2 ****************************************************************************************
4 * @file ecrnx_testmode.h
6 * @brief Test mode function declarations
8 * Copyright (C) ESWIN 2015-2020
10 ****************************************************************************************
13 #ifndef ECRNX_TESTMODE_H_
14 #define ECRNX_TESTMODE_H_
16 #include <net/mac80211.h>
17 #include <net/netlink.h>
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.
24 /* commands from user application to access register */
25 ECRNX_TM_CMD_APP2DEV_REG_READ = 1,
26 ECRNX_TM_CMD_APP2DEV_REG_WRITE,
28 /* commands from user application to select the Debug levels */
29 ECRNX_TM_CMD_APP2DEV_SET_DBGMODFILTER,
30 ECRNX_TM_CMD_APP2DEV_SET_DBGSEVFILTER,
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,
40 enum ecrnx_tm_attr_t {
41 ECRNX_TM_ATTR_NOT_APPLICABLE = 0,
43 ECRNX_TM_ATTR_COMMAND,
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,
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,
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);
64 #endif /* ECRNX_TESTMODE_H_ */