Linux MultiMedia Card development
 help / color / mirror / Atom feed
From: Ping-Ke Shih <pkshih@realtek.com>
To: Fiona Klute <fiona.klute@gmx.de>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Cc: "kvalo@kernel.org" <kvalo@kernel.org>,
	"ulf.hansson@linaro.org" <ulf.hansson@linaro.org>,
	"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>,
	"pavel@ucw.cz" <pavel@ucw.cz>, "megi@xff.cz" <megi@xff.cz>
Subject: RE: [PATCH v2 5/9] wifi: rtw88: Add rtw8703b.c
Date: Fri, 1 Mar 2024 02:33:07 +0000	[thread overview]
Message-ID: <3805850d51334319984bc304ca1dc3c4@realtek.com> (raw)
In-Reply-To: <20240227235507.781615-6-fiona.klute@gmx.de>



> -----Original Message-----
> From: Fiona Klute <fiona.klute@gmx.de>
> Sent: Wednesday, February 28, 2024 7:55 AM
> To: linux-wireless@vger.kernel.org; Ping-Ke Shih <pkshih@realtek.com>
> Cc: Fiona Klute <fiona.klute@gmx.de>; kvalo@kernel.org; ulf.hansson@linaro.org; linux-mmc@vger.kernel.org;
> pavel@ucw.cz; megi@xff.cz
> Subject: [PATCH v2 5/9] wifi: rtw88: Add rtw8703b.c
> 
> This is the main source for the new rtw88_8703b chip driver.
> 
> Acked-by: Ping-Ke Shih <pkshih@realtek.com>
> Tested-by: Pavel Machek <pavel@ucw.cz>
> Signed-off-by: Fiona Klute <fiona.klute@gmx.de>
> ---
>  drivers/net/wireless/realtek/rtw88/rtw8703b.c | 2112 +++++++++++++++++
>  1 file changed, 2112 insertions(+)
>  create mode 100644 drivers/net/wireless/realtek/rtw88/rtw8703b.c
> 
> diff --git a/drivers/net/wireless/realtek/rtw88/rtw8703b.c
> b/drivers/net/wireless/realtek/rtw88/rtw8703b.c
> new file mode 100644
> index 00000000000..83b1da60eb4
> --- /dev/null
> +++ b/drivers/net/wireless/realtek/rtw88/rtw8703b.c
> @@ -0,0 +1,2112 @@
> +// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
> +/* Copyright Fiona Klute <fiona.klute@gmx.de> */
> +
> +#include <linux/of_net.h>
> +#include "main.h"
> +#include "coex.h"
> +#include "debug.h"
> +#include "mac.h"
> +#include "phy.h"
> +#include "reg.h"
> +#include "rx.h"
> +#include "rtw8703b.h"
> +#include "rtw8703b_tables.h"
> +#include "rtw8723x.h"
> +
> +#define GET_RX_DESC_BW(rxdesc)                                              \
> +       (le32_get_bits(*((__le32 *)(rxdesc) + 0x04), GENMASK(31, 24)))

Can we move this to rx.h GET_RX_DESC_xxx()? 

> +
> +#define BIT_MASK_TXQ_INIT (BIT(7))
> +#define WLAN_RL_VAL 0x3030
> +/* disable BAR */
> +#define WLAN_BAR_VAL 0x0201ffff
> +#define WLAN_PIFS_VAL 0
> +#define WLAN_RX_PKT_LIMIT 0x18
> +#define WLAN_SLOT_TIME 0x09
> +#define WLAN_SPEC_SIFS 0x100a
> +#define WLAN_MAX_AGG_NR 0x1f
> +#define WLAN_AMPDU_MAX_TIME 0x70
> +
> +/* unit is 32us */
> +#define TBTT_PROHIBIT_SETUP_TIME 0x04
> +#define TBTT_PROHIBIT_HOLD_TIME 0x80
> +#define TBTT_PROHIBIT_HOLD_TIME_STOP_BCN 0x64
> +
> +/* raw pkt_stat->drv_info_sz is in unit of 8-bytes */
> +#define RX_DRV_INFO_SZ_UNIT_8703B 8
> +
> +#define TRANS_SEQ_END                  \
> +       {0xFFFF,                        \
> +        RTW_PWR_CUT_ALL_MSK,           \
> +        RTW_PWR_INTF_ALL_MSK,          \
> +        0,                             \
> +        RTW_PWR_CMD_END, 0, 0}

Move this macro to main.h along with RTW_PWR_CUT_ALL_MSK.

> +
> +static void rtw8703b_cfg_notch(struct rtw_dev *rtwdev, u8 channel, bool notch)
> +{
> +       if (!notch) {
> +               rtw_write32_mask(rtwdev, REG_OFDM0_RXDSP, BIT_MASK_RXDSP, 0x1f);
> +               rtw_write32_mask(rtwdev, REG_OFDM0_RXDSP, BIT_EN_RXDSP, 0x0);
> +               rtw_write32(rtwdev, REG_OFDM1_CSI1, 0x00000000);
> +               rtw_write32(rtwdev, REG_OFDM1_CSI2, 0x00000000);
> +               rtw_write32(rtwdev, REG_OFDM1_CSI3, 0x00000000);
> +               rtw_write32(rtwdev, REG_OFDM1_CSI4, 0x00000000);
> +               rtw_write32_mask(rtwdev, REG_OFDM1_CFOTRK, BIT_EN_CFOTRK, 0x0);
> +               return;
> +       }
> +
> +       switch (channel) {
> +       case 5:
> +               fallthrough;

no need fallthrough unless you do something by case 5.

> +       case 13:
> +               rtw_write32_mask(rtwdev, REG_OFDM0_RXDSP, BIT_MASK_RXDSP, 0xb);
> +               rtw_write32_mask(rtwdev, REG_OFDM0_RXDSP, BIT_EN_RXDSP, 0x1);
> +               rtw_write32(rtwdev, REG_OFDM1_CSI1, 0x06000000);
> +               rtw_write32(rtwdev, REG_OFDM1_CSI2, 0x00000000);
> +               rtw_write32(rtwdev, REG_OFDM1_CSI3, 0x00000000);
> +               rtw_write32(rtwdev, REG_OFDM1_CSI4, 0x00000000);
> +               rtw_write32_mask(rtwdev, REG_OFDM1_CFOTRK, BIT_EN_CFOTRK, 0x1);
> +               break;

[...]





  reply	other threads:[~2024-03-01  2:33 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-27 23:54 [PATCH v2 0/9] rtw88: Add support for RTL8723CS/RTL8703B Fiona Klute
2024-02-27 23:54 ` [PATCH v2 1/9] wifi: rtw88: Shared module for rtw8723x devices Fiona Klute
2024-02-27 23:54 ` [PATCH v2 2/9] wifi: rtw88: Debug output for rtw8723x EFUSE Fiona Klute
2024-02-27 23:54 ` [PATCH v2 3/9] wifi: rtw88: Add definitions for 8703b chip Fiona Klute
2024-02-27 23:54 ` [PATCH v2 4/9] wifi: rtw88: Add rtw8703b.h Fiona Klute
2024-03-01  2:09   ` Ping-Ke Shih
2024-03-01 16:35     ` Fiona Klute
2024-03-01 17:15       ` Fiona Klute
2024-03-02  0:35         ` Ping-Ke Shih
2024-03-02  0:33       ` Ping-Ke Shih
2024-03-02  0:57         ` Fiona Klute
2024-02-27 23:54 ` [PATCH v2 5/9] wifi: rtw88: Add rtw8703b.c Fiona Klute
2024-03-01  2:33   ` Ping-Ke Shih [this message]
2024-03-01  4:36     ` Ping-Ke Shih
2024-03-01 16:54       ` Fiona Klute
2024-02-27 23:55 ` [PATCH v2 6/9] wifi: rtw88: Add rtw8703b_tables.h Fiona Klute
2024-02-27 23:55 ` [PATCH v2 7/9] wifi: rtw88: Add rtw8703b_tables.c Fiona Klute
2024-03-01  2:36   ` Ping-Ke Shih
2024-03-01 16:46     ` Fiona Klute
2024-03-02  0:28       ` Ping-Ke Shih
2024-02-27 23:55 ` [PATCH v2 8/9] wifi: rtw88: Reset 8703b firmware before download Fiona Klute
2024-02-27 23:55 ` [PATCH v2 9/9] wifi: rtw88: SDIO device driver for RTL8723CS Fiona Klute
2024-03-01  2:39   ` Ping-Ke Shih
2024-02-29  6:40 ` [PATCH v2 0/9] rtw88: Add support for RTL8723CS/RTL8703B Ping-Ke Shih
2024-03-01  0:45   ` Fiona Klute
2024-03-01  0:57     ` Ping-Ke Shih

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3805850d51334319984bc304ca1dc3c4@realtek.com \
    --to=pkshih@realtek.com \
    --cc=fiona.klute@gmx.de \
    --cc=kvalo@kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=megi@xff.cz \
    --cc=pavel@ucw.cz \
    --cc=ulf.hansson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox