File: adminq.c

package info (click to toggle)
linux 6.17.10-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,734,900 kB
  • sloc: ansic: 26,684,436; asm: 271,195; sh: 147,406; python: 75,980; makefile: 57,306; perl: 36,943; xml: 19,562; cpp: 5,899; yacc: 4,909; lex: 2,943; awk: 1,556; sed: 29; ruby: 25
file content (52 lines) | stat: -rw-r--r-- 1,286 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// SPDX-License-Identifier: GPL-2.0-only
/* Copyright (C) 2025 Intel Corporation */

#include <linux/module.h>
#include <linux/net/intel/libie/adminq.h>

static const char * const libie_aq_str_arr[] = {
#define LIBIE_AQ_STR(x)					\
	[LIBIE_AQ_RC_##x]	= "LIBIE_AQ_RC_" #x
	LIBIE_AQ_STR(OK),
	LIBIE_AQ_STR(EPERM),
	LIBIE_AQ_STR(ENOENT),
	LIBIE_AQ_STR(ESRCH),
	LIBIE_AQ_STR(EIO),
	LIBIE_AQ_STR(EAGAIN),
	LIBIE_AQ_STR(ENOMEM),
	LIBIE_AQ_STR(EACCES),
	LIBIE_AQ_STR(EBUSY),
	LIBIE_AQ_STR(EEXIST),
	LIBIE_AQ_STR(EINVAL),
	LIBIE_AQ_STR(ENOSPC),
	LIBIE_AQ_STR(ENOSYS),
	LIBIE_AQ_STR(EMODE),
	LIBIE_AQ_STR(ENOSEC),
	LIBIE_AQ_STR(EBADSIG),
	LIBIE_AQ_STR(ESVN),
	LIBIE_AQ_STR(EBADMAN),
	LIBIE_AQ_STR(EBADBUF),
#undef LIBIE_AQ_STR
	"LIBIE_AQ_RC_UNKNOWN",
};

#define __LIBIE_AQ_STR_NUM (ARRAY_SIZE(libie_aq_str_arr) - 1)

/**
 * libie_aq_str - get error string based on aq error
 * @err: admin queue error type
 *
 * Return: error string for passed error code
 */
const char *libie_aq_str(enum libie_aq_err err)
{
	if (err >= ARRAY_SIZE(libie_aq_str_arr) ||
	    !libie_aq_str_arr[err])
		err = __LIBIE_AQ_STR_NUM;

	return libie_aq_str_arr[err];
}
EXPORT_SYMBOL_NS_GPL(libie_aq_str, "LIBIE_ADMINQ");

MODULE_DESCRIPTION("Intel(R) Ethernet common library - adminq helpers");
MODULE_LICENSE("GPL");