aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWey-Yi Guy <wey-yi.w.guy@intel.com>2011-06-24 12:02:44 -0400
committerWey-Yi Guy <wey-yi.w.guy@intel.com>2011-07-01 10:46:32 -0400
commit4466320f053bb9aa1d68f73d92cb8d6c5bd75b1c (patch)
treeae889a71a7bf4214b1a75cbe71e5629666101384
parent98a648e10a3c4eb30f8043281345506e17ace007 (diff)
iwlagn: re-define the testmode cmd and attr enum
To make sure not having issues when adding new testmode commands or attributes in the future, re-define the enum. no functional changes Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-testmode.h236
1 files changed, 132 insertions, 104 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-testmode.h b/drivers/net/wireless/iwlwifi/iwl-testmode.h
index 160911a3716..d825188e521 100644
--- a/drivers/net/wireless/iwlwifi/iwl-testmode.h
+++ b/drivers/net/wireless/iwlwifi/iwl-testmode.h
@@ -66,116 +66,144 @@
66#include <linux/types.h> 66#include <linux/types.h>
67 67
68 68
69/* Commands from user space to kernel space(IWL_TM_CMD_ID_APP2DEV_XX) and 69/*
70 * Commands from user space to kernel space(IWL_TM_CMD_ID_APP2DEV_XX) and
70 * from and kernel space to user space(IWL_TM_CMD_ID_DEV2APP_XX). 71 * from and kernel space to user space(IWL_TM_CMD_ID_DEV2APP_XX).
71 * The command ID is carried with IWL_TM_ATTR_COMMAND. There are three types of 72 * The command ID is carried with IWL_TM_ATTR_COMMAND.
72 * of command from user space and two types of command from kernel space. 73 *
73 * See below. 74 * @IWL_TM_CMD_APP2DEV_UCODE:
75 * commands from user application to the uCode,
76 * the actual uCode host command ID is carried with
77 * IWL_TM_ATTR_UCODE_CMD_ID
78 *
79 * @IWL_TM_CMD_APP2DEV_REG_READ32:
80 * @IWL_TM_CMD_APP2DEV_REG_WRITE32:
81 * @IWL_TM_CMD_APP2DEV_REG_WRITE8:
82 * commands from user applicaiton to access register
83 *
84 * @IWL_TM_CMD_APP2DEV_GET_DEVICENAME: retrieve device name
85 * @IWL_TM_CMD_APP2DEV_LOAD_INIT_FW: load initial uCode image
86 * @IWL_TM_CMD_APP2DEV_CFG_INIT_CALIB: perform calibration
87 * @IWL_TM_CMD_APP2DEV_LOAD_RUNTIME_FW: load runtime uCode image
88 * @IWL_TM_CMD_APP2DEV_GET_EEPROM: request EEPROM data
89 * @IWL_TM_CMD_APP2DEV_FIXRATE_REQ: set fix MCS
90 * commands fom user space for pure driver level operations
91 *
92 * @IWL_TM_CMD_APP2DEV_BEGIN_TRACE:
93 * @IWL_TM_CMD_APP2DEV_END_TRACE:
94 * @IWL_TM_CMD_APP2DEV_READ_TRACE:
95 * commands fom user space for uCode trace operations
96 *
97 * @IWL_TM_CMD_DEV2APP_SYNC_RSP:
98 * commands from kernel space to carry the synchronous response
99 * to user application
100 * @IWL_TM_CMD_DEV2APP_UCODE_RX_PKT:
101 * commands from kernel space to multicast the spontaneous messages
102 * to user application
103 * @IWL_TM_CMD_DEV2APP_EEPROM_RSP:
104 * commands from kernel space to carry the eeprom response
105 * to user application
74 */ 106 */
75enum iwl_tm_cmd_t { 107enum iwl_tm_cmd_t {
76 /* commands from user application to the uCode, 108 IWL_TM_CMD_APP2DEV_UCODE = 1,
77 * the actual uCode host command ID is carried with 109 IWL_TM_CMD_APP2DEV_REG_READ32 = 2,
78 * IWL_TM_ATTR_UCODE_CMD_ID */ 110 IWL_TM_CMD_APP2DEV_REG_WRITE32 = 3,
79 IWL_TM_CMD_APP2DEV_UCODE = 1, 111 IWL_TM_CMD_APP2DEV_REG_WRITE8 = 4,
80 112 IWL_TM_CMD_APP2DEV_GET_DEVICENAME = 5,
81 /* commands from user applicaiton to access register */ 113 IWL_TM_CMD_APP2DEV_LOAD_INIT_FW = 6,
82 IWL_TM_CMD_APP2DEV_REG_READ32, 114 IWL_TM_CMD_APP2DEV_CFG_INIT_CALIB = 7,
83 IWL_TM_CMD_APP2DEV_REG_WRITE32, 115 IWL_TM_CMD_APP2DEV_LOAD_RUNTIME_FW = 8,
84 IWL_TM_CMD_APP2DEV_REG_WRITE8, 116 IWL_TM_CMD_APP2DEV_GET_EEPROM = 9,
85 117 IWL_TM_CMD_APP2DEV_FIXRATE_REQ = 10,
86 /* commands fom user space for pure driver level operations */ 118 IWL_TM_CMD_APP2DEV_BEGIN_TRACE = 11,
87 IWL_TM_CMD_APP2DEV_GET_DEVICENAME, 119 IWL_TM_CMD_APP2DEV_END_TRACE = 12,
88 IWL_TM_CMD_APP2DEV_LOAD_INIT_FW, 120 IWL_TM_CMD_APP2DEV_READ_TRACE = 13,
89 IWL_TM_CMD_APP2DEV_CFG_INIT_CALIB, 121 IWL_TM_CMD_DEV2APP_SYNC_RSP = 14,
90 IWL_TM_CMD_APP2DEV_LOAD_RUNTIME_FW, 122 IWL_TM_CMD_DEV2APP_UCODE_RX_PKT = 15,
91 IWL_TM_CMD_APP2DEV_GET_EEPROM, 123 IWL_TM_CMD_DEV2APP_EEPROM_RSP = 16,
92 IWL_TM_CMD_APP2DEV_FIXRATE_REQ, 124 IWL_TM_CMD_MAX = 17,
93 /* if there is other new command for the driver layer operation,
94 * append them here */
95
96 /* commands fom user space for uCode trace operations */
97 IWL_TM_CMD_APP2DEV_BEGIN_TRACE,
98 IWL_TM_CMD_APP2DEV_END_TRACE,
99 IWL_TM_CMD_APP2DEV_READ_TRACE,
100
101 /* commands from kernel space to carry the synchronous response
102 * to user application */
103 IWL_TM_CMD_DEV2APP_SYNC_RSP,
104
105 /* commands from kernel space to multicast the spontaneous messages
106 * to user application */
107 IWL_TM_CMD_DEV2APP_UCODE_RX_PKT,
108
109 /* commands from kernel space to carry the eeprom response
110 * to user application */
111 IWL_TM_CMD_DEV2APP_EEPROM_RSP,
112
113 IWL_TM_CMD_MAX,
114}; 125};
115 126
127/*
128 * Atrribute filed in testmode command
129 * See enum iwl_tm_cmd_t.
130 *
131 * @IWL_TM_ATTR_NOT_APPLICABLE:
132 * The attribute is not applicable or invalid
133 * @IWL_TM_ATTR_COMMAND:
134 * From user space to kernel space:
135 * the command either destines to ucode, driver, or register;
136 * From kernel space to user space:
137 * the command either carries synchronous response,
138 * or the spontaneous message multicast from the device;
139 *
140 * @IWL_TM_ATTR_UCODE_CMD_ID:
141 * @IWL_TM_ATTR_UCODE_CMD_DATA:
142 * When IWL_TM_ATTR_COMMAND is IWL_TM_CMD_APP2DEV_UCODE,
143 * The mandatory fields are :
144 * IWL_TM_ATTR_UCODE_CMD_ID for recognizable command ID;
145 * IWL_TM_ATTR_COMMAND_FLAG for the flags of the commands;
146 * The optional fields are:
147 * IWL_TM_ATTR_UCODE_CMD_DATA for the actual command payload
148 * to the ucode
149 *
150 * @IWL_TM_ATTR_REG_OFFSET:
151 * @IWL_TM_ATTR_REG_VALUE8:
152 * @IWL_TM_ATTR_REG_VALUE32:
153 * When IWL_TM_ATTR_COMMAND is IWL_TM_CMD_APP2DEV_REG_XXX,
154 * The mandatory fields are:
155 * IWL_TM_ATTR_REG_OFFSET for the offset of the target register;
156 * IWL_TM_ATTR_REG_VALUE8 or IWL_TM_ATTR_REG_VALUE32 for value
157 *
158 * @IWL_TM_ATTR_SYNC_RSP:
159 * When IWL_TM_ATTR_COMMAND is IWL_TM_CMD_DEV2APP_SYNC_RSP,
160 * The mandatory fields are:
161 * IWL_TM_ATTR_SYNC_RSP for the data content responding to the user
162 * application command
163 *
164 * @IWL_TM_ATTR_UCODE_RX_PKT:
165 * When IWL_TM_ATTR_COMMAND is IWL_TM_CMD_DEV2APP_UCODE_RX_PKT,
166 * The mandatory fields are:
167 * IWL_TM_ATTR_UCODE_RX_PKT for the data content multicast to the user
168 * application
169 *
170 * @IWL_TM_ATTR_EEPROM:
171 * When IWL_TM_ATTR_COMMAND is IWL_TM_CMD_DEV2APP_EEPROM,
172 * The mandatory fields are:
173 * IWL_TM_ATTR_EEPROM for the data content responging to the user
174 * application
175 *
176 * @IWL_TM_ATTR_TRACE_ADDR:
177 * @IWL_TM_ATTR_TRACE_SIZE:
178 * @IWL_TM_ATTR_TRACE_DUMP:
179 * When IWL_TM_ATTR_COMMAND is IWL_TM_CMD_APP2DEV_XXX_TRACE,
180 * The mandatory fields are:
181 * IWL_TM_ATTR_MEM_TRACE_ADDR for the trace address
182 * IWL_TM_ATTR_MEM_TRACE_SIZE for the trace buffer size
183 * IWL_TM_ATTR_MEM_TRACE_DUMP for the trace dump
184 *
185 * @IWL_TM_ATTR_FIXRATE:
186 * When IWL_TM_ATTR_COMMAND is IWL_TM_CMD_APP2DEV_FIXRATE_REQ,
187 * The mandatory fields are:
188 * IWL_TM_ATTR_FIXRATE for the fixed rate
189 *
190 */
116enum iwl_tm_attr_t { 191enum iwl_tm_attr_t {
117 IWL_TM_ATTR_NOT_APPLICABLE = 0, 192 IWL_TM_ATTR_NOT_APPLICABLE = 0,
118 193 IWL_TM_ATTR_COMMAND = 1,
119 /* From user space to kernel space: 194 IWL_TM_ATTR_UCODE_CMD_ID = 2,
120 * the command either destines to ucode, driver, or register; 195 IWL_TM_ATTR_UCODE_CMD_DATA = 3,
121 * See enum iwl_tm_cmd_t. 196 IWL_TM_ATTR_REG_OFFSET = 4,
122 * 197 IWL_TM_ATTR_REG_VALUE8 = 5,
123 * From kernel space to user space: 198 IWL_TM_ATTR_REG_VALUE32 = 6,
124 * the command either carries synchronous response, 199 IWL_TM_ATTR_SYNC_RSP = 7,
125 * or the spontaneous message multicast from the device; 200 IWL_TM_ATTR_UCODE_RX_PKT = 8,
126 * See enum iwl_tm_cmd_t. */ 201 IWL_TM_ATTR_EEPROM = 9,
127 IWL_TM_ATTR_COMMAND, 202 IWL_TM_ATTR_TRACE_ADDR = 10,
128 203 IWL_TM_ATTR_TRACE_SIZE = 11,
129 /* When IWL_TM_ATTR_COMMAND is IWL_TM_CMD_APP2DEV_UCODE, 204 IWL_TM_ATTR_TRACE_DUMP = 12,
130 * The mandatory fields are : 205 IWL_TM_ATTR_FIXRATE = 13,
131 * IWL_TM_ATTR_UCODE_CMD_ID for recognizable command ID; 206 IWL_TM_ATTR_MAX = 14,
132 * IWL_TM_ATTR_COMMAND_FLAG for the flags of the commands;
133 * The optional fields are:
134 * IWL_TM_ATTR_UCODE_CMD_DATA for the actual command payload
135 * to the ucode */
136 IWL_TM_ATTR_UCODE_CMD_ID,
137 IWL_TM_ATTR_UCODE_CMD_DATA,
138
139 /* When IWL_TM_ATTR_COMMAND is IWL_TM_CMD_APP2DEV_REG_XXX,
140 * The mandatory fields are:
141 * IWL_TM_ATTR_REG_OFFSET for the offset of the target register;
142 * IWL_TM_ATTR_REG_VALUE8 or IWL_TM_ATTR_REG_VALUE32 for value */
143 IWL_TM_ATTR_REG_OFFSET,
144 IWL_TM_ATTR_REG_VALUE8,
145 IWL_TM_ATTR_REG_VALUE32,
146
147 /* When IWL_TM_ATTR_COMMAND is IWL_TM_CMD_DEV2APP_SYNC_RSP,
148 * The mandatory fields are:
149 * IWL_TM_ATTR_SYNC_RSP for the data content responding to the user
150 * application command */
151 IWL_TM_ATTR_SYNC_RSP,
152 /* When IWL_TM_ATTR_COMMAND is IWL_TM_CMD_DEV2APP_UCODE_RX_PKT,
153 * The mandatory fields are:
154 * IWL_TM_ATTR_UCODE_RX_PKT for the data content multicast to the user
155 * application */
156 IWL_TM_ATTR_UCODE_RX_PKT,
157
158 /* When IWL_TM_ATTR_COMMAND is IWL_TM_CMD_DEV2APP_EEPROM,
159 * The mandatory fields are:
160 * IWL_TM_ATTR_EEPROM for the data content responging to the user
161 * application */
162 IWL_TM_ATTR_EEPROM,
163
164 /* When IWL_TM_ATTR_COMMAND is IWL_TM_CMD_APP2DEV_XXX_TRACE,
165 * The mandatory fields are:
166 * IWL_TM_ATTR_MEM_TRACE_ADDR for the trace address
167 */
168 IWL_TM_ATTR_TRACE_ADDR,
169 IWL_TM_ATTR_TRACE_SIZE,
170 IWL_TM_ATTR_TRACE_DUMP,
171
172 /* When IWL_TM_ATTR_COMMAND is IWL_TM_CMD_APP2DEV_FIXRATE_REQ,
173 * The mandatory fields are:
174 * IWL_TM_ATTR_FIXRATE for the fixed rate
175 */
176 IWL_TM_ATTR_FIXRATE,
177
178 IWL_TM_ATTR_MAX,
179}; 207};
180 208
181/* uCode trace buffer */ 209/* uCode trace buffer */