linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Icenowy Zheng <icenowy@aosc.io>
To: Sascha Hauer <s.hauer@pengutronix.de>, linux-wireless@vger.kernel.org
Cc: Neo Jou <neojou@gmail.com>, Hans Ulli Kroll <linux@ulli-kroll.de>,
	Ping-Ke Shih <pkshih@realtek.com>,
	Yan-Hsuan Chuang <tony0620emma@gmail.com>,
	Kalle Valo <kvalo@kernel.org>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	kernel@pengutronix.de, Johannes Berg <johannes@sipsolutions.net>
Subject: Re: [PATCH 07/10] rtw88: Add rtw8723du chipset support
Date: Mon, 30 May 2022 14:34:12 +0800	[thread overview]
Message-ID: <8e357eaea90e49d7d23bdb83ead4f0da870c3689.camel@aosc.io> (raw)
In-Reply-To: <20220518082318.3898514-8-s.hauer@pengutronix.de>

在 2022-05-18星期三的 10:23 +0200,Sascha Hauer写道:
> Add support for the rtw8723du chipset based on
> https://github.com/ulli-kroll/rtw88-usb.git
> 
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> Reported-by: kernel test robot <lkp@intel.com>
> ---
>  drivers/net/wireless/realtek/rtw88/Kconfig    | 11 +++++
>  drivers/net/wireless/realtek/rtw88/Makefile   |  3 ++
>  drivers/net/wireless/realtek/rtw88/rtw8723d.c | 19 +++++++++
>  drivers/net/wireless/realtek/rtw88/rtw8723d.h |  1 +
>  .../net/wireless/realtek/rtw88/rtw8723du.c    | 40
> +++++++++++++++++++
>  .../net/wireless/realtek/rtw88/rtw8723du.h    | 13 ++++++
>  6 files changed, 87 insertions(+)
>  create mode 100644 drivers/net/wireless/realtek/rtw88/rtw8723du.c
>  create mode 100644 drivers/net/wireless/realtek/rtw88/rtw8723du.h
> 
> diff --git a/drivers/net/wireless/realtek/rtw88/Kconfig
> b/drivers/net/wireless/realtek/rtw88/Kconfig
> index 1624c5db69bac..ad1ac453015a9 100644
> --- a/drivers/net/wireless/realtek/rtw88/Kconfig
> +++ b/drivers/net/wireless/realtek/rtw88/Kconfig
> @@ -64,6 +64,17 @@ config RTW88_8723DE
>  
>           802.11n PCIe wireless network adapter
>  
> +config RTW88_8723DU
> +       tristate "Realtek 8723DU USB wireless network adapter"
> +       depends on USB
> +       select RTW88_CORE
> +       select RTW88_USB
> +       select RTW88_8723D
> +       help
> +         Select this option will enable support for 8723DU chipset
> +
> +         802.11n USB wireless network adapter
> +
>  config RTW88_8821CE
>         tristate "Realtek 8821CE PCI wireless network adapter"
>         depends on PCI
> diff --git a/drivers/net/wireless/realtek/rtw88/Makefile
> b/drivers/net/wireless/realtek/rtw88/Makefile
> index 9e095f8181483..eb26c215fcde3 100644
> --- a/drivers/net/wireless/realtek/rtw88/Makefile
> +++ b/drivers/net/wireless/realtek/rtw88/Makefile
> @@ -38,6 +38,9 @@ rtw88_8723d-objs              := rtw8723d.o
> rtw8723d_table.o
>  obj-$(CONFIG_RTW88_8723DE)     += rtw88_8723de.o
>  rtw88_8723de-objs              := rtw8723de.o
>  
> +obj-$(CONFIG_RTW88_8723DU)     += rtw88_8723du.o
> +rtw88_8723du-objs              := rtw8723du.o
> +
>  obj-$(CONFIG_RTW88_8821C)      += rtw88_8821c.o
>  rtw88_8821c-objs               := rtw8821c.o rtw8821c_table.o
>  
> diff --git a/drivers/net/wireless/realtek/rtw88/rtw8723d.c
> b/drivers/net/wireless/realtek/rtw88/rtw8723d.c
> index ad2b323a0423c..ccd23902756e1 100644
> --- a/drivers/net/wireless/realtek/rtw88/rtw8723d.c
> +++ b/drivers/net/wireless/realtek/rtw88/rtw8723d.c
> @@ -210,6 +210,12 @@ static void rtw8723de_efuse_parsing(struct
> rtw_efuse *efuse,
>         ether_addr_copy(efuse->addr, map->e.mac_addr);
>  }
>  
> +static void rtw8723du_efuse_parsing(struct rtw_efuse *efuse,
> +                                   struct rtw8723d_efuse *map)
> +{
> +       ether_addr_copy(efuse->addr, map->u.mac_addr);
> +}
> +
>  static int rtw8723d_read_efuse(struct rtw_dev *rtwdev, u8 *log_map)
>  {
>         struct rtw_efuse *efuse = &rtwdev->efuse;
> @@ -239,6 +245,9 @@ static int rtw8723d_read_efuse(struct rtw_dev
> *rtwdev, u8 *log_map)
>         case RTW_HCI_TYPE_PCIE:
>                 rtw8723de_efuse_parsing(efuse, map);
>                 break;
> +       case RTW_HCI_TYPE_USB:
> +               rtw8723du_efuse_parsing(efuse, map);
> +               break;
>         default:
>                 /* unsupported now */
>                 return -ENOTSUPP;
> @@ -1945,6 +1954,15 @@ static void rtw8723d_pwr_track(struct rtw_dev
> *rtwdev)
>         dm_info->pwr_trk_triggered = false;
>  }
>  
> +static void rtw8723d_fill_txdesc_checksum(struct rtw_dev *rtwdev,
> +                                         struct rtw_tx_pkt_info
> *pkt_info,
> +                                         u8 *txdesc)
> +{
> +       size_t words = 32 / 2; /* calculate the first 32 bytes (16
> words) */
> +
> +       fill_txdesc_checksum_common(txdesc, words);
> +}
> +
>  static struct rtw_chip_ops rtw8723d_ops = {
>         .phy_set_param          = rtw8723d_phy_set_param,
>         .read_efuse             = rtw8723d_read_efuse,
> @@ -1965,6 +1983,7 @@ static struct rtw_chip_ops rtw8723d_ops = {
>         .config_bfee            = NULL,
>         .set_gid_table          = NULL,
>         .cfg_csi_rate           = NULL,
> +       .fill_txdesc_checksum   = rtw8723d_fill_txdesc_checksum,
>  
>         .coex_set_init          = rtw8723d_coex_cfg_init,
>         .coex_set_ant_switch    = NULL,
> diff --git a/drivers/net/wireless/realtek/rtw88/rtw8723d.h
> b/drivers/net/wireless/realtek/rtw88/rtw8723d.h
> index 41d35174a5425..8113bd97edf57 100644
> --- a/drivers/net/wireless/realtek/rtw88/rtw8723d.h
> +++ b/drivers/net/wireless/realtek/rtw88/rtw8723d.h
> @@ -70,6 +70,7 @@ struct rtw8723d_efuse {
>         u8 country_code[2];
>         u8 res[3];
>         struct rtw8723de_efuse e;
> +       struct rtw8723de_efuse u;

The code here looks ridiculously wrong.

Should there be a rtw8723du_efuse struct and an union here?

BTW I found that Ulli's rtw88-usb repo has the same error, but I doubt
whether 8723du support is tested there.

>  };
>  
>  /* phy status page0 */
> diff --git a/drivers/net/wireless/realtek/rtw88/rtw8723du.c
> b/drivers/net/wireless/realtek/rtw88/rtw8723du.c
> new file mode 100644
> index 0000000000000..910f64c168131
> --- /dev/null
> +++ b/drivers/net/wireless/realtek/rtw88/rtw8723du.c
> @@ -0,0 +1,40 @@
> +// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
> +/* Copyright(c) 2018-2019  Realtek Corporation
> + */
> +
> +#include <linux/module.h>
> +#include <linux/usb.h>
> +#include "main.h"
> +#include "rtw8723du.h"
> +#include "usb.h"
> +
> +static const struct usb_device_id rtw_8723du_id_table[] = {
> +       /*
> +        * ULLI :
> +        * ID found in rtw8822bu sources
> +        */
> +       { USB_DEVICE_AND_INTERFACE_INFO(RTW_USB_VENDOR_ID_REALTEK,
> +                                       0xD723,
> +                                       0xff, 0xff, 0xff),
> +         .driver_info = (kernel_ulong_t)&(rtw8723d_hw_spec) }, /*
> 8723DU 1*1 */
> +       { },
> +};
> +MODULE_DEVICE_TABLE(usb, rtw_8723du_id_table);
> +
> +static int rtw8723du_probe(struct usb_interface *intf,
> +                           const struct usb_device_id *id)
> +{
> +       return rtw_usb_probe(intf, id);
> +}
> +
> +static struct usb_driver rtw_8723du_driver = {
> +       .name = "rtw_8723du",
> +       .id_table = rtw_8723du_id_table,
> +       .probe = rtw8723du_probe,
> +       .disconnect = rtw_usb_disconnect,
> +};
> +module_usb_driver(rtw_8723du_driver);
> +
> +MODULE_AUTHOR("Hans Ulli Kroll <linux@ulli-kroll.de>");
> +MODULE_DESCRIPTION("Realtek 802.11n wireless 8723du driver");
> +MODULE_LICENSE("Dual BSD/GPL");
> diff --git a/drivers/net/wireless/realtek/rtw88/rtw8723du.h
> b/drivers/net/wireless/realtek/rtw88/rtw8723du.h
> new file mode 100644
> index 0000000000000..2e069f65c0551
> --- /dev/null
> +++ b/drivers/net/wireless/realtek/rtw88/rtw8723du.h
> @@ -0,0 +1,13 @@
> +/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
> +/* Copyright(c) 2018-2019  Realtek Corporation
> + */
> +
> +#ifndef __RTW_8723DU_H_
> +#define __RTW_8723DU_H_
> +
> +/* USB Vendor/Product IDs */
> +#define RTW_USB_VENDOR_ID_REALTEK              0x0BDA
> +
> +extern struct rtw_chip_info rtw8723d_hw_spec;
> +
> +#endif



  parent reply	other threads:[~2022-05-30  6:34 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-18  8:23 [PATCH 00/10] RTW88: Add support for USB variants Sascha Hauer
2022-05-18  8:23 ` [PATCH 01/10] rtw88: Call rtw_fw_beacon_filter_config() with rtwdev->mutex held Sascha Hauer
2022-05-18  8:23 ` [PATCH 02/10] rtw88: Drop rf_lock Sascha Hauer
2022-05-20  3:49   ` Pkshih
2022-05-20  6:54     ` s.hauer
2022-05-18  8:23 ` [PATCH 03/10] rtw88: Drop h2c.lock Sascha Hauer
2022-05-18  8:23 ` [PATCH 04/10] rtw88: Drop coex mutex Sascha Hauer
2022-05-18  8:23 ` [PATCH 05/10] rtw88: Do not access registers while atomic Sascha Hauer
2022-05-20  6:06   ` Pkshih
2022-05-20  7:07     ` s.hauer
2022-05-20 17:32   ` Larry Finger
2022-05-18  8:23 ` [PATCH 06/10] rtw88: Add common USB chip support Sascha Hauer
2022-05-18  8:32   ` Sascha Hauer
2022-05-18  8:34     ` Johannes Berg
2022-05-19 13:58       ` Sascha Hauer
2022-05-20  7:39   ` Pkshih
2022-05-20  8:51     ` s.hauer
2022-05-20  9:23       ` Pkshih
2022-05-20 18:33   ` Larry Finger
2022-05-23  4:07   ` Hans Ulli Kroll
2022-05-18  8:23 ` [PATCH 07/10] rtw88: Add rtw8723du chipset support Sascha Hauer
2022-05-18 16:55   ` kernel test robot
2022-05-20  7:47   ` Pkshih
2022-05-20  8:16     ` s.hauer
2022-05-30  6:34   ` Icenowy Zheng [this message]
2022-05-18  8:23 ` [PATCH 08/10] rtw88: Add rtw8821cu " Sascha Hauer
2022-05-20  7:56   ` Pkshih
2022-05-18  8:23 ` [PATCH 09/10] rtw88: Add rtw8822bu " Sascha Hauer
2022-05-20  7:58   ` Pkshih
2022-05-23 11:56   ` Rin Cat (鈴猫)
2022-05-23 12:34     ` Sascha Hauer
2022-05-18  8:23 ` [PATCH 10/10] rtw88: Add rtw8822cu " Sascha Hauer
2022-05-20  8:03   ` Pkshih
2022-05-20  8:56     ` s.hauer
2022-05-23  4:07 ` [PATCH 00/10] RTW88: Add support for USB variants Hans Ulli Kroll
2022-05-23  6:53   ` Sascha Hauer
2022-05-23 11:39     ` Ping-Ke Shih
2022-05-24  6:54       ` s.hauer
2022-05-23 10:13   ` Sascha Hauer
2022-05-30  9:25 ` Kalle Valo
2022-05-30  9:52   ` Sascha Hauer
2022-05-30 10:07     ` Kalle Valo
2022-05-30 10:16       ` Sascha Hauer

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=8e357eaea90e49d7d23bdb83ead4f0da870c3689.camel@aosc.io \
    --to=icenowy@aosc.io \
    --cc=johannes@sipsolutions.net \
    --cc=kernel@pengutronix.de \
    --cc=kvalo@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linux@ulli-kroll.de \
    --cc=martin.blumenstingl@googlemail.com \
    --cc=neojou@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pkshih@realtek.com \
    --cc=s.hauer@pengutronix.de \
    --cc=tony0620emma@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).