[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20071124165201.GA31677@deine-taler.de>
Date: Sat, 24 Nov 2007 17:52:01 +0100
From: Ulrich Kunitz <kune@...ne-taler.de>
To: Herbert Xu <herbert@...dor.apana.org.au>
Cc: netdev@...r.kernel.org, linux-wireless@...r.kernel.org,
Shaddy Baddah <shaddy_baddah@...mail.com>,
David Miller <davem@...emloft.net>
Subject: Re: ZD1211RW unaligned accesses...
Herbert Xu wrote:
> So please try the following patch (instead of the original one)
> which should fix all the unailgned accesses in do_rx.
>
> Cheers,
> --
> Visit Openswan at http://www.openswan.org/
> Email: Herbert Xu ~{PmV>HI~} <herbert@...dor.apana.org.au>
> Home Page: http://gondor.apana.org.au/~herbert/
> PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
> --
> diff --git a/drivers/net/wireless/zd1211rw/zd_mac.c b/drivers/net/wireless/zd1211rw/zd_mac.c
> index a903645..d06b05b 100644
> --- a/drivers/net/wireless/zd1211rw/zd_mac.c
> +++ b/drivers/net/wireless/zd1211rw/zd_mac.c
> @@ -1166,15 +1166,16 @@ static void do_rx(unsigned long mac_ptr)
> int zd_mac_rx_irq(struct zd_mac *mac, const u8 *buffer, unsigned int length)
> {
> struct sk_buff *skb;
> + unsigned int hlen = ALIGN(sizeof(struct zd_rt_hdr), 16);
>
> - skb = dev_alloc_skb(sizeof(struct zd_rt_hdr) + length);
> + skb = dev_alloc_skb(hlen + length);
> if (!skb) {
> struct ieee80211_device *ieee = zd_mac_to_ieee80211(mac);
> dev_warn(zd_mac_dev(mac), "Could not allocate skb.\n");
> ieee->stats.rx_dropped++;
> return -ENOMEM;
> }
> - skb_reserve(skb, sizeof(struct zd_rt_hdr));
> + skb_reserve(skb, hlen - ZD_PLCP_HEADER_SIZE);
> memcpy(__skb_put(skb, length), buffer, length);
> skb_queue_tail(&mac->rx_queue, skb);
> tasklet_schedule(&mac->rx_tasklet);
ACK. This patch should solve it and is better than my patch.
--
Uli Kunitz
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists