Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp352693ybv; Tue, 4 Feb 2020 23:09:41 -0800 (PST) X-Google-Smtp-Source: APXvYqypnmnl8rFprBbR4oOycYeKAgOJ6NvTY8sc4J2dUEmCU6GXgxMRqsyOq9US7gJTH/lxCqdq X-Received: by 2002:aca:6244:: with SMTP id w65mr1931305oib.113.1580886580984; Tue, 04 Feb 2020 23:09:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580886580; cv=none; d=google.com; s=arc-20160816; b=wLUnyPBQ2T0zO7ZNR/D9E+0ftj9G1iKSobfsdYinNocjt4b06N+5qzQ3X4RBu8XyOr ar8y35ORbkDSKY0cpwZASPlYL0Df800Sy60B7PJzXxpBsgf3tW5PZUsOJARatvVGGQcZ 0UPNdJ9j7AivyhKDSX7amFElDIlotgiE0B6yz3nd6qD4/WbsF+zhcR2p1KhB53pNpxyd 2nxjY5DheecTgANUO/UDVNLPmeWrCGU0h3+sJ0oZJWhIAa2bobhGPBOv/gqhrnTIuIhC NO/8FqK+cviB1TdGF0ob0oW3PoYd0HaH21vWonSIC4KDz7D6SoZdPGS3+EoAxc0oRnlI fvoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:authenticated-by; bh=jO5EYgzsVLMJyLeqTRmyLA9R3o0ThTRK5gEGlTtuF5Q=; b=miWZbncQYGEMFhEoAaP0oLfLAeWXbki2qeg4Y6G3OYVX7txdWZcgIDej2PU61sb4Ee 5NoKBAKvgr2Uu1Ejxdgl0Usf7HAGalYZPnQUZoFMmwJJENKc37gKxR1KgaJoifoos7B5 bCTqPOnKYgy7u8WloQRvwtaAYGKpggRUW7H8A0nBMP3ADOZWY7DuYIHMo6Kk3nSWR51U TmPUIuWWcbSIxZrGyKASkq69C99u/xPwAbZsgd4n6deY8Ce9PoHXxsvVCTvyDkQIl/Tr 4x9jQtF3HhpsSAmdq+SGGH4FJCd331+5Xzd2aybXLOteirX2Zue8r2V3BB3UO6bBF4nk 01Qw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k19si6097448otp.33.2020.02.04.23.09.17; Tue, 04 Feb 2020 23:09:40 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727892AbgBEHJL (ORCPT + 99 others); Wed, 5 Feb 2020 02:09:11 -0500 Received: from rtits2.realtek.com ([211.75.126.72]:49342 "EHLO rtits2.realtek.com.tw" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727504AbgBEHJL (ORCPT ); Wed, 5 Feb 2020 02:09:11 -0500 Authenticated-By: X-SpamFilter-By: BOX Solutions SpamTrap 5.62 with qID 015794EP008604, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (RTEXMB06.realtek.com.tw[172.21.6.99]) by rtits2.realtek.com.tw (8.15.2/2.57/5.78) with ESMTPS id 015794EP008604 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 5 Feb 2020 15:09:04 +0800 Received: from RTEXDAG01.realtek.com.tw (172.21.6.100) by RTEXMB06.realtek.com.tw (172.21.6.99) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1779.2; Wed, 5 Feb 2020 15:09:04 +0800 Received: from RTEXMB06.realtek.com.tw (172.21.6.99) by RTEXDAG01.realtek.com.tw (172.21.6.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1779.2; Wed, 5 Feb 2020 15:09:04 +0800 Received: from RTITCASV01.realtek.com.tw (172.21.6.18) by RTEXMB06.realtek.com.tw (172.21.6.99) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.1.1779.2 via Frontend Transport; Wed, 5 Feb 2020 15:09:04 +0800 Received: from localhost.localdomain (172.21.69.117) by RTITCASV01.realtek.com.tw (172.21.6.18) with Microsoft SMTP Server id 14.3.468.0; Wed, 5 Feb 2020 15:09:03 +0800 From: To: CC: , Subject: [PATCH 2/7] rtw88: add rtw_read8_mask and rtw_read16_mask Date: Wed, 5 Feb 2020 15:08:53 +0800 Message-ID: <20200205070858.15386-3-yhchuang@realtek.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200205070858.15386-1-yhchuang@realtek.com> References: <20200205070858.15386-1-yhchuang@realtek.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.21.69.117] Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Yan-Hsuan Chuang Both are missing but could be used sometimes. Signed-off-by: Yan-Hsuan Chuang --- drivers/net/wireless/realtek/rtw88/hci.h | 26 ++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/drivers/net/wireless/realtek/rtw88/hci.h b/drivers/net/wireless/realtek/rtw88/hci.h index 85a81a578fd5..cad56389182c 100644 --- a/drivers/net/wireless/realtek/rtw88/hci.h +++ b/drivers/net/wireless/realtek/rtw88/hci.h @@ -193,6 +193,32 @@ rtw_read32_mask(struct rtw_dev *rtwdev, u32 addr, u32 mask) return ret; } +static inline u16 +rtw_read16_mask(struct rtw_dev *rtwdev, u32 addr, u32 mask) +{ + u32 shift = __ffs(mask); + u32 orig; + u32 ret; + + orig = rtw_read16(rtwdev, addr); + ret = (orig & mask) >> shift; + + return ret; +} + +static inline u8 +rtw_read8_mask(struct rtw_dev *rtwdev, u32 addr, u32 mask) +{ + u32 shift = __ffs(mask); + u32 orig; + u32 ret; + + orig = rtw_read8(rtwdev, addr); + ret = (orig & mask) >> shift; + + return ret; +} + static inline void rtw_write32_mask(struct rtw_dev *rtwdev, u32 addr, u32 mask, u32 data) { -- 2.17.1