From patchwork Tue Jun 18 04:41:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasanthakumar Thiagarajan X-Patchwork-Id: 11000881 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 44C61924 for ; Tue, 18 Jun 2019 04:41:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 34B9D289FF for ; Tue, 18 Jun 2019 04:41:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 292D328A01; Tue, 18 Jun 2019 04:41:46 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 C2A94289FF for ; Tue, 18 Jun 2019 04:41:45 +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:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=O0m5TR6Tff4k9CnpnMbJvj28UZZEVFht7BcnTan44XY=; b=a/JY5MUQR/1R/d LEuacSdyW35atBEtlPrTN29qcsB3Bql+IiKkHBZZCfTtckHKTVsGqmhjZn7aZ5nhsXEfp1GpGZyvi ukcocqrUxyRvhexR3thgHdM1ea82ON3WxjQklIoYMlpxcLZBrA1Yaayt6PuSD9PuGcbw+EEqE1/Cx yUTTbFWtoRWex2eSotX2umJ0pkiqNhZTjDxHY+lGbj/SRmCYvPaPKHjTfQPmwyhD9bfYyU7VMilN9 wj7KtKHL18/3QEVsXd6Hy1aNG2T43oZxkCLZ+1fl7K/icydjuJ4DIC9DnM+W9AI3r0yZeNYrv08y8 la3INpzuLTezvqiSI/rw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hd5wG-0007C2-R2; Tue, 18 Jun 2019 04:41:44 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hd5wD-0007Ad-Qa for ath11k@lists.infradead.org; Tue, 18 Jun 2019 04:41:43 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 8FFA46074C; Tue, 18 Jun 2019 04:41:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1560832901; bh=kiv2mKPLQ7Pbdab5MQfPtEAVtWfsSwou4ejQnCyWIF4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=mOz9UWgcn+90shvLwaBPZdnacU7FhW6DPp2ZiTPnYzoDOf53zBKj3uEvtd0AWN6p5 VZaUJ3sjyJKIIS85GIDSSNlQ49onxPHWbD8W0jk/lq1qoiiKa7SLmvIXmW1N57qIf/ WStxDXblmwWdRTzNzby6D1oY28JkCjl8Fl9+S3yY= Received: from vasanth-lnx.qca.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: vthiagar@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id BB34D602FE for ; Tue, 18 Jun 2019 04:41:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1560832901; bh=kiv2mKPLQ7Pbdab5MQfPtEAVtWfsSwou4ejQnCyWIF4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=mOz9UWgcn+90shvLwaBPZdnacU7FhW6DPp2ZiTPnYzoDOf53zBKj3uEvtd0AWN6p5 VZaUJ3sjyJKIIS85GIDSSNlQ49onxPHWbD8W0jk/lq1qoiiKa7SLmvIXmW1N57qIf/ WStxDXblmwWdRTzNzby6D1oY28JkCjl8Fl9+S3yY= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org BB34D602FE Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=vthiagar@codeaurora.org From: Vasanthakumar Thiagarajan To: ath11k@lists.infradead.org Subject: [PATCH 3/5] ath11k{dp, hal}: Endian macro related clean ups Date: Tue, 18 Jun 2019 10:11:27 +0530 Message-Id: <1560832889-14129-3-git-send-email-vthiagar@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1560832889-14129-1-git-send-email-vthiagar@codeaurora.org> References: <1560832889-14129-1-git-send-email-vthiagar@codeaurora.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190617_214141_890700_F250E836 X-CRM114-Status: UNSURE ( 9.61 ) X-CRM114-Notice: Please train this message. X-BeenThere: ath11k@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "ath11k" Errors-To: ath11k-bounces+patchwork-ath11k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Replace ifdef __BIG_ENDIAN with IS_ENABLED(CONFIG_CPU_BIG_ENDIAN). Replace swapXX() with swabXX(). Also does a renaming of dp_peer_map_get_mac_addr. Signed-off-by: Vasanthakumar Thiagarajan --- drivers/net/wireless/ath/ath11k/dp.h | 11 +++++------ drivers/net/wireless/ath/ath11k/dp_rx.c | 4 ++-- drivers/net/wireless/ath/ath11k/hal.c | 8 +++----- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/drivers/net/wireless/ath/ath11k/dp.h b/drivers/net/wireless/ath/ath11k/dp.h index 037fcbd..f7acd65 100644 --- a/drivers/net/wireless/ath/ath11k/dp.h +++ b/drivers/net/wireless/ath/ath11k/dp.h @@ -1483,13 +1483,12 @@ struct htt_mac_addr { u32 mac_addr_h16; }; -static inline void dp_peer_map_get_mac_addr(u32 addr_l32, u16 addr_h16, - u8 *addr) +static inline void ath11k_dp_get_mac_addr(u32 addr_l32, u16 addr_h16, u8 *addr) { -#ifdef __BIG_ENDIAN - addr_l32 = swap32(addr_l32); - addr_h16 = swap16(addr_h16); -#endif + if (IS_ENABLED(CONFIG_CPU_BIG_ENDIAN)) { + addr_l32 = swab32(addr_l32); + addr_h16 = swab16(addr_h16); + } memcpy(addr, &addr_l32, 4); memcpy(addr + 4, &addr_h16, ETH_ALEN - 4); } diff --git a/drivers/net/wireless/ath/ath11k/dp_rx.c b/drivers/net/wireless/ath/ath11k/dp_rx.c index 9e5bd81..5c47cfc 100644 --- a/drivers/net/wireless/ath/ath11k/dp_rx.c +++ b/drivers/net/wireless/ath/ath11k/dp_rx.c @@ -1386,8 +1386,8 @@ void ath11k_dp_htt_htc_t2h_msg_handler(struct ath11k_base *ab, resp->peer_map_ev.info); peer_mac_h16 = FIELD_GET(HTT_T2H_PEER_MAP_INFO1_MAC_ADDR_H16, resp->peer_map_ev.info1); - dp_peer_map_get_mac_addr(resp->peer_map_ev.mac_addr_l32, - peer_mac_h16, mac_addr); + ath11k_dp_get_mac_addr(resp->peer_map_ev.mac_addr_l32, + peer_mac_h16, mac_addr); ast_hash = FIELD_GET(HTT_T2H_PEER_MAP_INFO2_AST_HASH_VAL, resp->peer_map_ev.info1); ath11k_peer_map_event(ab, vdev_id, peer_id, mac_addr, ast_hash); diff --git a/drivers/net/wireless/ath/ath11k/hal.c b/drivers/net/wireless/ath/ath11k/hal.c index 3fe8f81..b7b9b9c 100644 --- a/drivers/net/wireless/ath/ath11k/hal.c +++ b/drivers/net/wireless/ath/ath11k/hal.c @@ -1032,11 +1032,9 @@ int ath11k_hal_srng_setup(struct ath11k_base *sc, enum hal_ring_type type, (srng->entry_size * srng->num_entries) << 2); /* TODO: Add comments on these swap configurations */ -#ifdef __BIG_ENDIAN - srng->flags |= HAL_SRNG_FLAGS_MSI_SWAP | - HAL_SRNG_FLAGS_DATA_TLV_SWAP | - HAL_SRNG_FLAGS_RING_PTR_SWAP; -#endif + if (IS_ENABLED(CONFIG_CPU_BIG_ENDIAN)) + srng->flags |= HAL_SRNG_FLAGS_MSI_SWAP | HAL_SRNG_FLAGS_DATA_TLV_SWAP | + HAL_SRNG_FLAGS_RING_PTR_SWAP; reg_base = srng->hwreg_base[HAL_SRNG_REG_GRP_R2];