Skip to contentSkip to conversation

softmac: report SIOCGIWAP event upon association

PATCH In review Daniel Drake 2 participants 2 messages Apr 19, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 softmac: report SIOCGIWAP event upon association

wpa_supplicant requires some notification when association has completed, and this is the way to do it.

Before this patch, wpa_supplicant just times out when trying to associate, even though the association completed successfully in the background. This was reported at
http://www.mail-archive.com/[email protected]/msg00959.html

After this patch, wpa_supplicant works for me. I have tested connecting to a WEP network.

net/ieee80211/softmac/ieee80211softmac_assoc.c renamed from net/ieee80211/softmac/ieee80211softmac_assoc.c.orig +6 -0
@@ -282,6 +282,8 @@ ieee80211softmac_associated(struct ieee8
 	struct ieee80211_assoc_response * resp,
 	struct ieee80211softmac_network *net)
 {
+	union iwreq_data wrqu;
+
 	mac->associnfo.associating = 0;
 	mac->associated = 1;
 	if (mac->set_bssid_filter)
@@ -290,6 +292,10 @@ ieee80211softmac_associated(struct ieee8
 	netif_carrier_on(mac->dev);
 	
 	mac->association_id = le16_to_cpup(&resp->aid);
+
+	wrqu.ap_addr.sa_family = ARPHRD_ETHER;
+	memcpy(wrqu.ap_addr.sa_data, net->bssid, ETH_ALEN);
+	wireless_send_event(mac->dev, SIOCGIWAP, &wrqu, NULL);
 }
 
 /* received frame handling functions */