All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC] Changes in mac80211 to make at76c50x-usb working again
@ 2010-06-15 12:16 Sebastian Smolorz
  2010-06-15 13:26 ` John W. Linville
  0 siblings, 1 reply; 11+ messages in thread
From: Sebastian Smolorz @ 2010-06-15 12:16 UTC (permalink / raw)
  To: kalle.valo; +Cc: linux-wireless

Hi,

the at76c50x-usb driver fails to authenticate with an AP. The last working 
major kernel version was 2.6.30. I investigated the problem and found out 
that the driver needs to send a join command (CMD_JOIN) prior to the actual 
authentication process. For the join command, the driver needs to know the 
bssid of the AP. The problem is now that the mac80211 layer does not inform 
the driver about the bssid prior to the authentication. So we have a 
chicken-and-egg dilemma.

The following patch solves the described problem. As it modifies generic 
mac80211 code and thus has influence on all drivers I'm open for comments on 
how to make a proper, probably less intrusive patch.

Sebastian

---
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index a1bf46c..6c34b4f 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -180,17 +180,9 @@ void ieee80211_bss_info_change_notify(struct ieee80211_sub_if_data *sdata,
 	if (!changed)
 		return;
 
-	if (sdata->vif.type == NL80211_IFTYPE_STATION) {
-		/*
-		 * While not associated, claim a BSSID of all-zeroes
-		 * so that drivers don't do any weird things with the
-		 * BSSID at that time.
-		 */
-		if (sdata->vif.bss_conf.assoc)
-			sdata->vif.bss_conf.bssid = sdata->u.mgd.bssid;
-		else
-			sdata->vif.bss_conf.bssid = zero;
-	} else if (sdata->vif.type == NL80211_IFTYPE_ADHOC)
+	if (sdata->vif.type == NL80211_IFTYPE_STATION)
+		sdata->vif.bss_conf.bssid = sdata->u.mgd.bssid;
+	else if (sdata->vif.type == NL80211_IFTYPE_ADHOC)
 		sdata->vif.bss_conf.bssid = sdata->u.ibss.bssid;
 	else if (sdata->vif.type == NL80211_IFTYPE_AP)
 		sdata->vif.bss_conf.bssid = sdata->vif.addr;
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 4dad08f..b06b175 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -2042,6 +2042,9 @@ int ieee80211_mgd_auth(struct ieee80211_sub_if_data *sdata,
 	wk->sdata = sdata;
 	wk->done = ieee80211_probe_auth_done;
 
+	memcpy(sdata->u.mgd.bssid, req->bss->bssid, ETH_ALEN);
+	ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BSSID);
+
 	ieee80211_add_work(wk);
 	return 0;
 }

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

end of thread, other threads:[~2010-06-17  7:50 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-15 12:16 [RFC] Changes in mac80211 to make at76c50x-usb working again Sebastian Smolorz
2010-06-15 13:26 ` John W. Linville
2010-06-15 13:36   ` Johannes Berg
2010-06-15 13:49     ` Sebastian Smolorz
2010-06-15 13:56       ` Johannes Berg
2010-06-15 14:11         ` Sebastian Smolorz
2010-06-15 14:21           ` Johannes Berg
2010-06-15 14:26     ` Kalle Valo
2010-06-16  7:46       ` Sebastian Smolorz
2010-06-17  6:27         ` Kalle Valo
2010-06-17  7:51           ` Sebastian Smolorz

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.