diff options
Diffstat (limited to 'drivers/net/wireless/rtlwifi/rtl8192cu/trx.c')
-rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8192cu/trx.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c b/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c index f383d5f1fed5..cbead007171f 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c +++ b/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c | |||
@@ -325,6 +325,7 @@ bool rtl92cu_rx_query_desc(struct ieee80211_hw *hw, | |||
325 | && (GET_RX_DESC_FAGGR(pdesc) == 1)); | 325 | && (GET_RX_DESC_FAGGR(pdesc) == 1)); |
326 | stats->timestamp_low = GET_RX_DESC_TSFL(pdesc); | 326 | stats->timestamp_low = GET_RX_DESC_TSFL(pdesc); |
327 | stats->rx_is40Mhzpacket = (bool) GET_RX_DESC_BW(pdesc); | 327 | stats->rx_is40Mhzpacket = (bool) GET_RX_DESC_BW(pdesc); |
328 | stats->is_ht = (bool)GET_RX_DESC_RX_HT(pdesc); | ||
328 | rx_status->freq = hw->conf.chandef.chan->center_freq; | 329 | rx_status->freq = hw->conf.chandef.chan->center_freq; |
329 | rx_status->band = hw->conf.chandef.chan->band; | 330 | rx_status->band = hw->conf.chandef.chan->band; |
330 | if (GET_RX_DESC_CRC32(pdesc)) | 331 | if (GET_RX_DESC_CRC32(pdesc)) |
@@ -338,10 +339,8 @@ bool rtl92cu_rx_query_desc(struct ieee80211_hw *hw, | |||
338 | rx_status->flag |= RX_FLAG_MACTIME_START; | 339 | rx_status->flag |= RX_FLAG_MACTIME_START; |
339 | if (stats->decrypted) | 340 | if (stats->decrypted) |
340 | rx_status->flag |= RX_FLAG_DECRYPTED; | 341 | rx_status->flag |= RX_FLAG_DECRYPTED; |
341 | rx_status->rate_idx = rtlwifi_rate_mapping(hw, | 342 | rx_status->rate_idx = rtlwifi_rate_mapping(hw, stats->is_ht, |
342 | (bool)GET_RX_DESC_RX_HT(pdesc), | 343 | false, stats->rate); |
343 | (u8)GET_RX_DESC_RX_MCS(pdesc), | ||
344 | (bool)GET_RX_DESC_PAGGR(pdesc)); | ||
345 | rx_status->mactime = GET_RX_DESC_TSFL(pdesc); | 344 | rx_status->mactime = GET_RX_DESC_TSFL(pdesc); |
346 | if (phystatus) { | 345 | if (phystatus) { |
347 | p_drvinfo = (struct rx_fwinfo_92c *)(skb->data + | 346 | p_drvinfo = (struct rx_fwinfo_92c *)(skb->data + |
@@ -393,6 +392,7 @@ static void _rtl_rx_process(struct ieee80211_hw *hw, struct sk_buff *skb) | |||
393 | && (GET_RX_DESC_FAGGR(rxdesc) == 1)); | 392 | && (GET_RX_DESC_FAGGR(rxdesc) == 1)); |
394 | stats.timestamp_low = GET_RX_DESC_TSFL(rxdesc); | 393 | stats.timestamp_low = GET_RX_DESC_TSFL(rxdesc); |
395 | stats.rx_is40Mhzpacket = (bool) GET_RX_DESC_BW(rxdesc); | 394 | stats.rx_is40Mhzpacket = (bool) GET_RX_DESC_BW(rxdesc); |
395 | stats.is_ht = (bool)GET_RX_DESC_RX_HT(rxdesc); | ||
396 | /* TODO: is center_freq changed when doing scan? */ | 396 | /* TODO: is center_freq changed when doing scan? */ |
397 | /* TODO: Shall we add protection or just skip those two step? */ | 397 | /* TODO: Shall we add protection or just skip those two step? */ |
398 | rx_status->freq = hw->conf.chandef.chan->center_freq; | 398 | rx_status->freq = hw->conf.chandef.chan->center_freq; |
@@ -406,10 +406,8 @@ static void _rtl_rx_process(struct ieee80211_hw *hw, struct sk_buff *skb) | |||
406 | if (GET_RX_DESC_RX_HT(rxdesc)) | 406 | if (GET_RX_DESC_RX_HT(rxdesc)) |
407 | rx_status->flag |= RX_FLAG_HT; | 407 | rx_status->flag |= RX_FLAG_HT; |
408 | /* Data rate */ | 408 | /* Data rate */ |
409 | rx_status->rate_idx = rtlwifi_rate_mapping(hw, | 409 | rx_status->rate_idx = rtlwifi_rate_mapping(hw, stats.is_ht, |
410 | (bool)GET_RX_DESC_RX_HT(rxdesc), | 410 | false, stats.rate); |
411 | (u8)GET_RX_DESC_RX_MCS(rxdesc), | ||
412 | (bool)GET_RX_DESC_PAGGR(rxdesc)); | ||
413 | /* There is a phy status after this rx descriptor. */ | 411 | /* There is a phy status after this rx descriptor. */ |
414 | if (GET_RX_DESC_PHY_STATUS(rxdesc)) { | 412 | if (GET_RX_DESC_PHY_STATUS(rxdesc)) { |
415 | p_drvinfo = (struct rx_fwinfo_92c *)(rxdesc + RTL_RX_DESC_SIZE); | 413 | p_drvinfo = (struct rx_fwinfo_92c *)(rxdesc + RTL_RX_DESC_SIZE); |
@@ -545,7 +543,7 @@ void rtl92cu_tx_fill_desc(struct ieee80211_hw *hw, | |||
545 | SET_TX_DESC_RTS_BW(txdesc, 0); | 543 | SET_TX_DESC_RTS_BW(txdesc, 0); |
546 | SET_TX_DESC_RTS_SC(txdesc, tcb_desc->rts_sc); | 544 | SET_TX_DESC_RTS_SC(txdesc, tcb_desc->rts_sc); |
547 | SET_TX_DESC_RTS_SHORT(txdesc, | 545 | SET_TX_DESC_RTS_SHORT(txdesc, |
548 | ((tcb_desc->rts_rate <= DESC92_RATE54M) ? | 546 | ((tcb_desc->rts_rate <= DESC_RATE54M) ? |
549 | (tcb_desc->rts_use_shortpreamble ? 1 : 0) | 547 | (tcb_desc->rts_use_shortpreamble ? 1 : 0) |
550 | : (tcb_desc->rts_use_shortgi ? 1 : 0))); | 548 | : (tcb_desc->rts_use_shortgi ? 1 : 0))); |
551 | if (mac->bw_40) { | 549 | if (mac->bw_40) { |
@@ -644,7 +642,7 @@ void rtl92cu_fill_fake_txdesc(struct ieee80211_hw *hw, u8 * pDesc, | |||
644 | } | 642 | } |
645 | SET_TX_DESC_USE_RATE(pDesc, 1); /* use data rate which is set by Sw */ | 643 | SET_TX_DESC_USE_RATE(pDesc, 1); /* use data rate which is set by Sw */ |
646 | SET_TX_DESC_OWN(pDesc, 1); | 644 | SET_TX_DESC_OWN(pDesc, 1); |
647 | SET_TX_DESC_TX_RATE(pDesc, DESC92_RATE1M); | 645 | SET_TX_DESC_TX_RATE(pDesc, DESC_RATE1M); |
648 | _rtl_tx_desc_checksum(pDesc); | 646 | _rtl_tx_desc_checksum(pDesc); |
649 | } | 647 | } |
650 | 648 | ||
@@ -660,7 +658,7 @@ void rtl92cu_tx_fill_cmddesc(struct ieee80211_hw *hw, | |||
660 | memset((void *)pdesc, 0, RTL_TX_HEADER_SIZE); | 658 | memset((void *)pdesc, 0, RTL_TX_HEADER_SIZE); |
661 | if (firstseg) | 659 | if (firstseg) |
662 | SET_TX_DESC_OFFSET(pdesc, RTL_TX_HEADER_SIZE); | 660 | SET_TX_DESC_OFFSET(pdesc, RTL_TX_HEADER_SIZE); |
663 | SET_TX_DESC_TX_RATE(pdesc, DESC92_RATE1M); | 661 | SET_TX_DESC_TX_RATE(pdesc, DESC_RATE1M); |
664 | SET_TX_DESC_SEQ(pdesc, 0); | 662 | SET_TX_DESC_SEQ(pdesc, 0); |
665 | SET_TX_DESC_LINIP(pdesc, 0); | 663 | SET_TX_DESC_LINIP(pdesc, 0); |
666 | SET_TX_DESC_QUEUE_SEL(pdesc, fw_queue); | 664 | SET_TX_DESC_QUEUE_SEL(pdesc, fw_queue); |