From patchwork Thu Feb 4 06:54:02 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vivek Natarajan X-Patchwork-Id: 76907 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o146sNxI007710 for ; Thu, 4 Feb 2010 06:54:23 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753868Ab0BDGyV (ORCPT ); Thu, 4 Feb 2010 01:54:21 -0500 Received: from mail.atheros.com ([12.36.123.2]:58245 "EHLO mail.atheros.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753632Ab0BDGyU (ORCPT ); Thu, 4 Feb 2010 01:54:20 -0500 Received: from mail.atheros.com ([10.10.20.105]) by sidewinder.atheros.com for ; Wed, 03 Feb 2010 22:54:20 -0800 Received: from smtp.atheros.com (10.12.4.60) by SC1EXHC-01.global.atheros.com (10.10.20.106) with Microsoft SMTP Server (TLS) id 8.0.751.0; Wed, 3 Feb 2010 22:54:18 -0800 Received: by smtp.atheros.com (sSMTP sendmail emulation); Thu, 04 Feb 2010 12:24:15 +0530 From: Vivek Natarajan To: CC: Vivek Natarajan Subject: [RFC PATCH 2/2] mac80211: Reset dynamic ps timer in Rx path. Date: Thu, 4 Feb 2010 12:24:02 +0530 Message-ID: <1265266442-6273-2-git-send-email-vnatarajan@atheros.com> X-Mailer: git-send-email 1.6.3.3 In-Reply-To: <1265266442-6273-1-git-send-email-vnatarajan@atheros.com> References: <1265266442-6273-1-git-send-email-vnatarajan@atheros.com> MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Thu, 04 Feb 2010 06:54:23 +0000 (UTC) diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 74ccf30..6ecc065 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h @@ -958,6 +958,10 @@ enum ieee80211_tkip_key_type { * Hardware supports Unscheduled Automatic Power Save Delivery * (U-APSD) in managed mode. The mode is configured with * conf_tx() operation. + * + * @IEEE80211_HW_NEEDS_RX_PS_RESET: + * Hardware requires the stack to reset the dynamic PS timer + * on receiving a data frame. */ enum ieee80211_hw_flags { IEEE80211_HW_HAS_RATE_CONTROL = 1<<0, @@ -978,6 +982,7 @@ enum ieee80211_hw_flags { IEEE80211_HW_SUPPORTS_STATIC_SMPS = 1<<15, IEEE80211_HW_SUPPORTS_DYNAMIC_SMPS = 1<<16, IEEE80211_HW_SUPPORTS_UAPSD = 1<<17, + IEEE80211_HW_NEEDS_RX_PS_RESET = 1<<18, }; /** diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index 5709307..0bb6169 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c @@ -1719,6 +1719,7 @@ static ieee80211_rx_result debug_noinline ieee80211_rx_h_data(struct ieee80211_rx_data *rx) { struct ieee80211_sub_if_data *sdata = rx->sdata; + struct ieee80211_local *local = rx->local; struct net_device *dev = sdata->dev; struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)rx->skb->data; __le16 fc = hdr->frame_control; @@ -1750,6 +1751,15 @@ ieee80211_rx_h_data(struct ieee80211_rx_data *rx) dev->stats.rx_packets++; dev->stats.rx_bytes += rx->skb->len; + if ((local->hw.flags & IEEE80211_HW_NEEDS_RX_PS_RESET) && + ieee80211_is_data(hdr->frame_control) && + !is_multicast_ether_addr(hdr->addr1)) { + if (local->hw.conf.dynamic_ps_timeout > 0 && local->ps_sdata) { + mod_timer(&local->dynamic_ps_timer, jiffies + + msecs_to_jiffies(local->hw.conf.dynamic_ps_timeout)); + } + } + ieee80211_deliver_skb(rx); return RX_QUEUED;