rtlwifi: Fix large packet issue
authorChaoming Li <chaoming_li@realsil.com.cn>
Wed, 22 Dec 2010 16:56:02 +0000 (10:56 -0600)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 22 Dec 2010 20:45:52 +0000 (15:45 -0500)
An RX buffer is set to 9100 bytes to receive 8K AMSDU; however, an skb
of this size fails in the kernel.

Signed-off-by: Chaoming Li <chaoming_li@realsil.com.cn>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/rtlwifi/pci.c

index 353e20358885ab5d34812bd6bef4766954cbaaa4..0fa36aa6701a80fb1b06f03891bd3830d7f5e4ca 100644 (file)
@@ -612,10 +612,22 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw)
                                                    num_rx_inperiod++;
                                }
 
-                               if (unlikely(!rtl_action_proc(hw, skb, false)))
+                               if (unlikely(!rtl_action_proc(hw, skb,
+                                   false))) {
                                        dev_kfree_skb_any(skb);
-                               else
-                                       ieee80211_rx_irqsafe(hw, skb);
+                               } else {
+                                       struct sk_buff *uskb = NULL;
+                                       u8 *pdata;
+                                       uskb = dev_alloc_skb(skb->len + 128);
+                                       memcpy(IEEE80211_SKB_RXCB(uskb),
+                                                       &rx_status,
+                                                       sizeof(rx_status));
+                                       pdata = (u8 *)skb_put(uskb, skb->len);
+                                       memcpy(pdata, skb->data, skb->len);
+                                       dev_kfree_skb_any(skb);
+
+                                       ieee80211_rx_irqsafe(hw, uskb);
+                               }
                        } else {
                                dev_kfree_skb_any(skb);
                        }