Remove cmpk_message_handle_rx() and static functions used by it. This function was never called. Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@xxxxxxxxx> --- drivers/staging/rtl8192e/rtl8192e/r8192E_cmdpkt.c | 272 ---------------------- drivers/staging/rtl8192e/rtl8192e/r8192E_cmdpkt.h | 134 ----------- 2 files changed, 406 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_cmdpkt.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_cmdpkt.c index 53676a6..ebd08a1 100644 --- a/drivers/staging/rtl8192e/rtl8192e/r8192E_cmdpkt.c +++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_cmdpkt.c @@ -88,275 +88,3 @@ bool cmpk_message_handle_tx( Failed: return rt_status; } - -static void -cmpk_count_txstatistic( - struct net_device *dev, - struct cmpk_txfb *pstx_fb) -{ - struct r8192_priv *priv = rtllib_priv(dev); -#ifdef ENABLE_PS - enum rt_rf_power_state rtState; - - pAdapter->HalFunc.GetHwRegHandler(pAdapter, HW_VAR_RF_STATE, - (pu1Byte)(&rtState)); - - if (rtState == eRfOff) - return; -#endif - - if (pstx_fb->tok) { - priv->stats.txfeedbackok++; - priv->stats.txoktotal++; - priv->stats.txokbytestotal += pstx_fb->pkt_length; - priv->stats.txokinperiod++; - - if (pstx_fb->pkt_type == PACKET_MULTICAST) { - priv->stats.txmulticast++; - priv->stats.txbytesmulticast += pstx_fb->pkt_length; - } else if (pstx_fb->pkt_type == PACKET_BROADCAST) { - priv->stats.txbroadcast++; - priv->stats.txbytesbroadcast += pstx_fb->pkt_length; - } else { - priv->stats.txunicast++; - priv->stats.txbytesunicast += pstx_fb->pkt_length; - } - } else { - priv->stats.txfeedbackfail++; - priv->stats.txerrtotal++; - priv->stats.txerrbytestotal += pstx_fb->pkt_length; - - if (pstx_fb->pkt_type == PACKET_MULTICAST) - priv->stats.txerrmulticast++; - else if (pstx_fb->pkt_type == PACKET_BROADCAST) - priv->stats.txerrbroadcast++; - else - priv->stats.txerrunicast++; - } - - priv->stats.txretrycount += pstx_fb->retry_cnt; - priv->stats.txfeedbackretry += pstx_fb->retry_cnt; -} - -static void cmpk_handle_tx_feedback(struct net_device *dev, u8 *pmsg) -{ - struct r8192_priv *priv = rtllib_priv(dev); - struct cmpk_txfb rx_tx_fb; - - priv->stats.txfeedback++; - - - memcpy((u8 *)&rx_tx_fb, pmsg, sizeof(struct cmpk_txfb)); - cmpk_count_txstatistic(dev, &rx_tx_fb); -} - -static void cmdpkt_beacontimerinterrupt_819xusb(struct net_device *dev) -{ - struct r8192_priv *priv = rtllib_priv(dev); - - if ((priv->rtllib->current_network.mode == IEEE_A) || - (priv->rtllib->current_network.mode == IEEE_N_5G) || - ((priv->rtllib->current_network.mode == IEEE_N_24G) && - (!priv->rtllib->pHTInfo->bCurSuppCCK))) - DMESG("send beacon frame tx rate is 6Mbpm\n"); - else - DMESG("send beacon frame tx rate is 1Mbpm\n"); -} - -static void cmpk_handle_interrupt_status(struct net_device *dev, u8 *pmsg) -{ - struct cmpk_intr_sta rx_intr_status; - struct r8192_priv *priv = rtllib_priv(dev); - - DMESG("---> cmpk_Handle_Interrupt_Status()\n"); - - rx_intr_status.length = pmsg[1]; - if (rx_intr_status.length != (sizeof(struct cmpk_intr_sta) - 2)) { - DMESG("cmpk_Handle_Interrupt_Status: wrong length!\n"); - return; - } - - if (priv->rtllib->iw_mode == IW_MODE_ADHOC) { - rx_intr_status.interrupt_status = *((u32 *)(pmsg + 4)); - - DMESG("interrupt status = 0x%x\n", - rx_intr_status.interrupt_status); - - if (rx_intr_status.interrupt_status & ISR_TxBcnOk) { - priv->rtllib->bibsscoordinator = true; - priv->stats.txbeaconokint++; - } else if (rx_intr_status.interrupt_status & ISR_TxBcnErr) { - priv->rtllib->bibsscoordinator = false; - priv->stats.txbeaconerr++; - } - - if (rx_intr_status.interrupt_status & ISR_BcnTimerIntr) - cmdpkt_beacontimerinterrupt_819xusb(dev); - } - - DMESG("<---- cmpk_handle_interrupt_status()\n"); - -} - -static void cmpk_count_tx_status(struct net_device *dev, - struct cmpk_tx_status *pstx_status) -{ - struct r8192_priv *priv = rtllib_priv(dev); - -#ifdef ENABLE_PS - - enum rt_rf_power_state rtstate; - - pAdapter->HalFunc.GetHwRegHandler(pAdapter, HW_VAR_RF_STATE, - (pu1Byte)(&rtState)); - - if (rtState == eRfOff) - return; -#endif - - priv->stats.txfeedbackok += pstx_status->txok; - priv->stats.txoktotal += pstx_status->txok; - - priv->stats.txfeedbackfail += pstx_status->txfail; - priv->stats.txerrtotal += pstx_status->txfail; - - priv->stats.txretrycount += pstx_status->txretry; - priv->stats.txfeedbackretry += pstx_status->txretry; - - - priv->stats.txmulticast += pstx_status->txmcok; - priv->stats.txbroadcast += pstx_status->txbcok; - priv->stats.txunicast += pstx_status->txucok; - - priv->stats.txerrmulticast += pstx_status->txmcfail; - priv->stats.txerrbroadcast += pstx_status->txbcfail; - priv->stats.txerrunicast += pstx_status->txucfail; - - priv->stats.txbytesmulticast += pstx_status->txmclength; - priv->stats.txbytesbroadcast += pstx_status->txbclength; - priv->stats.txbytesunicast += pstx_status->txuclength; - - priv->stats.last_packet_rate = pstx_status->rate; -} - -static void cmpk_handle_tx_status(struct net_device *dev, u8 *pmsg) -{ - struct cmpk_tx_status rx_tx_sts; - - memcpy((void *)&rx_tx_sts, (void *)pmsg, sizeof(struct cmpk_tx_status)); - cmpk_count_tx_status(dev, &rx_tx_sts); -} - -static void cmpk_handle_tx_rate_history(struct net_device *dev, u8 *pmsg) -{ - struct cmpk_tx_rahis *ptxrate; - u8 i, j; - u16 length = sizeof(struct cmpk_tx_rahis); - u32 *ptemp; - struct r8192_priv *priv = rtllib_priv(dev); - -#ifdef ENABLE_PS - pAdapter->HalFunc.GetHwRegHandler(pAdapter, HW_VAR_RF_STATE, - (pu1Byte)(&rtState)); - - if (rtState == eRfOff) - return; -#endif - - ptemp = (u32 *)pmsg; - - for (i = 0; i < (length / 4); i++) { - u16 temp1, temp2; - - temp1 = ptemp[i] & 0x0000FFFF; - temp2 = ptemp[i] >> 16; - ptemp[i] = (temp1 << 16) | temp2; - } - - ptxrate = (struct cmpk_tx_rahis *)pmsg; - - if (ptxrate == NULL) - return; - - for (i = 0; i < 16; i++) { - if (i < 4) - priv->stats.txrate.cck[i] += ptxrate->cck[i]; - - if (i < 8) - priv->stats.txrate.ofdm[i] += ptxrate->ofdm[i]; - - for (j = 0; j < 4; j++) - priv->stats.txrate.ht_mcs[j][i] += - ptxrate->ht_mcs[j][i]; - } -} - -u32 cmpk_message_handle_rx(struct net_device *dev, - struct rtllib_rx_stats *pstats) -{ - int total_length; - u8 cmd_length, exe_cnt = 0; - u8 element_id; - u8 *pcmd_buff; - - RT_TRACE(COMP_CMDPKT, "---->cmpk_message_handle_rx()\n"); - - if (pstats == NULL) - return 0; - - total_length = pstats->Length; - - pcmd_buff = pstats->virtual_address; - - element_id = pcmd_buff[0]; - - while (total_length > 0 || exe_cnt++ > 100) { - element_id = pcmd_buff[0]; - - switch (element_id) { - case RX_TX_FEEDBACK: - RT_TRACE(COMP_CMDPKT, - "---->cmpk_message_handle_rx():RX_TX_FEEDBACK\n"); - cmpk_handle_tx_feedback(dev, pcmd_buff); - cmd_length = CMPK_RX_TX_FB_SIZE; - break; - case RX_INTERRUPT_STATUS: - RT_TRACE(COMP_CMDPKT, - "---->cmpk_message_handle_rx():RX_INTERRUPT_STATUS\n"); - cmpk_handle_interrupt_status(dev, pcmd_buff); - cmd_length = sizeof(struct cmpk_intr_sta); - break; - case BOTH_QUERY_CONFIG: - RT_TRACE(COMP_CMDPKT, - "---->cmpk_message_handle_rx():BOTH_QUERY_CONFIG\n"); - cmd_length = CMPK_BOTH_QUERY_CONFIG_SIZE; - break; - case RX_TX_STATUS: - RT_TRACE(COMP_CMDPKT, - "---->cmpk_message_handle_rx():RX_TX_STATUS\n"); - cmpk_handle_tx_status(dev, pcmd_buff); - cmd_length = CMPK_RX_TX_STS_SIZE; - break; - case RX_TX_PER_PKT_FEEDBACK: - RT_TRACE(COMP_CMDPKT, - "---->cmpk_message_handle_rx():RX_TX_PER_PKT_FEEDBACK\n"); - cmd_length = CMPK_RX_TX_FB_SIZE; - break; - case RX_TX_RATE_HISTORY: - RT_TRACE(COMP_CMDPKT, - "---->cmpk_message_handle_rx():RX_TX_HISTORY\n"); - cmpk_handle_tx_rate_history(dev, pcmd_buff); - cmd_length = CMPK_TX_RAHIS_SIZE; - break; - default: - - RT_TRACE(COMP_CMDPKT, - "---->cmpk_message_handle_rx():unknown CMD Element\n"); - return 1; - } - - total_length -= cmd_length; - pcmd_buff += cmd_length; - } - return 1; -} diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_cmdpkt.h b/drivers/staging/rtl8192e/rtl8192e/r8192E_cmdpkt.h index 2693682..f714d51 100644 --- a/drivers/staging/rtl8192e/rtl8192e/r8192E_cmdpkt.h +++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_cmdpkt.h @@ -18,142 +18,8 @@ ******************************************************************************/ #ifndef R819XUSB_CMDPKT_H #define R819XUSB_CMDPKT_H -#define CMPK_RX_TX_FB_SIZE sizeof(struct cmpk_txfb) -#define CMPK_TX_SET_CONFIG_SIZE sizeof(struct cmpk_set_cfg) -#define CMPK_BOTH_QUERY_CONFIG_SIZE sizeof(struct cmpk_set_cfg) -#define CMPK_RX_TX_STS_SIZE sizeof(struct cmpk_tx_status) -#define CMPK_RX_DBG_MSG_SIZE sizeof(struct cmpk_rx_dbginfo) -#define CMPK_TX_RAHIS_SIZE sizeof(struct cmpk_tx_rahis) -#define ISR_TxBcnOk BIT27 -#define ISR_TxBcnErr BIT26 -#define ISR_BcnTimerIntr BIT13 - - -struct cmpk_txfb { - u8 element_id; - u8 length; - u8 TID:4; - u8 fail_reason:3; - u8 tok:1; - u8 reserve1:4; - u8 pkt_type:2; - u8 bandwidth:1; - u8 qos_pkt:1; - - u8 reserve2; - u8 retry_cnt; - u16 pkt_id; - - u16 seq_num; - u8 s_rate; - u8 f_rate; - - u8 s_rts_rate; - u8 f_rts_rate; - u16 pkt_length; - - u16 reserve3; - u16 duration; -}; - -struct cmpk_intr_sta { - u8 element_id; - u8 length; - u16 reserve; - u32 interrupt_status; -}; - - -struct cmpk_set_cfg { - u8 element_id; - u8 length; - u16 reserve1; - u8 cfg_reserve1:3; - u8 cfg_size:2; - u8 cfg_type:2; - u8 cfg_action:1; - u8 cfg_reserve2; - u8 cfg_page:4; - u8 cfg_reserve3:4; - u8 cfg_offset; - u32 value; - u32 mask; -}; - -#define cmpk_query_cfg_t struct cmpk_set_cfg - -struct cmpk_tx_status { - u16 reserve1; - u8 length; - u8 element_id; - - u16 txfail; - u16 txok; - - u16 txmcok; - u16 txretry; - - u16 txucok; - u16 txbcok; - - u16 txbcfail; - u16 txmcfail; - - u16 reserve2; - u16 txucfail; - - u32 txmclength; - u32 txbclength; - u32 txuclength; - - u16 reserve3_23; - u8 reserve3_1; - u8 rate; -} __packed; - -struct cmpk_rx_dbginfo { - u16 reserve1; - u8 length; - u8 element_id; - - -}; - -struct cmpk_tx_rahis { - u8 element_id; - u8 length; - u16 reserved1; - - u16 cck[4]; - - u16 ofdm[8]; - - - - - - u16 ht_mcs[4][16]; - -} __packed; - -enum cmpk_element { - RX_TX_FEEDBACK = 0, - RX_INTERRUPT_STATUS = 1, - TX_SET_CONFIG = 2, - BOTH_QUERY_CONFIG = 3, - RX_TX_STATUS = 4, - RX_DBGINFO_FEEDBACK = 5, - RX_TX_PER_PKT_FEEDBACK = 6, - RX_TX_RATE_HISTORY = 7, - RX_CMD_ELE_MAX -}; - -extern u32 cmpk_message_handle_rx(struct net_device *dev, - struct rtllib_rx_stats *pstats); extern bool cmpk_message_handle_tx(struct net_device *dev, u8 *codevirtualaddress, u32 packettype, u32 buffer_len); - - #endif -- 1.8.4.1 _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel