aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/mlme.c
diff options
context:
space:
mode:
authorVivek Natarajan <vnatarajan@atheros.com>2010-03-11 15:59:53 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2010-04-01 19:01:57 -0400
commit03d0e14875e0f4151ec039125c15ca46e056b914 (patch)
treed758e4819e099fcc3f97d1da14d28aaf1e6042d0 /net/mac80211/mlme.c
parent7c74e3f2e97f7bdcb56b72919201af941ea0b4e6 (diff)
mac80211: Retry null data frame for power save
commit 375177bf35efc08e1bd37bbda4cc0c8cc4db8500 upstream. Even if the null data frame is not acked by the AP, mac80211 goes into power save. This might lead to loss of frames from the AP. Prevent this by restarting dynamic_ps_timer when ack is not received for null data frames. Cc: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Vivek Natarajan <vnatarajan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'net/mac80211/mlme.c')
-rw-r--r--net/mac80211/mlme.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 9072a412089e..1a209ac67ffa 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -662,8 +662,11 @@ static void ieee80211_enable_ps(struct ieee80211_local *local,
662 } else { 662 } else {
663 if (local->hw.flags & IEEE80211_HW_PS_NULLFUNC_STACK) 663 if (local->hw.flags & IEEE80211_HW_PS_NULLFUNC_STACK)
664 ieee80211_send_nullfunc(local, sdata, 1); 664 ieee80211_send_nullfunc(local, sdata, 1);
665 conf->flags |= IEEE80211_CONF_PS; 665
666 ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_PS); 666 if (!(local->hw.flags & IEEE80211_HW_REPORTS_TX_ACK_STATUS)) {
667 conf->flags |= IEEE80211_CONF_PS;
668 ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_PS);
669 }
667 } 670 }
668} 671}
669 672
@@ -754,6 +757,7 @@ void ieee80211_dynamic_ps_enable_work(struct work_struct *work)
754 container_of(work, struct ieee80211_local, 757 container_of(work, struct ieee80211_local,
755 dynamic_ps_enable_work); 758 dynamic_ps_enable_work);
756 struct ieee80211_sub_if_data *sdata = local->ps_sdata; 759 struct ieee80211_sub_if_data *sdata = local->ps_sdata;
760 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
757 761
758 /* can only happen when PS was just disabled anyway */ 762 /* can only happen when PS was just disabled anyway */
759 if (!sdata) 763 if (!sdata)
@@ -762,11 +766,16 @@ void ieee80211_dynamic_ps_enable_work(struct work_struct *work)
762 if (local->hw.conf.flags & IEEE80211_CONF_PS) 766 if (local->hw.conf.flags & IEEE80211_CONF_PS)
763 return; 767 return;
764 768
765 if (local->hw.flags & IEEE80211_HW_PS_NULLFUNC_STACK) 769 if ((local->hw.flags & IEEE80211_HW_PS_NULLFUNC_STACK) &&
770 (!(ifmgd->flags & IEEE80211_STA_NULLFUNC_ACKED)))
766 ieee80211_send_nullfunc(local, sdata, 1); 771 ieee80211_send_nullfunc(local, sdata, 1);
767 772
768 local->hw.conf.flags |= IEEE80211_CONF_PS; 773 if (!(local->hw.flags & IEEE80211_HW_REPORTS_TX_ACK_STATUS) ||
769 ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_PS); 774 (ifmgd->flags & IEEE80211_STA_NULLFUNC_ACKED)) {
775 ifmgd->flags &= ~IEEE80211_STA_NULLFUNC_ACKED;
776 local->hw.conf.flags |= IEEE80211_CONF_PS;
777 ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_PS);
778 }
770} 779}
771 780
772void ieee80211_dynamic_ps_timer(unsigned long data) 781void ieee80211_dynamic_ps_timer(unsigned long data)
@@ -2468,6 +2477,7 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata,
2468 list_add(&wk->list, &ifmgd->work_list); 2477 list_add(&wk->list, &ifmgd->work_list);
2469 2478
2470 ifmgd->flags &= ~IEEE80211_STA_DISABLE_11N; 2479 ifmgd->flags &= ~IEEE80211_STA_DISABLE_11N;
2480 ifmgd->flags &= ~IEEE80211_STA_NULLFUNC_ACKED;
2471 2481
2472 for (i = 0; i < req->crypto.n_ciphers_pairwise; i++) 2482 for (i = 0; i < req->crypto.n_ciphers_pairwise; i++)
2473 if (req->crypto.ciphers_pairwise[i] == WLAN_CIPHER_SUITE_WEP40 || 2483 if (req->crypto.ciphers_pairwise[i] == WLAN_CIPHER_SUITE_WEP40 ||