b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame^] | 1 | /** |
| 2 | **************************************************************************************** |
| 3 | * |
| 4 | * @file rwnx_testmode.h |
| 5 | * |
| 6 | * @brief Test mode function declarations |
| 7 | * |
| 8 | * Copyright (C) RivieraWaves 2012-2019 |
| 9 | * |
| 10 | **************************************************************************************** |
| 11 | */ |
| 12 | |
| 13 | #ifndef RWNX_TESTMODE_H_ |
| 14 | #define RWNX_TESTMODE_H_ |
| 15 | |
| 16 | #include <net/mac80211.h> |
| 17 | #include <net/netlink.h> |
| 18 | |
| 19 | /* Commands from user space to kernel space(RWNX_TM_CMD_APP2DEV_XX) and |
| 20 | * from and kernel space to user space(RWNX_TM_CMD_DEV2APP_XX). |
| 21 | * The command ID is carried with RWNX_TM_ATTR_COMMAND. |
| 22 | */ |
| 23 | enum rwnx_tm_cmd_t { |
| 24 | /* commands from user application to access register */ |
| 25 | RWNX_TM_CMD_APP2DEV_REG_READ = 1, |
| 26 | RWNX_TM_CMD_APP2DEV_REG_WRITE, |
| 27 | |
| 28 | /* commands from user application to select the Debug levels */ |
| 29 | RWNX_TM_CMD_APP2DEV_SET_DBGMODFILTER, |
| 30 | RWNX_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 | RWNX_TM_CMD_APP2DEV_REG_READ_DBG, |
| 35 | RWNX_TM_CMD_APP2DEV_REG_WRITE_DBG, |
| 36 | |
| 37 | RWNX_TM_CMD_MAX, |
| 38 | }; |
| 39 | |
| 40 | enum rwnx_tm_attr_t { |
| 41 | RWNX_TM_ATTR_NOT_APPLICABLE = 0, |
| 42 | |
| 43 | RWNX_TM_ATTR_COMMAND, |
| 44 | |
| 45 | /* When RWNX_TM_ATTR_COMMAND is RWNX_TM_CMD_APP2DEV_REG_XXX, |
| 46 | * The mandatory fields are: |
| 47 | * RWNX_TM_ATTR_REG_OFFSET for the offset of the target register; |
| 48 | * RWNX_TM_ATTR_REG_VALUE32 for value */ |
| 49 | RWNX_TM_ATTR_REG_OFFSET, |
| 50 | RWNX_TM_ATTR_REG_VALUE32, |
| 51 | |
| 52 | /* When RWNX_TM_ATTR_COMMAND is RWNX_TM_CMD_APP2DEV_SET_DBGXXXFILTER, |
| 53 | * The mandatory field is RWNX_TM_ATTR_REG_FILTER. */ |
| 54 | RWNX_TM_ATTR_REG_FILTER, |
| 55 | |
| 56 | RWNX_TM_ATTR_MAX, |
| 57 | }; |
| 58 | |
| 59 | /***********************************************************************/ |
| 60 | int rwnx_testmode_reg(struct ieee80211_hw *hw, struct nlattr **tb); |
| 61 | int rwnx_testmode_dbg_filter(struct ieee80211_hw *hw, struct nlattr **tb); |
| 62 | int rwnx_testmode_reg_dbg(struct ieee80211_hw *hw, struct nlattr **tb); |
| 63 | |
| 64 | #endif /* RWNX_TESTMODE_H_ */ |