Commit 8db8ddf1 authored by Mike McCormack's avatar Mike McCormack Committed by John W. Linville

rtlwifi: Resubmit skbs with bad CRC early

Once we realize a bad packet was received, don't
waste time unmapping it, freeing it, then allocation
a new skb and mapping it, just resubmit the existing
skb.
Signed-off-by: default avatarMike McCormack <mikem@ring3k.org>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 2c333366
...@@ -669,6 +669,9 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw) ...@@ -669,6 +669,9 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw)
&rx_status, &rx_status,
(u8 *) pdesc, skb); (u8 *) pdesc, skb);
if (stats.crc || stats.hwerror)
goto done;
new_skb = dev_alloc_skb(rtlpci->rxbuffersize); new_skb = dev_alloc_skb(rtlpci->rxbuffersize);
if (unlikely(!new_skb)) { if (unlikely(!new_skb)) {
RT_TRACE(rtlpriv, (COMP_INTR | COMP_RECV), RT_TRACE(rtlpriv, (COMP_INTR | COMP_RECV),
...@@ -696,7 +699,6 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw) ...@@ -696,7 +699,6 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw)
hdr = rtl_get_hdr(skb); hdr = rtl_get_hdr(skb);
fc = rtl_get_fc(skb); fc = rtl_get_fc(skb);
if (!stats.crc && !stats.hwerror) {
memcpy(IEEE80211_SKB_RXCB(skb), &rx_status, memcpy(IEEE80211_SKB_RXCB(skb), &rx_status,
sizeof(rx_status)); sizeof(rx_status));
...@@ -722,14 +724,12 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw) ...@@ -722,14 +724,12 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw)
rtl_swlps_beacon(hw, (void *)skb->data, skb->len); rtl_swlps_beacon(hw, (void *)skb->data, skb->len);
rtl_recognize_peer(hw, (void *)skb->data, skb->len); rtl_recognize_peer(hw, (void *)skb->data, skb->len);
if ((rtlpriv->mac80211.opmode == NL80211_IFTYPE_AP) && if ((rtlpriv->mac80211.opmode == NL80211_IFTYPE_AP) &&
(rtlpriv->rtlhal.current_bandtype == (rtlpriv->rtlhal.current_bandtype == BAND_ON_2_4G) &&
BAND_ON_2_4G) &&
(ieee80211_is_beacon(fc) || (ieee80211_is_beacon(fc) ||
ieee80211_is_probe_resp(fc))) { ieee80211_is_probe_resp(fc))) {
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
} else { } else {
if (unlikely(!rtl_action_proc(hw, skb, if (unlikely(!rtl_action_proc(hw, skb, false))) {
false))) {
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
} else { } else {
struct sk_buff *uskb = NULL; struct sk_buff *uskb = NULL;
...@@ -744,9 +744,6 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw) ...@@ -744,9 +744,6 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw)
ieee80211_rx_irqsafe(hw, uskb); ieee80211_rx_irqsafe(hw, uskb);
} }
} }
} else {
dev_kfree_skb_any(skb);
}
if (((rtlpriv->link_info.num_rx_inperiod + if (((rtlpriv->link_info.num_rx_inperiod +
rtlpriv->link_info.num_tx_inperiod) > 8) || rtlpriv->link_info.num_tx_inperiod) > 8) ||
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment