return wl->session_counter;
}
-int wl12xx_cmd_role_start_dev(struct wl1271 *wl)
+int wl12xx_cmd_role_start_dev(struct wl1271 *wl, struct wl12xx_vif *wlvif)
{
struct wl12xx_cmd_role_start *cmd;
int ret;
goto out;
}
- wl1271_debug(DEBUG_CMD, "cmd role start dev %d", wl->dev_role_id);
+ wl1271_debug(DEBUG_CMD, "cmd role start dev %d", wlvif->dev_role_id);
- cmd->role_id = wl->dev_role_id;
+ cmd->role_id = wlvif->dev_role_id;
if (wl->band == IEEE80211_BAND_5GHZ)
cmd->band = WL12XX_BAND_5GHZ;
cmd->channel = wl->channel;
return ret;
}
-int wl12xx_cmd_role_stop_dev(struct wl1271 *wl)
+int wl12xx_cmd_role_stop_dev(struct wl1271 *wl, struct wl12xx_vif *wlvif)
{
struct wl12xx_cmd_role_stop *cmd;
int ret;
wl1271_debug(DEBUG_CMD, "cmd role stop dev");
- cmd->role_id = wl->dev_role_id;
+ cmd->role_id = wlvif->dev_role_id;
cmd->disc_type = DISCONNECT_IMMEDIATE;
cmd->reason = cpu_to_le16(WLAN_REASON_UNSPECIFIED);
{
wlvif->bss_type = MAX_BSS_TYPE;
wlvif->role_id = WL12XX_INVALID_ROLE_ID;
+ wlvif->dev_role_id = WL12XX_INVALID_ROLE_ID;
wlvif->basic_rate_set = CONF_TX_RATE_MASK_BASIC;
wlvif->basic_rate = CONF_TX_RATE_MASK_BASIC;
wlvif->rate_set = CONF_TX_RATE_MASK_BASIC;
*/
ret = wl12xx_cmd_role_enable(wl, vif->addr,
WL1271_ROLE_DEVICE,
- &wl->dev_role_id);
+ &wlvif->dev_role_id);
if (ret < 0)
goto irq_disable;
}
goto deinit;
if (wlvif->bss_type == BSS_TYPE_STA_BSS) {
- ret = wl12xx_cmd_role_disable(wl, &wl->dev_role_id);
+ ret = wl12xx_cmd_role_disable(wl, &wlvif->dev_role_id);
if (ret < 0)
goto deinit;
}
wl->ap_ps_map = 0;
wl->sched_scanning = false;
wlvif->role_id = WL12XX_INVALID_ROLE_ID;
- wl->dev_role_id = WL12XX_INVALID_ROLE_ID;
+ wlvif->dev_role_id = WL12XX_INVALID_ROLE_ID;
memset(wl->roles_map, 0, sizeof(wl->roles_map));
memset(wl->links_map, 0, sizeof(wl->links_map));
memset(wl->roc_map, 0, sizeof(wl->roc_map));
if (idle) {
/* no need to croc if we weren't busy (e.g. during boot) */
if (wl12xx_is_roc(wl)) {
- ret = wl12xx_croc(wl, wl->dev_role_id);
+ ret = wl12xx_croc(wl, wlvif->dev_role_id);
if (ret < 0)
goto out;
- ret = wl12xx_cmd_role_stop_dev(wl);
+ ret = wl12xx_cmd_role_stop_dev(wl, wlvif);
if (ret < 0)
goto out;
}
ieee80211_sched_scan_stopped(wl->hw);
}
- ret = wl12xx_cmd_role_start_dev(wl);
+ ret = wl12xx_cmd_role_start_dev(wl, wlvif);
if (ret < 0)
goto out;
- ret = wl12xx_roc(wl, wl->dev_role_id);
+ ret = wl12xx_roc(wl, wlvif->dev_role_id);
if (ret < 0)
goto out;
clear_bit(WL1271_FLAG_IDLE, &wl->flags);
if (test_bit(WL1271_FLAG_STA_ASSOCIATED, &wl->flags)) {
if (wl12xx_is_roc(wl)) {
/* roaming */
- ret = wl12xx_croc(wl, wl->dev_role_id);
+ ret = wl12xx_croc(wl,
+ wlvif->dev_role_id);
if (ret < 0)
goto out_sleep;
}
*/
if (wl12xx_is_roc(wl) &&
!(conf->flags & IEEE80211_CONF_IDLE)) {
- ret = wl12xx_croc(wl, wl->dev_role_id);
+ ret = wl12xx_croc(wl,
+ wlvif->dev_role_id);
if (ret < 0)
goto out_sleep;
- ret = wl12xx_roc(wl, wl->dev_role_id);
+ ret = wl12xx_roc(wl,
+ wlvif->dev_role_id);
if (ret < 0)
wl1271_warning("roc failed %d",
ret);
struct cfg80211_scan_request *req)
{
struct wl1271 *wl = hw->priv;
+ struct wl12xx_vif *wlvif = wl12xx_vif_to_data(vif);
+
int ret;
u8 *ssid = NULL;
size_t len = 0;
ret = -EBUSY;
goto out_sleep;
}
- wl12xx_croc(wl, wl->dev_role_id);
- wl12xx_cmd_role_stop_dev(wl);
+ wl12xx_croc(wl, wlvif->dev_role_id);
+ wl12xx_cmd_role_stop_dev(wl, wlvif);
}
ret = wl1271_scan(hw->priv, vif, ssid, len, req);
if (test_and_clear_bit(WL1271_FLAG_IBSS_JOINED,
&wl->flags)) {
wl1271_unjoin(wl, wlvif);
- wl12xx_cmd_role_start_dev(wl);
- wl12xx_roc(wl, wl->dev_role_id);
+ wl12xx_cmd_role_start_dev(wl, wlvif);
+ wl12xx_roc(wl, wlvif->dev_role_id);
}
}
}
* roaming on the same channel. until we will
* have a better flow...)
*/
- if (test_bit(wl->dev_role_id, wl->roc_map)) {
- ret = wl12xx_croc(wl, wl->dev_role_id);
+ if (test_bit(wlvif->dev_role_id, wl->roc_map)) {
+ ret = wl12xx_croc(wl,
+ wlvif->dev_role_id);
if (ret < 0)
goto out;
}
wl1271_unjoin(wl, wlvif);
if (!(conf_flags & IEEE80211_CONF_IDLE)) {
- wl12xx_cmd_role_start_dev(wl);
- wl12xx_roc(wl, wl->dev_role_id);
+ wl12xx_cmd_role_start_dev(wl, wlvif);
+ wl12xx_roc(wl, wlvif->dev_role_id);
}
}
}
* stop device role if started (we might already be in
* STA role). TODO: make it better.
*/
- if (wl->dev_role_id != WL12XX_INVALID_ROLE_ID) {
- ret = wl12xx_croc(wl, wl->dev_role_id);
+ if (wlvif->dev_role_id != WL12XX_INVALID_ROLE_ID) {
+ ret = wl12xx_croc(wl, wlvif->dev_role_id);
if (ret < 0)
goto out;
- ret = wl12xx_cmd_role_stop_dev(wl);
+ ret = wl12xx_cmd_role_stop_dev(wl, wlvif);
if (ret < 0)
goto out;
}
wl->tx_spare_blocks = TX_HW_BLOCK_SPARE_DEFAULT;
wl->system_hlid = WL12XX_SYSTEM_HLID;
wl->sta_hlid = WL12XX_INVALID_LINK_ID;
- wl->dev_role_id = WL12XX_INVALID_ROLE_ID;
wl->dev_hlid = WL12XX_INVALID_LINK_ID;
wl->session_counter = 0;
wl->ap_bcast_hlid = WL12XX_INVALID_LINK_ID;
{
struct delayed_work *dwork;
struct wl1271 *wl;
+ struct ieee80211_vif *vif;
struct wl12xx_vif *wlvif;
int ret;
bool is_sta, is_ibss;
if (wl->scan.state == WL1271_SCAN_STATE_IDLE)
goto out;
- wlvif = wl12xx_vif_to_data(wl->scan_vif);
+ vif = wl->scan_vif;
+ wlvif = wl12xx_vif_to_data(vif);
wl->scan.state = WL1271_SCAN_STATE_IDLE;
memset(wl->scan.scanned_ch, 0, sizeof(wl->scan.scanned_ch));
is_ibss = (wlvif->bss_type == BSS_TYPE_IBSS);
if (((is_sta && !test_bit(WL1271_FLAG_STA_ASSOCIATED, &wl->flags)) ||
(is_ibss && !test_bit(WL1271_FLAG_IBSS_JOINED, &wl->flags))) &&
- !test_bit(wl->dev_role_id, wl->roc_map)) {
+ !test_bit(wlvif->dev_role_id, wl->roc_map)) {
/* restore remain on channel */
- wl12xx_cmd_role_start_dev(wl);
- wl12xx_roc(wl, wl->dev_role_id);
+ wl12xx_cmd_role_start_dev(wl, wlvif);
+ wl12xx_roc(wl, wlvif->dev_role_id);
}
wl1271_ps_elp_sleep(wl);
}
static int wl1271_tx_update_filters(struct wl1271 *wl,
- struct sk_buff *skb)
+ struct wl12xx_vif *wlvif,
+ struct sk_buff *skb)
{
struct ieee80211_hdr *hdr;
int ret;
goto out;
wl1271_debug(DEBUG_CMD, "starting device role for roaming");
- ret = wl12xx_cmd_role_start_dev(wl);
+ ret = wl12xx_cmd_role_start_dev(wl, wlvif);
if (ret < 0)
goto out;
- ret = wl12xx_roc(wl, wl->dev_role_id);
+ ret = wl12xx_roc(wl, wlvif->dev_role_id);
if (ret < 0)
goto out;
out:
if (wlvif->bss_type == BSS_TYPE_AP_BSS)
return wl12xx_tx_get_hlid_ap(wl, skb);
- wl1271_tx_update_filters(wl, skb);
+ wl1271_tx_update_filters(wl, wlvif, skb);
if ((test_bit(WL1271_FLAG_STA_ASSOCIATED, &wl->flags) ||
test_bit(WL1271_FLAG_IBSS_JOINED, &wl->flags)) &&