linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* mac80211 hardware encryption
@ 2008-04-05 17:31 Ivo van Doorn
  2008-04-06 16:44 ` Ivo van Doorn
  2008-04-07 13:09 ` Johannes Berg
  0 siblings, 2 replies; 21+ messages in thread
From: Ivo van Doorn @ 2008-04-05 17:31 UTC (permalink / raw)
  To: linux-wireless; +Cc: Johannes Berg

Hi,

I'm investigating hardware encryption support for the rt2x00 drivers,
Support for rt61pci and rt73usb should be the easiest to do so currently I'm
only focussing on that, and decide later if rt2500pci and rt2500usb should
also be implemented.

What I am currently facing is the following problem:
For each TX frame the device needs 2 fields in the descriptor namely the
IV and the EIV. From what I can gather from mac80211 those 2 fields are
created by mac80211 with the following code in wpa.c:

ieee80211_tkip_add_iv(pos, key,
		      (u8) (key->u.tkip.iv16 >> 8),
		      (u8) (((key->u.tkip.iv16 >> 8) | 0x20) &
			    0x7f),
		      (u8) key->u.tkip.iv16);

And the following function in tkip.c:

u8 * ieee80211_tkip_add_iv(u8 *pos, struct ieee80211_key *key,
			   u8 iv0, u8 iv1, u8 iv2)
{
	*pos++ = iv0;
	*pos++ = iv1;
	*pos++ = iv2;
	*pos++ = (key->conf.keyidx << 6) | (1 << 5) /* Ext IV */;
	*pos++ = key->u.tkip.iv32 & 0xff;
	*pos++ = (key->u.tkip.iv32 >> 8) & 0xff;
	*pos++ = (key->u.tkip.iv32 >> 16) & 0xff;
	*pos++ = (key->u.tkip.iv32 >> 24) & 0xff;
	return pos;
}

If I understand correctly mac80211 is inserting the values just after
the ieee80211 header in the frame. Now there are 2 ways rt2x00 can
handle this.
	1) copy the frame to the DMA in 2 steps, skipping the inserted IV by mac80211
	    and copy the IV into the descriptor.
	2) Add flag to mac80211 to provide the IV and EIV seperately to the driver
	    so there won't be overhead by mac80211 to insert the IV after the ieee80211
	    header when the driver doesn't want it to.

Thanks,

Ivo

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2008-04-17 16:59 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-05 17:31 mac80211 hardware encryption Ivo van Doorn
2008-04-06 16:44 ` Ivo van Doorn
2008-04-07  7:07   ` Jouni Malinen
2008-04-07 13:09 ` Johannes Berg
2008-04-07 13:34   ` Ivo van Doorn
2008-04-07 13:47     ` Johannes Berg
2008-04-07 14:10       ` Ivo van Doorn
2008-04-07 14:12         ` Johannes Berg
2008-04-07 14:26           ` Ivo van Doorn
2008-04-07 14:36             ` Johannes Berg
2008-04-07 14:45               ` Ivo van Doorn
2008-04-14 16:27                 ` Ivo van Doorn
2008-04-14 18:39                   ` Tomas Winkler
2008-04-14 21:07                     ` Ivo van Doorn
2008-04-15 10:35                       ` Johannes Berg
2008-04-15 15:17                         ` Ivo van Doorn
2008-04-16 13:57                           ` Johannes Berg
2008-04-17 10:14                           ` Johannes Berg
2008-04-17 17:04                             ` Ivo van Doorn
2008-04-15 15:55                         ` Tomas Winkler
2008-04-16  6:15                     ` Jouni Malinen

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).