aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTaehee Yoo <ap420073@gmail.com>2015-03-27 11:22:39 -0400
committerKalle Valo <kvalo@codeaurora.org>2015-04-07 13:09:04 -0400
commitcad737dfde3566e3293e884e8b391e2cae7e8068 (patch)
tree55f5cf4c3c228d9848a23789ee861285df5443b9
parent00ca18034f62a6a3f29b8e660198e4ea573f2657 (diff)
rtlwifi: Add encryption argument in rtl_is_special_data for checking DHCP packet.
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>
-rw-r--r--drivers/net/wireless/rtlwifi/base.c7
-rw-r--r--drivers/net/wireless/rtlwifi/base.h3
-rw-r--r--drivers/net/wireless/rtlwifi/pci.c2
-rw-r--r--drivers/net/wireless/rtlwifi/rc.c5
4 files changed, 11 insertions, 6 deletions
diff --git a/drivers/net/wireless/rtlwifi/base.c b/drivers/net/wireless/rtlwifi/base.c
index 074f716020aa..01f56c7df8b5 100644
--- a/drivers/net/wireless/rtlwifi/base.c
+++ b/drivers/net/wireless/rtlwifi/base.c
@@ -1315,7 +1315,8 @@ static void setup_arp_tx(struct rtl_priv *rtlpriv, struct rtl_ps_ctl *ppsc)
1315} 1315}
1316 1316
1317/*should call before software enc*/ 1317/*should call before software enc*/
1318u8 rtl_is_special_data(struct ieee80211_hw *hw, struct sk_buff *skb, u8 is_tx) 1318u8 rtl_is_special_data(struct ieee80211_hw *hw, struct sk_buff *skb, u8 is_tx,
1319 bool is_enc)
1319{ 1320{
1320 struct rtl_priv *rtlpriv = rtl_priv(hw); 1321 struct rtl_priv *rtlpriv = rtl_priv(hw);
1321 struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw)); 1322 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)
1344 break; 1345 break;
1345 } 1346 }
1346 1347
1347 offset = mac_hdr_len + SNAP_SIZE + encrypt_header_len; 1348 offset = mac_hdr_len + SNAP_SIZE;
1349 if (is_enc)
1350 offset += encrypt_header_len;
1348 ether_type = be16_to_cpup((__be16 *)(skb->data + offset)); 1351 ether_type = be16_to_cpup((__be16 *)(skb->data + offset));
1349 1352
1350 if (ETH_P_IP == ether_type) { 1353 if (ETH_P_IP == ether_type) {
diff --git a/drivers/net/wireless/rtlwifi/base.h b/drivers/net/wireless/rtlwifi/base.h
index ff9a4bfd4515..74233d601a90 100644
--- a/drivers/net/wireless/rtlwifi/base.h
+++ b/drivers/net/wireless/rtlwifi/base.h
@@ -120,7 +120,8 @@ bool rtl_action_proc(struct ieee80211_hw *hw, struct sk_buff *skb, u8 is_tx);
120int rtlwifi_rate_mapping(struct ieee80211_hw *hw, bool isht, 120int rtlwifi_rate_mapping(struct ieee80211_hw *hw, bool isht,
121 bool isvht, u8 desc_rate); 121 bool isvht, u8 desc_rate);
122bool rtl_tx_mgmt_proc(struct ieee80211_hw *hw, struct sk_buff *skb); 122bool rtl_tx_mgmt_proc(struct ieee80211_hw *hw, struct sk_buff *skb);
123u8 rtl_is_special_data(struct ieee80211_hw *hw, struct sk_buff *skb, u8 is_tx); 123u8 rtl_is_special_data(struct ieee80211_hw *hw, struct sk_buff *skb, u8 is_tx,
124 bool is_enc);
124 125
125void rtl_beacon_statistic(struct ieee80211_hw *hw, struct sk_buff *skb); 126void rtl_beacon_statistic(struct ieee80211_hw *hw, struct sk_buff *skb);
126int rtl_tx_agg_start(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 127int rtl_tx_agg_start(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
diff --git a/drivers/net/wireless/rtlwifi/pci.c b/drivers/net/wireless/rtlwifi/pci.c
index 8c45cf44ce24..f46c9d7f6528 100644
--- a/drivers/net/wireless/rtlwifi/pci.c
+++ b/drivers/net/wireless/rtlwifi/pci.c
@@ -887,7 +887,7 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw)
887 unicast = true; 887 unicast = true;
888 rtlpriv->stats.rxbytesunicast += skb->len; 888 rtlpriv->stats.rxbytesunicast += skb->len;
889 } 889 }
890 rtl_is_special_data(hw, skb, false); 890 rtl_is_special_data(hw, skb, false, true);
891 891
892 if (ieee80211_is_data(fc)) { 892 if (ieee80211_is_data(fc)) {
893 rtlpriv->cfg->ops->led_control(hw, LED_CTL_RX); 893 rtlpriv->cfg->ops->led_control(hw, LED_CTL_RX);
diff --git a/drivers/net/wireless/rtlwifi/rc.c b/drivers/net/wireless/rtlwifi/rc.c
index 7863bd278b22..74c14ce28238 100644
--- a/drivers/net/wireless/rtlwifi/rc.c
+++ b/drivers/net/wireless/rtlwifi/rc.c
@@ -56,7 +56,8 @@ static u8 _rtl_rc_get_highest_rix(struct rtl_priv *rtlpriv,
56 wireless_mode = sta_entry->wireless_mode; 56 wireless_mode = sta_entry->wireless_mode;
57 } 57 }
58 58
59 if (rtl_is_special_data(rtlpriv->mac80211.hw, skb, true) || not_data) { 59 if (rtl_is_special_data(rtlpriv->mac80211.hw, skb, true, false) ||
60 not_data) {
60 return 0; 61 return 0;
61 } else { 62 } else {
62 if (rtlhal->current_bandtype == BAND_ON_2_4G) { 63 if (rtlhal->current_bandtype == BAND_ON_2_4G) {
@@ -201,7 +202,7 @@ static void rtl_tx_status(void *ppriv,
201 if (!priv_sta || !ieee80211_is_data(fc)) 202 if (!priv_sta || !ieee80211_is_data(fc))
202 return; 203 return;
203 204
204 if (rtl_is_special_data(mac->hw, skb, true)) 205 if (rtl_is_special_data(mac->hw, skb, true, true))
205 return; 206 return;
206 207
207 if (is_multicast_ether_addr(ieee80211_get_DA(hdr)) || 208 if (is_multicast_ether_addr(ieee80211_get_DA(hdr)) ||