diff mbox

[1/2] ath10k: remove P2P from supported interface modes for 10.X FW

Message ID 1382090878-22216-1-git-send-email-bartosz.markowski@tieto.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Bartosz Markowski Oct. 18, 2013, 10:07 a.m. UTC
FW 10.X does not support P2P, stop advertising it to mac80211.

Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
---
 drivers/net/wireless/ath/ath10k/mac.c |   44 +++++++++++++++++++++++++++------
 1 file changed, 37 insertions(+), 7 deletions(-)

Comments

Kalle Valo Oct. 21, 2013, 6:30 a.m. UTC | #1
Bartosz Markowski <bartosz.markowski@tieto.com> writes:

> FW 10.X does not support P2P, stop advertising it to mac80211.
>
> Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>

[...]

> @@ -3478,7 +3504,11 @@ int ath10k_mac_register(struct ath10k *ar)
>  	 */
>  	ar->hw->queues = 4;
>  
> -	ar->hw->wiphy->iface_combinations = &ath10k_if_comb;
> +	if (test_bit(ATH10K_FW_FEATURE_WMI_10X, ar->fw_features))
> +		ar->hw->wiphy->iface_combinations = &ath10k_10x_if_comb;
> +	else
> +		ar->hw->wiphy->iface_combinations = &ath10k_if_comb;

I think it would be better to have a separate feature flag for this,
like NO_P2P or something like that. Just in case we want to disable P2P
in other firmware branches.
Bartosz Markowski Oct. 21, 2013, 6:52 a.m. UTC | #2
On 21 October 2013 08:30, Kalle Valo <kvalo@qca.qualcomm.com> wrote:
> Bartosz Markowski <bartosz.markowski@tieto.com> writes:
>
>> FW 10.X does not support P2P, stop advertising it to mac80211.
>>
>> Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
>
> [...]
>
>> @@ -3478,7 +3504,11 @@ int ath10k_mac_register(struct ath10k *ar)
>>        */
>>       ar->hw->queues = 4;
>>
>> -     ar->hw->wiphy->iface_combinations = &ath10k_if_comb;
>> +     if (test_bit(ATH10K_FW_FEATURE_WMI_10X, ar->fw_features))
>> +             ar->hw->wiphy->iface_combinations = &ath10k_10x_if_comb;
>> +     else
>> +             ar->hw->wiphy->iface_combinations = &ath10k_if_comb;
>
> I think it would be better to have a separate feature flag for this,
> like NO_P2P or something like that. Just in case we want to disable P2P
> in other firmware branches.

Make sense. I will change this.
diff mbox

Patch

diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index 0b1cc51..af046c4 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -3249,6 +3249,17 @@  static const struct ieee80211_iface_limit ath10k_if_limits[] = {
 	},
 };
 
+static const struct ieee80211_iface_limit ath10k_10x_if_limits[] = {
+	{
+	.max	= 8,
+	.types	= BIT(NL80211_IFTYPE_STATION)
+	},
+	{
+	.max	= 7,
+	.types	= BIT(NL80211_IFTYPE_AP)
+	},
+};
+
 static const struct ieee80211_iface_combination ath10k_if_comb = {
 	.limits = ath10k_if_limits,
 	.n_limits = ARRAY_SIZE(ath10k_if_limits),
@@ -3257,6 +3268,14 @@  static const struct ieee80211_iface_combination ath10k_if_comb = {
 	.beacon_int_infra_match = true,
 };
 
+static const struct ieee80211_iface_combination ath10k_10x_if_comb = {
+	.limits = ath10k_10x_if_limits,
+	.n_limits = ARRAY_SIZE(ath10k_10x_if_limits),
+	.max_interfaces = 8,
+	.num_different_channels = 1,
+	.beacon_int_infra_match = true,
+};
+
 static struct ieee80211_sta_vht_cap ath10k_create_vht_cap(struct ath10k *ar)
 {
 	struct ieee80211_sta_vht_cap vht_cap = {0};
@@ -3430,12 +3449,19 @@  int ath10k_mac_register(struct ath10k *ar)
 		ar->hw->wiphy->bands[IEEE80211_BAND_5GHZ] = band;
 	}
 
-	ar->hw->wiphy->interface_modes =
-		BIT(NL80211_IFTYPE_STATION) |
-		BIT(NL80211_IFTYPE_ADHOC) |
-		BIT(NL80211_IFTYPE_AP) |
-		BIT(NL80211_IFTYPE_P2P_CLIENT) |
-		BIT(NL80211_IFTYPE_P2P_GO);
+	/* 10.x firmware does not support P2P */
+	if (test_bit(ATH10K_FW_FEATURE_WMI_10X, ar->fw_features))
+		ar->hw->wiphy->interface_modes =
+			BIT(NL80211_IFTYPE_STATION) |
+			BIT(NL80211_IFTYPE_ADHOC) |
+			BIT(NL80211_IFTYPE_AP);
+	else
+		ar->hw->wiphy->interface_modes =
+			BIT(NL80211_IFTYPE_STATION) |
+			BIT(NL80211_IFTYPE_ADHOC) |
+			BIT(NL80211_IFTYPE_AP) |
+			BIT(NL80211_IFTYPE_P2P_CLIENT) |
+			BIT(NL80211_IFTYPE_P2P_GO);
 
 	ar->hw->flags = IEEE80211_HW_SIGNAL_DBM |
 			IEEE80211_HW_SUPPORTS_PS |
@@ -3478,7 +3504,11 @@  int ath10k_mac_register(struct ath10k *ar)
 	 */
 	ar->hw->queues = 4;
 
-	ar->hw->wiphy->iface_combinations = &ath10k_if_comb;
+	if (test_bit(ATH10K_FW_FEATURE_WMI_10X, ar->fw_features))
+		ar->hw->wiphy->iface_combinations = &ath10k_10x_if_comb;
+	else
+		ar->hw->wiphy->iface_combinations = &ath10k_if_comb;
+
 	ar->hw->wiphy->n_iface_combinations = 1;
 
 	ar->hw->netdev_features = NETIF_F_HW_CSUM;