From: Dan Williams <dcbw@redhat.com>
To: Pierre Ossman <drzeus@drzeus.cx>
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH] libertas: make if_sdio align packets
Date: Mon, 22 Oct 2007 13:11:27 -0400 [thread overview]
Message-ID: <1193073087.4325.1.camel@localhost.localdomain> (raw)
In-Reply-To: <20071022190532.5077ce3d@poseidon.drzeus.cx>
On Mon, 2007-10-22 at 19:05 +0200, Pierre Ossman wrote:
> 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>
Acked-by: Dan Williams <dcbw@redhat.com>
John; if you don't have if_sdio.c, please rebase from Linus or something
since it went in with Pierre's SDIO stack.
> ---
>
> diff --git a/drivers/net/wireless/libertas/if_sdio.c b/drivers/net/wireless/libertas/if_sdio.c
> index 5b13705..56dd568 100644
> --- a/drivers/net/wireless/libertas/if_sdio.c
> +++ b/drivers/net/wireless/libertas/if_sdio.c
> @@ -175,12 +175,20 @@ 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;
> }
>
> + /*
> + * The IP stack is littered with silly assumptions on alignment,
> + * so we need to do a bit of layering violation here and make
> + * assumptions about the size of the headers between us and the
> + * IP stack.
> + */
> + skb_reserve(skb, NET_IP_ALIGN);
> +
> data = skb_put(skb, size);
>
> memcpy(data, buffer, size);
next prev parent reply other threads:[~2007-10-22 17:11 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-22 17:05 [PATCH] libertas: make if_sdio align packets Pierre Ossman
2007-10-22 17:11 ` Dan Williams [this message]
2007-10-23 1:15 ` David Miller
2007-10-23 5:29 ` Pierre Ossman
2007-10-23 6:57 ` Holger Schurig
2007-10-23 7:17 ` David Miller
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=1193073087.4325.1.camel@localhost.localdomain \
--to=dcbw@redhat.com \
--cc=drzeus@drzeus.cx \
--cc=linux-wireless@vger.kernel.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