From: Eliad Peller <eliad@wizery.com>
To: Luciano Coelho <coelho@ti.com>
Cc: <linux-wireless@vger.kernel.org>
Subject: [PATCH 23/29] wl12xx: move pspoll_work into wlvif
Date: Wed, 5 Oct 2011 11:56:00 +0200 [thread overview]
Message-ID: <1317808566-18857-24-git-send-email-eliad@wizery.com> (raw)
In-Reply-To: <1317808566-18857-1-git-send-email-eliad@wizery.com>
move pspoll_work into the per-interface data, rather than
being global.
Signed-off-by: Eliad Peller <eliad@wizery.com>
---
drivers/net/wireless/wl12xx/event.c | 8 ++++----
drivers/net/wireless/wl12xx/main.c | 8 +++++---
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 f59e354..1ea508b 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)
int ret;
dwork = container_of(work, struct delayed_work, work);
- wl = container_of(dwork, struct wl1271, pspoll_work);
- vif = wl->vif; /* TODO: move work into vif struct */
- wlvif = wl12xx_vif_to_data(vif);
+ wlvif = container_of(dwork, struct wl12xx_vif, pspoll_work);
+ vif = container_of((void *)wlvif, struct ieee80211_vif, drv_priv);
+ wl = wlvif->wl;
wl1271_debug(DEBUG_EVENT, "pspoll work");
@@ -90,7 +90,7 @@ static void wl1271_event_pspoll_delivery_fail(struct wl1271 *wl,
if (ret < 0)
return;
set_bit(WL1271_FLAG_PSPOLL_FAILURE, &wl->flags);
- ieee80211_queue_delayed_work(wl->hw, &wl->pspoll_work,
+ ieee80211_queue_delayed_work(wl->hw, &wlvif->pspoll_work,
msecs_to_jiffies(delay));
}
diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index 9302c88..4fe7662 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,
wl1271_enable_interrupts(wl);
flush_work(&wl->tx_work);
- flush_delayed_work(&wl->pspoll_work);
+ flush_delayed_work(&wlvif->pspoll_work);
flush_delayed_work(&wl->elp_work);
return 0;
@@ -1902,6 +1902,8 @@ static int wl12xx_init_vif_data(struct ieee80211_vif *vif)
wlvif->rate_set = CONF_TX_RATE_MASK_BASIC;
wlvif->beacon_int = WL1271_DEFAULT_BEACON_INT;
+ INIT_DELAYED_WORK(&wlvif->pspoll_work, wl1271_pspoll_work);
+
return 0;
}
@@ -1941,6 +1943,7 @@ static int wl1271_op_add_interface(struct ieee80211_hw *hw,
if (ret < 0)
goto out;
+ wlvif->wl = wl;
role_type = wl12xx_get_role_type(wl, wlvif);
if (role_type == WL12XX_INVALID_ROLE_TYPE) {
ret = -EINVAL;
@@ -2126,7 +2129,7 @@ deinit:
del_timer_sync(&wl->rx_streaming_timer);
cancel_work_sync(&wl->rx_streaming_enable_work);
cancel_work_sync(&wl->rx_streaming_disable_work);
- cancel_delayed_work_sync(&wl->pspoll_work);
+ cancel_delayed_work_sync(&wlvif->pspoll_work);
cancel_delayed_work_sync(&wl->elp_work);
mutex_lock(&wl->mutex);
@@ -4833,7 +4836,6 @@ struct ieee80211_hw *wl1271_alloc_hw(void)
skb_queue_head_init(&wl->deferred_tx_queue);
INIT_DELAYED_WORK(&wl->elp_work, wl1271_elp_work);
- INIT_DELAYED_WORK(&wl->pspoll_work, wl1271_pspoll_work);
INIT_WORK(&wl->netstack_work, wl1271_netstack_work);
INIT_WORK(&wl->tx_work, wl1271_tx_work);
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 4755aad..d016509 100644
--- a/drivers/net/wireless/wl12xx/wl12xx.h
+++ b/drivers/net/wireless/wl12xx/wl12xx.h
@@ -510,7 +510,6 @@ struct wl1271 {
struct completion *elp_compl;
struct completion *ps_compl;
struct delayed_work elp_work;
- struct delayed_work pspoll_work;
/* counter for ps-poll delivery failures */
int ps_poll_failures;
@@ -603,6 +602,7 @@ struct wl1271_station {
};
struct wl12xx_vif {
+ struct wl1271 *wl;
u8 bss_type;
u8 p2p; /* we are using p2p role */
u8 role_id;
@@ -649,6 +649,8 @@ struct wl12xx_vif {
/* Session counter for the chipset */
int session_counter;
+
+ struct delayed_work pspoll_work;
};
static inline struct wl12xx_vif *wl12xx_vif_to_data(struct ieee80211_vif *vif)
--
1.7.6.401.g6a319
next prev parent reply other threads:[~2011-10-05 9:56 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-05 9:55 [PATCH 00/29] wl12xx: start preparing the driver for multi-vif support Eliad Peller
2011-10-05 9:55 ` [PATCH 01/29] wl12xx: disable AP-mode-specific quirks Eliad Peller
2011-10-05 9:55 ` [PATCH 02/29] wl12xx: replace wl->mac_addr with vif->addr Eliad Peller
2011-10-05 9:55 ` [PATCH 03/29] wl12xx: start reworking the init sequence Eliad Peller
2011-10-05 9:55 ` [PATCH 04/29] wl12xx: define wl12xx_vif Eliad Peller
2011-10-05 9:55 ` [PATCH 05/29] wl12xx: move rate_set into wlvif Eliad Peller
2011-10-05 9:55 ` [PATCH 06/29] wl12xx: move basic_rate " Eliad Peller
2011-10-05 9:55 ` [PATCH 07/29] wl12xx: replace wl->bssid with vif->bss_conf.bssid Eliad Peller
2011-10-05 9:55 ` [PATCH 08/29] wl12xx: move bss_type into wlvif Eliad Peller
2011-10-05 9:55 ` [PATCH 09/29] wl12xx: remove set_bss_type field Eliad Peller
2011-10-05 9:55 ` [PATCH 10/29] wl12xx: move p2p into wlvif Eliad Peller
2011-10-05 9:55 ` [PATCH 11/29] wl12xx: move ssid and ssid_len " Eliad Peller
2011-10-05 9:55 ` [PATCH 12/29] wl12xx: move probereq " Eliad Peller
2011-10-05 9:55 ` [PATCH 13/29] wl12xx: move aid " Eliad Peller
2011-10-05 9:55 ` [PATCH 14/29] wl12xx: move role_id " Eliad Peller
2011-10-05 9:55 ` [PATCH 15/29] wl12xx: move dev_role_id " Eliad Peller
2011-10-05 9:55 ` [PATCH 16/29] wl12xx: move sta_hlid " Eliad Peller
2011-10-05 9:55 ` [PATCH 17/29] wl12xx: move ap_global_hlid and ap_bcast_hlid " Eliad Peller
2011-10-05 9:55 ` [PATCH 18/29] wl12xx: move session_counter " Eliad Peller
2011-10-05 9:55 ` [PATCH 19/29] wl12xx: move some logic into wl12xx_init_vif_data Eliad Peller
2011-10-05 9:55 ` [PATCH 20/29] wl12xx: move dev_hlid into wlvif Eliad Peller
2011-10-05 9:55 ` [PATCH 21/29] wl12xx: move beacon_int " Eliad Peller
2011-10-05 9:55 ` [PATCH 22/29] wl12xx: move default_key " Eliad Peller
2011-10-05 9:56 ` Eliad Peller [this message]
2011-10-05 9:56 ` [PATCH 24/29] wl12xx: move ps_compl " Eliad Peller
2011-10-05 9:56 ` [PATCH 25/29] wl12xx: move ps_poll_failures and psm_entry_retry " Eliad Peller
2011-10-05 9:56 ` [PATCH 26/29] wl12xx: move rssi_thold and last_rssi_event " Eliad Peller
2011-10-05 9:56 ` [PATCH 27/29] wl12xx: move ba fields " Eliad Peller
2011-10-05 9:56 ` [PATCH 28/29] wl12xx: move ap_hlid_map into wlvif.ap Eliad Peller
2011-10-05 9:56 ` [PATCH 29/29] wl12xx: move recorded_ap_keys into wlvif Eliad Peller
2011-10-06 13:18 ` [PATCH 00/29] wl12xx: start preparing the driver for multi-vif support Luciano Coelho
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1317808566-18857-24-git-send-email-eliad@wizery.com \
--to=eliad@wizery.com \
--cc=coelho@ti.com \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox