mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-04-16 04:13:31 +00:00
rtw88: move usb part out of backport tree
Create a useless driver to avoid affecting the backport tree.
This commit is contained in:
parent
9364fa6e6c
commit
09c81d9274
@ -1,12 +0,0 @@
|
|||||||
--- a/drivers/net/wireless/realtek/rtw88/mac80211.c
|
|
||||||
+++ b/drivers/net/wireless/realtek/rtw88/mac80211.c
|
|
||||||
@@ -455,8 +455,8 @@ static int rtw_ops_sta_remove(struct iee
|
|
||||||
{
|
|
||||||
struct rtw_dev *rtwdev = hw->priv;
|
|
||||||
|
|
||||||
- rtw_fw_beacon_filter_config(rtwdev, false, vif);
|
|
||||||
mutex_lock(&rtwdev->mutex);
|
|
||||||
+ rtw_fw_beacon_filter_config(rtwdev, false, vif);
|
|
||||||
rtw_sta_remove(rtwdev, sta, true);
|
|
||||||
mutex_unlock(&rtwdev->mutex);
|
|
||||||
|
|
@ -1,60 +0,0 @@
|
|||||||
--- a/drivers/net/wireless/realtek/rtw88/coex.c
|
|
||||||
+++ b/drivers/net/wireless/realtek/rtw88/coex.c
|
|
||||||
@@ -606,7 +606,7 @@ static struct sk_buff *rtw_coex_info_req
|
|
||||||
struct rtw_coex *coex = &rtwdev->coex;
|
|
||||||
struct sk_buff *skb_resp = NULL;
|
|
||||||
|
|
||||||
- mutex_lock(&coex->mutex);
|
|
||||||
+ lockdep_assert_held(&rtwdev->mutex);
|
|
||||||
|
|
||||||
rtw_fw_query_bt_mp_info(rtwdev, req);
|
|
||||||
|
|
||||||
@@ -623,7 +623,6 @@ static struct sk_buff *rtw_coex_info_req
|
|
||||||
}
|
|
||||||
|
|
||||||
out:
|
|
||||||
- mutex_unlock(&coex->mutex);
|
|
||||||
return skb_resp;
|
|
||||||
}
|
|
||||||
|
|
||||||
--- a/drivers/net/wireless/realtek/rtw88/debug.c
|
|
||||||
+++ b/drivers/net/wireless/realtek/rtw88/debug.c
|
|
||||||
@@ -794,7 +794,9 @@ static int rtw_debugfs_get_coex_info(str
|
|
||||||
struct rtw_debugfs_priv *debugfs_priv = m->private;
|
|
||||||
struct rtw_dev *rtwdev = debugfs_priv->rtwdev;
|
|
||||||
|
|
||||||
+ mutex_lock(&rtwdev->mutex);
|
|
||||||
rtw_coex_display_coex_info(rtwdev, m);
|
|
||||||
+ mutex_unlock(&rtwdev->mutex);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
--- a/drivers/net/wireless/realtek/rtw88/main.c
|
|
||||||
+++ b/drivers/net/wireless/realtek/rtw88/main.c
|
|
||||||
@@ -1843,7 +1843,6 @@ int rtw_core_init(struct rtw_dev *rtwdev
|
|
||||||
spin_lock_init(&rtwdev->tx_report.q_lock);
|
|
||||||
|
|
||||||
mutex_init(&rtwdev->mutex);
|
|
||||||
- mutex_init(&rtwdev->coex.mutex);
|
|
||||||
mutex_init(&rtwdev->hal.tx_power_mutex);
|
|
||||||
|
|
||||||
init_waitqueue_head(&rtwdev->coex.wait);
|
|
||||||
@@ -1910,7 +1909,6 @@ void rtw_core_deinit(struct rtw_dev *rtw
|
|
||||||
}
|
|
||||||
|
|
||||||
mutex_destroy(&rtwdev->mutex);
|
|
||||||
- mutex_destroy(&rtwdev->coex.mutex);
|
|
||||||
mutex_destroy(&rtwdev->hal.tx_power_mutex);
|
|
||||||
}
|
|
||||||
EXPORT_SYMBOL(rtw_core_deinit);
|
|
||||||
--- a/drivers/net/wireless/realtek/rtw88/main.h
|
|
||||||
+++ b/drivers/net/wireless/realtek/rtw88/main.h
|
|
||||||
@@ -1429,8 +1429,6 @@ struct rtw_coex_stat {
|
|
||||||
};
|
|
||||||
|
|
||||||
struct rtw_coex {
|
|
||||||
- /* protects coex info request section */
|
|
||||||
- struct mutex mutex;
|
|
||||||
struct sk_buff_head queue;
|
|
||||||
wait_queue_head_t wait;
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
@ -1,198 +0,0 @@
|
|||||||
--- a/drivers/net/wireless/realtek/rtw88/Kconfig
|
|
||||||
+++ b/drivers/net/wireless/realtek/rtw88/Kconfig
|
|
||||||
@@ -87,6 +87,18 @@ config RTW88_8821CE
|
|
||||||
|
|
||||||
802.11ac PCIe wireless network adapter
|
|
||||||
|
|
||||||
+config RTW88_8821CU
|
|
||||||
+ tristate "Realtek 8821CU USB wireless network adapter"
|
|
||||||
+ depends on m
|
|
||||||
+ depends on USB
|
|
||||||
+ select RTW88_CORE
|
|
||||||
+ select RTW88_USB
|
|
||||||
+ select RTW88_8821C
|
|
||||||
+ help
|
|
||||||
+ Select this option will enable support for 8821CU chipset
|
|
||||||
+
|
|
||||||
+ 802.11ac USB wireless network adapter
|
|
||||||
+
|
|
||||||
config RTW88_DEBUG
|
|
||||||
bool "Realtek rtw88 debug support"
|
|
||||||
depends on RTW88_CORE
|
|
||||||
--- a/drivers/net/wireless/realtek/rtw88/Makefile
|
|
||||||
+++ b/drivers/net/wireless/realtek/rtw88/Makefile
|
|
||||||
@@ -43,6 +43,9 @@ rtw88_8821c-objs := rtw8821c.o rtw8821c
|
|
||||||
obj-$(CPTCFG_RTW88_8821CE) += rtw88_8821ce.o
|
|
||||||
rtw88_8821ce-objs := rtw8821ce.o
|
|
||||||
|
|
||||||
+obj-$(CPTCFG_RTW88_8821CU) += rtw88_8821cu.o
|
|
||||||
+rtw88_8821cu-objs := rtw8821cu.o
|
|
||||||
+
|
|
||||||
obj-$(CPTCFG_RTW88_PCI) += rtw88_pci.o
|
|
||||||
rtw88_pci-objs := pci.o
|
|
||||||
|
|
||||||
--- a/drivers/net/wireless/realtek/rtw88/rtw8821c.c
|
|
||||||
+++ b/drivers/net/wireless/realtek/rtw88/rtw8821c.c
|
|
||||||
@@ -26,6 +26,12 @@ static void rtw8821ce_efuse_parsing(stru
|
|
||||||
ether_addr_copy(efuse->addr, map->e.mac_addr);
|
|
||||||
}
|
|
||||||
|
|
||||||
+static void rtw8821cu_efuse_parsing(struct rtw_efuse *efuse,
|
|
||||||
+ struct rtw8821c_efuse *map)
|
|
||||||
+{
|
|
||||||
+ ether_addr_copy(efuse->addr, map->u.mac_addr);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
enum rtw8821ce_rf_set {
|
|
||||||
SWITCH_TO_BTG,
|
|
||||||
SWITCH_TO_WLG,
|
|
||||||
@@ -65,6 +71,9 @@ static int rtw8821c_read_efuse(struct rt
|
|
||||||
case RTW_HCI_TYPE_PCIE:
|
|
||||||
rtw8821ce_efuse_parsing(efuse, map);
|
|
||||||
break;
|
|
||||||
+ case RTW_HCI_TYPE_USB:
|
|
||||||
+ rtw8821cu_efuse_parsing(efuse, map);
|
|
||||||
+ break;
|
|
||||||
default:
|
|
||||||
/* unsupported now */
|
|
||||||
return -ENOTSUPP;
|
|
||||||
@@ -1128,6 +1137,18 @@ static void rtw8821c_phy_cck_pd_set(stru
|
|
||||||
dm_info->cck_pd_default + new_lvl * 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
+static void rtw8821c_fill_txdesc_checksum(struct rtw_dev *rtwdev,
|
|
||||||
+ struct rtw_tx_pkt_info *pkt_info,
|
|
||||||
+ u8 *txdesc)
|
|
||||||
+{
|
|
||||||
+ struct rtw_chip_info *chip = rtwdev->chip;
|
|
||||||
+ size_t words;
|
|
||||||
+
|
|
||||||
+ words = (pkt_info->pkt_offset * 8 + chip->tx_pkt_desc_sz) / 2;
|
|
||||||
+
|
|
||||||
+ fill_txdesc_checksum_common(txdesc, words);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
static struct rtw_pwr_seq_cmd trans_carddis_to_cardemu_8821c[] = {
|
|
||||||
{0x0086,
|
|
||||||
RTW_PWR_CUT_ALL_MSK,
|
|
||||||
@@ -1499,6 +1520,9 @@ static const struct rtw_intf_phy_para_ta
|
|
||||||
static const struct rtw_rfe_def rtw8821c_rfe_defs[] = {
|
|
||||||
[0] = RTW_DEF_RFE(8821c, 0, 0),
|
|
||||||
[2] = RTW_DEF_RFE_EXT(8821c, 0, 0, 2),
|
|
||||||
+ [4] = RTW_DEF_RFE_EXT(8821c, 0, 0, 2),
|
|
||||||
+ [6] = RTW_DEF_RFE(8821c, 0, 0),
|
|
||||||
+ [34] = RTW_DEF_RFE(8821c, 0, 0),
|
|
||||||
};
|
|
||||||
|
|
||||||
static struct rtw_hw_reg rtw8821c_dig[] = {
|
|
||||||
@@ -1573,6 +1597,7 @@ static struct rtw_chip_ops rtw8821c_ops
|
|
||||||
.config_bfee = rtw8821c_bf_config_bfee,
|
|
||||||
.set_gid_table = rtw_bf_set_gid_table,
|
|
||||||
.cfg_csi_rate = rtw_bf_cfg_csi_rate,
|
|
||||||
+ .fill_txdesc_checksum = rtw8821c_fill_txdesc_checksum,
|
|
||||||
|
|
||||||
.coex_set_init = rtw8821c_coex_cfg_init,
|
|
||||||
.coex_set_ant_switch = rtw8821c_coex_cfg_ant_switch,
|
|
||||||
--- a/drivers/net/wireless/realtek/rtw88/rtw8821c.h
|
|
||||||
+++ b/drivers/net/wireless/realtek/rtw88/rtw8821c.h
|
|
||||||
@@ -9,6 +9,26 @@
|
|
||||||
|
|
||||||
#define RCR_VHT_ACK BIT(26)
|
|
||||||
|
|
||||||
+struct rtw8821cu_efuse {
|
|
||||||
+ u8 res4[4]; /* 0xd0 */
|
|
||||||
+ u8 usb_optional_function;
|
|
||||||
+ u8 res5[0x1e];
|
|
||||||
+ u8 res6[2];
|
|
||||||
+ u8 serial[0x0b]; /* 0xf5 */
|
|
||||||
+ u8 vid; /* 0x100 */
|
|
||||||
+ u8 res7;
|
|
||||||
+ u8 pid;
|
|
||||||
+ u8 res8[4];
|
|
||||||
+ u8 mac_addr[ETH_ALEN]; /* 0x107 */
|
|
||||||
+ u8 res9[2];
|
|
||||||
+ u8 vendor_name[0x07];
|
|
||||||
+ u8 res10[2];
|
|
||||||
+ u8 device_name[0x14];
|
|
||||||
+ u8 res11[0xcf];
|
|
||||||
+ u8 package_type; /* 0x1fb */
|
|
||||||
+ u8 res12[0x4];
|
|
||||||
+};
|
|
||||||
+
|
|
||||||
struct rtw8821ce_efuse {
|
|
||||||
u8 mac_addr[ETH_ALEN]; /* 0xd0 */
|
|
||||||
u8 vender_id[2];
|
|
||||||
@@ -73,6 +93,7 @@ struct rtw8821c_efuse {
|
|
||||||
u8 res[3];
|
|
||||||
union {
|
|
||||||
struct rtw8821ce_efuse e;
|
|
||||||
+ struct rtw8821cu_efuse u;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/drivers/net/wireless/realtek/rtw88/rtw8821cu.c
|
|
||||||
@@ -0,0 +1,50 @@
|
|
||||||
+// 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 "rtw8821cu.h"
|
|
||||||
+#include "usb.h"
|
|
||||||
+
|
|
||||||
+static const struct usb_device_id rtw_8821cu_id_table[] = {
|
|
||||||
+ { USB_DEVICE_AND_INTERFACE_INFO(RTW_USB_VENDOR_ID_REALTEK, 0xb82b, 0xff, 0xff, 0xff),
|
|
||||||
+ .driver_info = (kernel_ulong_t)&(rtw8821c_hw_spec) }, /* 8821CU */
|
|
||||||
+ { USB_DEVICE_AND_INTERFACE_INFO(RTW_USB_VENDOR_ID_REALTEK, 0xb820, 0xff, 0xff, 0xff),
|
|
||||||
+ .driver_info = (kernel_ulong_t)&(rtw8821c_hw_spec) }, /* 8821CU */
|
|
||||||
+ { USB_DEVICE_AND_INTERFACE_INFO(RTW_USB_VENDOR_ID_REALTEK, 0xc821, 0xff, 0xff, 0xff),
|
|
||||||
+ .driver_info = (kernel_ulong_t)&(rtw8821c_hw_spec) }, /* 8821CU */
|
|
||||||
+ { USB_DEVICE_AND_INTERFACE_INFO(RTW_USB_VENDOR_ID_REALTEK, 0xc820, 0xff, 0xff, 0xff),
|
|
||||||
+ .driver_info = (kernel_ulong_t)&(rtw8821c_hw_spec) }, /* 8821CU */
|
|
||||||
+ { USB_DEVICE_AND_INTERFACE_INFO(RTW_USB_VENDOR_ID_REALTEK, 0xc82a, 0xff, 0xff, 0xff),
|
|
||||||
+ .driver_info = (kernel_ulong_t)&(rtw8821c_hw_spec) }, /* 8821CU */
|
|
||||||
+ { USB_DEVICE_AND_INTERFACE_INFO(RTW_USB_VENDOR_ID_REALTEK, 0xc82b, 0xff, 0xff, 0xff),
|
|
||||||
+ .driver_info = (kernel_ulong_t)&(rtw8821c_hw_spec) }, /* 8821CU */
|
|
||||||
+ { USB_DEVICE_AND_INTERFACE_INFO(RTW_USB_VENDOR_ID_REALTEK, 0xc811, 0xff, 0xff, 0xff),
|
|
||||||
+ .driver_info = (kernel_ulong_t)&(rtw8821c_hw_spec) }, /* 8811CU */
|
|
||||||
+ { USB_DEVICE_AND_INTERFACE_INFO(RTW_USB_VENDOR_ID_REALTEK, 0x8811, 0xff, 0xff, 0xff),
|
|
||||||
+ .driver_info = (kernel_ulong_t)&(rtw8821c_hw_spec) }, /* 8811CU */
|
|
||||||
+ { USB_DEVICE_AND_INTERFACE_INFO(RTW_USB_VENDOR_ID_REALTEK, 0x2006, 0xff, 0xff, 0xff),
|
|
||||||
+ .driver_info = (kernel_ulong_t)&(rtw8821c_hw_spec) }, /* TOTOLINK A650UA v3 */
|
|
||||||
+ {},
|
|
||||||
+};
|
|
||||||
+MODULE_DEVICE_TABLE(usb, rtw_8821cu_id_table);
|
|
||||||
+
|
|
||||||
+static int rtw_8821cu_probe(struct usb_interface *intf,
|
|
||||||
+ const struct usb_device_id *id)
|
|
||||||
+{
|
|
||||||
+ return rtw_usb_probe(intf, id);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static struct usb_driver rtw_8821cu_driver = {
|
|
||||||
+ .name = "rtw_8821cu",
|
|
||||||
+ .id_table = rtw_8821cu_id_table,
|
|
||||||
+ .probe = rtw_8821cu_probe,
|
|
||||||
+ .disconnect = rtw_usb_disconnect,
|
|
||||||
+};
|
|
||||||
+module_usb_driver(rtw_8821cu_driver);
|
|
||||||
+
|
|
||||||
+MODULE_AUTHOR("Hans Ulli Kroll <linux@ulli-kroll.de>");
|
|
||||||
+MODULE_DESCRIPTION("Realtek 802.11ac wireless 8821cu driver");
|
|
||||||
+MODULE_LICENSE("Dual BSD/GPL");
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/drivers/net/wireless/realtek/rtw88/rtw8821cu.h
|
|
||||||
@@ -0,0 +1,10 @@
|
|
||||||
+/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
|
|
||||||
+/* Copyright(c) 2018-2019 Realtek Corporation
|
|
||||||
+ */
|
|
||||||
+
|
|
||||||
+#ifndef __RTW_8821CU_H_
|
|
||||||
+#define __RTW_8821CU_H_
|
|
||||||
+
|
|
||||||
+extern struct rtw_chip_info rtw8821c_hw_spec;
|
|
||||||
+
|
|
||||||
+#endif
|
|
@ -1,12 +0,0 @@
|
|||||||
--- a/drivers/net/wireless/realtek/rtw88/mac80211.c
|
|
||||||
+++ b/drivers/net/wireless/realtek/rtw88/mac80211.c
|
|
||||||
@@ -85,7 +85,8 @@ static int rtw_ops_config(struct ieee802
|
|
||||||
}
|
|
||||||
|
|
||||||
if (changed & IEEE80211_CONF_CHANGE_PS) {
|
|
||||||
- if (hw->conf.flags & IEEE80211_CONF_PS) {
|
|
||||||
+ if (hw->conf.flags & IEEE80211_CONF_PS &&
|
|
||||||
+ rtw_hci_type(rtwdev) != RTW_HCI_TYPE_USB) {
|
|
||||||
rtwdev->ps_enabled = true;
|
|
||||||
} else {
|
|
||||||
rtwdev->ps_enabled = false;
|
|
@ -25,8 +25,8 @@ config-y += RTL8XXXU_UNTESTED
|
|||||||
config-$(call config_package,rtl8723bs) += RTL8723BS
|
config-$(call config_package,rtl8723bs) += RTL8723BS
|
||||||
config-y += STAGING
|
config-y += STAGING
|
||||||
|
|
||||||
config-$(call config_package,rtw88) += RTW88 RTW88_CORE RTW88_PCI RTW88_USB
|
config-$(call config_package,rtw88) += RTW88 RTW88_CORE RTW88_PCI
|
||||||
config-y += RTW88_8821CU RTW88_8822BE RTW88_8822CE RTW88_8723DE
|
config-y += RTW88_8822BE RTW88_8822CE RTW88_8723DE
|
||||||
config-$(CONFIG_PACKAGE_RTW88_DEBUG) += RTW88_DEBUG
|
config-$(CONFIG_PACKAGE_RTW88_DEBUG) += RTW88_DEBUG
|
||||||
config-$(CONFIG_PACKAGE_RTW88_DEBUGFS) += RTW88_DEBUGFS
|
config-$(CONFIG_PACKAGE_RTW88_DEBUGFS) += RTW88_DEBUGFS
|
||||||
|
|
||||||
@ -195,11 +195,9 @@ endef
|
|||||||
|
|
||||||
define KernelPackage/rtw88
|
define KernelPackage/rtw88
|
||||||
$(call KernelPackage/mac80211/Default)
|
$(call KernelPackage/mac80211/Default)
|
||||||
TITLE:=Realtek RTL8821CU/RTL8822BE/RTL8822CE/RTL8723DE
|
TITLE:=Realtek RTL8822BE/RTL8822CE/RTL8723DE
|
||||||
DEPENDS+= @(PCI_SUPPORT||USB_SUPPORT) +kmod-mac80211 +@DRIVER_11AC_SUPPORT +@DRIVER_11N_SUPPORT
|
DEPENDS+= @(PCI_SUPPORT) +kmod-mac80211 +@DRIVER_11AC_SUPPORT +@DRIVER_11N_SUPPORT
|
||||||
FILES:=\
|
FILES:=\
|
||||||
$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8821c.ko \
|
|
||||||
$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8821cu.ko \
|
|
||||||
$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8822be.ko \
|
$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8822be.ko \
|
||||||
$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8822b.ko \
|
$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8822b.ko \
|
||||||
$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8822ce.ko \
|
$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8822ce.ko \
|
||||||
@ -207,9 +205,8 @@ define KernelPackage/rtw88
|
|||||||
$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8723de.ko \
|
$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8723de.ko \
|
||||||
$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8723d.ko \
|
$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8723d.ko \
|
||||||
$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_core.ko \
|
$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_core.ko \
|
||||||
$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_pci.ko \
|
$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_pci.ko
|
||||||
$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_usb.ko
|
AUTOLOAD:=$(call AutoProbe,rtw88_8822be rtw88_8822ce rtw88_8723de)
|
||||||
AUTOLOAD:=$(call AutoProbe,rtw88_8821cu rtw88_8822be rtw88_8822ce rtw88_8723de)
|
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define KernelPackage/rtl8723bs
|
define KernelPackage/rtl8723bs
|
||||||
|
132
package/kernel/rtw88-usb/Makefile
Normal file
132
package/kernel/rtw88-usb/Makefile
Normal file
@ -0,0 +1,132 @@
|
|||||||
|
#
|
||||||
|
# Copyright (C) 2017 OpenWrt.org
|
||||||
|
#
|
||||||
|
# This is free software, licensed under the GNU General Public License v2.
|
||||||
|
# See /LICENSE for more information.
|
||||||
|
#
|
||||||
|
|
||||||
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
|
PKG_NAME:=rtw88-usb
|
||||||
|
PKG_RELEASE:=1
|
||||||
|
|
||||||
|
PKG_SOURCE_PROTO:=git
|
||||||
|
PKG_SOURCE_DATE:=2021-07-06
|
||||||
|
PKG_SOURCE_URL:=https://github.com/ulli-kroll/rtw88-usb.git
|
||||||
|
PKG_SOURCE_VERSION:=dd05eec8e5ac934b3d8e67e8008228f842b4ce1c
|
||||||
|
PKG_MIRROR_HASH:=9932f69573a3469d1eba403c7964a9472530fcfa1c29356babeecdad8d9c6991
|
||||||
|
|
||||||
|
PKG_BUILD_PARALLEL:=1
|
||||||
|
PKG_LICENSE:=GPL-2.0
|
||||||
|
PKG_LICENSE_FILES:=LICENSE
|
||||||
|
|
||||||
|
STAMP_CONFIGURED_DEPENDS := $(STAGING_DIR)/usr/include/mac80211-backport/backport/autoconf.h
|
||||||
|
|
||||||
|
include $(INCLUDE_DIR)/kernel.mk
|
||||||
|
include $(INCLUDE_DIR)/package.mk
|
||||||
|
|
||||||
|
define KernelPackage/rtw88-default
|
||||||
|
SUBMENU:=Wireless Drivers
|
||||||
|
TITLE:=Realtek rtw88 family usb driver
|
||||||
|
DEPENDS:=+kmod-mac80211 +kmod-usb-core \
|
||||||
|
+@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT
|
||||||
|
endef
|
||||||
|
|
||||||
|
define KernelPackage/rtw88-usb
|
||||||
|
$(KernelPackage/rtw88-default)
|
||||||
|
HIDDEN:=1
|
||||||
|
FILES:= \
|
||||||
|
$(PKG_BUILD_DIR)/rtw88_usb.ko \
|
||||||
|
$(PKG_BUILD_DIR)/rtw88_core.ko
|
||||||
|
endef
|
||||||
|
|
||||||
|
define KernelPackage/rtl8723du
|
||||||
|
$(KernelPackage/rtw88-default)
|
||||||
|
TITLE:=Realtek RTL8723DU support
|
||||||
|
DEPENDS+=+kmod-rtw88-usb +rtl8723du-firmware
|
||||||
|
FILES:= \
|
||||||
|
$(PKG_BUILD_DIR)/rtw88_8723d.ko \
|
||||||
|
$(PKG_BUILD_DIR)/rtw88_8723du.ko
|
||||||
|
AUTOLOAD:=$(call AutoProbe,rtw88_8723du)
|
||||||
|
endef
|
||||||
|
|
||||||
|
define KernelPackage/rtl8821cu
|
||||||
|
$(KernelPackage/rtw88-default)
|
||||||
|
TITLE:=Realtek RTL8821CU support
|
||||||
|
DEPENDS+=+kmod-rtw88-usb +rtl8821ce-firmware
|
||||||
|
FILES:= \
|
||||||
|
$(PKG_BUILD_DIR)/rtw88_8821c.ko \
|
||||||
|
$(PKG_BUILD_DIR)/rtw88_8821cu.ko
|
||||||
|
AUTOLOAD:=$(call AutoProbe,rtw88_8821cu)
|
||||||
|
endef
|
||||||
|
|
||||||
|
define KernelPackage/rtl8822bu
|
||||||
|
$(KernelPackage/rtw88-default)
|
||||||
|
TITLE:=Realtek RTL8822BU support
|
||||||
|
DEPENDS+=+kmod-rtw88-usb +rtl8822be-firmware
|
||||||
|
FILES:= \
|
||||||
|
$(PKG_BUILD_DIR)/rtw88_8822b.ko \
|
||||||
|
$(PKG_BUILD_DIR)/rtw88_8822bu.ko
|
||||||
|
AUTOLOAD:=$(call AutoProbe,rtw88_8822bu)
|
||||||
|
endef
|
||||||
|
|
||||||
|
define KernelPackage/rtl8822cu
|
||||||
|
$(KernelPackage/rtw88-default)
|
||||||
|
TITLE:=Realtek RTL8822CU support
|
||||||
|
DEPENDS+=+kmod-rtw88-usb +rtl8822ce-firmware
|
||||||
|
FILES:= \
|
||||||
|
$(PKG_BUILD_DIR)/rtw88_8822c.ko \
|
||||||
|
$(PKG_BUILD_DIR)/rtw88_8822cu.ko
|
||||||
|
AUTOLOAD:=$(call AutoProbe,rtw88_8822cu)
|
||||||
|
endef
|
||||||
|
|
||||||
|
NOSTDINC_FLAGS := \
|
||||||
|
$(KERNEL_NOSTDINC_FLAGS) \
|
||||||
|
-I$(PKG_BUILD_DIR) \
|
||||||
|
-I$(STAGING_DIR)/usr/include/mac80211-backport/uapi \
|
||||||
|
-I$(STAGING_DIR)/usr/include/mac80211-backport \
|
||||||
|
-I$(STAGING_DIR)/usr/include/mac80211/uapi \
|
||||||
|
-I$(STAGING_DIR)/usr/include/mac80211 \
|
||||||
|
-include backport/autoconf.h \
|
||||||
|
-include backport/backport.h
|
||||||
|
|
||||||
|
ifdef CONFIG_PACKAGE_kmod-rtw88-usb
|
||||||
|
PKG_MAKE_FLAGS += \
|
||||||
|
CONFIG_RTW88_USB=m \
|
||||||
|
CONFIG_RTW88_CORE=m
|
||||||
|
endif
|
||||||
|
ifdef CONFIG_PACKAGE_kmod-rtl8723du
|
||||||
|
PKG_MAKE_FLAGS += \
|
||||||
|
CONFIG_RTW88_8723D=m \
|
||||||
|
CONFIG_RTW88_8723DU=m
|
||||||
|
endif
|
||||||
|
ifdef CONFIG_PACKAGE_kmod-rtl8821cu
|
||||||
|
PKG_MAKE_FLAGS += \
|
||||||
|
CONFIG_RTW88_8821C=m \
|
||||||
|
CONFIG_RTW88_8821CU=m
|
||||||
|
endif
|
||||||
|
ifdef CONFIG_PACKAGE_kmod-rtl8822bu
|
||||||
|
PKG_MAKE_FLAGS += \
|
||||||
|
CONFIG_RTW88_8822B=m \
|
||||||
|
CONFIG_RTW88_8822BU=m
|
||||||
|
endif
|
||||||
|
ifdef CONFIG_PACKAGE_kmod-rtl8822cu
|
||||||
|
PKG_MAKE_FLAGS += \
|
||||||
|
CONFIG_RTW88_8822C=m \
|
||||||
|
CONFIG_RTW88_8822CU=m
|
||||||
|
endif
|
||||||
|
|
||||||
|
define Build/Compile
|
||||||
|
+$(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" \
|
||||||
|
$(KERNEL_MAKE_FLAGS) \
|
||||||
|
$(PKG_MAKE_FLAGS) \
|
||||||
|
M="$(PKG_BUILD_DIR)" \
|
||||||
|
NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \
|
||||||
|
modules
|
||||||
|
endef
|
||||||
|
|
||||||
|
$(eval $(call KernelPackage,rtw88-usb))
|
||||||
|
$(eval $(call KernelPackage,rtl8723du))
|
||||||
|
$(eval $(call KernelPackage,rtl8821cu))
|
||||||
|
$(eval $(call KernelPackage,rtl8822bu))
|
||||||
|
$(eval $(call KernelPackage,rtl8822cu))
|
391
package/kernel/rtw88-usb/patches/001-sync-upstream-regd.patch
Normal file
391
package/kernel/rtw88-usb/patches/001-sync-upstream-regd.patch
Normal file
@ -0,0 +1,391 @@
|
|||||||
|
--- a/debug.c
|
||||||
|
+++ b/debug.c
|
||||||
|
@@ -868,37 +868,6 @@ static int rtw_debugfs_get_coex_enable(struct seq_file *m, void *v)
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
-static ssize_t rtw_debugfs_set_edcca_enable(struct file *filp,
|
||||||
|
- const char __user *buffer,
|
||||||
|
- size_t count, loff_t *loff)
|
||||||
|
-{
|
||||||
|
- struct seq_file *seqpriv = (struct seq_file *)filp->private_data;
|
||||||
|
- struct rtw_debugfs_priv *debugfs_priv = seqpriv->private;
|
||||||
|
- struct rtw_dev *rtwdev = debugfs_priv->rtwdev;
|
||||||
|
- char tmp[32 + 1];
|
||||||
|
- int err;
|
||||||
|
-
|
||||||
|
- rtw_debugfs_copy_from_user(tmp, sizeof(tmp), buffer, count, 1);
|
||||||
|
-
|
||||||
|
- err = kstrtobool(tmp, &rtw_edcca_enabled);
|
||||||
|
- if (err)
|
||||||
|
- return err;
|
||||||
|
- rtw_phy_adaptivity_set_mode(rtwdev);
|
||||||
|
-
|
||||||
|
- return count;
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
-static int rtw_debugfs_get_edcca_enable(struct seq_file *m, void *v)
|
||||||
|
-{
|
||||||
|
- struct rtw_debugfs_priv *debugfs_priv = m->private;
|
||||||
|
- struct rtw_dev *rtwdev = debugfs_priv->rtwdev;
|
||||||
|
- struct rtw_dm_info *dm_info = &rtwdev->dm_info;
|
||||||
|
-
|
||||||
|
- seq_printf(m, "EDCCA mode %d\n", dm_info->edcca_mode);
|
||||||
|
-
|
||||||
|
- return 0;
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
static ssize_t rtw_debugfs_set_fw_crash(struct file *filp,
|
||||||
|
const char __user *buffer,
|
||||||
|
size_t count, loff_t *loff)
|
||||||
|
@@ -1118,11 +1087,6 @@ static struct rtw_debugfs_priv rtw_debug_priv_coex_info = {
|
||||||
|
.cb_read = rtw_debugfs_get_coex_info,
|
||||||
|
};
|
||||||
|
|
||||||
|
-static struct rtw_debugfs_priv rtw_debug_priv_edcca_enable = {
|
||||||
|
- .cb_write = rtw_debugfs_set_edcca_enable,
|
||||||
|
- .cb_read = rtw_debugfs_get_edcca_enable,
|
||||||
|
-};
|
||||||
|
-
|
||||||
|
static struct rtw_debugfs_priv rtw_debug_priv_fw_crash = {
|
||||||
|
.cb_write = rtw_debugfs_set_fw_crash,
|
||||||
|
.cb_read = rtw_debugfs_get_fw_crash,
|
||||||
|
@@ -1209,7 +1173,6 @@ void rtw_debugfs_init(struct rtw_dev *rtwdev)
|
||||||
|
rtw_debugfs_add_r(tx_pwr_tbl);
|
||||||
|
rtw_debugfs_add_rw(fw_crash);
|
||||||
|
rtw_debugfs_add_rw(dm_cap);
|
||||||
|
- rtw_debugfs_add_rw(edcca_enable);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* CONFIG_RTW88_DEBUGFS */
|
||||||
|
--- a/phy.c
|
||||||
|
+++ b/phy.c
|
||||||
|
@@ -9,7 +9,6 @@
|
||||||
|
#include "fw.h"
|
||||||
|
#include "phy.h"
|
||||||
|
#include "debug.h"
|
||||||
|
-#include "regd.h"
|
||||||
|
|
||||||
|
struct phy_cfg_pair {
|
||||||
|
u32 addr;
|
||||||
|
@@ -121,58 +120,6 @@ static void rtw_phy_cck_pd_init(struct rtw_dev *rtwdev)
|
||||||
|
dm_info->cck_fa_avg = CCK_FA_AVG_RESET;
|
||||||
|
}
|
||||||
|
|
||||||
|
-void rtw_phy_set_edcca_th(struct rtw_dev *rtwdev, u8 l2h, u8 h2l)
|
||||||
|
-{
|
||||||
|
- struct rtw_hw_reg_offset *edcca_th = rtwdev->chip->edcca_th;
|
||||||
|
-
|
||||||
|
- rtw_write32_mask(rtwdev,
|
||||||
|
- edcca_th[EDCCA_TH_L2H_IDX].hw_reg.addr,
|
||||||
|
- edcca_th[EDCCA_TH_L2H_IDX].hw_reg.mask,
|
||||||
|
- l2h + edcca_th[EDCCA_TH_L2H_IDX].offset);
|
||||||
|
- rtw_write32_mask(rtwdev,
|
||||||
|
- edcca_th[EDCCA_TH_H2L_IDX].hw_reg.addr,
|
||||||
|
- edcca_th[EDCCA_TH_H2L_IDX].hw_reg.mask,
|
||||||
|
- h2l + edcca_th[EDCCA_TH_H2L_IDX].offset);
|
||||||
|
-}
|
||||||
|
-EXPORT_SYMBOL(rtw_phy_set_edcca_th);
|
||||||
|
-
|
||||||
|
-void rtw_phy_adaptivity_set_mode(struct rtw_dev *rtwdev)
|
||||||
|
-{
|
||||||
|
- struct rtw_chip_info *chip = rtwdev->chip;
|
||||||
|
- struct rtw_dm_info *dm_info = &rtwdev->dm_info;
|
||||||
|
-
|
||||||
|
- /* turn off in debugfs for debug usage */
|
||||||
|
- if (!rtw_edcca_enabled) {
|
||||||
|
- dm_info->edcca_mode = RTW_EDCCA_NORMAL;
|
||||||
|
- rtw_dbg(rtwdev, RTW_DBG_PHY, "EDCCA disabled, cannot be set\n");
|
||||||
|
- return;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- switch (rtwdev->regd.region) {
|
||||||
|
- case NL80211_DFS_ETSI:
|
||||||
|
- dm_info->edcca_mode = RTW_EDCCA_ADAPTIVITY;
|
||||||
|
- dm_info->l2h_th_ini = chip->l2h_th_ini_ad;
|
||||||
|
- break;
|
||||||
|
- case NL80211_DFS_JP:
|
||||||
|
- dm_info->edcca_mode = RTW_EDCCA_ADAPTIVITY;
|
||||||
|
- dm_info->l2h_th_ini = chip->l2h_th_ini_cs;
|
||||||
|
- break;
|
||||||
|
- default:
|
||||||
|
- dm_info->edcca_mode = RTW_EDCCA_NORMAL;
|
||||||
|
- break;
|
||||||
|
- }
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
-static void rtw_phy_adaptivity_init(struct rtw_dev *rtwdev)
|
||||||
|
-{
|
||||||
|
- struct rtw_chip_info *chip = rtwdev->chip;
|
||||||
|
-
|
||||||
|
- rtw_regd_init_dfs_region(rtwdev, rtwdev->regd.region);
|
||||||
|
- rtw_phy_adaptivity_set_mode(rtwdev);
|
||||||
|
- if (chip->ops->adaptivity_init)
|
||||||
|
- chip->ops->adaptivity_init(rtwdev);
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
static void rtw_phy_cfo_init(struct rtw_dev *rtwdev)
|
||||||
|
{
|
||||||
|
struct rtw_chip_info *chip = rtwdev->chip;
|
||||||
|
@@ -202,8 +149,6 @@ void rtw_phy_init(struct rtw_dev *rtwdev)
|
||||||
|
rtw_phy_cck_pd_init(rtwdev);
|
||||||
|
|
||||||
|
dm_info->iqk.done = false;
|
||||||
|
- dm_info->iqk.done = false;
|
||||||
|
- rtw_phy_adaptivity_init(rtwdev);
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL(rtw_phy_init);
|
||||||
|
|
||||||
|
--- a/phy.h
|
||||||
|
+++ b/phy.h
|
||||||
|
@@ -61,8 +61,6 @@ void rtw_phy_config_swing_table(struct rtw_dev *rtwdev,
|
||||||
|
struct rtw_swing_table *swing_table);
|
||||||
|
void rtw_phy_parsing_cfo(struct rtw_dev *rtwdev,
|
||||||
|
struct rtw_rx_pkt_stat *pkt_stat);
|
||||||
|
-void rtw_phy_set_edcca_th(struct rtw_dev *rtwdev, u8 l2h, u8 h2l);
|
||||||
|
-void rtw_phy_adaptivity_set_mode(struct rtw_dev *rtwdev);
|
||||||
|
|
||||||
|
struct rtw_txpwr_lmt_cfg_pair {
|
||||||
|
u8 regd;
|
||||||
|
--- a/regd.c
|
||||||
|
+++ b/regd.c
|
||||||
|
@@ -7,18 +7,6 @@
|
||||||
|
#include "debug.h"
|
||||||
|
#include "phy.h"
|
||||||
|
|
||||||
|
-static const struct ieee80211_regdomain rtw88_world_regdom = {
|
||||||
|
- .n_reg_rules = 5,
|
||||||
|
- .alpha2 = "99",
|
||||||
|
- .reg_rules = {
|
||||||
|
- REG_RULE(2412 - 10, 2462 + 10, 40, 0, 20, 0),
|
||||||
|
- REG_RULE(2467 - 10, 2484 + 10, 40, 0, 20, NL80211_RRF_NO_IR),
|
||||||
|
- REG_RULE(5180 - 10, 5240 + 10, 80, 0, 20, NL80211_RRF_NO_IR),
|
||||||
|
- REG_RULE(5260 - 10, 5700 + 10, 80, 0, 20,
|
||||||
|
- NL80211_RRF_NO_IR | NL80211_RRF_DFS),
|
||||||
|
- REG_RULE(5745 - 10, 5825 + 10, 80, 0, 20, NL80211_RRF_NO_IR),
|
||||||
|
- }
|
||||||
|
-};
|
||||||
|
#define COUNTRY_CHPLAN_ENT(_alpha2, _chplan, _txpwr_regd) \
|
||||||
|
{.alpha2 = (_alpha2), \
|
||||||
|
.chplan = (_chplan), \
|
||||||
|
@@ -351,73 +339,28 @@ static struct rtw_regulatory rtw_regd_find_reg_by_name(char *alpha2)
|
||||||
|
return rtw_defined_chplan;
|
||||||
|
}
|
||||||
|
|
||||||
|
-static bool rtw_regd_is_ww(struct rtw_regulatory *reg)
|
||||||
|
-{
|
||||||
|
- if (reg->txpwr_regd == RTW_REGD_WW)
|
||||||
|
- return true;
|
||||||
|
- return false;
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
-void rtw_regd_init_dfs_region(struct rtw_dev *rtwdev,
|
||||||
|
- enum nl80211_dfs_regions curr_region)
|
||||||
|
-{
|
||||||
|
- struct ieee80211_hw *hw = rtwdev->hw;
|
||||||
|
- const struct ieee80211_regdomain *wiphy_regd = NULL;
|
||||||
|
-
|
||||||
|
- if (curr_region != RTW_REGION_INVALID)
|
||||||
|
- return;
|
||||||
|
-
|
||||||
|
- rcu_read_lock();
|
||||||
|
- wiphy_regd = rcu_dereference(hw->wiphy->regd);
|
||||||
|
- if (wiphy_regd)
|
||||||
|
- rtwdev->regd.region = wiphy_regd->dfs_region;
|
||||||
|
- rcu_read_unlock();
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
static int rtw_regd_notifier_apply(struct rtw_dev *rtwdev,
|
||||||
|
struct wiphy *wiphy,
|
||||||
|
struct regulatory_request *request)
|
||||||
|
{
|
||||||
|
- if (request->initiator == NL80211_REGDOM_SET_BY_DRIVER)
|
||||||
|
- return -ENOTSUPP;
|
||||||
|
- if (request->initiator == NL80211_REGDOM_SET_BY_USER &&
|
||||||
|
- !IS_ENABLED(CONFIG_RTW88_REGD_USER_REG_HINTS))
|
||||||
|
- return -EPERM;
|
||||||
|
- if (request->initiator == NL80211_REGDOM_SET_BY_COUNTRY_IE &&
|
||||||
|
- !rtw_regd_is_ww(&rtwdev->regd))
|
||||||
|
- return -EINVAL;
|
||||||
|
- if (request->initiator == NL80211_REGDOM_SET_BY_CORE &&
|
||||||
|
- !rtwdev->efuse.country_worldwide) {
|
||||||
|
- rtwdev->regd =
|
||||||
|
- rtw_regd_find_reg_by_name(rtwdev->efuse.country_code);
|
||||||
|
- /* return to the efuse setting */
|
||||||
|
- rtw_regd_init_dfs_region(rtwdev, RTW_REGION_INVALID);
|
||||||
|
+ if (request->initiator == NL80211_REGDOM_SET_BY_USER)
|
||||||
|
return 0;
|
||||||
|
- }
|
||||||
|
rtwdev->regd = rtw_regd_find_reg_by_name(request->alpha2);
|
||||||
|
rtw_regd_apply_world_flags(wiphy, request->initiator);
|
||||||
|
- rtwdev->regd.region = request->dfs_region;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
-rtw_regd_init_wiphy(struct rtw_dev *rtwdev, struct wiphy *wiphy,
|
||||||
|
+rtw_regd_init_wiphy(struct rtw_regulatory *reg, struct wiphy *wiphy,
|
||||||
|
void (*reg_notifier)(struct wiphy *wiphy,
|
||||||
|
struct regulatory_request *request))
|
||||||
|
{
|
||||||
|
- struct rtw_regulatory *reg = &rtwdev->regd;
|
||||||
|
-
|
||||||
|
wiphy->reg_notifier = reg_notifier;
|
||||||
|
|
||||||
|
- if (rtw_regd_is_ww(reg)) {
|
||||||
|
- rtwdev->efuse.country_worldwide = true;
|
||||||
|
- wiphy->regulatory_flags |= REGULATORY_CUSTOM_REG;
|
||||||
|
- wiphy_apply_custom_regulatory(wiphy, &rtw88_world_regdom);
|
||||||
|
- } else {
|
||||||
|
- rtwdev->efuse.country_worldwide = false;
|
||||||
|
- }
|
||||||
|
- wiphy->regulatory_flags |= REGULATORY_STRICT_REG;
|
||||||
|
+ wiphy->regulatory_flags &= ~REGULATORY_CUSTOM_REG;
|
||||||
|
+ wiphy->regulatory_flags &= ~REGULATORY_STRICT_REG;
|
||||||
|
+ wiphy->regulatory_flags &= ~REGULATORY_DISABLE_BEACON_HINTS;
|
||||||
|
|
||||||
|
rtw_regd_apply_hw_cap_flags(wiphy);
|
||||||
|
|
||||||
|
@@ -434,8 +377,7 @@ int rtw_regd_init(struct rtw_dev *rtwdev,
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
|
rtwdev->regd = rtw_regd_find_reg_by_name(rtwdev->efuse.country_code);
|
||||||
|
- rtw_regd_init_wiphy(rtwdev, wiphy, reg_notifier);
|
||||||
|
- rtwdev->regd.region = RTW_REGION_INVALID;
|
||||||
|
+ rtw_regd_init_wiphy(&rtwdev->regd, wiphy, reg_notifier);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
@@ -445,21 +387,12 @@ void rtw_regd_notifier(struct wiphy *wiphy, struct regulatory_request *request)
|
||||||
|
struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy);
|
||||||
|
struct rtw_dev *rtwdev = hw->priv;
|
||||||
|
struct rtw_hal *hal = &rtwdev->hal;
|
||||||
|
- int ret;
|
||||||
|
|
||||||
|
- ret = rtw_regd_notifier_apply(rtwdev, wiphy, request);
|
||||||
|
- if (ret) {
|
||||||
|
- rtw_warn(rtwdev, "failed to apply regulatory from initiator %d: %d\n",
|
||||||
|
- request->initiator, ret);
|
||||||
|
- return;
|
||||||
|
- }
|
||||||
|
+ rtw_regd_notifier_apply(rtwdev, wiphy, request);
|
||||||
|
rtw_dbg(rtwdev, RTW_DBG_REGD,
|
||||||
|
"get alpha2 %c%c from initiator %d, mapping to chplan 0x%x, txregd %d\n",
|
||||||
|
- request->alpha2[0], request->alpha2[1],
|
||||||
|
- request->initiator, rtwdev->regd.chplan,
|
||||||
|
- rtwdev->regd.txpwr_regd);
|
||||||
|
-
|
||||||
|
- rtw_phy_adaptivity_set_mode(rtwdev);
|
||||||
|
+ request->alpha2[0], request->alpha2[1], request->initiator,
|
||||||
|
+ rtwdev->regd.chplan, rtwdev->regd.txpwr_regd);
|
||||||
|
|
||||||
|
rtw_phy_set_tx_power_level(rtwdev, hal->current_channel);
|
||||||
|
}
|
||||||
|
--- a/regd.h
|
||||||
|
+++ b/regd.h
|
||||||
|
@@ -68,6 +68,4 @@ int rtw_regd_init(struct rtw_dev *rtwdev,
|
||||||
|
void (*reg_notifier)(struct wiphy *wiphy,
|
||||||
|
struct regulatory_request *request));
|
||||||
|
void rtw_regd_notifier(struct wiphy *wiphy, struct regulatory_request *request);
|
||||||
|
-void rtw_regd_init_dfs_region(struct rtw_dev *rtwdev,
|
||||||
|
- enum nl80211_dfs_regions curr_region);
|
||||||
|
#endif
|
||||||
|
--- a/rtw8822b.c
|
||||||
|
+++ b/rtw8822b.c
|
||||||
|
@@ -1561,37 +1561,6 @@ static void rtw8822b_bf_config_bfee(struct rtw_dev *rtwdev, struct rtw_vif *vif,
|
||||||
|
rtw_warn(rtwdev, "wrong bfee role\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
-static void rtw8822b_adaptivity_init(struct rtw_dev *rtwdev)
|
||||||
|
-{
|
||||||
|
- rtw_phy_set_edcca_th(rtwdev, 0x7f, 0x7f);
|
||||||
|
- /* mac edcca state setting */
|
||||||
|
- rtw_write32_mask(rtwdev, REG_TX_PTCL_CTRL, BIT_DIS_EDCCA, 0);
|
||||||
|
- rtw_write32_mask(rtwdev, REG_RD_CTRL, BIT_EDCCA_MSK_CNTDOWN_EN, 1);
|
||||||
|
-
|
||||||
|
- rtw_write32_mask(rtwdev, REG_EDCCA_SOURCE, BIT_SOURCE_OPTION, 1);
|
||||||
|
- rtw_write32_mask(rtwdev, REG_EDCCA_POW_MA, BIT_MA_LEVEL, 0);
|
||||||
|
- /* edcca decistion opt */
|
||||||
|
- rtw_write32_mask(rtwdev, REG_EDCCA_DECISION, BIT_EDCCA_OPTION, 1);
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
-static void rtw8822b_adaptivity(struct rtw_dev *rtwdev)
|
||||||
|
-{
|
||||||
|
- struct rtw_dm_info *dm_info = &rtwdev->dm_info;
|
||||||
|
- s8 l2h, h2l;
|
||||||
|
- u8 igi;
|
||||||
|
-
|
||||||
|
- igi = dm_info->igi_history[0];
|
||||||
|
- if (dm_info->edcca_mode == RTW_EDCCA_NORMAL) {
|
||||||
|
- l2h = max_t(s8, igi + EDCCA_IGI_L2H_DIFF, EDCCA_TH_L2H_LB);
|
||||||
|
- h2l = l2h - EDCCA_L2H_H2L_DIFF_NORMAL;
|
||||||
|
- } else {
|
||||||
|
- l2h = min_t(s8, igi, dm_info->l2h_th_ini);
|
||||||
|
- h2l = l2h - EDCCA_L2H_H2L_DIFF;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- rtw_phy_set_edcca_th(rtwdev, l2h, h2l);
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
static void rtw8822b_fill_txdesc_checksum(struct rtw_dev *rtwdev,
|
||||||
|
struct rtw_tx_pkt_info *pkt_info,
|
||||||
|
u8 *txdesc)
|
||||||
|
@@ -2174,8 +2143,6 @@ static struct rtw_chip_ops rtw8822b_ops = {
|
||||||
|
.config_bfee = rtw8822b_bf_config_bfee,
|
||||||
|
.set_gid_table = rtw_bf_set_gid_table,
|
||||||
|
.cfg_csi_rate = rtw_bf_cfg_csi_rate,
|
||||||
|
- .adaptivity_init = rtw8822b_adaptivity_init,
|
||||||
|
- .adaptivity = rtw8822b_adaptivity,
|
||||||
|
.fill_txdesc_checksum = rtw8822b_fill_txdesc_checksum,
|
||||||
|
|
||||||
|
.coex_set_init = rtw8822b_coex_cfg_init,
|
||||||
|
--- a/rtw8822c.c
|
||||||
|
+++ b/rtw8822c.c
|
||||||
|
@@ -4442,37 +4442,6 @@ static void rtw8822c_pwr_track(struct rtw_dev *rtwdev)
|
||||||
|
dm_info->pwr_trk_triggered = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
-static void rtw8822c_adaptivity_init(struct rtw_dev *rtwdev)
|
||||||
|
-{
|
||||||
|
- rtw_phy_set_edcca_th(rtwdev, 0x7f, 0x7f);
|
||||||
|
- /* mac edcca state setting */
|
||||||
|
- rtw_write32_mask(rtwdev, REG_TX_PTCL_CTRL, BIT_DIS_EDCCA, 0);
|
||||||
|
- rtw_write32_mask(rtwdev, REG_RD_CTRL, BIT_EDCCA_MSK_CNTDOWN_EN, 1);
|
||||||
|
- /* edcca decistion opt */
|
||||||
|
- rtw_write32_mask(rtwdev, REG_EDCCA_DECISION, BIT_EDCCA_OPTION, 0);
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
-static void rtw8822c_adaptivity(struct rtw_dev *rtwdev)
|
||||||
|
-{
|
||||||
|
- struct rtw_dm_info *dm_info = &rtwdev->dm_info;
|
||||||
|
- s8 l2h, h2l;
|
||||||
|
- u8 igi;
|
||||||
|
-
|
||||||
|
- igi = dm_info->igi_history[0];
|
||||||
|
- if (dm_info->edcca_mode == RTW_EDCCA_NORMAL) {
|
||||||
|
- l2h = max_t(s8, igi + EDCCA_IGI_L2H_DIFF, EDCCA_TH_L2H_LB);
|
||||||
|
- h2l = l2h - EDCCA_L2H_H2L_DIFF_NORMAL;
|
||||||
|
- } else {
|
||||||
|
- if (igi < dm_info->l2h_th_ini - EDCCA_ADC_BACKOFF)
|
||||||
|
- l2h = igi + EDCCA_ADC_BACKOFF;
|
||||||
|
- else
|
||||||
|
- l2h = dm_info->l2h_th_ini;
|
||||||
|
- h2l = l2h - EDCCA_L2H_H2L_DIFF;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- rtw_phy_set_edcca_th(rtwdev, l2h, h2l);
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
static void rtw8822c_fill_txdesc_checksum(struct rtw_dev *rtwdev,
|
||||||
|
struct rtw_tx_pkt_info *pkt_info,
|
||||||
|
u8 *txdesc)
|
||||||
|
@@ -4903,8 +4872,6 @@ static struct rtw_chip_ops rtw8822c_ops = {
|
||||||
|
.cfg_csi_rate = rtw_bf_cfg_csi_rate,
|
||||||
|
.cfo_init = rtw8822c_cfo_init,
|
||||||
|
.cfo_track = rtw8822c_cfo_track,
|
||||||
|
- .adaptivity_init = rtw8822c_adaptivity_init,
|
||||||
|
- .adaptivity = rtw8822c_adaptivity,
|
||||||
|
.fill_txdesc_checksum = rtw8822c_fill_txdesc_checksum,
|
||||||
|
|
||||||
|
.coex_set_init = rtw8822c_coex_cfg_init,
|
@ -1,6 +1,21 @@
|
|||||||
--- a/drivers/net/wireless/realtek/rtw88/debug.c
|
From d57ca103e54e2b3eea7e2603548c58bcc4155541 Mon Sep 17 00:00:00 2001
|
||||||
+++ b/drivers/net/wireless/realtek/rtw88/debug.c
|
From: Sascha Hauer <s.hauer@pengutronix.de>
|
||||||
@@ -143,7 +143,9 @@ static int rtw_debugfs_get_rf_read(struc
|
Date: Fri, 2 Dec 2022 09:12:16 +0100
|
||||||
|
Subject: [PATCH] wifi: rtw88: Drop rf_lock
|
||||||
|
|
||||||
|
The rtwdev->rf_lock spinlock protects the rf register accesses in
|
||||||
|
rtw_read_rf() and rtw_write_rf(). Most callers of these functions hold
|
||||||
|
rtwdev->mutex already with the exception of the callsites in the debugfs
|
||||||
|
code. The debugfs code doesn't justify an extra lock, so acquire the mutex
|
||||||
|
there as well before calling rf register accessors and drop the now
|
||||||
|
unnecessary spinlock.
|
||||||
|
|
||||||
|
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
||||||
|
---
|
||||||
|
|
||||||
|
--- a/debug.c
|
||||||
|
+++ b/debug.c
|
||||||
|
@@ -144,7 +144,9 @@ static int rtw_debugfs_get_rf_read(struct seq_file *m, void *v)
|
||||||
addr = debugfs_priv->rf_addr;
|
addr = debugfs_priv->rf_addr;
|
||||||
mask = debugfs_priv->rf_mask;
|
mask = debugfs_priv->rf_mask;
|
||||||
|
|
||||||
@ -10,7 +25,7 @@
|
|||||||
|
|
||||||
seq_printf(m, "rf_read path:%d addr:0x%08x mask:0x%08x val=0x%08x\n",
|
seq_printf(m, "rf_read path:%d addr:0x%08x mask:0x%08x val=0x%08x\n",
|
||||||
path, addr, mask, val);
|
path, addr, mask, val);
|
||||||
@@ -401,7 +403,9 @@ static ssize_t rtw_debugfs_set_rf_write(
|
@@ -418,7 +420,9 @@ static ssize_t rtw_debugfs_set_rf_write(struct file *filp,
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -20,7 +35,7 @@
|
|||||||
rtw_dbg(rtwdev, RTW_DBG_DEBUGFS,
|
rtw_dbg(rtwdev, RTW_DBG_DEBUGFS,
|
||||||
"write_rf path:%d addr:0x%08x mask:0x%08x, val:0x%08x\n",
|
"write_rf path:%d addr:0x%08x mask:0x%08x, val:0x%08x\n",
|
||||||
path, addr, mask, val);
|
path, addr, mask, val);
|
||||||
@@ -481,6 +485,8 @@ static int rtw_debug_get_rf_dump(struct
|
@@ -523,6 +527,8 @@ static int rtw_debug_get_rf_dump(struct seq_file *m, void *v)
|
||||||
u32 addr, offset, data;
|
u32 addr, offset, data;
|
||||||
u8 path;
|
u8 path;
|
||||||
|
|
||||||
@ -29,7 +44,7 @@
|
|||||||
for (path = 0; path < rtwdev->hal.rf_path_num; path++) {
|
for (path = 0; path < rtwdev->hal.rf_path_num; path++) {
|
||||||
seq_printf(m, "RF path:%d\n", path);
|
seq_printf(m, "RF path:%d\n", path);
|
||||||
for (addr = 0; addr < 0x100; addr += 4) {
|
for (addr = 0; addr < 0x100; addr += 4) {
|
||||||
@@ -495,6 +501,8 @@ static int rtw_debug_get_rf_dump(struct
|
@@ -537,6 +543,8 @@ static int rtw_debug_get_rf_dump(struct seq_file *m, void *v)
|
||||||
seq_puts(m, "\n");
|
seq_puts(m, "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -38,7 +53,7 @@
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -911,6 +919,8 @@ static void dump_gapk_status(struct rtw_
|
@@ -1027,6 +1035,8 @@ static void dump_gapk_status(struct rtw_dev *rtwdev, struct seq_file *m)
|
||||||
dm_info->dm_flags & BIT(RTW_DM_CAP_TXGAPK) ? '-' : '+',
|
dm_info->dm_flags & BIT(RTW_DM_CAP_TXGAPK) ? '-' : '+',
|
||||||
rtw_dm_cap_strs[RTW_DM_CAP_TXGAPK]);
|
rtw_dm_cap_strs[RTW_DM_CAP_TXGAPK]);
|
||||||
|
|
||||||
@ -47,7 +62,7 @@
|
|||||||
for (path = 0; path < rtwdev->hal.rf_path_num; path++) {
|
for (path = 0; path < rtwdev->hal.rf_path_num; path++) {
|
||||||
val = rtw_read_rf(rtwdev, path, RF_GAINTX, RFREG_MASK);
|
val = rtw_read_rf(rtwdev, path, RF_GAINTX, RFREG_MASK);
|
||||||
seq_printf(m, "path %d:\n0x%x = 0x%x\n", path, RF_GAINTX, val);
|
seq_printf(m, "path %d:\n0x%x = 0x%x\n", path, RF_GAINTX, val);
|
||||||
@@ -920,6 +930,7 @@ static void dump_gapk_status(struct rtw_
|
@@ -1036,6 +1046,7 @@ static void dump_gapk_status(struct rtw_dev *rtwdev, struct seq_file *m)
|
||||||
txgapk->rf3f_fs[path][i], i);
|
txgapk->rf3f_fs[path][i], i);
|
||||||
seq_puts(m, "\n");
|
seq_puts(m, "\n");
|
||||||
}
|
}
|
||||||
@ -55,8 +70,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int rtw_debugfs_get_dm_cap(struct seq_file *m, void *v)
|
static int rtw_debugfs_get_dm_cap(struct seq_file *m, void *v)
|
||||||
--- a/drivers/net/wireless/realtek/rtw88/hci.h
|
--- a/hci.h
|
||||||
+++ b/drivers/net/wireless/realtek/rtw88/hci.h
|
+++ b/hci.h
|
||||||
@@ -166,12 +166,11 @@ static inline u32
|
@@ -166,12 +166,11 @@ static inline u32
|
||||||
rtw_read_rf(struct rtw_dev *rtwdev, enum rtw_rf_path rf_path,
|
rtw_read_rf(struct rtw_dev *rtwdev, enum rtw_rf_path rf_path,
|
||||||
u32 addr, u32 mask)
|
u32 addr, u32 mask)
|
||||||
@ -85,9 +100,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
static inline u32
|
static inline u32
|
||||||
--- a/drivers/net/wireless/realtek/rtw88/main.c
|
--- a/main.c
|
||||||
+++ b/drivers/net/wireless/realtek/rtw88/main.c
|
+++ b/main.c
|
||||||
@@ -1839,7 +1839,6 @@ int rtw_core_init(struct rtw_dev *rtwdev
|
@@ -1994,7 +1994,6 @@ int rtw_core_init(struct rtw_dev *rtwdev)
|
||||||
skb_queue_head_init(&rtwdev->coex.queue);
|
skb_queue_head_init(&rtwdev->coex.queue);
|
||||||
skb_queue_head_init(&rtwdev->tx_report.queue);
|
skb_queue_head_init(&rtwdev->tx_report.queue);
|
||||||
|
|
||||||
@ -95,9 +110,9 @@
|
|||||||
spin_lock_init(&rtwdev->h2c.lock);
|
spin_lock_init(&rtwdev->h2c.lock);
|
||||||
spin_lock_init(&rtwdev->txq_lock);
|
spin_lock_init(&rtwdev->txq_lock);
|
||||||
spin_lock_init(&rtwdev->tx_report.q_lock);
|
spin_lock_init(&rtwdev->tx_report.q_lock);
|
||||||
--- a/drivers/net/wireless/realtek/rtw88/main.h
|
--- a/main.h
|
||||||
+++ b/drivers/net/wireless/realtek/rtw88/main.h
|
+++ b/main.h
|
||||||
@@ -1842,9 +1842,6 @@ struct rtw_dev {
|
@@ -1994,9 +1994,6 @@ struct rtw_dev {
|
||||||
/* ensures exclusive access from mac80211 callbacks */
|
/* ensures exclusive access from mac80211 callbacks */
|
||||||
struct mutex mutex;
|
struct mutex mutex;
|
||||||
|
|
@ -1,6 +1,20 @@
|
|||||||
--- a/drivers/net/wireless/realtek/rtw88/debug.c
|
From 1e2701f4079a7906ff3fb43a315925d303e289d8 Mon Sep 17 00:00:00 2001
|
||||||
+++ b/drivers/net/wireless/realtek/rtw88/debug.c
|
From: Sascha Hauer <s.hauer@pengutronix.de>
|
||||||
@@ -379,7 +379,9 @@ static ssize_t rtw_debugfs_set_h2c(struc
|
Date: Fri, 2 Dec 2022 09:12:17 +0100
|
||||||
|
Subject: [PATCH] wifi: rtw88: Drop h2c.lock
|
||||||
|
|
||||||
|
The h2c.lock spinlock is used in rtw_fw_send_h2c_command() and
|
||||||
|
rtw_fw_send_h2c_packet(). Most callers call this with rtwdev->mutex
|
||||||
|
held, except from one callsite in the debugfs code. The debugfs code
|
||||||
|
alone doesn't justify the extra lock, so acquire rtwdev->mutex in
|
||||||
|
debugfs and drop the now unnecessary spinlock.
|
||||||
|
|
||||||
|
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
||||||
|
---
|
||||||
|
|
||||||
|
--- a/debug.c
|
||||||
|
+++ b/debug.c
|
||||||
|
@@ -396,7 +396,9 @@ static ssize_t rtw_debugfs_set_h2c(struct file *filp,
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -10,9 +24,9 @@
|
|||||||
|
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
--- a/drivers/net/wireless/realtek/rtw88/fw.c
|
--- a/fw.c
|
||||||
+++ b/drivers/net/wireless/realtek/rtw88/fw.c
|
+++ b/fw.c
|
||||||
@@ -285,7 +285,7 @@ static void rtw_fw_send_h2c_command(stru
|
@@ -320,7 +320,7 @@ static void rtw_fw_send_h2c_command(struct rtw_dev *rtwdev,
|
||||||
h2c[3], h2c[2], h2c[1], h2c[0],
|
h2c[3], h2c[2], h2c[1], h2c[0],
|
||||||
h2c[7], h2c[6], h2c[5], h2c[4]);
|
h2c[7], h2c[6], h2c[5], h2c[4]);
|
||||||
|
|
||||||
@ -21,7 +35,7 @@
|
|||||||
|
|
||||||
box = rtwdev->h2c.last_box_num;
|
box = rtwdev->h2c.last_box_num;
|
||||||
switch (box) {
|
switch (box) {
|
||||||
@@ -307,7 +307,7 @@ static void rtw_fw_send_h2c_command(stru
|
@@ -342,7 +342,7 @@ static void rtw_fw_send_h2c_command(struct rtw_dev *rtwdev,
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
WARN(1, "invalid h2c mail box number\n");
|
WARN(1, "invalid h2c mail box number\n");
|
||||||
@ -30,7 +44,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
ret = read_poll_timeout_atomic(rtw_read8, box_state,
|
ret = read_poll_timeout_atomic(rtw_read8, box_state,
|
||||||
@@ -316,7 +316,7 @@ static void rtw_fw_send_h2c_command(stru
|
@@ -351,7 +351,7 @@ static void rtw_fw_send_h2c_command(struct rtw_dev *rtwdev,
|
||||||
|
|
||||||
if (ret) {
|
if (ret) {
|
||||||
rtw_err(rtwdev, "failed to send h2c command\n");
|
rtw_err(rtwdev, "failed to send h2c command\n");
|
||||||
@ -39,7 +53,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (idx = 0; idx < 4; idx++)
|
for (idx = 0; idx < 4; idx++)
|
||||||
@@ -326,9 +326,6 @@ static void rtw_fw_send_h2c_command(stru
|
@@ -361,9 +361,6 @@ static void rtw_fw_send_h2c_command(struct rtw_dev *rtwdev,
|
||||||
|
|
||||||
if (++rtwdev->h2c.last_box_num >= 4)
|
if (++rtwdev->h2c.last_box_num >= 4)
|
||||||
rtwdev->h2c.last_box_num = 0;
|
rtwdev->h2c.last_box_num = 0;
|
||||||
@ -49,7 +63,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
void rtw_fw_h2c_cmd_dbg(struct rtw_dev *rtwdev, u8 *h2c)
|
void rtw_fw_h2c_cmd_dbg(struct rtw_dev *rtwdev, u8 *h2c)
|
||||||
@@ -340,15 +337,13 @@ static void rtw_fw_send_h2c_packet(struc
|
@@ -375,15 +372,13 @@ static void rtw_fw_send_h2c_packet(struct rtw_dev *rtwdev, u8 *h2c_pkt)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
@ -66,9 +80,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
--- a/drivers/net/wireless/realtek/rtw88/main.c
|
--- a/main.c
|
||||||
+++ b/drivers/net/wireless/realtek/rtw88/main.c
|
+++ b/main.c
|
||||||
@@ -1839,7 +1839,6 @@ int rtw_core_init(struct rtw_dev *rtwdev
|
@@ -1994,7 +1994,6 @@ int rtw_core_init(struct rtw_dev *rtwdev)
|
||||||
skb_queue_head_init(&rtwdev->coex.queue);
|
skb_queue_head_init(&rtwdev->coex.queue);
|
||||||
skb_queue_head_init(&rtwdev->tx_report.queue);
|
skb_queue_head_init(&rtwdev->tx_report.queue);
|
||||||
|
|
||||||
@ -76,9 +90,9 @@
|
|||||||
spin_lock_init(&rtwdev->txq_lock);
|
spin_lock_init(&rtwdev->txq_lock);
|
||||||
spin_lock_init(&rtwdev->tx_report.q_lock);
|
spin_lock_init(&rtwdev->tx_report.q_lock);
|
||||||
|
|
||||||
--- a/drivers/net/wireless/realtek/rtw88/main.h
|
--- a/main.h
|
||||||
+++ b/drivers/net/wireless/realtek/rtw88/main.h
|
+++ b/main.h
|
||||||
@@ -1865,8 +1865,6 @@ struct rtw_dev {
|
@@ -2018,8 +2018,6 @@ struct rtw_dev {
|
||||||
struct {
|
struct {
|
||||||
/* incicate the mail box to use with fw */
|
/* incicate the mail box to use with fw */
|
||||||
u8 last_box_num;
|
u8 last_box_num;
|
||||||
@ -86,4 +100,4 @@
|
|||||||
- spinlock_t lock;
|
- spinlock_t lock;
|
||||||
u32 seq;
|
u32 seq;
|
||||||
} h2c;
|
} h2c;
|
||||||
|
|
74
package/kernel/rtw88-usb/patches/004-drop-coex-mutex.patch
Normal file
74
package/kernel/rtw88-usb/patches/004-drop-coex-mutex.patch
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
From 8647f7f0b9080bc2d2f6e02524782f2f02f159bc Mon Sep 17 00:00:00 2001
|
||||||
|
From: Sascha Hauer <s.hauer@pengutronix.de>
|
||||||
|
Date: Fri, 2 Dec 2022 09:12:18 +0100
|
||||||
|
Subject: [PATCH] wifi: rtw88: Drop coex mutex
|
||||||
|
|
||||||
|
coex->mutex is used in rtw_coex_info_request() only. Most callers of this
|
||||||
|
function hold rtwdev->mutex already, except for one callsite in the
|
||||||
|
debugfs code. The debugfs code alone doesn't justify the extra lock, so
|
||||||
|
acquire rtwdev->mutex there as well and drop the now unnecessary
|
||||||
|
spinlock.
|
||||||
|
|
||||||
|
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
||||||
|
---
|
||||||
|
|
||||||
|
--- a/coex.c
|
||||||
|
+++ b/coex.c
|
||||||
|
@@ -633,7 +633,7 @@ static struct sk_buff *rtw_coex_info_request(struct rtw_dev *rtwdev,
|
||||||
|
struct rtw_coex *coex = &rtwdev->coex;
|
||||||
|
struct sk_buff *skb_resp = NULL;
|
||||||
|
|
||||||
|
- mutex_lock(&coex->mutex);
|
||||||
|
+ lockdep_assert_held(&rtwdev->mutex);
|
||||||
|
|
||||||
|
rtw_fw_query_bt_mp_info(rtwdev, req);
|
||||||
|
|
||||||
|
@@ -650,7 +650,6 @@ static struct sk_buff *rtw_coex_info_request(struct rtw_dev *rtwdev,
|
||||||
|
}
|
||||||
|
|
||||||
|
out:
|
||||||
|
- mutex_unlock(&coex->mutex);
|
||||||
|
return skb_resp;
|
||||||
|
}
|
||||||
|
|
||||||
|
--- a/debug.c
|
||||||
|
+++ b/debug.c
|
||||||
|
@@ -842,7 +842,9 @@ static int rtw_debugfs_get_coex_info(struct seq_file *m, void *v)
|
||||||
|
struct rtw_debugfs_priv *debugfs_priv = m->private;
|
||||||
|
struct rtw_dev *rtwdev = debugfs_priv->rtwdev;
|
||||||
|
|
||||||
|
+ mutex_lock(&rtwdev->mutex);
|
||||||
|
rtw_coex_display_coex_info(rtwdev, m);
|
||||||
|
+ mutex_unlock(&rtwdev->mutex);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
--- a/main.c
|
||||||
|
+++ b/main.c
|
||||||
|
@@ -1998,7 +1998,6 @@ int rtw_core_init(struct rtw_dev *rtwdev)
|
||||||
|
spin_lock_init(&rtwdev->tx_report.q_lock);
|
||||||
|
|
||||||
|
mutex_init(&rtwdev->mutex);
|
||||||
|
- mutex_init(&rtwdev->coex.mutex);
|
||||||
|
mutex_init(&rtwdev->hal.tx_power_mutex);
|
||||||
|
|
||||||
|
init_waitqueue_head(&rtwdev->coex.wait);
|
||||||
|
@@ -2066,7 +2065,6 @@ void rtw_core_deinit(struct rtw_dev *rtwdev)
|
||||||
|
}
|
||||||
|
|
||||||
|
mutex_destroy(&rtwdev->mutex);
|
||||||
|
- mutex_destroy(&rtwdev->coex.mutex);
|
||||||
|
mutex_destroy(&rtwdev->hal.tx_power_mutex);
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL(rtw_core_deinit);
|
||||||
|
--- a/main.h
|
||||||
|
+++ b/main.h
|
||||||
|
@@ -1507,8 +1507,6 @@ struct rtw_coex_stat {
|
||||||
|
};
|
||||||
|
|
||||||
|
struct rtw_coex {
|
||||||
|
- /* protects coex info request section */
|
||||||
|
- struct mutex mutex;
|
||||||
|
struct sk_buff_head queue;
|
||||||
|
wait_queue_head_t wait;
|
||||||
|
|
@ -1,6 +1,25 @@
|
|||||||
--- a/drivers/net/wireless/realtek/rtw88/phy.c
|
From 78d5bf925f30bf9f79a69ce77386902672defe68 Mon Sep 17 00:00:00 2001
|
||||||
+++ b/drivers/net/wireless/realtek/rtw88/phy.c
|
From: Sascha Hauer <s.hauer@pengutronix.de>
|
||||||
@@ -240,7 +240,7 @@ static void rtw_phy_stat_rssi(struct rtw
|
Date: Fri, 2 Dec 2022 09:12:19 +0100
|
||||||
|
Subject: [PATCH] wifi: rtw88: iterate over vif/sta list non-atomically
|
||||||
|
|
||||||
|
The driver uses ieee80211_iterate_active_interfaces_atomic()
|
||||||
|
and ieee80211_iterate_stations_atomic() in several places and does
|
||||||
|
register accesses in the iterators. This doesn't cope with upcoming
|
||||||
|
USB support as registers can only be accessed non-atomically.
|
||||||
|
|
||||||
|
Split these into a two stage process: First use the atomic iterator
|
||||||
|
functions to collect all active interfaces or stations on a list, then
|
||||||
|
iterate over the list non-atomically and call the iterator on each
|
||||||
|
entry.
|
||||||
|
|
||||||
|
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
||||||
|
Suggested-by: Ping-Ke shih <pkshih@realtek.com>
|
||||||
|
---
|
||||||
|
|
||||||
|
--- a/phy.c
|
||||||
|
+++ b/phy.c
|
||||||
|
@@ -300,7 +300,7 @@ static void rtw_phy_stat_rssi(struct rtw_dev *rtwdev)
|
||||||
|
|
||||||
data.rtwdev = rtwdev;
|
data.rtwdev = rtwdev;
|
||||||
data.min_rssi = U8_MAX;
|
data.min_rssi = U8_MAX;
|
||||||
@ -9,7 +28,7 @@
|
|||||||
|
|
||||||
dm_info->pre_min_rssi = dm_info->min_rssi;
|
dm_info->pre_min_rssi = dm_info->min_rssi;
|
||||||
dm_info->min_rssi = data.min_rssi;
|
dm_info->min_rssi = data.min_rssi;
|
||||||
@@ -484,7 +484,7 @@ static void rtw_phy_ra_info_update(struc
|
@@ -544,7 +544,7 @@ static void rtw_phy_ra_info_update(struct rtw_dev *rtwdev)
|
||||||
if (rtwdev->watch_dog_cnt & 0x3)
|
if (rtwdev->watch_dog_cnt & 0x3)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -18,7 +37,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
static u32 rtw_phy_get_rrsr_mask(struct rtw_dev *rtwdev, u8 rate_idx)
|
static u32 rtw_phy_get_rrsr_mask(struct rtw_dev *rtwdev, u8 rate_idx)
|
||||||
@@ -537,7 +537,7 @@ static void rtw_phy_rrsr_update(struct r
|
@@ -597,7 +597,7 @@ static void rtw_phy_rrsr_update(struct rtw_dev *rtwdev)
|
||||||
struct rtw_dm_info *dm_info = &rtwdev->dm_info;
|
struct rtw_dm_info *dm_info = &rtwdev->dm_info;
|
||||||
|
|
||||||
dm_info->rrsr_mask_min = RRSR_RATE_ORDER_MAX;
|
dm_info->rrsr_mask_min = RRSR_RATE_ORDER_MAX;
|
||||||
@ -27,9 +46,9 @@
|
|||||||
rtw_write32(rtwdev, REG_RRSR, dm_info->rrsr_val_init & dm_info->rrsr_mask_min);
|
rtw_write32(rtwdev, REG_RRSR, dm_info->rrsr_val_init & dm_info->rrsr_mask_min);
|
||||||
}
|
}
|
||||||
|
|
||||||
--- a/drivers/net/wireless/realtek/rtw88/ps.c
|
--- a/ps.c
|
||||||
+++ b/drivers/net/wireless/realtek/rtw88/ps.c
|
+++ b/ps.c
|
||||||
@@ -58,7 +58,7 @@ int rtw_leave_ips(struct rtw_dev *rtwdev
|
@@ -58,7 +58,7 @@ int rtw_leave_ips(struct rtw_dev *rtwdev)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -38,9 +57,9 @@
|
|||||||
|
|
||||||
rtw_coex_ips_notify(rtwdev, COEX_IPS_LEAVE);
|
rtw_coex_ips_notify(rtwdev, COEX_IPS_LEAVE);
|
||||||
|
|
||||||
--- a/drivers/net/wireless/realtek/rtw88/util.c
|
--- a/util.c
|
||||||
+++ b/drivers/net/wireless/realtek/rtw88/util.c
|
+++ b/util.c
|
||||||
@@ -105,3 +105,106 @@ void rtw_desc_to_mcsrate(u16 rate, u8 *m
|
@@ -105,3 +105,106 @@ void rtw_desc_to_mcsrate(u16 rate, u8 *mcs, u8 *nss)
|
||||||
*mcs = rate - DESC_RATEMCS0;
|
*mcs = rate - DESC_RATEMCS0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -147,8 +166,8 @@
|
|||||||
+ kfree(vif_entry);
|
+ kfree(vif_entry);
|
||||||
+ }
|
+ }
|
||||||
+}
|
+}
|
||||||
--- a/drivers/net/wireless/realtek/rtw88/util.h
|
--- a/util.h
|
||||||
+++ b/drivers/net/wireless/realtek/rtw88/util.h
|
+++ b/util.h
|
||||||
@@ -7,9 +7,6 @@
|
@@ -7,9 +7,6 @@
|
||||||
|
|
||||||
struct rtw_dev;
|
struct rtw_dev;
|
25
package/kernel/rtw88-usb/patches/100-update-makefile.patch
Normal file
25
package/kernel/rtw88-usb/patches/100-update-makefile.patch
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
--- a/Makefile
|
||||||
|
+++ b/Makefile
|
||||||
|
@@ -2,22 +2,6 @@
|
||||||
|
KERNELDIR ?= /lib/modules/$(shell uname -r)/build
|
||||||
|
PWD := $(shell pwd)
|
||||||
|
|
||||||
|
-CONFIG_RTW88_CORE=m
|
||||||
|
-CONFIG_RTW88_PCI=m
|
||||||
|
-CONFIG_RTW88_USB=m
|
||||||
|
-CONFIG_RTW88_8822BE=m
|
||||||
|
-CONFIG_RTW88_8822BU=m
|
||||||
|
-CONFIG_RTW88_8822B=m
|
||||||
|
-CONFIG_RTW88_8821CE=m
|
||||||
|
-CONFIG_RTW88_8821CU=m
|
||||||
|
-CONFIG_RTW88_8821C=m
|
||||||
|
-CONFIG_RTW88_8822CE=m
|
||||||
|
-CONFIG_RTW88_8822CU=m
|
||||||
|
-CONFIG_RTW88_8822C=m
|
||||||
|
-CONFIG_RTW88_8723DE=m
|
||||||
|
-CONFIG_RTW88_8723DU=m
|
||||||
|
-CONFIG_RTW88_8723D=m
|
||||||
|
-
|
||||||
|
ifneq ($(CONFIG_RTW88_8822BE),m)
|
||||||
|
ccflags-y += -DCONFIG_RTW88_8822BE=y
|
||||||
|
endif
|
14
package/kernel/rtw88-usb/patches/101-wireless-5.14.patch
Normal file
14
package/kernel/rtw88-usb/patches/101-wireless-5.14.patch
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
--- a/mac80211.c
|
||||||
|
+++ b/mac80211.c
|
||||||
|
@@ -614,7 +614,11 @@ static void rtw_ops_sw_scan_complete(struct ieee80211_hw *hw,
|
||||||
|
|
||||||
|
static void rtw_ops_mgd_prepare_tx(struct ieee80211_hw *hw,
|
||||||
|
struct ieee80211_vif *vif,
|
||||||
|
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 14, 0))
|
||||||
|
+ struct ieee80211_prep_tx_info *info)
|
||||||
|
+#else
|
||||||
|
u16 duration)
|
||||||
|
+#endif
|
||||||
|
{
|
||||||
|
struct rtw_dev *rtwdev = hw->priv;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user