* [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu
@ 2016-02-29 22:03 Jes.Sorensen
2016-02-29 22:03 ` [PATCH 001/113] rtl8xxxu: Add initial code to parse rtl8192eu efuse Jes.Sorensen
` (113 more replies)
0 siblings, 114 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:03 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
Hi,
This is a rather large set of patches adding support for rtl8723bu
devices, as well as containing some code for rtl8192eu devices.
I started working on 8192eu support at the beginning but later
switched over and completed 8723bu support, before finally completing
8192eu support. The two new devices share a lot of new features not
found in the older generation parts (8723au/8188cu/8192cu/8188ru).
I am holding back the 8192eu support for now, in order to reduce the
size of the patch set (I have another 60 patches that goes on top of
this set with 8192eu support and additional bug fixes). Given that
support for the two devices is intermingled, trying to disentangle it
is pretty much impossible at this point, and risks breaking the code.
This applies on top of wireless-drivers-next as of today 2016-02-29.
Cheers,
Jes
Jakub Sitnicki (5):
rtl8xxxu: Don't check for illegal offset when reading from efuse
rtl8xxxu: Skip disabled efuse words early
rtl8xxxu: rtl8723au: Introduce a pointer to efuse
rtl8xxxu: rtl8192cu: Introduce a pointer to efuse
rtl8xxxu: rtl8192eu: Map out EFUSE TX power area
Jes Sorensen (108):
rtl8xxxu: Add initial code to parse rtl8192eu efuse
rtl8xxxu: Identify chip vendors correctly
rtl8xxxu: Use 1024 byte block loads for 8192eu firmware
rtl8xxxu: Add rtl8192eu_nic.bin to the MODULE_FIRMWARE list
rtl8xxxu: Implment rtl8192eu_power_on()
rtl8xxxu: Add rtl8xxxu_auto_llt_table()
rtl8xxxu: Init page boundaries before starting the firmware
rtl8xxxu: Init the LLT after we start the firmware
rtl8xxxu: Fix incorrect test for auto LLT failure
rtl8xxxu: Kludge to drop incorrect USB OUT EP for 8192EU
rtl8xxxu: Init REG_HIMR[01] for 8192eu parts
rtl8xxxu: Initial rtl8723bu chip identification
rtl8xxxu: Add rtl8723bu_parse_efuse() and 8723bu efuse definition
rtl8xxxu: Use 1024 byte writes for writing 8723bu firmware
rtl8xxxu: Only setup USB interrupts for parts which support it
rtl8xxxu: Add rtl8723b_phy_1t_init_table
rtl8xxxu: Add rtl8723bu_radioa_1t_init_table
rtl8xxxu: Add rtl8723bu_phy_init_antenna_selection()
rtl8xxxu: Add rtl8723b_mac_init_table
rtl8xxxu: Add 8723by AGC table
rtl8xxxu: Handle 32 bit mailbox extension regs found on
8723bu/8192eu/8812
rtl8xxxu: Add some missing register definitions for 8723bu
rtl8xxxu: Group USB fixups together for all chips
rtl8xxxu: Add definitions for new generation h2c commands
rtl8xxxu: rtl8192eu_parse_efuse(): Use a pointer to the struct
rtl8192eu_efuse
rtl8xxxu: rtl8723bu_parse_efuse(): Use a pointer to the struct
rtl8723bu_efuse
rtl8xxxu: rtl8xxxu_h2c_cmd(): Add size argument
rtl8xxxu: Do BT_WLAN_CALIBRATION before doing IQK calibration
rtl8xxxu: Do not overwrite rtl8xxxu_debug for untested chips
rtl8xxxu: Use correct formatting type to print sizeof()
rtl8xxxu: Make rtl8xxxu_add_path_on() use device specific init values
rtl8xxxu: Add a couple of new register definitions
rtl8xxxu: First stab at adding IQK calibration for 8723bu parts
rtl8xxxu: Handle S0S1 register in lc_calibrate()
rtl8xxxu: Do LC calibration before IQK calibration
rtl8xxxu: Remove backing up certain registers, which was never used
rtl8xxxu: Initial implementation of rtl8723bu_config_channel()
rtl8xxxu: Initial rtl8723bu_init_bt() code
rtl8xxxu: Remove unused variable
rtl8xxxu: Improve 8723bu init code
rtl8xxxu: Do not ignore wlan activity on 8723bu
rtl8xxxu: Set the right type for ps tdma on 8723bu
rtl8xxxu: Add rtl8723bu (nextgen) rx descriptor definition
rtl8xxxu: Handle 8723bu style rx descriptors
rtl8xxxu: Initial functionality to handle C2H events for 8723bu
rtl8xxxu: Handle BT register writes and MP_OPER events
rtl8xxxu: Issue BT_INFO command
rtl8xxxu: Do not set REG_AFE_XTAL_CTRL on 8723bu
rtl8xxxu: Implement 8723bu power on sequence
rtl8xxxu: Setup LLT before downloading firmware
rtl8xxxu: Additional fixes for 8723bu
rtl8xxxu: Handle XTAL_K value in efuse specific location
rtl8xxxu: Another 8723bu patch for rtl8xxxu_init_phy_bb()
rtl8xxxu: Another 8723bu magic register set during init
rtl8xxxu: Init H2C command register for 8723bu
rtl8xxxu: 80M spur hack is for 8723au only
rtl8xxxu: Do queue init in same order as 8723bu vendor driver
rtl8xxxu: Do not set FPGA0_TX_INFO for 8723bu and use a larger PBP
page size
rtl8xxxu: Set RX boundary for 8723bu
rtl8xxxu: Initialize burst parameters for 8723bu
rtl8xxxu: Call device specific _config_channel()
rtl8xxxu: 8723bu lock phy after RF init
rtl8xxxu: Add REG_DWBCN1_CTRL_8723B define
rtl8xxxu: Group chip quirks together
rtl8xxxu: Setup RX aggregation
rtl8xxxu: Add missing blank space in front of bracket
rtl8xxxu: Implement init_statistics for 8723bu
rtl8xxxu: RF_T_METER is different on the newer chips
rtl8xxxu: Set WLAN_ACT_CONTROL per vendor driver setting
rtl8xxxu: 8723bu: REG_BT_COEX_TABLE4 is only 8 bits
rtl8xxxu: Use name for REG_RFE_BUFFER rather than hard coded value
rtl8xxxu: Use REG_RFE_CTRL_ANTA_SRC rather than hard coded value
rtl8xxxu: Setup coex table correctly (hopefully)
rtl8xxxu: Do not use hard-wired RF enable settings for 8723bu
rtl8xxxu: Correct struct rtl8723bu_efuse to list power bases correctly
rtl8xxxu: Introduce set_tx_power() fileop and a new 8723b dummy
derivative
rtl8xxxu: Use size of source pointer when copying efuse data
rtl8xxxu: Bump TX power arrays to handle larger channel groups
rtl8xxxu: Parse efuse power indices for 8723bu
rtl8xxxu: Set 8723bu TX power for CCK and OFDM rates
rtl8xxxu: Set 8723bu MCS TX power
rtl8xxxu: Set the correct thermal meter register for 8723bu
rtl8xxxu: Add definition for 8723bu tx descriptor
rtl8xxxu: Handle 40 byte TX descriptors for rtl8723bu
rtl8xxxu: Do not unconditionally print debug info in
rtl8723bu_handle_c2h()
rtl8xxxu: Add additional tx descriptor bits for data word 0
rtl8xxxu: Add more 40 byte TX desc bit definitions
rtl8xxxu: Set the correct TX descriptor bits for agg and break on
8723b
rtl8xxxu: Set sequence number correctly for 40 byte TX descriptors
rtl8723au: Update TX descriptor words 4 and 5 definitions
rtl8xxxu: TX RTS rate is word 4 for 8723a
rtl8xxxu: Improve handling of txdesc32 vs txdesc40 handling
rtl8xxxu: Do not parse RX descriptor info for C2H packets
rtl8xxxu: Define 8723b H2C ramask command structure
rtl8xxxu: Implement basic 8723b specific update_rate_mask() function
rtl8xxxu: Report media status using the correct H2C command for 8723bu
rtl8xxxu: Dump contents of unhandled C2H events
rtl8xxxu: Process C2H RA_REPORT events for 8723bu
rtl8xxxu: Pass RX rate to rx_parse_phystats and enable phystats for
rtl8723bu
rtl8xxxu: Remove unncessary semicolon
rtl8xxxu: convert rtl8723bu_init_bt() into rtl8723b_enable_rf()
rtl8xxxu: Use define for REG_PWR_DATA bits
rtl8xxxu: Implement 8723bu specific disable_rf() function
rtl8xxxu: Implement device specific power_off function
rtl8xxxu: Flush FIFO before powering down devices
rtl8xxxu: Print a warning if flushing the FIFO fails
rtl8xxxu: Use correct 8051 reset function for 8723b parts
rtl8xxxu: Temporarily disable 8192eu device init
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 3524 +++++++++++++++++---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 691 +++-
.../net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h | 97 +-
3 files changed, 3852 insertions(+), 460 deletions(-)
--
2.5.0
^ permalink raw reply [flat|nested] 139+ messages in thread
* [PATCH 001/113] rtl8xxxu: Add initial code to parse rtl8192eu efuse
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
@ 2016-02-29 22:03 ` Jes.Sorensen
2016-02-29 22:04 ` [PATCH 002/113] rtl8xxxu: Identify chip vendors correctly Jes.Sorensen
` (112 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:03 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
This is the start of 8192eu support. For now just detect the device
and parse the efuse.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 80 +++++++++++++++++++++++-
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 50 ++++++++++++++-
2 files changed, 124 insertions(+), 6 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index fdeae3b..8dc4b2d 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -42,7 +42,7 @@
#define DRIVER_NAME "rtl8xxxu"
-static int rtl8xxxu_debug;
+static int rtl8xxxu_debug = RTL8XXXU_DEBUG_EFUSE;
static bool rtl8xxxu_ht40_2g;
MODULE_AUTHOR("Jes Sorensen <Jes.Sorensen@redhat.com>");
@@ -1890,6 +1890,53 @@ static int rtl8192cu_parse_efuse(struct rtl8xxxu_priv *priv)
#endif
+static int rtl8192eu_parse_efuse(struct rtl8xxxu_priv *priv)
+{
+ int i;
+
+ if (priv->efuse_wifi.efuse8192eu.rtl_id != cpu_to_le16(0x8129))
+ return -EINVAL;
+
+ ether_addr_copy(priv->mac_addr, priv->efuse_wifi.efuse8192eu.mac_addr);
+
+ memcpy(priv->cck_tx_power_index_A,
+ priv->efuse_wifi.efuse8192eu.cck_tx_power_index_A,
+ sizeof(priv->cck_tx_power_index_A));
+ memcpy(priv->cck_tx_power_index_B,
+ priv->efuse_wifi.efuse8192eu.cck_tx_power_index_B,
+ sizeof(priv->cck_tx_power_index_B));
+
+ memcpy(priv->ht40_1s_tx_power_index_A,
+ priv->efuse_wifi.efuse8192eu.ht40_1s_tx_power_index_A,
+ sizeof(priv->ht40_1s_tx_power_index_A));
+ memcpy(priv->ht40_1s_tx_power_index_B,
+ priv->efuse_wifi.efuse8192eu.ht40_1s_tx_power_index_B,
+ sizeof(priv->ht40_1s_tx_power_index_B));
+
+ dev_info(&priv->udev->dev, "Vendor: %.7s\n",
+ priv->efuse_wifi.efuse8192eu.vendor_name);
+ dev_info(&priv->udev->dev, "Product: %.11s\n",
+ priv->efuse_wifi.efuse8192eu.device_name);
+ dev_info(&priv->udev->dev, "Serial: %.11s\n",
+ priv->efuse_wifi.efuse8192eu.serial);
+
+ if (rtl8xxxu_debug & RTL8XXXU_DEBUG_EFUSE) {
+ unsigned char *raw = priv->efuse_wifi.raw;
+
+ dev_info(&priv->udev->dev,
+ "%s: dumping efuse (0x%02zx bytes):\n",
+ __func__, sizeof(struct rtl8192eu_efuse));
+ for (i = 0; i < sizeof(struct rtl8192eu_efuse); i += 8) {
+ dev_info(&priv->udev->dev, "%02x: "
+ "%02x %02x %02x %02x %02x %02x %02x %02x\n", i,
+ raw[i], raw[i + 1], raw[i + 2],
+ raw[i + 3], raw[i + 4], raw[i + 5],
+ raw[i + 6], raw[i + 7]);
+ }
+ }
+ return -EINVAL;
+}
+
static int
rtl8xxxu_read_efuse8(struct rtl8xxxu_priv *priv, u16 offset, u8 *data)
{
@@ -1973,7 +2020,7 @@ static int rtl8xxxu_read_efuse(struct rtl8xxxu_priv *priv)
}
/* Default value is 0xff */
- memset(priv->efuse_wifi.raw, 0xff, EFUSE_MAP_LEN_8723A);
+ memset(priv->efuse_wifi.raw, 0xff, EFUSE_MAP_LEN);
efuse_addr = 0;
while (efuse_addr < EFUSE_REAL_CONTENT_LEN_8723A) {
@@ -2005,7 +2052,7 @@ static int rtl8xxxu_read_efuse(struct rtl8xxxu_priv *priv)
/* We have 8 bits to indicate validity */
map_addr = offset * 8;
- if (map_addr >= EFUSE_MAP_LEN_8723A) {
+ if (map_addr >= EFUSE_MAP_LEN) {
dev_warn(dev, "%s: Illegal map_addr (%04x), "
"efuse corrupt!\n",
__func__, map_addr);
@@ -2286,6 +2333,24 @@ static int rtl8192cu_load_firmware(struct rtl8xxxu_priv *priv)
#endif
+static int rtl8192eu_load_firmware(struct rtl8xxxu_priv *priv)
+{
+ char *fw_name;
+ int ret;
+
+ return -EBUSY;
+ if (!priv->vendor_umc)
+ fw_name = "rtlwifi/rtl8192cufw_TMSC.bin";
+ else if (priv->chip_cut || priv->rtlchip == 0x8192c)
+ fw_name = "rtlwifi/rtl8192cufw_B.bin";
+ else
+ fw_name = "rtlwifi/rtl8192cufw_A.bin";
+
+ ret = rtl8xxxu_load_firmware(priv, fw_name);
+
+ return ret;
+}
+
static void rtl8xxxu_firmware_self_reset(struct rtl8xxxu_priv *priv)
{
u16 val16;
@@ -5863,6 +5928,13 @@ static struct rtl8xxxu_fileops rtl8192cu_fops = {
#endif
+static struct rtl8xxxu_fileops rtl8192eu_fops = {
+ .parse_efuse = rtl8192eu_parse_efuse,
+ .load_firmware = rtl8192eu_load_firmware,
+ .power_on = rtl8192cu_power_on,
+ .writeN_block_size = 128,
+};
+
static struct usb_device_id dev_table[] = {
{USB_DEVICE_AND_INTERFACE_INFO(USB_VENDOR_ID_REALTEK, 0x8724, 0xff, 0xff, 0xff),
.driver_info = (unsigned long)&rtl8723au_fops},
@@ -5870,6 +5942,8 @@ static struct usb_device_id dev_table[] = {
.driver_info = (unsigned long)&rtl8723au_fops},
{USB_DEVICE_AND_INTERFACE_INFO(USB_VENDOR_ID_REALTEK, 0x0724, 0xff, 0xff, 0xff),
.driver_info = (unsigned long)&rtl8723au_fops},
+{USB_DEVICE_AND_INTERFACE_INFO(USB_VENDOR_ID_REALTEK, 0x818b, 0xff, 0xff, 0xff),
+ .driver_info = (unsigned long)&rtl8192eu_fops},
#ifdef CONFIG_RTL8XXXU_UNTESTED
/* Still supported by rtlwifi */
{USB_DEVICE_AND_INTERFACE_INFO(USB_VENDOR_ID_REALTEK, 0x8176, 0xff, 0xff, 0xff),
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
index bbd0f6b..8168a35 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
@@ -55,8 +55,8 @@
#define RTL8723A_MAX_RF_PATHS 2
#define RF6052_MAX_TX_PWR 0x3f
-#define EFUSE_MAP_LEN_8723A 256
-#define EFUSE_MAX_SECTION_8723A 32
+#define EFUSE_MAP_LEN 512
+#define EFUSE_MAX_SECTION_8723A 64
#define EFUSE_REAL_CONTENT_LEN_8723A 512
#define EFUSE_BT_MAP_LEN_8723A 1024
#define EFUSE_MAX_WORD_UNIT 4
@@ -500,6 +500,49 @@ struct rtl8192cu_efuse {
u8 customer_id;
};
+struct rtl8192eu_efuse {
+ __le16 rtl_id;
+ u8 res0[0x0e];
+ u8 cck_tx_power_index_A[3]; /* 0x10 */
+ u8 cck_tx_power_index_B[3];
+ u8 ht40_1s_tx_power_index_A[3]; /* 0x16 */
+ u8 ht40_1s_tx_power_index_B[3];
+ u8 res1[0x9c];
+ u8 channel_plan; /* 0xb8 */
+ u8 xtal_k;
+ u8 thermal_meter;
+ u8 iqk_lck;
+ u8 pa_type; /* 0xbc */
+ u8 lna_type_2g; /* 0xbd */
+ u8 res2[1];
+ u8 lna_type_5g; /* 0xbf */
+ u8 res13[1];
+ u8 rf_board_option;
+ u8 rf_feature_option;
+ u8 rf_bt_setting;
+ u8 eeprom_version;
+ u8 eeprom_customer_id;
+ u8 res3[3];
+ u8 rf_antenna_option; /* 0xc9 */
+ u8 res4[6];
+ u8 vid; /* 0xd0 */
+ u8 res5[1];
+ u8 pid; /* 0xd2 */
+ u8 res6[1];
+ u8 usb_optional_function;
+ u8 res7[2];
+ u8 mac_addr[ETH_ALEN]; /* 0xd7 */
+ u8 res8[2];
+ u8 vendor_name[7];
+ u8 res9[2];
+ u8 device_name[0x0b]; /* 0xe8 */
+ u8 res10[2];
+ u8 serial[0x0b]; /* 0xf5 */
+ u8 res11[0x30];
+ u8 unknown[0x0d]; /* 0x130 */
+ u8 res12[0xc3];
+};
+
struct rtl8xxxu_reg8val {
u16 reg;
u8 val;
@@ -643,9 +686,10 @@ struct rtl8xxxu_priv {
u8 val8;
} usb_buf;
union {
- u8 raw[EFUSE_MAP_LEN_8723A];
+ u8 raw[EFUSE_MAP_LEN];
struct rtl8723au_efuse efuse8723;
struct rtl8192cu_efuse efuse8192;
+ struct rtl8192eu_efuse efuse8192eu;
} efuse_wifi;
u32 adda_backup[RTL8XXXU_ADDA_REGS];
u32 mac_backup[RTL8XXXU_MAC_REGS];
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 002/113] rtl8xxxu: Identify chip vendors correctly
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
2016-02-29 22:03 ` [PATCH 001/113] rtl8xxxu: Add initial code to parse rtl8192eu efuse Jes.Sorensen
@ 2016-02-29 22:04 ` Jes.Sorensen
2016-02-29 22:04 ` [PATCH 003/113] rtl8xxxu: Use 1024 byte block loads for 8192eu firmware Jes.Sorensen
` (111 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:04 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
This identifies the chip vendors correctly and also picks the correct
firmware for rtl8192eu.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 73 +++++++++++++++++-----
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 2 +
.../net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h | 4 ++
3 files changed, 64 insertions(+), 15 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 8dc4b2d..2db2d21 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -1662,16 +1662,24 @@ static void rtl8xxxu_print_chipinfo(struct rtl8xxxu_priv *priv)
case 1:
cut = "B";
break;
+ case 2:
+ cut = "C";
+ break;
+ case 3:
+ cut = "D";
+ break;
+ case 4:
+ cut = "E";
+ break;
default:
cut = "unknown";
}
dev_info(dev,
"RTL%s rev %s (%s) %iT%iR, TX queues %i, WiFi=%i, BT=%i, GPS=%i, HI PA=%i\n",
- priv->chip_name, cut, priv->vendor_umc ? "UMC" : "TSMC",
- priv->tx_paths, priv->rx_paths, priv->ep_tx_count,
- priv->has_wifi, priv->has_bluetooth, priv->has_gps,
- priv->hi_pa);
+ priv->chip_name, cut, priv->chip_vendor, priv->tx_paths,
+ priv->rx_paths, priv->ep_tx_count, priv->has_wifi,
+ priv->has_bluetooth, priv->has_gps, priv->hi_pa);
dev_info(dev, "RTL%s MAC: %pM\n", priv->chip_name, priv->mac_addr);
}
@@ -1708,7 +1716,21 @@ static int rtl8xxxu_identify_chip(struct rtl8xxxu_priv *priv)
} else if (val32 & SYS_CFG_TYPE_ID) {
bonding = rtl8xxxu_read32(priv, REG_HPON_FSM);
bonding &= HPON_FSM_BONDING_MASK;
- if (bonding == HPON_FSM_BONDING_1T2R) {
+ if (priv->chip_cut >= 3) {
+ if (bonding == HPON_FSM_BONDING_1T2R) {
+ sprintf(priv->chip_name, "8191EU");
+ priv->rf_paths = 2;
+ priv->rx_paths = 2;
+ priv->tx_paths = 1;
+ priv->rtlchip = 0x8191e;
+ } else {
+ sprintf(priv->chip_name, "8192EU");
+ priv->rf_paths = 2;
+ priv->rx_paths = 2;
+ priv->tx_paths = 2;
+ priv->rtlchip = 0x8192e;
+ }
+ } else if (bonding == HPON_FSM_BONDING_1T2R) {
sprintf(priv->chip_name, "8191CU");
priv->rf_paths = 2;
priv->rx_paths = 2;
@@ -1731,8 +1753,34 @@ static int rtl8xxxu_identify_chip(struct rtl8xxxu_priv *priv)
priv->has_wifi = 1;
}
- if (val32 & SYS_CFG_VENDOR_ID)
- priv->vendor_umc = 1;
+ switch (priv->rtlchip) {
+ case 0x8188e:
+ case 0x8192e:
+ case 0x8723b:
+ switch (val32 & SYS_CFG_VENDOR_EXT_MASK) {
+ case SYS_CFG_VENDOR_ID_TSMC:
+ sprintf(priv->chip_vendor, "TSMC");
+ break;
+ case SYS_CFG_VENDOR_ID_SMIC:
+ sprintf(priv->chip_vendor, "SMIC");
+ priv->vendor_smic = 1;
+ break;
+ case SYS_CFG_VENDOR_ID_UMC:
+ sprintf(priv->chip_vendor, "UMC");
+ priv->vendor_umc = 1;
+ break;
+ default:
+ sprintf(priv->chip_vendor, "unknown");
+ }
+ break;
+ default:
+ if (val32 & SYS_CFG_VENDOR_ID) {
+ sprintf(priv->chip_vendor, "UMC");
+ priv->vendor_umc = 1;
+ } else {
+ sprintf(priv->chip_vendor, "TSMC");
+ }
+ }
val32 = rtl8xxxu_read32(priv, REG_GPIO_OUTSTS);
priv->rom_rev = (val32 & GPIO_RF_RL_ID) >> 28;
@@ -1934,7 +1982,7 @@ static int rtl8192eu_parse_efuse(struct rtl8xxxu_priv *priv)
raw[i + 6], raw[i + 7]);
}
}
- return -EINVAL;
+ return 0;
}
static int
@@ -2269,6 +2317,7 @@ static int rtl8xxxu_load_firmware(struct rtl8xxxu_priv *priv, char *fw_name)
signature = le16_to_cpu(priv->fw_data->signature);
switch (signature & 0xfff0) {
+ case 0x92e0:
case 0x92c0:
case 0x88c0:
case 0x2300:
@@ -2338,13 +2387,7 @@ static int rtl8192eu_load_firmware(struct rtl8xxxu_priv *priv)
char *fw_name;
int ret;
- return -EBUSY;
- if (!priv->vendor_umc)
- fw_name = "rtlwifi/rtl8192cufw_TMSC.bin";
- else if (priv->chip_cut || priv->rtlchip == 0x8192c)
- fw_name = "rtlwifi/rtl8192cufw_B.bin";
- else
- fw_name = "rtlwifi/rtl8192cufw_A.bin";
+ fw_name = "rtlwifi/rtl8192eu_nic.bin";
ret = rtl8xxxu_load_firmware(priv, fw_name);
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
index 8168a35..0d4ff80 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
@@ -625,6 +625,7 @@ struct rtl8xxxu_priv {
u8 mac_addr[ETH_ALEN];
char chip_name[8];
+ char chip_vendor[8];
u8 cck_tx_power_index_A[3]; /* 0x10 */
u8 cck_tx_power_index_B[3];
u8 ht40_1s_tx_power_index_A[3]; /* 0x16 */
@@ -647,6 +648,7 @@ struct rtl8xxxu_priv {
u32 has_gps:1;
u32 hi_pa:1;
u32 vendor_umc:1;
+ u32 vendor_smic:1;
u32 has_polarity_ctrl:1;
u32 has_eeprom:1;
u32 boot_eeprom:1;
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
index 8f6c9c6..a934c0d 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
@@ -222,6 +222,10 @@
#define SYS_CFG_CHIP_VER (BIT(12) | BIT(13) | BIT(14) | BIT(15))
#define SYS_CFG_BT_FUNC BIT(16)
#define SYS_CFG_VENDOR_ID BIT(19)
+#define SYS_CFG_VENDOR_EXT_MASK (BIT(18) | BIT(19))
+#define SYS_CFG_VENDOR_ID_TSMC 0
+#define SYS_CFG_VENDOR_ID_SMIC BIT(18)
+#define SYS_CFG_VENDOR_ID_UMC BIT(19)
#define SYS_CFG_PAD_HWPD_IDN BIT(22)
#define SYS_CFG_TRP_VAUX_EN BIT(23)
#define SYS_CFG_TRP_BT_EN BIT(24)
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 003/113] rtl8xxxu: Use 1024 byte block loads for 8192eu firmware
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
2016-02-29 22:03 ` [PATCH 001/113] rtl8xxxu: Add initial code to parse rtl8192eu efuse Jes.Sorensen
2016-02-29 22:04 ` [PATCH 002/113] rtl8xxxu: Identify chip vendors correctly Jes.Sorensen
@ 2016-02-29 22:04 ` Jes.Sorensen
2016-02-29 22:04 ` [PATCH 004/113] rtl8xxxu: Add rtl8192eu_nic.bin to the MODULE_FIRMWARE list Jes.Sorensen
` (110 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:04 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
The rtl8192eu can handle 1024 byte block writes, unlike it's
predecessors (8192cu/8188cu).
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 2db2d21..8ef72e3 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -5975,7 +5975,7 @@ static struct rtl8xxxu_fileops rtl8192eu_fops = {
.parse_efuse = rtl8192eu_parse_efuse,
.load_firmware = rtl8192eu_load_firmware,
.power_on = rtl8192cu_power_on,
- .writeN_block_size = 128,
+ .writeN_block_size = 1024,
};
static struct usb_device_id dev_table[] = {
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 004/113] rtl8xxxu: Add rtl8192eu_nic.bin to the MODULE_FIRMWARE list
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (2 preceding siblings ...)
2016-02-29 22:04 ` [PATCH 003/113] rtl8xxxu: Use 1024 byte block loads for 8192eu firmware Jes.Sorensen
@ 2016-02-29 22:04 ` Jes.Sorensen
2016-02-29 22:04 ` [PATCH 005/113] rtl8xxxu: Implment rtl8192eu_power_on() Jes.Sorensen
` (109 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:04 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 8ef72e3..5413e35 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -54,6 +54,7 @@ MODULE_FIRMWARE("rtlwifi/rtl8723aufw_B_NoBT.bin");
MODULE_FIRMWARE("rtlwifi/rtl8192cufw_A.bin");
MODULE_FIRMWARE("rtlwifi/rtl8192cufw_B.bin");
MODULE_FIRMWARE("rtlwifi/rtl8192cufw_TMSC.bin");
+MODULE_FIRMWARE("rtlwifi/rtl8192eu_nic.bin");
module_param_named(debug, rtl8xxxu_debug, int, 0600);
MODULE_PARM_DESC(debug, "Set debug mask");
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 005/113] rtl8xxxu: Implment rtl8192eu_power_on()
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (3 preceding siblings ...)
2016-02-29 22:04 ` [PATCH 004/113] rtl8xxxu: Add rtl8192eu_nic.bin to the MODULE_FIRMWARE list Jes.Sorensen
@ 2016-02-29 22:04 ` Jes.Sorensen
2016-02-29 22:04 ` [PATCH 006/113] rtl8xxxu: Add rtl8xxxu_auto_llt_table() Jes.Sorensen
` (108 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:04 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
This implements the rtl8192eu power on sequence, and splits it off
from the rtl8192cu/rtl8723au power on sequence.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 133 ++++++++++++++++++++-
.../net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h | 6 +
2 files changed, 133 insertions(+), 6 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 5413e35..5f30ae9 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -3791,7 +3791,7 @@ exit:
return ret;
}
-static void rtl8xxxu_disabled_to_emu(struct rtl8xxxu_priv *priv)
+static void rtl8723a_disabled_to_emu(struct rtl8xxxu_priv *priv)
{
u8 val8;
@@ -3811,7 +3811,82 @@ static void rtl8xxxu_disabled_to_emu(struct rtl8xxxu_priv *priv)
rtl8xxxu_write8(priv, REG_APS_FSMCO + 1, val8);
}
-static int rtl8xxxu_emu_to_active(struct rtl8xxxu_priv *priv)
+static void rtl8192e_disabled_to_emu(struct rtl8xxxu_priv *priv)
+{
+ u8 val8;
+
+ /* Clear suspend enable and power down enable*/
+ val8 = rtl8xxxu_read8(priv, REG_APS_FSMCO + 1);
+ val8 &= ~(BIT(3) | BIT(4));
+ rtl8xxxu_write8(priv, REG_APS_FSMCO + 1, val8);
+}
+
+static int rtl8192e_emu_to_active(struct rtl8xxxu_priv *priv)
+{
+ u8 val8;
+ u32 val32;
+ int count, ret = 0;
+
+ /* disable HWPDN 0x04[15]=0*/
+ val8 = rtl8xxxu_read8(priv, REG_APS_FSMCO + 1);
+ val8 &= ~BIT(7);
+ rtl8xxxu_write8(priv, REG_APS_FSMCO + 1, val8);
+
+ /* disable SW LPS 0x04[10]= 0 */
+ val8 = rtl8xxxu_read8(priv, REG_APS_FSMCO + 1);
+ val8 &= ~BIT(2);
+ rtl8xxxu_write8(priv, REG_APS_FSMCO + 1, val8);
+
+ /* disable WL suspend*/
+ val8 = rtl8xxxu_read8(priv, REG_APS_FSMCO + 1);
+ val8 &= ~(BIT(3) | BIT(4));
+ rtl8xxxu_write8(priv, REG_APS_FSMCO + 1, val8);
+
+ /* wait till 0x04[17] = 1 power ready*/
+ for (count = RTL8XXXU_MAX_REG_POLL; count; count--) {
+ val32 = rtl8xxxu_read32(priv, REG_APS_FSMCO);
+ if (val32 & BIT(17))
+ break;
+
+ udelay(10);
+ }
+
+ if (!count) {
+ ret = -EBUSY;
+ goto exit;
+ }
+
+ /* We should be able to optimize the following three entries into one */
+
+ /* release WLON reset 0x04[16]= 1*/
+ val8 = rtl8xxxu_read8(priv, REG_APS_FSMCO + 2);
+ val8 |= BIT(0);
+ rtl8xxxu_write8(priv, REG_APS_FSMCO + 2, val8);
+
+ /* set, then poll until 0 */
+ val32 = rtl8xxxu_read32(priv, REG_APS_FSMCO);
+ val32 |= APS_FSMCO_MAC_ENABLE;
+ rtl8xxxu_write32(priv, REG_APS_FSMCO, val32);
+
+ for (count = RTL8XXXU_MAX_REG_POLL; count; count--) {
+ val32 = rtl8xxxu_read32(priv, REG_APS_FSMCO);
+ if ((val32 & APS_FSMCO_MAC_ENABLE) == 0) {
+ ret = 0;
+ break;
+ }
+ udelay(10);
+ }
+
+ if (!count) {
+ ret = -EBUSY;
+ goto exit;
+ }
+
+exit:
+ return ret;
+}
+
+static int rtl8723a_emu_to_active(struct rtl8xxxu_priv *priv)
{
u8 val8;
u32 val32;
@@ -3940,9 +4015,9 @@ static int rtl8723au_power_on(struct rtl8xxxu_priv *priv)
*/
rtl8xxxu_write8(priv, REG_RSV_CTRL, 0x0);
- rtl8xxxu_disabled_to_emu(priv);
+ rtl8723a_disabled_to_emu(priv);
- ret = rtl8xxxu_emu_to_active(priv);
+ ret = rtl8723a_emu_to_active(priv);
if (ret)
goto exit;
@@ -4081,6 +4156,52 @@ static int rtl8192cu_power_on(struct rtl8xxxu_priv *priv)
#endif
+static int rtl8192eu_power_on(struct rtl8xxxu_priv *priv)
+{
+ u16 val16;
+ u32 val32;
+ int ret;
+
+ ret = 0;
+
+ val32 = rtl8xxxu_read32(priv, REG_SYS_CFG);
+ if (val32 & SYS_CFG_SPS_LDO_SEL) {
+ rtl8xxxu_write8(priv, REG_LDO_SW_CTRL, 0xc3);
+ } else {
+ /*
+ * Raise 1.2V voltage
+ */
+ val32 = rtl8xxxu_read32(priv, REG_8192E_LDOV12_CTRL);
+ val32 &= 0xff0fffff;
+ val32 |= 0x00500000;
+ rtl8xxxu_write32(priv, REG_8192E_LDOV12_CTRL, val32);
+ rtl8xxxu_write8(priv, REG_LDO_SW_CTRL, 0x83);
+ }
+
+ rtl8192e_disabled_to_emu(priv);
+
+ ret = rtl8192e_emu_to_active(priv);
+ if (ret)
+ goto exit;
+
+ rtl8xxxu_write16(priv, REG_CR, 0x0000);
+
+ /*
+ * Enable MAC DMA/WMAC/SCHEDULE/SEC block
+ * Set CR bit10 to enable 32k calibration.
+ */
+ val16 = rtl8xxxu_read16(priv, REG_CR);
+ val16 |= (CR_HCI_TXDMA_ENABLE | CR_HCI_RXDMA_ENABLE |
+ CR_TXDMA_ENABLE | CR_RXDMA_ENABLE |
+ CR_PROTOCOL_ENABLE | CR_SCHEDULE_ENABLE |
+ CR_MAC_TX_ENABLE | CR_MAC_RX_ENABLE |
+ CR_SECURITY_ENABLE | CR_CALTIMER_ENABLE);
+ rtl8xxxu_write16(priv, REG_CR, val16);
+
+exit:
+ return ret;
+}
+
static void rtl8xxxu_power_off(struct rtl8xxxu_priv *priv)
{
u8 val8;
@@ -5975,8 +6096,8 @@ static struct rtl8xxxu_fileops rtl8192cu_fops = {
static struct rtl8xxxu_fileops rtl8192eu_fops = {
.parse_efuse = rtl8192eu_parse_efuse,
.load_firmware = rtl8192eu_load_firmware,
- .power_on = rtl8192cu_power_on,
- .writeN_block_size = 1024,
+ .power_on = rtl8192eu_power_on,
+ .writeN_block_size = 128,
};
static struct usb_device_id dev_table[] = {
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
index a934c0d..02c7d6c 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
@@ -72,6 +72,7 @@
#define REG_AFE_MISC 0x0010
#define REG_SPS0_CTRL 0x0011
#define REG_SPS_OCP_CFG 0x0018
+#define REG_8192E_LDOV12_CTRL 0x0014
#define REG_RSV_CTRL 0x001c
#define REG_RF_CTRL 0x001f
@@ -178,6 +179,8 @@
control */
#define MULTI_GPS_FUNC_EN BIT(22) /* GPS function enable */
+#define REG_LDO_SW_CTRL 0x007c /* 8192eu */
+
#define REG_MCU_FW_DL 0x0080
#define MCU_FW_DL_ENABLE BIT(0)
#define MCU_FW_DL_READY BIT(1)
@@ -229,6 +232,7 @@
#define SYS_CFG_PAD_HWPD_IDN BIT(22)
#define SYS_CFG_TRP_VAUX_EN BIT(23)
#define SYS_CFG_TRP_BT_EN BIT(24)
+#define SYS_CFG_SPS_LDO_SEL BIT(24) /* 8192eu */
#define SYS_CFG_BD_PKG_SEL BIT(25)
#define SYS_CFG_BD_HCI_SEL BIT(26)
#define SYS_CFG_TYPE_ID BIT(27)
@@ -261,6 +265,8 @@
#define GPIO_USB_SUSEN BIT(23)
#define GPIO_RF_RL_ID (BIT(31) | BIT(30) | BIT(29) | BIT(28))
+#define REG_SYS_CFG2 0x00fc /* 8192eu */
+
/* 0x0100 ~ 0x01FF MACTOP General Configuration */
#define REG_CR 0x0100
#define CR_HCI_TXDMA_ENABLE BIT(0)
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 006/113] rtl8xxxu: Add rtl8xxxu_auto_llt_table()
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (4 preceding siblings ...)
2016-02-29 22:04 ` [PATCH 005/113] rtl8xxxu: Implment rtl8192eu_power_on() Jes.Sorensen
@ 2016-02-29 22:04 ` Jes.Sorensen
2016-02-29 22:04 ` [PATCH 007/113] rtl8xxxu: Init page boundaries before starting the firmware Jes.Sorensen
` (107 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:04 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
Newer chips can auto load the LLT table, it is no longer necessary to
build it manually in the driver.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 33 +++++++++++++++++++++-
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 1 +
.../net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h | 3 ++
3 files changed, 36 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 5f30ae9..2f31c2a 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -2774,6 +2774,34 @@ exit:
return ret;
}
+static int rtl8xxxu_auto_llt_table(struct rtl8xxxu_priv *priv, u8 last_tx_page)
+{
+ u32 val32;
+ int ret = 0;
+ int i;
+
+ val32 = rtl8xxxu_read32(priv, REG_AUTO_LLT);
+ pr_info("AUTO_LLT = %08x\n", val32);
+ val32 |= AUTO_LLT_INIT_LLT;
+ rtl8xxxu_write32(priv, REG_AUTO_LLT, val32);
+
+ for (i = 500; i; i--) {
+ val32 = rtl8xxxu_read32(priv, REG_AUTO_LLT);
+ if (!(val32 & AUTO_LLT_INIT_LLT))
+ break;
+ usleep_range(2, 4);
+ }
+
+ if (i) {
+ ret = -EBUSY;
+ dev_warn(&priv->udev->dev, "LLT table init failed\n");
+ }
+ else
+ dev_warn(&priv->udev->dev, "LLT table init success\n");
+
+ return ret;
+}
+
static int rtl8xxxu_init_queue_priority(struct rtl8xxxu_priv *priv)
{
u16 val16, hi, lo;
@@ -4287,7 +4315,7 @@ static int rtl8xxxu_init_device(struct ieee80211_hw *hw)
dev_dbg(dev, "%s: macpower %i\n", __func__, macpower);
if (!macpower) {
- ret = rtl8xxxu_init_llt_table(priv, TX_TOTAL_PAGE_NUM);
+ ret = priv->fops->llt_init(priv, TX_TOTAL_PAGE_NUM);
if (ret) {
dev_warn(dev, "%s: LLT table init failed\n", __func__);
goto exit;
@@ -6079,6 +6107,7 @@ static struct rtl8xxxu_fileops rtl8723au_fops = {
.parse_efuse = rtl8723au_parse_efuse,
.load_firmware = rtl8723au_load_firmware,
.power_on = rtl8723au_power_on,
+ .llt_init = rtl8xxxu_init_llt_table,
.writeN_block_size = 1024,
};
@@ -6088,6 +6117,7 @@ static struct rtl8xxxu_fileops rtl8192cu_fops = {
.parse_efuse = rtl8192cu_parse_efuse,
.load_firmware = rtl8192cu_load_firmware,
.power_on = rtl8192cu_power_on,
+ .llt_init = rtl8xxxu_init_llt_table,
.writeN_block_size = 128,
};
@@ -6097,6 +6127,7 @@ static struct rtl8xxxu_fileops rtl8192eu_fops = {
.parse_efuse = rtl8192eu_parse_efuse,
.load_firmware = rtl8192eu_load_firmware,
.power_on = rtl8192eu_power_on,
+ .llt_init = rtl8xxxu_auto_llt_table,
.writeN_block_size = 128,
};
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
index 0d4ff80..56c4e0a 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
@@ -718,5 +718,6 @@ struct rtl8xxxu_fileops {
int (*parse_efuse) (struct rtl8xxxu_priv *priv);
int (*load_firmware) (struct rtl8xxxu_priv *priv);
int (*power_on) (struct rtl8xxxu_priv *priv);
+ int (*llt_init) (struct rtl8xxxu_priv *priv, u8 last_tx_page);
int writeN_block_size;
};
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
index 02c7d6c..b83bd34 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
@@ -372,6 +372,9 @@
#define RQPN_NPQ_SHIFT 0
#define RQPN_EPQ_SHIFT 16
+#define REG_AUTO_LLT 0x0224
+#define AUTO_LLT_INIT_LLT BIT(16)
+
/* 0x0280 ~ 0x02FF RXDMA Configuration */
#define REG_RXDMA_AGG_PG_TH 0x0280
#define REG_RXPKT_NUM 0x0284
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 007/113] rtl8xxxu: Init page boundaries before starting the firmware
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (5 preceding siblings ...)
2016-02-29 22:04 ` [PATCH 006/113] rtl8xxxu: Add rtl8xxxu_auto_llt_table() Jes.Sorensen
@ 2016-02-29 22:04 ` Jes.Sorensen
2016-02-29 22:04 ` [PATCH 008/113] rtl8xxxu: Init the LLT after we start " Jes.Sorensen
` (106 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:04 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
This reorganizes the device initialization to init page boundaries
before starting the firmware. This matches the flow in the 8192eu
vendor driver.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 68 ++++++++++++------------
1 file changed, 34 insertions(+), 34 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 2f31c2a..a17d88e 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -4315,6 +4315,40 @@ static int rtl8xxxu_init_device(struct ieee80211_hw *hw)
dev_dbg(dev, "%s: macpower %i\n", __func__, macpower);
if (!macpower) {
+ if (priv->ep_tx_normal_queue)
+ val8 = TX_PAGE_NUM_NORM_PQ;
+ else
+ val8 = 0;
+
+ rtl8xxxu_write8(priv, REG_RQPN_NPQ, val8);
+
+ val32 = (TX_PAGE_NUM_PUBQ << RQPN_NORM_PQ_SHIFT) | RQPN_LOAD;
+
+ if (priv->ep_tx_high_queue)
+ val32 |= (TX_PAGE_NUM_HI_PQ << RQPN_HI_PQ_SHIFT);
+ if (priv->ep_tx_low_queue)
+ val32 |= (TX_PAGE_NUM_LO_PQ << RQPN_LO_PQ_SHIFT);
+
+ rtl8xxxu_write32(priv, REG_RQPN, val32);
+
+ /*
+ * Set TX buffer boundary
+ */
+ val8 = TX_TOTAL_PAGE_NUM + 1;
+ rtl8xxxu_write8(priv, REG_TXPKTBUF_BCNQ_BDNY, val8);
+ rtl8xxxu_write8(priv, REG_TXPKTBUF_MGQ_BDNY, val8);
+ rtl8xxxu_write8(priv, REG_TXPKTBUF_WMAC_LBK_BF_HD, val8);
+ rtl8xxxu_write8(priv, REG_TRXFF_BNDY, val8);
+ rtl8xxxu_write8(priv, REG_TDECTRL + 1, val8);
+ }
+
+ ret = rtl8xxxu_init_queue_priority(priv);
+ dev_dbg(dev, "%s: init_queue_priority %i\n", __func__, ret);
+ if (ret)
+ goto exit;
+
+ dev_dbg(dev, "%s: macpower %i\n", __func__, macpower);
+ if (!macpower) {
ret = priv->fops->llt_init(priv, TX_TOTAL_PAGE_NUM);
if (ret) {
dev_warn(dev, "%s: LLT table init failed\n", __func__);
@@ -4392,40 +4426,6 @@ static int rtl8xxxu_init_device(struct ieee80211_hw *hw)
priv->rf_mode_ag[0] = rtl8xxxu_read_rfreg(priv, RF_A,
RF6052_REG_MODE_AG);
- dev_dbg(dev, "%s: macpower %i\n", __func__, macpower);
- if (!macpower) {
- if (priv->ep_tx_normal_queue)
- val8 = TX_PAGE_NUM_NORM_PQ;
- else
- val8 = 0;
-
- rtl8xxxu_write8(priv, REG_RQPN_NPQ, val8);
-
- val32 = (TX_PAGE_NUM_PUBQ << RQPN_NORM_PQ_SHIFT) | RQPN_LOAD;
-
- if (priv->ep_tx_high_queue)
- val32 |= (TX_PAGE_NUM_HI_PQ << RQPN_HI_PQ_SHIFT);
- if (priv->ep_tx_low_queue)
- val32 |= (TX_PAGE_NUM_LO_PQ << RQPN_LO_PQ_SHIFT);
-
- rtl8xxxu_write32(priv, REG_RQPN, val32);
-
- /*
- * Set TX buffer boundary
- */
- val8 = TX_TOTAL_PAGE_NUM + 1;
- rtl8xxxu_write8(priv, REG_TXPKTBUF_BCNQ_BDNY, val8);
- rtl8xxxu_write8(priv, REG_TXPKTBUF_MGQ_BDNY, val8);
- rtl8xxxu_write8(priv, REG_TXPKTBUF_WMAC_LBK_BF_HD, val8);
- rtl8xxxu_write8(priv, REG_TRXFF_BNDY, val8);
- rtl8xxxu_write8(priv, REG_TDECTRL + 1, val8);
- }
-
- ret = rtl8xxxu_init_queue_priority(priv);
- dev_dbg(dev, "%s: init_queue_priority %i\n", __func__, ret);
- if (ret)
- goto exit;
-
/*
* Set RX page boundary
*/
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 008/113] rtl8xxxu: Init the LLT after we start the firmware
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (6 preceding siblings ...)
2016-02-29 22:04 ` [PATCH 007/113] rtl8xxxu: Init page boundaries before starting the firmware Jes.Sorensen
@ 2016-02-29 22:04 ` Jes.Sorensen
2016-02-29 22:04 ` [PATCH 009/113] rtl8xxxu: Fix incorrect test for auto LLT failure Jes.Sorensen
` (105 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:04 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
To match the flow of the vendor driver, move the LLT init to after the
firmware is started.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index a17d88e..a817208 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -4342,6 +4342,15 @@ static int rtl8xxxu_init_device(struct ieee80211_hw *hw)
rtl8xxxu_write8(priv, REG_TDECTRL + 1, val8);
}
+ ret = rtl8xxxu_download_firmware(priv);
+ dev_dbg(dev, "%s: download_fiwmare %i\n", __func__, ret);
+ if (ret)
+ goto exit;
+ ret = rtl8xxxu_start_firmware(priv);
+ dev_dbg(dev, "%s: start_fiwmare %i\n", __func__, ret);
+ if (ret)
+ goto exit;
+
ret = rtl8xxxu_init_queue_priority(priv);
dev_dbg(dev, "%s: init_queue_priority %i\n", __func__, ret);
if (ret)
@@ -4356,15 +4365,6 @@ static int rtl8xxxu_init_device(struct ieee80211_hw *hw)
}
}
- ret = rtl8xxxu_download_firmware(priv);
- dev_dbg(dev, "%s: download_fiwmare %i\n", __func__, ret);
- if (ret)
- goto exit;
- ret = rtl8xxxu_start_firmware(priv);
- dev_dbg(dev, "%s: start_fiwmare %i\n", __func__, ret);
- if (ret)
- goto exit;
-
ret = rtl8xxxu_init_mac(priv, rtl8723a_mac_init_table);
dev_dbg(dev, "%s: init_mac %i\n", __func__, ret);
if (ret)
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 009/113] rtl8xxxu: Fix incorrect test for auto LLT failure
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (7 preceding siblings ...)
2016-02-29 22:04 ` [PATCH 008/113] rtl8xxxu: Init the LLT after we start " Jes.Sorensen
@ 2016-02-29 22:04 ` Jes.Sorensen
2016-02-29 22:04 ` [PATCH 010/113] rtl8xxxu: Kludge to drop incorrect USB OUT EP for 8192EU Jes.Sorensen
` (104 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:04 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
The logic for testing auto load failure in rtl8xxxu_auto_llt_table()
was inverted.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index a817208..45f787c 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -2781,7 +2781,6 @@ static int rtl8xxxu_auto_llt_table(struct rtl8xxxu_priv *priv, u8 last_tx_page)
int i;
val32 = rtl8xxxu_read32(priv, REG_AUTO_LLT);
- pr_info("AUTO_LLT = %08x\n", val32);
val32 |= AUTO_LLT_INIT_LLT;
rtl8xxxu_write32(priv, REG_AUTO_LLT, val32);
@@ -2792,12 +2791,10 @@ static int rtl8xxxu_auto_llt_table(struct rtl8xxxu_priv *priv, u8 last_tx_page)
usleep_range(2, 4);
}
- if (i) {
+ if (!i) {
ret = -EBUSY;
dev_warn(&priv->udev->dev, "LLT table init failed\n");
}
- else
- dev_warn(&priv->udev->dev, "LLT table init success\n");
return ret;
}
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 010/113] rtl8xxxu: Kludge to drop incorrect USB OUT EP for 8192EU
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (8 preceding siblings ...)
2016-02-29 22:04 ` [PATCH 009/113] rtl8xxxu: Fix incorrect test for auto LLT failure Jes.Sorensen
@ 2016-02-29 22:04 ` Jes.Sorensen
2016-02-29 22:04 ` [PATCH 011/113] rtl8xxxu: Init REG_HIMR[01] for 8192eu parts Jes.Sorensen
` (103 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:04 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
The 8192eu (and some other parts) will report an incorrect USB OUT
EP. This tells the chip to drop it - as per the vendor driver.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 6 ++++++
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h | 1 +
2 files changed, 7 insertions(+)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 45f787c..9236133 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -4362,6 +4362,12 @@ static int rtl8xxxu_init_device(struct ieee80211_hw *hw)
}
}
+ if (priv->rtlchip == 0x8192e) {
+ val32 = rtl8xxxu_read32(priv, REG_TXDMA_OFFSET_CHK);
+ val32 |= TXDMA_OFFSET_DROP_DATA_EN;
+ rtl8xxxu_write32(priv, REG_TXDMA_OFFSET_CHK, val32);
+ }
+
ret = rtl8xxxu_init_mac(priv, rtl8723a_mac_init_table);
dev_dbg(dev, "%s: init_mac %i\n", __func__, ret);
if (ret)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
index b83bd34..226a1fa 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
@@ -367,6 +367,7 @@
#define REG_FIFOPAGE 0x0204
#define REG_TDECTRL 0x0208
#define REG_TXDMA_OFFSET_CHK 0x020c
+#define TXDMA_OFFSET_DROP_DATA_EN BIT(9)
#define REG_TXDMA_STATUS 0x0210
#define REG_RQPN_NPQ 0x0214
#define RQPN_NPQ_SHIFT 0
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 011/113] rtl8xxxu: Init REG_HIMR[01] for 8192eu parts
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (9 preceding siblings ...)
2016-02-29 22:04 ` [PATCH 010/113] rtl8xxxu: Kludge to drop incorrect USB OUT EP for 8192EU Jes.Sorensen
@ 2016-02-29 22:04 ` Jes.Sorensen
2016-02-29 22:04 ` [PATCH 012/113] rtl8xxxu: Initial rtl8723bu chip identification Jes.Sorensen
` (102 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:04 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
The newer generation chips have different interrupt registers.
Initialize this correct registers on 8192eu.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 3 +++
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h | 4 ++++
2 files changed, 7 insertions(+)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 9236133..b6c20e3 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -4366,6 +4366,9 @@ static int rtl8xxxu_init_device(struct ieee80211_hw *hw)
val32 = rtl8xxxu_read32(priv, REG_TXDMA_OFFSET_CHK);
val32 |= TXDMA_OFFSET_DROP_DATA_EN;
rtl8xxxu_write32(priv, REG_TXDMA_OFFSET_CHK, val32);
+
+ rtl8xxxu_write32(priv, REG_HIMR0, 0x00);
+ rtl8xxxu_write32(priv, REG_HIMR1, 0x00);
}
ret = rtl8xxxu_init_mac(priv, rtl8723a_mac_init_table);
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
index 226a1fa..3cbb549 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
@@ -196,6 +196,10 @@
#define REG_HMBOX_EXT_1 0x008a
#define REG_HMBOX_EXT_2 0x008c
#define REG_HMBOX_EXT_3 0x008e
+/* Interrupt registers for 8192e/8812 */
+#define REG_HIMR0 0x00b0
+#define REG_HIMR1 0x00b8
+
/* Host suspend counter on FPGA platform */
#define REG_HOST_SUSP_CNT 0x00bc
/* Efuse access protection for RTL8723 */
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 012/113] rtl8xxxu: Initial rtl8723bu chip identification
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (10 preceding siblings ...)
2016-02-29 22:04 ` [PATCH 011/113] rtl8xxxu: Init REG_HIMR[01] for 8192eu parts Jes.Sorensen
@ 2016-02-29 22:04 ` Jes.Sorensen
2016-02-29 22:04 ` [PATCH 013/113] rtl8xxxu: Add rtl8723bu_parse_efuse() and 8723bu efuse definition Jes.Sorensen
` (101 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:04 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
This provides initial detection of 8723bu devices, and selects the
correct firmware image to load.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 40 ++++++++++++++++++++++--
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 2 +-
2 files changed, 38 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index b6c20e3..cd0c84a 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -55,6 +55,8 @@ MODULE_FIRMWARE("rtlwifi/rtl8192cufw_A.bin");
MODULE_FIRMWARE("rtlwifi/rtl8192cufw_B.bin");
MODULE_FIRMWARE("rtlwifi/rtl8192cufw_TMSC.bin");
MODULE_FIRMWARE("rtlwifi/rtl8192eu_nic.bin");
+MODULE_FIRMWARE("rtlwifi/rtl8723bu_nic.bin");
+MODULE_FIRMWARE("rtlwifi/rtl8723bu_bt.bin");
module_param_named(debug, rtl8xxxu_debug, int, 0600);
MODULE_PARM_DESC(debug, "Set debug mask");
@@ -1700,11 +1702,17 @@ static int rtl8xxxu_identify_chip(struct rtl8xxxu_priv *priv)
}
if (val32 & SYS_CFG_BT_FUNC) {
- sprintf(priv->chip_name, "8723AU");
+ if (priv->chip_cut >= 3) {
+ sprintf(priv->chip_name, "8723BU");
+ priv->rtlchip = 0x8723b;
+ } else {
+ sprintf(priv->chip_name, "8723AU");
+ priv->rtlchip = 0x8723a;
+ }
+
priv->rf_paths = 1;
priv->rx_paths = 1;
priv->tx_paths = 1;
- priv->rtlchip = 0x8723a;
val32 = rtl8xxxu_read32(priv, REG_MULTI_FUNC_CTRL);
if (val32 & MULTI_WIFI_FUNC_EN)
@@ -1807,6 +1815,7 @@ static int rtl8xxxu_identify_chip(struct rtl8xxxu_priv *priv)
*/
if (!priv->ep_tx_count) {
switch (priv->nr_out_eps) {
+ case 4:
case 3:
priv->ep_tx_low_queue = 1;
priv->ep_tx_count++;
@@ -2321,6 +2330,7 @@ static int rtl8xxxu_load_firmware(struct rtl8xxxu_priv *priv, char *fw_name)
case 0x92e0:
case 0x92c0:
case 0x88c0:
+ case 0x5300:
case 0x2300:
break;
default:
@@ -2362,6 +2372,20 @@ static int rtl8723au_load_firmware(struct rtl8xxxu_priv *priv)
return ret;
}
+static int rtl8723bu_load_firmware(struct rtl8xxxu_priv *priv)
+{
+ char *fw_name;
+ int ret;
+
+ if (priv->enable_bluetooth)
+ fw_name = "rtlwifi/rtl8723bu_bt.bin";
+ else
+ fw_name = "rtlwifi/rtl8723bu_nic.bin";
+
+ ret = rtl8xxxu_load_firmware(priv, fw_name);
+ return ret;
+}
+
#ifdef CONFIG_RTL8XXXU_UNTESTED
static int rtl8192cu_load_firmware(struct rtl8xxxu_priv *priv)
@@ -2587,7 +2611,7 @@ static int rtl8xxxu_init_phy_bb(struct rtl8xxxu_priv *priv)
else
rtl8xxxu_init_phy_regs(priv, rtl8xxx_agc_standard_table);
- if (priv->rtlchip == 0x8723a &&
+ if ((priv->rtlchip == 0x8723a || priv->rtlchip == 0x8723b) &&
priv->efuse_wifi.efuse8723.version >= 0x01) {
val32 = rtl8xxxu_read32(priv, REG_MAC_PHY_CTRL);
@@ -6117,6 +6141,14 @@ static struct rtl8xxxu_fileops rtl8723au_fops = {
.writeN_block_size = 1024,
};
+static struct rtl8xxxu_fileops rtl8723bu_fops = {
+ .parse_efuse = rtl8723au_parse_efuse,
+ .load_firmware = rtl8723bu_load_firmware,
+ .power_on = rtl8723au_power_on,
+ .llt_init = rtl8xxxu_auto_llt_table,
+ .writeN_block_size = 128,
+};
+
#ifdef CONFIG_RTL8XXXU_UNTESTED
static struct rtl8xxxu_fileops rtl8192cu_fops = {
@@ -6146,6 +6178,8 @@ static struct usb_device_id dev_table[] = {
.driver_info = (unsigned long)&rtl8723au_fops},
{USB_DEVICE_AND_INTERFACE_INFO(USB_VENDOR_ID_REALTEK, 0x818b, 0xff, 0xff, 0xff),
.driver_info = (unsigned long)&rtl8192eu_fops},
+{USB_DEVICE_AND_INTERFACE_INFO(USB_VENDOR_ID_REALTEK, 0xb720, 0xff, 0xff, 0xff),
+ .driver_info = (unsigned long)&rtl8723bu_fops},
#ifdef CONFIG_RTL8XXXU_UNTESTED
/* Still supported by rtlwifi */
{USB_DEVICE_AND_INTERFACE_INFO(USB_VENDOR_ID_REALTEK, 0x8176, 0xff, 0xff, 0xff),
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
index 56c4e0a..dd4c563 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
@@ -34,7 +34,7 @@
#define RTL8XXXU_MAX_REG_POLL 500
#define USB_INTR_CONTENT_LENGTH 56
-#define RTL8XXXU_OUT_ENDPOINTS 3
+#define RTL8XXXU_OUT_ENDPOINTS 4
#define REALTEK_USB_READ 0xc0
#define REALTEK_USB_WRITE 0x40
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 013/113] rtl8xxxu: Add rtl8723bu_parse_efuse() and 8723bu efuse definition
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (11 preceding siblings ...)
2016-02-29 22:04 ` [PATCH 012/113] rtl8xxxu: Initial rtl8723bu chip identification Jes.Sorensen
@ 2016-02-29 22:04 ` Jes.Sorensen
2016-02-29 22:04 ` [PATCH 014/113] rtl8xxxu: Use 1024 byte writes for writing 8723bu firmware Jes.Sorensen
` (100 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:04 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
Implement first stab at parsing the 8723bu's efuse.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 47 +++++++++++++++++++++++-
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 42 +++++++++++++++++++++
2 files changed, 88 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index cd0c84a..b6068da 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -1877,6 +1877,51 @@ static int rtl8723au_parse_efuse(struct rtl8xxxu_priv *priv)
return 0;
}
+static int rtl8723bu_parse_efuse(struct rtl8xxxu_priv *priv)
+{
+ if (priv->efuse_wifi.efuse8723bu.rtl_id != cpu_to_le16(0x8129))
+ return -EINVAL;
+
+ ether_addr_copy(priv->mac_addr, priv->efuse_wifi.efuse8723bu.mac_addr);
+
+ memcpy(priv->cck_tx_power_index_A,
+ priv->efuse_wifi.efuse8723bu.cck_tx_power_index_A,
+ sizeof(priv->cck_tx_power_index_A));
+ memcpy(priv->cck_tx_power_index_B,
+ priv->efuse_wifi.efuse8723bu.cck_tx_power_index_B,
+ sizeof(priv->cck_tx_power_index_B));
+
+ memcpy(priv->ht40_1s_tx_power_index_A,
+ priv->efuse_wifi.efuse8723bu.ht40_1s_tx_power_index_A,
+ sizeof(priv->ht40_1s_tx_power_index_A));
+ memcpy(priv->ht40_1s_tx_power_index_B,
+ priv->efuse_wifi.efuse8723bu.ht40_1s_tx_power_index_B,
+ sizeof(priv->ht40_1s_tx_power_index_B));
+
+ dev_info(&priv->udev->dev, "Vendor: %.7s\n",
+ priv->efuse_wifi.efuse8723bu.vendor_name);
+ dev_info(&priv->udev->dev, "Product: %.41s\n",
+ priv->efuse_wifi.efuse8723bu.device_name);
+
+ if (rtl8xxxu_debug & RTL8XXXU_DEBUG_EFUSE) {
+ int i;
+ unsigned char *raw = priv->efuse_wifi.raw;
+
+ dev_info(&priv->udev->dev,
+ "%s: dumping efuse (0x%02zx bytes):\n",
+ __func__, sizeof(struct rtl8723bu_efuse));
+ for (i = 0; i < sizeof(struct rtl8723bu_efuse); i += 8) {
+ dev_info(&priv->udev->dev, "%02x: "
+ "%02x %02x %02x %02x %02x %02x %02x %02x\n", i,
+ raw[i], raw[i + 1], raw[i + 2],
+ raw[i + 3], raw[i + 4], raw[i + 5],
+ raw[i + 6], raw[i + 7]);
+ }
+ }
+
+ return 0;
+}
+
#ifdef CONFIG_RTL8XXXU_UNTESTED
static int rtl8192cu_parse_efuse(struct rtl8xxxu_priv *priv)
@@ -6142,7 +6187,7 @@ static struct rtl8xxxu_fileops rtl8723au_fops = {
};
static struct rtl8xxxu_fileops rtl8723bu_fops = {
- .parse_efuse = rtl8723au_parse_efuse,
+ .parse_efuse = rtl8723bu_parse_efuse,
.load_firmware = rtl8723bu_load_firmware,
.power_on = rtl8723au_power_on,
.llt_init = rtl8xxxu_auto_llt_table,
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
index dd4c563..bf424db 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
@@ -500,6 +500,47 @@ struct rtl8192cu_efuse {
u8 customer_id;
};
+struct rtl8723bu_efuse {
+ __le16 rtl_id;
+ u8 res0[0x0e];
+ u8 cck_tx_power_index_A[3]; /* 0x10 */
+ u8 cck_tx_power_index_B[3];
+ u8 ht40_1s_tx_power_index_A[3]; /* 0x16 */
+ u8 ht40_1s_tx_power_index_B[3];
+ u8 res1[0x9c];
+ u8 channel_plan; /* 0xb8 */
+ u8 xtal_k;
+ u8 thermal_meter;
+ u8 iqk_lck;
+ u8 pa_type; /* 0xbc */
+ u8 lna_type_2g; /* 0xbd */
+ u8 res2[3];
+ u8 rf_board_option;
+ u8 rf_feature_option;
+ u8 rf_bt_setting;
+ u8 eeprom_version;
+ u8 eeprom_customer_id;
+ u8 res3[2];
+ u8 tx_pwr_calibrate_rate;
+ u8 rf_antenna_option; /* 0xc9 */
+ u8 rfe_option;
+ u8 res4[9];
+ 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]; /* 0xe8 */
+ u8 res11[0xd4];
+};
+
struct rtl8192eu_efuse {
__le16 rtl_id;
u8 res0[0x0e];
@@ -690,6 +731,7 @@ struct rtl8xxxu_priv {
union {
u8 raw[EFUSE_MAP_LEN];
struct rtl8723au_efuse efuse8723;
+ struct rtl8723bu_efuse efuse8723bu;
struct rtl8192cu_efuse efuse8192;
struct rtl8192eu_efuse efuse8192eu;
} efuse_wifi;
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 014/113] rtl8xxxu: Use 1024 byte writes for writing 8723bu firmware
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (12 preceding siblings ...)
2016-02-29 22:04 ` [PATCH 013/113] rtl8xxxu: Add rtl8723bu_parse_efuse() and 8723bu efuse definition Jes.Sorensen
@ 2016-02-29 22:04 ` Jes.Sorensen
2016-02-29 22:04 ` [PATCH 015/113] rtl8xxxu: Only setup USB interrupts for parts which support it Jes.Sorensen
` (99 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:04 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
The 8723bu, like the 8192eu, can also handle 1024 byte block writes.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index b6068da..66a0c17 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -6191,7 +6191,7 @@ static struct rtl8xxxu_fileops rtl8723bu_fops = {
.load_firmware = rtl8723bu_load_firmware,
.power_on = rtl8723au_power_on,
.llt_init = rtl8xxxu_auto_llt_table,
- .writeN_block_size = 128,
+ .writeN_block_size = 1024,
};
#ifdef CONFIG_RTL8XXXU_UNTESTED
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 015/113] rtl8xxxu: Only setup USB interrupts for parts which support it
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (13 preceding siblings ...)
2016-02-29 22:04 ` [PATCH 014/113] rtl8xxxu: Use 1024 byte writes for writing 8723bu firmware Jes.Sorensen
@ 2016-02-29 22:04 ` Jes.Sorensen
2016-02-29 22:04 ` [PATCH 016/113] rtl8xxxu: Add rtl8723b_phy_1t_init_table Jes.Sorensen
` (98 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:04 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
Only 1st generation chips do provide USB interrupts, so do not try to
setup interrupts for newer chips (8192eu and 8723bu).
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 18 +++++++++++++-----
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 1 +
2 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 66a0c17..b3fd5c2 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -1707,6 +1707,7 @@ static int rtl8xxxu_identify_chip(struct rtl8xxxu_priv *priv)
priv->rtlchip = 0x8723b;
} else {
sprintf(priv->chip_name, "8723AU");
+ priv->usb_interrupts = 1;
priv->rtlchip = 0x8723a;
}
@@ -1744,12 +1745,14 @@ static int rtl8xxxu_identify_chip(struct rtl8xxxu_priv *priv)
priv->rf_paths = 2;
priv->rx_paths = 2;
priv->tx_paths = 1;
+ priv->usb_interrupts = 1;
priv->rtlchip = 0x8191c;
} else {
sprintf(priv->chip_name, "8192CU");
priv->rf_paths = 2;
priv->rx_paths = 2;
priv->tx_paths = 2;
+ priv->usb_interrupts = 1;
priv->rtlchip = 0x8192c;
}
priv->has_wifi = 1;
@@ -1759,6 +1762,7 @@ static int rtl8xxxu_identify_chip(struct rtl8xxxu_priv *priv)
priv->rx_paths = 1;
priv->tx_paths = 1;
priv->rtlchip = 0x8188c;
+ priv->usb_interrupts = 1;
priv->has_wifi = 1;
}
@@ -5825,9 +5829,11 @@ static int rtl8xxxu_start(struct ieee80211_hw *hw)
init_usb_anchor(&priv->int_anchor);
rtl8723a_enable_rf(priv);
- ret = rtl8xxxu_submit_int_urb(hw);
- if (ret)
- goto exit;
+ if (priv->usb_interrupts) {
+ ret = rtl8xxxu_submit_int_urb(hw);
+ if (ret)
+ goto exit;
+ }
for (i = 0; i < RTL8XXXU_TX_URBS; i++) {
tx_urb = kmalloc(sizeof(struct rtl8xxxu_tx_urb), GFP_KERNEL);
@@ -5902,14 +5908,16 @@ static void rtl8xxxu_stop(struct ieee80211_hw *hw)
usb_kill_anchored_urbs(&priv->rx_anchor);
usb_kill_anchored_urbs(&priv->tx_anchor);
- usb_kill_anchored_urbs(&priv->int_anchor);
+ if (priv->usb_interrupts)
+ usb_kill_anchored_urbs(&priv->int_anchor);
rtl8723a_disable_rf(priv);
/*
* Disable interrupts
*/
- rtl8xxxu_write32(priv, REG_USB_HIMR, 0);
+ if (priv->usb_interrupts)
+ rtl8xxxu_write32(priv, REG_USB_HIMR, 0);
rtl8xxxu_free_rx_resources(priv);
rtl8xxxu_free_tx_resources(priv);
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
index bf424db..2055048 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
@@ -693,6 +693,7 @@ struct rtl8xxxu_priv {
u32 has_polarity_ctrl:1;
u32 has_eeprom:1;
u32 boot_eeprom:1;
+ u32 usb_interrupts:1;
u32 ep_tx_high_queue:1;
u32 ep_tx_normal_queue:1;
u32 ep_tx_low_queue:1;
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 016/113] rtl8xxxu: Add rtl8723b_phy_1t_init_table
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (14 preceding siblings ...)
2016-02-29 22:04 ` [PATCH 015/113] rtl8xxxu: Only setup USB interrupts for parts which support it Jes.Sorensen
@ 2016-02-29 22:04 ` Jes.Sorensen
2016-02-29 22:04 ` [PATCH 017/113] rtl8xxxu: Add rtl8723bu_radioa_1t_init_table Jes.Sorensen
` (97 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:04 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
This adds the 8723bu PHY 1T init table.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 103 +++++++++++++++++++++++
1 file changed, 103 insertions(+)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index b3fd5c2..88af2e8 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -251,6 +251,107 @@ static struct rtl8xxxu_reg32val rtl8723a_phy_1t_init_table[] = {
{0xffff, 0xffffffff},
};
+static struct rtl8xxxu_reg32val rtl8723b_phy_1t_init_table[] = {
+ {0x800, 0x80040000}, {0x804, 0x00000003},
+ {0x808, 0x0000fc00}, {0x80c, 0x0000000a},
+ {0x810, 0x10001331}, {0x814, 0x020c3d10},
+ {0x818, 0x02200385}, {0x81c, 0x00000000},
+ {0x820, 0x01000100}, {0x824, 0x00190204},
+ {0x828, 0x00000000}, {0x82c, 0x00000000},
+ {0x830, 0x00000000}, {0x834, 0x00000000},
+ {0x838, 0x00000000}, {0x83c, 0x00000000},
+ {0x840, 0x00010000}, {0x844, 0x00000000},
+ {0x848, 0x00000000}, {0x84c, 0x00000000},
+ {0x850, 0x00000000}, {0x854, 0x00000000},
+ {0x858, 0x569a11a9}, {0x85c, 0x01000014},
+ {0x860, 0x66f60110}, {0x864, 0x061f0649},
+ {0x868, 0x00000000}, {0x86c, 0x27272700},
+ {0x870, 0x07000760}, {0x874, 0x25004000},
+ {0x878, 0x00000808}, {0x87c, 0x00000000},
+ {0x880, 0xb0000c1c}, {0x884, 0x00000001},
+ {0x888, 0x00000000}, {0x88c, 0xccc000c0},
+ {0x890, 0x00000800}, {0x894, 0xfffffffe},
+ {0x898, 0x40302010}, {0x89c, 0x00706050},
+ {0x900, 0x00000000}, {0x904, 0x00000023},
+ {0x908, 0x00000000}, {0x90c, 0x81121111},
+ {0x910, 0x00000002}, {0x914, 0x00000201},
+ {0xa00, 0x00d047c8}, {0xa04, 0x80ff800c},
+ {0xa08, 0x8c838300}, {0xa0c, 0x2e7f120f},
+ {0xa10, 0x9500bb78}, {0xa14, 0x1114d028},
+ {0xa18, 0x00881117}, {0xa1c, 0x89140f00},
+ {0xa20, 0x1a1b0000}, {0xa24, 0x090e1317},
+ {0xa28, 0x00000204}, {0xa2c, 0x00d30000},
+ {0xa70, 0x101fbf00}, {0xa74, 0x00000007},
+ {0xa78, 0x00000900}, {0xa7c, 0x225b0606},
+ {0xa80, 0x21806490}, {0xb2c, 0x00000000},
+ {0xc00, 0x48071d40}, {0xc04, 0x03a05611},
+ {0xc08, 0x000000e4}, {0xc0c, 0x6c6c6c6c},
+ {0xc10, 0x08800000}, {0xc14, 0x40000100},
+ {0xc18, 0x08800000}, {0xc1c, 0x40000100},
+ {0xc20, 0x00000000}, {0xc24, 0x00000000},
+ {0xc28, 0x00000000}, {0xc2c, 0x00000000},
+ {0xc30, 0x69e9ac44}, {0xc34, 0x469652af},
+ {0xc38, 0x49795994}, {0xc3c, 0x0a97971c},
+ {0xc40, 0x1f7c403f}, {0xc44, 0x000100b7},
+ {0xc48, 0xec020107}, {0xc4c, 0x007f037f},
+ {0xc50, 0x69553420}, {0xc54, 0x43bc0094},
+ {0xc58, 0x00013149}, {0xc5c, 0x00250492},
+ {0xc60, 0x00000000}, {0xc64, 0x7112848b},
+ {0xc68, 0x47c00bff}, {0xc6c, 0x00000036},
+ {0xc70, 0x2c7f000d}, {0xc74, 0x020610db},
+ {0xc78, 0x0000001f}, {0xc7c, 0x00b91612},
+ {0xc80, 0x390000e4}, {0xc84, 0x20f60000},
+ {0xc88, 0x40000100}, {0xc8c, 0x20200000},
+ {0xc90, 0x00020e1a}, {0xc94, 0x00000000},
+ {0xc98, 0x00020e1a}, {0xc9c, 0x00007f7f},
+ {0xca0, 0x00000000}, {0xca4, 0x000300a0},
+ {0xca8, 0x00000000}, {0xcac, 0x00000000},
+ {0xcb0, 0x00000000}, {0xcb4, 0x00000000},
+ {0xcb8, 0x00000000}, {0xcbc, 0x28000000},
+ {0xcc0, 0x00000000}, {0xcc4, 0x00000000},
+ {0xcc8, 0x00000000}, {0xccc, 0x00000000},
+ {0xcd0, 0x00000000}, {0xcd4, 0x00000000},
+ {0xcd8, 0x64b22427}, {0xcdc, 0x00766932},
+ {0xce0, 0x00222222}, {0xce4, 0x00000000},
+ {0xce8, 0x37644302}, {0xcec, 0x2f97d40c},
+ {0xd00, 0x00000740}, {0xd04, 0x40020401},
+ {0xd08, 0x0000907f}, {0xd0c, 0x20010201},
+ {0xd10, 0xa0633333}, {0xd14, 0x3333bc53},
+ {0xd18, 0x7a8f5b6f}, {0xd2c, 0xcc979975},
+ {0xd30, 0x00000000}, {0xd34, 0x80608000},
+ {0xd38, 0x00000000}, {0xd3c, 0x00127353},
+ {0xd40, 0x00000000}, {0xd44, 0x00000000},
+ {0xd48, 0x00000000}, {0xd4c, 0x00000000},
+ {0xd50, 0x6437140a}, {0xd54, 0x00000000},
+ {0xd58, 0x00000282}, {0xd5c, 0x30032064},
+ {0xd60, 0x4653de68}, {0xd64, 0x04518a3c},
+ {0xd68, 0x00002101}, {0xd6c, 0x2a201c16},
+ {0xd70, 0x1812362e}, {0xd74, 0x322c2220},
+ {0xd78, 0x000e3c24}, {0xe00, 0x2d2d2d2d},
+ {0xe04, 0x2d2d2d2d}, {0xe08, 0x0390272d},
+ {0xe10, 0x2d2d2d2d}, {0xe14, 0x2d2d2d2d},
+ {0xe18, 0x2d2d2d2d}, {0xe1c, 0x2d2d2d2d},
+ {0xe28, 0x00000000}, {0xe30, 0x1000dc1f},
+ {0xe34, 0x10008c1f}, {0xe38, 0x02140102},
+ {0xe3c, 0x681604c2}, {0xe40, 0x01007c00},
+ {0xe44, 0x01004800}, {0xe48, 0xfb000000},
+ {0xe4c, 0x000028d1}, {0xe50, 0x1000dc1f},
+ {0xe54, 0x10008c1f}, {0xe58, 0x02140102},
+ {0xe5c, 0x28160d05}, {0xe60, 0x00000008},
+ {0xe68, 0x001b2556}, {0xe6c, 0x00c00096},
+ {0xe70, 0x00c00096}, {0xe74, 0x01000056},
+ {0xe78, 0x01000014}, {0xe7c, 0x01000056},
+ {0xe80, 0x01000014}, {0xe84, 0x00c00096},
+ {0xe88, 0x01000056}, {0xe8c, 0x00c00096},
+ {0xed0, 0x00c00096}, {0xed4, 0x00c00096},
+ {0xed8, 0x00c00096}, {0xedc, 0x000000d6},
+ {0xee0, 0x000000d6}, {0xeec, 0x01c00016},
+ {0xf14, 0x00000003}, {0xf4c, 0x00000000},
+ {0xf00, 0x00000300},
+ {0x820, 0x01000100}, {0x800, 0x83040000},
+ {0xffff, 0xffffffff},
+};
+
static struct rtl8xxxu_reg32val rtl8192cu_phy_2t_init_table[] = {
{0x024, 0x0011800f}, {0x028, 0x00ffdb83},
{0x800, 0x80040002}, {0x804, 0x00000003},
@@ -2589,6 +2690,8 @@ static int rtl8xxxu_init_phy_bb(struct rtl8xxxu_priv *priv)
rtl8xxxu_init_phy_regs(priv, rtl8188ru_phy_1t_highpa_table);
else if (priv->tx_paths == 2)
rtl8xxxu_init_phy_regs(priv, rtl8192cu_phy_2t_init_table);
+ else if (priv->rtlchip == 0x8723b)
+ rtl8xxxu_init_phy_regs(priv, rtl8723b_phy_1t_init_table);
else
rtl8xxxu_init_phy_regs(priv, rtl8723a_phy_1t_init_table);
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 017/113] rtl8xxxu: Add rtl8723bu_radioa_1t_init_table
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (15 preceding siblings ...)
2016-02-29 22:04 ` [PATCH 016/113] rtl8xxxu: Add rtl8723b_phy_1t_init_table Jes.Sorensen
@ 2016-02-29 22:04 ` Jes.Sorensen
2016-02-29 22:04 ` [PATCH 018/113] rtl8xxxu: Add rtl8723bu_phy_init_antenna_selection() Jes.Sorensen
` (96 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:04 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
Add 8723bu 1T radio init table. The vendor driver indicates that some
registers need special treatment for TFBGA90, TFBGA80, and TFBGA79
packaging. However the vendor driver never actually checks the package
type, so just stick to default values here.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 78 ++++++++++++++++++++++++
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 6 +-
2 files changed, 82 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 88af2e8..2979a5e 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -792,6 +792,75 @@ static struct rtl8xxxu_rfregval rtl8723au_radioa_1t_init_table[] = {
{0xff, 0xffffffff}
};
+static struct rtl8xxxu_rfregval rtl8723bu_radioa_1t_init_table[] = {
+ {0x00, 0x00010000}, {0xb0, 0x000dffe0},
+ {0xfe, 0x00000000}, {0xfe, 0x00000000},
+ {0xfe, 0x00000000}, {0xb1, 0x00000018},
+ {0xfe, 0x00000000}, {0xfe, 0x00000000},
+ {0xfe, 0x00000000}, {0xb2, 0x00084c00},
+ {0xb5, 0x0000d2cc}, {0xb6, 0x000925aa},
+ {0xb7, 0x00000010}, {0xb8, 0x0000907f},
+ {0x5c, 0x00000002}, {0x7c, 0x00000002},
+ {0x7e, 0x00000005}, {0x8b, 0x0006fc00},
+ {0xb0, 0x000ff9f0}, {0x1c, 0x000739d2},
+ {0x1e, 0x00000000}, {0xdf, 0x00000780},
+ {0x50, 0x00067435},
+ /*
+ * The 8723bu vendor driver indicates that bit 8 should be set in
+ * 0x51 for package types TFBGA90, TFBGA80, and TFBGA79. However
+ * they never actually check the package type - and just default
+ * to not setting it.
+ */
+ {0x51, 0x0006b04e},
+ {0x52, 0x000007d2}, {0x53, 0x00000000},
+ {0x54, 0x00050400}, {0x55, 0x0004026e},
+ {0xdd, 0x0000004c}, {0x70, 0x00067435},
+ /*
+ * 0x71 has same package type condition as for register 0x51
+ */
+ {0x71, 0x0006b04e},
+ {0x72, 0x000007d2}, {0x73, 0x00000000},
+ {0x74, 0x00050400}, {0x75, 0x0004026e},
+ {0xef, 0x00000100}, {0x34, 0x0000add7},
+ {0x35, 0x00005c00}, {0x34, 0x00009dd4},
+ {0x35, 0x00005000}, {0x34, 0x00008dd1},
+ {0x35, 0x00004400}, {0x34, 0x00007dce},
+ {0x35, 0x00003800}, {0x34, 0x00006cd1},
+ {0x35, 0x00004400}, {0x34, 0x00005cce},
+ {0x35, 0x00003800}, {0x34, 0x000048ce},
+ {0x35, 0x00004400}, {0x34, 0x000034ce},
+ {0x35, 0x00003800}, {0x34, 0x00002451},
+ {0x35, 0x00004400}, {0x34, 0x0000144e},
+ {0x35, 0x00003800}, {0x34, 0x00000051},
+ {0x35, 0x00004400}, {0xef, 0x00000000},
+ {0xef, 0x00000100}, {0xed, 0x00000010},
+ {0x44, 0x0000add7}, {0x44, 0x00009dd4},
+ {0x44, 0x00008dd1}, {0x44, 0x00007dce},
+ {0x44, 0x00006cc1}, {0x44, 0x00005cce},
+ {0x44, 0x000044d1}, {0x44, 0x000034ce},
+ {0x44, 0x00002451}, {0x44, 0x0000144e},
+ {0x44, 0x00000051}, {0xef, 0x00000000},
+ {0xed, 0x00000000}, {0x7f, 0x00020080},
+ {0xef, 0x00002000}, {0x3b, 0x000380ef},
+ {0x3b, 0x000302fe}, {0x3b, 0x00028ce6},
+ {0x3b, 0x000200bc}, {0x3b, 0x000188a5},
+ {0x3b, 0x00010fbc}, {0x3b, 0x00008f71},
+ {0x3b, 0x00000900}, {0xef, 0x00000000},
+ {0xed, 0x00000001}, {0x40, 0x000380ef},
+ {0x40, 0x000302fe}, {0x40, 0x00028ce6},
+ {0x40, 0x000200bc}, {0x40, 0x000188a5},
+ {0x40, 0x00010fbc}, {0x40, 0x00008f71},
+ {0x40, 0x00000900}, {0xed, 0x00000000},
+ {0x82, 0x00080000}, {0x83, 0x00008000},
+ {0x84, 0x00048d80}, {0x85, 0x00068000},
+ {0xa2, 0x00080000}, {0xa3, 0x00008000},
+ {0xa4, 0x00048d80}, {0xa5, 0x00068000},
+ {0xed, 0x00000002}, {0xef, 0x00000002},
+ {0x56, 0x00000032}, {0x76, 0x00000032},
+ {0x01, 0x00000780},
+ {0xff, 0xffffffff}
+};
+
static struct rtl8xxxu_rfregval rtl8192cu_radioa_2t_init_table[] = {
{0x00, 0x00030159}, {0x01, 0x00031284},
{0x02, 0x00098000}, {0x03, 0x00018c63},
@@ -1270,6 +1339,11 @@ static u32 rtl8xxxu_read_rfreg(struct rtl8xxxu_priv *priv,
return retval;
}
+/*
+ * The RTL8723BU driver indicates that registers 0xb2 and 0xb6 can
+ * have write issues in high temperature conditions. We may have to
+ * retry writing them.
+ */
static int rtl8xxxu_write_rfreg(struct rtl8xxxu_priv *priv,
enum rtl8xxxu_rfpath path, u8 reg, u32 data)
{
@@ -4562,6 +4636,10 @@ static int rtl8xxxu_init_device(struct ieee80211_hw *hw)
rftable = rtl8723au_radioa_1t_init_table;
ret = rtl8xxxu_init_phy_rf(priv, rftable, RF_A);
break;
+ case 0x8723b:
+ rftable = rtl8723bu_radioa_1t_init_table;
+ ret = rtl8xxxu_init_phy_rf(priv, rftable, RF_A);
+ break;
case 0x8188c:
if (priv->hi_pa)
rftable = rtl8188ru_radioa_1t_highpa_table;
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
index 2055048..326fda5 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
@@ -537,8 +537,10 @@ struct rtl8723bu_efuse {
u8 res9[2];
u8 vendor_name[0x07];
u8 res10[2];
- u8 device_name[0x14]; /* 0xe8 */
- u8 res11[0xd4];
+ u8 device_name[0x14];
+ u8 res11[0xcf];
+ u8 package_type; /* 0x1fb */
+ u8 res12[0x4];
};
struct rtl8192eu_efuse {
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 018/113] rtl8xxxu: Add rtl8723bu_phy_init_antenna_selection()
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (16 preceding siblings ...)
2016-02-29 22:04 ` [PATCH 017/113] rtl8xxxu: Add rtl8723bu_radioa_1t_init_table Jes.Sorensen
@ 2016-02-29 22:04 ` Jes.Sorensen
2016-02-29 22:04 ` [PATCH 019/113] rtl8xxxu: Add rtl8723b_mac_init_table Jes.Sorensen
` (95 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:04 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
So far this is just for 8723BU. It includes writing to a number of
registers I have seen no description for so far.
0x0064
0x0930
0x0944
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 36 ++++++++++++++++++++++++
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 1 +
2 files changed, 37 insertions(+)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 2979a5e..13d3b5e 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -2670,6 +2670,38 @@ static void rtl8xxxu_firmware_self_reset(struct rtl8xxxu_priv *priv)
}
}
+static void rtl8723bu_phy_init_antenna_selection(struct rtl8xxxu_priv *priv)
+{
+ u32 val32;
+
+ val32 = rtl8xxxu_read32(priv, 0x64);
+ val32 &= ~(BIT(20) | BIT(24));
+ rtl8xxxu_write32(priv, 0x64, val32);
+
+ val32 = rtl8xxxu_read32(priv, REG_GPIO_MUXCFG);
+ val32 &= ~BIT(4);
+ val32 |= BIT(3);
+ rtl8xxxu_write32(priv, REG_GPIO_MUXCFG, val32);
+
+ val32 = rtl8xxxu_read32(priv, REG_LEDCFG0);
+ val32 &= ~BIT(23);
+ val32 |= BIT(24);
+ rtl8xxxu_write32(priv, REG_LEDCFG0, val32);
+
+ val32 = rtl8xxxu_read32(priv, 0x0944);
+ val32 |= (BIT(0) | BIT(1));
+ rtl8xxxu_write32(priv, 0x0944, val32);
+
+ val32 = rtl8xxxu_read32(priv, 0x0930);
+ val32 &= 0xffffff00;
+ val32 |= 0x77;
+ rtl8xxxu_write32(priv, 0x0930, val32);
+
+ val32 = rtl8xxxu_read32(priv, REG_PWR_DATA);
+ val32 |= BIT(11);
+ rtl8xxxu_write32(priv, REG_PWR_DATA, val32);
+}
+
static int
rtl8xxxu_init_mac(struct rtl8xxxu_priv *priv, struct rtl8xxxu_reg8val *array)
{
@@ -4621,6 +4653,9 @@ static int rtl8xxxu_init_device(struct ieee80211_hw *hw)
rtl8xxxu_write32(priv, REG_HIMR1, 0x00);
}
+ if (priv->fops->phy_init_antenna_selection)
+ priv->fops->phy_init_antenna_selection(priv);
+
ret = rtl8xxxu_init_mac(priv, rtl8723a_mac_init_table);
dev_dbg(dev, "%s: init_mac %i\n", __func__, ret);
if (ret)
@@ -6380,6 +6415,7 @@ static struct rtl8xxxu_fileops rtl8723bu_fops = {
.load_firmware = rtl8723bu_load_firmware,
.power_on = rtl8723au_power_on,
.llt_init = rtl8xxxu_auto_llt_table,
+ .phy_init_antenna_selection = rtl8723bu_phy_init_antenna_selection,
.writeN_block_size = 1024,
};
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
index 326fda5..43300bd 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
@@ -764,5 +764,6 @@ struct rtl8xxxu_fileops {
int (*load_firmware) (struct rtl8xxxu_priv *priv);
int (*power_on) (struct rtl8xxxu_priv *priv);
int (*llt_init) (struct rtl8xxxu_priv *priv, u8 last_tx_page);
+ void (*phy_init_antenna_selection) (struct rtl8xxxu_priv *priv);
int writeN_block_size;
};
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 019/113] rtl8xxxu: Add rtl8723b_mac_init_table
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (17 preceding siblings ...)
2016-02-29 22:04 ` [PATCH 018/113] rtl8xxxu: Add rtl8723bu_phy_init_antenna_selection() Jes.Sorensen
@ 2016-02-29 22:04 ` Jes.Sorensen
2016-02-29 22:04 ` [PATCH 020/113] rtl8xxxu: Add 8723by AGC table Jes.Sorensen
` (94 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:04 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
Newer chips seem to have some different mac registers, requiring
a different init table.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 37 +++++++++++++++++++++++-
1 file changed, 36 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 13d3b5e..8a6947f 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -153,6 +153,37 @@ static struct rtl8xxxu_reg8val rtl8723a_mac_init_table[] = {
{0x70a, 0x65}, {0x70b, 0x87}, {0xffff, 0xff},
};
+static struct rtl8xxxu_reg8val rtl8723b_mac_init_table[] = {
+ {0x02f, 0x30}, {0x035, 0x00}, {0x039, 0x08}, {0x04e, 0xe0},
+ {0x064, 0x00}, {0x067, 0x20}, {0x428, 0x0a}, {0x429, 0x10},
+ {0x430, 0x00}, {0x431, 0x00},
+ {0x432, 0x00}, {0x433, 0x01}, {0x434, 0x04}, {0x435, 0x05},
+ {0x436, 0x07}, {0x437, 0x08}, {0x43c, 0x04}, {0x43d, 0x05},
+ {0x43e, 0x07}, {0x43f, 0x08}, {0x440, 0x5d}, {0x441, 0x01},
+ {0x442, 0x00}, {0x444, 0x10}, {0x445, 0x00}, {0x446, 0x00},
+ {0x447, 0x00}, {0x448, 0x00}, {0x449, 0xf0}, {0x44a, 0x0f},
+ {0x44b, 0x3e}, {0x44c, 0x10}, {0x44d, 0x00}, {0x44e, 0x00},
+ {0x44f, 0x00}, {0x450, 0x00}, {0x451, 0xf0}, {0x452, 0x0f},
+ {0x453, 0x00}, {0x456, 0x5e}, {0x460, 0x66}, {0x461, 0x66},
+ {0x4c8, 0xff}, {0x4c9, 0x08}, {0x4cc, 0xff},
+ {0x4cd, 0xff}, {0x4ce, 0x01}, {0x500, 0x26}, {0x501, 0xa2},
+ {0x502, 0x2f}, {0x503, 0x00}, {0x504, 0x28}, {0x505, 0xa3},
+ {0x506, 0x5e}, {0x507, 0x00}, {0x508, 0x2b}, {0x509, 0xa4},
+ {0x50a, 0x5e}, {0x50b, 0x00}, {0x50c, 0x4f}, {0x50d, 0xa4},
+ {0x50e, 0x00}, {0x50f, 0x00}, {0x512, 0x1c}, {0x514, 0x0a},
+ {0x516, 0x0a}, {0x525, 0x4f},
+ {0x550, 0x10}, {0x551, 0x10}, {0x559, 0x02}, {0x55c, 0x50},
+ {0x55d, 0xff}, {0x605, 0x30}, {0x608, 0x0e}, {0x609, 0x2a},
+ {0x620, 0xff}, {0x621, 0xff}, {0x622, 0xff}, {0x623, 0xff},
+ {0x624, 0xff}, {0x625, 0xff}, {0x626, 0xff}, {0x627, 0xff},
+ {0x638, 0x50}, {0x63c, 0x0a}, {0x63d, 0x0a}, {0x63e, 0x0e},
+ {0x63f, 0x0e}, {0x640, 0x40}, {0x642, 0x40}, {0x643, 0x00},
+ {0x652, 0xc8}, {0x66e, 0x05}, {0x700, 0x21}, {0x701, 0x43},
+ {0x702, 0x65}, {0x703, 0x87}, {0x708, 0x21}, {0x709, 0x43},
+ {0x70a, 0x65}, {0x70b, 0x87}, {0x765, 0x18}, {0x76e, 0x04},
+ {0xffff, 0xff},
+};
+
static struct rtl8xxxu_reg32val rtl8723a_phy_1t_init_table[] = {
{0x800, 0x80040000}, {0x804, 0x00000003},
{0x808, 0x0000fc00}, {0x80c, 0x0000000a},
@@ -4656,7 +4687,11 @@ static int rtl8xxxu_init_device(struct ieee80211_hw *hw)
if (priv->fops->phy_init_antenna_selection)
priv->fops->phy_init_antenna_selection(priv);
- ret = rtl8xxxu_init_mac(priv, rtl8723a_mac_init_table);
+ if (priv->rtlchip == 0x8723b)
+ ret = rtl8xxxu_init_mac(priv, rtl8723b_mac_init_table);
+ else
+ ret = rtl8xxxu_init_mac(priv, rtl8723a_mac_init_table);
+
dev_dbg(dev, "%s: init_mac %i\n", __func__, ret);
if (ret)
goto exit;
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 020/113] rtl8xxxu: Add 8723by AGC table
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (18 preceding siblings ...)
2016-02-29 22:04 ` [PATCH 019/113] rtl8xxxu: Add rtl8723b_mac_init_table Jes.Sorensen
@ 2016-02-29 22:04 ` Jes.Sorensen
2016-02-29 22:04 ` [PATCH 021/113] rtl8xxxu: Handle 32 bit mailbox extension regs found on 8723bu/8192eu/8812 Jes.Sorensen
` (93 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:04 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
The different RF module seems to require a different AGC table as well
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 75 +++++++++++++++++++++++-
1 file changed, 74 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 8a6947f..3c5b42c 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -748,6 +748,77 @@ static struct rtl8xxxu_reg32val rtl8xxx_agc_highpa_table[] = {
{0xffff, 0xffffffff}
};
+static struct rtl8xxxu_reg32val rtl8xxx_agc_8723bu_table[] = {
+ {0xc78, 0xfd000001}, {0xc78, 0xfc010001},
+ {0xc78, 0xfb020001}, {0xc78, 0xfa030001},
+ {0xc78, 0xf9040001}, {0xc78, 0xf8050001},
+ {0xc78, 0xf7060001}, {0xc78, 0xf6070001},
+ {0xc78, 0xf5080001}, {0xc78, 0xf4090001},
+ {0xc78, 0xf30a0001}, {0xc78, 0xf20b0001},
+ {0xc78, 0xf10c0001}, {0xc78, 0xf00d0001},
+ {0xc78, 0xef0e0001}, {0xc78, 0xee0f0001},
+ {0xc78, 0xed100001}, {0xc78, 0xec110001},
+ {0xc78, 0xeb120001}, {0xc78, 0xea130001},
+ {0xc78, 0xe9140001}, {0xc78, 0xe8150001},
+ {0xc78, 0xe7160001}, {0xc78, 0xe6170001},
+ {0xc78, 0xe5180001}, {0xc78, 0xe4190001},
+ {0xc78, 0xe31a0001}, {0xc78, 0xa51b0001},
+ {0xc78, 0xa41c0001}, {0xc78, 0xa31d0001},
+ {0xc78, 0x671e0001}, {0xc78, 0x661f0001},
+ {0xc78, 0x65200001}, {0xc78, 0x64210001},
+ {0xc78, 0x63220001}, {0xc78, 0x4a230001},
+ {0xc78, 0x49240001}, {0xc78, 0x48250001},
+ {0xc78, 0x47260001}, {0xc78, 0x46270001},
+ {0xc78, 0x45280001}, {0xc78, 0x44290001},
+ {0xc78, 0x432a0001}, {0xc78, 0x422b0001},
+ {0xc78, 0x292c0001}, {0xc78, 0x282d0001},
+ {0xc78, 0x272e0001}, {0xc78, 0x262f0001},
+ {0xc78, 0x0a300001}, {0xc78, 0x09310001},
+ {0xc78, 0x08320001}, {0xc78, 0x07330001},
+ {0xc78, 0x06340001}, {0xc78, 0x05350001},
+ {0xc78, 0x04360001}, {0xc78, 0x03370001},
+ {0xc78, 0x02380001}, {0xc78, 0x01390001},
+ {0xc78, 0x013a0001}, {0xc78, 0x013b0001},
+ {0xc78, 0x013c0001}, {0xc78, 0x013d0001},
+ {0xc78, 0x013e0001}, {0xc78, 0x013f0001},
+ {0xc78, 0xfc400001}, {0xc78, 0xfb410001},
+ {0xc78, 0xfa420001}, {0xc78, 0xf9430001},
+ {0xc78, 0xf8440001}, {0xc78, 0xf7450001},
+ {0xc78, 0xf6460001}, {0xc78, 0xf5470001},
+ {0xc78, 0xf4480001}, {0xc78, 0xf3490001},
+ {0xc78, 0xf24a0001}, {0xc78, 0xf14b0001},
+ {0xc78, 0xf04c0001}, {0xc78, 0xef4d0001},
+ {0xc78, 0xee4e0001}, {0xc78, 0xed4f0001},
+ {0xc78, 0xec500001}, {0xc78, 0xeb510001},
+ {0xc78, 0xea520001}, {0xc78, 0xe9530001},
+ {0xc78, 0xe8540001}, {0xc78, 0xe7550001},
+ {0xc78, 0xe6560001}, {0xc78, 0xe5570001},
+ {0xc78, 0xe4580001}, {0xc78, 0xe3590001},
+ {0xc78, 0xa65a0001}, {0xc78, 0xa55b0001},
+ {0xc78, 0xa45c0001}, {0xc78, 0xa35d0001},
+ {0xc78, 0x675e0001}, {0xc78, 0x665f0001},
+ {0xc78, 0x65600001}, {0xc78, 0x64610001},
+ {0xc78, 0x63620001}, {0xc78, 0x62630001},
+ {0xc78, 0x61640001}, {0xc78, 0x48650001},
+ {0xc78, 0x47660001}, {0xc78, 0x46670001},
+ {0xc78, 0x45680001}, {0xc78, 0x44690001},
+ {0xc78, 0x436a0001}, {0xc78, 0x426b0001},
+ {0xc78, 0x286c0001}, {0xc78, 0x276d0001},
+ {0xc78, 0x266e0001}, {0xc78, 0x256f0001},
+ {0xc78, 0x24700001}, {0xc78, 0x09710001},
+ {0xc78, 0x08720001}, {0xc78, 0x07730001},
+ {0xc78, 0x06740001}, {0xc78, 0x05750001},
+ {0xc78, 0x04760001}, {0xc78, 0x03770001},
+ {0xc78, 0x02780001}, {0xc78, 0x01790001},
+ {0xc78, 0x017a0001}, {0xc78, 0x017b0001},
+ {0xc78, 0x017c0001}, {0xc78, 0x017d0001},
+ {0xc78, 0x017e0001}, {0xc78, 0x017f0001},
+ {0xc50, 0x69553422},
+ {0xc50, 0x69553420},
+ {0x824, 0x00390204},
+ {0xffff, 0xffffffff}
+};
+
static struct rtl8xxxu_rfregval rtl8723au_radioa_1t_init_table[] = {
{0x00, 0x00030159}, {0x01, 0x00031284},
{0x02, 0x00098000}, {0x03, 0x00039c63},
@@ -2895,7 +2966,9 @@ static int rtl8xxxu_init_phy_bb(struct rtl8xxxu_priv *priv)
rtl8xxxu_write32(priv, REG_TX_TO_TX, val32);
}
- if (priv->hi_pa)
+ if (priv->rtlchip == 0x8723b)
+ rtl8xxxu_init_phy_regs(priv, rtl8xxx_agc_8723bu_table);
+ else if (priv->hi_pa)
rtl8xxxu_init_phy_regs(priv, rtl8xxx_agc_highpa_table);
else
rtl8xxxu_init_phy_regs(priv, rtl8xxx_agc_standard_table);
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 021/113] rtl8xxxu: Handle 32 bit mailbox extension regs found on 8723bu/8192eu/8812
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (19 preceding siblings ...)
2016-02-29 22:04 ` [PATCH 020/113] rtl8xxxu: Add 8723by AGC table Jes.Sorensen
@ 2016-02-29 22:04 ` Jes.Sorensen
2016-02-29 22:04 ` [PATCH 022/113] rtl8xxxu: Add some missing register definitions for 8723bu Jes.Sorensen
` (92 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:04 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
Gen1 chips use a 16 bit mailbox extension register, for upto 48 bit
mailbox commands. The newer generation chips use a 32 bit mailbox
extension register instead, for upto 64 bit mailbox commands.
Handle writing the larger mailboxes.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 29 +++++++++++++++++++-----
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 8 ++++++-
2 files changed, 30 insertions(+), 7 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 3c5b42c..6976cec 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -1482,7 +1482,8 @@ static int rtl8723a_h2c_cmd(struct rtl8xxxu_priv *priv, struct h2c_cmd *h2c)
mbox_nr = priv->next_mbox;
mbox_reg = REG_HMBOX_0 + (mbox_nr * 4);
- mbox_ext_reg = REG_HMBOX_EXT_0 + (mbox_nr * 2);
+ mbox_ext_reg = priv->fops->mbox_ext_reg +
+ (mbox_nr * priv->fops->mbox_ext_width);
/*
* MBOX ready?
@@ -1504,11 +1505,19 @@ static int rtl8723a_h2c_cmd(struct rtl8xxxu_priv *priv, struct h2c_cmd *h2c)
* Need to swap as it's being swapped again by rtl8xxxu_write16/32()
*/
if (h2c->cmd.cmd & H2C_EXT) {
- rtl8xxxu_write16(priv, mbox_ext_reg,
- le16_to_cpu(h2c->raw.ext));
- if (rtl8xxxu_debug & RTL8XXXU_DEBUG_H2C)
- dev_info(dev, "H2C_EXT %04x\n",
- le16_to_cpu(h2c->raw.ext));
+ if (priv->fops->mbox_ext_width == 4) {
+ rtl8xxxu_write32(priv, mbox_ext_reg,
+ le32_to_cpu(h2c->raw_wide.ext));
+ if (rtl8xxxu_debug & RTL8XXXU_DEBUG_H2C)
+ dev_info(dev, "H2C_EXT %08x\n",
+ le32_to_cpu(h2c->raw_wide.ext));
+ } else {
+ rtl8xxxu_write16(priv, mbox_ext_reg,
+ le16_to_cpu(h2c->raw.ext));
+ if (rtl8xxxu_debug & RTL8XXXU_DEBUG_H2C)
+ dev_info(dev, "H2C_EXT %04x\n",
+ le16_to_cpu(h2c->raw.ext));
+ }
}
rtl8xxxu_write32(priv, mbox_reg, le32_to_cpu(h2c->raw.data));
if (rtl8xxxu_debug & RTL8XXXU_DEBUG_H2C)
@@ -6516,6 +6525,8 @@ static struct rtl8xxxu_fileops rtl8723au_fops = {
.power_on = rtl8723au_power_on,
.llt_init = rtl8xxxu_init_llt_table,
.writeN_block_size = 1024,
+ .mbox_ext_reg = REG_HMBOX_EXT_0,
+ .mbox_ext_width = 2,
};
static struct rtl8xxxu_fileops rtl8723bu_fops = {
@@ -6525,6 +6536,8 @@ static struct rtl8xxxu_fileops rtl8723bu_fops = {
.llt_init = rtl8xxxu_auto_llt_table,
.phy_init_antenna_selection = rtl8723bu_phy_init_antenna_selection,
.writeN_block_size = 1024,
+ .mbox_ext_reg = REG_HMBOX_EXT0_8723B,
+ .mbox_ext_width = 4,
};
#ifdef CONFIG_RTL8XXXU_UNTESTED
@@ -6535,6 +6548,8 @@ static struct rtl8xxxu_fileops rtl8192cu_fops = {
.power_on = rtl8192cu_power_on,
.llt_init = rtl8xxxu_init_llt_table,
.writeN_block_size = 128,
+ .mbox_ext_reg = REG_HMBOX_EXT_0,
+ .mbox_ext_width = 2,
};
#endif
@@ -6545,6 +6560,8 @@ static struct rtl8xxxu_fileops rtl8192eu_fops = {
.power_on = rtl8192eu_power_on,
.llt_init = rtl8xxxu_auto_llt_table,
.writeN_block_size = 128,
+ .mbox_ext_reg = REG_HMBOX_EXT0_8723B,
+ .mbox_ext_width = 4,
};
static struct usb_device_id dev_table[] = {
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
index 43300bd..7aed304 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
@@ -628,13 +628,17 @@ struct h2c_cmd {
union {
struct {
u8 cmd;
- u8 data[5];
+ u8 data[7];
} __packed cmd;
struct {
__le32 data;
__le16 ext;
} __packed raw;
struct {
+ __le32 data;
+ __le32 ext;
+ } __packed raw_wide;
+ struct {
u8 cmd;
u8 data;
u8 pad[4];
@@ -766,4 +770,6 @@ struct rtl8xxxu_fileops {
int (*llt_init) (struct rtl8xxxu_priv *priv, u8 last_tx_page);
void (*phy_init_antenna_selection) (struct rtl8xxxu_priv *priv);
int writeN_block_size;
+ u16 mbox_ext_reg;
+ char mbox_ext_width;
};
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 022/113] rtl8xxxu: Add some missing register definitions for 8723bu
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (20 preceding siblings ...)
2016-02-29 22:04 ` [PATCH 021/113] rtl8xxxu: Handle 32 bit mailbox extension regs found on 8723bu/8192eu/8812 Jes.Sorensen
@ 2016-02-29 22:04 ` Jes.Sorensen
2016-02-29 22:04 ` [PATCH 023/113] rtl8xxxu: Group USB fixups together for all chips Jes.Sorensen
` (91 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:04 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
This introduces additional register definitions for newer generation
chips.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
index 3cbb549..f1375b8 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
@@ -155,6 +155,8 @@
/* RTL8723 WIFI/BT/GPS Multi-Function GPIO Select. */
#define REG_GPIO_IO_SEL_2 0x0062
+/* RTL8723B */
+#define REG_PAD_CTRL1 0x0064
/* RTL8723 only WIFI/BT/GPS Multi-Function control source. */
#define REG_MULTI_FUNC_CTRL 0x0068
@@ -196,9 +198,11 @@
#define REG_HMBOX_EXT_1 0x008a
#define REG_HMBOX_EXT_2 0x008c
#define REG_HMBOX_EXT_3 0x008e
-/* Interrupt registers for 8192e/8812 */
+/* Interrupt registers for 8192e/8723bu/8812 */
#define REG_HIMR0 0x00b0
+#define REG_HISR0 0x00b4
#define REG_HIMR1 0x00b8
+#define REG_HISR1 0x00bc
/* Host suspend counter on FPGA platform */
#define REG_HOST_SUSP_CNT 0x00bc
@@ -337,6 +341,8 @@
#define REG_MBIST_DONE 0x0178
#define REG_MBIST_FAIL 0x017c
#define REG_C2HEVT_MSG_NORMAL 0x01a0
+/* 8192EU/8723BU/8812 */
+#define REG_C2HEVT_CMD_ID_8723B 0x01ae
#define REG_C2HEVT_CLEAR 0x01af
#define REG_C2HEVT_MSG_TEST 0x01b8
#define REG_MCUTST_1 0x01c0
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 023/113] rtl8xxxu: Group USB fixups together for all chips
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (21 preceding siblings ...)
2016-02-29 22:04 ` [PATCH 022/113] rtl8xxxu: Add some missing register definitions for 8723bu Jes.Sorensen
@ 2016-02-29 22:04 ` Jes.Sorensen
2016-02-29 22:04 ` [PATCH 024/113] rtl8xxxu: Add definitions for new generation h2c commands Jes.Sorensen
` (90 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:04 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
In addition do not apply fixups for 8188/8191/8192 A-cut UMC parts.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 57 +++++++++++++-----------
1 file changed, 32 insertions(+), 25 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 6976cec..2ff7430 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -4757,11 +4757,42 @@ static int rtl8xxxu_init_device(struct ieee80211_hw *hw)
}
}
- if (priv->rtlchip == 0x8192e) {
+ /* Fix USB interface interference issue */
+ if (priv->rtlchip == 0x8723a) {
+ rtl8xxxu_write8(priv, 0xfe40, 0xe0);
+ rtl8xxxu_write8(priv, 0xfe41, 0x8d);
+ rtl8xxxu_write8(priv, 0xfe42, 0x80);
+ rtl8xxxu_write32(priv, REG_TXDMA_OFFSET_CHK, 0xfd0320);
+ } else {
val32 = rtl8xxxu_read32(priv, REG_TXDMA_OFFSET_CHK);
val32 |= TXDMA_OFFSET_DROP_DATA_EN;
rtl8xxxu_write32(priv, REG_TXDMA_OFFSET_CHK, val32);
+ }
+ /* Solve too many protocol error on USB bus */
+ /* Can't do this for 8188/8192 UMC A cut parts */
+ if (priv->rtlchip == 0x8723a ||
+ ((priv->rtlchip == 0x8192c || priv->rtlchip == 0x8191c ||
+ priv->rtlchip == 0x8188c) &&
+ (priv->chip_cut || !priv->vendor_umc))) {
+ rtl8xxxu_write8(priv, 0xfe40, 0xe6);
+ rtl8xxxu_write8(priv, 0xfe41, 0x94);
+ rtl8xxxu_write8(priv, 0xfe42, 0x80);
+
+ rtl8xxxu_write8(priv, 0xfe40, 0xe0);
+ rtl8xxxu_write8(priv, 0xfe41, 0x19);
+ rtl8xxxu_write8(priv, 0xfe42, 0x80);
+
+ rtl8xxxu_write8(priv, 0xfe40, 0xe5);
+ rtl8xxxu_write8(priv, 0xfe41, 0x91);
+ rtl8xxxu_write8(priv, 0xfe42, 0x80);
+
+ rtl8xxxu_write8(priv, 0xfe40, 0xe2);
+ rtl8xxxu_write8(priv, 0xfe41, 0x81);
+ rtl8xxxu_write8(priv, 0xfe42, 0x80);
+ }
+
+ if (priv->rtlchip == 0x8192e || priv->rtlchip == 0x8723b) {
rtl8xxxu_write32(priv, REG_HIMR0, 0x00);
rtl8xxxu_write32(priv, REG_HIMR1, 0x00);
}
@@ -4968,30 +4999,6 @@ static int rtl8xxxu_init_device(struct ieee80211_hw *hw)
rtl8723a_phy_lc_calibrate(priv);
- /* fix USB interface interference issue */
- rtl8xxxu_write8(priv, 0xfe40, 0xe0);
- rtl8xxxu_write8(priv, 0xfe41, 0x8d);
- rtl8xxxu_write8(priv, 0xfe42, 0x80);
- rtl8xxxu_write32(priv, REG_TXDMA_OFFSET_CHK, 0xfd0320);
-
- /* Solve too many protocol error on USB bus */
- /* Can't do this for 8188/8192 UMC A cut parts */
- rtl8xxxu_write8(priv, 0xfe40, 0xe6);
- rtl8xxxu_write8(priv, 0xfe41, 0x94);
- rtl8xxxu_write8(priv, 0xfe42, 0x80);
-
- rtl8xxxu_write8(priv, 0xfe40, 0xe0);
- rtl8xxxu_write8(priv, 0xfe41, 0x19);
- rtl8xxxu_write8(priv, 0xfe42, 0x80);
-
- rtl8xxxu_write8(priv, 0xfe40, 0xe5);
- rtl8xxxu_write8(priv, 0xfe41, 0x91);
- rtl8xxxu_write8(priv, 0xfe42, 0x80);
-
- rtl8xxxu_write8(priv, 0xfe40, 0xe2);
- rtl8xxxu_write8(priv, 0xfe41, 0x81);
- rtl8xxxu_write8(priv, 0xfe42, 0x80);
-
/* Init BT hw config. */
rtl8xxxu_init_bt(priv);
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 024/113] rtl8xxxu: Add definitions for new generation h2c commands
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (22 preceding siblings ...)
2016-02-29 22:04 ` [PATCH 023/113] rtl8xxxu: Group USB fixups together for all chips Jes.Sorensen
@ 2016-02-29 22:04 ` Jes.Sorensen
2016-02-29 22:04 ` [PATCH 025/113] rtl8xxxu: Don't check for illegal offset when reading from efuse Jes.Sorensen
` (89 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:04 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
The larger mailboxes also use a different set of mailbox commands.
This provides a list of the 64 bit commands.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 87 ++++++++++++++++++++++--
1 file changed, 83 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
index 7aed304..198b1d8 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
@@ -617,12 +617,91 @@ struct rtl8xxxu_rfregs {
#define H2C_MAX_MBOX 4
#define H2C_EXT BIT(7)
-#define H2C_SET_POWER_MODE 1
-#define H2C_JOIN_BSS_REPORT 2
#define H2C_JOIN_BSS_DISCONNECT 0
#define H2C_JOIN_BSS_CONNECT 1
-#define H2C_SET_RSSI 5
-#define H2C_SET_RATE_MASK (6 | H2C_EXT)
+
+/*
+ * H2C (firmware) commands differ between the older generation chips
+ * 8188[cr]u, 819[12]cu, and 8723au, and the more recent chips 8723bu,
+ * 8192[de]u, 8192eu, and 8812.
+ */
+enum h2c_cmd_8723a {
+ H2C_SET_POWER_MODE = 1,
+ H2C_JOIN_BSS_REPORT = 2,
+ H2C_SET_RSSI = 5,
+ H2C_SET_RATE_MASK = (6 | H2C_EXT),
+};
+
+enum h2c_cmd_8723b {
+ /*
+ * Common Class: 000
+ */
+ H2C_8723B_RSVD_PAGE = 0x00,
+ H2C_8723B_MEDIA_STATUS_RPT = 0x01,
+ H2C_8723B_SCAN_ENABLE = 0x02,
+ H2C_8723B_KEEP_ALIVE = 0x03,
+ H2C_8723B_DISCON_DECISION = 0x04,
+ H2C_8723B_PSD_OFFLOAD = 0x05,
+ H2C_8723B_AP_OFFLOAD = 0x08,
+ H2C_8723B_BCN_RSVDPAGE = 0x09,
+ H2C_8723B_PROBERSP_RSVDPAGE = 0x0A,
+ H2C_8723B_FCS_RSVDPAGE = 0x10,
+ H2C_8723B_FCS_INFO = 0x11,
+ H2C_8723B_AP_WOW_GPIO_CTRL = 0x13,
+
+ /*
+ * PoweSave Class: 001
+ */
+ H2C_8723B_SET_PWR_MODE = 0x20,
+ H2C_8723B_PS_TUNING_PARA = 0x21,
+ H2C_8723B_PS_TUNING_PARA2 = 0x22,
+ H2C_8723B_P2P_LPS_PARAM = 0x23,
+ H2C_8723B_P2P_PS_OFFLOAD = 0x24,
+ H2C_8723B_PS_SCAN_ENABLE = 0x25,
+ H2C_8723B_SAP_PS_ = 0x26,
+ H2C_8723B_INACTIVE_PS_ = 0x27,
+ H2C_8723B_FWLPS_IN_IPS_ = 0x28,
+
+ /*
+ * Dynamic Mechanism Class: 010
+ */
+ H2C_8723B_MACID_CFG = 0x40,
+ H2C_8723B_TXBF = 0x41,
+ H2C_8723B_RSSI_SETTING = 0x42,
+ H2C_8723B_AP_REQ_TXRPT = 0x43,
+ H2C_8723B_INIT_RATE_COLLECT = 0x44,
+
+ /*
+ * BT Class: 011
+ */
+ H2C_8723B_B_TYPE_TDMA = 0x60,
+ H2C_8723B_BT_INFO = 0x61,
+ H2C_8723B_FORCE_BT_TXPWR = 0x62,
+ H2C_8723B_BT_IGNORE_WLANACT = 0x63,
+ H2C_8723B_DAC_SWING_VALUE = 0x64,
+ H2C_8723B_ANT_SEL_RSV = 0x65,
+ H2C_8723B_WL_OPMODE = 0x66,
+ H2C_8723B_BT_MP_OPER = 0x67,
+ H2C_8723B_BT_CONTROL = 0x68,
+ H2C_8723B_BT_WIFI_CTRL = 0x69,
+ H2C_8723B_BT_FW_PATCH = 0x6A,
+ H2C_8723B_BT_WLAN_CALIBRATION = 0x6D,
+
+ /*
+ * WOWLAN Class: 100
+ */
+ H2C_8723B_WOWLAN = 0x80,
+ H2C_8723B_REMOTE_WAKE_CTRL = 0x81,
+ H2C_8723B_AOAC_GLOBAL_INFO = 0x82,
+ H2C_8723B_AOAC_RSVD_PAGE = 0x83,
+ H2C_8723B_AOAC_RSVD_PAGE2 = 0x84,
+ H2C_8723B_D0_SCAN_OFFLOAD_CTRL = 0x85,
+ H2C_8723B_D0_SCAN_OFFLOAD_INFO = 0x86,
+ H2C_8723B_CHNL_SWITCH_OFFLOAD = 0x87,
+
+ H2C_8723B_RESET_TSF = 0xC0,
+};
+
struct h2c_cmd {
union {
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 025/113] rtl8xxxu: Don't check for illegal offset when reading from efuse
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (23 preceding siblings ...)
2016-02-29 22:04 ` [PATCH 024/113] rtl8xxxu: Add definitions for new generation h2c commands Jes.Sorensen
@ 2016-02-29 22:04 ` Jes.Sorensen
2016-02-29 22:04 ` [PATCH 026/113] rtl8xxxu: Skip disabled efuse words early Jes.Sorensen
` (88 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:04 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jakub Sitnicki, Jes Sorensen
From: Jakub Sitnicki <jsitnicki@gmail.com>
It is enough to check for either illegal offset or illegal map address
because map address is a value derived from an offset:
map_addr = offset * 8
EFUSE_MAP_LEN = EFUSE_MAX_SECTION_8723A * 8
Leave just the check for an illegal map address because its upper
bound (EFUSE_MAP_LEN) is used also in a couple other places.
Signed-off-by: Jakub Sitnicki <jsitnicki@gmail.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 63 +++++++++++-------------
1 file changed, 28 insertions(+), 35 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 2ff7430..eb0203c 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -2417,6 +2417,8 @@ static int rtl8xxxu_read_efuse(struct rtl8xxxu_priv *priv)
efuse_addr = 0;
while (efuse_addr < EFUSE_REAL_CONTENT_LEN_8723A) {
+ u16 map_addr;
+
ret = rtl8xxxu_read_efuse8(priv, efuse_addr++, &header);
if (ret || header == 0xff)
goto exit;
@@ -2439,45 +2441,36 @@ static int rtl8xxxu_read_efuse(struct rtl8xxxu_priv *priv)
word_mask = header & 0x0f;
}
- if (offset < EFUSE_MAX_SECTION_8723A) {
- u16 map_addr;
- /* Get word enable value from PG header */
+ /* Get word enable value from PG header */
- /* We have 8 bits to indicate validity */
- map_addr = offset * 8;
- if (map_addr >= EFUSE_MAP_LEN) {
- dev_warn(dev, "%s: Illegal map_addr (%04x), "
- "efuse corrupt!\n",
- __func__, map_addr);
- ret = -EINVAL;
- goto exit;
- }
- for (i = 0; i < EFUSE_MAX_WORD_UNIT; i++) {
- /* Check word enable condition in the section */
- if (!(word_mask & BIT(i))) {
- ret = rtl8xxxu_read_efuse8(priv,
- efuse_addr++,
- &val8);
- if (ret)
- goto exit;
- priv->efuse_wifi.raw[map_addr++] = val8;
-
- ret = rtl8xxxu_read_efuse8(priv,
- efuse_addr++,
- &val8);
- if (ret)
- goto exit;
- priv->efuse_wifi.raw[map_addr++] = val8;
- } else
- map_addr += 2;
- }
- } else {
- dev_warn(dev,
- "%s: Illegal offset (%04x), efuse corrupt!\n",
- __func__, offset);
+ /* We have 8 bits to indicate validity */
+ map_addr = offset * 8;
+ if (map_addr >= EFUSE_MAP_LEN) {
+ dev_warn(dev, "%s: Illegal map_addr (%04x), "
+ "efuse corrupt!\n",
+ __func__, map_addr);
ret = -EINVAL;
goto exit;
}
+ for (i = 0; i < EFUSE_MAX_WORD_UNIT; i++) {
+ /* Check word enable condition in the section */
+ if (!(word_mask & BIT(i))) {
+ ret = rtl8xxxu_read_efuse8(priv,
+ efuse_addr++,
+ &val8);
+ if (ret)
+ goto exit;
+ priv->efuse_wifi.raw[map_addr++] = val8;
+
+ ret = rtl8xxxu_read_efuse8(priv,
+ efuse_addr++,
+ &val8);
+ if (ret)
+ goto exit;
+ priv->efuse_wifi.raw[map_addr++] = val8;
+ } else
+ map_addr += 2;
+ }
}
exit:
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 026/113] rtl8xxxu: Skip disabled efuse words early
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (24 preceding siblings ...)
2016-02-29 22:04 ` [PATCH 025/113] rtl8xxxu: Don't check for illegal offset when reading from efuse Jes.Sorensen
@ 2016-02-29 22:04 ` Jes.Sorensen
2016-02-29 22:04 ` [PATCH 027/113] rtl8xxxu: rtl8723au: Introduce a pointer to efuse Jes.Sorensen
` (87 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:04 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jakub Sitnicki, Jes Sorensen
From: Jakub Sitnicki <jsitnicki@gmail.com>
Avoid a negative conditional and an extra level of indentation in the
bigger part of the loop body.
Signed-off-by: Jakub Sitnicki <jsitnicki@gmail.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 28 +++++++++++-------------
1 file changed, 13 insertions(+), 15 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index eb0203c..2b9664e 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -2454,22 +2454,20 @@ static int rtl8xxxu_read_efuse(struct rtl8xxxu_priv *priv)
}
for (i = 0; i < EFUSE_MAX_WORD_UNIT; i++) {
/* Check word enable condition in the section */
- if (!(word_mask & BIT(i))) {
- ret = rtl8xxxu_read_efuse8(priv,
- efuse_addr++,
- &val8);
- if (ret)
- goto exit;
- priv->efuse_wifi.raw[map_addr++] = val8;
-
- ret = rtl8xxxu_read_efuse8(priv,
- efuse_addr++,
- &val8);
- if (ret)
- goto exit;
- priv->efuse_wifi.raw[map_addr++] = val8;
- } else
+ if (word_mask & BIT(i)) {
map_addr += 2;
+ continue;
+ }
+
+ ret = rtl8xxxu_read_efuse8(priv, efuse_addr++, &val8);
+ if (ret)
+ goto exit;
+ priv->efuse_wifi.raw[map_addr++] = val8;
+
+ ret = rtl8xxxu_read_efuse8(priv, efuse_addr++, &val8);
+ if (ret)
+ goto exit;
+ priv->efuse_wifi.raw[map_addr++] = val8;
}
}
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 027/113] rtl8xxxu: rtl8723au: Introduce a pointer to efuse
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (25 preceding siblings ...)
2016-02-29 22:04 ` [PATCH 026/113] rtl8xxxu: Skip disabled efuse words early Jes.Sorensen
@ 2016-02-29 22:04 ` Jes.Sorensen
2016-02-29 22:04 ` [PATCH 028/113] rtl8xxxu: rtl8192cu: " Jes.Sorensen
` (86 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:04 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jakub Sitnicki, Jes Sorensen
From: Jakub Sitnicki <jsitnicki@gmail.com>
Signed-off-by: Jakub Sitnicki <jsitnicki@gmail.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 26 +++++++++++++-----------
1 file changed, 14 insertions(+), 12 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 2b9664e..4591330 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -2127,43 +2127,45 @@ static int rtl8xxxu_identify_chip(struct rtl8xxxu_priv *priv)
static int rtl8723au_parse_efuse(struct rtl8xxxu_priv *priv)
{
- if (priv->efuse_wifi.efuse8723.rtl_id != cpu_to_le16(0x8129))
+ struct rtl8723au_efuse *efuse = &priv->efuse_wifi.efuse8723;
+
+ if (efuse->rtl_id != cpu_to_le16(0x8129))
return -EINVAL;
- ether_addr_copy(priv->mac_addr, priv->efuse_wifi.efuse8723.mac_addr);
+ ether_addr_copy(priv->mac_addr, efuse->mac_addr);
memcpy(priv->cck_tx_power_index_A,
- priv->efuse_wifi.efuse8723.cck_tx_power_index_A,
+ efuse->cck_tx_power_index_A,
sizeof(priv->cck_tx_power_index_A));
memcpy(priv->cck_tx_power_index_B,
- priv->efuse_wifi.efuse8723.cck_tx_power_index_B,
+ efuse->cck_tx_power_index_B,
sizeof(priv->cck_tx_power_index_B));
memcpy(priv->ht40_1s_tx_power_index_A,
- priv->efuse_wifi.efuse8723.ht40_1s_tx_power_index_A,
+ efuse->ht40_1s_tx_power_index_A,
sizeof(priv->ht40_1s_tx_power_index_A));
memcpy(priv->ht40_1s_tx_power_index_B,
- priv->efuse_wifi.efuse8723.ht40_1s_tx_power_index_B,
+ efuse->ht40_1s_tx_power_index_B,
sizeof(priv->ht40_1s_tx_power_index_B));
memcpy(priv->ht20_tx_power_index_diff,
- priv->efuse_wifi.efuse8723.ht20_tx_power_index_diff,
+ efuse->ht20_tx_power_index_diff,
sizeof(priv->ht20_tx_power_index_diff));
memcpy(priv->ofdm_tx_power_index_diff,
- priv->efuse_wifi.efuse8723.ofdm_tx_power_index_diff,
+ efuse->ofdm_tx_power_index_diff,
sizeof(priv->ofdm_tx_power_index_diff));
memcpy(priv->ht40_max_power_offset,
- priv->efuse_wifi.efuse8723.ht40_max_power_offset,
+ efuse->ht40_max_power_offset,
sizeof(priv->ht40_max_power_offset));
memcpy(priv->ht20_max_power_offset,
- priv->efuse_wifi.efuse8723.ht20_max_power_offset,
+ efuse->ht20_max_power_offset,
sizeof(priv->ht20_max_power_offset));
dev_info(&priv->udev->dev, "Vendor: %.7s\n",
- priv->efuse_wifi.efuse8723.vendor_name);
+ efuse->vendor_name);
dev_info(&priv->udev->dev, "Product: %.41s\n",
- priv->efuse_wifi.efuse8723.device_name);
+ efuse->device_name);
return 0;
}
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 028/113] rtl8xxxu: rtl8192cu: Introduce a pointer to efuse
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (26 preceding siblings ...)
2016-02-29 22:04 ` [PATCH 027/113] rtl8xxxu: rtl8723au: Introduce a pointer to efuse Jes.Sorensen
@ 2016-02-29 22:04 ` Jes.Sorensen
2016-02-29 22:04 ` [PATCH 029/113] rtl8xxxu: rtl8192eu_parse_efuse(): Use a pointer to the struct rtl8192eu_efuse Jes.Sorensen
` (85 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:04 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jakub Sitnicki, Jes Sorensen
From: Jakub Sitnicki <jsitnicki@gmail.com>
Signed-off-by: Jakub Sitnicki <jsitnicki@gmail.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 29 ++++++++++++------------
1 file changed, 15 insertions(+), 14 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 4591330..2ca99d0 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -2218,50 +2218,51 @@ static int rtl8723bu_parse_efuse(struct rtl8xxxu_priv *priv)
static int rtl8192cu_parse_efuse(struct rtl8xxxu_priv *priv)
{
+ struct rtl8192cu_efuse *efuse = &priv->efuse_wifi.efuse8192;
int i;
- if (priv->efuse_wifi.efuse8192.rtl_id != cpu_to_le16(0x8129))
+ if (efuse->rtl_id != cpu_to_le16(0x8129))
return -EINVAL;
- ether_addr_copy(priv->mac_addr, priv->efuse_wifi.efuse8192.mac_addr);
+ ether_addr_copy(priv->mac_addr, efuse->mac_addr);
memcpy(priv->cck_tx_power_index_A,
- priv->efuse_wifi.efuse8192.cck_tx_power_index_A,
+ efuse->cck_tx_power_index_A,
sizeof(priv->cck_tx_power_index_A));
memcpy(priv->cck_tx_power_index_B,
- priv->efuse_wifi.efuse8192.cck_tx_power_index_B,
+ efuse->cck_tx_power_index_B,
sizeof(priv->cck_tx_power_index_B));
memcpy(priv->ht40_1s_tx_power_index_A,
- priv->efuse_wifi.efuse8192.ht40_1s_tx_power_index_A,
+ efuse->ht40_1s_tx_power_index_A,
sizeof(priv->ht40_1s_tx_power_index_A));
memcpy(priv->ht40_1s_tx_power_index_B,
- priv->efuse_wifi.efuse8192.ht40_1s_tx_power_index_B,
+ efuse->ht40_1s_tx_power_index_B,
sizeof(priv->ht40_1s_tx_power_index_B));
memcpy(priv->ht40_2s_tx_power_index_diff,
- priv->efuse_wifi.efuse8192.ht40_2s_tx_power_index_diff,
+ efuse->ht40_2s_tx_power_index_diff,
sizeof(priv->ht40_2s_tx_power_index_diff));
memcpy(priv->ht20_tx_power_index_diff,
- priv->efuse_wifi.efuse8192.ht20_tx_power_index_diff,
+ efuse->ht20_tx_power_index_diff,
sizeof(priv->ht20_tx_power_index_diff));
memcpy(priv->ofdm_tx_power_index_diff,
- priv->efuse_wifi.efuse8192.ofdm_tx_power_index_diff,
+ efuse->ofdm_tx_power_index_diff,
sizeof(priv->ofdm_tx_power_index_diff));
memcpy(priv->ht40_max_power_offset,
- priv->efuse_wifi.efuse8192.ht40_max_power_offset,
+ efuse->ht40_max_power_offset,
sizeof(priv->ht40_max_power_offset));
memcpy(priv->ht20_max_power_offset,
- priv->efuse_wifi.efuse8192.ht20_max_power_offset,
+ efuse->ht20_max_power_offset,
sizeof(priv->ht20_max_power_offset));
dev_info(&priv->udev->dev, "Vendor: %.7s\n",
- priv->efuse_wifi.efuse8192.vendor_name);
+ efuse->vendor_name);
dev_info(&priv->udev->dev, "Product: %.20s\n",
- priv->efuse_wifi.efuse8192.device_name);
+ efuse->device_name);
- if (priv->efuse_wifi.efuse8192.rf_regulatory & 0x20) {
+ if (efuse->rf_regulatory & 0x20) {
sprintf(priv->chip_name, "8188RU");
priv->hi_pa = 1;
}
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 029/113] rtl8xxxu: rtl8192eu_parse_efuse(): Use a pointer to the struct rtl8192eu_efuse
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (27 preceding siblings ...)
2016-02-29 22:04 ` [PATCH 028/113] rtl8xxxu: rtl8192cu: " Jes.Sorensen
@ 2016-02-29 22:04 ` Jes.Sorensen
2016-02-29 22:04 ` [PATCH 030/113] rtl8xxxu: rtl8723bu_parse_efuse(): Use a pointer to the struct rtl8723bu_efuse Jes.Sorensen
` (84 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:04 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
Make the code easier to read and less error prone by using a pointer
to the efuse.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 26 +++++++++---------------
1 file changed, 10 insertions(+), 16 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 2ca99d0..d25536a 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -2288,33 +2288,27 @@ static int rtl8192cu_parse_efuse(struct rtl8xxxu_priv *priv)
static int rtl8192eu_parse_efuse(struct rtl8xxxu_priv *priv)
{
+ struct rtl8192eu_efuse *efuse = &priv->efuse_wifi.efuse8192eu;
int i;
- if (priv->efuse_wifi.efuse8192eu.rtl_id != cpu_to_le16(0x8129))
+ if (efuse->rtl_id != cpu_to_le16(0x8129))
return -EINVAL;
- ether_addr_copy(priv->mac_addr, priv->efuse_wifi.efuse8192eu.mac_addr);
+ ether_addr_copy(priv->mac_addr, efuse->mac_addr);
- memcpy(priv->cck_tx_power_index_A,
- priv->efuse_wifi.efuse8192eu.cck_tx_power_index_A,
+ memcpy(priv->cck_tx_power_index_A, efuse->cck_tx_power_index_A,
sizeof(priv->cck_tx_power_index_A));
- memcpy(priv->cck_tx_power_index_B,
- priv->efuse_wifi.efuse8192eu.cck_tx_power_index_B,
+ memcpy(priv->cck_tx_power_index_B, efuse->cck_tx_power_index_B,
sizeof(priv->cck_tx_power_index_B));
- memcpy(priv->ht40_1s_tx_power_index_A,
- priv->efuse_wifi.efuse8192eu.ht40_1s_tx_power_index_A,
+ memcpy(priv->ht40_1s_tx_power_index_A, efuse->ht40_1s_tx_power_index_A,
sizeof(priv->ht40_1s_tx_power_index_A));
- memcpy(priv->ht40_1s_tx_power_index_B,
- priv->efuse_wifi.efuse8192eu.ht40_1s_tx_power_index_B,
+ memcpy(priv->ht40_1s_tx_power_index_B, efuse->ht40_1s_tx_power_index_B,
sizeof(priv->ht40_1s_tx_power_index_B));
- dev_info(&priv->udev->dev, "Vendor: %.7s\n",
- priv->efuse_wifi.efuse8192eu.vendor_name);
- dev_info(&priv->udev->dev, "Product: %.11s\n",
- priv->efuse_wifi.efuse8192eu.device_name);
- dev_info(&priv->udev->dev, "Serial: %.11s\n",
- priv->efuse_wifi.efuse8192eu.serial);
+ dev_info(&priv->udev->dev, "Vendor: %.7s\n", efuse->vendor_name);
+ dev_info(&priv->udev->dev, "Product: %.11s\n", efuse->device_name);
+ dev_info(&priv->udev->dev, "Serial: %.11s\n", efuse->serial);
if (rtl8xxxu_debug & RTL8XXXU_DEBUG_EFUSE) {
unsigned char *raw = priv->efuse_wifi.raw;
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 030/113] rtl8xxxu: rtl8723bu_parse_efuse(): Use a pointer to the struct rtl8723bu_efuse
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (28 preceding siblings ...)
2016-02-29 22:04 ` [PATCH 029/113] rtl8xxxu: rtl8192eu_parse_efuse(): Use a pointer to the struct rtl8192eu_efuse Jes.Sorensen
@ 2016-02-29 22:04 ` Jes.Sorensen
2016-02-29 22:04 ` [PATCH 031/113] rtl8xxxu: rtl8xxxu_h2c_cmd(): Add size argument Jes.Sorensen
` (83 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:04 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
Likewise for 8723bu, use a pointer to the efuse.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 24 ++++++++++--------------
1 file changed, 10 insertions(+), 14 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index d25536a..d100a99 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -2171,29 +2171,25 @@ static int rtl8723au_parse_efuse(struct rtl8xxxu_priv *priv)
static int rtl8723bu_parse_efuse(struct rtl8xxxu_priv *priv)
{
- if (priv->efuse_wifi.efuse8723bu.rtl_id != cpu_to_le16(0x8129))
+ struct rtl8723bu_efuse *efuse = &priv->efuse_wifi.efuse8723bu;
+
+ if (efuse->rtl_id != cpu_to_le16(0x8129))
return -EINVAL;
- ether_addr_copy(priv->mac_addr, priv->efuse_wifi.efuse8723bu.mac_addr);
+ ether_addr_copy(priv->mac_addr, efuse->mac_addr);
- memcpy(priv->cck_tx_power_index_A,
- priv->efuse_wifi.efuse8723bu.cck_tx_power_index_A,
+ memcpy(priv->cck_tx_power_index_A, efuse->cck_tx_power_index_A,
sizeof(priv->cck_tx_power_index_A));
- memcpy(priv->cck_tx_power_index_B,
- priv->efuse_wifi.efuse8723bu.cck_tx_power_index_B,
+ memcpy(priv->cck_tx_power_index_B, efuse->cck_tx_power_index_B,
sizeof(priv->cck_tx_power_index_B));
- memcpy(priv->ht40_1s_tx_power_index_A,
- priv->efuse_wifi.efuse8723bu.ht40_1s_tx_power_index_A,
+ memcpy(priv->ht40_1s_tx_power_index_A, efuse->ht40_1s_tx_power_index_A,
sizeof(priv->ht40_1s_tx_power_index_A));
- memcpy(priv->ht40_1s_tx_power_index_B,
- priv->efuse_wifi.efuse8723bu.ht40_1s_tx_power_index_B,
+ memcpy(priv->ht40_1s_tx_power_index_B, efuse->ht40_1s_tx_power_index_B,
sizeof(priv->ht40_1s_tx_power_index_B));
- dev_info(&priv->udev->dev, "Vendor: %.7s\n",
- priv->efuse_wifi.efuse8723bu.vendor_name);
- dev_info(&priv->udev->dev, "Product: %.41s\n",
- priv->efuse_wifi.efuse8723bu.device_name);
+ dev_info(&priv->udev->dev, "Vendor: %.7s\n", efuse->vendor_name);
+ dev_info(&priv->udev->dev, "Product: %.41s\n", efuse->device_name);
if (rtl8xxxu_debug & RTL8XXXU_DEBUG_EFUSE) {
int i;
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 031/113] rtl8xxxu: rtl8xxxu_h2c_cmd(): Add size argument
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (29 preceding siblings ...)
2016-02-29 22:04 ` [PATCH 030/113] rtl8xxxu: rtl8723bu_parse_efuse(): Use a pointer to the struct rtl8723bu_efuse Jes.Sorensen
@ 2016-02-29 22:04 ` Jes.Sorensen
2016-02-29 22:04 ` [PATCH 032/113] rtl8xxxu: Do BT_WLAN_CALIBRATION before doing IQK calibration Jes.Sorensen
` (82 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:04 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
The firmware command API differs slightly between new and old
devices. The new generation requires the size since there is no
extension bit encoded into the command number.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 13 +++++++------
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 1 -
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index d100a99..3139890 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -1471,7 +1471,8 @@ static int rtl8xxxu_write_rfreg(struct rtl8xxxu_priv *priv,
return retval;
}
-static int rtl8723a_h2c_cmd(struct rtl8xxxu_priv *priv, struct h2c_cmd *h2c)
+static int rtl8723a_h2c_cmd(struct rtl8xxxu_priv *priv,
+ struct h2c_cmd *h2c, int len)
{
struct device *dev = &priv->udev->dev;
int mbox_nr, retry, retval = 0;
@@ -1504,7 +1505,7 @@ static int rtl8723a_h2c_cmd(struct rtl8xxxu_priv *priv, struct h2c_cmd *h2c)
/*
* Need to swap as it's being swapped again by rtl8xxxu_write16/32()
*/
- if (h2c->cmd.cmd & H2C_EXT) {
+ if (len > sizeof(u32)) {
if (priv->fops->mbox_ext_width == 4) {
rtl8xxxu_write32(priv, mbox_ext_reg,
le32_to_cpu(h2c->raw_wide.ext));
@@ -5110,9 +5111,9 @@ static void rtl8xxxu_update_rate_mask(struct rtl8xxxu_priv *priv,
if (sgi)
h2c.ramask.arg |= 0x20;
- dev_dbg(&priv->udev->dev, "%s: rate mask %08x, arg %02x\n", __func__,
- ramask, h2c.ramask.arg);
- rtl8723a_h2c_cmd(priv, &h2c);
+ dev_dbg(&priv->udev->dev, "%s: rate mask %08x, arg %02x, size %li\n",
+ __func__, ramask, h2c.ramask.arg, sizeof(h2c.ramask));
+ rtl8723a_h2c_cmd(priv, &h2c, sizeof(h2c.ramask));
}
static void rtl8xxxu_set_basic_rates(struct rtl8xxxu_priv *priv, u32 rate_cfg)
@@ -5200,7 +5201,7 @@ rtl8xxxu_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
h2c.joinbss.data = H2C_JOIN_BSS_DISCONNECT;
}
h2c.joinbss.cmd = H2C_JOIN_BSS_REPORT;
- rtl8723a_h2c_cmd(priv, &h2c);
+ rtl8723a_h2c_cmd(priv, &h2c, sizeof(h2c.joinbss));
}
if (changed & BSS_CHANGED_ERP_PREAMBLE) {
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
index 198b1d8..47898ff 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
@@ -720,7 +720,6 @@ struct h2c_cmd {
struct {
u8 cmd;
u8 data;
- u8 pad[4];
} __packed joinbss;
struct {
u8 cmd;
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 032/113] rtl8xxxu: Do BT_WLAN_CALIBRATION before doing IQK calibration
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (30 preceding siblings ...)
2016-02-29 22:04 ` [PATCH 031/113] rtl8xxxu: rtl8xxxu_h2c_cmd(): Add size argument Jes.Sorensen
@ 2016-02-29 22:04 ` Jes.Sorensen
2016-02-29 22:04 ` [PATCH 033/113] rtl8xxxu: Do not overwrite rtl8xxxu_debug for untested chips Jes.Sorensen
` (81 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:04 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
Newer generation chips require the firmware be notified before we
start the IQK calibration.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 20 +++++++++++++++++++-
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 4 ++++
2 files changed, 23 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 3139890..3829687 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -1497,7 +1497,7 @@ static int rtl8723a_h2c_cmd(struct rtl8xxxu_priv *priv,
} while (retry--);
if (!retry) {
- dev_dbg(dev, "%s: Mailbox busy\n", __func__);
+ dev_info(dev, "%s: Mailbox busy\n", __func__);
retval = -EBUSY;
goto error;
}
@@ -3877,6 +3877,20 @@ static void rtl8xxxu_phy_iqcalibrate(struct rtl8xxxu_priv *priv,
}
}
+static void rtl8xxxu_prepare_calibrate(struct rtl8xxxu_priv *priv, u8 start)
+{
+ struct h2c_cmd h2c;
+
+ if (priv->fops->mbox_ext_width < 4)
+ return;
+
+ memset(&h2c, 0, sizeof(struct h2c_cmd));
+ h2c.bt_wlan_calibration.cmd = H2C_8723B_BT_WLAN_CALIBRATION;
+ h2c.bt_wlan_calibration.data = start;
+
+ rtl8723a_h2c_cmd(priv, &h2c, sizeof(h2c.bt_wlan_calibration));
+}
+
static void rtl8723a_phy_iq_calibrate(struct rtl8xxxu_priv *priv)
{
struct device *dev = &priv->udev->dev;
@@ -3888,6 +3902,8 @@ static void rtl8723a_phy_iq_calibrate(struct rtl8xxxu_priv *priv)
s32 reg_tmp = 0;
bool simu;
+ rtl8xxxu_prepare_calibrate(priv, 1);
+
memset(result, 0, sizeof(result));
candidate = -1;
@@ -3975,6 +3991,8 @@ static void rtl8723a_phy_iq_calibrate(struct rtl8xxxu_priv *priv)
rtl8xxxu_save_regs(priv, rtl8723au_iqk_phy_iq_bb_reg,
priv->bb_recovery_backup, RTL8XXXU_BB_REGS);
+
+ rtl8xxxu_prepare_calibrate(priv, 0);
}
static void rtl8723a_phy_lc_calibrate(struct rtl8xxxu_priv *priv)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
index 47898ff..07533ac 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
@@ -727,6 +727,10 @@ struct h2c_cmd {
u8 arg;
__le16 mask_lo;
} __packed ramask;
+ struct {
+ u8 cmd;
+ u8 data;
+ } __packed bt_wlan_calibration;
};
};
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 033/113] rtl8xxxu: Do not overwrite rtl8xxxu_debug for untested chips
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (31 preceding siblings ...)
2016-02-29 22:04 ` [PATCH 032/113] rtl8xxxu: Do BT_WLAN_CALIBRATION before doing IQK calibration Jes.Sorensen
@ 2016-02-29 22:04 ` Jes.Sorensen
2016-02-29 22:04 ` [PATCH 034/113] rtl8xxxu: Use correct formatting type to print sizeof() Jes.Sorensen
` (80 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:04 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
Fix a silly bug where the debug level was overwritten rather than
amended for untested chips.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 3829687..ac47b77 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -6391,7 +6391,7 @@ static int rtl8xxxu_probe(struct usb_interface *interface,
}
if (untested) {
- rtl8xxxu_debug = RTL8XXXU_DEBUG_EFUSE;
+ rtl8xxxu_debug |= RTL8XXXU_DEBUG_EFUSE;
dev_info(&udev->dev,
"This Realtek USB WiFi dongle (0x%04x:0x%04x) is untested!\n",
id->idVendor, id->idProduct);
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 034/113] rtl8xxxu: Use correct formatting type to print sizeof()
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (32 preceding siblings ...)
2016-02-29 22:04 ` [PATCH 033/113] rtl8xxxu: Do not overwrite rtl8xxxu_debug for untested chips Jes.Sorensen
@ 2016-02-29 22:04 ` Jes.Sorensen
2016-02-29 22:04 ` [PATCH 035/113] rtl8xxxu: Make rtl8xxxu_add_path_on() use device specific init values Jes.Sorensen
` (79 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:04 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
Usual gcc i386 issue reported by kbuildbot
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index ac47b77..9d8b69a 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -5129,7 +5129,7 @@ static void rtl8xxxu_update_rate_mask(struct rtl8xxxu_priv *priv,
if (sgi)
h2c.ramask.arg |= 0x20;
- dev_dbg(&priv->udev->dev, "%s: rate mask %08x, arg %02x, size %li\n",
+ dev_dbg(&priv->udev->dev, "%s: rate mask %08x, arg %02x, size %zi\n",
__func__, ramask, h2c.ramask.arg, sizeof(h2c.ramask));
rtl8723a_h2c_cmd(priv, &h2c, sizeof(h2c.ramask));
}
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 035/113] rtl8xxxu: Make rtl8xxxu_add_path_on() use device specific init values
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (33 preceding siblings ...)
2016-02-29 22:04 ` [PATCH 034/113] rtl8xxxu: Use correct formatting type to print sizeof() Jes.Sorensen
@ 2016-02-29 22:04 ` Jes.Sorensen
2016-02-29 22:04 ` [PATCH 036/113] rtl8xxxu: Add a couple of new register definitions Jes.Sorensen
` (78 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:04 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
rtl8192cu/rtl8188cu/rtl8723au use the same values, but 8723bu and
8192eu have their own.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 24 +++++++++++++++++++++---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 4 ++++
2 files changed, 25 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 9d8b69a..e543a26 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -3557,11 +3557,13 @@ static void rtl8xxxu_path_adda_on(struct rtl8xxxu_priv *priv, const u32 *regs,
u32 path_on;
int i;
- path_on = path_a_on ? 0x04db25a4 : 0x0b1b25a4;
if (priv->tx_paths == 1) {
- path_on = 0x0bdb25a0;
- rtl8xxxu_write32(priv, regs[0], 0x0b1b25a0);
+ path_on = priv->fops->adda_1t_path_on;
+ rtl8xxxu_write32(priv, regs[0], priv->fops->adda_1t_init);
} else {
+ path_on = path_a_on ? priv->fops->adda_2t_path_on_a :
+ priv->fops->adda_2t_path_on_b;
+
rtl8xxxu_write32(priv, regs[0], path_on);
}
@@ -6537,6 +6539,10 @@ static struct rtl8xxxu_fileops rtl8723au_fops = {
.writeN_block_size = 1024,
.mbox_ext_reg = REG_HMBOX_EXT_0,
.mbox_ext_width = 2,
+ .adda_1t_init = 0x0b1b25a0,
+ .adda_1t_path_on = 0x0bdb25a0,
+ .adda_2t_path_on_a = 0x04db25a4,
+ .adda_2t_path_on_b = 0x0b1b25a4,
};
static struct rtl8xxxu_fileops rtl8723bu_fops = {
@@ -6548,6 +6554,10 @@ static struct rtl8xxxu_fileops rtl8723bu_fops = {
.writeN_block_size = 1024,
.mbox_ext_reg = REG_HMBOX_EXT0_8723B,
.mbox_ext_width = 4,
+ .adda_1t_init = 0x01c00014,
+ .adda_1t_path_on = 0x01c00014,
+ .adda_2t_path_on_a = 0x01c00014,
+ .adda_2t_path_on_b = 0x01c00014,
};
#ifdef CONFIG_RTL8XXXU_UNTESTED
@@ -6560,6 +6570,10 @@ static struct rtl8xxxu_fileops rtl8192cu_fops = {
.writeN_block_size = 128,
.mbox_ext_reg = REG_HMBOX_EXT_0,
.mbox_ext_width = 2,
+ .adda_1t_init = 0x0b1b25a0,
+ .adda_1t_path_on = 0x0bdb25a0,
+ .adda_2t_path_on_a = 0x04db25a4,
+ .adda_2t_path_on_b = 0x0b1b25a4,
};
#endif
@@ -6572,6 +6586,10 @@ static struct rtl8xxxu_fileops rtl8192eu_fops = {
.writeN_block_size = 128,
.mbox_ext_reg = REG_HMBOX_EXT0_8723B,
.mbox_ext_width = 4,
+ .adda_1t_init = 0x0fc01616,
+ .adda_1t_path_on = 0x0fc01616,
+ .adda_2t_path_on_a = 0x0fc01616,
+ .adda_2t_path_on_b = 0x0fc01616,
};
static struct usb_device_id dev_table[] = {
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
index 07533ac..4b8431d 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
@@ -854,4 +854,8 @@ struct rtl8xxxu_fileops {
int writeN_block_size;
u16 mbox_ext_reg;
char mbox_ext_width;
+ u32 adda_1t_init;
+ u32 adda_1t_path_on;
+ u32 adda_2t_path_on_a;
+ u32 adda_2t_path_on_b;
};
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 036/113] rtl8xxxu: Add a couple of new register definitions
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (34 preceding siblings ...)
2016-02-29 22:04 ` [PATCH 035/113] rtl8xxxu: Make rtl8xxxu_add_path_on() use device specific init values Jes.Sorensen
@ 2016-02-29 22:04 ` Jes.Sorensen
2016-02-29 22:04 ` [PATCH 037/113] rtl8xxxu: First stab at adding IQK calibration for 8723bu parts Jes.Sorensen
` (77 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:04 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
This adds some additional register definitions for 8723bu, as well as
a bit define for USB RXDMA aggregation in REG_RXDMA_AGG_PG_TH.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
index f1375b8..162a9e8 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
@@ -388,9 +388,14 @@
/* 0x0280 ~ 0x02FF RXDMA Configuration */
#define REG_RXDMA_AGG_PG_TH 0x0280
+#define RXDMA_USB_AGG_ENABLE BIT(31)
#define REG_RXPKT_NUM 0x0284
#define REG_RXDMA_STATUS 0x0288
+/* Presumably only found on newer chips such as 8723bu */
+#define REG_RX_DMA_CTRL_8723B 0x0286
+#define REG_RX_DMA_MODE_CTRL_8723B 0x0290
+
#define REG_RF_BB_CMD_ADDR 0x02c0
#define REG_RF_BB_CMD_DATA 0x02c4
@@ -473,6 +478,7 @@
#define REG_POWER_STATUS 0x04a4
#define REG_POWER_STAGE1 0x04b4
#define REG_POWER_STAGE2 0x04b8
+#define REG_AMPDU_BURST_MODE_8723B 0x04bc
#define REG_PKT_VO_VI_LIFE_TIME 0x04c0
#define REG_PKT_BE_BK_LIFE_TIME 0x04c2
#define REG_STBC_SETTING 0x04c4
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 037/113] rtl8xxxu: First stab at adding IQK calibration for 8723bu parts
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (35 preceding siblings ...)
2016-02-29 22:04 ` [PATCH 036/113] rtl8xxxu: Add a couple of new register definitions Jes.Sorensen
@ 2016-02-29 22:04 ` Jes.Sorensen
2016-03-10 14:24 ` Kalle Valo
2016-02-29 22:04 ` [PATCH 038/113] rtl8xxxu: Handle S0S1 register in lc_calibrate() Jes.Sorensen
` (76 subsequent siblings)
113 siblings, 1 reply; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:04 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
The 8723bu also has it's own IQK calibration process. This is similar
in flow, but still different enough to warrent it's own
implementation, at least for now.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 811 ++++++++++++++++++++-
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 1 +
.../net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h | 17 +
3 files changed, 827 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index e543a26..b2aa723 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -3510,6 +3510,91 @@ static bool rtl8xxxu_simularity_compare(struct rtl8xxxu_priv *priv,
return false;
}
+static bool rtl8723bu_simularity_compare(struct rtl8xxxu_priv *priv,
+ int result[][8], int c1, int c2)
+{
+ u32 i, j, diff, simubitmap, bound = 0;
+ int candidate[2] = {-1, -1}; /* for path A and path B */
+ int tmp1, tmp2;
+ bool retval = true;
+
+ if (priv->tx_paths > 1)
+ bound = 8;
+ else
+ bound = 4;
+
+ simubitmap = 0;
+
+ for (i = 0; i < bound; i++) {
+ if (i & 1) {
+ if ((result[c1][i] & 0x00000200))
+ tmp1 = result[c1][i] | 0xfffffc00;
+ else
+ tmp1 = result[c1][i];
+
+ if ((result[c2][i]& 0x00000200))
+ tmp2 = result[c2][i] | 0xfffffc00;
+ else
+ tmp2 = result[c2][i];
+ } else {
+ tmp1 = result[c1][i];
+ tmp2 = result[c2][i];
+ }
+
+ diff = (tmp1 > tmp2) ? (tmp1 - tmp2) : (tmp2 - tmp1);
+
+ if (diff > MAX_TOLERANCE) {
+ if ((i == 2 || i == 6) && !simubitmap) {
+ if (result[c1][i] + result[c1][i + 1] == 0)
+ candidate[(i / 4)] = c2;
+ else if (result[c2][i] + result[c2][i + 1] == 0)
+ candidate[(i / 4)] = c1;
+ else
+ simubitmap = simubitmap | (1 << i);
+ } else {
+ simubitmap = simubitmap | (1 << i);
+ }
+ }
+ }
+
+ if (simubitmap == 0) {
+ for (i = 0; i < (bound / 4); i++) {
+ if (candidate[i] >= 0) {
+ for (j = i * 4; j < (i + 1) * 4 - 2; j++)
+ result[3][j] = result[candidate[i]][j];
+ retval = false;
+ }
+ }
+ return retval;
+ } else {
+ if (!(simubitmap & 0x03)) {
+ /* path A TX OK */
+ for (i = 0; i < 2; i++)
+ result[3][i] = result[c1][i];
+ }
+
+ if (!(simubitmap & 0x0c)) {
+ /* path A RX OK */
+ for (i = 2; i < 4; i++)
+ result[3][i] = result[c1][i];
+ }
+
+ if (!(simubitmap & 0x30) && priv->tx_paths > 1) {
+ /* path B RX OK */
+ for (i = 4; i < 6; i++)
+ result[3][i] = result[c1][i];
+ }
+
+ if (!(simubitmap & 0x30) && priv->tx_paths > 1) {
+ /* path B RX OK */
+ for (i = 6; i < 8; i++)
+ result[3][i] = result[c1][i];
+ }
+ }
+
+ return false;
+}
+
static void
rtl8xxxu_save_mac_regs(struct rtl8xxxu_priv *priv, const u32 *reg, u32 *backup)
{
@@ -3677,6 +3762,369 @@ out:
return result;
}
+static int rtl8723bu_iqk_path_a(struct rtl8xxxu_priv *priv)
+{
+ u32 reg_eac, reg_e94, reg_e9c, path_sel, val32;
+ int result = 0;
+
+ path_sel = rtl8xxxu_read32(priv, REG_S0S1_PATH_SWITCH);
+
+ /*
+ * Leave IQK mode
+ */
+ val32 = rtl8xxxu_read32(priv, REG_FPGA0_IQK);
+ val32 &= 0x000000ff;
+ rtl8xxxu_write32(priv, REG_FPGA0_IQK, val32);
+
+ /*
+ * Enable path A PA in TX IQK mode
+ */
+ val32 = rtl8xxxu_read_rfreg(priv, RF_A, RF6052_REG_WE_LUT);
+ val32 |= 0x80000;
+ rtl8xxxu_write_rfreg(priv, RF_A, RF6052_REG_WE_LUT, val32);
+ rtl8xxxu_write_rfreg(priv, RF_A, RF6052_REG_RCK_OS, 0x20000);
+ rtl8xxxu_write_rfreg(priv, RF_A, RF6052_REG_TXPA_G1, 0x0003f);
+ rtl8xxxu_write_rfreg(priv, RF_A, RF6052_REG_TXPA_G2, 0xc7f87);
+
+ /*
+ * Tx IQK setting
+ */
+ rtl8xxxu_write32(priv, REG_TX_IQK, 0x01007c00);
+ rtl8xxxu_write32(priv, REG_RX_IQK, 0x01004800);
+
+ /* path-A IQK setting */
+ rtl8xxxu_write32(priv, REG_TX_IQK_TONE_A, 0x18008c1c);
+ rtl8xxxu_write32(priv, REG_RX_IQK_TONE_A, 0x38008c1c);
+ rtl8xxxu_write32(priv, REG_TX_IQK_TONE_B, 0x38008c1c);
+ rtl8xxxu_write32(priv, REG_RX_IQK_TONE_B, 0x38008c1c);
+
+ rtl8xxxu_write32(priv, REG_TX_IQK_PI_A, 0x821403ea);
+ rtl8xxxu_write32(priv, REG_RX_IQK_PI_A, 0x28110000);
+ rtl8xxxu_write32(priv, REG_TX_IQK_PI_B, 0x82110000);
+ rtl8xxxu_write32(priv, REG_RX_IQK_PI_B, 0x28110000);
+
+ /* LO calibration setting */
+ rtl8xxxu_write32(priv, REG_IQK_AGC_RSP, 0x00462911);
+
+ /*
+ * Enter IQK mode
+ */
+ val32 = rtl8xxxu_read32(priv, REG_FPGA0_IQK);
+ val32 &= 0x000000ff;
+ val32 |= 0x80800000;
+ rtl8xxxu_write32(priv, REG_FPGA0_IQK, val32);
+
+ /*
+ * The vendor driver indicates the USB module is always using
+ * S0S1 path 1 for the 8723bu. This may be different for 8192eu
+ */
+ if (priv->rf_paths > 1)
+ rtl8xxxu_write32(priv, REG_S0S1_PATH_SWITCH, 0x00000000);
+ else
+ rtl8xxxu_write32(priv, REG_S0S1_PATH_SWITCH, 0x00000280);
+
+ /*
+ * Bit 12 seems to be BT_GRANT, and is only found in the 8723bu.
+ * No trace of this in the 8192eu or 8188eu vendor drivers.
+ */
+ rtl8xxxu_write32(priv, REG_BT_CONTROL_8723BU, 0x00000800);
+
+ /* One shot, path A LOK & IQK */
+ rtl8xxxu_write32(priv, REG_IQK_AGC_PTS, 0xf9000000);
+ rtl8xxxu_write32(priv, REG_IQK_AGC_PTS, 0xf8000000);
+
+ mdelay(1);
+
+ /* Restore Ant Path */
+ rtl8xxxu_write32(priv, REG_S0S1_PATH_SWITCH, path_sel);
+#ifdef RTL8723BU_BT
+ /* GNT_BT = 1 */
+ rtl8xxxu_write32(priv, REG_BT_CONTROL_8723BU, 0x00001800);
+#endif
+
+ /*
+ * Leave IQK mode
+ */
+ val32 = rtl8xxxu_read32(priv, REG_FPGA0_IQK);
+ val32 &= 0x000000ff;
+ rtl8xxxu_write32(priv, REG_FPGA0_IQK, val32);
+
+ /* Check failed */
+ reg_eac = rtl8xxxu_read32(priv, REG_RX_POWER_AFTER_IQK_A_2);
+ reg_e94 = rtl8xxxu_read32(priv, REG_TX_POWER_BEFORE_IQK_A);
+ reg_e9c = rtl8xxxu_read32(priv, REG_TX_POWER_AFTER_IQK_A);
+
+ val32 = (reg_e9c >> 16) & 0x3ff;
+ if (val32 & 0x200)
+ val32 = 0x400 - val32;
+
+ if (!(reg_eac & BIT(28)) &&
+ ((reg_e94 & 0x03ff0000) != 0x01420000) &&
+ ((reg_e9c & 0x03ff0000) != 0x00420000) &&
+ ((reg_e94 & 0x03ff0000) < 0x01100000) &&
+ ((reg_e94 & 0x03ff0000) > 0x00f00000) &&
+ val32 < 0xf)
+ result |= 0x01;
+ else /* If TX not OK, ignore RX */
+ goto out;
+
+out:
+ return result;
+}
+
+static int rtl8723bu_rx_iqk_path_a(struct rtl8xxxu_priv *priv)
+{
+ u32 reg_ea4, reg_eac, reg_e94, reg_e9c, path_sel, val32;
+ int result = 0;
+
+ path_sel = rtl8xxxu_read32(priv, REG_S0S1_PATH_SWITCH);
+
+ /*
+ * Leave IQK mode
+ */
+ val32 = rtl8xxxu_read32(priv, REG_FPGA0_IQK);
+ val32 &= 0x000000ff;
+ rtl8xxxu_write32(priv, REG_FPGA0_IQK, val32);
+
+ /*
+ * Enable path A PA in TX IQK mode
+ */
+ val32 = rtl8xxxu_read_rfreg(priv, RF_A, RF6052_REG_WE_LUT);
+ val32 |= 0x80000;
+ rtl8xxxu_write_rfreg(priv, RF_A, RF6052_REG_WE_LUT, val32);
+ rtl8xxxu_write_rfreg(priv, RF_A, RF6052_REG_RCK_OS, 0x30000);
+ rtl8xxxu_write_rfreg(priv, RF_A, RF6052_REG_TXPA_G1, 0x0001f);
+ rtl8xxxu_write_rfreg(priv, RF_A, RF6052_REG_TXPA_G2, 0xf7fb7);
+
+ /*
+ * Tx IQK setting
+ */
+ rtl8xxxu_write32(priv, REG_TX_IQK, 0x01007c00);
+ rtl8xxxu_write32(priv, REG_RX_IQK, 0x01004800);
+
+ /* path-A IQK setting */
+ rtl8xxxu_write32(priv, REG_TX_IQK_TONE_A, 0x18008c1c);
+ rtl8xxxu_write32(priv, REG_RX_IQK_TONE_A, 0x38008c1c);
+ rtl8xxxu_write32(priv, REG_TX_IQK_TONE_B, 0x38008c1c);
+ rtl8xxxu_write32(priv, REG_RX_IQK_TONE_B, 0x38008c1c);
+
+ rtl8xxxu_write32(priv, REG_TX_IQK_PI_A, 0x82160ff0);
+ rtl8xxxu_write32(priv, REG_RX_IQK_PI_A, 0x28110000);
+ rtl8xxxu_write32(priv, REG_TX_IQK_PI_B, 0x82110000);
+ rtl8xxxu_write32(priv, REG_RX_IQK_PI_B, 0x28110000);
+
+ /* LO calibration setting */
+ rtl8xxxu_write32(priv, REG_IQK_AGC_RSP, 0x0046a911);
+
+ /*
+ * Enter IQK mode
+ */
+ val32 = rtl8xxxu_read32(priv, REG_FPGA0_IQK);
+ val32 &= 0x000000ff;
+ val32 |= 0x80800000;
+ rtl8xxxu_write32(priv, REG_FPGA0_IQK, val32);
+
+ /*
+ * The vendor driver indicates the USB module is always using
+ * S0S1 path 1 for the 8723bu. This may be different for 8192eu
+ */
+ if (priv->rf_paths > 1)
+ rtl8xxxu_write32(priv, REG_S0S1_PATH_SWITCH, 0x00000000);
+ else
+ rtl8xxxu_write32(priv, REG_S0S1_PATH_SWITCH, 0x00000280);
+
+ /*
+ * Bit 12 seems to be BT_GRANT, and is only found in the 8723bu.
+ * No trace of this in the 8192eu or 8188eu vendor drivers.
+ */
+ rtl8xxxu_write32(priv, REG_BT_CONTROL_8723BU, 0x00000800);
+
+ /* One shot, path A LOK & IQK */
+ rtl8xxxu_write32(priv, REG_IQK_AGC_PTS, 0xf9000000);
+ rtl8xxxu_write32(priv, REG_IQK_AGC_PTS, 0xf8000000);
+
+ mdelay(1);
+
+ /* Restore Ant Path */
+ rtl8xxxu_write32(priv, REG_S0S1_PATH_SWITCH, path_sel);
+#ifdef RTL8723BU_BT
+ /* GNT_BT = 1 */
+ rtl8xxxu_write32(priv, REG_BT_CONTROL_8723BU, 0x00001800);
+#endif
+
+ /*
+ * Leave IQK mode
+ */
+ val32 = rtl8xxxu_read32(priv, REG_FPGA0_IQK);
+ val32 &= 0x000000ff;
+ rtl8xxxu_write32(priv, REG_FPGA0_IQK, val32);
+
+ /* Check failed */
+ reg_eac = rtl8xxxu_read32(priv, REG_RX_POWER_AFTER_IQK_A_2);
+ reg_e94 = rtl8xxxu_read32(priv, REG_TX_POWER_BEFORE_IQK_A);
+ reg_e9c = rtl8xxxu_read32(priv, REG_TX_POWER_AFTER_IQK_A);
+
+ val32 = (reg_e9c >> 16) & 0x3ff;
+ if (val32 & 0x200)
+ val32 = 0x400 - val32;
+
+ if (!(reg_eac & BIT(28)) &&
+ ((reg_e94 & 0x03ff0000) != 0x01420000) &&
+ ((reg_e9c & 0x03ff0000) != 0x00420000) &&
+ ((reg_e94 & 0x03ff0000) < 0x01100000) &&
+ ((reg_e94 & 0x03ff0000) > 0x00f00000) &&
+ val32 < 0xf)
+ result |= 0x01;
+ else /* If TX not OK, ignore RX */
+ goto out;
+
+ val32 = 0x80007c00 | (reg_e94 &0x3ff0000) |
+ ((reg_e9c & 0x3ff0000) >> 16);
+ rtl8xxxu_write32(priv, REG_TX_IQK, val32);
+
+ /*
+ * Modify RX IQK mode
+ */
+ val32 = rtl8xxxu_read32(priv, REG_FPGA0_IQK);
+ val32 &= 0x000000ff;
+ rtl8xxxu_write32(priv, REG_FPGA0_IQK, val32);
+ val32 = rtl8xxxu_read_rfreg(priv, RF_A, RF6052_REG_WE_LUT);
+ val32 |= 0x80000;
+ rtl8xxxu_write_rfreg(priv, RF_A, RF6052_REG_WE_LUT, val32);
+ rtl8xxxu_write_rfreg(priv, RF_A, RF6052_REG_RCK_OS, 0x30000);
+ rtl8xxxu_write_rfreg(priv, RF_A, RF6052_REG_TXPA_G1, 0x0001f);
+ rtl8xxxu_write_rfreg(priv, RF_A, RF6052_REG_TXPA_G2, 0xf7d77);
+
+ /*
+ * PA, PAD setting
+ */
+ rtl8xxxu_write_rfreg(priv, RF_A, RF6052_REG_UNKNOWN_DF, 0xf80);
+ rtl8xxxu_write_rfreg(priv, RF_A, RF6052_REG_UNKNOWN_55, 0x4021f);
+
+ /*
+ * RX IQK setting
+ */
+ rtl8xxxu_write32(priv, REG_RX_IQK, 0x01004800);
+
+ /* path-A IQK setting */
+ rtl8xxxu_write32(priv, REG_TX_IQK_TONE_A, 0x38008c1c);
+ rtl8xxxu_write32(priv, REG_RX_IQK_TONE_A, 0x18008c1c);
+ rtl8xxxu_write32(priv, REG_TX_IQK_TONE_B, 0x38008c1c);
+ rtl8xxxu_write32(priv, REG_RX_IQK_TONE_B, 0x38008c1c);
+
+ rtl8xxxu_write32(priv, REG_TX_IQK_PI_A, 0x82110000);
+ rtl8xxxu_write32(priv, REG_RX_IQK_PI_A, 0x2816001f);
+ rtl8xxxu_write32(priv, REG_TX_IQK_PI_B, 0x82110000);
+ rtl8xxxu_write32(priv, REG_RX_IQK_PI_B, 0x28110000);
+
+ /* LO calibration setting */
+ rtl8xxxu_write32(priv, REG_IQK_AGC_RSP, 0x0046a8d1);
+
+ /*
+ * Enter IQK mode
+ */
+ val32 = rtl8xxxu_read32(priv, REG_FPGA0_IQK);
+ val32 &= 0x000000ff;
+ val32 |= 0x80800000;
+ rtl8xxxu_write32(priv, REG_FPGA0_IQK, val32);
+
+ if (priv->rf_paths > 1)
+ rtl8xxxu_write32(priv, REG_S0S1_PATH_SWITCH, 0x00000000);
+ else
+ rtl8xxxu_write32(priv, REG_S0S1_PATH_SWITCH, 0x00000280);
+
+ /*
+ * Disable BT
+ */
+ rtl8xxxu_write32(priv, REG_BT_CONTROL_8723BU, 0x00000800);
+
+ /* One shot, path A LOK & IQK */
+ rtl8xxxu_write32(priv, REG_IQK_AGC_PTS, 0xf9000000);
+ rtl8xxxu_write32(priv, REG_IQK_AGC_PTS, 0xf8000000);
+
+ mdelay(1);
+
+ /* Restore Ant Path */
+ rtl8xxxu_write32(priv, REG_S0S1_PATH_SWITCH, path_sel);
+#ifdef RTL8723BU_BT
+ /* GNT_BT = 1 */
+ rtl8xxxu_write32(priv, REG_BT_CONTROL_8723BU, 0x00001800);
+#endif
+
+ /*
+ * Leave IQK mode
+ */
+ val32 = rtl8xxxu_read32(priv, REG_FPGA0_IQK);
+ val32 &= 0x000000ff;
+ rtl8xxxu_write32(priv, REG_FPGA0_IQK, val32);
+
+ /* Check failed */
+ reg_eac = rtl8xxxu_read32(priv, REG_RX_POWER_AFTER_IQK_A_2);
+ reg_ea4 = rtl8xxxu_read32(priv, REG_RX_POWER_BEFORE_IQK_A_2);
+
+ rtl8xxxu_write_rfreg(priv, RF_A, RF6052_REG_UNKNOWN_DF, 0x780);
+
+ val32 = (reg_eac >> 16) & 0x3ff;
+ if (val32 & 0x200)
+ val32 = 0x400 - val32;
+
+ if (!(reg_eac & BIT(27)) &&
+ ((reg_ea4 & 0x03ff0000) != 0x01320000) &&
+ ((reg_eac & 0x03ff0000) != 0x00360000) &&
+ ((reg_ea4 & 0x03ff0000) < 0x01100000) &&
+ ((reg_ea4 & 0x03ff0000) > 0x00f00000) &&
+ val32 < 0xf)
+ result |= 0x02;
+ else /* If TX not OK, ignore RX */
+ goto out;
+out:
+ return result;
+}
+
+#ifdef RTL8723BU_PATH_B
+static int rtl8723bu_iqk_path_b(struct rtl8xxxu_priv *priv)
+{
+ u32 reg_eac, reg_eb4, reg_ebc, reg_ec4, reg_ecc, path_sel;
+ int result = 0;
+
+ path_sel = rtl8xxxu_read32(priv, REG_S0S1_PATH_SWITCH);
+
+ val32 = rtl8xxxu_read32(priv, REG_FPGA0_IQK);
+ val32 &= 0x000000ff;
+ rtl8xxxu_write32(priv, REG_FPGA0_IQK, val32);
+
+ /* One shot, path B LOK & IQK */
+ rtl8xxxu_write32(priv, REG_IQK_AGC_CONT, 0x00000002);
+ rtl8xxxu_write32(priv, REG_IQK_AGC_CONT, 0x00000000);
+
+ mdelay(1);
+
+ /* Check failed */
+ reg_eac = rtl8xxxu_read32(priv, REG_RX_POWER_AFTER_IQK_A_2);
+ reg_eb4 = rtl8xxxu_read32(priv, REG_TX_POWER_BEFORE_IQK_B);
+ reg_ebc = rtl8xxxu_read32(priv, REG_TX_POWER_AFTER_IQK_B);
+ reg_ec4 = rtl8xxxu_read32(priv, REG_RX_POWER_BEFORE_IQK_B_2);
+ reg_ecc = rtl8xxxu_read32(priv, REG_RX_POWER_AFTER_IQK_B_2);
+
+ if (!(reg_eac & BIT(31)) &&
+ ((reg_eb4 & 0x03ff0000) != 0x01420000) &&
+ ((reg_ebc & 0x03ff0000) != 0x00420000))
+ result |= 0x01;
+ else
+ goto out;
+
+ if (!(reg_eac & BIT(30)) &&
+ (((reg_ec4 & 0x03ff0000) >> 16) != 0x132) &&
+ (((reg_ecc & 0x03ff0000) >> 16) != 0x36))
+ result |= 0x02;
+ else
+ dev_warn(&priv->udev->dev, "%s: Path B RX IQK failed!\n",
+ __func__);
+out:
+ return result;
+}
+#endif
+
static void rtl8xxxu_phy_iqcalibrate(struct rtl8xxxu_priv *priv,
int result[][8], int t)
{
@@ -3879,6 +4327,234 @@ static void rtl8xxxu_phy_iqcalibrate(struct rtl8xxxu_priv *priv,
}
}
+static void rtl8723bu_phy_iqcalibrate(struct rtl8xxxu_priv *priv,
+ int result[][8], int t)
+{
+ struct device *dev = &priv->udev->dev;
+ u32 i, val32;
+ int path_a_ok /*, path_b_ok */;
+ int retry = 2;
+ const u32 adda_regs[RTL8XXXU_ADDA_REGS] = {
+ REG_FPGA0_XCD_SWITCH_CTRL, REG_BLUETOOTH,
+ REG_RX_WAIT_CCA, REG_TX_CCK_RFON,
+ REG_TX_CCK_BBON, REG_TX_OFDM_RFON,
+ REG_TX_OFDM_BBON, REG_TX_TO_RX,
+ REG_TX_TO_TX, REG_RX_CCK,
+ REG_RX_OFDM, REG_RX_WAIT_RIFS,
+ REG_RX_TO_RX, REG_STANDBY,
+ REG_SLEEP, REG_PMPD_ANAEN
+ };
+ const u32 iqk_mac_regs[RTL8XXXU_MAC_REGS] = {
+ REG_TXPAUSE, REG_BEACON_CTRL,
+ REG_BEACON_CTRL_1, REG_GPIO_MUXCFG
+ };
+ const u32 iqk_bb_regs[RTL8XXXU_BB_REGS] = {
+ REG_OFDM0_TRX_PATH_ENABLE, REG_OFDM0_TR_MUX_PAR,
+ REG_FPGA0_XCD_RF_SW_CTRL, REG_CONFIG_ANT_A, REG_CONFIG_ANT_B,
+ REG_FPGA0_XAB_RF_SW_CTRL, REG_FPGA0_XA_RF_INT_OE,
+ REG_FPGA0_XB_RF_INT_OE, REG_FPGA0_RF_MODE
+ };
+ u8 xa_agc = rtl8xxxu_read32(priv, REG_OFDM0_XA_AGC_CORE1) & 0xff;
+ u8 xb_agc = rtl8xxxu_read32(priv, REG_OFDM0_XB_AGC_CORE1) & 0xff;
+
+ /*
+ * Note: IQ calibration must be performed after loading
+ * PHY_REG.txt , and radio_a, radio_b.txt
+ */
+
+ if (t == 0) {
+ /* Save ADDA parameters, turn Path A ADDA on */
+ rtl8xxxu_save_regs(priv, adda_regs, priv->adda_backup,
+ RTL8XXXU_ADDA_REGS);
+ rtl8xxxu_save_mac_regs(priv, iqk_mac_regs, priv->mac_backup);
+ rtl8xxxu_save_regs(priv, iqk_bb_regs,
+ priv->bb_backup, RTL8XXXU_BB_REGS);
+ }
+
+ rtl8xxxu_path_adda_on(priv, adda_regs, true);
+
+ /* MAC settings */
+ rtl8xxxu_mac_calibration(priv, iqk_mac_regs, priv->mac_backup);
+
+ val32 = rtl8xxxu_read32(priv, REG_CCK0_AFE_SETTING);
+ val32 |= 0x0f000000;
+ rtl8xxxu_write32(priv, REG_CCK0_AFE_SETTING, val32);
+
+ rtl8xxxu_write32(priv, REG_OFDM0_TRX_PATH_ENABLE, 0x03a05600);
+ rtl8xxxu_write32(priv, REG_OFDM0_TR_MUX_PAR, 0x000800e4);
+ rtl8xxxu_write32(priv, REG_FPGA0_XCD_RF_SW_CTRL, 0x22204000);
+
+#ifdef RTL8723BU_PATH_B
+ /* Set RF mode to standby Path B */
+ if (priv->tx_paths > 1)
+ rtl8xxxu_write_rfreg(priv, RF_B, RF6052_REG_AC, 0x10000);
+#endif
+
+#if 0
+ /* Page B init */
+ rtl8xxxu_write32(priv, REG_CONFIG_ANT_A, 0x0f600000);
+
+ if (priv->tx_paths > 1)
+ rtl8xxxu_write32(priv, REG_CONFIG_ANT_B, 0x0f600000);
+#endif
+
+ /*
+ * RX IQ calibration setting for 8723B D cut large current issue
+ * when leaving IPS
+ */
+ val32 = rtl8xxxu_read32(priv, REG_FPGA0_IQK);
+ val32 &= 0x000000ff;
+ rtl8xxxu_write32(priv, REG_FPGA0_IQK, val32);
+
+ val32 = rtl8xxxu_read_rfreg(priv, RF_A, RF6052_REG_WE_LUT);
+ val32 |= 0x80000;
+ rtl8xxxu_write_rfreg(priv, RF_A, RF6052_REG_WE_LUT, val32);
+
+ rtl8xxxu_write_rfreg(priv, RF_A, RF6052_REG_RCK_OS, 0x30000);
+ rtl8xxxu_write_rfreg(priv, RF_A, RF6052_REG_TXPA_G1, 0x0001f);
+ rtl8xxxu_write_rfreg(priv, RF_A, RF6052_REG_TXPA_G2, 0xf7fb7);
+
+ val32 = rtl8xxxu_read_rfreg(priv, RF_A, RF6052_REG_UNKNOWN_ED);
+ val32 |= 0x20;
+ rtl8xxxu_write_rfreg(priv, RF_A, RF6052_REG_UNKNOWN_ED, val32);
+
+ rtl8xxxu_write_rfreg(priv, RF_A, RF6052_REG_UNKNOWN_43, 0x60fbd);
+
+ for (i = 0; i < retry; i++) {
+ path_a_ok = rtl8723bu_iqk_path_a(priv);
+ if (path_a_ok == 0x01) {
+ val32 = rtl8xxxu_read32(priv, REG_FPGA0_IQK);
+ val32 &= 0x000000ff;
+ rtl8xxxu_write32(priv, REG_FPGA0_IQK, val32);
+
+#if 0 /* Only needed in restore case, we may need this when going to suspend */
+ priv->RFCalibrateInfo.TxLOK[RF_A] =
+ rtl8xxxu_read_rfreg(priv, RF_A,
+ RF6052_REG_TXM_IDAC);
+#endif
+
+ val32 = rtl8xxxu_read32(priv,
+ REG_TX_POWER_BEFORE_IQK_A);
+ result[t][0] = (val32 >> 16) & 0x3ff;
+ val32 = rtl8xxxu_read32(priv,
+ REG_TX_POWER_AFTER_IQK_A);
+ result[t][1] = (val32 >> 16) & 0x3ff;
+
+ break;
+ }
+ }
+
+ if (!path_a_ok)
+ dev_dbg(dev, "%s: Path A TX IQK failed!\n", __func__);
+
+ for (i = 0; i < retry; i++) {
+ path_a_ok = rtl8723bu_rx_iqk_path_a(priv);
+ if (path_a_ok == 0x03) {
+ val32 = rtl8xxxu_read32(priv,
+ REG_RX_POWER_BEFORE_IQK_A_2);
+ result[t][2] = (val32 >> 16) & 0x3ff;
+ val32 = rtl8xxxu_read32(priv,
+ REG_RX_POWER_AFTER_IQK_A_2);
+ result[t][3] = (val32 >> 16) & 0x3ff;
+
+ break;
+ }
+ }
+
+ if (!path_a_ok)
+ dev_dbg(dev, "%s: Path A RX IQK failed!\n", __func__);
+
+ if (priv->tx_paths > 1) {
+#if 1
+ dev_warn(dev, "%s: Path B not supported\n", __func__);
+#else
+
+ /*
+ * Path A into standby
+ */
+ val32 = rtl8xxxu_read32(priv, REG_FPGA0_IQK);
+ val32 &= 0x000000ff;
+ rtl8xxxu_write32(priv, REG_FPGA0_IQK, val32);
+ rtl8xxxu_write_rfreg(priv, RF_A, RF6052_REG_AC, 0x10000);
+
+ val32 = rtl8xxxu_read32(priv, REG_FPGA0_IQK);
+ val32 &= 0x000000ff;
+ val32 |= 0x80800000;
+ rtl8xxxu_write32(priv, REG_FPGA0_IQK, val32);
+
+ /* Turn Path B ADDA on */
+ rtl8xxxu_path_adda_on(priv, adda_regs, false);
+
+ for (i = 0; i < retry; i++) {
+ path_b_ok = rtl8xxxu_iqk_path_b(priv);
+ if (path_b_ok == 0x03) {
+ val32 = rtl8xxxu_read32(priv, REG_TX_POWER_BEFORE_IQK_B);
+ result[t][4] = (val32 >> 16) & 0x3ff;
+ val32 = rtl8xxxu_read32(priv, REG_TX_POWER_AFTER_IQK_B);
+ result[t][5] = (val32 >> 16) & 0x3ff;
+ break;
+ }
+ }
+
+ if (!path_b_ok)
+ dev_dbg(dev, "%s: Path B IQK failed!\n", __func__);
+
+ for (i = 0; i < retry; i++) {
+ path_b_ok = rtl8723bu_rx_iqk_path_b(priv);
+ if (path_a_ok == 0x03) {
+ val32 = rtl8xxxu_read32(priv,
+ REG_RX_POWER_BEFORE_IQK_B_2);
+ result[t][6] = (val32 >> 16) & 0x3ff;
+ val32 = rtl8xxxu_read32(priv,
+ REG_RX_POWER_AFTER_IQK_B_2);
+ result[t][7] = (val32 >> 16) & 0x3ff;
+ break;
+ }
+ }
+
+ if (!path_b_ok)
+ dev_dbg(dev, "%s: Path B RX IQK failed!\n", __func__);
+#endif
+ }
+
+ /* Back to BB mode, load original value */
+ val32 = rtl8xxxu_read32(priv, REG_FPGA0_IQK);
+ val32 &= 0x000000ff;
+ rtl8xxxu_write32(priv, REG_FPGA0_IQK, val32);
+
+ if (t) {
+ /* Reload ADDA power saving parameters */
+ rtl8xxxu_restore_regs(priv, adda_regs, priv->adda_backup,
+ RTL8XXXU_ADDA_REGS);
+
+ /* Reload MAC parameters */
+ rtl8xxxu_restore_mac_regs(priv, iqk_mac_regs, priv->mac_backup);
+
+ /* Reload BB parameters */
+ rtl8xxxu_restore_regs(priv, iqk_bb_regs,
+ priv->bb_backup, RTL8XXXU_BB_REGS);
+
+ /* Restore RX initial gain */
+ val32 = rtl8xxxu_read32(priv, REG_OFDM0_XA_AGC_CORE1);
+ val32 &= 0xffffff00;
+ rtl8xxxu_write32(priv, REG_OFDM0_XA_AGC_CORE1, val32 | 0x50);
+ rtl8xxxu_write32(priv, REG_OFDM0_XA_AGC_CORE1, val32 | xa_agc);
+
+ if (priv->tx_paths > 1) {
+ val32 = rtl8xxxu_read32(priv, REG_OFDM0_XB_AGC_CORE1);
+ val32 &= 0xffffff00;
+ rtl8xxxu_write32(priv, REG_OFDM0_XB_AGC_CORE1,
+ val32 | 0x50);
+ rtl8xxxu_write32(priv, REG_OFDM0_XB_AGC_CORE1,
+ val32 | xb_agc);
+ }
+
+ /* Load 0xe30 IQC default value */
+ rtl8xxxu_write32(priv, REG_TX_IQK_TONE_A, 0x01008c00);
+ rtl8xxxu_write32(priv, REG_RX_IQK_TONE_A, 0x01008c00);
+ }
+}
+
static void rtl8xxxu_prepare_calibrate(struct rtl8xxxu_priv *priv, u8 start)
{
struct h2c_cmd h2c;
@@ -3893,7 +4569,7 @@ static void rtl8xxxu_prepare_calibrate(struct rtl8xxxu_priv *priv, u8 start)
rtl8723a_h2c_cmd(priv, &h2c, sizeof(h2c.bt_wlan_calibration));
}
-static void rtl8723a_phy_iq_calibrate(struct rtl8xxxu_priv *priv)
+static void rtl8723au_phy_iq_calibrate(struct rtl8xxxu_priv *priv)
{
struct device *dev = &priv->udev->dev;
int result[4][8]; /* last is final result */
@@ -3997,6 +4673,133 @@ static void rtl8723a_phy_iq_calibrate(struct rtl8xxxu_priv *priv)
rtl8xxxu_prepare_calibrate(priv, 0);
}
+static void rtl8723bu_phy_iq_calibrate(struct rtl8xxxu_priv *priv)
+{
+ struct device *dev = &priv->udev->dev;
+ int result[4][8]; /* last is final result */
+ int i, candidate;
+ bool path_a_ok, path_b_ok;
+ u32 reg_e94, reg_e9c, reg_ea4, reg_eac;
+ u32 reg_eb4, reg_ebc, reg_ec4, reg_ecc;
+ u32 val32, bt_control;
+ s32 reg_tmp = 0;
+ bool simu;
+
+ rtl8xxxu_prepare_calibrate(priv, 1);
+
+ memset(result, 0, sizeof(result));
+ candidate = -1;
+
+ path_a_ok = false;
+ path_b_ok = false;
+
+ bt_control = rtl8xxxu_read32(priv, REG_BT_CONTROL_8723BU);
+
+ for (i = 0; i < 3; i++) {
+ rtl8723bu_phy_iqcalibrate(priv, result, i);
+
+ if (i == 1) {
+ simu = rtl8723bu_simularity_compare(priv, result, 0, 1);
+ if (simu) {
+ candidate = 0;
+ break;
+ }
+ }
+
+ if (i == 2) {
+ simu = rtl8723bu_simularity_compare(priv, result, 0, 2);
+ if (simu) {
+ candidate = 0;
+ break;
+ }
+
+ simu = rtl8723bu_simularity_compare(priv, result, 1, 2);
+ if (simu) {
+ candidate = 1;
+ } else {
+ for (i = 0; i < 8; i++)
+ reg_tmp += result[3][i];
+
+ if (reg_tmp)
+ candidate = 3;
+ else
+ candidate = -1;
+ }
+ }
+ }
+
+ for (i = 0; i < 4; i++) {
+ reg_e94 = result[i][0];
+ reg_e9c = result[i][1];
+ reg_ea4 = result[i][2];
+ reg_eac = result[i][3];
+ reg_eb4 = result[i][4];
+ reg_ebc = result[i][5];
+ reg_ec4 = result[i][6];
+ reg_ecc = result[i][7];
+ }
+
+ if (candidate >= 0) {
+ reg_e94 = result[candidate][0];
+ priv->rege94 = reg_e94;
+ reg_e9c = result[candidate][1];
+ priv->rege9c = reg_e9c;
+ reg_ea4 = result[candidate][2];
+ reg_eac = result[candidate][3];
+ reg_eb4 = result[candidate][4];
+ priv->regeb4 = reg_eb4;
+ reg_ebc = result[candidate][5];
+ priv->regebc = reg_ebc;
+ reg_ec4 = result[candidate][6];
+ reg_ecc = result[candidate][7];
+ dev_dbg(dev, "%s: candidate is %x\n", __func__, candidate);
+ dev_dbg(dev,
+ "%s: e94 =%x e9c=%x ea4=%x eac=%x eb4=%x ebc=%x ec4=%x "
+ "ecc=%x\n ", __func__, reg_e94, reg_e9c,
+ reg_ea4, reg_eac, reg_eb4, reg_ebc, reg_ec4, reg_ecc);
+ path_a_ok = true;
+ path_b_ok = true;
+ } else {
+ reg_e94 = reg_eb4 = priv->rege94 = priv->regeb4 = 0x100;
+ reg_e9c = reg_ebc = priv->rege9c = priv->regebc = 0x0;
+ }
+
+ if (reg_e94 && candidate >= 0)
+ rtl8xxxu_fill_iqk_matrix_a(priv, path_a_ok, result,
+ candidate, (reg_ea4 == 0));
+
+ if (priv->tx_paths > 1 && reg_eb4)
+ rtl8xxxu_fill_iqk_matrix_b(priv, path_b_ok, result,
+ candidate, (reg_ec4 == 0));
+
+ rtl8xxxu_save_regs(priv, rtl8723au_iqk_phy_iq_bb_reg,
+ priv->bb_recovery_backup, RTL8XXXU_BB_REGS);
+
+ rtl8xxxu_write32(priv, REG_BT_CONTROL_8723BU, bt_control);
+
+ val32 = rtl8xxxu_read_rfreg(priv, RF_A, RF6052_REG_WE_LUT);
+ val32 |= 0x80000;
+ rtl8xxxu_write_rfreg(priv, RF_A, RF6052_REG_WE_LUT, val32);
+ rtl8xxxu_write_rfreg(priv, RF_A, RF6052_REG_RCK_OS, 0x18000);
+ rtl8xxxu_write_rfreg(priv, RF_A, RF6052_REG_TXPA_G1, 0x0001f);
+ rtl8xxxu_write_rfreg(priv, RF_A, RF6052_REG_TXPA_G2, 0xe6177);
+ val32 = rtl8xxxu_read_rfreg(priv, RF_A, RF6052_REG_UNKNOWN_ED);
+ val32 |= 0x20;
+ rtl8xxxu_write_rfreg(priv, RF_A, RF6052_REG_UNKNOWN_ED, val32);
+ rtl8xxxu_write_rfreg(priv, RF_A, 0x43, 0x300bd);
+
+ if (priv->rf_paths > 1) {
+ dev_dbg(dev, "%s: beware 2T not yet supported\n", __func__);
+#ifdef RTL8723BU_PATH_B
+ if (RF_Path == 0x0) //S1
+ ODM_SetIQCbyRFpath(pDM_Odm, 0);
+ else //S0
+ ODM_SetIQCbyRFpath(pDM_Odm, 1);
+#endif
+ }
+ rtl8xxxu_prepare_calibrate(priv, 0);
+}
+
static void rtl8723a_phy_lc_calibrate(struct rtl8xxxu_priv *priv)
{
u32 val32;
@@ -4995,7 +5798,7 @@ static int rtl8xxxu_init_device(struct ieee80211_hw *hw)
rtl8xxxu_write16(priv, REG_FAST_EDCA_CTRL, 0);
- rtl8723a_phy_iq_calibrate(priv);
+ priv->fops->phy_iq_calibrate(priv);
/*
* This should enable thermal meter
@@ -6536,6 +7339,7 @@ static struct rtl8xxxu_fileops rtl8723au_fops = {
.load_firmware = rtl8723au_load_firmware,
.power_on = rtl8723au_power_on,
.llt_init = rtl8xxxu_init_llt_table,
+ .phy_iq_calibrate = rtl8723au_phy_iq_calibrate,
.writeN_block_size = 1024,
.mbox_ext_reg = REG_HMBOX_EXT_0,
.mbox_ext_width = 2,
@@ -6551,6 +7355,7 @@ static struct rtl8xxxu_fileops rtl8723bu_fops = {
.power_on = rtl8723au_power_on,
.llt_init = rtl8xxxu_auto_llt_table,
.phy_init_antenna_selection = rtl8723bu_phy_init_antenna_selection,
+ .phy_iq_calibrate = rtl8723bu_phy_iq_calibrate,
.writeN_block_size = 1024,
.mbox_ext_reg = REG_HMBOX_EXT0_8723B,
.mbox_ext_width = 4,
@@ -6567,6 +7372,7 @@ static struct rtl8xxxu_fileops rtl8192cu_fops = {
.load_firmware = rtl8192cu_load_firmware,
.power_on = rtl8192cu_power_on,
.llt_init = rtl8xxxu_init_llt_table,
+ .phy_iq_calibrate = rtl8723au_phy_iq_calibrate,
.writeN_block_size = 128,
.mbox_ext_reg = REG_HMBOX_EXT_0,
.mbox_ext_width = 2,
@@ -6583,6 +7389,7 @@ static struct rtl8xxxu_fileops rtl8192eu_fops = {
.load_firmware = rtl8192eu_load_firmware,
.power_on = rtl8192eu_power_on,
.llt_init = rtl8xxxu_auto_llt_table,
+ .phy_iq_calibrate = rtl8723bu_phy_iq_calibrate,
.writeN_block_size = 128,
.mbox_ext_reg = REG_HMBOX_EXT0_8723B,
.mbox_ext_width = 4,
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
index 4b8431d..76398de 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
@@ -851,6 +851,7 @@ struct rtl8xxxu_fileops {
int (*power_on) (struct rtl8xxxu_priv *priv);
int (*llt_init) (struct rtl8xxxu_priv *priv, u8 last_tx_page);
void (*phy_init_antenna_selection) (struct rtl8xxxu_priv *priv);
+ void (*phy_iq_calibrate) (struct rtl8xxxu_priv *priv);
int writeN_block_size;
u16 mbox_ext_reg;
char mbox_ext_width;
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
index 162a9e8..499210f 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
@@ -708,6 +708,12 @@
#define REG_MACID1 0x0700
#define REG_BSSID1 0x0708
+/*
+ * This seems to be 8723bu specific
+ */
+#define REG_BT_CONTROL_8723BU 0x0764
+#define BT_CONTROL_BT_GRANT BIT(12)
+
#define REG_FPGA0_RF_MODE 0x0800
#define FPGA_RF_MODE BIT(0)
#define FPGA_RF_MODE_JAPAN BIT(1)
@@ -810,6 +816,7 @@
#define REG_RFE_CTRL_ANTA_SRC 0x0930 /* 8723BU */
#define REG_RFE_PATH_SELECT 0x0940 /* 8723BU */
#define REG_RFE_BUFFER 0x0944 /* 8723BU */
+#define REG_S0S1_PATH_SWITCH 0x0948 /* 8723BU */
#define REG_CCK0_SYSTEM 0x0a00
#define CCK0_SIDEBAND BIT(4)
@@ -1050,3 +1057,13 @@
#define RF6052_REG_TXPA_G1 0x31 /* RF TX PA control */
#define RF6052_REG_TXPA_G2 0x32 /* RF TX PA control */
#define RF6052_REG_TXPA_G3 0x33 /* RF TX PA control */
+
+/*
+ * NextGen regs: 8723BU
+ */
+#define RF6052_REG_UNKNOWN_43 0x43
+#define RF6052_REG_UNKNOWN_55 0x55
+#define RF6052_REG_S0S1 0xb0
+#define RF6052_REG_UNKNOWN_DF 0xdf
+#define RF6052_REG_UNKNOWN_ED 0xed
+#define RF6052_REG_WE_LUT 0xef
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 038/113] rtl8xxxu: Handle S0S1 register in lc_calibrate()
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (36 preceding siblings ...)
2016-02-29 22:04 ` [PATCH 037/113] rtl8xxxu: First stab at adding IQK calibration for 8723bu parts Jes.Sorensen
@ 2016-02-29 22:04 ` Jes.Sorensen
2016-02-29 22:04 ` [PATCH 039/113] rtl8xxxu: Do LC calibration before IQK calibration Jes.Sorensen
` (75 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:04 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
Newer chips (8723bu/8192eu) has S0S1 settings which needs to be dealt
with during LC calibration.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 7 +++++++
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 1 +
2 files changed, 8 insertions(+)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index b2aa723..c990a09 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -4835,12 +4835,17 @@ static void rtl8723a_phy_lc_calibrate(struct rtl8xxxu_priv *priv)
}
/* Start LC calibration */
+ if (priv->fops->has_s0s1)
+ rtl8xxxu_write_rfreg(priv, RF_A, RF6052_REG_S0S1, 0xdfbe0);
val32 = rtl8xxxu_read_rfreg(priv, RF_A, RF6052_REG_MODE_AG);
val32 |= 0x08000;
rtl8xxxu_write_rfreg(priv, RF_A, RF6052_REG_MODE_AG, val32);
msleep(100);
+ if (priv->fops->has_s0s1)
+ rtl8xxxu_write_rfreg(priv, RF_A, RF6052_REG_S0S1, 0xdffe0);
+
/* Restore original parameters */
if (lstf & OFDM_LSTF_MASK) {
/* Path-A */
@@ -7359,6 +7364,7 @@ static struct rtl8xxxu_fileops rtl8723bu_fops = {
.writeN_block_size = 1024,
.mbox_ext_reg = REG_HMBOX_EXT0_8723B,
.mbox_ext_width = 4,
+ .has_s0s1 = 1,
.adda_1t_init = 0x01c00014,
.adda_1t_path_on = 0x01c00014,
.adda_2t_path_on_a = 0x01c00014,
@@ -7393,6 +7399,7 @@ static struct rtl8xxxu_fileops rtl8192eu_fops = {
.writeN_block_size = 128,
.mbox_ext_reg = REG_HMBOX_EXT0_8723B,
.mbox_ext_width = 4,
+ .has_s0s1 = 1,
.adda_1t_init = 0x0fc01616,
.adda_1t_path_on = 0x0fc01616,
.adda_2t_path_on_a = 0x0fc01616,
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
index 76398de..4a974a6 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
@@ -855,6 +855,7 @@ struct rtl8xxxu_fileops {
int writeN_block_size;
u16 mbox_ext_reg;
char mbox_ext_width;
+ char has_s0s1;
u32 adda_1t_init;
u32 adda_1t_path_on;
u32 adda_2t_path_on_a;
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 039/113] rtl8xxxu: Do LC calibration before IQK calibration
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (37 preceding siblings ...)
2016-02-29 22:04 ` [PATCH 038/113] rtl8xxxu: Handle S0S1 register in lc_calibrate() Jes.Sorensen
@ 2016-02-29 22:04 ` Jes.Sorensen
2016-02-29 22:04 ` [PATCH 040/113] rtl8xxxu: Remove backing up certain registers, which was never used Jes.Sorensen
` (74 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:04 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
This matches the flow of the vendor driver for newer hardware, and
doesn't seem to cause issues for the older parts.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index c990a09..a8385c7 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -5803,6 +5803,8 @@ static int rtl8xxxu_init_device(struct ieee80211_hw *hw)
rtl8xxxu_write16(priv, REG_FAST_EDCA_CTRL, 0);
+ rtl8723a_phy_lc_calibrate(priv);
+
priv->fops->phy_iq_calibrate(priv);
/*
@@ -5810,8 +5812,6 @@ static int rtl8xxxu_init_device(struct ieee80211_hw *hw)
*/
rtl8xxxu_write_rfreg(priv, RF_A, RF6052_REG_T_METER, 0x60);
- rtl8723a_phy_lc_calibrate(priv);
-
/* Init BT hw config. */
rtl8xxxu_init_bt(priv);
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 040/113] rtl8xxxu: Remove backing up certain registers, which was never used
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (38 preceding siblings ...)
2016-02-29 22:04 ` [PATCH 039/113] rtl8xxxu: Do LC calibration before IQK calibration Jes.Sorensen
@ 2016-02-29 22:04 ` Jes.Sorensen
2016-02-29 22:04 ` [PATCH 041/113] rtl8xxxu: rtl8192eu: Map out EFUSE TX power area Jes.Sorensen
` (73 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:04 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
This was inspired by the vendor driver, but in the end never used for
anything.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 14 --------------
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 3 ---
2 files changed, 17 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index a8385c7..e3e08da 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -5815,20 +5815,6 @@ static int rtl8xxxu_init_device(struct ieee80211_hw *hw)
/* Init BT hw config. */
rtl8xxxu_init_bt(priv);
- /*
- * Not sure if we really need to save these parameters, but the
- * vendor driver does
- */
- val32 = rtl8xxxu_read32(priv, REG_FPGA0_XA_HSSI_PARM2);
- if (val32 & FPGA0_HSSI_PARM2_CCK_HIGH_PWR)
- priv->path_a_hi_power = 1;
-
- val32 = rtl8xxxu_read32(priv, REG_OFDM0_TRX_PATH_ENABLE);
- priv->path_a_rf_paths = val32 & OFDM_RF_PATH_RX_MASK;
-
- val32 = rtl8xxxu_read32(priv, REG_OFDM0_XA_AGC_CORE1);
- priv->path_a_ig_value = val32 & OFDM0_X_AGC_CORE1_IGI_MASK;
-
/* Set NAV_UPPER to 30000us */
val8 = ((30000 + NAV_UPPER_UNIT - 1) / NAV_UPPER_UNIT);
rtl8xxxu_write8(priv, REG_NAV_UPPER, val8);
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
index 4a974a6..7b76e11 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
@@ -785,13 +785,10 @@ struct rtl8xxxu_priv {
u32 ep_tx_high_queue:1;
u32 ep_tx_normal_queue:1;
u32 ep_tx_low_queue:1;
- u32 path_a_hi_power:1;
- u32 path_a_rf_paths:4;
unsigned int pipe_interrupt;
unsigned int pipe_in;
unsigned int pipe_out[TXDESC_QUEUE_MAX];
u8 out_ep[RTL8XXXU_OUT_ENDPOINTS];
- u8 path_a_ig_value;
u8 ep_tx_count;
u8 rf_paths;
u8 rx_paths;
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 041/113] rtl8xxxu: rtl8192eu: Map out EFUSE TX power area
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (39 preceding siblings ...)
2016-02-29 22:04 ` [PATCH 040/113] rtl8xxxu: Remove backing up certain registers, which was never used Jes.Sorensen
@ 2016-02-29 22:04 ` Jes.Sorensen
2016-02-29 22:04 ` [PATCH 042/113] rtl8xxxu: Initial implementation of rtl8723bu_config_channel() Jes.Sorensen
` (72 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:04 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jakub Sitnicki, Jes Sorensen
From: Jakub Sitnicki <jsitnicki@gmail.com>
TX power values are laid out differently in EFUSE found in RTL8192EU &
RTL8188EU devices. TX power indices and differences for each RF path
are not interleaved (A, B, A, B), as in other chips, but follow one
another (A, B, C, D).
Signed-off-by: Jakub Sitnicki <jsitnicki@gmail.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 10 ----------
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 22 +++++++++++++++++-----
2 files changed, 17 insertions(+), 15 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index e3e08da..cd13524 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -2293,16 +2293,6 @@ static int rtl8192eu_parse_efuse(struct rtl8xxxu_priv *priv)
ether_addr_copy(priv->mac_addr, efuse->mac_addr);
- memcpy(priv->cck_tx_power_index_A, efuse->cck_tx_power_index_A,
- sizeof(priv->cck_tx_power_index_A));
- memcpy(priv->cck_tx_power_index_B, efuse->cck_tx_power_index_B,
- sizeof(priv->cck_tx_power_index_B));
-
- memcpy(priv->ht40_1s_tx_power_index_A, efuse->ht40_1s_tx_power_index_A,
- sizeof(priv->ht40_1s_tx_power_index_A));
- memcpy(priv->ht40_1s_tx_power_index_B, efuse->ht40_1s_tx_power_index_B,
- sizeof(priv->ht40_1s_tx_power_index_B));
-
dev_info(&priv->udev->dev, "Vendor: %.7s\n", efuse->vendor_name);
dev_info(&priv->udev->dev, "Product: %.11s\n", efuse->device_name);
dev_info(&priv->udev->dev, "Serial: %.11s\n", efuse->serial);
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
index 7b76e11..6c6bac2 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
@@ -543,14 +543,26 @@ struct rtl8723bu_efuse {
u8 res12[0x4];
};
+struct rtl8192eu_efuse_tx_power {
+ u8 cck_base[6];
+ u8 ht40_base[5];
+ struct rtl8723au_idx ht20_ofdm_1s_diff;
+ struct rtl8723au_idx ht40_ht20_2s_diff;
+ struct rtl8723au_idx ofdm_cck_2s_diff; /* not used */
+ struct rtl8723au_idx ht40_ht20_3s_diff;
+ struct rtl8723au_idx ofdm_cck_3s_diff; /* not used */
+ struct rtl8723au_idx ht40_ht20_4s_diff;
+ struct rtl8723au_idx ofdm_cck_4s_diff; /* not used */
+};
+
struct rtl8192eu_efuse {
__le16 rtl_id;
u8 res0[0x0e];
- u8 cck_tx_power_index_A[3]; /* 0x10 */
- u8 cck_tx_power_index_B[3];
- u8 ht40_1s_tx_power_index_A[3]; /* 0x16 */
- u8 ht40_1s_tx_power_index_B[3];
- u8 res1[0x9c];
+ struct rtl8192eu_efuse_tx_power tx_power_index_A; /* 0x10 */
+ struct rtl8192eu_efuse_tx_power tx_power_index_B; /* 0x22 */
+ struct rtl8192eu_efuse_tx_power tx_power_index_C; /* 0x34 */
+ struct rtl8192eu_efuse_tx_power tx_power_index_D; /* 0x46 */
+ u8 res1[0x60];
u8 channel_plan; /* 0xb8 */
u8 xtal_k;
u8 thermal_meter;
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 042/113] rtl8xxxu: Initial implementation of rtl8723bu_config_channel()
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (40 preceding siblings ...)
2016-02-29 22:04 ` [PATCH 041/113] rtl8xxxu: rtl8192eu: Map out EFUSE TX power area Jes.Sorensen
@ 2016-02-29 22:04 ` Jes.Sorensen
2016-03-10 14:26 ` Kalle Valo
2016-02-29 22:04 ` [PATCH 043/113] rtl8xxxu: Initial rtl8723bu_init_bt() code Jes.Sorensen
` (71 subsequent siblings)
113 siblings, 1 reply; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:04 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
This is a first stab of implementing rtl8723bu_config_channel(). For
now this will only do 20MHz channels.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 134 +++++++++++++++++++++
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 1 +
.../net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h | 14 +++
3 files changed, 149 insertions(+)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index cd13524..1626bd8 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -1777,6 +1777,136 @@ static void rtl8723au_config_channel(struct ieee80211_hw *hw)
}
}
+static void rtl8723bu_config_channel(struct ieee80211_hw *hw)
+{
+ struct rtl8xxxu_priv *priv = hw->priv;
+ u32 val32, rsr;
+ u8 val8, opmode, subchannel;
+ u16 rf_mode_bw;
+ bool ht = true;
+ int sec_ch_above, channel;
+ int i;
+
+ rf_mode_bw = rtl8xxxu_read16(priv, REG_WMAC_TRXPTCL_CTL);
+ rf_mode_bw &= ~WMAC_TRXPTCL_CTL_BW_MASK;
+ rsr = rtl8xxxu_read32(priv, REG_RESPONSE_RATE_SET);
+ channel = hw->conf.chandef.chan->hw_value;
+
+/* Hack */
+ subchannel = 0;
+
+ switch (hw->conf.chandef.width) {
+ case NL80211_CHAN_WIDTH_20_NOHT:
+ ht = false;
+ case NL80211_CHAN_WIDTH_20:
+ rf_mode_bw |= WMAC_TRXPTCL_CTL_BW_20;
+ subchannel = 0;
+
+ val32 = rtl8xxxu_read32(priv, REG_FPGA0_RF_MODE);
+ val32 &= ~FPGA_RF_MODE;
+ rtl8xxxu_write32(priv, REG_FPGA0_RF_MODE, val32);
+
+ val32 = rtl8xxxu_read32(priv, REG_FPGA1_RF_MODE);
+ val32 &= ~FPGA_RF_MODE;
+ rtl8xxxu_write32(priv, REG_FPGA1_RF_MODE, val32);
+
+ val32 = rtl8xxxu_read32(priv, REG_OFDM0_TX_PSDO_NOISE_WEIGHT);
+ val32 &= ~(BIT(30) | BIT(31));
+ rtl8xxxu_write32(priv, REG_OFDM0_TX_PSDO_NOISE_WEIGHT, val32);
+
+ break;
+ case NL80211_CHAN_WIDTH_40:
+ rf_mode_bw |= WMAC_TRXPTCL_CTL_BW_40;
+
+ if (hw->conf.chandef.center_freq1 >
+ hw->conf.chandef.chan->center_freq) {
+ sec_ch_above = 1;
+ channel += 2;
+ } else {
+ sec_ch_above = 0;
+ channel -= 2;
+ }
+
+ val32 = rtl8xxxu_read32(priv, REG_FPGA0_RF_MODE);
+ val32 |= FPGA_RF_MODE;
+ rtl8xxxu_write32(priv, REG_FPGA0_RF_MODE, val32);
+
+ val32 = rtl8xxxu_read32(priv, REG_FPGA1_RF_MODE);
+ val32 |= FPGA_RF_MODE;
+ rtl8xxxu_write32(priv, REG_FPGA1_RF_MODE, val32);
+
+ /*
+ * Set Control channel to upper or lower. These settings
+ * are required only for 40MHz
+ */
+ val32 = rtl8xxxu_read32(priv, REG_CCK0_SYSTEM);
+ val32 &= ~CCK0_SIDEBAND;
+ if (!sec_ch_above)
+ val32 |= CCK0_SIDEBAND;
+ rtl8xxxu_write32(priv, REG_CCK0_SYSTEM, val32);
+
+ val32 = rtl8xxxu_read32(priv, REG_OFDM1_LSTF);
+ val32 &= ~OFDM_LSTF_PRIME_CH_MASK; /* 0xc00 */
+ if (sec_ch_above)
+ val32 |= OFDM_LSTF_PRIME_CH_LOW;
+ else
+ val32 |= OFDM_LSTF_PRIME_CH_HIGH;
+ rtl8xxxu_write32(priv, REG_OFDM1_LSTF, val32);
+
+ val32 = rtl8xxxu_read32(priv, REG_FPGA0_POWER_SAVE);
+ val32 &= ~(FPGA0_PS_LOWER_CHANNEL | FPGA0_PS_UPPER_CHANNEL);
+ if (sec_ch_above)
+ val32 |= FPGA0_PS_UPPER_CHANNEL;
+ else
+ val32 |= FPGA0_PS_LOWER_CHANNEL;
+ rtl8xxxu_write32(priv, REG_FPGA0_POWER_SAVE, val32);
+ break;
+ case NL80211_CHAN_WIDTH_80:
+ rf_mode_bw |= WMAC_TRXPTCL_CTL_BW_80;
+ break;
+ default:
+ break;
+ }
+
+ for (i = RF_A; i < priv->rf_paths; i++) {
+ val32 = rtl8xxxu_read_rfreg(priv, i, RF6052_REG_MODE_AG);
+ val32 &= ~MODE_AG_CHANNEL_MASK;
+ val32 |= channel;
+ rtl8xxxu_write_rfreg(priv, i, RF6052_REG_MODE_AG, val32);
+ }
+
+ rtl8xxxu_write16(priv, REG_WMAC_TRXPTCL_CTL, rf_mode_bw);
+ rtl8xxxu_write8(priv, REG_DATA_SUBCHANNEL, subchannel);
+
+ if (ht)
+ val8 = 0x0e;
+ else
+ val8 = 0x0a;
+
+ rtl8xxxu_write8(priv, REG_SIFS_CCK + 1, val8);
+ rtl8xxxu_write8(priv, REG_SIFS_OFDM + 1, val8);
+
+ rtl8xxxu_write16(priv, REG_R2T_SIFS, 0x0808);
+ rtl8xxxu_write16(priv, REG_T2T_SIFS, 0x0a0a);
+
+ for (i = RF_A; i < priv->rf_paths; i++) {
+ val32 = rtl8xxxu_read_rfreg(priv, i, RF6052_REG_MODE_AG);
+ val32 &= ~MODE_AG_BW_MASK;
+ switch(hw->conf.chandef.width) {
+ case NL80211_CHAN_WIDTH_80:
+ val32 |= MODE_AG_BW_80MHZ_8723B;
+ break;
+ case NL80211_CHAN_WIDTH_40:
+ val32 |= MODE_AG_BW_40MHZ_8723B;
+ break;
+ default:
+ val32 |= MODE_AG_BW_20MHZ_8723B;
+ break;
+ }
+ rtl8xxxu_write_rfreg(priv, i, RF6052_REG_MODE_AG, val32);
+ }
+}
+
static void
rtl8723a_set_tx_power(struct rtl8xxxu_priv *priv, int channel, bool ht40)
{
@@ -7321,6 +7451,7 @@ static struct rtl8xxxu_fileops rtl8723au_fops = {
.power_on = rtl8723au_power_on,
.llt_init = rtl8xxxu_init_llt_table,
.phy_iq_calibrate = rtl8723au_phy_iq_calibrate,
+ .config_channel = rtl8723au_config_channel,
.writeN_block_size = 1024,
.mbox_ext_reg = REG_HMBOX_EXT_0,
.mbox_ext_width = 2,
@@ -7337,6 +7468,7 @@ static struct rtl8xxxu_fileops rtl8723bu_fops = {
.llt_init = rtl8xxxu_auto_llt_table,
.phy_init_antenna_selection = rtl8723bu_phy_init_antenna_selection,
.phy_iq_calibrate = rtl8723bu_phy_iq_calibrate,
+ .config_channel = rtl8723bu_config_channel,
.writeN_block_size = 1024,
.mbox_ext_reg = REG_HMBOX_EXT0_8723B,
.mbox_ext_width = 4,
@@ -7355,6 +7487,7 @@ static struct rtl8xxxu_fileops rtl8192cu_fops = {
.power_on = rtl8192cu_power_on,
.llt_init = rtl8xxxu_init_llt_table,
.phy_iq_calibrate = rtl8723au_phy_iq_calibrate,
+ .config_channel = rtl8723au_config_channel,
.writeN_block_size = 128,
.mbox_ext_reg = REG_HMBOX_EXT_0,
.mbox_ext_width = 2,
@@ -7372,6 +7505,7 @@ static struct rtl8xxxu_fileops rtl8192eu_fops = {
.power_on = rtl8192eu_power_on,
.llt_init = rtl8xxxu_auto_llt_table,
.phy_iq_calibrate = rtl8723bu_phy_iq_calibrate,
+ .config_channel = rtl8723bu_config_channel,
.writeN_block_size = 128,
.mbox_ext_reg = REG_HMBOX_EXT0_8723B,
.mbox_ext_width = 4,
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
index 6c6bac2..bce52cd 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
@@ -861,6 +861,7 @@ struct rtl8xxxu_fileops {
int (*llt_init) (struct rtl8xxxu_priv *priv, u8 last_tx_page);
void (*phy_init_antenna_selection) (struct rtl8xxxu_priv *priv);
void (*phy_iq_calibrate) (struct rtl8xxxu_priv *priv);
+ void (*config_channel) (struct ieee80211_hw *hw);
int writeN_block_size;
u16 mbox_ext_reg;
char mbox_ext_width;
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
index 499210f..147deba 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
@@ -473,6 +473,9 @@
#define REG_FAST_EDCA_CTRL 0x0460
#define REG_RD_RESP_PKT_TH 0x0463
#define REG_INIRTS_RATE_SEL 0x0480
+/* 8723bu */
+#define REG_DATA_SUBCHANNEL 0x0483
+/* 8723au */
#define REG_INIDATA_RATE_SEL 0x0484
#define REG_POWER_STATUS 0x04a4
@@ -658,6 +661,10 @@
#define REG_FWDLY 0x0661
#define REG_RXERR_RPT 0x0664
#define REG_WMAC_TRXPTCL_CTL 0x0668
+#define WMAC_TRXPTCL_CTL_BW_MASK (BIT(7) | BIT(8))
+#define WMAC_TRXPTCL_CTL_BW_20 0
+#define WMAC_TRXPTCL_CTL_BW_40 BIT(7)
+#define WMAC_TRXPTCL_CTL_BW_80 BIT(8)
/* Security */
#define REG_CAM_CMD 0x0670
@@ -872,6 +879,9 @@
#define REG_OFDM0_RX_IQ_EXT_ANTA 0x0ca0
+/* 8723bu */
+#define REG_OFDM0_TX_PSDO_NOISE_WEIGHT 0x0ce4
+
#define REG_OFDM1_LSTF 0x0d00
#define OFDM_LSTF_PRIME_CH_LOW BIT(10)
#define OFDM_LSTF_PRIME_CH_HIGH BIT(11)
@@ -1030,6 +1040,10 @@
#define RF6052_REG_MODE_AG 0x18 /* RF channel and BW switch */
#define MODE_AG_CHANNEL_MASK 0x3ff
#define MODE_AG_CHANNEL_20MHZ BIT(10)
+#define MODE_AG_BW_MASK (BIT(10) | BIT(11))
+#define MODE_AG_BW_20MHZ_8723B (BIT(10) | BIT(11))
+#define MODE_AG_BW_40MHZ_8723B BIT(10)
+#define MODE_AG_BW_80MHZ_8723B 0
#define RF6052_REG_TOP 0x19
#define RF6052_REG_RX_G1 0x1a
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 043/113] rtl8xxxu: Initial rtl8723bu_init_bt() code
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (41 preceding siblings ...)
2016-02-29 22:04 ` [PATCH 042/113] rtl8xxxu: Initial implementation of rtl8723bu_config_channel() Jes.Sorensen
@ 2016-02-29 22:04 ` Jes.Sorensen
2016-02-29 22:04 ` [PATCH 044/113] rtl8xxxu: Remove unused variable Jes.Sorensen
` (70 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:04 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
This should initialize the antennas on the 8723bu, but so far I am
still not receiving anything :( More work is needed.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 87 +++++++++++++++++++++-
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 15 +++-
.../net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h | 2 +
3 files changed, 98 insertions(+), 6 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 1626bd8..937b495 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -5603,10 +5603,87 @@ static void rtl8xxxu_power_off(struct rtl8xxxu_priv *priv)
rtl8xxxu_write8(priv, REG_RSV_CTRL, 0x0e);
}
-static void rtl8xxxu_init_bt(struct rtl8xxxu_priv *priv)
+static void rtl8723bu_init_bt(struct rtl8xxxu_priv *priv)
{
- if (!priv->has_bluetooth)
- return;
+ struct h2c_cmd h2c;
+ u32 val32;
+ u8 val8;
+
+ /*
+ * No indication anywhere as to what 0x0790 does. The 2 antenna
+ * vendor code preserves bits 6-7 here.
+ */
+ rtl8xxxu_write8(priv, 0x0790, 0x05);
+ /*
+ * 0x0778 seems to be related to enabling the number of antennas
+ * In the vendor driver halbtc8723b2ant_InitHwConfig() sets it
+ * to 0x03, while halbtc8723b1ant_InitHwConfig() sets it to 0x01
+ */
+ rtl8xxxu_write8(priv, 0x0778, 0x01);
+
+ val8 = rtl8xxxu_read8(priv, REG_GPIO_MUXCFG);
+ val8 |= BIT(5);
+ rtl8xxxu_write8(priv, REG_GPIO_MUXCFG, val8);
+
+ rtl8xxxu_write_rfreg(priv, RF_A, RF6052_REG_IQADJ_G1, 0x780);
+
+ /*
+ * Set BT grant to low
+ */
+ memset(&h2c, 0, sizeof(struct h2c_cmd));
+ h2c.bt_grant.cmd = H2C_8723B_BT_GRANT;
+ h2c.bt_grant.data = 0;
+ rtl8723a_h2c_cmd(priv, &h2c, sizeof(h2c.bt_grant));
+
+ /*
+ * WLAN action by PTA
+ */
+ rtl8xxxu_write8(priv, REG_WLAN_ACT_CONTROL_8723B, 0x0c);
+
+ /*
+ * BT select S0/S1 controlled by WiFi
+ */
+ val8 = rtl8xxxu_read8(priv, 0x0067);
+ val8 |= BIT(5);
+ rtl8xxxu_write8(priv, 0x0067, val8);
+
+ val32 = rtl8xxxu_read32(priv, REG_PWR_DATA);
+ val32 |= BIT(11);
+ rtl8xxxu_write32(priv, REG_PWR_DATA, val32);
+
+ /*
+ * Bits 6/7 are marked in/out ... but for what?
+ */
+ rtl8xxxu_write8(priv, 0x0974, 0xff);
+
+ val32 = rtl8xxxu_read32(priv, 0x0944);
+ val32 |= (BIT(0) | BIT(1));
+ rtl8xxxu_write32(priv, 0x0944, val32);
+
+ rtl8xxxu_write8(priv, REG_RFE_CTRL_ANTA_SRC, 0x77);
+
+ val32 = rtl8xxxu_read32(priv, REG_LEDCFG0);
+ val32 &= ~BIT(24);
+ val32 |= BIT(23);
+ rtl8xxxu_write32(priv, REG_LEDCFG0, val32);
+
+ /*
+ * Fix external switch Main->S1, Aux->S0
+ */
+ val8 = rtl8xxxu_read8(priv, REG_PAD_CTRL1);
+ val8 &= ~BIT(0);
+ rtl8xxxu_write8(priv, REG_PAD_CTRL1, val8);
+
+ memset(&h2c, 0, sizeof(struct h2c_cmd));
+ h2c.ant_sel_rsv.cmd = H2C_8723B_ANT_SEL_RSV;
+ h2c.ant_sel_rsv.ant_inverse = 1;
+ h2c.ant_sel_rsv.int_switch_type = 0;
+ rtl8723a_h2c_cmd(priv, &h2c, sizeof(h2c.ant_sel_rsv));
+
+ /*
+ * 0x280, 0x00, 0x200, 0x80 - not clear
+ */
+ rtl8xxxu_write32(priv, REG_S0S1_PATH_SWITCH, 0x280);
}
static int rtl8xxxu_init_device(struct ieee80211_hw *hw)
@@ -5933,7 +6010,8 @@ static int rtl8xxxu_init_device(struct ieee80211_hw *hw)
rtl8xxxu_write_rfreg(priv, RF_A, RF6052_REG_T_METER, 0x60);
/* Init BT hw config. */
- rtl8xxxu_init_bt(priv);
+ if (priv->fops->init_bt)
+ priv->fops->init_bt(priv);
/* Set NAV_UPPER to 30000us */
val8 = ((30000 + NAV_UPPER_UNIT - 1) / NAV_UPPER_UNIT);
@@ -7469,6 +7547,7 @@ static struct rtl8xxxu_fileops rtl8723bu_fops = {
.phy_init_antenna_selection = rtl8723bu_phy_init_antenna_selection,
.phy_iq_calibrate = rtl8723bu_phy_iq_calibrate,
.config_channel = rtl8723bu_config_channel,
+ .init_bt = rtl8723bu_init_bt,
.writeN_block_size = 1024,
.mbox_ext_reg = REG_HMBOX_EXT0_8723B,
.mbox_ext_width = 4,
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
index bce52cd..bcbdc78 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
@@ -696,8 +696,9 @@ enum h2c_cmd_8723b {
H2C_8723B_BT_MP_OPER = 0x67,
H2C_8723B_BT_CONTROL = 0x68,
H2C_8723B_BT_WIFI_CTRL = 0x69,
- H2C_8723B_BT_FW_PATCH = 0x6A,
- H2C_8723B_BT_WLAN_CALIBRATION = 0x6D,
+ H2C_8723B_BT_FW_PATCH = 0x6a,
+ H2C_8723B_BT_WLAN_CALIBRATION = 0x6d,
+ H2C_8723B_BT_GRANT = 0x6e,
/*
* WOWLAN Class: 100
@@ -743,6 +744,15 @@ struct h2c_cmd {
u8 cmd;
u8 data;
} __packed bt_wlan_calibration;
+ struct {
+ u8 cmd;
+ u8 ant_inverse;
+ u8 int_switch_type;
+ } __packed ant_sel_rsv;
+ struct {
+ u8 cmd;
+ u8 data;
+ } __packed bt_grant;
};
};
@@ -862,6 +872,7 @@ struct rtl8xxxu_fileops {
void (*phy_init_antenna_selection) (struct rtl8xxxu_priv *priv);
void (*phy_iq_calibrate) (struct rtl8xxxu_priv *priv);
void (*config_channel) (struct ieee80211_hw *hw);
+ void (*init_bt) (struct rtl8xxxu_priv *priv);
int writeN_block_size;
u16 mbox_ext_reg;
char mbox_ext_width;
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
index 147deba..248f64c 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
@@ -721,6 +721,8 @@
#define REG_BT_CONTROL_8723BU 0x0764
#define BT_CONTROL_BT_GRANT BIT(12)
+#define REG_WLAN_ACT_CONTROL_8723B 0x076e
+
#define REG_FPGA0_RF_MODE 0x0800
#define FPGA_RF_MODE BIT(0)
#define FPGA_RF_MODE_JAPAN BIT(1)
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 044/113] rtl8xxxu: Remove unused variable
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (42 preceding siblings ...)
2016-02-29 22:04 ` [PATCH 043/113] rtl8xxxu: Initial rtl8723bu_init_bt() code Jes.Sorensen
@ 2016-02-29 22:04 ` Jes.Sorensen
2016-02-29 22:04 ` [PATCH 045/113] rtl8xxxu: Improve 8723bu init code Jes.Sorensen
` (69 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:04 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
Remove an unused variable to make the compiler happy.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 937b495..0db6b3f 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -1781,7 +1781,7 @@ static void rtl8723bu_config_channel(struct ieee80211_hw *hw)
{
struct rtl8xxxu_priv *priv = hw->priv;
u32 val32, rsr;
- u8 val8, opmode, subchannel;
+ u8 val8, subchannel;
u16 rf_mode_bw;
bool ht = true;
int sec_ch_above, channel;
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 045/113] rtl8xxxu: Improve 8723bu init code
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (43 preceding siblings ...)
2016-02-29 22:04 ` [PATCH 044/113] rtl8xxxu: Remove unused variable Jes.Sorensen
@ 2016-02-29 22:04 ` Jes.Sorensen
2016-02-29 22:04 ` [PATCH 046/113] rtl8xxxu: Do not ignore wlan activity on 8723bu Jes.Sorensen
` (68 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:04 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
Implement additional init sequence code for the 8723bu.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 45 ++++++++++++++++++----
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 8 ++++
.../net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h | 5 ++-
3 files changed, 49 insertions(+), 9 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 0db6b3f..7dcf387 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -2984,14 +2984,18 @@ static int rtl8xxxu_init_phy_bb(struct rtl8xxxu_priv *priv)
* addresses, which is initialized here. Do we need this?
*/
- val8 = rtl8xxxu_read8(priv, REG_AFE_PLL_CTRL);
- udelay(2);
- val8 |= AFE_PLL_320_ENABLE;
- rtl8xxxu_write8(priv, REG_AFE_PLL_CTRL, val8);
- udelay(2);
+ if (priv->rtlchip == 0x8723b) {
+ rtl8xxxu_write32(priv, REG_S0S1_PATH_SWITCH, 0x00);
+ } else {
+ val8 = rtl8xxxu_read8(priv, REG_AFE_PLL_CTRL);
+ udelay(2);
+ val8 |= AFE_PLL_320_ENABLE;
+ rtl8xxxu_write8(priv, REG_AFE_PLL_CTRL, val8);
+ udelay(2);
- rtl8xxxu_write8(priv, REG_AFE_PLL_CTRL + 1, 0xff);
- udelay(2);
+ rtl8xxxu_write8(priv, REG_AFE_PLL_CTRL + 1, 0xff);
+ udelay(2);
+ }
val8 = rtl8xxxu_read8(priv, REG_SYS_FUNC);
val8 |= SYS_FUNC_BB_GLB_RSTN | SYS_FUNC_BBRSTB;
@@ -5603,6 +5607,21 @@ static void rtl8xxxu_power_off(struct rtl8xxxu_priv *priv)
rtl8xxxu_write8(priv, REG_RSV_CTRL, 0x0e);
}
+static void rtl8723bu_set_ps_tdma(struct rtl8xxxu_priv *priv,
+ u8 arg1, u8 arg2, u8 arg3, u8 arg4, u8 arg5)
+{
+ struct h2c_cmd h2c;
+
+ memset(&h2c, 0, sizeof(struct h2c_cmd));
+ h2c.b_type_dma.cmd = H2C_8723B_B_TYPE_TDMA;
+ h2c.b_type_dma.data1 = arg1;
+ h2c.b_type_dma.data2 = arg2;
+ h2c.b_type_dma.data3 = arg3;
+ h2c.b_type_dma.data4 = arg4;
+ h2c.b_type_dma.data5 = arg5;
+ rtl8723a_h2c_cmd(priv, &h2c, sizeof(h2c.b_type_dma));
+}
+
static void rtl8723bu_init_bt(struct rtl8xxxu_priv *priv)
{
struct h2c_cmd h2c;
@@ -5683,7 +5702,17 @@ static void rtl8723bu_init_bt(struct rtl8xxxu_priv *priv)
/*
* 0x280, 0x00, 0x200, 0x80 - not clear
*/
- rtl8xxxu_write32(priv, REG_S0S1_PATH_SWITCH, 0x280);
+ rtl8xxxu_write32(priv, REG_S0S1_PATH_SWITCH, 0x00);
+
+ /*
+ * Software control, antenna at WiFi side
+ */
+ rtl8723bu_set_ps_tdma(priv, 0x00, 0x00, 0x00, 0x00, 0x00);
+
+ rtl8xxxu_write32(priv, REG_BT_COEX_TABLE1, 0x55555555);
+ rtl8xxxu_write32(priv, REG_BT_COEX_TABLE2, 0x5a5a5a5a);
+ rtl8xxxu_write32(priv, REG_BT_COEX_TABLE3, 0x00ffffff);
+ rtl8xxxu_write32(priv, REG_BT_COEX_TABLE4, 0x00000003);
}
static int rtl8xxxu_init_device(struct ieee80211_hw *hw)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
index bcbdc78..c4c0b28 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
@@ -742,6 +742,14 @@ struct h2c_cmd {
} __packed ramask;
struct {
u8 cmd;
+ u8 data1;
+ u8 data2;
+ u8 data3;
+ u8 data4;
+ u8 data5;
+ } __packed b_type_dma;
+ struct {
+ u8 cmd;
u8 data;
} __packed bt_wlan_calibration;
struct {
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
index 248f64c..a82c0ba 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
@@ -709,7 +709,10 @@
#define REG_BCN_PSR_RPT 0x06a8
#define REG_CALB32K_CTRL 0x06ac
#define REG_PKT_MON_CTRL 0x06b4
-#define REG_BT_COEX_TABLE 0x06c0
+#define REG_BT_COEX_TABLE1 0x06c0
+#define REG_BT_COEX_TABLE2 0x06c4
+#define REG_BT_COEX_TABLE3 0x06c8
+#define REG_BT_COEX_TABLE4 0x06cc
#define REG_WMAC_RESP_TXINFO 0x06d8
#define REG_MACID1 0x0700
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 046/113] rtl8xxxu: Do not ignore wlan activity on 8723bu
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (44 preceding siblings ...)
2016-02-29 22:04 ` [PATCH 045/113] rtl8xxxu: Improve 8723bu init code Jes.Sorensen
@ 2016-02-29 22:04 ` Jes.Sorensen
2016-02-29 22:04 ` [PATCH 047/113] rtl8xxxu: Set the right type for ps tdma " Jes.Sorensen
` (67 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:04 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
The 8723bu is a WiFi/BT combo part. When initializing it for WiFi,
make sure to tell it not to ignore WiFi activity.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 5 +++++
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 4 ++++
2 files changed, 9 insertions(+)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 7dcf387..24c3157 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -5704,6 +5704,11 @@ static void rtl8723bu_init_bt(struct rtl8xxxu_priv *priv)
*/
rtl8xxxu_write32(priv, REG_S0S1_PATH_SWITCH, 0x00);
+ memset(&h2c, 0, sizeof(struct h2c_cmd));
+ h2c.ignore_wlan.cmd = H2C_8723B_BT_IGNORE_WLANACT;
+ h2c.ignore_wlan.data = 0;
+ rtl8723a_h2c_cmd(priv, &h2c, sizeof(h2c.ignore_wlan));
+
/*
* Software control, antenna at WiFi side
*/
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
index c4c0b28..5a6b223 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
@@ -754,6 +754,10 @@ struct h2c_cmd {
} __packed bt_wlan_calibration;
struct {
u8 cmd;
+ u8 data;
+ } __packed ignore_wlan;
+ struct {
+ u8 cmd;
u8 ant_inverse;
u8 int_switch_type;
} __packed ant_sel_rsv;
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 047/113] rtl8xxxu: Set the right type for ps tdma on 8723bu
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (45 preceding siblings ...)
2016-02-29 22:04 ` [PATCH 046/113] rtl8xxxu: Do not ignore wlan activity on 8723bu Jes.Sorensen
@ 2016-02-29 22:04 ` Jes.Sorensen
2016-02-29 22:04 ` [PATCH 048/113] rtl8xxxu: Add rtl8723bu (nextgen) rx descriptor definition Jes.Sorensen
` (66 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:04 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
Use the correct type when setting PS TDMA for 8723bu. This matches the
vendor driver.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 24c3157..6aa908e 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -5712,7 +5712,7 @@ static void rtl8723bu_init_bt(struct rtl8xxxu_priv *priv)
/*
* Software control, antenna at WiFi side
*/
- rtl8723bu_set_ps_tdma(priv, 0x00, 0x00, 0x00, 0x00, 0x00);
+ rtl8723bu_set_ps_tdma(priv, 0x08, 0x00, 0x00, 0x00, 0x00);
rtl8xxxu_write32(priv, REG_BT_COEX_TABLE1, 0x55555555);
rtl8xxxu_write32(priv, REG_BT_COEX_TABLE2, 0x5a5a5a5a);
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 048/113] rtl8xxxu: Add rtl8723bu (nextgen) rx descriptor definition
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (46 preceding siblings ...)
2016-02-29 22:04 ` [PATCH 047/113] rtl8xxxu: Set the right type for ps tdma " Jes.Sorensen
@ 2016-02-29 22:04 ` Jes.Sorensen
2016-02-29 22:04 ` [PATCH 049/113] rtl8xxxu: Handle 8723bu style rx descriptors Jes.Sorensen
` (65 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:04 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
The nextgen chips use a slightly different RX descriptor format. This
adds support for the new format.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 125 +++++++++++++++++++++++
1 file changed, 125 insertions(+)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
index 5a6b223..a8a4f2b 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
@@ -197,6 +197,131 @@ struct rtl8xxxu_rx_desc {
#endif
};
+struct rtl8723bu_rx_desc {
+#ifdef __LITTLE_ENDIAN
+ u32 pktlen:14;
+ u32 crc32:1;
+ u32 icverr:1;
+ u32 drvinfo_sz:4;
+ u32 security:3;
+ u32 qos:1;
+ u32 shift:2;
+ u32 phy_stats:1;
+ u32 swdec:1;
+ u32 ls:1;
+ u32 fs:1;
+ u32 eor:1;
+ u32 own:1;
+
+ u32 macid:7;
+ u32 dummy1_0:1;
+ u32 tid:4;
+ u32 dummy1_1:1;
+ u32 amsdu:1;
+ u32 rxid_match:1;
+ u32 paggr:1;
+ u32 a1fit:4; /* 16 */
+ u32 chkerr:1;
+ u32 ipver:1;
+ u32 tcpudp:1;
+ u32 chkvld:1;
+ u32 pam:1;
+ u32 pwr:1;
+ u32 more_data:1;
+ u32 more_frag:1;
+ u32 type:2;
+ u32 mc:1;
+ u32 bc:1;
+
+ u32 seq:12;
+ u32 frag:4;
+ u32 rx_is_qos:1; /* 16 */
+ u32 dummy2_0:1;
+ u32 wlanhd_iv_len:6;
+ u32 dummy2_1:4;
+ u32 rpt_sel:1;
+ u32 dummy2_2:3;
+
+ u32 rxmcs:7;
+ u32 dummy3_0:3;
+ u32 htc:1;
+ u32 eosp:1;
+ u32 bssidfit:2;
+ u32 dummy3_1:2;
+ u32 usb_agg_pktnum:8; /* 16 */
+ u32 dummy3_2:5;
+ u32 pattern_match:1;
+ u32 unicast_match:1;
+ u32 magic_match:1;
+
+ u32 splcp:1;
+ u32 ldcp:1;
+ u32 stbc:1;
+ u32 dummy4_0:1;
+ u32 bw:2;
+ u32 dummy4_1:26;
+#else
+ u32 own:1;
+ u32 eor:1;
+ u32 fs:1;
+ u32 ls:1;
+ u32 swdec:1;
+ u32 phy_stats:1;
+ u32 shift:2;
+ u32 qos:1;
+ u32 security:3;
+ u32 drvinfo_sz:4;
+ u32 icverr:1;
+ u32 crc32:1;
+ u32 pktlen:14;
+
+ u32 bc:1;
+ u32 mc:1;
+ u32 type:2;
+ u32 mf:1;
+ u32 md:1;
+ u32 pwr:1;
+ u32 pam:1;
+ u32 a2fit:4;
+ u32 a1fit:4;
+ u32 faggr:1;
+ u32 paggr:1;
+ u32 amsdu:1;
+ u32 hwrsvd:4;
+ u32 tid:4;
+ u32 macid:5;
+
+ u32 dummy2_2:3;
+ u32 rpt_sel:1;
+ u32 dummy2_1:4;
+ u32 wlanhd_iv_len:6;
+ u32 dummy2_0:1;
+ u32 rx_is_qos:1;
+ u32 frag:4; /* 16 */
+ u32 seq:12;
+
+ u32 magic_match:1;
+ u32 unicast_match:1;
+ u32 pattern_match:1;
+ u32 dummy3_2:5;
+ u32 usb_agg_pktnum:8;
+ u32 dummy3_1:2; /* 16 */
+ u32 bssidfit:2;
+ u32 eosp:1;
+ u32 htc:1;
+ u32 dummy3_0:3;
+ u32 rxmcs:7;
+
+ u32 dumm4_1:26;
+ u32 bw:2;
+ u32 dummy4_0:1;
+ u32 stbc:1;
+ u32 ldcp:1;
+ u32 splcp:1;
+#endif
+ __le32 tsfl;
+};
+
struct rtl8xxxu_tx_desc {
__le16 pkt_size;
u8 pkt_offset;
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 049/113] rtl8xxxu: Handle 8723bu style rx descriptors
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (47 preceding siblings ...)
2016-02-29 22:04 ` [PATCH 048/113] rtl8xxxu: Add rtl8723bu (nextgen) rx descriptor definition Jes.Sorensen
@ 2016-02-29 22:04 ` Jes.Sorensen
2016-02-29 22:04 ` [PATCH 050/113] rtl8xxxu: Initial functionality to handle C2H events for 8723bu Jes.Sorensen
` (64 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:04 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
This adds code to parse the new RX descriptor format used by the
8723bu/8192eu parts.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 125 +++++++++++++++++------
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 8 ++
2 files changed, 103 insertions(+), 30 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 6aa908e..b1b3e14 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -6730,6 +6730,91 @@ static void rtl8xxxu_rx_urb_work(struct work_struct *work)
}
}
+static int rtl8723au_parse_rx_desc(struct rtl8xxxu_priv *priv,
+ struct sk_buff *skb,
+ struct ieee80211_rx_status *rx_status)
+{
+ struct rtl8xxxu_rx_desc *rx_desc = (struct rtl8xxxu_rx_desc *)skb->data;
+ struct rtl8723au_phy_stats *phy_stats;
+ int drvinfo_sz, desc_shift;
+
+ skb_pull(skb, sizeof(struct rtl8xxxu_rx_desc));
+
+ phy_stats = (struct rtl8723au_phy_stats *)skb->data;
+
+ drvinfo_sz = rx_desc->drvinfo_sz * 8;
+ desc_shift = rx_desc->shift;
+ skb_pull(skb, drvinfo_sz + desc_shift);
+
+ if (rx_desc->phy_stats)
+ rtl8xxxu_rx_parse_phystats(priv, rx_status, rx_desc, phy_stats);
+
+ rx_status->mactime = le32_to_cpu(rx_desc->tsfl);
+ rx_status->flag |= RX_FLAG_MACTIME_START;
+
+ if (!rx_desc->swdec)
+ rx_status->flag |= RX_FLAG_DECRYPTED;
+ if (rx_desc->crc32)
+ rx_status->flag |= RX_FLAG_FAILED_FCS_CRC;
+ if (rx_desc->bw)
+ rx_status->flag |= RX_FLAG_40MHZ;
+
+ if (rx_desc->rxht) {
+ rx_status->flag |= RX_FLAG_HT;
+ rx_status->rate_idx = rx_desc->rxmcs - DESC_RATE_MCS0;
+ } else {
+ rx_status->rate_idx = rx_desc->rxmcs;
+ }
+
+ return RX_TYPE_DATA_PKT;
+}
+
+static int rtl8723bu_parse_rx_desc(struct rtl8xxxu_priv *priv,
+ struct sk_buff *skb,
+ struct ieee80211_rx_status *rx_status)
+{
+ struct rtl8723bu_rx_desc *rx_desc =
+ (struct rtl8723bu_rx_desc *)skb->data;
+ struct rtl8723au_phy_stats *phy_stats;
+ int drvinfo_sz, desc_shift;
+ int rx_type;
+
+ skb_pull(skb, sizeof(struct rtl8723bu_rx_desc));
+
+ phy_stats = (struct rtl8723au_phy_stats *)skb->data;
+
+ drvinfo_sz = rx_desc->drvinfo_sz * 8;
+ desc_shift = rx_desc->shift;
+ skb_pull(skb, drvinfo_sz + desc_shift);
+
+ rx_status->mactime = le32_to_cpu(rx_desc->tsfl);
+ rx_status->flag |= RX_FLAG_MACTIME_START;
+
+ if (!rx_desc->swdec)
+ rx_status->flag |= RX_FLAG_DECRYPTED;
+ if (rx_desc->crc32)
+ rx_status->flag |= RX_FLAG_FAILED_FCS_CRC;
+ if (rx_desc->bw)
+ rx_status->flag |= RX_FLAG_40MHZ;
+
+ if (rx_desc->rxmcs >= DESC_RATE_MCS0) {
+ rx_status->flag |= RX_FLAG_HT;
+ rx_status->rate_idx = rx_desc->rxmcs - DESC_RATE_MCS0;
+ } else {
+ rx_status->rate_idx = rx_desc->rxmcs;
+ }
+
+ if (rx_desc->rpt_sel) {
+ struct device *dev = &priv->udev->dev;
+ dev_dbg(dev, "%s: C2H packet\n", __func__);
+ rx_type = RX_TYPE_C2H;
+ } else {
+ rx_type = RX_TYPE_DATA_PKT;
+ }
+
+ return rx_type;
+}
+
static void rtl8xxxu_rx_complete(struct urb *urb)
{
struct rtl8xxxu_rx_urb *rx_urb =
@@ -6737,54 +6822,30 @@ static void rtl8xxxu_rx_complete(struct urb *urb)
struct ieee80211_hw *hw = rx_urb->hw;
struct rtl8xxxu_priv *priv = hw->priv;
struct sk_buff *skb = (struct sk_buff *)urb->context;
- struct rtl8xxxu_rx_desc *rx_desc = (struct rtl8xxxu_rx_desc *)skb->data;
- struct rtl8723au_phy_stats *phy_stats;
struct ieee80211_rx_status *rx_status = IEEE80211_SKB_RXCB(skb);
struct device *dev = &priv->udev->dev;
__le32 *_rx_desc_le = (__le32 *)skb->data;
u32 *_rx_desc = (u32 *)skb->data;
- int drvinfo_sz, desc_shift, i;
+ int rx_type, i;
for (i = 0; i < (sizeof(struct rtl8xxxu_rx_desc) / sizeof(u32)); i++)
_rx_desc[i] = le32_to_cpu(_rx_desc_le[i]);
- drvinfo_sz = rx_desc->drvinfo_sz * 8;
- desc_shift = rx_desc->shift;
skb_put(skb, urb->actual_length);
if (urb->status == 0) {
- skb_pull(skb, sizeof(struct rtl8xxxu_rx_desc));
- phy_stats = (struct rtl8723au_phy_stats *)skb->data;
-
- skb_pull(skb, drvinfo_sz + desc_shift);
-
memset(rx_status, 0, sizeof(struct ieee80211_rx_status));
- if (rx_desc->phy_stats)
- rtl8xxxu_rx_parse_phystats(priv, rx_status,
- rx_desc, phy_stats);
+ rx_type = priv->fops->parse_rx_desc(priv, skb, rx_status);
rx_status->freq = hw->conf.chandef.chan->center_freq;
rx_status->band = hw->conf.chandef.chan->band;
- rx_status->mactime = le32_to_cpu(rx_desc->tsfl);
- rx_status->flag |= RX_FLAG_MACTIME_START;
-
- if (!rx_desc->swdec)
- rx_status->flag |= RX_FLAG_DECRYPTED;
- if (rx_desc->crc32)
- rx_status->flag |= RX_FLAG_FAILED_FCS_CRC;
- if (rx_desc->bw)
- rx_status->flag |= RX_FLAG_40MHZ;
-
- if (rx_desc->rxht) {
- rx_status->flag |= RX_FLAG_HT;
- rx_status->rate_idx = rx_desc->rxmcs - DESC_RATE_MCS0;
- } else {
- rx_status->rate_idx = rx_desc->rxmcs;
- }
+ if (rx_type == RX_TYPE_DATA_PKT)
+ ieee80211_rx_irqsafe(hw, skb);
+ else
+ dev_kfree_skb(skb);
- ieee80211_rx_irqsafe(hw, skb);
skb = NULL;
rx_urb->urb.context = NULL;
rtl8xxxu_queue_rx_urb(priv, rx_urb);
@@ -7564,6 +7625,7 @@ static struct rtl8xxxu_fileops rtl8723au_fops = {
.llt_init = rtl8xxxu_init_llt_table,
.phy_iq_calibrate = rtl8723au_phy_iq_calibrate,
.config_channel = rtl8723au_config_channel,
+ .parse_rx_desc = rtl8723au_parse_rx_desc,
.writeN_block_size = 1024,
.mbox_ext_reg = REG_HMBOX_EXT_0,
.mbox_ext_width = 2,
@@ -7582,6 +7644,7 @@ static struct rtl8xxxu_fileops rtl8723bu_fops = {
.phy_iq_calibrate = rtl8723bu_phy_iq_calibrate,
.config_channel = rtl8723bu_config_channel,
.init_bt = rtl8723bu_init_bt,
+ .parse_rx_desc = rtl8723bu_parse_rx_desc,
.writeN_block_size = 1024,
.mbox_ext_reg = REG_HMBOX_EXT0_8723B,
.mbox_ext_width = 4,
@@ -7601,6 +7664,7 @@ static struct rtl8xxxu_fileops rtl8192cu_fops = {
.llt_init = rtl8xxxu_init_llt_table,
.phy_iq_calibrate = rtl8723au_phy_iq_calibrate,
.config_channel = rtl8723au_config_channel,
+ .parse_rx_desc = rtl8723au_parse_rx_desc,
.writeN_block_size = 128,
.mbox_ext_reg = REG_HMBOX_EXT_0,
.mbox_ext_width = 2,
@@ -7619,6 +7683,7 @@ static struct rtl8xxxu_fileops rtl8192eu_fops = {
.llt_init = rtl8xxxu_auto_llt_table,
.phy_iq_calibrate = rtl8723bu_phy_iq_calibrate,
.config_channel = rtl8723bu_config_channel,
+ .parse_rx_desc = rtl8723bu_parse_rx_desc,
.writeN_block_size = 128,
.mbox_ext_reg = REG_HMBOX_EXT0_8723B,
.mbox_ext_width = 4,
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
index a8a4f2b..4a3afe3 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
@@ -61,6 +61,12 @@
#define EFUSE_BT_MAP_LEN_8723A 1024
#define EFUSE_MAX_WORD_UNIT 4
+enum rtl8xxxu_rx_type {
+ RX_TYPE_DATA_PKT = 0,
+ RX_TYPE_C2H = 1,
+ RX_TYPE_ERROR = -1
+};
+
struct rtl8xxxu_rx_desc {
#ifdef __LITTLE_ENDIAN
u32 pktlen:14;
@@ -1010,6 +1016,8 @@ struct rtl8xxxu_fileops {
void (*phy_iq_calibrate) (struct rtl8xxxu_priv *priv);
void (*config_channel) (struct ieee80211_hw *hw);
void (*init_bt) (struct rtl8xxxu_priv *priv);
+ int (*parse_rx_desc) (struct rtl8xxxu_priv *priv, struct sk_buff *skb,
+ struct ieee80211_rx_status *rx_status);
int writeN_block_size;
u16 mbox_ext_reg;
char mbox_ext_width;
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 050/113] rtl8xxxu: Initial functionality to handle C2H events for 8723bu
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (48 preceding siblings ...)
2016-02-29 22:04 ` [PATCH 049/113] rtl8xxxu: Handle 8723bu style rx descriptors Jes.Sorensen
@ 2016-02-29 22:04 ` Jes.Sorensen
2016-02-29 22:04 ` [PATCH 051/113] rtl8xxxu: Handle BT register writes and MP_OPER events Jes.Sorensen
` (63 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:04 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
The 64 bit mailbox commands also provide a different method for
mailbox command responses (C2H events).
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 34 ++++++++++++++-
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 54 ++++++++++++++++++++++++
2 files changed, 87 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index b1b3e14..35e2522 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -6815,6 +6815,36 @@ static int rtl8723bu_parse_rx_desc(struct rtl8xxxu_priv *priv,
return rx_type;
}
+static void rtl8723bu_handle_c2h(struct rtl8xxxu_priv *priv,
+ struct sk_buff *skb)
+{
+ struct rtl8723bu_c2h *c2h = (struct rtl8723bu_c2h *)skb->data;
+ struct device *dev = &priv->udev->dev;
+ int len;
+
+ len = skb->len - 2;
+
+ pr_info("%s: C2H ID %02x seq %02x, len %02x %02x\n", __func__,
+ c2h->id, c2h->seq, len, c2h->bt_info.response_source);
+
+ switch(c2h->id) {
+ case C2H_8723B_BT_INFO:
+ if (c2h->bt_info.response_source >
+ BT_INFO_SRC_8723B_BT_ACTIVE_SEND)
+ dev_info(dev, "C2H_BT_INFO WiFi only firmware\n");
+ else
+ dev_info(dev, "C2H_BT_INFO BT/WiFi coexist firmware\n");
+
+ if (c2h->bt_info.bt_has_reset)
+ dev_info(dev, "BT has been reset\n");
+
+ break;
+ default:
+ pr_info("%s: Unhandled C2H event %02x\n", __func__, c2h->id);
+ break;
+ }
+}
+
static void rtl8xxxu_rx_complete(struct urb *urb)
{
struct rtl8xxxu_rx_urb *rx_urb =
@@ -6843,8 +6873,10 @@ static void rtl8xxxu_rx_complete(struct urb *urb)
if (rx_type == RX_TYPE_DATA_PKT)
ieee80211_rx_irqsafe(hw, skb);
- else
+ else {
+ rtl8723bu_handle_c2h(priv, skb);
dev_kfree_skb(skb);
+ }
skb = NULL;
rx_urb->urb.context = NULL;
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
index 4a3afe3..e4d5c4b 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
@@ -899,6 +899,60 @@ struct h2c_cmd {
};
};
+enum c2h_evt_8723b {
+ C2H_8723B_DEBUG = 0,
+ C2H_8723B_TSF = 1,
+ C2H_8723B_AP_RPT_RSP = 2,
+ C2H_8723B_CCX_TX_RPT = 3,
+ C2H_8723B_BT_RSSI = 4,
+ C2H_8723B_BT_OP_MODE = 5,
+ C2H_8723B_EXT_RA_RPT = 6,
+ C2H_8723B_BT_INFO = 9,
+ C2H_8723B_HW_INFO_EXCH = 10,
+ C2H_8723B_BT_MP_INFO = 11,
+ C2H_8723B_FW_DEBUG = 0xff,
+};
+
+enum bt_info_src_8723b {
+ BT_INFO_SRC_8723B_WIFI_FW = 0x0,
+ BT_INFO_SRC_8723B_BT_RSP = 0x1,
+ BT_INFO_SRC_8723B_BT_ACTIVE_SEND = 0x2,
+};
+
+struct rtl8723bu_c2h {
+ u8 id;
+ u8 seq;
+ union {
+ struct {
+ u8 payload[0];
+ } __packed raw;
+ struct {
+ u8 response_source:4;
+ u8 dummy0_0:4;
+
+ u8 bt_info;
+
+ u8 retry_count:4;
+ u8 dummy2_0:1;
+ u8 bt_page:1;
+ u8 tx_rx_mask:1;
+ u8 dummy2_2:1;
+
+ u8 rssi;
+
+ u8 basic_rate:1;
+ u8 bt_has_reset:1;
+ u8 dummy4_1:1;;
+ u8 ignore_wlan:1;
+ u8 auto_report:1;
+ u8 dummy4_2:3;
+
+ u8 a4;
+ u8 a5;
+ } __packed bt_info;
+ };
+};
+
struct rtl8xxxu_fileops;
struct rtl8xxxu_priv {
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 051/113] rtl8xxxu: Handle BT register writes and MP_OPER events
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (49 preceding siblings ...)
2016-02-29 22:04 ` [PATCH 050/113] rtl8xxxu: Initial functionality to handle C2H events for 8723bu Jes.Sorensen
@ 2016-02-29 22:04 ` Jes.Sorensen
2016-02-29 22:04 ` [PATCH 052/113] rtl8xxxu: Issue BT_INFO command Jes.Sorensen
` (62 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:04 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
8723bu BT registers are written via the mailbox interface. Add support
for writing these and corresponding C2H event responses.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 34 +++++++++++++-
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 59 +++++++++++++++++++++++-
2 files changed, 89 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 35e2522..8535883 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -1531,6 +1531,27 @@ error:
return retval;
}
+static void rtl8723bu_write_btreg(struct rtl8xxxu_priv *priv, u8 reg, u8 data)
+{
+ struct h2c_cmd h2c;
+ int reqnum = 0;
+
+ memset(&h2c, 0, sizeof(struct h2c_cmd));
+ h2c.bt_mp_oper.cmd = H2C_8723B_BT_MP_OPER;
+ h2c.bt_mp_oper.operreq = 0 | (reqnum << 4);
+ h2c.bt_mp_oper.opcode = BT_MP_OP_WRITE_REG_VALUE;
+ h2c.bt_mp_oper.data = data;
+ rtl8723a_h2c_cmd(priv, &h2c, sizeof(h2c.bt_mp_oper));
+
+ reqnum++;
+ memset(&h2c, 0, sizeof(struct h2c_cmd));
+ h2c.bt_mp_oper.cmd = H2C_8723B_BT_MP_OPER;
+ h2c.bt_mp_oper.operreq = 0 | (reqnum << 4);
+ h2c.bt_mp_oper.opcode = BT_MP_OP_WRITE_REG_VALUE;
+ h2c.bt_mp_oper.addr = reg;
+ rtl8723a_h2c_cmd(priv, &h2c, sizeof(h2c.bt_mp_oper));
+}
+
static void rtl8723a_enable_rf(struct rtl8xxxu_priv *priv)
{
u8 val8;
@@ -5646,6 +5667,8 @@ static void rtl8723bu_init_bt(struct rtl8xxxu_priv *priv)
rtl8xxxu_write_rfreg(priv, RF_A, RF6052_REG_IQADJ_G1, 0x780);
+ rtl8723bu_write_btreg(priv, 0x3c, 0x15); /* BT TRx Mask on */
+
/*
* Set BT grant to low
*/
@@ -6824,8 +6847,9 @@ static void rtl8723bu_handle_c2h(struct rtl8xxxu_priv *priv,
len = skb->len - 2;
- pr_info("%s: C2H ID %02x seq %02x, len %02x %02x\n", __func__,
- c2h->id, c2h->seq, len, c2h->bt_info.response_source);
+ dev_info(dev, "%s: C2H ID %02x seq %02x, len %02x source %02x\n",
+ __func__,
+ c2h->id, c2h->seq, len, c2h->bt_info.response_source);
switch(c2h->id) {
case C2H_8723B_BT_INFO:
@@ -6837,8 +6861,14 @@ static void rtl8723bu_handle_c2h(struct rtl8xxxu_priv *priv,
if (c2h->bt_info.bt_has_reset)
dev_info(dev, "BT has been reset\n");
+ if (c2h->bt_info.tx_rx_mask)
+ dev_info(dev, "BT TRx mask\n");
break;
+ case C2H_8723B_BT_MP_INFO:
+ dev_info(dev, "C2H_MP_INFO ext ID %02x, status %02x\n",
+ c2h->bt_mp_info.ext_id, c2h->bt_mp_info.status);
+ break;
default:
pr_info("%s: Unhandled C2H event %02x\n", __func__, c2h->id);
break;
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
index e4d5c4b..3e4e355 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
@@ -881,6 +881,13 @@ struct h2c_cmd {
} __packed b_type_dma;
struct {
u8 cmd;
+ u8 operreq;
+ u8 opcode;
+ u8 data;
+ u8 addr;
+ } __packed bt_mp_oper;
+ struct {
+ u8 cmd;
u8 data;
} __packed bt_wlan_calibration;
struct {
@@ -908,8 +915,8 @@ enum c2h_evt_8723b {
C2H_8723B_BT_OP_MODE = 5,
C2H_8723B_EXT_RA_RPT = 6,
C2H_8723B_BT_INFO = 9,
- C2H_8723B_HW_INFO_EXCH = 10,
- C2H_8723B_BT_MP_INFO = 11,
+ C2H_8723B_HW_INFO_EXCH = 0x0a,
+ C2H_8723B_BT_MP_INFO = 0x0b,
C2H_8723B_FW_DEBUG = 0xff,
};
@@ -919,6 +926,46 @@ enum bt_info_src_8723b {
BT_INFO_SRC_8723B_BT_ACTIVE_SEND = 0x2,
};
+enum bt_mp_oper_opcode_8723b {
+ BT_MP_OP_GET_BT_VERSION = 0x00,
+ BT_MP_OP_RESET = 0x01,
+ BT_MP_OP_TEST_CTRL = 0x02,
+ BT_MP_OP_SET_BT_MODE = 0x03,
+ BT_MP_OP_SET_CHNL_TX_GAIN = 0x04,
+ BT_MP_OP_SET_PKT_TYPE_LEN = 0x05,
+ BT_MP_OP_SET_PKT_CNT_L_PL_TYPE = 0x06,
+ BT_MP_OP_SET_PKT_CNT_H_PKT_INTV = 0x07,
+ BT_MP_OP_SET_PKT_HEADER = 0x08,
+ BT_MP_OP_SET_WHITENCOEFF = 0x09,
+ BT_MP_OP_SET_BD_ADDR_L = 0x0a,
+ BT_MP_OP_SET_BD_ADDR_H = 0x0b,
+ BT_MP_OP_WRITE_REG_ADDR = 0x0c,
+ BT_MP_OP_WRITE_REG_VALUE = 0x0d,
+ BT_MP_OP_GET_BT_STATUS = 0x0e,
+ BT_MP_OP_GET_BD_ADDR_L = 0x0f,
+ BT_MP_OP_GET_BD_ADDR_H = 0x10,
+ BT_MP_OP_READ_REG = 0x11,
+ BT_MP_OP_SET_TARGET_BD_ADDR_L = 0x12,
+ BT_MP_OP_SET_TARGET_BD_ADDR_H = 0x13,
+ BT_MP_OP_SET_TX_POWER_CALIBRATION = 0x14,
+ BT_MP_OP_GET_RX_PKT_CNT_L = 0x15,
+ BT_MP_OP_GET_RX_PKT_CNT_H = 0x16,
+ BT_MP_OP_GET_RX_ERROR_BITS_L = 0x17,
+ BT_MP_OP_GET_RX_ERROR_BITS_H = 0x18,
+ BT_MP_OP_GET_RSSI = 0x19,
+ BT_MP_OP_GET_CFO_HDR_QUALITY_L = 0x1a,
+ BT_MP_OP_GET_CFO_HDR_QUALITY_H = 0x1b,
+ BT_MP_OP_GET_TARGET_BD_ADDR_L = 0x1c,
+ BT_MP_OP_GET_TARGET_BD_ADDR_H = 0x1d,
+ BT_MP_OP_GET_AFH_MAP_L = 0x1e,
+ BT_MP_OP_GET_AFH_MAP_M = 0x1f,
+ BT_MP_OP_GET_AFH_MAP_H = 0x20,
+ BT_MP_OP_GET_AFH_STATUS = 0x21,
+ BT_MP_OP_SET_TRACKING_INTERVAL = 0x22,
+ BT_MP_OP_SET_THERMAL_METER = 0x23,
+ BT_MP_OP_ENABLE_CFO_TRACKING = 0x24,
+};
+
struct rtl8723bu_c2h {
u8 id;
u8 seq;
@@ -927,6 +974,14 @@ struct rtl8723bu_c2h {
u8 payload[0];
} __packed raw;
struct {
+ u8 ext_id;
+ u8 status:4;
+ u8 retlen:4;
+ u8 opcode_ver:4;
+ u8 req_num:4;
+ u8 payload[2];
+ } __packed bt_mp_info;
+ struct {
u8 response_source:4;
u8 dummy0_0:4;
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 052/113] rtl8xxxu: Issue BT_INFO command
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (50 preceding siblings ...)
2016-02-29 22:04 ` [PATCH 051/113] rtl8xxxu: Handle BT register writes and MP_OPER events Jes.Sorensen
@ 2016-02-29 22:04 ` Jes.Sorensen
2016-02-29 22:04 ` [PATCH 053/113] rtl8xxxu: Do not set REG_AFE_XTAL_CTRL on 8723bu Jes.Sorensen
` (61 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:04 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
Issue a BT_INFO command to verify the status of BT/WiFi settings.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 18 +++++++++++-------
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 4 ++++
2 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 8535883..bb2ad9b 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -5727,20 +5727,25 @@ static void rtl8723bu_init_bt(struct rtl8xxxu_priv *priv)
*/
rtl8xxxu_write32(priv, REG_S0S1_PATH_SWITCH, 0x00);
- memset(&h2c, 0, sizeof(struct h2c_cmd));
- h2c.ignore_wlan.cmd = H2C_8723B_BT_IGNORE_WLANACT;
- h2c.ignore_wlan.data = 0;
- rtl8723a_h2c_cmd(priv, &h2c, sizeof(h2c.ignore_wlan));
-
/*
* Software control, antenna at WiFi side
*/
rtl8723bu_set_ps_tdma(priv, 0x08, 0x00, 0x00, 0x00, 0x00);
+ memset(&h2c, 0, sizeof(struct h2c_cmd));
+ h2c.bt_info.cmd = H2C_8723B_BT_INFO;
+ h2c.bt_info.data = BIT(0);
+ rtl8723a_h2c_cmd(priv, &h2c, sizeof(h2c.bt_info));
+
rtl8xxxu_write32(priv, REG_BT_COEX_TABLE1, 0x55555555);
rtl8xxxu_write32(priv, REG_BT_COEX_TABLE2, 0x5a5a5a5a);
rtl8xxxu_write32(priv, REG_BT_COEX_TABLE3, 0x00ffffff);
rtl8xxxu_write32(priv, REG_BT_COEX_TABLE4, 0x00000003);
+
+ memset(&h2c, 0, sizeof(struct h2c_cmd));
+ h2c.ignore_wlan.cmd = H2C_8723B_BT_IGNORE_WLANACT;
+ h2c.ignore_wlan.data = 0;
+ rtl8723a_h2c_cmd(priv, &h2c, sizeof(h2c.ignore_wlan));
}
static int rtl8xxxu_init_device(struct ieee80211_hw *hw)
@@ -6847,8 +6852,7 @@ static void rtl8723bu_handle_c2h(struct rtl8xxxu_priv *priv,
len = skb->len - 2;
- dev_info(dev, "%s: C2H ID %02x seq %02x, len %02x source %02x\n",
- __func__,
+ dev_info(dev, "C2H ID %02x seq %02x, len %02x source %02x\n",
c2h->id, c2h->seq, len, c2h->bt_info.response_source);
switch(c2h->id) {
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
index 3e4e355..ea0b28a 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
@@ -881,6 +881,10 @@ struct h2c_cmd {
} __packed b_type_dma;
struct {
u8 cmd;
+ u8 data;
+ } __packed bt_info;
+ struct {
+ u8 cmd;
u8 operreq;
u8 opcode;
u8 data;
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 053/113] rtl8xxxu: Do not set REG_AFE_XTAL_CTRL on 8723bu
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (51 preceding siblings ...)
2016-02-29 22:04 ` [PATCH 052/113] rtl8xxxu: Issue BT_INFO command Jes.Sorensen
@ 2016-02-29 22:04 ` Jes.Sorensen
2016-02-29 22:04 ` [PATCH 054/113] rtl8xxxu: Implement 8723bu power on sequence Jes.Sorensen
` (60 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:04 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
The 8723bu does not like REG_AFE_XTAL_CTRL being set, so skip this for
now, to match the vendor driver.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 21 ++++++++++++---------
1 file changed, 12 insertions(+), 9 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index bb2ad9b..7f17e69 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -2998,6 +2998,7 @@ static int rtl8xxxu_init_phy_regs(struct rtl8xxxu_priv *priv,
static int rtl8xxxu_init_phy_bb(struct rtl8xxxu_priv *priv)
{
u8 val8, ldoa15, ldov12d, lpldo, ldohci12;
+ u16 val16;
u32 val32;
/*
@@ -3018,16 +3019,18 @@ static int rtl8xxxu_init_phy_bb(struct rtl8xxxu_priv *priv)
udelay(2);
}
- val8 = rtl8xxxu_read8(priv, REG_SYS_FUNC);
- val8 |= SYS_FUNC_BB_GLB_RSTN | SYS_FUNC_BBRSTB;
- rtl8xxxu_write8(priv, REG_SYS_FUNC, val8);
+ val16 = rtl8xxxu_read16(priv, REG_SYS_FUNC);
+ val16 |= SYS_FUNC_BB_GLB_RSTN | SYS_FUNC_BBRSTB;
+ rtl8xxxu_write16(priv, REG_SYS_FUNC, val16);
- /* AFE_XTAL_RF_GATE (bit 14) if addressing as 32 bit register */
- val32 = rtl8xxxu_read32(priv, REG_AFE_XTAL_CTRL);
- val32 &= ~AFE_XTAL_RF_GATE;
- if (priv->has_bluetooth)
- val32 &= ~AFE_XTAL_BT_GATE;
- rtl8xxxu_write32(priv, REG_AFE_XTAL_CTRL, val32);
+ if (priv->rtlchip != 0x8723b) {
+ /* AFE_XTAL_RF_GATE (bit 14) if addressing as 32 bit register */
+ val32 = rtl8xxxu_read32(priv, REG_AFE_XTAL_CTRL);
+ val32 &= ~AFE_XTAL_RF_GATE;
+ if (priv->has_bluetooth)
+ val32 &= ~AFE_XTAL_BT_GATE;
+ rtl8xxxu_write32(priv, REG_AFE_XTAL_CTRL, val32);
+ }
/* 6. 0x1f[7:0] = 0x07 */
val8 = RF_ENABLE | RF_RSTB | RF_SDMRSTB;
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 054/113] rtl8xxxu: Implement 8723bu power on sequence
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (52 preceding siblings ...)
2016-02-29 22:04 ` [PATCH 053/113] rtl8xxxu: Do not set REG_AFE_XTAL_CTRL on 8723bu Jes.Sorensen
@ 2016-02-29 22:04 ` Jes.Sorensen
2016-03-10 14:32 ` Kalle Valo
2016-02-29 22:04 ` [PATCH 055/113] rtl8xxxu: Setup LLT before downloading firmware Jes.Sorensen
` (59 subsequent siblings)
113 siblings, 1 reply; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:04 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
This implements the 8723bu specific power on sequence as it is
different from that of the 8723au chips.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 183 ++++++++++++++++++++-
.../net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h | 11 ++
2 files changed, 189 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 7f17e69..a8b7b75 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -2933,10 +2933,6 @@ static void rtl8723bu_phy_init_antenna_selection(struct rtl8xxxu_priv *priv)
val32 &= 0xffffff00;
val32 |= 0x77;
rtl8xxxu_write32(priv, 0x0930, val32);
-
- val32 = rtl8xxxu_read32(priv, REG_PWR_DATA);
- val32 |= BIT(11);
- rtl8xxxu_write32(priv, REG_PWR_DATA, val32);
}
static int
@@ -5359,6 +5355,127 @@ exit:
return ret;
}
+static int rtl8723b_emu_to_active(struct rtl8xxxu_priv *priv)
+{
+ u8 val8;
+ u32 val32;
+ int count, ret = 0;
+
+ /* 0x20[0] = 1 enable LDOA12 MACRO block for all interface */
+ val8 = rtl8xxxu_read8(priv, REG_LDOA15_CTRL);
+ val8 |= LDOA15_ENABLE;
+ rtl8xxxu_write8(priv, REG_LDOA15_CTRL, val8);
+
+ /* 0x67[0] = 0 to disable BT_GPS_SEL pins*/
+ val8 = rtl8xxxu_read8(priv, 0x0067);
+ val8 &= ~BIT(4);
+ rtl8xxxu_write8(priv, 0x0067, val8);
+
+ mdelay(1);
+
+ /* 0x00[5] = 0 release analog Ips to digital, 1:isolation */
+ val8 = rtl8xxxu_read8(priv, REG_SYS_ISO_CTRL);
+ val8 &= ~SYS_ISO_ANALOG_IPS;
+ rtl8xxxu_write8(priv, REG_SYS_ISO_CTRL, val8);
+
+ /* Disable SW LPS 0x04[10]= 0 */
+ val32 = rtl8xxxu_read8(priv, REG_APS_FSMCO);
+ val32 &= ~APS_FSMCO_SW_LPS;
+ rtl8xxxu_write32(priv, REG_APS_FSMCO, val32);
+
+ /* Wait until 0x04[17] = 1 power ready */
+ for (count = RTL8XXXU_MAX_REG_POLL; count; count--) {
+ val32 = rtl8xxxu_read32(priv, REG_APS_FSMCO);
+ if (val32 & BIT(17))
+ break;
+
+ udelay(10);
+ }
+
+ if (!count) {
+ ret = -EBUSY;
+ goto exit;
+ }
+
+ /* We should be able to optimize the following three entries into one */
+
+ /* Release WLON reset 0x04[16]= 1*/
+ val32 = rtl8xxxu_read32(priv, REG_APS_FSMCO);
+ val32 |= APS_FSMCO_WLON_RESET;
+ rtl8xxxu_write32(priv, REG_APS_FSMCO, val32);
+
+ /* Disable HWPDN 0x04[15]= 0*/
+ val32 = rtl8xxxu_read32(priv, REG_APS_FSMCO);
+ val32 &= ~APS_FSMCO_HW_POWERDOWN;
+ rtl8xxxu_write32(priv, REG_APS_FSMCO, val32);
+
+ /* Disable WL suspend*/
+ val32 = rtl8xxxu_read32(priv, REG_APS_FSMCO);
+ val32 &= ~(APS_FSMCO_HW_SUSPEND | APS_FSMCO_PCIE);
+ rtl8xxxu_write32(priv, REG_APS_FSMCO, val32);
+
+ /* Set, then poll until 0 */
+ val32 = rtl8xxxu_read32(priv, REG_APS_FSMCO);
+ val32 |= APS_FSMCO_MAC_ENABLE;
+ rtl8xxxu_write32(priv, REG_APS_FSMCO, val32);
+
+ for (count = RTL8XXXU_MAX_REG_POLL; count; count--) {
+ val32 = rtl8xxxu_read32(priv, REG_APS_FSMCO);
+ if ((val32 & APS_FSMCO_MAC_ENABLE) == 0) {
+ ret = 0;
+ break;
+ }
+ udelay(10);
+ }
+
+ if (!count) {
+ ret = -EBUSY;
+ goto exit;
+ }
+
+ /* Enable WL control XTAL setting */
+ val8 = rtl8xxxu_read8(priv, REG_AFE_MISC);
+ val8 |= AFE_MISC_WL_XTAL_CTRL;
+ rtl8xxxu_write8(priv, REG_AFE_MISC, val8);
+
+ /* Enable falling edge triggering interrupt */
+ val8 = rtl8xxxu_read8(priv, REG_GPIO_INTM + 1);
+ val8 |= BIT(1);
+ rtl8xxxu_write8(priv, REG_GPIO_INTM + 1, val8);
+
+ /* Enable GPIO9 interrupt mode */
+ val8 = rtl8xxxu_read8(priv, REG_GPIO_IO_SEL_2 + 1);
+ val8 |= BIT(1);
+ rtl8xxxu_write8(priv, REG_GPIO_IO_SEL_2 + 1, val8);
+
+ /* Enable GPIO9 input mode */
+ val8 = rtl8xxxu_read8(priv, REG_GPIO_IO_SEL_2);
+ val8 &= ~BIT(1);
+ rtl8xxxu_write8(priv, REG_GPIO_IO_SEL_2, val8);
+
+ /* Enable HSISR GPIO[C:0] interrupt */
+ val8 = rtl8xxxu_read8(priv, REG_HSIMR);
+ val8 |= BIT(0);
+ rtl8xxxu_write8(priv, REG_HSIMR, val8);
+
+ /* Enable HSISR GPIO9 interrupt */
+ val8 = rtl8xxxu_read8(priv, REG_HSIMR + 2);
+ val8 |= BIT(1);
+ rtl8xxxu_write8(priv, REG_HSIMR + 2, val8);
+
+ val8 = rtl8xxxu_read8(priv, REG_MULTI_FUNC_CTRL);
+ val8 |= MULTI_WIFI_HW_ROF_EN;
+ rtl8xxxu_write8(priv, REG_MULTI_FUNC_CTRL, val8);
+
+ /* For GPIO9 internal pull high setting BIT(14) */
+ val8 = rtl8xxxu_read8(priv, REG_MULTI_FUNC_CTRL + 1);
+ val8 |= BIT(6);
+ rtl8xxxu_write8(priv, REG_MULTI_FUNC_CTRL + 1, val8);
+
+exit:
+ return ret;
+}
+
static int rtl8xxxu_emu_to_disabled(struct rtl8xxxu_priv *priv)
{
u8 val8;
@@ -5430,6 +5547,62 @@ exit:
return ret;
}
+static int rtl8723bu_power_on(struct rtl8xxxu_priv *priv)
+{
+ u8 val8;
+ u16 val16;
+ u32 val32;
+ int ret;
+
+ rtl8723a_disabled_to_emu(priv);
+
+ ret = rtl8723b_emu_to_active(priv);
+ if (ret)
+ goto exit;
+
+ /*
+ * Enable MAC DMA/WMAC/SCHEDULE/SEC block
+ * Set CR bit10 to enable 32k calibration.
+ */
+ val16 = rtl8xxxu_read16(priv, REG_CR);
+ val16 |= (CR_HCI_TXDMA_ENABLE | CR_HCI_RXDMA_ENABLE |
+ CR_TXDMA_ENABLE | CR_RXDMA_ENABLE |
+ CR_PROTOCOL_ENABLE | CR_SCHEDULE_ENABLE |
+ CR_MAC_TX_ENABLE | CR_MAC_RX_ENABLE |
+ CR_SECURITY_ENABLE | CR_CALTIMER_ENABLE);
+ rtl8xxxu_write16(priv, REG_CR, val16);
+
+ /*
+ * BT coexist power on settings. This is identical for 1 and 2
+ * antenna parts.
+ */
+ rtl8xxxu_write8(priv, REG_PAD_CTRL1 + 3, 0x20);
+
+ val16 = rtl8xxxu_read16(priv, REG_SYS_FUNC);
+ val16 |= SYS_FUNC_BBRSTB | SYS_FUNC_BB_GLB_RSTN;
+ rtl8xxxu_write16(priv, REG_SYS_FUNC, val16);
+
+ rtl8xxxu_write8(priv, REG_BT_CONTROL_8723BU + 1, 0x18);
+ rtl8xxxu_write8(priv, REG_WLAN_ACT_CONTROL_8723B, 0x04);
+ rtl8xxxu_write32(priv, REG_S0S1_PATH_SWITCH, 0x00);
+ /* Antenna inverse */
+ rtl8xxxu_write8(priv, 0xfe08, 0x01);
+
+ val16 = rtl8xxxu_read16(priv, REG_PWR_DATA);
+ val16 |= PWR_DATA_EEPRPAD_RFE_CTRL_EN;
+ rtl8xxxu_write16(priv, REG_PWR_DATA, val16);
+
+ val32 = rtl8xxxu_read32(priv, REG_LEDCFG0);
+ val32 |= LEDCFG0_DPDT_SELECT;
+ rtl8xxxu_write32(priv, REG_LEDCFG0, val32);
+
+ val8 = rtl8xxxu_read8(priv, REG_PAD_CTRL1);
+ val8 &= ~PAD_CTRL1_SW_DPDT_SEL_DATA;
+ rtl8xxxu_write8(priv, REG_PAD_CTRL1, val8);
+exit:
+ return ret;
+}
+
#ifdef CONFIG_RTL8XXXU_UNTESTED
static int rtl8192cu_power_on(struct rtl8xxxu_priv *priv)
@@ -7707,7 +7880,7 @@ static struct rtl8xxxu_fileops rtl8723au_fops = {
static struct rtl8xxxu_fileops rtl8723bu_fops = {
.parse_efuse = rtl8723bu_parse_efuse,
.load_firmware = rtl8723bu_load_firmware,
- .power_on = rtl8723au_power_on,
+ .power_on = rtl8723bu_power_on,
.llt_init = rtl8xxxu_auto_llt_table,
.phy_init_antenna_selection = rtl8723bu_phy_init_antenna_selection,
.phy_iq_calibrate = rtl8723bu_phy_iq_calibrate,
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
index a82c0ba..5250388 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
@@ -70,6 +70,8 @@
#define REG_EE_VPD 0x000c
#define REG_AFE_MISC 0x0010
+#define AFE_MISC_WL_XTAL_CTRL BIT(6)
+
#define REG_SPS0_CTRL 0x0011
#define REG_SPS_OCP_CFG 0x0018
#define REG_8192E_LDOV12_CTRL 0x0014
@@ -133,6 +135,8 @@
#define EFUSE_ACCESS_DISABLE 0x00 /* RTL8723 only */
#define REG_PWR_DATA 0x0038
+#define PWR_DATA_EEPRPAD_RFE_CTRL_EN BIT(11)
+
#define REG_CAL_TIMER 0x003c
#define REG_ACLK_MON 0x003e
#define REG_GPIO_MUXCFG 0x0040
@@ -140,7 +144,10 @@
#define REG_MAC_PINMUX_CFG 0x0043
#define REG_GPIO_PIN_CTRL 0x0044
#define REG_GPIO_INTM 0x0048
+#define GPIO_INTM_EDGE_TRIG_IRQ BIT(9)
+
#define REG_LEDCFG0 0x004c
+#define LEDCFG0_DPDT_SELECT BIT(23)
#define REG_LEDCFG1 0x004d
#define REG_LEDCFG2 0x004e
#define LEDCFG2_DPDT_SELECT BIT(7)
@@ -154,9 +161,13 @@
#define REG_GPIO_PIN_CTRL_2 0x0060
/* RTL8723 WIFI/BT/GPS Multi-Function GPIO Select. */
#define REG_GPIO_IO_SEL_2 0x0062
+#define GPIO_IO_SEL_2_GPIO09_INPUT BIT(1)
+#define GPIO_IO_SEL_2_GPIO09_IRQ BIT(9)
/* RTL8723B */
#define REG_PAD_CTRL1 0x0064
+#define PAD_CTRL1_SW_DPDT_SEL_DATA BIT(0)
+
/* RTL8723 only WIFI/BT/GPS Multi-Function control source. */
#define REG_MULTI_FUNC_CTRL 0x0068
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 055/113] rtl8xxxu: Setup LLT before downloading firmware
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (53 preceding siblings ...)
2016-02-29 22:04 ` [PATCH 054/113] rtl8xxxu: Implement 8723bu power on sequence Jes.Sorensen
@ 2016-02-29 22:04 ` Jes.Sorensen
2016-02-29 22:04 ` [PATCH 056/113] rtl8xxxu: Additional fixes for 8723bu Jes.Sorensen
` (58 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:04 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
This matches the order of the 8723bu vendor driver
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 29 ++++++++++++++++--------
1 file changed, 20 insertions(+), 9 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index a8b7b75..15e27ab3 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -5955,6 +5955,26 @@ static int rtl8xxxu_init_device(struct ieee80211_hw *hw)
dev_dbg(dev, "%s: macpower %i\n", __func__, macpower);
if (!macpower) {
+ ret = priv->fops->llt_init(priv, TX_TOTAL_PAGE_NUM);
+ if (ret) {
+ dev_warn(dev, "%s: LLT table init failed\n", __func__);
+ goto exit;
+ }
+
+ /*
+ * Presumably this is for 8188EU as well
+ * Enable TX report and TX report timer
+ */
+ if (priv->rtlchip == 0x8723bu) {
+ val8 = rtl8xxxu_read8(priv, REG_TX_REPORT_CTRL);
+ val8 |= BIT(1);
+ rtl8xxxu_write8(priv, REG_TX_REPORT_CTRL, val8);
+ /* Set MAX RPT MACID */
+ rtl8xxxu_write8(priv, REG_TX_REPORT_CTRL + 1, 0x02);
+ /* TX report Timer. Unit: 32us */
+ rtl8xxxu_write16(priv, REG_TX_REPORT_TIME, 0xcdf0);
+ }
+
if (priv->ep_tx_normal_queue)
val8 = TX_PAGE_NUM_NORM_PQ;
else
@@ -5996,15 +6016,6 @@ static int rtl8xxxu_init_device(struct ieee80211_hw *hw)
if (ret)
goto exit;
- dev_dbg(dev, "%s: macpower %i\n", __func__, macpower);
- if (!macpower) {
- ret = priv->fops->llt_init(priv, TX_TOTAL_PAGE_NUM);
- if (ret) {
- dev_warn(dev, "%s: LLT table init failed\n", __func__);
- goto exit;
- }
- }
-
/* Fix USB interface interference issue */
if (priv->rtlchip == 0x8723a) {
rtl8xxxu_write8(priv, 0xfe40, 0xe0);
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 056/113] rtl8xxxu: Additional fixes for 8723bu
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (54 preceding siblings ...)
2016-02-29 22:04 ` [PATCH 055/113] rtl8xxxu: Setup LLT before downloading firmware Jes.Sorensen
@ 2016-02-29 22:04 ` Jes.Sorensen
2016-02-29 22:04 ` [PATCH 057/113] rtl8xxxu: Handle XTAL_K value in efuse specific location Jes.Sorensen
` (57 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:04 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
Additional tweaks to further map the init sequence for the 8723bu to
that of the vendor driver.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 25 +++++++++++++++++-------
1 file changed, 18 insertions(+), 7 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 15e27ab3..d97e66c 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -2957,7 +2957,8 @@ rtl8xxxu_init_mac(struct rtl8xxxu_priv *priv, struct rtl8xxxu_reg8val *array)
}
}
- rtl8xxxu_write8(priv, REG_MAX_AGGR_NUM, 0x0a);
+ if (priv->rtlchip != 0x8723b)
+ rtl8xxxu_write8(priv, REG_MAX_AGGR_NUM, 0x0a);
return 0;
}
@@ -3003,6 +3004,11 @@ static int rtl8xxxu_init_phy_bb(struct rtl8xxxu_priv *priv)
*/
if (priv->rtlchip == 0x8723b) {
+ val16 = rtl8xxxu_read16(priv, REG_SYS_FUNC);
+ val16 |= SYS_FUNC_BB_GLB_RSTN | SYS_FUNC_BBRSTB |
+ SYS_FUNC_DIO_RF;
+ rtl8xxxu_write16(priv, REG_SYS_FUNC, val16);
+
rtl8xxxu_write32(priv, REG_S0S1_PATH_SWITCH, 0x00);
} else {
val8 = rtl8xxxu_read8(priv, REG_AFE_PLL_CTRL);
@@ -3013,11 +3019,11 @@ static int rtl8xxxu_init_phy_bb(struct rtl8xxxu_priv *priv)
rtl8xxxu_write8(priv, REG_AFE_PLL_CTRL + 1, 0xff);
udelay(2);
- }
- val16 = rtl8xxxu_read16(priv, REG_SYS_FUNC);
- val16 |= SYS_FUNC_BB_GLB_RSTN | SYS_FUNC_BBRSTB;
- rtl8xxxu_write16(priv, REG_SYS_FUNC, val16);
+ val16 = rtl8xxxu_read16(priv, REG_SYS_FUNC);
+ val16 |= SYS_FUNC_BB_GLB_RSTN | SYS_FUNC_BBRSTB;
+ rtl8xxxu_write16(priv, REG_SYS_FUNC, val16);
+ }
if (priv->rtlchip != 0x8723b) {
/* AFE_XTAL_RF_GATE (bit 14) if addressing as 32 bit register */
@@ -3036,9 +3042,14 @@ static int rtl8xxxu_init_phy_bb(struct rtl8xxxu_priv *priv)
rtl8xxxu_init_phy_regs(priv, rtl8188ru_phy_1t_highpa_table);
else if (priv->tx_paths == 2)
rtl8xxxu_init_phy_regs(priv, rtl8192cu_phy_2t_init_table);
- else if (priv->rtlchip == 0x8723b)
+ else if (priv->rtlchip == 0x8723b) {
+ /*
+ * Why?
+ */
+ rtl8xxxu_write8(priv, REG_SYS_FUNC, 0xe3);
+ rtl8xxxu_write8(priv, REG_AFE_XTAL_CTRL + 1, 0x80);
rtl8xxxu_init_phy_regs(priv, rtl8723b_phy_1t_init_table);
- else
+ } else
rtl8xxxu_init_phy_regs(priv, rtl8723a_phy_1t_init_table);
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 057/113] rtl8xxxu: Handle XTAL_K value in efuse specific location
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (55 preceding siblings ...)
2016-02-29 22:04 ` [PATCH 056/113] rtl8xxxu: Additional fixes for 8723bu Jes.Sorensen
@ 2016-02-29 22:04 ` Jes.Sorensen
2016-02-29 22:04 ` [PATCH 058/113] rtl8xxxu: Another 8723bu patch for rtl8xxxu_init_phy_bb() Jes.Sorensen
` (56 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:04 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
Retrieve the XTAL_K value in the parse_efuse() functions as it's
location various on a per device basis. For parts that do not provide
an XTAL_K value, skip setting it.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 15 ++++++++++++---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 2 ++
2 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index d97e66c..968ed95 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -2314,6 +2314,10 @@ static int rtl8723au_parse_efuse(struct rtl8xxxu_priv *priv)
efuse->ht20_max_power_offset,
sizeof(priv->ht20_max_power_offset));
+ if (priv->efuse_wifi.efuse8723.version >= 0x01) {
+ priv->has_xtalk = 1;
+ priv->xtalk = priv->efuse_wifi.efuse8723.xtal_k & 0x3f;
+ }
dev_info(&priv->udev->dev, "Vendor: %.7s\n",
efuse->vendor_name);
dev_info(&priv->udev->dev, "Product: %.41s\n",
@@ -2340,6 +2344,9 @@ static int rtl8723bu_parse_efuse(struct rtl8xxxu_priv *priv)
memcpy(priv->ht40_1s_tx_power_index_B, efuse->ht40_1s_tx_power_index_B,
sizeof(priv->ht40_1s_tx_power_index_B));
+ priv->has_xtalk = 1;
+ priv->xtalk = priv->efuse_wifi.efuse8723bu.xtal_k & 0x3f;
+
dev_info(&priv->udev->dev, "Vendor: %.7s\n", efuse->vendor_name);
dev_info(&priv->udev->dev, "Product: %.41s\n", efuse->device_name);
@@ -2444,6 +2451,9 @@ static int rtl8192eu_parse_efuse(struct rtl8xxxu_priv *priv)
ether_addr_copy(priv->mac_addr, efuse->mac_addr);
+ priv->has_xtalk = 1;
+ priv->xtalk = priv->efuse_wifi.efuse8192eu.xtal_k & 0x3f;
+
dev_info(&priv->udev->dev, "Vendor: %.7s\n", efuse->vendor_name);
dev_info(&priv->udev->dev, "Product: %.11s\n", efuse->device_name);
dev_info(&priv->udev->dev, "Serial: %.11s\n", efuse->serial);
@@ -3122,11 +3132,10 @@ static int rtl8xxxu_init_phy_bb(struct rtl8xxxu_priv *priv)
else
rtl8xxxu_init_phy_regs(priv, rtl8xxx_agc_standard_table);
- if ((priv->rtlchip == 0x8723a || priv->rtlchip == 0x8723b) &&
- priv->efuse_wifi.efuse8723.version >= 0x01) {
+ if (priv->has_xtalk) {
val32 = rtl8xxxu_read32(priv, REG_MAC_PHY_CTRL);
- val8 = priv->efuse_wifi.efuse8723.xtal_k & 0x3f;
+ val8 = priv->xtalk;
val32 &= 0xff000fff;
val32 |= ((val8 | (val8 << 6)) << 12);
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
index ea0b28a..2250e1b 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
@@ -1063,6 +1063,8 @@ struct rtl8xxxu_priv {
u32 ep_tx_high_queue:1;
u32 ep_tx_normal_queue:1;
u32 ep_tx_low_queue:1;
+ u32 has_xtalk:1;
+ u8 xtalk;
unsigned int pipe_interrupt;
unsigned int pipe_in;
unsigned int pipe_out[TXDESC_QUEUE_MAX];
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 058/113] rtl8xxxu: Another 8723bu patch for rtl8xxxu_init_phy_bb()
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (56 preceding siblings ...)
2016-02-29 22:04 ` [PATCH 057/113] rtl8xxxu: Handle XTAL_K value in efuse specific location Jes.Sorensen
@ 2016-02-29 22:04 ` Jes.Sorensen
2016-02-29 22:04 ` [PATCH 059/113] rtl8xxxu: Another 8723bu magic register set during init Jes.Sorensen
` (55 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:04 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
This function is going to need to be split up into chip specific
variants.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 968ed95..473c910 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -3142,13 +3142,16 @@ static int rtl8xxxu_init_phy_bb(struct rtl8xxxu_priv *priv)
rtl8xxxu_write32(priv, REG_MAC_PHY_CTRL, val32);
}
- ldoa15 = LDOA15_ENABLE | LDOA15_OBUF;
- ldov12d = LDOV12D_ENABLE | BIT(2) | (2 << LDOV12D_VADJ_SHIFT);
- ldohci12 = 0x57;
- lpldo = 1;
- val32 = (lpldo << 24) | (ldohci12 << 16) | (ldov12d << 8) | ldoa15;
+ if (priv->rtlchip != 0x8723bu) {
+ ldoa15 = LDOA15_ENABLE | LDOA15_OBUF;
+ ldov12d = LDOV12D_ENABLE | BIT(2) | (2 << LDOV12D_VADJ_SHIFT);
+ ldohci12 = 0x57;
+ lpldo = 1;
+ val32 = (lpldo << 24) | (ldohci12 << 16) |
+ (ldov12d << 8) | ldoa15;
- rtl8xxxu_write32(priv, REG_LDOA15_CTRL, val32);
+ rtl8xxxu_write32(priv, REG_LDOA15_CTRL, val32);
+ }
return 0;
}
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 059/113] rtl8xxxu: Another 8723bu magic register set during init
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (57 preceding siblings ...)
2016-02-29 22:04 ` [PATCH 058/113] rtl8xxxu: Another 8723bu patch for rtl8xxxu_init_phy_bb() Jes.Sorensen
@ 2016-02-29 22:04 ` Jes.Sorensen
2016-02-29 22:04 ` [PATCH 060/113] rtl8xxxu: Init H2C command register for 8723bu Jes.Sorensen
` (54 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:04 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
No indication of what register 0xa3 does anywhere in the vendor source.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 473c910..cd5c61b 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -5996,6 +5996,11 @@ static int rtl8xxxu_init_device(struct ieee80211_hw *hw)
rtl8xxxu_write8(priv, REG_TX_REPORT_CTRL + 1, 0x02);
/* TX report Timer. Unit: 32us */
rtl8xxxu_write16(priv, REG_TX_REPORT_TIME, 0xcdf0);
+
+ /* tmp ps ? */
+ val8 = rtl8xxxu_read8(priv, 0xa3);
+ val8 &= 0xf8;
+ rtl8xxxu_write8(priv, 0xa3, val8);
}
if (priv->ep_tx_normal_queue)
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 060/113] rtl8xxxu: Init H2C command register for 8723bu
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (58 preceding siblings ...)
2016-02-29 22:04 ` [PATCH 059/113] rtl8xxxu: Another 8723bu magic register set during init Jes.Sorensen
@ 2016-02-29 22:04 ` Jes.Sorensen
2016-02-29 22:04 ` [PATCH 061/113] rtl8xxxu: 80M spur hack is for 8723au only Jes.Sorensen
` (53 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:04 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
In addition make register read/write flow match closer to vendor
driver flow. This is mainly to be able to compare the register write
log with the vendor driver, and can be optimized later once 8723bu
support is working.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index cd5c61b..c253641 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -2685,6 +2685,11 @@ static int rtl8xxxu_start_firmware(struct rtl8xxxu_priv *priv)
goto exit;
}
+ /*
+ * Init H2C command
+ */
+ if (priv->rtlchip == 0x8723b)
+ rtl8xxxu_write8(priv, REG_HMTFR, 0x0f);
exit:
return ret;
}
@@ -2927,14 +2932,20 @@ static void rtl8723bu_phy_init_antenna_selection(struct rtl8xxxu_priv *priv)
val32 = rtl8xxxu_read32(priv, REG_GPIO_MUXCFG);
val32 &= ~BIT(4);
+ rtl8xxxu_write32(priv, REG_GPIO_MUXCFG, val32);
+
+ val32 = rtl8xxxu_read32(priv, REG_GPIO_MUXCFG);
val32 |= BIT(3);
rtl8xxxu_write32(priv, REG_GPIO_MUXCFG, val32);
val32 = rtl8xxxu_read32(priv, REG_LEDCFG0);
- val32 &= ~BIT(23);
val32 |= BIT(24);
rtl8xxxu_write32(priv, REG_LEDCFG0, val32);
+ val32 = rtl8xxxu_read32(priv, REG_LEDCFG0);
+ val32 &= ~BIT(23);
+ rtl8xxxu_write32(priv, REG_LEDCFG0, val32);
+
val32 = rtl8xxxu_read32(priv, 0x0944);
val32 |= (BIT(0) | BIT(1));
rtl8xxxu_write32(priv, 0x0944, val32);
@@ -2943,6 +2954,10 @@ static void rtl8723bu_phy_init_antenna_selection(struct rtl8xxxu_priv *priv)
val32 &= 0xffffff00;
val32 |= 0x77;
rtl8xxxu_write32(priv, 0x0930, val32);
+
+ val32 = rtl8xxxu_read32(priv, REG_PWR_DATA);
+ val32 |= PWR_DATA_EEPRPAD_RFE_CTRL_EN;
+ rtl8xxxu_write32(priv, REG_PWR_DATA, val32);
}
static int
@@ -6079,7 +6094,7 @@ static int rtl8xxxu_init_device(struct ieee80211_hw *hw)
rtl8xxxu_write8(priv, 0xfe42, 0x80);
}
- if (priv->rtlchip == 0x8192e || priv->rtlchip == 0x8723b) {
+ if (priv->rtlchip == 0x8192e) {
rtl8xxxu_write32(priv, REG_HIMR0, 0x00);
rtl8xxxu_write32(priv, REG_HIMR1, 0x00);
}
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 061/113] rtl8xxxu: 80M spur hack is for 8723au only
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (59 preceding siblings ...)
2016-02-29 22:04 ` [PATCH 060/113] rtl8xxxu: Init H2C command register for 8723bu Jes.Sorensen
@ 2016-02-29 22:04 ` Jes.Sorensen
2016-02-29 22:05 ` [PATCH 062/113] rtl8xxxu: Do queue init in same order as 8723bu vendor driver Jes.Sorensen
` (52 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:04 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
Only apply the 80M spur hack for 8723au parts.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index c253641..8b91edc 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -6151,11 +6151,12 @@ static int rtl8xxxu_init_device(struct ieee80211_hw *hw)
if (ret)
goto exit;
- /* Reduce 80M spur */
- rtl8xxxu_write32(priv, REG_AFE_XTAL_CTRL, 0x0381808d);
- rtl8xxxu_write32(priv, REG_AFE_PLL_CTRL, 0xf0ffff83);
- rtl8xxxu_write32(priv, REG_AFE_PLL_CTRL, 0xf0ffff82);
- rtl8xxxu_write32(priv, REG_AFE_PLL_CTRL, 0xf0ffff83);
+ if (priv->rtlchip == 0x8723a) { /* Reduce 80M spur */
+ rtl8xxxu_write32(priv, REG_AFE_XTAL_CTRL, 0x0381808d);
+ rtl8xxxu_write32(priv, REG_AFE_PLL_CTRL, 0xf0ffff83);
+ rtl8xxxu_write32(priv, REG_AFE_PLL_CTRL, 0xf0ffff82);
+ rtl8xxxu_write32(priv, REG_AFE_PLL_CTRL, 0xf0ffff83);
+ }
/* RFSW Control - clear bit 14 ?? */
rtl8xxxu_write32(priv, REG_FPGA0_TX_INFO, 0x00000003);
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 062/113] rtl8xxxu: Do queue init in same order as 8723bu vendor driver
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (60 preceding siblings ...)
2016-02-29 22:04 ` [PATCH 061/113] rtl8xxxu: 80M spur hack is for 8723au only Jes.Sorensen
@ 2016-02-29 22:05 ` Jes.Sorensen
2016-02-29 22:05 ` [PATCH 063/113] rtl8xxxu: Do not set FPGA0_TX_INFO for 8723bu and use a larger PBP page size Jes.Sorensen
` (51 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:05 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
Reorganize the init sequence in order to be able to compare to the
8723bu vendor driver's init sequence.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 68 +++++++++++++-----------
1 file changed, 37 insertions(+), 31 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 8b91edc..7e525fa 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -6017,32 +6017,6 @@ static int rtl8xxxu_init_device(struct ieee80211_hw *hw)
val8 &= 0xf8;
rtl8xxxu_write8(priv, 0xa3, val8);
}
-
- if (priv->ep_tx_normal_queue)
- val8 = TX_PAGE_NUM_NORM_PQ;
- else
- val8 = 0;
-
- rtl8xxxu_write8(priv, REG_RQPN_NPQ, val8);
-
- val32 = (TX_PAGE_NUM_PUBQ << RQPN_NORM_PQ_SHIFT) | RQPN_LOAD;
-
- if (priv->ep_tx_high_queue)
- val32 |= (TX_PAGE_NUM_HI_PQ << RQPN_HI_PQ_SHIFT);
- if (priv->ep_tx_low_queue)
- val32 |= (TX_PAGE_NUM_LO_PQ << RQPN_LO_PQ_SHIFT);
-
- rtl8xxxu_write32(priv, REG_RQPN, val32);
-
- /*
- * Set TX buffer boundary
- */
- val8 = TX_TOTAL_PAGE_NUM + 1;
- rtl8xxxu_write8(priv, REG_TXPKTBUF_BCNQ_BDNY, val8);
- rtl8xxxu_write8(priv, REG_TXPKTBUF_MGQ_BDNY, val8);
- rtl8xxxu_write8(priv, REG_TXPKTBUF_WMAC_LBK_BF_HD, val8);
- rtl8xxxu_write8(priv, REG_TRXFF_BNDY, val8);
- rtl8xxxu_write8(priv, REG_TDECTRL + 1, val8);
}
ret = rtl8xxxu_download_firmware(priv);
@@ -6054,11 +6028,6 @@ static int rtl8xxxu_init_device(struct ieee80211_hw *hw)
if (ret)
goto exit;
- ret = rtl8xxxu_init_queue_priority(priv);
- dev_dbg(dev, "%s: init_queue_priority %i\n", __func__, ret);
- if (ret)
- goto exit;
-
/* Fix USB interface interference issue */
if (priv->rtlchip == 0x8723a) {
rtl8xxxu_write8(priv, 0xfe40, 0xe0);
@@ -6158,6 +6127,43 @@ static int rtl8xxxu_init_device(struct ieee80211_hw *hw)
rtl8xxxu_write32(priv, REG_AFE_PLL_CTRL, 0xf0ffff83);
}
+ if (!macpower){
+ if (priv->ep_tx_normal_queue)
+ val8 = TX_PAGE_NUM_NORM_PQ;
+ else
+ val8 = 0;
+
+ rtl8xxxu_write8(priv, REG_RQPN_NPQ, val8);
+
+ val32 = (TX_PAGE_NUM_PUBQ << RQPN_NORM_PQ_SHIFT) | RQPN_LOAD;
+
+ if (priv->ep_tx_high_queue)
+ val32 |= (TX_PAGE_NUM_HI_PQ << RQPN_HI_PQ_SHIFT);
+ if (priv->ep_tx_low_queue)
+ val32 |= (TX_PAGE_NUM_LO_PQ << RQPN_LO_PQ_SHIFT);
+
+ rtl8xxxu_write32(priv, REG_RQPN, val32);
+
+ /*
+ * Set TX buffer boundary
+ */
+ val8 = TX_TOTAL_PAGE_NUM + 1;
+
+ if (priv->rtlchip == 0x8723b)
+ val8 -= 1;
+
+ rtl8xxxu_write8(priv, REG_TXPKTBUF_BCNQ_BDNY, val8);
+ rtl8xxxu_write8(priv, REG_TXPKTBUF_MGQ_BDNY, val8);
+ rtl8xxxu_write8(priv, REG_TXPKTBUF_WMAC_LBK_BF_HD, val8);
+ rtl8xxxu_write8(priv, REG_TRXFF_BNDY, val8);
+ rtl8xxxu_write8(priv, REG_TDECTRL + 1, val8);
+ }
+
+ ret = rtl8xxxu_init_queue_priority(priv);
+ dev_dbg(dev, "%s: init_queue_priority %i\n", __func__, ret);
+ if (ret)
+ goto exit;
+
/* RFSW Control - clear bit 14 ?? */
rtl8xxxu_write32(priv, REG_FPGA0_TX_INFO, 0x00000003);
/* 0x07000760 */
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 063/113] rtl8xxxu: Do not set FPGA0_TX_INFO for 8723bu and use a larger PBP page size
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (61 preceding siblings ...)
2016-02-29 22:05 ` [PATCH 062/113] rtl8xxxu: Do queue init in same order as 8723bu vendor driver Jes.Sorensen
@ 2016-02-29 22:05 ` Jes.Sorensen
2016-02-29 22:05 ` [PATCH 064/113] rtl8xxxu: Set RX boundary for 8723bu Jes.Sorensen
` (50 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:05 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
The vendor driver does not set FPGA0_TX_INFO here. In additiona the
8723bu can handler a larger PBP page size.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 7e525fa..3a7fd2c 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -6165,7 +6165,8 @@ static int rtl8xxxu_init_device(struct ieee80211_hw *hw)
goto exit;
/* RFSW Control - clear bit 14 ?? */
- rtl8xxxu_write32(priv, REG_FPGA0_TX_INFO, 0x00000003);
+ if (priv->rtlchip != 0x8723b)
+ rtl8xxxu_write32(priv, REG_FPGA0_TX_INFO, 0x00000003);
/* 0x07000760 */
val32 = FPGA0_RF_TRSW | FPGA0_RF_TRSWB | FPGA0_RF_ANTSW |
FPGA0_RF_ANTSWB | FPGA0_RF_PAPE |
@@ -6185,8 +6186,12 @@ static int rtl8xxxu_init_device(struct ieee80211_hw *hw)
/*
* Transfer page size is always 128
*/
- val8 = (PBP_PAGE_SIZE_128 << PBP_PAGE_SIZE_RX_SHIFT) |
- (PBP_PAGE_SIZE_128 << PBP_PAGE_SIZE_TX_SHIFT);
+ if (priv->rtlchip == 0x8723b)
+ val8 = (PBP_PAGE_SIZE_256 << PBP_PAGE_SIZE_RX_SHIFT) |
+ (PBP_PAGE_SIZE_256 << PBP_PAGE_SIZE_TX_SHIFT);
+ else
+ val8 = (PBP_PAGE_SIZE_128 << PBP_PAGE_SIZE_RX_SHIFT) |
+ (PBP_PAGE_SIZE_128 << PBP_PAGE_SIZE_TX_SHIFT);
rtl8xxxu_write8(priv, REG_PBP, val8);
/*
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 064/113] rtl8xxxu: Set RX boundary for 8723bu
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (62 preceding siblings ...)
2016-02-29 22:05 ` [PATCH 063/113] rtl8xxxu: Do not set FPGA0_TX_INFO for 8723bu and use a larger PBP page size Jes.Sorensen
@ 2016-02-29 22:05 ` Jes.Sorensen
2016-02-29 23:11 ` Julian Calaby
2016-02-29 22:05 ` [PATCH 065/113] rtl8xxxu: Initialize burst parameters " Jes.Sorensen
` (49 subsequent siblings)
113 siblings, 1 reply; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:05 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
Set the correct TRXFF boundary for 8723bu.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 3a7fd2c..835eca8 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -6182,7 +6182,10 @@ static int rtl8xxxu_init_device(struct ieee80211_hw *hw)
/*
* Set RX page boundary
*/
- rtl8xxxu_write16(priv, REG_TRXFF_BNDY + 2, 0x27ff);
+ if (priv->rtlchip == 0x8723b)
+ rtl8xxxu_write16(priv, REG_TRXFF_BNDY + 2, 0x3f7f);
+ else
+ rtl8xxxu_write16(priv, REG_TRXFF_BNDY + 2, 0x27ff);
/*
* Transfer page size is always 128
*/
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 065/113] rtl8xxxu: Initialize burst parameters for 8723bu
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (63 preceding siblings ...)
2016-02-29 22:05 ` [PATCH 064/113] rtl8xxxu: Set RX boundary for 8723bu Jes.Sorensen
@ 2016-02-29 22:05 ` Jes.Sorensen
2016-02-29 22:05 ` [PATCH 066/113] rtl8xxxu: Call device specific _config_channel() Jes.Sorensen
` (48 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:05 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
Implement burst parameter sequence for 8723bu parts. Eventually this
should be moved into device specific sections.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 33 ++++++++++++++++++++++
.../net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h | 5 +++-
2 files changed, 37 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 835eca8..ecd0f59 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -6279,6 +6279,39 @@ static int rtl8xxxu_init_device(struct ieee80211_hw *hw)
rtl8xxxu_write16(priv, REG_BEACON_TCFG, 0x660F);
/*
+ * Initialize burst parameters
+ */
+ if (priv->rtlchip == 0x8723b) {
+ /*
+ * For USB high speed set 512B packets
+ */
+ val8 = rtl8xxxu_read8(priv, REG_RXDMA_PRO_8723B);
+ val8 &= ~(BIT(4) | BIT(5));
+ val8 |= BIT(4);
+ val8 |= BIT(1) | BIT(2) | BIT(3);
+ rtl8xxxu_write8(priv, REG_RXDMA_PRO_8723B, val8);
+
+ /*
+ * For USB high speed set 512B packets
+ */
+ val8 = rtl8xxxu_read8(priv, REG_HT_SINGLE_AMPDU_8723B);
+ val8 |= BIT(7);
+ rtl8xxxu_write8(priv, REG_HT_SINGLE_AMPDU_8723B, val8);
+
+ rtl8xxxu_write16(priv, REG_MAX_AGGR_NUM, 0x0c14);
+ rtl8xxxu_write8(priv, REG_AMPDU_MAX_TIME_8723B, 0x5e);
+ rtl8xxxu_write32(priv, REG_AGGLEN_LMT, 0xffffffff);
+ rtl8xxxu_write8(priv, REG_RX_PKT_LIMIT, 0x18);
+ rtl8xxxu_write8(priv, REG_PIFS, 0x00);
+ rtl8xxxu_write8(priv, REG_USTIME_TSF_8723B, 0x50);
+ rtl8xxxu_write8(priv, REG_USTIME_EDCA, 0x50);
+
+ val8 = rtl8xxxu_read8(priv, REG_RSV_CTRL);
+ val8 |= BIT(5) | BIT(6);
+ rtl8xxxu_write8(priv, REG_RSV_CTRL, val8);
+ }
+
+ /*
* Enable CCK and OFDM block
*/
val32 = rtl8xxxu_read32(priv, REG_FPGA0_RF_MODE);
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
index 5250388..8209830 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
@@ -405,7 +405,7 @@
/* Presumably only found on newer chips such as 8723bu */
#define REG_RX_DMA_CTRL_8723B 0x0286
-#define REG_RX_DMA_MODE_CTRL_8723B 0x0290
+#define REG_RXDMA_PRO_8723B 0x0290
#define REG_RF_BB_CMD_ADDR 0x02c0
#define REG_RF_BB_CMD_DATA 0x02c4
@@ -478,6 +478,7 @@
#define REG_ARFR1 0x0448
#define REG_ARFR2 0x044c
#define REG_ARFR3 0x0450
+#define REG_AMPDU_MAX_TIME_8723B 0x0456
#define REG_AGGLEN_LMT 0x0458
#define REG_AMPDU_MIN_SPACE 0x045c
#define REG_TXPKTBUF_WMAC_LBK_BF_HD 0x045d
@@ -496,6 +497,7 @@
#define REG_PKT_VO_VI_LIFE_TIME 0x04c0
#define REG_PKT_BE_BK_LIFE_TIME 0x04c2
#define REG_STBC_SETTING 0x04c4
+#define REG_HT_SINGLE_AMPDU_8723B 0x04c7
#define REG_PROT_MODE_CTRL 0x04c8
#define REG_MAX_AGGR_NUM 0x04ca
#define REG_RTS_MAX_AGGR_NUM 0x04cb
@@ -560,6 +562,7 @@
#define BEACON_DMA_ATIME_INT_TIME 2
#define REG_ATIMWND 0x055a
+#define REG_USTIME_TSF_8723B 0x055c
#define REG_BCN_MAX_ERR 0x055d
#define REG_RXTSF_OFFSET_CCK 0x055e
#define REG_RXTSF_OFFSET_OFDM 0x055f
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 066/113] rtl8xxxu: Call device specific _config_channel()
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (64 preceding siblings ...)
2016-02-29 22:05 ` [PATCH 065/113] rtl8xxxu: Initialize burst parameters " Jes.Sorensen
@ 2016-02-29 22:05 ` Jes.Sorensen
2016-02-29 23:12 ` Julian Calaby
2016-02-29 22:05 ` [PATCH 067/113] rtl8xxxu: 8723bu lock phy after RF init Jes.Sorensen
` (47 subsequent siblings)
113 siblings, 1 reply; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:05 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
Having a version for the newer chips without calling it doesn't do
much good.....
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index ecd0f59..566eeb5 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -7348,7 +7348,7 @@ static int rtl8xxxu_config(struct ieee80211_hw *hw, u32 changed)
rtl8723a_set_tx_power(priv, channel, ht40);
- rtl8723au_config_channel(hw);
+ priv->fops->config_channel(hw);
}
exit:
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 067/113] rtl8xxxu: 8723bu lock phy after RF init
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (65 preceding siblings ...)
2016-02-29 22:05 ` [PATCH 066/113] rtl8xxxu: Call device specific _config_channel() Jes.Sorensen
@ 2016-02-29 22:05 ` Jes.Sorensen
2016-02-29 22:05 ` [PATCH 068/113] rtl8xxxu: Add REG_DWBCN1_CTRL_8723B define Jes.Sorensen
` (46 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:05 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
Set PHY lock after running the RF init sequence on 8723bu.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 566eeb5..566159e 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -6093,6 +6093,13 @@ static int rtl8xxxu_init_device(struct ieee80211_hw *hw)
case 0x8723b:
rftable = rtl8723bu_radioa_1t_init_table;
ret = rtl8xxxu_init_phy_rf(priv, rftable, RF_A);
+ /*
+ * PHY LCK
+ */
+ rtl8xxxu_write_rfreg(priv, RF_A, 0xb0, 0xdfbe0);
+ rtl8xxxu_write_rfreg(priv, RF_A, RF6052_REG_MODE_AG, 0x8c01);
+ msleep(200);
+ rtl8xxxu_write_rfreg(priv, RF_A, 0xb0, 0xdffe0);
break;
case 0x8188c:
if (priv->hi_pa)
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 068/113] rtl8xxxu: Add REG_DWBCN1_CTRL_8723B define
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (66 preceding siblings ...)
2016-02-29 22:05 ` [PATCH 067/113] rtl8xxxu: 8723bu lock phy after RF init Jes.Sorensen
@ 2016-02-29 22:05 ` Jes.Sorensen
2016-02-29 22:05 ` [PATCH 069/113] rtl8xxxu: Group chip quirks together Jes.Sorensen
` (45 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:05 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
List yet another new register found on the 8723b.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
index 8209830..ec6f40f 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
@@ -397,6 +397,8 @@
#define REG_AUTO_LLT 0x0224
#define AUTO_LLT_INIT_LLT BIT(16)
+#define REG_DWBCN1_CTRL_8723B 0x0228
+
/* 0x0280 ~ 0x02FF RXDMA Configuration */
#define REG_RXDMA_AGG_PG_TH 0x0280
#define RXDMA_USB_AGG_ENABLE BIT(31)
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 069/113] rtl8xxxu: Group chip quirks together
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (67 preceding siblings ...)
2016-02-29 22:05 ` [PATCH 068/113] rtl8xxxu: Add REG_DWBCN1_CTRL_8723B define Jes.Sorensen
@ 2016-02-29 22:05 ` Jes.Sorensen
2016-02-29 22:05 ` [PATCH 070/113] rtl8xxxu: Setup RX aggregation Jes.Sorensen
` (44 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:05 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
Group chip quirks together instead of having them scattered all over
in the init code.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 28 +++++++++++++-----------
1 file changed, 15 insertions(+), 13 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 566159e..de921cf 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -6028,18 +6028,6 @@ static int rtl8xxxu_init_device(struct ieee80211_hw *hw)
if (ret)
goto exit;
- /* Fix USB interface interference issue */
- if (priv->rtlchip == 0x8723a) {
- rtl8xxxu_write8(priv, 0xfe40, 0xe0);
- rtl8xxxu_write8(priv, 0xfe41, 0x8d);
- rtl8xxxu_write8(priv, 0xfe42, 0x80);
- rtl8xxxu_write32(priv, REG_TXDMA_OFFSET_CHK, 0xfd0320);
- } else {
- val32 = rtl8xxxu_read32(priv, REG_TXDMA_OFFSET_CHK);
- val32 |= TXDMA_OFFSET_DROP_DATA_EN;
- rtl8xxxu_write32(priv, REG_TXDMA_OFFSET_CHK, val32);
- }
-
/* Solve too many protocol error on USB bus */
/* Can't do this for 8188/8192 UMC A cut parts */
if (priv->rtlchip == 0x8723a ||
@@ -6127,11 +6115,25 @@ static int rtl8xxxu_init_device(struct ieee80211_hw *hw)
if (ret)
goto exit;
- if (priv->rtlchip == 0x8723a) { /* Reduce 80M spur */
+ /*
+ * Chip specific quirks
+ */
+ if (priv->rtlchip == 0x8723a) {
+ /* Fix USB interface interference issue */
+ rtl8xxxu_write8(priv, 0xfe40, 0xe0);
+ rtl8xxxu_write8(priv, 0xfe41, 0x8d);
+ rtl8xxxu_write8(priv, 0xfe42, 0x80);
+ rtl8xxxu_write32(priv, REG_TXDMA_OFFSET_CHK, 0xfd0320);
+
+ /* Reduce 80M spur */
rtl8xxxu_write32(priv, REG_AFE_XTAL_CTRL, 0x0381808d);
rtl8xxxu_write32(priv, REG_AFE_PLL_CTRL, 0xf0ffff83);
rtl8xxxu_write32(priv, REG_AFE_PLL_CTRL, 0xf0ffff82);
rtl8xxxu_write32(priv, REG_AFE_PLL_CTRL, 0xf0ffff83);
+ } else {
+ val32 = rtl8xxxu_read32(priv, REG_TXDMA_OFFSET_CHK);
+ val32 |= TXDMA_OFFSET_DROP_DATA_EN;
+ rtl8xxxu_write32(priv, REG_TXDMA_OFFSET_CHK, val32);
}
if (!macpower){
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 070/113] rtl8xxxu: Setup RX aggregation
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (68 preceding siblings ...)
2016-02-29 22:05 ` [PATCH 069/113] rtl8xxxu: Group chip quirks together Jes.Sorensen
@ 2016-02-29 22:05 ` Jes.Sorensen
2016-02-29 22:05 ` [PATCH 071/113] rtl8xxxu: Add missing blank space in front of bracket Jes.Sorensen
` (43 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:05 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
This initializes RX DMA aggregation on 8723bu. We should do this for
all parts eventually, and also init TX aggregation.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 23 ++++++++++++++++++++++
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 1 +
.../net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h | 1 +
3 files changed, 25 insertions(+)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index de921cf..50494e4 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -5962,6 +5962,25 @@ static void rtl8723bu_init_bt(struct rtl8xxxu_priv *priv)
rtl8723a_h2c_cmd(priv, &h2c, sizeof(h2c.ignore_wlan));
}
+static void rtl8723bu_init_aggregation(struct rtl8xxxu_priv *priv)
+{
+ u32 agg_rx;
+ u8 agg_ctrl;
+
+ /*
+ * For now simply disable RX aggregation
+ */
+ agg_ctrl = rtl8xxxu_read8(priv, REG_TRXDMA_CTRL);
+ agg_ctrl &= ~TRXDMA_CTRL_RXDMA_AGG_EN;
+
+ agg_rx = rtl8xxxu_read32(priv, REG_RXDMA_AGG_PG_TH);
+ agg_rx &= ~RXDMA_USB_AGG_ENABLE;
+ agg_rx &= ~0xff0f;
+
+ rtl8xxxu_write8(priv, REG_TRXDMA_CTRL, agg_ctrl);
+ rtl8xxxu_write32(priv, REG_RXDMA_AGG_PG_TH, agg_rx);
+}
+
static int rtl8xxxu_init_device(struct ieee80211_hw *hw)
{
struct rtl8xxxu_priv *priv = hw->priv;
@@ -6320,6 +6339,9 @@ static int rtl8xxxu_init_device(struct ieee80211_hw *hw)
rtl8xxxu_write8(priv, REG_RSV_CTRL, val8);
}
+ if (priv->fops->init_aggregation)
+ priv->fops->init_aggregation(priv);
+
/*
* Enable CCK and OFDM block
*/
@@ -7998,6 +8020,7 @@ static struct rtl8xxxu_fileops rtl8723bu_fops = {
.config_channel = rtl8723bu_config_channel,
.init_bt = rtl8723bu_init_bt,
.parse_rx_desc = rtl8723bu_parse_rx_desc,
+ .init_aggregation = rtl8723bu_init_aggregation,
.writeN_block_size = 1024,
.mbox_ext_reg = REG_HMBOX_EXT0_8723B,
.mbox_ext_width = 4,
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
index 2250e1b..14b7a35 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
@@ -1133,6 +1133,7 @@ struct rtl8xxxu_fileops {
void (*init_bt) (struct rtl8xxxu_priv *priv);
int (*parse_rx_desc) (struct rtl8xxxu_priv *priv, struct sk_buff *skb,
struct ieee80211_rx_status *rx_status);
+ void (*init_aggregation) (struct rtl8xxxu_priv *priv);
int writeN_block_size;
u16 mbox_ext_reg;
char mbox_ext_width;
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
index ec6f40f..d6c7ad3 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
@@ -318,6 +318,7 @@
#define PBP_PAGE_SIZE_1024 0x4
#define REG_TRXDMA_CTRL 0x010c
+#define TRXDMA_CTRL_RXDMA_AGG_EN BIT(2)
#define TRXDMA_CTRL_VOQ_SHIFT 4
#define TRXDMA_CTRL_VIQ_SHIFT 6
#define TRXDMA_CTRL_BEQ_SHIFT 8
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 071/113] rtl8xxxu: Add missing blank space in front of bracket
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (69 preceding siblings ...)
2016-02-29 22:05 ` [PATCH 070/113] rtl8xxxu: Setup RX aggregation Jes.Sorensen
@ 2016-02-29 22:05 ` Jes.Sorensen
2016-02-29 22:05 ` [PATCH 072/113] rtl8xxxu: Implement init_statistics for 8723bu Jes.Sorensen
` (42 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:05 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
Keep the automated tools happy
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 50494e4..a0a847c 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -6155,7 +6155,7 @@ static int rtl8xxxu_init_device(struct ieee80211_hw *hw)
rtl8xxxu_write32(priv, REG_TXDMA_OFFSET_CHK, val32);
}
- if (!macpower){
+ if (!macpower) {
if (priv->ep_tx_normal_queue)
val8 = TX_PAGE_NUM_NORM_PQ;
else
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 072/113] rtl8xxxu: Implement init_statistics for 8723bu
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (70 preceding siblings ...)
2016-02-29 22:05 ` [PATCH 071/113] rtl8xxxu: Add missing blank space in front of bracket Jes.Sorensen
@ 2016-02-29 22:05 ` Jes.Sorensen
2016-02-29 22:05 ` [PATCH 073/113] rtl8xxxu: RF_T_METER is different on the newer chips Jes.Sorensen
` (41 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:05 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
Vendor driver implements this for 8723b and 8821 series
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 27 ++++++++++++++++++++++
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 1 +
.../net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h | 7 ++++++
3 files changed, 35 insertions(+)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index a0a847c..e586f53 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -5981,6 +5981,29 @@ static void rtl8723bu_init_aggregation(struct rtl8xxxu_priv *priv)
rtl8xxxu_write32(priv, REG_RXDMA_AGG_PG_TH, agg_rx);
}
+static void rtl8723bu_init_statistics(struct rtl8xxxu_priv *priv)
+{
+ u32 val32;
+
+ /* Time duration for NHM unit: 4us, 0x2710=40ms */
+ rtl8xxxu_write16(priv, REG_NHM_TIMER_8723B + 2, 0x2710);
+ rtl8xxxu_write16(priv, REG_NHM_TH9_TH10_8723B + 2, 0xffff);
+ rtl8xxxu_write32(priv, REG_NHM_TH3_TO_TH0_8723B, 0xffffff52);
+ rtl8xxxu_write32(priv, REG_NHM_TH7_TO_TH4_8723B, 0xffffffff);
+ /* TH8 */
+ val32 = rtl8xxxu_read32(priv, REG_FPGA0_IQK);
+ val32 |= 0xff;
+ rtl8xxxu_write32(priv, REG_FPGA0_IQK, val32);
+ /* Enable CCK */
+ val32 = rtl8xxxu_read32(priv, REG_NHM_TH9_TH10_8723B);
+ val32 |= BIT(8) | BIT(9) | BIT(10);
+ rtl8xxxu_write32(priv, REG_NHM_TH9_TH10_8723B, val32);
+ /* Max power amongst all RX antennas */
+ val32 = rtl8xxxu_read32(priv, REG_OFDM0_FA_RSTC);
+ val32 |= BIT(7);
+ rtl8xxxu_write32(priv, REG_OFDM0_FA_RSTC, val32);
+}
+
static int rtl8xxxu_init_device(struct ieee80211_hw *hw)
{
struct rtl8xxxu_priv *priv = hw->priv;
@@ -6371,6 +6394,9 @@ static int rtl8xxxu_init_device(struct ieee80211_hw *hw)
rtl8xxxu_write16(priv, REG_FAST_EDCA_CTRL, 0);
+ if (priv->fops->init_statistics)
+ priv->fops->init_statistics(priv);
+
rtl8723a_phy_lc_calibrate(priv);
priv->fops->phy_iq_calibrate(priv);
@@ -8021,6 +8047,7 @@ static struct rtl8xxxu_fileops rtl8723bu_fops = {
.init_bt = rtl8723bu_init_bt,
.parse_rx_desc = rtl8723bu_parse_rx_desc,
.init_aggregation = rtl8723bu_init_aggregation,
+ .init_statistics = rtl8723bu_init_statistics,
.writeN_block_size = 1024,
.mbox_ext_reg = REG_HMBOX_EXT0_8723B,
.mbox_ext_width = 4,
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
index 14b7a35..b75678b 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
@@ -1134,6 +1134,7 @@ struct rtl8xxxu_fileops {
int (*parse_rx_desc) (struct rtl8xxxu_priv *priv, struct sk_buff *skb,
struct ieee80211_rx_status *rx_status);
void (*init_aggregation) (struct rtl8xxxu_priv *priv);
+ void (*init_statistics) (struct rtl8xxxu_priv *priv);
int writeN_block_size;
u16 mbox_ext_reg;
char mbox_ext_width;
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
index d6c7ad3..d3f6fa3 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
@@ -833,6 +833,11 @@
#define REG_FPGA0_ANALOG3 0x0888
#define REG_FPGA0_ANALOG4 0x088c
+#define REG_NHM_TH9_TH10_8723B 0x0890
+#define REG_NHM_TIMER_8723B 0x0894
+#define REG_NHM_TH3_TO_TH0_8723B 0x0898
+#define REG_NHM_TH7_TO_TH4_8723B 0x089c
+
#define REG_FPGA0_XA_LSSI_READBACK 0x08a0 /* Tranceiver LSSI Readback */
#define REG_FPGA0_XB_LSSI_READBACK 0x08a4
#define REG_HSPI_XA_READBACK 0x08b8 /* Transceiver A HSPI read */
@@ -869,6 +874,8 @@
#define REG_OFDM0_TR_MUX_PAR 0x0c08
+#define REG_OFDM0_FA_RSTC 0x0c0c
+
#define REG_OFDM0_XA_RX_IQ_IMBALANCE 0x0c14
#define REG_OFDM0_XB_RX_IQ_IMBALANCE 0x0c1c
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 073/113] rtl8xxxu: RF_T_METER is different on the newer chips
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (71 preceding siblings ...)
2016-02-29 22:05 ` [PATCH 072/113] rtl8xxxu: Implement init_statistics for 8723bu Jes.Sorensen
@ 2016-02-29 22:05 ` Jes.Sorensen
2016-02-29 22:05 ` [PATCH 074/113] rtl8xxxu: Set WLAN_ACT_CONTROL per vendor driver setting Jes.Sorensen
` (40 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:05 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
Provide RF_T_METER register location for nextgen chips.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
index d3f6fa3..a055362 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
@@ -1104,9 +1104,10 @@
/*
* NextGen regs: 8723BU
*/
-#define RF6052_REG_UNKNOWN_43 0x43
-#define RF6052_REG_UNKNOWN_55 0x55
-#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_T_METER_8723B 0x42
+#define RF6052_REG_UNKNOWN_43 0x43
+#define RF6052_REG_UNKNOWN_55 0x55
+#define RF6052_REG_S0S1 0xb0
+#define RF6052_REG_UNKNOWN_DF 0xdf
+#define RF6052_REG_UNKNOWN_ED 0xed
+#define RF6052_REG_WE_LUT 0xef
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 074/113] rtl8xxxu: Set WLAN_ACT_CONTROL per vendor driver setting
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (72 preceding siblings ...)
2016-02-29 22:05 ` [PATCH 073/113] rtl8xxxu: RF_T_METER is different on the newer chips Jes.Sorensen
@ 2016-02-29 22:05 ` Jes.Sorensen
2016-02-29 22:05 ` [PATCH 075/113] rtl8xxxu: 8723bu: REG_BT_COEX_TABLE4 is only 8 bits Jes.Sorensen
` (39 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:05 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
The initial code set the wrong setting in WLAN_ACT_CONTROL for the
8723bu.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index e586f53..b4660c6 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -5894,7 +5894,7 @@ static void rtl8723bu_init_bt(struct rtl8xxxu_priv *priv)
/*
* WLAN action by PTA
*/
- rtl8xxxu_write8(priv, REG_WLAN_ACT_CONTROL_8723B, 0x0c);
+ rtl8xxxu_write8(priv, REG_WLAN_ACT_CONTROL_8723B, 0x04);
/*
* BT select S0/S1 controlled by WiFi
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 075/113] rtl8xxxu: 8723bu: REG_BT_COEX_TABLE4 is only 8 bits
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (73 preceding siblings ...)
2016-02-29 22:05 ` [PATCH 074/113] rtl8xxxu: Set WLAN_ACT_CONTROL per vendor driver setting Jes.Sorensen
@ 2016-02-29 22:05 ` Jes.Sorensen
2016-02-29 22:05 ` [PATCH 076/113] rtl8xxxu: Use name for REG_RFE_BUFFER rather than hard coded value Jes.Sorensen
` (38 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:05 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
The BT_COEX_TABLE register list contains 3 32 bit registers and one 8
bit register. Hence, use rtl8xxxu_write8() when writing the 8 bit
register.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index b4660c6..690e31d 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -5954,7 +5954,7 @@ static void rtl8723bu_init_bt(struct rtl8xxxu_priv *priv)
rtl8xxxu_write32(priv, REG_BT_COEX_TABLE1, 0x55555555);
rtl8xxxu_write32(priv, REG_BT_COEX_TABLE2, 0x5a5a5a5a);
rtl8xxxu_write32(priv, REG_BT_COEX_TABLE3, 0x00ffffff);
- rtl8xxxu_write32(priv, REG_BT_COEX_TABLE4, 0x00000003);
+ rtl8xxxu_write8(priv, REG_BT_COEX_TABLE4, 0x03);
memset(&h2c, 0, sizeof(struct h2c_cmd));
h2c.ignore_wlan.cmd = H2C_8723B_BT_IGNORE_WLANACT;
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 076/113] rtl8xxxu: Use name for REG_RFE_BUFFER rather than hard coded value
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (74 preceding siblings ...)
2016-02-29 22:05 ` [PATCH 075/113] rtl8xxxu: 8723bu: REG_BT_COEX_TABLE4 is only 8 bits Jes.Sorensen
@ 2016-02-29 22:05 ` Jes.Sorensen
2016-02-29 22:05 ` [PATCH 077/113] rtl8xxxu: Use REG_RFE_CTRL_ANTA_SRC " Jes.Sorensen
` (37 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:05 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
Register 0x0944 is REG_RFE_BUFFER. Use the name rather than hard coded
value when accessing it.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 690e31d..25a8ca5b 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -2946,9 +2946,9 @@ static void rtl8723bu_phy_init_antenna_selection(struct rtl8xxxu_priv *priv)
val32 &= ~BIT(23);
rtl8xxxu_write32(priv, REG_LEDCFG0, val32);
- val32 = rtl8xxxu_read32(priv, 0x0944);
+ val32 = rtl8xxxu_read32(priv, REG_RFE_BUFFER);
val32 |= (BIT(0) | BIT(1));
- rtl8xxxu_write32(priv, 0x0944, val32);
+ rtl8xxxu_write32(priv, REG_RFE_BUFFER, val32);
val32 = rtl8xxxu_read32(priv, 0x0930);
val32 &= 0xffffff00;
@@ -5912,9 +5912,9 @@ static void rtl8723bu_init_bt(struct rtl8xxxu_priv *priv)
*/
rtl8xxxu_write8(priv, 0x0974, 0xff);
- val32 = rtl8xxxu_read32(priv, 0x0944);
+ val32 = rtl8xxxu_read32(priv, REG_RFE_BUFFER);
val32 |= (BIT(0) | BIT(1));
- rtl8xxxu_write32(priv, 0x0944, val32);
+ rtl8xxxu_write32(priv, REG_RFE_BUFFER, val32);
rtl8xxxu_write8(priv, REG_RFE_CTRL_ANTA_SRC, 0x77);
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 077/113] rtl8xxxu: Use REG_RFE_CTRL_ANTA_SRC rather than hard coded value
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (75 preceding siblings ...)
2016-02-29 22:05 ` [PATCH 076/113] rtl8xxxu: Use name for REG_RFE_BUFFER rather than hard coded value Jes.Sorensen
@ 2016-02-29 22:05 ` Jes.Sorensen
2016-02-29 22:05 ` [PATCH 078/113] rtl8xxxu: Setup coex table correctly (hopefully) Jes.Sorensen
` (36 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:05 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
Another case where we should use the register name rather than the
hard coded value when accessing it.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 25a8ca5b..18458db 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -2950,10 +2950,10 @@ static void rtl8723bu_phy_init_antenna_selection(struct rtl8xxxu_priv *priv)
val32 |= (BIT(0) | BIT(1));
rtl8xxxu_write32(priv, REG_RFE_BUFFER, val32);
- val32 = rtl8xxxu_read32(priv, 0x0930);
+ val32 = rtl8xxxu_read32(priv, REG_RFE_CTRL_ANTA_SRC);
val32 &= 0xffffff00;
val32 |= 0x77;
- rtl8xxxu_write32(priv, 0x0930, val32);
+ rtl8xxxu_write32(priv, REG_RFE_CTRL_ANTA_SRC, val32);
val32 = rtl8xxxu_read32(priv, REG_PWR_DATA);
val32 |= PWR_DATA_EEPRPAD_RFE_CTRL_EN;
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 078/113] rtl8xxxu: Setup coex table correctly (hopefully)
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (76 preceding siblings ...)
2016-02-29 22:05 ` [PATCH 077/113] rtl8xxxu: Use REG_RFE_CTRL_ANTA_SRC " Jes.Sorensen
@ 2016-02-29 22:05 ` Jes.Sorensen
2016-02-29 22:05 ` [PATCH 079/113] rtl8xxxu: Do not use hard-wired RF enable settings for 8723bu Jes.Sorensen
` (35 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:05 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
Use the same values as the vendor driver when setting up the BTCOEX
table for 8723bu.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 18458db..7fb9830 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -5842,6 +5842,7 @@ static void rtl8xxxu_power_off(struct rtl8xxxu_priv *priv)
rtl8xxxu_write8(priv, REG_RSV_CTRL, 0x0e);
}
+#ifdef NEED_PS_TDMA
static void rtl8723bu_set_ps_tdma(struct rtl8xxxu_priv *priv,
u8 arg1, u8 arg2, u8 arg3, u8 arg4, u8 arg5)
{
@@ -5856,6 +5857,7 @@ static void rtl8723bu_set_ps_tdma(struct rtl8xxxu_priv *priv,
h2c.b_type_dma.data5 = arg5;
rtl8723a_h2c_cmd(priv, &h2c, sizeof(h2c.b_type_dma));
}
+#endif
static void rtl8723bu_init_bt(struct rtl8xxxu_priv *priv)
{
@@ -5944,18 +5946,20 @@ static void rtl8723bu_init_bt(struct rtl8xxxu_priv *priv)
/*
* Software control, antenna at WiFi side
*/
+#ifdef NEED_PS_TDMA
rtl8723bu_set_ps_tdma(priv, 0x08, 0x00, 0x00, 0x00, 0x00);
+#endif
+
+ rtl8xxxu_write32(priv, REG_BT_COEX_TABLE1, 0x55555555);
+ rtl8xxxu_write32(priv, REG_BT_COEX_TABLE2, 0x55555555);
+ rtl8xxxu_write32(priv, REG_BT_COEX_TABLE3, 0x00ffffff);
+ rtl8xxxu_write8(priv, REG_BT_COEX_TABLE4, 0x03);
memset(&h2c, 0, sizeof(struct h2c_cmd));
h2c.bt_info.cmd = H2C_8723B_BT_INFO;
h2c.bt_info.data = BIT(0);
rtl8723a_h2c_cmd(priv, &h2c, sizeof(h2c.bt_info));
- rtl8xxxu_write32(priv, REG_BT_COEX_TABLE1, 0x55555555);
- rtl8xxxu_write32(priv, REG_BT_COEX_TABLE2, 0x5a5a5a5a);
- rtl8xxxu_write32(priv, REG_BT_COEX_TABLE3, 0x00ffffff);
- rtl8xxxu_write8(priv, REG_BT_COEX_TABLE4, 0x03);
-
memset(&h2c, 0, sizeof(struct h2c_cmd));
h2c.ignore_wlan.cmd = H2C_8723B_BT_IGNORE_WLANACT;
h2c.ignore_wlan.data = 0;
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 079/113] rtl8xxxu: Do not use hard-wired RF enable settings for 8723bu
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (77 preceding siblings ...)
2016-02-29 22:05 ` [PATCH 078/113] rtl8xxxu: Setup coex table correctly (hopefully) Jes.Sorensen
@ 2016-02-29 22:05 ` Jes.Sorensen
2016-02-29 22:05 ` [PATCH 080/113] rtl8xxxu: Correct struct rtl8723bu_efuse to list power bases correctly Jes.Sorensen
` (34 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:05 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
These settings simply block the 8723bu, for now leave an empty
function.
With this change we can finally communicate with aliens using the
8723bu!
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 10 +++++++++-
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 1 +
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 7fb9830..9caee4dc 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -1596,6 +1596,10 @@ static void rtl8723a_enable_rf(struct rtl8xxxu_priv *priv)
rtl8xxxu_write8(priv, REG_TXPAUSE, 0x00);
}
+static void rtl8723b_enable_rf(struct rtl8xxxu_priv *priv)
+{
+}
+
static void rtl8723a_disable_rf(struct rtl8xxxu_priv *priv)
{
u8 sps0;
@@ -7665,7 +7669,7 @@ static int rtl8xxxu_start(struct ieee80211_hw *hw)
init_usb_anchor(&priv->tx_anchor);
init_usb_anchor(&priv->int_anchor);
- rtl8723a_enable_rf(priv);
+ priv->fops->enable_rf(priv);
if (priv->usb_interrupts) {
ret = rtl8xxxu_submit_int_urb(hw);
if (ret)
@@ -8031,6 +8035,7 @@ static struct rtl8xxxu_fileops rtl8723au_fops = {
.phy_iq_calibrate = rtl8723au_phy_iq_calibrate,
.config_channel = rtl8723au_config_channel,
.parse_rx_desc = rtl8723au_parse_rx_desc,
+ .enable_rf = rtl8723a_enable_rf,
.writeN_block_size = 1024,
.mbox_ext_reg = REG_HMBOX_EXT_0,
.mbox_ext_width = 2,
@@ -8052,6 +8057,7 @@ static struct rtl8xxxu_fileops rtl8723bu_fops = {
.parse_rx_desc = rtl8723bu_parse_rx_desc,
.init_aggregation = rtl8723bu_init_aggregation,
.init_statistics = rtl8723bu_init_statistics,
+ .enable_rf = rtl8723b_enable_rf,
.writeN_block_size = 1024,
.mbox_ext_reg = REG_HMBOX_EXT0_8723B,
.mbox_ext_width = 4,
@@ -8072,6 +8078,7 @@ static struct rtl8xxxu_fileops rtl8192cu_fops = {
.phy_iq_calibrate = rtl8723au_phy_iq_calibrate,
.config_channel = rtl8723au_config_channel,
.parse_rx_desc = rtl8723au_parse_rx_desc,
+ .enable_rf = rtl8723a_enable_rf,
.writeN_block_size = 128,
.mbox_ext_reg = REG_HMBOX_EXT_0,
.mbox_ext_width = 2,
@@ -8091,6 +8098,7 @@ static struct rtl8xxxu_fileops rtl8192eu_fops = {
.phy_iq_calibrate = rtl8723bu_phy_iq_calibrate,
.config_channel = rtl8723bu_config_channel,
.parse_rx_desc = rtl8723bu_parse_rx_desc,
+ .enable_rf = rtl8723b_enable_rf,
.writeN_block_size = 128,
.mbox_ext_reg = REG_HMBOX_EXT0_8723B,
.mbox_ext_width = 4,
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
index b75678b..ac8f47f 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
@@ -1135,6 +1135,7 @@ struct rtl8xxxu_fileops {
struct ieee80211_rx_status *rx_status);
void (*init_aggregation) (struct rtl8xxxu_priv *priv);
void (*init_statistics) (struct rtl8xxxu_priv *priv);
+ void (*enable_rf) (struct rtl8xxxu_priv *priv);
int writeN_block_size;
u16 mbox_ext_reg;
char mbox_ext_width;
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 080/113] rtl8xxxu: Correct struct rtl8723bu_efuse to list power bases correctly
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (78 preceding siblings ...)
2016-02-29 22:05 ` [PATCH 079/113] rtl8xxxu: Do not use hard-wired RF enable settings for 8723bu Jes.Sorensen
@ 2016-02-29 22:05 ` Jes.Sorensen
2016-02-29 22:05 ` [PATCH 081/113] rtl8xxxu: Introduce set_tx_power() fileop and a new 8723b dummy derivative Jes.Sorensen
` (33 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:05 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
Correct TX power definitions in rtl8723bu_efuse
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 10 ----------
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 23 ++++++++++++++++++-----
2 files changed, 18 insertions(+), 15 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 9caee4dc..0afa9a9 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -2338,16 +2338,6 @@ static int rtl8723bu_parse_efuse(struct rtl8xxxu_priv *priv)
ether_addr_copy(priv->mac_addr, efuse->mac_addr);
- memcpy(priv->cck_tx_power_index_A, efuse->cck_tx_power_index_A,
- sizeof(priv->cck_tx_power_index_A));
- memcpy(priv->cck_tx_power_index_B, efuse->cck_tx_power_index_B,
- sizeof(priv->cck_tx_power_index_B));
-
- memcpy(priv->ht40_1s_tx_power_index_A, efuse->ht40_1s_tx_power_index_A,
- sizeof(priv->ht40_1s_tx_power_index_A));
- memcpy(priv->ht40_1s_tx_power_index_B, efuse->ht40_1s_tx_power_index_B,
- sizeof(priv->ht40_1s_tx_power_index_B));
-
priv->has_xtalk = 1;
priv->xtalk = priv->efuse_wifi.efuse8723bu.xtal_k & 0x3f;
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
index ac8f47f..6d56581 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
@@ -53,6 +53,7 @@
#define RTL8723A_CHANNEL_GROUPS 3
#define RTL8723A_MAX_RF_PATHS 2
+#define RTL8723B_MAX_RF_PATHS 4
#define RF6052_MAX_TX_PWR 0x3f
#define EFUSE_MAP_LEN 512
@@ -631,14 +632,26 @@ struct rtl8192cu_efuse {
u8 customer_id;
};
+struct rtl8723bu_efuse_tx_power {
+ u8 cck_base[6];
+ u8 ht40_base[5];
+ struct rtl8723au_idx ht20_ofdm_1s_diff;
+ struct rtl8723au_idx ht40_ht20_2s_diff;
+ struct rtl8723au_idx ofdm_cck_2s_diff; /* not used */
+ struct rtl8723au_idx ht40_ht20_3s_diff;
+ struct rtl8723au_idx ofdm_cck_3s_diff; /* not used */
+ struct rtl8723au_idx ht40_ht20_4s_diff;
+ struct rtl8723au_idx ofdm_cck_4s_diff; /* not used */
+ u8 dummy5g[24]; /* max channel group (14) + power diff offset (10) */
+};
+
struct rtl8723bu_efuse {
__le16 rtl_id;
u8 res0[0x0e];
- u8 cck_tx_power_index_A[3]; /* 0x10 */
- u8 cck_tx_power_index_B[3];
- u8 ht40_1s_tx_power_index_A[3]; /* 0x16 */
- u8 ht40_1s_tx_power_index_B[3];
- u8 res1[0x9c];
+ struct rtl8723bu_efuse_tx_power tx_power_index_A; /* 0x10 */
+ struct rtl8723bu_efuse_tx_power tx_power_index_B; /* 0x3a */
+ struct rtl8723bu_efuse_tx_power tx_power_index_C; /* 0x64 */
+ struct rtl8723bu_efuse_tx_power tx_power_index_D; /* 0x8e */
u8 channel_plan; /* 0xb8 */
u8 xtal_k;
u8 thermal_meter;
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 081/113] rtl8xxxu: Introduce set_tx_power() fileop and a new 8723b dummy derivative
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (79 preceding siblings ...)
2016-02-29 22:05 ` [PATCH 080/113] rtl8xxxu: Correct struct rtl8723bu_efuse to list power bases correctly Jes.Sorensen
@ 2016-02-29 22:05 ` Jes.Sorensen
2016-02-29 22:05 ` [PATCH 082/113] rtl8xxxu: Use size of source pointer when copying efuse data Jes.Sorensen
` (32 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:05 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
The 8723b series is significantly different from the older generation
in this sense. So far the 8723b version doesn't do anything useful.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 34 ++++++++++++++++++++++--
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 2 ++
2 files changed, 34 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 0afa9a9..f640306 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -1680,6 +1680,24 @@ static int rtl8723a_channel_to_group(int channel)
return group;
}
+static int rtl8723b_channel_to_group(int channel)
+{
+ int group;
+
+ if (channel < 3)
+ group = 0;
+ else if (channel < 6)
+ group = 1;
+ else if (channel < 9)
+ group = 2;
+ else if (channel < 12)
+ group = 3;
+ else
+ group = 4;
+
+ return group;
+}
+
static void rtl8723au_config_channel(struct ieee80211_hw *hw)
{
struct rtl8xxxu_priv *priv = hw->priv;
@@ -2041,6 +2059,14 @@ rtl8723a_set_tx_power(struct rtl8xxxu_priv *priv, int channel, bool ht40)
}
}
+static void
+rtl8723b_set_tx_power(struct rtl8xxxu_priv *priv, int channel, bool ht40)
+{
+ int group;
+
+ group = rtl8723b_channel_to_group(channel);
+}
+
static void rtl8xxxu_set_linktype(struct rtl8xxxu_priv *priv,
enum nl80211_iftype linktype)
{
@@ -6378,7 +6404,7 @@ static int rtl8xxxu_init_device(struct ieee80211_hw *hw)
/*
* Start out with default power levels for channel 6, 20MHz
*/
- rtl8723a_set_tx_power(priv, 1, false);
+ priv->fops->set_tx_power(priv, 1, false);
/* Let the 8051 take control of antenna setting */
val8 = rtl8xxxu_read8(priv, REG_LEDCFG2);
@@ -7401,7 +7427,7 @@ static int rtl8xxxu_config(struct ieee80211_hw *hw, u32 changed)
channel = hw->conf.chandef.chan->hw_value;
- rtl8723a_set_tx_power(priv, channel, ht40);
+ priv->fops->set_tx_power(priv, channel, ht40);
priv->fops->config_channel(hw);
}
@@ -8026,6 +8052,7 @@ static struct rtl8xxxu_fileops rtl8723au_fops = {
.config_channel = rtl8723au_config_channel,
.parse_rx_desc = rtl8723au_parse_rx_desc,
.enable_rf = rtl8723a_enable_rf,
+ .set_tx_power = rtl8723a_set_tx_power,
.writeN_block_size = 1024,
.mbox_ext_reg = REG_HMBOX_EXT_0,
.mbox_ext_width = 2,
@@ -8048,6 +8075,7 @@ static struct rtl8xxxu_fileops rtl8723bu_fops = {
.init_aggregation = rtl8723bu_init_aggregation,
.init_statistics = rtl8723bu_init_statistics,
.enable_rf = rtl8723b_enable_rf,
+ .set_tx_power = rtl8723b_set_tx_power,
.writeN_block_size = 1024,
.mbox_ext_reg = REG_HMBOX_EXT0_8723B,
.mbox_ext_width = 4,
@@ -8069,6 +8097,7 @@ static struct rtl8xxxu_fileops rtl8192cu_fops = {
.config_channel = rtl8723au_config_channel,
.parse_rx_desc = rtl8723au_parse_rx_desc,
.enable_rf = rtl8723a_enable_rf,
+ .set_tx_power = rtl8723a_set_tx_power,
.writeN_block_size = 128,
.mbox_ext_reg = REG_HMBOX_EXT_0,
.mbox_ext_width = 2,
@@ -8089,6 +8118,7 @@ static struct rtl8xxxu_fileops rtl8192eu_fops = {
.config_channel = rtl8723bu_config_channel,
.parse_rx_desc = rtl8723bu_parse_rx_desc,
.enable_rf = rtl8723b_enable_rf,
+ .set_tx_power = rtl8723b_set_tx_power,
.writeN_block_size = 128,
.mbox_ext_reg = REG_HMBOX_EXT0_8723B,
.mbox_ext_width = 4,
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
index 6d56581..c7b4c92 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
@@ -1149,6 +1149,8 @@ struct rtl8xxxu_fileops {
void (*init_aggregation) (struct rtl8xxxu_priv *priv);
void (*init_statistics) (struct rtl8xxxu_priv *priv);
void (*enable_rf) (struct rtl8xxxu_priv *priv);
+ void (*set_tx_power) (struct rtl8xxxu_priv *priv, int channel,
+ bool ht40);
int writeN_block_size;
u16 mbox_ext_reg;
char mbox_ext_width;
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 082/113] rtl8xxxu: Use size of source pointer when copying efuse data
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (80 preceding siblings ...)
2016-02-29 22:05 ` [PATCH 081/113] rtl8xxxu: Introduce set_tx_power() fileop and a new 8723b dummy derivative Jes.Sorensen
@ 2016-02-29 22:05 ` Jes.Sorensen
2016-02-29 22:05 ` [PATCH 083/113] rtl8xxxu: Bump TX power arrays to handle larger channel groups Jes.Sorensen
` (31 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:05 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
Some newer chips have more channel groups in their efuse parameter
tables, so use the size of the source, rather than the destination
when copying them out. This avoids copying garbage when increasing the
common array sizes.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 34 ++++++++++++------------
1 file changed, 17 insertions(+), 17 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index f640306..39c6322 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -2318,31 +2318,31 @@ static int rtl8723au_parse_efuse(struct rtl8xxxu_priv *priv)
memcpy(priv->cck_tx_power_index_A,
efuse->cck_tx_power_index_A,
- sizeof(priv->cck_tx_power_index_A));
+ sizeof(efuse->cck_tx_power_index_A));
memcpy(priv->cck_tx_power_index_B,
efuse->cck_tx_power_index_B,
- sizeof(priv->cck_tx_power_index_B));
+ sizeof(efuse->cck_tx_power_index_B));
memcpy(priv->ht40_1s_tx_power_index_A,
efuse->ht40_1s_tx_power_index_A,
- sizeof(priv->ht40_1s_tx_power_index_A));
+ sizeof(efuse->ht40_1s_tx_power_index_A));
memcpy(priv->ht40_1s_tx_power_index_B,
efuse->ht40_1s_tx_power_index_B,
- sizeof(priv->ht40_1s_tx_power_index_B));
+ sizeof(efuse->ht40_1s_tx_power_index_B));
memcpy(priv->ht20_tx_power_index_diff,
efuse->ht20_tx_power_index_diff,
- sizeof(priv->ht20_tx_power_index_diff));
+ sizeof(efuse->ht20_tx_power_index_diff));
memcpy(priv->ofdm_tx_power_index_diff,
efuse->ofdm_tx_power_index_diff,
- sizeof(priv->ofdm_tx_power_index_diff));
+ sizeof(efuse->ofdm_tx_power_index_diff));
memcpy(priv->ht40_max_power_offset,
efuse->ht40_max_power_offset,
- sizeof(priv->ht40_max_power_offset));
+ sizeof(efuse->ht40_max_power_offset));
memcpy(priv->ht20_max_power_offset,
efuse->ht20_max_power_offset,
- sizeof(priv->ht20_max_power_offset));
+ sizeof(efuse->ht20_max_power_offset));
if (priv->efuse_wifi.efuse8723.version >= 0x01) {
priv->has_xtalk = 1;
@@ -2403,34 +2403,34 @@ static int rtl8192cu_parse_efuse(struct rtl8xxxu_priv *priv)
memcpy(priv->cck_tx_power_index_A,
efuse->cck_tx_power_index_A,
- sizeof(priv->cck_tx_power_index_A));
+ sizeof(efuse->cck_tx_power_index_A));
memcpy(priv->cck_tx_power_index_B,
efuse->cck_tx_power_index_B,
- sizeof(priv->cck_tx_power_index_B));
+ sizeof(efuse->cck_tx_power_index_B));
memcpy(priv->ht40_1s_tx_power_index_A,
efuse->ht40_1s_tx_power_index_A,
- sizeof(priv->ht40_1s_tx_power_index_A));
+ sizeof(efuse->ht40_1s_tx_power_index_A));
memcpy(priv->ht40_1s_tx_power_index_B,
efuse->ht40_1s_tx_power_index_B,
- sizeof(priv->ht40_1s_tx_power_index_B));
+ sizeof(efuse->ht40_1s_tx_power_index_B));
memcpy(priv->ht40_2s_tx_power_index_diff,
efuse->ht40_2s_tx_power_index_diff,
- sizeof(priv->ht40_2s_tx_power_index_diff));
+ sizeof(efuse->ht40_2s_tx_power_index_diff));
memcpy(priv->ht20_tx_power_index_diff,
efuse->ht20_tx_power_index_diff,
- sizeof(priv->ht20_tx_power_index_diff));
+ sizeof(efuse->ht20_tx_power_index_diff));
memcpy(priv->ofdm_tx_power_index_diff,
efuse->ofdm_tx_power_index_diff,
- sizeof(priv->ofdm_tx_power_index_diff));
+ sizeof(efuse->ofdm_tx_power_index_diff));
memcpy(priv->ht40_max_power_offset,
efuse->ht40_max_power_offset,
- sizeof(priv->ht40_max_power_offset));
+ sizeof(efuse->ht40_max_power_offset));
memcpy(priv->ht20_max_power_offset,
efuse->ht20_max_power_offset,
- sizeof(priv->ht20_max_power_offset));
+ sizeof(efuse->ht20_max_power_offset));
dev_info(&priv->udev->dev, "Vendor: %.7s\n",
efuse->vendor_name);
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 083/113] rtl8xxxu: Bump TX power arrays to handle larger channel groups
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (81 preceding siblings ...)
2016-02-29 22:05 ` [PATCH 082/113] rtl8xxxu: Use size of source pointer when copying efuse data Jes.Sorensen
@ 2016-02-29 22:05 ` Jes.Sorensen
2016-02-29 22:05 ` [PATCH 084/113] rtl8xxxu: Parse efuse power indices for 8723bu Jes.Sorensen
` (30 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:05 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
Newer generation chips have more channels groups. In order to carry
the larger arrays in common structures, bump the array sizes to
match.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 25 +++++++++++++++---------
1 file changed, 16 insertions(+), 9 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
index c7b4c92..92768f5 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
@@ -53,7 +53,9 @@
#define RTL8723A_CHANNEL_GROUPS 3
#define RTL8723A_MAX_RF_PATHS 2
+#define RTL8723B_CHANNEL_GROUPS 6
#define RTL8723B_MAX_RF_PATHS 4
+#define RTL8XXXU_MAX_CHANNEL_GROUPS 6
#define RF6052_MAX_TX_PWR 0x3f
#define EFUSE_MAP_LEN 512
@@ -1046,19 +1048,24 @@ struct rtl8xxxu_priv {
u8 mac_addr[ETH_ALEN];
char chip_name[8];
char chip_vendor[8];
- u8 cck_tx_power_index_A[3]; /* 0x10 */
- u8 cck_tx_power_index_B[3];
- u8 ht40_1s_tx_power_index_A[3]; /* 0x16 */
- u8 ht40_1s_tx_power_index_B[3];
+ u8 cck_tx_power_index_A[RTL8XXXU_MAX_CHANNEL_GROUPS];
+ u8 cck_tx_power_index_B[RTL8XXXU_MAX_CHANNEL_GROUPS];
+ u8 ht40_1s_tx_power_index_A[RTL8XXXU_MAX_CHANNEL_GROUPS];
+ u8 ht40_1s_tx_power_index_B[RTL8XXXU_MAX_CHANNEL_GROUPS];
/*
* The following entries are half-bytes split as:
* bits 0-3: path A, bits 4-7: path B, all values 4 bits signed
*/
- struct rtl8723au_idx ht40_2s_tx_power_index_diff[3];
- struct rtl8723au_idx ht20_tx_power_index_diff[3];
- struct rtl8723au_idx ofdm_tx_power_index_diff[3];
- struct rtl8723au_idx ht40_max_power_offset[3];
- struct rtl8723au_idx ht20_max_power_offset[3];
+ struct rtl8723au_idx ht40_2s_tx_power_index_diff[
+ RTL8XXXU_MAX_CHANNEL_GROUPS];
+ struct rtl8723au_idx ht20_tx_power_index_diff[
+ RTL8XXXU_MAX_CHANNEL_GROUPS];
+ struct rtl8723au_idx ofdm_tx_power_index_diff[
+ RTL8XXXU_MAX_CHANNEL_GROUPS];
+ struct rtl8723au_idx ht40_max_power_offset[
+ RTL8XXXU_MAX_CHANNEL_GROUPS];
+ struct rtl8723au_idx ht20_max_power_offset[
+ RTL8XXXU_MAX_CHANNEL_GROUPS];
u32 chip_cut:4;
u32 rom_rev:4;
u32 is_multi_func:1;
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 084/113] rtl8xxxu: Parse efuse power indices for 8723bu
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (82 preceding siblings ...)
2016-02-29 22:05 ` [PATCH 083/113] rtl8xxxu: Bump TX power arrays to handle larger channel groups Jes.Sorensen
@ 2016-02-29 22:05 ` Jes.Sorensen
2016-02-29 22:05 ` [PATCH 085/113] rtl8xxxu: Set 8723bu TX power for CCK and OFDM rates Jes.Sorensen
` (29 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:05 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
This should (hopefully) parse the power indices correctly for the
8723bu.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 43 ++++++++++++++++++++++++
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 43 +++++++++++++++---------
2 files changed, 71 insertions(+), 15 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 39c6322..970f0ec 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -2358,12 +2358,55 @@ static int rtl8723au_parse_efuse(struct rtl8xxxu_priv *priv)
static int rtl8723bu_parse_efuse(struct rtl8xxxu_priv *priv)
{
struct rtl8723bu_efuse *efuse = &priv->efuse_wifi.efuse8723bu;
+ int i;
if (efuse->rtl_id != cpu_to_le16(0x8129))
return -EINVAL;
ether_addr_copy(priv->mac_addr, efuse->mac_addr);
+ memcpy(priv->cck_tx_power_index_A, efuse->tx_power_index_A.cck_base,
+ sizeof(efuse->tx_power_index_A.cck_base));
+ memcpy(priv->cck_tx_power_index_B, efuse->tx_power_index_B.cck_base,
+ sizeof(efuse->tx_power_index_B.cck_base));
+
+ memcpy(priv->ht40_1s_tx_power_index_A,
+ efuse->tx_power_index_A.ht40_base,
+ sizeof(efuse->tx_power_index_A.ht40_base));
+ memcpy(priv->ht40_1s_tx_power_index_B,
+ efuse->tx_power_index_B.ht40_base,
+ sizeof(efuse->tx_power_index_B.ht40_base));
+
+ priv->ofdm_tx_power_diff[0].a =
+ efuse->tx_power_index_A.ht20_ofdm_1s_diff.a;
+ priv->ofdm_tx_power_diff[0].b =
+ efuse->tx_power_index_B.ht20_ofdm_1s_diff.a;
+
+ priv->ht20_tx_power_diff[0].a =
+ efuse->tx_power_index_A.ht20_ofdm_1s_diff.b;
+ priv->ht20_tx_power_diff[0].b =
+ efuse->tx_power_index_B.ht20_ofdm_1s_diff.b;
+
+ priv->ht40_tx_power_diff[0].a = 0;
+ priv->ht40_tx_power_diff[0].b = 0;
+
+ for (i = 1; i < RTL8723B_TX_COUNT; i++) {
+ priv->ofdm_tx_power_diff[i].a =
+ efuse->tx_power_index_A.pwr_diff[i - 1].ofdm;
+ priv->ofdm_tx_power_diff[i].b =
+ efuse->tx_power_index_B.pwr_diff[i - 1].ofdm;
+
+ priv->ht20_tx_power_diff[i].a =
+ efuse->tx_power_index_A.pwr_diff[i - 1].ht20;
+ priv->ht20_tx_power_diff[i].b =
+ efuse->tx_power_index_B.pwr_diff[i - 1].ht20;
+
+ priv->ht40_tx_power_diff[i].a =
+ efuse->tx_power_index_A.pwr_diff[i - 1].ht40;
+ priv->ht40_tx_power_diff[i].b =
+ efuse->tx_power_index_B.pwr_diff[i - 1].ht40;
+ }
+
priv->has_xtalk = 1;
priv->xtalk = priv->efuse_wifi.efuse8723bu.xtal_k & 0x3f;
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
index 92768f5..fe23561 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
@@ -54,6 +54,7 @@
#define RTL8723A_CHANNEL_GROUPS 3
#define RTL8723A_MAX_RF_PATHS 2
#define RTL8723B_CHANNEL_GROUPS 6
+#define RTL8723B_TX_COUNT 4
#define RTL8723B_MAX_RF_PATHS 4
#define RTL8XXXU_MAX_CHANNEL_GROUPS 6
#define RF6052_MAX_TX_PWR 0x3f
@@ -634,16 +635,25 @@ struct rtl8192cu_efuse {
u8 customer_id;
};
+struct rtl8723bu_pwr_idx {
+#ifdef __LITTLE_ENDIAN
+ int ht20:4;
+ int ht40:4;
+ int ofdm:4;
+ int cck:4;
+#else
+ int cck:4;
+ int ofdm:4;
+ int ht40:4;
+ int ht20:4;
+#endif
+} __attribute__((packed));
+
struct rtl8723bu_efuse_tx_power {
u8 cck_base[6];
u8 ht40_base[5];
struct rtl8723au_idx ht20_ofdm_1s_diff;
- struct rtl8723au_idx ht40_ht20_2s_diff;
- struct rtl8723au_idx ofdm_cck_2s_diff; /* not used */
- struct rtl8723au_idx ht40_ht20_3s_diff;
- struct rtl8723au_idx ofdm_cck_3s_diff; /* not used */
- struct rtl8723au_idx ht40_ht20_4s_diff;
- struct rtl8723au_idx ofdm_cck_4s_diff; /* not used */
+ struct rtl8723bu_pwr_idx pwr_diff[3];
u8 dummy5g[24]; /* max channel group (14) + power diff offset (10) */
};
@@ -1057,15 +1067,18 @@ struct rtl8xxxu_priv {
* bits 0-3: path A, bits 4-7: path B, all values 4 bits signed
*/
struct rtl8723au_idx ht40_2s_tx_power_index_diff[
- RTL8XXXU_MAX_CHANNEL_GROUPS];
- struct rtl8723au_idx ht20_tx_power_index_diff[
- RTL8XXXU_MAX_CHANNEL_GROUPS];
- struct rtl8723au_idx ofdm_tx_power_index_diff[
- RTL8XXXU_MAX_CHANNEL_GROUPS];
- struct rtl8723au_idx ht40_max_power_offset[
- RTL8XXXU_MAX_CHANNEL_GROUPS];
- struct rtl8723au_idx ht20_max_power_offset[
- RTL8XXXU_MAX_CHANNEL_GROUPS];
+ RTL8723A_CHANNEL_GROUPS];
+ struct rtl8723au_idx ht20_tx_power_index_diff[RTL8723A_CHANNEL_GROUPS];
+ struct rtl8723au_idx ofdm_tx_power_index_diff[RTL8723A_CHANNEL_GROUPS];
+ struct rtl8723au_idx ht40_max_power_offset[RTL8723A_CHANNEL_GROUPS];
+ struct rtl8723au_idx ht20_max_power_offset[RTL8723A_CHANNEL_GROUPS];
+ /*
+ * Newer generation chips only keep power diffs per TX count,
+ * not per channel group.
+ */
+ struct rtl8723au_idx ofdm_tx_power_diff[RTL8723B_TX_COUNT];
+ struct rtl8723au_idx ht20_tx_power_diff[RTL8723B_TX_COUNT];
+ struct rtl8723au_idx ht40_tx_power_diff[RTL8723B_TX_COUNT];
u32 chip_cut:4;
u32 rom_rev:4;
u32 is_multi_func:1;
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 085/113] rtl8xxxu: Set 8723bu TX power for CCK and OFDM rates
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (83 preceding siblings ...)
2016-02-29 22:05 ` [PATCH 084/113] rtl8xxxu: Parse efuse power indices for 8723bu Jes.Sorensen
@ 2016-02-29 22:05 ` Jes.Sorensen
2016-02-29 22:05 ` [PATCH 086/113] rtl8xxxu: Set 8723bu MCS TX power Jes.Sorensen
` (28 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:05 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
This implements support for setting TX power for CCK and OFDM rates on
8723bu. MCS rates is still pending.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 23 ++++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 970f0ec..daea712 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -2062,9 +2062,30 @@ rtl8723a_set_tx_power(struct rtl8xxxu_priv *priv, int channel, bool ht40)
static void
rtl8723b_set_tx_power(struct rtl8xxxu_priv *priv, int channel, bool ht40)
{
- int group;
+ u32 val32, ofdm;
+ u8 cck, ofdmbase;
+ int group, tx_idx;
+ tx_idx = 0;
group = rtl8723b_channel_to_group(channel);
+
+ cck = priv->cck_tx_power_index_B[group];
+ val32 = rtl8xxxu_read32(priv, REG_TX_AGC_A_CCK1_MCS32);
+ val32 &= 0xffff00ff;
+ val32 |= (cck << 8);
+ rtl8xxxu_write32(priv, REG_TX_AGC_A_CCK1_MCS32, val32);
+
+ val32 = rtl8xxxu_read32(priv, REG_TX_AGC_B_CCK11_A_CCK2_11);
+ val32 &= 0xff;
+ val32 |= ((cck << 8) | (cck << 16) | (cck << 24));
+ rtl8xxxu_write32(priv, REG_TX_AGC_B_CCK11_A_CCK2_11, val32);
+
+ ofdmbase = priv->ht40_1s_tx_power_index_B[group];
+ ofdmbase += priv->ofdm_tx_power_diff[tx_idx].b;
+ ofdm = ofdmbase | ofdmbase << 8 | ofdmbase << 16 | ofdmbase << 24;
+
+ rtl8xxxu_write32(priv, REG_TX_AGC_A_RATE18_06, ofdm);
+ rtl8xxxu_write32(priv, REG_TX_AGC_A_RATE54_24, ofdm);
}
static void rtl8xxxu_set_linktype(struct rtl8xxxu_priv *priv,
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 086/113] rtl8xxxu: Set 8723bu MCS TX power
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (84 preceding siblings ...)
2016-02-29 22:05 ` [PATCH 085/113] rtl8xxxu: Set 8723bu TX power for CCK and OFDM rates Jes.Sorensen
@ 2016-02-29 22:05 ` Jes.Sorensen
2016-02-29 22:05 ` [PATCH 087/113] rtl8xxxu: Set the correct thermal meter register for 8723bu Jes.Sorensen
` (27 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:05 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
This adds the missing support for setting MCS TX power rates on 8723bu.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index daea712..cca3b92 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -2062,8 +2062,8 @@ rtl8723a_set_tx_power(struct rtl8xxxu_priv *priv, int channel, bool ht40)
static void
rtl8723b_set_tx_power(struct rtl8xxxu_priv *priv, int channel, bool ht40)
{
- u32 val32, ofdm;
- u8 cck, ofdmbase;
+ u32 val32, ofdm, mcs;
+ u8 cck, ofdmbase, mcsbase;
int group, tx_idx;
tx_idx = 0;
@@ -2086,6 +2086,16 @@ rtl8723b_set_tx_power(struct rtl8xxxu_priv *priv, int channel, bool ht40)
rtl8xxxu_write32(priv, REG_TX_AGC_A_RATE18_06, ofdm);
rtl8xxxu_write32(priv, REG_TX_AGC_A_RATE54_24, ofdm);
+
+ mcsbase = priv->ht40_1s_tx_power_index_B[group];
+ if (ht40)
+ mcsbase += priv->ht40_tx_power_diff[tx_idx++].b;
+ else
+ mcsbase += priv->ht20_tx_power_diff[tx_idx++].b;
+ mcs = mcsbase | mcsbase << 8 | mcsbase << 16 | mcsbase << 24;
+
+ rtl8xxxu_write32(priv, REG_TX_AGC_A_MCS03_MCS00, mcs);
+ rtl8xxxu_write32(priv, REG_TX_AGC_A_MCS07_MCS04, mcs);
}
static void rtl8xxxu_set_linktype(struct rtl8xxxu_priv *priv,
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 087/113] rtl8xxxu: Set the correct thermal meter register for 8723bu
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (85 preceding siblings ...)
2016-02-29 22:05 ` [PATCH 086/113] rtl8xxxu: Set 8723bu MCS TX power Jes.Sorensen
@ 2016-02-29 22:05 ` Jes.Sorensen
2016-02-29 22:05 ` [PATCH 088/113] rtl8xxxu: Add definition for 8723bu tx descriptor Jes.Sorensen
` (26 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:05 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
Older chips use RF register 0x24 to set the thermal meter. Newer chips
use register 0x42.
This change makes sure to set the correct thermal meter register
depending on the chip.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index cca3b92..6825351 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -6502,7 +6502,11 @@ static int rtl8xxxu_init_device(struct ieee80211_hw *hw)
/*
* This should enable thermal meter
*/
- rtl8xxxu_write_rfreg(priv, RF_A, RF6052_REG_T_METER, 0x60);
+ if (priv->fops->has_s0s1)
+ rtl8xxxu_write_rfreg(priv,
+ RF_A, RF6052_REG_T_METER_8723B, 0x37cf8);
+ else
+ rtl8xxxu_write_rfreg(priv, RF_A, RF6052_REG_T_METER, 0x60);
/* Init BT hw config. */
if (priv->fops->init_bt)
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 088/113] rtl8xxxu: Add definition for 8723bu tx descriptor
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (86 preceding siblings ...)
2016-02-29 22:05 ` [PATCH 087/113] rtl8xxxu: Set the correct thermal meter register for 8723bu Jes.Sorensen
@ 2016-02-29 22:05 ` Jes.Sorensen
2016-02-29 22:05 ` [PATCH 089/113] rtl8xxxu: Handle 40 byte TX descriptors for rtl8723bu Jes.Sorensen
` (25 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:05 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
Newer generation chips use a 40 byte TX descriptor, compared to the
32 byte descriptor used on older chips.
This adds the definition for the 40 byte descriptor.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
index fe23561..f06b88b 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
@@ -346,6 +346,22 @@ struct rtl8xxxu_tx_desc {
__le16 txdw7;
};
+struct rtl8723bu_tx_desc {
+ __le16 pkt_size;
+ u8 pkt_offset;
+ u8 txdw0;
+ __le32 txdw1;
+ __le32 txdw2;
+ __le32 txdw3;
+ __le32 txdw4;
+ __le32 txdw5;
+ __le32 txdw6;
+ __le16 csum;
+ __le16 txdw7;
+ __le32 txdw8;
+ __le32 txdw9;
+};
+
/* CCK Rates, TxHT = 0 */
#define DESC_RATE_1M 0x00
#define DESC_RATE_2M 0x01
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 089/113] rtl8xxxu: Handle 40 byte TX descriptors for rtl8723bu
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (87 preceding siblings ...)
2016-02-29 22:05 ` [PATCH 088/113] rtl8xxxu: Add definition for 8723bu tx descriptor Jes.Sorensen
@ 2016-02-29 22:05 ` Jes.Sorensen
2016-02-29 22:05 ` [PATCH 090/113] rtl8xxxu: Do not unconditionally print debug info in rtl8723bu_handle_c2h() Jes.Sorensen
` (24 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:05 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
Note the descriptor checksum is still only calculated over the initial
32 bytes of the descriptor, ignoring the last 8 bytes of the
descriptor.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 35 ++++++++++++++++--------
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 3 +-
2 files changed, 25 insertions(+), 13 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 6825351..c69a062 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -6787,7 +6787,12 @@ static u32 rtl8xxxu_queue_select(struct ieee80211_hw *hw, struct sk_buff *skb)
return queue;
}
-static void rtl8xxxu_calc_tx_desc_csum(struct rtl8xxxu_tx_desc *tx_desc)
+/*
+ * Despite newer chips 8723b/8812/8821 having a larger TX descriptor
+ * format. The descriptor checksum is still only calculated over the
+ * initial 32 bytes of the descriptor!
+ */
+static void rtl8xxxu_calc_tx_desc_csum(struct rtl8723au_tx_desc *tx_desc)
{
__le16 *ptr = (__le16 *)tx_desc;
u16 csum = 0;
@@ -6799,7 +6804,7 @@ static void rtl8xxxu_calc_tx_desc_csum(struct rtl8xxxu_tx_desc *tx_desc)
*/
tx_desc->csum = cpu_to_le16(0);
- for (i = 0; i < (sizeof(struct rtl8xxxu_tx_desc) / sizeof(u16)); i++)
+ for (i = 0; i < (sizeof(struct rtl8723au_tx_desc) / sizeof(u16)); i++)
csum = csum ^ le16_to_cpu(ptr[i]);
tx_desc->csum |= cpu_to_le16(csum);
@@ -6868,13 +6873,15 @@ static void rtl8xxxu_tx_complete(struct urb *urb)
struct sk_buff *skb = (struct sk_buff *)urb->context;
struct ieee80211_tx_info *tx_info;
struct ieee80211_hw *hw;
+ struct rtl8xxxu_priv *priv;
struct rtl8xxxu_tx_urb *tx_urb =
container_of(urb, struct rtl8xxxu_tx_urb, urb);
tx_info = IEEE80211_SKB_CB(skb);
hw = tx_info->rate_driver_data[0];
+ priv = hw->priv;
- skb_pull(skb, sizeof(struct rtl8xxxu_tx_desc));
+ skb_pull(skb, priv->fops->tx_desc_size);
ieee80211_tx_info_clear_status(tx_info);
tx_info->status.rates[0].idx = -1;
@@ -6885,7 +6892,7 @@ static void rtl8xxxu_tx_complete(struct urb *urb)
ieee80211_tx_status_irqsafe(hw, skb);
- rtl8xxxu_free_tx_urb(hw->priv, tx_urb);
+ rtl8xxxu_free_tx_urb(priv, tx_urb);
}
static void rtl8xxxu_dump_action(struct device *dev,
@@ -6935,7 +6942,7 @@ static void rtl8xxxu_tx(struct ieee80211_hw *hw,
struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
struct ieee80211_rate *tx_rate = ieee80211_get_tx_rate(hw, tx_info);
struct rtl8xxxu_priv *priv = hw->priv;
- struct rtl8xxxu_tx_desc *tx_desc;
+ struct rtl8723au_tx_desc *tx_desc;
struct rtl8xxxu_tx_urb *tx_urb;
struct ieee80211_sta *sta = NULL;
struct ieee80211_vif *vif = tx_info->control.vif;
@@ -6944,16 +6951,17 @@ static void rtl8xxxu_tx(struct ieee80211_hw *hw,
u16 pktlen = skb->len;
u16 seq_number;
u16 rate_flag = tx_info->control.rates[0].flags;
+ int tx_desc_size = priv->fops->tx_desc_size;
int ret;
- if (skb_headroom(skb) < sizeof(struct rtl8xxxu_tx_desc)) {
+ if (skb_headroom(skb) < tx_desc_size) {
dev_warn(dev,
"%s: Not enough headroom (%i) for tx descriptor\n",
__func__, skb_headroom(skb));
goto error;
}
- if (unlikely(skb->len > (65535 - sizeof(struct rtl8xxxu_tx_desc)))) {
+ if (unlikely(skb->len > (65535 - tx_desc_size))) {
dev_warn(dev, "%s: Trying to send over-sized skb (%i)\n",
__func__, skb->len);
goto error;
@@ -6977,12 +6985,11 @@ static void rtl8xxxu_tx(struct ieee80211_hw *hw,
if (control && control->sta)
sta = control->sta;
- tx_desc = (struct rtl8xxxu_tx_desc *)
- skb_push(skb, sizeof(struct rtl8xxxu_tx_desc));
+ tx_desc = (struct rtl8723au_tx_desc *)skb_push(skb, tx_desc_size);
- memset(tx_desc, 0, sizeof(struct rtl8xxxu_tx_desc));
+ memset(tx_desc, 0, tx_desc_size);
tx_desc->pkt_size = cpu_to_le16(pktlen);
- tx_desc->pkt_offset = sizeof(struct rtl8xxxu_tx_desc);
+ tx_desc->pkt_offset = tx_desc_size;
tx_desc->txdw0 =
TXDESC_OWN | TXDESC_FIRST_SEGMENT | TXDESC_LAST_SEGMENT;
@@ -8077,7 +8084,7 @@ static int rtl8xxxu_probe(struct usb_interface *interface,
SET_IEEE80211_DEV(priv->hw, &interface->dev);
SET_IEEE80211_PERM_ADDR(hw, priv->mac_addr);
- hw->extra_tx_headroom = sizeof(struct rtl8xxxu_tx_desc);
+ hw->extra_tx_headroom = priv->fops->tx_desc_size;
ieee80211_hw_set(hw, SIGNAL_DBM);
/*
* The firmware handles rate control
@@ -8134,6 +8141,7 @@ static struct rtl8xxxu_fileops rtl8723au_fops = {
.writeN_block_size = 1024,
.mbox_ext_reg = REG_HMBOX_EXT_0,
.mbox_ext_width = 2,
+ .tx_desc_size = sizeof(struct rtl8723au_tx_desc),
.adda_1t_init = 0x0b1b25a0,
.adda_1t_path_on = 0x0bdb25a0,
.adda_2t_path_on_a = 0x04db25a4,
@@ -8157,6 +8165,7 @@ static struct rtl8xxxu_fileops rtl8723bu_fops = {
.writeN_block_size = 1024,
.mbox_ext_reg = REG_HMBOX_EXT0_8723B,
.mbox_ext_width = 4,
+ .tx_desc_size = sizeof(struct rtl8723bu_tx_desc),
.has_s0s1 = 1,
.adda_1t_init = 0x01c00014,
.adda_1t_path_on = 0x01c00014,
@@ -8179,6 +8188,7 @@ static struct rtl8xxxu_fileops rtl8192cu_fops = {
.writeN_block_size = 128,
.mbox_ext_reg = REG_HMBOX_EXT_0,
.mbox_ext_width = 2,
+ .tx_desc_size = sizeof(struct rtl8723au_tx_desc),
.adda_1t_init = 0x0b1b25a0,
.adda_1t_path_on = 0x0bdb25a0,
.adda_2t_path_on_a = 0x04db25a4,
@@ -8200,6 +8210,7 @@ static struct rtl8xxxu_fileops rtl8192eu_fops = {
.writeN_block_size = 128,
.mbox_ext_reg = REG_HMBOX_EXT0_8723B,
.mbox_ext_width = 4,
+ .tx_desc_size = sizeof(struct rtl8723au_tx_desc),
.has_s0s1 = 1,
.adda_1t_init = 0x0fc01616,
.adda_1t_path_on = 0x0fc01616,
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
index f06b88b..d53912a 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
@@ -332,7 +332,7 @@ struct rtl8723bu_rx_desc {
__le32 tsfl;
};
-struct rtl8xxxu_tx_desc {
+struct rtl8723au_tx_desc {
__le16 pkt_size;
u8 pkt_offset;
u8 txdw0;
@@ -1190,6 +1190,7 @@ struct rtl8xxxu_fileops {
int writeN_block_size;
u16 mbox_ext_reg;
char mbox_ext_width;
+ char tx_desc_size;
char has_s0s1;
u32 adda_1t_init;
u32 adda_1t_path_on;
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 090/113] rtl8xxxu: Do not unconditionally print debug info in rtl8723bu_handle_c2h()
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (88 preceding siblings ...)
2016-02-29 22:05 ` [PATCH 089/113] rtl8xxxu: Handle 40 byte TX descriptors for rtl8723bu Jes.Sorensen
@ 2016-02-29 22:05 ` Jes.Sorensen
2016-02-29 22:05 ` [PATCH 091/113] rtl8xxxu: Add additional tx descriptor bits for data word 0 Jes.Sorensen
` (23 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:05 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
Reduce the log level in rtl8723bu_handle_c2h()
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index c69a062..d137915c 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -7296,29 +7296,29 @@ static void rtl8723bu_handle_c2h(struct rtl8xxxu_priv *priv,
len = skb->len - 2;
- dev_info(dev, "C2H ID %02x seq %02x, len %02x source %02x\n",
- c2h->id, c2h->seq, len, c2h->bt_info.response_source);
+ dev_dbg(dev, "C2H ID %02x seq %02x, len %02x source %02x\n",
+ c2h->id, c2h->seq, len, c2h->bt_info.response_source);
switch(c2h->id) {
case C2H_8723B_BT_INFO:
if (c2h->bt_info.response_source >
BT_INFO_SRC_8723B_BT_ACTIVE_SEND)
- dev_info(dev, "C2H_BT_INFO WiFi only firmware\n");
+ dev_dbg(dev, "C2H_BT_INFO WiFi only firmware\n");
else
- dev_info(dev, "C2H_BT_INFO BT/WiFi coexist firmware\n");
+ dev_dbg(dev, "C2H_BT_INFO BT/WiFi coexist firmware\n");
if (c2h->bt_info.bt_has_reset)
- dev_info(dev, "BT has been reset\n");
+ dev_dbg(dev, "BT has been reset\n");
if (c2h->bt_info.tx_rx_mask)
- dev_info(dev, "BT TRx mask\n");
+ dev_dbg(dev, "BT TRx mask\n");
break;
case C2H_8723B_BT_MP_INFO:
- dev_info(dev, "C2H_MP_INFO ext ID %02x, status %02x\n",
- c2h->bt_mp_info.ext_id, c2h->bt_mp_info.status);
+ dev_dbg(dev, "C2H_MP_INFO ext ID %02x, status %02x\n",
+ c2h->bt_mp_info.ext_id, c2h->bt_mp_info.status);
break;
default:
- pr_info("%s: Unhandled C2H event %02x\n", __func__, c2h->id);
+ dev_info(dev, "Unhandled C2H event %02x\n", c2h->id);
break;
}
}
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 091/113] rtl8xxxu: Add additional tx descriptor bits for data word 0
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (89 preceding siblings ...)
2016-02-29 22:05 ` [PATCH 090/113] rtl8xxxu: Do not unconditionally print debug info in rtl8723bu_handle_c2h() Jes.Sorensen
@ 2016-02-29 22:05 ` Jes.Sorensen
2016-02-29 22:05 ` [PATCH 092/113] rtl8xxxu: Add more 40 byte TX desc bit definitions Jes.Sorensen
` (22 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:05 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
This adds documentation for some additional bits in TX descriptor word
0.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
index d53912a..9364a31 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
@@ -407,8 +407,12 @@ struct rtl8723bu_tx_desc {
#define TXDESC_OWN BIT(31)
#else
#define TXDESC_BROADMULTICAST BIT(0)
+#define TXDESC_HTC BIT(1)
#define TXDESC_LAST_SEGMENT BIT(2)
#define TXDESC_FIRST_SEGMENT BIT(3)
+#define TXDESC_LINIP BIT(4)
+#define TXDESC_NO_ACM BIT(5)
+#define TXDESC_GF BIT(6)
#define TXDESC_OWN BIT(7)
#endif
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 092/113] rtl8xxxu: Add more 40 byte TX desc bit definitions
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (90 preceding siblings ...)
2016-02-29 22:05 ` [PATCH 091/113] rtl8xxxu: Add additional tx descriptor bits for data word 0 Jes.Sorensen
@ 2016-02-29 22:05 ` Jes.Sorensen
2016-02-29 22:05 ` [PATCH 093/113] rtl8xxxu: Set the correct TX descriptor bits for agg and break on 8723b Jes.Sorensen
` (21 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:05 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
Add additional bit definitions for 40 byte TX descriptors, and rename
bits for 32 byte descriptors that are located differently in the 40
byte descriptor format.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 7 +++---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 27 +++++++++++++++++++++---
2 files changed, 28 insertions(+), 6 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index d137915c..62ed6af 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -7035,11 +7035,12 @@ static void rtl8xxxu_tx(struct ieee80211_hw *hw,
ampdu = (u32)sta->ht_cap.ampdu_density;
val32 = ampdu << TXDESC_AMPDU_DENSITY_SHIFT;
tx_desc->txdw2 |= cpu_to_le32(val32);
- tx_desc->txdw1 |= cpu_to_le32(TXDESC_AGG_ENABLE);
+
+ tx_desc->txdw1 |= cpu_to_le32(TXDESC_AGG_ENABLE_8723A);
} else
- tx_desc->txdw1 |= cpu_to_le32(TXDESC_BK);
+ tx_desc->txdw1 |= cpu_to_le32(TXDESC_AGG_BREAK_8723A);
} else
- tx_desc->txdw1 |= cpu_to_le32(TXDESC_BK);
+ tx_desc->txdw1 |= cpu_to_le32(TXDESC_AGG_BREAK_8723A);
if (ieee80211_is_data_qos(hdr->frame_control))
tx_desc->txdw4 |= cpu_to_le32(TXDESC_QOS);
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
index 9364a31..6ba12ab 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
@@ -417,9 +417,15 @@ struct rtl8723bu_tx_desc {
#endif
/* Word 1 */
+/*
+ * Bits 0-7 differ dependent on chip generation. For 8723au bits 5/6 are
+ * aggregation enable and break respectively. For 8723bu, bits 0-7 are macid.
+ */
#define TXDESC_PKT_OFFSET_SZ 0
-#define TXDESC_AGG_ENABLE BIT(5)
-#define TXDESC_BK BIT(6)
+#define TXDESC_AGG_ENABLE_8723A BIT(5)
+#define TXDESC_AGG_BREAK_8723A BIT(6)
+#define TXDESC_MACID_SHIFT_8723B 0
+#define TXDESC_MACID_MASK_8723B 0x00f0
#define TXDESC_QUEUE_SHIFT 8
#define TXDESC_QUEUE_MASK 0x1f00
#define TXDESC_QUEUE_BK 0x2
@@ -431,6 +437,9 @@ struct rtl8723bu_tx_desc {
#define TXDESC_QUEUE_MGNT 0x12
#define TXDESC_QUEUE_CMD 0x13
#define TXDESC_QUEUE_MAX (TXDESC_QUEUE_CMD + 1)
+#define TXDESC_RDG_NAV_EXT_8723B BIT(13)
+#define TXDESC_LSIG_TXOP_ENABLE_8723B BIT(14)
+#define TXDESC_PIFS_8723B BIT(15)
#define DESC_RATE_ID_SHIFT 16
#define DESC_RATE_ID_MASK 0xf
@@ -442,8 +451,20 @@ struct rtl8723bu_tx_desc {
#define TXDESC_HWPC BIT(31)
/* Word 2 */
-#define TXDESC_ACK_REPORT BIT(19)
+#define TXDESC_PAID_SHIFT_8723B 0
+#define TXDESC_PAID_MASK_8723B 0x1ff
+#define TXDESC_CCA_RTS_SHIFT_8723B 10
+#define TXDESC_CCA_RTS_MASK_8723B 0xc00
+#define TXDESC_AGG_ENABLE_8723B BIT(12)
+#define TXDESC_RDG_ENABLE_8723B BIT(13)
+#define TXDESC_AGG_BREAK_8723B BIT(16)
+#define TXDESC_MORE_FRAG_8723B BIT(17)
+#define TXDESC_RAW_8723B BIT(18)
+#define TXDESC_ACK_REPORT_8723A BIT(19)
+#define TXDESC_SPE_RPT_8723B BIT(19)
#define TXDESC_AMPDU_DENSITY_SHIFT 20
+#define TXDESC_BT_INT_8723B BIT(23)
+#define TXDESC_GID_8723B BIT(24)
/* Word 3 */
#define TXDESC_SEQ_SHIFT 16
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 093/113] rtl8xxxu: Set the correct TX descriptor bits for agg and break on 8723b
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (91 preceding siblings ...)
2016-02-29 22:05 ` [PATCH 092/113] rtl8xxxu: Add more 40 byte TX desc bit definitions Jes.Sorensen
@ 2016-02-29 22:05 ` Jes.Sorensen
2016-02-29 22:05 ` [PATCH 094/113] rtl8xxxu: Set sequence number correctly for 40 byte TX descriptors Jes.Sorensen
` (20 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:05 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
Fixup victim of the relocated bits for AGG_ENABLE/AGG_BREAK in the 40
byte TX descriptor
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 19 ++++++++++++++++---
1 file changed, 16 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 62ed6af..48a669e 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -6953,6 +6953,7 @@ static void rtl8xxxu_tx(struct ieee80211_hw *hw,
u16 rate_flag = tx_info->control.rates[0].flags;
int tx_desc_size = priv->fops->tx_desc_size;
int ret;
+ bool txdesc40, ampdu_enable;
if (skb_headroom(skb) < tx_desc_size) {
dev_warn(dev,
@@ -6980,6 +6981,7 @@ static void rtl8xxxu_tx(struct ieee80211_hw *hw,
if (ieee80211_is_action(hdr->frame_control))
rtl8xxxu_dump_action(dev, hdr);
+ txdesc40 = (tx_desc_size == 40);
tx_info->rate_driver_data[0] = hw;
if (control && control->sta)
@@ -7028,6 +7030,7 @@ static void rtl8xxxu_tx(struct ieee80211_hw *hw,
tx_desc->txdw5 |= cpu_to_le32(0x0001ff00);
/* (tx_info->flags & IEEE80211_TX_CTL_AMPDU) && */
+ ampdu_enable = false;
if (ieee80211_is_data_qos(hdr->frame_control) && sta) {
if (sta->ht_cap.ht_supported) {
u32 ampdu, val32;
@@ -7036,11 +7039,21 @@ static void rtl8xxxu_tx(struct ieee80211_hw *hw,
val32 = ampdu << TXDESC_AMPDU_DENSITY_SHIFT;
tx_desc->txdw2 |= cpu_to_le32(val32);
+ ampdu_enable = true;
+ }
+ }
+
+ if (!txdesc40) {
+ if (ampdu_enable)
tx_desc->txdw1 |= cpu_to_le32(TXDESC_AGG_ENABLE_8723A);
- } else
+ else
tx_desc->txdw1 |= cpu_to_le32(TXDESC_AGG_BREAK_8723A);
- } else
- tx_desc->txdw1 |= cpu_to_le32(TXDESC_AGG_BREAK_8723A);
+ } else {
+ if (ampdu_enable)
+ tx_desc->txdw2 |= cpu_to_le32(TXDESC_AGG_ENABLE_8723B);
+ else
+ tx_desc->txdw2 |= cpu_to_le32(TXDESC_AGG_BREAK_8723B);
+ };
if (ieee80211_is_data_qos(hdr->frame_control))
tx_desc->txdw4 |= cpu_to_le32(TXDESC_QOS);
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 094/113] rtl8xxxu: Set sequence number correctly for 40 byte TX descriptors
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (92 preceding siblings ...)
2016-02-29 22:05 ` [PATCH 093/113] rtl8xxxu: Set the correct TX descriptor bits for agg and break on 8723b Jes.Sorensen
@ 2016-02-29 22:05 ` Jes.Sorensen
2016-02-29 22:05 ` [PATCH 095/113] rtl8723au: Update TX descriptor words 4 and 5 definitions Jes.Sorensen
` (19 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:05 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
SEQ changed location in the 40 byte TX descriptor. Set it correctly.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 24 ++++++++++++++++--------
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 8 ++++++--
2 files changed, 22 insertions(+), 10 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 48a669e..14f6a2b 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -6943,6 +6943,7 @@ static void rtl8xxxu_tx(struct ieee80211_hw *hw,
struct ieee80211_rate *tx_rate = ieee80211_get_tx_rate(hw, tx_info);
struct rtl8xxxu_priv *priv = hw->priv;
struct rtl8723au_tx_desc *tx_desc;
+ struct rtl8723bu_tx_desc *tx_desc40;
struct rtl8xxxu_tx_urb *tx_urb;
struct ieee80211_sta *sta = NULL;
struct ieee80211_vif *vif = tx_info->control.vif;
@@ -6953,7 +6954,7 @@ static void rtl8xxxu_tx(struct ieee80211_hw *hw,
u16 rate_flag = tx_info->control.rates[0].flags;
int tx_desc_size = priv->fops->tx_desc_size;
int ret;
- bool txdesc40, ampdu_enable;
+ bool usedesc40, ampdu_enable;
if (skb_headroom(skb) < tx_desc_size) {
dev_warn(dev,
@@ -6981,7 +6982,7 @@ static void rtl8xxxu_tx(struct ieee80211_hw *hw,
if (ieee80211_is_action(hdr->frame_control))
rtl8xxxu_dump_action(dev, hdr);
- txdesc40 = (tx_desc_size == 40);
+ usedesc40 = (tx_desc_size == 40);
tx_info->rate_driver_data[0] = hw;
if (control && control->sta)
@@ -7017,9 +7018,6 @@ static void rtl8xxxu_tx(struct ieee80211_hw *hw,
}
}
- seq_number = IEEE80211_SEQ_TO_SN(le16_to_cpu(hdr->seq_ctrl));
- tx_desc->txdw3 = cpu_to_le32((u32)seq_number << TXDESC_SEQ_SHIFT);
-
if (rate_flag & IEEE80211_TX_RC_MCS)
rate = tx_info->control.rates[0].idx + DESC_RATE_MCS0;
else
@@ -7043,16 +7041,26 @@ static void rtl8xxxu_tx(struct ieee80211_hw *hw,
}
}
- if (!txdesc40) {
+ seq_number = IEEE80211_SEQ_TO_SN(le16_to_cpu(hdr->seq_ctrl));
+ if (!usedesc40) {
+ tx_desc->txdw3 =
+ cpu_to_le32((u32)seq_number << TXDESC_SEQ_SHIFT_8723A);
+
if (ampdu_enable)
tx_desc->txdw1 |= cpu_to_le32(TXDESC_AGG_ENABLE_8723A);
else
tx_desc->txdw1 |= cpu_to_le32(TXDESC_AGG_BREAK_8723A);
} else {
+ tx_desc40 = (struct rtl8723bu_tx_desc *)tx_desc;
+
+ tx_desc40->txdw9 =
+ cpu_to_le32((u32)seq_number << TXDESC_SEQ_SHIFT_8723B);
+
if (ampdu_enable)
- tx_desc->txdw2 |= cpu_to_le32(TXDESC_AGG_ENABLE_8723B);
+ tx_desc40->txdw2 |=
+ cpu_to_le32(TXDESC_AGG_ENABLE_8723B);
else
- tx_desc->txdw2 |= cpu_to_le32(TXDESC_AGG_BREAK_8723B);
+ tx_desc40->txdw2 |= cpu_to_le32(TXDESC_AGG_BREAK_8723B);
};
if (ieee80211_is_data_qos(hdr->frame_control))
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
index 6ba12ab..8f95896 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
@@ -467,8 +467,8 @@ struct rtl8723bu_tx_desc {
#define TXDESC_GID_8723B BIT(24)
/* Word 3 */
-#define TXDESC_SEQ_SHIFT 16
-#define TXDESC_SEQ_MASK 0x0fff0000
+#define TXDESC_SEQ_SHIFT_8723A 16
+#define TXDESC_SEQ_MASK_8723A 0x0fff0000
/* Word 4 */
#define TXDESC_QOS BIT(6)
@@ -498,6 +498,10 @@ struct rtl8723bu_tx_desc {
/* Word 6 */
#define TXDESC_MAX_AGG_SHIFT 11
+/* Word 9 */
+#define TXDESC_SEQ_SHIFT_8723B 12
+#define TXDESC_SEQ_MASK_8723B 0x00fff000
+
struct phy_rx_agc_info {
#ifdef __LITTLE_ENDIAN
u8 gain:7, trsw:1;
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 095/113] rtl8723au: Update TX descriptor words 4 and 5 definitions
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (93 preceding siblings ...)
2016-02-29 22:05 ` [PATCH 094/113] rtl8xxxu: Set sequence number correctly for 40 byte TX descriptors Jes.Sorensen
@ 2016-02-29 22:05 ` Jes.Sorensen
2016-02-29 22:05 ` [PATCH 096/113] rtl8xxxu: TX RTS rate is word 4 for 8723a Jes.Sorensen
` (18 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:05 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
TX data words 4 and 5 differ significantly between 32 byte and 40 byte
descriptors.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 11 ++++----
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 32 ++++++++++++++++--------
2 files changed, 28 insertions(+), 15 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 14f6a2b..9a1b4ee 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -7076,16 +7076,17 @@ static void rtl8xxxu_tx(struct ieee80211_hw *hw,
}
if (ieee80211_is_mgmt(hdr->frame_control)) {
tx_desc->txdw5 = cpu_to_le32(tx_rate->hw_value);
- tx_desc->txdw4 |= cpu_to_le32(TXDESC_USE_DRIVER_RATE);
- tx_desc->txdw5 |= cpu_to_le32(6 << TXDESC_RETRY_LIMIT_SHIFT);
- tx_desc->txdw5 |= cpu_to_le32(TXDESC_RETRY_LIMIT_ENABLE);
+ tx_desc->txdw4 |= cpu_to_le32(TXDESC_USE_DRIVER_RATE_8723A);
+ tx_desc->txdw5 |=
+ cpu_to_le32(6 << TXDESC_RETRY_LIMIT_SHIFT_8723A);
+ tx_desc->txdw5 |= cpu_to_le32(TXDESC_RETRY_LIMIT_ENABLE_8723A);
}
if (rate_flag & IEEE80211_TX_RC_USE_RTS_CTS) {
/* Use RTS rate 24M - does the mac80211 tell us which to use? */
tx_desc->txdw4 |= cpu_to_le32(DESC_RATE_24M);
- tx_desc->txdw4 |= cpu_to_le32(TXDESC_RTS_CTS_ENABLE);
- tx_desc->txdw4 |= cpu_to_le32(TXDESC_HW_RTS_ENABLE);
+ tx_desc->txdw4 |= cpu_to_le32(TXDESC_RTS_CTS_ENABLE_8723A);
+ tx_desc->txdw4 |= cpu_to_le32(TXDESC_HW_RTS_ENABLE_8723A);
}
rtl8xxxu_calc_tx_desc_csum(tx_desc);
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
index 8f95896..5f60f19 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
@@ -467,17 +467,21 @@ struct rtl8723bu_tx_desc {
#define TXDESC_GID_8723B BIT(24)
/* Word 3 */
+#define TXDESC_USE_DRIVER_RATE_8723B BIT(8)
+#define TXDESC_CTS_SELF_ENABLE_8723B BIT(11)
+#define TXDESC_RTS_CTS_ENABLE_8723B BIT(12)
+#define TXDESC_HW_RTS_ENABLE_8723B BIT(13)
#define TXDESC_SEQ_SHIFT_8723A 16
#define TXDESC_SEQ_MASK_8723A 0x0fff0000
/* Word 4 */
#define TXDESC_QOS BIT(6)
-#define TXDESC_HW_SEQ_ENABLE BIT(7)
-#define TXDESC_USE_DRIVER_RATE BIT(8)
+#define TXDESC_HW_SEQ_ENABLE_8723A BIT(7)
+#define TXDESC_USE_DRIVER_RATE_8723A BIT(8)
#define TXDESC_DISABLE_DATA_FB BIT(10)
-#define TXDESC_CTS_SELF_ENABLE BIT(11)
-#define TXDESC_RTS_CTS_ENABLE BIT(12)
-#define TXDESC_HW_RTS_ENABLE BIT(13)
+#define TXDESC_CTS_SELF_ENABLE_8723A BIT(11)
+#define TXDESC_RTS_CTS_ENABLE_8723A BIT(12)
+#define TXDESC_HW_RTS_ENABLE_8723A BIT(13)
#define TXDESC_PRIME_CH_OFF_LOWER BIT(20)
#define TXDESC_PRIME_CH_OFF_UPPER BIT(21)
#define TXDESC_SHORT_PREAMBLE BIT(24)
@@ -485,19 +489,27 @@ struct rtl8723bu_tx_desc {
#define TXDESC_RTS_DATA_BW BIT(27)
#define TXDESC_RTS_PRIME_CH_OFF_LOWER BIT(28)
#define TXDESC_RTS_PRIME_CH_OFF_UPPER BIT(29)
+#define TXDESC_RETRY_LIMIT_ENABLE_8723B BIT(17)
+#define TXDESC_RETRY_LIMIT_SHIFT_8723B 18
+#define TXDESC_RETRY_LIMIT_MASK_8723B 0x00fc0000
+#define TXDESC_RTS_RATE_SHIFT_8723B 24
+#define TXDESC_RTS_RATE_MASK_8723B 0x3f000000
/* Word 5 */
-#define TXDESC_RTS_RATE_SHIFT 0
-#define TXDESC_RTS_RATE_MASK 0x3f
+#define TXDESC_RTS_RATE_SHIFT_8723A 0
+#define TXDESC_RTS_RATE_MASK_8723A 0x3f
#define TXDESC_SHORT_GI BIT(6)
#define TXDESC_CCX_TAG BIT(7)
-#define TXDESC_RETRY_LIMIT_ENABLE BIT(17)
-#define TXDESC_RETRY_LIMIT_SHIFT 18
-#define TXDESC_RETRY_LIMIT_MASK 0x00fc0000
+#define TXDESC_RETRY_LIMIT_ENABLE_8723A BIT(17)
+#define TXDESC_RETRY_LIMIT_SHIFT_8723A 18
+#define TXDESC_RETRY_LIMIT_MASK_8723A 0x00fc0000
/* Word 6 */
#define TXDESC_MAX_AGG_SHIFT 11
+/* Word 8 */
+#define TXDESC_HW_SEQ_ENABLE_8723B BIT(15)
+
/* Word 9 */
#define TXDESC_SEQ_SHIFT_8723B 12
#define TXDESC_SEQ_MASK_8723B 0x00fff000
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 096/113] rtl8xxxu: TX RTS rate is word 4 for 8723a
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (94 preceding siblings ...)
2016-02-29 22:05 ` [PATCH 095/113] rtl8723au: Update TX descriptor words 4 and 5 definitions Jes.Sorensen
@ 2016-02-29 22:05 ` Jes.Sorensen
2016-02-29 22:05 ` [PATCH 097/113] rtl8xxxu: Improve handling of txdesc32 vs txdesc40 handling Jes.Sorensen
` (17 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:05 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
Correct the setting of TX RTS for 8723a generation chips. In addition
update documentation to match that this is part of data word 4, note
data word 5.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 3 ++-
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 4 ++--
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 9a1b4ee..10714e6 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -7084,7 +7084,8 @@ static void rtl8xxxu_tx(struct ieee80211_hw *hw,
if (rate_flag & IEEE80211_TX_RC_USE_RTS_CTS) {
/* Use RTS rate 24M - does the mac80211 tell us which to use? */
- tx_desc->txdw4 |= cpu_to_le32(DESC_RATE_24M);
+ tx_desc->txdw4 |= cpu_to_le32(DESC_RATE_24M <<
+ TXDESC_RTS_RATE_SHIFT_8723A);
tx_desc->txdw4 |= cpu_to_le32(TXDESC_RTS_CTS_ENABLE_8723A);
tx_desc->txdw4 |= cpu_to_le32(TXDESC_HW_RTS_ENABLE_8723A);
}
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
index 5f60f19..b015c75 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
@@ -475,6 +475,8 @@ struct rtl8723bu_tx_desc {
#define TXDESC_SEQ_MASK_8723A 0x0fff0000
/* Word 4 */
+#define TXDESC_RTS_RATE_SHIFT_8723A 0
+#define TXDESC_RTS_RATE_MASK_8723A 0x3f
#define TXDESC_QOS BIT(6)
#define TXDESC_HW_SEQ_ENABLE_8723A BIT(7)
#define TXDESC_USE_DRIVER_RATE_8723A BIT(8)
@@ -496,8 +498,6 @@ struct rtl8723bu_tx_desc {
#define TXDESC_RTS_RATE_MASK_8723B 0x3f000000
/* Word 5 */
-#define TXDESC_RTS_RATE_SHIFT_8723A 0
-#define TXDESC_RTS_RATE_MASK_8723A 0x3f
#define TXDESC_SHORT_GI BIT(6)
#define TXDESC_CCX_TAG BIT(7)
#define TXDESC_RETRY_LIMIT_ENABLE_8723A BIT(17)
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 097/113] rtl8xxxu: Improve handling of txdesc32 vs txdesc40 handling
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (95 preceding siblings ...)
2016-02-29 22:05 ` [PATCH 096/113] rtl8xxxu: TX RTS rate is word 4 for 8723a Jes.Sorensen
@ 2016-02-29 22:05 ` Jes.Sorensen
2016-02-29 22:05 ` [PATCH 098/113] rtl8xxxu: Do not parse RX descriptor info for C2H packets Jes.Sorensen
` (16 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:05 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
Further correct the handling of 40 byte TX descriptors.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 123 ++++++++++++++++-------
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 7 +-
2 files changed, 92 insertions(+), 38 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 10714e6..f4842aa 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -7018,15 +7018,6 @@ static void rtl8xxxu_tx(struct ieee80211_hw *hw,
}
}
- if (rate_flag & IEEE80211_TX_RC_MCS)
- rate = tx_info->control.rates[0].idx + DESC_RATE_MCS0;
- else
- rate = tx_rate->hw_value;
- tx_desc->txdw5 = cpu_to_le32(rate);
-
- if (ieee80211_is_data(hdr->frame_control))
- tx_desc->txdw5 |= cpu_to_le32(0x0001ff00);
-
/* (tx_info->flags & IEEE80211_TX_CTL_AMPDU) && */
ampdu_enable = false;
if (ieee80211_is_data_qos(hdr->frame_control) && sta) {
@@ -7041,8 +7032,18 @@ static void rtl8xxxu_tx(struct ieee80211_hw *hw,
}
}
+ if (rate_flag & IEEE80211_TX_RC_MCS)
+ rate = tx_info->control.rates[0].idx + DESC_RATE_MCS0;
+ else
+ rate = tx_rate->hw_value;
+
seq_number = IEEE80211_SEQ_TO_SN(le16_to_cpu(hdr->seq_ctrl));
if (!usedesc40) {
+ tx_desc->txdw5 = cpu_to_le32(rate);
+
+ if (ieee80211_is_data(hdr->frame_control))
+ tx_desc->txdw5 |= cpu_to_le32(0x0001ff00);
+
tx_desc->txdw3 =
cpu_to_le32((u32)seq_number << TXDESC_SEQ_SHIFT_8723A);
@@ -7050,9 +7051,56 @@ static void rtl8xxxu_tx(struct ieee80211_hw *hw,
tx_desc->txdw1 |= cpu_to_le32(TXDESC_AGG_ENABLE_8723A);
else
tx_desc->txdw1 |= cpu_to_le32(TXDESC_AGG_BREAK_8723A);
+
+ if (ieee80211_is_mgmt(hdr->frame_control)) {
+ tx_desc->txdw5 = cpu_to_le32(tx_rate->hw_value);
+ tx_desc->txdw4 |=
+ cpu_to_le32(TXDESC_USE_DRIVER_RATE_8723A);
+ tx_desc->txdw5 |=
+ cpu_to_le32(6 <<
+ TXDESC_RETRY_LIMIT_SHIFT_8723A);
+ tx_desc->txdw5 |=
+ cpu_to_le32(TXDESC_RETRY_LIMIT_ENABLE_8723A);
+ }
+
+ if (ieee80211_is_data_qos(hdr->frame_control))
+ tx_desc->txdw4 |= cpu_to_le32(TXDESC_QOS_8723A);
+
+ if (rate_flag & IEEE80211_TX_RC_USE_SHORT_PREAMBLE ||
+ (sta && vif && vif->bss_conf.use_short_preamble))
+ tx_desc->txdw4 |=
+ cpu_to_le32(TXDESC_SHORT_PREAMBLE_8723A);
+
+ if (rate_flag & IEEE80211_TX_RC_SHORT_GI ||
+ (ieee80211_is_data_qos(hdr->frame_control) &&
+ sta && sta->ht_cap.cap &
+ (IEEE80211_HT_CAP_SGI_40 | IEEE80211_HT_CAP_SGI_20))) {
+ tx_desc->txdw5 |= cpu_to_le32(TXDESC_SHORT_GI);
+ }
+
+ if (rate_flag & IEEE80211_TX_RC_USE_RTS_CTS) {
+ /*
+ * Use RTS rate 24M - does the mac80211 tell
+ * us which to use?
+ */
+ tx_desc->txdw4 |=
+ cpu_to_le32(DESC_RATE_24M <<
+ TXDESC_RTS_RATE_SHIFT_8723A);
+ tx_desc->txdw4 |=
+ cpu_to_le32(TXDESC_RTS_CTS_ENABLE_8723A);
+ tx_desc->txdw4 |=
+ cpu_to_le32(TXDESC_HW_RTS_ENABLE_8723A);
+ }
} else {
tx_desc40 = (struct rtl8723bu_tx_desc *)tx_desc;
+ tx_desc40->txdw4 = cpu_to_le32(rate);
+ if (ieee80211_is_data(hdr->frame_control)) {
+ tx_desc->txdw4 |=
+ cpu_to_le32(0x1f <<
+ TXDESC_DATA_RATE_FB_SHIFT_8723B);
+ }
+
tx_desc40->txdw9 =
cpu_to_le32((u32)seq_number << TXDESC_SEQ_SHIFT_8723B);
@@ -7061,34 +7109,37 @@ static void rtl8xxxu_tx(struct ieee80211_hw *hw,
cpu_to_le32(TXDESC_AGG_ENABLE_8723B);
else
tx_desc40->txdw2 |= cpu_to_le32(TXDESC_AGG_BREAK_8723B);
- };
- if (ieee80211_is_data_qos(hdr->frame_control))
- tx_desc->txdw4 |= cpu_to_le32(TXDESC_QOS);
- if (rate_flag & IEEE80211_TX_RC_USE_SHORT_PREAMBLE ||
- (sta && vif && vif->bss_conf.use_short_preamble))
- tx_desc->txdw4 |= cpu_to_le32(TXDESC_SHORT_PREAMBLE);
- if (rate_flag & IEEE80211_TX_RC_SHORT_GI ||
- (ieee80211_is_data_qos(hdr->frame_control) &&
- sta && sta->ht_cap.cap &
- (IEEE80211_HT_CAP_SGI_40 | IEEE80211_HT_CAP_SGI_20))) {
- tx_desc->txdw5 |= cpu_to_le32(TXDESC_SHORT_GI);
- }
- if (ieee80211_is_mgmt(hdr->frame_control)) {
- tx_desc->txdw5 = cpu_to_le32(tx_rate->hw_value);
- tx_desc->txdw4 |= cpu_to_le32(TXDESC_USE_DRIVER_RATE_8723A);
- tx_desc->txdw5 |=
- cpu_to_le32(6 << TXDESC_RETRY_LIMIT_SHIFT_8723A);
- tx_desc->txdw5 |= cpu_to_le32(TXDESC_RETRY_LIMIT_ENABLE_8723A);
- }
-
- if (rate_flag & IEEE80211_TX_RC_USE_RTS_CTS) {
- /* Use RTS rate 24M - does the mac80211 tell us which to use? */
- tx_desc->txdw4 |= cpu_to_le32(DESC_RATE_24M <<
- TXDESC_RTS_RATE_SHIFT_8723A);
- tx_desc->txdw4 |= cpu_to_le32(TXDESC_RTS_CTS_ENABLE_8723A);
- tx_desc->txdw4 |= cpu_to_le32(TXDESC_HW_RTS_ENABLE_8723A);
- }
+ if (ieee80211_is_mgmt(hdr->frame_control)) {
+ tx_desc40->txdw4 = cpu_to_le32(tx_rate->hw_value);
+ tx_desc40->txdw3 |=
+ cpu_to_le32(TXDESC_USE_DRIVER_RATE_8723B);
+ tx_desc40->txdw4 |=
+ cpu_to_le32(6 <<
+ TXDESC_RETRY_LIMIT_SHIFT_8723B);
+ tx_desc40->txdw4 |=
+ cpu_to_le32(TXDESC_RETRY_LIMIT_ENABLE_8723B);
+ }
+
+ if (rate_flag & IEEE80211_TX_RC_USE_SHORT_PREAMBLE ||
+ (sta && vif && vif->bss_conf.use_short_preamble))
+ tx_desc40->txdw5 |=
+ cpu_to_le32(TXDESC_SHORT_PREAMBLE_8723B);
+
+ if (rate_flag & IEEE80211_TX_RC_USE_RTS_CTS) {
+ /*
+ * Use RTS rate 24M - does the mac80211 tell
+ * us which to use?
+ */
+ tx_desc->txdw4 |=
+ cpu_to_le32(DESC_RATE_24M <<
+ TXDESC_RTS_RATE_SHIFT_8723B);
+ tx_desc->txdw3 |=
+ cpu_to_le32(TXDESC_RTS_CTS_ENABLE_8723B);
+ tx_desc->txdw3 |=
+ cpu_to_le32(TXDESC_HW_RTS_ENABLE_8723B);
+ }
+ };
rtl8xxxu_calc_tx_desc_csum(tx_desc);
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
index b015c75..687b9a9 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
@@ -477,7 +477,7 @@ struct rtl8723bu_tx_desc {
/* Word 4 */
#define TXDESC_RTS_RATE_SHIFT_8723A 0
#define TXDESC_RTS_RATE_MASK_8723A 0x3f
-#define TXDESC_QOS BIT(6)
+#define TXDESC_QOS_8723A BIT(6)
#define TXDESC_HW_SEQ_ENABLE_8723A BIT(7)
#define TXDESC_USE_DRIVER_RATE_8723A BIT(8)
#define TXDESC_DISABLE_DATA_FB BIT(10)
@@ -486,11 +486,13 @@ struct rtl8723bu_tx_desc {
#define TXDESC_HW_RTS_ENABLE_8723A BIT(13)
#define TXDESC_PRIME_CH_OFF_LOWER BIT(20)
#define TXDESC_PRIME_CH_OFF_UPPER BIT(21)
-#define TXDESC_SHORT_PREAMBLE BIT(24)
+#define TXDESC_SHORT_PREAMBLE_8723A BIT(24)
#define TXDESC_DATA_BW BIT(25)
#define TXDESC_RTS_DATA_BW BIT(27)
#define TXDESC_RTS_PRIME_CH_OFF_LOWER BIT(28)
#define TXDESC_RTS_PRIME_CH_OFF_UPPER BIT(29)
+#define TXDESC_DATA_RATE_FB_SHIFT_8723B 8
+#define TXDESC_DATA_RATE_FB_MASK_8723B 0x00001f00
#define TXDESC_RETRY_LIMIT_ENABLE_8723B BIT(17)
#define TXDESC_RETRY_LIMIT_SHIFT_8723B 18
#define TXDESC_RETRY_LIMIT_MASK_8723B 0x00fc0000
@@ -498,6 +500,7 @@ struct rtl8723bu_tx_desc {
#define TXDESC_RTS_RATE_MASK_8723B 0x3f000000
/* Word 5 */
+#define TXDESC_SHORT_PREAMBLE_8723B BIT(4)
#define TXDESC_SHORT_GI BIT(6)
#define TXDESC_CCX_TAG BIT(7)
#define TXDESC_RETRY_LIMIT_ENABLE_8723A BIT(17)
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 098/113] rtl8xxxu: Do not parse RX descriptor info for C2H packets
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (96 preceding siblings ...)
2016-02-29 22:05 ` [PATCH 097/113] rtl8xxxu: Improve handling of txdesc32 vs txdesc40 handling Jes.Sorensen
@ 2016-02-29 22:05 ` Jes.Sorensen
2016-02-29 22:05 ` [PATCH 099/113] rtl8xxxu: Define 8723b H2C ramask command structure Jes.Sorensen
` (15 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:05 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
C2H events are delivered as RX packets on 8723bu/8192eu. When
receiving a C2H event, do not parse the rest of the RX descriptor as
the info isn't valid.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 17 +++++++----------
1 file changed, 7 insertions(+), 10 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index f4842aa..924b8cc 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -7324,7 +7324,6 @@ static int rtl8723bu_parse_rx_desc(struct rtl8xxxu_priv *priv,
(struct rtl8723bu_rx_desc *)skb->data;
struct rtl8723au_phy_stats *phy_stats;
int drvinfo_sz, desc_shift;
- int rx_type;
skb_pull(skb, sizeof(struct rtl8723bu_rx_desc));
@@ -7334,6 +7333,12 @@ static int rtl8723bu_parse_rx_desc(struct rtl8xxxu_priv *priv,
desc_shift = rx_desc->shift;
skb_pull(skb, drvinfo_sz + desc_shift);
+ if (rx_desc->rpt_sel) {
+ struct device *dev = &priv->udev->dev;
+ dev_dbg(dev, "%s: C2H packet\n", __func__);
+ return RX_TYPE_C2H;
+ }
+
rx_status->mactime = le32_to_cpu(rx_desc->tsfl);
rx_status->flag |= RX_FLAG_MACTIME_START;
@@ -7351,15 +7356,7 @@ static int rtl8723bu_parse_rx_desc(struct rtl8xxxu_priv *priv,
rx_status->rate_idx = rx_desc->rxmcs;
}
- if (rx_desc->rpt_sel) {
- struct device *dev = &priv->udev->dev;
- dev_dbg(dev, "%s: C2H packet\n", __func__);
- rx_type = RX_TYPE_C2H;
- } else {
- rx_type = RX_TYPE_DATA_PKT;
- }
-
- return rx_type;
+ return RX_TYPE_DATA_PKT;
}
static void rtl8723bu_handle_c2h(struct rtl8xxxu_priv *priv,
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 099/113] rtl8xxxu: Define 8723b H2C ramask command structure
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (97 preceding siblings ...)
2016-02-29 22:05 ` [PATCH 098/113] rtl8xxxu: Do not parse RX descriptor info for C2H packets Jes.Sorensen
@ 2016-02-29 22:05 ` Jes.Sorensen
2016-02-29 22:05 ` [PATCH 100/113] rtl8xxxu: Implement basic 8723b specific update_rate_mask() function Jes.Sorensen
` (14 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:05 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
Define H2C command structure for setting the rate mask.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
index 687b9a9..37657fe 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
@@ -893,7 +893,7 @@ enum h2c_cmd_8723b {
/*
* Dynamic Mechanism Class: 010
*/
- H2C_8723B_MACID_CFG = 0x40,
+ H2C_8723B_MACID_CFG_RAID = 0x40,
H2C_8723B_TXBF = 0x41,
H2C_8723B_RSSI_SETTING = 0x42,
H2C_8723B_AP_REQ_TXRPT = 0x43,
@@ -960,6 +960,15 @@ struct h2c_cmd {
u8 cmd;
u8 data1;
u8 data2;
+ u8 ramask1;
+ u8 ramask2;
+ u8 ramask3;
+ u8 ramask4;
+ } __packed b_macid_cfg;
+ struct {
+ u8 cmd;
+ u8 data1;
+ u8 data2;
u8 data3;
u8 data4;
u8 data5;
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 100/113] rtl8xxxu: Implement basic 8723b specific update_rate_mask() function
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (98 preceding siblings ...)
2016-02-29 22:05 ` [PATCH 099/113] rtl8xxxu: Define 8723b H2C ramask command structure Jes.Sorensen
@ 2016-02-29 22:05 ` Jes.Sorensen
2016-02-29 22:05 ` [PATCH 101/113] rtl8xxxu: Report media status using the correct H2C command for 8723bu Jes.Sorensen
` (13 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:05 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
Support for setting bandwidth and VHT parameters is still missing
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 38 ++++++++++++++++++++++--
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 16 +++++++++-
2 files changed, 50 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 924b8cc..a3546a0 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -6609,11 +6609,13 @@ static void rtl8xxxu_sw_scan_complete(struct ieee80211_hw *hw,
rtl8xxxu_write8(priv, REG_BEACON_CTRL, val8);
}
-static void rtl8xxxu_update_rate_mask(struct rtl8xxxu_priv *priv,
- u32 ramask, int sgi)
+static void rtl8723au_update_rate_mask(struct rtl8xxxu_priv *priv,
+ u32 ramask, int sgi)
{
struct h2c_cmd h2c;
+ memset(&h2c, 0, sizeof(struct h2c_cmd));
+
h2c.ramask.cmd = H2C_SET_RATE_MASK;
h2c.ramask.mask_lo = cpu_to_le16(ramask & 0xffff);
h2c.ramask.mask_hi = cpu_to_le16(ramask >> 16);
@@ -6627,6 +6629,32 @@ static void rtl8xxxu_update_rate_mask(struct rtl8xxxu_priv *priv,
rtl8723a_h2c_cmd(priv, &h2c, sizeof(h2c.ramask));
}
+static void rtl8723bu_update_rate_mask(struct rtl8xxxu_priv *priv,
+ u32 ramask, int sgi)
+{
+ struct h2c_cmd h2c;
+ u8 bw = 0;
+
+ memset(&h2c, 0, sizeof(struct h2c_cmd));
+
+ h2c.b_macid_cfg.cmd = H2C_8723B_MACID_CFG_RAID;
+ h2c.b_macid_cfg.ramask0 = ramask & 0xff;
+ h2c.b_macid_cfg.ramask1 = (ramask >> 8) & 0xff;
+ h2c.b_macid_cfg.ramask2 = (ramask >> 16) & 0xff;
+ h2c.b_macid_cfg.ramask3 = (ramask >> 24) & 0xff;
+
+ h2c.ramask.arg = 0x80;
+ h2c.b_macid_cfg.data1 = 0;
+ if (sgi)
+ h2c.b_macid_cfg.data1 |= BIT(7);
+
+ h2c.b_macid_cfg.data2 = bw;
+
+ dev_dbg(&priv->udev->dev, "%s: rate mask %08x, arg %02x, size %zi\n",
+ __func__, ramask, h2c.ramask.arg, sizeof(h2c.b_macid_cfg));
+ rtl8723a_h2c_cmd(priv, &h2c, sizeof(h2c.b_macid_cfg));
+}
+
static void rtl8xxxu_set_basic_rates(struct rtl8xxxu_priv *priv, u32 rate_cfg)
{
u32 val32;
@@ -6693,7 +6721,7 @@ rtl8xxxu_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
sgi = 1;
rcu_read_unlock();
- rtl8xxxu_update_rate_mask(priv, ramask, sgi);
+ priv->fops->update_rate_mask(priv, ramask, sgi);
rtl8xxxu_write8(priv, REG_BCN_MAX_ERR, 0xff);
@@ -8210,6 +8238,7 @@ static struct rtl8xxxu_fileops rtl8723au_fops = {
.parse_rx_desc = rtl8723au_parse_rx_desc,
.enable_rf = rtl8723a_enable_rf,
.set_tx_power = rtl8723a_set_tx_power,
+ .update_rate_mask = rtl8723au_update_rate_mask,
.writeN_block_size = 1024,
.mbox_ext_reg = REG_HMBOX_EXT_0,
.mbox_ext_width = 2,
@@ -8234,6 +8263,7 @@ static struct rtl8xxxu_fileops rtl8723bu_fops = {
.init_statistics = rtl8723bu_init_statistics,
.enable_rf = rtl8723b_enable_rf,
.set_tx_power = rtl8723b_set_tx_power,
+ .update_rate_mask = rtl8723bu_update_rate_mask,
.writeN_block_size = 1024,
.mbox_ext_reg = REG_HMBOX_EXT0_8723B,
.mbox_ext_width = 4,
@@ -8257,6 +8287,7 @@ static struct rtl8xxxu_fileops rtl8192cu_fops = {
.parse_rx_desc = rtl8723au_parse_rx_desc,
.enable_rf = rtl8723a_enable_rf,
.set_tx_power = rtl8723a_set_tx_power,
+ .update_rate_mask = rtl8723au_update_rate_mask,
.writeN_block_size = 128,
.mbox_ext_reg = REG_HMBOX_EXT_0,
.mbox_ext_width = 2,
@@ -8279,6 +8310,7 @@ static struct rtl8xxxu_fileops rtl8192eu_fops = {
.parse_rx_desc = rtl8723bu_parse_rx_desc,
.enable_rf = rtl8723b_enable_rf,
.set_tx_power = rtl8723b_set_tx_power,
+ .update_rate_mask = rtl8723au_update_rate_mask,
.writeN_block_size = 128,
.mbox_ext_reg = REG_HMBOX_EXT0_8723B,
.mbox_ext_width = 4,
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
index 37657fe..eea62f1 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
@@ -958,12 +958,24 @@ struct h2c_cmd {
} __packed ramask;
struct {
u8 cmd;
+ u8 macid;
+ /*
+ * [0:4] - RAID
+ * [7] - SGI
+ */
u8 data1;
+ /*
+ * [0:1] - Bandwidth
+ * [3] - No Update
+ * [4:5] - VHT enable
+ * [6] - DISPT
+ * [7] - DISRA
+ */
u8 data2;
+ u8 ramask0;
u8 ramask1;
u8 ramask2;
u8 ramask3;
- u8 ramask4;
} __packed b_macid_cfg;
struct {
u8 cmd;
@@ -1240,6 +1252,8 @@ struct rtl8xxxu_fileops {
void (*enable_rf) (struct rtl8xxxu_priv *priv);
void (*set_tx_power) (struct rtl8xxxu_priv *priv, int channel,
bool ht40);
+ void (*update_rate_mask) (struct rtl8xxxu_priv *priv,
+ u32 ramask, int sgi);
int writeN_block_size;
u16 mbox_ext_reg;
char mbox_ext_width;
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 101/113] rtl8xxxu: Report media status using the correct H2C command for 8723bu
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (99 preceding siblings ...)
2016-02-29 22:05 ` [PATCH 100/113] rtl8xxxu: Implement basic 8723b specific update_rate_mask() function Jes.Sorensen
@ 2016-02-29 22:05 ` Jes.Sorensen
2016-02-29 22:05 ` [PATCH 102/113] rtl8xxxu: Dump contents of unhandled C2H events Jes.Sorensen
` (12 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:05 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
Implement support for nextgen devices reporting connectition to the
firmware.
The H2C API for reporting connection to the firmware is different
between the two device generations. Use the fileops structure to
determine which one to call.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 46 ++++++++++++++++++++----
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 8 +++++
2 files changed, 47 insertions(+), 7 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index a3546a0..f9d5b23 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -6655,6 +6655,39 @@ static void rtl8723bu_update_rate_mask(struct rtl8xxxu_priv *priv,
rtl8723a_h2c_cmd(priv, &h2c, sizeof(h2c.b_macid_cfg));
}
+static void rtl8723au_report_connect(struct rtl8xxxu_priv *priv,
+ u8 macid, bool connect)
+{
+ struct h2c_cmd h2c;
+
+ memset(&h2c, 0, sizeof(struct h2c_cmd));
+
+ h2c.joinbss.cmd = H2C_JOIN_BSS_REPORT;
+
+ if (connect)
+ h2c.joinbss.data = H2C_JOIN_BSS_CONNECT;
+ else
+ h2c.joinbss.data = H2C_JOIN_BSS_DISCONNECT;
+
+ rtl8723a_h2c_cmd(priv, &h2c, sizeof(h2c.joinbss));
+}
+
+static void rtl8723bu_report_connect(struct rtl8xxxu_priv *priv,
+ u8 macid, bool connect)
+{
+ struct h2c_cmd h2c;
+
+ memset(&h2c, 0, sizeof(struct h2c_cmd));
+
+ h2c.media_status_rpt.cmd = H2C_8723B_MEDIA_STATUS_RPT;
+ if (connect)
+ h2c.media_status_rpt.parm |= BIT(0);
+ else
+ h2c.media_status_rpt.parm &= ~BIT(0);
+
+ rtl8723a_h2c_cmd(priv, &h2c, sizeof(h2c.media_status_rpt));
+}
+
static void rtl8xxxu_set_basic_rates(struct rtl8xxxu_priv *priv, u32 rate_cfg)
{
u32 val32;
@@ -6687,11 +6720,8 @@ rtl8xxxu_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
u8 val8;
if (changed & BSS_CHANGED_ASSOC) {
- struct h2c_cmd h2c;
-
dev_dbg(dev, "Changed ASSOC: %i!\n", bss_conf->assoc);
- memset(&h2c, 0, sizeof(struct h2c_cmd));
rtl8xxxu_set_linktype(priv, vif->type);
if (bss_conf->assoc) {
@@ -6731,16 +6761,14 @@ rtl8xxxu_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
rtl8xxxu_write16(priv, REG_BCN_PSR_RPT,
0xc000 | bss_conf->aid);
- h2c.joinbss.data = H2C_JOIN_BSS_CONNECT;
+ priv->fops->report_connect(priv, 0, true);
} else {
val8 = rtl8xxxu_read8(priv, REG_BEACON_CTRL);
val8 |= BEACON_DISABLE_TSF_UPDATE;
rtl8xxxu_write8(priv, REG_BEACON_CTRL, val8);
- h2c.joinbss.data = H2C_JOIN_BSS_DISCONNECT;
+ priv->fops->report_connect(priv, 0, false);
}
- h2c.joinbss.cmd = H2C_JOIN_BSS_REPORT;
- rtl8723a_h2c_cmd(priv, &h2c, sizeof(h2c.joinbss));
}
if (changed & BSS_CHANGED_ERP_PREAMBLE) {
@@ -8239,6 +8267,7 @@ static struct rtl8xxxu_fileops rtl8723au_fops = {
.enable_rf = rtl8723a_enable_rf,
.set_tx_power = rtl8723a_set_tx_power,
.update_rate_mask = rtl8723au_update_rate_mask,
+ .report_connect = rtl8723au_report_connect,
.writeN_block_size = 1024,
.mbox_ext_reg = REG_HMBOX_EXT_0,
.mbox_ext_width = 2,
@@ -8264,6 +8293,7 @@ static struct rtl8xxxu_fileops rtl8723bu_fops = {
.enable_rf = rtl8723b_enable_rf,
.set_tx_power = rtl8723b_set_tx_power,
.update_rate_mask = rtl8723bu_update_rate_mask,
+ .report_connect = rtl8723bu_report_connect,
.writeN_block_size = 1024,
.mbox_ext_reg = REG_HMBOX_EXT0_8723B,
.mbox_ext_width = 4,
@@ -8288,6 +8318,7 @@ static struct rtl8xxxu_fileops rtl8192cu_fops = {
.enable_rf = rtl8723a_enable_rf,
.set_tx_power = rtl8723a_set_tx_power,
.update_rate_mask = rtl8723au_update_rate_mask,
+ .report_connect = rtl8723au_report_connect,
.writeN_block_size = 128,
.mbox_ext_reg = REG_HMBOX_EXT_0,
.mbox_ext_width = 2,
@@ -8311,6 +8342,7 @@ static struct rtl8xxxu_fileops rtl8192eu_fops = {
.enable_rf = rtl8723b_enable_rf,
.set_tx_power = rtl8723b_set_tx_power,
.update_rate_mask = rtl8723au_update_rate_mask,
+ .report_connect = rtl8723au_report_connect,
.writeN_block_size = 128,
.mbox_ext_reg = REG_HMBOX_EXT0_8723B,
.mbox_ext_width = 4,
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
index eea62f1..2191b6b 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
@@ -958,6 +958,12 @@ struct h2c_cmd {
} __packed ramask;
struct {
u8 cmd;
+ u8 parm;
+ u8 macid;
+ u8 macid_end;
+ } __packed media_status_rpt;
+ struct {
+ u8 cmd;
u8 macid;
/*
* [0:4] - RAID
@@ -1254,6 +1260,8 @@ struct rtl8xxxu_fileops {
bool ht40);
void (*update_rate_mask) (struct rtl8xxxu_priv *priv,
u32 ramask, int sgi);
+ void (*report_connect) (struct rtl8xxxu_priv *priv,
+ u8 macid, bool connect);
int writeN_block_size;
u16 mbox_ext_reg;
char mbox_ext_width;
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 102/113] rtl8xxxu: Dump contents of unhandled C2H events
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (100 preceding siblings ...)
2016-02-29 22:05 ` [PATCH 101/113] rtl8xxxu: Report media status using the correct H2C command for 8723bu Jes.Sorensen
@ 2016-02-29 22:05 ` Jes.Sorensen
2016-02-29 22:05 ` [PATCH 103/113] rtl8xxxu: Process C2H RA_REPORT events for 8723bu Jes.Sorensen
` (11 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:05 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
Dump the contents of unhandled C2H events. We should be handling all
expected events, so this is debugging help in case an unexpected event
happens.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index f9d5b23..3985903 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -7446,7 +7446,10 @@ static void rtl8723bu_handle_c2h(struct rtl8xxxu_priv *priv,
c2h->bt_mp_info.ext_id, c2h->bt_mp_info.status);
break;
default:
- dev_info(dev, "Unhandled C2H event %02x\n", c2h->id);
+ dev_info(dev, "Unhandled C2H event %02x seq %02x\n",
+ c2h->id, c2h->seq);
+ print_hex_dump(KERN_INFO, "C2H content: ", DUMP_PREFIX_NONE,
+ 16, 1, c2h->raw.payload, len, false);
break;
}
}
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 103/113] rtl8xxxu: Process C2H RA_REPORT events for 8723bu
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (101 preceding siblings ...)
2016-02-29 22:05 ` [PATCH 102/113] rtl8xxxu: Dump contents of unhandled C2H events Jes.Sorensen
@ 2016-02-29 22:05 ` Jes.Sorensen
2016-02-29 22:05 ` [PATCH 104/113] rtl8xxxu: Pass RX rate to rx_parse_phystats and enable phystats for rtl8723bu Jes.Sorensen
` (10 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:05 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
Handle RA_REPORTS events for 8723bu to not have them show up as
unhandled.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 6 ++++++
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 11 +++++++++++
2 files changed, 17 insertions(+)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 3985903..253de87 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -7445,6 +7445,12 @@ static void rtl8723bu_handle_c2h(struct rtl8xxxu_priv *priv,
dev_dbg(dev, "C2H_MP_INFO ext ID %02x, status %02x\n",
c2h->bt_mp_info.ext_id, c2h->bt_mp_info.status);
break;
+ case C2H_8723B_RA_REPORT:
+ dev_dbg(dev,
+ "C2H RA RPT: rate %02x, unk %i, macid %02x, noise %i\n",
+ c2h->ra_report.rate, c2h->ra_report.dummy0_0,
+ c2h->ra_report.macid, c2h->ra_report.noisy_state);
+ break;
default:
dev_info(dev, "Unhandled C2H event %02x seq %02x\n",
c2h->id, c2h->seq);
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
index 2191b6b..b44cb59 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
@@ -1033,6 +1033,7 @@ enum c2h_evt_8723b {
C2H_8723B_BT_INFO = 9,
C2H_8723B_HW_INFO_EXCH = 0x0a,
C2H_8723B_BT_MP_INFO = 0x0b,
+ C2H_8723B_RA_REPORT = 0x0c,
C2H_8723B_FW_DEBUG = 0xff,
};
@@ -1121,6 +1122,16 @@ struct rtl8723bu_c2h {
u8 a4;
u8 a5;
} __packed bt_info;
+ struct {
+ u8 rate:7;
+ u8 dummy0_0:1;
+ u8 macid;
+ u8 ldpc:1;
+ u8 txbf:1;
+ u8 noisy_state:1;
+ u8 dummy2_0:5;
+ u8 dummy3_0;
+ } __packed ra_report;
};
};
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 104/113] rtl8xxxu: Pass RX rate to rx_parse_phystats and enable phystats for rtl8723bu
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (102 preceding siblings ...)
2016-02-29 22:05 ` [PATCH 103/113] rtl8xxxu: Process C2H RA_REPORT events for 8723bu Jes.Sorensen
@ 2016-02-29 22:05 ` Jes.Sorensen
2016-02-29 22:05 ` [PATCH 105/113] rtl8xxxu: Remove unncessary semicolon Jes.Sorensen
` (9 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:05 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
rtl8xxxu_rx_parse_phystats() only needs the RX rate to determine
whether to handle the stats as CCK or not. Parsing in the rate rather
than the rx descriptor elimantes the need to handle multiple rx
descriptor formats in the function.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 253de87..8cb76e2 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -7216,13 +7216,13 @@ error:
static void rtl8xxxu_rx_parse_phystats(struct rtl8xxxu_priv *priv,
struct ieee80211_rx_status *rx_status,
- struct rtl8xxxu_rx_desc *rx_desc,
- struct rtl8723au_phy_stats *phy_stats)
+ struct rtl8723au_phy_stats *phy_stats,
+ u32 rxmcs)
{
if (phy_stats->sgi_en)
rx_status->flag |= RX_FLAG_SHORT_GI;
- if (rx_desc->rxmcs < DESC_RATE_6M) {
+ if (rxmcs < DESC_RATE_6M) {
/*
* Handle PHY stats for CCK rates
*/
@@ -7350,7 +7350,8 @@ static int rtl8723au_parse_rx_desc(struct rtl8xxxu_priv *priv,
skb_pull(skb, drvinfo_sz + desc_shift);
if (rx_desc->phy_stats)
- rtl8xxxu_rx_parse_phystats(priv, rx_status, rx_desc, phy_stats);
+ rtl8xxxu_rx_parse_phystats(priv, rx_status, phy_stats,
+ rx_desc->rxmcs);
rx_status->mactime = le32_to_cpu(rx_desc->tsfl);
rx_status->flag |= RX_FLAG_MACTIME_START;
@@ -7395,6 +7396,10 @@ static int rtl8723bu_parse_rx_desc(struct rtl8xxxu_priv *priv,
return RX_TYPE_C2H;
}
+ if (rx_desc->phy_stats)
+ rtl8xxxu_rx_parse_phystats(priv, rx_status, phy_stats,
+ rx_desc->rxmcs);
+
rx_status->mactime = le32_to_cpu(rx_desc->tsfl);
rx_status->flag |= RX_FLAG_MACTIME_START;
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 105/113] rtl8xxxu: Remove unncessary semicolon
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (103 preceding siblings ...)
2016-02-29 22:05 ` [PATCH 104/113] rtl8xxxu: Pass RX rate to rx_parse_phystats and enable phystats for rtl8723bu Jes.Sorensen
@ 2016-02-29 22:05 ` Jes.Sorensen
2016-02-29 22:05 ` [PATCH 106/113] rtl8xxxu: convert rtl8723bu_init_bt() into rtl8723b_enable_rf() Jes.Sorensen
` (8 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:05 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
This removes an superfluous semicolon.
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 8cb76e2..67ea89b 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -7195,7 +7195,7 @@ static void rtl8xxxu_tx(struct ieee80211_hw *hw,
tx_desc->txdw3 |=
cpu_to_le32(TXDESC_HW_RTS_ENABLE_8723B);
}
- };
+ }
rtl8xxxu_calc_tx_desc_csum(tx_desc);
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 106/113] rtl8xxxu: convert rtl8723bu_init_bt() into rtl8723b_enable_rf()
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (104 preceding siblings ...)
2016-02-29 22:05 ` [PATCH 105/113] rtl8xxxu: Remove unncessary semicolon Jes.Sorensen
@ 2016-02-29 22:05 ` Jes.Sorensen
2016-02-29 23:46 ` Julian Calaby
2016-02-29 22:05 ` [PATCH 107/113] rtl8xxxu: Use define for REG_PWR_DATA bits Jes.Sorensen
` (7 subsequent siblings)
113 siblings, 1 reply; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:05 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
rtl8723bu_init_bt() is effectively the function enabling RF, so name
it appropriately.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 11 +----------
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 1 -
2 files changed, 1 insertion(+), 11 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 67ea89b..b5ab899 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -1596,10 +1596,6 @@ static void rtl8723a_enable_rf(struct rtl8xxxu_priv *priv)
rtl8xxxu_write8(priv, REG_TXPAUSE, 0x00);
}
-static void rtl8723b_enable_rf(struct rtl8xxxu_priv *priv)
-{
-}
-
static void rtl8723a_disable_rf(struct rtl8xxxu_priv *priv)
{
u8 sps0;
@@ -5953,7 +5949,7 @@ static void rtl8723bu_set_ps_tdma(struct rtl8xxxu_priv *priv,
}
#endif
-static void rtl8723bu_init_bt(struct rtl8xxxu_priv *priv)
+static void rtl8723b_enable_rf(struct rtl8xxxu_priv *priv)
{
struct h2c_cmd h2c;
u32 val32;
@@ -6508,10 +6504,6 @@ static int rtl8xxxu_init_device(struct ieee80211_hw *hw)
else
rtl8xxxu_write_rfreg(priv, RF_A, RF6052_REG_T_METER, 0x60);
- /* Init BT hw config. */
- if (priv->fops->init_bt)
- priv->fops->init_bt(priv);
-
/* Set NAV_UPPER to 30000us */
val8 = ((30000 + NAV_UPPER_UNIT - 1) / NAV_UPPER_UNIT);
rtl8xxxu_write8(priv, REG_NAV_UPPER, val8);
@@ -8300,7 +8292,6 @@ static struct rtl8xxxu_fileops rtl8723bu_fops = {
.phy_init_antenna_selection = rtl8723bu_phy_init_antenna_selection,
.phy_iq_calibrate = rtl8723bu_phy_iq_calibrate,
.config_channel = rtl8723bu_config_channel,
- .init_bt = rtl8723bu_init_bt,
.parse_rx_desc = rtl8723bu_parse_rx_desc,
.init_aggregation = rtl8723bu_init_aggregation,
.init_statistics = rtl8723bu_init_statistics,
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
index b44cb59..776fd17 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
@@ -1261,7 +1261,6 @@ struct rtl8xxxu_fileops {
void (*phy_init_antenna_selection) (struct rtl8xxxu_priv *priv);
void (*phy_iq_calibrate) (struct rtl8xxxu_priv *priv);
void (*config_channel) (struct ieee80211_hw *hw);
- void (*init_bt) (struct rtl8xxxu_priv *priv);
int (*parse_rx_desc) (struct rtl8xxxu_priv *priv, struct sk_buff *skb,
struct ieee80211_rx_status *rx_status);
void (*init_aggregation) (struct rtl8xxxu_priv *priv);
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 107/113] rtl8xxxu: Use define for REG_PWR_DATA bits
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (105 preceding siblings ...)
2016-02-29 22:05 ` [PATCH 106/113] rtl8xxxu: convert rtl8723bu_init_bt() into rtl8723b_enable_rf() Jes.Sorensen
@ 2016-02-29 22:05 ` Jes.Sorensen
2016-03-10 14:46 ` Kalle Valo
2016-02-29 22:05 ` [PATCH 108/113] rtl8xxxu: Implement 8723bu specific disable_rf() function Jes.Sorensen
` (6 subsequent siblings)
113 siblings, 1 reply; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:05 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
Use the bit define rather than hard code the value for REG_PWR_DATA bits.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 2 +-
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index b5ab899..c7984ab 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -5996,7 +5996,7 @@ static void rtl8723b_enable_rf(struct rtl8xxxu_priv *priv)
rtl8xxxu_write8(priv, 0x0067, val8);
val32 = rtl8xxxu_read32(priv, REG_PWR_DATA);
- val32 |= BIT(11);
+ val32 |= PWR_DATA_EEPRPAD_RFE_CTRL_EN;
rtl8xxxu_write32(priv, REG_PWR_DATA, val32);
/*
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
index a055362..e0b9ea3 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
@@ -135,7 +135,7 @@
#define EFUSE_ACCESS_DISABLE 0x00 /* RTL8723 only */
#define REG_PWR_DATA 0x0038
-#define PWR_DATA_EEPRPAD_RFE_CTRL_EN BIT(11)
+#define PWR_DATA_EEPRPAD_RFE_CTRL_EN BIT(11)
#define REG_CAL_TIMER 0x003c
#define REG_ACLK_MON 0x003e
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 108/113] rtl8xxxu: Implement 8723bu specific disable_rf() function
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (106 preceding siblings ...)
2016-02-29 22:05 ` [PATCH 107/113] rtl8xxxu: Use define for REG_PWR_DATA bits Jes.Sorensen
@ 2016-02-29 22:05 ` Jes.Sorensen
2016-02-29 22:05 ` [PATCH 109/113] rtl8xxxu: Implement device specific power_off function Jes.Sorensen
` (5 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:05 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
Powering up the 8723bu RF should probably be matched by the ability to
power it down again.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 17 ++++++++++++++++-
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 1 +
2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index c7984ab..1095c18 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -6056,6 +6056,17 @@ static void rtl8723b_enable_rf(struct rtl8xxxu_priv *priv)
rtl8723a_h2c_cmd(priv, &h2c, sizeof(h2c.ignore_wlan));
}
+static void rtl8723b_disable_rf(struct rtl8xxxu_priv *priv)
+{
+ u32 val32;
+
+ rtl8xxxu_write8(priv, REG_TXPAUSE, 0xff);
+
+ val32 = rtl8xxxu_read32(priv, REG_RX_WAIT_CCA);
+ val32 &= ~(BIT(22) | BIT(23));
+ rtl8xxxu_write32(priv, REG_RX_WAIT_CCA, val32);
+}
+
static void rtl8723bu_init_aggregation(struct rtl8xxxu_priv *priv)
{
u32 agg_rx;
@@ -7987,7 +7998,7 @@ static void rtl8xxxu_stop(struct ieee80211_hw *hw)
if (priv->usb_interrupts)
usb_kill_anchored_urbs(&priv->int_anchor);
- rtl8723a_disable_rf(priv);
+ priv->fops->disable_rf(priv);
/*
* Disable interrupts
@@ -8271,6 +8282,7 @@ static struct rtl8xxxu_fileops rtl8723au_fops = {
.config_channel = rtl8723au_config_channel,
.parse_rx_desc = rtl8723au_parse_rx_desc,
.enable_rf = rtl8723a_enable_rf,
+ .disable_rf = rtl8723a_disable_rf,
.set_tx_power = rtl8723a_set_tx_power,
.update_rate_mask = rtl8723au_update_rate_mask,
.report_connect = rtl8723au_report_connect,
@@ -8296,6 +8308,7 @@ static struct rtl8xxxu_fileops rtl8723bu_fops = {
.init_aggregation = rtl8723bu_init_aggregation,
.init_statistics = rtl8723bu_init_statistics,
.enable_rf = rtl8723b_enable_rf,
+ .disable_rf = rtl8723b_disable_rf,
.set_tx_power = rtl8723b_set_tx_power,
.update_rate_mask = rtl8723bu_update_rate_mask,
.report_connect = rtl8723bu_report_connect,
@@ -8321,6 +8334,7 @@ static struct rtl8xxxu_fileops rtl8192cu_fops = {
.config_channel = rtl8723au_config_channel,
.parse_rx_desc = rtl8723au_parse_rx_desc,
.enable_rf = rtl8723a_enable_rf,
+ .disable_rf = rtl8723a_disable_rf,
.set_tx_power = rtl8723a_set_tx_power,
.update_rate_mask = rtl8723au_update_rate_mask,
.report_connect = rtl8723au_report_connect,
@@ -8345,6 +8359,7 @@ static struct rtl8xxxu_fileops rtl8192eu_fops = {
.config_channel = rtl8723bu_config_channel,
.parse_rx_desc = rtl8723bu_parse_rx_desc,
.enable_rf = rtl8723b_enable_rf,
+ .disable_rf = rtl8723b_disable_rf,
.set_tx_power = rtl8723b_set_tx_power,
.update_rate_mask = rtl8723au_update_rate_mask,
.report_connect = rtl8723au_report_connect,
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
index 776fd17..9c535e8 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
@@ -1266,6 +1266,7 @@ struct rtl8xxxu_fileops {
void (*init_aggregation) (struct rtl8xxxu_priv *priv);
void (*init_statistics) (struct rtl8xxxu_priv *priv);
void (*enable_rf) (struct rtl8xxxu_priv *priv);
+ void (*disable_rf) (struct rtl8xxxu_priv *priv);
void (*set_tx_power) (struct rtl8xxxu_priv *priv, int channel,
bool ht40);
void (*update_rate_mask) (struct rtl8xxxu_priv *priv,
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 109/113] rtl8xxxu: Implement device specific power_off function
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (107 preceding siblings ...)
2016-02-29 22:05 ` [PATCH 108/113] rtl8xxxu: Implement 8723bu specific disable_rf() function Jes.Sorensen
@ 2016-02-29 22:05 ` Jes.Sorensen
2016-02-29 22:05 ` [PATCH 110/113] rtl8xxxu: Flush FIFO before powering down devices Jes.Sorensen
` (4 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:05 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
Implment 8723bu specific device power down, and make power_off() a
fileops function.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 98 +++++++++++++++++++++-
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 1 +
.../net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h | 2 +
3 files changed, 99 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 1095c18..7f68b61 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -5240,6 +5240,64 @@ exit:
return ret;
}
+static int rtl8723bu_active_to_emu(struct rtl8xxxu_priv *priv)
+{
+ u8 val8;
+ u16 val16;
+ u32 val32;
+ int count, ret;
+
+ /* Turn off RF */
+ rtl8xxxu_write8(priv, REG_RF_CTRL, 0);
+
+ /* Enable rising edge triggering interrupt */
+ val16 = rtl8xxxu_read16(priv, REG_GPIO_INTM);
+ val16 &= ~GPIO_INTM_EDGE_TRIG_IRQ;
+ rtl8xxxu_write16(priv, REG_GPIO_INTM, val16);
+
+ /* Release WLON reset 0x04[16]= 1*/
+ val32 = rtl8xxxu_read32(priv, REG_GPIO_INTM);
+ val32 |= APS_FSMCO_WLON_RESET;
+ rtl8xxxu_write32(priv, REG_GPIO_INTM, val32);
+
+ /* 0x0005[1] = 1 turn off MAC by HW state machine*/
+ val8 = rtl8xxxu_read8(priv, REG_APS_FSMCO + 1);
+ val8 |= BIT(1);
+ rtl8xxxu_write8(priv, REG_APS_FSMCO + 1, val8);
+
+ for (count = RTL8XXXU_MAX_REG_POLL; count; count--) {
+ val8 = rtl8xxxu_read8(priv, REG_APS_FSMCO + 1);
+ if ((val8 & BIT(1)) == 0)
+ break;
+ udelay(10);
+ }
+
+ if (!count) {
+ dev_warn(&priv->udev->dev, "%s: Disabling MAC timed out\n",
+ __func__);
+ ret = -EBUSY;
+ goto exit;
+ }
+
+ /* Enable BT control XTAL setting */
+ val8 = rtl8xxxu_read8(priv, REG_AFE_MISC);
+ val8 &= ~AFE_MISC_WL_XTAL_CTRL;
+ rtl8xxxu_write8(priv, REG_AFE_MISC, val8);
+
+ /* 0x0000[5] = 1 analog Ips to digital, 1:isolation */
+ val8 = rtl8xxxu_read8(priv, REG_SYS_ISO_CTRL);
+ val8 |= SYS_ISO_ANALOG_IPS;
+ rtl8xxxu_write8(priv, REG_SYS_ISO_CTRL, val8);
+
+ /* 0x0020[0] = 0 disable LDOA12 MACRO block*/
+ val8 = rtl8xxxu_read8(priv, REG_LDOA15_CTRL);
+ val8 &= ~LDOA15_ENABLE;
+ rtl8xxxu_write8(priv, REG_LDOA15_CTRL, val8);
+
+exit:
+ return ret;
+}
+
static int rtl8xxxu_active_to_lps(struct rtl8xxxu_priv *priv)
{
u8 val8;
@@ -5932,6 +5990,38 @@ static void rtl8xxxu_power_off(struct rtl8xxxu_priv *priv)
rtl8xxxu_write8(priv, REG_RSV_CTRL, 0x0e);
}
+static void rtl8723bu_power_off(struct rtl8xxxu_priv *priv)
+{
+ u8 val8;
+ u16 val16;
+
+ /*
+ * Disable TX report timer
+ */
+ val8 = rtl8xxxu_read8(priv, REG_TX_REPORT_CTRL);
+ val8 &= ~TX_REPORT_CTRL_TIMER_ENABLE;
+ rtl8xxxu_write8(priv, REG_TX_REPORT_CTRL, val8);
+
+ rtl8xxxu_write16(priv, REG_CR, 0x0000);
+
+ rtl8xxxu_active_to_lps(priv);
+
+ /* Reset Firmware if running in RAM */
+ if (rtl8xxxu_read8(priv, REG_MCU_FW_DL) & MCU_FW_RAM_SEL)
+ rtl8xxxu_firmware_self_reset(priv);
+
+ /* Reset MCU */
+ val16 = rtl8xxxu_read16(priv, REG_SYS_FUNC);
+ val16 &= ~SYS_FUNC_CPU_ENABLE;
+ rtl8xxxu_write16(priv, REG_SYS_FUNC, val16);
+
+ /* Reset MCU ready status */
+ rtl8xxxu_write8(priv, REG_MCU_FW_DL, 0x00);
+
+ rtl8723bu_active_to_emu(priv);
+ rtl8xxxu_emu_to_disabled(priv);
+}
+
#ifdef NEED_PS_TDMA
static void rtl8723bu_set_ps_tdma(struct rtl8xxxu_priv *priv,
u8 arg1, u8 arg2, u8 arg3, u8 arg4, u8 arg5)
@@ -6152,7 +6242,7 @@ static int rtl8xxxu_init_device(struct ieee80211_hw *hw)
*/
if (priv->rtlchip == 0x8723bu) {
val8 = rtl8xxxu_read8(priv, REG_TX_REPORT_CTRL);
- val8 |= BIT(1);
+ val8 |= TX_REPORT_CTRL_TIMER_ENABLE;
rtl8xxxu_write8(priv, REG_TX_REPORT_CTRL, val8);
/* Set MAX RPT MACID */
rtl8xxxu_write8(priv, REG_TX_REPORT_CTRL + 1, 0x02);
@@ -6545,7 +6635,7 @@ static void rtl8xxxu_disable_device(struct ieee80211_hw *hw)
{
struct rtl8xxxu_priv *priv = hw->priv;
- rtl8xxxu_power_off(priv);
+ priv->fops->power_off(priv);
}
static void rtl8xxxu_cam_write(struct rtl8xxxu_priv *priv,
@@ -8277,6 +8367,7 @@ static struct rtl8xxxu_fileops rtl8723au_fops = {
.parse_efuse = rtl8723au_parse_efuse,
.load_firmware = rtl8723au_load_firmware,
.power_on = rtl8723au_power_on,
+ .power_off = rtl8xxxu_power_off,
.llt_init = rtl8xxxu_init_llt_table,
.phy_iq_calibrate = rtl8723au_phy_iq_calibrate,
.config_channel = rtl8723au_config_channel,
@@ -8300,6 +8391,7 @@ static struct rtl8xxxu_fileops rtl8723bu_fops = {
.parse_efuse = rtl8723bu_parse_efuse,
.load_firmware = rtl8723bu_load_firmware,
.power_on = rtl8723bu_power_on,
+ .power_off = rtl8723bu_power_off,
.llt_init = rtl8xxxu_auto_llt_table,
.phy_init_antenna_selection = rtl8723bu_phy_init_antenna_selection,
.phy_iq_calibrate = rtl8723bu_phy_iq_calibrate,
@@ -8329,6 +8421,7 @@ static struct rtl8xxxu_fileops rtl8192cu_fops = {
.parse_efuse = rtl8192cu_parse_efuse,
.load_firmware = rtl8192cu_load_firmware,
.power_on = rtl8192cu_power_on,
+ .power_off = rtl8xxxu_power_off,
.llt_init = rtl8xxxu_init_llt_table,
.phy_iq_calibrate = rtl8723au_phy_iq_calibrate,
.config_channel = rtl8723au_config_channel,
@@ -8354,6 +8447,7 @@ static struct rtl8xxxu_fileops rtl8192eu_fops = {
.parse_efuse = rtl8192eu_parse_efuse,
.load_firmware = rtl8192eu_load_firmware,
.power_on = rtl8192eu_power_on,
+ .power_off = rtl8xxxu_power_off,
.llt_init = rtl8xxxu_auto_llt_table,
.phy_iq_calibrate = rtl8723bu_phy_iq_calibrate,
.config_channel = rtl8723bu_config_channel,
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
index 9c535e8..bfa9d6c 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
@@ -1257,6 +1257,7 @@ struct rtl8xxxu_fileops {
int (*parse_efuse) (struct rtl8xxxu_priv *priv);
int (*load_firmware) (struct rtl8xxxu_priv *priv);
int (*power_on) (struct rtl8xxxu_priv *priv);
+ void (*power_off) (struct rtl8xxxu_priv *priv);
int (*llt_init) (struct rtl8xxxu_priv *priv, u8 last_tx_page);
void (*phy_init_antenna_selection) (struct rtl8xxxu_priv *priv);
void (*phy_iq_calibrate) (struct rtl8xxxu_priv *priv);
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
index e0b9ea3..a8d5c9f 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
@@ -512,6 +512,8 @@
#define REG_PKT_LOSE_RPT 0x04e1
#define REG_PTCL_ERR_STATUS 0x04e2
#define REG_TX_REPORT_CTRL 0x04ec
+#define TX_REPORT_CTRL_TIMER_ENABLE BIT(1)
+
#define REG_TX_REPORT_TIME 0x04f0
#define REG_DUMMY 0x04fc
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 110/113] rtl8xxxu: Flush FIFO before powering down devices
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (108 preceding siblings ...)
2016-02-29 22:05 ` [PATCH 109/113] rtl8xxxu: Implement device specific power_off function Jes.Sorensen
@ 2016-02-29 22:05 ` Jes.Sorensen
2016-02-29 22:05 ` [PATCH 111/113] rtl8xxxu: Print a warning if flushing the FIFO fails Jes.Sorensen
` (3 subsequent siblings)
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:05 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
This should help when reloading the driver for 8723bu devices
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 34 ++++++++++++++++++++++
.../net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h | 2 ++
2 files changed, 36 insertions(+)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 7f68b61..c594afa 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -5687,6 +5687,36 @@ static int rtl8xxxu_emu_to_disabled(struct rtl8xxxu_priv *priv)
return 0;
}
+static int rtl8xxxu_flush_fifo(struct rtl8xxxu_priv *priv)
+{
+ u32 val32;
+ int retry, retval;
+
+ rtl8xxxu_write8(priv, REG_TXPAUSE, 0xff);
+
+ val32 = rtl8xxxu_read32(priv, REG_RXPKT_NUM);
+ val32 |= RXPKT_NUM_RW_RELEASE_EN;
+ rtl8xxxu_write32(priv, REG_RXPKT_NUM, val32);
+
+ retry = 100;
+ retval = -EBUSY;
+
+ do {
+ val32 = rtl8xxxu_read32(priv, REG_RXPKT_NUM);
+ if (val32 & RXPKT_NUM_RXDMA_IDLE) {
+ retval = 0;
+ break;
+ }
+ } while (retry--);
+
+ rtl8xxxu_write16(priv, REG_RQPN_NPQ, 0);
+ rtl8xxxu_write32(priv, REG_RQPN, 0x80000000);
+ mdelay(2);
+ pr_info("%s: retry %i\n", __func__, retry);
+
+ return retval;
+}
+
static int rtl8723au_power_on(struct rtl8xxxu_priv *priv)
{
u8 val8;
@@ -5957,6 +5987,8 @@ static void rtl8xxxu_power_off(struct rtl8xxxu_priv *priv)
rtl8xxxu_write32(priv, REG_FPGA0_XCD_RF_PARM, val32);
}
+ rtl8xxxu_flush_fifo(priv);
+
rtl8xxxu_active_to_lps(priv);
/* Turn off RF */
@@ -5995,6 +6027,8 @@ static void rtl8723bu_power_off(struct rtl8xxxu_priv *priv)
u8 val8;
u16 val16;
+ rtl8xxxu_flush_fifo(priv);
+
/*
* Disable TX report timer
*/
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
index a8d5c9f..e545e84 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
@@ -404,6 +404,8 @@
#define REG_RXDMA_AGG_PG_TH 0x0280
#define RXDMA_USB_AGG_ENABLE BIT(31)
#define REG_RXPKT_NUM 0x0284
+#define RXPKT_NUM_RXDMA_IDLE BIT(17)
+#define RXPKT_NUM_RW_RELEASE_EN BIT(18)
#define REG_RXDMA_STATUS 0x0288
/* Presumably only found on newer chips such as 8723bu */
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 111/113] rtl8xxxu: Print a warning if flushing the FIFO fails
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (109 preceding siblings ...)
2016-02-29 22:05 ` [PATCH 110/113] rtl8xxxu: Flush FIFO before powering down devices Jes.Sorensen
@ 2016-02-29 22:05 ` Jes.Sorensen
2016-02-29 23:48 ` Julian Calaby
2016-02-29 22:05 ` [PATCH 112/113] rtl8xxxu: Use correct 8051 reset function for 8723b parts Jes.Sorensen
` (2 subsequent siblings)
113 siblings, 1 reply; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:05 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
Only print a warning if the FIFO flush fails, as opposed to printing
the status unconditionally.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index c594afa..11a970c 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -5689,6 +5689,7 @@ static int rtl8xxxu_emu_to_disabled(struct rtl8xxxu_priv *priv)
static int rtl8xxxu_flush_fifo(struct rtl8xxxu_priv *priv)
{
+ struct device *dev = &priv->udev->dev;
u32 val32;
int retry, retval;
@@ -5712,7 +5713,9 @@ static int rtl8xxxu_flush_fifo(struct rtl8xxxu_priv *priv)
rtl8xxxu_write16(priv, REG_RQPN_NPQ, 0);
rtl8xxxu_write32(priv, REG_RQPN, 0x80000000);
mdelay(2);
- pr_info("%s: retry %i\n", __func__, retry);
+
+ if (!retry)
+ dev_warn(dev, "Failed to flush FIFO\n");
return retval;
}
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 112/113] rtl8xxxu: Use correct 8051 reset function for 8723b parts
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (110 preceding siblings ...)
2016-02-29 22:05 ` [PATCH 111/113] rtl8xxxu: Print a warning if flushing the FIFO fails Jes.Sorensen
@ 2016-02-29 22:05 ` Jes.Sorensen
2016-02-29 22:05 ` [PATCH 113/113] rtl8xxxu: Temporarily disable 8192eu device init Jes.Sorensen
2016-03-11 12:37 ` [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Kalle Valo
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:05 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
8723b needs more action, so implement support for device specific
reset functions.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 40 ++++++++++++++++++++++--
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 1 +
2 files changed, 39 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 11a970c..1c5a6ef 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -2720,12 +2720,44 @@ static void rtl8xxxu_reset_8051(struct rtl8xxxu_priv *priv)
val8 = rtl8xxxu_read8(priv, REG_RSV_CTRL + 1);
val8 &= ~BIT(0);
rtl8xxxu_write8(priv, REG_RSV_CTRL + 1, val8);
+
sys_func = rtl8xxxu_read16(priv, REG_SYS_FUNC);
sys_func &= ~SYS_FUNC_CPU_ENABLE;
rtl8xxxu_write16(priv, REG_SYS_FUNC, sys_func);
+
val8 = rtl8xxxu_read8(priv, REG_RSV_CTRL + 1);
val8 |= BIT(0);
rtl8xxxu_write8(priv, REG_RSV_CTRL + 1, val8);
+
+ sys_func |= SYS_FUNC_CPU_ENABLE;
+ rtl8xxxu_write16(priv, REG_SYS_FUNC, sys_func);
+}
+
+static void rtl8723bu_reset_8051(struct rtl8xxxu_priv *priv)
+{
+ u8 val8;
+ u16 sys_func;
+
+ val8 = rtl8xxxu_read8(priv, REG_RSV_CTRL);
+ val8 &= ~BIT(1);
+ rtl8xxxu_write8(priv, REG_RSV_CTRL, val8);
+
+ val8 = rtl8xxxu_read8(priv, REG_RSV_CTRL + 1);
+ val8 &= ~BIT(0);
+ rtl8xxxu_write8(priv, REG_RSV_CTRL + 1, val8);
+
+ sys_func = rtl8xxxu_read16(priv, REG_SYS_FUNC);
+ sys_func &= ~SYS_FUNC_CPU_ENABLE;
+ rtl8xxxu_write16(priv, REG_SYS_FUNC, sys_func);
+
+ val8 = rtl8xxxu_read8(priv, REG_RSV_CTRL);
+ val8 &= ~BIT(1);
+ rtl8xxxu_write8(priv, REG_RSV_CTRL, val8);
+
+ val8 = rtl8xxxu_read8(priv, REG_RSV_CTRL + 1);
+ val8 |= BIT(0);
+ rtl8xxxu_write8(priv, REG_RSV_CTRL + 1, val8);
+
sys_func |= SYS_FUNC_CPU_ENABLE;
rtl8xxxu_write16(priv, REG_SYS_FUNC, sys_func);
}
@@ -2758,7 +2790,7 @@ static int rtl8xxxu_start_firmware(struct rtl8xxxu_priv *priv)
* Reset the 8051 in order for the firmware to start running,
* otherwise it won't come up on the 8192eu
*/
- rtl8xxxu_reset_8051(priv);
+ priv->fops->reset_8051(priv);
/* Wait for firmware to become ready */
for (i = 0; i < RTL8XXXU_FIRMWARE_POLL_MAX; i++) {
@@ -2805,7 +2837,7 @@ static int rtl8xxxu_download_firmware(struct rtl8xxxu_priv *priv)
if (val8 & MCU_FW_RAM_SEL) {
pr_info("do the RAM reset\n");
rtl8xxxu_write8(priv, REG_MCU_FW_DL, 0x00);
- rtl8xxxu_reset_8051(priv);
+ priv->fops->reset_8051(priv);
}
/* MCU firmware download enable */
@@ -8405,6 +8437,7 @@ static struct rtl8xxxu_fileops rtl8723au_fops = {
.load_firmware = rtl8723au_load_firmware,
.power_on = rtl8723au_power_on,
.power_off = rtl8xxxu_power_off,
+ .reset_8051 = rtl8xxxu_reset_8051,
.llt_init = rtl8xxxu_init_llt_table,
.phy_iq_calibrate = rtl8723au_phy_iq_calibrate,
.config_channel = rtl8723au_config_channel,
@@ -8429,6 +8462,7 @@ static struct rtl8xxxu_fileops rtl8723bu_fops = {
.load_firmware = rtl8723bu_load_firmware,
.power_on = rtl8723bu_power_on,
.power_off = rtl8723bu_power_off,
+ .reset_8051 = rtl8723bu_reset_8051,
.llt_init = rtl8xxxu_auto_llt_table,
.phy_init_antenna_selection = rtl8723bu_phy_init_antenna_selection,
.phy_iq_calibrate = rtl8723bu_phy_iq_calibrate,
@@ -8459,6 +8493,7 @@ static struct rtl8xxxu_fileops rtl8192cu_fops = {
.load_firmware = rtl8192cu_load_firmware,
.power_on = rtl8192cu_power_on,
.power_off = rtl8xxxu_power_off,
+ .reset_8051 = rtl8xxxu_reset_8051,
.llt_init = rtl8xxxu_init_llt_table,
.phy_iq_calibrate = rtl8723au_phy_iq_calibrate,
.config_channel = rtl8723au_config_channel,
@@ -8485,6 +8520,7 @@ static struct rtl8xxxu_fileops rtl8192eu_fops = {
.load_firmware = rtl8192eu_load_firmware,
.power_on = rtl8192eu_power_on,
.power_off = rtl8xxxu_power_off,
+ .reset_8051 = rtl8xxxu_reset_8051,
.llt_init = rtl8xxxu_auto_llt_table,
.phy_iq_calibrate = rtl8723bu_phy_iq_calibrate,
.config_channel = rtl8723bu_config_channel,
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
index bfa9d6c..7b73654 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
@@ -1258,6 +1258,7 @@ struct rtl8xxxu_fileops {
int (*load_firmware) (struct rtl8xxxu_priv *priv);
int (*power_on) (struct rtl8xxxu_priv *priv);
void (*power_off) (struct rtl8xxxu_priv *priv);
+ void (*reset_8051) (struct rtl8xxxu_priv *priv);
int (*llt_init) (struct rtl8xxxu_priv *priv, u8 last_tx_page);
void (*phy_init_antenna_selection) (struct rtl8xxxu_priv *priv);
void (*phy_iq_calibrate) (struct rtl8xxxu_priv *priv);
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 113/113] rtl8xxxu: Temporarily disable 8192eu device init
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (111 preceding siblings ...)
2016-02-29 22:05 ` [PATCH 112/113] rtl8xxxu: Use correct 8051 reset function for 8723b parts Jes.Sorensen
@ 2016-02-29 22:05 ` Jes.Sorensen
2016-03-11 12:37 ` [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Kalle Valo
113 siblings, 0 replies; 139+ messages in thread
From: Jes.Sorensen @ 2016-02-29 22:05 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Larry.Finger, Jes Sorensen
From: Jes Sorensen <Jes.Sorensen@redhat.com>
To reduce the patch volume, temporariliy disable 8192eu device init.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 1c5a6ef..8b3523d 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -2562,6 +2562,10 @@ static int rtl8192eu_parse_efuse(struct rtl8xxxu_priv *priv)
raw[i + 6], raw[i + 7]);
}
}
+ /*
+ * Temporarily disable 8192eu support
+ */
+ return -EINVAL;
return 0;
}
--
2.5.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* Re: [PATCH 064/113] rtl8xxxu: Set RX boundary for 8723bu
2016-02-29 22:05 ` [PATCH 064/113] rtl8xxxu: Set RX boundary for 8723bu Jes.Sorensen
@ 2016-02-29 23:11 ` Julian Calaby
2016-02-29 23:47 ` Jes Sorensen
0 siblings, 1 reply; 139+ messages in thread
From: Julian Calaby @ 2016-02-29 23:11 UTC (permalink / raw)
To: Jes Sorensen; +Cc: linux-wireless, Kalle Valo, Larry Finger
Hi Jes,
On Tue, Mar 1, 2016 at 9:05 AM, <Jes.Sorensen@redhat.com> wrote:
> From: Jes Sorensen <Jes.Sorensen@redhat.com>
>
> Set the correct TRXFF boundary for 8723bu.
>
> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
> ---
> drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
> index 3a7fd2c..835eca8 100644
> --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
> +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
> @@ -6182,7 +6182,10 @@ static int rtl8xxxu_init_device(struct ieee80211_hw *hw)
> /*
> * Set RX page boundary
> */
> - rtl8xxxu_write16(priv, REG_TRXFF_BNDY + 2, 0x27ff);
> + if (priv->rtlchip == 0x8723b)
> + rtl8xxxu_write16(priv, REG_TRXFF_BNDY + 2, 0x3f7f);
> + else
> + rtl8xxxu_write16(priv, REG_TRXFF_BNDY + 2, 0x27ff);
Is this likely to be different for other chipsets in the future? If
so, would it make sense to stuff it into the fops structure?
Thanks,
--
Julian Calaby
Email: julian.calaby@gmail.com
Profile: http://www.google.com/profiles/julian.calaby/
^ permalink raw reply [flat|nested] 139+ messages in thread
* Re: [PATCH 066/113] rtl8xxxu: Call device specific _config_channel()
2016-02-29 22:05 ` [PATCH 066/113] rtl8xxxu: Call device specific _config_channel() Jes.Sorensen
@ 2016-02-29 23:12 ` Julian Calaby
2016-02-29 23:48 ` Jes Sorensen
0 siblings, 1 reply; 139+ messages in thread
From: Julian Calaby @ 2016-02-29 23:12 UTC (permalink / raw)
To: Jes Sorensen; +Cc: linux-wireless, Kalle Valo, Larry Finger
Hi Jes,
On Tue, Mar 1, 2016 at 9:05 AM, <Jes.Sorensen@redhat.com> wrote:
> From: Jes Sorensen <Jes.Sorensen@redhat.com>
>
> Having a version for the newer chips without calling it doesn't do
> much good.....
>
> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Should this be squashed into the patch that introduces the new op?
> ---
> drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
> index ecd0f59..566eeb5 100644
> --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
> +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
> @@ -7348,7 +7348,7 @@ static int rtl8xxxu_config(struct ieee80211_hw *hw, u32 changed)
>
> rtl8723a_set_tx_power(priv, channel, ht40);
>
> - rtl8723au_config_channel(hw);
> + priv->fops->config_channel(hw);
> }
>
> exit:
Thanks,
--
Julian Calaby
Email: julian.calaby@gmail.com
Profile: http://www.google.com/profiles/julian.calaby/
^ permalink raw reply [flat|nested] 139+ messages in thread
* Re: [PATCH 106/113] rtl8xxxu: convert rtl8723bu_init_bt() into rtl8723b_enable_rf()
2016-02-29 22:05 ` [PATCH 106/113] rtl8xxxu: convert rtl8723bu_init_bt() into rtl8723b_enable_rf() Jes.Sorensen
@ 2016-02-29 23:46 ` Julian Calaby
2016-02-29 23:51 ` Jes Sorensen
0 siblings, 1 reply; 139+ messages in thread
From: Julian Calaby @ 2016-02-29 23:46 UTC (permalink / raw)
To: Jes Sorensen; +Cc: linux-wireless, Kalle Valo, Larry Finger
Hi Jes,
On Tue, Mar 1, 2016 at 9:05 AM, <Jes.Sorensen@redhat.com> wrote:
> From: Jes Sorensen <Jes.Sorensen@redhat.com>
>
> rtl8723bu_init_bt() is effectively the function enabling RF, so name
> it appropriately.
Should this be merged into the patches that introduce these functions?
Thanks,
--
Julian Calaby
Email: julian.calaby@gmail.com
Profile: http://www.google.com/profiles/julian.calaby/
^ permalink raw reply [flat|nested] 139+ messages in thread
* Re: [PATCH 064/113] rtl8xxxu: Set RX boundary for 8723bu
2016-02-29 23:11 ` Julian Calaby
@ 2016-02-29 23:47 ` Jes Sorensen
0 siblings, 0 replies; 139+ messages in thread
From: Jes Sorensen @ 2016-02-29 23:47 UTC (permalink / raw)
To: Julian Calaby; +Cc: linux-wireless, Kalle Valo, Larry Finger
Julian Calaby <julian.calaby@gmail.com> writes:
> Hi Jes,
>
> On Tue, Mar 1, 2016 at 9:05 AM, <Jes.Sorensen@redhat.com> wrote:
>> From: Jes Sorensen <Jes.Sorensen@redhat.com>
>>
>> Set the correct TRXFF boundary for 8723bu.
>>
>> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
>> ---
>> drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 5 ++++-
>> 1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
>> index 3a7fd2c..835eca8 100644
>> --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
>> +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
>> @@ -6182,7 +6182,10 @@ static int rtl8xxxu_init_device(struct ieee80211_hw *hw)
>> /*
>> * Set RX page boundary
>> */
>> - rtl8xxxu_write16(priv, REG_TRXFF_BNDY + 2, 0x27ff);
>> + if (priv->rtlchip == 0x8723b)
>> + rtl8xxxu_write16(priv, REG_TRXFF_BNDY + 2, 0x3f7f);
>> + else
>> + rtl8xxxu_write16(priv, REG_TRXFF_BNDY + 2, 0x27ff);
>
> Is this likely to be different for other chipsets in the future? If
> so, would it make sense to stuff it into the fops structure?
Happens in a later patch
Jes
^ permalink raw reply [flat|nested] 139+ messages in thread
* Re: [PATCH 111/113] rtl8xxxu: Print a warning if flushing the FIFO fails
2016-02-29 22:05 ` [PATCH 111/113] rtl8xxxu: Print a warning if flushing the FIFO fails Jes.Sorensen
@ 2016-02-29 23:48 ` Julian Calaby
2016-02-29 23:52 ` Jes Sorensen
0 siblings, 1 reply; 139+ messages in thread
From: Julian Calaby @ 2016-02-29 23:48 UTC (permalink / raw)
To: Jes Sorensen; +Cc: linux-wireless, Kalle Valo, Larry Finger
Hi Jes,
On Tue, Mar 1, 2016 at 9:05 AM, <Jes.Sorensen@redhat.com> wrote:
> From: Jes Sorensen <Jes.Sorensen@redhat.com>
>
> Only print a warning if the FIFO flush fails, as opposed to printing
> the status unconditionally.
>
> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Should this be squashed into the previous patch?
Thanks,
--
Julian Calaby
Email: julian.calaby@gmail.com
Profile: http://www.google.com/profiles/julian.calaby/
^ permalink raw reply [flat|nested] 139+ messages in thread
* Re: [PATCH 066/113] rtl8xxxu: Call device specific _config_channel()
2016-02-29 23:12 ` Julian Calaby
@ 2016-02-29 23:48 ` Jes Sorensen
2016-02-29 23:50 ` Julian Calaby
0 siblings, 1 reply; 139+ messages in thread
From: Jes Sorensen @ 2016-02-29 23:48 UTC (permalink / raw)
To: Julian Calaby; +Cc: linux-wireless, Kalle Valo, Larry Finger
Julian Calaby <julian.calaby@gmail.com> writes:
> Hi Jes,
>
> On Tue, Mar 1, 2016 at 9:05 AM, <Jes.Sorensen@redhat.com> wrote:
>> From: Jes Sorensen <Jes.Sorensen@redhat.com>
>>
>> Having a version for the newer chips without calling it doesn't do
>> much good.....
>>
>> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
>
> Should this be squashed into the patch that introduces the new op?
I can start rewriting history, but all that comes out of that is having
to fight patch conflicts rebasing things.
If there was an actual functional reason for it, sure, but in this case
there isn't.
Jes
>
>> ---
>> drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
>> index ecd0f59..566eeb5 100644
>> --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
>> +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
>> @@ -7348,7 +7348,7 @@ static int rtl8xxxu_config(struct ieee80211_hw *hw, u32 changed)
>>
>> rtl8723a_set_tx_power(priv, channel, ht40);
>>
>> - rtl8723au_config_channel(hw);
>> + priv->fops->config_channel(hw);
>> }
>>
>> exit:
>
> Thanks,
^ permalink raw reply [flat|nested] 139+ messages in thread
* Re: [PATCH 066/113] rtl8xxxu: Call device specific _config_channel()
2016-02-29 23:48 ` Jes Sorensen
@ 2016-02-29 23:50 ` Julian Calaby
2016-02-29 23:58 ` Jes Sorensen
0 siblings, 1 reply; 139+ messages in thread
From: Julian Calaby @ 2016-02-29 23:50 UTC (permalink / raw)
To: Jes Sorensen; +Cc: linux-wireless, Kalle Valo, Larry Finger
Hi Jes,
On Tue, Mar 1, 2016 at 10:48 AM, Jes Sorensen <Jes.Sorensen@redhat.com> wrote:
> Julian Calaby <julian.calaby@gmail.com> writes:
>> Hi Jes,
>>
>> On Tue, Mar 1, 2016 at 9:05 AM, <Jes.Sorensen@redhat.com> wrote:
>>> From: Jes Sorensen <Jes.Sorensen@redhat.com>
>>>
>>> Having a version for the newer chips without calling it doesn't do
>>> much good.....
>>>
>>> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
>>
>> Should this be squashed into the patch that introduces the new op?
>
> I can start rewriting history, but all that comes out of that is having
> to fight patch conflicts rebasing things.
>
> If there was an actual functional reason for it, sure, but in this case
> there isn't.
Fair enough, it just looks odd to have fixes like this in a patch
series that almost entirely consists of introducing new stuff.
Thanks,
--
Julian Calaby
Email: julian.calaby@gmail.com
Profile: http://www.google.com/profiles/julian.calaby/
^ permalink raw reply [flat|nested] 139+ messages in thread
* Re: [PATCH 106/113] rtl8xxxu: convert rtl8723bu_init_bt() into rtl8723b_enable_rf()
2016-02-29 23:46 ` Julian Calaby
@ 2016-02-29 23:51 ` Jes Sorensen
2016-03-01 0:04 ` Julian Calaby
0 siblings, 1 reply; 139+ messages in thread
From: Jes Sorensen @ 2016-02-29 23:51 UTC (permalink / raw)
To: Julian Calaby; +Cc: linux-wireless, Kalle Valo, Larry Finger
Julian Calaby <julian.calaby@gmail.com> writes:
> Hi Jes,
>
> On Tue, Mar 1, 2016 at 9:05 AM, <Jes.Sorensen@redhat.com> wrote:
>> From: Jes Sorensen <Jes.Sorensen@redhat.com>
>>
>> rtl8723bu_init_bt() is effectively the function enabling RF, so name
>> it appropriately.
>
> Should this be merged into the patches that introduce these functions?
Again, this would be rewriting history and simply cause me to fight a
pile of patch conflicts rebasing things, for no gain, and at the risk of
introducing new errors in the process.
Jes
^ permalink raw reply [flat|nested] 139+ messages in thread
* Re: [PATCH 111/113] rtl8xxxu: Print a warning if flushing the FIFO fails
2016-02-29 23:48 ` Julian Calaby
@ 2016-02-29 23:52 ` Jes Sorensen
0 siblings, 0 replies; 139+ messages in thread
From: Jes Sorensen @ 2016-02-29 23:52 UTC (permalink / raw)
To: Julian Calaby; +Cc: linux-wireless, Kalle Valo, Larry Finger
Julian Calaby <julian.calaby@gmail.com> writes:
> Hi Jes,
>
> On Tue, Mar 1, 2016 at 9:05 AM, <Jes.Sorensen@redhat.com> wrote:
>> From: Jes Sorensen <Jes.Sorensen@redhat.com>
>>
>> Only print a warning if the FIFO flush fails, as opposed to printing
>> the status unconditionally.
>>
>> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
>
> Should this be squashed into the previous patch?
If you want to have the whole set reposted for a nitpick, sure. If Kalle
prefers to squash the two together, I am fine with that.
Jes
^ permalink raw reply [flat|nested] 139+ messages in thread
* Re: [PATCH 066/113] rtl8xxxu: Call device specific _config_channel()
2016-02-29 23:50 ` Julian Calaby
@ 2016-02-29 23:58 ` Jes Sorensen
0 siblings, 0 replies; 139+ messages in thread
From: Jes Sorensen @ 2016-02-29 23:58 UTC (permalink / raw)
To: Julian Calaby; +Cc: linux-wireless, Kalle Valo, Larry Finger
Julian Calaby <julian.calaby@gmail.com> writes:
> Hi Jes,
>
> On Tue, Mar 1, 2016 at 10:48 AM, Jes Sorensen <Jes.Sorensen@redhat.com> wrote:
>> Julian Calaby <julian.calaby@gmail.com> writes:
>>> Hi Jes,
>>>
>>> On Tue, Mar 1, 2016 at 9:05 AM, <Jes.Sorensen@redhat.com> wrote:
>>>> From: Jes Sorensen <Jes.Sorensen@redhat.com>
>>>>
>>>> Having a version for the newer chips without calling it doesn't do
>>>> much good.....
>>>>
>>>> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
>>>
>>> Should this be squashed into the patch that introduces the new op?
>>
>> I can start rewriting history, but all that comes out of that is having
>> to fight patch conflicts rebasing things.
>>
>> If there was an actual functional reason for it, sure, but in this case
>> there isn't.
>
> Fair enough, it just looks odd to have fixes like this in a patch
> series that almost entirely consists of introducing new stuff.
As you can see from the dates, this code was written over time, one top
of adding already existing code.
Merging patches randomly into giant jumbo patches will make it
completely impossible to bisect and debug in case one of these changes
breaks something in the parts of the code that was working prior to
introducing this set.
So no, this is not at all odd, it's perfectly normal for this type of
code.
Jes
^ permalink raw reply [flat|nested] 139+ messages in thread
* Re: [PATCH 106/113] rtl8xxxu: convert rtl8723bu_init_bt() into rtl8723b_enable_rf()
2016-02-29 23:51 ` Jes Sorensen
@ 2016-03-01 0:04 ` Julian Calaby
2016-03-01 0:15 ` Jes Sorensen
0 siblings, 1 reply; 139+ messages in thread
From: Julian Calaby @ 2016-03-01 0:04 UTC (permalink / raw)
To: Jes Sorensen; +Cc: linux-wireless, Kalle Valo, Larry Finger
Hi Jes,
On Tue, Mar 1, 2016 at 10:51 AM, Jes Sorensen <Jes.Sorensen@redhat.com> wrote:
> Julian Calaby <julian.calaby@gmail.com> writes:
>> Hi Jes,
>>
>> On Tue, Mar 1, 2016 at 9:05 AM, <Jes.Sorensen@redhat.com> wrote:
>>> From: Jes Sorensen <Jes.Sorensen@redhat.com>
>>>
>>> rtl8723bu_init_bt() is effectively the function enabling RF, so name
>>> it appropriately.
>>
>> Should this be merged into the patches that introduce these functions?
>
> Again, this would be rewriting history and simply cause me to fight a
> pile of patch conflicts rebasing things, for no gain, and at the risk of
> introducing new errors in the process.
Totally agree, this is definitely something that would cause conflicts.
IMHO, history is only important if multiple people have contributed to
something or it's being developed in public - which, for Linux, I
define as it being in a maintainer's repository.
This patch set looks like you've been playing around with a bunch of
stuff, completed *bu support, then just thrown it all over the wall
without "prettying" it up for review and submission. If I were
developing this I'd have happily rewritten history even if all I did
was reduce the number of patches by squashing later fixes into earlier
patches.
I can see a lot of scope for reducing the number of patches in this
patch set, so if you'd like me to play around with that, just ask.
Thanks,
--
Julian Calaby
Email: julian.calaby@gmail.com
Profile: http://www.google.com/profiles/julian.calaby/
^ permalink raw reply [flat|nested] 139+ messages in thread
* Re: [PATCH 106/113] rtl8xxxu: convert rtl8723bu_init_bt() into rtl8723b_enable_rf()
2016-03-01 0:04 ` Julian Calaby
@ 2016-03-01 0:15 ` Jes Sorensen
2016-03-01 0:32 ` Julian Calaby
0 siblings, 1 reply; 139+ messages in thread
From: Jes Sorensen @ 2016-03-01 0:15 UTC (permalink / raw)
To: Julian Calaby; +Cc: linux-wireless, Kalle Valo, Larry Finger
Julian Calaby <julian.calaby@gmail.com> writes:
> Hi Jes,
>
> On Tue, Mar 1, 2016 at 10:51 AM, Jes Sorensen <Jes.Sorensen@redhat.com> wrote:
>> Julian Calaby <julian.calaby@gmail.com> writes:
>>> Hi Jes,
>>>
>>> On Tue, Mar 1, 2016 at 9:05 AM, <Jes.Sorensen@redhat.com> wrote:
>>>> From: Jes Sorensen <Jes.Sorensen@redhat.com>
>>>>
>>>> rtl8723bu_init_bt() is effectively the function enabling RF, so name
>>>> it appropriately.
>>>
>>> Should this be merged into the patches that introduce these functions?
>>
>> Again, this would be rewriting history and simply cause me to fight a
>> pile of patch conflicts rebasing things, for no gain, and at the risk of
>> introducing new errors in the process.
>
> Totally agree, this is definitely something that would cause conflicts.
>
> IMHO, history is only important if multiple people have contributed to
> something or it's being developed in public - which, for Linux, I
> define as it being in a maintainer's repository.
Well I have to completely agree with you on that one. I have had
multiple test out my development repository while I was working on
this. I reordered some patches for an earlier submission to reduce the
patchset.
> This patch set looks like you've been playing around with a bunch of
> stuff, completed *bu support, then just thrown it all over the wall
> without "prettying" it up for review and submission. If I were
> developing this I'd have happily rewritten history even if all I did
> was reduce the number of patches by squashing later fixes into earlier
> patches.
Well again, prettying things up by merging a lot of patches together
reduces the maintainability and the debug option. Patches often sit
outside a maintainer's tree for a long time, and the sub-maintainer and
developer may have to go back and bisect his/her way to a bug that was
introduced in the middle.
Linux development is not only what happens in the official tree, it's
also how it got there.
> I can see a lot of scope for reducing the number of patches in this
> patch set, so if you'd like me to play around with that, just ask.
Unless you plan to test every single change you suggest against all the
supported USB parts, then I'd say thanks, but no thanks.
The whole point of git is to commit often, and keep the history.
Jes
^ permalink raw reply [flat|nested] 139+ messages in thread
* Re: [PATCH 106/113] rtl8xxxu: convert rtl8723bu_init_bt() into rtl8723b_enable_rf()
2016-03-01 0:15 ` Jes Sorensen
@ 2016-03-01 0:32 ` Julian Calaby
2016-03-01 1:30 ` Jes Sorensen
0 siblings, 1 reply; 139+ messages in thread
From: Julian Calaby @ 2016-03-01 0:32 UTC (permalink / raw)
To: Jes Sorensen; +Cc: linux-wireless, Kalle Valo, Larry Finger
Hi Jes,
On Tue, Mar 1, 2016 at 11:15 AM, Jes Sorensen <Jes.Sorensen@redhat.com> wrote:
> Julian Calaby <julian.calaby@gmail.com> writes:
>> Hi Jes,
>>
>> On Tue, Mar 1, 2016 at 10:51 AM, Jes Sorensen <Jes.Sorensen@redhat.com> wrote:
>>> Julian Calaby <julian.calaby@gmail.com> writes:
>>>> Hi Jes,
>>>>
>>>> On Tue, Mar 1, 2016 at 9:05 AM, <Jes.Sorensen@redhat.com> wrote:
>>>>> From: Jes Sorensen <Jes.Sorensen@redhat.com>
>>>>>
>>>>> rtl8723bu_init_bt() is effectively the function enabling RF, so name
>>>>> it appropriately.
>>>>
>>>> Should this be merged into the patches that introduce these functions?
>>>
>>> Again, this would be rewriting history and simply cause me to fight a
>>> pile of patch conflicts rebasing things, for no gain, and at the risk of
>>> introducing new errors in the process.
>>
>> Totally agree, this is definitely something that would cause conflicts.
>>
>> IMHO, history is only important if multiple people have contributed to
>> something or it's being developed in public - which, for Linux, I
>> define as it being in a maintainer's repository.
>
> Well I have to completely agree with you on that one. I have had
> multiple test out my development repository while I was working on
> this. I reordered some patches for an earlier submission to reduce the
> patchset.
>
>> This patch set looks like you've been playing around with a bunch of
>> stuff, completed *bu support, then just thrown it all over the wall
>> without "prettying" it up for review and submission. If I were
>> developing this I'd have happily rewritten history even if all I did
>> was reduce the number of patches by squashing later fixes into earlier
>> patches.
>
> Well again, prettying things up by merging a lot of patches together
> reduces the maintainability and the debug option. Patches often sit
> outside a maintainer's tree for a long time, and the sub-maintainer and
> developer may have to go back and bisect his/her way to a bug that was
> introduced in the middle.
I'm not advocating turning this into a couple of huge patches, I'm
saying that two patches that introduce a new op and adjust code to use
it should either be one patch or patches n and n+1, not separated by
tens of unrelated patches; and I'm saying that there's no point
keeping the history that a particular message used to be much more
verbose.
> Linux development is not only what happens in the official tree, it's
> also how it got there.
I've seen tens of new drivers introduced and accepted into Linux in
the time I've been watching these mailing lists and they tend to fall
into one of three categories:
1. Vendor dumps a huge ten-thousand line patch adding the new driver
then is told to split it up for review. (E.g. most SCSI drivers)
2. Developer submits a new driver in 10-20 patches which logically
bring up the device and add features. (E.g. most new WiFi drivers and
practically all drivers on the ARM list I follow)
3. Developer submits basic support for a device then releases dribs
and drabs of patches to add features. (E.g. b43)
You're trying to do both 2 and 3 here.
>> I can see a lot of scope for reducing the number of patches in this
>> patch set, so if you'd like me to play around with that, just ask.
>
> Unless you plan to test every single change you suggest against all the
> supported USB parts, then I'd say thanks, but no thanks.
Fair point. Look, at least rip out the *eu specific stuff until it's
complete. It's ugly to write write a bunch of stuff to add support for
a chipset, never get there, then disable it in the last patch.
> The whole point of git is to commit often, and keep the history.
I agree that committing often is essential for modern development, but
I don't think keeping every last detail of the code's history is
worthwhile.
Thanks,
--
Julian Calaby
Email: julian.calaby@gmail.com
Profile: http://www.google.com/profiles/julian.calaby/
^ permalink raw reply [flat|nested] 139+ messages in thread
* Re: [PATCH 106/113] rtl8xxxu: convert rtl8723bu_init_bt() into rtl8723b_enable_rf()
2016-03-01 0:32 ` Julian Calaby
@ 2016-03-01 1:30 ` Jes Sorensen
2016-03-01 1:47 ` Julian Calaby
0 siblings, 1 reply; 139+ messages in thread
From: Jes Sorensen @ 2016-03-01 1:30 UTC (permalink / raw)
To: Julian Calaby; +Cc: linux-wireless, Kalle Valo, Larry Finger
Julian Calaby <julian.calaby@gmail.com> writes:
> Hi Jes,
>
> On Tue, Mar 1, 2016 at 11:15 AM, Jes Sorensen <Jes.Sorensen@redhat.com> wrote:
>> Julian Calaby <julian.calaby@gmail.com> writes:
>> Well again, prettying things up by merging a lot of patches together
>> reduces the maintainability and the debug option. Patches often sit
>> outside a maintainer's tree for a long time, and the sub-maintainer and
>> developer may have to go back and bisect his/her way to a bug that was
>> introduced in the middle.
>
> I'm not advocating turning this into a couple of huge patches, I'm
> saying that two patches that introduce a new op and adjust code to use
> it should either be one patch or patches n and n+1, not separated by
> tens of unrelated patches; and I'm saying that there's no point
> keeping the history that a particular message used to be much more
> verbose.
As I said earlier, there are a few places where you could squash one
patch into another. It requires rewriting history and potentially
hitting patch conflicts. If it added value, I would agree with you, but
I don't see any case where it does.
>> Linux development is not only what happens in the official tree, it's
>> also how it got there.
>
> I've seen tens of new drivers introduced and accepted into Linux in
> the time I've been watching these mailing lists and they tend to fall
> into one of three categories:
> 1. Vendor dumps a huge ten-thousand line patch adding the new driver
> then is told to split it up for review. (E.g. most SCSI drivers)
> 2. Developer submits a new driver in 10-20 patches which logically
> bring up the device and add features. (E.g. most new WiFi drivers and
> practically all drivers on the ARM list I follow)
> 3. Developer submits basic support for a device then releases dribs
> and drabs of patches to add features. (E.g. b43)
>
> You're trying to do both 2 and 3 here.
Well I am sure you have seen a lot of drivers come and go over time, so
have I. I also wrote some of them.
For the initial submission of rtl8xxxu I did merge it all into one,
because it was a completely new driver. However since then I received
feedback, fixed bugs, and started adding new features.
SCSI is a lot simpler than WiFi. Sure I could merge this into 10-20
large patches and post those, but that would affect other portions of
the code, not just support for the new pieces. It is very common for
Linux drivers to take a large number of changes in a set of patches.
It's how Linux evolves.
>>> I can see a lot of scope for reducing the number of patches in this
>>> patch set, so if you'd like me to play around with that, just ask.
>>
>> Unless you plan to test every single change you suggest against all the
>> supported USB parts, then I'd say thanks, but no thanks.
>
> Fair point. Look, at least rip out the *eu specific stuff until it's
> complete. It's ugly to write write a bunch of stuff to add support for
> a chipset, never get there, then disable it in the last patch.
Trying to isolate the 8192eu support from the 8723bu support at this
point would be insane. The two are so intermingled that it's not doable
without breaking everything. It would take a lot of time and the end
code would be the same.
I could have included the 50-60 additional patches to bring up 8192eu
with this patchset, but I know Kalle prefers fewer patches at a
time. This was the smallest I could do which would include functional
8723bu support. Alternatively I could have pushed 20 patches at a time,
leaving the code dysfunctional until I reached the set level of this
patchset and then enabled support for the 8723bu at that time.
In my oppinion having a half deck of patches that aren't providing any
functional feature, in the tree, would be far worse than taking the full
set in in one go.
The good news is that once the 8192eu changes are in as well, adding
support for the 8188eu and 8192du should be a lot simpler and require
fewer changes since both generations of chips will then be covered.
I also plan to reorganize the code to split it more into sub-drivers,
making it easier to develop support for new chips down the line. Having
had that in place for 8723bu/8192eu development would have been nice,
but I only learned of the differences and what needed to be split out as
I went along.
>> The whole point of git is to commit often, and keep the history.
>
> I agree that committing often is essential for modern development, but
> I don't think keeping every last detail of the code's history is
> worthwhile.
We'll have to agree to disagree on that one. If you decide to write your
own driver at some point, I will fully support you keeping the history
of that code, the way you prefer.
Jes
^ permalink raw reply [flat|nested] 139+ messages in thread
* Re: [PATCH 106/113] rtl8xxxu: convert rtl8723bu_init_bt() into rtl8723b_enable_rf()
2016-03-01 1:30 ` Jes Sorensen
@ 2016-03-01 1:47 ` Julian Calaby
0 siblings, 0 replies; 139+ messages in thread
From: Julian Calaby @ 2016-03-01 1:47 UTC (permalink / raw)
To: Jes Sorensen; +Cc: linux-wireless, Kalle Valo, Larry Finger
Hi Jes,
On Tue, Mar 1, 2016 at 12:30 PM, Jes Sorensen <Jes.Sorensen@redhat.com> wrote:
> Julian Calaby <julian.calaby@gmail.com> writes:
>> Hi Jes,
>>
>> On Tue, Mar 1, 2016 at 11:15 AM, Jes Sorensen <Jes.Sorensen@redhat.com> wrote:
>>> Julian Calaby <julian.calaby@gmail.com> writes:
>>> Well again, prettying things up by merging a lot of patches together
>>> reduces the maintainability and the debug option. Patches often sit
>>> outside a maintainer's tree for a long time, and the sub-maintainer and
>>> developer may have to go back and bisect his/her way to a bug that was
>>> introduced in the middle.
>>
>> I'm not advocating turning this into a couple of huge patches, I'm
>> saying that two patches that introduce a new op and adjust code to use
>> it should either be one patch or patches n and n+1, not separated by
>> tens of unrelated patches; and I'm saying that there's no point
>> keeping the history that a particular message used to be much more
>> verbose.
>
> As I said earlier, there are a few places where you could squash one
> patch into another. It requires rewriting history and potentially
> hitting patch conflicts. If it added value, I would agree with you, but
> I don't see any case where it does.
>
>>> Linux development is not only what happens in the official tree, it's
>>> also how it got there.
>>
>> I've seen tens of new drivers introduced and accepted into Linux in
>> the time I've been watching these mailing lists and they tend to fall
>> into one of three categories:
>> 1. Vendor dumps a huge ten-thousand line patch adding the new driver
>> then is told to split it up for review. (E.g. most SCSI drivers)
>> 2. Developer submits a new driver in 10-20 patches which logically
>> bring up the device and add features. (E.g. most new WiFi drivers and
>> practically all drivers on the ARM list I follow)
>> 3. Developer submits basic support for a device then releases dribs
>> and drabs of patches to add features. (E.g. b43)
>>
>> You're trying to do both 2 and 3 here.
>
> Well I am sure you have seen a lot of drivers come and go over time, so
> have I. I also wrote some of them.
>
> For the initial submission of rtl8xxxu I did merge it all into one,
> because it was a completely new driver. However since then I received
> feedback, fixed bugs, and started adding new features.
And it was beautiful and concise, as were the patches that followed.
> SCSI is a lot simpler than WiFi. Sure I could merge this into 10-20
> large patches and post those, but that would affect other portions of
> the code, not just support for the new pieces. It is very common for
> Linux drivers to take a large number of changes in a set of patches.
> It's how Linux evolves.
It could be argued both ways, some of the SCSI drivers are shockingly
huge, particularly for data centre focused iSCSI accelerators.
>>>> I can see a lot of scope for reducing the number of patches in this
>>>> patch set, so if you'd like me to play around with that, just ask.
>>>
>>> Unless you plan to test every single change you suggest against all the
>>> supported USB parts, then I'd say thanks, but no thanks.
>>
>> Fair point. Look, at least rip out the *eu specific stuff until it's
>> complete. It's ugly to write write a bunch of stuff to add support for
>> a chipset, never get there, then disable it in the last patch.
>
> Trying to isolate the 8192eu support from the 8723bu support at this
> point would be insane. The two are so intermingled that it's not doable
> without breaking everything. It would take a lot of time and the end
> code would be the same.
I'm talking all the code changes that are specific to 8192eu, i.e.
adding the fops, device IDs and any functions with 8192eu in their
name that aren't used elsewhere. Any conflicts from doing that would
be trivial to resolve.
> I could have included the 50-60 additional patches to bring up 8192eu
> with this patchset, but I know Kalle prefers fewer patches at a
> time. This was the smallest I could do which would include functional
> 8723bu support. Alternatively I could have pushed 20 patches at a time,
> leaving the code dysfunctional until I reached the set level of this
> patchset and then enabled support for the 8723bu at that time.
>
> In my oppinion having a half deck of patches that aren't providing any
> functional feature, in the tree, would be far worse than taking the full
> set in in one go.
However you've done exactly this with the *eu support.
> The good news is that once the 8192eu changes are in as well, adding
> support for the 8188eu and 8192du should be a lot simpler and require
> fewer changes since both generations of chips will then be covered.
>
> I also plan to reorganize the code to split it more into sub-drivers,
> making it easier to develop support for new chips down the line. Having
> had that in place for 8723bu/8192eu development would have been nice,
> but I only learned of the differences and what needed to be split out as
> I went along.
>
>>> The whole point of git is to commit often, and keep the history.
>>
>> I agree that committing often is essential for modern development, but
>> I don't think keeping every last detail of the code's history is
>> worthwhile.
>
> We'll have to agree to disagree on that one. If you decide to write your
> own driver at some point, I will fully support you keeping the history
> of that code, the way you prefer.
I guess this is just a difference in style. I like anything I submit
to be as polished and clean as possible, that includes the history of
the code.
Anyway, I consider this matter closed. I made some suggestions for
improvement and you rejected them. End of story.
Thanks,
--
Julian Calaby
Email: julian.calaby@gmail.com
Profile: http://www.google.com/profiles/julian.calaby/
^ permalink raw reply [flat|nested] 139+ messages in thread
* Re: [PATCH 037/113] rtl8xxxu: First stab at adding IQK calibration for 8723bu parts
2016-02-29 22:04 ` [PATCH 037/113] rtl8xxxu: First stab at adding IQK calibration for 8723bu parts Jes.Sorensen
@ 2016-03-10 14:24 ` Kalle Valo
2016-03-10 14:52 ` Jes Sorensen
0 siblings, 1 reply; 139+ messages in thread
From: Kalle Valo @ 2016-03-10 14:24 UTC (permalink / raw)
To: Jes.Sorensen; +Cc: linux-wireless, Larry.Finger
Jes.Sorensen@redhat.com writes:
> From: Jes Sorensen <Jes.Sorensen@redhat.com>
>
> The 8723bu also has it's own IQK calibration process. This is similar
> in flow, but still different enough to warrent it's own
> implementation, at least for now.
>
> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
> ---
> drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 811 ++++++++++++++++++++-
> drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 1 +
> .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h | 17 +
> 3 files changed, 827 insertions(+), 2 deletions(-)
>
[...]
> +#ifdef RTL8723BU_BT
> + /* GNT_BT = 1 */
> + rtl8xxxu_write32(priv, REG_BT_CONTROL_8723BU, 0x00001800);
> +#endif
What's this about?
> +#ifdef RTL8723BU_BT
> + /* GNT_BT = 1 */
> + rtl8xxxu_write32(priv, REG_BT_CONTROL_8723BU, 0x00001800);
> +#endif
Same here.
> +#ifdef RTL8723BU_PATH_B
> +static int rtl8723bu_iqk_path_b(struct rtl8xxxu_priv *priv)
And this?
> +#if 0
> + /* Page B init */
> + rtl8xxxu_write32(priv, REG_CONFIG_ANT_A, 0x0f600000);
> +
> + if (priv->tx_paths > 1)
> + rtl8xxxu_write32(priv, REG_CONFIG_ANT_B, 0x0f600000);
> +#endif
Like discussed before, "#if 0" is not really welcomed in upstream. Can't
you just keep the unimplemented parts in a private branch and submit
them once they are ready? That way upstream code is not cluttered with
these.
--
Kalle Valo
^ permalink raw reply [flat|nested] 139+ messages in thread
* Re: [PATCH 042/113] rtl8xxxu: Initial implementation of rtl8723bu_config_channel()
2016-02-29 22:04 ` [PATCH 042/113] rtl8xxxu: Initial implementation of rtl8723bu_config_channel() Jes.Sorensen
@ 2016-03-10 14:26 ` Kalle Valo
2016-03-10 14:52 ` Jes Sorensen
0 siblings, 1 reply; 139+ messages in thread
From: Kalle Valo @ 2016-03-10 14:26 UTC (permalink / raw)
To: Jes.Sorensen; +Cc: linux-wireless, Larry.Finger
Jes.Sorensen@redhat.com writes:
> From: Jes Sorensen <Jes.Sorensen@redhat.com>
>
> This is a first stab of implementing rtl8723bu_config_channel(). For
> now this will only do 20MHz channels.
>
> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
[...]
> +static void rtl8723bu_config_channel(struct ieee80211_hw *hw)
> +{
> + struct rtl8xxxu_priv *priv = hw->priv;
> + u32 val32, rsr;
> + u8 val8, opmode, subchannel;
> + u16 rf_mode_bw;
> + bool ht = true;
> + int sec_ch_above, channel;
> + int i;
> +
> + rf_mode_bw = rtl8xxxu_read16(priv, REG_WMAC_TRXPTCL_CTL);
> + rf_mode_bw &= ~WMAC_TRXPTCL_CTL_BW_MASK;
> + rsr = rtl8xxxu_read32(priv, REG_RESPONSE_RATE_SET);
> + channel = hw->conf.chandef.chan->hw_value;
> +
> +/* Hack */
Indentation.
--
Kalle Valo
^ permalink raw reply [flat|nested] 139+ messages in thread
* Re: [PATCH 054/113] rtl8xxxu: Implement 8723bu power on sequence
2016-02-29 22:04 ` [PATCH 054/113] rtl8xxxu: Implement 8723bu power on sequence Jes.Sorensen
@ 2016-03-10 14:32 ` Kalle Valo
2016-03-10 14:53 ` Jes Sorensen
0 siblings, 1 reply; 139+ messages in thread
From: Kalle Valo @ 2016-03-10 14:32 UTC (permalink / raw)
To: Jes.Sorensen; +Cc: linux-wireless, Larry.Finger
Jes.Sorensen@redhat.com writes:
> From: Jes Sorensen <Jes.Sorensen@redhat.com>
>
> This implements the 8723bu specific power on sequence as it is
> different from that of the 8723au chips.
>
> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
[...]
> @@ -140,7 +144,10 @@
> #define REG_MAC_PINMUX_CFG 0x0043
> #define REG_GPIO_PIN_CTRL 0x0044
> #define REG_GPIO_INTM 0x0048
> +#define GPIO_INTM_EDGE_TRIG_IRQ BIT(9)
> +
> #define REG_LEDCFG0 0x004c
> +#define LEDCFG0_DPDT_SELECT BIT(23)
> #define REG_LEDCFG1 0x004d
> #define REG_LEDCFG2 0x004e
> #define LEDCFG2_DPDT_SELECT BIT(7)
> @@ -154,9 +161,13 @@
> #define REG_GPIO_PIN_CTRL_2 0x0060
> /* RTL8723 WIFI/BT/GPS Multi-Function GPIO Select. */
> #define REG_GPIO_IO_SEL_2 0x0062
> +#define GPIO_IO_SEL_2_GPIO09_INPUT BIT(1)
> +#define GPIO_IO_SEL_2_GPIO09_IRQ BIT(9)
>
> /* RTL8723B */
> #define REG_PAD_CTRL1 0x0064
> +#define PAD_CTRL1_SW_DPDT_SEL_DATA BIT(0)
Why two spaces after define?
--
Kalle Valo
^ permalink raw reply [flat|nested] 139+ messages in thread
* Re: [PATCH 107/113] rtl8xxxu: Use define for REG_PWR_DATA bits
2016-02-29 22:05 ` [PATCH 107/113] rtl8xxxu: Use define for REG_PWR_DATA bits Jes.Sorensen
@ 2016-03-10 14:46 ` Kalle Valo
2016-03-10 14:55 ` Jes Sorensen
0 siblings, 1 reply; 139+ messages in thread
From: Kalle Valo @ 2016-03-10 14:46 UTC (permalink / raw)
To: Jes.Sorensen; +Cc: linux-wireless, Larry.Finger
Jes.Sorensen@redhat.com writes:
> From: Jes Sorensen <Jes.Sorensen@redhat.com>
>
> Use the bit define rather than hard code the value for REG_PWR_DATA bits.
>
> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
[...]
> --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
> +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
> @@ -135,7 +135,7 @@
> #define EFUSE_ACCESS_DISABLE 0x00 /* RTL8723 only */
>
> #define REG_PWR_DATA 0x0038
> -#define PWR_DATA_EEPRPAD_RFE_CTRL_EN BIT(11)
> +#define PWR_DATA_EEPRPAD_RFE_CTRL_EN BIT(11)
Again the two spaces. Is your editor adding them automatically or what?
--
Kalle Valo
^ permalink raw reply [flat|nested] 139+ messages in thread
* Re: [PATCH 037/113] rtl8xxxu: First stab at adding IQK calibration for 8723bu parts
2016-03-10 14:24 ` Kalle Valo
@ 2016-03-10 14:52 ` Jes Sorensen
0 siblings, 0 replies; 139+ messages in thread
From: Jes Sorensen @ 2016-03-10 14:52 UTC (permalink / raw)
To: Kalle Valo; +Cc: linux-wireless, Larry.Finger
Kalle Valo <kvalo@codeaurora.org> writes:
> Jes.Sorensen@redhat.com writes:
>
>> From: Jes Sorensen <Jes.Sorensen@redhat.com>
>>
>> The 8723bu also has it's own IQK calibration process. This is similar
>> in flow, but still different enough to warrent it's own
>> implementation, at least for now.
>>
>> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
>> ---
>> drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 811
>> ++++++++++++++++++++-
>> drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 1 +
>> .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h | 17 +
>> 3 files changed, 827 insertions(+), 2 deletions(-)
>>
>
> [...]
>
>> +#ifdef RTL8723BU_BT
>> + /* GNT_BT = 1 */
>> + rtl8xxxu_write32(priv, REG_BT_CONTROL_8723BU, 0x00001800);
>> +#endif
>
> What's this about?
>
>> +#ifdef RTL8723BU_BT
>> + /* GNT_BT = 1 */
>> + rtl8xxxu_write32(priv, REG_BT_CONTROL_8723BU, 0x00001800);
>> +#endif
>
> Same here.
>
>> +#ifdef RTL8723BU_PATH_B
>> +static int rtl8723bu_iqk_path_b(struct rtl8xxxu_priv *priv)
>
> And this?
>
>> +#if 0
>> + /* Page B init */
>> + rtl8xxxu_write32(priv, REG_CONFIG_ANT_A, 0x0f600000);
>> +
>> + if (priv->tx_paths > 1)
>> + rtl8xxxu_write32(priv, REG_CONFIG_ANT_B, 0x0f600000);
>> +#endif
>
> Like discussed before, "#if 0" is not really welcomed in upstream. Can't
> you just keep the unimplemented parts in a private branch and submit
> them once they are ready? That way upstream code is not cluttered with
> these.
This is removed in a follow-on patch, so it becomes a non-issue.
Rebasing this to remove it retroactively would create a mess.
Jes
^ permalink raw reply [flat|nested] 139+ messages in thread
* Re: [PATCH 042/113] rtl8xxxu: Initial implementation of rtl8723bu_config_channel()
2016-03-10 14:26 ` Kalle Valo
@ 2016-03-10 14:52 ` Jes Sorensen
0 siblings, 0 replies; 139+ messages in thread
From: Jes Sorensen @ 2016-03-10 14:52 UTC (permalink / raw)
To: Kalle Valo; +Cc: linux-wireless, Larry.Finger
Kalle Valo <kvalo@codeaurora.org> writes:
> Jes.Sorensen@redhat.com writes:
>
>> From: Jes Sorensen <Jes.Sorensen@redhat.com>
>>
>> This is a first stab of implementing rtl8723bu_config_channel(). For
>> now this will only do 20MHz channels.
>>
>> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
>
> [...]
>
>> +static void rtl8723bu_config_channel(struct ieee80211_hw *hw)
>> +{
>> + struct rtl8xxxu_priv *priv = hw->priv;
>> + u32 val32, rsr;
>> + u8 val8, opmode, subchannel;
>> + u16 rf_mode_bw;
>> + bool ht = true;
>> + int sec_ch_above, channel;
>> + int i;
>> +
>> + rf_mode_bw = rtl8xxxu_read16(priv, REG_WMAC_TRXPTCL_CTL);
>> + rf_mode_bw &= ~WMAC_TRXPTCL_CTL_BW_MASK;
>> + rsr = rtl8xxxu_read32(priv, REG_RESPONSE_RATE_SET);
>> + channel = hw->conf.chandef.chan->hw_value;
>> +
>> +/* Hack */
>
> Indentation.
I can send you a v2 of this with it indented.
Jes
^ permalink raw reply [flat|nested] 139+ messages in thread
* Re: [PATCH 054/113] rtl8xxxu: Implement 8723bu power on sequence
2016-03-10 14:32 ` Kalle Valo
@ 2016-03-10 14:53 ` Jes Sorensen
0 siblings, 0 replies; 139+ messages in thread
From: Jes Sorensen @ 2016-03-10 14:53 UTC (permalink / raw)
To: Kalle Valo; +Cc: linux-wireless, Larry.Finger
Kalle Valo <kvalo@codeaurora.org> writes:
> Jes.Sorensen@redhat.com writes:
>
>> From: Jes Sorensen <Jes.Sorensen@redhat.com>
>>
>> This implements the 8723bu specific power on sequence as it is
>> different from that of the 8723au chips.
>>
>> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
>
> [...]
>
>> @@ -140,7 +144,10 @@
>> #define REG_MAC_PINMUX_CFG 0x0043
>> #define REG_GPIO_PIN_CTRL 0x0044
>> #define REG_GPIO_INTM 0x0048
>> +#define GPIO_INTM_EDGE_TRIG_IRQ BIT(9)
>> +
>> #define REG_LEDCFG0 0x004c
>> +#define LEDCFG0_DPDT_SELECT BIT(23)
>> #define REG_LEDCFG1 0x004d
>> #define REG_LEDCFG2 0x004e
>> #define LEDCFG2_DPDT_SELECT BIT(7)
>> @@ -154,9 +161,13 @@
>> #define REG_GPIO_PIN_CTRL_2 0x0060
>> /* RTL8723 WIFI/BT/GPS Multi-Function GPIO Select. */
>> #define REG_GPIO_IO_SEL_2 0x0062
>> +#define GPIO_IO_SEL_2_GPIO09_INPUT BIT(1)
>> +#define GPIO_IO_SEL_2_GPIO09_IRQ BIT(9)
>>
>> /* RTL8723B */
>> #define REG_PAD_CTRL1 0x0064
>> +#define PAD_CTRL1_SW_DPDT_SEL_DATA BIT(0)
>
> Why two spaces after define?
I use two spaces for bit defines, so it refers to the register
above. It's consistent throughout the code.
Jes
^ permalink raw reply [flat|nested] 139+ messages in thread
* Re: [PATCH 107/113] rtl8xxxu: Use define for REG_PWR_DATA bits
2016-03-10 14:46 ` Kalle Valo
@ 2016-03-10 14:55 ` Jes Sorensen
0 siblings, 0 replies; 139+ messages in thread
From: Jes Sorensen @ 2016-03-10 14:55 UTC (permalink / raw)
To: Kalle Valo; +Cc: linux-wireless, Larry.Finger
Kalle Valo <kvalo@codeaurora.org> writes:
> Jes.Sorensen@redhat.com writes:
>
>> From: Jes Sorensen <Jes.Sorensen@redhat.com>
>>
>> Use the bit define rather than hard code the value for REG_PWR_DATA bits.
>>
>> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
>
> [...]
>
>> --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
>> +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h
>> @@ -135,7 +135,7 @@
>> #define EFUSE_ACCESS_DISABLE 0x00 /* RTL8723 only */
>>
>> #define REG_PWR_DATA 0x0038
>> -#define PWR_DATA_EEPRPAD_RFE_CTRL_EN BIT(11)
>> +#define PWR_DATA_EEPRPAD_RFE_CTRL_EN BIT(11)
>
> Again the two spaces. Is your editor adding them automatically or what?
As in the previous email, this is for bit defines, matching the
register. The above just made it consistent with the rest of the code.
Jes
^ permalink raw reply [flat|nested] 139+ messages in thread
* Re: [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
` (112 preceding siblings ...)
2016-02-29 22:05 ` [PATCH 113/113] rtl8xxxu: Temporarily disable 8192eu device init Jes.Sorensen
@ 2016-03-11 12:37 ` Kalle Valo
2016-03-11 19:46 ` Jes Sorensen
113 siblings, 1 reply; 139+ messages in thread
From: Kalle Valo @ 2016-03-11 12:37 UTC (permalink / raw)
To: Jes.Sorensen; +Cc: linux-wireless, Larry.Finger
Jes.Sorensen@redhat.com writes:
> This is a rather large set of patches adding support for rtl8723bu
> devices, as well as containing some code for rtl8192eu devices.
>
> I started working on 8192eu support at the beginning but later
> switched over and completed 8723bu support, before finally completing
> 8192eu support. The two new devices share a lot of new features not
> found in the older generation parts (8723au/8188cu/8192cu/8188ru).
>
> I am holding back the 8192eu support for now, in order to reduce the
> size of the patch set (I have another 60 patches that goes on top of
> this set with 8192eu support and additional bug fixes). Given that
> support for the two devices is intermingled, trying to disentangle it
> is pretty much impossible at this point, and risks breaking the code.
>
> This applies on top of wireless-drivers-next as of today 2016-02-29.
First of all, a huge patchset like this automatically goes to the bottom
of my queue. 113 patches is wrong in so many levels, it makes review
really hard, making changes in patches is difficult and whatnot. I think
that 10-15 patches per set is optimal, please try to follow that. Don't
sit on the patches for too long, send them as fast as you can. "Release
early, release often"
I have applied this to wireless-drivers-next, this time, but in the
future please keep the patch count in reasonable levels. The merge
window is getting closer so I'm not sure if these make it to 4.6 but I
would guess I can still squeeze them in.
--
Kalle Valo
^ permalink raw reply [flat|nested] 139+ messages in thread
* Re: [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu
2016-03-11 12:37 ` [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Kalle Valo
@ 2016-03-11 19:46 ` Jes Sorensen
0 siblings, 0 replies; 139+ messages in thread
From: Jes Sorensen @ 2016-03-11 19:46 UTC (permalink / raw)
To: Kalle Valo; +Cc: linux-wireless, Larry.Finger
Kalle Valo <kvalo@codeaurora.org> writes:
> Jes.Sorensen@redhat.com writes:
>
>> This is a rather large set of patches adding support for rtl8723bu
>> devices, as well as containing some code for rtl8192eu devices.
>>
>> I started working on 8192eu support at the beginning but later
>> switched over and completed 8723bu support, before finally completing
>> 8192eu support. The two new devices share a lot of new features not
>> found in the older generation parts (8723au/8188cu/8192cu/8188ru).
>>
>> I am holding back the 8192eu support for now, in order to reduce the
>> size of the patch set (I have another 60 patches that goes on top of
>> this set with 8192eu support and additional bug fixes). Given that
>> support for the two devices is intermingled, trying to disentangle it
>> is pretty much impossible at this point, and risks breaking the code.
>>
>> This applies on top of wireless-drivers-next as of today 2016-02-29.
>
> First of all, a huge patchset like this automatically goes to the bottom
> of my queue. 113 patches is wrong in so many levels, it makes review
> really hard, making changes in patches is difficult and whatnot. I think
> that 10-15 patches per set is optimal, please try to follow that. Don't
> sit on the patches for too long, send them as fast as you can. "Release
> early, release often"
>
> I have applied this to wireless-drivers-next, this time, but in the
> future please keep the patch count in reasonable levels. The merge
> window is getting closer so I'm not sure if these make it to 4.6 but I
> would guess I can still squeeze them in.
Thanks!
The follow-on sets will be smaller, especially as the base
infrastructure is now in which covers the gen2 chips.
Cheers,
Jes
^ permalink raw reply [flat|nested] 139+ messages in thread
end of thread, other threads:[~2016-03-11 19:46 UTC | newest]
Thread overview: 139+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-29 22:03 [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Jes.Sorensen
2016-02-29 22:03 ` [PATCH 001/113] rtl8xxxu: Add initial code to parse rtl8192eu efuse Jes.Sorensen
2016-02-29 22:04 ` [PATCH 002/113] rtl8xxxu: Identify chip vendors correctly Jes.Sorensen
2016-02-29 22:04 ` [PATCH 003/113] rtl8xxxu: Use 1024 byte block loads for 8192eu firmware Jes.Sorensen
2016-02-29 22:04 ` [PATCH 004/113] rtl8xxxu: Add rtl8192eu_nic.bin to the MODULE_FIRMWARE list Jes.Sorensen
2016-02-29 22:04 ` [PATCH 005/113] rtl8xxxu: Implment rtl8192eu_power_on() Jes.Sorensen
2016-02-29 22:04 ` [PATCH 006/113] rtl8xxxu: Add rtl8xxxu_auto_llt_table() Jes.Sorensen
2016-02-29 22:04 ` [PATCH 007/113] rtl8xxxu: Init page boundaries before starting the firmware Jes.Sorensen
2016-02-29 22:04 ` [PATCH 008/113] rtl8xxxu: Init the LLT after we start " Jes.Sorensen
2016-02-29 22:04 ` [PATCH 009/113] rtl8xxxu: Fix incorrect test for auto LLT failure Jes.Sorensen
2016-02-29 22:04 ` [PATCH 010/113] rtl8xxxu: Kludge to drop incorrect USB OUT EP for 8192EU Jes.Sorensen
2016-02-29 22:04 ` [PATCH 011/113] rtl8xxxu: Init REG_HIMR[01] for 8192eu parts Jes.Sorensen
2016-02-29 22:04 ` [PATCH 012/113] rtl8xxxu: Initial rtl8723bu chip identification Jes.Sorensen
2016-02-29 22:04 ` [PATCH 013/113] rtl8xxxu: Add rtl8723bu_parse_efuse() and 8723bu efuse definition Jes.Sorensen
2016-02-29 22:04 ` [PATCH 014/113] rtl8xxxu: Use 1024 byte writes for writing 8723bu firmware Jes.Sorensen
2016-02-29 22:04 ` [PATCH 015/113] rtl8xxxu: Only setup USB interrupts for parts which support it Jes.Sorensen
2016-02-29 22:04 ` [PATCH 016/113] rtl8xxxu: Add rtl8723b_phy_1t_init_table Jes.Sorensen
2016-02-29 22:04 ` [PATCH 017/113] rtl8xxxu: Add rtl8723bu_radioa_1t_init_table Jes.Sorensen
2016-02-29 22:04 ` [PATCH 018/113] rtl8xxxu: Add rtl8723bu_phy_init_antenna_selection() Jes.Sorensen
2016-02-29 22:04 ` [PATCH 019/113] rtl8xxxu: Add rtl8723b_mac_init_table Jes.Sorensen
2016-02-29 22:04 ` [PATCH 020/113] rtl8xxxu: Add 8723by AGC table Jes.Sorensen
2016-02-29 22:04 ` [PATCH 021/113] rtl8xxxu: Handle 32 bit mailbox extension regs found on 8723bu/8192eu/8812 Jes.Sorensen
2016-02-29 22:04 ` [PATCH 022/113] rtl8xxxu: Add some missing register definitions for 8723bu Jes.Sorensen
2016-02-29 22:04 ` [PATCH 023/113] rtl8xxxu: Group USB fixups together for all chips Jes.Sorensen
2016-02-29 22:04 ` [PATCH 024/113] rtl8xxxu: Add definitions for new generation h2c commands Jes.Sorensen
2016-02-29 22:04 ` [PATCH 025/113] rtl8xxxu: Don't check for illegal offset when reading from efuse Jes.Sorensen
2016-02-29 22:04 ` [PATCH 026/113] rtl8xxxu: Skip disabled efuse words early Jes.Sorensen
2016-02-29 22:04 ` [PATCH 027/113] rtl8xxxu: rtl8723au: Introduce a pointer to efuse Jes.Sorensen
2016-02-29 22:04 ` [PATCH 028/113] rtl8xxxu: rtl8192cu: " Jes.Sorensen
2016-02-29 22:04 ` [PATCH 029/113] rtl8xxxu: rtl8192eu_parse_efuse(): Use a pointer to the struct rtl8192eu_efuse Jes.Sorensen
2016-02-29 22:04 ` [PATCH 030/113] rtl8xxxu: rtl8723bu_parse_efuse(): Use a pointer to the struct rtl8723bu_efuse Jes.Sorensen
2016-02-29 22:04 ` [PATCH 031/113] rtl8xxxu: rtl8xxxu_h2c_cmd(): Add size argument Jes.Sorensen
2016-02-29 22:04 ` [PATCH 032/113] rtl8xxxu: Do BT_WLAN_CALIBRATION before doing IQK calibration Jes.Sorensen
2016-02-29 22:04 ` [PATCH 033/113] rtl8xxxu: Do not overwrite rtl8xxxu_debug for untested chips Jes.Sorensen
2016-02-29 22:04 ` [PATCH 034/113] rtl8xxxu: Use correct formatting type to print sizeof() Jes.Sorensen
2016-02-29 22:04 ` [PATCH 035/113] rtl8xxxu: Make rtl8xxxu_add_path_on() use device specific init values Jes.Sorensen
2016-02-29 22:04 ` [PATCH 036/113] rtl8xxxu: Add a couple of new register definitions Jes.Sorensen
2016-02-29 22:04 ` [PATCH 037/113] rtl8xxxu: First stab at adding IQK calibration for 8723bu parts Jes.Sorensen
2016-03-10 14:24 ` Kalle Valo
2016-03-10 14:52 ` Jes Sorensen
2016-02-29 22:04 ` [PATCH 038/113] rtl8xxxu: Handle S0S1 register in lc_calibrate() Jes.Sorensen
2016-02-29 22:04 ` [PATCH 039/113] rtl8xxxu: Do LC calibration before IQK calibration Jes.Sorensen
2016-02-29 22:04 ` [PATCH 040/113] rtl8xxxu: Remove backing up certain registers, which was never used Jes.Sorensen
2016-02-29 22:04 ` [PATCH 041/113] rtl8xxxu: rtl8192eu: Map out EFUSE TX power area Jes.Sorensen
2016-02-29 22:04 ` [PATCH 042/113] rtl8xxxu: Initial implementation of rtl8723bu_config_channel() Jes.Sorensen
2016-03-10 14:26 ` Kalle Valo
2016-03-10 14:52 ` Jes Sorensen
2016-02-29 22:04 ` [PATCH 043/113] rtl8xxxu: Initial rtl8723bu_init_bt() code Jes.Sorensen
2016-02-29 22:04 ` [PATCH 044/113] rtl8xxxu: Remove unused variable Jes.Sorensen
2016-02-29 22:04 ` [PATCH 045/113] rtl8xxxu: Improve 8723bu init code Jes.Sorensen
2016-02-29 22:04 ` [PATCH 046/113] rtl8xxxu: Do not ignore wlan activity on 8723bu Jes.Sorensen
2016-02-29 22:04 ` [PATCH 047/113] rtl8xxxu: Set the right type for ps tdma " Jes.Sorensen
2016-02-29 22:04 ` [PATCH 048/113] rtl8xxxu: Add rtl8723bu (nextgen) rx descriptor definition Jes.Sorensen
2016-02-29 22:04 ` [PATCH 049/113] rtl8xxxu: Handle 8723bu style rx descriptors Jes.Sorensen
2016-02-29 22:04 ` [PATCH 050/113] rtl8xxxu: Initial functionality to handle C2H events for 8723bu Jes.Sorensen
2016-02-29 22:04 ` [PATCH 051/113] rtl8xxxu: Handle BT register writes and MP_OPER events Jes.Sorensen
2016-02-29 22:04 ` [PATCH 052/113] rtl8xxxu: Issue BT_INFO command Jes.Sorensen
2016-02-29 22:04 ` [PATCH 053/113] rtl8xxxu: Do not set REG_AFE_XTAL_CTRL on 8723bu Jes.Sorensen
2016-02-29 22:04 ` [PATCH 054/113] rtl8xxxu: Implement 8723bu power on sequence Jes.Sorensen
2016-03-10 14:32 ` Kalle Valo
2016-03-10 14:53 ` Jes Sorensen
2016-02-29 22:04 ` [PATCH 055/113] rtl8xxxu: Setup LLT before downloading firmware Jes.Sorensen
2016-02-29 22:04 ` [PATCH 056/113] rtl8xxxu: Additional fixes for 8723bu Jes.Sorensen
2016-02-29 22:04 ` [PATCH 057/113] rtl8xxxu: Handle XTAL_K value in efuse specific location Jes.Sorensen
2016-02-29 22:04 ` [PATCH 058/113] rtl8xxxu: Another 8723bu patch for rtl8xxxu_init_phy_bb() Jes.Sorensen
2016-02-29 22:04 ` [PATCH 059/113] rtl8xxxu: Another 8723bu magic register set during init Jes.Sorensen
2016-02-29 22:04 ` [PATCH 060/113] rtl8xxxu: Init H2C command register for 8723bu Jes.Sorensen
2016-02-29 22:04 ` [PATCH 061/113] rtl8xxxu: 80M spur hack is for 8723au only Jes.Sorensen
2016-02-29 22:05 ` [PATCH 062/113] rtl8xxxu: Do queue init in same order as 8723bu vendor driver Jes.Sorensen
2016-02-29 22:05 ` [PATCH 063/113] rtl8xxxu: Do not set FPGA0_TX_INFO for 8723bu and use a larger PBP page size Jes.Sorensen
2016-02-29 22:05 ` [PATCH 064/113] rtl8xxxu: Set RX boundary for 8723bu Jes.Sorensen
2016-02-29 23:11 ` Julian Calaby
2016-02-29 23:47 ` Jes Sorensen
2016-02-29 22:05 ` [PATCH 065/113] rtl8xxxu: Initialize burst parameters " Jes.Sorensen
2016-02-29 22:05 ` [PATCH 066/113] rtl8xxxu: Call device specific _config_channel() Jes.Sorensen
2016-02-29 23:12 ` Julian Calaby
2016-02-29 23:48 ` Jes Sorensen
2016-02-29 23:50 ` Julian Calaby
2016-02-29 23:58 ` Jes Sorensen
2016-02-29 22:05 ` [PATCH 067/113] rtl8xxxu: 8723bu lock phy after RF init Jes.Sorensen
2016-02-29 22:05 ` [PATCH 068/113] rtl8xxxu: Add REG_DWBCN1_CTRL_8723B define Jes.Sorensen
2016-02-29 22:05 ` [PATCH 069/113] rtl8xxxu: Group chip quirks together Jes.Sorensen
2016-02-29 22:05 ` [PATCH 070/113] rtl8xxxu: Setup RX aggregation Jes.Sorensen
2016-02-29 22:05 ` [PATCH 071/113] rtl8xxxu: Add missing blank space in front of bracket Jes.Sorensen
2016-02-29 22:05 ` [PATCH 072/113] rtl8xxxu: Implement init_statistics for 8723bu Jes.Sorensen
2016-02-29 22:05 ` [PATCH 073/113] rtl8xxxu: RF_T_METER is different on the newer chips Jes.Sorensen
2016-02-29 22:05 ` [PATCH 074/113] rtl8xxxu: Set WLAN_ACT_CONTROL per vendor driver setting Jes.Sorensen
2016-02-29 22:05 ` [PATCH 075/113] rtl8xxxu: 8723bu: REG_BT_COEX_TABLE4 is only 8 bits Jes.Sorensen
2016-02-29 22:05 ` [PATCH 076/113] rtl8xxxu: Use name for REG_RFE_BUFFER rather than hard coded value Jes.Sorensen
2016-02-29 22:05 ` [PATCH 077/113] rtl8xxxu: Use REG_RFE_CTRL_ANTA_SRC " Jes.Sorensen
2016-02-29 22:05 ` [PATCH 078/113] rtl8xxxu: Setup coex table correctly (hopefully) Jes.Sorensen
2016-02-29 22:05 ` [PATCH 079/113] rtl8xxxu: Do not use hard-wired RF enable settings for 8723bu Jes.Sorensen
2016-02-29 22:05 ` [PATCH 080/113] rtl8xxxu: Correct struct rtl8723bu_efuse to list power bases correctly Jes.Sorensen
2016-02-29 22:05 ` [PATCH 081/113] rtl8xxxu: Introduce set_tx_power() fileop and a new 8723b dummy derivative Jes.Sorensen
2016-02-29 22:05 ` [PATCH 082/113] rtl8xxxu: Use size of source pointer when copying efuse data Jes.Sorensen
2016-02-29 22:05 ` [PATCH 083/113] rtl8xxxu: Bump TX power arrays to handle larger channel groups Jes.Sorensen
2016-02-29 22:05 ` [PATCH 084/113] rtl8xxxu: Parse efuse power indices for 8723bu Jes.Sorensen
2016-02-29 22:05 ` [PATCH 085/113] rtl8xxxu: Set 8723bu TX power for CCK and OFDM rates Jes.Sorensen
2016-02-29 22:05 ` [PATCH 086/113] rtl8xxxu: Set 8723bu MCS TX power Jes.Sorensen
2016-02-29 22:05 ` [PATCH 087/113] rtl8xxxu: Set the correct thermal meter register for 8723bu Jes.Sorensen
2016-02-29 22:05 ` [PATCH 088/113] rtl8xxxu: Add definition for 8723bu tx descriptor Jes.Sorensen
2016-02-29 22:05 ` [PATCH 089/113] rtl8xxxu: Handle 40 byte TX descriptors for rtl8723bu Jes.Sorensen
2016-02-29 22:05 ` [PATCH 090/113] rtl8xxxu: Do not unconditionally print debug info in rtl8723bu_handle_c2h() Jes.Sorensen
2016-02-29 22:05 ` [PATCH 091/113] rtl8xxxu: Add additional tx descriptor bits for data word 0 Jes.Sorensen
2016-02-29 22:05 ` [PATCH 092/113] rtl8xxxu: Add more 40 byte TX desc bit definitions Jes.Sorensen
2016-02-29 22:05 ` [PATCH 093/113] rtl8xxxu: Set the correct TX descriptor bits for agg and break on 8723b Jes.Sorensen
2016-02-29 22:05 ` [PATCH 094/113] rtl8xxxu: Set sequence number correctly for 40 byte TX descriptors Jes.Sorensen
2016-02-29 22:05 ` [PATCH 095/113] rtl8723au: Update TX descriptor words 4 and 5 definitions Jes.Sorensen
2016-02-29 22:05 ` [PATCH 096/113] rtl8xxxu: TX RTS rate is word 4 for 8723a Jes.Sorensen
2016-02-29 22:05 ` [PATCH 097/113] rtl8xxxu: Improve handling of txdesc32 vs txdesc40 handling Jes.Sorensen
2016-02-29 22:05 ` [PATCH 098/113] rtl8xxxu: Do not parse RX descriptor info for C2H packets Jes.Sorensen
2016-02-29 22:05 ` [PATCH 099/113] rtl8xxxu: Define 8723b H2C ramask command structure Jes.Sorensen
2016-02-29 22:05 ` [PATCH 100/113] rtl8xxxu: Implement basic 8723b specific update_rate_mask() function Jes.Sorensen
2016-02-29 22:05 ` [PATCH 101/113] rtl8xxxu: Report media status using the correct H2C command for 8723bu Jes.Sorensen
2016-02-29 22:05 ` [PATCH 102/113] rtl8xxxu: Dump contents of unhandled C2H events Jes.Sorensen
2016-02-29 22:05 ` [PATCH 103/113] rtl8xxxu: Process C2H RA_REPORT events for 8723bu Jes.Sorensen
2016-02-29 22:05 ` [PATCH 104/113] rtl8xxxu: Pass RX rate to rx_parse_phystats and enable phystats for rtl8723bu Jes.Sorensen
2016-02-29 22:05 ` [PATCH 105/113] rtl8xxxu: Remove unncessary semicolon Jes.Sorensen
2016-02-29 22:05 ` [PATCH 106/113] rtl8xxxu: convert rtl8723bu_init_bt() into rtl8723b_enable_rf() Jes.Sorensen
2016-02-29 23:46 ` Julian Calaby
2016-02-29 23:51 ` Jes Sorensen
2016-03-01 0:04 ` Julian Calaby
2016-03-01 0:15 ` Jes Sorensen
2016-03-01 0:32 ` Julian Calaby
2016-03-01 1:30 ` Jes Sorensen
2016-03-01 1:47 ` Julian Calaby
2016-02-29 22:05 ` [PATCH 107/113] rtl8xxxu: Use define for REG_PWR_DATA bits Jes.Sorensen
2016-03-10 14:46 ` Kalle Valo
2016-03-10 14:55 ` Jes Sorensen
2016-02-29 22:05 ` [PATCH 108/113] rtl8xxxu: Implement 8723bu specific disable_rf() function Jes.Sorensen
2016-02-29 22:05 ` [PATCH 109/113] rtl8xxxu: Implement device specific power_off function Jes.Sorensen
2016-02-29 22:05 ` [PATCH 110/113] rtl8xxxu: Flush FIFO before powering down devices Jes.Sorensen
2016-02-29 22:05 ` [PATCH 111/113] rtl8xxxu: Print a warning if flushing the FIFO fails Jes.Sorensen
2016-02-29 23:48 ` Julian Calaby
2016-02-29 23:52 ` Jes Sorensen
2016-02-29 22:05 ` [PATCH 112/113] rtl8xxxu: Use correct 8051 reset function for 8723b parts Jes.Sorensen
2016-02-29 22:05 ` [PATCH 113/113] rtl8xxxu: Temporarily disable 8192eu device init Jes.Sorensen
2016-03-11 12:37 ` [PATCH 000/113] rtl8xxxu: Add support for rtl8723bu Kalle Valo
2016-03-11 19:46 ` Jes Sorensen
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).