aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorEliad Peller <eliad@wizery.com>2011-10-10 04:13:09 -0400
committerLuciano Coelho <coelho@ti.com>2011-10-11 08:12:12 -0400
commit1b92f15ee0e0f06222d4fd36dc36960d217243b3 (patch)
tree332eea70f430df3917df16a32469867db0c0f3e1 /drivers/net
parent52630c5d89840bf09826fe89cc15f868e92223ef (diff)
wl12xx: add band field to wlvif
add band field into the per-interface data. mac80211 configures some values (e.g. band, channel) globally, while we configure them per-interface. In order to make it easier to keep track of the configured value for each value while keeping sync with mac80211, save these values both globally and per-vif. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/wl12xx/cmd.c32
-rw-r--r--drivers/net/wireless/wl12xx/cmd.h5
-rw-r--r--drivers/net/wireless/wl12xx/event.c2
-rw-r--r--drivers/net/wireless/wl12xx/main.c32
-rw-r--r--drivers/net/wireless/wl12xx/ps.c2
-rw-r--r--drivers/net/wireless/wl12xx/scan.c2
-rw-r--r--drivers/net/wireless/wl12xx/tx.c5
-rw-r--r--drivers/net/wireless/wl12xx/wl12xx.h3
8 files changed, 49 insertions, 34 deletions
diff --git a/drivers/net/wireless/wl12xx/cmd.c b/drivers/net/wireless/wl12xx/cmd.c
index ff653e8832a8..6cf8cdc72b59 100644
--- a/drivers/net/wireless/wl12xx/cmd.c
+++ b/drivers/net/wireless/wl12xx/cmd.c
@@ -481,7 +481,7 @@ int wl12xx_cmd_role_start_dev(struct wl1271 *wl, struct wl12xx_vif *wlvif)
481 wl1271_debug(DEBUG_CMD, "cmd role start dev %d", wlvif->dev_role_id); 481 wl1271_debug(DEBUG_CMD, "cmd role start dev %d", wlvif->dev_role_id);
482 482
483 cmd->role_id = wlvif->dev_role_id; 483 cmd->role_id = wlvif->dev_role_id;
484 if (wl->band == IEEE80211_BAND_5GHZ) 484 if (wlvif->band == IEEE80211_BAND_5GHZ)
485 cmd->band = WL12XX_BAND_5GHZ; 485 cmd->band = WL12XX_BAND_5GHZ;
486 cmd->channel = wl->channel; 486 cmd->channel = wl->channel;
487 487
@@ -571,7 +571,7 @@ int wl12xx_cmd_role_start_sta(struct wl1271 *wl, struct wl12xx_vif *wlvif)
571 wl1271_debug(DEBUG_CMD, "cmd role start sta %d", wlvif->role_id); 571 wl1271_debug(DEBUG_CMD, "cmd role start sta %d", wlvif->role_id);
572 572
573 cmd->role_id = wlvif->role_id; 573 cmd->role_id = wlvif->role_id;
574 if (wl->band == IEEE80211_BAND_5GHZ) 574 if (wlvif->band == IEEE80211_BAND_5GHZ)
575 cmd->band = WL12XX_BAND_5GHZ; 575 cmd->band = WL12XX_BAND_5GHZ;
576 cmd->channel = wl->channel; 576 cmd->channel = wl->channel;
577 cmd->sta.basic_rate_set = cpu_to_le32(wlvif->basic_rate_set); 577 cmd->sta.basic_rate_set = cpu_to_le32(wlvif->basic_rate_set);
@@ -704,7 +704,7 @@ int wl12xx_cmd_role_start_ap(struct wl1271 *wl, struct wl12xx_vif *wlvif)
704 704
705 cmd->ap.local_rates = cpu_to_le32(0xffffffff); 705 cmd->ap.local_rates = cpu_to_le32(0xffffffff);
706 706
707 switch (wl->band) { 707 switch (wlvif->band) {
708 case IEEE80211_BAND_2GHZ: 708 case IEEE80211_BAND_2GHZ:
709 cmd->band = RADIO_BAND_2_4GHZ; 709 cmd->band = RADIO_BAND_2_4GHZ;
710 break; 710 break;
@@ -712,7 +712,7 @@ int wl12xx_cmd_role_start_ap(struct wl1271 *wl, struct wl12xx_vif *wlvif)
712 cmd->band = RADIO_BAND_5GHZ; 712 cmd->band = RADIO_BAND_5GHZ;
713 break; 713 break;
714 default: 714 default:
715 wl1271_warning("ap start - unknown band: %d", (int)wl->band); 715 wl1271_warning("ap start - unknown band: %d", (int)wlvif->band);
716 cmd->band = RADIO_BAND_2_4GHZ; 716 cmd->band = RADIO_BAND_2_4GHZ;
717 break; 717 break;
718 } 718 }
@@ -785,7 +785,7 @@ int wl12xx_cmd_role_start_ibss(struct wl1271 *wl, struct wl12xx_vif *wlvif)
785 wl1271_debug(DEBUG_CMD, "cmd role start ibss %d", wlvif->role_id); 785 wl1271_debug(DEBUG_CMD, "cmd role start ibss %d", wlvif->role_id);
786 786
787 cmd->role_id = wlvif->role_id; 787 cmd->role_id = wlvif->role_id;
788 if (wl->band == IEEE80211_BAND_5GHZ) 788 if (wlvif->band == IEEE80211_BAND_5GHZ)
789 cmd->band = WL12XX_BAND_5GHZ; 789 cmd->band = WL12XX_BAND_5GHZ;
790 cmd->channel = wl->channel; 790 cmd->channel = wl->channel;
791 cmd->ibss.basic_rate_set = cpu_to_le32(wlvif->basic_rate_set); 791 cmd->ibss.basic_rate_set = cpu_to_le32(wlvif->basic_rate_set);
@@ -1157,8 +1157,8 @@ struct sk_buff *wl1271_cmd_build_ap_probe_req(struct wl1271 *wl,
1157 1157
1158 wl1271_dump(DEBUG_SCAN, "AP PROBE REQ: ", skb->data, skb->len); 1158 wl1271_dump(DEBUG_SCAN, "AP PROBE REQ: ", skb->data, skb->len);
1159 1159
1160 rate = wl1271_tx_min_rate_get(wl, wlvif->bitrate_masks[wl->band]); 1160 rate = wl1271_tx_min_rate_get(wl, wlvif->bitrate_masks[wlvif->band]);
1161 if (wl->band == IEEE80211_BAND_2GHZ) 1161 if (wlvif->band == IEEE80211_BAND_2GHZ)
1162 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_CFG_PROBE_REQ_2_4, 1162 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_CFG_PROBE_REQ_2_4,
1163 skb->data, skb->len, 0, rate); 1163 skb->data, skb->len, 0, rate);
1164 else 1164 else
@@ -1428,7 +1428,8 @@ out:
1428 return ret; 1428 return ret;
1429} 1429}
1430 1430
1431int wl12xx_cmd_add_peer(struct wl1271 *wl, struct ieee80211_sta *sta, u8 hlid) 1431int wl12xx_cmd_add_peer(struct wl1271 *wl, struct wl12xx_vif *wlvif,
1432 struct ieee80211_sta *sta, u8 hlid)
1432{ 1433{
1433 struct wl12xx_cmd_add_peer *cmd; 1434 struct wl12xx_cmd_add_peer *cmd;
1434 int i, ret; 1435 int i, ret;
@@ -1455,13 +1456,13 @@ int wl12xx_cmd_add_peer(struct wl1271 *wl, struct ieee80211_sta *sta, u8 hlid)
1455 else 1456 else
1456 cmd->psd_type[i] = WL1271_PSD_LEGACY; 1457 cmd->psd_type[i] = WL1271_PSD_LEGACY;
1457 1458
1458 sta_rates = sta->supp_rates[wl->band]; 1459 sta_rates = sta->supp_rates[wlvif->band];
1459 if (sta->ht_cap.ht_supported) 1460 if (sta->ht_cap.ht_supported)
1460 sta_rates |= sta->ht_cap.mcs.rx_mask[0] << HW_HT_RATES_OFFSET; 1461 sta_rates |= sta->ht_cap.mcs.rx_mask[0] << HW_HT_RATES_OFFSET;
1461 1462
1462 cmd->supported_rates = 1463 cmd->supported_rates =
1463 cpu_to_le32(wl1271_tx_enabled_rates_get(wl, sta_rates, 1464 cpu_to_le32(wl1271_tx_enabled_rates_get(wl, sta_rates,
1464 wl->band)); 1465 wlvif->band));
1465 1466
1466 wl1271_debug(DEBUG_CMD, "new peer rates=0x%x queues=0x%x", 1467 wl1271_debug(DEBUG_CMD, "new peer rates=0x%x queues=0x%x",
1467 cmd->supported_rates, sta->uapsd_queues); 1468 cmd->supported_rates, sta->uapsd_queues);
@@ -1601,7 +1602,8 @@ out:
1601 return ret; 1602 return ret;
1602} 1603}
1603 1604
1604static int wl12xx_cmd_roc(struct wl1271 *wl, u8 role_id) 1605static int wl12xx_cmd_roc(struct wl1271 *wl, struct wl12xx_vif *wlvif,
1606 u8 role_id)
1605{ 1607{
1606 struct wl12xx_cmd_roc *cmd; 1608 struct wl12xx_cmd_roc *cmd;
1607 int ret = 0; 1609 int ret = 0;
@@ -1619,7 +1621,7 @@ static int wl12xx_cmd_roc(struct wl1271 *wl, u8 role_id)
1619 1621
1620 cmd->role_id = role_id; 1622 cmd->role_id = role_id;
1621 cmd->channel = wl->channel; 1623 cmd->channel = wl->channel;
1622 switch (wl->band) { 1624 switch (wlvif->band) {
1623 case IEEE80211_BAND_2GHZ: 1625 case IEEE80211_BAND_2GHZ:
1624 cmd->band = RADIO_BAND_2_4GHZ; 1626 cmd->band = RADIO_BAND_2_4GHZ;
1625 break; 1627 break;
@@ -1627,7 +1629,7 @@ static int wl12xx_cmd_roc(struct wl1271 *wl, u8 role_id)
1627 cmd->band = RADIO_BAND_5GHZ; 1629 cmd->band = RADIO_BAND_5GHZ;
1628 break; 1630 break;
1629 default: 1631 default:
1630 wl1271_error("roc - unknown band: %d", (int)wl->band); 1632 wl1271_error("roc - unknown band: %d", (int)wlvif->band);
1631 ret = -EINVAL; 1633 ret = -EINVAL;
1632 goto out_free; 1634 goto out_free;
1633 } 1635 }
@@ -1674,14 +1676,14 @@ out:
1674 return ret; 1676 return ret;
1675} 1677}
1676 1678
1677int wl12xx_roc(struct wl1271 *wl, u8 role_id) 1679int wl12xx_roc(struct wl1271 *wl, struct wl12xx_vif *wlvif, u8 role_id)
1678{ 1680{
1679 int ret = 0; 1681 int ret = 0;
1680 1682
1681 if (WARN_ON(test_bit(role_id, wl->roc_map))) 1683 if (WARN_ON(test_bit(role_id, wl->roc_map)))
1682 return 0; 1684 return 0;
1683 1685
1684 ret = wl12xx_cmd_roc(wl, role_id); 1686 ret = wl12xx_cmd_roc(wl, wlvif, role_id);
1685 if (ret < 0) 1687 if (ret < 0)
1686 goto out; 1688 goto out;
1687 1689
diff --git a/drivers/net/wireless/wl12xx/cmd.h b/drivers/net/wireless/wl12xx/cmd.h
index 8182cf1b4861..968d5bdc0b60 100644
--- a/drivers/net/wireless/wl12xx/cmd.h
+++ b/drivers/net/wireless/wl12xx/cmd.h
@@ -80,9 +80,10 @@ int wl1271_cmd_set_ap_key(struct wl1271 *wl, struct wl12xx_vif *wlvif,
80 u8 key_size, const u8 *key, u8 hlid, u32 tx_seq_32, 80 u8 key_size, const u8 *key, u8 hlid, u32 tx_seq_32,
81 u16 tx_seq_16); 81 u16 tx_seq_16);
82int wl12xx_cmd_set_peer_state(struct wl1271 *wl, u8 hlid); 82int wl12xx_cmd_set_peer_state(struct wl1271 *wl, u8 hlid);
83int wl12xx_roc(struct wl1271 *wl, u8 role_id); 83int wl12xx_roc(struct wl1271 *wl, struct wl12xx_vif *wlvif, u8 role_id);
84int wl12xx_croc(struct wl1271 *wl, u8 role_id); 84int wl12xx_croc(struct wl1271 *wl, u8 role_id);
85int wl12xx_cmd_add_peer(struct wl1271 *wl, struct ieee80211_sta *sta, u8 hlid); 85int wl12xx_cmd_add_peer(struct wl1271 *wl, struct wl12xx_vif *wlvif,
86 struct ieee80211_sta *sta, u8 hlid);
86int wl12xx_cmd_remove_peer(struct wl1271 *wl, u8 hlid); 87int wl12xx_cmd_remove_peer(struct wl1271 *wl, u8 hlid);
87int wl12xx_cmd_config_fwlog(struct wl1271 *wl); 88int wl12xx_cmd_config_fwlog(struct wl1271 *wl);
88int wl12xx_cmd_start_fwlog(struct wl1271 *wl); 89int wl12xx_cmd_start_fwlog(struct wl1271 *wl);
diff --git a/drivers/net/wireless/wl12xx/event.c b/drivers/net/wireless/wl12xx/event.c
index a47312db5a2a..fd2e7b2d9389 100644
--- a/drivers/net/wireless/wl12xx/event.c
+++ b/drivers/net/wireless/wl12xx/event.c
@@ -145,7 +145,7 @@ static int wl1271_event_ps_report(struct wl1271 *wl,
145 * BET has only a minor effect in 5GHz and masks 145 * BET has only a minor effect in 5GHz and masks
146 * channel switch IEs, so we only enable BET on 2.4GHz 146 * channel switch IEs, so we only enable BET on 2.4GHz
147 */ 147 */
148 if (wl->band == IEEE80211_BAND_2GHZ) 148 if (wlvif->band == IEEE80211_BAND_2GHZ)
149 /* enable beacon early termination */ 149 /* enable beacon early termination */
150 ret = wl1271_acx_bet_enable(wl, wlvif, true); 150 ret = wl1271_acx_bet_enable(wl, wlvif, true);
151 151
diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index 0647d460b698..8e395f1f4b1a 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -1968,6 +1968,12 @@ static int wl12xx_init_vif_data(struct wl1271 *wl, struct ieee80211_vif *vif)
1968 wlvif->rate_set = CONF_TX_RATE_MASK_BASIC; 1968 wlvif->rate_set = CONF_TX_RATE_MASK_BASIC;
1969 wlvif->beacon_int = WL1271_DEFAULT_BEACON_INT; 1969 wlvif->beacon_int = WL1271_DEFAULT_BEACON_INT;
1970 1970
1971 /*
1972 * mac80211 configures some values globally, while we treat them
1973 * per-interface. thus, on init, we have to copy them from wl
1974 */
1975 wlvif->band = wl->band;
1976
1971 INIT_WORK(&wlvif->rx_streaming_enable_work, 1977 INIT_WORK(&wlvif->rx_streaming_enable_work,
1972 wl1271_rx_streaming_enable_work); 1978 wl1271_rx_streaming_enable_work);
1973 INIT_WORK(&wlvif->rx_streaming_disable_work, 1979 INIT_WORK(&wlvif->rx_streaming_disable_work,
@@ -2337,7 +2343,7 @@ out:
2337 2343
2338static void wl1271_set_band_rate(struct wl1271 *wl, struct wl12xx_vif *wlvif) 2344static void wl1271_set_band_rate(struct wl1271 *wl, struct wl12xx_vif *wlvif)
2339{ 2345{
2340 wlvif->basic_rate_set = wlvif->bitrate_masks[wl->band]; 2346 wlvif->basic_rate_set = wlvif->bitrate_masks[wlvif->band];
2341 wlvif->rate_set = wlvif->basic_rate_set; 2347 wlvif->rate_set = wlvif->basic_rate_set;
2342} 2348}
2343 2349
@@ -2390,7 +2396,7 @@ static int wl1271_sta_handle_idle(struct wl1271 *wl, struct wl12xx_vif *wlvif,
2390 if (ret < 0) 2396 if (ret < 0)
2391 goto out; 2397 goto out;
2392 2398
2393 ret = wl12xx_roc(wl, wlvif->dev_role_id); 2399 ret = wl12xx_roc(wl, wlvif, wlvif->dev_role_id);
2394 if (ret < 0) 2400 if (ret < 0)
2395 goto out; 2401 goto out;
2396 clear_bit(WL1271_FLAG_IDLE, &wl->flags); 2402 clear_bit(WL1271_FLAG_IDLE, &wl->flags);
@@ -2451,11 +2457,12 @@ static int wl1271_op_config(struct ieee80211_hw *hw, u32 changed)
2451 2457
2452 /* if the channel changes while joined, join again */ 2458 /* if the channel changes while joined, join again */
2453 if (changed & IEEE80211_CONF_CHANGE_CHANNEL && 2459 if (changed & IEEE80211_CONF_CHANGE_CHANNEL &&
2454 ((wl->band != conf->channel->band) || 2460 ((wlvif->band != conf->channel->band) ||
2455 (wl->channel != channel))) { 2461 (wl->channel != channel))) {
2456 /* send all pending packets */ 2462 /* send all pending packets */
2457 wl1271_tx_work_locked(wl); 2463 wl1271_tx_work_locked(wl);
2458 wl->band = conf->channel->band; 2464 wl->band = conf->channel->band;
2465 wlvif->band = conf->channel->band;
2459 wl->channel = channel; 2466 wl->channel = channel;
2460 2467
2461 if (!is_ap) { 2468 if (!is_ap) {
@@ -2502,7 +2509,7 @@ static int wl1271_op_config(struct ieee80211_hw *hw, u32 changed)
2502 if (ret < 0) 2509 if (ret < 0)
2503 goto out_sleep; 2510 goto out_sleep;
2504 2511
2505 ret = wl12xx_roc(wl, 2512 ret = wl12xx_roc(wl, wlvif,
2506 wlvif->dev_role_id); 2513 wlvif->dev_role_id);
2507 if (ret < 0) 2514 if (ret < 0)
2508 wl1271_warning("roc failed %d", 2515 wl1271_warning("roc failed %d",
@@ -3420,7 +3427,7 @@ static void wl1271_bss_info_changed_ap(struct wl1271 *wl,
3420 u32 rates = bss_conf->basic_rates; 3427 u32 rates = bss_conf->basic_rates;
3421 3428
3422 wlvif->basic_rate_set = wl1271_tx_enabled_rates_get(wl, rates, 3429 wlvif->basic_rate_set = wl1271_tx_enabled_rates_get(wl, rates,
3423 wl->band); 3430 wlvif->band);
3424 wlvif->basic_rate = wl1271_tx_min_rate_get(wl, 3431 wlvif->basic_rate = wl1271_tx_min_rate_get(wl,
3425 wlvif->basic_rate_set); 3432 wlvif->basic_rate_set);
3426 3433
@@ -3516,7 +3523,7 @@ static void wl1271_bss_info_changed_sta(struct wl1271 *wl,
3516 &wlvif->flags)) { 3523 &wlvif->flags)) {
3517 wl1271_unjoin(wl, wlvif); 3524 wl1271_unjoin(wl, wlvif);
3518 wl12xx_cmd_role_start_dev(wl, wlvif); 3525 wl12xx_cmd_role_start_dev(wl, wlvif);
3519 wl12xx_roc(wl, wlvif->dev_role_id); 3526 wl12xx_roc(wl, wlvif, wlvif->dev_role_id);
3520 } 3527 }
3521 } 3528 }
3522 } 3529 }
@@ -3595,7 +3602,7 @@ sta_not_found:
3595 rates = bss_conf->basic_rates; 3602 rates = bss_conf->basic_rates;
3596 wlvif->basic_rate_set = 3603 wlvif->basic_rate_set =
3597 wl1271_tx_enabled_rates_get(wl, rates, 3604 wl1271_tx_enabled_rates_get(wl, rates,
3598 wl->band); 3605 wlvif->band);
3599 wlvif->basic_rate = 3606 wlvif->basic_rate =
3600 wl1271_tx_min_rate_get(wl, 3607 wl1271_tx_min_rate_get(wl,
3601 wlvif->basic_rate_set); 3608 wlvif->basic_rate_set);
@@ -3603,7 +3610,7 @@ sta_not_found:
3603 wlvif->rate_set = 3610 wlvif->rate_set =
3604 wl1271_tx_enabled_rates_get(wl, 3611 wl1271_tx_enabled_rates_get(wl,
3605 sta_rate_set, 3612 sta_rate_set,
3606 wl->band); 3613 wlvif->band);
3607 ret = wl1271_acx_sta_rate_policies(wl, wlvif); 3614 ret = wl1271_acx_sta_rate_policies(wl, wlvif);
3608 if (ret < 0) 3615 if (ret < 0)
3609 goto out; 3616 goto out;
@@ -3694,7 +3701,8 @@ sta_not_found:
3694 wl1271_unjoin(wl, wlvif); 3701 wl1271_unjoin(wl, wlvif);
3695 if (!(conf_flags & IEEE80211_CONF_IDLE)) { 3702 if (!(conf_flags & IEEE80211_CONF_IDLE)) {
3696 wl12xx_cmd_role_start_dev(wl, wlvif); 3703 wl12xx_cmd_role_start_dev(wl, wlvif);
3697 wl12xx_roc(wl, wlvif->dev_role_id); 3704 wl12xx_roc(wl, wlvif,
3705 wlvif->dev_role_id);
3698 } 3706 }
3699 } 3707 }
3700 } 3708 }
@@ -3708,7 +3716,7 @@ sta_not_found:
3708 u32 rates = bss_conf->basic_rates; 3716 u32 rates = bss_conf->basic_rates;
3709 wlvif->basic_rate_set = 3717 wlvif->basic_rate_set =
3710 wl1271_tx_enabled_rates_get(wl, rates, 3718 wl1271_tx_enabled_rates_get(wl, rates,
3711 wl->band); 3719 wlvif->band);
3712 wlvif->basic_rate = 3720 wlvif->basic_rate =
3713 wl1271_tx_min_rate_get(wl, 3721 wl1271_tx_min_rate_get(wl,
3714 wlvif->basic_rate_set); 3722 wlvif->basic_rate_set);
@@ -3762,7 +3770,7 @@ sta_not_found:
3762 3770
3763 /* ROC until connected (after EAPOL exchange) */ 3771 /* ROC until connected (after EAPOL exchange) */
3764 if (!is_ibss) { 3772 if (!is_ibss) {
3765 ret = wl12xx_roc(wl, wlvif->role_id); 3773 ret = wl12xx_roc(wl, wlvif, wlvif->role_id);
3766 if (ret < 0) 3774 if (ret < 0)
3767 goto out; 3775 goto out;
3768 3776
@@ -4068,7 +4076,7 @@ static int wl1271_op_sta_add(struct ieee80211_hw *hw,
4068 if (ret < 0) 4076 if (ret < 0)
4069 goto out_free_sta; 4077 goto out_free_sta;
4070 4078
4071 ret = wl12xx_cmd_add_peer(wl, sta, hlid); 4079 ret = wl12xx_cmd_add_peer(wl, wlvif, sta, hlid);
4072 if (ret < 0) 4080 if (ret < 0)
4073 goto out_sleep; 4081 goto out_sleep;
4074 4082
diff --git a/drivers/net/wireless/wl12xx/ps.c b/drivers/net/wireless/wl12xx/ps.c
index 8cd81cec2841..8153408233b5 100644
--- a/drivers/net/wireless/wl12xx/ps.c
+++ b/drivers/net/wireless/wl12xx/ps.c
@@ -178,7 +178,7 @@ int wl1271_ps_set_mode(struct wl1271 *wl, struct wl12xx_vif *wlvif,
178 wl1271_debug(DEBUG_PSM, "leaving psm"); 178 wl1271_debug(DEBUG_PSM, "leaving psm");
179 179
180 /* disable beacon early termination */ 180 /* disable beacon early termination */
181 if (wl->band == IEEE80211_BAND_2GHZ) { 181 if (wlvif->band == IEEE80211_BAND_2GHZ) {
182 ret = wl1271_acx_bet_enable(wl, wlvif, false); 182 ret = wl1271_acx_bet_enable(wl, wlvif, false);
183 if (ret < 0) 183 if (ret < 0)
184 return ret; 184 return ret;
diff --git a/drivers/net/wireless/wl12xx/scan.c b/drivers/net/wireless/wl12xx/scan.c
index 765f08ba29af..2711438fdde3 100644
--- a/drivers/net/wireless/wl12xx/scan.c
+++ b/drivers/net/wireless/wl12xx/scan.c
@@ -77,7 +77,7 @@ void wl1271_scan_complete_work(struct work_struct *work)
77 !test_bit(wlvif->dev_role_id, wl->roc_map)) { 77 !test_bit(wlvif->dev_role_id, wl->roc_map)) {
78 /* restore remain on channel */ 78 /* restore remain on channel */
79 wl12xx_cmd_role_start_dev(wl, wlvif); 79 wl12xx_cmd_role_start_dev(wl, wlvif);
80 wl12xx_roc(wl, wlvif->dev_role_id); 80 wl12xx_roc(wl, wlvif, wlvif->dev_role_id);
81 } 81 }
82 wl1271_ps_elp_sleep(wl); 82 wl1271_ps_elp_sleep(wl);
83 83
diff --git a/drivers/net/wireless/wl12xx/tx.c b/drivers/net/wireless/wl12xx/tx.c
index 3cf7166dab63..604913ff42bd 100644
--- a/drivers/net/wireless/wl12xx/tx.c
+++ b/drivers/net/wireless/wl12xx/tx.c
@@ -102,7 +102,7 @@ static int wl1271_tx_update_filters(struct wl1271 *wl,
102 if (ret < 0) 102 if (ret < 0)
103 goto out; 103 goto out;
104 104
105 ret = wl12xx_roc(wl, wlvif->dev_role_id); 105 ret = wl12xx_roc(wl, wlvif, wlvif->dev_role_id);
106 if (ret < 0) 106 if (ret < 0)
107 goto out; 107 goto out;
108out: 108out:
@@ -809,7 +809,8 @@ static void wl1271_tx_complete_packet(struct wl1271 *wl,
809 if (result->status == TX_SUCCESS) { 809 if (result->status == TX_SUCCESS) {
810 if (!(info->flags & IEEE80211_TX_CTL_NO_ACK)) 810 if (!(info->flags & IEEE80211_TX_CTL_NO_ACK))
811 info->flags |= IEEE80211_TX_STAT_ACK; 811 info->flags |= IEEE80211_TX_STAT_ACK;
812 rate = wl1271_rate_to_idx(result->rate_class_index, wl->band); 812 rate = wl1271_rate_to_idx(result->rate_class_index,
813 wlvif->band);
813 retries = result->ack_failures; 814 retries = result->ack_failures;
814 } else if (result->status == TX_RETRY_EXCEEDED) { 815 } else if (result->status == TX_RETRY_EXCEEDED) {
815 wl->stats.excessive_retries++; 816 wl->stats.excessive_retries++;
diff --git a/drivers/net/wireless/wl12xx/wl12xx.h b/drivers/net/wireless/wl12xx/wl12xx.h
index fc8c9758fc0c..a689ad02a357 100644
--- a/drivers/net/wireless/wl12xx/wl12xx.h
+++ b/drivers/net/wireless/wl12xx/wl12xx.h
@@ -591,6 +591,9 @@ struct wl12xx_vif {
591 u8 ssid[IEEE80211_MAX_SSID_LEN + 1]; 591 u8 ssid[IEEE80211_MAX_SSID_LEN + 1];
592 u8 ssid_len; 592 u8 ssid_len;
593 593
594 /* The current band */
595 enum ieee80211_band band;
596
594 u32 bitrate_masks[IEEE80211_NUM_BANDS]; 597 u32 bitrate_masks[IEEE80211_NUM_BANDS];
595 u32 basic_rate_set; 598 u32 basic_rate_set;
596 599