]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
ath11k: add ab to TARGET_NUM_VDEVS & co
authorKalle Valo <quic_kvalo@quicinc.com>
Mon, 13 Dec 2021 09:53:08 +0000 (11:53 +0200)
committerKalle Valo <quic_kvalo@quicinc.com>
Tue, 14 Dec 2021 15:32:33 +0000 (17:32 +0200)
The next patch changes TARGET_NUM_VDEVS to be dynamic and need access to ab.
Add ab separately to keep the next patch simple.

Compile tested only.

Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20211209104351.9811-2-kvalo@kernel.org
drivers/net/wireless/ath/ath11k/core.c
drivers/net/wireless/ath/ath11k/hw.c
drivers/net/wireless/ath/ath11k/hw.h
drivers/net/wireless/ath/ath11k/mac.c

index 1d983fde6fc91ce3093bc12523ce7cda69c58df2..c08e96522332f66f7c682166f703cc6da2536249 100644 (file)
@@ -1067,7 +1067,7 @@ static int ath11k_core_reconfigure_on_crash(struct ath11k_base *ab)
        ath11k_dp_free(ab);
        ath11k_hal_srng_deinit(ab);
 
-       ab->free_vdev_map = (1LL << (ab->num_radios * TARGET_NUM_VDEVS)) - 1;
+       ab->free_vdev_map = (1LL << (ab->num_radios * TARGET_NUM_VDEVS(ab))) - 1;
 
        ret = ath11k_hal_srng_init(ab);
        if (ret)
index 2f0b526188e45dced1306839a857dcd2df7acdbb..3b0fdc1a6b3f4dfa6b0a86ad880a5e8acc199721 100644 (file)
@@ -150,18 +150,18 @@ static void ath11k_hw_ipq8074_reo_setup(struct ath11k_base *ab)
 static void ath11k_init_wmi_config_ipq8074(struct ath11k_base *ab,
                                           struct target_resource_config *config)
 {
-       config->num_vdevs = ab->num_radios * TARGET_NUM_VDEVS;
+       config->num_vdevs = ab->num_radios * TARGET_NUM_VDEVS(ab);
 
        if (ab->num_radios == 2) {
-               config->num_peers = TARGET_NUM_PEERS(DBS);
-               config->num_tids = TARGET_NUM_TIDS(DBS);
+               config->num_peers = TARGET_NUM_PEERS(ab, DBS);
+               config->num_tids = TARGET_NUM_TIDS(ab, DBS);
        } else if (ab->num_radios == 3) {
-               config->num_peers = TARGET_NUM_PEERS(DBS_SBS);
-               config->num_tids = TARGET_NUM_TIDS(DBS_SBS);
+               config->num_peers = TARGET_NUM_PEERS(ab, DBS_SBS);
+               config->num_tids = TARGET_NUM_TIDS(ab, DBS_SBS);
        } else {
                /* Control should not reach here */
-               config->num_peers = TARGET_NUM_PEERS(SINGLE);
-               config->num_tids = TARGET_NUM_TIDS(SINGLE);
+               config->num_peers = TARGET_NUM_PEERS(ab, SINGLE);
+               config->num_tids = TARGET_NUM_TIDS(ab, SINGLE);
        }
        config->num_offload_peers = TARGET_NUM_OFFLD_PEERS;
        config->num_offload_reorder_buffs = TARGET_NUM_OFFLD_REORDER_BUFFS;
index fe6e0cb9476cc210540d027ecf39d32ebb6ff7a7..7ea3207692dc83160ec8ce7f3327156a492fae13 100644 (file)
 /* Target configuration defines */
 
 /* Num VDEVS per radio */
-#define TARGET_NUM_VDEVS       (16 + 1)
+#define TARGET_NUM_VDEVS(ab)   (16 + 1)
 
-#define TARGET_NUM_PEERS_PDEV  (512 + TARGET_NUM_VDEVS)
+#define TARGET_NUM_PEERS_PDEV(ab) (512 + TARGET_NUM_VDEVS(ab))
 
 /* Num of peers for Single Radio mode */
-#define TARGET_NUM_PEERS_SINGLE                (TARGET_NUM_PEERS_PDEV)
+#define TARGET_NUM_PEERS_SINGLE(ab) (TARGET_NUM_PEERS_PDEV(ab))
 
 /* Num of peers for DBS */
-#define TARGET_NUM_PEERS_DBS           (2 * TARGET_NUM_PEERS_PDEV)
+#define TARGET_NUM_PEERS_DBS(ab) (2 * TARGET_NUM_PEERS_PDEV(ab))
 
 /* Num of peers for DBS_SBS */
-#define TARGET_NUM_PEERS_DBS_SBS       (3 * TARGET_NUM_PEERS_PDEV)
+#define TARGET_NUM_PEERS_DBS_SBS(ab)   (3 * TARGET_NUM_PEERS_PDEV(ab))
 
 /* Max num of stations (per radio) */
-#define TARGET_NUM_STATIONS    512
+#define TARGET_NUM_STATIONS(ab)        512
 
-#define TARGET_NUM_PEERS(x)    TARGET_NUM_PEERS_##x
+#define TARGET_NUM_PEERS(ab, x)        TARGET_NUM_PEERS_##x(ab)
 #define TARGET_NUM_PEER_KEYS   2
-#define TARGET_NUM_TIDS(x)     (2 * TARGET_NUM_PEERS(x) + \
-                                4 * TARGET_NUM_VDEVS + 8)
+#define TARGET_NUM_TIDS(ab, x) (2 * TARGET_NUM_PEERS(ab, x) +  \
+                                4 * TARGET_NUM_VDEVS(ab) + 8)
 
 #define TARGET_AST_SKID_LIMIT  16
 #define TARGET_NUM_OFFLD_PEERS 4
index 6361378cb407cb4b0c2fc1fe3792f305a6ffaade..2bc93456b34e94a277949ff93fff938a5e86ce3d 100644 (file)
@@ -6004,9 +6004,9 @@ static int ath11k_mac_op_add_interface(struct ieee80211_hw *hw,
                goto err;
        }
 
-       if (ar->num_created_vdevs > (TARGET_NUM_VDEVS - 1)) {
+       if (ar->num_created_vdevs > (TARGET_NUM_VDEVS(ab) - 1)) {
                ath11k_warn(ab, "failed to create vdev %u, reached max vdev limit %d\n",
-                           ar->num_created_vdevs, TARGET_NUM_VDEVS);
+                           ar->num_created_vdevs, TARGET_NUM_VDEVS(ab));
                ret = -EBUSY;
                goto err;
        }
@@ -8202,8 +8202,8 @@ static int __ath11k_mac_register(struct ath11k *ar)
        ar->hw->wiphy->features |= NL80211_FEATURE_AP_MODE_CHAN_WIDTH_CHANGE |
                                   NL80211_FEATURE_AP_SCAN;
 
-       ar->max_num_stations = TARGET_NUM_STATIONS;
-       ar->max_num_peers = TARGET_NUM_PEERS_PDEV;
+       ar->max_num_stations = TARGET_NUM_STATIONS(ab);
+       ar->max_num_peers = TARGET_NUM_PEERS_PDEV(ab);
 
        ar->hw->wiphy->max_ap_assoc_sta = ar->max_num_stations;
 
@@ -8306,7 +8306,7 @@ int ath11k_mac_register(struct ath11k_base *ab)
 
        /* Initialize channel counters frequency value in hertz */
        ab->cc_freq_hz = IPQ8074_CC_FREQ_HERTZ;
-       ab->free_vdev_map = (1LL << (ab->num_radios * TARGET_NUM_VDEVS)) - 1;
+       ab->free_vdev_map = (1LL << (ab->num_radios * TARGET_NUM_VDEVS(ab))) - 1;
 
        for (i = 0; i < ab->num_radios; i++) {
                pdev = &ab->pdevs[i];