Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 278662
b: refs/heads/master
c: c7ffb90
h: refs/heads/master
v: v3
  • Loading branch information
Eliad Peller authored and Luciano Coelho committed Oct 7, 2011
1 parent 292ff97 commit a2517f4
Show file tree
Hide file tree
Showing 10 changed files with 93 additions and 118 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: d0802abdf9c60b1dadb097e806022f3449b0cc6b
refs/heads/master: c7ffb902cca655e4d6bdda4156407008573bb214
34 changes: 18 additions & 16 deletions trunk/drivers/net/wireless/wl12xx/cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -434,23 +434,25 @@ int wl12xx_cmd_role_disable(struct wl1271 *wl, u8 *role_id)
return ret;
}

static int wl12xx_allocate_link(struct wl1271 *wl, u8 *hlid)
int wl12xx_allocate_link(struct wl1271 *wl, struct wl12xx_vif *wlvif, u8 *hlid)
{
u8 link = find_first_zero_bit(wl->links_map, WL12XX_MAX_LINKS);
if (link >= WL12XX_MAX_LINKS)
return -EBUSY;

__set_bit(link, wl->links_map);
__set_bit(link, wlvif->links_map);
*hlid = link;
return 0;
}

static void wl12xx_free_link(struct wl1271 *wl, u8 *hlid)
void wl12xx_free_link(struct wl1271 *wl, struct wl12xx_vif *wlvif, u8 *hlid)
{
if (*hlid == WL12XX_INVALID_LINK_ID)
return;

__clear_bit(*hlid, wl->links_map);
__clear_bit(*hlid, wlvif->links_map);
*hlid = WL12XX_INVALID_LINK_ID;
}

Expand Down Expand Up @@ -484,7 +486,7 @@ int wl12xx_cmd_role_start_dev(struct wl1271 *wl, struct wl12xx_vif *wlvif)
cmd->channel = wl->channel;

if (wlvif->dev_hlid == WL12XX_INVALID_LINK_ID) {
ret = wl12xx_allocate_link(wl, &wlvif->dev_hlid);
ret = wl12xx_allocate_link(wl, wlvif, &wlvif->dev_hlid);
if (ret)
goto out_free;
}
Expand All @@ -504,7 +506,7 @@ int wl12xx_cmd_role_start_dev(struct wl1271 *wl, struct wl12xx_vif *wlvif)

err_hlid:
/* clear links on error */
wl12xx_free_link(wl, &wlvif->dev_hlid);
wl12xx_free_link(wl, wlvif, &wlvif->dev_hlid);

out_free:
kfree(cmd);
Expand Down Expand Up @@ -545,7 +547,7 @@ int wl12xx_cmd_role_stop_dev(struct wl1271 *wl, struct wl12xx_vif *wlvif)
goto out_free;
}

wl12xx_free_link(wl, &wlvif->dev_hlid);
wl12xx_free_link(wl, wlvif, &wlvif->dev_hlid);

out_free:
kfree(cmd);
Expand Down Expand Up @@ -581,7 +583,7 @@ int wl12xx_cmd_role_start_sta(struct wl1271 *wl, struct wl12xx_vif *wlvif)
cmd->sta.local_rates = cpu_to_le32(wlvif->rate_set);

if (wlvif->sta.hlid == WL12XX_INVALID_LINK_ID) {
ret = wl12xx_allocate_link(wl, &wlvif->sta.hlid);
ret = wl12xx_allocate_link(wl, wlvif, &wlvif->sta.hlid);
if (ret)
goto out_free;
}
Expand All @@ -604,7 +606,7 @@ int wl12xx_cmd_role_start_sta(struct wl1271 *wl, struct wl12xx_vif *wlvif)

err_hlid:
/* clear links on error. */
wl12xx_free_link(wl, &wlvif->sta.hlid);
wl12xx_free_link(wl, wlvif, &wlvif->sta.hlid);

out_free:
kfree(cmd);
Expand Down Expand Up @@ -640,7 +642,7 @@ int wl12xx_cmd_role_stop_sta(struct wl1271 *wl, struct wl12xx_vif *wlvif)
goto out_free;
}

wl12xx_free_link(wl, &wlvif->sta.hlid);
wl12xx_free_link(wl, wlvif, &wlvif->sta.hlid);

out_free:
kfree(cmd);
Expand Down Expand Up @@ -670,11 +672,11 @@ int wl12xx_cmd_role_start_ap(struct wl1271 *wl, struct wl12xx_vif *wlvif)
goto out;
}

ret = wl12xx_allocate_link(wl, &wlvif->ap.global_hlid);
ret = wl12xx_allocate_link(wl, wlvif, &wlvif->ap.global_hlid);
if (ret < 0)
goto out_free;

ret = wl12xx_allocate_link(wl, &wlvif->ap.bcast_hlid);
ret = wl12xx_allocate_link(wl, wlvif, &wlvif->ap.bcast_hlid);
if (ret < 0)
goto out_free_global;

Expand Down Expand Up @@ -724,10 +726,10 @@ int wl12xx_cmd_role_start_ap(struct wl1271 *wl, struct wl12xx_vif *wlvif)
goto out_free;

out_free_bcast:
wl12xx_free_link(wl, &wlvif->ap.bcast_hlid);
wl12xx_free_link(wl, wlvif, &wlvif->ap.bcast_hlid);

out_free_global:
wl12xx_free_link(wl, &wlvif->ap.global_hlid);
wl12xx_free_link(wl, wlvif, &wlvif->ap.global_hlid);

out_free:
kfree(cmd);
Expand Down Expand Up @@ -757,8 +759,8 @@ int wl12xx_cmd_role_stop_ap(struct wl1271 *wl, struct wl12xx_vif *wlvif)
goto out_free;
}

wl12xx_free_link(wl, &wlvif->ap.bcast_hlid);
wl12xx_free_link(wl, &wlvif->ap.global_hlid);
wl12xx_free_link(wl, wlvif, &wlvif->ap.bcast_hlid);
wl12xx_free_link(wl, wlvif, &wlvif->ap.global_hlid);

out_free:
kfree(cmd);
Expand Down Expand Up @@ -796,7 +798,7 @@ int wl12xx_cmd_role_start_ibss(struct wl1271 *wl, struct wl12xx_vif *wlvif)
cmd->sta.local_rates = cpu_to_le32(wlvif->rate_set);

if (wlvif->sta.hlid == WL12XX_INVALID_LINK_ID) {
ret = wl12xx_allocate_link(wl, &wlvif->sta.hlid);
ret = wl12xx_allocate_link(wl, wlvif, &wlvif->sta.hlid);
if (ret)
goto out_free;
}
Expand All @@ -821,7 +823,7 @@ int wl12xx_cmd_role_start_ibss(struct wl1271 *wl, struct wl12xx_vif *wlvif)

err_hlid:
/* clear links on error. */
wl12xx_free_link(wl, &wlvif->sta.hlid);
wl12xx_free_link(wl, wlvif, &wlvif->sta.hlid);

out_free:
kfree(cmd);
Expand Down
3 changes: 3 additions & 0 deletions trunk/drivers/net/wireless/wl12xx/cmd.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ int wl12xx_cmd_stop_fwlog(struct wl1271 *wl);
int wl12xx_cmd_channel_switch(struct wl1271 *wl,
struct ieee80211_channel_switch *ch_switch);
int wl12xx_cmd_stop_channel_switch(struct wl1271 *wl);
int wl12xx_allocate_link(struct wl1271 *wl, struct wl12xx_vif *wlvif,
u8 *hlid);
void wl12xx_free_link(struct wl1271 *wl, struct wl12xx_vif *wlvif, u8 *hlid);

enum wl1271_commands {
CMD_INTERROGATE = 1, /*use this to read information elements*/
Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/net/wireless/wl12xx/debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,6 @@ static ssize_t driver_state_read(struct file *file, char __user *user_buf,
DRIVER_STATE_PRINT_INT(sg_enabled);
DRIVER_STATE_PRINT_INT(enable_11a);
DRIVER_STATE_PRINT_INT(noise);
DRIVER_STATE_PRINT_LHEX(ap_hlid_map[0]);
DRIVER_STATE_PRINT_INT(last_tx_hlid);
DRIVER_STATE_PRINT_HEX(ap_fw_ps_map);
DRIVER_STATE_PRINT_LHEX(ap_ps_map);
Expand Down
15 changes: 7 additions & 8 deletions trunk/drivers/net/wireless/wl12xx/event.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,12 @@ static void wl1271_stop_ba_event(struct wl1271 *wl, struct wl12xx_vif *wlvif)
ieee80211_stop_rx_ba_session(wl->vif, wlvif->sta.ba_rx_bitmap,
wl->vif->bss_conf.bssid);
} else {
int i;
u8 hlid;
struct wl1271_link *lnk;
for (i = WL1271_AP_STA_HLID_START; i < AP_MAX_LINKS; i++) {
lnk = &wl->links[i];
if (!wl1271_is_active_sta(wl, i) || !lnk->ba_bitmap)
for_each_set_bit(hlid, wlvif->ap.sta_hlid_map,
WL12XX_MAX_LINKS) {
lnk = &wl->links[hlid];
if (!lnk->ba_bitmap)
continue;

ieee80211_stop_rx_ba_session(wl->vif,
Expand Down Expand Up @@ -355,10 +356,8 @@ static int wl1271_event_process(struct wl1271 *wl, struct event_mailbox *mbox)
const u8 *addr;
int h;

for (h = find_first_bit(&sta_bitmap, AP_MAX_LINKS);
h < AP_MAX_LINKS;
h = find_next_bit(&sta_bitmap, AP_MAX_LINKS, h+1)) {
if (!wl1271_is_active_sta(wl, h))
for_each_set_bit(h, &sta_bitmap, WL12XX_MAX_LINKS) {
if (!test_bit(h, wlvif->ap.sta_hlid_map))
continue;

addr = wl->links[h].addr;
Expand Down
3 changes: 0 additions & 3 deletions trunk/drivers/net/wireless/wl12xx/event.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,4 @@ void wl1271_event_mbox_config(struct wl1271 *wl);
int wl1271_event_handle(struct wl1271 *wl, u8 mbox);
void wl1271_pspoll_work(struct work_struct *work);

/* Functions from main.c */
bool wl1271_is_active_sta(struct wl1271 *wl, u8 hlid);

#endif
Loading

0 comments on commit a2517f4

Please sign in to comment.