linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christian Lamparter <chunkeey@googlemail.com>
To: "Andrew V. Stepanov" <stanv@altlinux.org>
Cc: linux-wireless@vger.kernel.org
Subject: Re: carl9170.ko RX - DMA, TX - COPY
Date: Wed, 4 May 2011 22:09:29 +0000	[thread overview]
Message-ID: <201105042209.29950.chunkeey@googlemail.com> (raw)
In-Reply-To: <BANLkTin3nks48iCQw34kFfMAwT3QyhG08A@mail.gmail.com>

On Wednesday 04 May 2011 18:52:58 Andrew V. Stepanov wrote:
> I think it is possible to align SKB frames in carl9170.ko driver.
> 
> rt2800usb do such think in next way:
> 
> void rt2x00queue_align_frame(struct sk_buff *skb)
> {
> »···unsigned int frame_length = skb->len;
> »···unsigned int align = ALIGN_SIZE(skb, 0);
> 
> »···if (!align)
> »···»···return;
> 
> »···skb_push(skb, align);
> »···memmove(skb->data, skb->data + align, frame_length);
> »···skb_trim(skb, frame_length);
> }
> 
> What do you think about this?
No that's wrong, here's the comment from rt2x00queue.c

"When DMA allocation is required we should guarantee to the
 driver that the DMA is aligned to a 4-byte boundary.
 However some drivers require L2 padding to pad the payload
 rather then the header. This could be a requirement for
 PCI and USB devices, while header alignment only is valid
 for PCI devices."

Do you see the difference there; header alignment is only needed
for PCI whereas rt2800usb hw/fw allows just the L2 data to be
padded and sadly AR9170 hw does not have this feature. 

Also, someone <https://patchwork.kernel.org/patch/98997/> added
bounce buffers to musb some time ago, so why not use this approach
instead? The advantage is that you won't need to modify any other
drivers when you will (inevitable) replace the device with a
better one, right?

Regards,
	Chr

  parent reply	other threads:[~2011-05-04 20:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-03 12:50 carl9170.ko RX - DMA, TX - COPY Andrew V. Stepanov
2011-05-03 15:20 ` Christian Lamparter
     [not found] ` <BANLkTi=6+P9Hj3LtciMeK4g-kDBrsuRXNw@mail.gmail.com>
     [not found]   ` <201105031642.43472.chunkeey@googlemail.com>
2011-05-03 16:52     ` Christian Lamparter
     [not found]       ` <BANLkTinpMmuz4yD+tQQAHGTSbTvmVjcVQw@mail.gmail.com>
2011-05-03 19:18         ` Christian Lamparter
     [not found]           ` <BANLkTikzpgP_swCfV28h7y0yNzGa7Df+vw@mail.gmail.com>
2011-05-03 20:58             ` Christian Lamparter
     [not found] ` <BANLkTi=gvwkV=JstvtkAFPzU481mKQWtiA@mail.gmail.com>
     [not found]   ` <BANLkTinC6ngn=ihLy2Y3Zx_qSKKCZVyNDw@mail.gmail.com>
2011-05-04 15:58     ` Christian Lamparter
     [not found]       ` <BANLkTin3nks48iCQw34kFfMAwT3QyhG08A@mail.gmail.com>
2011-05-04 22:09         ` Christian Lamparter [this message]
     [not found]           ` <BANLkTinH2pU2mGnoN1=BMQkY-0mhN801+A@mail.gmail.com>
2011-05-06 13:02             ` Christian Lamparter

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=201105042209.29950.chunkeey@googlemail.com \
    --to=chunkeey@googlemail.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=stanv@altlinux.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).