libertas: make if_sdio align packets
authorPierre Ossman <drzeus@drzeus.cx>
Mon, 22 Oct 2007 17:05:32 +0000 (19:05 +0200)
committerJeff Garzik <jeff@garzik.org>
Sat, 10 Nov 2007 09:25:10 +0000 (04:25 -0500)
Incoming packets have to be aligned or the IP stack becomes upset.
Make sure to shift them two bytes to achieve this.

Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/libertas/if_sdio.c

index a8e1707..b24425f 100644 (file)
@@ -182,12 +182,14 @@ static int if_sdio_handle_data(struct if_sdio_card *card,
                goto out;
        }
 
-       skb = dev_alloc_skb(MRVDRV_ETH_RX_PACKET_BUFFER_SIZE);
+       skb = dev_alloc_skb(MRVDRV_ETH_RX_PACKET_BUFFER_SIZE + NET_IP_ALIGN);
        if (!skb) {
                ret = -ENOMEM;
                goto out;
        }
 
+       skb_reserve(skb, NET_IP_ALIGN);
+
        data = skb_put(skb, size);
 
        memcpy(data, buffer, size);