All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christian Lamparter <chunkeey@googlemail.com>
To: dhlii@dlasys.net
Cc: linux-wireless@vger.kernel.org
Subject: Re: carl9170 1.0.6 carl9170_tx_superdesc
Date: Sat, 22 May 2010 00:55:02 +0200	[thread overview]
Message-ID: <201005220055.02528.chunkeey@googlemail.com> (raw)
In-Reply-To: <4BF6FC91.9060109@dlasys.net>

On Friday 21 May 2010 23:35:13 David H. Lynch Jr. wrote:
> I need to track a new value for each tx frame only in the firmware.
> It appears I should be adding it to carl9170_tx_superdesc.
> But that structure seems to be used on both the Linux and firmware side,
> and I have not been able to successfully add to it without breaking
> something elsewhere either in the firmware or Linux driver or between them.
there are two superdesc structures:
	carl9170_tx_superdesc and _carl9170_tx_superdesc.

This is due to the bit-field packing bug which is present
in all GCC version prior to 4.4.

Now, for the firmware we have a special toolchain and
a BUILD_BUG check, so no problem is there.

But kernel driver & userspace tools might be compiled by
an older version.

Therefore, if you want to introduce new fields, you have
to update both structures accordingly.

(And of course, always check that you're using your
 custom firmware and driver.)

> 	Alternately I can create a private array to hold my data, but then I 
> need to be able to find items in it using a carl9170_tx_superframe 
> pointer. I am gathering that the cookie and queue number constitute a 
> unique identifier, but that seems like alot of work to avoid adding a 
> u16 to carl9170_tx_superdesc.
It might not be visible at first glance, but carl9170_tx_superframe
has two distinct header descriptors.
 * ar9170_tx_hwdesc
 * carl9170_tx_superdesc

variables of those headers can not be mixed. This is because the
layout of ar9170_tx_hwdesc is dictated by the hardware design.

Therefore the queue number goes into ar9170_tx_hwdesc.mac.QoS,
whereas the "cookie" is intended to be used by the firmware code.
(In fact, carl9170_tx_superdesc is _hidden_ from the hardware POV) 
 
> 	Any other ideas about tracking a u16 value for each tx frame only on 
> the firmware side without substantial complexity ?
Erm, adding a single u16 is a bad idea. I'm pretty sure that the documents
from your employer cover this subject in great detail since this is a
well-known limitation.

What you could try - on the other hand - u32.
even if you don't need the extra 2 bytes that come with this
bigger storage class.


BTW:
Yes, the (CARL9170_TX_STATUS_NUM % 2) check can be safely disabled now.
But let me run some experiments. Just to be on the safe side.

Regards,
	Chr

  reply	other threads:[~2010-05-21 22:55 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-01 10:19 ar9170-fw II David H. Lynch Jr.
2010-05-01 17:19 ` Christian Lamparter
2010-05-01 18:23   ` David H. Lynch Jr.
2010-05-01 20:45     ` Christian Lamparter
2010-05-02  7:47       ` Benoit Papillault
2010-05-02 11:14         ` David H. Lynch Jr.
2010-05-02 12:52           ` Christian Lamparter
2010-05-02 13:47             ` David H. Lynch Jr.
2010-05-05 18:41             ` carl9170 1.0.5.1 David H. Lynch Jr.
2010-05-05 19:59               ` 2.6.34-rc6 pci bridge problems Christian Lamparter
2010-05-06 15:09                 ` Bjorn Helgaas
2010-05-07 15:46                   ` Bjorn Helgaas
2010-05-07 18:44                     ` Christian Lamparter
2010-05-06  0:11               ` carl9170 1.0.5.1 Luis R. Rodriguez
2010-05-11 22:02             ` ar9170-fw II David H. Lynch Jr.
2010-05-11 23:27               ` Christian Lamparter
2010-05-21  7:50             ` carl9170 1.0.6 David H. Lynch Jr.
2010-05-21 21:35             ` carl9170 1.0.6 carl9170_tx_superdesc David H. Lynch Jr.
2010-05-21 22:55               ` Christian Lamparter [this message]
2010-05-22  1:09                 ` David H. Lynch Jr.
2010-05-22 19:13             ` carl9170 1.0.9 David H. Lynch Jr.
2010-05-23  1:34               ` Christian Lamparter
2010-05-23  5:30                 ` David H. Lynch Jr.
2010-05-23  6:30                 ` carl9170 1.0.9.1 David H. Lynch Jr.
2010-05-03 21:39     ` ar9170-fw II Luis R. Rodriguez

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=201005220055.02528.chunkeey@googlemail.com \
    --to=chunkeey@googlemail.com \
    --cc=dhlii@dlasys.net \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.