carl9170: Implement tx_frames_pending mac80211 callback function
authorChristian Lamparter <chunkeey@googlemail.com>
Thu, 7 Jul 2011 21:01:25 +0000 (23:01 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 8 Jul 2011 15:42:26 +0000 (11:42 -0400)
Implementing this callback function will cause mac80211 refrain from
going to powersave state when there are still untransmitted TX frames
in the queues.

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/carl9170/main.c

index d2b9f1256bc86900e70a3c598a5c4ac765e02fbc..a61cf6781d5e0d3a0f936c04363d70f5d01737f5 100644 (file)
@@ -1484,6 +1484,13 @@ static void carl9170_op_sta_notify(struct ieee80211_hw *hw,
        }
 }
 
+static bool carl9170_tx_frames_pending(struct ieee80211_hw *hw)
+{
+       struct ar9170 *ar = hw->priv;
+
+       return !!atomic_read(&ar->tx_total_queued);
+}
+
 static const struct ieee80211_ops carl9170_ops = {
        .start                  = carl9170_op_start,
        .stop                   = carl9170_op_stop,
@@ -1504,6 +1511,7 @@ static const struct ieee80211_ops carl9170_ops = {
        .get_survey             = carl9170_op_get_survey,
        .get_stats              = carl9170_op_get_stats,
        .ampdu_action           = carl9170_op_ampdu_action,
+       .tx_frames_pending      = carl9170_tx_frames_pending,
 };
 
 void *carl9170_alloc(size_t priv_size)