wifi: ath11k: change interface combination for P2P mode
Current interface combination doesn't support P2P mode. So change it for P2P mode. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.37 Tested-on: QCA2066 hw2.1 PCI WLAN.HSP.1.1-03926.13-QCAHSPSWPL_V2_SILICONZ_CE-2.52297.2 Signed-off-by: Kang Yang <quic_kangyang@quicinc.com> Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com> Link: https://msgid.link/20240228093537.25052-2-quic_kangyang@quicinc.com
This commit is contained in:
@@ -9850,12 +9850,18 @@ static int ath11k_mac_setup_iface_combinations(struct ath11k *ar)
|
||||
struct ieee80211_iface_combination *combinations;
|
||||
struct ieee80211_iface_limit *limits;
|
||||
int n_limits;
|
||||
bool p2p;
|
||||
|
||||
p2p = ab->hw_params.interface_modes & BIT(NL80211_IFTYPE_P2P_DEVICE);
|
||||
|
||||
combinations = kzalloc(sizeof(*combinations), GFP_KERNEL);
|
||||
if (!combinations)
|
||||
return -ENOMEM;
|
||||
|
||||
n_limits = 2;
|
||||
if (p2p)
|
||||
n_limits = 3;
|
||||
else
|
||||
n_limits = 2;
|
||||
|
||||
limits = kcalloc(n_limits, sizeof(*limits), GFP_KERNEL);
|
||||
if (!limits) {
|
||||
@@ -9863,39 +9869,29 @@ static int ath11k_mac_setup_iface_combinations(struct ath11k *ar)
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
limits[0].types |= BIT(NL80211_IFTYPE_STATION);
|
||||
limits[1].types |= BIT(NL80211_IFTYPE_AP);
|
||||
if (IS_ENABLED(CONFIG_MAC80211_MESH) &&
|
||||
ab->hw_params.interface_modes & BIT(NL80211_IFTYPE_MESH_POINT))
|
||||
limits[1].types |= BIT(NL80211_IFTYPE_MESH_POINT);
|
||||
|
||||
combinations[0].limits = limits;
|
||||
combinations[0].n_limits = n_limits;
|
||||
combinations[0].beacon_int_infra_match = true;
|
||||
combinations[0].beacon_int_min_gcd = 100;
|
||||
|
||||
if (ab->hw_params.support_dual_stations) {
|
||||
limits[0].max = 2;
|
||||
limits[0].types |= BIT(NL80211_IFTYPE_STATION);
|
||||
|
||||
limits[1].max = 1;
|
||||
limits[1].types |= BIT(NL80211_IFTYPE_AP);
|
||||
if (IS_ENABLED(CONFIG_MAC80211_MESH) &&
|
||||
ab->hw_params.interface_modes & BIT(NL80211_IFTYPE_MESH_POINT))
|
||||
limits[1].types |= BIT(NL80211_IFTYPE_MESH_POINT);
|
||||
|
||||
combinations[0].limits = limits;
|
||||
combinations[0].n_limits = 2;
|
||||
combinations[0].max_interfaces = ab->hw_params.num_vdevs;
|
||||
combinations[0].num_different_channels = 2;
|
||||
combinations[0].beacon_int_infra_match = true;
|
||||
combinations[0].beacon_int_min_gcd = 100;
|
||||
} else {
|
||||
limits[0].max = 1;
|
||||
limits[0].types |= BIT(NL80211_IFTYPE_STATION);
|
||||
|
||||
limits[1].max = 16;
|
||||
limits[1].types |= BIT(NL80211_IFTYPE_AP);
|
||||
|
||||
if (IS_ENABLED(CONFIG_MAC80211_MESH) &&
|
||||
ab->hw_params.interface_modes & BIT(NL80211_IFTYPE_MESH_POINT))
|
||||
limits[1].types |= BIT(NL80211_IFTYPE_MESH_POINT);
|
||||
|
||||
combinations[0].limits = limits;
|
||||
combinations[0].n_limits = 2;
|
||||
combinations[0].max_interfaces = 16;
|
||||
combinations[0].num_different_channels = 1;
|
||||
combinations[0].beacon_int_infra_match = true;
|
||||
combinations[0].beacon_int_min_gcd = 100;
|
||||
combinations[0].radar_detect_widths = BIT(NL80211_CHAN_WIDTH_20_NOHT) |
|
||||
BIT(NL80211_CHAN_WIDTH_20) |
|
||||
BIT(NL80211_CHAN_WIDTH_40) |
|
||||
@@ -9904,6 +9900,13 @@ static int ath11k_mac_setup_iface_combinations(struct ath11k *ar)
|
||||
BIT(NL80211_CHAN_WIDTH_160);
|
||||
}
|
||||
|
||||
if (p2p) {
|
||||
limits[1].types |= BIT(NL80211_IFTYPE_P2P_CLIENT) |
|
||||
BIT(NL80211_IFTYPE_P2P_GO);
|
||||
limits[2].max = 1;
|
||||
limits[2].types |= BIT(NL80211_IFTYPE_P2P_DEVICE);
|
||||
}
|
||||
|
||||
ar->hw->wiphy->iface_combinations = combinations;
|
||||
ar->hw->wiphy->n_iface_combinations = 1;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user