All of lore.kernel.org
 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>
Subject: Re: [patch 1/2]d80211: hardware TKIP support for ipw3945
Date: Wed, 25 Oct 2006 10:50:45 +0200	[thread overview]
Message-ID: <1161766245.2767.17.camel@ux156> (raw)
In-Reply-To: <1161764889.8668.13.camel@devlinux-hong>

On Wed, 2006-10-25 at 16:28 +0800, Hong Liu wrote:

> I'd prefer to let the stack tell the driver when there is new phase1 key
> generated.

Fine too, I guess.

> +	u8 tkip_keylen;

What do you need that for? The driver should know whether it requested a
phase 1 or phase 2 key.

> +	u8 tkip_key[16];/* generated RC4/phase1 key for hw TKIP */

Do we really have to stick this into this structure? But I'll let Jiri
figure out how to remove the structure bloat :)
 
> +	/* calculate Michael MIC for an MSDU when doing hwcrypto */
> +#define IEEE80211_HW_TKIP_INCLUDE_MMIC (1<<12)
> +	/* Do TKIP phase1 key mixing in stack to support cards only do
> +	 * phase2 key mixing when doing hwcrypto */
> +#define IEEE80211_HW_TKIP_REQ_PHASE1_KEY (1<<13)
> +	/* Do TKIP phase1 and phase2 key mixing in stack and send the generated
> +	 * per-packet RC4 key with each TX frame when doing hwcrypto */
> +#define IEEE80211_HW_TKIP_REQ_PHASE2_KEY (1<<14)

Maybe a comment indicating that you must not set both of these flags
would be good. Or (see below)

Should there be some flag indicating if the hw/firmware checked the MIC
on reception? The current code has bad assumptions there:

(from the pre-flags version)

        /* Some devices handle Michael MIC internally and do not include MIC in
         * the received packets passed up. device_strips_mic must be set
         * for such devices. The 'encryption' frame control bit is expected to
         * be still set in the IEEE 802.11 header with this option unlike with
         * the device_hides_wep configuration option.
         */
        unsigned int device_strips_mic:1;

What if the devices leaves the MIC there but indicates if it was checked?
 
> +		if (flags & IEEE80211_HW_TKIP_REQ_PHASE1_KEY) {
...
> +		} else if (flags & IEEE80211_HW_TKIP_REQ_PHASE2_KEY) {
...

if you change the order of these tests then setting both flags will be
fine.

johannes

  reply	other threads:[~2006-10-25  8:49 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 [this message]
2006-11-14  2:22                   ` Hong Liu
2006-11-15 16:25                     ` Johannes Berg
2006-11-16  9:52                       ` Johannes Berg
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=1161766245.2767.17.camel@ux156 \
    --to=johannes@sipsolutions.net \
    --cc=hong.liu@intel.com \
    --cc=jbenc@suse.cz \
    --cc=linville@tuxdriver.com \
    --cc=mb@bu3sch.de \
    --cc=netdev@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.