From patchwork Fri Sep 18 07:58:35 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalle Valo X-Patchwork-Id: 7213681 Return-Path: X-Original-To: patchwork-ath10k@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id BADACBEEC1 for ; Fri, 18 Sep 2015 07:59:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E1254207C1 for ; Fri, 18 Sep 2015 07:59:09 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 08D2D207AD for ; Fri, 18 Sep 2015 07:59:09 +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 1ZcqZU-0002SI-IQ; Fri, 18 Sep 2015 07:59:04 +0000 Received: from sabertooth01.qualcomm.com ([65.197.215.72]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZcqZT-00028T-5u for ath10k@lists.infradead.org; Fri, 18 Sep 2015 07:59:04 +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=1442563143; x=1474099143; h=subject:to:from:cc:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Hlgz786nkJHde9uOzmNmaCeIRjj725uAe1YpI9vceh4=; b=GYYnoBBZJz4G1pHoLfxFp5meCoYvijFgrgPPWkM1CwEagib5RFf0Im/N 5SnHWTQECRDJjfMTHZxY1QKan/7czVcVjm5ZAcKrx6Bb6/U7XEjALyf8C f8tDDBlsWoEqkSCBWE+lk4MMGxL3dteSt4uZRd9CxFvhOrYwkZqwmc5Ok A=; X-IronPort-AV: E=McAfee;i="5700,7163,7927"; a="96896199" Received: from unknown (HELO ironmsg04-lv.qualcomm.com) ([10.47.202.184]) by sabertooth01.qualcomm.com with ESMTP; 18 Sep 2015 00:58:42 -0700 X-IronPort-AV: E=Sophos;i="5.17,551,1437462000"; d="scan'208";a="27585454" Received: from nalasexr01g.na.qualcomm.com ([10.49.56.53]) by ironmsg04-lv.qualcomm.com with ESMTP/TLS/RC4-SHA; 18 Sep 2015 00:58:42 -0700 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.1076.9; Fri, 18 Sep 2015 00:58:40 -0700 Subject: [PATCH 1/2] ath10k: add a_sle32_to_cpu() To: From: Kalle Valo Date: Fri, 18 Sep 2015 10:58:35 +0300 Message-ID: <20150918075835.6983.66350.stgit@potku.adurom.net> In-Reply-To: <20150918075706.6983.11216.stgit@potku.adurom.net> References: <20150918075706.6983.11216.stgit@potku.adurom.net> User-Agent: StGit/0.15 MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: NASANEXM01C.na.qualcomm.com (10.85.0.83) 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-20150918_005903_662589_8055B043 X-CRM114-Status: UNSURE ( 7.16 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -7.0 (-------) X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-wireless@vger.kernel.org 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 Copy a_sle32_to_cpu() from ath6kl so that we can easily handle signed __le32 values. This is needed in struct wmi_pdev_tpc_config_event. Signed-off-by: Kalle Valo --- drivers/net/wireless/ath/ath10k/wmi.h | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h index 3e5a1591f772..95fdc723a996 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.h +++ b/drivers/net/wireless/ath/ath10k/wmi.h @@ -73,6 +73,25 @@ struct wmi_cmd_hdr { #define HTC_PROTOCOL_VERSION 0x0002 #define WMI_PROTOCOL_VERSION 0x0002 +/* + * There is no signed version of __le32, so for a temporary solution come + * up with our own version. The idea is from fs/ntfs/types.h. + * + * Use a_ prefix so that it doesn't conflict if we get proper support to + * linux/types.h. + */ +typedef __s32 __bitwise a_sle32; + +static inline a_sle32 a_cpu_to_sle32(s32 val) +{ + return (__force a_sle32) cpu_to_le32(val); +} + +static inline s32 a_sle32_to_cpu(a_sle32 val) +{ + return le32_to_cpu((__force __le32) val); +} + enum wmi_service { WMI_SERVICE_BEACON_OFFLOAD = 0, WMI_SERVICE_SCAN_OFFLOAD, @@ -3657,7 +3676,7 @@ struct wmi_pdev_tpc_config_event { __le32 phy_mode; __le32 twice_antenna_reduction; __le32 twice_max_rd_power; - s32 twice_antenna_gain; + a_sle32 twice_antenna_gain; __le32 power_limit; __le32 rate_max; __le32 num_tx_chain;