Skip to content

Commit

Permalink
cfg80211: use sme_state in ibss start/join path
Browse files Browse the repository at this point in the history
CFG80211_DEV_WARN_ON() at "net/wireless/ibss.c line 63"
is unnecessarily triggered even after successful connection,
when cfg80211_ibss_joined() is called by driver inside
.join_ibss handler.

This patch fixes the problem by changing 'sme_state' in ibss path
and having WARN_ON() check for 'sme_state' similar to infra
association.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Amitkumar Karwar authored and linvjw committed Jun 4, 2012
1 parent 7a1c993 commit 28f3336
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion net/wireless/ibss.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ void __cfg80211_ibss_joined(struct net_device *dev, const u8 *bssid)
cfg80211_hold_bss(bss_from_pub(bss));
wdev->current_bss = bss_from_pub(bss);

wdev->sme_state = CFG80211_SME_CONNECTED;
cfg80211_upload_connect_keys(wdev);

nl80211_send_ibss_bssid(wiphy_to_dev(wdev->wiphy), dev, bssid,
Expand All @@ -60,7 +61,7 @@ void cfg80211_ibss_joined(struct net_device *dev, const u8 *bssid, gfp_t gfp)
struct cfg80211_event *ev;
unsigned long flags;

CFG80211_DEV_WARN_ON(!wdev->ssid_len);
CFG80211_DEV_WARN_ON(wdev->sme_state != CFG80211_SME_CONNECTING);

ev = kzalloc(sizeof(*ev), gfp);
if (!ev)
Expand Down Expand Up @@ -115,9 +116,11 @@ int __cfg80211_join_ibss(struct cfg80211_registered_device *rdev,
#ifdef CONFIG_CFG80211_WEXT
wdev->wext.ibss.channel = params->channel;
#endif
wdev->sme_state = CFG80211_SME_CONNECTING;
err = rdev->ops->join_ibss(&rdev->wiphy, dev, params);
if (err) {
wdev->connect_keys = NULL;
wdev->sme_state = CFG80211_SME_IDLE;
return err;
}

Expand Down Expand Up @@ -169,6 +172,7 @@ static void __cfg80211_clear_ibss(struct net_device *dev, bool nowext)
}

wdev->current_bss = NULL;
wdev->sme_state = CFG80211_SME_IDLE;
wdev->ssid_len = 0;
#ifdef CONFIG_CFG80211_WEXT
if (!nowext)
Expand Down

0 comments on commit 28f3336

Please sign in to comment.