netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Hong Liu <hong.liu@intel.com>
Cc: Jiri Benc <jbenc@suse.cz>,
	"John W. Linville" <linville@tuxdriver.com>,
	netdev <netdev@vger.kernel.org>, Michael Buesch <mb@bu3sch.de>,
	"James P. Ketrenos" <ipw2100-admin@linux.intel.com>,
	Simon Barber <simon@devicescape.com>,
	Jouni Malinen <jkm@devicescape.com>
Subject: Re: [patch 1/2]d80211: hardware TKIP support for ipw3945
Date: Thu, 16 Nov 2006 10:52:42 +0100	[thread overview]
Message-ID: <1163670762.2763.19.camel@ux156> (raw)
In-Reply-To: <1163607901.2705.53.camel@ux156>

On Wed, 2006-11-15 at 17:25 +0100, Johannes Berg wrote:

> Instead of putting all this into the stack, however, I think we could
> make those drivers that require it do the bookkeeping and export
> ieee80211_tkip_gen_phase1key and ieee80211_tkip_gen_rc4key for their
> use. Maybe that's too much against Jiri's doctrine of "be easy on
> drivers" though :)

Thought about this a bit more.

I think we should simplify the stack code by making it have *only* the
distinction between between hardware and software crypto (on a per-key
basis).

This would entail getting rid of the flags

  IEEE80211_HW_TKIP_INCLUDE_MMIC
  IEEE80211_HW_TKIP_REQ_PHASE1_KEY
  IEEE80211_HW_TKIP_REQ_PHASE2_KEY

and possibly

  IEEE80211_HW_NO_TKIP_WMM_HWACCEL


Instead, I would like to provide "library" functions to do these tasks
and let drivers use them when they are necessary.

This should simplify and streamline code in the stack by getting rid of
all the tests for these flags and associated code.

My reasoning for this is that
 1) it doesn't break Jiri's doctrine of making things easy for drivers
    because, well, simple drivers just use sw crypto
 2) since drivers will always hard-code these flags it actually makes
    the code more efficient -- no testing of flags required, just
    function calls we'd be making elsewhere after testing flags
 3) instead of drivers hard-coding the flag setting they hardcode
    (yes, in a few more lines) the crypto they need

I think putting the code into the driver vs. the stack is a trade-off we
should make because it makes things more efficient.

Could you live with a patch to do this and adjust ipw3945 accordingly?

For ipw3945 it would be just an addition of a call to
ieee80211_tkip_gen_rc4key() as it lives in the stack after this patch,
and for bcm43xx it would be similar to the code you added within 
"else if (flags & IEEE80211_HW_TKIP_REQ_PHASE1_KEY) {"

As for IEEE80211_HW_NO_TKIP_WMM_HWACCEL, we would have to tell the
hw->set_key routine if WME is enabled for the STA associated with the
key. I'm not yet sure how to do this best, plus the flag isn't actually
checked in the TX path but only the key setting path so...

Basically, I think we have too much knowledge of hardware quirks in the
stack. I'll be submitting a patch for this item later today.

johannes

  reply	other threads:[~2006-11-16  9:51 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-20  9:19 [patch 1/2]d80211: hardware TKIP support for ipw3945 Hong Liu
2006-10-21 21:10 ` Matthieu CASTET
2006-10-23 12:40 ` Jiri Benc
2006-10-23 12:48   ` Johannes Berg
2006-10-23 12:56     ` Jiri Benc
2006-10-24  8:20       ` Hong Liu
2006-10-24  8:35         ` Johannes Berg
2006-10-24  8:38           ` Hong Liu
2006-10-24  9:10             ` Johannes Berg
2006-10-24  9:12               ` Johannes Berg
2006-10-25  8:28               ` Hong Liu
2006-10-25  8:50                 ` Johannes Berg
2006-11-14  2:22                   ` Hong Liu
2006-11-15 16:25                     ` Johannes Berg
2006-11-16  9:52                       ` Johannes Berg [this message]
2006-11-16 17:21                         ` Jouni Malinen
2006-11-16 17:38                           ` Johannes Berg
2006-11-16 17:40                             ` Jouni Malinen
2006-11-16 17:49                               ` Johannes Berg
2006-10-23 13:04   ` Stuffed Crust
2006-10-23 15:29   ` David Kimdon
2006-10-23 16:31     ` Jiri Benc

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=1163670762.2763.19.camel@ux156 \
    --to=johannes@sipsolutions.net \
    --cc=hong.liu@intel.com \
    --cc=ipw2100-admin@linux.intel.com \
    --cc=jbenc@suse.cz \
    --cc=jkm@devicescape.com \
    --cc=linville@tuxdriver.com \
    --cc=mb@bu3sch.de \
    --cc=netdev@vger.kernel.org \
    --cc=simon@devicescape.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 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).