diff options
author | Eliad Peller <eliad@wizery.com> | 2011-10-05 05:56:00 -0400 |
---|---|---|
committer | Luciano Coelho <coelho@ti.com> | 2011-10-07 01:32:50 -0400 |
commit | 252efa4f978a2901039fffc934060fb8ccf82ac7 (patch) | |
tree | 919f33de17e038696e38a8e772438c05f2143493 /drivers | |
parent | f75c753f3c77b758fa5ace90c15b2ea3b7a3d46d (diff) |
wl12xx: move pspoll_work into wlvif
move pspoll_work into the per-interface data, rather than
being global.
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/wl12xx/event.c | 8 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/main.c | 8 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/wl12xx.h | 4 |
3 files changed, 12 insertions, 8 deletions
diff --git a/drivers/net/wireless/wl12xx/event.c b/drivers/net/wireless/wl12xx/event.c index 28a4396fb8e4..4e3474c11e05 100644 --- a/drivers/net/wireless/wl12xx/event.c +++ b/drivers/net/wireless/wl12xx/event.c | |||
@@ -38,9 +38,9 @@ void wl1271_pspoll_work(struct work_struct *work) | |||
38 | int ret; | 38 | int ret; |
39 | 39 | ||
40 | dwork = container_of(work, struct delayed_work, work); | 40 | dwork = container_of(work, struct delayed_work, work); |
41 | wl = container_of(dwork, struct wl1271, pspoll_work); | 41 | wlvif = container_of(dwork, struct wl12xx_vif, pspoll_work); |
42 | vif = wl->vif; /* TODO: move work into vif struct */ | 42 | vif = container_of((void *)wlvif, struct ieee80211_vif, drv_priv); |
43 | wlvif = wl12xx_vif_to_data(vif); | 43 | wl = wlvif->wl; |
44 | 44 | ||
45 | wl1271_debug(DEBUG_EVENT, "pspoll work"); | 45 | wl1271_debug(DEBUG_EVENT, "pspoll work"); |
46 | 46 | ||
@@ -90,7 +90,7 @@ static void wl1271_event_pspoll_delivery_fail(struct wl1271 *wl, | |||
90 | if (ret < 0) | 90 | if (ret < 0) |
91 | return; | 91 | return; |
92 | set_bit(WL1271_FLAG_PSPOLL_FAILURE, &wl->flags); | 92 | set_bit(WL1271_FLAG_PSPOLL_FAILURE, &wl->flags); |
93 | ieee80211_queue_delayed_work(wl->hw, &wl->pspoll_work, | 93 | ieee80211_queue_delayed_work(wl->hw, &wlvif->pspoll_work, |
94 | msecs_to_jiffies(delay)); | 94 | msecs_to_jiffies(delay)); |
95 | } | 95 | } |
96 | 96 | ||
diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c index 09983dee4105..76f466380667 100644 --- a/drivers/net/wireless/wl12xx/main.c +++ b/drivers/net/wireless/wl12xx/main.c | |||
@@ -1766,7 +1766,7 @@ static int wl1271_op_suspend(struct ieee80211_hw *hw, | |||
1766 | 1766 | ||
1767 | wl1271_enable_interrupts(wl); | 1767 | wl1271_enable_interrupts(wl); |
1768 | flush_work(&wl->tx_work); | 1768 | flush_work(&wl->tx_work); |
1769 | flush_delayed_work(&wl->pspoll_work); | 1769 | flush_delayed_work(&wlvif->pspoll_work); |
1770 | flush_delayed_work(&wl->elp_work); | 1770 | flush_delayed_work(&wl->elp_work); |
1771 | 1771 | ||
1772 | return 0; | 1772 | return 0; |
@@ -1902,6 +1902,8 @@ static int wl12xx_init_vif_data(struct ieee80211_vif *vif) | |||
1902 | wlvif->rate_set = CONF_TX_RATE_MASK_BASIC; | 1902 | wlvif->rate_set = CONF_TX_RATE_MASK_BASIC; |
1903 | wlvif->beacon_int = WL1271_DEFAULT_BEACON_INT; | 1903 | wlvif->beacon_int = WL1271_DEFAULT_BEACON_INT; |
1904 | 1904 | ||
1905 | INIT_DELAYED_WORK(&wlvif->pspoll_work, wl1271_pspoll_work); | ||
1906 | |||
1905 | return 0; | 1907 | return 0; |
1906 | } | 1908 | } |
1907 | 1909 | ||
@@ -1941,6 +1943,7 @@ static int wl1271_op_add_interface(struct ieee80211_hw *hw, | |||
1941 | if (ret < 0) | 1943 | if (ret < 0) |
1942 | goto out; | 1944 | goto out; |
1943 | 1945 | ||
1946 | wlvif->wl = wl; | ||
1944 | role_type = wl12xx_get_role_type(wl, wlvif); | 1947 | role_type = wl12xx_get_role_type(wl, wlvif); |
1945 | if (role_type == WL12XX_INVALID_ROLE_TYPE) { | 1948 | if (role_type == WL12XX_INVALID_ROLE_TYPE) { |
1946 | ret = -EINVAL; | 1949 | ret = -EINVAL; |
@@ -2126,7 +2129,7 @@ deinit: | |||
2126 | del_timer_sync(&wl->rx_streaming_timer); | 2129 | del_timer_sync(&wl->rx_streaming_timer); |
2127 | cancel_work_sync(&wl->rx_streaming_enable_work); | 2130 | cancel_work_sync(&wl->rx_streaming_enable_work); |
2128 | cancel_work_sync(&wl->rx_streaming_disable_work); | 2131 | cancel_work_sync(&wl->rx_streaming_disable_work); |
2129 | cancel_delayed_work_sync(&wl->pspoll_work); | 2132 | cancel_delayed_work_sync(&wlvif->pspoll_work); |
2130 | cancel_delayed_work_sync(&wl->elp_work); | 2133 | cancel_delayed_work_sync(&wl->elp_work); |
2131 | 2134 | ||
2132 | mutex_lock(&wl->mutex); | 2135 | mutex_lock(&wl->mutex); |
@@ -4874,7 +4877,6 @@ struct ieee80211_hw *wl1271_alloc_hw(void) | |||
4874 | skb_queue_head_init(&wl->deferred_tx_queue); | 4877 | skb_queue_head_init(&wl->deferred_tx_queue); |
4875 | 4878 | ||
4876 | INIT_DELAYED_WORK(&wl->elp_work, wl1271_elp_work); | 4879 | INIT_DELAYED_WORK(&wl->elp_work, wl1271_elp_work); |
4877 | INIT_DELAYED_WORK(&wl->pspoll_work, wl1271_pspoll_work); | ||
4878 | INIT_WORK(&wl->netstack_work, wl1271_netstack_work); | 4880 | INIT_WORK(&wl->netstack_work, wl1271_netstack_work); |
4879 | INIT_WORK(&wl->tx_work, wl1271_tx_work); | 4881 | INIT_WORK(&wl->tx_work, wl1271_tx_work); |
4880 | INIT_WORK(&wl->recovery_work, wl1271_recovery_work); | 4882 | INIT_WORK(&wl->recovery_work, wl1271_recovery_work); |
diff --git a/drivers/net/wireless/wl12xx/wl12xx.h b/drivers/net/wireless/wl12xx/wl12xx.h index 91e6cd36bf8b..d6d5a7bff315 100644 --- a/drivers/net/wireless/wl12xx/wl12xx.h +++ b/drivers/net/wireless/wl12xx/wl12xx.h | |||
@@ -511,7 +511,6 @@ struct wl1271 { | |||
511 | struct completion *elp_compl; | 511 | struct completion *elp_compl; |
512 | struct completion *ps_compl; | 512 | struct completion *ps_compl; |
513 | struct delayed_work elp_work; | 513 | struct delayed_work elp_work; |
514 | struct delayed_work pspoll_work; | ||
515 | 514 | ||
516 | /* counter for ps-poll delivery failures */ | 515 | /* counter for ps-poll delivery failures */ |
517 | int ps_poll_failures; | 516 | int ps_poll_failures; |
@@ -604,6 +603,7 @@ struct wl1271_station { | |||
604 | }; | 603 | }; |
605 | 604 | ||
606 | struct wl12xx_vif { | 605 | struct wl12xx_vif { |
606 | struct wl1271 *wl; | ||
607 | u8 bss_type; | 607 | u8 bss_type; |
608 | u8 p2p; /* we are using p2p role */ | 608 | u8 p2p; /* we are using p2p role */ |
609 | u8 role_id; | 609 | u8 role_id; |
@@ -650,6 +650,8 @@ struct wl12xx_vif { | |||
650 | 650 | ||
651 | /* Session counter for the chipset */ | 651 | /* Session counter for the chipset */ |
652 | int session_counter; | 652 | int session_counter; |
653 | |||
654 | struct delayed_work pspoll_work; | ||
653 | }; | 655 | }; |
654 | 656 | ||
655 | static inline struct wl12xx_vif *wl12xx_vif_to_data(struct ieee80211_vif *vif) | 657 | static inline struct wl12xx_vif *wl12xx_vif_to_data(struct ieee80211_vif *vif) |