From 4daffe3543667419294b6f22901b7255cbdebdf4 Mon Sep 17 00:00:00 2001 From: Amitkumar Karwar Date: Wed, 18 Apr 2012 20:08:28 -0700 Subject: mwifiex: add support for Marvell USB8797 chipset This patch supports Avastar 88W8797 chipset with USB interface. The corresponding firmware image file is located at: "mrvl/usb8797_uapsta.bin" Signed-off-by: Amitkumar Karwar Signed-off-by: Bing Zhao Signed-off-by: Kiran Divekar Signed-off-by: Frank Huang Signed-off-by: John W. Linville --- drivers/net/wireless/mwifiex/util.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'drivers/net/wireless/mwifiex/util.c') diff --git a/drivers/net/wireless/mwifiex/util.c b/drivers/net/wireless/mwifiex/util.c index 6b399976d6c8..2864c74bdb6f 100644 --- a/drivers/net/wireless/mwifiex/util.c +++ b/drivers/net/wireless/mwifiex/util.c @@ -167,6 +167,28 @@ int mwifiex_recv_packet(struct mwifiex_adapter *adapter, struct sk_buff *skb) skb->dev = priv->netdev; skb->protocol = eth_type_trans(skb, priv->netdev); skb->ip_summed = CHECKSUM_NONE; + + /* This is required only in case of 11n and USB as we alloc + * a buffer of 4K only if its 11N (to be able to receive 4K + * AMSDU packets). In case of SD we allocate buffers based + * on the size of packet and hence this is not needed. + * + * Modifying the truesize here as our allocation for each + * skb is 4K but we only receive 2K packets and this cause + * the kernel to start dropping packets in case where + * application has allocated buffer based on 2K size i.e. + * if there a 64K packet received (in IP fragments and + * application allocates 64K to receive this packet but + * this packet would almost double up because we allocate + * each 1.5K fragment in 4K and pass it up. As soon as the + * 64K limit hits kernel will start to drop rest of the + * fragments. Currently we fail the Filesndl-ht.scr script + * for UDP, hence this fix + */ + if ((adapter->iface_type == MWIFIEX_USB) && + (skb->truesize > MWIFIEX_RX_DATA_BUF_SIZE)) + skb->truesize += (skb->len - MWIFIEX_RX_DATA_BUF_SIZE); + priv->stats.rx_bytes += skb->len; priv->stats.rx_packets++; if (in_interrupt()) -- cgit v1.2.3-59-g8ed1b