mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-09 10:11:52 -04:00
wifi: rtl8xxxu: Support new chip RTL8192FU
This is a newer chip, similar to the RTL8710BU in that it uses the same PHY status structs. Features: 2.4 GHz, b/g/n mode, 2T2R, 300 Mbps. It can allegedly have Bluetooth, but that's not implemented here. This chip can have many RFE (RF front end) types, of which types 1 and 5 are the only ones tested. Many of the other types need different initialisation tables. They can be added if someone wants them. The vendor driver v5.8.6.2_35538.20191028_COEX20190910-0d02 from https://github.com/BrightX/rtl8192fu was used as reference, with additional device IDs taken from https://github.com/kelebek333/rtl8192fu-dkms. The vendor driver also claims to support devices with ID 0bda:a725, but that is found in some bluetooth-only devices, so it's not supported here. Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com> Reviewed-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/7dcf9fb9-1c97-ac28-5286-2236e287a18c@gmail.com
This commit is contained in:
committed by
Kalle Valo
parent
87807f77a0
commit
c98411dc8c
@@ -11,7 +11,8 @@ config RTL8XXXU
|
||||
parts written to utilize the Linux mac80211 stack.
|
||||
The driver is known to work with a number of RTL8723AU,
|
||||
RL8188CU, RTL8188RU, RTL8191CU, RTL8192CU, RTL8723BU, RTL8192EU,
|
||||
RTL8188FU, RTL8188EU, and RTL8710BU (aka RTL8188GU) devices.
|
||||
RTL8188FU, RTL8188EU, RTL8710BU (aka RTL8188GU), and RTL8192FU
|
||||
devices.
|
||||
|
||||
This driver is under development and has a limited feature
|
||||
set. In particular it does not yet support 40MHz channels
|
||||
|
||||
@@ -3,4 +3,4 @@ obj-$(CONFIG_RTL8XXXU) += rtl8xxxu.o
|
||||
|
||||
rtl8xxxu-y := rtl8xxxu_core.o rtl8xxxu_8192e.o rtl8xxxu_8723b.o \
|
||||
rtl8xxxu_8723a.o rtl8xxxu_8192c.o rtl8xxxu_8188f.o \
|
||||
rtl8xxxu_8188e.o rtl8xxxu_8710b.o
|
||||
rtl8xxxu_8188e.o rtl8xxxu_8710b.o rtl8xxxu_8192f.o
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
#define TX_TOTAL_PAGE_NUM_8188E 0xa9
|
||||
#define TX_TOTAL_PAGE_NUM_8192E 0xf3
|
||||
#define TX_TOTAL_PAGE_NUM_8723B 0xf7
|
||||
#define TX_TOTAL_PAGE_NUM_8192F 0xf7
|
||||
/* (HPQ + LPQ + NPQ + PUBQ) = TX_TOTAL_PAGE_NUM */
|
||||
#define TX_PAGE_NUM_PUBQ 0xe7
|
||||
#define TX_PAGE_NUM_HI_PQ 0x0c
|
||||
@@ -65,6 +66,11 @@
|
||||
#define TX_PAGE_NUM_LO_PQ_8723B 0x02
|
||||
#define TX_PAGE_NUM_NORM_PQ_8723B 0x02
|
||||
|
||||
#define TX_PAGE_NUM_PUBQ_8192F 0xde
|
||||
#define TX_PAGE_NUM_HI_PQ_8192F 0x08
|
||||
#define TX_PAGE_NUM_LO_PQ_8192F 0x08
|
||||
#define TX_PAGE_NUM_NORM_PQ_8192F 0x08
|
||||
|
||||
#define RTL_FW_PAGE_SIZE 4096
|
||||
#define RTL8XXXU_FIRMWARE_POLL_MAX 1000
|
||||
|
||||
@@ -81,6 +87,7 @@
|
||||
#define EFUSE_REAL_CONTENT_LEN_8723A 512
|
||||
#define EFUSE_BT_MAP_LEN_8723A 1024
|
||||
#define EFUSE_MAX_WORD_UNIT 4
|
||||
#define EFUSE_UNDEFINED 0xff
|
||||
|
||||
enum rtl8xxxu_rtl_chip {
|
||||
RTL8192S = 0x81920,
|
||||
@@ -105,6 +112,7 @@ enum rtl8xxxu_rtl_chip {
|
||||
RTL8195A = 0x8195a,
|
||||
RTL8188F = 0x8188f,
|
||||
RTL8710B = 0x8710b,
|
||||
RTL8192F = 0x8192f,
|
||||
};
|
||||
|
||||
enum rtl8xxxu_rx_type {
|
||||
@@ -1246,6 +1254,40 @@ struct rtl8710bu_efuse {
|
||||
u8 res7[0x3c];
|
||||
} __packed;
|
||||
|
||||
struct rtl8192fu_efuse {
|
||||
__le16 rtl_id;
|
||||
u8 res0[0x0e];
|
||||
struct rtl8192eu_efuse_tx_power tx_power_index_A; /* 0x10 */
|
||||
struct rtl8192eu_efuse_tx_power tx_power_index_B; /* 0x3a */
|
||||
u8 res2[0x54];
|
||||
u8 channel_plan; /* 0xb8 */
|
||||
u8 xtal_k; /* 0xb9 */
|
||||
u8 thermal_meter; /* 0xba */
|
||||
u8 iqk_lck; /* 0xbb */
|
||||
u8 pa_type; /* 0xbc */
|
||||
u8 lna_type_2g; /* 0xbd */
|
||||
u8 res3[1];
|
||||
u8 lna_type_5g; /* 0xbf */
|
||||
u8 res4[1];
|
||||
u8 rf_board_option; /* 0xc1 */
|
||||
u8 rf_feature_option; /* 0xc2 */
|
||||
u8 rf_bt_setting; /* 0xc3 */
|
||||
u8 eeprom_version; /* 0xc4 */
|
||||
u8 eeprom_customer_id; /* 0xc5 */
|
||||
u8 res5[3];
|
||||
u8 rf_antenna_option; /* 0xc9 */
|
||||
u8 rfe_option; /* 0xca */
|
||||
u8 country_code; /* 0xcb */
|
||||
u8 res6[52];
|
||||
u8 vid[2]; /* 0x100 */
|
||||
u8 pid[2]; /* 0x102 */
|
||||
u8 usb_optional_function; /* 0x104 */
|
||||
u8 res7[2];
|
||||
u8 mac_addr[ETH_ALEN]; /* 0x107 */
|
||||
u8 device_info[80]; /* 0x10d */
|
||||
u8 res9[163];
|
||||
} __packed;
|
||||
|
||||
struct rtl8xxxu_reg8val {
|
||||
u16 reg;
|
||||
u8 val;
|
||||
@@ -1796,6 +1838,7 @@ struct rtl8xxxu_priv {
|
||||
u32 cck_agc_report_type:1;
|
||||
u32 cck_new_agc:1;
|
||||
u8 default_crystal_cap;
|
||||
u8 rfe_type;
|
||||
unsigned int pipe_interrupt;
|
||||
unsigned int pipe_in;
|
||||
unsigned int pipe_out[TXDESC_QUEUE_MAX];
|
||||
@@ -1835,6 +1878,7 @@ struct rtl8xxxu_priv {
|
||||
struct rtl8188fu_efuse efuse8188fu;
|
||||
struct rtl8188eu_efuse efuse8188eu;
|
||||
struct rtl8710bu_efuse efuse8710bu;
|
||||
struct rtl8192fu_efuse efuse8192fu;
|
||||
} efuse_wifi;
|
||||
u32 adda_backup[RTL8XXXU_ADDA_REGS];
|
||||
u32 mac_backup[RTL8XXXU_MAC_REGS];
|
||||
@@ -1943,6 +1987,7 @@ struct rtl8xxxu_fileops {
|
||||
u8 init_reg_hmtfr:1;
|
||||
u8 ampdu_max_time;
|
||||
u8 ustime_tsf_edca;
|
||||
u16 max_aggr_num;
|
||||
u8 supports_ap:1;
|
||||
u16 max_macid_num;
|
||||
u32 adda_1t_init;
|
||||
@@ -2031,6 +2076,7 @@ void rtl8xxxu_gen1_phy_iq_calibrate(struct rtl8xxxu_priv *priv);
|
||||
void rtl8xxxu_gen1_init_phy_bb(struct rtl8xxxu_priv *priv);
|
||||
void rtl8xxxu_gen1_set_tx_power(struct rtl8xxxu_priv *priv,
|
||||
int channel, bool ht40);
|
||||
void rtl8188f_channel_to_group(int channel, int *group, int *cck_group);
|
||||
void rtl8188f_set_tx_power(struct rtl8xxxu_priv *priv,
|
||||
int channel, bool ht40);
|
||||
void rtl8xxxu_gen1_config_channel(struct ieee80211_hw *hw);
|
||||
@@ -2095,6 +2141,7 @@ void rtl8xxxu_update_ra_report(struct rtl8xxxu_ra_report *rarpt,
|
||||
void rtl8188e_ra_info_init_all(struct rtl8xxxu_ra_info *ra);
|
||||
void rtl8188e_handle_ra_tx_report2(struct rtl8xxxu_priv *priv, struct sk_buff *skb);
|
||||
|
||||
extern struct rtl8xxxu_fileops rtl8192fu_fops;
|
||||
extern struct rtl8xxxu_fileops rtl8710bu_fops;
|
||||
extern struct rtl8xxxu_fileops rtl8188fu_fops;
|
||||
extern struct rtl8xxxu_fileops rtl8188eu_fops;
|
||||
|
||||
@@ -351,7 +351,7 @@ static int rtl8188fu_identify_chip(struct rtl8xxxu_priv *priv)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void rtl8188f_channel_to_group(int channel, int *group, int *cck_group)
|
||||
void rtl8188f_channel_to_group(int channel, int *group, int *cck_group)
|
||||
{
|
||||
if (channel < 3)
|
||||
*group = 0;
|
||||
@@ -1748,6 +1748,7 @@ struct rtl8xxxu_fileops rtl8188fu_fops = {
|
||||
.init_reg_hmtfr = 1,
|
||||
.ampdu_max_time = 0x70,
|
||||
.ustime_tsf_edca = 0x28,
|
||||
.max_aggr_num = 0x0c14,
|
||||
.supports_ap = 1,
|
||||
.max_macid_num = 16,
|
||||
.adda_1t_init = 0x03c00014,
|
||||
|
||||
2090
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192f.c
Normal file
2090
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192f.c
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1874,6 +1874,7 @@ struct rtl8xxxu_fileops rtl8710bu_fops = {
|
||||
* but in rtl8xxxu 0x50 causes slow upload and random packet loss. Why?
|
||||
*/
|
||||
.ustime_tsf_edca = 0x28,
|
||||
.max_aggr_num = 0x0c14,
|
||||
.adda_1t_init = 0x03c00016,
|
||||
.adda_1t_path_on = 0x03c00016,
|
||||
.trxff_boundary = 0x3f7f,
|
||||
|
||||
@@ -1741,6 +1741,7 @@ struct rtl8xxxu_fileops rtl8723bu_fops = {
|
||||
.init_reg_hmtfr = 1,
|
||||
.ampdu_max_time = 0x5e,
|
||||
.ustime_tsf_edca = 0x50,
|
||||
.max_aggr_num = 0x0c14,
|
||||
.adda_1t_init = 0x01c00014,
|
||||
.adda_1t_path_on = 0x01c00014,
|
||||
.adda_2t_path_on_a = 0x01c00014,
|
||||
|
||||
@@ -56,6 +56,7 @@ MODULE_FIRMWARE("rtlwifi/rtl8723bu_bt.bin");
|
||||
MODULE_FIRMWARE("rtlwifi/rtl8188fufw.bin");
|
||||
MODULE_FIRMWARE("rtlwifi/rtl8710bufw_SMIC.bin");
|
||||
MODULE_FIRMWARE("rtlwifi/rtl8710bufw_UMC.bin");
|
||||
MODULE_FIRMWARE("rtlwifi/rtl8192fufw.bin");
|
||||
|
||||
module_param_named(debug, rtl8xxxu_debug, int, 0600);
|
||||
MODULE_PARM_DESC(debug, "Set debug mask");
|
||||
@@ -2020,12 +2021,18 @@ static int rtl8xxxu_start_firmware(struct rtl8xxxu_priv *priv)
|
||||
static int rtl8xxxu_download_firmware(struct rtl8xxxu_priv *priv)
|
||||
{
|
||||
int pages, remainder, i, ret;
|
||||
u16 reg_fw_start_address;
|
||||
u16 reg_mcu_fw_dl;
|
||||
u8 val8;
|
||||
u16 val16;
|
||||
u32 val32;
|
||||
u8 *fwptr;
|
||||
|
||||
if (priv->rtl_chip == RTL8192F)
|
||||
reg_fw_start_address = REG_FW_START_ADDRESS_8192F;
|
||||
else
|
||||
reg_fw_start_address = REG_FW_START_ADDRESS;
|
||||
|
||||
if (priv->rtl_chip == RTL8710B) {
|
||||
reg_mcu_fw_dl = REG_8051FW_CTRL_V1_8710B;
|
||||
} else {
|
||||
@@ -2081,7 +2088,7 @@ static int rtl8xxxu_download_firmware(struct rtl8xxxu_priv *priv)
|
||||
val8 |= i;
|
||||
rtl8xxxu_write8(priv, reg_mcu_fw_dl + 2, val8);
|
||||
|
||||
ret = rtl8xxxu_writeN(priv, REG_FW_START_ADDRESS,
|
||||
ret = rtl8xxxu_writeN(priv, reg_fw_start_address,
|
||||
fwptr, RTL_FW_PAGE_SIZE);
|
||||
if (ret != RTL_FW_PAGE_SIZE) {
|
||||
ret = -EAGAIN;
|
||||
@@ -2095,7 +2102,7 @@ static int rtl8xxxu_download_firmware(struct rtl8xxxu_priv *priv)
|
||||
val8 = rtl8xxxu_read8(priv, reg_mcu_fw_dl + 2) & 0xF8;
|
||||
val8 |= i;
|
||||
rtl8xxxu_write8(priv, reg_mcu_fw_dl + 2, val8);
|
||||
ret = rtl8xxxu_writeN(priv, REG_FW_START_ADDRESS,
|
||||
ret = rtl8xxxu_writeN(priv, reg_fw_start_address,
|
||||
fwptr, remainder);
|
||||
if (ret != remainder) {
|
||||
ret = -EAGAIN;
|
||||
@@ -2149,6 +2156,7 @@ int rtl8xxxu_load_firmware(struct rtl8xxxu_priv *priv, const char *fw_name)
|
||||
case 0x2300:
|
||||
case 0x88f0:
|
||||
case 0x10b0:
|
||||
case 0x92f0:
|
||||
break;
|
||||
default:
|
||||
ret = -EINVAL;
|
||||
@@ -2595,6 +2603,7 @@ static int rtl8xxxu_init_queue_priority(struct rtl8xxxu_priv *priv)
|
||||
u16 hiq, mgq, bkq, beq, viq, voq;
|
||||
int hip, mgp, bkp, bep, vip, vop;
|
||||
int ret = 0;
|
||||
u32 val32;
|
||||
|
||||
switch (priv->ep_tx_count) {
|
||||
case 1:
|
||||
@@ -2677,15 +2686,28 @@ static int rtl8xxxu_init_queue_priority(struct rtl8xxxu_priv *priv)
|
||||
* queue here .... why?
|
||||
*/
|
||||
if (!ret) {
|
||||
val16 = rtl8xxxu_read16(priv, REG_TRXDMA_CTRL);
|
||||
val16 &= 0x7;
|
||||
val16 |= (voq << TRXDMA_CTRL_VOQ_SHIFT) |
|
||||
(viq << TRXDMA_CTRL_VIQ_SHIFT) |
|
||||
(beq << TRXDMA_CTRL_BEQ_SHIFT) |
|
||||
(bkq << TRXDMA_CTRL_BKQ_SHIFT) |
|
||||
(mgq << TRXDMA_CTRL_MGQ_SHIFT) |
|
||||
(hiq << TRXDMA_CTRL_HIQ_SHIFT);
|
||||
rtl8xxxu_write16(priv, REG_TRXDMA_CTRL, val16);
|
||||
/* Only RTL8192F seems to do it like this. */
|
||||
if (priv->rtl_chip == RTL8192F) {
|
||||
val32 = rtl8xxxu_read32(priv, REG_TRXDMA_CTRL);
|
||||
val32 &= 0x7;
|
||||
val32 |= (voq << TRXDMA_CTRL_VOQ_SHIFT_8192F) |
|
||||
(viq << TRXDMA_CTRL_VIQ_SHIFT_8192F) |
|
||||
(beq << TRXDMA_CTRL_BEQ_SHIFT_8192F) |
|
||||
(bkq << TRXDMA_CTRL_BKQ_SHIFT_8192F) |
|
||||
(mgq << TRXDMA_CTRL_MGQ_SHIFT_8192F) |
|
||||
(hiq << TRXDMA_CTRL_HIQ_SHIFT_8192F);
|
||||
rtl8xxxu_write32(priv, REG_TRXDMA_CTRL, val32);
|
||||
} else {
|
||||
val16 = rtl8xxxu_read16(priv, REG_TRXDMA_CTRL);
|
||||
val16 &= 0x7;
|
||||
val16 |= (voq << TRXDMA_CTRL_VOQ_SHIFT) |
|
||||
(viq << TRXDMA_CTRL_VIQ_SHIFT) |
|
||||
(beq << TRXDMA_CTRL_BEQ_SHIFT) |
|
||||
(bkq << TRXDMA_CTRL_BKQ_SHIFT) |
|
||||
(mgq << TRXDMA_CTRL_MGQ_SHIFT) |
|
||||
(hiq << TRXDMA_CTRL_HIQ_SHIFT);
|
||||
rtl8xxxu_write16(priv, REG_TRXDMA_CTRL, val16);
|
||||
}
|
||||
|
||||
priv->pipe_out[TXDESC_QUEUE_VO] =
|
||||
usb_sndbulkpipe(priv->udev, priv->out_ep[vop]);
|
||||
@@ -2856,10 +2878,14 @@ void rtl8xxxu_fill_iqk_matrix_b(struct rtl8xxxu_priv *priv, bool iqk_ok,
|
||||
|
||||
reg = (result[candidate][7] >> 6) & 0xf;
|
||||
|
||||
val32 = rtl8xxxu_read32(priv, REG_OFDM0_AGCR_SSI_TABLE);
|
||||
val32 &= ~0x0000f000;
|
||||
val32 |= (reg << 12);
|
||||
rtl8xxxu_write32(priv, REG_OFDM0_AGCR_SSI_TABLE, val32);
|
||||
if (priv->rtl_chip == RTL8192F) {
|
||||
rtl8xxxu_write32_mask(priv, REG_RXIQB_EXT, 0x000000f0, reg);
|
||||
} else {
|
||||
val32 = rtl8xxxu_read32(priv, REG_OFDM0_AGCR_SSI_TABLE);
|
||||
val32 &= ~0x0000f000;
|
||||
val32 |= (reg << 12);
|
||||
rtl8xxxu_write32(priv, REG_OFDM0_AGCR_SSI_TABLE, val32);
|
||||
}
|
||||
}
|
||||
|
||||
#define MAX_TOLERANCE 5
|
||||
@@ -3958,13 +3984,14 @@ void rtl8xxxu_init_burst(struct rtl8xxxu_priv *priv)
|
||||
val8 |= HT_SINGLE_AMPDU_ENABLE;
|
||||
rtl8xxxu_write8(priv, REG_HT_SINGLE_AMPDU_8723B, val8);
|
||||
|
||||
rtl8xxxu_write16(priv, REG_MAX_AGGR_NUM, 0x0c14);
|
||||
rtl8xxxu_write16(priv, REG_MAX_AGGR_NUM, priv->fops->max_aggr_num);
|
||||
rtl8xxxu_write8(priv, REG_AMPDU_MAX_TIME_8723B,
|
||||
priv->fops->ampdu_max_time);
|
||||
rtl8xxxu_write32(priv, REG_AGGLEN_LMT, 0xffffffff);
|
||||
rtl8xxxu_write8(priv, REG_RX_PKT_LIMIT, 0x18);
|
||||
rtl8xxxu_write8(priv, REG_PIFS, 0x00);
|
||||
if (priv->rtl_chip == RTL8188F || priv->rtl_chip == RTL8710B) {
|
||||
if (priv->rtl_chip == RTL8188F || priv->rtl_chip == RTL8710B ||
|
||||
priv->rtl_chip == RTL8192F) {
|
||||
rtl8xxxu_write8(priv, REG_FWHW_TXQ_CTRL, FWHW_TXQ_CTRL_AMPDU_RETRY);
|
||||
rtl8xxxu_write32(priv, REG_FAST_EDCA_CTRL, 0x03086666);
|
||||
}
|
||||
@@ -4078,9 +4105,14 @@ static int rtl8xxxu_init_device(struct ieee80211_hw *hw)
|
||||
if (ret)
|
||||
goto exit;
|
||||
|
||||
/* Mac APLL Setting */
|
||||
if (priv->rtl_chip == RTL8192F)
|
||||
rtl8xxxu_write16_set(priv, REG_AFE_CTRL4, BIT(4) | BIT(15));
|
||||
|
||||
/* RFSW Control - clear bit 14 ?? */
|
||||
if (priv->rtl_chip != RTL8723B && priv->rtl_chip != RTL8192E &&
|
||||
priv->rtl_chip != RTL8188E && priv->rtl_chip != RTL8710B)
|
||||
priv->rtl_chip != RTL8188E && priv->rtl_chip != RTL8710B &&
|
||||
priv->rtl_chip != RTL8192F)
|
||||
rtl8xxxu_write32(priv, REG_FPGA0_TX_INFO, 0x00000003);
|
||||
|
||||
val32 = FPGA0_RF_TRSW | FPGA0_RF_TRSWB | FPGA0_RF_ANTSW |
|
||||
@@ -4094,7 +4126,7 @@ static int rtl8xxxu_init_device(struct ieee80211_hw *hw)
|
||||
|
||||
/* 0x860[6:5]= 00 - why? - this sets antenna B */
|
||||
if (priv->rtl_chip != RTL8192E && priv->rtl_chip != RTL8188E &&
|
||||
priv->rtl_chip != RTL8710B)
|
||||
priv->rtl_chip != RTL8710B && priv->rtl_chip != RTL8192F)
|
||||
rtl8xxxu_write32(priv, REG_FPGA0_XA_RF_INT_OE, 0x66f60210);
|
||||
|
||||
if (!macpower) {
|
||||
@@ -4168,7 +4200,7 @@ static int rtl8xxxu_init_device(struct ieee80211_hw *hw)
|
||||
rtl8xxxu_write8(priv, 0xa3, val8);
|
||||
}
|
||||
|
||||
if (priv->rtl_chip == RTL8710B)
|
||||
if (priv->rtl_chip == RTL8710B || priv->rtl_chip == RTL8192F)
|
||||
rtl8xxxu_write8(priv, REG_EARLY_MODE_CONTROL_8710B, 0);
|
||||
}
|
||||
|
||||
@@ -4195,7 +4227,7 @@ static int rtl8xxxu_init_device(struct ieee80211_hw *hw)
|
||||
rtl8xxxu_write8(priv, REG_USB_SPECIAL_OPTION, val8);
|
||||
} else if (priv->rtl_chip == RTL8710B) {
|
||||
rtl8xxxu_write32(priv, REG_HIMR0_8710B, 0);
|
||||
} else {
|
||||
} else if (priv->rtl_chip != RTL8192F) {
|
||||
/*
|
||||
* Enable all interrupts - not obvious USB needs to do this
|
||||
*/
|
||||
@@ -4283,7 +4315,8 @@ static int rtl8xxxu_init_device(struct ieee80211_hw *hw)
|
||||
val16 = BEACON_DISABLE_TSF_UPDATE | (BEACON_DISABLE_TSF_UPDATE << 8);
|
||||
rtl8xxxu_write16(priv, REG_BEACON_CTRL, val16);
|
||||
rtl8xxxu_write16(priv, REG_TBTT_PROHIBIT, 0x6404);
|
||||
if (priv->rtl_chip != RTL8188F && priv->rtl_chip != RTL8710B)
|
||||
if (priv->rtl_chip != RTL8188F && priv->rtl_chip != RTL8710B &&
|
||||
priv->rtl_chip != RTL8192F)
|
||||
/* Firmware will control REG_DRVERLYINT when power saving is enable, */
|
||||
/* so don't set this register on STA mode. */
|
||||
rtl8xxxu_write8(priv, REG_DRIVER_EARLY_INT, DRIVER_EARLY_INT_TIME);
|
||||
@@ -4334,7 +4367,8 @@ static int rtl8xxxu_init_device(struct ieee80211_hw *hw)
|
||||
/* Disable BAR - not sure if this has any effect on USB */
|
||||
rtl8xxxu_write32(priv, REG_BAR_MODE_CTRL, 0x0201ffff);
|
||||
|
||||
if (priv->rtl_chip != RTL8188F && priv->rtl_chip != RTL8188E && priv->rtl_chip != RTL8710B)
|
||||
if (priv->rtl_chip != RTL8188F && priv->rtl_chip != RTL8188E &&
|
||||
priv->rtl_chip != RTL8710B && priv->rtl_chip != RTL8192F)
|
||||
rtl8xxxu_write16(priv, REG_FAST_EDCA_CTRL, 0);
|
||||
|
||||
if (fops->init_statistics)
|
||||
@@ -4352,9 +4386,10 @@ static int rtl8xxxu_init_device(struct ieee80211_hw *hw)
|
||||
* Reset USB mode switch setting
|
||||
*/
|
||||
rtl8xxxu_write8(priv, REG_ACLK_MON, 0x00);
|
||||
} else if (priv->rtl_chip == RTL8188F || priv->rtl_chip == RTL8188E) {
|
||||
} else if (priv->rtl_chip == RTL8188F || priv->rtl_chip == RTL8188E ||
|
||||
priv->rtl_chip == RTL8192F) {
|
||||
/*
|
||||
* Init GPIO settings for 8188f, 8188e
|
||||
* Init GPIO settings for 8188f, 8188e, 8192f
|
||||
*/
|
||||
val8 = rtl8xxxu_read8(priv, REG_GPIO_MUXCFG);
|
||||
val8 &= ~GPIO_MUXCFG_IO_SEL_ENBT;
|
||||
@@ -5516,8 +5551,10 @@ static void rtl8xxxu_tx(struct ieee80211_hw *hw,
|
||||
tx_desc->pkt_size = cpu_to_le16(pktlen);
|
||||
tx_desc->pkt_offset = tx_desc_size;
|
||||
|
||||
tx_desc->txdw0 =
|
||||
TXDESC_OWN | TXDESC_FIRST_SEGMENT | TXDESC_LAST_SEGMENT;
|
||||
/* These bits mean different things to the RTL8192F. */
|
||||
if (priv->rtl_chip != RTL8192F)
|
||||
tx_desc->txdw0 =
|
||||
TXDESC_OWN | TXDESC_FIRST_SEGMENT | TXDESC_LAST_SEGMENT;
|
||||
if (is_multicast_ether_addr(ieee80211_get_DA(hdr)) ||
|
||||
is_broadcast_ether_addr(ieee80211_get_DA(hdr)))
|
||||
tx_desc->txdw0 |= TXDESC_BROADMULTICAST;
|
||||
@@ -5587,7 +5624,7 @@ static void rtl8xxxu_tx(struct ieee80211_hw *hw,
|
||||
rtl8xxxu_calc_tx_desc_csum(tx_desc);
|
||||
|
||||
/* avoid zero checksum make tx hang */
|
||||
if (priv->rtl_chip == RTL8710B)
|
||||
if (priv->rtl_chip == RTL8710B || priv->rtl_chip == RTL8192F)
|
||||
tx_desc->csum = ~tx_desc->csum;
|
||||
|
||||
usb_fill_bulk_urb(&tx_urb->urb, priv->udev, priv->pipe_out[queue],
|
||||
@@ -7460,6 +7497,7 @@ static int rtl8xxxu_probe(struct usb_interface *interface,
|
||||
case 0xf179:
|
||||
case 0x8179:
|
||||
case 0xb711:
|
||||
case 0xf192:
|
||||
untested = 0;
|
||||
break;
|
||||
}
|
||||
@@ -7484,6 +7522,10 @@ static int rtl8xxxu_probe(struct usb_interface *interface,
|
||||
if (id->idProduct == 0x0109)
|
||||
untested = 0;
|
||||
break;
|
||||
case 0x0b05:
|
||||
if (id->idProduct == 0x18f1)
|
||||
untested = 0;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -7750,6 +7792,16 @@ static const struct usb_device_id dev_table[] = {
|
||||
/* TOTOLINK N150UA V5 / N150UA-B */
|
||||
{USB_DEVICE_AND_INTERFACE_INFO(USB_VENDOR_ID_REALTEK, 0x2005, 0xff, 0xff, 0xff),
|
||||
.driver_info = (unsigned long)&rtl8710bu_fops},
|
||||
/* Comfast CF-826F */
|
||||
{USB_DEVICE_AND_INTERFACE_INFO(USB_VENDOR_ID_REALTEK, 0xf192, 0xff, 0xff, 0xff),
|
||||
.driver_info = (unsigned long)&rtl8192fu_fops},
|
||||
/* Asus USB-N13 rev C1 */
|
||||
{USB_DEVICE_AND_INTERFACE_INFO(0x0b05, 0x18f1, 0xff, 0xff, 0xff),
|
||||
.driver_info = (unsigned long)&rtl8192fu_fops},
|
||||
{USB_DEVICE_AND_INTERFACE_INFO(0x7392, 0xb722, 0xff, 0xff, 0xff),
|
||||
.driver_info = (unsigned long)&rtl8192fu_fops},
|
||||
{USB_DEVICE_AND_INTERFACE_INFO(USB_VENDOR_ID_REALTEK, 0x318b, 0xff, 0xff, 0xff),
|
||||
.driver_info = (unsigned long)&rtl8192fu_fops},
|
||||
#ifdef CONFIG_RTL8XXXU_UNTESTED
|
||||
/* Still supported by rtlwifi */
|
||||
{USB_DEVICE_AND_INTERFACE_INFO(USB_VENDOR_ID_REALTEK, 0x8176, 0xff, 0xff, 0xff),
|
||||
|
||||
@@ -67,6 +67,7 @@
|
||||
#define REG_SPS0_CTRL 0x0011
|
||||
#define REG_SPS_OCP_CFG 0x0018
|
||||
#define REG_8192E_LDOV12_CTRL 0x0014
|
||||
#define REG_SYS_SWR_CTRL2 0x0014
|
||||
#define REG_RSV_CTRL 0x001c
|
||||
#define RSV_CTRL_WLOCK_1C BIT(5)
|
||||
#define RSV_CTRL_DIS_PRST BIT(6)
|
||||
@@ -215,6 +216,8 @@
|
||||
#define REG_HMBOX_EXT_2 0x008c
|
||||
#define REG_HMBOX_EXT_3 0x008e
|
||||
|
||||
#define REG_RSVD_1 0x0097
|
||||
|
||||
/* Interrupt registers for 8192e/8723bu/8812 */
|
||||
#define REG_HIMR0 0x00b0
|
||||
#define IMR0_TXCCK BIT(30) /* TXRPT interrupt when CCX bit
|
||||
@@ -283,6 +286,7 @@
|
||||
#define REG_BIST_SCAN 0x00d0
|
||||
#define REG_BIST_RPT 0x00d4
|
||||
#define REG_BIST_ROM_RPT 0x00d8
|
||||
#define REG_RSVD_4 0x00dc
|
||||
#define REG_USB_SIE_INTF 0x00e0
|
||||
#define REG_PCIE_MIO_INTF 0x00e4
|
||||
#define REG_PCIE_MIO_INTD 0x00e8
|
||||
@@ -390,6 +394,12 @@
|
||||
#define TRXDMA_CTRL_BKQ_SHIFT 10
|
||||
#define TRXDMA_CTRL_MGQ_SHIFT 12
|
||||
#define TRXDMA_CTRL_HIQ_SHIFT 14
|
||||
#define TRXDMA_CTRL_VOQ_SHIFT_8192F 4
|
||||
#define TRXDMA_CTRL_VIQ_SHIFT_8192F 7
|
||||
#define TRXDMA_CTRL_BEQ_SHIFT_8192F 10
|
||||
#define TRXDMA_CTRL_BKQ_SHIFT_8192F 13
|
||||
#define TRXDMA_CTRL_MGQ_SHIFT_8192F 16
|
||||
#define TRXDMA_CTRL_HIQ_SHIFT_8192F 19
|
||||
#define TRXDMA_QUEUE_LOW 1
|
||||
#define TRXDMA_QUEUE_NORMAL 2
|
||||
#define TRXDMA_QUEUE_HIGH 3
|
||||
@@ -973,12 +983,18 @@
|
||||
#define FPGA1_TX_OFDM_TXSC_MASK 0x30000000
|
||||
|
||||
#define REG_ANT_MAPPING1 0x0914
|
||||
#define REG_RFE_OPT 0x0920
|
||||
#define REG_DPDT_CTRL 0x092c /* 8723BU */
|
||||
#define REG_RFE_CTRL_ANTA_SRC 0x0930 /* 8723BU */
|
||||
#define REG_RFE_CTRL_ANT_SRC1 0x0934
|
||||
#define REG_RFE_CTRL_ANT_SRC2 0x0938
|
||||
#define REG_RFE_CTRL_ANT_SRC3 0x093c
|
||||
#define REG_RFE_PATH_SELECT 0x0940 /* 8723BU */
|
||||
#define REG_RFE_BUFFER 0x0944 /* 8723BU */
|
||||
#define REG_S0S1_PATH_SWITCH 0x0948 /* 8723BU */
|
||||
#define REG_RX_DFIR_MOD_97F 0x0948
|
||||
#define REG_OFDM_RX_DFIR 0x954
|
||||
#define REG_RFE_OPT62 0x0968
|
||||
|
||||
#define REG_CCK0_SYSTEM 0x0a00
|
||||
#define CCK0_SIDEBAND BIT(4)
|
||||
@@ -1038,6 +1054,8 @@
|
||||
|
||||
#define REG_OFDM0_FA_RSTC 0x0c0c
|
||||
|
||||
#define REG_DOWNSAM_FACTOR 0x0c10
|
||||
|
||||
#define REG_OFDM0_XA_RX_AFE 0x0c10
|
||||
#define REG_OFDM0_XA_RX_IQ_IMBALANCE 0x0c14
|
||||
#define REG_OFDM0_XB_RX_IQ_IMBALANCE 0x0c1c
|
||||
@@ -1074,6 +1092,8 @@
|
||||
/* 8188eu */
|
||||
#define REG_ANTDIV_PARA1 0x0ca4
|
||||
|
||||
#define REG_RXIQB_EXT 0x0ca8
|
||||
|
||||
/* 8723bu */
|
||||
#define REG_OFDM0_TX_PSDO_NOISE_WEIGHT 0x0ce4
|
||||
|
||||
@@ -1093,6 +1113,8 @@
|
||||
#define REG_OFDM1_CSI_FIX_MASK1 0x0d40
|
||||
#define REG_OFDM1_CSI_FIX_MASK2 0x0d44
|
||||
|
||||
#define REG_ANAPWR1 0x0d94
|
||||
|
||||
#define REG_TX_AGC_A_RATE18_06 0x0e00
|
||||
#define REG_TX_AGC_A_RATE54_24 0x0e04
|
||||
#define REG_TX_AGC_A_CCK1_MCS32 0x0e08
|
||||
@@ -1101,6 +1123,10 @@
|
||||
#define REG_TX_AGC_A_MCS11_MCS08 0x0e18
|
||||
#define REG_TX_AGC_A_MCS15_MCS12 0x0e1c
|
||||
|
||||
#define REG_NP_ANTA 0x0e20
|
||||
|
||||
#define REG_TAP_UPD_97F 0x0e24
|
||||
|
||||
#define REG_FPGA0_IQK 0x0e28
|
||||
|
||||
#define REG_TX_IQK_TONE_A 0x0e30
|
||||
@@ -1129,19 +1155,23 @@
|
||||
#define REG_RX_CCK 0x0e8c
|
||||
|
||||
#define REG_TX_POWER_BEFORE_IQK_A 0x0e94
|
||||
#define REG_IQK_RPT_TXA 0x0e98
|
||||
#define REG_TX_POWER_AFTER_IQK_A 0x0e9c
|
||||
|
||||
#define REG_RX_POWER_BEFORE_IQK_A 0x0ea0
|
||||
#define REG_RX_POWER_BEFORE_IQK_A_2 0x0ea4
|
||||
#define REG_RX_POWER_AFTER_IQK_A 0x0ea8
|
||||
#define REG_IQK_RPT_RXA 0x0ea8
|
||||
#define REG_RX_POWER_AFTER_IQK_A_2 0x0eac
|
||||
|
||||
#define REG_TX_POWER_BEFORE_IQK_B 0x0eb4
|
||||
#define REG_IQK_RPT_TXB 0x0eb8
|
||||
#define REG_TX_POWER_AFTER_IQK_B 0x0ebc
|
||||
|
||||
#define REG_RX_POWER_BEFORE_IQK_B 0x0ec0
|
||||
#define REG_RX_POWER_BEFORE_IQK_B_2 0x0ec4
|
||||
#define REG_RX_POWER_AFTER_IQK_B 0x0ec8
|
||||
#define REG_IQK_RPT_RXB 0x0ec8
|
||||
#define REG_RX_POWER_AFTER_IQK_B_2 0x0ecc
|
||||
|
||||
#define REG_RX_OFDM 0x0ed0
|
||||
@@ -1152,6 +1182,12 @@
|
||||
#define REG_PMPD_ANAEN 0x0eec
|
||||
|
||||
#define REG_FW_START_ADDRESS 0x1000
|
||||
#define REG_FW_START_ADDRESS_8192F 0x4000
|
||||
|
||||
#define REG_SW_GPIO_SHARE_CTRL_0 0x1038
|
||||
#define REG_SW_GPIO_SHARE_CTRL_1 0x103c
|
||||
#define REG_GPIO_A0 0x1050
|
||||
#define REG_GPIO_B0 0x105b
|
||||
|
||||
#define REG_USB_INFO 0xfe17
|
||||
#define REG_USB_HIMR 0xfe38
|
||||
@@ -1316,12 +1352,15 @@
|
||||
/*
|
||||
* NextGen regs: 8723BU
|
||||
*/
|
||||
#define RF6052_REG_GAIN_P1 0x35
|
||||
#define RF6052_REG_T_METER_8723B 0x42
|
||||
#define RF6052_REG_UNKNOWN_43 0x43
|
||||
#define RF6052_REG_UNKNOWN_55 0x55
|
||||
#define RF6052_REG_UNKNOWN_56 0x56
|
||||
#define RF6052_REG_TXMOD 0x58
|
||||
#define RF6052_REG_RXG_MIX_SWBW 0x87
|
||||
#define RF6052_REG_S0S1 0xb0
|
||||
#define RF6052_REG_UNKNOWN_DF 0xdf
|
||||
#define RF6052_REG_UNKNOWN_ED 0xed
|
||||
#define RF6052_REG_WE_LUT 0xef
|
||||
#define RF6052_REG_GAIN_CTRL 0xf5
|
||||
|
||||
Reference in New Issue
Block a user