aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2008-02-19 05:31:14 -0500
committerJohn W. Linville <linville@tuxdriver.com>2008-02-29 15:37:13 -0500
commit4a9a66e9a87a8346129d557c7ec2303173318012 (patch)
treee89092e2188f9d9b479aa8f13a38fdcb2ea3e163 /net
parentd007b7f42e2a3a2b95ef43e8cc1a3dfe66b19736 (diff)
mac80211: convert sta_info.pspoll to a flag
This doesn't really need to be a full int variable since it's just a flag to indicate a PS-poll is in progress. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net')
-rw-r--r--net/mac80211/rx.c13
-rw-r--r--net/mac80211/sta_info.h3
-rw-r--r--net/mac80211/tx.c5
3 files changed, 12 insertions, 9 deletions
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 279ee493520d..c4b7cc07315d 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -579,7 +579,7 @@ static void ap_sta_ps_start(struct net_device *dev, struct sta_info *sta)
579 if (sdata->bss) 579 if (sdata->bss)
580 atomic_inc(&sdata->bss->num_sta_ps); 580 atomic_inc(&sdata->bss->num_sta_ps);
581 sta->flags |= WLAN_STA_PS; 581 sta->flags |= WLAN_STA_PS;
582 sta->pspoll = 0; 582 sta->flags &= ~WLAN_STA_PSPOLL;
583#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG 583#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG
584 printk(KERN_DEBUG "%s: STA %s aid %d enters power save mode\n", 584 printk(KERN_DEBUG "%s: STA %s aid %d enters power save mode\n",
585 dev->name, print_mac(mac, sta->addr), sta->aid); 585 dev->name, print_mac(mac, sta->addr), sta->aid);
@@ -598,8 +598,7 @@ static int ap_sta_ps_end(struct net_device *dev, struct sta_info *sta)
598 sdata = IEEE80211_DEV_TO_SUB_IF(sta->dev); 598 sdata = IEEE80211_DEV_TO_SUB_IF(sta->dev);
599 if (sdata->bss) 599 if (sdata->bss)
600 atomic_dec(&sdata->bss->num_sta_ps); 600 atomic_dec(&sdata->bss->num_sta_ps);
601 sta->flags &= ~(WLAN_STA_PS | WLAN_STA_TIM); 601 sta->flags &= ~(WLAN_STA_PS | WLAN_STA_TIM | WLAN_STA_PSPOLL);
602 sta->pspoll = 0;
603 if (!skb_queue_empty(&sta->ps_tx_buf)) { 602 if (!skb_queue_empty(&sta->ps_tx_buf)) {
604 if (local->ops->set_tim) 603 if (local->ops->set_tim)
605 local->ops->set_tim(local_to_hw(local), sta->aid, 0); 604 local->ops->set_tim(local_to_hw(local), sta->aid, 0);
@@ -925,9 +924,11 @@ ieee80211_rx_h_ps_poll(struct ieee80211_txrx_data *rx)
925 struct ieee80211_hdr *hdr = 924 struct ieee80211_hdr *hdr =
926 (struct ieee80211_hdr *) skb->data; 925 (struct ieee80211_hdr *) skb->data;
927 926
928 /* tell TX path to send one frame even though the STA may 927 /*
929 * still remain is PS mode after this frame exchange */ 928 * Tell TX path to send one frame even though the STA may
930 rx->sta->pspoll = 1; 929 * still remain is PS mode after this frame exchange.
930 */
931 rx->sta->flags |= WLAN_STA_PSPOLL;
931 932
932#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG 933#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG
933 printk(KERN_DEBUG "STA %s aid %d: PS Poll (entries after %d)\n", 934 printk(KERN_DEBUG "STA %s aid %d: PS Poll (entries after %d)\n",
diff --git a/net/mac80211/sta_info.h b/net/mac80211/sta_info.h
index 19f3fb412940..ca51d29b7008 100644
--- a/net/mac80211/sta_info.h
+++ b/net/mac80211/sta_info.h
@@ -32,6 +32,7 @@
32 * @WLAN_STA_ASSOC_AP: We're associated to that station, it is an AP. 32 * @WLAN_STA_ASSOC_AP: We're associated to that station, it is an AP.
33 * @WLAN_STA_WME: Station is a QoS-STA. 33 * @WLAN_STA_WME: Station is a QoS-STA.
34 * @WLAN_STA_WDS: Station is one of our WDS peers. 34 * @WLAN_STA_WDS: Station is one of our WDS peers.
35 * @WLAN_STA_PSPOLL: Station has just PS-polled us.
35 */ 36 */
36enum ieee80211_sta_info_flags { 37enum ieee80211_sta_info_flags {
37 WLAN_STA_AUTH = 1<<0, 38 WLAN_STA_AUTH = 1<<0,
@@ -43,6 +44,7 @@ enum ieee80211_sta_info_flags {
43 WLAN_STA_ASSOC_AP = 1<<6, 44 WLAN_STA_ASSOC_AP = 1<<6,
44 WLAN_STA_WME = 1<<7, 45 WLAN_STA_WME = 1<<7,
45 WLAN_STA_WDS = 1<<8, 46 WLAN_STA_WDS = 1<<8,
47 WLAN_STA_PSPOLL = 1<<9,
46}; 48};
47 49
48#define STA_TID_NUM 16 50#define STA_TID_NUM 16
@@ -133,7 +135,6 @@ struct sta_info {
133 135
134 struct sk_buff_head ps_tx_buf; /* buffer of TX frames for station in 136 struct sk_buff_head ps_tx_buf; /* buffer of TX frames for station in
135 * power saving state */ 137 * power saving state */
136 int pspoll; /* whether STA has send a PS Poll frame */
137 struct sk_buff_head tx_filtered; /* buffer of TX frames that were 138 struct sk_buff_head tx_filtered; /* buffer of TX frames that were
138 * already given to low-level driver, 139 * already given to low-level driver,
139 * but were filtered */ 140 * but were filtered */
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 181d97015f61..4f951e78df15 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -395,7 +395,8 @@ ieee80211_tx_h_unicast_ps_buf(struct ieee80211_txrx_data *tx)
395 (tx->fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_PROBE_RESP))) 395 (tx->fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_PROBE_RESP)))
396 return TX_CONTINUE; 396 return TX_CONTINUE;
397 397
398 if (unlikely((sta->flags & WLAN_STA_PS) && !sta->pspoll)) { 398 if (unlikely((sta->flags & WLAN_STA_PS) &&
399 !(sta->flags & WLAN_STA_PSPOLL))) {
399 struct ieee80211_tx_packet_data *pkt_data; 400 struct ieee80211_tx_packet_data *pkt_data;
400#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG 401#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG
401 printk(KERN_DEBUG "STA %s aid %d: PS buffer (entries " 402 printk(KERN_DEBUG "STA %s aid %d: PS buffer (entries "
@@ -436,7 +437,7 @@ ieee80211_tx_h_unicast_ps_buf(struct ieee80211_txrx_data *tx)
436 print_mac(mac, sta->addr)); 437 print_mac(mac, sta->addr));
437 } 438 }
438#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */ 439#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */
439 sta->pspoll = 0; 440 sta->flags &= ~WLAN_STA_PSPOLL;
440 441
441 return TX_CONTINUE; 442 return TX_CONTINUE;
442} 443}