From patchwork Sun Sep 1 15:47:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Larry Finger X-Patchwork-Id: 11125339 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7788916B1 for ; Sun, 1 Sep 2019 15:47:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 43C5D233A2 for ; Sun, 1 Sep 2019 15:47:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="dSgVRLz8" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729157AbfIAPrM (ORCPT ); Sun, 1 Sep 2019 11:47:12 -0400 Received: from mail-ot1-f65.google.com ([209.85.210.65]:34284 "EHLO mail-ot1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728621AbfIAPrM (ORCPT ); Sun, 1 Sep 2019 11:47:12 -0400 Received: by mail-ot1-f65.google.com with SMTP id c7so11485898otp.1 for ; Sun, 01 Sep 2019 08:47:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=5o350+aR3TZqQCsSzTSyCAFIUXU4nabJdh7kMaYN2aE=; b=dSgVRLz8q90y/U4Xe6CTOU5KFTWTLSwsrKobwPO149n6l9ZWERPlcqRCQaQSoxQAmQ Bif0OgvjNxeDMQ9IyxjfqzKC2YeXbtz+col0LMz6gBMd51hl1f8rHZ4APyvm/ZYHlnRM 8HclczZThMPfM+s2can/YFUVDXKfTu8cHcGINAB2Gp6FnAKEvIrsGg3eJCPZDUkLl61b FRvNES+GrX71T1Fp9Rz++4AECnke9g/KbMHounT4kA4LAujzpgEc/I/xHs3JpeKp0mvg eHRg4KQwG8C0PIG33scBVwxMx7k7f4qS/o7uctxAXBRFfjs/2EbUddajvjm76vX9aXjT i9Rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=5o350+aR3TZqQCsSzTSyCAFIUXU4nabJdh7kMaYN2aE=; b=nd3Jvs02eEQMrEqKoKnlTNrUB7eB9xaTQzBY4Zkfj0qLn2zLjlDmOZB6c4000jdCw8 btRwZMXfKoVxni4cKRXu1HqmhpFS7DOhWINxGzaSVE/nZcVHaSfRpsmMkwPWAJLFSTLh raxmnZAHdBqJim/pZRB4AC5Pp+ft3qG7eINAmxQ6Mvm6f0L/+5/cvCLwNrma2M+o9YYh KLz8tC7l8FLxO9Sh26uAvI8BA6ZhBgNAShbILlCTw7fqJJyRyjzpqOvSnfIjMCEztGts 3XHj2FwARVFaaI2pFa7kYvik8iQjjC/Tczi1UVbb6zzgv7eIHaBmghOrZgAtMIOWlHoV u8xw== X-Gm-Message-State: APjAAAWQZC66VocHoVsWTAsZdeqPy9OvJZeLep7vDSkl7dJpLUu1h6yO sg5weM190y/IWWdBmC0s+TwUONg/ X-Google-Smtp-Source: APXvYqy2rKXpcrOMB4dnaN5RLRGPgw7+zojLZDhDKtxZNYTI8hHRb+EegEOXKWN+IAG95yM9+4n/Lg== X-Received: by 2002:a05:6830:1f04:: with SMTP id u4mr11876485otg.340.1567352830782; Sun, 01 Sep 2019 08:47:10 -0700 (PDT) Received: from localhost.localdomain (cpe-24-31-245-230.kc.res.rr.com. [24.31.245.230]) by smtp.gmail.com with ESMTPSA id b19sm3186440oie.34.2019.09.01.08.47.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 01 Sep 2019 08:47:10 -0700 (PDT) From: Larry Finger To: kvalo@codeaurora.org Cc: linux-wireless@vger.kernel.org, pkshih@realtek.com, Larry Finger Subject: [PATCH 1/4] rtlwifi: rtl8192cu: Remove unused GET_XXX and SET_XXX Date: Sun, 1 Sep 2019 10:47:03 -0500 Message-Id: <20190901154706.24193-2-Larry.Finger@lwfinger.net> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20190901154706.24193-1-Larry.Finger@lwfinger.net> References: <20190901154706.24193-1-Larry.Finger@lwfinger.net> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org As the first step in converting from macros that get/set information in the RX and TX descriptors, unused macros are being removed. Signed-off-by: Larry Finger --- .../net/wireless/realtek/rtlwifi/rtl8192cu/trx.h | 150 +-------------------- 1 file changed, 3 insertions(+), 147 deletions(-) diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.h b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.h index ae2e8aa212de..15627a7d42f5 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.h +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.h @@ -81,92 +81,28 @@ struct rx_drv_info_92c { LE_BITS_TO_4BYTE(__rxdesc, 15, 1) #define GET_RX_DESC_DRVINFO_SIZE(__rxdesc) \ LE_BITS_TO_4BYTE(__rxdesc, 16, 4) -#define GET_RX_DESC_SECURITY(__rxdesc) \ - LE_BITS_TO_4BYTE(__rxdesc, 20, 3) -#define GET_RX_DESC_QOS(__rxdesc) \ - LE_BITS_TO_4BYTE(__rxdesc, 23, 1) #define GET_RX_DESC_SHIFT(__rxdesc) \ LE_BITS_TO_4BYTE(__rxdesc, 24, 2) #define GET_RX_DESC_PHY_STATUS(__rxdesc) \ LE_BITS_TO_4BYTE(__rxdesc, 26, 1) #define GET_RX_DESC_SWDEC(__rxdesc) \ LE_BITS_TO_4BYTE(__rxdesc, 27, 1) -#define GET_RX_DESC_LAST_SEG(__rxdesc) \ - LE_BITS_TO_4BYTE(__rxdesc, 28, 1) -#define GET_RX_DESC_FIRST_SEG(__rxdesc) \ - LE_BITS_TO_4BYTE(__rxdesc, 29, 1) -#define GET_RX_DESC_EOR(__rxdesc) \ - LE_BITS_TO_4BYTE(__rxdesc, 30, 1) -#define GET_RX_DESC_OWN(__rxdesc) \ - LE_BITS_TO_4BYTE(__rxdesc, 31, 1) /* DWORD 1 */ -#define GET_RX_DESC_MACID(__rxdesc) \ - LE_BITS_TO_4BYTE(__rxdesc + 4, 0, 5) -#define GET_RX_DESC_TID(__rxdesc) \ - LE_BITS_TO_4BYTE(__rxdesc + 4, 5, 4) #define GET_RX_DESC_PAGGR(__rxdesc) \ LE_BITS_TO_4BYTE(__rxdesc + 4, 14, 1) #define GET_RX_DESC_FAGGR(__rxdesc) \ LE_BITS_TO_4BYTE(__rxdesc + 4, 15, 1) -#define GET_RX_DESC_A1_FIT(__rxdesc) \ - LE_BITS_TO_4BYTE(__rxdesc + 4, 16, 4) -#define GET_RX_DESC_A2_FIT(__rxdesc) \ - LE_BITS_TO_4BYTE(__rxdesc + 4, 20, 4) -#define GET_RX_DESC_PAM(__rxdesc) \ - LE_BITS_TO_4BYTE(__rxdesc + 4, 24, 1) -#define GET_RX_DESC_PWR(__rxdesc) \ - LE_BITS_TO_4BYTE(__rxdesc + 4, 25, 1) -#define GET_RX_DESC_MORE_DATA(__rxdesc) \ - LE_BITS_TO_4BYTE(__rxdesc + 4, 26, 1) -#define GET_RX_DESC_MORE_FRAG(__rxdesc) \ - LE_BITS_TO_4BYTE(__rxdesc + 4, 27, 1) -#define GET_RX_DESC_TYPE(__rxdesc) \ - LE_BITS_TO_4BYTE(__rxdesc + 4, 28, 2) -#define GET_RX_DESC_MC(__rxdesc) \ - LE_BITS_TO_4BYTE(__rxdesc + 4, 30, 1) -#define GET_RX_DESC_BC(__rxdesc) \ - LE_BITS_TO_4BYTE(__rxdesc + 4, 31, 1) - -/* DWORD 2 */ -#define GET_RX_DESC_SEQ(__rxdesc) \ - LE_BITS_TO_4BYTE(__rxdesc + 8, 0, 12) -#define GET_RX_DESC_FRAG(__rxdesc) \ - LE_BITS_TO_4BYTE(__rxdesc + 8, 12, 4) -#define GET_RX_DESC_USB_AGG_PKTNUM(__rxdesc) \ - LE_BITS_TO_4BYTE(__rxdesc + 8, 16, 8) -#define GET_RX_DESC_NEXT_IND(__rxdesc) \ - LE_BITS_TO_4BYTE(__rxdesc + 8, 30, 1) /* DWORD 3 */ #define GET_RX_DESC_RX_MCS(__rxdesc) \ LE_BITS_TO_4BYTE(__rxdesc + 12, 0, 6) -#define GET_RX_DESC_RX_HT(__rxdesc) \ +#define GET_RX_DESC_RX_HT(__rxdesc) \ LE_BITS_TO_4BYTE(__rxdesc + 12, 6, 1) -#define GET_RX_DESC_AMSDU(__rxdesc) \ - LE_BITS_TO_4BYTE(__rxdesc + 12, 7, 1) -#define GET_RX_DESC_SPLCP(__rxdesc) \ +#define GET_RX_DESC_SPLCP(__rxdesc) \ LE_BITS_TO_4BYTE(__rxdesc + 12, 8, 1) -#define GET_RX_DESC_BW(__rxdesc) \ +#define GET_RX_DESC_BW(__rxdesc) \ LE_BITS_TO_4BYTE(__rxdesc + 12, 9, 1) -#define GET_RX_DESC_HTC(__rxdesc) \ - LE_BITS_TO_4BYTE(__rxdesc + 12, 10, 1) -#define GET_RX_DESC_TCP_CHK_RPT(__rxdesc) \ - LE_BITS_TO_4BYTE(__rxdesc + 12, 11, 1) -#define GET_RX_DESC_IP_CHK_RPT(__rxdesc) \ - LE_BITS_TO_4BYTE(__rxdesc + 12, 12, 1) -#define GET_RX_DESC_TCP_CHK_VALID(__rxdesc) \ - LE_BITS_TO_4BYTE(__rxdesc + 12, 13, 1) -#define GET_RX_DESC_HWPC_ERR(__rxdesc) \ - LE_BITS_TO_4BYTE(__rxdesc + 12, 14, 1) -#define GET_RX_DESC_HWPC_IND(__rxdesc) \ - LE_BITS_TO_4BYTE(__rxdesc + 12, 15, 1) -#define GET_RX_DESC_IV0(__rxdesc) \ - LE_BITS_TO_4BYTE(__rxdesc + 12, 16, 16) - -/* DWORD 4 */ -#define GET_RX_DESC_IV1(__rxdesc) \ - LE_BITS_TO_4BYTE(__rxdesc + 16, 0, 32) /* DWORD 5 */ #define GET_RX_DESC_TSFL(__rxdesc) \ @@ -191,10 +127,6 @@ struct rx_drv_info_92c { SET_BITS_TO_LE_4BYTE(__txdesc, 27, 1, __value) #define SET_TX_DESC_LINIP(__txdesc, __value) \ SET_BITS_TO_LE_4BYTE(__txdesc, 28, 1, __value) -#define SET_TX_DESC_NO_ACM(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc, 29, 1, __value) -#define SET_TX_DESC_GF(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc, 30, 1, __value) #define SET_TX_DESC_OWN(__txdesc, __value) \ SET_BITS_TO_LE_4BYTE(__txdesc, 31, 1, __value) @@ -209,56 +141,22 @@ struct rx_drv_info_92c { SET_BITS_TO_LE_4BYTE(__txdesc + 4, 7, 1, __value) #define SET_TX_DESC_QUEUE_SEL(__txdesc, __value) \ SET_BITS_TO_LE_4BYTE(__txdesc + 4, 8, 5, __value) -#define SET_TX_DESC_RDG_NAV_EXT(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc + 4, 13, 1, __value) -#define SET_TX_DESC_LSIG_TXOP_EN(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc + 4, 14, 1, __value) -#define SET_TX_DESC_PIFS(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc + 4, 15, 1, __value) #define SET_TX_DESC_RATE_ID(__txdesc, __value) \ SET_BITS_TO_LE_4BYTE(__txdesc + 4, 16, 4, __value) -#define SET_TX_DESC_RA_BRSR_ID(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc + 4, 16, 4, __value) #define SET_TX_DESC_NAV_USE_HDR(__txdesc, __value) \ SET_BITS_TO_LE_4BYTE(__txdesc + 4, 20, 1, __value) -#define SET_TX_DESC_EN_DESC_ID(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc + 4, 21, 1, __value) #define SET_TX_DESC_SEC_TYPE(__txdesc, __value) \ SET_BITS_TO_LE_4BYTE(__txdesc + 4, 22, 2, __value) #define SET_TX_DESC_PKT_OFFSET(__txdesc, __value) \ SET_BITS_TO_LE_4BYTE(__txdesc + 4, 26, 5, __value) /* Dword 2 */ -#define SET_TX_DESC_RTS_RC(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc + 8, 0, 6, __value) -#define SET_TX_DESC_DATA_RC(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc + 8, 6, 6, __value) -#define SET_TX_DESC_BAR_RTY_TH(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc + 8, 14, 2, __value) #define SET_TX_DESC_MORE_FRAG(__txdesc, __value) \ SET_BITS_TO_LE_4BYTE(__txdesc + 8, 17, 1, __value) -#define SET_TX_DESC_RAW(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc + 8, 18, 1, __value) -#define SET_TX_DESC_CCX(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc + 8, 19, 1, __value) #define SET_TX_DESC_AMPDU_DENSITY(__txdesc, __value) \ SET_BITS_TO_LE_4BYTE(__txdesc + 8, 20, 3, __value) -#define SET_TX_DESC_ANTSEL_A(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc + 8, 24, 1, __value) -#define SET_TX_DESC_ANTSEL_B(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc + 8, 25, 1, __value) -#define SET_TX_DESC_TX_ANT_CCK(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc + 8, 26, 2, __value) -#define SET_TX_DESC_TX_ANTL(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc + 8, 28, 2, __value) -#define SET_TX_DESC_TX_ANT_HT(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc + 8, 30, 2, __value) /* Dword 3 */ -#define SET_TX_DESC_NEXT_HEAP_PAGE(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc + 12, 0, 8, __value) -#define SET_TX_DESC_TAIL_PAGE(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc + 12, 8, 8, __value) #define SET_TX_DESC_SEQ(__txdesc, __value) \ SET_BITS_TO_LE_4BYTE(__txdesc + 12, 16, 12, __value) #define SET_TX_DESC_PKT_ID(__txdesc, __value) \ @@ -267,16 +165,12 @@ struct rx_drv_info_92c { /* Dword 4 */ #define SET_TX_DESC_RTS_RATE(__txdesc, __value) \ SET_BITS_TO_LE_4BYTE(__txdesc + 16, 0, 5, __value) -#define SET_TX_DESC_AP_DCFE(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc + 16, 5, 1, __value) #define SET_TX_DESC_QOS(__txdesc, __value) \ SET_BITS_TO_LE_4BYTE(__txdesc + 16, 6, 1, __value) #define SET_TX_DESC_HWSEQ_EN(__txdesc, __value) \ SET_BITS_TO_LE_4BYTE(__txdesc + 16, 7, 1, __value) #define SET_TX_DESC_USE_RATE(__txdesc, __value) \ SET_BITS_TO_LE_4BYTE(__txdesc + 16, 8, 1, __value) -#define SET_TX_DESC_DISABLE_RTS_FB(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc + 16, 9, 1, __value) #define SET_TX_DESC_DISABLE_FB(__txdesc, __value) \ SET_BITS_TO_LE_4BYTE(__txdesc + 16, 10, 1, __value) #define SET_TX_DESC_CTS2SELF(__txdesc, __value) \ @@ -285,16 +179,8 @@ struct rx_drv_info_92c { SET_BITS_TO_LE_4BYTE(__txdesc + 16, 12, 1, __value) #define SET_TX_DESC_HW_RTS_ENABLE(__txdesc, __value) \ SET_BITS_TO_LE_4BYTE(__txdesc + 16, 13, 1, __value) -#define SET_TX_DESC_WAIT_DCTS(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc + 16, 18, 1, __value) -#define SET_TX_DESC_CTS2AP_EN(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc + 16, 19, 1, __value) #define SET_TX_DESC_DATA_SC(__txdesc, __value) \ SET_BITS_TO_LE_4BYTE(__txdesc + 16, 20, 2, __value) -#define SET_TX_DESC_DATA_STBC(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc + 16, 22, 2, __value) -#define SET_TX_DESC_DATA_SHORT(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc + 16, 24, 1, __value) #define SET_TX_DESC_DATA_BW(__txdesc, __value) \ SET_BITS_TO_LE_4BYTE(__txdesc + 16, 25, 1, __value) #define SET_TX_DESC_RTS_SHORT(__txdesc, __value) \ @@ -311,48 +197,18 @@ struct rx_drv_info_92c { SET_BITS_TO_LE_4BYTE(__pdesc + 20, 0, 6, __val) #define SET_TX_DESC_DATA_SHORTGI(__pdesc, __val) \ SET_BITS_TO_LE_4BYTE(__pdesc + 20, 6, 1, __val) -#define SET_TX_DESC_CCX_TAG(__pdesc, __val) \ - SET_BITS_TO_LE_4BYTE(__pdesc + 20, 7, 1, __val) #define SET_TX_DESC_DATA_RATE_FB_LIMIT(__txdesc, __value) \ SET_BITS_TO_LE_4BYTE(__txdesc + 20, 8, 5, __value) #define SET_TX_DESC_RTS_RATE_FB_LIMIT(__txdesc, __value) \ SET_BITS_TO_LE_4BYTE(__txdesc + 20, 13, 4, __value) -#define SET_TX_DESC_RETRY_LIMIT_ENABLE(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc + 20, 17, 1, __value) -#define SET_TX_DESC_DATA_RETRY_LIMIT(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc + 20, 18, 6, __value) -#define SET_TX_DESC_USB_TXAGG_NUM(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc + 20, 24, 8, __value) /* Dword 6 */ -#define SET_TX_DESC_TXAGC_A(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc + 24, 0, 5, __value) -#define SET_TX_DESC_TXAGC_B(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc + 24, 5, 5, __value) -#define SET_TX_DESC_USB_MAX_LEN(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc + 24, 10, 1, __value) #define SET_TX_DESC_MAX_AGG_NUM(__txdesc, __value) \ SET_BITS_TO_LE_4BYTE(__txdesc + 24, 11, 5, __value) -#define SET_TX_DESC_MCSG1_MAX_LEN(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc + 24, 16, 4, __value) -#define SET_TX_DESC_MCSG2_MAX_LEN(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc + 24, 20, 4, __value) -#define SET_TX_DESC_MCSG3_MAX_LEN(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc + 24, 24, 4, __value) -#define SET_TX_DESC_MCSG7_MAX_LEN(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc + 24, 28, 4, __value) /* Dword 7 */ #define SET_TX_DESC_TX_DESC_CHECKSUM(__txdesc, __value) \ SET_BITS_TO_LE_4BYTE(__txdesc + 28, 0, 16, __value) -#define SET_TX_DESC_MCSG4_MAX_LEN(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc + 28, 16, 4, __value) -#define SET_TX_DESC_MCSG5_MAX_LEN(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc + 28, 20, 4, __value) -#define SET_TX_DESC_MCSG6_MAX_LEN(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc + 28, 24, 4, __value) -#define SET_TX_DESC_MCSG15_MAX_LEN(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc + 28, 28, 4, __value) int rtl8192cu_endpoint_mapping(struct ieee80211_hw *hw); u16 rtl8192cu_mq_to_hwq(__le16 fc, u16 mac80211_queue_index); From patchwork Sun Sep 1 15:47:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Larry Finger X-Patchwork-Id: 11125341 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AC5941890 for ; Sun, 1 Sep 2019 15:47:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8A97C233A2 for ; Sun, 1 Sep 2019 15:47:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hAxIhGQL" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729158AbfIAPrN (ORCPT ); Sun, 1 Sep 2019 11:47:13 -0400 Received: from mail-ot1-f66.google.com ([209.85.210.66]:44564 "EHLO mail-ot1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729152AbfIAPrM (ORCPT ); Sun, 1 Sep 2019 11:47:12 -0400 Received: by mail-ot1-f66.google.com with SMTP id 21so4007280otj.11 for ; Sun, 01 Sep 2019 08:47:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=MYf2hfMtg0Kfi690obi/FqMgBzF13cavN2XEHAgilEg=; b=hAxIhGQLlKBhXrv4fCo1x1YZEVgethjsPW6hu+tMON0/ZM2gCRqqdxVXZBRxIe4lnh J1S0Jdxhc2uFbUN3DgITJmn7iVt7JoHa3K98UqckHvz3CgDyMgTwopavyjn/EilNoqMI qwtXjm5pWpA2uMI2VxGE3Jxr3bW/uXzhmKvcixAwhnztX6FFCQrxLlCBl1sL4yD0Agam MVKc6xtUx6xR2tpEuKKzVGaaatW0e3ZnJunWzsPUMmA1W/kgI6NCWz9D4ZAqV96iv+9X pXvinaWH4e1YO/DbBbfeYdwig9NiRX8s7u7BWWww54T4cGxo7TqosXtrYbO+IMs9VJTE HVbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=MYf2hfMtg0Kfi690obi/FqMgBzF13cavN2XEHAgilEg=; b=bwhHW5FaL9wzBV/lxlD7KfMYFqLTvIBOXT7+VxUZtqQPu38pQGRbEF5ojerV9ixGXB B3bbdkxT99pjm3t4wpoOaOkp2xkkvs986iQ6o0AKEk3FCm7C9Z+g+xjOU1pNX66UQdZn xQtHGFNcHXydBHPrbhQGuWM0MLzRvF4qpXhGET/E/pYvOXUSrqPEz3Q4omV7UBUwX4f+ eWDxTFHVMc9vkG011E8xEOPCoY7GaPN3aKAxDSdni7mlW+u1951XtVQNJKIoJEqORZz0 xtQYTg7GO8LHk+2wxqAwSXO3PB7GgwX9fD7gEmVBUTNLDyS2ANyG/kOUU5n3EjMFZWfS 4ZPQ== X-Gm-Message-State: APjAAAW0lt4FlSExLlzWJy1lQBYUrBBvXl+BgBlNGdeq+/7WmMvUstYU El/mL7UHFNRZatKUb3mRfH0= X-Google-Smtp-Source: APXvYqxoJInA+J6cm74ExUTulxr/lQGiIjWeHdl+JNjA55QhMabcpnZzYxkb7+yq0sqmJ5zVvdmOvQ== X-Received: by 2002:a05:6830:1018:: with SMTP id a24mr6990794otp.191.1567352831442; Sun, 01 Sep 2019 08:47:11 -0700 (PDT) Received: from localhost.localdomain (cpe-24-31-245-230.kc.res.rr.com. [24.31.245.230]) by smtp.gmail.com with ESMTPSA id b19sm3186440oie.34.2019.09.01.08.47.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 01 Sep 2019 08:47:11 -0700 (PDT) From: Larry Finger To: kvalo@codeaurora.org Cc: linux-wireless@vger.kernel.org, pkshih@realtek.com, Larry Finger Subject: [PATCH 2/4] rtlwifi: rtl8192cu: Replace local bit manipulation macros Date: Sun, 1 Sep 2019 10:47:04 -0500 Message-Id: <20190901154706.24193-3-Larry.Finger@lwfinger.net> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20190901154706.24193-1-Larry.Finger@lwfinger.net> References: <20190901154706.24193-1-Larry.Finger@lwfinger.net> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org This driver uses a set of local macros to manipulate the TX and RX descriptors, which are all little-endian quantities. These macros are replaced by the bitfield macros le32p_replace_bits() and le32_get_bits(). In several places, the macros operated on an entire 32-bit word. In these cases, a direct read or replacement is used. Signed-off-by: Larry Finger --- .../net/wireless/realtek/rtlwifi/rtl8192cu/trx.h | 110 ++++++++++----------- 1 file changed, 55 insertions(+), 55 deletions(-) diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.h b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.h index 15627a7d42f5..916fa0e98123 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.h +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.h @@ -74,39 +74,39 @@ struct rx_drv_info_92c { /* DWORD 0 */ #define GET_RX_DESC_PKT_LEN(__rxdesc) \ - LE_BITS_TO_4BYTE((__rxdesc), 0, 14) + le32_get_bits(*(__le32 *)__rxdesc, GENMASK(13, 0)) #define GET_RX_DESC_CRC32(__rxdesc) \ - LE_BITS_TO_4BYTE(__rxdesc, 14, 1) + le32_get_bits(*(__le32 *)__rxdesc, BIT(14)) #define GET_RX_DESC_ICV(__rxdesc) \ - LE_BITS_TO_4BYTE(__rxdesc, 15, 1) + le32_get_bits(*(__le32 *)__rxdesc, BIT(15)) #define GET_RX_DESC_DRVINFO_SIZE(__rxdesc) \ - LE_BITS_TO_4BYTE(__rxdesc, 16, 4) + le32_get_bits(*(__le32 *)__rxdesc, GENMASK(19, 16)) #define GET_RX_DESC_SHIFT(__rxdesc) \ - LE_BITS_TO_4BYTE(__rxdesc, 24, 2) + le32_get_bits(*(__le32 *)__rxdesc, GENMASK(25, 24)) #define GET_RX_DESC_PHY_STATUS(__rxdesc) \ - LE_BITS_TO_4BYTE(__rxdesc, 26, 1) + le32_get_bits(*(__le32 *)__rxdesc, BIT(26)) #define GET_RX_DESC_SWDEC(__rxdesc) \ - LE_BITS_TO_4BYTE(__rxdesc, 27, 1) + le32_get_bits(*(__le32 *)__rxdesc, BIT(27)) /* DWORD 1 */ #define GET_RX_DESC_PAGGR(__rxdesc) \ - LE_BITS_TO_4BYTE(__rxdesc + 4, 14, 1) + le32_get_bits(*(__le32 *)(__rxdesc + 4), BIT(14)) #define GET_RX_DESC_FAGGR(__rxdesc) \ - LE_BITS_TO_4BYTE(__rxdesc + 4, 15, 1) + le32_get_bits(*(__le32 *)(__rxdesc + 4), BIT(15)) /* DWORD 3 */ #define GET_RX_DESC_RX_MCS(__rxdesc) \ - LE_BITS_TO_4BYTE(__rxdesc + 12, 0, 6) + le32_get_bits(*(__le32 *)(__rxdesc + 12), GENMASK(5, 0)) #define GET_RX_DESC_RX_HT(__rxdesc) \ - LE_BITS_TO_4BYTE(__rxdesc + 12, 6, 1) + le32_get_bits(*(__le32 *)(__rxdesc + 12), BIT(6)) #define GET_RX_DESC_SPLCP(__rxdesc) \ - LE_BITS_TO_4BYTE(__rxdesc + 12, 8, 1) + le32_get_bits(*(__le32 *)(__rxdesc + 12), BIT(8)) #define GET_RX_DESC_BW(__rxdesc) \ - LE_BITS_TO_4BYTE(__rxdesc + 12, 9, 1) + le32_get_bits(*(__le32 *)(__rxdesc + 12), BIT(9)) /* DWORD 5 */ #define GET_RX_DESC_TSFL(__rxdesc) \ - LE_BITS_TO_4BYTE(__rxdesc + 20, 0, 32) + le32_to_cpu(*((__le32 *)(__rxdesc + 20))) /*======================= tx desc ============================================*/ @@ -114,101 +114,101 @@ struct rx_drv_info_92c { /* Dword 0 */ #define SET_TX_DESC_PKT_SIZE(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc, 0, 16, __value) + le32p_replace_bits((__le32 *)__txdesc, __value, GENMASK(15, 0)) #define SET_TX_DESC_OFFSET(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc, 16, 8, __value) + le32p_replace_bits((__le32 *)__txdesc, __value, GENMASK(23, 16)) #define SET_TX_DESC_BMC(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc, 24, 1, __value) + le32p_replace_bits((__le32 *)__txdesc, __value, BIT(24)) #define SET_TX_DESC_HTC(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc, 25, 1, __value) + le32p_replace_bits((__le32 *)__txdesc, __value, BIT(25)) #define SET_TX_DESC_LAST_SEG(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc, 26, 1, __value) + le32p_replace_bits((__le32 *)__txdesc, __value, BIT(26)) #define SET_TX_DESC_FIRST_SEG(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc, 27, 1, __value) + le32p_replace_bits((__le32 *)__txdesc, __value, BIT(27)) #define SET_TX_DESC_LINIP(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc, 28, 1, __value) + le32p_replace_bits((__le32 *)__txdesc, __value, BIT(28)) #define SET_TX_DESC_OWN(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc, 31, 1, __value) + le32p_replace_bits((__le32 *)__txdesc, __value, BIT(31)) /* Dword 1 */ #define SET_TX_DESC_MACID(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc + 4, 0, 5, __value) + le32p_replace_bits((__le32 *)(__txdesc + 4), __value, GENMASK(4, 0)) #define SET_TX_DESC_AGG_ENABLE(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc + 4, 5, 1, __value) + le32p_replace_bits((__le32 *)(__txdesc + 4), __value, BIT(5)) #define SET_TX_DESC_AGG_BREAK(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc + 4, 6, 1, __value) + le32p_replace_bits((__le32 *)(__txdesc + 4), __value, BIT(6)) #define SET_TX_DESC_RDG_ENABLE(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc + 4, 7, 1, __value) + le32p_replace_bits((__le32 *)(__txdesc + 4), __value, BIT(7)) #define SET_TX_DESC_QUEUE_SEL(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc + 4, 8, 5, __value) + le32p_replace_bits((__le32 *)(__txdesc + 4), __value, GENMASK(12, 8)) #define SET_TX_DESC_RATE_ID(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc + 4, 16, 4, __value) + le32p_replace_bits((__le32 *)(__txdesc + 4), __value, GENMASK(19, 16)) #define SET_TX_DESC_NAV_USE_HDR(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc + 4, 20, 1, __value) + le32p_replace_bits((__le32 *)(__txdesc + 4), __value, BIT(20)) #define SET_TX_DESC_SEC_TYPE(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc + 4, 22, 2, __value) + le32p_replace_bits((__le32 *)(__txdesc + 4), __value, GENMASK(23, 22)) #define SET_TX_DESC_PKT_OFFSET(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc + 4, 26, 5, __value) + le32p_replace_bits((__le32 *)(__txdesc + 4), __value, GENMASK(30, 26)) /* Dword 2 */ #define SET_TX_DESC_MORE_FRAG(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc + 8, 17, 1, __value) + le32p_replace_bits((__le32 *)(__txdesc + 8), __value, BIT(17)) #define SET_TX_DESC_AMPDU_DENSITY(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc + 8, 20, 3, __value) + le32p_replace_bits((__le32 *)(__txdesc + 8), __value, GENMASK(22, 20)) /* Dword 3 */ #define SET_TX_DESC_SEQ(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc + 12, 16, 12, __value) + le32p_replace_bits((__le32 *)(__txdesc + 12), __value, GENMASK(27, 16)) #define SET_TX_DESC_PKT_ID(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc + 12, 28, 4, __value) + le32p_replace_bits((__le32 *)(__txdesc + 12), __value, GENMASK(31, 28)) /* Dword 4 */ #define SET_TX_DESC_RTS_RATE(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc + 16, 0, 5, __value) + le32p_replace_bits((__le32 *)(__txdesc + 16), __value, GENMASK(4, 0)) #define SET_TX_DESC_QOS(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc + 16, 6, 1, __value) + le32p_replace_bits((__le32 *)(__txdesc + 16), __value, BIT(6)) #define SET_TX_DESC_HWSEQ_EN(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc + 16, 7, 1, __value) + le32p_replace_bits((__le32 *)(__txdesc + 16), __value, BIT(7)) #define SET_TX_DESC_USE_RATE(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc + 16, 8, 1, __value) + le32p_replace_bits((__le32 *)(__txdesc + 16), __value, BIT(8)) #define SET_TX_DESC_DISABLE_FB(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc + 16, 10, 1, __value) + le32p_replace_bits((__le32 *)(__txdesc + 16), __value, BIT(10)) #define SET_TX_DESC_CTS2SELF(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc + 16, 11, 1, __value) + le32p_replace_bits((__le32 *)(__txdesc + 16), __value, BIT(11)) #define SET_TX_DESC_RTS_ENABLE(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc + 16, 12, 1, __value) + le32p_replace_bits((__le32 *)(__txdesc + 16), __value, BIT(12)) #define SET_TX_DESC_HW_RTS_ENABLE(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc + 16, 13, 1, __value) + le32p_replace_bits((__le32 *)(__txdesc + 16), __value, BIT(13)) #define SET_TX_DESC_DATA_SC(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc + 16, 20, 2, __value) + le32p_replace_bits((__le32 *)(__txdesc + 16), __value, GENMASK(21, 20)) #define SET_TX_DESC_DATA_BW(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc + 16, 25, 1, __value) + le32p_replace_bits((__le32 *)(__txdesc + 16), __value, BIT(25)) #define SET_TX_DESC_RTS_SHORT(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc + 16, 26, 1, __value) + le32p_replace_bits((__le32 *)(__txdesc + 16), __value, BIT(26)) #define SET_TX_DESC_RTS_BW(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc + 16, 27, 1, __value) + le32p_replace_bits((__le32 *)(__txdesc + 16), __value, BIT(27)) #define SET_TX_DESC_RTS_SC(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc + 16, 28, 2, __value) + le32p_replace_bits((__le32 *)(__txdesc + 16), __value, GENMASK(29, 28)) #define SET_TX_DESC_RTS_STBC(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc + 16, 30, 2, __value) + le32p_replace_bits((__le32 *)(__txdesc + 16), __value, GENMASK(31, 30)) /* Dword 5 */ #define SET_TX_DESC_TX_RATE(__pdesc, __val) \ - SET_BITS_TO_LE_4BYTE(__pdesc + 20, 0, 6, __val) + le32p_replace_bits((__le32 *)(__pdesc + 20), __val, GENMASK(5, 0)) #define SET_TX_DESC_DATA_SHORTGI(__pdesc, __val) \ - SET_BITS_TO_LE_4BYTE(__pdesc + 20, 6, 1, __val) + le32p_replace_bits((__le32 *)(__pdesc + 20), __val, BIT(6)) #define SET_TX_DESC_DATA_RATE_FB_LIMIT(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc + 20, 8, 5, __value) + le32p_replace_bits((__le32 *)(__txdesc + 20), __value, GENMASK(12, 8)) #define SET_TX_DESC_RTS_RATE_FB_LIMIT(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc + 20, 13, 4, __value) + le32p_replace_bits((__le32 *)(__txdesc + 20), __value, GENMASK(16, 13)) /* Dword 6 */ #define SET_TX_DESC_MAX_AGG_NUM(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc + 24, 11, 5, __value) + le32p_replace_bits((__le32 *)(__txdesc + 24), __value, GENMASK(15, 11)) /* Dword 7 */ #define SET_TX_DESC_TX_DESC_CHECKSUM(__txdesc, __value) \ - SET_BITS_TO_LE_4BYTE(__txdesc + 28, 0, 16, __value) + le32p_replace_bits((__le32 *)(__txdesc + 28), __value, GENMASK(15, 0)) int rtl8192cu_endpoint_mapping(struct ieee80211_hw *hw); u16 rtl8192cu_mq_to_hwq(__le16 fc, u16 mac80211_queue_index); From patchwork Sun Sep 1 15:47:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Larry Finger X-Patchwork-Id: 11125345 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 109271922 for ; Sun, 1 Sep 2019 15:47:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D8A08233A2 for ; Sun, 1 Sep 2019 15:47:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="onzUV9wT" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729167AbfIAPrP (ORCPT ); Sun, 1 Sep 2019 11:47:15 -0400 Received: from mail-ot1-f66.google.com ([209.85.210.66]:37678 "EHLO mail-ot1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728621AbfIAPrO (ORCPT ); Sun, 1 Sep 2019 11:47:14 -0400 Received: by mail-ot1-f66.google.com with SMTP id 97so8605004otr.4 for ; Sun, 01 Sep 2019 08:47:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=8hOYI62P0dEa0jRVkJEIjHuMfDfEaEj0ant+x7m7yvA=; b=onzUV9wTxLc0zfNwHX3Y+UVm7CJ9vCQDwlnaGojs4Fk3naZK0NWXp8HquqyfltveX5 tZTH8hNK1Af4D8HgMNIziEYW+rs3JPMN9Sg9mD79hL1Qkqd5avPGi9o4V1OHnZCU7LLE uZxuRVPefsuDTuK6e3+bms+9zQ8EZDwLxzyvzTHrIZXLDmVE/fHV25WFaICahWQY5ts6 92dYY07W9iII0hBuBUwgZFabfKwhMPm4r8nYeDiVCuGy1qtbHU2P2oQ+iMu1MJp82SM+ vH2nRP2tGNZP2mZ4SXjheWVRgIuuIbWPzzdObjvnT67usg1QLyn4BgKuqcrOMRmlZSUO uvbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=8hOYI62P0dEa0jRVkJEIjHuMfDfEaEj0ant+x7m7yvA=; b=bWTLapcIZc1yKJqfXYJ0hoqwp9eoHgJljx9DkJ1LBLiLNx/CvMvOhMXP5POOBedFlZ mZ7QtTvAKphgPzo7tOv8HwL74Fxn8hYP/5i63Ti6z+chpSXVV+mSSRlfJw3WTBKUbgei k7xtAYRaJpwvBi9LLDxGsL7BYTmSecDe+1maaT38L9hUWjkFi6qjRxuGlB4/SkgEJdil x0ZLEgiZwtBZ2fHYROxsyHM37j+JeluDxgIx0X+664d5vpdHGBqgkeoteDk4xZm+5UkY DnMu6StVyyHpZ6Shi0g423Kt11PXbRV4ImvqAa89oiIEhvZj2y4CnePwN5oZzjgYl2X9 2Trw== X-Gm-Message-State: APjAAAXEsLV+VN1QpWDlqAAOv3hMm64p4gt7yG/j9tcUsVUMRH0Vi+Ja YONPKP5kjmeTf6HJFwv4FHI= X-Google-Smtp-Source: APXvYqypv/31c/x6efJ2b5Azo9JABJobHZzj615t/4P96dX/CH+SdgeEm0vJC/J8MWHFDusgC0GcYQ== X-Received: by 2002:a05:6830:4da:: with SMTP id s26mr19370997otd.223.1567352832249; Sun, 01 Sep 2019 08:47:12 -0700 (PDT) Received: from localhost.localdomain (cpe-24-31-245-230.kc.res.rr.com. [24.31.245.230]) by smtp.gmail.com with ESMTPSA id b19sm3186440oie.34.2019.09.01.08.47.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 01 Sep 2019 08:47:11 -0700 (PDT) From: Larry Finger To: kvalo@codeaurora.org Cc: linux-wireless@vger.kernel.org, pkshih@realtek.com, Larry Finger Subject: [PATCH 3/4] rtlwifi: rtl8192cu: Convert macros that set descriptor Date: Sun, 1 Sep 2019 10:47:05 -0500 Message-Id: <20190901154706.24193-4-Larry.Finger@lwfinger.net> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20190901154706.24193-1-Larry.Finger@lwfinger.net> References: <20190901154706.24193-1-Larry.Finger@lwfinger.net> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org As a first step in the conversion, the macros that set the RX and TX descriptors are converted to static inline routines, and the names are changed from upper to lower case. To minimize the changes in a given step, the input descriptor information is left as as a byte array (u8 *), even though it should be a little-endian word array (__le32 *). That will be changed in the next patch. Several places where checkpatch.pl complains about a space after a cast and other warnings are fixed. Signed-off-by: Larry Finger --- .../net/wireless/realtek/rtlwifi/rtl8192cu/mac.c | 6 +- .../net/wireless/realtek/rtlwifi/rtl8192cu/trx.c | 246 ++++++------- .../net/wireless/realtek/rtlwifi/rtl8192cu/trx.h | 385 +++++++++++++++------ 3 files changed, 402 insertions(+), 235 deletions(-) diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/mac.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/mac.c index b3ce8000d52d..a2f878de0a70 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/mac.c +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/mac.c @@ -736,9 +736,9 @@ static void _rtl92c_query_rxphystatus(struct ieee80211_hw *hw, pstats->rx_pwdb_all = pwdb_all; pstats->rxpower = rx_pwr_all; pstats->recvsignalpower = rx_pwr_all; - if (GET_RX_DESC_RX_MCS(pdesc) && - GET_RX_DESC_RX_MCS(pdesc) >= DESC_RATEMCS8 && - GET_RX_DESC_RX_MCS(pdesc) <= DESC_RATEMCS15) + if (get_rx_desc_rx_mcs(pdesc) && + get_rx_desc_rx_mcs(pdesc) >= DESC_RATEMCS8 && + get_rx_desc_rx_mcs(pdesc) <= DESC_RATEMCS15) max_spatial_stream = 2; else max_spatial_stream = 1; diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.c index 9b5c7ec6b6f7..a9f16868791f 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.c +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.c @@ -286,40 +286,40 @@ bool rtl92cu_rx_query_desc(struct ieee80211_hw *hw, { struct rx_fwinfo_92c *p_drvinfo; struct rx_desc_92c *p_desc = (struct rx_desc_92c *)pdesc; - u32 phystatus = GET_RX_DESC_PHY_STATUS(pdesc); + u32 phystatus = get_rx_desc_phy_status(pdesc); - stats->length = (u16) GET_RX_DESC_PKT_LEN(pdesc); - stats->rx_drvinfo_size = (u8)GET_RX_DESC_DRVINFO_SIZE(pdesc) * + stats->length = (u16)get_rx_desc_pkt_len(pdesc); + stats->rx_drvinfo_size = (u8)get_rx_desc_drvinfo_size(pdesc) * RX_DRV_INFO_SIZE_UNIT; - stats->rx_bufshift = (u8) (GET_RX_DESC_SHIFT(pdesc) & 0x03); - stats->icv = (u16) GET_RX_DESC_ICV(pdesc); - stats->crc = (u16) GET_RX_DESC_CRC32(pdesc); + stats->rx_bufshift = (u8)(get_rx_desc_shift(pdesc) & 0x03); + stats->icv = (u16)get_rx_desc_icv(pdesc); + stats->crc = (u16)get_rx_desc_crc32(pdesc); stats->hwerror = (stats->crc | stats->icv); - stats->decrypted = !GET_RX_DESC_SWDEC(pdesc); - stats->rate = (u8) GET_RX_DESC_RX_MCS(pdesc); - stats->shortpreamble = (u16) GET_RX_DESC_SPLCP(pdesc); - stats->isampdu = (bool) (GET_RX_DESC_PAGGR(pdesc) == 1); - stats->isfirst_ampdu = (bool)((GET_RX_DESC_PAGGR(pdesc) == 1) - && (GET_RX_DESC_FAGGR(pdesc) == 1)); - stats->timestamp_low = GET_RX_DESC_TSFL(pdesc); - stats->rx_is40mhzpacket = (bool)GET_RX_DESC_BW(pdesc); - stats->is_ht = (bool)GET_RX_DESC_RX_HT(pdesc); + stats->decrypted = !get_rx_desc_swdec(pdesc); + stats->rate = (u8)get_rx_desc_rx_mcs(pdesc); + stats->shortpreamble = (u16)get_rx_desc_splcp(pdesc); + stats->isampdu = (bool)(get_rx_desc_paggr(pdesc) == 1); + stats->isfirst_ampdu = (bool)((get_rx_desc_paggr(pdesc) == 1) && + (get_rx_desc_faggr(pdesc) == 1)); + stats->timestamp_low = get_rx_desc_tsfl(pdesc); + stats->rx_is40mhzpacket = (bool)get_rx_desc_bw(pdesc); + stats->is_ht = (bool)get_rx_desc_rx_ht(pdesc); rx_status->freq = hw->conf.chandef.chan->center_freq; rx_status->band = hw->conf.chandef.chan->band; - if (GET_RX_DESC_CRC32(pdesc)) + if (get_rx_desc_crc32(pdesc)) rx_status->flag |= RX_FLAG_FAILED_FCS_CRC; - if (!GET_RX_DESC_SWDEC(pdesc)) + if (!get_rx_desc_swdec(pdesc)) rx_status->flag |= RX_FLAG_DECRYPTED; - if (GET_RX_DESC_BW(pdesc)) + if (get_rx_desc_bw(pdesc)) rx_status->bw = RATE_INFO_BW_40; - if (GET_RX_DESC_RX_HT(pdesc)) + if (get_rx_desc_rx_ht(pdesc)) rx_status->encoding = RX_ENC_HT; rx_status->flag |= RX_FLAG_MACTIME_START; if (stats->decrypted) rx_status->flag |= RX_FLAG_DECRYPTED; rx_status->rate_idx = rtlwifi_rate_mapping(hw, stats->is_ht, false, stats->rate); - rx_status->mactime = GET_RX_DESC_TSFL(pdesc); + rx_status->mactime = get_rx_desc_tsfl(pdesc); if (phystatus) { p_drvinfo = (struct rx_fwinfo_92c *)(skb->data + stats->rx_bufshift); @@ -352,42 +352,42 @@ static void _rtl_rx_process(struct ieee80211_hw *hw, struct sk_buff *skb) memset(rx_status, 0, sizeof(*rx_status)); rxdesc = skb->data; skb_len = skb->len; - drvinfo_len = (GET_RX_DESC_DRVINFO_SIZE(rxdesc) * RTL_RX_DRV_INFO_UNIT); - pkt_len = GET_RX_DESC_PKT_LEN(rxdesc); + drvinfo_len = (get_rx_desc_drvinfo_size(rxdesc) * RTL_RX_DRV_INFO_UNIT); + pkt_len = get_rx_desc_pkt_len(rxdesc); /* TODO: Error recovery. drop this skb or something. */ WARN_ON(skb_len < (pkt_len + RTL_RX_DESC_SIZE + drvinfo_len)); - stats.length = (u16) GET_RX_DESC_PKT_LEN(rxdesc); - stats.rx_drvinfo_size = (u8)GET_RX_DESC_DRVINFO_SIZE(rxdesc) * + stats.length = (u16)get_rx_desc_pkt_len(rxdesc); + stats.rx_drvinfo_size = (u8)get_rx_desc_drvinfo_size(rxdesc) * RX_DRV_INFO_SIZE_UNIT; - stats.rx_bufshift = (u8) (GET_RX_DESC_SHIFT(rxdesc) & 0x03); - stats.icv = (u16) GET_RX_DESC_ICV(rxdesc); - stats.crc = (u16) GET_RX_DESC_CRC32(rxdesc); + stats.rx_bufshift = (u8)(get_rx_desc_shift(rxdesc) & 0x03); + stats.icv = (u16)get_rx_desc_icv(rxdesc); + stats.crc = (u16)get_rx_desc_crc32(rxdesc); stats.hwerror = (stats.crc | stats.icv); - stats.decrypted = !GET_RX_DESC_SWDEC(rxdesc); - stats.rate = (u8) GET_RX_DESC_RX_MCS(rxdesc); - stats.shortpreamble = (u16) GET_RX_DESC_SPLCP(rxdesc); - stats.isampdu = (bool) ((GET_RX_DESC_PAGGR(rxdesc) == 1) - && (GET_RX_DESC_FAGGR(rxdesc) == 1)); - stats.timestamp_low = GET_RX_DESC_TSFL(rxdesc); - stats.rx_is40mhzpacket = (bool)GET_RX_DESC_BW(rxdesc); - stats.is_ht = (bool)GET_RX_DESC_RX_HT(rxdesc); + stats.decrypted = !get_rx_desc_swdec(rxdesc); + stats.rate = (u8)get_rx_desc_rx_mcs(rxdesc); + stats.shortpreamble = (u16)get_rx_desc_splcp(rxdesc); + stats.isampdu = (bool)((get_rx_desc_paggr(rxdesc) == 1) && + (get_rx_desc_faggr(rxdesc) == 1)); + stats.timestamp_low = get_rx_desc_tsfl(rxdesc); + stats.rx_is40mhzpacket = (bool)get_rx_desc_bw(rxdesc); + stats.is_ht = (bool)get_rx_desc_rx_ht(rxdesc); /* TODO: is center_freq changed when doing scan? */ /* TODO: Shall we add protection or just skip those two step? */ rx_status->freq = hw->conf.chandef.chan->center_freq; rx_status->band = hw->conf.chandef.chan->band; - if (GET_RX_DESC_CRC32(rxdesc)) + if (get_rx_desc_crc32(rxdesc)) rx_status->flag |= RX_FLAG_FAILED_FCS_CRC; - if (!GET_RX_DESC_SWDEC(rxdesc)) + if (!get_rx_desc_swdec(rxdesc)) rx_status->flag |= RX_FLAG_DECRYPTED; - if (GET_RX_DESC_BW(rxdesc)) + if (get_rx_desc_bw(rxdesc)) rx_status->bw = RATE_INFO_BW_40; - if (GET_RX_DESC_RX_HT(rxdesc)) + if (get_rx_desc_rx_ht(rxdesc)) rx_status->encoding = RX_ENC_HT; /* Data rate */ rx_status->rate_idx = rtlwifi_rate_mapping(hw, stats.is_ht, false, stats.rate); /* There is a phy status after this rx descriptor. */ - if (GET_RX_DESC_PHY_STATUS(rxdesc)) { + if (get_rx_desc_phy_status(rxdesc)) { p_drvinfo = (struct rx_fwinfo_92c *)(rxdesc + RTL_RX_DESC_SIZE); rtl92c_translate_rx_signal_stuff(hw, skb, &stats, (struct rx_desc_92c *)rxdesc, p_drvinfo); @@ -442,9 +442,9 @@ struct sk_buff *rtl8192c_tx_aggregate_hdl(struct ieee80211_hw *hw, static void _rtl_fill_usb_tx_desc(u8 *txdesc) { - SET_TX_DESC_OWN(txdesc, 1); - SET_TX_DESC_LAST_SEG(txdesc, 1); - SET_TX_DESC_FIRST_SEG(txdesc, 1); + set_tx_desc_own(txdesc, 1); + set_tx_desc_last_seg(txdesc, 1); + set_tx_desc_first_seg(txdesc, 1); } /** @@ -457,10 +457,10 @@ static void _rtl_tx_desc_checksum(u8 *txdesc) u32 index; /* Clear first */ - SET_TX_DESC_TX_DESC_CHECKSUM(txdesc, 0); + set_tx_desc_tx_desc_checksum(txdesc, 0); for (index = 0; index < 16; index++) checksum = checksum ^ le16_to_cpu(*(ptr + index)); - SET_TX_DESC_TX_DESC_CHECKSUM(txdesc, checksum); + set_tx_desc_tx_desc_checksum(txdesc, checksum); } void rtl92cu_tx_fill_desc(struct ieee80211_hw *hw, @@ -489,55 +489,57 @@ void rtl92cu_tx_fill_desc(struct ieee80211_hw *hw, rtl_get_tcb_desc(hw, info, sta, skb, tcb_desc); txdesc = skb_push(skb, RTL_TX_HEADER_SIZE); memset(txdesc, 0, RTL_TX_HEADER_SIZE); - SET_TX_DESC_PKT_SIZE(txdesc, pktlen); - SET_TX_DESC_LINIP(txdesc, 0); - SET_TX_DESC_PKT_OFFSET(txdesc, RTL_DUMMY_OFFSET); - SET_TX_DESC_OFFSET(txdesc, RTL_TX_HEADER_SIZE); - SET_TX_DESC_TX_RATE(txdesc, tcb_desc->hw_rate); + set_tx_desc_pkt_size(txdesc, pktlen); + set_tx_desc_linip(txdesc, 0); + set_tx_desc_pkt_offset(txdesc, RTL_DUMMY_OFFSET); + set_tx_desc_offset(txdesc, RTL_TX_HEADER_SIZE); + set_tx_desc_tx_rate(txdesc, tcb_desc->hw_rate); if (tcb_desc->use_shortgi || tcb_desc->use_shortpreamble) - SET_TX_DESC_DATA_SHORTGI(txdesc, 1); + set_tx_desc_data_shortgi(txdesc, 1); if (mac->tids[tid].agg.agg_state == RTL_AGG_ON && info->flags & IEEE80211_TX_CTL_AMPDU) { - SET_TX_DESC_AGG_ENABLE(txdesc, 1); - SET_TX_DESC_MAX_AGG_NUM(txdesc, 0x14); + set_tx_desc_agg_enable(txdesc, 1); + set_tx_desc_max_agg_num(txdesc, 0x14); } else { - SET_TX_DESC_AGG_BREAK(txdesc, 1); + set_tx_desc_agg_break(txdesc, 1); } - SET_TX_DESC_SEQ(txdesc, seq_number); - SET_TX_DESC_RTS_ENABLE(txdesc, ((tcb_desc->rts_enable && - !tcb_desc->cts_enable) ? 1 : 0)); - SET_TX_DESC_HW_RTS_ENABLE(txdesc, ((tcb_desc->rts_enable || - tcb_desc->cts_enable) ? 1 : 0)); - SET_TX_DESC_CTS2SELF(txdesc, ((tcb_desc->cts_enable) ? 1 : 0)); - SET_TX_DESC_RTS_STBC(txdesc, ((tcb_desc->rts_stbc) ? 1 : 0)); - SET_TX_DESC_RTS_RATE(txdesc, tcb_desc->rts_rate); - SET_TX_DESC_RTS_BW(txdesc, 0); - SET_TX_DESC_RTS_SC(txdesc, tcb_desc->rts_sc); - SET_TX_DESC_RTS_SHORT(txdesc, + set_tx_desc_seq(txdesc, seq_number); + set_tx_desc_rts_enable(txdesc, + ((tcb_desc->rts_enable && + !tcb_desc->cts_enable) ? 1 : 0)); + set_tx_desc_hw_rts_enable(txdesc, + ((tcb_desc->rts_enable || + tcb_desc->cts_enable) ? 1 : 0)); + set_tx_desc_cts2self(txdesc, ((tcb_desc->cts_enable) ? 1 : 0)); + set_tx_desc_rts_stbc(txdesc, ((tcb_desc->rts_stbc) ? 1 : 0)); + set_tx_desc_rts_rate(txdesc, tcb_desc->rts_rate); + set_tx_desc_rts_bw(txdesc, 0); + set_tx_desc_rts_sc(txdesc, tcb_desc->rts_sc); + set_tx_desc_rts_short(txdesc, ((tcb_desc->rts_rate <= DESC_RATE54M) ? (tcb_desc->rts_use_shortpreamble ? 1 : 0) : (tcb_desc->rts_use_shortgi ? 1 : 0))); if (mac->bw_40) { if (rate_flag & IEEE80211_TX_RC_DUP_DATA) { - SET_TX_DESC_DATA_BW(txdesc, 1); - SET_TX_DESC_DATA_SC(txdesc, 3); + set_tx_desc_data_bw(txdesc, 1); + set_tx_desc_data_sc(txdesc, 3); } else if(rate_flag & IEEE80211_TX_RC_40_MHZ_WIDTH){ - SET_TX_DESC_DATA_BW(txdesc, 1); - SET_TX_DESC_DATA_SC(txdesc, mac->cur_40_prime_sc); + set_tx_desc_data_bw(txdesc, 1); + set_tx_desc_data_sc(txdesc, mac->cur_40_prime_sc); } else { - SET_TX_DESC_DATA_BW(txdesc, 0); - SET_TX_DESC_DATA_SC(txdesc, 0); + set_tx_desc_data_bw(txdesc, 0); + set_tx_desc_data_sc(txdesc, 0); } } else { - SET_TX_DESC_DATA_BW(txdesc, 0); - SET_TX_DESC_DATA_SC(txdesc, 0); + set_tx_desc_data_bw(txdesc, 0); + set_tx_desc_data_sc(txdesc, 0); } rcu_read_lock(); sta = ieee80211_find_sta(mac->vif, mac->bssid); if (sta) { u8 ampdu_density = sta->ht_cap.ampdu_density; - SET_TX_DESC_AMPDU_DENSITY(txdesc, ampdu_density); + set_tx_desc_ampdu_density(txdesc, ampdu_density); } rcu_read_unlock(); if (info->control.hw_key) { @@ -547,49 +549,49 @@ void rtl92cu_tx_fill_desc(struct ieee80211_hw *hw, case WLAN_CIPHER_SUITE_WEP40: case WLAN_CIPHER_SUITE_WEP104: case WLAN_CIPHER_SUITE_TKIP: - SET_TX_DESC_SEC_TYPE(txdesc, 0x1); + set_tx_desc_sec_type(txdesc, 0x1); break; case WLAN_CIPHER_SUITE_CCMP: - SET_TX_DESC_SEC_TYPE(txdesc, 0x3); + set_tx_desc_sec_type(txdesc, 0x3); break; default: - SET_TX_DESC_SEC_TYPE(txdesc, 0x0); + set_tx_desc_sec_type(txdesc, 0x0); break; } } - SET_TX_DESC_PKT_ID(txdesc, 0); - SET_TX_DESC_QUEUE_SEL(txdesc, fw_qsel); - SET_TX_DESC_DATA_RATE_FB_LIMIT(txdesc, 0x1F); - SET_TX_DESC_RTS_RATE_FB_LIMIT(txdesc, 0xF); - SET_TX_DESC_DISABLE_FB(txdesc, 0); - SET_TX_DESC_USE_RATE(txdesc, tcb_desc->use_driver_rate ? 1 : 0); + set_tx_desc_pkt_id(txdesc, 0); + set_tx_desc_queue_sel(txdesc, fw_qsel); + set_tx_desc_data_rate_fb_limit(txdesc, 0x1F); + set_tx_desc_rts_rate_fb_limit(txdesc, 0xF); + set_tx_desc_disable_fb(txdesc, 0); + set_tx_desc_use_rate(txdesc, tcb_desc->use_driver_rate ? 1 : 0); if (ieee80211_is_data_qos(fc)) { if (mac->rdg_en) { RT_TRACE(rtlpriv, COMP_SEND, DBG_TRACE, "Enable RDG function\n"); - SET_TX_DESC_RDG_ENABLE(txdesc, 1); - SET_TX_DESC_HTC(txdesc, 1); + set_tx_desc_rdg_enable(txdesc, 1); + set_tx_desc_htc(txdesc, 1); } } if (rtlpriv->dm.useramask) { - SET_TX_DESC_RATE_ID(txdesc, tcb_desc->ratr_index); - SET_TX_DESC_MACID(txdesc, tcb_desc->mac_id); + set_tx_desc_rate_id(txdesc, tcb_desc->ratr_index); + set_tx_desc_macid(txdesc, tcb_desc->mac_id); } else { - SET_TX_DESC_RATE_ID(txdesc, 0xC + tcb_desc->ratr_index); - SET_TX_DESC_MACID(txdesc, tcb_desc->ratr_index); + set_tx_desc_rate_id(txdesc, 0xC + tcb_desc->ratr_index); + set_tx_desc_macid(txdesc, tcb_desc->ratr_index); } if ((!ieee80211_is_data_qos(fc)) && ppsc->leisure_ps && ppsc->fwctrl_lps) { - SET_TX_DESC_HWSEQ_EN(txdesc, 1); - SET_TX_DESC_PKT_ID(txdesc, 8); + set_tx_desc_hwseq_en(txdesc, 1); + set_tx_desc_pkt_id(txdesc, 8); if (!defaultadapter) - SET_TX_DESC_QOS(txdesc, 1); + set_tx_desc_qos(txdesc, 1); } if (ieee80211_has_morefrags(fc)) - SET_TX_DESC_MORE_FRAG(txdesc, 1); + set_tx_desc_more_frag(txdesc, 1); if (is_multicast_ether_addr(ieee80211_get_DA(hdr)) || is_broadcast_ether_addr(ieee80211_get_DA(hdr))) - SET_TX_DESC_BMC(txdesc, 1); + set_tx_desc_bmc(txdesc, 1); _rtl_fill_usb_tx_desc(txdesc); _rtl_tx_desc_checksum(txdesc); RT_TRACE(rtlpriv, COMP_SEND, DBG_TRACE, "==>\n"); @@ -600,22 +602,22 @@ void rtl92cu_fill_fake_txdesc(struct ieee80211_hw *hw, u8 *pdesc, { /* Clear all status */ memset(pdesc, 0, RTL_TX_HEADER_SIZE); - SET_TX_DESC_FIRST_SEG(pdesc, 1); /* bFirstSeg; */ - SET_TX_DESC_LAST_SEG(pdesc, 1); /* bLastSeg; */ - SET_TX_DESC_OFFSET(pdesc, RTL_TX_HEADER_SIZE); /* Offset = 32 */ - SET_TX_DESC_PKT_SIZE(pdesc, buffer_len); /* Buffer size + command hdr */ - SET_TX_DESC_QUEUE_SEL(pdesc, QSLT_MGNT); /* Fixed queue of Mgnt queue */ + set_tx_desc_first_seg(pdesc, 1); /* bFirstSeg; */ + set_tx_desc_last_seg(pdesc, 1); /* bLastSeg; */ + set_tx_desc_offset(pdesc, RTL_TX_HEADER_SIZE); /* Offset = 32 */ + set_tx_desc_pkt_size(pdesc, buffer_len); /* Buffer size + command hdr */ + set_tx_desc_queue_sel(pdesc, QSLT_MGNT); /* Fixed queue of Mgnt queue */ /* Set NAVUSEHDR to prevent Ps-poll AId filed to be changed to error * vlaue by Hw. */ if (is_pspoll) { - SET_TX_DESC_NAV_USE_HDR(pdesc, 1); + set_tx_desc_nav_use_hdr(pdesc, 1); } else { - SET_TX_DESC_HWSEQ_EN(pdesc, 1); /* Hw set sequence number */ - SET_TX_DESC_PKT_ID(pdesc, BIT(3)); /* set bit3 to 1. */ + set_tx_desc_hwseq_en(pdesc, 1); /* Hw set sequence number */ + set_tx_desc_pkt_id(pdesc, BIT(3)); /* set bit3 to 1. */ } - SET_TX_DESC_USE_RATE(pdesc, 1); /* use data rate which is set by Sw */ - SET_TX_DESC_OWN(pdesc, 1); - SET_TX_DESC_TX_RATE(pdesc, DESC_RATE1M); + set_tx_desc_use_rate(pdesc, 1); /* use data rate which is set by Sw */ + set_tx_desc_own(pdesc, 1); + set_tx_desc_tx_rate(pdesc, DESC_RATE1M); _rtl_tx_desc_checksum(pdesc); } @@ -630,24 +632,24 @@ void rtl92cu_tx_fill_cmddesc(struct ieee80211_hw *hw, memset((void *)pdesc, 0, RTL_TX_HEADER_SIZE); if (firstseg) - SET_TX_DESC_OFFSET(pdesc, RTL_TX_HEADER_SIZE); - SET_TX_DESC_TX_RATE(pdesc, DESC_RATE1M); - SET_TX_DESC_SEQ(pdesc, 0); - SET_TX_DESC_LINIP(pdesc, 0); - SET_TX_DESC_QUEUE_SEL(pdesc, fw_queue); - SET_TX_DESC_FIRST_SEG(pdesc, 1); - SET_TX_DESC_LAST_SEG(pdesc, 1); - SET_TX_DESC_RATE_ID(pdesc, 7); - SET_TX_DESC_MACID(pdesc, 0); - SET_TX_DESC_OWN(pdesc, 1); - SET_TX_DESC_PKT_SIZE(pdesc, (u16)skb->len); - SET_TX_DESC_FIRST_SEG(pdesc, 1); - SET_TX_DESC_LAST_SEG(pdesc, 1); - SET_TX_DESC_OFFSET(pdesc, 0x20); - SET_TX_DESC_USE_RATE(pdesc, 1); + set_tx_desc_offset(pdesc, RTL_TX_HEADER_SIZE); + set_tx_desc_tx_rate(pdesc, DESC_RATE1M); + set_tx_desc_seq(pdesc, 0); + set_tx_desc_linip(pdesc, 0); + set_tx_desc_queue_sel(pdesc, fw_queue); + set_tx_desc_first_seg(pdesc, 1); + set_tx_desc_last_seg(pdesc, 1); + set_tx_desc_rate_id(pdesc, 7); + set_tx_desc_macid(pdesc, 0); + set_tx_desc_own(pdesc, 1); + set_tx_desc_pkt_size(pdesc, (u16)skb->len); + set_tx_desc_first_seg(pdesc, 1); + set_tx_desc_last_seg(pdesc, 1); + set_tx_desc_offset(pdesc, 0x20); + set_tx_desc_use_rate(pdesc, 1); if (!ieee80211_is_data_qos(fc)) { - SET_TX_DESC_HWSEQ_EN(pdesc, 1); - SET_TX_DESC_PKT_ID(pdesc, 8); + set_tx_desc_hwseq_en(pdesc, 1); + set_tx_desc_pkt_id(pdesc, 8); } RT_PRINT_DATA(rtlpriv, COMP_CMD, DBG_LOUD, "H2C Tx Cmd Content", pdesc, RTL_TX_DESC_SIZE); diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.h b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.h index 916fa0e98123..3d8a913d799d 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.h +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.h @@ -73,142 +73,307 @@ struct rx_drv_info_92c { /* macros to read various fields in RX descriptor */ /* DWORD 0 */ -#define GET_RX_DESC_PKT_LEN(__rxdesc) \ - le32_get_bits(*(__le32 *)__rxdesc, GENMASK(13, 0)) -#define GET_RX_DESC_CRC32(__rxdesc) \ - le32_get_bits(*(__le32 *)__rxdesc, BIT(14)) -#define GET_RX_DESC_ICV(__rxdesc) \ - le32_get_bits(*(__le32 *)__rxdesc, BIT(15)) -#define GET_RX_DESC_DRVINFO_SIZE(__rxdesc) \ - le32_get_bits(*(__le32 *)__rxdesc, GENMASK(19, 16)) -#define GET_RX_DESC_SHIFT(__rxdesc) \ - le32_get_bits(*(__le32 *)__rxdesc, GENMASK(25, 24)) -#define GET_RX_DESC_PHY_STATUS(__rxdesc) \ - le32_get_bits(*(__le32 *)__rxdesc, BIT(26)) -#define GET_RX_DESC_SWDEC(__rxdesc) \ - le32_get_bits(*(__le32 *)__rxdesc, BIT(27)) +static inline u32 get_rx_desc_pkt_len(u8 *__rxdesc) +{ + return le32_get_bits(*(__le32 *)__rxdesc, GENMASK(13, 0)); +} + +static inline u32 get_rx_desc_crc32(u8 *__rxdesc) +{ + return le32_get_bits(*(__le32 *)__rxdesc, BIT(14)); +} + +static inline u32 get_rx_desc_icv(u8 *__rxdesc) +{ + return le32_get_bits(*(__le32 *)__rxdesc, BIT(15)); +} + +static inline u32 get_rx_desc_drvinfo_size(u8 *__rxdesc) +{ + return le32_get_bits(*(__le32 *)__rxdesc, GENMASK(19, 16)); +} + +static inline u32 get_rx_desc_shift(u8 *__rxdesc) +{ + return le32_get_bits(*(__le32 *)__rxdesc, GENMASK(25, 24)); +} + +static inline u32 get_rx_desc_phy_status(u8 *__rxdesc) +{ + return le32_get_bits(*(__le32 *)__rxdesc, BIT(26)); +} + +static inline u32 get_rx_desc_swdec(u8 *__rxdesc) +{ + return le32_get_bits(*(__le32 *)__rxdesc, BIT(27)); +} + /* DWORD 1 */ -#define GET_RX_DESC_PAGGR(__rxdesc) \ - le32_get_bits(*(__le32 *)(__rxdesc + 4), BIT(14)) -#define GET_RX_DESC_FAGGR(__rxdesc) \ - le32_get_bits(*(__le32 *)(__rxdesc + 4), BIT(15)) +static inline u32 get_rx_desc_paggr(u8 *__rxdesc) +{ + return le32_get_bits(*(__le32 *)(__rxdesc + 4), BIT(14)); +} + +static inline u32 get_rx_desc_faggr(u8 *__rxdesc) +{ + return le32_get_bits(*(__le32 *)(__rxdesc + 4), BIT(15)); +} + /* DWORD 3 */ -#define GET_RX_DESC_RX_MCS(__rxdesc) \ - le32_get_bits(*(__le32 *)(__rxdesc + 12), GENMASK(5, 0)) -#define GET_RX_DESC_RX_HT(__rxdesc) \ - le32_get_bits(*(__le32 *)(__rxdesc + 12), BIT(6)) -#define GET_RX_DESC_SPLCP(__rxdesc) \ - le32_get_bits(*(__le32 *)(__rxdesc + 12), BIT(8)) -#define GET_RX_DESC_BW(__rxdesc) \ - le32_get_bits(*(__le32 *)(__rxdesc + 12), BIT(9)) +static inline u32 get_rx_desc_rx_mcs(u8 *__rxdesc) +{ + return le32_get_bits(*(__le32 *)(__rxdesc + 12), GENMASK(5, 0)); +} + +static inline u32 get_rx_desc_rx_ht(u8 *__rxdesc) +{ + return le32_get_bits(*(__le32 *)(__rxdesc + 12), BIT(6)); +} + +static inline u32 get_rx_desc_splcp(u8 *__rxdesc) +{ + return le32_get_bits(*(__le32 *)(__rxdesc + 12), BIT(8)); +} + +static inline u32 get_rx_desc_bw(u8 *__rxdesc) +{ + return le32_get_bits(*(__le32 *)(__rxdesc + 12), BIT(9)); +} + /* DWORD 5 */ -#define GET_RX_DESC_TSFL(__rxdesc) \ - le32_to_cpu(*((__le32 *)(__rxdesc + 20))) +static inline u32 get_rx_desc_tsfl(u8 *__rxdesc) +{ + return le32_to_cpu(*((__le32 *)(__rxdesc + 20))); +} + /*======================= tx desc ============================================*/ /* macros to set various fields in TX descriptor */ /* Dword 0 */ -#define SET_TX_DESC_PKT_SIZE(__txdesc, __value) \ - le32p_replace_bits((__le32 *)__txdesc, __value, GENMASK(15, 0)) -#define SET_TX_DESC_OFFSET(__txdesc, __value) \ - le32p_replace_bits((__le32 *)__txdesc, __value, GENMASK(23, 16)) -#define SET_TX_DESC_BMC(__txdesc, __value) \ - le32p_replace_bits((__le32 *)__txdesc, __value, BIT(24)) -#define SET_TX_DESC_HTC(__txdesc, __value) \ - le32p_replace_bits((__le32 *)__txdesc, __value, BIT(25)) -#define SET_TX_DESC_LAST_SEG(__txdesc, __value) \ - le32p_replace_bits((__le32 *)__txdesc, __value, BIT(26)) -#define SET_TX_DESC_FIRST_SEG(__txdesc, __value) \ - le32p_replace_bits((__le32 *)__txdesc, __value, BIT(27)) -#define SET_TX_DESC_LINIP(__txdesc, __value) \ - le32p_replace_bits((__le32 *)__txdesc, __value, BIT(28)) -#define SET_TX_DESC_OWN(__txdesc, __value) \ - le32p_replace_bits((__le32 *)__txdesc, __value, BIT(31)) +static inline void set_tx_desc_pkt_size(u8 *__txdesc, u32 __value) +{ + le32p_replace_bits((__le32 *)__txdesc, __value, GENMASK(15, 0)); +} + +static inline void set_tx_desc_offset(u8 *__txdesc, u32 __value) +{ + le32p_replace_bits((__le32 *)__txdesc, __value, GENMASK(23, 16)); +} + +static inline void set_tx_desc_bmc(u8 *__txdesc, u32 __value) +{ + le32p_replace_bits((__le32 *)__txdesc, __value, BIT(24)); +} + +static inline void set_tx_desc_htc(u8 *__txdesc, u32 __value) +{ + le32p_replace_bits((__le32 *)__txdesc, __value, BIT(25)); +} + +static inline void set_tx_desc_last_seg(u8 *__txdesc, u32 __value) +{ + le32p_replace_bits((__le32 *)__txdesc, __value, BIT(26)); +} + +static inline void set_tx_desc_first_seg(u8 *__txdesc, u32 __value) +{ + le32p_replace_bits((__le32 *)__txdesc, __value, BIT(27)); +} + +static inline void set_tx_desc_linip(u8 *__txdesc, u32 __value) +{ + le32p_replace_bits((__le32 *)__txdesc, __value, BIT(28)); +} + +static inline void set_tx_desc_own(u8 *__txdesc, u32 __value) +{ + le32p_replace_bits((__le32 *)__txdesc, __value, BIT(31)); +} + /* Dword 1 */ -#define SET_TX_DESC_MACID(__txdesc, __value) \ - le32p_replace_bits((__le32 *)(__txdesc + 4), __value, GENMASK(4, 0)) -#define SET_TX_DESC_AGG_ENABLE(__txdesc, __value) \ - le32p_replace_bits((__le32 *)(__txdesc + 4), __value, BIT(5)) -#define SET_TX_DESC_AGG_BREAK(__txdesc, __value) \ - le32p_replace_bits((__le32 *)(__txdesc + 4), __value, BIT(6)) -#define SET_TX_DESC_RDG_ENABLE(__txdesc, __value) \ - le32p_replace_bits((__le32 *)(__txdesc + 4), __value, BIT(7)) -#define SET_TX_DESC_QUEUE_SEL(__txdesc, __value) \ - le32p_replace_bits((__le32 *)(__txdesc + 4), __value, GENMASK(12, 8)) -#define SET_TX_DESC_RATE_ID(__txdesc, __value) \ - le32p_replace_bits((__le32 *)(__txdesc + 4), __value, GENMASK(19, 16)) -#define SET_TX_DESC_NAV_USE_HDR(__txdesc, __value) \ - le32p_replace_bits((__le32 *)(__txdesc + 4), __value, BIT(20)) -#define SET_TX_DESC_SEC_TYPE(__txdesc, __value) \ - le32p_replace_bits((__le32 *)(__txdesc + 4), __value, GENMASK(23, 22)) -#define SET_TX_DESC_PKT_OFFSET(__txdesc, __value) \ - le32p_replace_bits((__le32 *)(__txdesc + 4), __value, GENMASK(30, 26)) +static inline void set_tx_desc_macid(u8 *__txdesc, u32 __value) +{ + le32p_replace_bits((__le32 *)(__txdesc + 4), __value, GENMASK(4, 0)); +} + +static inline void set_tx_desc_agg_enable(u8 *__txdesc, u32 __value) +{ + le32p_replace_bits((__le32 *)(__txdesc + 4), __value, BIT(5)); +} + +static inline void set_tx_desc_agg_break(u8 *__txdesc, u32 __value) +{ + le32p_replace_bits((__le32 *)(__txdesc + 4), __value, BIT(6)); +} + +static inline void set_tx_desc_rdg_enable(u8 *__txdesc, u32 __value) +{ + le32p_replace_bits((__le32 *)(__txdesc + 4), __value, BIT(7)); +} + +static inline void set_tx_desc_queue_sel(u8 *__txdesc, u32 __value) +{ + le32p_replace_bits((__le32 *)(__txdesc + 4), __value, GENMASK(12, 8)); +} + +static inline void set_tx_desc_rate_id(u8 *__txdesc, u32 __value) +{ + le32p_replace_bits((__le32 *)(__txdesc + 4), __value, GENMASK(19, 16)); +} + +static inline void set_tx_desc_nav_use_hdr(u8 *__txdesc, u32 __value) +{ + le32p_replace_bits((__le32 *)(__txdesc + 4), __value, BIT(20)); +} + +static inline void set_tx_desc_sec_type(u8 *__txdesc, u32 __value) +{ + le32p_replace_bits((__le32 *)(__txdesc + 4), __value, GENMASK(23, 22)); +} + +static inline void set_tx_desc_pkt_offset(u8 *__txdesc, u32 __value) +{ + le32p_replace_bits((__le32 *)(__txdesc + 4), __value, GENMASK(30, 26)); +} + /* Dword 2 */ -#define SET_TX_DESC_MORE_FRAG(__txdesc, __value) \ - le32p_replace_bits((__le32 *)(__txdesc + 8), __value, BIT(17)) -#define SET_TX_DESC_AMPDU_DENSITY(__txdesc, __value) \ - le32p_replace_bits((__le32 *)(__txdesc + 8), __value, GENMASK(22, 20)) +static inline void set_tx_desc_more_frag(u8 *__txdesc, u32 __value) +{ + le32p_replace_bits((__le32 *)(__txdesc + 8), __value, BIT(17)); +} + +static inline void set_tx_desc_ampdu_density(u8 *__txdesc, u32 __value) +{ + le32p_replace_bits((__le32 *)(__txdesc + 8), __value, GENMASK(22, 20)); +} + /* Dword 3 */ -#define SET_TX_DESC_SEQ(__txdesc, __value) \ - le32p_replace_bits((__le32 *)(__txdesc + 12), __value, GENMASK(27, 16)) -#define SET_TX_DESC_PKT_ID(__txdesc, __value) \ - le32p_replace_bits((__le32 *)(__txdesc + 12), __value, GENMASK(31, 28)) +static inline void set_tx_desc_seq(u8 *__txdesc, u32 __value) +{ + le32p_replace_bits((__le32 *)(__txdesc + 12), __value, GENMASK(27, 16)); +} + +static inline void set_tx_desc_pkt_id(u8 *__txdesc, u32 __value) +{ + le32p_replace_bits((__le32 *)(__txdesc + 12), __value, GENMASK(31, 28)); +} + /* Dword 4 */ -#define SET_TX_DESC_RTS_RATE(__txdesc, __value) \ - le32p_replace_bits((__le32 *)(__txdesc + 16), __value, GENMASK(4, 0)) -#define SET_TX_DESC_QOS(__txdesc, __value) \ - le32p_replace_bits((__le32 *)(__txdesc + 16), __value, BIT(6)) -#define SET_TX_DESC_HWSEQ_EN(__txdesc, __value) \ - le32p_replace_bits((__le32 *)(__txdesc + 16), __value, BIT(7)) -#define SET_TX_DESC_USE_RATE(__txdesc, __value) \ - le32p_replace_bits((__le32 *)(__txdesc + 16), __value, BIT(8)) -#define SET_TX_DESC_DISABLE_FB(__txdesc, __value) \ - le32p_replace_bits((__le32 *)(__txdesc + 16), __value, BIT(10)) -#define SET_TX_DESC_CTS2SELF(__txdesc, __value) \ - le32p_replace_bits((__le32 *)(__txdesc + 16), __value, BIT(11)) -#define SET_TX_DESC_RTS_ENABLE(__txdesc, __value) \ - le32p_replace_bits((__le32 *)(__txdesc + 16), __value, BIT(12)) -#define SET_TX_DESC_HW_RTS_ENABLE(__txdesc, __value) \ - le32p_replace_bits((__le32 *)(__txdesc + 16), __value, BIT(13)) -#define SET_TX_DESC_DATA_SC(__txdesc, __value) \ - le32p_replace_bits((__le32 *)(__txdesc + 16), __value, GENMASK(21, 20)) -#define SET_TX_DESC_DATA_BW(__txdesc, __value) \ - le32p_replace_bits((__le32 *)(__txdesc + 16), __value, BIT(25)) -#define SET_TX_DESC_RTS_SHORT(__txdesc, __value) \ - le32p_replace_bits((__le32 *)(__txdesc + 16), __value, BIT(26)) -#define SET_TX_DESC_RTS_BW(__txdesc, __value) \ - le32p_replace_bits((__le32 *)(__txdesc + 16), __value, BIT(27)) -#define SET_TX_DESC_RTS_SC(__txdesc, __value) \ - le32p_replace_bits((__le32 *)(__txdesc + 16), __value, GENMASK(29, 28)) -#define SET_TX_DESC_RTS_STBC(__txdesc, __value) \ - le32p_replace_bits((__le32 *)(__txdesc + 16), __value, GENMASK(31, 30)) +static inline void set_tx_desc_rts_rate(u8 *__txdesc, u32 __value) +{ + le32p_replace_bits((__le32 *)(__txdesc + 16), __value, GENMASK(4, 0)); +} + +static inline void set_tx_desc_qos(u8 *__txdesc, u32 __value) +{ + le32p_replace_bits((__le32 *)(__txdesc + 16), __value, BIT(6)); +} + +static inline void set_tx_desc_hwseq_en(u8 *__txdesc, u32 __value) +{ + le32p_replace_bits((__le32 *)(__txdesc + 16), __value, BIT(7)); +} + +static inline void set_tx_desc_use_rate(u8 *__txdesc, u32 __value) +{ + le32p_replace_bits((__le32 *)(__txdesc + 16), __value, BIT(8)); +} + +static inline void set_tx_desc_disable_fb(u8 *__txdesc, u32 __value) +{ + le32p_replace_bits((__le32 *)(__txdesc + 16), __value, BIT(10)); +} + +static inline void set_tx_desc_cts2self(u8 *__txdesc, u32 __value) +{ + le32p_replace_bits((__le32 *)(__txdesc + 16), __value, BIT(11)); +} + +static inline void set_tx_desc_rts_enable(u8 *__txdesc, u32 __value) +{ + le32p_replace_bits((__le32 *)(__txdesc + 16), __value, BIT(12)); +} + +static inline void set_tx_desc_hw_rts_enable(u8 *__txdesc, u32 __value) +{ + le32p_replace_bits((__le32 *)(__txdesc + 16), __value, BIT(13)); +} + +static inline void set_tx_desc_data_sc(u8 *__txdesc, u32 __value) +{ + le32p_replace_bits((__le32 *)(__txdesc + 16), __value, GENMASK(21, 20)); +} + +static inline void set_tx_desc_data_bw(u8 *__txdesc, u32 __value) +{ + le32p_replace_bits((__le32 *)(__txdesc + 16), __value, BIT(25)); +} + +static inline void set_tx_desc_rts_short(u8 *__txdesc, u32 __value) +{ + le32p_replace_bits((__le32 *)(__txdesc + 16), __value, BIT(26)); +} + +static inline void set_tx_desc_rts_bw(u8 *__txdesc, u32 __value) +{ + le32p_replace_bits((__le32 *)(__txdesc + 16), __value, BIT(27)); +} + +static inline void set_tx_desc_rts_sc(u8 *__txdesc, u32 __value) +{ + le32p_replace_bits((__le32 *)(__txdesc + 16), __value, GENMASK(29, 28)); +} + +static inline void set_tx_desc_rts_stbc(u8 *__txdesc, u32 __value) +{ + le32p_replace_bits((__le32 *)(__txdesc + 16), __value, GENMASK(31, 30)); +} + /* Dword 5 */ -#define SET_TX_DESC_TX_RATE(__pdesc, __val) \ - le32p_replace_bits((__le32 *)(__pdesc + 20), __val, GENMASK(5, 0)) -#define SET_TX_DESC_DATA_SHORTGI(__pdesc, __val) \ - le32p_replace_bits((__le32 *)(__pdesc + 20), __val, BIT(6)) -#define SET_TX_DESC_DATA_RATE_FB_LIMIT(__txdesc, __value) \ - le32p_replace_bits((__le32 *)(__txdesc + 20), __value, GENMASK(12, 8)) -#define SET_TX_DESC_RTS_RATE_FB_LIMIT(__txdesc, __value) \ - le32p_replace_bits((__le32 *)(__txdesc + 20), __value, GENMASK(16, 13)) +static inline void set_tx_desc_tx_rate(u8 *__pdesc, u32 __val) +{ + le32p_replace_bits((__le32 *)(__pdesc + 20), __val, GENMASK(5, 0)); +} + +static inline void set_tx_desc_data_shortgi(u8 *__pdesc, u32 __val) +{ + le32p_replace_bits((__le32 *)(__pdesc + 20), __val, BIT(6)); +} + +static inline void set_tx_desc_data_rate_fb_limit(u8 *__txdesc, u32 __value) +{ + le32p_replace_bits((__le32 *)(__txdesc + 20), __value, GENMASK(12, 8)); +} + +static inline void set_tx_desc_rts_rate_fb_limit(u8 *__txdesc, u32 __value) +{ + le32p_replace_bits((__le32 *)(__txdesc + 20), __value, GENMASK(16, 13)); +} + /* Dword 6 */ -#define SET_TX_DESC_MAX_AGG_NUM(__txdesc, __value) \ - le32p_replace_bits((__le32 *)(__txdesc + 24), __value, GENMASK(15, 11)) +static inline void set_tx_desc_max_agg_num(u8 *__txdesc, u32 __value) +{ + le32p_replace_bits((__le32 *)(__txdesc + 24), __value, GENMASK(15, 11)); +} + /* Dword 7 */ -#define SET_TX_DESC_TX_DESC_CHECKSUM(__txdesc, __value) \ - le32p_replace_bits((__le32 *)(__txdesc + 28), __value, GENMASK(15, 0)) +static inline void set_tx_desc_tx_desc_checksum(u8 *__txdesc, u32 __value) +{ + le32p_replace_bits((__le32 *)(__txdesc + 28), __value, GENMASK(15, 0)); +} + int rtl8192cu_endpoint_mapping(struct ieee80211_hw *hw); u16 rtl8192cu_mq_to_hwq(__le16 fc, u16 mac80211_queue_index); From patchwork Sun Sep 1 15:47:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Larry Finger X-Patchwork-Id: 11125347 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D748C112C for ; Sun, 1 Sep 2019 15:47:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9831821897 for ; Sun, 1 Sep 2019 15:47:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Zy5dLCiG" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729172AbfIAPrQ (ORCPT ); Sun, 1 Sep 2019 11:47:16 -0400 Received: from mail-oi1-f196.google.com ([209.85.167.196]:43150 "EHLO mail-oi1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729159AbfIAPrP (ORCPT ); Sun, 1 Sep 2019 11:47:15 -0400 Received: by mail-oi1-f196.google.com with SMTP id y8so8807562oih.10 for ; Sun, 01 Sep 2019 08:47:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=NHmmgKODSWneMcnDKK8/QTwogiTmmswI0WqUwJ9TKB0=; b=Zy5dLCiGVLLiSZEcvI3kAFHgrcLXCr04e9aCjipLqX+mjd0VOXrEnOS+WD+lBx/hFY nhEYwY6J9ArS5cxicC5GRqCXf9ClEBgBADnjhxckmSNjCTsksPD4dXJln+VGHzCQX1QC xjZipx4C1tOXTjTyeO3GGerbIgnrTH0sSZPdDv123M1SNF2SypiMlgnKCVCuW1Z8MCSE cKIUo6vwDqCihdOFzfHtbeyrybLVY6McdW3EHei+xZdaspbq+oekmvScHBTqJmRfqIOJ ci2g/F99DtwUAX/P0CSKujZxm7V+zgUD9PwP5nh+x/opvOl5GS0joIpPfB8ca70HfyvH DAFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=NHmmgKODSWneMcnDKK8/QTwogiTmmswI0WqUwJ9TKB0=; b=ZE56X0IoJ5HL0RFTVbaZ0IOWS0KwsWo4UgsfbYLF/6zgFvaA2oNp1FOjiu6aUw7fug nwxoAFKyrmVTU8B1pfFtBaHfcendtzrq2lpH7M1eIsknlCedBH/fbdb+uBflGLAdnNFq xWZbS5bGMAvvqHkoFoHnR/3Ahz6P5q1NyY3KlTyffjpJSB7Ob93LJshz6D033viaN9ud eEhhmrh1bQBU3gh6Qe2D4FtkDoTGFc/eK4RLFR9cpdVyaB5PGC+BnzSsutsbQxSxfaF0 fynLUtg5Em8fv2B8wRTQpPCfNhKpAqYK2fytbVUmKRH8T0h+RBiTkRtGLhcrt+NL0xiS LUQw== X-Gm-Message-State: APjAAAVhcs00HsMIlITh7NhKOIAg8IClwX1SrnoOZHhM7T7D9EU+GIux oCrZsDDGL6lLA8vB24YKdz1w0m39 X-Google-Smtp-Source: APXvYqxAWNHlIR7OZI7Sfhn9xGZvkYKOUoqlbCB9aOf25+Vgw2rs5BJeocKri3aT6od51T+g20vOmg== X-Received: by 2002:aca:d694:: with SMTP id n142mr3743246oig.69.1567352832871; Sun, 01 Sep 2019 08:47:12 -0700 (PDT) Received: from localhost.localdomain (cpe-24-31-245-230.kc.res.rr.com. [24.31.245.230]) by smtp.gmail.com with ESMTPSA id b19sm3186440oie.34.2019.09.01.08.47.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 01 Sep 2019 08:47:12 -0700 (PDT) From: Larry Finger To: kvalo@codeaurora.org Cc: linux-wireless@vger.kernel.org, pkshih@realtek.com, Larry Finger Subject: [PATCH 4/4] rtlwifi: rtl8192cu: Convert inline routines to little-endian words Date: Sun, 1 Sep 2019 10:47:06 -0500 Message-Id: <20190901154706.24193-5-Larry.Finger@lwfinger.net> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20190901154706.24193-1-Larry.Finger@lwfinger.net> References: <20190901154706.24193-1-Larry.Finger@lwfinger.net> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org In this step, the read/write routines for the descriptors are converted to use __le32 quantities, thus a lot of casts can be removed. Callback routines still use the 8-bit arrays, but these are changed within the specified routine. Signed-off-by: Larry Finger --- .../net/wireless/realtek/rtlwifi/rtl8192cu/mac.c | 2 +- .../net/wireless/realtek/rtlwifi/rtl8192cu/trx.c | 26 ++- .../net/wireless/realtek/rtlwifi/rtl8192cu/trx.h | 220 ++++++++++----------- 3 files changed, 127 insertions(+), 121 deletions(-) diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/mac.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/mac.c index a2f878de0a70..c8daad1e749f 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/mac.c +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/mac.c @@ -638,7 +638,7 @@ static void _rtl92c_query_rxphystatus(struct ieee80211_hw *hw, u32 rssi, total_rssi = 0; bool in_powersavemode = false; bool is_cck_rate; - u8 *pdesc = (u8 *)p_desc; + __le32 *pdesc = (__le32 *)p_desc; is_cck_rate = RX_HAL_IS_CCK_RATE(p_desc->rxmcs); pstats->packet_matchbssid = packet_match_bssid; diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.c index a9f16868791f..fc526477740f 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.c +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.c @@ -282,10 +282,11 @@ static enum rtl_desc_qsel _rtl8192cu_mq_to_descq(struct ieee80211_hw *hw, bool rtl92cu_rx_query_desc(struct ieee80211_hw *hw, struct rtl_stats *stats, struct ieee80211_rx_status *rx_status, - u8 *pdesc, struct sk_buff *skb) + u8 *pdesc8, struct sk_buff *skb) { struct rx_fwinfo_92c *p_drvinfo; - struct rx_desc_92c *p_desc = (struct rx_desc_92c *)pdesc; + struct rx_desc_92c *p_desc = (struct rx_desc_92c *)pdesc8; + __le32 *pdesc = (__le32 *)pdesc8; u32 phystatus = get_rx_desc_phy_status(pdesc); stats->length = (u16)get_rx_desc_pkt_len(pdesc); @@ -339,7 +340,7 @@ static void _rtl_rx_process(struct ieee80211_hw *hw, struct sk_buff *skb) (struct ieee80211_rx_status *)IEEE80211_SKB_RXCB(skb); u32 skb_len, pkt_len, drvinfo_len; struct rtl_priv *rtlpriv = rtl_priv(hw); - u8 *rxdesc; + __le32 *rxdesc; struct rtl_stats stats = { .signal = 0, .rate = 0, @@ -350,7 +351,7 @@ static void _rtl_rx_process(struct ieee80211_hw *hw, struct sk_buff *skb) struct ieee80211_hdr *hdr; memset(rx_status, 0, sizeof(*rx_status)); - rxdesc = skb->data; + rxdesc = (__le32 *)skb->data; skb_len = skb->len; drvinfo_len = (get_rx_desc_drvinfo_size(rxdesc) * RTL_RX_DRV_INFO_UNIT); pkt_len = get_rx_desc_pkt_len(rxdesc); @@ -440,7 +441,7 @@ struct sk_buff *rtl8192c_tx_aggregate_hdl(struct ieee80211_hw *hw, /*======================================== trx ===============================*/ -static void _rtl_fill_usb_tx_desc(u8 *txdesc) +static void _rtl_fill_usb_tx_desc(__le32 *txdesc) { set_tx_desc_own(txdesc, 1); set_tx_desc_last_seg(txdesc, 1); @@ -450,7 +451,7 @@ static void _rtl_fill_usb_tx_desc(u8 *txdesc) /** * For HW recovery information */ -static void _rtl_tx_desc_checksum(u8 *txdesc) +static void _rtl_tx_desc_checksum(__le32 *txdesc) { __le16 *ptr = (__le16 *)txdesc; u16 checksum = 0; @@ -483,11 +484,13 @@ void rtl92cu_tx_fill_desc(struct ieee80211_hw *hw, u16 pktlen = skb->len; enum rtl_desc_qsel fw_qsel = _rtl8192cu_mq_to_descq(hw, fc, skb_get_queue_mapping(skb)); - u8 *txdesc; + u8 *txdesc8; + __le32 *txdesc; seq_number = (le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_SEQ) >> 4; rtl_get_tcb_desc(hw, info, sta, skb, tcb_desc); - txdesc = skb_push(skb, RTL_TX_HEADER_SIZE); + txdesc8 = skb_push(skb, RTL_TX_HEADER_SIZE); + txdesc = (__le32 *)txdesc8; memset(txdesc, 0, RTL_TX_HEADER_SIZE); set_tx_desc_pkt_size(txdesc, pktlen); set_tx_desc_linip(txdesc, 0); @@ -597,9 +600,11 @@ void rtl92cu_tx_fill_desc(struct ieee80211_hw *hw, RT_TRACE(rtlpriv, COMP_SEND, DBG_TRACE, "==>\n"); } -void rtl92cu_fill_fake_txdesc(struct ieee80211_hw *hw, u8 *pdesc, +void rtl92cu_fill_fake_txdesc(struct ieee80211_hw *hw, u8 *pdesc8, u32 buffer_len, bool is_pspoll) { + __le32 *pdesc = (__le32 *)pdesc8; + /* Clear all status */ memset(pdesc, 0, RTL_TX_HEADER_SIZE); set_tx_desc_first_seg(pdesc, 1); /* bFirstSeg; */ @@ -622,13 +627,14 @@ void rtl92cu_fill_fake_txdesc(struct ieee80211_hw *hw, u8 *pdesc, } void rtl92cu_tx_fill_cmddesc(struct ieee80211_hw *hw, - u8 *pdesc, bool firstseg, + u8 *pdesc8, bool firstseg, bool lastseg, struct sk_buff *skb) { struct rtl_priv *rtlpriv = rtl_priv(hw); u8 fw_queue = QSLT_BEACON; struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)(skb->data); __le16 fc = hdr->frame_control; + __le32 *pdesc = (__le32 *)pdesc8; memset((void *)pdesc, 0, RTL_TX_HEADER_SIZE); if (firstseg) diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.h b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.h index 3d8a913d799d..171fe39dfb0c 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.h +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.h @@ -73,80 +73,80 @@ struct rx_drv_info_92c { /* macros to read various fields in RX descriptor */ /* DWORD 0 */ -static inline u32 get_rx_desc_pkt_len(u8 *__rxdesc) +static inline u32 get_rx_desc_pkt_len(__le32 *__rxdesc) { - return le32_get_bits(*(__le32 *)__rxdesc, GENMASK(13, 0)); + return le32_get_bits(*__rxdesc, GENMASK(13, 0)); } -static inline u32 get_rx_desc_crc32(u8 *__rxdesc) +static inline u32 get_rx_desc_crc32(__le32 *__rxdesc) { - return le32_get_bits(*(__le32 *)__rxdesc, BIT(14)); + return le32_get_bits(*__rxdesc, BIT(14)); } -static inline u32 get_rx_desc_icv(u8 *__rxdesc) +static inline u32 get_rx_desc_icv(__le32 *__rxdesc) { - return le32_get_bits(*(__le32 *)__rxdesc, BIT(15)); + return le32_get_bits(*__rxdesc, BIT(15)); } -static inline u32 get_rx_desc_drvinfo_size(u8 *__rxdesc) +static inline u32 get_rx_desc_drvinfo_size(__le32 *__rxdesc) { - return le32_get_bits(*(__le32 *)__rxdesc, GENMASK(19, 16)); + return le32_get_bits(*__rxdesc, GENMASK(19, 16)); } -static inline u32 get_rx_desc_shift(u8 *__rxdesc) +static inline u32 get_rx_desc_shift(__le32 *__rxdesc) { - return le32_get_bits(*(__le32 *)__rxdesc, GENMASK(25, 24)); + return le32_get_bits(*__rxdesc, GENMASK(25, 24)); } -static inline u32 get_rx_desc_phy_status(u8 *__rxdesc) +static inline u32 get_rx_desc_phy_status(__le32 *__rxdesc) { - return le32_get_bits(*(__le32 *)__rxdesc, BIT(26)); + return le32_get_bits(*__rxdesc, BIT(26)); } -static inline u32 get_rx_desc_swdec(u8 *__rxdesc) +static inline u32 get_rx_desc_swdec(__le32 *__rxdesc) { - return le32_get_bits(*(__le32 *)__rxdesc, BIT(27)); + return le32_get_bits(*__rxdesc, BIT(27)); } /* DWORD 1 */ -static inline u32 get_rx_desc_paggr(u8 *__rxdesc) +static inline u32 get_rx_desc_paggr(__le32 *__rxdesc) { - return le32_get_bits(*(__le32 *)(__rxdesc + 4), BIT(14)); + return le32_get_bits(*(__rxdesc + 1), BIT(14)); } -static inline u32 get_rx_desc_faggr(u8 *__rxdesc) +static inline u32 get_rx_desc_faggr(__le32 *__rxdesc) { - return le32_get_bits(*(__le32 *)(__rxdesc + 4), BIT(15)); + return le32_get_bits(*(__rxdesc + 1), BIT(15)); } /* DWORD 3 */ -static inline u32 get_rx_desc_rx_mcs(u8 *__rxdesc) +static inline u32 get_rx_desc_rx_mcs(__le32 *__rxdesc) { - return le32_get_bits(*(__le32 *)(__rxdesc + 12), GENMASK(5, 0)); + return le32_get_bits(*(__rxdesc + 3), GENMASK(5, 0)); } -static inline u32 get_rx_desc_rx_ht(u8 *__rxdesc) +static inline u32 get_rx_desc_rx_ht(__le32 *__rxdesc) { - return le32_get_bits(*(__le32 *)(__rxdesc + 12), BIT(6)); + return le32_get_bits(*(__rxdesc + 3), BIT(6)); } -static inline u32 get_rx_desc_splcp(u8 *__rxdesc) +static inline u32 get_rx_desc_splcp(__le32 *__rxdesc) { - return le32_get_bits(*(__le32 *)(__rxdesc + 12), BIT(8)); + return le32_get_bits(*(__rxdesc + 3), BIT(8)); } -static inline u32 get_rx_desc_bw(u8 *__rxdesc) +static inline u32 get_rx_desc_bw(__le32 *__rxdesc) { - return le32_get_bits(*(__le32 *)(__rxdesc + 12), BIT(9)); + return le32_get_bits(*(__rxdesc + 3), BIT(9)); } /* DWORD 5 */ -static inline u32 get_rx_desc_tsfl(u8 *__rxdesc) +static inline u32 get_rx_desc_tsfl(__le32 *__rxdesc) { - return le32_to_cpu(*((__le32 *)(__rxdesc + 20))); + return le32_to_cpu(*((__rxdesc + 5))); } @@ -155,223 +155,223 @@ static inline u32 get_rx_desc_tsfl(u8 *__rxdesc) /* macros to set various fields in TX descriptor */ /* Dword 0 */ -static inline void set_tx_desc_pkt_size(u8 *__txdesc, u32 __value) +static inline void set_tx_desc_pkt_size(__le32 *__txdesc, u32 __value) { - le32p_replace_bits((__le32 *)__txdesc, __value, GENMASK(15, 0)); + le32p_replace_bits(__txdesc, __value, GENMASK(15, 0)); } -static inline void set_tx_desc_offset(u8 *__txdesc, u32 __value) +static inline void set_tx_desc_offset(__le32 *__txdesc, u32 __value) { - le32p_replace_bits((__le32 *)__txdesc, __value, GENMASK(23, 16)); + le32p_replace_bits(__txdesc, __value, GENMASK(23, 16)); } -static inline void set_tx_desc_bmc(u8 *__txdesc, u32 __value) +static inline void set_tx_desc_bmc(__le32 *__txdesc, u32 __value) { - le32p_replace_bits((__le32 *)__txdesc, __value, BIT(24)); + le32p_replace_bits(__txdesc, __value, BIT(24)); } -static inline void set_tx_desc_htc(u8 *__txdesc, u32 __value) +static inline void set_tx_desc_htc(__le32 *__txdesc, u32 __value) { - le32p_replace_bits((__le32 *)__txdesc, __value, BIT(25)); + le32p_replace_bits(__txdesc, __value, BIT(25)); } -static inline void set_tx_desc_last_seg(u8 *__txdesc, u32 __value) +static inline void set_tx_desc_last_seg(__le32 *__txdesc, u32 __value) { - le32p_replace_bits((__le32 *)__txdesc, __value, BIT(26)); + le32p_replace_bits(__txdesc, __value, BIT(26)); } -static inline void set_tx_desc_first_seg(u8 *__txdesc, u32 __value) +static inline void set_tx_desc_first_seg(__le32 *__txdesc, u32 __value) { - le32p_replace_bits((__le32 *)__txdesc, __value, BIT(27)); + le32p_replace_bits(__txdesc, __value, BIT(27)); } -static inline void set_tx_desc_linip(u8 *__txdesc, u32 __value) +static inline void set_tx_desc_linip(__le32 *__txdesc, u32 __value) { - le32p_replace_bits((__le32 *)__txdesc, __value, BIT(28)); + le32p_replace_bits(__txdesc, __value, BIT(28)); } -static inline void set_tx_desc_own(u8 *__txdesc, u32 __value) +static inline void set_tx_desc_own(__le32 *__txdesc, u32 __value) { - le32p_replace_bits((__le32 *)__txdesc, __value, BIT(31)); + le32p_replace_bits(__txdesc, __value, BIT(31)); } /* Dword 1 */ -static inline void set_tx_desc_macid(u8 *__txdesc, u32 __value) +static inline void set_tx_desc_macid(__le32 *__txdesc, u32 __value) { - le32p_replace_bits((__le32 *)(__txdesc + 4), __value, GENMASK(4, 0)); + le32p_replace_bits((__txdesc + 1), __value, GENMASK(4, 0)); } -static inline void set_tx_desc_agg_enable(u8 *__txdesc, u32 __value) +static inline void set_tx_desc_agg_enable(__le32 *__txdesc, u32 __value) { - le32p_replace_bits((__le32 *)(__txdesc + 4), __value, BIT(5)); + le32p_replace_bits((__txdesc + 1), __value, BIT(5)); } -static inline void set_tx_desc_agg_break(u8 *__txdesc, u32 __value) +static inline void set_tx_desc_agg_break(__le32 *__txdesc, u32 __value) { - le32p_replace_bits((__le32 *)(__txdesc + 4), __value, BIT(6)); + le32p_replace_bits((__txdesc + 1), __value, BIT(6)); } -static inline void set_tx_desc_rdg_enable(u8 *__txdesc, u32 __value) +static inline void set_tx_desc_rdg_enable(__le32 *__txdesc, u32 __value) { - le32p_replace_bits((__le32 *)(__txdesc + 4), __value, BIT(7)); + le32p_replace_bits((__txdesc + 1), __value, BIT(7)); } -static inline void set_tx_desc_queue_sel(u8 *__txdesc, u32 __value) +static inline void set_tx_desc_queue_sel(__le32 *__txdesc, u32 __value) { - le32p_replace_bits((__le32 *)(__txdesc + 4), __value, GENMASK(12, 8)); + le32p_replace_bits((__txdesc + 1), __value, GENMASK(12, 8)); } -static inline void set_tx_desc_rate_id(u8 *__txdesc, u32 __value) +static inline void set_tx_desc_rate_id(__le32 *__txdesc, u32 __value) { - le32p_replace_bits((__le32 *)(__txdesc + 4), __value, GENMASK(19, 16)); + le32p_replace_bits((__txdesc + 1), __value, GENMASK(19, 16)); } -static inline void set_tx_desc_nav_use_hdr(u8 *__txdesc, u32 __value) +static inline void set_tx_desc_nav_use_hdr(__le32 *__txdesc, u32 __value) { - le32p_replace_bits((__le32 *)(__txdesc + 4), __value, BIT(20)); + le32p_replace_bits((__txdesc + 1), __value, BIT(20)); } -static inline void set_tx_desc_sec_type(u8 *__txdesc, u32 __value) +static inline void set_tx_desc_sec_type(__le32 *__txdesc, u32 __value) { - le32p_replace_bits((__le32 *)(__txdesc + 4), __value, GENMASK(23, 22)); + le32p_replace_bits((__txdesc + 1), __value, GENMASK(23, 22)); } -static inline void set_tx_desc_pkt_offset(u8 *__txdesc, u32 __value) +static inline void set_tx_desc_pkt_offset(__le32 *__txdesc, u32 __value) { - le32p_replace_bits((__le32 *)(__txdesc + 4), __value, GENMASK(30, 26)); + le32p_replace_bits((__txdesc + 1), __value, GENMASK(30, 26)); } /* Dword 2 */ -static inline void set_tx_desc_more_frag(u8 *__txdesc, u32 __value) +static inline void set_tx_desc_more_frag(__le32 *__txdesc, u32 __value) { - le32p_replace_bits((__le32 *)(__txdesc + 8), __value, BIT(17)); + le32p_replace_bits((__txdesc + 2), __value, BIT(17)); } -static inline void set_tx_desc_ampdu_density(u8 *__txdesc, u32 __value) +static inline void set_tx_desc_ampdu_density(__le32 *__txdesc, u32 __value) { - le32p_replace_bits((__le32 *)(__txdesc + 8), __value, GENMASK(22, 20)); + le32p_replace_bits((__txdesc + 2), __value, GENMASK(22, 20)); } /* Dword 3 */ -static inline void set_tx_desc_seq(u8 *__txdesc, u32 __value) +static inline void set_tx_desc_seq(__le32 *__txdesc, u32 __value) { - le32p_replace_bits((__le32 *)(__txdesc + 12), __value, GENMASK(27, 16)); + le32p_replace_bits((__txdesc + 3), __value, GENMASK(27, 16)); } -static inline void set_tx_desc_pkt_id(u8 *__txdesc, u32 __value) +static inline void set_tx_desc_pkt_id(__le32 *__txdesc, u32 __value) { - le32p_replace_bits((__le32 *)(__txdesc + 12), __value, GENMASK(31, 28)); + le32p_replace_bits((__txdesc + 3), __value, GENMASK(31, 28)); } /* Dword 4 */ -static inline void set_tx_desc_rts_rate(u8 *__txdesc, u32 __value) +static inline void set_tx_desc_rts_rate(__le32 *__txdesc, u32 __value) { - le32p_replace_bits((__le32 *)(__txdesc + 16), __value, GENMASK(4, 0)); + le32p_replace_bits((__txdesc + 4), __value, GENMASK(4, 0)); } -static inline void set_tx_desc_qos(u8 *__txdesc, u32 __value) +static inline void set_tx_desc_qos(__le32 *__txdesc, u32 __value) { - le32p_replace_bits((__le32 *)(__txdesc + 16), __value, BIT(6)); + le32p_replace_bits((__txdesc + 4), __value, BIT(6)); } -static inline void set_tx_desc_hwseq_en(u8 *__txdesc, u32 __value) +static inline void set_tx_desc_hwseq_en(__le32 *__txdesc, u32 __value) { - le32p_replace_bits((__le32 *)(__txdesc + 16), __value, BIT(7)); + le32p_replace_bits((__txdesc + 4), __value, BIT(7)); } -static inline void set_tx_desc_use_rate(u8 *__txdesc, u32 __value) +static inline void set_tx_desc_use_rate(__le32 *__txdesc, u32 __value) { - le32p_replace_bits((__le32 *)(__txdesc + 16), __value, BIT(8)); + le32p_replace_bits((__txdesc + 4), __value, BIT(8)); } -static inline void set_tx_desc_disable_fb(u8 *__txdesc, u32 __value) +static inline void set_tx_desc_disable_fb(__le32 *__txdesc, u32 __value) { - le32p_replace_bits((__le32 *)(__txdesc + 16), __value, BIT(10)); + le32p_replace_bits((__txdesc + 4), __value, BIT(10)); } -static inline void set_tx_desc_cts2self(u8 *__txdesc, u32 __value) +static inline void set_tx_desc_cts2self(__le32 *__txdesc, u32 __value) { - le32p_replace_bits((__le32 *)(__txdesc + 16), __value, BIT(11)); + le32p_replace_bits((__txdesc + 4), __value, BIT(11)); } -static inline void set_tx_desc_rts_enable(u8 *__txdesc, u32 __value) +static inline void set_tx_desc_rts_enable(__le32 *__txdesc, u32 __value) { - le32p_replace_bits((__le32 *)(__txdesc + 16), __value, BIT(12)); + le32p_replace_bits((__txdesc + 4), __value, BIT(12)); } -static inline void set_tx_desc_hw_rts_enable(u8 *__txdesc, u32 __value) +static inline void set_tx_desc_hw_rts_enable(__le32 *__txdesc, u32 __value) { - le32p_replace_bits((__le32 *)(__txdesc + 16), __value, BIT(13)); + le32p_replace_bits((__txdesc + 4), __value, BIT(13)); } -static inline void set_tx_desc_data_sc(u8 *__txdesc, u32 __value) +static inline void set_tx_desc_data_sc(__le32 *__txdesc, u32 __value) { - le32p_replace_bits((__le32 *)(__txdesc + 16), __value, GENMASK(21, 20)); + le32p_replace_bits((__txdesc + 4), __value, GENMASK(21, 20)); } -static inline void set_tx_desc_data_bw(u8 *__txdesc, u32 __value) +static inline void set_tx_desc_data_bw(__le32 *__txdesc, u32 __value) { - le32p_replace_bits((__le32 *)(__txdesc + 16), __value, BIT(25)); + le32p_replace_bits((__txdesc + 4), __value, BIT(25)); } -static inline void set_tx_desc_rts_short(u8 *__txdesc, u32 __value) +static inline void set_tx_desc_rts_short(__le32 *__txdesc, u32 __value) { - le32p_replace_bits((__le32 *)(__txdesc + 16), __value, BIT(26)); + le32p_replace_bits((__txdesc + 4), __value, BIT(26)); } -static inline void set_tx_desc_rts_bw(u8 *__txdesc, u32 __value) +static inline void set_tx_desc_rts_bw(__le32 *__txdesc, u32 __value) { - le32p_replace_bits((__le32 *)(__txdesc + 16), __value, BIT(27)); + le32p_replace_bits((__txdesc + 4), __value, BIT(27)); } -static inline void set_tx_desc_rts_sc(u8 *__txdesc, u32 __value) +static inline void set_tx_desc_rts_sc(__le32 *__txdesc, u32 __value) { - le32p_replace_bits((__le32 *)(__txdesc + 16), __value, GENMASK(29, 28)); + le32p_replace_bits((__txdesc + 4), __value, GENMASK(29, 28)); } -static inline void set_tx_desc_rts_stbc(u8 *__txdesc, u32 __value) +static inline void set_tx_desc_rts_stbc(__le32 *__txdesc, u32 __value) { - le32p_replace_bits((__le32 *)(__txdesc + 16), __value, GENMASK(31, 30)); + le32p_replace_bits((__txdesc + 4), __value, GENMASK(31, 30)); } /* Dword 5 */ -static inline void set_tx_desc_tx_rate(u8 *__pdesc, u32 __val) +static inline void set_tx_desc_tx_rate(__le32 *__pdesc, u32 __val) { - le32p_replace_bits((__le32 *)(__pdesc + 20), __val, GENMASK(5, 0)); + le32p_replace_bits((__pdesc + 5), __val, GENMASK(5, 0)); } -static inline void set_tx_desc_data_shortgi(u8 *__pdesc, u32 __val) +static inline void set_tx_desc_data_shortgi(__le32 *__pdesc, u32 __val) { - le32p_replace_bits((__le32 *)(__pdesc + 20), __val, BIT(6)); + le32p_replace_bits((__pdesc + 5), __val, BIT(6)); } -static inline void set_tx_desc_data_rate_fb_limit(u8 *__txdesc, u32 __value) +static inline void set_tx_desc_data_rate_fb_limit(__le32 *__txdesc, u32 __value) { - le32p_replace_bits((__le32 *)(__txdesc + 20), __value, GENMASK(12, 8)); + le32p_replace_bits((__txdesc + 5), __value, GENMASK(12, 8)); } -static inline void set_tx_desc_rts_rate_fb_limit(u8 *__txdesc, u32 __value) +static inline void set_tx_desc_rts_rate_fb_limit(__le32 *__txdesc, u32 __value) { - le32p_replace_bits((__le32 *)(__txdesc + 20), __value, GENMASK(16, 13)); + le32p_replace_bits((__txdesc + 5), __value, GENMASK(16, 13)); } /* Dword 6 */ -static inline void set_tx_desc_max_agg_num(u8 *__txdesc, u32 __value) +static inline void set_tx_desc_max_agg_num(__le32 *__txdesc, u32 __value) { - le32p_replace_bits((__le32 *)(__txdesc + 24), __value, GENMASK(15, 11)); + le32p_replace_bits((__txdesc + 6), __value, GENMASK(15, 11)); } /* Dword 7 */ -static inline void set_tx_desc_tx_desc_checksum(u8 *__txdesc, u32 __value) +static inline void set_tx_desc_tx_desc_checksum(__le32 *__txdesc, u32 __value) { - le32p_replace_bits((__le32 *)(__txdesc + 28), __value, GENMASK(15, 0)); + le32p_replace_bits((__txdesc + 7), __value, GENMASK(15, 0)); }