diff options
author | Zhu Yi <yi.zhu@intel.com> | 2009-10-16 01:18:46 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-10-27 16:48:24 -0400 |
commit | 03d1a62c1fb10fe00cfc5cb7f4496d8d6d0e7660 (patch) | |
tree | 8b8cc89b08568b7e18d7e065984f4a762adffd4b /drivers/net/wireless/iwmc3200wifi | |
parent | 30315ff05fce99ef0c172a966b3ed71baa62219b (diff) |
iwmc3200wifi: allow joining an existed IBSS network
We used to only support creating a new IBSS network. Now joining to
an existed IBSS network is supported as well.
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwmc3200wifi')
-rw-r--r-- | drivers/net/wireless/iwmc3200wifi/cfg80211.c | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/drivers/net/wireless/iwmc3200wifi/cfg80211.c b/drivers/net/wireless/iwmc3200wifi/cfg80211.c index a56a2b0ac99a..703edb30c269 100644 --- a/drivers/net/wireless/iwmc3200wifi/cfg80211.c +++ b/drivers/net/wireless/iwmc3200wifi/cfg80211.c | |||
@@ -404,39 +404,21 @@ static int iwm_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev, | |||
404 | { | 404 | { |
405 | struct iwm_priv *iwm = wiphy_to_iwm(wiphy); | 405 | struct iwm_priv *iwm = wiphy_to_iwm(wiphy); |
406 | struct ieee80211_channel *chan = params->channel; | 406 | struct ieee80211_channel *chan = params->channel; |
407 | struct cfg80211_bss *bss; | ||
408 | 407 | ||
409 | if (!test_bit(IWM_STATUS_READY, &iwm->status)) | 408 | if (!test_bit(IWM_STATUS_READY, &iwm->status)) |
410 | return -EIO; | 409 | return -EIO; |
411 | 410 | ||
412 | /* UMAC doesn't support creating IBSS network with specified bssid. | 411 | /* UMAC doesn't support creating or joining an IBSS network |
413 | * This should be removed after we have join only mode supported. */ | 412 | * with specified bssid. */ |
414 | if (params->bssid) | 413 | if (params->bssid) |
415 | return -EOPNOTSUPP; | 414 | return -EOPNOTSUPP; |
416 | 415 | ||
417 | bss = cfg80211_get_ibss(iwm_to_wiphy(iwm), NULL, | ||
418 | params->ssid, params->ssid_len); | ||
419 | if (!bss) { | ||
420 | iwm_scan_one_ssid(iwm, params->ssid, params->ssid_len); | ||
421 | schedule_timeout_interruptible(2 * HZ); | ||
422 | bss = cfg80211_get_ibss(iwm_to_wiphy(iwm), NULL, | ||
423 | params->ssid, params->ssid_len); | ||
424 | } | ||
425 | /* IBSS join only mode is not supported by UMAC ATM */ | ||
426 | if (bss) { | ||
427 | cfg80211_put_bss(bss); | ||
428 | return -EOPNOTSUPP; | ||
429 | } | ||
430 | |||
431 | iwm->channel = ieee80211_frequency_to_channel(chan->center_freq); | 416 | iwm->channel = ieee80211_frequency_to_channel(chan->center_freq); |
432 | iwm->umac_profile->ibss.band = chan->band; | 417 | iwm->umac_profile->ibss.band = chan->band; |
433 | iwm->umac_profile->ibss.channel = iwm->channel; | 418 | iwm->umac_profile->ibss.channel = iwm->channel; |
434 | iwm->umac_profile->ssid.ssid_len = params->ssid_len; | 419 | iwm->umac_profile->ssid.ssid_len = params->ssid_len; |
435 | memcpy(iwm->umac_profile->ssid.ssid, params->ssid, params->ssid_len); | 420 | memcpy(iwm->umac_profile->ssid.ssid, params->ssid, params->ssid_len); |
436 | 421 | ||
437 | if (params->bssid) | ||
438 | memcpy(&iwm->umac_profile->bssid[0], params->bssid, ETH_ALEN); | ||
439 | |||
440 | return iwm_send_mlme_profile(iwm); | 422 | return iwm_send_mlme_profile(iwm); |
441 | } | 423 | } |
442 | 424 | ||