aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/wl12xx/main.c
diff options
context:
space:
mode:
authorArik Nemtsov <arik@wizery.com>2011-04-26 16:35:39 -0400
committerLuciano Coelho <coelho@ti.com>2011-05-02 03:27:21 -0400
commit33437893025aa3c0195b933ac99ef7de924019f4 (patch)
treee811e118dc4b7cb6792c2c3ab8cab905636f5dce /drivers/net/wireless/wl12xx/main.c
parent4cf557fcf01e352fb418e110dd013e4128493c5f (diff)
wl12xx: implement the tx_frames_pending mac80211 callback
Frames are considered pending when they reside in the driver TX queue or already queued in the FW. This notion of "pending" is appropriate for power save considerations in STA mode, but not necessarily in other modes (for instance P2P-GO). [Fixed a sparse warning about missing "static" in a function declaration -- Luca] Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers/net/wireless/wl12xx/main.c')
-rw-r--r--drivers/net/wireless/wl12xx/main.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index 6dd72365b63a..e177764e7140 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -3147,6 +3147,28 @@ out:
3147 return ret; 3147 return ret;
3148} 3148}
3149 3149
3150static bool wl1271_tx_frames_pending(struct ieee80211_hw *hw)
3151{
3152 struct wl1271 *wl = hw->priv;
3153 bool ret = false;
3154
3155 mutex_lock(&wl->mutex);
3156
3157 if (unlikely(wl->state == WL1271_STATE_OFF))
3158 goto out;
3159
3160 /* packets are considered pending if in the TX queue or the FW */
3161 ret = (wl->tx_queue_count > 0) || (wl->tx_frames_cnt > 0);
3162
3163 /* the above is appropriate for STA mode for PS purposes */
3164 WARN_ON(wl->bss_type != BSS_TYPE_STA_BSS);
3165
3166out:
3167 mutex_unlock(&wl->mutex);
3168
3169 return ret;
3170}
3171
3150/* can't be const, mac80211 writes to this */ 3172/* can't be const, mac80211 writes to this */
3151static struct ieee80211_rate wl1271_rates[] = { 3173static struct ieee80211_rate wl1271_rates[] = {
3152 { .bitrate = 10, 3174 { .bitrate = 10,
@@ -3398,6 +3420,7 @@ static const struct ieee80211_ops wl1271_ops = {
3398 .sta_add = wl1271_op_sta_add, 3420 .sta_add = wl1271_op_sta_add,
3399 .sta_remove = wl1271_op_sta_remove, 3421 .sta_remove = wl1271_op_sta_remove,
3400 .ampdu_action = wl1271_op_ampdu_action, 3422 .ampdu_action = wl1271_op_ampdu_action,
3423 .tx_frames_pending = wl1271_tx_frames_pending,
3401 CFG80211_TESTMODE_CMD(wl1271_tm_cmd) 3424 CFG80211_TESTMODE_CMD(wl1271_tm_cmd)
3402}; 3425};
3403 3426