1 /******************************************************************************
3 (c) Copyright 2008, RealTEK Technologies Inc. All Rights Reserved.
5 Module: r819xusb_cmdpkt.c (RTL8190 TX/RX command packet handler Source C File)
7 Note: The module is responsible for handling TX and RX command packet.
8 1. TX : Send set and query configuration command packet.
9 2. RX : Receive tx feedback, beacon state, query configuration
21 05/06/2008 amy Create initial version porting from windows driver.
23 ******************************************************************************/
25 #include "r8192E_hw.h"
26 #include "r819xE_cmdpkt.h"
27 /*---------------------------Define Local Constant---------------------------*/
29 #define CMPK_DEBOUNCE_CNT 1
30 /* 2007/10/24 MH Add for printing a range of data. */
31 #define CMPK_PRINT(Address)\
36 memcpy(temp, Address, 40);\
37 for (i = 0; i <40; i+=4)\
38 printk("\r\n %08x", temp[i]);\
41 /*---------------------------Define functions---------------------------------*/
42 /*-----------------------------------------------------------------------------
43 * Function: cmpk_message_handle_tx()
45 * Overview: Driver internal module can call the API to send message to
46 * firmware side. For example, you can send a debug command packet.
47 * Or you can send a request for FW to modify RLX4181 LBUS HW bank.
48 * Otherwise, you can change MAC/PHT/RF register by firmware at
49 * run time. We do not support message more than one segment now.
59 * 05/06/2008 amy porting from windows code.
61 *---------------------------------------------------------------------------*/
62 extern RT_STATUS cmpk_message_handle_tx(
63 struct net_device *dev,
64 u8* code_virtual_address,
69 RT_STATUS rt_status = RT_STATUS_SUCCESS;
73 struct r8192_priv *priv = ieee80211_priv(dev);
75 u16 frag_length = 0, frag_offset = 0;
76 rt_firmware *pfirmware = priv->pFirmware;
78 unsigned char *seg_ptr;
82 PTX_FWINFO_8190PCI pTxFwInfo = NULL;
85 //spin_lock_irqsave(&priv->tx_lock,flags);
86 RT_TRACE(COMP_CMDPKT,"%s(),buffer_len is %d\n",__FUNCTION__,buffer_len);
87 firmware_init_param(dev);
88 //Fragmentation might be required
89 frag_threshold = pfirmware->cmdpacket_frag_thresold;
91 if((buffer_len - frag_offset) > frag_threshold) {
92 frag_length = frag_threshold ;
96 frag_length =(u16)(buffer_len - frag_offset);
101 /* Allocate skb buffer to contain firmware info and tx descriptor info
102 * add 4 to avoid packet appending overflow.
105 skb = dev_alloc_skb(USB_HWDESC_HEADER_LEN + frag_length + 4);
107 skb = dev_alloc_skb(frag_length + priv->ieee80211->tx_headroom + 4);
110 rt_status = RT_STATUS_FAILURE;
114 memcpy((unsigned char *)(skb->cb),&dev,sizeof(dev));
115 tcb_desc = (cb_desc*)(skb->cb + MAX_DEV_ADDR_SIZE);
116 tcb_desc->queue_index = TXCMD_QUEUE;
117 tcb_desc->bCmdOrInit = packettype;
118 tcb_desc->bLastIniPkt = bLastIniPkt;
119 tcb_desc->pkt_size = frag_length;
122 skb_reserve(skb, USB_HWDESC_HEADER_LEN);
125 //seg_ptr = skb_put(skb, frag_length + priv->ieee80211->tx_headroom);
126 seg_ptr = skb_put(skb, priv->ieee80211->tx_headroom);
128 pTxFwInfo = (PTX_FWINFO_8190PCI)seg_ptr;
129 memset(pTxFwInfo,0,sizeof(TX_FWINFO_8190PCI));
130 memset(pTxFwInfo,0x12,8);
132 seg_ptr +=sizeof(TX_FWINFO_8190PCI);
135 * Transform from little endian to big endian
139 for(i=0 ; i < frag_length; i+=4) {
140 *seg_ptr++ = ((i+0)<frag_length)?code_virtual_address[i+3]:0;
141 *seg_ptr++ = ((i+1)<frag_length)?code_virtual_address[i+2]:0;
142 *seg_ptr++ = ((i+2)<frag_length)?code_virtual_address[i+1]:0;
143 *seg_ptr++ = ((i+3)<frag_length)?code_virtual_address[i+0]:0;
146 priv->ieee80211->softmac_hard_start_xmit(skb,dev);
148 code_virtual_address += frag_length;
149 frag_offset += frag_length;
154 printk("------------tx cmd------------\n");
156 printk(" 0x%x",((u8*)buf)[k]);
161 printk("-------------cmd desc----------\n");
163 printk(" 0x%x",((u8*)pdesc)[m]);
167 }while(frag_offset < buffer_len);
170 //spin_unlock_irqrestore(&priv->tx_lock,flags);
175 } /* CMPK_Message_Handle_Tx */
177 /*-----------------------------------------------------------------------------
178 * Function: cmpk_counttxstatistic()
182 * Input: PADAPTER pAdapter - .
183 * CMPK_TXFB_T *psTx_FB - .
191 * 05/12/2008 amy Create Version 0 porting from windows code.
193 *---------------------------------------------------------------------------*/
195 cmpk_count_txstatistic(
196 struct net_device *dev,
197 cmpk_txfb_t *pstx_fb)
199 struct r8192_priv *priv = ieee80211_priv(dev);
201 RT_RF_POWER_STATE rtState;
203 pAdapter->HalFunc.GetHwRegHandler(pAdapter, HW_VAR_RF_STATE, (pu1Byte)(&rtState));
205 // When RF is off, we should not count the packet for hw/sw synchronize
206 // reason, ie. there may be a duration while sw switch is changed and hw
207 // switch is being changed. 2006.12.04, by shien chang.
208 if (rtState == eRfOff)
215 if(pAdapter->bInHctTest)
218 /* We can not know the packet length and transmit type: broadcast or uni
219 or multicast. So the relative statistics must be collected in tx
223 priv->stats.txfeedbackok++;
224 priv->stats.txoktotal++;
225 priv->stats.txokbytestotal += pstx_fb->pkt_length;
226 priv->stats.txokinperiod++;
228 /* We can not make sure broadcast/multicast or unicast mode. */
229 if (pstx_fb->pkt_type == PACKET_MULTICAST)
231 priv->stats.txmulticast++;
232 priv->stats.txbytesmulticast += pstx_fb->pkt_length;
234 else if (pstx_fb->pkt_type == PACKET_BROADCAST)
236 priv->stats.txbroadcast++;
237 priv->stats.txbytesbroadcast += pstx_fb->pkt_length;
241 priv->stats.txunicast++;
242 priv->stats.txbytesunicast += pstx_fb->pkt_length;
247 priv->stats.txfeedbackfail++;
248 priv->stats.txerrtotal++;
249 priv->stats.txerrbytestotal += pstx_fb->pkt_length;
251 /* We can not make sure broadcast/multicast or unicast mode. */
252 if (pstx_fb->pkt_type == PACKET_MULTICAST)
254 priv->stats.txerrmulticast++;
256 else if (pstx_fb->pkt_type == PACKET_BROADCAST)
258 priv->stats.txerrbroadcast++;
262 priv->stats.txerrunicast++;
266 priv->stats.txretrycount += pstx_fb->retry_cnt;
267 priv->stats.txfeedbackretry += pstx_fb->retry_cnt;
269 } /* cmpk_CountTxStatistic */
273 /*-----------------------------------------------------------------------------
274 * Function: cmpk_handle_tx_feedback()
276 * Overview: The function is responsible for extract the message inside TX
277 * feedbck message from firmware. It will contain dedicated info in
278 * ws-06-0063-rtl8190-command-packet-specification. Please
279 * refer to chapter "TX Feedback Element". We have to read 20 bytes
280 * in the command packet.
282 * Input: struct net_device * dev
283 * u8 * pmsg - Msg Ptr of the command packet.
291 * 05/08/2008 amy Create Version 0 porting from windows code.
293 *---------------------------------------------------------------------------*/
295 cmpk_handle_tx_feedback(
296 struct net_device *dev,
299 struct r8192_priv *priv = ieee80211_priv(dev);
300 cmpk_txfb_t rx_tx_fb; /* */
302 priv->stats.txfeedback++;
304 /* 0. Display received message. */
305 //cmpk_Display_Message(CMPK_RX_TX_FB_SIZE, pMsg);
307 /* 1. Extract TX feedback info from RFD to temp structure buffer. */
308 /* It seems that FW use big endian(MIPS) and DRV use little endian in
309 windows OS. So we have to read the content byte by byte or transfer
310 endian type before copy the message copy. */
311 #if 0 // The TX FEEDBACK packet element address
312 //rx_tx_fb.Element_ID = pMsg[0];
313 //rx_tx_fb.Length = pMsg[1];
314 rx_tx_fb.TOK = pMsg[2]>>7;
315 rx_tx_fb.Fail_Reason = (pMsg[2] & 0x70) >> 4;
316 rx_tx_fb.TID = (pMsg[2] & 0x0F);
317 rx_tx_fb.Qos_Pkt = pMsg[3] >> 7;
318 rx_tx_fb.Bandwidth = (pMsg[3] & 0x40) >> 6;
319 rx_tx_fb.Retry_Cnt = pMsg[5];
320 rx_tx_fb.Pkt_ID = (pMsg[6] << 8) | pMsg[7];
321 rx_tx_fb.Seq_Num = (pMsg[8] << 8) | pMsg[9];
322 rx_tx_fb.S_Rate = pMsg[10];
323 rx_tx_fb.F_Rate = pMsg[11];
324 rx_tx_fb.S_RTS_Rate = pMsg[12];
325 rx_tx_fb.F_RTS_Rate = pMsg[13];
326 rx_tx_fb.pkt_length = (pMsg[14] << 8) | pMsg[15];
328 /* 2007/07/05 MH Use pointer to transfer structure memory. */
329 //memcpy((UINT8 *)&rx_tx_fb, pMsg, sizeof(CMPK_TXFB_T));
330 memcpy((u8*)&rx_tx_fb, pmsg, sizeof(cmpk_txfb_t));
331 /* 2. Use tx feedback info to count TX statistics. */
332 cmpk_count_txstatistic(dev, &rx_tx_fb);
334 /* 2007/07/11 MH Assign current operate rate. */
335 if (pAdapter->RegWirelessMode == WIRELESS_MODE_A ||
336 pAdapter->RegWirelessMode == WIRELESS_MODE_B ||
337 pAdapter->RegWirelessMode == WIRELESS_MODE_G)
339 pMgntInfo->CurrentOperaRate = (rx_tx_fb.F_Rate & 0x7F);
341 else if (pAdapter->RegWirelessMode == WIRELESS_MODE_N_24G ||
342 pAdapter->RegWirelessMode == WIRELESS_MODE_N_5G)
344 pMgntInfo->HTCurrentOperaRate = (rx_tx_fb.F_Rate & 0x8F);
347 /* 2007/01/17 MH Comment previous method for TX statistic function. */
348 /* Collect info TX feedback packet to fill TCB. */
349 /* We can not know the packet length and transmit type: broadcast or uni
351 //CountTxStatistics( pAdapter, &tcb );
353 } /* cmpk_Handle_Tx_Feedback */
356 cmdpkt_beacontimerinterrupt_819xusb(
357 struct net_device *dev
360 struct r8192_priv *priv = ieee80211_priv(dev);
364 // 070117, rcnjko: 87B have to S/W beacon for DTM encryption_cmn.
366 if((priv->ieee80211->current_network.mode == IEEE_A) ||
367 (priv->ieee80211->current_network.mode == IEEE_N_5G) ||
368 ((priv->ieee80211->current_network.mode == IEEE_N_24G) && (!priv->ieee80211->pHTInfo->bCurSuppCCK)))
371 DMESG("send beacon frame tx rate is 6Mbpm\n");
376 DMESG("send beacon frame tx rate is 1Mbpm\n");
379 //rtl819xusb_beacon_tx(dev,tx_rate); // HW Beacon
388 /*-----------------------------------------------------------------------------
389 * Function: cmpk_handle_interrupt_status()
391 * Overview: The function is responsible for extract the message from
392 * firmware. It will contain dedicated info in
393 * ws-07-0063-v06-rtl819x-command-packet-specification-070315.doc.
394 * Please refer to chapter "Interrupt Status Element".
396 * Input: struct net_device *dev,
397 * u8* pmsg - Message Pointer of the command packet.
405 * 05/12/2008 amy Add this for rtl8192 porting from windows code.
407 *---------------------------------------------------------------------------*/
409 cmpk_handle_interrupt_status(
410 struct net_device *dev,
413 cmpk_intr_sta_t rx_intr_status; /* */
414 struct r8192_priv *priv = ieee80211_priv(dev);
416 DMESG("---> cmpk_Handle_Interrupt_Status()\n");
418 /* 0. Display received message. */
419 //cmpk_Display_Message(CMPK_RX_BEACON_STATE_SIZE, pMsg);
421 /* 1. Extract TX feedback info from RFD to temp structure buffer. */
422 /* It seems that FW use big endian(MIPS) and DRV use little endian in
423 windows OS. So we have to read the content byte by byte or transfer
424 endian type before copy the message copy. */
425 //rx_bcn_state.Element_ID = pMsg[0];
426 //rx_bcn_state.Length = pMsg[1];
427 rx_intr_status.length = pmsg[1];
428 if (rx_intr_status.length != (sizeof(cmpk_intr_sta_t) - 2))
430 DMESG("cmpk_Handle_Interrupt_Status: wrong length!\n");
435 // Statistics of beacon for ad-hoc mode.
436 if( priv->ieee80211->iw_mode == IW_MODE_ADHOC)
438 //2 maybe need endian transform?
439 rx_intr_status.interrupt_status = *((u32 *)(pmsg + 4));
440 //rx_intr_status.InterruptStatus = N2H4BYTE(*((UINT32 *)(pMsg + 4)));
442 DMESG("interrupt status = 0x%x\n", rx_intr_status.interrupt_status);
444 if (rx_intr_status.interrupt_status & ISR_TxBcnOk)
446 priv->ieee80211->bibsscoordinator = true;
447 priv->stats.txbeaconokint++;
449 else if (rx_intr_status.interrupt_status & ISR_TxBcnErr)
451 priv->ieee80211->bibsscoordinator = false;
452 priv->stats.txbeaconerr++;
455 if (rx_intr_status.interrupt_status & ISR_BcnTimerIntr)
457 cmdpkt_beacontimerinterrupt_819xusb(dev);
462 // Other informations in interrupt status we need?
465 DMESG("<---- cmpk_handle_interrupt_status()\n");
467 } /* cmpk_handle_interrupt_status */
470 /*-----------------------------------------------------------------------------
471 * Function: cmpk_handle_query_config_rx()
473 * Overview: The function is responsible for extract the message from
474 * firmware. It will contain dedicated info in
475 * ws-06-0063-rtl8190-command-packet-specification. Please
476 * refer to chapter "Beacon State Element".
478 * Input: u8 * pmsg - Message Pointer of the command packet.
486 * 05/12/2008 amy Create Version 0 porting from windows code.
488 *---------------------------------------------------------------------------*/
490 cmpk_handle_query_config_rx(
491 struct net_device *dev,
494 cmpk_query_cfg_t rx_query_cfg; /* */
496 /* 0. Display received message. */
497 //cmpk_Display_Message(CMPK_RX_BEACON_STATE_SIZE, pMsg);
499 /* 1. Extract TX feedback info from RFD to temp structure buffer. */
500 /* It seems that FW use big endian(MIPS) and DRV use little endian in
501 windows OS. So we have to read the content byte by byte or transfer
502 endian type before copy the message copy. */
503 //rx_query_cfg.Element_ID = pMsg[0];
504 //rx_query_cfg.Length = pMsg[1];
505 rx_query_cfg.cfg_action = (pmsg[4] & 0x80000000)>>31;
506 rx_query_cfg.cfg_type = (pmsg[4] & 0x60) >> 5;
507 rx_query_cfg.cfg_size = (pmsg[4] & 0x18) >> 3;
508 rx_query_cfg.cfg_page = (pmsg[6] & 0x0F) >> 0;
509 rx_query_cfg.cfg_offset = pmsg[7];
510 rx_query_cfg.value = (pmsg[8] << 24) | (pmsg[9] << 16) |
511 (pmsg[10] << 8) | (pmsg[11] << 0);
512 rx_query_cfg.mask = (pmsg[12] << 24) | (pmsg[13] << 16) |
513 (pmsg[14] << 8) | (pmsg[15] << 0);
515 } /* cmpk_Handle_Query_Config_Rx */
518 /*-----------------------------------------------------------------------------
519 * Function: cmpk_count_tx_status()
521 * Overview: Count aggregated tx status from firmwar of one type rx command
522 * packet element id = RX_TX_STATUS.
532 * 05/12/2008 amy Create Version 0 porting from windows code.
534 *---------------------------------------------------------------------------*/
535 static void cmpk_count_tx_status( struct net_device *dev,
536 cmpk_tx_status_t *pstx_status)
538 struct r8192_priv *priv = ieee80211_priv(dev);
542 RT_RF_POWER_STATE rtstate;
544 pAdapter->HalFunc.GetHwRegHandler(pAdapter, HW_VAR_RF_STATE, (pu1Byte)(&rtState));
546 // When RF is off, we should not count the packet for hw/sw synchronize
547 // reason, ie. there may be a duration while sw switch is changed and hw
548 // switch is being changed. 2006.12.04, by shien chang.
549 if (rtState == eRfOff)
555 priv->stats.txfeedbackok += pstx_status->txok;
556 priv->stats.txoktotal += pstx_status->txok;
558 priv->stats.txfeedbackfail += pstx_status->txfail;
559 priv->stats.txerrtotal += pstx_status->txfail;
561 priv->stats.txretrycount += pstx_status->txretry;
562 priv->stats.txfeedbackretry += pstx_status->txretry;
564 //pAdapter->TxStats.NumTxOkBytesTotal += psTx_FB->pkt_length;
565 //pAdapter->TxStats.NumTxErrBytesTotal += psTx_FB->pkt_length;
566 //pAdapter->MgntInfo.LinkDetectInfo.NumTxOkInPeriod++;
568 priv->stats.txmulticast += pstx_status->txmcok;
569 priv->stats.txbroadcast += pstx_status->txbcok;
570 priv->stats.txunicast += pstx_status->txucok;
572 priv->stats.txerrmulticast += pstx_status->txmcfail;
573 priv->stats.txerrbroadcast += pstx_status->txbcfail;
574 priv->stats.txerrunicast += pstx_status->txucfail;
576 priv->stats.txbytesmulticast += pstx_status->txmclength;
577 priv->stats.txbytesbroadcast += pstx_status->txbclength;
578 priv->stats.txbytesunicast += pstx_status->txuclength;
580 priv->stats.last_packet_rate = pstx_status->rate;
581 } /* cmpk_CountTxStatus */
585 /*-----------------------------------------------------------------------------
586 * Function: cmpk_handle_tx_status()
588 * Overview: Firmware add a new tx feedback status to reduce rx command
589 * packet buffer operation load.
599 * 05/12/2008 amy Create Version 0 porting from windows code.
601 *---------------------------------------------------------------------------*/
603 cmpk_handle_tx_status(
604 struct net_device *dev,
607 cmpk_tx_status_t rx_tx_sts; /* */
609 memcpy((void*)&rx_tx_sts, (void*)pmsg, sizeof(cmpk_tx_status_t));
610 /* 2. Use tx feedback info to count TX statistics. */
611 cmpk_count_tx_status(dev, &rx_tx_sts);
613 } /* cmpk_Handle_Tx_Status */
616 /*-----------------------------------------------------------------------------
617 * Function: cmpk_handle_tx_rate_history()
619 * Overview: Firmware add a new tx rate history
629 * 05/12/2008 amy Create Version 0 porting from windows code.
631 *---------------------------------------------------------------------------*/
633 cmpk_handle_tx_rate_history(
634 struct net_device *dev,
637 cmpk_tx_rahis_t *ptxrate;
638 // RT_RF_POWER_STATE rtState;
640 u16 length = sizeof(cmpk_tx_rahis_t);
642 struct r8192_priv *priv = ieee80211_priv(dev);
646 pAdapter->HalFunc.GetHwRegHandler(pAdapter, HW_VAR_RF_STATE, (pu1Byte)(&rtState));
648 // When RF is off, we should not count the packet for hw/sw synchronize
649 // reason, ie. there may be a duration while sw switch is changed and hw
650 // switch is being changed. 2006.12.04, by shien chang.
651 if (rtState == eRfOff)
660 // Do endian transfer to word alignment(16 bits) for windows system.
661 // You must do different endian transfer for linux and MAC OS
663 for (i = 0; i < (length/4); i++)
667 temp1 = ptemp[i]&0x0000FFFF;
668 temp2 = ptemp[i]>>16;
669 ptemp[i] = (temp1<<16)|temp2;
672 ptxrate = (cmpk_tx_rahis_t *)pmsg;
674 if (ptxrate == NULL )
679 for (i = 0; i < 16; i++)
681 // Collect CCK rate packet num
683 priv->stats.txrate.cck[i] += ptxrate->cck[i];
685 // Collect OFDM rate packet num
687 priv->stats.txrate.ofdm[i] += ptxrate->ofdm[i];
689 for (j = 0; j < 4; j++)
690 priv->stats.txrate.ht_mcs[j][i] += ptxrate->ht_mcs[j][i];
693 } /* cmpk_Handle_Tx_Rate_History */
696 /*-----------------------------------------------------------------------------
697 * Function: cmpk_message_handle_rx()
699 * Overview: In the function, we will capture different RX command packet
700 * info. Every RX command packet element has different message
701 * length and meaning in content. We only support three type of RX
702 * command packet now. Please refer to document
703 * ws-06-0063-rtl8190-command-packet-specification.
713 * 05/06/2008 amy Create Version 0 porting from windows code.
715 *---------------------------------------------------------------------------*/
717 cmpk_message_handle_rx(
718 struct net_device *dev,
719 struct ieee80211_rx_stats *pstats)
721 // u32 debug_level = DBG_LOUD;
722 struct r8192_priv *priv = ieee80211_priv(dev);
724 u8 cmd_length, exe_cnt = 0;
728 RT_TRACE(COMP_EVENTS, "---->cmpk_message_handle_rx()\n");
730 /* 0. Check inpt arguments. If is is a command queue message or pointer is
732 if (/*(prfd->queue_id != CMPK_RX_QUEUE_ID) || */(pstats== NULL))
734 /* Print error message. */
735 /*RT_TRACE(COMP_SEND, DebugLevel,
736 ("\n\r[CMPK]-->Err queue id or pointer"));*/
737 return 0; /* This is not a command packet. */
740 /* 1. Read received command packet message length from RFD. */
741 total_length = pstats->Length;
743 /* 2. Read virtual address from RFD. */
744 pcmd_buff = pstats->virtual_address;
746 /* 3. Read command pakcet element id and length. */
747 element_id = pcmd_buff[0];
748 /*RT_TRACE(COMP_SEND, DebugLevel,
749 ("\n\r[CMPK]-->element ID=%d Len=%d", element_id, total_length));*/
751 /* 4. Check every received command packet conent according to different
752 element type. Because FW may aggregate RX command packet to minimize
753 transmit time between DRV and FW.*/
754 // Add a counter to prevent to locked in the loop too long
755 while (total_length > 0 || exe_cnt++ >100)
757 /* 2007/01/17 MH We support aggregation of different cmd in the same packet. */
758 element_id = pcmd_buff[0];
764 RT_TRACE(COMP_EVENTS, "---->cmpk_message_handle_rx():RX_TX_FEEDBACK\n");
765 cmpk_handle_tx_feedback (dev, pcmd_buff);
766 cmd_length = CMPK_RX_TX_FB_SIZE;
769 case RX_INTERRUPT_STATUS:
771 RT_TRACE(COMP_EVENTS, "---->cmpk_message_handle_rx():RX_INTERRUPT_STATUS\n");
772 cmpk_handle_interrupt_status(dev, pcmd_buff);
773 cmd_length = sizeof(cmpk_intr_sta_t);
776 case BOTH_QUERY_CONFIG:
778 RT_TRACE(COMP_EVENTS, "---->cmpk_message_handle_rx():BOTH_QUERY_CONFIG\n");
779 cmpk_handle_query_config_rx(dev, pcmd_buff);
780 cmd_length = CMPK_BOTH_QUERY_CONFIG_SIZE;
785 RT_TRACE(COMP_EVENTS, "---->cmpk_message_handle_rx():RX_TX_STATUS\n");
786 cmpk_handle_tx_status(dev, pcmd_buff);
787 cmd_length = CMPK_RX_TX_STS_SIZE;
790 case RX_TX_PER_PKT_FEEDBACK:
791 // You must at lease add a switch case element here,
792 // Otherwise, we will jump to default case.
793 //DbgPrint("CCX Test\r\n");
794 RT_TRACE(COMP_EVENTS, "---->cmpk_message_handle_rx():RX_TX_PER_PKT_FEEDBACK\n");
795 cmd_length = CMPK_RX_TX_FB_SIZE;
798 case RX_TX_RATE_HISTORY:
799 //DbgPrint(" rx tx rate history\r\n");
801 RT_TRACE(COMP_EVENTS, "---->cmpk_message_handle_rx():RX_TX_HISTORY\n");
802 cmpk_handle_tx_rate_history(dev, pcmd_buff);
803 cmd_length = CMPK_TX_RAHIS_SIZE;
808 RT_TRACE(COMP_EVENTS, "---->cmpk_message_handle_rx():unknow CMD Element\n");
809 return 1; /* This is a command packet. */
811 // 2007/01/22 MH Display received rx command packet info.
812 //cmpk_Display_Message(cmd_length, pcmd_buff);
814 // 2007/01/22 MH Add to display tx statistic.
815 //cmpk_DisplayTxStatistic(pAdapter);
817 /* 2007/03/09 MH Collect sidderent cmd element pkt num. */
818 priv->stats.rxcmdpkt[element_id]++;
820 total_length -= cmd_length;
821 pcmd_buff += cmd_length;
822 } /* while (total_length > 0) */
823 return 1; /* This is a command packet. */
825 RT_TRACE(COMP_EVENTS, "<----cmpk_message_handle_rx()\n");
826 } /* CMPK_Message_Handle_Rx */