All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sebastian Smolorz <Sebastian.Smolorz@gmx.de>
To: kalle.valo@iki.fi
Cc: linux-wireless@vger.kernel.org
Subject: [RFC] Changes in mac80211 to make at76c50x-usb working again
Date: Tue, 15 Jun 2010 14:16:36 +0200	[thread overview]
Message-ID: <201006151416.36686.Sebastian.Smolorz@gmx.de> (raw)

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;
 }

             reply	other threads:[~2010-06-15 12:15 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-15 12:16 Sebastian Smolorz [this message]
2010-06-15 13:26 ` [RFC] Changes in mac80211 to make at76c50x-usb working again 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

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=201006151416.36686.Sebastian.Smolorz@gmx.de \
    --to=sebastian.smolorz@gmx.de \
    --cc=kalle.valo@iki.fi \
    --cc=linux-wireless@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.