[PATCH, resend] libertas: problems setting wpa keys

Marc Pignat marc.pignat at hevs.ch
Wed Oct 3 02:01:20 EDT 2007


The 88w8385 chip, using sdio interface and firmware release 5.0.11p0, has
problems when both unicast and multicast key are set in one command.
This small patch insure only one key is set at once.

Signed-off-by: Marc Pignat <marc.pignat at hevs.ch>

---

Hello!

This is a resend with proper format of the patch sent on libertas-dev
Complete discussion is in the thread named "problems setting wpa keys" (2007-09-18).

Regards

Marc


--- drivers/net/wireless/libertas/assoc.c.orig	2007-09-18 12:00:32.000000000 +0200
+++ drivers/net/wireless/libertas/assoc.c	2007-09-18 14:08:40.000000000 +0200
@@ -372,15 +372,35 @@
                                  struct assoc_request * assoc_req)
 {
 	int ret = 0;
+	unsigned int flags = assoc_req->flags;

 	lbs_deb_enter(LBS_DEB_ASSOC);

-	ret = libertas_prepare_and_send_command(priv,
-				    CMD_802_11_KEY_MATERIAL,
-				    CMD_ACT_SET,
-				    CMD_OPTION_WAITFORRSP,
-				    0, assoc_req);
+	if (test_bit(ASSOC_FLAG_WPA_UCAST_KEY, &assoc_req->flags)) {
+		clear_bit(ASSOC_FLAG_WPA_MCAST_KEY, &assoc_req->flags);
+		ret = libertas_prepare_and_send_command(priv,
+					CMD_802_11_KEY_MATERIAL,
+					CMD_ACT_SET,
+					CMD_OPTION_WAITFORRSP,
+					0, assoc_req);
+		assoc_req->flags = flags;
+	}
+
+	if (ret)
+		goto out;
+
+	if (test_bit(ASSOC_FLAG_WPA_MCAST_KEY, &assoc_req->flags)) {
+		clear_bit(ASSOC_FLAG_WPA_UCAST_KEY, &assoc_req->flags);
+
+		ret = libertas_prepare_and_send_command(priv,
+					CMD_802_11_KEY_MATERIAL,
+					CMD_ACT_SET,
+					CMD_OPTION_WAITFORRSP,
+					0, assoc_req);
+		assoc_req->flags = flags;
+	}

+out:
 	lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret);
 	return ret;
 }




More information about the libertas-dev mailing list