Skip to content

Commit 5bc5aaa

Browse files
committed
iwlwifi: mvm: set up initial SMPS/NSS station info
When a station is added, we need to tell the firmware what the SMPS settings and number of streams are. After having the initial data, the firmware will track future changes by itself. Reviewed-by: Emmanuel Grumbach <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
1 parent f0c2646 commit 5bc5aaa

File tree

1 file changed

+49
-2
lines changed
  • drivers/net/wireless/iwlwifi/mvm

1 file changed

+49
-2
lines changed

drivers/net/wireless/iwlwifi/mvm/sta.c

Lines changed: 49 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,55 @@ int iwl_mvm_sta_send_to_fw(struct iwl_mvm *mvm, struct ieee80211_sta *sta,
101101
}
102102
add_sta_cmd.add_modify = update ? 1 : 0;
103103

104-
/* STA_FLG_FAT_EN_MSK ? */
105-
/* STA_FLG_MIMO_EN_MSK ? */
104+
add_sta_cmd.station_flags_msk |= cpu_to_le32(STA_FLG_FAT_EN_MSK |
105+
STA_FLG_MIMO_EN_MSK);
106+
107+
switch (sta->bandwidth) {
108+
case IEEE80211_STA_RX_BW_160:
109+
add_sta_cmd.station_flags |= cpu_to_le32(STA_FLG_FAT_EN_160MHZ);
110+
/* fall through */
111+
case IEEE80211_STA_RX_BW_80:
112+
add_sta_cmd.station_flags |= cpu_to_le32(STA_FLG_FAT_EN_80MHZ);
113+
/* fall through */
114+
case IEEE80211_STA_RX_BW_40:
115+
add_sta_cmd.station_flags |= cpu_to_le32(STA_FLG_FAT_EN_40MHZ);
116+
/* fall through */
117+
case IEEE80211_STA_RX_BW_20:
118+
if (sta->ht_cap.ht_supported)
119+
add_sta_cmd.station_flags |=
120+
cpu_to_le32(STA_FLG_FAT_EN_20MHZ);
121+
break;
122+
}
123+
124+
switch (sta->rx_nss) {
125+
case 1:
126+
add_sta_cmd.station_flags |= cpu_to_le32(STA_FLG_MIMO_EN_SISO);
127+
break;
128+
case 2:
129+
add_sta_cmd.station_flags |= cpu_to_le32(STA_FLG_MIMO_EN_MIMO2);
130+
break;
131+
case 3 ... 8:
132+
add_sta_cmd.station_flags |= cpu_to_le32(STA_FLG_MIMO_EN_MIMO3);
133+
break;
134+
}
135+
136+
switch (sta->smps_mode) {
137+
case IEEE80211_SMPS_AUTOMATIC:
138+
case IEEE80211_SMPS_NUM_MODES:
139+
WARN_ON(1);
140+
break;
141+
case IEEE80211_SMPS_STATIC:
142+
/* override NSS */
143+
add_sta_cmd.station_flags &= ~cpu_to_le32(STA_FLG_MIMO_EN_MSK);
144+
add_sta_cmd.station_flags |= cpu_to_le32(STA_FLG_MIMO_EN_SISO);
145+
break;
146+
case IEEE80211_SMPS_DYNAMIC:
147+
add_sta_cmd.station_flags |= cpu_to_le32(STA_FLG_RTS_MIMO_PROT);
148+
break;
149+
case IEEE80211_SMPS_OFF:
150+
/* nothing */
151+
break;
152+
}
106153

107154
if (sta->ht_cap.ht_supported) {
108155
add_sta_cmd.station_flags_msk |=

0 commit comments

Comments
 (0)