diff options
author | Arik Nemtsov <arik@wizery.com> | 2012-02-27 17:41:29 -0500 |
---|---|---|
committer | Luciano Coelho <coelho@ti.com> | 2012-02-28 06:19:19 -0500 |
commit | 0b0e32b792b4077c113ae70d6de12b5f301e0882 (patch) | |
tree | a7254db28e6209f6a0dd703ae6a9060d4a27db81 | |
parent | 5af70c864a1539bd1d3f3fcb04ab9558491c9103 (diff) |
wl12xx: change bits in the link_map under spin lock
These bits are used in op_tx to determine if a packet should be dropped.
As such we should use the spin lock to sync the state.
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
-rw-r--r-- | drivers/net/wireless/wl12xx/cmd.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/net/wireless/wl12xx/cmd.c b/drivers/net/wireless/wl12xx/cmd.c index b776d9d5efe8..ef994dacf8d2 100644 --- a/drivers/net/wireless/wl12xx/cmd.c +++ b/drivers/net/wireless/wl12xx/cmd.c | |||
@@ -459,23 +459,32 @@ out: | |||
459 | 459 | ||
460 | int wl12xx_allocate_link(struct wl1271 *wl, struct wl12xx_vif *wlvif, u8 *hlid) | 460 | int wl12xx_allocate_link(struct wl1271 *wl, struct wl12xx_vif *wlvif, u8 *hlid) |
461 | { | 461 | { |
462 | unsigned long flags; | ||
462 | u8 link = find_first_zero_bit(wl->links_map, WL12XX_MAX_LINKS); | 463 | u8 link = find_first_zero_bit(wl->links_map, WL12XX_MAX_LINKS); |
463 | if (link >= WL12XX_MAX_LINKS) | 464 | if (link >= WL12XX_MAX_LINKS) |
464 | return -EBUSY; | 465 | return -EBUSY; |
465 | 466 | ||
467 | /* these bits are used by op_tx */ | ||
468 | spin_lock_irqsave(&wl->wl_lock, flags); | ||
466 | __set_bit(link, wl->links_map); | 469 | __set_bit(link, wl->links_map); |
467 | __set_bit(link, wlvif->links_map); | 470 | __set_bit(link, wlvif->links_map); |
471 | spin_unlock_irqrestore(&wl->wl_lock, flags); | ||
468 | *hlid = link; | 472 | *hlid = link; |
469 | return 0; | 473 | return 0; |
470 | } | 474 | } |
471 | 475 | ||
472 | void wl12xx_free_link(struct wl1271 *wl, struct wl12xx_vif *wlvif, u8 *hlid) | 476 | void wl12xx_free_link(struct wl1271 *wl, struct wl12xx_vif *wlvif, u8 *hlid) |
473 | { | 477 | { |
478 | unsigned long flags; | ||
479 | |||
474 | if (*hlid == WL12XX_INVALID_LINK_ID) | 480 | if (*hlid == WL12XX_INVALID_LINK_ID) |
475 | return; | 481 | return; |
476 | 482 | ||
483 | /* these bits are used by op_tx */ | ||
484 | spin_lock_irqsave(&wl->wl_lock, flags); | ||
477 | __clear_bit(*hlid, wl->links_map); | 485 | __clear_bit(*hlid, wl->links_map); |
478 | __clear_bit(*hlid, wlvif->links_map); | 486 | __clear_bit(*hlid, wlvif->links_map); |
487 | spin_unlock_irqrestore(&wl->wl_lock, flags); | ||
479 | *hlid = WL12XX_INVALID_LINK_ID; | 488 | *hlid = WL12XX_INVALID_LINK_ID; |
480 | } | 489 | } |
481 | 490 | ||