net:wireless:Support eswin usb wifi ECR6600U
[platform/kernel/linux-starfive.git] / drivers / net / wireless / eswin / ecrnx_testmode.h
1 /**
2  ****************************************************************************************
3  *
4  * @file ecrnx_testmode.h
5  *
6  * @brief Test mode function declarations
7  *
8  * Copyright (C) ESWIN 2015-2020
9  *
10  ****************************************************************************************
11  */
12
13 #ifndef ECRNX_TESTMODE_H_
14 #define ECRNX_TESTMODE_H_
15
16 #include <net/mac80211.h>
17 #include <net/netlink.h>
18
19 /* Commands from user space to kernel space(ECRNX_TM_CMD_APP2DEV_XX) and
20  * from and kernel space to user space(ECRNX_TM_CMD_DEV2APP_XX).
21  * The command ID is carried with ECRNX_TM_ATTR_COMMAND.
22  */
23 enum ecrnx_tm_cmd_t {
24     /* commands from user application to access register */
25     ECRNX_TM_CMD_APP2DEV_REG_READ = 1,
26     ECRNX_TM_CMD_APP2DEV_REG_WRITE,
27
28     /* commands from user application to select the Debug levels */
29     ECRNX_TM_CMD_APP2DEV_SET_DBGMODFILTER,
30     ECRNX_TM_CMD_APP2DEV_SET_DBGSEVFILTER,
31
32     /* commands to access registers without sending messages to LMAC layer,
33      * this must be used when LMAC FW is stuck. */
34     ECRNX_TM_CMD_APP2DEV_REG_READ_DBG,
35     ECRNX_TM_CMD_APP2DEV_REG_WRITE_DBG,
36
37     ECRNX_TM_CMD_MAX,
38 };
39
40 enum ecrnx_tm_attr_t {
41     ECRNX_TM_ATTR_NOT_APPLICABLE = 0,
42
43     ECRNX_TM_ATTR_COMMAND,
44
45     /* When ECRNX_TM_ATTR_COMMAND is ECRNX_TM_CMD_APP2DEV_REG_XXX,
46      * The mandatory fields are:
47      * ECRNX_TM_ATTR_REG_OFFSET for the offset of the target register;
48      * ECRNX_TM_ATTR_REG_VALUE32 for value */
49     ECRNX_TM_ATTR_REG_OFFSET,
50     ECRNX_TM_ATTR_REG_VALUE32,
51
52     /* When ECRNX_TM_ATTR_COMMAND is ECRNX_TM_CMD_APP2DEV_SET_DBGXXXFILTER,
53      * The mandatory field is ECRNX_TM_ATTR_REG_FILTER. */
54     ECRNX_TM_ATTR_REG_FILTER,
55
56     ECRNX_TM_ATTR_MAX,
57 };
58
59 /***********************************************************************/
60 int ecrnx_testmode_reg(struct ieee80211_hw *hw, struct nlattr **tb);
61 int ecrnx_testmode_dbg_filter(struct ieee80211_hw *hw, struct nlattr **tb);
62 int ecrnx_testmode_reg_dbg(struct ieee80211_hw *hw, struct nlattr **tb);
63
64 #endif /* ECRNX_TESTMODE_H_ */