Skip to content

Commit 5bc89ad

Browse files
FROMGIT: wifi: ath11k: support DBS and DFS compatibility (#14)
Now some chips which support 'support_dual_stations' will enable DBS, but will disable DFS. Restructure the ath11k_mac_setup_iface_combinations function to support DBS and DFS compatibility. About 'support_dual_station' feature can refer: https://msgid.link/[email protected] Add a ieee80211_iface_combination to support DBS and DFS compatibility, one combination can support DFS(same with non dual sta), another combination can support DBS. When running different scenarios that will use different ieee80211_iface_combination due to mac80211 will go through all of possible interface combinations. In addition, maximum number of interfaces of these types should be total allowed in this group. The chips affected are: QCA6390 hw2.0 WCN6855 hw2.0 WCN6855 hw2.1 Other chips are not affected. Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.1.0.1-00410-QCAHKSWPL_SILICONZ-2 Tested-on: IPQ6018 hw1.0 AHB WLAN.HK.2.1.0.1-01161-QCAHKSWPL_SILICONZ-1 Tested-on: WCN6855 hw2.1 PCI WLAN.HSP.1.1-04402-QCAHSPSWPL_V1_V2_SILICONZ_IOE-1. Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-05266-QCAHSTSWPLZ_V2_TO_X86-1 Reviewed-by: Baochen Qiang <[email protected]> Reviewed-by: Vasanthakumar Thiagarajan <[email protected]> Acked-by: Jeff Johnson <[email protected]> Tested-by: Mihai Moldovan <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Yu Zhang (Yuriy) <[email protected]> Signed-off-by: Jeff Johnson <[email protected]> Signed-off-by: Miaoqing Pan <[email protected]> Co-authored-by: Yu Zhang(Yuriy) <[email protected]>
1 parent 82f2b0b commit 5bc89ad

File tree

1 file changed

+24
-18
lines changed
  • drivers/net/wireless/ath/ath11k

1 file changed

+24
-18
lines changed

drivers/net/wireless/ath/ath11k/mac.c

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9966,12 +9966,17 @@ static int ath11k_mac_setup_iface_combinations(struct ath11k *ar)
99669966
struct ath11k_base *ab = ar->ab;
99679967
struct ieee80211_iface_combination *combinations;
99689968
struct ieee80211_iface_limit *limits;
9969-
int n_limits;
9969+
int n_limits, n_combos;
99709970
bool p2p;
99719971

99729972
p2p = ab->hw_params.interface_modes & BIT(NL80211_IFTYPE_P2P_DEVICE);
99739973

9974-
combinations = kzalloc(sizeof(*combinations), GFP_KERNEL);
9974+
if (ab->hw_params.support_dual_stations)
9975+
n_combos = 2;
9976+
else
9977+
n_combos = 1;
9978+
9979+
combinations = kcalloc(n_combos, sizeof(*combinations), GFP_KERNEL);
99759980
if (!combinations)
99769981
return -ENOMEM;
99779982

@@ -9986,7 +9991,9 @@ static int ath11k_mac_setup_iface_combinations(struct ath11k *ar)
99869991
return -ENOMEM;
99879992
}
99889993

9994+
limits[0].max = 1;
99899995
limits[0].types |= BIT(NL80211_IFTYPE_STATION);
9996+
limits[1].max = 16;
99909997
limits[1].types |= BIT(NL80211_IFTYPE_AP);
99919998
if (IS_ENABLED(CONFIG_MAC80211_MESH) &&
99929999
ab->hw_params.interface_modes & BIT(NL80211_IFTYPE_MESH_POINT))
@@ -9996,25 +10003,24 @@ static int ath11k_mac_setup_iface_combinations(struct ath11k *ar)
999610003
combinations[0].n_limits = n_limits;
999710004
combinations[0].beacon_int_infra_match = true;
999810005
combinations[0].beacon_int_min_gcd = 100;
10006+
combinations[0].max_interfaces = 16;
10007+
combinations[0].num_different_channels = 1;
10008+
combinations[0].radar_detect_widths = BIT(NL80211_CHAN_WIDTH_20_NOHT) |
10009+
BIT(NL80211_CHAN_WIDTH_20) |
10010+
BIT(NL80211_CHAN_WIDTH_40) |
10011+
BIT(NL80211_CHAN_WIDTH_80) |
10012+
BIT(NL80211_CHAN_WIDTH_80P80) |
10013+
BIT(NL80211_CHAN_WIDTH_160);
999910014

1000010015
if (ab->hw_params.support_dual_stations) {
1000110016
limits[0].max = 2;
10002-
limits[1].max = 1;
10003-
10004-
combinations[0].max_interfaces = ab->hw_params.num_vdevs;
10005-
combinations[0].num_different_channels = 2;
10006-
} else {
10007-
limits[0].max = 1;
10008-
limits[1].max = 16;
1000910017

10010-
combinations[0].max_interfaces = 16;
10011-
combinations[0].num_different_channels = 1;
10012-
combinations[0].radar_detect_widths = BIT(NL80211_CHAN_WIDTH_20_NOHT) |
10013-
BIT(NL80211_CHAN_WIDTH_20) |
10014-
BIT(NL80211_CHAN_WIDTH_40) |
10015-
BIT(NL80211_CHAN_WIDTH_80) |
10016-
BIT(NL80211_CHAN_WIDTH_80P80) |
10017-
BIT(NL80211_CHAN_WIDTH_160);
10018+
combinations[1].limits = limits;
10019+
combinations[1].n_limits = n_limits;
10020+
combinations[1].beacon_int_infra_match = true;
10021+
combinations[1].beacon_int_min_gcd = 100;
10022+
combinations[1].max_interfaces = ab->hw_params.num_vdevs;
10023+
combinations[1].num_different_channels = 2;
1001810024
}
1001910025

1002010026
if (p2p) {
@@ -10025,7 +10031,7 @@ static int ath11k_mac_setup_iface_combinations(struct ath11k *ar)
1002510031
}
1002610032

1002710033
ar->hw->wiphy->iface_combinations = combinations;
10028-
ar->hw->wiphy->n_iface_combinations = 1;
10034+
ar->hw->wiphy->n_iface_combinations = n_combos;
1002910035

1003010036
return 0;
1003110037
}

0 commit comments

Comments
 (0)