From patchwork Tue Jul 11 13:56:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manikanta Pubbisetty X-Patchwork-Id: 9834745 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7C1A7602A0 for ; Tue, 11 Jul 2017 13:57:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6AD3C2821F for ; Tue, 11 Jul 2017 13:57:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5FBDB28403; Tue, 11 Jul 2017 13:57:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 155282821F for ; Tue, 11 Jul 2017 13:57:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=mXUrsTryqYxim9EMJB/9F8Bh2tBA81rNltUeRDFbdJQ=; b=rBq4u6x0dMS5au 3kEyvCmWQJzOB4jcf5j5YRyGXuhFuqRZPkY7Rqy9ieEsaElPyBUNEYtWJnO/PPO9kGXhu7crE0Lo7 xbgmNYBrqqh6+6MqUeCub50Hyn4GgbrskHKxp6QPyaFGjS3tANvyZZhBZMN9mbjX87Vopv3HBIeHA r+g7AZqhfFds3MtbHoQ+gDWKSzX2JDzzBFrcbt54LslJT9jf1/vviNYSodznx3huF8XmKbVdVLEnY +BilEba7qa2xPNVohHYBtsIIf9PMfk4cDi6OlzUC1crUbQuwcIZL7XzKfn6br31tsCUel3g80EZpE RSXdNdjiqMhvHNMKSzig==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dUvfJ-0006hA-6S; Tue, 11 Jul 2017 13:57:25 +0000 Received: from alexa-out.qualcomm.com ([129.46.98.28] helo=alexa-out-lv-01.qualcomm.com) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dUvfG-0006br-EE for ath10k@lists.infradead.org; Tue, 11 Jul 2017 13:57:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qti.qualcomm.com; i=@qti.qualcomm.com; q=dns/txt; s=qcdkim; t=1499781442; x=1531317442; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=ZfeVp5nedoEkJShzU27Qi97gMY+M1ssD7XoFkyunJgk=; b=PeyycyscrymmW4Se4YDQB8l7WEx5Mp9yHz1WnWFU8egVDDIB7hcnXS4i dIbRWtAP4RX62LBq1GtrKo8WeSBQaL2yrmiRcnZBJtP//QDQYtL4UTjKR wyld+q/nasfJo8yP9826tJcLYunu+aEehGMeKGNSNwVOpHSCusXyKXR2Q k=; X-IronPort-AV: E=Sophos;i="5.40,346,1496127600"; d="scan'208";a="668976" Received: from ironmsg02-r-new.qualcomm.com (HELO ironmsg02-R.qualcomm.com) ([10.53.140.106]) by alexa-out-lv-01.qualcomm.com with ESMTP; 11 Jul 2017 06:57:04 -0700 X-IronPort-AV: E=McAfee;i="5800,7501,8587"; a="996543604" X-MGA-submission: =?us-ascii?q?MDFDfaDMpS8/FRUJe23YweB/2xwBy33n+/ggw2?= =?us-ascii?q?dNQWGcvkgrehUCZU9PMppOUNXYiT6QnNA+/X/LbCEoQlSRjQudWyxMlX?= =?us-ascii?q?JQNVqlNnANPVdX2X+lMKuZWbZNIUFgekL8AlZGCHg4aMYcqYYzcDEVnl?= =?us-ascii?q?iT?= Received: from nasanexm01c.na.qualcomm.com ([10.85.0.83]) by ironmsg02-R.qualcomm.com with ESMTP/TLS/RC4-SHA; 11 Jul 2017 06:57:03 -0700 Received: from aphydexm01f.ap.qualcomm.com (10.252.127.15) by NASANEXM01C.na.qualcomm.com (10.85.0.83) with Microsoft SMTP Server (TLS) id 15.0.1178.4; Tue, 11 Jul 2017 06:57:02 -0700 Received: from localhost (10.80.80.8) by aphydexm01f.ap.qualcomm.com (10.252.127.15) with Microsoft SMTP Server (TLS) id 15.0.1178.4; Tue, 11 Jul 2017 19:26:56 +0530 From: To: Subject: [PATCH 1/3] ath10k: extend wmi service map to accommodate new services Date: Tue, 11 Jul 2017 19:26:16 +0530 Message-ID: <1499781378-858-2-git-send-email-mpubbise@qti.qualcomm.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1499781378-858-1-git-send-email-mpubbise@qti.qualcomm.com> References: <1499781378-858-1-git-send-email-mpubbise@qti.qualcomm.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanexm01a.na.qualcomm.com (10.85.0.81) To aphydexm01f.ap.qualcomm.com (10.252.127.15) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170711_065722_556889_C1AA8146 X-CRM114-Status: UNSURE ( 8.38 ) X-CRM114-Notice: Please train this message. X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Manikanta Pubbisetty , linux-wireless@vger.kernel.org Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Manikanta Pubbisetty Though there is room to accommodate 512 services in wmi service ready event, target uses only first 4-bits of each 32-bit word for advertising wmi services thereby limiting max wmi services to 64. TDLS implementation for 10.4 firmwares introduces new wmi services by making use of remaining unused bits of each 32-bit word, therefore the wmi service mapping in host needs to be extended. This patch adds the logic to extend the wmi SVCMAP to accommodate new wmi services. Signed-off-by: Manikanta Pubbisetty --- drivers/net/wireless/ath/ath10k/wmi.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h index baa38c8..3a4cbbc 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.h +++ b/drivers/net/wireless/ath/ath10k/wmi.h @@ -420,9 +420,20 @@ static inline char *wmi_service_name(int service_id) __le32_to_cpu((wmi_svc_bmap)[(svc_id) / (sizeof(u32))]) & \ BIT((svc_id) % (sizeof(u32)))) +/* This extension is required to accommodate new services, current limit + * for wmi_services is 64 as target is using only 4-bits of each 32-bit + * wmi_service word. Extending this to make use of remaining unused bits + * for new services. + */ +#define WMI_EXT_SERVICE_IS_ENABLED(wmi_svc_bmap, svc_id, len) \ + ((svc_id) >= (len) && \ + __le32_to_cpu((wmi_svc_bmap)[((svc_id) - (len)) / 28]) & \ + BIT(((((svc_id) - (len)) % 28) & 0x1f) + 4)) + #define SVCMAP(x, y, len) \ do { \ - if (WMI_SERVICE_IS_ENABLED((in), (x), (len))) \ + if ((WMI_SERVICE_IS_ENABLED((in), (x), (len))) || \ + (WMI_EXT_SERVICE_IS_ENABLED((in), (x), (len)))) \ __set_bit(y, out); \ } while (0)