From patchwork Mon Dec 17 13:54:19 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Lamparter X-Patchwork-Id: 1905771 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 0E7BADFB79 for ; Sat, 22 Dec 2012 14:46:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751363Ab2LVOq3 (ORCPT ); Sat, 22 Dec 2012 09:46:29 -0500 Received: from mail-wi0-f172.google.com ([209.85.212.172]:55430 "EHLO mail-wi0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751144Ab2LVOq2 (ORCPT ); Sat, 22 Dec 2012 09:46:28 -0500 Received: by mail-wi0-f172.google.com with SMTP id o1so5626518wic.5 for ; Sat, 22 Dec 2012 06:46:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:in-reply-to:references:from:date:subject:to :cc; bh=2Zgf8Ct9rj5+SfjOPzqF5nxyh4VT0niqjbQiHtL0y4U=; b=hBhefmbN7/H+enZXcNVFnE7eJ3FwI7SymjmQf0Oq/82BF84Pev5gclGesoANZgZ8Q6 +9oOJjXdHhi9t873Ry8olwmic1n95nzo8iFpPHSNniwST+V6evg08vUXbvRr5aihli3V La1SbNrU9NTfIofq8xs/j36n5liAvZHn9QY4iw1afugP1VCKucrJyFw5PZ+RgFFgjLxp crT3XEf0ei998VnPKYDtSDETkTS5V2yVmS02Zx9h4zlpxnIxGf5ASqITDx9dEiEi5bGL KjXLeOCqeHhtASoKDF0G1PHV9LX2fX805T95LAzYwypw91MukRcV8IvhF77yQJn82qMi ZK+Q== X-Received: by 10.194.89.167 with SMTP id bp7mr28568800wjb.0.1356187587800; Sat, 22 Dec 2012 06:46:27 -0800 (PST) Received: from debian64.localnet (pD9F88B3A.dip.t-dialin.net. [217.248.139.58]) by mx.google.com with ESMTPS id i2sm34508049wiw.3.2012.12.22.06.46.26 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 22 Dec 2012 06:46:27 -0800 (PST) Received: from localhost ([127.0.0.1] helo=debian64.localnet ident=chuck) by debian64.localnet with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1TmQLA-0004Aa-SL; Sat, 22 Dec 2012 15:46:18 +0100 Message-Id: <77b183fe375c0cb455f4533f9cb69ef489476d40.1356186145.git.chunkeey@googlemail.com> In-Reply-To: <8f92b38a456c1dd901ce2022fcb66609a5b8ac4b.1356186145.git.chunkeey@googlemail.com> References: <8f92b38a456c1dd901ce2022fcb66609a5b8ac4b.1356186145.git.chunkeey@googlemail.com> From: Christian Lamparter Date: Mon, 17 Dec 2012 14:54:19 +0100 Subject: [PATCH 2/8] carl9170: Only specify interface combinations if more than one interface is possible To: linux-wireless@vger.kernel.org Cc: linville@tuxdriver.com Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Otherwise carl9170 triggers a warning in cfg80211, from net/wireless/core.c /* Combinations with just one interface aren't real */ if (WARN_ON(c->max_interfaces < 2)) Note: The number of supported interfaces is set by the carl9170 firmware. The default number of supported interfaces for all current firmwares is 2. Therefore this warning can only be observed with custom firmwares. Signed-off-by: Christian Lamparter --- drivers/net/wireless/ath/carl9170/fw.c | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/drivers/net/wireless/ath/carl9170/fw.c b/drivers/net/wireless/ath/carl9170/fw.c index 5a8a9f8..401a080 100644 --- a/drivers/net/wireless/ath/carl9170/fw.c +++ b/drivers/net/wireless/ath/carl9170/fw.c @@ -215,6 +215,24 @@ static int carl9170_fw_tx_sequence(struct ar9170 *ar) return 0; } +static void carl9170_fw_set_if_combinations(struct ar9170 *ar, + u16 if_comb_types) +{ + if (ar->fw.vif_num < 2) + return; + + ar->if_comb_limits[0].max = ar->fw.vif_num; + ar->if_comb_limits[0].types = if_comb_types; + + ar->if_combs[0].num_different_channels = 1; + ar->if_combs[0].max_interfaces = ar->fw.vif_num; + ar->if_combs[0].limits = ar->if_comb_limits; + ar->if_combs[0].n_limits = ARRAY_SIZE(ar->if_comb_limits); + + ar->hw->wiphy->iface_combinations = ar->if_combs; + ar->hw->wiphy->n_iface_combinations = ARRAY_SIZE(ar->if_combs); +} + static int carl9170_fw(struct ar9170 *ar, const __u8 *data, size_t len) { const struct carl9170fw_otus_desc *otus_desc; @@ -341,16 +359,7 @@ static int carl9170_fw(struct ar9170 *ar, const __u8 *data, size_t len) } } - ar->if_comb_limits[0].max = ar->fw.vif_num; - ar->if_comb_limits[0].types = if_comb_types; - - ar->if_combs[0].num_different_channels = 1; - ar->if_combs[0].max_interfaces = ar->fw.vif_num; - ar->if_combs[0].limits = ar->if_comb_limits; - ar->if_combs[0].n_limits = ARRAY_SIZE(ar->if_comb_limits); - - ar->hw->wiphy->iface_combinations = ar->if_combs; - ar->hw->wiphy->n_iface_combinations = ARRAY_SIZE(ar->if_combs); + carl9170_fw_set_if_combinations(ar, if_comb_types); ar->hw->wiphy->interface_modes |= if_comb_types;