From patchwork Mon Dec 15 05:11:10 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajkumar Manoharan X-Patchwork-Id: 5490331 Return-Path: X-Original-To: patchwork-linux-wireless@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 1C6A69F326 for ; Mon, 15 Dec 2014 05:12:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 28DB2209D7 for ; Mon, 15 Dec 2014 05:12:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1F74F209D5 for ; Mon, 15 Dec 2014 05:12:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750821AbaLOFMm (ORCPT ); Mon, 15 Dec 2014 00:12:42 -0500 Received: from sabertooth01.qualcomm.com ([65.197.215.72]:10749 "EHLO sabertooth01.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750756AbaLOFMm (ORCPT ); Mon, 15 Dec 2014 00:12:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qti.qualcomm.com; i=@qti.qualcomm.com; q=dns/txt; s=qcdkim; t=1418620361; x=1450156361; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=6nTgVFPQgy80UjqJZLoPKEv9wBYC/AD5pBKIZPN20cY=; b=M+xEGx+6f0IkpPqlm6uRvf4znVbZHEhNrfho8A0078cxS0HcpgEjgB98 I6cUJwxlRC5/M4FVy5iG1PdhlFkENFTTRNc4aC1drWfFNC2t32yG6iXHk cnDnePonBh6qz3aymiPzJfEU3wBgMcd0UhkOmy7l63XawOYtjCQbe6BRK M=; X-IronPort-AV: E=McAfee;i="5600,1067,7652"; a="80059257" Received: from unknown (HELO Ironmsg04-L.qualcomm.com) ([172.30.48.19]) by sabertooth01.qualcomm.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 14 Dec 2014 21:12:41 -0800 X-IronPort-AV: E=Sophos;i="5.07,578,1413270000"; d="scan'208";a="771553776" Received: from nasanexm02h.na.qualcomm.com ([129.46.53.248]) by Ironmsg04-L.qualcomm.com with ESMTP/TLS/RC4-SHA; 14 Dec 2014 21:12:41 -0800 Received: from aphydexm01b.ap.qualcomm.com (10.222.112.203) by nasanexm02h.na.qualcomm.com (129.46.53.248) with Microsoft SMTP Server (TLS) id 15.0.913.22; Sun, 14 Dec 2014 21:12:40 -0800 Received: from qcmail1.qualcomm.com (10.80.80.8) by aphydexm01b.ap.qualcomm.com (10.222.112.203) with Microsoft SMTP Server (TLS) id 15.0.913.22; Sun, 14 Dec 2014 21:12:15 -0800 Received: by qcmail1.qualcomm.com (sSMTP sendmail emulation); Mon, 15 Dec 2014 10:41:44 +0530 From: Rajkumar Manoharan To: CC: , Rajkumar Manoharan Subject: [PATCH 1/5] ath10k: add 10.2.4 firmware support Date: Mon, 15 Dec 2014 10:41:10 +0530 Message-ID: <1418620274-3081-2-git-send-email-rmanohar@qti.qualcomm.com> X-Mailer: git-send-email 2.1.3 In-Reply-To: <1418620274-3081-1-git-send-email-rmanohar@qti.qualcomm.com> References: <1418620274-3081-1-git-send-email-rmanohar@qti.qualcomm.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: NASANEXM01B.na.qualcomm.com (10.85.0.82) To aphydexm01b.ap.qualcomm.com (10.222.112.203) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,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 10.2.4 firmware uses bitmask in wmi_resource_config to configure 10.2 firmware features like airtime fairness and rx batch mode instead of maintaining separete bool entry. This allows new features that can be configure during init time without breaking backward compatibility. Signed-off-by: Rajkumar Manoharan --- drivers/net/wireless/ath/ath10k/core.c | 8 +++++++- drivers/net/wireless/ath/ath10k/core.h | 5 +++++ drivers/net/wireless/ath/ath10k/hw.h | 1 + drivers/net/wireless/ath/ath10k/wmi.c | 1 + drivers/net/wireless/ath/ath10k/wmi.h | 7 ++++++- 5 files changed, 20 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c index 577a3d7..c05841e 100644 --- a/drivers/net/wireless/ath/ath10k/core.c +++ b/drivers/net/wireless/ath/ath10k/core.c @@ -894,7 +894,12 @@ static int ath10k_core_init_firmware_features(struct ath10k *ar) */ if (ar->wmi.op_version == ATH10K_FW_WMI_OP_VERSION_UNSET) { if (test_bit(ATH10K_FW_FEATURE_WMI_10X, ar->fw_features)) { - if (test_bit(ATH10K_FW_FEATURE_WMI_10_2, ar->fw_features)) + if (test_bit(ATH10K_FW_FEATURE_WMI_10_2_4, + ar->fw_features)) + ar->wmi.op_version = + ATH10K_FW_WMI_OP_VERSION_10_2_4; + else if (test_bit(ATH10K_FW_FEATURE_WMI_10_2, + ar->fw_features)) ar->wmi.op_version = ATH10K_FW_WMI_OP_VERSION_10_2; else ar->wmi.op_version = ATH10K_FW_WMI_OP_VERSION_10_1; @@ -911,6 +916,7 @@ static int ath10k_core_init_firmware_features(struct ath10k *ar) break; case ATH10K_FW_WMI_OP_VERSION_10_1: case ATH10K_FW_WMI_OP_VERSION_10_2: + case ATH10K_FW_WMI_OP_VERSION_10_2_4: ar->max_num_peers = TARGET_10X_NUM_PEERS; ar->max_num_stations = TARGET_10X_NUM_STATIONS; ar->htt.max_num_pending_tx = TARGET_10X_NUM_MSDU_DESC; diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h index 613355c..8083b91 100644 --- a/drivers/net/wireless/ath/ath10k/core.h +++ b/drivers/net/wireless/ath/ath10k/core.h @@ -387,6 +387,11 @@ enum ath10k_fw_features { */ ATH10K_FW_FEATURE_WMI_10_2 = 4, + /* Firmware 10.2.4 supports bitmask in resource config to configure + * Airtime fairness and rx batch mode + */ + ATH10K_FW_FEATURE_WMI_10_2_4 = 5, + /* keep last */ ATH10K_FW_FEATURE_COUNT, }; diff --git a/drivers/net/wireless/ath/ath10k/hw.h b/drivers/net/wireless/ath/ath10k/hw.h index 809c252..892b6f0 100644 --- a/drivers/net/wireless/ath/ath10k/hw.h +++ b/drivers/net/wireless/ath/ath10k/hw.h @@ -72,6 +72,7 @@ enum ath10k_fw_wmi_op_version { ATH10K_FW_WMI_OP_VERSION_10_1 = 2, ATH10K_FW_WMI_OP_VERSION_10_2 = 3, ATH10K_FW_WMI_OP_VERSION_TLV = 4, + ATH10K_FW_WMI_OP_VERSION_10_2_4 = 5, /* keep last */ ATH10K_FW_WMI_OP_VERSION_MAX, diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c index fa486f6..c42382c 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.c +++ b/drivers/net/wireless/ath/ath10k/wmi.c @@ -4748,6 +4748,7 @@ static const struct wmi_ops wmi_10_2_ops = { int ath10k_wmi_attach(struct ath10k *ar) { switch (ar->wmi.op_version) { + case ATH10K_FW_WMI_OP_VERSION_10_2_4: case ATH10K_FW_WMI_OP_VERSION_10_2: ar->wmi.cmd = &wmi_10_2_cmd_map; ar->wmi.ops = &wmi_10_2_ops; diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h index 97f902f..ce517bf 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.h +++ b/drivers/net/wireless/ath/ath10k/wmi.h @@ -1940,6 +1940,11 @@ struct wmi_resource_config_10x { __le32 max_frag_entries; } __packed; +enum wmi_10_2_feature_mask { + WMI_10_2_RX_BATCH_MODE = BIT(0), + WMI_10_2_ATF_CONFIG = BIT(1), +}; + struct wmi_resource_config_10_2 { struct wmi_resource_config_10x common; __le32 max_peer_ext_stats; @@ -1948,7 +1953,7 @@ struct wmi_resource_config_10_2 { __le32 be_min_free; __le32 vi_min_free; __le32 vo_min_free; - __le32 rx_batchmode; /* 0-disable, 1-enable */ + __le32 feature_mask; } __packed; #define NUM_UNITS_IS_NUM_VDEVS 0x1