提交 afaf8bdb 编写于 作者: E Eliad Peller 提交者: Luciano Coelho

wl12xx: move dev_hlid into wlvif

move dev_hlid into the per-interface data, rather than
being global.
Signed-off-by: NEliad Peller <eliad@wizery.com>
Signed-off-by: NLuciano Coelho <coelho@ti.com>
上级 e936bbe0
...@@ -483,12 +483,12 @@ int wl12xx_cmd_role_start_dev(struct wl1271 *wl, struct wl12xx_vif *wlvif) ...@@ -483,12 +483,12 @@ int wl12xx_cmd_role_start_dev(struct wl1271 *wl, struct wl12xx_vif *wlvif)
cmd->band = WL12XX_BAND_5GHZ; cmd->band = WL12XX_BAND_5GHZ;
cmd->channel = wl->channel; cmd->channel = wl->channel;
if (wl->dev_hlid == WL12XX_INVALID_LINK_ID) { if (wlvif->dev_hlid == WL12XX_INVALID_LINK_ID) {
ret = wl12xx_allocate_link(wl, &wl->dev_hlid); ret = wl12xx_allocate_link(wl, &wlvif->dev_hlid);
if (ret) if (ret)
goto out_free; goto out_free;
} }
cmd->device.hlid = wl->dev_hlid; cmd->device.hlid = wlvif->dev_hlid;
cmd->device.session = wlvif->session_counter; cmd->device.session = wlvif->session_counter;
wl1271_debug(DEBUG_CMD, "role start: roleid=%d, hlid=%d, session=%d", wl1271_debug(DEBUG_CMD, "role start: roleid=%d, hlid=%d, session=%d",
...@@ -504,9 +504,7 @@ int wl12xx_cmd_role_start_dev(struct wl1271 *wl, struct wl12xx_vif *wlvif) ...@@ -504,9 +504,7 @@ int wl12xx_cmd_role_start_dev(struct wl1271 *wl, struct wl12xx_vif *wlvif)
err_hlid: err_hlid:
/* clear links on error */ /* clear links on error */
__clear_bit(wl->dev_hlid, wl->links_map); wl12xx_free_link(wl, &wlvif->dev_hlid);
wl->dev_hlid = WL12XX_INVALID_LINK_ID;
out_free: out_free:
kfree(cmd); kfree(cmd);
...@@ -520,7 +518,7 @@ int wl12xx_cmd_role_stop_dev(struct wl1271 *wl, struct wl12xx_vif *wlvif) ...@@ -520,7 +518,7 @@ int wl12xx_cmd_role_stop_dev(struct wl1271 *wl, struct wl12xx_vif *wlvif)
struct wl12xx_cmd_role_stop *cmd; struct wl12xx_cmd_role_stop *cmd;
int ret; int ret;
if (WARN_ON(wl->dev_hlid == WL12XX_INVALID_LINK_ID)) if (WARN_ON(wlvif->dev_hlid == WL12XX_INVALID_LINK_ID))
return -EINVAL; return -EINVAL;
cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); cmd = kzalloc(sizeof(*cmd), GFP_KERNEL);
...@@ -547,7 +545,7 @@ int wl12xx_cmd_role_stop_dev(struct wl1271 *wl, struct wl12xx_vif *wlvif) ...@@ -547,7 +545,7 @@ int wl12xx_cmd_role_stop_dev(struct wl1271 *wl, struct wl12xx_vif *wlvif)
goto out_free; goto out_free;
} }
wl12xx_free_link(wl, &wl->dev_hlid); wl12xx_free_link(wl, &wlvif->dev_hlid);
out_free: out_free:
kfree(cmd); kfree(cmd);
......
...@@ -1884,6 +1884,7 @@ static int wl12xx_init_vif_data(struct ieee80211_vif *vif) ...@@ -1884,6 +1884,7 @@ static int wl12xx_init_vif_data(struct ieee80211_vif *vif)
wlvif->role_id = WL12XX_INVALID_ROLE_ID; wlvif->role_id = WL12XX_INVALID_ROLE_ID;
wlvif->dev_role_id = WL12XX_INVALID_ROLE_ID; wlvif->dev_role_id = WL12XX_INVALID_ROLE_ID;
wlvif->dev_hlid = WL12XX_INVALID_LINK_ID;
if (wlvif->bss_type == BSS_TYPE_STA_BSS || if (wlvif->bss_type == BSS_TYPE_STA_BSS ||
wlvif->bss_type == BSS_TYPE_IBSS) { wlvif->bss_type == BSS_TYPE_IBSS) {
...@@ -2103,7 +2104,7 @@ static void __wl1271_op_remove_interface(struct wl1271 *wl, ...@@ -2103,7 +2104,7 @@ static void __wl1271_op_remove_interface(struct wl1271 *wl,
deinit: deinit:
/* clear all hlids (except system_hlid) */ /* clear all hlids (except system_hlid) */
wlvif->sta.hlid = WL12XX_INVALID_LINK_ID; wlvif->sta.hlid = WL12XX_INVALID_LINK_ID;
wl->dev_hlid = WL12XX_INVALID_LINK_ID; wlvif->dev_hlid = WL12XX_INVALID_LINK_ID;
wlvif->ap.bcast_hlid = WL12XX_INVALID_LINK_ID; wlvif->ap.bcast_hlid = WL12XX_INVALID_LINK_ID;
wlvif->ap.global_hlid = WL12XX_INVALID_LINK_ID; wlvif->ap.global_hlid = WL12XX_INVALID_LINK_ID;
...@@ -4908,7 +4909,6 @@ struct ieee80211_hw *wl1271_alloc_hw(void) ...@@ -4908,7 +4909,6 @@ struct ieee80211_hw *wl1271_alloc_hw(void)
wl->tx_security_last_seq_lsb = 0; wl->tx_security_last_seq_lsb = 0;
wl->tx_spare_blocks = TX_HW_BLOCK_SPARE_DEFAULT; wl->tx_spare_blocks = TX_HW_BLOCK_SPARE_DEFAULT;
wl->system_hlid = WL12XX_SYSTEM_HLID; wl->system_hlid = WL12XX_SYSTEM_HLID;
wl->dev_hlid = WL12XX_INVALID_LINK_ID;
wl->active_sta_count = 0; wl->active_sta_count = 0;
setup_timer(&wl->rx_streaming_timer, wl1271_rx_streaming_timer, setup_timer(&wl->rx_streaming_timer, wl1271_rx_streaming_timer,
(unsigned long) wl); (unsigned long) wl);
......
...@@ -94,7 +94,7 @@ static int wl1271_tx_update_filters(struct wl1271 *wl, ...@@ -94,7 +94,7 @@ static int wl1271_tx_update_filters(struct wl1271 *wl,
if (!ieee80211_is_auth(hdr->frame_control)) if (!ieee80211_is_auth(hdr->frame_control))
return 0; return 0;
if (wl->dev_hlid != WL12XX_INVALID_LINK_ID) if (wlvif->dev_hlid != WL12XX_INVALID_LINK_ID)
goto out; goto out;
wl1271_debug(DEBUG_CMD, "starting device role for roaming"); wl1271_debug(DEBUG_CMD, "starting device role for roaming");
...@@ -202,7 +202,7 @@ static u8 wl1271_tx_get_hlid(struct wl1271 *wl, struct ieee80211_vif *vif, ...@@ -202,7 +202,7 @@ static u8 wl1271_tx_get_hlid(struct wl1271 *wl, struct ieee80211_vif *vif,
!ieee80211_is_assoc_req(hdr->frame_control)) !ieee80211_is_assoc_req(hdr->frame_control))
return wlvif->sta.hlid; return wlvif->sta.hlid;
else else
return wl->dev_hlid; return wlvif->dev_hlid;
} }
static unsigned int wl12xx_calc_packet_alignment(struct wl1271 *wl, static unsigned int wl12xx_calc_packet_alignment(struct wl1271 *wl,
......
...@@ -402,7 +402,6 @@ struct wl1271 { ...@@ -402,7 +402,6 @@ struct wl1271 {
u8 mac_addr[ETH_ALEN]; u8 mac_addr[ETH_ALEN];
int channel; int channel;
u8 system_hlid; u8 system_hlid;
u8 dev_hlid;
unsigned long links_map[BITS_TO_LONGS(WL12XX_MAX_LINKS)]; unsigned long links_map[BITS_TO_LONGS(WL12XX_MAX_LINKS)];
unsigned long roles_map[BITS_TO_LONGS(WL12XX_MAX_ROLES)]; unsigned long roles_map[BITS_TO_LONGS(WL12XX_MAX_ROLES)];
...@@ -617,6 +616,7 @@ struct wl12xx_vif { ...@@ -617,6 +616,7 @@ struct wl12xx_vif {
/* sta/ibss specific */ /* sta/ibss specific */
u8 dev_role_id; u8 dev_role_id;
u8 dev_hlid;
union { union {
struct { struct {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册