From patchwork Sun Aug 26 20:55:05 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Quartulli X-Patchwork-Id: 1375831 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id E90EB3FD40 for ; Sun, 26 Aug 2012 20:55:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752598Ab2HZUz1 (ORCPT ); Sun, 26 Aug 2012 16:55:27 -0400 Received: from latitanza.investici.org ([82.94.249.234]:62240 "EHLO latitanza.investici.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752567Ab2HZUzZ (ORCPT ); Sun, 26 Aug 2012 16:55:25 -0400 Received: from [82.94.249.234] (latitanza [82.94.249.234]) (Authenticated sender: ordex@autistici.org) by localhost (Postfix) with ESMTPSA id 55231980BB; Sun, 26 Aug 2012 20:55:24 +0000 (UTC) X-DKIM: Sendmail DKIM Filter v2.8.2 latitanza.investici.org 55231980BB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=autistici.org; s=stigmate; t=1346014524; bh=51qGAQFgwk0zLhNSsWQ61+/6VqsOZHsvsQFVB+bvlLw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=Q9XImO1JjWyUTc76MC4rIhYjuRMACikGcmn3EpWCUlW1IWXmYCKYmutZdvwum5ftR 4OCZHTdPKi1kb5CGYeT/HC7zjzc/q7k7OAvqO3GQ9f7rxxU/F5d7oR1Fb7SK5XJmc0 Rxr6V1dfqKWNQcUw1whEm/22sqFJlYe4lyIDC17U= From: Antonio Quartulli To: "Luis R. Rodriguez" , Sujith Manoharan Cc: ath9k-devel@lists.ath9k.org, linux-wireless@vger.kernel.org, Antonio Quartulli Subject: [PATCHv2 2/2] ath9k_htc: advertise allowed VIFs combination Date: Sun, 26 Aug 2012 22:55:05 +0200 Message-Id: <1346014505-7554-2-git-send-email-ordex@autistici.org> X-Mailer: git-send-email 1.7.12 In-Reply-To: <1346014505-7554-1-git-send-email-ordex@autistici.org> References: <1346014505-7554-1-git-send-email-ordex@autistici.org> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org This driver now advertises its allowed VIFs combinations to the mac80211 sublayer. Other than that, practical tests shown that ath9k_htc devices allow an IBSS VIF to coexist with VIF set up on other modes. This patch removes the check which block the creation of any other VIF whenever an IBSS one is already present. Signed-off-by: Antonio Quartulli --- drivers/net/wireless/ath/ath9k/htc_drv_init.c | 30 +++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_init.c b/drivers/net/wireless/ath/ath9k/htc_drv_init.c index a035a38..6aa2af4 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c @@ -689,6 +689,33 @@ err_hw: return ret; } +/* it is possible to have at most ATH9K_HTC_MAX_BCN_VIF beaconing interfaces, + * therefore either we have 1 IBSS + ATH9K_HTC_MAX_BCN_VIF - 1 APs, or we have + * only ATH9K_HTC_MAX_BCN_VIF APs */ +static const struct ieee80211_iface_limit if_limits_ibss[] = { + { .max = ATH9K_HTC_MAX_VIF, .types = BIT(NL80211_IFTYPE_STATION) }, + { .max = ATH9K_HTC_MAX_BCN_VIF - 1, .types = BIT(NL80211_IFTYPE_AP) }, + { .max = 1, .types = BIT(NL80211_IFTYPE_ADHOC) }, +}; + +static const struct ieee80211_iface_limit if_limits_noibss[] = { + { .max = ATH9K_HTC_MAX_VIF, .types = BIT(NL80211_IFTYPE_STATION) }, + { .max = ATH9K_HTC_MAX_BCN_VIF, .types = BIT(NL80211_IFTYPE_AP) }, +}; + +static const struct ieee80211_iface_combination if_comb[] = { + { .limits = if_limits_ibss, + .n_limits = ARRAY_SIZE(if_limits_ibss), + .max_interfaces = ATH9K_HTC_MAX_VIF, + .num_different_channels = 1, + }, + { .limits = if_limits_noibss, + .n_limits = ARRAY_SIZE(if_limits_noibss), + .max_interfaces = ATH9K_HTC_MAX_VIF, + .num_different_channels = 1, + }, +}; + static void ath9k_set_hw_capab(struct ath9k_htc_priv *priv, struct ieee80211_hw *hw) { @@ -711,6 +738,9 @@ static void ath9k_set_hw_capab(struct ath9k_htc_priv *priv, BIT(NL80211_IFTYPE_P2P_GO) | BIT(NL80211_IFTYPE_P2P_CLIENT); + hw->wiphy->iface_combinations = if_comb; + hw->wiphy->n_iface_combinations = ARRAY_SIZE(if_comb); + hw->wiphy->flags &= ~WIPHY_FLAG_PS_ON_BY_DEFAULT; hw->wiphy->flags |= WIPHY_FLAG_IBSS_RSN |