@@ -129,7 +129,7 @@ int rs_fw_vht_highest_rx_mcs_index(const struct ieee80211_sta_vht_cap *vht_cap,
129
129
static void
130
130
rs_fw_vht_set_enabled_rates (const struct ieee80211_sta * sta ,
131
131
const struct ieee80211_sta_vht_cap * vht_cap ,
132
- struct iwl_tlc_config_cmd * cmd )
132
+ struct iwl_tlc_config_cmd_v4 * cmd )
133
133
{
134
134
u16 supp ;
135
135
int i , highest_mcs ;
@@ -154,7 +154,7 @@ rs_fw_vht_set_enabled_rates(const struct ieee80211_sta *sta,
154
154
if (sta -> bandwidth == IEEE80211_STA_RX_BW_20 )
155
155
supp &= ~BIT (IWL_TLC_MNG_HT_RATE_MCS9 );
156
156
157
- cmd -> ht_rates [i ][IWL_TLC_HT_BW_NONE_160 ] = cpu_to_le16 (supp );
157
+ cmd -> ht_rates [i ][IWL_TLC_MCS_PER_BW_80 ] = cpu_to_le16 (supp );
158
158
/*
159
159
* Check if VHT extended NSS indicates that the bandwidth/NSS
160
160
* configuration is supported - only for MCS 0 since we already
@@ -164,8 +164,8 @@ rs_fw_vht_set_enabled_rates(const struct ieee80211_sta *sta,
164
164
ieee80211_get_vht_max_nss (& ieee_vht_cap ,
165
165
IEEE80211_VHT_CHANWIDTH_160MHZ ,
166
166
0 , true, nss ) >= nss )
167
- cmd -> ht_rates [i ][IWL_TLC_HT_BW_160 ] =
168
- cmd -> ht_rates [i ][IWL_TLC_HT_BW_NONE_160 ];
167
+ cmd -> ht_rates [i ][IWL_TLC_MCS_PER_BW_160 ] =
168
+ cmd -> ht_rates [i ][IWL_TLC_MCS_PER_BW_80 ];
169
169
}
170
170
}
171
171
@@ -189,7 +189,7 @@ static u16 rs_fw_he_ieee80211_mcs_to_rs_mcs(u16 mcs)
189
189
static void
190
190
rs_fw_he_set_enabled_rates (const struct ieee80211_sta * sta ,
191
191
struct ieee80211_supported_band * sband ,
192
- struct iwl_tlc_config_cmd * cmd )
192
+ struct iwl_tlc_config_cmd_v4 * cmd )
193
193
{
194
194
const struct ieee80211_sta_he_cap * he_cap = & sta -> he_cap ;
195
195
u16 mcs_160 = le16_to_cpu (he_cap -> he_mcs_nss_supp .rx_mcs_160 );
@@ -219,7 +219,7 @@ rs_fw_he_set_enabled_rates(const struct ieee80211_sta *sta,
219
219
}
220
220
if (_mcs_80 > _tx_mcs_80 )
221
221
_mcs_80 = _tx_mcs_80 ;
222
- cmd -> ht_rates [i ][IWL_TLC_HT_BW_NONE_160 ] =
222
+ cmd -> ht_rates [i ][IWL_TLC_MCS_PER_BW_80 ] =
223
223
cpu_to_le16 (rs_fw_he_ieee80211_mcs_to_rs_mcs (_mcs_80 ));
224
224
225
225
/* If one side doesn't support - mark both as not supporting */
@@ -230,14 +230,14 @@ rs_fw_he_set_enabled_rates(const struct ieee80211_sta *sta,
230
230
}
231
231
if (_mcs_160 > _tx_mcs_160 )
232
232
_mcs_160 = _tx_mcs_160 ;
233
- cmd -> ht_rates [i ][IWL_TLC_HT_BW_160 ] =
233
+ cmd -> ht_rates [i ][IWL_TLC_MCS_PER_BW_160 ] =
234
234
cpu_to_le16 (rs_fw_he_ieee80211_mcs_to_rs_mcs (_mcs_160 ));
235
235
}
236
236
}
237
237
238
238
static void rs_fw_set_supp_rates (struct ieee80211_sta * sta ,
239
239
struct ieee80211_supported_band * sband ,
240
- struct iwl_tlc_config_cmd * cmd )
240
+ struct iwl_tlc_config_cmd_v4 * cmd )
241
241
{
242
242
int i ;
243
243
u16 supp = 0 ;
@@ -263,15 +263,15 @@ static void rs_fw_set_supp_rates(struct ieee80211_sta *sta,
263
263
rs_fw_vht_set_enabled_rates (sta , vht_cap , cmd );
264
264
} else if (ht_cap -> ht_supported ) {
265
265
cmd -> mode = IWL_TLC_MNG_MODE_HT ;
266
- cmd -> ht_rates [IWL_TLC_NSS_1 ][IWL_TLC_HT_BW_NONE_160 ] =
266
+ cmd -> ht_rates [IWL_TLC_NSS_1 ][IWL_TLC_MCS_PER_BW_80 ] =
267
267
cpu_to_le16 (ht_cap -> mcs .rx_mask [0 ]);
268
268
269
269
/* the station support only a single receive chain */
270
270
if (sta -> smps_mode == IEEE80211_SMPS_STATIC )
271
- cmd -> ht_rates [IWL_TLC_NSS_2 ][IWL_TLC_HT_BW_NONE_160 ] =
271
+ cmd -> ht_rates [IWL_TLC_NSS_2 ][IWL_TLC_MCS_PER_BW_80 ] =
272
272
0 ;
273
273
else
274
- cmd -> ht_rates [IWL_TLC_NSS_2 ][IWL_TLC_HT_BW_NONE_160 ] =
274
+ cmd -> ht_rates [IWL_TLC_NSS_2 ][IWL_TLC_MCS_PER_BW_80 ] =
275
275
cpu_to_le16 (ht_cap -> mcs .rx_mask [1 ]);
276
276
}
277
277
}
@@ -423,23 +423,18 @@ void rs_fw_rate_init(struct iwl_mvm *mvm, struct ieee80211_sta *sta,
423
423
u32 cmd_id = iwl_cmd_id (TLC_MNG_CONFIG_CMD , DATA_PATH_GROUP , 0 );
424
424
struct ieee80211_supported_band * sband = hw -> wiphy -> bands [band ];
425
425
u16 max_amsdu_len = rs_fw_get_max_amsdu_len (sta );
426
- struct iwl_tlc_config_cmd cfg_cmd = {
426
+ struct iwl_tlc_config_cmd_v4 cfg_cmd = {
427
427
.sta_id = mvmsta -> sta_id ,
428
428
.max_ch_width = update ?
429
429
rs_fw_bw_from_sta_bw (sta ) : RATE_MCS_CHAN_WIDTH_20 ,
430
430
.flags = cpu_to_le16 (rs_fw_get_config_flags (mvm , sta , sband )),
431
431
.chains = rs_fw_set_active_chains (iwl_mvm_get_valid_tx_ant (mvm )),
432
432
.sgi_ch_width_supp = rs_fw_sgi_cw_support (sta ),
433
- .max_mpdu_len = cpu_to_le16 ( max_amsdu_len ),
434
- . amsdu = iwl_mvm_is_csum_supported ( mvm ) ,
433
+ .max_mpdu_len = iwl_mvm_is_csum_supported ( mvm ) ?
434
+ cpu_to_le16 ( max_amsdu_len ) : 0 ,
435
435
};
436
436
int ret ;
437
- u16 cmd_size = sizeof (cfg_cmd );
438
-
439
- /* In old versions of the API the struct is 4 bytes smaller */
440
- if (iwl_fw_lookup_cmd_ver (mvm -> fw , DATA_PATH_GROUP ,
441
- TLC_MNG_CONFIG_CMD , 0 ) < 3 )
442
- cmd_size -= 4 ;
437
+ int cmd_ver ;
443
438
444
439
memset (lq_sta , 0 , offsetof(typeof (* lq_sta ), pers ));
445
440
@@ -454,8 +449,41 @@ void rs_fw_rate_init(struct iwl_mvm *mvm, struct ieee80211_sta *sta,
454
449
*/
455
450
sta -> max_amsdu_len = max_amsdu_len ;
456
451
457
- ret = iwl_mvm_send_cmd_pdu (mvm , cmd_id , CMD_ASYNC , cmd_size ,
458
- & cfg_cmd );
452
+ cmd_ver = iwl_fw_lookup_cmd_ver (mvm -> fw , DATA_PATH_GROUP ,
453
+ TLC_MNG_CONFIG_CMD , 0 );
454
+ if (cmd_ver == 4 ) {
455
+ ret = iwl_mvm_send_cmd_pdu (mvm , cmd_id , CMD_ASYNC ,
456
+ sizeof (cfg_cmd ), & cfg_cmd );
457
+ } else if (cmd_ver < 4 ) {
458
+ struct iwl_tlc_config_cmd_v3 cfg_cmd_v3 = {
459
+ .sta_id = cfg_cmd .sta_id ,
460
+ .max_ch_width = cfg_cmd .max_ch_width ,
461
+ .mode = cfg_cmd .mode ,
462
+ .chains = cfg_cmd .chains ,
463
+ .amsdu = !!cfg_cmd .max_mpdu_len ,
464
+ .flags = cfg_cmd .flags ,
465
+ .non_ht_rates = cfg_cmd .non_ht_rates ,
466
+ .ht_rates [0 ][0 ] = cfg_cmd .ht_rates [0 ][0 ],
467
+ .ht_rates [0 ][1 ] = cfg_cmd .ht_rates [0 ][1 ],
468
+ .ht_rates [1 ][0 ] = cfg_cmd .ht_rates [1 ][0 ],
469
+ .ht_rates [1 ][1 ] = cfg_cmd .ht_rates [1 ][1 ],
470
+ .sgi_ch_width_supp = cfg_cmd .sgi_ch_width_supp ,
471
+ .max_mpdu_len = cfg_cmd .max_mpdu_len ,
472
+ };
473
+
474
+ u16 cmd_size = sizeof (cfg_cmd_v3 );
475
+
476
+ /* In old versions of the API the struct is 4 bytes smaller */
477
+ if (iwl_fw_lookup_cmd_ver (mvm -> fw , DATA_PATH_GROUP ,
478
+ TLC_MNG_CONFIG_CMD , 0 ) < 3 )
479
+ cmd_size -= 4 ;
480
+
481
+ ret = iwl_mvm_send_cmd_pdu (mvm , cmd_id , CMD_ASYNC , cmd_size ,
482
+ & cfg_cmd_v3 );
483
+ } else {
484
+ ret = - EINVAL ;
485
+ }
486
+
459
487
if (ret )
460
488
IWL_ERR (mvm , "Failed to send rate scale config (%d)\n" , ret );
461
489
}
0 commit comments