Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+39 −42
Original line number Diff line number Diff line
@@ -669,6 +669,9 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw)
						 &rx_status,
						 (u8 *) pdesc, skb);

		if (stats.crc || stats.hwerror)
			goto done;

		new_skb = dev_alloc_skb(rtlpci->rxbuffersize);
		if (unlikely(!new_skb)) {
			RT_TRACE(rtlpriv, (COMP_INTR | COMP_RECV),
@@ -696,7 +699,6 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw)
		hdr = rtl_get_hdr(skb);
		fc = rtl_get_fc(skb);

		if (!stats.crc && !stats.hwerror) {
		memcpy(IEEE80211_SKB_RXCB(skb), &rx_status,
		       sizeof(rx_status));

@@ -722,14 +724,12 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw)
		rtl_swlps_beacon(hw, (void *)skb->data, skb->len);
		rtl_recognize_peer(hw, (void *)skb->data, skb->len);
		if ((rtlpriv->mac80211.opmode == NL80211_IFTYPE_AP) &&
			    (rtlpriv->rtlhal.current_bandtype ==
			     BAND_ON_2_4G) &&
		    (rtlpriv->rtlhal.current_bandtype == BAND_ON_2_4G) &&
		     (ieee80211_is_beacon(fc) ||
		     ieee80211_is_probe_resp(fc))) {
			dev_kfree_skb_any(skb);
		} else {
				if (unlikely(!rtl_action_proc(hw, skb,
				    false))) {
			if (unlikely(!rtl_action_proc(hw, skb, false))) {
				dev_kfree_skb_any(skb);
			} else {
				struct sk_buff *uskb = NULL;
@@ -744,9 +744,6 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw)
				ieee80211_rx_irqsafe(hw, uskb);
			}
		}
		} else {
			dev_kfree_skb_any(skb);
		}

		if (((rtlpriv->link_info.num_rx_inperiod +
			rtlpriv->link_info.num_tx_inperiod) > 8) ||