diff options
author | Dan Williams <dcbw@redhat.com> | 2007-08-02 13:14:29 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-10 19:50:10 -0400 |
commit | 0edef215e405fef3c6569511a9aebeeb3f6cd799 (patch) | |
tree | 250b4de92fd2efb9859a77e71793b3e600af42a6 /drivers/net | |
parent | 9556d2120ceecc158b324fa01e30704ff9f42ae3 (diff) |
[PATCH] libertas: send association events on adhoc reassociation
Send association event to userspace when reassociating to the same
ad-hoc network, because it's still an association.
Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/libertas/join.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/drivers/net/wireless/libertas/join.c b/drivers/net/wireless/libertas/join.c index c16d1f625d1b..0ebf2f8acbf1 100644 --- a/drivers/net/wireless/libertas/join.c +++ b/drivers/net/wireless/libertas/join.c | |||
@@ -209,15 +209,26 @@ int libertas_join_adhoc_network(wlan_private * priv, struct assoc_request * asso | |||
209 | bss->ssid_len); | 209 | bss->ssid_len); |
210 | 210 | ||
211 | /* check if the requested SSID is already joined */ | 211 | /* check if the requested SSID is already joined */ |
212 | if (adapter->curbssparams.ssid_len | 212 | if ( adapter->curbssparams.ssid_len |
213 | && !libertas_ssid_cmp(adapter->curbssparams.ssid, | 213 | && !libertas_ssid_cmp(adapter->curbssparams.ssid, |
214 | adapter->curbssparams.ssid_len, | 214 | adapter->curbssparams.ssid_len, |
215 | bss->ssid, bss->ssid_len) | 215 | bss->ssid, bss->ssid_len) |
216 | && (adapter->mode == IW_MODE_ADHOC)) { | 216 | && (adapter->mode == IW_MODE_ADHOC) |
217 | lbs_deb_join( | 217 | && (adapter->connect_status == LIBERTAS_CONNECTED)) { |
218 | "ADHOC_J_CMD: New ad-hoc SSID is the same as current, " | 218 | union iwreq_data wrqu; |
219 | "not attempting to re-join"); | 219 | |
220 | return -1; | 220 | lbs_deb_join("ADHOC_J_CMD: New ad-hoc SSID is the same as " |
221 | "current, not attempting to re-join"); | ||
222 | |||
223 | /* Send the re-association event though, because the association | ||
224 | * request really was successful, even if just a null-op. | ||
225 | */ | ||
226 | memset(&wrqu, 0, sizeof(wrqu)); | ||
227 | memcpy(wrqu.ap_addr.sa_data, adapter->curbssparams.bssid, | ||
228 | ETH_ALEN); | ||
229 | wrqu.ap_addr.sa_family = ARPHRD_ETHER; | ||
230 | wireless_send_event(priv->dev, SIOCGIWAP, &wrqu, NULL); | ||
231 | goto out; | ||
221 | } | 232 | } |
222 | 233 | ||
223 | /* Use shortpreamble only when both creator and card supports | 234 | /* Use shortpreamble only when both creator and card supports |
@@ -242,6 +253,7 @@ int libertas_join_adhoc_network(wlan_private * priv, struct assoc_request * asso | |||
242 | 0, CMD_OPTION_WAITFORRSP, | 253 | 0, CMD_OPTION_WAITFORRSP, |
243 | OID_802_11_SSID, assoc_req); | 254 | OID_802_11_SSID, assoc_req); |
244 | 255 | ||
256 | out: | ||
245 | return ret; | 257 | return ret; |
246 | } | 258 | } |
247 | 259 | ||