aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2013-02-12 08:21:00 -0500
committerJohannes Berg <johannes.berg@intel.com>2013-02-15 03:41:41 -0500
commitaf0ed69badc67a0b6e976543f52029fce9ac8f69 (patch)
tree95f35f3f70f3fd949beda47ad3cee838b0c343c1 /drivers/net/wireless
parent9fb04b501a57ad29fa989ab3cd2123482e7eac5f (diff)
mac80211: stop modifying HT SMPS capability
Instead of modifying the HT SMPS capability field for stations, track the SMPS mode explicitly in a new field in the station struct and use it in the drivers that care about it. This simplifies the code using it. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/iwlegacy/4965-rs.c3
-rw-r--r--drivers/net/wireless/iwlegacy/common.c16
-rw-r--r--drivers/net/wireless/iwlwifi/dvm/rs.c6
-rw-r--r--drivers/net/wireless/iwlwifi/dvm/sta.c17
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/rs.c6
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00queue.c5
6 files changed, 20 insertions, 33 deletions
diff --git a/drivers/net/wireless/iwlegacy/4965-rs.c b/drivers/net/wireless/iwlegacy/4965-rs.c
index f3b8e91aa3dc..e8324b5e5bfe 100644
--- a/drivers/net/wireless/iwlegacy/4965-rs.c
+++ b/drivers/net/wireless/iwlegacy/4965-rs.c
@@ -1183,8 +1183,7 @@ il4965_rs_switch_to_mimo2(struct il_priv *il, struct il_lq_sta *lq_sta,
1183 if (!conf_is_ht(conf) || !sta->ht_cap.ht_supported) 1183 if (!conf_is_ht(conf) || !sta->ht_cap.ht_supported)
1184 return -1; 1184 return -1;
1185 1185
1186 if (((sta->ht_cap.cap & IEEE80211_HT_CAP_SM_PS) >> 2) == 1186 if (sta->smps_mode == IEEE80211_SMPS_STATIC)
1187 WLAN_HT_CAP_SM_PS_STATIC)
1188 return -1; 1187 return -1;
1189 1188
1190 /* Need both Tx chains/antennas to support MIMO */ 1189 /* Need both Tx chains/antennas to support MIMO */
diff --git a/drivers/net/wireless/iwlegacy/common.c b/drivers/net/wireless/iwlegacy/common.c
index 1f598604a79c..4c9aafb1b0cd 100644
--- a/drivers/net/wireless/iwlegacy/common.c
+++ b/drivers/net/wireless/iwlegacy/common.c
@@ -1830,32 +1830,30 @@ il_set_ht_add_station(struct il_priv *il, u8 idx, struct ieee80211_sta *sta)
1830{ 1830{
1831 struct ieee80211_sta_ht_cap *sta_ht_inf = &sta->ht_cap; 1831 struct ieee80211_sta_ht_cap *sta_ht_inf = &sta->ht_cap;
1832 __le32 sta_flags; 1832 __le32 sta_flags;
1833 u8 mimo_ps_mode;
1834 1833
1835 if (!sta || !sta_ht_inf->ht_supported) 1834 if (!sta || !sta_ht_inf->ht_supported)
1836 goto done; 1835 goto done;
1837 1836
1838 mimo_ps_mode = (sta_ht_inf->cap & IEEE80211_HT_CAP_SM_PS) >> 2;
1839 D_ASSOC("spatial multiplexing power save mode: %s\n", 1837 D_ASSOC("spatial multiplexing power save mode: %s\n",
1840 (mimo_ps_mode == WLAN_HT_CAP_SM_PS_STATIC) ? "static" : 1838 (sta->smps_mode == IEEE80211_SMPS_STATIC) ? "static" :
1841 (mimo_ps_mode == WLAN_HT_CAP_SM_PS_DYNAMIC) ? "dynamic" : 1839 (sta->smps_mode == IEEE80211_SMPS_DYNAMIC) ? "dynamic" :
1842 "disabled"); 1840 "disabled");
1843 1841
1844 sta_flags = il->stations[idx].sta.station_flags; 1842 sta_flags = il->stations[idx].sta.station_flags;
1845 1843
1846 sta_flags &= ~(STA_FLG_RTS_MIMO_PROT_MSK | STA_FLG_MIMO_DIS_MSK); 1844 sta_flags &= ~(STA_FLG_RTS_MIMO_PROT_MSK | STA_FLG_MIMO_DIS_MSK);
1847 1845
1848 switch (mimo_ps_mode) { 1846 switch (sta->smps_mode) {
1849 case WLAN_HT_CAP_SM_PS_STATIC: 1847 case IEEE80211_SMPS_STATIC:
1850 sta_flags |= STA_FLG_MIMO_DIS_MSK; 1848 sta_flags |= STA_FLG_MIMO_DIS_MSK;
1851 break; 1849 break;
1852 case WLAN_HT_CAP_SM_PS_DYNAMIC: 1850 case IEEE80211_SMPS_DYNAMIC:
1853 sta_flags |= STA_FLG_RTS_MIMO_PROT_MSK; 1851 sta_flags |= STA_FLG_RTS_MIMO_PROT_MSK;
1854 break; 1852 break;
1855 case WLAN_HT_CAP_SM_PS_DISABLED: 1853 case IEEE80211_SMPS_OFF:
1856 break; 1854 break;
1857 default: 1855 default:
1858 IL_WARN("Invalid MIMO PS mode %d\n", mimo_ps_mode); 1856 IL_WARN("Invalid MIMO PS mode %d\n", sta->smps_mode);
1859 break; 1857 break;
1860 } 1858 }
1861 1859
diff --git a/drivers/net/wireless/iwlwifi/dvm/rs.c b/drivers/net/wireless/iwlwifi/dvm/rs.c
index b25de02964f9..abe304267261 100644
--- a/drivers/net/wireless/iwlwifi/dvm/rs.c
+++ b/drivers/net/wireless/iwlwifi/dvm/rs.c
@@ -1289,8 +1289,7 @@ static int rs_switch_to_mimo2(struct iwl_priv *priv,
1289 if (!conf_is_ht(conf) || !sta->ht_cap.ht_supported) 1289 if (!conf_is_ht(conf) || !sta->ht_cap.ht_supported)
1290 return -1; 1290 return -1;
1291 1291
1292 if (((sta->ht_cap.cap & IEEE80211_HT_CAP_SM_PS) >> 2) 1292 if (sta->smps_mode == IEEE80211_SMPS_STATIC)
1293 == WLAN_HT_CAP_SM_PS_STATIC)
1294 return -1; 1293 return -1;
1295 1294
1296 /* Need both Tx chains/antennas to support MIMO */ 1295 /* Need both Tx chains/antennas to support MIMO */
@@ -1345,8 +1344,7 @@ static int rs_switch_to_mimo3(struct iwl_priv *priv,
1345 if (!conf_is_ht(conf) || !sta->ht_cap.ht_supported) 1344 if (!conf_is_ht(conf) || !sta->ht_cap.ht_supported)
1346 return -1; 1345 return -1;
1347 1346
1348 if (((sta->ht_cap.cap & IEEE80211_HT_CAP_SM_PS) >> 2) 1347 if (sta->smps_mode == IEEE80211_SMPS_STATIC)
1349 == WLAN_HT_CAP_SM_PS_STATIC)
1350 return -1; 1348 return -1;
1351 1349
1352 /* Need both Tx chains/antennas to support MIMO */ 1350 /* Need both Tx chains/antennas to support MIMO */
diff --git a/drivers/net/wireless/iwlwifi/dvm/sta.c b/drivers/net/wireless/iwlwifi/dvm/sta.c
index 6deab38c7aee..d5faf74c7991 100644
--- a/drivers/net/wireless/iwlwifi/dvm/sta.c
+++ b/drivers/net/wireless/iwlwifi/dvm/sta.c
@@ -196,7 +196,6 @@ static void iwl_sta_calc_ht_flags(struct iwl_priv *priv,
196 __le32 *flags, __le32 *mask) 196 __le32 *flags, __le32 *mask)
197{ 197{
198 struct ieee80211_sta_ht_cap *sta_ht_inf = &sta->ht_cap; 198 struct ieee80211_sta_ht_cap *sta_ht_inf = &sta->ht_cap;
199 u8 mimo_ps_mode;
200 199
201 *mask = STA_FLG_RTS_MIMO_PROT_MSK | 200 *mask = STA_FLG_RTS_MIMO_PROT_MSK |
202 STA_FLG_MIMO_DIS_MSK | 201 STA_FLG_MIMO_DIS_MSK |
@@ -208,26 +207,24 @@ static void iwl_sta_calc_ht_flags(struct iwl_priv *priv,
208 if (!sta || !sta_ht_inf->ht_supported) 207 if (!sta || !sta_ht_inf->ht_supported)
209 return; 208 return;
210 209
211 mimo_ps_mode = (sta_ht_inf->cap & IEEE80211_HT_CAP_SM_PS) >> 2;
212
213 IWL_DEBUG_INFO(priv, "STA %pM SM PS mode: %s\n", 210 IWL_DEBUG_INFO(priv, "STA %pM SM PS mode: %s\n",
214 sta->addr, 211 sta->addr,
215 (mimo_ps_mode == WLAN_HT_CAP_SM_PS_STATIC) ? 212 (sta->smps_mode == IEEE80211_SMPS_STATIC) ?
216 "static" : 213 "static" :
217 (mimo_ps_mode == WLAN_HT_CAP_SM_PS_DYNAMIC) ? 214 (sta->smps_mode == IEEE80211_SMPS_DYNAMIC) ?
218 "dynamic" : "disabled"); 215 "dynamic" : "disabled");
219 216
220 switch (mimo_ps_mode) { 217 switch (sta->smps_mode) {
221 case WLAN_HT_CAP_SM_PS_STATIC: 218 case IEEE80211_SMPS_STATIC:
222 *flags |= STA_FLG_MIMO_DIS_MSK; 219 *flags |= STA_FLG_MIMO_DIS_MSK;
223 break; 220 break;
224 case WLAN_HT_CAP_SM_PS_DYNAMIC: 221 case IEEE80211_SMPS_DYNAMIC:
225 *flags |= STA_FLG_RTS_MIMO_PROT_MSK; 222 *flags |= STA_FLG_RTS_MIMO_PROT_MSK;
226 break; 223 break;
227 case WLAN_HT_CAP_SM_PS_DISABLED: 224 case IEEE80211_SMPS_OFF:
228 break; 225 break;
229 default: 226 default:
230 IWL_WARN(priv, "Invalid MIMO PS mode %d\n", mimo_ps_mode); 227 IWL_WARN(priv, "Invalid MIMO PS mode %d\n", sta->smps_mode);
231 break; 228 break;
232 } 229 }
233 230
diff --git a/drivers/net/wireless/iwlwifi/mvm/rs.c b/drivers/net/wireless/iwlwifi/mvm/rs.c
index 8ba36e5e4b67..56b636d9ab30 100644
--- a/drivers/net/wireless/iwlwifi/mvm/rs.c
+++ b/drivers/net/wireless/iwlwifi/mvm/rs.c
@@ -1229,8 +1229,7 @@ static int rs_switch_to_mimo2(struct iwl_mvm *mvm,
1229 if (!sta->ht_cap.ht_supported) 1229 if (!sta->ht_cap.ht_supported)
1230 return -1; 1230 return -1;
1231 1231
1232 if (((sta->ht_cap.cap & IEEE80211_HT_CAP_SM_PS) >> 2) 1232 if (sta->smps_mode == IEEE80211_SMPS_STATIC)
1233 == WLAN_HT_CAP_SM_PS_STATIC)
1234 return -1; 1233 return -1;
1235 1234
1236 /* Need both Tx chains/antennas to support MIMO */ 1235 /* Need both Tx chains/antennas to support MIMO */
@@ -1282,8 +1281,7 @@ static int rs_switch_to_mimo3(struct iwl_mvm *mvm,
1282 if (!sta->ht_cap.ht_supported) 1281 if (!sta->ht_cap.ht_supported)
1283 return -1; 1282 return -1;
1284 1283
1285 if (((sta->ht_cap.cap & IEEE80211_HT_CAP_SM_PS) >> 2) 1284 if (sta->smps_mode == IEEE80211_SMPS_STATIC)
1286 == WLAN_HT_CAP_SM_PS_STATIC)
1287 return -1; 1285 return -1;
1288 1286
1289 /* Need both Tx chains/antennas to support MIMO */ 1287 /* Need both Tx chains/antennas to support MIMO */
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c
index f35d85a71bbc..9503e6954b89 100644
--- a/drivers/net/wireless/rt2x00/rt2x00queue.c
+++ b/drivers/net/wireless/rt2x00/rt2x00queue.c
@@ -343,10 +343,7 @@ static void rt2x00queue_create_tx_descriptor_ht(struct rt2x00_dev *rt2x00dev,
343 * when using more then one tx stream (>MCS7). 343 * when using more then one tx stream (>MCS7).
344 */ 344 */
345 if (sta && txdesc->u.ht.mcs > 7 && 345 if (sta && txdesc->u.ht.mcs > 7 &&
346 ((sta->ht_cap.cap & 346 sta->smps_mode == IEEE80211_SMPS_DYNAMIC)
347 IEEE80211_HT_CAP_SM_PS) >>
348 IEEE80211_HT_CAP_SM_PS_SHIFT) ==
349 WLAN_HT_CAP_SM_PS_DYNAMIC)
350 __set_bit(ENTRY_TXD_HT_MIMO_PS, &txdesc->flags); 347 __set_bit(ENTRY_TXD_HT_MIMO_PS, &txdesc->flags);
351 } else { 348 } else {
352 txdesc->u.ht.mcs = rt2x00_get_rate_mcs(hwrate->mcs); 349 txdesc->u.ht.mcs = rt2x00_get_rate_mcs(hwrate->mcs);