From patchwork Wed Dec 17 10:20:45 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalle Valo X-Patchwork-Id: 5506351 Return-Path: X-Original-To: patchwork-ath10k@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C6A9F9F4DC for ; Wed, 17 Dec 2014 10:21:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0AFA220A27 for ; Wed, 17 Dec 2014 10:21:22 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3B34520A25 for ; Wed, 17 Dec 2014 10:21:21 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Y1BjH-0000x4-5P; Wed, 17 Dec 2014 10:21:15 +0000 Received: from wolverine02.qualcomm.com ([199.106.114.251]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Y1BjE-0000so-HO for ath10k@lists.infradead.org; Wed, 17 Dec 2014 10:21:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qca.qualcomm.com; i=@qca.qualcomm.com; q=dns/txt; s=qcdkim; t=1418811672; x=1450347672; h=subject:to:from:cc:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=hrvDT5tkxCUj/dwz6RXn+ge8iYFuqooGvxhZ2Hnfszc=; b=jfSg2gGyTOxKtA4VXT9NGU8e34HPqG7v9+MoUkSUjZ1MBKj+3y8ucHor jpYcWQs7jGIBSP1w4oVn+qEE0W43IYVuCmtS1k0YJxck5ieY6xcEtWfRL CZMmFdQwJ25Hx+RWc44482ZEnro4UMuT+xq2p4+rVixIKdrF+yfu1kgRR Y=; X-IronPort-AV: E=McAfee;i="5600,1067,7654"; a="185717365" Received: from ironmsg06-lv.qualcomm.com ([10.47.202.185]) by wolverine02.qualcomm.com with ESMTP; 17 Dec 2014 02:20:49 -0800 X-IronPort-AV: E=Sophos;i="5.07,593,1413270000"; d="scan'208";a="16750580" Received: from nalasexr01g.na.qualcomm.com ([10.49.56.53]) by Ironmsg06-lv.qualcomm.com with ESMTP/TLS/RC4-SHA; 17 Dec 2014 02:20:49 -0800 Received: from potku.adurom.net (10.80.80.8) by NALASEXR01G.na.qualcomm.com (10.49.56.53) with Microsoft SMTP Server (TLS) id 15.0.913.22; Wed, 17 Dec 2014 02:20:48 -0800 Subject: [PATCH v2 1/8] ath10k: set max_num_vdevs based on wmi op version To: From: Kalle Valo Date: Wed, 17 Dec 2014 12:20:45 +0200 Message-ID: <20141217102044.15964.60991.stgit@potku.adurom.net> In-Reply-To: <20141217101755.15964.2625.stgit@potku.adurom.net> References: <20141217101755.15964.2625.stgit@potku.adurom.net> User-Agent: StGit/0.15 MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: NASANEXM01F.na.qualcomm.com (10.85.0.32) To NALASEXR01G.na.qualcomm.com (10.49.56.53) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141217_022112_660660_258DE2D2 X-CRM114-Status: UNSURE ( 9.75 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -5.1 (-----) Cc: linux-wireless@vger.kernel.org X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP To make it easier to manage firmware differences, we should not use ATH10K_FW_FEATURE_WMI_10X outside ath10k_core_init_firmware_features(). To achieve that create new field ar->max_num_vdevs and set it based on wmi op version. Signed-off-by: Kalle Valo --- drivers/net/wireless/ath/ath10k/core.c | 7 +++---- drivers/net/wireless/ath/ath10k/core.h | 1 + 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c index 577a3d76df22..f17366620fde 100644 --- a/drivers/net/wireless/ath/ath10k/core.c +++ b/drivers/net/wireless/ath/ath10k/core.c @@ -907,12 +907,14 @@ static int ath10k_core_init_firmware_features(struct ath10k *ar) case ATH10K_FW_WMI_OP_VERSION_MAIN: ar->max_num_peers = TARGET_NUM_PEERS; ar->max_num_stations = TARGET_NUM_STATIONS; + ar->max_num_vdevs = TARGET_NUM_VDEVS; ar->htt.max_num_pending_tx = TARGET_NUM_MSDU_DESC; break; case ATH10K_FW_WMI_OP_VERSION_10_1: case ATH10K_FW_WMI_OP_VERSION_10_2: ar->max_num_peers = TARGET_10X_NUM_PEERS; ar->max_num_stations = TARGET_10X_NUM_STATIONS; + ar->max_num_vdevs = TARGET_10X_NUM_VDEVS; ar->htt.max_num_pending_tx = TARGET_10X_NUM_MSDU_DESC; break; case ATH10K_FW_WMI_OP_VERSION_TLV: @@ -1064,10 +1066,7 @@ int ath10k_core_start(struct ath10k *ar, enum ath10k_firmware_mode mode) if (status) goto err_hif_stop; - if (test_bit(ATH10K_FW_FEATURE_WMI_10X, ar->fw_features)) - ar->free_vdev_map = (1LL << TARGET_10X_NUM_VDEVS) - 1; - else - ar->free_vdev_map = (1LL << TARGET_NUM_VDEVS) - 1; + ar->free_vdev_map = (1LL << ar->max_num_vdevs) - 1; INIT_LIST_HEAD(&ar->arvifs); diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h index 613355cc6895..3998f1e33874 100644 --- a/drivers/net/wireless/ath/ath10k/core.h +++ b/drivers/net/wireless/ath/ath10k/core.h @@ -581,6 +581,7 @@ struct ath10k { int max_num_peers; int max_num_stations; + int max_num_vdevs; struct work_struct offchan_tx_work; struct sk_buff_head offchan_tx_queue;