diff options
Diffstat (limited to 'drivers/net/wireless/mwifiex/util.c')
-rw-r--r-- | drivers/net/wireless/mwifiex/util.c | 22 |
1 files changed, 22 insertions, 0 deletions
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) | |||
167 | skb->dev = priv->netdev; | 167 | skb->dev = priv->netdev; |
168 | skb->protocol = eth_type_trans(skb, priv->netdev); | 168 | skb->protocol = eth_type_trans(skb, priv->netdev); |
169 | skb->ip_summed = CHECKSUM_NONE; | 169 | skb->ip_summed = CHECKSUM_NONE; |
170 | |||
171 | /* This is required only in case of 11n and USB as we alloc | ||
172 | * a buffer of 4K only if its 11N (to be able to receive 4K | ||
173 | * AMSDU packets). In case of SD we allocate buffers based | ||
174 | * on the size of packet and hence this is not needed. | ||
175 | * | ||
176 | * Modifying the truesize here as our allocation for each | ||
177 | * skb is 4K but we only receive 2K packets and this cause | ||
178 | * the kernel to start dropping packets in case where | ||
179 | * application has allocated buffer based on 2K size i.e. | ||
180 | * if there a 64K packet received (in IP fragments and | ||
181 | * application allocates 64K to receive this packet but | ||
182 | * this packet would almost double up because we allocate | ||
183 | * each 1.5K fragment in 4K and pass it up. As soon as the | ||
184 | * 64K limit hits kernel will start to drop rest of the | ||
185 | * fragments. Currently we fail the Filesndl-ht.scr script | ||
186 | * for UDP, hence this fix | ||
187 | */ | ||
188 | if ((adapter->iface_type == MWIFIEX_USB) && | ||
189 | (skb->truesize > MWIFIEX_RX_DATA_BUF_SIZE)) | ||
190 | skb->truesize += (skb->len - MWIFIEX_RX_DATA_BUF_SIZE); | ||
191 | |||
170 | priv->stats.rx_bytes += skb->len; | 192 | priv->stats.rx_bytes += skb->len; |
171 | priv->stats.rx_packets++; | 193 | priv->stats.rx_packets++; |
172 | if (in_interrupt()) | 194 | if (in_interrupt()) |