rtlwifi: Add encryption argument in rtl_is_special_data for checking DHCP packet.
authorTaehee Yoo <ap420073@gmail.com>
Fri, 27 Mar 2015 15:22:39 +0000 (00:22 +0900)
committerKalle Valo <kvalo@codeaurora.org>
Tue, 7 Apr 2015 17:09:04 +0000 (20:09 +0300)
rtl8192cu can't connect to AP after physical reconnect.
according to dmesg, that problem's cause was DHCP timeout.

rtl_is_special_data function checks packet type for adjusting rate.
when that function is called from _rtl_rc_get_highest_rix, it can not
calculate offset correctly. so i add argument is_encn in rtl_is_special_data.
is_enc variable mean that iv header is added in skb parameter.

i test only rtl8192cu chipset. because i doesn't have other rtlwifi chipsets.

Signed-off-by: Taehee Yoo <ap420073@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/rtlwifi/base.c
drivers/net/wireless/rtlwifi/base.h
drivers/net/wireless/rtlwifi/pci.c
drivers/net/wireless/rtlwifi/rc.c

index 074f716020aae4e28d3e8340da846514065a94db..01f56c7df8b501f7b6390a1f2a12bd1a70168a26 100644 (file)
@@ -1315,7 +1315,8 @@ static void setup_arp_tx(struct rtl_priv *rtlpriv, struct rtl_ps_ctl *ppsc)
 }
 
 /*should call before software enc*/
-u8 rtl_is_special_data(struct ieee80211_hw *hw, struct sk_buff *skb, u8 is_tx)
+u8 rtl_is_special_data(struct ieee80211_hw *hw, struct sk_buff *skb, u8 is_tx,
+                      bool is_enc)
 {
        struct rtl_priv *rtlpriv = rtl_priv(hw);
        struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw));
@@ -1344,7 +1345,9 @@ u8 rtl_is_special_data(struct ieee80211_hw *hw, struct sk_buff *skb, u8 is_tx)
                break;
        }
 
-       offset = mac_hdr_len + SNAP_SIZE + encrypt_header_len;
+       offset = mac_hdr_len + SNAP_SIZE;
+       if (is_enc)
+               offset += encrypt_header_len;
        ether_type = be16_to_cpup((__be16 *)(skb->data + offset));
 
        if (ETH_P_IP == ether_type) {
index ff9a4bfd45154aaaf37055d82eba1d32b0276a83..74233d601a909b12b6eb33dcd1793db28efca3da 100644 (file)
@@ -120,7 +120,8 @@ bool rtl_action_proc(struct ieee80211_hw *hw, struct sk_buff *skb, u8 is_tx);
 int rtlwifi_rate_mapping(struct ieee80211_hw *hw, bool isht,
                         bool isvht, u8 desc_rate);
 bool rtl_tx_mgmt_proc(struct ieee80211_hw *hw, struct sk_buff *skb);
-u8 rtl_is_special_data(struct ieee80211_hw *hw, struct sk_buff *skb, u8 is_tx);
+u8 rtl_is_special_data(struct ieee80211_hw *hw, struct sk_buff *skb, u8 is_tx,
+                      bool is_enc);
 
 void rtl_beacon_statistic(struct ieee80211_hw *hw, struct sk_buff *skb);
 int rtl_tx_agg_start(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
index 8c45cf44ce24bac6393902ae2daf708b0ce11e6a..f46c9d7f652813a46fe6d8bbe24a48ab814afd6f 100644 (file)
@@ -887,7 +887,7 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw)
                                unicast = true;
                                rtlpriv->stats.rxbytesunicast += skb->len;
                        }
-                       rtl_is_special_data(hw, skb, false);
+                       rtl_is_special_data(hw, skb, false, true);
 
                        if (ieee80211_is_data(fc)) {
                                rtlpriv->cfg->ops->led_control(hw, LED_CTL_RX);
index 7863bd278b227f6c7dd5057405d64a042f2fe69a..74c14ce28238eed70f8ad798f0724642147411d3 100644 (file)
@@ -56,7 +56,8 @@ static u8 _rtl_rc_get_highest_rix(struct rtl_priv *rtlpriv,
                wireless_mode = sta_entry->wireless_mode;
        }
 
-       if (rtl_is_special_data(rtlpriv->mac80211.hw, skb, true) || not_data) {
+       if (rtl_is_special_data(rtlpriv->mac80211.hw, skb, true, false) ||
+           not_data) {
                return 0;
        } else {
                if (rtlhal->current_bandtype == BAND_ON_2_4G) {
@@ -201,7 +202,7 @@ static void rtl_tx_status(void *ppriv,
        if (!priv_sta || !ieee80211_is_data(fc))
                return;
 
-       if (rtl_is_special_data(mac->hw, skb, true))
+       if (rtl_is_special_data(mac->hw, skb, true, true))
                return;
 
        if (is_multicast_ether_addr(ieee80211_get_DA(hdr)) ||