Commit 4a9a66e9 authored by Johannes Berg's avatar Johannes Berg Committed by John W. Linville

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: default avatarJohannes Berg <johannes@sipsolutions.net>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent d007b7f4
...@@ -579,7 +579,7 @@ static void ap_sta_ps_start(struct net_device *dev, struct sta_info *sta) ...@@ -579,7 +579,7 @@ static void ap_sta_ps_start(struct net_device *dev, struct sta_info *sta)
if (sdata->bss) if (sdata->bss)
atomic_inc(&sdata->bss->num_sta_ps); atomic_inc(&sdata->bss->num_sta_ps);
sta->flags |= WLAN_STA_PS; sta->flags |= WLAN_STA_PS;
sta->pspoll = 0; sta->flags &= ~WLAN_STA_PSPOLL;
#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG #ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG
printk(KERN_DEBUG "%s: STA %s aid %d enters power save mode\n", printk(KERN_DEBUG "%s: STA %s aid %d enters power save mode\n",
dev->name, print_mac(mac, sta->addr), sta->aid); 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,8 +598,7 @@ static int ap_sta_ps_end(struct net_device *dev, struct sta_info *sta)
sdata = IEEE80211_DEV_TO_SUB_IF(sta->dev); sdata = IEEE80211_DEV_TO_SUB_IF(sta->dev);
if (sdata->bss) if (sdata->bss)
atomic_dec(&sdata->bss->num_sta_ps); atomic_dec(&sdata->bss->num_sta_ps);
sta->flags &= ~(WLAN_STA_PS | WLAN_STA_TIM); sta->flags &= ~(WLAN_STA_PS | WLAN_STA_TIM | WLAN_STA_PSPOLL);
sta->pspoll = 0;
if (!skb_queue_empty(&sta->ps_tx_buf)) { if (!skb_queue_empty(&sta->ps_tx_buf)) {
if (local->ops->set_tim) if (local->ops->set_tim)
local->ops->set_tim(local_to_hw(local), sta->aid, 0); 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,9 +924,11 @@ ieee80211_rx_h_ps_poll(struct ieee80211_txrx_data *rx)
struct ieee80211_hdr *hdr = struct ieee80211_hdr *hdr =
(struct ieee80211_hdr *) skb->data; (struct ieee80211_hdr *) skb->data;
/* tell TX path to send one frame even though the STA may /*
* still remain is PS mode after this frame exchange */ * Tell TX path to send one frame even though the STA may
rx->sta->pspoll = 1; * still remain is PS mode after this frame exchange.
*/
rx->sta->flags |= WLAN_STA_PSPOLL;
#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG #ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG
printk(KERN_DEBUG "STA %s aid %d: PS Poll (entries after %d)\n", printk(KERN_DEBUG "STA %s aid %d: PS Poll (entries after %d)\n",
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
* @WLAN_STA_ASSOC_AP: We're associated to that station, it is an AP. * @WLAN_STA_ASSOC_AP: We're associated to that station, it is an AP.
* @WLAN_STA_WME: Station is a QoS-STA. * @WLAN_STA_WME: Station is a QoS-STA.
* @WLAN_STA_WDS: Station is one of our WDS peers. * @WLAN_STA_WDS: Station is one of our WDS peers.
* @WLAN_STA_PSPOLL: Station has just PS-polled us.
*/ */
enum ieee80211_sta_info_flags { enum ieee80211_sta_info_flags {
WLAN_STA_AUTH = 1<<0, WLAN_STA_AUTH = 1<<0,
...@@ -43,6 +44,7 @@ enum ieee80211_sta_info_flags { ...@@ -43,6 +44,7 @@ enum ieee80211_sta_info_flags {
WLAN_STA_ASSOC_AP = 1<<6, WLAN_STA_ASSOC_AP = 1<<6,
WLAN_STA_WME = 1<<7, WLAN_STA_WME = 1<<7,
WLAN_STA_WDS = 1<<8, WLAN_STA_WDS = 1<<8,
WLAN_STA_PSPOLL = 1<<9,
}; };
#define STA_TID_NUM 16 #define STA_TID_NUM 16
...@@ -133,7 +135,6 @@ struct sta_info { ...@@ -133,7 +135,6 @@ struct sta_info {
struct sk_buff_head ps_tx_buf; /* buffer of TX frames for station in struct sk_buff_head ps_tx_buf; /* buffer of TX frames for station in
* power saving state */ * power saving state */
int pspoll; /* whether STA has send a PS Poll frame */
struct sk_buff_head tx_filtered; /* buffer of TX frames that were struct sk_buff_head tx_filtered; /* buffer of TX frames that were
* already given to low-level driver, * already given to low-level driver,
* but were filtered */ * but were filtered */
......
...@@ -395,7 +395,8 @@ ieee80211_tx_h_unicast_ps_buf(struct ieee80211_txrx_data *tx) ...@@ -395,7 +395,8 @@ ieee80211_tx_h_unicast_ps_buf(struct ieee80211_txrx_data *tx)
(tx->fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_PROBE_RESP))) (tx->fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_PROBE_RESP)))
return TX_CONTINUE; return TX_CONTINUE;
if (unlikely((sta->flags & WLAN_STA_PS) && !sta->pspoll)) { if (unlikely((sta->flags & WLAN_STA_PS) &&
!(sta->flags & WLAN_STA_PSPOLL))) {
struct ieee80211_tx_packet_data *pkt_data; struct ieee80211_tx_packet_data *pkt_data;
#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG #ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG
printk(KERN_DEBUG "STA %s aid %d: PS buffer (entries " 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,7 +437,7 @@ ieee80211_tx_h_unicast_ps_buf(struct ieee80211_txrx_data *tx)
print_mac(mac, sta->addr)); print_mac(mac, sta->addr));
} }
#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */ #endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */
sta->pspoll = 0; sta->flags &= ~WLAN_STA_PSPOLL;
return TX_CONTINUE; return TX_CONTINUE;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment