Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 279357
b: refs/heads/master
c: 92e712d
h: refs/heads/master
i:
  279355: fa7aa5d
v: v3
  • Loading branch information
Eliad Peller authored and Luciano Coelho committed Dec 20, 2011
1 parent c60ba73 commit dc3be88
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 24 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8aefffeaae5d2e10edc77c084f75dc36bcce0c68
refs/heads/master: 92e712da55b2e5776fee7e177e789c01828a1bf4
41 changes: 18 additions & 23 deletions trunk/drivers/net/wireless/wl12xx/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2036,6 +2036,11 @@ static bool wl12xx_init_fw(struct wl1271 *wl)
return booted;
}

static bool wl12xx_dev_role_started(struct wl12xx_vif *wlvif)
{
return wlvif->dev_hlid != WL12XX_INVALID_LINK_ID;
}

static int wl1271_op_add_interface(struct ieee80211_hw *hw,
struct ieee80211_vif *vif)
{
Expand Down Expand Up @@ -2369,17 +2374,6 @@ static void wl1271_set_band_rate(struct wl1271 *wl, struct wl12xx_vif *wlvif)
wlvif->rate_set = wlvif->basic_rate_set;
}

static bool wl12xx_is_roc(struct wl1271 *wl)
{
u8 role_id;

role_id = find_first_bit(wl->roc_map, WL12XX_MAX_ROLES);
if (role_id >= WL12XX_MAX_ROLES)
return false;

return true;
}

static int wl1271_sta_handle_idle(struct wl1271 *wl, struct wl12xx_vif *wlvif,
bool idle)
{
Expand All @@ -2391,7 +2385,7 @@ static int wl1271_sta_handle_idle(struct wl1271 *wl, struct wl12xx_vif *wlvif,

if (idle) {
/* no need to croc if we weren't busy (e.g. during boot) */
if (wl12xx_is_roc(wl)) {
if (wl12xx_dev_role_started(wlvif)) {
ret = wl12xx_stop_dev(wl, wlvif);
if (ret < 0)
goto out;
Expand Down Expand Up @@ -2461,7 +2455,7 @@ static int wl12xx_config_vif(struct wl1271 *wl, struct wl12xx_vif *wlvif,

if (test_bit(WLVIF_FLAG_STA_ASSOCIATED,
&wlvif->flags)) {
if (wl12xx_is_roc(wl)) {
if (wl12xx_dev_role_started(wlvif)) {
/* roaming */
ret = wl12xx_croc(wl,
wlvif->dev_role_id);
Expand All @@ -2478,7 +2472,7 @@ static int wl12xx_config_vif(struct wl1271 *wl, struct wl12xx_vif *wlvif,
* not idle. otherwise, CROC will be called
* anyway.
*/
if (wl12xx_is_roc(wl) &&
if (wl12xx_dev_role_started(wlvif) &&
!(conf->flags & IEEE80211_CONF_IDLE)) {
ret = wl12xx_stop_dev(wl, wlvif);
if (ret < 0)
Expand Down Expand Up @@ -3025,15 +3019,16 @@ static int wl1271_op_hw_scan(struct ieee80211_hw *hw,
if (ret < 0)
goto out;

if (test_bit(WLVIF_FLAG_STA_ASSOCIATED, &wlvif->flags) &&
test_bit(wlvif->role_id, wl->roc_map)) {
/* don't allow scanning right now */
ret = -EBUSY;
goto out_sleep;
}

/* cancel ROC before scanning */
if (wl12xx_is_roc(wl)) {
if (test_bit(WLVIF_FLAG_STA_ASSOCIATED, &wlvif->flags)) {
/* don't allow scanning right now */
ret = -EBUSY;
goto out_sleep;
}
if (wl12xx_dev_role_started(wlvif))
wl12xx_stop_dev(wl, wlvif);
}

ret = wl1271_scan(hw->priv, vif, ssid, len, req);
out_sleep:
Expand Down Expand Up @@ -3844,9 +3839,9 @@ static void wl1271_bss_info_changed_sta(struct wl1271 *wl,
}
/*
* stop device role if started (we might already be in
* STA role). TODO: make it better.
* STA/IBSS role).
*/
if (wlvif->dev_role_id != WL12XX_INVALID_ROLE_ID) {
if (wl12xx_dev_role_started(wlvif)) {
ret = wl12xx_stop_dev(wl, wlvif);
if (ret < 0)
goto out;
Expand Down

0 comments on commit dc3be88

Please sign in to comment.