Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2863313rwd; Mon, 22 May 2023 05:35:57 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7Smzkh4zlxmcyaB20FhvMRAz7XVkWzBhxY4AO2rzQolUaEm3H83+jWwnpXc+SA/AprD9XK X-Received: by 2002:a17:902:d345:b0:1a2:6257:36b9 with SMTP id l5-20020a170902d34500b001a2625736b9mr11343183plk.31.1684758957212; Mon, 22 May 2023 05:35:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684758957; cv=none; d=google.com; s=arc-20160816; b=rh3cW+0eqzx0JT1q3eTN6A5NMoA8dHv7GxQBOx18mFPM+opXvSmKEUtX6VkNU7GHgY a9u4UEfT4wABPjCU+hRhAIGCUKDJjCXvna9BiXJZ1hDskKZ0t3Ix2Vu2pOd+FPKGRU8i VPLkoxjAICwJJ1g8j05Ln+mLsfgbk8syrG1I5WjsTMowmrUP5GioZIMr/QUnCCIZkQP+ RyOcGxj+m4ic1qOh0sayaco4eHPGn8NcoidPmQCdK9EbulQbZRSh3rBOiycZUxe2uVRy w02xwKVzdTj9ioHXZEfZyqCtAGVYx7h7LIradHDLGateMgTFtUoLJ8uppVmCkid9iR89 cSyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:authenticated-by; bh=KQlwOYXckJmgHw8u2PIrjDKG4SyCtD2NOM/uThPhdDs=; b=E6BquqdWsydv+i1HvJOq2BqcGLmNSvsddAondhre4L1ai7IDtqW7N34rPWYH6Ktwpp hu8Um4zpLQUy0yyndRlBIGCpjR9NiwdoLmO+eEcgYjsnU/vCsynLJmKp4ZWUuc5MVx9O oJy2qCRrsZsAW7sLQlGzgT/gW/6iKGYFFFMz7b15/ljnIzD9Z8NOyJTG/g+1o41T+ajP l43fvuvJjnNd5WtdH5jxn1VzZvnHHaJmus6PsfWLu1+Gh51unZpl+z9201YU5OdBm3wl 8v9bieFCWUDyik+D/T1bN6sdFbynspI3uW9A1h3rA4cK/MzY0o7rOfnYJypyj972ZpC4 AyzA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c6-20020a170902d48600b001ab29e16b3asi3144243plg.286.2023.05.22.05.35.46; Mon, 22 May 2023 05:35:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234057AbjEVM3r (ORCPT + 63 others); Mon, 22 May 2023 08:29:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234059AbjEVM1r (ORCPT ); Mon, 22 May 2023 08:27:47 -0400 Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 134D7192 for ; Mon, 22 May 2023 05:25:48 -0700 (PDT) Authenticated-By: X-SpamFilter-By: ArmorX SpamTrap 5.77 with qID 34MCPUQD0030914, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (rtexh36506.realtek.com.tw[172.21.6.27]) by rtits2.realtek.com.tw (8.15.2/2.81/5.90) with ESMTPS id 34MCPUQD0030914 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=OK); Mon, 22 May 2023 20:25:30 +0800 Received: from RTEXMBS04.realtek.com.tw (172.21.6.97) by RTEXH36506.realtek.com.tw (172.21.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.17; Mon, 22 May 2023 20:25:41 +0800 Received: from [127.0.1.1] (172.16.17.50) by RTEXMBS04.realtek.com.tw (172.21.6.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.7; Mon, 22 May 2023 20:25:40 +0800 From: Ping-Ke Shih To: CC: Subject: [PATCH 0/5] wifi: rtw89: use struct to access register-based H2C/C2H and RX related info Date: Mon, 22 May 2023 20:25:08 +0800 Message-ID: <20230522122513.13559-1-pkshih@realtek.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [172.16.17.50] X-ClientProxiedBy: RTEXMBS02.realtek.com.tw (172.21.6.95) To RTEXMBS04.realtek.com.tw (172.21.6.97) X-KSE-ServerInfo: RTEXMBS04.realtek.com.tw, 9 X-KSE-AntiSpam-Interceptor-Info: fallback X-KSE-Antivirus-Interceptor-Info: fallback X-KSE-AntiSpam-Interceptor-Info: fallback X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Originally, access these fields by macros that needs casting and add an offset, so it could hide some mistakes. Refine these macros by accessing fields via struct. Ping-Ke Shih (5): wifi: rtw89: add chip_ops::query_rxdesc() and rxd_len as helpers to support newer chips wifi: rtw89: use struct and le32_get_bits to access RX info wifi: rtw89: use struct and le32_get_bits() to access received PHY status IEs wifi: rtw89: use struct and le32_get_bits() to access RX descriptor wifi: rtw89: use struct to access register-based H2C/C2H drivers/net/wireless/realtek/rtw89/core.c | 114 +++++++------ drivers/net/wireless/realtek/rtw89/core.h | 16 +- drivers/net/wireless/realtek/rtw89/fw.c | 18 +- drivers/net/wireless/realtek/rtw89/fw.h | 102 ++++++------ drivers/net/wireless/realtek/rtw89/mac.c | 23 +-- drivers/net/wireless/realtek/rtw89/pci.c | 12 +- drivers/net/wireless/realtek/rtw89/rtw8851b.c | 1 + drivers/net/wireless/realtek/rtw89/rtw8852a.c | 1 + drivers/net/wireless/realtek/rtw89/rtw8852b.c | 1 + drivers/net/wireless/realtek/rtw89/rtw8852c.c | 1 + drivers/net/wireless/realtek/rtw89/txrx.h | 157 +++++------------- 11 files changed, 210 insertions(+), 236 deletions(-) -- 2.25.1