diff mbox series

[v2] ath10k: Enable support for beacon interval per VAP

Message ID 1550579046-22649-1-git-send-email-dundi@codeaurora.org (mailing list archive)
State New, archived
Headers show
Series [v2] ath10k: Enable support for beacon interval per VAP | expand

Commit Message

Dundi Raviteja Feb. 19, 2019, 12:24 p.m. UTC
Enable support to configure different beacon interval per VAP.

To support this feature, map different beacon interval service bit
to wmi tlv service.

Tested HW: WCN3990
Tested FW: WLAN.HL.2.0-01188-QCAHLSWMTPLZ-1

Signed-off-by: Dundi Raviteja <dundi@codeaurora.org>
---
This change is dependent on the below patchset
ath10k: Add support for ack rssi value of management tx packets (https://patchwork.kernel.org/patch/10809631/)
---
 drivers/net/wireless/ath/ath10k/mac.c     | 33 +++++++++++++++++++++++++++++++
 drivers/net/wireless/ath/ath10k/wmi-tlv.h |  3 +++
 2 files changed, 36 insertions(+)

Comments

Kalle Valo Sept. 25, 2019, 5:13 a.m. UTC | #1
Dundi Raviteja <dundi@codeaurora.org> writes:

> Enable support to configure different beacon interval per VAP.
>
> To support this feature, map different beacon interval service bit
> to wmi tlv service.
>
> Tested HW: WCN3990
> Tested FW: WLAN.HL.2.0-01188-QCAHLSWMTPLZ-1
>
> Signed-off-by: Dundi Raviteja <dundi@codeaurora.org>

[...]

> --- a/drivers/net/wireless/ath/ath10k/mac.c
> +++ b/drivers/net/wireless/ath/ath10k/mac.c
> @@ -8232,6 +8232,30 @@ void ath10k_mac_destroy(struct ath10k *ar)
>  	},
>  };
>  
> +static struct
> +ieee80211_iface_combination ath10k_tlv_qcs_bcn_int_if_comb[] = {
> +	{
> +		.limits = ath10k_tlv_if_limit,
> +		.num_different_channels = 1,
> +		.max_interfaces = 4,
> +		.beacon_int_infra_match = true,
> +		.beacon_int_min_gcd = 1,
> +		.n_limits = ARRAY_SIZE(ath10k_tlv_if_limit),
> +	},
> +	{
> +		.limits = ath10k_tlv_qcs_if_limit,
> +		.num_different_channels = 2,
> +		.max_interfaces = 4,
> +		.n_limits = ARRAY_SIZE(ath10k_tlv_qcs_if_limit),
> +	},
> +	{
> +		.limits = ath10k_tlv_if_limit_ibss,
> +		.num_different_channels = 1,
> +		.max_interfaces = 2,
> +		.n_limits = ARRAY_SIZE(ath10k_tlv_if_limit_ibss),
> +	},
> +};
> +
>  static const struct ieee80211_iface_limit ath10k_10_4_if_limits[] = {
>  	{
>  		.max = 1,
> @@ -8642,6 +8666,15 @@ int ath10k_mac_register(struct ath10k *ar)
>  				ath10k_tlv_qcs_if_comb;
>  			ar->hw->wiphy->n_iface_combinations =
>  				ARRAY_SIZE(ath10k_tlv_qcs_if_comb);
> +
> +			if (test_bit
> +			    (WMI_SERVICE_VDEV_DIFFERENT_BEACON_INTERVAL_SUPPORT,
> +			    ar->wmi.svc_map)) {
> +				ar->hw->wiphy->iface_combinations =
> +						ath10k_tlv_qcs_bcn_int_if_comb;
> +				ar->hw->wiphy->n_iface_combinations =
> +				     ARRAY_SIZE(ath10k_tlv_qcs_bcn_int_if_comb);
> +			}

I don't like using WMI service flags to advertise different interface
combinations, it makes ath10k code convoluted. A much better approach is
to use WMI_SERVICE_IFACE_COMBINATION_SUPPORT:

ath10k:New interface to get interface combinations from FW

https://patchwork.kernel.org/patch/11027361/
diff mbox series

Patch

diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index e49b367..09c4705 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -8232,6 +8232,30 @@  void ath10k_mac_destroy(struct ath10k *ar)
 	},
 };
 
+static struct
+ieee80211_iface_combination ath10k_tlv_qcs_bcn_int_if_comb[] = {
+	{
+		.limits = ath10k_tlv_if_limit,
+		.num_different_channels = 1,
+		.max_interfaces = 4,
+		.beacon_int_infra_match = true,
+		.beacon_int_min_gcd = 1,
+		.n_limits = ARRAY_SIZE(ath10k_tlv_if_limit),
+	},
+	{
+		.limits = ath10k_tlv_qcs_if_limit,
+		.num_different_channels = 2,
+		.max_interfaces = 4,
+		.n_limits = ARRAY_SIZE(ath10k_tlv_qcs_if_limit),
+	},
+	{
+		.limits = ath10k_tlv_if_limit_ibss,
+		.num_different_channels = 1,
+		.max_interfaces = 2,
+		.n_limits = ARRAY_SIZE(ath10k_tlv_if_limit_ibss),
+	},
+};
+
 static const struct ieee80211_iface_limit ath10k_10_4_if_limits[] = {
 	{
 		.max = 1,
@@ -8642,6 +8666,15 @@  int ath10k_mac_register(struct ath10k *ar)
 				ath10k_tlv_qcs_if_comb;
 			ar->hw->wiphy->n_iface_combinations =
 				ARRAY_SIZE(ath10k_tlv_qcs_if_comb);
+
+			if (test_bit
+			    (WMI_SERVICE_VDEV_DIFFERENT_BEACON_INTERVAL_SUPPORT,
+			    ar->wmi.svc_map)) {
+				ar->hw->wiphy->iface_combinations =
+						ath10k_tlv_qcs_bcn_int_if_comb;
+				ar->hw->wiphy->n_iface_combinations =
+				     ARRAY_SIZE(ath10k_tlv_qcs_bcn_int_if_comb);
+			}
 		} else {
 			ar->hw->wiphy->iface_combinations = ath10k_tlv_if_comb;
 			ar->hw->wiphy->n_iface_combinations =
diff --git a/drivers/net/wireless/ath/ath10k/wmi-tlv.h b/drivers/net/wireless/ath/ath10k/wmi-tlv.h
index e07e990..9f78502 100644
--- a/drivers/net/wireless/ath/ath10k/wmi-tlv.h
+++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.h
@@ -1567,6 +1567,9 @@  enum wmi_tlv_service {
 	SVCMAP(WMI_TLV_SERVICE_THERM_THROT,
 	       WMI_SERVICE_THERM_THROT,
 	       WMI_TLV_MAX_SERVICE);
+	SVCMAP(WMI_TLV_SERVICE_VDEV_DIFFERENT_BEACON_INTERVAL_SUPPORT,
+	       WMI_SERVICE_VDEV_DIFFERENT_BEACON_INTERVAL_SUPPORT,
+	       WMI_TLV_MAX_SERVICE);
 }
 
 #undef SVCMAP