sta_info.c (5108ca828017120981880eeec8a9ec369334a899) | sta_info.c (e3685e03b40f5ec7926d9a75bf63467fc4071df9) |
---|---|
1/* 2 * Copyright 2002-2005, Instant802 Networks, Inc. 3 * Copyright 2006-2007 Jiri Benc <jbenc@suse.cz> 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License version 2 as 7 * published by the Free Software Foundation. 8 */ --- 85 unchanged lines hidden (view full) --- 94static void __cleanup_single_sta(struct sta_info *sta) 95{ 96 int ac, i; 97 struct tid_ampdu_tx *tid_tx; 98 struct ieee80211_sub_if_data *sdata = sta->sdata; 99 struct ieee80211_local *local = sdata->local; 100 struct ps_data *ps; 101 | 1/* 2 * Copyright 2002-2005, Instant802 Networks, Inc. 3 * Copyright 2006-2007 Jiri Benc <jbenc@suse.cz> 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License version 2 as 7 * published by the Free Software Foundation. 8 */ --- 85 unchanged lines hidden (view full) --- 94static void __cleanup_single_sta(struct sta_info *sta) 95{ 96 int ac, i; 97 struct tid_ampdu_tx *tid_tx; 98 struct ieee80211_sub_if_data *sdata = sta->sdata; 99 struct ieee80211_local *local = sdata->local; 100 struct ps_data *ps; 101 |
102 if (test_sta_flag(sta, WLAN_STA_PS_STA)) { | 102 if (test_sta_flag(sta, WLAN_STA_PS_STA) || 103 test_sta_flag(sta, WLAN_STA_PS_DRIVER)) { |
103 if (sta->sdata->vif.type == NL80211_IFTYPE_AP || 104 sta->sdata->vif.type == NL80211_IFTYPE_AP_VLAN) 105 ps = &sdata->bss->ps; 106 else if (ieee80211_vif_is_mesh(&sdata->vif)) 107 ps = &sdata->u.mesh.ps; 108 else 109 return; 110 111 clear_sta_flag(sta, WLAN_STA_PS_STA); | 104 if (sta->sdata->vif.type == NL80211_IFTYPE_AP || 105 sta->sdata->vif.type == NL80211_IFTYPE_AP_VLAN) 106 ps = &sdata->bss->ps; 107 else if (ieee80211_vif_is_mesh(&sdata->vif)) 108 ps = &sdata->u.mesh.ps; 109 else 110 return; 111 112 clear_sta_flag(sta, WLAN_STA_PS_STA); |
113 clear_sta_flag(sta, WLAN_STA_PS_DRIVER); |
|
112 113 atomic_dec(&ps->num_sta_ps); 114 sta_info_recalc_tim(sta); 115 } 116 117 for (ac = 0; ac < IEEE80211_NUM_ACS; ac++) { 118 local->total_ps_buffered -= skb_queue_len(&sta->ps_tx_buf[ac]); 119 ieee80211_purge_tx_queue(&local->hw, &sta->ps_tx_buf[ac]); --- 965 unchanged lines hidden (view full) --- 1085 1086 if (!sta->uploaded) 1087 return NULL; 1088 1089 return &sta->sta; 1090} 1091EXPORT_SYMBOL(ieee80211_find_sta); 1092 | 114 115 atomic_dec(&ps->num_sta_ps); 116 sta_info_recalc_tim(sta); 117 } 118 119 for (ac = 0; ac < IEEE80211_NUM_ACS; ac++) { 120 local->total_ps_buffered -= skb_queue_len(&sta->ps_tx_buf[ac]); 121 ieee80211_purge_tx_queue(&local->hw, &sta->ps_tx_buf[ac]); --- 965 unchanged lines hidden (view full) --- 1087 1088 if (!sta->uploaded) 1089 return NULL; 1090 1091 return &sta->sta; 1092} 1093EXPORT_SYMBOL(ieee80211_find_sta); 1094 |
1093static void clear_sta_ps_flags(void *_sta) | 1095/* powersave support code */ 1096void ieee80211_sta_ps_deliver_wakeup(struct sta_info *sta) |
1094{ | 1097{ |
1095 struct sta_info *sta = _sta; | |
1096 struct ieee80211_sub_if_data *sdata = sta->sdata; | 1098 struct ieee80211_sub_if_data *sdata = sta->sdata; |
1099 struct ieee80211_local *local = sdata->local; 1100 struct sk_buff_head pending; 1101 int filtered = 0, buffered = 0, ac; 1102 unsigned long flags; |
|
1097 struct ps_data *ps; 1098 1099 if (sdata->vif.type == NL80211_IFTYPE_AP || 1100 sdata->vif.type == NL80211_IFTYPE_AP_VLAN) 1101 ps = &sdata->bss->ps; 1102 else if (ieee80211_vif_is_mesh(&sdata->vif)) 1103 ps = &sdata->u.mesh.ps; 1104 else 1105 return; 1106 | 1103 struct ps_data *ps; 1104 1105 if (sdata->vif.type == NL80211_IFTYPE_AP || 1106 sdata->vif.type == NL80211_IFTYPE_AP_VLAN) 1107 ps = &sdata->bss->ps; 1108 else if (ieee80211_vif_is_mesh(&sdata->vif)) 1109 ps = &sdata->u.mesh.ps; 1110 else 1111 return; 1112 |
1107 clear_sta_flag(sta, WLAN_STA_PS_DRIVER); 1108 if (test_and_clear_sta_flag(sta, WLAN_STA_PS_STA)) 1109 atomic_dec(&ps->num_sta_ps); 1110} 1111 1112/* powersave support code */ 1113void ieee80211_sta_ps_deliver_wakeup(struct sta_info *sta) 1114{ 1115 struct ieee80211_sub_if_data *sdata = sta->sdata; 1116 struct ieee80211_local *local = sdata->local; 1117 struct sk_buff_head pending; 1118 int filtered = 0, buffered = 0, ac; 1119 unsigned long flags; 1120 | |
1121 clear_sta_flag(sta, WLAN_STA_SP); 1122 1123 BUILD_BUG_ON(BITS_TO_LONGS(IEEE80211_NUM_TIDS) > 1); 1124 sta->driver_buffered_tids = 0; 1125 1126 if (!(local->hw.flags & IEEE80211_HW_AP_LINK_PS)) 1127 drv_sta_notify(local, sdata, STA_NOTIFY_AWAKE, &sta->sta); 1128 --- 14 unchanged lines hidden (view full) --- 1143 1144 spin_lock_irqsave(&sta->ps_tx_buf[ac].lock, flags); 1145 skb_queue_splice_tail_init(&sta->ps_tx_buf[ac], &pending); 1146 spin_unlock_irqrestore(&sta->ps_tx_buf[ac].lock, flags); 1147 tmp = skb_queue_len(&pending); 1148 buffered += tmp - count; 1149 } 1150 | 1113 clear_sta_flag(sta, WLAN_STA_SP); 1114 1115 BUILD_BUG_ON(BITS_TO_LONGS(IEEE80211_NUM_TIDS) > 1); 1116 sta->driver_buffered_tids = 0; 1117 1118 if (!(local->hw.flags & IEEE80211_HW_AP_LINK_PS)) 1119 drv_sta_notify(local, sdata, STA_NOTIFY_AWAKE, &sta->sta); 1120 --- 14 unchanged lines hidden (view full) --- 1135 1136 spin_lock_irqsave(&sta->ps_tx_buf[ac].lock, flags); 1137 skb_queue_splice_tail_init(&sta->ps_tx_buf[ac], &pending); 1138 spin_unlock_irqrestore(&sta->ps_tx_buf[ac].lock, flags); 1139 tmp = skb_queue_len(&pending); 1140 buffered += tmp - count; 1141 } 1142 |
1151 ieee80211_add_pending_skbs_fn(local, &pending, clear_sta_ps_flags, sta); | 1143 ieee80211_add_pending_skbs(local, &pending); 1144 clear_sta_flag(sta, WLAN_STA_PS_DRIVER); 1145 clear_sta_flag(sta, WLAN_STA_PS_STA); |
1152 spin_unlock(&sta->ps_lock); 1153 | 1146 spin_unlock(&sta->ps_lock); 1147 |
1148 atomic_dec(&ps->num_sta_ps); 1149 |
|
1154 /* This station just woke up and isn't aware of our SMPS state */ 1155 if (!ieee80211_smps_is_restrictive(sta->known_smps_mode, 1156 sdata->smps_mode) && 1157 sta->known_smps_mode != sdata->bss->req_smps && 1158 sta_info_tx_streams(sta) != 1) { 1159 ht_dbg(sdata, 1160 "%pM just woke up and MIMO capable - update SMPS\n", 1161 sta->sta.addr); --- 547 unchanged lines hidden --- | 1150 /* This station just woke up and isn't aware of our SMPS state */ 1151 if (!ieee80211_smps_is_restrictive(sta->known_smps_mode, 1152 sdata->smps_mode) && 1153 sta->known_smps_mode != sdata->bss->req_smps && 1154 sta_info_tx_streams(sta) != 1) { 1155 ht_dbg(sdata, 1156 "%pM just woke up and MIMO capable - update SMPS\n", 1157 sta->sta.addr); --- 547 unchanged lines hidden --- |