Commit f29dcae9 authored by Kalle Valo's avatar Kalle Valo
Browse files

Merge tag 'rtw-next-2024-06-04' of https://github.com/pkshih/rtw

rtw-next patches for v6.11

Some fixes and refactors of rtlwifi, rtw88 and rtw89. Only one major change
listed below:

rtlwifi:
 - add new chip support of RTL8192DU
parents 5bcd9a0a 9373ed28
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -119,6 +119,18 @@ config RTL8192CU

	If you choose to build it as a module, it will be called rtl8192cu

config RTL8192DU
	tristate "Realtek RTL8192DU USB Wireless Network Adapter"
	depends on USB
	select RTLWIFI
	select RTLWIFI_USB
	select RTL8192D_COMMON
	help
	This is the driver for Realtek RTL8192DU 802.11n USB
	wireless network adapters.

	If you choose to build it as a module, it will be called rtl8192du

config RTLWIFI
	tristate
	select FW_LOADER
+1 −0
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ obj-$(CONFIG_RTL8192CU) += rtl8192cu/
obj-$(CONFIG_RTL8192SE)		+= rtl8192se/
obj-$(CONFIG_RTL8192D_COMMON)	+= rtl8192d/
obj-$(CONFIG_RTL8192DE)		+= rtl8192de/
obj-$(CONFIG_RTL8192DU)		+= rtl8192du/
obj-$(CONFIG_RTL8723AE)		+= rtl8723ae/
obj-$(CONFIG_RTL8723BE)		+= rtl8723be/
obj-$(CONFIG_RTL8188EE)		+= rtl8188ee/
+1 −1
Original line number Diff line number Diff line
@@ -2272,7 +2272,7 @@ static void rtl_c2h_content_parsing(struct ieee80211_hw *hw,
				    struct sk_buff *skb)
{
	struct rtl_priv *rtlpriv = rtl_priv(hw);
	struct rtl_hal_ops *hal_ops = rtlpriv->cfg->ops;
	const struct rtl_hal_ops *hal_ops = rtlpriv->cfg->ops;
	const struct rtl_btc_ops *btc_ops = rtlpriv->btcoexist.btc_ops;
	u8 cmd_id, cmd_len;
	u8 *cmd_buf = NULL;
+1 −2
Original line number Diff line number Diff line
@@ -53,8 +53,6 @@ static int rtl92cu_init_sw_vars(struct ieee80211_hw *hw)
	} else {
		fw_name = "rtlwifi/rtl8192cufw_TMSC.bin";
	}
	/* provide name of alternative file */
	rtlpriv->cfg->alt_fw_name = "rtlwifi/rtl8192cufw.bin";
	pr_info("Loading firmware %s\n", fw_name);
	rtlpriv->max_fw_size = 0x4000;
	err = request_firmware_nowait(THIS_MODULE, 1,
@@ -160,6 +158,7 @@ static struct rtl_hal_usbint_cfg rtl92cu_interface_cfg = {

static struct rtl_hal_cfg rtl92cu_hal_cfg = {
	.name = "rtl92c_usb",
	.alt_fw_name = "rtlwifi/rtl8192cufw.bin",
	.ops = &rtl8192cu_hal_ops,
	.mod_params = &rtl92cu_mod_params,
	.usb_interface_cfg = &rtl92cu_interface_cfg,
+47 −47
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@
#include "hw_common.h"
#include "phy_common.h"

void rtl92de_stop_tx_beacon(struct ieee80211_hw *hw)
void rtl92d_stop_tx_beacon(struct ieee80211_hw *hw)
{
	struct rtl_priv *rtlpriv = rtl_priv(hw);
	u8 tmp1byte;
@@ -27,9 +27,9 @@ void rtl92de_stop_tx_beacon(struct ieee80211_hw *hw)
	tmp1byte &= ~(BIT(0));
	rtl_write_byte(rtlpriv, REG_TBTT_PROHIBIT + 2, tmp1byte);
}
EXPORT_SYMBOL_GPL(rtl92de_stop_tx_beacon);
EXPORT_SYMBOL_GPL(rtl92d_stop_tx_beacon);

void rtl92de_resume_tx_beacon(struct ieee80211_hw *hw)
void rtl92d_resume_tx_beacon(struct ieee80211_hw *hw)
{
	struct rtl_priv *rtlpriv = rtl_priv(hw);
	u8 tmp1byte;
@@ -42,7 +42,7 @@ void rtl92de_resume_tx_beacon(struct ieee80211_hw *hw)
	tmp1byte |= BIT(0);
	rtl_write_byte(rtlpriv, REG_TBTT_PROHIBIT + 2, tmp1byte);
}
EXPORT_SYMBOL_GPL(rtl92de_resume_tx_beacon);
EXPORT_SYMBOL_GPL(rtl92d_resume_tx_beacon);

void rtl92d_get_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
{
@@ -285,7 +285,7 @@ void rtl92d_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
}
EXPORT_SYMBOL_GPL(rtl92d_set_hw_reg);

bool rtl92de_llt_write(struct ieee80211_hw *hw, u32 address, u32 data)
bool rtl92d_llt_write(struct ieee80211_hw *hw, u32 address, u32 data)
{
	struct rtl_priv *rtlpriv = rtl_priv(hw);
	bool status = true;
@@ -307,9 +307,9 @@ bool rtl92de_llt_write(struct ieee80211_hw *hw, u32 address, u32 data)
	} while (++count);
	return status;
}
EXPORT_SYMBOL_GPL(rtl92de_llt_write);
EXPORT_SYMBOL_GPL(rtl92d_llt_write);

void rtl92de_enable_hw_security_config(struct ieee80211_hw *hw)
void rtl92d_enable_hw_security_config(struct ieee80211_hw *hw)
{
	struct rtl_priv *rtlpriv = rtl_priv(hw);
	u8 sec_reg_value;
@@ -334,16 +334,16 @@ void rtl92de_enable_hw_security_config(struct ieee80211_hw *hw)
		"The SECR-value %x\n", sec_reg_value);
	rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_WPA_CONFIG, &sec_reg_value);
}
EXPORT_SYMBOL_GPL(rtl92de_enable_hw_security_config);
EXPORT_SYMBOL_GPL(rtl92d_enable_hw_security_config);

/* don't set REG_EDCA_BE_PARAM here because
 * mac80211 will send pkt when scan
 */
void rtl92de_set_qos(struct ieee80211_hw *hw, int aci)
void rtl92d_set_qos(struct ieee80211_hw *hw, int aci)
{
	rtl92d_dm_init_edca_turbo(hw);
}
EXPORT_SYMBOL_GPL(rtl92de_set_qos);
EXPORT_SYMBOL_GPL(rtl92d_set_qos);

static enum version_8192d _rtl92d_read_chip_version(struct ieee80211_hw *hw)
{
@@ -362,7 +362,7 @@ static enum version_8192d _rtl92d_read_chip_version(struct ieee80211_hw *hw)
	return version;
}

static void _rtl92de_readpowervalue_fromprom(struct txpower_info *pwrinfo,
static void _rtl92d_readpowervalue_fromprom(struct txpower_info *pwrinfo,
					    u8 *efuse, bool autoloadfail)
{
	u32 rfpath, eeaddr, group, offset, offset1, offset2;
@@ -500,7 +500,7 @@ static void _rtl92de_readpowervalue_fromprom(struct txpower_info *pwrinfo,
	}
}

static void _rtl92de_read_txpower_info(struct ieee80211_hw *hw,
static void _rtl92d_read_txpower_info(struct ieee80211_hw *hw,
				      bool autoload_fail, u8 *hwinfo)
{
	struct rtl_priv *rtlpriv = rtl_priv(hw);
@@ -509,7 +509,7 @@ static void _rtl92de_read_txpower_info(struct ieee80211_hw *hw,
	u8 tempval[2], i, pwr, diff;
	u32 ch, rfpath, group;

	_rtl92de_readpowervalue_fromprom(&pwrinfo, hwinfo, autoload_fail);
	_rtl92d_readpowervalue_fromprom(&pwrinfo, hwinfo, autoload_fail);
	if (!autoload_fail) {
		/* bit0~2 */
		rtlefuse->eeprom_regulatory = (hwinfo[EEPROM_RF_OPT1] & 0x7);
@@ -613,7 +613,7 @@ static void _rtl92de_read_txpower_info(struct ieee80211_hw *hw,
	}
}

static void _rtl92de_read_macphymode_from_prom(struct ieee80211_hw *hw,
static void _rtl92d_read_macphymode_from_prom(struct ieee80211_hw *hw,
					      u8 *content)
{
	struct rtl_priv *rtlpriv = rtl_priv(hw);
@@ -636,15 +636,15 @@ static void _rtl92de_read_macphymode_from_prom(struct ieee80211_hw *hw,
	}
}

static void _rtl92de_read_macphymode_and_bandtype(struct ieee80211_hw *hw,
static void _rtl92d_read_macphymode_and_bandtype(struct ieee80211_hw *hw,
						 u8 *content)
{
	_rtl92de_read_macphymode_from_prom(hw, content);
	_rtl92d_read_macphymode_from_prom(hw, content);
	rtl92d_phy_config_macphymode(hw);
	rtl92d_phy_config_macphymode_info(hw);
}

static void _rtl92de_efuse_update_chip_version(struct ieee80211_hw *hw)
static void _rtl92d_efuse_update_chip_version(struct ieee80211_hw *hw)
{
	struct rtl_priv *rtlpriv = rtl_priv(hw);
	enum version_8192d chipver = rtlpriv->rtlhal.version;
@@ -676,7 +676,7 @@ static void _rtl92de_efuse_update_chip_version(struct ieee80211_hw *hw)
	rtlpriv->rtlhal.version = chipver;
}

static void _rtl92de_read_adapter_info(struct ieee80211_hw *hw)
static void _rtl92d_read_adapter_info(struct ieee80211_hw *hw)
{
	static const int params_pci[] = {
		RTL8190_EEPROM_ID, EEPROM_VID, EEPROM_DID,
@@ -706,8 +706,8 @@ static void _rtl92de_read_adapter_info(struct ieee80211_hw *hw)
	if (rtl_get_hwinfo(hw, rtlpriv, HWSET_MAX_SIZE, hwinfo, params))
		goto exit;

	_rtl92de_efuse_update_chip_version(hw);
	_rtl92de_read_macphymode_and_bandtype(hw, hwinfo);
	_rtl92d_efuse_update_chip_version(hw);
	_rtl92d_read_macphymode_and_bandtype(hw, hwinfo);

	/* Read Permanent MAC address for 2nd interface */
	if (rtlhal->interfaceindex != 0)
@@ -717,7 +717,7 @@ static void _rtl92de_read_adapter_info(struct ieee80211_hw *hw)
	rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_ETHER_ADDR,
				      rtlefuse->dev_addr);
	rtl_dbg(rtlpriv, COMP_INIT, DBG_DMESG, "%pM\n", rtlefuse->dev_addr);
	_rtl92de_read_txpower_info(hw, rtlefuse->autoload_failflag, hwinfo);
	_rtl92d_read_txpower_info(hw, rtlefuse->autoload_failflag, hwinfo);

	/* Read Channel Plan */
	switch (rtlhal->bandset) {
@@ -739,7 +739,7 @@ static void _rtl92de_read_adapter_info(struct ieee80211_hw *hw)
	kfree(hwinfo);
}

void rtl92de_read_eeprom_info(struct ieee80211_hw *hw)
void rtl92d_read_eeprom_info(struct ieee80211_hw *hw)
{
	struct rtl_priv *rtlpriv = rtl_priv(hw);
	struct rtl_efuse *rtlefuse = rtl_efuse(rtl_priv(hw));
@@ -760,14 +760,14 @@ void rtl92de_read_eeprom_info(struct ieee80211_hw *hw)
		rtl_dbg(rtlpriv, COMP_INIT, DBG_LOUD, "Autoload OK\n");

		rtlefuse->autoload_failflag = false;
		_rtl92de_read_adapter_info(hw);
		_rtl92d_read_adapter_info(hw);
	} else {
		pr_err("Autoload ERR!!\n");
	}
}
EXPORT_SYMBOL_GPL(rtl92de_read_eeprom_info);
EXPORT_SYMBOL_GPL(rtl92d_read_eeprom_info);

static void rtl92de_update_hal_rate_table(struct ieee80211_hw *hw,
static void rtl92d_update_hal_rate_table(struct ieee80211_hw *hw,
					 struct ieee80211_sta *sta)
{
	struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
@@ -851,7 +851,7 @@ static void rtl92de_update_hal_rate_table(struct ieee80211_hw *hw,
		rtl_read_dword(rtlpriv, REG_ARFR0));
}

static void rtl92de_update_hal_rate_mask(struct ieee80211_hw *hw,
static void rtl92d_update_hal_rate_mask(struct ieee80211_hw *hw,
					struct ieee80211_sta *sta,
					u8 rssi_level, bool update_bw)
{
@@ -1009,20 +1009,20 @@ static void rtl92de_update_hal_rate_mask(struct ieee80211_hw *hw,
		sta_entry->ratr_index = ratr_index;
}

void rtl92de_update_hal_rate_tbl(struct ieee80211_hw *hw,
void rtl92d_update_hal_rate_tbl(struct ieee80211_hw *hw,
				struct ieee80211_sta *sta,
				u8 rssi_level, bool update_bw)
{
	struct rtl_priv *rtlpriv = rtl_priv(hw);

	if (rtlpriv->dm.useramask)
		rtl92de_update_hal_rate_mask(hw, sta, rssi_level, update_bw);
		rtl92d_update_hal_rate_mask(hw, sta, rssi_level, update_bw);
	else
		rtl92de_update_hal_rate_table(hw, sta);
		rtl92d_update_hal_rate_table(hw, sta);
}
EXPORT_SYMBOL_GPL(rtl92de_update_hal_rate_tbl);
EXPORT_SYMBOL_GPL(rtl92d_update_hal_rate_tbl);

void rtl92de_update_channel_access_setting(struct ieee80211_hw *hw)
void rtl92d_update_channel_access_setting(struct ieee80211_hw *hw)
{
	struct rtl_priv *rtlpriv = rtl_priv(hw);
	struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
@@ -1036,9 +1036,9 @@ void rtl92de_update_channel_access_setting(struct ieee80211_hw *hw)
		sifs_timer = 0x1010;
	rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_SIFS, (u8 *)&sifs_timer);
}
EXPORT_SYMBOL_GPL(rtl92de_update_channel_access_setting);
EXPORT_SYMBOL_GPL(rtl92d_update_channel_access_setting);

bool rtl92de_gpio_radio_on_off_checking(struct ieee80211_hw *hw, u8 *valid)
bool rtl92d_gpio_radio_on_off_checking(struct ieee80211_hw *hw, u8 *valid)
{
	struct rtl_priv *rtlpriv = rtl_priv(hw);
	struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw));
@@ -1093,9 +1093,9 @@ bool rtl92de_gpio_radio_on_off_checking(struct ieee80211_hw *hw, u8 *valid)
	*valid = 1;
	return !ppsc->hwradiooff;
}
EXPORT_SYMBOL_GPL(rtl92de_gpio_radio_on_off_checking);
EXPORT_SYMBOL_GPL(rtl92d_gpio_radio_on_off_checking);

void rtl92de_set_key(struct ieee80211_hw *hw, u32 key_index,
void rtl92d_set_key(struct ieee80211_hw *hw, u32 key_index,
		    u8 *p_macaddr, bool is_group, u8 enc_algo,
		    bool is_wepkey, bool clear_all)
{
@@ -1222,4 +1222,4 @@ void rtl92de_set_key(struct ieee80211_hw *hw, u32 key_index,
		}
	}
}
EXPORT_SYMBOL_GPL(rtl92de_set_key);
EXPORT_SYMBOL_GPL(rtl92d_set_key);
Loading