All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lennert Buytenhek <buytenh@wantstofly.org>
To: Brian Cavagnolo <brian@cozybit.com>
Cc: linux-wireless@vger.kernel.org,
	Pradeep Nemavat <pnemavat@marvell.com>,
	Nishant Sarmukadam <nishants@marvell.com>
Subject: Re: [PATCH 3/7] mwl8k: allow for padding in AP transmit descriptor
Date: Tue, 2 Nov 2010 09:53:34 +0100	[thread overview]
Message-ID: <20101102085334.GP1733@mail.wantstofly.org> (raw)
In-Reply-To: <1288659351-22313-3-git-send-email-brian@cozybit.com>

On Mon, Nov 01, 2010 at 05:55:47PM -0700, Brian Cavagnolo wrote:

> +/*
> + * The size of the tx descriptors used by the firmware varies depending on
> + * whether we use AP firmware or STA firmware.  However, the fields used by
> + * this driver are identical, so the difference in size is treated as padding
> + * at the end of the structure.
> + */
> +#define MWL8K_TX_DESC_SIZE_STA			32
> +#define MWL8K_TX_DESC_SIZE_AP			52

This is misleading, if not downright a lie.

Only the STA firmware branch bothers to mostly keep a degree of ABI
compatibility -- the TX descriptor for STA firmware images is 32 bytes,
no matter whether you're on 8687, 8363, or 8366.

(I like this very much about STA firmware -- it meant I could take the
8687 STA driver and run it on 8363 and 8366 STA with hardly any changes.
And there's reports that mwl8k runs on 8361P STA with almost no patching
needed either.)

But the AP firmware branch changes stuff around all the time, as the AP
people generally supply their driver along with the firmware, and can
make concurrent changes to those while not having to give a damn about
the other users of their firmware.

E.g., the format of the SET_MAC_ADDR command packet changing if you're
compiling the AP firmware for multi-BSS (a 16 bit field is added in the
_middle_ of the command packet if you do that, see mwl8k_cmd_set_mac_addr)
-- and changing the TX descriptor format is another one of those things.

The reason that the AP TX descriptor for 8366 is 52 bytes is not because
it has been defined to be such, but because the "official" AP driver for
8366 just so happens, at this moment, to have 20 bytes of driver-private
info for every TX packet, which it stashes into the TX descriptor (that
doesn't even make any sense either, but hey).  If next week they decide
they need 4 more bytes for driver-private info, they'll just bump it to
56, and we'll be left to pick up the pieces.

So this

> +#define MWL8K_TX_DESC_SIZE_AP                        52

is very misleading, as:

- It suggests that something is set in stone which isn't set in stone at
  all.
- It only applies to this particular 8366 AP image, and might not apply
  to other 8366 AP images or even AP images in general.

In other words, it's just a quick hack to get things to work for one
more HW/firmware/version combo, but it doesn't solve the problem in a
clean way or in general.  (Then again, you probably don't care about
that anyway.)

Since you're being paid by Marvell to do this, please tell them that
this nonsense needs to stop, and that they need to add something to the
firmware so that the driver can figure out what options the firmware
has been built with, or include some way that we can reliably figure
out which ABI variation to use to talk to the firmware.

  reply	other threads:[~2010-11-02  8:53 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-02  0:55 [PATCH 1/7] mwl8k: add firmware files for 8366 Brian Cavagnolo
2010-11-02  0:55 ` [PATCH 2/7] mwl8k: rf_tx_power cmd deprecated for AP firmware Brian Cavagnolo
2010-11-02  8:32   ` Lennert Buytenhek
2010-11-02  0:55 ` [PATCH 3/7] mwl8k: allow for padding in AP transmit descriptor Brian Cavagnolo
2010-11-02  8:53   ` Lennert Buytenhek [this message]
2010-11-02  0:55 ` [PATCH 4/7] mwl8k: force AP mode to use non-AMPDU frames Brian Cavagnolo
2010-11-02  8:57   ` Lennert Buytenhek
2010-11-02  0:55 ` [PATCH 5/7] mwl8k: factor out firmware loading and hw init code Brian Cavagnolo
2010-11-02  9:01   ` Lennert Buytenhek
2010-11-02  0:55 ` [PATCH 6/7] mwl8k: choose proper firmware image as directed by user Brian Cavagnolo
2010-11-02  8:30   ` Lennert Buytenhek
2010-11-04  0:19     ` Brian Cavagnolo
2010-11-02  0:55 ` [PATCH 7/7] mac80211: unset SDATA_STATE_OFFCHANNEL when cancelling a scan Brian Cavagnolo
2010-11-02  8:31   ` Lennert Buytenhek
2010-11-04  0:20     ` Brian Cavagnolo
2010-11-02  8:22 ` [PATCH 1/7] mwl8k: add firmware files for 8366 Lennert Buytenhek
2010-11-04  0:19   ` Brian Cavagnolo
2010-11-04 15:36     ` Johannes Berg
2010-11-04 20:53       ` Brian Cavagnolo
2010-11-05  0:15     ` Lennert Buytenhek
2010-11-13  1:23 ` [PATCH V2 0/6] mwl8k: add initial support for AP firmware on 8366 Brian Cavagnolo
2010-11-13  1:23 ` [PATCH V2 1/7] mwl8k: revert unnecessary modification of tx descriptor Brian Cavagnolo
2010-11-13  1:23 ` [PATCH V2 2/7] mwl8k: rf_tx_power cmd not supported by AP firmware APIv1 Brian Cavagnolo
2010-11-13  1:23 ` [PATCH V2 3/7] mwl8k: factor out firmware loading and hw init code Brian Cavagnolo
2010-11-13  1:25   ` Brian Cavagnolo
2010-11-13  1:23 ` [PATCH V2 4/7] mwl8k: choose proper firmware image as directed by user Brian Cavagnolo
2010-11-13  1:25   ` Brian Cavagnolo
2010-11-13  1:23 ` [PATCH V2 5/7] mwl8k: add API version checking for AP firmware Brian Cavagnolo
2010-11-13  1:23 ` [PATCH V2 6/7] mwl8k: make initial firmware load asynchronous Brian Cavagnolo
2010-11-13  1:23 ` [PATCH V2 7/7] mwl8k: use const struct fw pointers throughout Brian Cavagnolo

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=20101102085334.GP1733@mail.wantstofly.org \
    --to=buytenh@wantstofly.org \
    --cc=brian@cozybit.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=nishants@marvell.com \
    --cc=pnemavat@marvell.com \
    /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.