Skip to content

Commit

Permalink
ath10k: set max_num_vdevs based on wmi op version
Browse files Browse the repository at this point in the history
To make it easier to manage firmware differences, we should not use
ATH10K_FW_FEATURE_WMI_10X outside ath10k_core_init_firmware_features(). To
achieve that create new field ar->max_num_vdevs and set it based on wmi op
version.

Signed-off-by: Kalle Valo <[email protected]>
  • Loading branch information
kvalo committed Dec 23, 2014
1 parent 75d2bd4 commit 30c7816
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
7 changes: 3 additions & 4 deletions drivers/net/wireless/ath/ath10k/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -904,12 +904,14 @@ static int ath10k_core_init_firmware_features(struct ath10k *ar)
case ATH10K_FW_WMI_OP_VERSION_MAIN:
ar->max_num_peers = TARGET_NUM_PEERS;
ar->max_num_stations = TARGET_NUM_STATIONS;
ar->max_num_vdevs = TARGET_NUM_VDEVS;
ar->htt.max_num_pending_tx = TARGET_NUM_MSDU_DESC;
break;
case ATH10K_FW_WMI_OP_VERSION_10_1:
case ATH10K_FW_WMI_OP_VERSION_10_2:
ar->max_num_peers = TARGET_10X_NUM_PEERS;
ar->max_num_stations = TARGET_10X_NUM_STATIONS;
ar->max_num_vdevs = TARGET_10X_NUM_VDEVS;
ar->htt.max_num_pending_tx = TARGET_10X_NUM_MSDU_DESC;
break;
case ATH10K_FW_WMI_OP_VERSION_TLV:
Expand Down Expand Up @@ -1061,10 +1063,7 @@ int ath10k_core_start(struct ath10k *ar, enum ath10k_firmware_mode mode)
if (status)
goto err_hif_stop;

if (test_bit(ATH10K_FW_FEATURE_WMI_10X, ar->fw_features))
ar->free_vdev_map = (1LL << TARGET_10X_NUM_VDEVS) - 1;
else
ar->free_vdev_map = (1LL << TARGET_NUM_VDEVS) - 1;
ar->free_vdev_map = (1LL << ar->max_num_vdevs) - 1;

INIT_LIST_HEAD(&ar->arvifs);

Expand Down
1 change: 1 addition & 0 deletions drivers/net/wireless/ath/ath10k/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,7 @@ struct ath10k {

int max_num_peers;
int max_num_stations;
int max_num_vdevs;

struct work_struct offchan_tx_work;
struct sk_buff_head offchan_tx_queue;
Expand Down

0 comments on commit 30c7816

Please sign in to comment.