linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stuffed Crust <pizza@shaftnet.org>
To: Stefan Rompf <stefan@loplof.de>
Cc: Jeff Garzik <jgarzik@pobox.com>,
	"John W. Linville" <linville@tuxdriver.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: wireless: recap of current issues (other issues / fake ethernet)
Date: Wed, 18 Jan 2006 11:32:07 -0500	[thread overview]
Message-ID: <20060118163207.GB27180@shaftnet.org> (raw)
In-Reply-To: <200601180036.10500.stefan@loplof.de>

[-- Attachment #1: Type: text/plain, Size: 3728 bytes --]

On Wed, Jan 18, 2006 at 12:36:09AM +0100, Stefan Rompf wrote:
> prism2 usb is even worse - the urb is build of some control structure, the 
> 802.11 3 address header, a 802.3 header and the 802.11 data part. Some bits 
> in the control structure decide whether the 802.11 or the 802.3 header is 
> used to create the frame sent to the air.

I actually maintain a prism2 usb driver.  It's host interface is truly
fscked, and then there are the unfixable hardware bugs... But back to
your point -- It's actually true of all prism2 devices.  You can use one
header or the other, but space for both is part of the fixed packet
structure. 

Meanwhile, I've only seen one wireless chipset that *requires* 802.3
headers, and that is the prism54/prismGT/Indigo/Duette (FullMAC mode). 
Those adapters (except for the Indigo, which never made it into 
production anyway) can run in a softmac mode, which uses regular 802.11 
headers.

It's actually fairly common that hardware devices have the 802.11 header 
separated from the 802.11 payload slightly, if for no other reason that 
they need space to add the encryption headers.  You can't make any 
assumptions.
 
> Fortunately, a driver should be able to specify it's additional memory need at 
> the front of the frame via hard_header_len. Some drivers will need to do some 
> ugly memmove()s at the packet begin then.

This amount also varies with different encryption modes.  And don't
forget you also need space for an LLC+SNAP header and finally, you need
a frame footer for encryption as well. 

> .. and it gets even worse as soon as we start encrypting packets. I think we 
> should start using the netdev wiki at http://linux-net.osdl.org/ to collect 
> information. For this part of the discussion, we need to know what transmit 
> frame formats different hardware needs.

They're all over the map, yes.. there's no guarantee that the frame will
be contiguious.  It's annoying.. They also vary depending on encrpytion
mode.  Keep the 802.11 stack generic; split the packet into its logical
block.

On a per-frame basis, you have:

 - 802.11 header (variable length)
 - Encryption header (variable length)
 - LLC+SNAP header on payload (which we may need to add)
   - actual payload
 - Encryption footer (variable length)

How's this strawman proposal:

wiphy_frame_xmit (struct wiphy_dev *dev, struct sk_buff *skb);

skb->data points to the raw payload, with LLC+SNAP header.
skb->cb points to a structure that has, among other things:
  - 802.11 header + length
  - encryption header + length
  - encryption footer + length
  - desired data rate(s), antenna, rts/cts, and other tx params.
  - hw/sw encryption flag, and the key needed to encrypt.

Given that I haven't seen two chipsets that do thigns the same way,
there's little point in making the stack generic enough to rearrange
these bits in the correct places. That said, we could provide a generic
coalesce method for the general swcrypto+payload case, where the
hardware would presumably treat it as an opaque payload.

Each driver would be responsible for rearranging these chunks as
appropriate, ideally using scatter-gather DMA.  That's why the chunks
are all specified as chunk+len; the driver can blindly copy the chunks
without worrying about their contents.

Chipsets that require payload padding when using crypto can tell the
802.11 stack of this requirement, and the stack will pass the
appropriate pads in via the crypt_header and crypt_footer.

I've put this stuff on the wiki, for what it's worth.

 - Solomon 
-- 
Solomon Peachy        				 ICQ: 1318344
Melbourne, FL 					 
Quidquid latine dictum sit, altum viditur.

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2006-01-18 16:32 UTC|newest]

Thread overview: 74+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20060113195723.GB16166@tuxdriver.com>
2006-01-13 21:26 ` wireless: recap of current issues (intro) John W. Linville
     [not found]   ` <20060113213011.GE16166@tuxdriver.com>
2006-01-13 22:19     ` wireless: recap of current issues (configuration) John W. Linville
2006-01-13 22:32       ` Johannes Berg
2006-01-14  1:17         ` Stuffed Crust
2006-01-14  9:28           ` Johannes Berg
2006-01-14 13:47             ` Krzysztof Halasa
2006-01-14 22:07           ` Jeff Garzik
2006-01-15 15:20             ` Stuffed Crust
2006-01-15 19:05               ` Samuel Ortiz
2006-01-16 17:09                 ` Stuffed Crust
2006-01-16 18:51                   ` Samuel Ortiz
2006-01-16 19:06                     ` John W. Linville
2006-01-16 20:16                       ` Samuel Ortiz
2006-01-16 21:06                         ` Stuffed Crust
2006-01-16 22:24                       ` Alan Cox
2006-01-16 23:02                         ` John W. Linville
2006-01-17 18:41                         ` Stuffed Crust
2006-01-17 18:54                           ` Kyle Moffett
2006-01-15 19:53               ` Sam Leffler
2006-01-16 17:28                 ` Stuffed Crust
2006-01-16 17:54                   ` Sam Leffler
2006-01-16 19:40                     ` Stuffed Crust
2006-01-16 20:14                       ` Sam Leffler
2006-01-16 20:58                         ` Stuffed Crust
2006-01-16 18:39                   ` Dan Williams
2006-01-16 19:07                   ` Samuel Ortiz
2006-01-16 19:50                     ` Stuffed Crust
2006-01-16 20:10                       ` Samuel Ortiz
2006-01-15 12:40         ` Stefan Rompf
2006-01-15 15:51           ` Johannes Berg
2006-01-15 17:53             ` Stefan Rompf
2006-01-15 20:08               ` Sam Leffler
2006-01-15 20:11                 ` Johannes Berg
2006-01-17 22:20                   ` Stefan Rompf
2006-01-15 19:39           ` Sam Leffler
2006-01-16  0:06             ` Mike Kershaw
2006-01-16 14:23         ` Jiri Benc
2006-01-16 14:55           ` Johannes Berg
2006-01-16 17:33             ` Stuffed Crust
2006-01-16 18:00               ` Sam Leffler
2006-01-16 20:16                 ` Stuffed Crust
2006-01-14  0:05       ` Krzysztof Halasa
2006-01-14 23:41       ` Dan Williams
2006-01-15 16:18         ` Stuffed Crust
2006-01-15  9:35       ` feyd
     [not found]   ` <20060113213126.GF16166@tuxdriver.com>
2006-01-13 22:20     ` wireless: recap of current issues (compatibility) John W. Linville
2006-01-13 22:33       ` Johannes Berg
2006-01-14 13:44         ` Krzysztof Halasa
     [not found]   ` <20060113213237.GH16166@tuxdriver.com>
2006-01-13 22:24     ` wireless: recap of current issues (other issues) John W. Linville
2006-01-13 22:35       ` Johannes Berg
2006-01-13 23:02         ` Johannes Berg
2006-01-14 22:09       ` Jeff Garzik
2006-01-15  0:54         ` John W. Linville
2006-01-15  1:51         ` David S. Miller
2006-01-15 11:23           ` Arnaldo Carvalho de Melo
2006-01-15 15:39         ` Stuffed Crust
2006-01-17 23:36           ` wireless: recap of current issues (other issues / fake ethernet) Stefan Rompf
2006-01-18 16:32             ` Stuffed Crust [this message]
     [not found]   ` <20060113213311.GI16166@tuxdriver.com>
2006-01-13 22:25     ` wireless: recap of current issues (actions) John W. Linville
2006-01-13 22:36       ` Johannes Berg
2006-01-14 22:11       ` Jeff Garzik
2006-01-15  0:56         ` John W. Linville
2006-01-16 14:44           ` Johannes Berg
     [not found]   ` <20060113213200.GG16166@tuxdriver.com>
2006-01-13 22:22     ` wireless: recap of current issues (stack) John W. Linville
2006-01-13 22:34       ` Johannes Berg
2006-01-13 23:03     ` Chase Venters
2006-01-14 10:46       ` Simon Kelley
2006-01-14 23:29         ` Dan Williams
2006-01-14 13:51       ` Michael Buesch
2006-01-17 17:38         ` Jean Tourrilhes
2006-01-14 14:13     ` Ulrich Kunitz
2006-01-15  4:42       ` Pete Zaitcev
2006-01-15 10:04         ` Ulrich Kunitz
     [not found] ` <43C80F9A.8020203@candelatech.com>
2006-01-13 22:49   ` wireless: recap of current issues Ben Greear

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=20060118163207.GB27180@shaftnet.org \
    --to=pizza@shaftnet.org \
    --cc=jgarzik@pobox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=netdev@vger.kernel.org \
    --cc=stefan@loplof.de \
    /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).