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 "r819xU_cmdpkt.h"
26 /*---------------------------Define Local Constant---------------------------*/
28 #define CMPK_DEBOUNCE_CNT 1
29 /* 2007/10/24 MH Add for printing a range of data. */
30 #define CMPK_PRINT(Address)\
35 memcpy(temp, Address, 40);\
36 for (i = 0; i <40; i+=4)\
37 printk("\r\n %08x", temp[i]);\
39 /*---------------------------Define functions---------------------------------*/
43 struct net_device *dev,
49 struct r8192_priv *priv = ieee80211_priv(dev);
52 unsigned char *ptr_buf;
53 //bool bLastInitPacket = false;
55 //PlatformAcquireSpinLock(Adapter, RT_TX_SPINLOCK);
57 //Get TCB and local buffer from common pool. (It is shared by CmdQ, MgntQ, and USB coalesce DataQ)
58 skb = dev_alloc_skb(USB_HWDESC_HEADER_LEN + DataLen + 4);
59 memcpy((unsigned char *)(skb->cb),&dev,sizeof(dev));
60 tcb_desc = (cb_desc*)(skb->cb + MAX_DEV_ADDR_SIZE);
61 tcb_desc->queue_index = TXCMD_QUEUE;
62 tcb_desc->bCmdOrInit = DESC_PACKET_TYPE_NORMAL;
63 tcb_desc->bLastIniPkt = 0;
64 skb_reserve(skb, USB_HWDESC_HEADER_LEN);
65 ptr_buf = skb_put(skb, DataLen);
66 memset(ptr_buf,0,DataLen);
67 memcpy(ptr_buf,pData,DataLen);
68 tcb_desc->txbuf_size= (u16)DataLen;
70 if(!priv->ieee80211->check_nic_enough_desc(dev,tcb_desc->queue_index)||
71 (!skb_queue_empty(&priv->ieee80211->skb_waitQ[tcb_desc->queue_index]))||\
72 (priv->ieee80211->queue_stop) ) {
73 RT_TRACE(COMP_FIRMWARE,"===================NULL packet==================================> tx full!\n");
74 skb_queue_tail(&priv->ieee80211->skb_waitQ[tcb_desc->queue_index], skb);
76 priv->ieee80211->softmac_hard_start_xmit(skb,dev);
79 //PlatformReleaseSpinLock(Adapter, RT_TX_SPINLOCK);
83 /*-----------------------------------------------------------------------------
84 * Function: cmpk_message_handle_tx()
86 * Overview: Driver internal module can call the API to send message to
87 * firmware side. For example, you can send a debug command packet.
88 * Or you can send a request for FW to modify RLX4181 LBUS HW bank.
89 * Otherwise, you can change MAC/PHT/RF register by firmware at
90 * run time. We do not support message more than one segment now.
100 * 05/06/2008 amy porting from windows code.
102 *---------------------------------------------------------------------------*/
103 extern bool cmpk_message_handle_tx(
104 struct net_device *dev,
105 u8* codevirtualaddress,
110 bool rt_status = true;
117 struct r8192_priv *priv = ieee80211_priv(dev);
119 u16 frag_length, frag_offset = 0;
123 rt_firmware *pfirmware = priv->pFirmware;
125 unsigned char *seg_ptr;
129 firmware_init_param(dev);
130 //Fragmentation might be required
131 frag_threshold = pfirmware->cmdpacket_frag_thresold;
133 if((buffer_len - frag_offset) > frag_threshold) {
134 frag_length = frag_threshold ;
138 frag_length = buffer_len - frag_offset;
143 /* Allocate skb buffer to contain firmware info and tx descriptor info
144 * add 4 to avoid packet appending overflow.
147 skb = dev_alloc_skb(USB_HWDESC_HEADER_LEN + frag_length + 4);
149 skb = dev_alloc_skb(frag_length + 4);
151 memcpy((unsigned char *)(skb->cb),&dev,sizeof(dev));
152 tcb_desc = (cb_desc*)(skb->cb + MAX_DEV_ADDR_SIZE);
153 tcb_desc->queue_index = TXCMD_QUEUE;
154 tcb_desc->bCmdOrInit = packettype;
155 tcb_desc->bLastIniPkt = bLastIniPkt;
158 skb_reserve(skb, USB_HWDESC_HEADER_LEN);
161 seg_ptr = skb_put(skb, buffer_len);
163 * Transform from little endian to big endian
166 memcpy(seg_ptr,codevirtualaddress,buffer_len);
167 tcb_desc->txbuf_size= (u16)buffer_len;
170 if(!priv->ieee80211->check_nic_enough_desc(dev,tcb_desc->queue_index)||
171 (!skb_queue_empty(&priv->ieee80211->skb_waitQ[tcb_desc->queue_index]))||\
172 (priv->ieee80211->queue_stop) ) {
173 RT_TRACE(COMP_FIRMWARE,"=====================================================> tx full!\n");
174 skb_queue_tail(&priv->ieee80211->skb_waitQ[tcb_desc->queue_index], skb);
176 priv->ieee80211->softmac_hard_start_xmit(skb,dev);
179 codevirtualaddress += frag_length;
180 frag_offset += frag_length;
182 }while(frag_offset < buffer_len);
189 } /* CMPK_Message_Handle_Tx */
191 /*-----------------------------------------------------------------------------
192 * Function: cmpk_counttxstatistic()
196 * Input: PADAPTER pAdapter - .
197 * CMPK_TXFB_T *psTx_FB - .
205 * 05/12/2008 amy Create Version 0 porting from windows code.
207 *---------------------------------------------------------------------------*/
209 cmpk_count_txstatistic(
210 struct net_device *dev,
211 cmpk_txfb_t *pstx_fb)
213 struct r8192_priv *priv = ieee80211_priv(dev);
215 RT_RF_POWER_STATE rtState;
217 pAdapter->HalFunc.GetHwRegHandler(pAdapter, HW_VAR_RF_STATE, (pu1Byte)(&rtState));
219 // When RF is off, we should not count the packet for hw/sw synchronize
220 // reason, ie. there may be a duration while sw switch is changed and hw
221 // switch is being changed. 2006.12.04, by shien chang.
222 if (rtState == eRfOff)
229 if(pAdapter->bInHctTest)
232 /* We can not know the packet length and transmit type: broadcast or uni
233 or multicast. So the relative statistics must be collected in tx
237 priv->stats.txfeedbackok++;
238 priv->stats.txoktotal++;
239 priv->stats.txokbytestotal += pstx_fb->pkt_length;
240 priv->stats.txokinperiod++;
242 /* We can not make sure broadcast/multicast or unicast mode. */
243 if (pstx_fb->pkt_type == PACKET_MULTICAST)
245 priv->stats.txmulticast++;
246 priv->stats.txbytesmulticast += pstx_fb->pkt_length;
248 else if (pstx_fb->pkt_type == PACKET_BROADCAST)
250 priv->stats.txbroadcast++;
251 priv->stats.txbytesbroadcast += pstx_fb->pkt_length;
255 priv->stats.txunicast++;
256 priv->stats.txbytesunicast += pstx_fb->pkt_length;
261 priv->stats.txfeedbackfail++;
262 priv->stats.txerrtotal++;
263 priv->stats.txerrbytestotal += pstx_fb->pkt_length;
265 /* We can not make sure broadcast/multicast or unicast mode. */
266 if (pstx_fb->pkt_type == PACKET_MULTICAST)
268 priv->stats.txerrmulticast++;
270 else if (pstx_fb->pkt_type == PACKET_BROADCAST)
272 priv->stats.txerrbroadcast++;
276 priv->stats.txerrunicast++;
280 priv->stats.txretrycount += pstx_fb->retry_cnt;
281 priv->stats.txfeedbackretry += pstx_fb->retry_cnt;
283 } /* cmpk_CountTxStatistic */
287 /*-----------------------------------------------------------------------------
288 * Function: cmpk_handle_tx_feedback()
290 * Overview: The function is responsible for extract the message inside TX
291 * feedbck message from firmware. It will contain dedicated info in
292 * ws-06-0063-rtl8190-command-packet-specification. Please
293 * refer to chapter "TX Feedback Element". We have to read 20 bytes
294 * in the command packet.
296 * Input: struct net_device * dev
297 * u8 * pmsg - Msg Ptr of the command packet.
305 * 05/08/2008 amy Create Version 0 porting from windows code.
307 *---------------------------------------------------------------------------*/
309 cmpk_handle_tx_feedback(
310 struct net_device *dev,
313 struct r8192_priv *priv = ieee80211_priv(dev);
314 cmpk_txfb_t rx_tx_fb; /* */
316 priv->stats.txfeedback++;
318 /* 0. Display received message. */
319 //cmpk_Display_Message(CMPK_RX_TX_FB_SIZE, pMsg);
321 /* 1. Extract TX feedback info from RFD to temp structure buffer. */
322 /* It seems that FW use big endian(MIPS) and DRV use little endian in
323 windows OS. So we have to read the content byte by byte or transfer
324 endian type before copy the message copy. */
325 #if 0 // The TX FEEDBACK packet element address
326 //rx_tx_fb.Element_ID = pMsg[0];
327 //rx_tx_fb.Length = pMsg[1];
328 rx_tx_fb.TOK = pMsg[2]>>7;
329 rx_tx_fb.Fail_Reason = (pMsg[2] & 0x70) >> 4;
330 rx_tx_fb.TID = (pMsg[2] & 0x0F);
331 rx_tx_fb.Qos_Pkt = pMsg[3] >> 7;
332 rx_tx_fb.Bandwidth = (pMsg[3] & 0x40) >> 6;
333 rx_tx_fb.Retry_Cnt = pMsg[5];
334 rx_tx_fb.Pkt_ID = (pMsg[6] << 8) | pMsg[7];
335 rx_tx_fb.Seq_Num = (pMsg[8] << 8) | pMsg[9];
336 rx_tx_fb.S_Rate = pMsg[10];
337 rx_tx_fb.F_Rate = pMsg[11];
338 rx_tx_fb.S_RTS_Rate = pMsg[12];
339 rx_tx_fb.F_RTS_Rate = pMsg[13];
340 rx_tx_fb.pkt_length = (pMsg[14] << 8) | pMsg[15];
342 /* 2007/07/05 MH Use pointer to transfer structure memory. */
343 //memcpy((UINT8 *)&rx_tx_fb, pMsg, sizeof(CMPK_TXFB_T));
344 memcpy((u8*)&rx_tx_fb, pmsg, sizeof(cmpk_txfb_t));
345 /* 2. Use tx feedback info to count TX statistics. */
346 cmpk_count_txstatistic(dev, &rx_tx_fb);
348 /* 2007/07/11 MH Assign current operate rate. */
349 if (pAdapter->RegWirelessMode == WIRELESS_MODE_A ||
350 pAdapter->RegWirelessMode == WIRELESS_MODE_B ||
351 pAdapter->RegWirelessMode == WIRELESS_MODE_G)
353 pMgntInfo->CurrentOperaRate = (rx_tx_fb.F_Rate & 0x7F);
355 else if (pAdapter->RegWirelessMode == WIRELESS_MODE_N_24G ||
356 pAdapter->RegWirelessMode == WIRELESS_MODE_N_5G)
358 pMgntInfo->HTCurrentOperaRate = (rx_tx_fb.F_Rate & 0x8F);
361 /* 2007/01/17 MH Comment previous method for TX statistic function. */
362 /* Collect info TX feedback packet to fill TCB. */
363 /* We can not know the packet length and transmit type: broadcast or uni
365 //CountTxStatistics( pAdapter, &tcb );
367 } /* cmpk_Handle_Tx_Feedback */
370 cmdpkt_beacontimerinterrupt_819xusb(
371 struct net_device *dev
374 struct r8192_priv *priv = ieee80211_priv(dev);
378 // 070117, rcnjko: 87B have to S/W beacon for DTM encryption_cmn.
380 if(priv->ieee80211->current_network.mode == IEEE_A ||
381 priv->ieee80211->current_network.mode == IEEE_N_5G ||
382 (priv->ieee80211->current_network.mode == IEEE_N_24G && (!priv->ieee80211->pHTInfo->bCurSuppCCK)))
385 DMESG("send beacon frame tx rate is 6Mbpm\n");
390 DMESG("send beacon frame tx rate is 1Mbpm\n");
393 rtl819xusb_beacon_tx(dev,tx_rate); // HW Beacon
402 /*-----------------------------------------------------------------------------
403 * Function: cmpk_handle_interrupt_status()
405 * Overview: The function is responsible for extract the message from
406 * firmware. It will contain dedicated info in
407 * ws-07-0063-v06-rtl819x-command-packet-specification-070315.doc.
408 * Please refer to chapter "Interrupt Status Element".
410 * Input: struct net_device *dev,
411 * u8* pmsg - Message Pointer of the command packet.
419 * 05/12/2008 amy Add this for rtl8192 porting from windows code.
421 *---------------------------------------------------------------------------*/
423 cmpk_handle_interrupt_status(
424 struct net_device *dev,
427 cmpk_intr_sta_t rx_intr_status; /* */
428 struct r8192_priv *priv = ieee80211_priv(dev);
430 DMESG("---> cmpk_Handle_Interrupt_Status()\n");
432 /* 0. Display received message. */
433 //cmpk_Display_Message(CMPK_RX_BEACON_STATE_SIZE, pMsg);
435 /* 1. Extract TX feedback info from RFD to temp structure buffer. */
436 /* It seems that FW use big endian(MIPS) and DRV use little endian in
437 windows OS. So we have to read the content byte by byte or transfer
438 endian type before copy the message copy. */
439 //rx_bcn_state.Element_ID = pMsg[0];
440 //rx_bcn_state.Length = pMsg[1];
441 rx_intr_status.length = pmsg[1];
442 if (rx_intr_status.length != (sizeof(cmpk_intr_sta_t) - 2))
444 DMESG("cmpk_Handle_Interrupt_Status: wrong length!\n");
449 // Statistics of beacon for ad-hoc mode.
450 if( priv->ieee80211->iw_mode == IW_MODE_ADHOC)
452 //2 maybe need endian transform?
453 rx_intr_status.interrupt_status = *((u32 *)(pmsg + 4));
454 //rx_intr_status.InterruptStatus = N2H4BYTE(*((UINT32 *)(pMsg + 4)));
456 DMESG("interrupt status = 0x%x\n", rx_intr_status.interrupt_status);
458 if (rx_intr_status.interrupt_status & ISR_TxBcnOk)
460 priv->ieee80211->bibsscoordinator = true;
461 priv->stats.txbeaconokint++;
463 else if (rx_intr_status.interrupt_status & ISR_TxBcnErr)
465 priv->ieee80211->bibsscoordinator = false;
466 priv->stats.txbeaconerr++;
469 if (rx_intr_status.interrupt_status & ISR_BcnTimerIntr)
471 cmdpkt_beacontimerinterrupt_819xusb(dev);
476 // Other informations in interrupt status we need?
479 DMESG("<---- cmpk_handle_interrupt_status()\n");
481 } /* cmpk_handle_interrupt_status */
484 /*-----------------------------------------------------------------------------
485 * Function: cmpk_handle_query_config_rx()
487 * Overview: The function is responsible for extract the message from
488 * firmware. It will contain dedicated info in
489 * ws-06-0063-rtl8190-command-packet-specification. Please
490 * refer to chapter "Beacon State Element".
492 * Input: u8 * pmsg - Message Pointer of the command packet.
500 * 05/12/2008 amy Create Version 0 porting from windows code.
502 *---------------------------------------------------------------------------*/
504 cmpk_handle_query_config_rx(
505 struct net_device *dev,
508 cmpk_query_cfg_t rx_query_cfg; /* */
510 /* 0. Display received message. */
511 //cmpk_Display_Message(CMPK_RX_BEACON_STATE_SIZE, pMsg);
513 /* 1. Extract TX feedback info from RFD to temp structure buffer. */
514 /* It seems that FW use big endian(MIPS) and DRV use little endian in
515 windows OS. So we have to read the content byte by byte or transfer
516 endian type before copy the message copy. */
517 //rx_query_cfg.Element_ID = pMsg[0];
518 //rx_query_cfg.Length = pMsg[1];
519 rx_query_cfg.cfg_action = (pmsg[4] & 0x80000000)>>31;
520 rx_query_cfg.cfg_type = (pmsg[4] & 0x60) >> 5;
521 rx_query_cfg.cfg_size = (pmsg[4] & 0x18) >> 3;
522 rx_query_cfg.cfg_page = (pmsg[6] & 0x0F) >> 0;
523 rx_query_cfg.cfg_offset = pmsg[7];
524 rx_query_cfg.value = (pmsg[8] << 24) | (pmsg[9] << 16) |
525 (pmsg[10] << 8) | (pmsg[11] << 0);
526 rx_query_cfg.mask = (pmsg[12] << 24) | (pmsg[13] << 16) |
527 (pmsg[14] << 8) | (pmsg[15] << 0);
529 } /* cmpk_Handle_Query_Config_Rx */
532 /*-----------------------------------------------------------------------------
533 * Function: cmpk_count_tx_status()
535 * Overview: Count aggregated tx status from firmwar of one type rx command
536 * packet element id = RX_TX_STATUS.
546 * 05/12/2008 amy Create Version 0 porting from windows code.
548 *---------------------------------------------------------------------------*/
549 static void cmpk_count_tx_status( struct net_device *dev,
550 cmpk_tx_status_t *pstx_status)
552 struct r8192_priv *priv = ieee80211_priv(dev);
556 RT_RF_POWER_STATE rtstate;
558 pAdapter->HalFunc.GetHwRegHandler(pAdapter, HW_VAR_RF_STATE, (pu1Byte)(&rtState));
560 // When RF is off, we should not count the packet for hw/sw synchronize
561 // reason, ie. there may be a duration while sw switch is changed and hw
562 // switch is being changed. 2006.12.04, by shien chang.
563 if (rtState == eRfOff)
569 priv->stats.txfeedbackok += pstx_status->txok;
570 priv->stats.txoktotal += pstx_status->txok;
572 priv->stats.txfeedbackfail += pstx_status->txfail;
573 priv->stats.txerrtotal += pstx_status->txfail;
575 priv->stats.txretrycount += pstx_status->txretry;
576 priv->stats.txfeedbackretry += pstx_status->txretry;
578 //pAdapter->TxStats.NumTxOkBytesTotal += psTx_FB->pkt_length;
579 //pAdapter->TxStats.NumTxErrBytesTotal += psTx_FB->pkt_length;
580 //pAdapter->MgntInfo.LinkDetectInfo.NumTxOkInPeriod++;
582 priv->stats.txmulticast += pstx_status->txmcok;
583 priv->stats.txbroadcast += pstx_status->txbcok;
584 priv->stats.txunicast += pstx_status->txucok;
586 priv->stats.txerrmulticast += pstx_status->txmcfail;
587 priv->stats.txerrbroadcast += pstx_status->txbcfail;
588 priv->stats.txerrunicast += pstx_status->txucfail;
590 priv->stats.txbytesmulticast += pstx_status->txmclength;
591 priv->stats.txbytesbroadcast += pstx_status->txbclength;
592 priv->stats.txbytesunicast += pstx_status->txuclength;
594 priv->stats.last_packet_rate = pstx_status->rate;
595 } /* cmpk_CountTxStatus */
599 /*-----------------------------------------------------------------------------
600 * Function: cmpk_handle_tx_status()
602 * Overview: Firmware add a new tx feedback status to reduce rx command
603 * packet buffer operation load.
613 * 05/12/2008 amy Create Version 0 porting from windows code.
615 *---------------------------------------------------------------------------*/
617 cmpk_handle_tx_status(
618 struct net_device *dev,
621 cmpk_tx_status_t rx_tx_sts; /* */
623 memcpy((void*)&rx_tx_sts, (void*)pmsg, sizeof(cmpk_tx_status_t));
624 /* 2. Use tx feedback info to count TX statistics. */
625 cmpk_count_tx_status(dev, &rx_tx_sts);
627 } /* cmpk_Handle_Tx_Status */
630 /*-----------------------------------------------------------------------------
631 * Function: cmpk_handle_tx_rate_history()
633 * Overview: Firmware add a new tx rate history
643 * 05/12/2008 amy Create Version 0 porting from windows code.
645 *---------------------------------------------------------------------------*/
647 cmpk_handle_tx_rate_history(
648 struct net_device *dev,
651 cmpk_tx_rahis_t *ptxrate;
652 // RT_RF_POWER_STATE rtState;
654 u16 length = sizeof(cmpk_tx_rahis_t);
656 struct r8192_priv *priv = ieee80211_priv(dev);
660 pAdapter->HalFunc.GetHwRegHandler(pAdapter, HW_VAR_RF_STATE, (pu1Byte)(&rtState));
662 // When RF is off, we should not count the packet for hw/sw synchronize
663 // reason, ie. there may be a duration while sw switch is changed and hw
664 // switch is being changed. 2006.12.04, by shien chang.
665 if (rtState == eRfOff)
674 // Do endian transfer to word alignment(16 bits) for windows system.
675 // You must do different endian transfer for linux and MAC OS
677 for (i = 0; i < (length/4); i++)
681 temp1 = ptemp[i]&0x0000FFFF;
682 temp2 = ptemp[i]>>16;
683 ptemp[i] = (temp1<<16)|temp2;
686 ptxrate = (cmpk_tx_rahis_t *)pmsg;
688 if (ptxrate == NULL )
693 for (i = 0; i < 16; i++)
695 // Collect CCK rate packet num
697 priv->stats.txrate.cck[i] += ptxrate->cck[i];
699 // Collect OFDM rate packet num
701 priv->stats.txrate.ofdm[i] += ptxrate->ofdm[i];
703 for (j = 0; j < 4; j++)
704 priv->stats.txrate.ht_mcs[j][i] += ptxrate->ht_mcs[j][i];
707 } /* cmpk_Handle_Tx_Rate_History */
710 /*-----------------------------------------------------------------------------
711 * Function: cmpk_message_handle_rx()
713 * Overview: In the function, we will capture different RX command packet
714 * info. Every RX command packet element has different message
715 * length and meaning in content. We only support three type of RX
716 * command packet now. Please refer to document
717 * ws-06-0063-rtl8190-command-packet-specification.
727 * 05/06/2008 amy Create Version 0 porting from windows code.
729 *---------------------------------------------------------------------------*/
731 cmpk_message_handle_rx(
732 struct net_device *dev,
733 struct ieee80211_rx_stats *pstats)
735 // u32 debug_level = DBG_LOUD;
736 struct r8192_priv *priv = ieee80211_priv(dev);
738 u8 cmd_length, exe_cnt = 0;
742 /* 0. Check inpt arguments. If is is a command queue message or pointer is
744 if (/*(prfd->queue_id != CMPK_RX_QUEUE_ID) || */(pstats== NULL))
746 /* Print error message. */
747 /*RT_TRACE(COMP_SEND, DebugLevel,
748 ("\n\r[CMPK]-->Err queue id or pointer"));*/
749 return 0; /* This is not a command packet. */
752 /* 1. Read received command packet message length from RFD. */
753 total_length = pstats->Length;
755 /* 2. Read virtual address from RFD. */
756 pcmd_buff = pstats->virtual_address;
758 /* 3. Read command pakcet element id and length. */
759 element_id = pcmd_buff[0];
760 /*RT_TRACE(COMP_SEND, DebugLevel,
761 ("\n\r[CMPK]-->element ID=%d Len=%d", element_id, total_length));*/
763 /* 4. Check every received command packet conent according to different
764 element type. Because FW may aggregate RX command packet to minimize
765 transmit time between DRV and FW.*/
766 // Add a counter to prevent to locked in the loop too long
767 while (total_length > 0 || exe_cnt++ >100)
769 /* 2007/01/17 MH We support aggregation of different cmd in the same packet. */
770 element_id = pcmd_buff[0];
775 cmpk_handle_tx_feedback (dev, pcmd_buff);
776 cmd_length = CMPK_RX_TX_FB_SIZE;
779 case RX_INTERRUPT_STATUS:
780 cmpk_handle_interrupt_status(dev, pcmd_buff);
781 cmd_length = sizeof(cmpk_intr_sta_t);
784 case BOTH_QUERY_CONFIG:
785 cmpk_handle_query_config_rx(dev, pcmd_buff);
786 cmd_length = CMPK_BOTH_QUERY_CONFIG_SIZE;
790 cmpk_handle_tx_status(dev, pcmd_buff);
791 cmd_length = CMPK_RX_TX_STS_SIZE;
794 case RX_TX_PER_PKT_FEEDBACK:
795 // You must at lease add a switch case element here,
796 // Otherwise, we will jump to default case.
797 //DbgPrint("CCX Test\r\n");
798 cmd_length = CMPK_RX_TX_FB_SIZE;
801 case RX_TX_RATE_HISTORY:
802 //DbgPrint(" rx tx rate history\r\n");
803 cmpk_handle_tx_rate_history(dev, pcmd_buff);
804 cmd_length = CMPK_TX_RAHIS_SIZE;
809 RT_TRACE(COMP_ERR, "---->cmpk_message_handle_rx():unknow CMD Element\n");
810 return 1; /* This is a command packet. */
812 // 2007/01/22 MH Display received rx command packet info.
813 //cmpk_Display_Message(cmd_length, pcmd_buff);
815 // 2007/01/22 MH Add to display tx statistic.
816 //cmpk_DisplayTxStatistic(pAdapter);
818 /* 2007/03/09 MH Collect sidderent cmd element pkt num. */
819 priv->stats.rxcmdpkt[element_id]++;
821 total_length -= cmd_length;
822 pcmd_buff += cmd_length;
823 } /* while (total_length > 0) */
824 return 1; /* This is a command packet. */
826 } /* CMPK_Message_Handle_Rx */