public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] RFC: Add support for passing PMK to WEXT
@ 2008-04-25  4:51 Masakazu Mokuno
  2008-04-25  5:05 ` [PATCH 1/3] RFC: WEXT: Add support for passing PMK and capability flags " Masakazu Mokuno
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Masakazu Mokuno @ 2008-04-25  4:51 UTC (permalink / raw)
  To: linux-wireless

	Hi,

I'd like to add support for passing PMK and capability flags to WEXT for
the drivers which want to do 4-way handshake in the driver/firmware.

Prior to 2.6.25, none of the mainlined wireless drivers had been designed
to do 4-way handshakes in the driver/firmware, thus WEXT does not define
the way to do that. 

The PS3 wireless device is such kind of device.  The current gelic
driver included in 2.6.25 uses private WEXT ioctls to get the PSK
because of the lack of a standard way in WEXT.

With this patch we would be able to:

  - define the standard way to pass the PMK to the driver
  - let user space programs figure out whether the driver will do 4-way
    handshakes
  - eliminate the use of private ioctls from the gelic driver

#1	Add support for passing PMK and capability flags to WEXT
#2	Use the new PMK interface in the gelic driver
#3	Deprecate the private ioctls in the gelic driver


#1 adds the flags to WEXT, #2 and #3 let the gelic driver conform.

Please review!

-- 
Masakazu Mokuno


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

* [PATCH 2/3] RFC: PS3: gelic: Use the new PMK interface in the gelic driver
  2008-04-25  4:51 [PATCH 0/3] RFC: Add support for passing PMK to WEXT Masakazu Mokuno
  2008-04-25  5:05 ` [PATCH 1/3] RFC: WEXT: Add support for passing PMK and capability flags " Masakazu Mokuno
@ 2008-04-25  5:05 ` Masakazu Mokuno
  2008-04-25  5:05 ` [PATCH 3/3] RFC: PS3: gelic: Deprecate the private ioctls " Masakazu Mokuno
  2008-04-26 16:13 ` [PATCH 0/3] RFC: Add support for passing PMK to WEXT Johannes Berg
  3 siblings, 0 replies; 8+ messages in thread
From: Masakazu Mokuno @ 2008-04-25  5:05 UTC (permalink / raw)
  To: linux-wireless

With the new WEXT flags, the PS3 wireless driver can tell the user space that
it would do handle 4-way handshake by itself and needs the PSK without private
ioctls.

Signed-off-by: Masakazu Mokuno <mokuno@sm.sony.co.jp>
---
 drivers/net/ps3_gelic_wireless.c |   46 ++++++++++-----------------------------
 1 file changed, 12 insertions(+), 34 deletions(-)

--- a/drivers/net/ps3_gelic_wireless.c
+++ b/drivers/net/ps3_gelic_wireless.c
@@ -350,7 +350,8 @@ static int gelic_wl_get_range(struct net
 
 	/* encryption capability */
 	range->enc_capa = IW_ENC_CAPA_WPA |
-		IW_ENC_CAPA_CIPHER_TKIP | IW_ENC_CAPA_CIPHER_CCMP;
+		IW_ENC_CAPA_CIPHER_TKIP | IW_ENC_CAPA_CIPHER_CCMP |
+		IW_ENC_CAPA_4WAY_HANDSHAKE;
 	if (wpa2_capable())
 		range->enc_capa |= IW_ENC_CAPA_WPA2;
 	range->encoding_size[0] = 5;	/* 40bit WEP */
@@ -1256,42 +1257,19 @@ static int gelic_wl_set_encodeext(struct
 		set_bit(key_index, &wl->key_enabled);
 		/* remember wep info changed */
 		set_bit(GELIC_WL_STAT_CONFIGURED, &wl->stat);
-	} else if ((alg == IW_ENCODE_ALG_TKIP) || (alg == IW_ENCODE_ALG_CCMP)) {
-		pr_debug("%s: TKIP/CCMP requested alg=%d\n", __func__, alg);
-		/* check key length */
-		if (IW_ENCODING_TOKEN_MAX < ext->key_len) {
-			pr_info("%s: key is too long %d\n", __func__,
-				ext->key_len);
+	} else if (alg == IW_ENCODE_ALG_PMK) {
+		if (ext->key_len != WPA_PSK_LEN) {
+			pr_err("%s: PSK length wrong %d\n", __func__,
+			       ext->key_len);
 			ret = -EINVAL;
 			goto done;
 		}
-		if (alg == IW_ENCODE_ALG_CCMP) {
-			pr_debug("%s: AES selected\n", __func__);
-			wl->group_cipher_method = GELIC_WL_CIPHER_AES;
-			wl->pairwise_cipher_method = GELIC_WL_CIPHER_AES;
-			wl->wpa_level = GELIC_WL_WPA_LEVEL_WPA2;
-		} else {
-			pr_debug("%s: TKIP selected, WPA forced\n", __func__);
-			wl->group_cipher_method = GELIC_WL_CIPHER_TKIP;
-			wl->pairwise_cipher_method = GELIC_WL_CIPHER_TKIP;
-			/* FIXME: how do we do if WPA2 + TKIP? */
-			wl->wpa_level = GELIC_WL_WPA_LEVEL_WPA;
-		}
-		if (flags & IW_ENCODE_RESTRICTED)
-			BUG();
-		wl->auth_method = GELIC_EURUS_AUTH_OPEN;
-		/* We should use same key for both and unicast */
-		if (ext->ext_flags & IW_ENCODE_EXT_GROUP_KEY)
-			pr_debug("%s: group key \n", __func__);
-		else
-			pr_debug("%s: unicast key \n", __func__);
-		/* OK, update the key */
-		wl->key_len[key_index] = ext->key_len;
-		memset(wl->key[key_index], 0, IW_ENCODING_TOKEN_MAX);
-		memcpy(wl->key[key_index], ext->key, ext->key_len);
-		set_bit(key_index, &wl->key_enabled);
-		/* remember info changed */
-		set_bit(GELIC_WL_STAT_CONFIGURED, &wl->stat);
+		memset(wl->psk, 0, sizeof(wl->psk));
+		memcpy(wl->psk, ext->key, ext->key_len);
+		wl->psk_len = ext->key_len;
+		wl->psk_type = GELIC_EURUS_WPA_PSK_BIN;
+		/* remember PSK configured */
+		set_bit(GELIC_WL_STAT_WPA_PSK_SET, &wl->stat);
 	}
 done:
 	spin_unlock_irqrestore(&wl->lock, irqflag);


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

* [PATCH 1/3] RFC: WEXT: Add support for passing PMK and capability flags to WEXT
  2008-04-25  4:51 [PATCH 0/3] RFC: Add support for passing PMK to WEXT Masakazu Mokuno
@ 2008-04-25  5:05 ` Masakazu Mokuno
  2008-04-25  5:05 ` [PATCH 2/3] RFC: PS3: gelic: Use the new PMK interface in the gelic driver Masakazu Mokuno
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: Masakazu Mokuno @ 2008-04-25  5:05 UTC (permalink / raw)
  To: linux-wireless

This defines the flags for setting the PMK to the driver and the
capability flag for this so that the user space program can figure out
whether the target driver wants to do 4-way hand shake by itself and
pass the PMK which is needed before 4-way handshake to the driver.

Signed-off-by: Masakazu Mokuno <mokuno@sm.sony.co.jp>
---
 include/linux/wireless.h |    2 ++
 1 file changed, 2 insertions(+)

--- a/include/linux/wireless.h
+++ b/include/linux/wireless.h
@@ -616,6 +616,7 @@
 #define IW_ENCODE_ALG_WEP	1
 #define IW_ENCODE_ALG_TKIP	2
 #define IW_ENCODE_ALG_CCMP	3
+#define IW_ENCODE_ALG_PMK	4
 /* struct iw_encode_ext ->ext_flags */
 #define IW_ENCODE_EXT_TX_SEQ_VALID	0x00000001
 #define IW_ENCODE_EXT_RX_SEQ_VALID	0x00000002
@@ -635,6 +636,7 @@
 #define IW_ENC_CAPA_WPA2	0x00000002
 #define IW_ENC_CAPA_CIPHER_TKIP	0x00000004
 #define IW_ENC_CAPA_CIPHER_CCMP	0x00000008
+#define IW_ENC_CAPA_4WAY_HANDSHAKE	0x00000010
 
 /* Event capability macros - in (struct iw_range *)->event_capa
  * Because we have more than 32 possible events, we use an array of


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

* [PATCH 3/3] RFC: PS3: gelic: Deprecate the private ioctls in the gelic driver
  2008-04-25  4:51 [PATCH 0/3] RFC: Add support for passing PMK to WEXT Masakazu Mokuno
  2008-04-25  5:05 ` [PATCH 1/3] RFC: WEXT: Add support for passing PMK and capability flags " Masakazu Mokuno
  2008-04-25  5:05 ` [PATCH 2/3] RFC: PS3: gelic: Use the new PMK interface in the gelic driver Masakazu Mokuno
@ 2008-04-25  5:05 ` Masakazu Mokuno
  2008-04-26 16:13 ` [PATCH 0/3] RFC: Add support for passing PMK to WEXT Johannes Berg
  3 siblings, 0 replies; 8+ messages in thread
From: Masakazu Mokuno @ 2008-04-25  5:05 UTC (permalink / raw)
  To: linux-wireless

As the driver has the standard way to handle PSK, deprecate the old
PSK interface.

Signed-off-by: Masakazu Mokuno <mokuno@sm.sony.co.jp>
---
 drivers/net/Kconfig              |   13 +++++++++++++
 drivers/net/ps3_gelic_wireless.c |    6 ++++++
 2 files changed, 19 insertions(+)

--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -2297,6 +2297,19 @@ config GELIC_WIRELESS
 	  the driver automatically distinguishes the models, you can
 	  safely enable this option even if you have a wireless-less model.
 
+config GELIC_WIRELESS_OLD_PSK_INTERFACE
+       bool "PS3 Wireless private PSK interface (OBSOLETE)"
+       depends on GELIC_WIRELESS
+       help
+          This option retains the obsolete private interface to pass
+          the PSK from user space programs to the driver.  The PSK
+          stands for 'Pre Shared Key' and is used for WPA[2]-PSK
+          (WPA-Personal) environment.
+          If WPA[2]-PSK is used and you need to use old programs that
+          support only this old interface, say Y.  Otherwise N.
+
+          If unsure, say N.
+
 config GIANFAR
 	tristate "Gianfar Ethernet"
 	depends on FSL_SOC
--- a/drivers/net/ps3_gelic_wireless.c
+++ b/drivers/net/ps3_gelic_wireless.c
@@ -1375,6 +1375,7 @@ static int gelic_wl_get_mode(struct net_
 	return 0;
 }
 
+#ifdef CONFIG_GELIC_WIRELESS_OLD_PSK_INTERFACE
 /* SIOCIWFIRSTPRIV */
 static int hex2bin(u8 *str, u8 *bin, unsigned int len)
 {
@@ -1479,6 +1480,7 @@ static int gelic_wl_priv_get_psk(struct 
 	pr_debug("%s:-> %d\n", __func__, data->data.length);
 	return 0;
 }
+#endif
 
 /* SIOCGIWNICKN */
 static int gelic_wl_get_nick(struct net_device *net_dev,
@@ -2329,6 +2331,7 @@ static const iw_handler gelic_wl_wext_ha
 	IW_IOCTL(SIOCGIWNICKN)		= gelic_wl_get_nick,
 };
 
+#ifdef CONFIG_GELIC_WIRELESS_OLD_PSK_INTERFACE
 static struct iw_priv_args gelic_wl_private_args[] =
 {
 	{
@@ -2350,15 +2353,18 @@ static const iw_handler gelic_wl_private
 	gelic_wl_priv_set_psk,
 	gelic_wl_priv_get_psk,
 };
+#endif
 
 static const struct iw_handler_def gelic_wl_wext_handler_def = {
 	.num_standard		= ARRAY_SIZE(gelic_wl_wext_handler),
 	.standard		= gelic_wl_wext_handler,
 	.get_wireless_stats	= gelic_wl_get_wireless_stats,
+#ifdef CONFIG_GELIC_WIRELESS_OLD_PSK_INTERFACE
 	.num_private		= ARRAY_SIZE(gelic_wl_private_handler),
 	.num_private_args	= ARRAY_SIZE(gelic_wl_private_args),
 	.private		= gelic_wl_private_handler,
 	.private_args		= gelic_wl_private_args,
+#endif
 };
 
 static struct net_device *gelic_wl_alloc(struct gelic_card *card)


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

* Re: [PATCH 0/3] RFC: Add support for passing PMK to WEXT
  2008-04-25  4:51 [PATCH 0/3] RFC: Add support for passing PMK to WEXT Masakazu Mokuno
                   ` (2 preceding siblings ...)
  2008-04-25  5:05 ` [PATCH 3/3] RFC: PS3: gelic: Deprecate the private ioctls " Masakazu Mokuno
@ 2008-04-26 16:13 ` Johannes Berg
  2008-04-27  6:35   ` Jouni Malinen
  3 siblings, 1 reply; 8+ messages in thread
From: Johannes Berg @ 2008-04-26 16:13 UTC (permalink / raw)
  To: Masakazu Mokuno; +Cc: linux-wireless

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

Hi,

>   - define the standard way to pass the PMK to the driver
>   - let user space programs figure out whether the driver will do 4-way
>     handshakes
>   - eliminate the use of private ioctls from the gelic driver
> 
> #1	Add support for passing PMK and capability flags to WEXT
> #2	Use the new PMK interface in the gelic driver
> #3	Deprecate the private ioctls in the gelic driver
> 
> 
> #1 adds the flags to WEXT, #2 and #3 let the gelic driver conform.
> 
> Please review!

Looks fine to me. You might want to ask for Jouni's input since took
part in the original design and will have to take the wpa_supplicant
patch :)

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

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

* Re: [PATCH 0/3] RFC: Add support for passing PMK to WEXT
  2008-04-26 16:13 ` [PATCH 0/3] RFC: Add support for passing PMK to WEXT Johannes Berg
@ 2008-04-27  6:35   ` Jouni Malinen
  2008-04-28  4:07     ` Dan Williams
  0 siblings, 1 reply; 8+ messages in thread
From: Jouni Malinen @ 2008-04-27  6:35 UTC (permalink / raw)
  To: Johannes Berg; +Cc: Masakazu Mokuno, linux-wireless

On Sat, Apr 26, 2008 at 06:13:47PM +0200, Johannes Berg wrote:

> Looks fine to me. You might want to ask for Jouni's input since took
> part in the original design and will have to take the wpa_supplicant
> patch :)

Actually, I had already seen this (and the matching wpa_supplicant
patch) and commented it before it was sent to linux-wireless. I'm fine
with this version.

-- 
Jouni Malinen                                            PGP id EFC895FA

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

* Re: [PATCH 0/3] RFC: Add support for passing PMK to WEXT
  2008-04-27  6:35   ` Jouni Malinen
@ 2008-04-28  4:07     ` Dan Williams
  2008-05-07 10:06       ` Masakazu Mokuno
  0 siblings, 1 reply; 8+ messages in thread
From: Dan Williams @ 2008-04-28  4:07 UTC (permalink / raw)
  To: Jouni Malinen; +Cc: Johannes Berg, Masakazu Mokuno, linux-wireless

On Sun, 2008-04-27 at 09:35 +0300, Jouni Malinen wrote:
> On Sat, Apr 26, 2008 at 06:13:47PM +0200, Johannes Berg wrote:
> 
> > Looks fine to me. You might want to ask for Jouni's input since took
> > part in the original design and will have to take the wpa_supplicant
> > patch :)
> 
> Actually, I had already seen this (and the matching wpa_supplicant
> patch) and commented it before it was sent to linux-wireless. I'm fine
> with this version.

Yeah, looks good to me too.

Dan


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

* Re: [PATCH 0/3] RFC: Add support for passing PMK to WEXT
  2008-04-28  4:07     ` Dan Williams
@ 2008-05-07 10:06       ` Masakazu Mokuno
  0 siblings, 0 replies; 8+ messages in thread
From: Masakazu Mokuno @ 2008-05-07 10:06 UTC (permalink / raw)
  To: Dan Williams, Jouni Malinen, Johannes Berg
  Cc: geoffrey.levand, Geert Uytterhoeven, linux-wireless


On Mon, 28 Apr 2008 00:07:24 -0400
Dan Williams <dcbw@redhat.com> wrote:

> On Sun, 2008-04-27 at 09:35 +0300, Jouni Malinen wrote:
> > On Sat, Apr 26, 2008 at 06:13:47PM +0200, Johannes Berg wrote:
> > 
> > > Looks fine to me. You might want to ask for Jouni's input since took
> > > part in the original design and will have to take the wpa_supplicant
> > > patch :)
> > 
> > Actually, I had already seen this (and the matching wpa_supplicant
> > patch) and commented it before it was sent to linux-wireless. I'm fine
> > with this version.
> 
> Yeah, looks good to me too.
> 

Thanks for your reviews!

I've got Jouni's comments as already he mentioned.  This set was the
revised version.

I'll submit them as usual patches.


-- 
Masakazu Mokuno


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

end of thread, other threads:[~2008-05-07 10:07 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-25  4:51 [PATCH 0/3] RFC: Add support for passing PMK to WEXT Masakazu Mokuno
2008-04-25  5:05 ` [PATCH 1/3] RFC: WEXT: Add support for passing PMK and capability flags " Masakazu Mokuno
2008-04-25  5:05 ` [PATCH 2/3] RFC: PS3: gelic: Use the new PMK interface in the gelic driver Masakazu Mokuno
2008-04-25  5:05 ` [PATCH 3/3] RFC: PS3: gelic: Deprecate the private ioctls " Masakazu Mokuno
2008-04-26 16:13 ` [PATCH 0/3] RFC: Add support for passing PMK to WEXT Johannes Berg
2008-04-27  6:35   ` Jouni Malinen
2008-04-28  4:07     ` Dan Williams
2008-05-07 10:06       ` Masakazu Mokuno

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox