aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath
diff options
context:
space:
mode:
authorErik Stromdahl <erik.stromdahl@gmail.com>2018-09-04 08:05:04 -0400
committerKalle Valo <kvalo@codeaurora.org>2018-09-06 12:14:26 -0400
commit4875e0b5208555a9cc2c45558f016e0814cbd6cb (patch)
tree03d29ab9b6c47f025d965015e33bc08e852982e0 /drivers/net/wireless/ath
parent9faaa14387fbb13cf1a314025a047cc3bc27dbef (diff)
ath10k: add per target config of max_num_peers
This patch makes sure the value of max_num_peers matches num_peers in hw_params (if set to a non zero value). hw_params->num_peers is used in the TLV WMI init command. If ar->max_num_peers is not set to the same value, there is a risk that the user creates more peers than the maximum number of peers supported by the device. Signed-off-by: Erik Stromdahl <erik.stromdahl@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/ath')
-rw-r--r--drivers/net/wireless/ath/ath10k/core.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
index e30dcb310bd6..cf3c47b8cb2d 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -2200,6 +2200,7 @@ static void ath10k_core_set_coverage_class_work(struct work_struct *work)
2200static int ath10k_core_init_firmware_features(struct ath10k *ar) 2200static int ath10k_core_init_firmware_features(struct ath10k *ar)
2201{ 2201{
2202 struct ath10k_fw_file *fw_file = &ar->normal_mode_fw.fw_file; 2202 struct ath10k_fw_file *fw_file = &ar->normal_mode_fw.fw_file;
2203 int max_num_peers;
2203 2204
2204 if (test_bit(ATH10K_FW_FEATURE_WMI_10_2, fw_file->fw_features) && 2205 if (test_bit(ATH10K_FW_FEATURE_WMI_10_2, fw_file->fw_features) &&
2205 !test_bit(ATH10K_FW_FEATURE_WMI_10X, fw_file->fw_features)) { 2206 !test_bit(ATH10K_FW_FEATURE_WMI_10X, fw_file->fw_features)) {
@@ -2279,7 +2280,7 @@ static int ath10k_core_init_firmware_features(struct ath10k *ar)
2279 2280
2280 switch (fw_file->wmi_op_version) { 2281 switch (fw_file->wmi_op_version) {
2281 case ATH10K_FW_WMI_OP_VERSION_MAIN: 2282 case ATH10K_FW_WMI_OP_VERSION_MAIN:
2282 ar->max_num_peers = TARGET_NUM_PEERS; 2283 max_num_peers = TARGET_NUM_PEERS;
2283 ar->max_num_stations = TARGET_NUM_STATIONS; 2284 ar->max_num_stations = TARGET_NUM_STATIONS;
2284 ar->max_num_vdevs = TARGET_NUM_VDEVS; 2285 ar->max_num_vdevs = TARGET_NUM_VDEVS;
2285 ar->htt.max_num_pending_tx = TARGET_NUM_MSDU_DESC; 2286 ar->htt.max_num_pending_tx = TARGET_NUM_MSDU_DESC;
@@ -2291,10 +2292,10 @@ static int ath10k_core_init_firmware_features(struct ath10k *ar)
2291 case ATH10K_FW_WMI_OP_VERSION_10_2: 2292 case ATH10K_FW_WMI_OP_VERSION_10_2:
2292 case ATH10K_FW_WMI_OP_VERSION_10_2_4: 2293 case ATH10K_FW_WMI_OP_VERSION_10_2_4:
2293 if (ath10k_peer_stats_enabled(ar)) { 2294 if (ath10k_peer_stats_enabled(ar)) {
2294 ar->max_num_peers = TARGET_10X_TX_STATS_NUM_PEERS; 2295 max_num_peers = TARGET_10X_TX_STATS_NUM_PEERS;
2295 ar->max_num_stations = TARGET_10X_TX_STATS_NUM_STATIONS; 2296 ar->max_num_stations = TARGET_10X_TX_STATS_NUM_STATIONS;
2296 } else { 2297 } else {
2297 ar->max_num_peers = TARGET_10X_NUM_PEERS; 2298 max_num_peers = TARGET_10X_NUM_PEERS;
2298 ar->max_num_stations = TARGET_10X_NUM_STATIONS; 2299 ar->max_num_stations = TARGET_10X_NUM_STATIONS;
2299 } 2300 }
2300 ar->max_num_vdevs = TARGET_10X_NUM_VDEVS; 2301 ar->max_num_vdevs = TARGET_10X_NUM_VDEVS;
@@ -2303,7 +2304,7 @@ static int ath10k_core_init_firmware_features(struct ath10k *ar)
2303 ar->max_spatial_stream = WMI_MAX_SPATIAL_STREAM; 2304 ar->max_spatial_stream = WMI_MAX_SPATIAL_STREAM;
2304 break; 2305 break;
2305 case ATH10K_FW_WMI_OP_VERSION_TLV: 2306 case ATH10K_FW_WMI_OP_VERSION_TLV:
2306 ar->max_num_peers = TARGET_TLV_NUM_PEERS; 2307 max_num_peers = TARGET_TLV_NUM_PEERS;
2307 ar->max_num_stations = TARGET_TLV_NUM_STATIONS; 2308 ar->max_num_stations = TARGET_TLV_NUM_STATIONS;
2308 ar->max_num_vdevs = TARGET_TLV_NUM_VDEVS; 2309 ar->max_num_vdevs = TARGET_TLV_NUM_VDEVS;
2309 ar->max_num_tdls_vdevs = TARGET_TLV_NUM_TDLS_VDEVS; 2310 ar->max_num_tdls_vdevs = TARGET_TLV_NUM_TDLS_VDEVS;
@@ -2315,7 +2316,7 @@ static int ath10k_core_init_firmware_features(struct ath10k *ar)
2315 ar->wmi.mgmt_max_num_pending_tx = TARGET_TLV_MGMT_NUM_MSDU_DESC; 2316 ar->wmi.mgmt_max_num_pending_tx = TARGET_TLV_MGMT_NUM_MSDU_DESC;
2316 break; 2317 break;
2317 case ATH10K_FW_WMI_OP_VERSION_10_4: 2318 case ATH10K_FW_WMI_OP_VERSION_10_4:
2318 ar->max_num_peers = TARGET_10_4_NUM_PEERS; 2319 max_num_peers = TARGET_10_4_NUM_PEERS;
2319 ar->max_num_stations = TARGET_10_4_NUM_STATIONS; 2320 ar->max_num_stations = TARGET_10_4_NUM_STATIONS;
2320 ar->num_active_peers = TARGET_10_4_ACTIVE_PEERS; 2321 ar->num_active_peers = TARGET_10_4_ACTIVE_PEERS;
2321 ar->max_num_vdevs = TARGET_10_4_NUM_VDEVS; 2322 ar->max_num_vdevs = TARGET_10_4_NUM_VDEVS;
@@ -2334,10 +2335,16 @@ static int ath10k_core_init_firmware_features(struct ath10k *ar)
2334 break; 2335 break;
2335 case ATH10K_FW_WMI_OP_VERSION_UNSET: 2336 case ATH10K_FW_WMI_OP_VERSION_UNSET:
2336 case ATH10K_FW_WMI_OP_VERSION_MAX: 2337 case ATH10K_FW_WMI_OP_VERSION_MAX:
2338 default:
2337 WARN_ON(1); 2339 WARN_ON(1);
2338 return -EINVAL; 2340 return -EINVAL;
2339 } 2341 }
2340 2342
2343 if (ar->hw_params.num_peers)
2344 ar->max_num_peers = ar->hw_params.num_peers;
2345 else
2346 ar->max_num_peers = max_num_peers;
2347
2341 /* Backwards compatibility for firmwares without 2348 /* Backwards compatibility for firmwares without
2342 * ATH10K_FW_IE_HTT_OP_VERSION. 2349 * ATH10K_FW_IE_HTT_OP_VERSION.
2343 */ 2350 */