aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging
diff options
context:
space:
mode:
authorMike McCormack <mikem@ring3k.org>2011-03-10 08:40:53 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2011-03-14 15:24:48 -0400
commit83970d9ba1768f1b9ad6c154872cbc08f89da062 (patch)
tree926bdc6c8d3fa96490d2744d55e852c6433b87bc /drivers/staging
parentef8efe5b2dd70f48efcb5b34b0d5cf73df99b32b (diff)
staging: rtl8192e: Pass priv to cmdpkt functions
Signed-off-by: Mike McCormack <mikem@ring3k.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/rtl8192e/r8192E.h2
-rw-r--r--drivers/staging/rtl8192e/r8192E_dm.c3
-rw-r--r--drivers/staging/rtl8192e/r819xE_cmdpkt.c58
-rw-r--r--drivers/staging/rtl8192e/r819xE_cmdpkt.h2
4 files changed, 20 insertions, 45 deletions
diff --git a/drivers/staging/rtl8192e/r8192E.h b/drivers/staging/rtl8192e/r8192E.h
index fc231a068fea..0229031d88d7 100644
--- a/drivers/staging/rtl8192e/r8192E.h
+++ b/drivers/staging/rtl8192e/r8192E.h
@@ -1127,7 +1127,7 @@ void EnableHWSecurityConfig8192(struct r8192_priv *priv);
1127void setKey(struct r8192_priv *priv, u8 EntryNo, u8 KeyIndex, u16 KeyType, 1127void setKey(struct r8192_priv *priv, u8 EntryNo, u8 KeyIndex, u16 KeyType,
1128 const u8 *MacAddr, u8 DefaultKey, u32 *KeyContent); 1128 const u8 *MacAddr, u8 DefaultKey, u32 *KeyContent);
1129void firmware_init_param(struct r8192_priv *priv); 1129void firmware_init_param(struct r8192_priv *priv);
1130RT_STATUS cmpk_message_handle_tx(struct net_device *dev, u8* codevirtualaddress, u32 packettype, u32 buffer_len); 1130RT_STATUS cmpk_message_handle_tx(struct r8192_priv *priv, u8 *codevirtualaddress, u32 packettype, u32 buffer_len);
1131 1131
1132#ifdef ENABLE_IPS 1132#ifdef ENABLE_IPS
1133void IPSEnter(struct r8192_priv *priv); 1133void IPSEnter(struct r8192_priv *priv);
diff --git a/drivers/staging/rtl8192e/r8192E_dm.c b/drivers/staging/rtl8192e/r8192E_dm.c
index 4ea50b8c57ca..688d29b55884 100644
--- a/drivers/staging/rtl8192e/r8192E_dm.c
+++ b/drivers/staging/rtl8192e/r8192E_dm.c
@@ -422,7 +422,6 @@ static const u8 CCKSwingTable_Ch14[CCK_Table_length][8] = {
422#define FW_Busy_Flag 0x13f 422#define FW_Busy_Flag 0x13f
423static void dm_TXPowerTrackingCallback_TSSI(struct r8192_priv *priv) 423static void dm_TXPowerTrackingCallback_TSSI(struct r8192_priv *priv)
424{ 424{
425 struct net_device *dev = priv->ieee80211->dev;
426 bool bHighpowerstate, viviflag = FALSE; 425 bool bHighpowerstate, viviflag = FALSE;
427 DCMD_TXCMD_T tx_cmd; 426 DCMD_TXCMD_T tx_cmd;
428 u8 powerlevelOFDM24G; 427 u8 powerlevelOFDM24G;
@@ -452,7 +451,7 @@ static void dm_TXPowerTrackingCallback_TSSI(struct r8192_priv *priv)
452 tx_cmd.Op = TXCMD_SET_TX_PWR_TRACKING; 451 tx_cmd.Op = TXCMD_SET_TX_PWR_TRACKING;
453 tx_cmd.Length = 4; 452 tx_cmd.Length = 4;
454 tx_cmd.Value = Value; 453 tx_cmd.Value = Value;
455 cmpk_message_handle_tx(dev, (u8*)&tx_cmd, DESC_PACKET_TYPE_INIT, sizeof(DCMD_TXCMD_T)); 454 cmpk_message_handle_tx(priv, (u8*)&tx_cmd, DESC_PACKET_TYPE_INIT, sizeof(DCMD_TXCMD_T));
456 mdelay(1); 455 mdelay(1);
457 456
458 for(i = 0;i <= 30; i++) 457 for(i = 0;i <= 30; i++)
diff --git a/drivers/staging/rtl8192e/r819xE_cmdpkt.c b/drivers/staging/rtl8192e/r819xE_cmdpkt.c
index f60396015df8..41dcb9026dd7 100644
--- a/drivers/staging/rtl8192e/r819xE_cmdpkt.c
+++ b/drivers/staging/rtl8192e/r819xE_cmdpkt.c
@@ -33,14 +33,13 @@
33 * run time. We do not support message more than one segment now. 33 * run time. We do not support message more than one segment now.
34 */ 34 */
35RT_STATUS cmpk_message_handle_tx( 35RT_STATUS cmpk_message_handle_tx(
36 struct net_device *dev, 36 struct r8192_priv *priv,
37 u8* code_virtual_address, 37 u8* code_virtual_address,
38 u32 packettype, 38 u32 packettype,
39 u32 buffer_len) 39 u32 buffer_len)
40{ 40{
41 41 struct net_device *dev = priv->ieee80211->dev;
42 RT_STATUS rt_status = RT_STATUS_SUCCESS; 42 RT_STATUS rt_status = RT_STATUS_SUCCESS;
43 struct r8192_priv *priv = ieee80211_priv(dev);
44 u16 frag_threshold; 43 u16 frag_threshold;
45 u16 frag_length = 0, frag_offset = 0; 44 u16 frag_length = 0, frag_offset = 0;
46 rt_firmware *pfirmware = priv->pFirmware; 45 rt_firmware *pfirmware = priv->pFirmware;
@@ -115,12 +114,8 @@ Failed:
115 return rt_status; 114 return rt_status;
116} 115}
117 116
118static void 117static void cmpk_count_txstatistic(struct r8192_priv *priv, cmpk_txfb_t *pstx_fb)
119cmpk_count_txstatistic(
120 struct net_device *dev,
121 cmpk_txfb_t *pstx_fb)
122{ 118{
123 struct r8192_priv *priv = ieee80211_priv(dev);
124#ifdef ENABLE_PS 119#ifdef ENABLE_PS
125 RT_RF_POWER_STATE rtState; 120 RT_RF_POWER_STATE rtState;
126 121
@@ -163,19 +158,15 @@ cmpk_count_txstatistic(
163 * refer to chapter "TX Feedback Element". We have to read 20 bytes 158 * refer to chapter "TX Feedback Element". We have to read 20 bytes
164 * in the command packet. 159 * in the command packet.
165 */ 160 */
166static void 161static void cmpk_handle_tx_feedback(struct r8192_priv *priv, u8 *pmsg)
167cmpk_handle_tx_feedback(
168 struct net_device *dev,
169 u8 * pmsg)
170{ 162{
171 struct r8192_priv *priv = ieee80211_priv(dev);
172 cmpk_txfb_t rx_tx_fb; /* */ 163 cmpk_txfb_t rx_tx_fb; /* */
173 164
174 priv->stats.txfeedback++; 165 priv->stats.txfeedback++;
175 166
176 memcpy((u8*)&rx_tx_fb, pmsg, sizeof(cmpk_txfb_t)); 167 memcpy((u8*)&rx_tx_fb, pmsg, sizeof(cmpk_txfb_t));
177 /* Use tx feedback info to count TX statistics. */ 168 /* Use tx feedback info to count TX statistics. */
178 cmpk_count_txstatistic(dev, &rx_tx_fb); 169 cmpk_count_txstatistic(priv, &rx_tx_fb);
179} 170}
180 171
181 172
@@ -185,13 +176,9 @@ cmpk_handle_tx_feedback(
185 * ws-07-0063-v06-rtl819x-command-packet-specification-070315.doc. 176 * ws-07-0063-v06-rtl819x-command-packet-specification-070315.doc.
186 * Please refer to chapter "Interrupt Status Element". 177 * Please refer to chapter "Interrupt Status Element".
187 */ 178 */
188static void 179static void cmpk_handle_interrupt_status(struct r8192_priv *priv, u8 *pmsg)
189cmpk_handle_interrupt_status(
190 struct net_device *dev,
191 u8* pmsg)
192{ 180{
193 cmpk_intr_sta_t rx_intr_status; /* */ 181 cmpk_intr_sta_t rx_intr_status; /* */
194 struct r8192_priv *priv = ieee80211_priv(dev);
195 182
196 DMESG("---> cmpk_Handle_Interrupt_Status()\n"); 183 DMESG("---> cmpk_Handle_Interrupt_Status()\n");
197 184
@@ -244,10 +231,7 @@ cmpk_handle_interrupt_status(
244 * ws-06-0063-rtl8190-command-packet-specification. Please 231 * ws-06-0063-rtl8190-command-packet-specification. Please
245 * refer to chapter "Beacon State Element". 232 * refer to chapter "Beacon State Element".
246 */ 233 */
247static void 234static void cmpk_handle_query_config_rx(struct r8192_priv *priv, u8 *pmsg)
248cmpk_handle_query_config_rx(
249 struct net_device *dev,
250 u8* pmsg)
251{ 235{
252 cmpk_query_cfg_t rx_query_cfg; /* */ 236 cmpk_query_cfg_t rx_query_cfg; /* */
253 237
@@ -277,10 +261,8 @@ cmpk_handle_query_config_rx(
277 * Count aggregated tx status from firmwar of one type rx command 261 * Count aggregated tx status from firmwar of one type rx command
278 * packet element id = RX_TX_STATUS. 262 * packet element id = RX_TX_STATUS.
279 */ 263 */
280static void cmpk_count_tx_status( struct net_device *dev, 264static void cmpk_count_tx_status(struct r8192_priv *priv, cmpk_tx_status_t *pstx_status)
281 cmpk_tx_status_t *pstx_status)
282{ 265{
283 struct r8192_priv *priv = ieee80211_priv(dev);
284 266
285#ifdef ENABLE_PS 267#ifdef ENABLE_PS
286 268
@@ -309,25 +291,19 @@ static void cmpk_count_tx_status( struct net_device *dev,
309 * Firmware add a new tx feedback status to reduce rx command 291 * Firmware add a new tx feedback status to reduce rx command
310 * packet buffer operation load. 292 * packet buffer operation load.
311 */ 293 */
312static void 294static void cmpk_handle_tx_status(struct r8192_priv *priv, u8 *pmsg)
313cmpk_handle_tx_status(
314 struct net_device *dev,
315 u8* pmsg)
316{ 295{
317 cmpk_tx_status_t rx_tx_sts; /* */ 296 cmpk_tx_status_t rx_tx_sts; /* */
318 297
319 memcpy((void*)&rx_tx_sts, (void*)pmsg, sizeof(cmpk_tx_status_t)); 298 memcpy((void*)&rx_tx_sts, (void*)pmsg, sizeof(cmpk_tx_status_t));
320 /* 2. Use tx feedback info to count TX statistics. */ 299 /* 2. Use tx feedback info to count TX statistics. */
321 cmpk_count_tx_status(dev, &rx_tx_sts); 300 cmpk_count_tx_status(priv, &rx_tx_sts);
322 301
323} 302}
324 303
325 304
326/* Firmware add a new tx rate history */ 305/* Firmware add a new tx rate history */
327static void 306static void cmpk_handle_tx_rate_history(struct r8192_priv *priv, u8 *pmsg)
328cmpk_handle_tx_rate_history(
329 struct net_device *dev,
330 u8* pmsg)
331{ 307{
332 u8 i; 308 u8 i;
333 u16 length = sizeof(cmpk_tx_rahis_t); 309 u16 length = sizeof(cmpk_tx_rahis_t);
@@ -369,7 +345,7 @@ cmpk_handle_tx_rate_history(
369 * command packet now. Please refer to document 345 * command packet now. Please refer to document
370 * ws-06-0063-rtl8190-command-packet-specification. 346 * ws-06-0063-rtl8190-command-packet-specification.
371 */ 347 */
372u32 cmpk_message_handle_rx(struct net_device *dev, struct ieee80211_rx_stats *pstats) 348u32 cmpk_message_handle_rx(struct r8192_priv *priv, struct ieee80211_rx_stats *pstats)
373{ 349{
374// u32 debug_level = DBG_LOUD; 350// u32 debug_level = DBG_LOUD;
375 int total_length; 351 int total_length;
@@ -414,28 +390,28 @@ u32 cmpk_message_handle_rx(struct net_device *dev, struct ieee80211_rx_stats *ps
414 case RX_TX_FEEDBACK: 390 case RX_TX_FEEDBACK:
415 391
416 RT_TRACE(COMP_EVENTS, "---->cmpk_message_handle_rx():RX_TX_FEEDBACK\n"); 392 RT_TRACE(COMP_EVENTS, "---->cmpk_message_handle_rx():RX_TX_FEEDBACK\n");
417 cmpk_handle_tx_feedback (dev, pcmd_buff); 393 cmpk_handle_tx_feedback(priv, pcmd_buff);
418 cmd_length = CMPK_RX_TX_FB_SIZE; 394 cmd_length = CMPK_RX_TX_FB_SIZE;
419 break; 395 break;
420 396
421 case RX_INTERRUPT_STATUS: 397 case RX_INTERRUPT_STATUS:
422 398
423 RT_TRACE(COMP_EVENTS, "---->cmpk_message_handle_rx():RX_INTERRUPT_STATUS\n"); 399 RT_TRACE(COMP_EVENTS, "---->cmpk_message_handle_rx():RX_INTERRUPT_STATUS\n");
424 cmpk_handle_interrupt_status(dev, pcmd_buff); 400 cmpk_handle_interrupt_status(priv, pcmd_buff);
425 cmd_length = sizeof(cmpk_intr_sta_t); 401 cmd_length = sizeof(cmpk_intr_sta_t);
426 break; 402 break;
427 403
428 case BOTH_QUERY_CONFIG: 404 case BOTH_QUERY_CONFIG:
429 405
430 RT_TRACE(COMP_EVENTS, "---->cmpk_message_handle_rx():BOTH_QUERY_CONFIG\n"); 406 RT_TRACE(COMP_EVENTS, "---->cmpk_message_handle_rx():BOTH_QUERY_CONFIG\n");
431 cmpk_handle_query_config_rx(dev, pcmd_buff); 407 cmpk_handle_query_config_rx(priv, pcmd_buff);
432 cmd_length = CMPK_BOTH_QUERY_CONFIG_SIZE; 408 cmd_length = CMPK_BOTH_QUERY_CONFIG_SIZE;
433 break; 409 break;
434 410
435 case RX_TX_STATUS: 411 case RX_TX_STATUS:
436 412
437 RT_TRACE(COMP_EVENTS, "---->cmpk_message_handle_rx():RX_TX_STATUS\n"); 413 RT_TRACE(COMP_EVENTS, "---->cmpk_message_handle_rx():RX_TX_STATUS\n");
438 cmpk_handle_tx_status(dev, pcmd_buff); 414 cmpk_handle_tx_status(priv, pcmd_buff);
439 cmd_length = CMPK_RX_TX_STS_SIZE; 415 cmd_length = CMPK_RX_TX_STS_SIZE;
440 break; 416 break;
441 417
@@ -451,7 +427,7 @@ u32 cmpk_message_handle_rx(struct net_device *dev, struct ieee80211_rx_stats *ps
451 //DbgPrint(" rx tx rate history\r\n"); 427 //DbgPrint(" rx tx rate history\r\n");
452 428
453 RT_TRACE(COMP_EVENTS, "---->cmpk_message_handle_rx():RX_TX_HISTORY\n"); 429 RT_TRACE(COMP_EVENTS, "---->cmpk_message_handle_rx():RX_TX_HISTORY\n");
454 cmpk_handle_tx_rate_history(dev, pcmd_buff); 430 cmpk_handle_tx_rate_history(priv, pcmd_buff);
455 cmd_length = CMPK_TX_RAHIS_SIZE; 431 cmd_length = CMPK_TX_RAHIS_SIZE;
456 break; 432 break;
457 433
diff --git a/drivers/staging/rtl8192e/r819xE_cmdpkt.h b/drivers/staging/rtl8192e/r819xE_cmdpkt.h
index 8d705ce4da12..312e4f84dedb 100644
--- a/drivers/staging/rtl8192e/r819xE_cmdpkt.h
+++ b/drivers/staging/rtl8192e/r819xE_cmdpkt.h
@@ -201,7 +201,7 @@ typedef enum tag_command_packet_directories
201 RX_CMD_ELE_MAX 201 RX_CMD_ELE_MAX
202}cmpk_element_e; 202}cmpk_element_e;
203 203
204u32 cmpk_message_handle_rx(struct net_device *dev, struct ieee80211_rx_stats * pstats); 204u32 cmpk_message_handle_rx(struct r8192_priv *priv, struct ieee80211_rx_stats *pstats);
205 205
206 206
207#endif 207#endif