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>
This commit is contained in:
parent
30315ff05f
commit
03d1a62c1f
@ -404,39 +404,21 @@ static int iwm_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
|
|||||||
{
|
{
|
||||||
struct iwm_priv *iwm = wiphy_to_iwm(wiphy);
|
struct iwm_priv *iwm = wiphy_to_iwm(wiphy);
|
||||||
struct ieee80211_channel *chan = params->channel;
|
struct ieee80211_channel *chan = params->channel;
|
||||||
struct cfg80211_bss *bss;
|
|
||||||
|
|
||||||
if (!test_bit(IWM_STATUS_READY, &iwm->status))
|
if (!test_bit(IWM_STATUS_READY, &iwm->status))
|
||||||
return -EIO;
|
return -EIO;
|
||||||
|
|
||||||
/* UMAC doesn't support creating IBSS network with specified bssid.
|
/* UMAC doesn't support creating or joining an IBSS network
|
||||||
* This should be removed after we have join only mode supported. */
|
* with specified bssid. */
|
||||||
if (params->bssid)
|
if (params->bssid)
|
||||||
return -EOPNOTSUPP;
|
return -EOPNOTSUPP;
|
||||||
|
|
||||||
bss = cfg80211_get_ibss(iwm_to_wiphy(iwm), NULL,
|
|
||||||
params->ssid, params->ssid_len);
|
|
||||||
if (!bss) {
|
|
||||||
iwm_scan_one_ssid(iwm, params->ssid, params->ssid_len);
|
|
||||||
schedule_timeout_interruptible(2 * HZ);
|
|
||||||
bss = cfg80211_get_ibss(iwm_to_wiphy(iwm), NULL,
|
|
||||||
params->ssid, params->ssid_len);
|
|
||||||
}
|
|
||||||
/* IBSS join only mode is not supported by UMAC ATM */
|
|
||||||
if (bss) {
|
|
||||||
cfg80211_put_bss(bss);
|
|
||||||
return -EOPNOTSUPP;
|
|
||||||
}
|
|
||||||
|
|
||||||
iwm->channel = ieee80211_frequency_to_channel(chan->center_freq);
|
iwm->channel = ieee80211_frequency_to_channel(chan->center_freq);
|
||||||
iwm->umac_profile->ibss.band = chan->band;
|
iwm->umac_profile->ibss.band = chan->band;
|
||||||
iwm->umac_profile->ibss.channel = iwm->channel;
|
iwm->umac_profile->ibss.channel = iwm->channel;
|
||||||
iwm->umac_profile->ssid.ssid_len = params->ssid_len;
|
iwm->umac_profile->ssid.ssid_len = params->ssid_len;
|
||||||
memcpy(iwm->umac_profile->ssid.ssid, params->ssid, params->ssid_len);
|
memcpy(iwm->umac_profile->ssid.ssid, params->ssid, params->ssid_len);
|
||||||
|
|
||||||
if (params->bssid)
|
|
||||||
memcpy(&iwm->umac_profile->bssid[0], params->bssid, ETH_ALEN);
|
|
||||||
|
|
||||||
return iwm_send_mlme_profile(iwm);
|
return iwm_send_mlme_profile(iwm);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user