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,56 +699,50 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw) ...@@ -696,56 +699,50 @@ 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));
if (is_broadcast_ether_addr(hdr->addr1)) { if (is_broadcast_ether_addr(hdr->addr1)) {
;/*TODO*/ ;/*TODO*/
} else if (is_multicast_ether_addr(hdr->addr1)) { } else if (is_multicast_ether_addr(hdr->addr1)) {
;/*TODO*/ ;/*TODO*/
} else { } else {
unicast = true; unicast = true;
rtlpriv->stats.rxbytesunicast += skb->len; rtlpriv->stats.rxbytesunicast += skb->len;
} }
rtl_is_special_data(hw, skb, false); rtl_is_special_data(hw, skb, false);
if (ieee80211_is_data(fc)) { if (ieee80211_is_data(fc)) {
rtlpriv->cfg->ops->led_control(hw, LED_CTL_RX); rtlpriv->cfg->ops->led_control(hw, LED_CTL_RX);
if (unicast) if (unicast)
rtlpriv->link_info.num_rx_inperiod++; rtlpriv->link_info.num_rx_inperiod++;
} }
/* for sw lps */ /* for sw lps */
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);
} else {
if (unlikely(!rtl_action_proc(hw, skb, false))) {
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
} else { } else {
if (unlikely(!rtl_action_proc(hw, skb, struct sk_buff *uskb = NULL;
false))) { u8 *pdata;
dev_kfree_skb_any(skb); uskb = dev_alloc_skb(skb->len + 128);
} else { memcpy(IEEE80211_SKB_RXCB(uskb),
struct sk_buff *uskb = NULL; &rx_status, sizeof(rx_status));
u8 *pdata; pdata = (u8 *)skb_put(uskb, skb->len);
uskb = dev_alloc_skb(skb->len + 128); memcpy(pdata, skb->data, skb->len);
memcpy(IEEE80211_SKB_RXCB(uskb), dev_kfree_skb_any(skb);
&rx_status, sizeof(rx_status));
pdata = (u8 *)skb_put(uskb, skb->len); ieee80211_rx_irqsafe(hw, uskb);
memcpy(pdata, skb->data, skb->len);
dev_kfree_skb_any(skb);
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 +
......
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