From: Ulrich Kunitz <kune-hUSrv6EASfkEnNRfnnE9gw@public.gmane.org>
To: Herbert Xu <herbert-lOAM2aK0SrRLBo1qDEOMRrpzq4S04n8Q@public.gmane.org>
Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Shaddy Baddah
<shaddy_baddah-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org>,
David Miller <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
Subject: Re: ZD1211RW unaligned accesses...
Date: Sat, 24 Nov 2007 17:52:01 +0100 [thread overview]
Message-ID: <20071124165201.GA31677@deine-taler.de> (raw)
In-Reply-To: <20071124150216.GA28153-lOAM2aK0SrRLBo1qDEOMRrpzq4S04n8Q@public.gmane.org>
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-lOAM2aK0SrRLBo1qDEOMRrpzq4S04n8Q@public.gmane.org>
> 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
next prev parent reply other threads:[~2007-11-24 16:52 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-20 12:05 ZD1211RW unaligned accesses David Miller
[not found] ` <20071120.040546.222294375.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2007-11-21 13:00 ` Shaddy Baddah
[not found] ` <47442BFC.8090008-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org>
2007-11-24 15:02 ` Herbert Xu
[not found] ` <20071124150216.GA28153-lOAM2aK0SrRLBo1qDEOMRrpzq4S04n8Q@public.gmane.org>
2007-11-24 16:52 ` Ulrich Kunitz [this message]
2007-11-29 21:45 ` John W. Linville
[not found] ` <20071129214533.GD32730-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>
2007-11-29 23:43 ` Herbert Xu
[not found] ` <20071129234327.GA23769-lOAM2aK0SrRLBo1qDEOMRrpzq4S04n8Q@public.gmane.org>
2007-11-30 7:34 ` Shaddy Baddah
2007-11-30 9:50 ` Herbert Xu
2007-11-30 11:33 ` Johannes Berg
2007-12-01 10:33 ` Ulrich Kunitz
2007-11-23 10:41 ` Johannes Berg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20071124165201.GA31677@deine-taler.de \
--to=kune-husrv6easfkennrfnne9gw@public.gmane.org \
--cc=davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org \
--cc=herbert-lOAM2aK0SrRLBo1qDEOMRrpzq4S04n8Q@public.gmane.org \
--cc=linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=shaddy_baddah-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).