diff options
Diffstat (limited to 'drivers/net/wireless/realtek/rtlwifi/rtl8821ae')
-rw-r--r-- | drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.c | 165 | ||||
-rw-r--r-- | drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c | 8 | ||||
-rw-r--r-- | drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c | 507 | ||||
-rw-r--r-- | drivers/net/wireless/realtek/rtlwifi/rtl8821ae/reg.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/realtek/rtlwifi/rtl8821ae/sw.c | 15 | ||||
-rw-r--r-- | drivers/net/wireless/realtek/rtlwifi/rtl8821ae/table.c | 1358 | ||||
-rw-r--r-- | drivers/net/wireless/realtek/rtlwifi/rtl8821ae/table.h | 28 | ||||
-rw-r--r-- | drivers/net/wireless/realtek/rtlwifi/rtl8821ae/trx.c | 12 |
9 files changed, 749 insertions, 1347 deletions
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.c index a504dfae4ed3..73350103b736 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.c +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.c @@ -678,12 +678,13 @@ void rtl8821ae_set_fw_global_info_cmd(struct ieee80211_hw *hw) #define PSPOLL_PG 1 #define NULL_PG 2 #define QOSNULL_PG 3 -#define ARPRESP_PG 4 -#define REMOTE_PG 5 -#define GTKEXT_PG 6 +#define BT_QOSNULL_PG 4 +#define ARPRESP_PG 5 +#define REMOTE_PG 6 +#define GTKEXT_PG 7 -#define TOTAL_RESERVED_PKT_LEN_8812 3584 -#define TOTAL_RESERVED_PKT_LEN_8821 1792 +#define TOTAL_RESERVED_PKT_LEN_8812 4096 +#define TOTAL_RESERVED_PKT_LEN_8821 2048 static u8 reserved_page_packet_8821[TOTAL_RESERVED_PKT_LEN_8821] = { /* page 0: beacon */ @@ -813,13 +814,46 @@ static u8 reserved_page_packet_8821[TOTAL_RESERVED_PKT_LEN_8821] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x1A, 0x00, 0x28, 0x8C, 0x00, 0x12, 0x00, 0x00, + 0x00, 0x00, 0x80, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + /* page 4: BT qos null data */ + 0xC8, 0x01, 0x00, 0x00, 0x84, 0xC9, 0xB2, 0xA7, + 0xB3, 0x6E, 0x00, 0xE0, 0x4C, 0x02, 0x51, 0x02, + 0x84, 0xC9, 0xB2, 0xA7, 0xB3, 0x6E, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x00, 0x28, 0x8C, 0x00, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - /* page 4~6 is for wowlan */ - /* page 4: ARP resp */ + /* page 5~7 is for wowlan */ + /* page 5: ARP resp */ 0x08, 0x01, 0x00, 0x00, 0x84, 0xC9, 0xB2, 0xA7, 0xB3, 0x6E, 0x00, 0xE0, 0x4C, 0x02, 0x51, 0x02, 0x84, 0xC9, 0xB2, 0xA7, 0xB3, 0x6E, 0x00, 0x00, @@ -852,7 +886,7 @@ static u8 reserved_page_packet_8821[TOTAL_RESERVED_PKT_LEN_8821] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - /* page 5: H2C_REMOTE_WAKE_CTRL_INFO */ + /* page 6: H2C_REMOTE_WAKE_CTRL_INFO */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -885,7 +919,7 @@ static u8 reserved_page_packet_8821[TOTAL_RESERVED_PKT_LEN_8821] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - /* page 6: Rsvd GTK extend memory (zero memory) */ + /* page 7: Rsvd GTK extend memory (zero memory) */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -1176,13 +1210,78 @@ static u8 reserved_page_packet_8812[TOTAL_RESERVED_PKT_LEN_8812] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x1A, 0x00, 0x28, 0x8C, 0x00, 0x12, 0x00, 0x00, + 0x00, 0x00, 0x80, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + /* page 4: BT Qos null data */ + 0xC8, 0x01, 0x00, 0x00, 0x84, 0xC9, 0xB2, 0xA7, + 0xB3, 0x6E, 0x00, 0xE0, 0x4C, 0x02, 0x51, 0x02, + 0x84, 0xC9, 0xB2, 0xA7, 0xB3, 0x6E, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x00, 0x28, 0x8C, 0x00, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - /* page 4~6 is for wowlan */ - /* page 4: ARP resp */ + /* page 5~7 is for wowlan */ + /* page 5: ARP resp */ 0x08, 0x01, 0x00, 0x00, 0x84, 0xC9, 0xB2, 0xA7, 0xB3, 0x6E, 0x00, 0xE0, 0x4C, 0x02, 0x51, 0x02, 0x84, 0xC9, 0xB2, 0xA7, 0xB3, 0x6E, 0x00, 0x00, @@ -1247,7 +1346,7 @@ static u8 reserved_page_packet_8812[TOTAL_RESERVED_PKT_LEN_8812] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - /* page 5: H2C_REMOTE_WAKE_CTRL_INFO */ + /* page 6: H2C_REMOTE_WAKE_CTRL_INFO */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -1312,7 +1411,7 @@ static u8 reserved_page_packet_8812[TOTAL_RESERVED_PKT_LEN_8812] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - /* page 6: Rsvd GTK extend memory (zero memory) */ + /* page 7: Rsvd GTK extend memory (zero memory) */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -1394,6 +1493,7 @@ void rtl8812ae_set_fw_rsvdpagepkt(struct ieee80211_hw *hw, u8 *p_pspoll; u8 *nullfunc; u8 *qosnull; + u8 *btqosnull; u8 *arpresp; /*--------------------------------------------------------- @@ -1441,12 +1541,23 @@ void rtl8812ae_set_fw_rsvdpagepkt(struct ieee80211_hw *hw, SET_H2CCMD_RSVDPAGE_LOC_QOS_NULL_DATA(u1RsvdPageLoc, QOSNULL_PG); + /*--------------------------------------------------------- + * (5) BT Qos null data + *---------------------------------------------------------- + */ + btqosnull = &reserved_page_packet_8812[BT_QOSNULL_PG * 512]; + SET_80211_HDR_ADDRESS1(btqosnull, mac->bssid); + SET_80211_HDR_ADDRESS2(btqosnull, mac->mac_addr); + SET_80211_HDR_ADDRESS3(btqosnull, mac->bssid); + + SET_H2CCMD_RSVDPAGE_LOC_BT_QOS_NULL_DATA(u1RsvdPageLoc, BT_QOSNULL_PG); + if (!dl_whole_packets) { - totalpacketlen = 512 * (QOSNULL_PG + 1) - 40; + totalpacketlen = 512 * (BT_QOSNULL_PG + 1) - 40; goto out; } /*--------------------------------------------------------- - * (5) ARP Resp + * (6) ARP Resp *---------------------------------------------------------- */ arpresp = &reserved_page_packet_8812[ARPRESP_PG * 512]; @@ -1457,14 +1568,14 @@ void rtl8812ae_set_fw_rsvdpagepkt(struct ieee80211_hw *hw, SET_8821AE_H2CCMD_AOAC_RSVDPAGE_LOC_ARP_RSP(u1RsvdPageLoc2, ARPRESP_PG); /*--------------------------------------------------------- - * (6) Remote Wake Ctrl + * (7) Remote Wake Ctrl *---------------------------------------------------------- */ SET_8821AE_H2CCMD_AOAC_RSVDPAGE_LOC_REMOTE_WAKE_CTRL_INFO(u1RsvdPageLoc2, REMOTE_PG); /*--------------------------------------------------------- - * (7) GTK Ext Memory + * (8) GTK Ext Memory *---------------------------------------------------------- */ SET_8821AE_H2CCMD_AOAC_RSVDPAGE_LOC_GTK_EXT_MEM(u1RsvdPageLoc2, GTKEXT_PG); @@ -1518,6 +1629,7 @@ void rtl8821ae_set_fw_rsvdpagepkt(struct ieee80211_hw *hw, u8 *p_pspoll; u8 *nullfunc; u8 *qosnull; + u8 *btqosnull; u8 *arpresp; /*--------------------------------------------------------- @@ -1565,12 +1677,23 @@ void rtl8821ae_set_fw_rsvdpagepkt(struct ieee80211_hw *hw, SET_H2CCMD_RSVDPAGE_LOC_QOS_NULL_DATA(u1RsvdPageLoc, QOSNULL_PG); + /*--------------------------------------------------------- + * (5) Qos null data + *---------------------------------------------------------- + */ + btqosnull = &reserved_page_packet_8821[BT_QOSNULL_PG * 256]; + SET_80211_HDR_ADDRESS1(btqosnull, mac->bssid); + SET_80211_HDR_ADDRESS2(btqosnull, mac->mac_addr); + SET_80211_HDR_ADDRESS3(btqosnull, mac->bssid); + + SET_H2CCMD_RSVDPAGE_LOC_BT_QOS_NULL_DATA(u1RsvdPageLoc, BT_QOSNULL_PG); + if (!dl_whole_packets) { - totalpacketlen = 256 * (QOSNULL_PG + 1) - 40; + totalpacketlen = 256 * (BT_QOSNULL_PG + 1) - 40; goto out; } /*--------------------------------------------------------- - * (5) ARP Resp + * (6) ARP Resp *---------------------------------------------------------- */ arpresp = &reserved_page_packet_8821[ARPRESP_PG * 256]; @@ -1581,14 +1704,14 @@ void rtl8821ae_set_fw_rsvdpagepkt(struct ieee80211_hw *hw, SET_8821AE_H2CCMD_AOAC_RSVDPAGE_LOC_ARP_RSP(u1RsvdPageLoc2, ARPRESP_PG); /*--------------------------------------------------------- - * (6) Remote Wake Ctrl + * (7) Remote Wake Ctrl *---------------------------------------------------------- */ SET_8821AE_H2CCMD_AOAC_RSVDPAGE_LOC_REMOTE_WAKE_CTRL_INFO(u1RsvdPageLoc2, REMOTE_PG); /*--------------------------------------------------------- - * (7) GTK Ext Memory + * (8) GTK Ext Memory *---------------------------------------------------------- */ SET_8821AE_H2CCMD_AOAC_RSVDPAGE_LOC_GTK_EXT_MEM(u1RsvdPageLoc2, GTKEXT_PG); diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.h b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.h index 90a98ed879f7..98d871afd92a 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.h +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.h @@ -229,6 +229,8 @@ enum rtl8821a_h2c_cmd { SET_BITS_TO_LE_1BYTE((__ph2ccmd)+2, 0, 8, __val) #define SET_H2CCMD_RSVDPAGE_LOC_QOS_NULL_DATA(__ph2ccmd, __val) \ SET_BITS_TO_LE_1BYTE((__ph2ccmd)+3, 0, 8, __val) +#define SET_H2CCMD_RSVDPAGE_LOC_BT_QOS_NULL_DATA(__ph2ccmd, __val) \ + SET_BITS_TO_LE_1BYTE((__ph2ccmd) + 4, 0, 8, __val) /* _MEDIA_STATUS_RPT_PARM_CMD1 */ #define SET_H2CCMD_MSRRPT_PARM_OPMODE(__cmd, __value) \ diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c index 363d2f28da1f..3571ce4bd276 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c @@ -842,12 +842,8 @@ static bool _rtl8821ae_llt_table_init(struct ieee80211_hw *hw) bool status; maxpage = 255; - txpktbuf_bndy = 0xF8; - rqpn = 0x80e70808; - if (rtlpriv->rtlhal.hw_type == HARDWARE_TYPE_RTL8812AE) { - txpktbuf_bndy = 0xFA; - rqpn = 0x80e90808; - } + txpktbuf_bndy = 0xF7; + rqpn = 0x80e60808; rtl_write_byte(rtlpriv, REG_TRXFF_BNDY, txpktbuf_bndy); rtl_write_word(rtlpriv, REG_TRXFF_BNDY + 2, MAX_RX_DMA_BUFFER_SIZE - 1); diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c index 8da874cbec1a..aa3ccc740521 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c @@ -358,6 +358,107 @@ bool rtl8821ae_phy_rf_config(struct ieee80211_hw *hw) return rtl8821ae_phy_rf6052_config(hw); } +static void _rtl8812ae_phy_set_rfe_reg_24g(struct ieee80211_hw *hw) +{ + struct rtl_priv *rtlpriv = rtl_priv(hw); + struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); + u8 tmp; + + switch (rtlhal->rfe_type) { + case 3: + rtl_set_bbreg(hw, RA_RFE_PINMUX, BMASKDWORD, 0x54337770); + rtl_set_bbreg(hw, RB_RFE_PINMUX, BMASKDWORD, 0x54337770); + rtl_set_bbreg(hw, RA_RFE_INV, BMASKRFEINV, 0x010); + rtl_set_bbreg(hw, RB_RFE_INV, BMASKRFEINV, 0x010); + rtl_set_bbreg(hw, 0x900, 0x00000303, 0x1); + break; + case 4: + rtl_set_bbreg(hw, RA_RFE_PINMUX, BMASKDWORD, 0x77777777); + rtl_set_bbreg(hw, RB_RFE_PINMUX, BMASKDWORD, 0x77777777); + rtl_set_bbreg(hw, RA_RFE_INV, BMASKRFEINV, 0x001); + rtl_set_bbreg(hw, RB_RFE_INV, BMASKRFEINV, 0x001); + break; + case 5: + rtl_write_byte(rtlpriv, RA_RFE_PINMUX + 2, 0x77); + rtl_set_bbreg(hw, RB_RFE_PINMUX, BMASKDWORD, 0x77777777); + tmp = rtl_read_byte(rtlpriv, RA_RFE_INV + 3); + rtl_write_byte(rtlpriv, RA_RFE_INV + 3, tmp & ~0x1); + rtl_set_bbreg(hw, RB_RFE_INV, BMASKRFEINV, 0x000); + break; + case 1: + if (rtlpriv->btcoexist.bt_coexistence) { + rtl_set_bbreg(hw, RA_RFE_PINMUX, 0xffffff, 0x777777); + rtl_set_bbreg(hw, RB_RFE_PINMUX, BMASKDWORD, + 0x77777777); + rtl_set_bbreg(hw, RA_RFE_INV, 0x33f00000, 0x000); + rtl_set_bbreg(hw, RB_RFE_INV, BMASKRFEINV, 0x000); + break; + } + case 0: + case 2: + default: + rtl_set_bbreg(hw, RA_RFE_PINMUX, BMASKDWORD, 0x77777777); + rtl_set_bbreg(hw, RB_RFE_PINMUX, BMASKDWORD, 0x77777777); + rtl_set_bbreg(hw, RA_RFE_INV, BMASKRFEINV, 0x000); + rtl_set_bbreg(hw, RB_RFE_INV, BMASKRFEINV, 0x000); + break; + } +} + +static void _rtl8812ae_phy_set_rfe_reg_5g(struct ieee80211_hw *hw) +{ + struct rtl_priv *rtlpriv = rtl_priv(hw); + struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); + u8 tmp; + + switch (rtlhal->rfe_type) { + case 0: + rtl_set_bbreg(hw, RA_RFE_PINMUX, BMASKDWORD, 0x77337717); + rtl_set_bbreg(hw, RB_RFE_PINMUX, BMASKDWORD, 0x77337717); + rtl_set_bbreg(hw, RA_RFE_INV, BMASKRFEINV, 0x010); + rtl_set_bbreg(hw, RB_RFE_INV, BMASKRFEINV, 0x010); + break; + case 1: + if (rtlpriv->btcoexist.bt_coexistence) { + rtl_set_bbreg(hw, RA_RFE_PINMUX, 0xffffff, 0x337717); + rtl_set_bbreg(hw, RB_RFE_PINMUX, BMASKDWORD, + 0x77337717); + rtl_set_bbreg(hw, RA_RFE_INV, 0x33f00000, 0x000); + rtl_set_bbreg(hw, RB_RFE_INV, BMASKRFEINV, 0x000); + } else { + rtl_set_bbreg(hw, RA_RFE_PINMUX, BMASKDWORD, + 0x77337717); + rtl_set_bbreg(hw, RB_RFE_PINMUX, BMASKDWORD, + 0x77337717); + rtl_set_bbreg(hw, RA_RFE_INV, BMASKRFEINV, 0x000); + rtl_set_bbreg(hw, RB_RFE_INV, BMASKRFEINV, 0x000); + } + break; + case 3: + rtl_set_bbreg(hw, RA_RFE_PINMUX, BMASKDWORD, 0x54337717); + rtl_set_bbreg(hw, RB_RFE_PINMUX, BMASKDWORD, 0x54337717); + rtl_set_bbreg(hw, RA_RFE_INV, BMASKRFEINV, 0x010); + rtl_set_bbreg(hw, RB_RFE_INV, BMASKRFEINV, 0x010); + rtl_set_bbreg(hw, 0x900, 0x00000303, 0x1); + break; + case 5: + rtl_write_byte(rtlpriv, RA_RFE_PINMUX + 2, 0x33); + rtl_set_bbreg(hw, RB_RFE_PINMUX, BMASKDWORD, 0x77337777); + tmp = rtl_read_byte(rtlpriv, RA_RFE_INV + 3); + rtl_write_byte(rtlpriv, RA_RFE_INV + 3, tmp | 0x1); + rtl_set_bbreg(hw, RB_RFE_INV, BMASKRFEINV, 0x010); + break; + case 2: + case 4: + default: + rtl_set_bbreg(hw, RA_RFE_PINMUX, BMASKDWORD, 0x77337777); + rtl_set_bbreg(hw, RB_RFE_PINMUX, BMASKDWORD, 0x77337777); + rtl_set_bbreg(hw, RA_RFE_INV, BMASKRFEINV, 0x010); + rtl_set_bbreg(hw, RB_RFE_INV, BMASKRFEINV, 0x010); + break; + } +} + u32 phy_get_tx_swing_8812A(struct ieee80211_hw *hw, u8 band, u8 rf_path) { @@ -552,14 +653,9 @@ void rtl8821ae_phy_switch_wirelessband(struct ieee80211_hw *hw, u8 band) /* 0x82C[1:0] = 2b'00 */ rtl_set_bbreg(hw, 0x82c, 0x3, 0); } - if (rtlhal->hw_type == HARDWARE_TYPE_RTL8812AE) { - rtl_set_bbreg(hw, RA_RFE_PINMUX, BMASKDWORD, - 0x77777777); - rtl_set_bbreg(hw, RB_RFE_PINMUX, BMASKDWORD, - 0x77777777); - rtl_set_bbreg(hw, RA_RFE_INV, 0x3ff00000, 0x000); - rtl_set_bbreg(hw, RB_RFE_INV, 0x3ff00000, 0x000); - } + + if (rtlhal->hw_type == HARDWARE_TYPE_RTL8812AE) + _rtl8812ae_phy_set_rfe_reg_24g(hw); rtl_set_bbreg(hw, RTXPATH, 0xf0, 0x1); rtl_set_bbreg(hw, RCCK_RX, 0x0f000000, 0x1); @@ -614,14 +710,8 @@ void rtl8821ae_phy_switch_wirelessband(struct ieee80211_hw *hw, u8 band) /* 0x82C[1:0] = 2'b00 */ rtl_set_bbreg(hw, 0x82c, 0x3, 1); - if (rtlhal->hw_type == HARDWARE_TYPE_RTL8812AE) { - rtl_set_bbreg(hw, RA_RFE_PINMUX, BMASKDWORD, - 0x77337777); - rtl_set_bbreg(hw, RB_RFE_PINMUX, BMASKDWORD, - 0x77337777); - rtl_set_bbreg(hw, RA_RFE_INV, 0x3ff00000, 0x010); - rtl_set_bbreg(hw, RB_RFE_INV, 0x3ff00000, 0x010); - } + if (rtlhal->hw_type == HARDWARE_TYPE_RTL8812AE) + _rtl8812ae_phy_set_rfe_reg_5g(hw); rtl_set_bbreg(hw, RTXPATH, 0xf0, 0); rtl_set_bbreg(hw, RCCK_RX, 0x0f000000, 0xf); @@ -660,6 +750,88 @@ void rtl8821ae_phy_switch_wirelessband(struct ieee80211_hw *hw, u8 band) return; } +static bool _rtl8821ae_check_positive(struct ieee80211_hw *hw, + const u32 condition1, + const u32 condition2) +{ + struct rtl_priv *rtlpriv = rtl_priv(hw); + struct rtl_hal *rtlhal = rtl_hal(rtlpriv); + u32 cut_ver = ((rtlhal->version & CHIP_VER_RTL_MASK) + >> CHIP_VER_RTL_SHIFT); + u32 intf = (rtlhal->interface == INTF_USB ? BIT(1) : BIT(0)); + + u8 board_type = ((rtlhal->board_type & BIT(4)) >> 4) << 0 | /* _GLNA */ + ((rtlhal->board_type & BIT(3)) >> 3) << 1 | /* _GPA */ + ((rtlhal->board_type & BIT(7)) >> 7) << 2 | /* _ALNA */ + ((rtlhal->board_type & BIT(6)) >> 6) << 3 | /* _APA */ + ((rtlhal->board_type & BIT(2)) >> 2) << 4; /* _BT */ + + u32 cond1 = condition1, cond2 = condition2; + u32 driver1 = cut_ver << 24 | /* CUT ver */ + 0 << 20 | /* interface 2/2 */ + 0x04 << 16 | /* platform */ + rtlhal->package_type << 12 | + intf << 8 | /* interface 1/2 */ + board_type; + + u32 driver2 = rtlhal->type_glna << 0 | + rtlhal->type_gpa << 8 | + rtlhal->type_alna << 16 | + rtlhal->type_apa << 24; + + RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, + "===> [8812A] CheckPositive (cond1, cond2) = (0x%X 0x%X)\n", + cond1, cond2); + RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, + "===> [8812A] CheckPositive (driver1, driver2) = (0x%X 0x%X)\n", + driver1, driver2); + + RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, + " (Platform, Interface) = (0x%X, 0x%X)\n", 0x04, intf); + RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, + " (Board, Package) = (0x%X, 0x%X)\n", + rtlhal->board_type, rtlhal->package_type); + + /*============== Value Defined Check ===============*/ + /*QFN Type [15:12] and Cut Version [27:24] need to do value check*/ + + if (((cond1 & 0x0000F000) != 0) && ((cond1 & 0x0000F000) != + (driver1 & 0x0000F000))) + return false; + if (((cond1 & 0x0F000000) != 0) && ((cond1 & 0x0F000000) != + (driver1 & 0x0F000000))) + return false; + + /*=============== Bit Defined Check ================*/ + /* We don't care [31:28] */ + + cond1 &= 0x00FF0FFF; + driver1 &= 0x00FF0FFF; + + if ((cond1 & driver1) == cond1) { + u32 mask = 0; + + if ((cond1 & 0x0F) == 0) /* BoardType is DONTCARE*/ + return true; + + if ((cond1 & BIT(0)) != 0) /*GLNA*/ + mask |= 0x000000FF; + if ((cond1 & BIT(1)) != 0) /*GPA*/ + mask |= 0x0000FF00; + if ((cond1 & BIT(2)) != 0) /*ALNA*/ + mask |= 0x00FF0000; + if ((cond1 & BIT(3)) != 0) /*APA*/ + mask |= 0xFF000000; + + /* BoardType of each RF path is matched*/ + if ((cond2 & mask) == (driver2 & mask)) + return true; + else + return false; + } else + return false; +} + static bool _rtl8821ae_check_condition(struct ieee80211_hw *hw, const u32 condition) { @@ -1695,55 +1867,78 @@ static bool _rtl8821ae_phy_bb8821a_config_parafile(struct ieee80211_hw *hw) return true; } +static bool +__rtl8821ae_phy_config_with_headerfile(struct ieee80211_hw *hw, + u32 *array_table, u16 arraylen, + void (*set_reg)(struct ieee80211_hw *hw, + u32 regaddr, u32 data)) +{ + #define COND_ELSE 2 + #define COND_ENDIF 3 + + int i = 0; + u8 cond; + bool matched = true, skipped = false; + + while ((i + 1) < arraylen) { + u32 v1 = array_table[i]; + u32 v2 = array_table[i + 1]; + + if (v1 & (BIT(31) | BIT(30))) {/*positive & negative condition*/ + if (v1 & BIT(31)) {/* positive condition*/ + cond = (u8)((v1 & (BIT(29) | BIT(28))) >> 28); + if (cond == COND_ENDIF) {/*end*/ + matched = true; + skipped = false; + } else if (cond == COND_ELSE) /*else*/ + matched = skipped ? false : true; + else {/*if , else if*/ + if (skipped) { + matched = false; + } else { + if (_rtl8821ae_check_positive( + hw, v1, v2)) { + matched = true; + skipped = true; + } else { + matched = false; + skipped = false; + } + } + } + } else if (v1 & BIT(30)) { /*negative condition*/ + /*do nothing*/ + } + } else { + if (matched) + set_reg(hw, v1, v2); + } + i = i + 2; + } + + return true; +} + static bool _rtl8821ae_phy_config_mac_with_headerfile(struct ieee80211_hw *hw) { struct rtl_priv *rtlpriv = rtl_priv(hw); struct rtl_hal *rtlhal = rtl_hal(rtlpriv); - u32 i, v1, v2; u32 arraylength; u32 *ptrarray; RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, "Read MAC_REG_Array\n"); if (rtlhal->hw_type == HARDWARE_TYPE_RTL8821AE) { - arraylength = RTL8821AEMAC_1T_ARRAYLEN; + arraylength = RTL8821AE_MAC_1T_ARRAYLEN; ptrarray = RTL8821AE_MAC_REG_ARRAY; } else { - arraylength = RTL8812AEMAC_1T_ARRAYLEN; + arraylength = RTL8812AE_MAC_1T_ARRAYLEN; ptrarray = RTL8812AE_MAC_REG_ARRAY; } RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, "Img: MAC_REG_ARRAY LEN %d\n", arraylength); - for (i = 0; i < arraylength; i += 2) { - v1 = ptrarray[i]; - v2 = (u8)ptrarray[i + 1]; - if (v1 < 0xCDCDCDCD) { - rtl_write_byte(rtlpriv, v1, (u8)v2); - continue; - } else { - if (!_rtl8821ae_check_condition(hw, v1)) { - /*Discard the following (offset, data) pairs*/ - READ_NEXT_PAIR(ptrarray, v1, v2, i); - while (v2 != 0xDEAD && - v2 != 0xCDEF && - v2 != 0xCDCD && i < arraylength - 2) { - READ_NEXT_PAIR(ptrarray, v1, v2, i); - } - i -= 2; /* prevent from for-loop += 2*/ - } else {/*Configure matched pairs and skip to end of if-else.*/ - READ_NEXT_PAIR(ptrarray, v1, v2, i); - while (v2 != 0xDEAD && - v2 != 0xCDEF && - v2 != 0xCDCD && i < arraylength - 2) { - rtl_write_byte(rtlpriv, v1, v2); - READ_NEXT_PAIR(ptrarray, v1, v2, i); - } - while (v2 != 0xDEAD && i < arraylength - 2) - READ_NEXT_PAIR(ptrarray, v1, v2, i); - } - } - } - return true; + return __rtl8821ae_phy_config_with_headerfile(hw, + ptrarray, arraylength, rtl_write_byte_with_val32); } static bool _rtl8821ae_phy_config_bb_with_headerfile(struct ieee80211_hw *hw, @@ -1751,111 +1946,33 @@ static bool _rtl8821ae_phy_config_bb_with_headerfile(struct ieee80211_hw *hw, { struct rtl_priv *rtlpriv = rtl_priv(hw); struct rtl_hal *rtlhal = rtl_hal(rtlpriv); - int i; u32 *array_table; u16 arraylen; - u32 v1 = 0, v2 = 0; if (configtype == BASEBAND_CONFIG_PHY_REG) { if (rtlhal->hw_type == HARDWARE_TYPE_RTL8812AE) { - arraylen = RTL8812AEPHY_REG_1TARRAYLEN; + arraylen = RTL8812AE_PHY_REG_1TARRAYLEN; array_table = RTL8812AE_PHY_REG_ARRAY; } else { - arraylen = RTL8821AEPHY_REG_1TARRAYLEN; + arraylen = RTL8821AE_PHY_REG_1TARRAYLEN; array_table = RTL8821AE_PHY_REG_ARRAY; } - for (i = 0; i < arraylen; i += 2) { - v1 = array_table[i]; - v2 = array_table[i + 1]; - if (v1 < 0xCDCDCDCD) { - _rtl8821ae_config_bb_reg(hw, v1, v2); - continue; - } else {/*This line is the start line of branch.*/ - if (!_rtl8821ae_check_condition(hw, v1)) { - /*Discard the following (offset, data) pairs*/ - READ_NEXT_PAIR(array_table, v1, v2, i); - while (v2 != 0xDEAD && - v2 != 0xCDEF && - v2 != 0xCDCD && - i < arraylen - 2) { - READ_NEXT_PAIR(array_table, v1, - v2, i); - } - - i -= 2; /* prevent from for-loop += 2*/ - } else {/*Configure matched pairs and skip to end of if-else.*/ - READ_NEXT_PAIR(array_table, v1, v2, i); - while (v2 != 0xDEAD && - v2 != 0xCDEF && - v2 != 0xCDCD && - i < arraylen - 2) { - _rtl8821ae_config_bb_reg(hw, v1, - v2); - READ_NEXT_PAIR(array_table, v1, - v2, i); - } - - while (v2 != 0xDEAD && - i < arraylen - 2) { - READ_NEXT_PAIR(array_table, v1, - v2, i); - } - } - } - } + return __rtl8821ae_phy_config_with_headerfile(hw, + array_table, arraylen, + _rtl8821ae_config_bb_reg); } else if (configtype == BASEBAND_CONFIG_AGC_TAB) { if (rtlhal->hw_type == HARDWARE_TYPE_RTL8812AE) { - arraylen = RTL8812AEAGCTAB_1TARRAYLEN; + arraylen = RTL8812AE_AGC_TAB_1TARRAYLEN; array_table = RTL8812AE_AGC_TAB_ARRAY; } else { - arraylen = RTL8821AEAGCTAB_1TARRAYLEN; + arraylen = RTL8821AE_AGC_TAB_1TARRAYLEN; array_table = RTL8821AE_AGC_TAB_ARRAY; } - for (i = 0; i < arraylen; i = i + 2) { - v1 = array_table[i]; - v2 = array_table[i+1]; - if (v1 < 0xCDCDCDCD) { - rtl_set_bbreg(hw, v1, MASKDWORD, v2); - udelay(1); - continue; - } else {/*This line is the start line of branch.*/ - if (!_rtl8821ae_check_condition(hw, v1)) { - /*Discard the following (offset, data) pairs*/ - READ_NEXT_PAIR(array_table, v1, v2, i); - while (v2 != 0xDEAD && - v2 != 0xCDEF && - v2 != 0xCDCD && - i < arraylen - 2) { - READ_NEXT_PAIR(array_table, v1, - v2, i); - } - i -= 2; /* prevent from for-loop += 2*/ - } else {/*Configure matched pairs and skip to end of if-else.*/ - READ_NEXT_PAIR(array_table, v1, v2, i); - while (v2 != 0xDEAD && - v2 != 0xCDEF && - v2 != 0xCDCD && - i < arraylen - 2) { - rtl_set_bbreg(hw, v1, MASKDWORD, - v2); - udelay(1); - READ_NEXT_PAIR(array_table, v1, - v2, i); - } - - while (v2 != 0xDEAD && - i < arraylen - 2) { - READ_NEXT_PAIR(array_table, v1, - v2, i); - } - } - RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, - "The agctab_array_table[0] is %x Rtl818EEPHY_REGArray[1] is %x\n", - array_table[i], array_table[i + 1]); - } - } + return __rtl8821ae_phy_config_with_headerfile(hw, + array_table, arraylen, + rtl_set_bbreg_with_dwmask); } return true; } @@ -1913,10 +2030,10 @@ static bool _rtl8821ae_phy_config_bb_with_pgheaderfile(struct ieee80211_hw *hw, u32 v1, v2, v3, v4, v5, v6; if (rtlhal->hw_type == HARDWARE_TYPE_RTL8812AE) { - arraylen = RTL8812AEPHY_REG_ARRAY_PGLEN; + arraylen = RTL8812AE_PHY_REG_ARRAY_PGLEN; array = RTL8812AE_PHY_REG_ARRAY_PG; } else { - arraylen = RTL8821AEPHY_REG_ARRAY_PGLEN; + arraylen = RTL8821AE_PHY_REG_ARRAY_PGLEN; array = RTL8821AE_PHY_REG_ARRAY_PG; } @@ -1980,12 +2097,10 @@ static bool _rtl8821ae_phy_config_bb_with_pgheaderfile(struct ieee80211_hw *hw, bool rtl8812ae_phy_config_rf_with_headerfile(struct ieee80211_hw *hw, enum radio_path rfpath) { - int i; bool rtstatus = true; u32 *radioa_array_table_a, *radioa_array_table_b; u16 radioa_arraylen_a, radioa_arraylen_b; struct rtl_priv *rtlpriv = rtl_priv(hw); - u32 v1 = 0, v2 = 0; radioa_arraylen_a = RTL8812AE_RADIOA_1TARRAYLEN; radioa_array_table_a = RTL8812AE_RADIOA_ARRAY; @@ -1997,69 +2112,14 @@ bool rtl8812ae_phy_config_rf_with_headerfile(struct ieee80211_hw *hw, rtstatus = true; switch (rfpath) { case RF90_PATH_A: - for (i = 0; i < radioa_arraylen_a; i = i + 2) { - v1 = radioa_array_table_a[i]; - v2 = radioa_array_table_a[i+1]; - if (v1 < 0xcdcdcdcd) { - _rtl8821ae_config_rf_radio_a(hw, v1, v2); - continue; - } else{/*This line is the start line of branch.*/ - if (!_rtl8821ae_check_condition(hw, v1)) { - /*Discard the following (offset, data) pairs*/ - READ_NEXT_PAIR(radioa_array_table_a, v1, v2, i); - while (v2 != 0xDEAD && - v2 != 0xCDEF && - v2 != 0xCDCD && i < radioa_arraylen_a-2) - READ_NEXT_PAIR(radioa_array_table_a, v1, v2, i); - - i -= 2; /* prevent from for-loop += 2*/ - } else {/*Configure matched pairs and skip to end of if-else.*/ - READ_NEXT_PAIR(radioa_array_table_a, v1, v2, i); - while (v2 != 0xDEAD && - v2 != 0xCDEF && - v2 != 0xCDCD && i < radioa_arraylen_a - 2) { - _rtl8821ae_config_rf_radio_a(hw, v1, v2); - READ_NEXT_PAIR(radioa_array_table_a, v1, v2, i); - } - - while (v2 != 0xDEAD && i < radioa_arraylen_a-2) - READ_NEXT_PAIR(radioa_array_table_a, v1, v2, i); - - } - } - } + return __rtl8821ae_phy_config_with_headerfile(hw, + radioa_array_table_a, radioa_arraylen_a, + _rtl8821ae_config_rf_radio_a); break; case RF90_PATH_B: - for (i = 0; i < radioa_arraylen_b; i = i + 2) { - v1 = radioa_array_table_b[i]; - v2 = radioa_array_table_b[i+1]; - if (v1 < 0xcdcdcdcd) { - _rtl8821ae_config_rf_radio_b(hw, v1, v2); - continue; - } else{/*This line is the start line of branch.*/ - if (!_rtl8821ae_check_condition(hw, v1)) { - /*Discard the following (offset, data) pairs*/ - READ_NEXT_PAIR(radioa_array_table_b, v1, v2, i); - while (v2 != 0xDEAD && - v2 != 0xCDEF && - v2 != 0xCDCD && i < radioa_arraylen_b-2) - READ_NEXT_PAIR(radioa_array_table_b, v1, v2, i); - - i -= 2; /* prevent from for-loop += 2*/ - } else {/*Configure matched pairs and skip to end of if-else.*/ - READ_NEXT_PAIR(radioa_array_table_b, v1, v2, i); - while (v2 != 0xDEAD && - v2 != 0xCDEF && - v2 != 0xCDCD && i < radioa_arraylen_b-2) { - _rtl8821ae_config_rf_radio_b(hw, v1, v2); - READ_NEXT_PAIR(radioa_array_table_b, v1, v2, i); - } - - while (v2 != 0xDEAD && i < radioa_arraylen_b-2) - READ_NEXT_PAIR(radioa_array_table_b, v1, v2, i); - } - } - } + return __rtl8821ae_phy_config_with_headerfile(hw, + radioa_array_table_b, radioa_arraylen_b, + _rtl8821ae_config_rf_radio_b); break; case RF90_PATH_C: case RF90_PATH_D: @@ -2072,21 +2132,10 @@ bool rtl8812ae_phy_config_rf_with_headerfile(struct ieee80211_hw *hw, bool rtl8821ae_phy_config_rf_with_headerfile(struct ieee80211_hw *hw, enum radio_path rfpath) { - #define READ_NEXT_RF_PAIR(v1, v2, i) \ - do { \ - i += 2; \ - v1 = radioa_array_table[i]; \ - v2 = radioa_array_table[i+1]; \ - } \ - while (0) - - int i; bool rtstatus = true; u32 *radioa_array_table; u16 radioa_arraylen; struct rtl_priv *rtlpriv = rtl_priv(hw); - /* struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); */ - u32 v1 = 0, v2 = 0; radioa_arraylen = RTL8821AE_RADIOA_1TARRAYLEN; radioa_array_table = RTL8821AE_RADIOA_ARRAY; @@ -2096,35 +2145,9 @@ bool rtl8821ae_phy_config_rf_with_headerfile(struct ieee80211_hw *hw, rtstatus = true; switch (rfpath) { case RF90_PATH_A: - for (i = 0; i < radioa_arraylen; i = i + 2) { - v1 = radioa_array_table[i]; - v2 = radioa_array_table[i+1]; - if (v1 < 0xcdcdcdcd) - _rtl8821ae_config_rf_radio_a(hw, v1, v2); - else{/*This line is the start line of branch.*/ - if (!_rtl8821ae_check_condition(hw, v1)) { - /*Discard the following (offset, data) pairs*/ - READ_NEXT_RF_PAIR(v1, v2, i); - while (v2 != 0xDEAD && - v2 != 0xCDEF && - v2 != 0xCDCD && i < radioa_arraylen - 2) - READ_NEXT_RF_PAIR(v1, v2, i); - - i -= 2; /* prevent from for-loop += 2*/ - } else {/*Configure matched pairs and skip to end of if-else.*/ - READ_NEXT_RF_PAIR(v1, v2, i); - while (v2 != 0xDEAD && - v2 != 0xCDEF && - v2 != 0xCDCD && i < radioa_arraylen - 2) { - _rtl8821ae_config_rf_radio_a(hw, v1, v2); - READ_NEXT_RF_PAIR(v1, v2, i); - } - - while (v2 != 0xDEAD && i < radioa_arraylen - 2) - READ_NEXT_RF_PAIR(v1, v2, i); - } - } - } + return __rtl8821ae_phy_config_with_headerfile(hw, + radioa_array_table, radioa_arraylen, + _rtl8821ae_config_rf_radio_a); break; case RF90_PATH_B: diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/reg.h b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/reg.h index 1d6110f9c1fb..ed69dbe178ff 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/reg.h +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/reg.h @@ -2424,6 +2424,7 @@ #define BMASKH4BITS 0xf0000000 #define BMASKOFDM_D 0xffc00000 #define BMASKCCK 0x3f3f3f3f +#define BMASKRFEINV 0x3ff00000 #define BRFREGOFFSETMASK 0xfffff diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/sw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/sw.c index 77cf3b2cd3f1..abaf34cb1433 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/sw.c +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/sw.c @@ -203,7 +203,7 @@ int rtl8821ae_init_sw_vars(struct ieee80211_hw *hw) fw_name = "rtlwifi/rtl8812aefw.bin"; wowlan_fw_name = "rtlwifi/rtl8812aefw_wowlan.bin"; } else { - fw_name = "rtlwifi/rtl8821aefw.bin"; + fw_name = "rtlwifi/rtl8821aefw_29.bin"; wowlan_fw_name = "rtlwifi/rtl8821aefw_wowlan.bin"; } @@ -214,8 +214,16 @@ int rtl8821ae_init_sw_vars(struct ieee80211_hw *hw) rtlpriv->io.dev, GFP_KERNEL, hw, rtl_fw_cb); if (err) { - pr_err("Failed to request normal firmware!\n"); - return 1; + /* Failed to get firmware. Check if old version available */ + fw_name = "rtlwifi/rtl8821aefw.bin"; + pr_info("Using firmware %s\n", fw_name); + err = request_firmware_nowait(THIS_MODULE, 1, fw_name, + rtlpriv->io.dev, GFP_KERNEL, hw, + rtl_fw_cb); + if (err) { + pr_err("Failed to request normal firmware!\n"); + return 1; + } } /*load wowlan firmware*/ pr_info("Using firmware %s\n", wowlan_fw_name); @@ -428,6 +436,7 @@ MODULE_AUTHOR("Realtek WlanFAE <wlanfae@realtek.com>"); MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("Realtek 8821ae 802.11ac PCI wireless"); MODULE_FIRMWARE("rtlwifi/rtl8821aefw.bin"); +MODULE_FIRMWARE("rtlwifi/rtl8821aefw_29.bin"); module_param_named(swenc, rtl8821ae_mod_params.sw_crypto, bool, 0444); module_param_named(debug_level, rtl8821ae_mod_params.debug_level, int, 0644); diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/table.c b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/table.c index 62a0fb76f080..408c4611e5de 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/table.c +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/table.c @@ -38,7 +38,7 @@ u32 RTL8812AE_PHY_REG_ARRAY[] = { 0x824, 0x00030FE0, 0x828, 0x00000000, 0x82C, 0x002083DD, - 0x830, 0x2AAA6C86, + 0x830, 0x2EAAEEB8, 0x834, 0x0037A706, 0x838, 0x06C89B44, 0x83C, 0x0000095B, @@ -68,7 +68,7 @@ u32 RTL8812AE_PHY_REG_ARRAY[] = { 0x8BC, 0x4CA520A3, 0x8C0, 0x27F00020, 0x8C4, 0x00000000, - 0x8C8, 0x00013169, + 0x8C8, 0x00012D69, 0x8CC, 0x08248492, 0x8D0, 0x0000B800, 0x8DC, 0x00000000, @@ -76,13 +76,7 @@ u32 RTL8812AE_PHY_REG_ARRAY[] = { 0x8D8, 0x290B5612, 0x8F8, 0x400002C0, 0x8FC, 0x00000000, - 0xFF0F07D8, 0xABCD, 0x900, 0x00000701, - 0xFF0F07D0, 0xCDEF, - 0x900, 0x00000701, - 0xCDCDCDCD, 0xCDCD, - 0x900, 0x00000700, - 0xFF0F07D8, 0xDEAD, 0x90C, 0x00000000, 0x910, 0x0000FC00, 0x914, 0x00000404, @@ -120,7 +114,7 @@ u32 RTL8812AE_PHY_REG_ARRAY[] = { 0x9D4, 0x00000000, 0x9D8, 0x00000000, 0x9DC, 0x00000000, - 0x9E4, 0x00000002, + 0x9E4, 0x00000003, 0x9E8, 0x000002D5, 0xA00, 0x00D047C8, 0xA04, 0x01FF000C, @@ -189,7 +183,21 @@ u32 RTL8812AE_PHY_REG_ARRAY[] = { 0xC5C, 0x00000058, 0xC60, 0x34344443, 0xC64, 0x07003333, + 0x80000008, 0x00000000, 0x40000000, 0x00000000, + 0xC68, 0x59791979, + 0x90000008, 0x05000000, 0x40000000, 0x00000000, + 0xC68, 0x59791979, + 0x90000002, 0x00000000, 0x40000000, 0x00000000, + 0xC68, 0x59791979, + 0x90000004, 0x00000000, 0x40000000, 0x00000000, + 0xC68, 0x59791979, + 0x90000001, 0x00000000, 0x40000000, 0x00000000, + 0xC68, 0x59791979, + 0x90000001, 0x00000005, 0x40000000, 0x00000000, 0xC68, 0x59791979, + 0xA0000000, 0x00000000, + 0xC68, 0x59799979, + 0xB0000000, 0x00000000, 0xC6C, 0x59795979, 0xC70, 0x19795979, 0xC74, 0x19795979, @@ -203,19 +211,7 @@ u32 RTL8812AE_PHY_REG_ARRAY[] = { 0xCA0, 0x00000029, 0xCA4, 0x08040201, 0xCA8, 0x80402010, - 0xFF0F0740, 0xABCD, - 0xCB0, 0x77547717, - 0xFF0F01C0, 0xCDEF, - 0xCB0, 0x77547717, - 0xFF0F02C0, 0xCDEF, - 0xCB0, 0x77547717, - 0xFF0F07D8, 0xCDEF, - 0xCB0, 0x54547710, - 0xFF0F07D0, 0xCDEF, - 0xCB0, 0x54547710, - 0xCDCDCDCD, 0xCDCD, 0xCB0, 0x77547777, - 0xFF0F0740, 0xDEAD, 0xCB4, 0x00000077, 0xCB8, 0x00508242, 0xE00, 0x00000007, @@ -257,23 +253,14 @@ u32 RTL8812AE_PHY_REG_ARRAY[] = { 0xEA0, 0x00000029, 0xEA4, 0x08040201, 0xEA8, 0x80402010, - 0xFF0F0740, 0xABCD, - 0xEB0, 0x77547717, - 0xFF0F01C0, 0xCDEF, - 0xEB0, 0x77547717, - 0xFF0F02C0, 0xCDEF, - 0xEB0, 0x77547717, - 0xFF0F07D8, 0xCDEF, - 0xEB0, 0x54547710, - 0xFF0F07D0, 0xCDEF, - 0xEB0, 0x54547710, - 0xCDCDCDCD, 0xCDCD, 0xEB0, 0x77547777, - 0xFF0F0740, 0xDEAD, 0xEB4, 0x00000077, 0xEB8, 0x00508242, }; +u32 RTL8812AE_PHY_REG_1TARRAYLEN = + sizeof(RTL8812AE_PHY_REG_ARRAY) / sizeof(u32); + u32 RTL8821AE_PHY_REG_ARRAY[] = { 0x800, 0x0020D090, 0x804, 0x080112E0, @@ -449,6 +436,9 @@ u32 RTL8821AE_PHY_REG_ARRAY[] = { 0xCB8, 0x00508240, }; +u32 RTL8821AE_PHY_REG_1TARRAYLEN = + sizeof(RTL8821AE_PHY_REG_ARRAY) / sizeof(u32); + u32 RTL8812AE_PHY_REG_ARRAY_PG[] = { 0, 0, 0, 0x00000c20, 0xffffffff, 0x34363840, 0, 0, 0, 0x00000c24, 0xffffffff, 0x42424444, @@ -498,6 +488,9 @@ u32 RTL8812AE_PHY_REG_ARRAY_PG[] = { 1, 1, 1, 0x00000e4c, 0xffffffff, 0x22242628 }; +u32 RTL8812AE_PHY_REG_ARRAY_PGLEN = + sizeof(RTL8812AE_PHY_REG_ARRAY_PG) / sizeof(u32); + u32 RTL8821AE_PHY_REG_ARRAY_PG[] = { 0, 0, 0, 0x00000c20, 0xffffffff, 0x32343638, 0, 0, 0, 0x00000c24, 0xffffffff, 0x36363838, @@ -516,6 +509,9 @@ u32 RTL8821AE_PHY_REG_ARRAY_PG[] = { 1, 0, 0, 0x00000c44, 0x0000ffff, 0x00002022 }; +u32 RTL8821AE_PHY_REG_ARRAY_PGLEN = + sizeof(RTL8821AE_PHY_REG_ARRAY_PG) / sizeof(u32); + u32 RTL8812AE_RADIOA_ARRAY[] = { 0x000, 0x00010000, 0x018, 0x0001712A, @@ -523,26 +519,25 @@ u32 RTL8812AE_RADIOA_ARRAY[] = { 0x066, 0x00040000, 0x01E, 0x00080000, 0x089, 0x00000080, - 0xFF0F0740, 0xABCD, - 0x086, 0x00014B38, - 0xFF0F02C0, 0xCDEF, - 0x086, 0x00014B38, - 0xFF0F01C0, 0xCDEF, - 0x086, 0x00014B38, - 0xFF0F07D8, 0xCDEF, + 0x80000001, 0x00000000, 0x40000000, 0x00000000, 0x086, 0x00014B3A, - 0xFF0F07D0, 0xCDEF, + 0x90000001, 0x00000005, 0x40000000, 0x00000000, 0x086, 0x00014B3A, - 0xCDCDCDCD, 0xCDCD, + 0xA0000000, 0x00000000, 0x086, 0x00014B38, - 0xFF0F0740, 0xDEAD, + 0xB0000000, 0x00000000, + 0x80000004, 0x00000000, 0x40000000, 0x00000000, + 0x08B, 0x00080180, + 0xA0000000, 0x00000000, + 0x08B, 0x00087180, + 0xB0000000, 0x00000000, 0x0B1, 0x0001FC1A, 0x0B3, 0x000F0810, 0x0B4, 0x0001A78D, 0x0BA, 0x00086180, 0x018, 0x00000006, 0x0EF, 0x00002000, - 0xFF0F07D8, 0xABCD, + 0x80000001, 0x00000000, 0x40000000, 0x00000000, 0x03B, 0x0003F218, 0x03B, 0x00030A58, 0x03B, 0x0002FA58, @@ -550,7 +545,7 @@ u32 RTL8812AE_RADIOA_ARRAY[] = { 0x03B, 0x0001FA50, 0x03B, 0x00010248, 0x03B, 0x00008240, - 0xFF0F07D0, 0xCDEF, + 0x90000001, 0x00000005, 0x40000000, 0x00000000, 0x03B, 0x0003F218, 0x03B, 0x00030A58, 0x03B, 0x0002FA58, @@ -558,7 +553,7 @@ u32 RTL8812AE_RADIOA_ARRAY[] = { 0x03B, 0x0001FA50, 0x03B, 0x00010248, 0x03B, 0x00008240, - 0xCDCDCDCD, 0xCDCD, + 0xA0000000, 0x00000000, 0x03B, 0x00038A58, 0x03B, 0x00037A58, 0x03B, 0x0002A590, @@ -566,9 +561,9 @@ u32 RTL8812AE_RADIOA_ARRAY[] = { 0x03B, 0x00018248, 0x03B, 0x00010240, 0x03B, 0x00008240, - 0xFF0F07D8, 0xDEAD, + 0xB0000000, 0x00000000, 0x0EF, 0x00000100, - 0xFF0F07D8, 0xABCD, + 0x80000002, 0x00000000, 0x40000000, 0x00000000, 0x034, 0x0000A4EE, 0x034, 0x00009076, 0x034, 0x00008073, @@ -580,7 +575,7 @@ u32 RTL8812AE_RADIOA_ARRAY[] = { 0x034, 0x00002028, 0x034, 0x00001025, 0x034, 0x00000022, - 0xCDCDCDCD, 0xCDCD, + 0xA0000000, 0x00000000, 0x034, 0x0000ADF4, 0x034, 0x00009DF1, 0x034, 0x00008DEE, @@ -592,7 +587,7 @@ u32 RTL8812AE_RADIOA_ARRAY[] = { 0x034, 0x000024E7, 0x034, 0x0000146B, 0x034, 0x0000006D, - 0xFF0F07D8, 0xDEAD, + 0xB0000000, 0x00000000, 0x0EF, 0x00000000, 0x0EF, 0x000020A2, 0x0DF, 0x00000080, @@ -646,7 +641,7 @@ u32 RTL8812AE_RADIOA_ARRAY[] = { 0x03B, 0x0006B064, 0x03C, 0x00004000, 0x03A, 0x000000D8, - 0x03B, 0x00023070, + 0x03B, 0x00063070, 0x03C, 0x00004000, 0x03A, 0x00000468, 0x03B, 0x0005B870, @@ -685,43 +680,7 @@ u32 RTL8812AE_RADIOA_ARRAY[] = { 0x03B, 0x00082080, 0x03C, 0x00010000, 0x0EF, 0x00001100, - 0xFF0F0740, 0xABCD, - 0x034, 0x0004A0B2, - 0x034, 0x000490AF, - 0x034, 0x00048070, - 0x034, 0x0004706D, - 0x034, 0x00046050, - 0x034, 0x0004504D, - 0x034, 0x0004404A, - 0x034, 0x00043047, - 0x034, 0x0004200A, - 0x034, 0x00041007, - 0x034, 0x00040004, - 0xFF0F02C0, 0xCDEF, - 0x034, 0x0004A0B2, - 0x034, 0x000490AF, - 0x034, 0x00048070, - 0x034, 0x0004706D, - 0x034, 0x00046050, - 0x034, 0x0004504D, - 0x034, 0x0004404A, - 0x034, 0x00043047, - 0x034, 0x0004200A, - 0x034, 0x00041007, - 0x034, 0x00040004, - 0xFF0F01C0, 0xCDEF, - 0x034, 0x0004A0B2, - 0x034, 0x000490AF, - 0x034, 0x00048070, - 0x034, 0x0004706D, - 0x034, 0x00046050, - 0x034, 0x0004504D, - 0x034, 0x0004404A, - 0x034, 0x00043047, - 0x034, 0x0004200A, - 0x034, 0x00041007, - 0x034, 0x00040004, - 0xFF0F07D8, 0xCDEF, + 0x80000008, 0x00000000, 0x40000000, 0x00000000, 0x034, 0x0004A0B2, 0x034, 0x000490AF, 0x034, 0x00048070, @@ -733,80 +692,32 @@ u32 RTL8812AE_RADIOA_ARRAY[] = { 0x034, 0x0004200A, 0x034, 0x00041007, 0x034, 0x00040004, - 0xFF0F07D0, 0xCDEF, + 0x90000008, 0x05000000, 0x40000000, 0x00000000, 0x034, 0x0004A0B2, 0x034, 0x000490AF, 0x034, 0x00048070, 0x034, 0x0004706D, - 0x034, 0x00046050, - 0x034, 0x0004504D, - 0x034, 0x0004404A, - 0x034, 0x00043047, - 0x034, 0x0004200A, - 0x034, 0x00041007, - 0x034, 0x00040004, - 0xCDCDCDCD, 0xCDCD, + 0x034, 0x0004604D, + 0x034, 0x0004504A, + 0x034, 0x00044047, + 0x034, 0x00043044, + 0x034, 0x00042007, + 0x034, 0x00041004, + 0x034, 0x00040001, + 0xA0000000, 0x00000000, 0x034, 0x0004ADF5, 0x034, 0x00049DF2, 0x034, 0x00048DEF, 0x034, 0x00047DEC, 0x034, 0x00046DE9, - 0x034, 0x00045DC9, - 0x034, 0x00044CE8, - 0x034, 0x000438CA, - 0x034, 0x00042889, - 0x034, 0x0004184A, - 0x034, 0x0004044A, - 0xFF0F0740, 0xDEAD, - 0xFF0F0740, 0xABCD, - 0x034, 0x0002A0B2, - 0x034, 0x000290AF, - 0x034, 0x00028070, - 0x034, 0x0002706D, - 0x034, 0x00026050, - 0x034, 0x0002504D, - 0x034, 0x0002404A, - 0x034, 0x00023047, - 0x034, 0x0002200A, - 0x034, 0x00021007, - 0x034, 0x00020004, - 0xFF0F02C0, 0xCDEF, - 0x034, 0x0002A0B2, - 0x034, 0x000290AF, - 0x034, 0x00028070, - 0x034, 0x0002706D, - 0x034, 0x00026050, - 0x034, 0x0002504D, - 0x034, 0x0002404A, - 0x034, 0x00023047, - 0x034, 0x0002200A, - 0x034, 0x00021007, - 0x034, 0x00020004, - 0xFF0F01C0, 0xCDEF, - 0x034, 0x0002A0B2, - 0x034, 0x000290AF, - 0x034, 0x00028070, - 0x034, 0x0002706D, - 0x034, 0x00026050, - 0x034, 0x0002504D, - 0x034, 0x0002404A, - 0x034, 0x00023047, - 0x034, 0x0002200A, - 0x034, 0x00021007, - 0x034, 0x00020004, - 0xFF0F07D8, 0xCDEF, - 0x034, 0x0002A0B2, - 0x034, 0x000290AF, - 0x034, 0x00028070, - 0x034, 0x0002706D, - 0x034, 0x00026050, - 0x034, 0x0002504D, - 0x034, 0x0002404A, - 0x034, 0x00023047, - 0x034, 0x0002200A, - 0x034, 0x00021007, - 0x034, 0x00020004, - 0xFF0F07D0, 0xCDEF, + 0x034, 0x00045DE6, + 0x034, 0x00044DE3, + 0x034, 0x000438C8, + 0x034, 0x000428C5, + 0x034, 0x000418C2, + 0x034, 0x000408C0, + 0xB0000000, 0x00000000, + 0x80000008, 0x00000000, 0x40000000, 0x00000000, 0x034, 0x0002A0B2, 0x034, 0x000290AF, 0x034, 0x00028070, @@ -818,32 +729,32 @@ u32 RTL8812AE_RADIOA_ARRAY[] = { 0x034, 0x0002200A, 0x034, 0x00021007, 0x034, 0x00020004, - 0xCDCDCDCD, 0xCDCD, + 0x90000008, 0x05000000, 0x40000000, 0x00000000, + 0x034, 0x0002A0B4, + 0x034, 0x000290B1, + 0x034, 0x00028072, + 0x034, 0x0002706F, + 0x034, 0x0002604F, + 0x034, 0x0002504C, + 0x034, 0x00024049, + 0x034, 0x00023046, + 0x034, 0x00022009, + 0x034, 0x00021006, + 0x034, 0x00020003, + 0xA0000000, 0x00000000, 0x034, 0x0002ADF5, 0x034, 0x00029DF2, 0x034, 0x00028DEF, 0x034, 0x00027DEC, 0x034, 0x00026DE9, - 0x034, 0x00025DC9, - 0x034, 0x00024CE8, - 0x034, 0x000238CA, - 0x034, 0x00022889, - 0x034, 0x0002184A, - 0x034, 0x0002044A, - 0xFF0F0740, 0xDEAD, - 0xFF0F0740, 0xABCD, - 0x034, 0x0000A0B2, - 0x034, 0x000090AF, - 0x034, 0x00008070, - 0x034, 0x0000706D, - 0x034, 0x00006050, - 0x034, 0x0000504D, - 0x034, 0x0000404A, - 0x034, 0x00003047, - 0x034, 0x0000200A, - 0x034, 0x00001007, - 0x034, 0x00000004, - 0xFF0F02C0, 0xCDEF, + 0x034, 0x00025DE6, + 0x034, 0x00024DE3, + 0x034, 0x000238C8, + 0x034, 0x000228C5, + 0x034, 0x000218C2, + 0x034, 0x000208C0, + 0xB0000000, 0x00000000, + 0x80000008, 0x00000000, 0x40000000, 0x00000000, 0x034, 0x0000A0B2, 0x034, 0x000090AF, 0x034, 0x00008070, @@ -855,93 +766,33 @@ u32 RTL8812AE_RADIOA_ARRAY[] = { 0x034, 0x0000200A, 0x034, 0x00001007, 0x034, 0x00000004, - 0xFF0F01C0, 0xCDEF, + 0x90000008, 0x05000000, 0x40000000, 0x00000000, 0x034, 0x0000A0B2, 0x034, 0x000090AF, 0x034, 0x00008070, 0x034, 0x0000706D, - 0x034, 0x00006050, - 0x034, 0x0000504D, - 0x034, 0x0000404A, - 0x034, 0x00003047, - 0x034, 0x0000200A, - 0x034, 0x00001007, - 0x034, 0x00000004, - 0xFF0F07D8, 0xCDEF, - 0x034, 0x0000A0B2, - 0x034, 0x000090AF, - 0x034, 0x00008070, - 0x034, 0x0000706D, - 0x034, 0x00006050, - 0x034, 0x0000504D, - 0x034, 0x0000404A, - 0x034, 0x00003047, - 0x034, 0x0000200A, - 0x034, 0x00001007, - 0x034, 0x00000004, - 0xFF0F07D0, 0xCDEF, - 0x034, 0x0000A0B2, - 0x034, 0x000090AF, - 0x034, 0x00008070, - 0x034, 0x0000706D, - 0x034, 0x00006050, - 0x034, 0x0000504D, - 0x034, 0x0000404A, - 0x034, 0x00003047, - 0x034, 0x0000200A, - 0x034, 0x00001007, - 0x034, 0x00000004, - 0xCDCDCDCD, 0xCDCD, + 0x034, 0x0000604D, + 0x034, 0x0000504A, + 0x034, 0x00004047, + 0x034, 0x00003044, + 0x034, 0x00002007, + 0x034, 0x00001004, + 0x034, 0x00000001, + 0xA0000000, 0x00000000, 0x034, 0x0000AFF7, 0x034, 0x00009DF7, 0x034, 0x00008DF4, 0x034, 0x00007DF1, 0x034, 0x00006DEE, - 0x034, 0x00005DCD, - 0x034, 0x00004CEB, + 0x034, 0x00005DEB, + 0x034, 0x00004DE8, 0x034, 0x000038CC, - 0x034, 0x0000288B, - 0x034, 0x0000184C, - 0x034, 0x0000044C, - 0xFF0F0740, 0xDEAD, + 0x034, 0x000028C9, + 0x034, 0x000018C6, + 0x034, 0x000008C3, + 0xB0000000, 0x00000000, 0x0EF, 0x00000000, - 0xFF0F0740, 0xABCD, - 0x018, 0x0001712A, - 0x0EF, 0x00000040, - 0x035, 0x000001D4, - 0x035, 0x000081D4, - 0x035, 0x000101D4, - 0x035, 0x000201B4, - 0x035, 0x000281B4, - 0x035, 0x000301B4, - 0x035, 0x000401B4, - 0x035, 0x000481B4, - 0x035, 0x000501B4, - 0xFF0F02C0, 0xCDEF, - 0x018, 0x0001712A, - 0x0EF, 0x00000040, - 0x035, 0x000001D4, - 0x035, 0x000081D4, - 0x035, 0x000101D4, - 0x035, 0x000201B4, - 0x035, 0x000281B4, - 0x035, 0x000301B4, - 0x035, 0x000401B4, - 0x035, 0x000481B4, - 0x035, 0x000501B4, - 0xFF0F01C0, 0xCDEF, - 0x018, 0x0001712A, - 0x0EF, 0x00000040, - 0x035, 0x000001D4, - 0x035, 0x000081D4, - 0x035, 0x000101D4, - 0x035, 0x000201B4, - 0x035, 0x000281B4, - 0x035, 0x000301B4, - 0x035, 0x000401B4, - 0x035, 0x000481B4, - 0x035, 0x000501B4, - 0xFF0F07D8, 0xCDEF, + 0x80000008, 0x00000000, 0x40000000, 0x00000000, 0x018, 0x0001712A, 0x0EF, 0x00000040, 0x035, 0x000001D4, @@ -953,7 +804,7 @@ u32 RTL8812AE_RADIOA_ARRAY[] = { 0x035, 0x000401B4, 0x035, 0x000481B4, 0x035, 0x000501B4, - 0xFF0F07D0, 0xCDEF, + 0x90000008, 0x05000000, 0x40000000, 0x00000000, 0x018, 0x0001712A, 0x0EF, 0x00000040, 0x035, 0x000001D4, @@ -965,7 +816,7 @@ u32 RTL8812AE_RADIOA_ARRAY[] = { 0x035, 0x000401B4, 0x035, 0x000481B4, 0x035, 0x000501B4, - 0xCDCDCDCD, 0xCDCD, + 0xA0000000, 0x00000000, 0x018, 0x0001712A, 0x0EF, 0x00000040, 0x035, 0x00000188, @@ -977,54 +828,9 @@ u32 RTL8812AE_RADIOA_ARRAY[] = { 0x035, 0x000401D8, 0x035, 0x000481D8, 0x035, 0x000501D8, - 0xFF0F0740, 0xDEAD, + 0xB0000000, 0x00000000, 0x0EF, 0x00000000, - 0xFF0F0740, 0xABCD, - 0x018, 0x0001712A, - 0x0EF, 0x00000010, - 0x036, 0x00004BFB, - 0x036, 0x0000CBFB, - 0x036, 0x00014BFB, - 0x036, 0x0001CBFB, - 0x036, 0x00024F4B, - 0x036, 0x0002CF4B, - 0x036, 0x00034F4B, - 0x036, 0x0003CF4B, - 0x036, 0x00044F4B, - 0x036, 0x0004CF4B, - 0x036, 0x00054F4B, - 0x036, 0x0005CF4B, - 0xFF0F02C0, 0xCDEF, - 0x018, 0x0001712A, - 0x0EF, 0x00000010, - 0x036, 0x00004BFB, - 0x036, 0x0000CBFB, - 0x036, 0x00014BFB, - 0x036, 0x0001CBFB, - 0x036, 0x00024F4B, - 0x036, 0x0002CF4B, - 0x036, 0x00034F4B, - 0x036, 0x0003CF4B, - 0x036, 0x00044F4B, - 0x036, 0x0004CF4B, - 0x036, 0x00054F4B, - 0x036, 0x0005CF4B, - 0xFF0F01C0, 0xCDEF, - 0x018, 0x0001712A, - 0x0EF, 0x00000010, - 0x036, 0x00004BFB, - 0x036, 0x0000CBFB, - 0x036, 0x00014BFB, - 0x036, 0x0001CBFB, - 0x036, 0x00024F4B, - 0x036, 0x0002CF4B, - 0x036, 0x00034F4B, - 0x036, 0x0003CF4B, - 0x036, 0x00044F4B, - 0x036, 0x0004CF4B, - 0x036, 0x00054F4B, - 0x036, 0x0005CF4B, - 0xFF0F07D8, 0xCDEF, + 0x80000008, 0x00000000, 0x40000000, 0x00000000, 0x018, 0x0001712A, 0x0EF, 0x00000010, 0x036, 0x00004BFB, @@ -1039,7 +845,7 @@ u32 RTL8812AE_RADIOA_ARRAY[] = { 0x036, 0x0004CF4B, 0x036, 0x00054F4B, 0x036, 0x0005CF4B, - 0xFF0F07D0, 0xCDEF, + 0x90000008, 0x05000000, 0x40000000, 0x00000000, 0x018, 0x0001712A, 0x0EF, 0x00000010, 0x036, 0x00004BFB, @@ -1054,91 +860,61 @@ u32 RTL8812AE_RADIOA_ARRAY[] = { 0x036, 0x0004CF4B, 0x036, 0x00054F4B, 0x036, 0x0005CF4B, - 0xCDCDCDCD, 0xCDCD, + 0xA0000000, 0x00000000, 0x018, 0x0001712A, 0x0EF, 0x00000010, 0x036, 0x00084EB4, 0x036, 0x0008CC35, 0x036, 0x00094C35, 0x036, 0x0009CC35, - 0x036, 0x000A4935, + 0x036, 0x000A4C35, 0x036, 0x000ACC35, 0x036, 0x000B4C35, 0x036, 0x000BCC35, - 0x036, 0x000C4EB4, - 0x036, 0x000CCEB5, - 0x036, 0x000D4EB5, - 0x036, 0x000DCEB5, - 0xFF0F0740, 0xDEAD, + 0x036, 0x000C4C34, + 0x036, 0x000CCC35, + 0x036, 0x000D4C35, + 0x036, 0x000DCC35, + 0xB0000000, 0x00000000, 0x0EF, 0x00000000, 0x0EF, 0x00000008, - 0xFF0F0740, 0xABCD, - 0x03C, 0x000002CC, - 0x03C, 0x00000522, - 0x03C, 0x00000902, - 0xFF0F02C0, 0xCDEF, + 0x80000008, 0x00000000, 0x40000000, 0x00000000, 0x03C, 0x000002CC, 0x03C, 0x00000522, 0x03C, 0x00000902, - 0xFF0F01C0, 0xCDEF, + 0x90000008, 0x05000000, 0x40000000, 0x00000000, 0x03C, 0x000002CC, 0x03C, 0x00000522, 0x03C, 0x00000902, - 0xFF0F07D8, 0xCDEF, - 0x03C, 0x000002CC, - 0x03C, 0x00000522, - 0x03C, 0x00000902, - 0xFF0F07D0, 0xCDEF, - 0x03C, 0x000002CC, - 0x03C, 0x00000522, - 0x03C, 0x00000902, - 0xCDCDCDCD, 0xCDCD, + 0xA0000000, 0x00000000, 0x03C, 0x000002A8, 0x03C, 0x000005A2, 0x03C, 0x00000880, - 0xFF0F0740, 0xDEAD, + 0xB0000000, 0x00000000, 0x0EF, 0x00000000, 0x018, 0x0001712A, 0x0EF, 0x00000002, 0x0DF, 0x00000080, - 0x01F, 0x00040064, - 0xFF0F0740, 0xABCD, - 0x061, 0x000FDD43, - 0x062, 0x00038F4B, - 0x063, 0x00032117, - 0x064, 0x000194AC, - 0x065, 0x000931D1, - 0xFF0F02C0, 0xCDEF, + 0x01F, 0x00000064, + 0x80000008, 0x00000000, 0x40000000, 0x00000000, 0x061, 0x000FDD43, 0x062, 0x00038F4B, 0x063, 0x00032117, 0x064, 0x000194AC, 0x065, 0x000931D1, - 0xFF0F01C0, 0xCDEF, + 0x90000008, 0x05000000, 0x40000000, 0x00000000, 0x061, 0x000FDD43, 0x062, 0x00038F4B, 0x063, 0x00032117, 0x064, 0x000194AC, - 0x065, 0x000931D1, - 0xFF0F07D8, 0xCDEF, - 0x061, 0x000FDD43, - 0x062, 0x00038F4B, - 0x063, 0x00032117, - 0x064, 0x000194AC, - 0x065, 0x000931D1, - 0xFF0F07D0, 0xCDEF, - 0x061, 0x000FDD43, - 0x062, 0x00038F4B, - 0x063, 0x00032117, - 0x064, 0x000194AC, - 0x065, 0x000931D1, - 0xCDCDCDCD, 0xCDCD, + 0x065, 0x000931D2, + 0xA0000000, 0x00000000, 0x061, 0x000E5D53, 0x062, 0x00038FCD, - 0x063, 0x000314EB, + 0x063, 0x000114EB, 0x064, 0x000196AC, 0x065, 0x000911D7, - 0xFF0F0740, 0xDEAD, + 0xB0000000, 0x00000000, 0x008, 0x00008400, 0x01C, 0x000739D2, 0x0B4, 0x0001E78D, @@ -1149,29 +925,29 @@ u32 RTL8812AE_RADIOA_ARRAY[] = { 0x0FE, 0x00000000, 0x0B4, 0x0001A78D, 0x018, 0x0001712A, - }; +u32 RTL8812AE_RADIOA_1TARRAYLEN = sizeof(RTL8812AE_RADIOA_ARRAY) / sizeof(u32); + u32 RTL8812AE_RADIOB_ARRAY[] = { 0x056, 0x00051CF2, 0x066, 0x00040000, 0x089, 0x00000080, - 0xFF0F0740, 0xABCD, - 0x086, 0x00014B38, - 0xFF0F01C0, 0xCDEF, - 0x086, 0x00014B38, - 0xFF0F02C0, 0xCDEF, - 0x086, 0x00014B38, - 0xFF0F07D8, 0xCDEF, + 0x80000001, 0x00000000, 0x40000000, 0x00000000, 0x086, 0x00014B3A, - 0xFF0F07D0, 0xCDEF, + 0x90000001, 0x00000005, 0x40000000, 0x00000000, 0x086, 0x00014B3A, - 0xCDCDCDCD, 0xCDCD, + 0xA0000000, 0x00000000, 0x086, 0x00014B38, - 0xFF0F0740, 0xDEAD, + 0xB0000000, 0x00000000, + 0x80000004, 0x00000000, 0x40000000, 0x00000000, + 0x08B, 0x00080180, + 0xA0000000, 0x00000000, + 0x08B, 0x00087180, + 0xB0000000, 0x00000000, 0x018, 0x00000006, 0x0EF, 0x00002000, - 0xFF0F07D8, 0xABCD, + 0x80000001, 0x00000000, 0x40000000, 0x00000000, 0x03B, 0x0003F218, 0x03B, 0x00030A58, 0x03B, 0x0002FA58, @@ -1179,7 +955,7 @@ u32 RTL8812AE_RADIOB_ARRAY[] = { 0x03B, 0x0001FA50, 0x03B, 0x00010248, 0x03B, 0x00008240, - 0xFF0F07D0, 0xCDEF, + 0x90000001, 0x00000005, 0x40000000, 0x00000000, 0x03B, 0x0003F218, 0x03B, 0x00030A58, 0x03B, 0x0002FA58, @@ -1187,7 +963,7 @@ u32 RTL8812AE_RADIOB_ARRAY[] = { 0x03B, 0x0001FA50, 0x03B, 0x00010248, 0x03B, 0x00008240, - 0xCDCDCDCD, 0xCDCD, + 0xA0000000, 0x00000000, 0x03B, 0x00038A58, 0x03B, 0x00037A58, 0x03B, 0x0002A590, @@ -1195,9 +971,9 @@ u32 RTL8812AE_RADIOB_ARRAY[] = { 0x03B, 0x00018248, 0x03B, 0x00010240, 0x03B, 0x00008240, - 0xFF0F07D8, 0xDEAD, + 0xB0000000, 0x00000000, 0x0EF, 0x00000100, - 0xFF0F07D8, 0xABCD, + 0x80000002, 0x00000000, 0x40000000, 0x00000000, 0x034, 0x0000A4EE, 0x034, 0x00009076, 0x034, 0x00008073, @@ -1209,7 +985,7 @@ u32 RTL8812AE_RADIOB_ARRAY[] = { 0x034, 0x00002028, 0x034, 0x00001025, 0x034, 0x00000022, - 0xCDCDCDCD, 0xCDCD, + 0xA0000000, 0x00000000, 0x034, 0x0000ADF4, 0x034, 0x00009DF1, 0x034, 0x00008DEE, @@ -1221,7 +997,7 @@ u32 RTL8812AE_RADIOB_ARRAY[] = { 0x034, 0x000024E7, 0x034, 0x0000146B, 0x034, 0x0000006D, - 0xFF0F07D8, 0xDEAD, + 0xB0000000, 0x00000000, 0x0EF, 0x00000000, 0x0EF, 0x000020A2, 0x0DF, 0x00000080, @@ -1314,31 +1090,7 @@ u32 RTL8812AE_RADIOB_ARRAY[] = { 0x03B, 0x00082080, 0x03C, 0x00010000, 0x0EF, 0x00001100, - 0xFF0F0740, 0xABCD, - 0x034, 0x0004A0B2, - 0x034, 0x000490AF, - 0x034, 0x00048070, - 0x034, 0x0004706D, - 0x034, 0x00046050, - 0x034, 0x0004504D, - 0x034, 0x0004404A, - 0x034, 0x00043047, - 0x034, 0x0004200A, - 0x034, 0x00041007, - 0x034, 0x00040004, - 0xFF0F01C0, 0xCDEF, - 0x034, 0x0004A0B2, - 0x034, 0x000490AF, - 0x034, 0x00048070, - 0x034, 0x0004706D, - 0x034, 0x00046050, - 0x034, 0x0004504D, - 0x034, 0x0004404A, - 0x034, 0x00043047, - 0x034, 0x0004200A, - 0x034, 0x00041007, - 0x034, 0x00040004, - 0xFF0F02C0, 0xCDEF, + 0x80000008, 0x00000000, 0x40000000, 0x00000000, 0x034, 0x0004A0B2, 0x034, 0x000490AF, 0x034, 0x00048070, @@ -1350,80 +1102,32 @@ u32 RTL8812AE_RADIOB_ARRAY[] = { 0x034, 0x0004200A, 0x034, 0x00041007, 0x034, 0x00040004, - 0xFF0F07D8, 0xCDEF, - 0x034, 0x0004A0B2, - 0x034, 0x000490AF, - 0x034, 0x00048070, - 0x034, 0x0004706D, - 0x034, 0x00046050, - 0x034, 0x0004504D, - 0x034, 0x0004404A, - 0x034, 0x00043047, - 0x034, 0x0004200A, - 0x034, 0x00041007, - 0x034, 0x00040004, - 0xFF0F07D0, 0xCDEF, - 0x034, 0x0004A0B2, - 0x034, 0x000490AF, - 0x034, 0x00048070, - 0x034, 0x0004706D, - 0x034, 0x00046050, - 0x034, 0x0004504D, - 0x034, 0x0004404A, - 0x034, 0x00043047, - 0x034, 0x0004200A, - 0x034, 0x00041007, - 0x034, 0x00040004, - 0xCDCDCDCD, 0xCDCD, + 0x90000008, 0x05000000, 0x40000000, 0x00000000, + 0x034, 0x0004A0B1, + 0x034, 0x000490AE, + 0x034, 0x0004806F, + 0x034, 0x0004706C, + 0x034, 0x0004604C, + 0x034, 0x00045049, + 0x034, 0x00044046, + 0x034, 0x00043043, + 0x034, 0x00042006, + 0x034, 0x00041003, + 0x034, 0x00040000, + 0xA0000000, 0x00000000, 0x034, 0x0004ADF5, 0x034, 0x00049DF2, 0x034, 0x00048DEF, 0x034, 0x00047DEC, 0x034, 0x00046DE9, - 0x034, 0x00045DC9, - 0x034, 0x00044CE8, - 0x034, 0x000438CA, - 0x034, 0x00042889, - 0x034, 0x0004184A, - 0x034, 0x0004044A, - 0xFF0F0740, 0xDEAD, - 0xFF0F0740, 0xABCD, - 0x034, 0x0002A0B2, - 0x034, 0x000290AF, - 0x034, 0x00028070, - 0x034, 0x0002706D, - 0x034, 0x00026050, - 0x034, 0x0002504D, - 0x034, 0x0002404A, - 0x034, 0x00023047, - 0x034, 0x0002200A, - 0x034, 0x00021007, - 0x034, 0x00020004, - 0xFF0F01C0, 0xCDEF, - 0x034, 0x0002A0B2, - 0x034, 0x000290AF, - 0x034, 0x00028070, - 0x034, 0x0002706D, - 0x034, 0x00026050, - 0x034, 0x0002504D, - 0x034, 0x0002404A, - 0x034, 0x00023047, - 0x034, 0x0002200A, - 0x034, 0x00021007, - 0x034, 0x00020004, - 0xFF0F02C0, 0xCDEF, - 0x034, 0x0002A0B2, - 0x034, 0x000290AF, - 0x034, 0x00028070, - 0x034, 0x0002706D, - 0x034, 0x00026050, - 0x034, 0x0002504D, - 0x034, 0x0002404A, - 0x034, 0x00023047, - 0x034, 0x0002200A, - 0x034, 0x00021007, - 0x034, 0x00020004, - 0xFF0F07D8, 0xCDEF, + 0x034, 0x00045DE6, + 0x034, 0x00044DE3, + 0x034, 0x000438C8, + 0x034, 0x000428C5, + 0x034, 0x000418C2, + 0x034, 0x000408C0, + 0xB0000000, 0x00000000, + 0x80000008, 0x00000000, 0x40000000, 0x00000000, 0x034, 0x0002A0B2, 0x034, 0x000290AF, 0x034, 0x00028070, @@ -1435,68 +1139,32 @@ u32 RTL8812AE_RADIOB_ARRAY[] = { 0x034, 0x0002200A, 0x034, 0x00021007, 0x034, 0x00020004, - 0xFF0F07D0, 0xCDEF, - 0x034, 0x0002A0B2, - 0x034, 0x000290AF, - 0x034, 0x00028070, - 0x034, 0x0002706D, - 0x034, 0x00026050, - 0x034, 0x0002504D, - 0x034, 0x0002404A, - 0x034, 0x00023047, - 0x034, 0x0002200A, - 0x034, 0x00021007, - 0x034, 0x00020004, - 0xCDCDCDCD, 0xCDCD, + 0x90000008, 0x05000000, 0x40000000, 0x00000000, + 0x034, 0x0002A0B3, + 0x034, 0x000290B0, + 0x034, 0x00028071, + 0x034, 0x0002706E, + 0x034, 0x0002604E, + 0x034, 0x0002504B, + 0x034, 0x00024048, + 0x034, 0x00023045, + 0x034, 0x00022008, + 0x034, 0x00021005, + 0x034, 0x00020002, + 0xA0000000, 0x00000000, 0x034, 0x0002ADF5, 0x034, 0x00029DF2, 0x034, 0x00028DEF, 0x034, 0x00027DEC, 0x034, 0x00026DE9, - 0x034, 0x00025DC9, - 0x034, 0x00024CE8, - 0x034, 0x000238CA, - 0x034, 0x00022889, - 0x034, 0x0002184A, - 0x034, 0x0002044A, - 0xFF0F0740, 0xDEAD, - 0xFF0F0740, 0xABCD, - 0x034, 0x0000A0B2, - 0x034, 0x000090AF, - 0x034, 0x00008070, - 0x034, 0x0000706D, - 0x034, 0x00006050, - 0x034, 0x0000504D, - 0x034, 0x0000404A, - 0x034, 0x00003047, - 0x034, 0x0000200A, - 0x034, 0x00001007, - 0x034, 0x00000004, - 0xFF0F01C0, 0xCDEF, - 0x034, 0x0000A0B2, - 0x034, 0x000090AF, - 0x034, 0x00008070, - 0x034, 0x0000706D, - 0x034, 0x00006050, - 0x034, 0x0000504D, - 0x034, 0x0000404A, - 0x034, 0x00003047, - 0x034, 0x0000200A, - 0x034, 0x00001007, - 0x034, 0x00000004, - 0xFF0F02C0, 0xCDEF, - 0x034, 0x0000A0B2, - 0x034, 0x000090AF, - 0x034, 0x00008070, - 0x034, 0x0000706D, - 0x034, 0x00006050, - 0x034, 0x0000504D, - 0x034, 0x0000404A, - 0x034, 0x00003047, - 0x034, 0x0000200A, - 0x034, 0x00001007, - 0x034, 0x00000004, - 0xFF0F07D8, 0xCDEF, + 0x034, 0x00025DE6, + 0x034, 0x00024DE3, + 0x034, 0x000238C8, + 0x034, 0x000228C5, + 0x034, 0x000218C2, + 0x034, 0x000208C0, + 0xB0000000, 0x00000000, + 0x80000008, 0x00000000, 0x40000000, 0x00000000, 0x034, 0x0000A0B2, 0x034, 0x000090AF, 0x034, 0x00008070, @@ -1508,72 +1176,33 @@ u32 RTL8812AE_RADIOB_ARRAY[] = { 0x034, 0x0000200A, 0x034, 0x00001007, 0x034, 0x00000004, - 0xFF0F07D0, 0xCDEF, - 0x034, 0x0000A0B2, - 0x034, 0x000090AF, + 0x90000008, 0x05000000, 0x40000000, 0x00000000, + 0x034, 0x0000A0B3, + 0x034, 0x000090B0, 0x034, 0x00008070, 0x034, 0x0000706D, - 0x034, 0x00006050, - 0x034, 0x0000504D, - 0x034, 0x0000404A, - 0x034, 0x00003047, - 0x034, 0x0000200A, - 0x034, 0x00001007, - 0x034, 0x00000004, - 0xCDCDCDCD, 0xCDCD, + 0x034, 0x0000604D, + 0x034, 0x0000504A, + 0x034, 0x00004047, + 0x034, 0x00003044, + 0x034, 0x00002007, + 0x034, 0x00001004, + 0x034, 0x00000001, + 0xA0000000, 0x00000000, 0x034, 0x0000AFF7, 0x034, 0x00009DF7, 0x034, 0x00008DF4, 0x034, 0x00007DF1, 0x034, 0x00006DEE, - 0x034, 0x00005DCD, - 0x034, 0x00004CEB, + 0x034, 0x00005DEB, + 0x034, 0x00004DE8, 0x034, 0x000038CC, - 0x034, 0x0000288B, - 0x034, 0x0000184C, - 0x034, 0x0000044C, - 0xFF0F0740, 0xDEAD, - 0x0EF, 0x00000000, - 0xFF0F0740, 0xABCD, - 0x018, 0x0001712A, - 0x0EF, 0x00000040, - 0x035, 0x000001C5, - 0x035, 0x000081C5, - 0x035, 0x000101C5, - 0x035, 0x00020174, - 0x035, 0x00028174, - 0x035, 0x00030174, - 0x035, 0x00040185, - 0x035, 0x00048185, - 0x035, 0x00050185, - 0x0EF, 0x00000000, - 0xFF0F01C0, 0xCDEF, - 0x018, 0x0001712A, - 0x0EF, 0x00000040, - 0x035, 0x000001C5, - 0x035, 0x000081C5, - 0x035, 0x000101C5, - 0x035, 0x00020174, - 0x035, 0x00028174, - 0x035, 0x00030174, - 0x035, 0x00040185, - 0x035, 0x00048185, - 0x035, 0x00050185, - 0x0EF, 0x00000000, - 0xFF0F02C0, 0xCDEF, - 0x018, 0x0001712A, - 0x0EF, 0x00000040, - 0x035, 0x000001C5, - 0x035, 0x000081C5, - 0x035, 0x000101C5, - 0x035, 0x00020174, - 0x035, 0x00028174, - 0x035, 0x00030174, - 0x035, 0x00040185, - 0x035, 0x00048185, - 0x035, 0x00050185, + 0x034, 0x000028C9, + 0x034, 0x000018C6, + 0x034, 0x000008C3, + 0xB0000000, 0x00000000, 0x0EF, 0x00000000, - 0xFF0F07D8, 0xCDEF, + 0x80000008, 0x00000000, 0x40000000, 0x00000000, 0x018, 0x0001712A, 0x0EF, 0x00000040, 0x035, 0x000001C5, @@ -1586,7 +1215,7 @@ u32 RTL8812AE_RADIOB_ARRAY[] = { 0x035, 0x00048185, 0x035, 0x00050185, 0x0EF, 0x00000000, - 0xFF0F07D0, 0xCDEF, + 0x90000008, 0x05000000, 0x40000000, 0x00000000, 0x018, 0x0001712A, 0x0EF, 0x00000040, 0x035, 0x000001C5, @@ -1599,51 +1228,21 @@ u32 RTL8812AE_RADIOB_ARRAY[] = { 0x035, 0x00048185, 0x035, 0x00050185, 0x0EF, 0x00000000, - 0xCDCDCDCD, 0xCDCD, + 0xA0000000, 0x00000000, 0x018, 0x0001712A, 0x0EF, 0x00000040, - 0x035, 0x00000186, - 0x035, 0x00008186, - 0x035, 0x00010185, - 0x035, 0x000201D5, - 0x035, 0x000281D5, - 0x035, 0x000301D5, - 0x035, 0x000401D5, - 0x035, 0x000481D5, - 0x035, 0x000501D5, + 0x035, 0x00000188, + 0x035, 0x00008147, + 0x035, 0x00010147, + 0x035, 0x000201D7, + 0x035, 0x000281D7, + 0x035, 0x000301D7, + 0x035, 0x000401D8, + 0x035, 0x000481D8, + 0x035, 0x000501D8, 0x0EF, 0x00000000, - 0xFF0F0740, 0xDEAD, - 0xFF0F0740, 0xABCD, - 0x018, 0x0001712A, - 0x0EF, 0x00000010, - 0x036, 0x00005B8B, - 0x036, 0x0000DB8B, - 0x036, 0x00015B8B, - 0x036, 0x0001DB8B, - 0x036, 0x000262DB, - 0x036, 0x0002E2DB, - 0x036, 0x000362DB, - 0x036, 0x0003E2DB, - 0x036, 0x0004553B, - 0x036, 0x0004D53B, - 0x036, 0x0005553B, - 0x036, 0x0005D53B, - 0xFF0F01C0, 0xCDEF, - 0x018, 0x0001712A, - 0x0EF, 0x00000010, - 0x036, 0x00005B8B, - 0x036, 0x0000DB8B, - 0x036, 0x00015B8B, - 0x036, 0x0001DB8B, - 0x036, 0x000262DB, - 0x036, 0x0002E2DB, - 0x036, 0x000362DB, - 0x036, 0x0003E2DB, - 0x036, 0x0004553B, - 0x036, 0x0004D53B, - 0x036, 0x0005553B, - 0x036, 0x0005D53B, - 0xFF0F02C0, 0xCDEF, + 0xB0000000, 0x00000000, + 0x80000008, 0x00000000, 0x40000000, 0x00000000, 0x018, 0x0001712A, 0x0EF, 0x00000010, 0x036, 0x00005B8B, @@ -1658,7 +1257,7 @@ u32 RTL8812AE_RADIOB_ARRAY[] = { 0x036, 0x0004D53B, 0x036, 0x0005553B, 0x036, 0x0005D53B, - 0xFF0F07D8, 0xCDEF, + 0x90000008, 0x05000000, 0x40000000, 0x00000000, 0x018, 0x0001712A, 0x0EF, 0x00000010, 0x036, 0x00005B8B, @@ -1673,109 +1272,71 @@ u32 RTL8812AE_RADIOB_ARRAY[] = { 0x036, 0x0004D53B, 0x036, 0x0005553B, 0x036, 0x0005D53B, - 0xFF0F07D0, 0xCDEF, - 0x018, 0x0001712A, - 0x0EF, 0x00000010, - 0x036, 0x00005B8B, - 0x036, 0x0000DB8B, - 0x036, 0x00015B8B, - 0x036, 0x0001DB8B, - 0x036, 0x000262DB, - 0x036, 0x0002E2DB, - 0x036, 0x000362DB, - 0x036, 0x0003E2DB, - 0x036, 0x0004553B, - 0x036, 0x0004D53B, - 0x036, 0x0005553B, - 0x036, 0x0005D53B, - 0xCDCDCDCD, 0xCDCD, + 0xA0000000, 0x00000000, 0x018, 0x0001712A, 0x0EF, 0x00000010, 0x036, 0x00084EB4, - 0x036, 0x0008C9B4, - 0x036, 0x000949B4, - 0x036, 0x0009C9B4, - 0x036, 0x000A4935, - 0x036, 0x000AC935, - 0x036, 0x000B4935, - 0x036, 0x000BC935, - 0x036, 0x000C4EB4, - 0x036, 0x000CCEB4, - 0x036, 0x000D4EB4, - 0x036, 0x000DCEB4, - 0xFF0F0740, 0xDEAD, + 0x036, 0x0008CC35, + 0x036, 0x00094C35, + 0x036, 0x0009CC35, + 0x036, 0x000A4C35, + 0x036, 0x000ACC35, + 0x036, 0x000B4C35, + 0x036, 0x000BCC35, + 0x036, 0x000C4C34, + 0x036, 0x000CCC35, + 0x036, 0x000D4C35, + 0x036, 0x000DCC35, + 0xB0000000, 0x00000000, 0x0EF, 0x00000000, 0x0EF, 0x00000008, - 0xFF0F0740, 0xABCD, - 0x03C, 0x000002DC, - 0x03C, 0x00000524, - 0x03C, 0x00000902, - 0xFF0F01C0, 0xCDEF, - 0x03C, 0x000002DC, - 0x03C, 0x00000524, - 0x03C, 0x00000902, - 0xFF0F02C0, 0xCDEF, + 0x80000008, 0x00000000, 0x40000000, 0x00000000, 0x03C, 0x000002DC, 0x03C, 0x00000524, 0x03C, 0x00000902, - 0xFF0F07D8, 0xCDEF, + 0x90000008, 0x05000000, 0x40000000, 0x00000000, 0x03C, 0x000002DC, 0x03C, 0x00000524, 0x03C, 0x00000902, - 0xFF0F07D0, 0xCDEF, - 0x03C, 0x000002DC, - 0x03C, 0x00000524, - 0x03C, 0x00000902, - 0xCDCDCDCD, 0xCDCD, - 0x03C, 0x000002AA, + 0xA0000000, 0x00000000, + 0x03C, 0x000002A8, 0x03C, 0x000005A2, 0x03C, 0x00000880, - 0xFF0F0740, 0xDEAD, + 0xB0000000, 0x00000000, 0x0EF, 0x00000000, 0x018, 0x0001712A, 0x0EF, 0x00000002, 0x0DF, 0x00000080, - 0xFF0F0740, 0xABCD, - 0x061, 0x000EAC43, - 0x062, 0x00038F47, - 0x063, 0x00031157, - 0x064, 0x0001C4AC, - 0x065, 0x000931D1, - 0xFF0F01C0, 0xCDEF, + 0x80000008, 0x00000000, 0x40000000, 0x00000000, 0x061, 0x000EAC43, 0x062, 0x00038F47, 0x063, 0x00031157, 0x064, 0x0001C4AC, 0x065, 0x000931D1, - 0xFF0F02C0, 0xCDEF, + 0x90000008, 0x05000000, 0x40000000, 0x00000000, 0x061, 0x000EAC43, 0x062, 0x00038F47, 0x063, 0x00031157, 0x064, 0x0001C4AC, - 0x065, 0x000931D1, - 0xFF0F07D8, 0xCDEF, + 0x065, 0x000931D2, + 0x90000002, 0x00000000, 0x40000000, 0x00000000, 0x061, 0x000EAC43, 0x062, 0x00038F47, 0x063, 0x00031157, 0x064, 0x0001C4AC, 0x065, 0x000931D1, - 0xFF0F07D0, 0xCDEF, - 0x061, 0x000EAC43, - 0x062, 0x00038F47, - 0x063, 0x00031157, - 0x064, 0x0001C4AC, - 0x065, 0x000931D1, - 0xCDCDCDCD, 0xCDCD, + 0xA0000000, 0x00000000, 0x061, 0x000E5D53, 0x062, 0x00038FCD, - 0x063, 0x000314EB, + 0x063, 0x000114EB, 0x064, 0x000196AC, - 0x065, 0x000931D7, - 0xFF0F0740, 0xDEAD, + 0x065, 0x000911D7, + 0xB0000000, 0x00000000, 0x008, 0x00008400, - }; +u32 RTL8812AE_RADIOB_1TARRAYLEN = sizeof(RTL8812AE_RADIOB_ARRAY) / sizeof(u32); + u32 RTL8821AE_RADIOA_ARRAY[] = { 0x018, 0x0001712A, 0x056, 0x00051CF2, @@ -2285,16 +1846,16 @@ u32 RTL8821AE_RADIOA_ARRAY[] = { 0x0EF, 0x00000000, 0x0EF, 0x00000100, 0x034, 0x0000ADF3, - 0x034, 0x00009DEF, - 0x034, 0x00008DEC, - 0x034, 0x00007DE9, - 0x034, 0x00006CED, - 0x034, 0x00005CE9, - 0x034, 0x000044E9, - 0x034, 0x000034E6, - 0x034, 0x0000246A, - 0x034, 0x00001467, - 0x034, 0x00000068, + 0x034, 0x00009DF0, + 0x034, 0x00008D70, + 0x034, 0x00007D6D, + 0x034, 0x00006CEE, + 0x034, 0x00005CCC, + 0x034, 0x000044EC, + 0x034, 0x000034AC, + 0x034, 0x0000246D, + 0x034, 0x0000106F, + 0x034, 0x0000006C, 0x0EF, 0x00000000, 0x0ED, 0x00000010, 0x044, 0x0000ADF2, @@ -2365,18 +1926,21 @@ u32 RTL8821AE_RADIOA_ARRAY[] = { 0x0FE, 0x00000000, 0x0FE, 0x00000000, 0x018, 0x0001712A, + }; +u32 RTL8821AE_RADIOA_1TARRAYLEN = sizeof(RTL8821AE_RADIOA_ARRAY) / sizeof(u32); + u32 RTL8812AE_MAC_REG_ARRAY[] = { 0x010, 0x0000000C, - 0xFF0F0180, 0xABCD, - 0x025, 0x0000000F, - 0xFF0F01C0, 0xCDEF, + 0x80000200, 0x00000000, 0x40000000, 0x00000000, + 0x011, 0x00000066, + 0xA0000000, 0x00000000, + 0x011, 0x0000005A, + 0xB0000000, 0x00000000, 0x025, 0x0000000F, - 0xCDCDCDCD, 0xCDCD, - 0x025, 0x0000006F, - 0xFF0F0180, 0xDEAD, 0x072, 0x00000000, + 0x420, 0x00000080, 0x428, 0x0000000A, 0x429, 0x00000010, 0x430, 0x00000000, @@ -2443,7 +2007,7 @@ u32 RTL8812AE_MAC_REG_ARRAY[] = { 0x559, 0x00000002, 0x55C, 0x00000050, 0x55D, 0x000000FF, - 0x604, 0x00000001, + 0x604, 0x00000009, 0x605, 0x00000030, 0x607, 0x00000003, 0x608, 0x0000000E, @@ -2475,9 +2039,10 @@ u32 RTL8812AE_MAC_REG_ARRAY[] = { 0x70A, 0x00000065, 0x70B, 0x00000087, 0x718, 0x00000040, - }; +u32 RTL8812AE_MAC_1T_ARRAYLEN = sizeof(RTL8812AE_MAC_REG_ARRAY) / sizeof(u32); + u32 RTL8821AE_MAC_REG_ARRAY[] = { 0x428, 0x0000000A, 0x429, 0x00000010, @@ -2578,8 +2143,10 @@ u32 RTL8821AE_MAC_REG_ARRAY[] = { 0x718, 0x00000040, }; +u32 RTL8821AE_MAC_1T_ARRAYLEN = sizeof(RTL8821AE_MAC_REG_ARRAY) / sizeof(u32); + u32 RTL8812AE_AGC_TAB_ARRAY[] = { - 0xFF0F07D8, 0xABCD, + 0x80000001, 0x00000000, 0x40000000, 0x00000000, 0x81C, 0xFC000001, 0x81C, 0xFB020001, 0x81C, 0xFA040001, @@ -2644,7 +2211,7 @@ u32 RTL8812AE_AGC_TAB_ARRAY[] = { 0x81C, 0x217A0001, 0x81C, 0x217C0001, 0x81C, 0x217E0001, - 0xFF0F07D0, 0xCDEF, + 0x90000001, 0x00000005, 0x40000000, 0x00000000, 0x81C, 0xF9000001, 0x81C, 0xF8020001, 0x81C, 0xF7040001, @@ -2709,7 +2276,7 @@ u32 RTL8812AE_AGC_TAB_ARRAY[] = { 0x81C, 0x217A0001, 0x81C, 0x217C0001, 0x81C, 0x217E0001, - 0xCDCDCDCD, 0xCDCD, + 0xA0000000, 0x00000000, 0x81C, 0xFF000001, 0x81C, 0xFF020001, 0x81C, 0xFF040001, @@ -2774,333 +2341,8 @@ u32 RTL8812AE_AGC_TAB_ARRAY[] = { 0x81C, 0x417A0001, 0x81C, 0x417C0001, 0x81C, 0x417E0001, - 0xFF0F07D8, 0xDEAD, - 0xFF0F0180, 0xABCD, - 0x81C, 0xFC800001, - 0x81C, 0xFB820001, - 0x81C, 0xFA840001, - 0x81C, 0xF9860001, - 0x81C, 0xF8880001, - 0x81C, 0xF78A0001, - 0x81C, 0xF68C0001, - 0x81C, 0xF58E0001, - 0x81C, 0xF4900001, - 0x81C, 0xF3920001, - 0x81C, 0xF2940001, - 0x81C, 0xF1960001, - 0x81C, 0xF0980001, - 0x81C, 0xEF9A0001, - 0x81C, 0xEE9C0001, - 0x81C, 0xED9E0001, - 0x81C, 0xECA00001, - 0x81C, 0xEBA20001, - 0x81C, 0xEAA40001, - 0x81C, 0xE9A60001, - 0x81C, 0xE8A80001, - 0x81C, 0xE7AA0001, - 0x81C, 0xE6AC0001, - 0x81C, 0xE5AE0001, - 0x81C, 0xE4B00001, - 0x81C, 0xE3B20001, - 0x81C, 0xA8B40001, - 0x81C, 0xA7B60001, - 0x81C, 0xA6B80001, - 0x81C, 0xA5BA0001, - 0x81C, 0xA4BC0001, - 0x81C, 0xA3BE0001, - 0x81C, 0xA2C00001, - 0x81C, 0xA1C20001, - 0x81C, 0x68C40001, - 0x81C, 0x67C60001, - 0x81C, 0x66C80001, - 0x81C, 0x65CA0001, - 0x81C, 0x64CC0001, - 0x81C, 0x47CE0001, - 0x81C, 0x46D00001, - 0x81C, 0x45D20001, - 0x81C, 0x44D40001, - 0x81C, 0x43D60001, - 0x81C, 0x42D80001, - 0x81C, 0x08DA0001, - 0x81C, 0x07DC0001, - 0x81C, 0x06DE0001, - 0x81C, 0x05E00001, - 0x81C, 0x04E20001, - 0x81C, 0x03E40001, - 0x81C, 0x02E60001, - 0x81C, 0x01E80001, - 0x81C, 0x01EA0001, - 0x81C, 0x01EC0001, - 0x81C, 0x01EE0001, - 0x81C, 0x01F00001, - 0x81C, 0x01F20001, - 0x81C, 0x01F40001, - 0x81C, 0x01F60001, - 0x81C, 0x01F80001, - 0x81C, 0x01FA0001, - 0x81C, 0x01FC0001, - 0x81C, 0x01FE0001, - 0xFF0F0280, 0xCDEF, - 0x81C, 0xFC800001, - 0x81C, 0xFB820001, - 0x81C, 0xFA840001, - 0x81C, 0xF9860001, - 0x81C, 0xF8880001, - 0x81C, 0xF78A0001, - 0x81C, 0xF68C0001, - 0x81C, 0xF58E0001, - 0x81C, 0xF4900001, - 0x81C, 0xF3920001, - 0x81C, 0xF2940001, - 0x81C, 0xF1960001, - 0x81C, 0xF0980001, - 0x81C, 0xEF9A0001, - 0x81C, 0xEE9C0001, - 0x81C, 0xED9E0001, - 0x81C, 0xECA00001, - 0x81C, 0xEBA20001, - 0x81C, 0xEAA40001, - 0x81C, 0xE9A60001, - 0x81C, 0xE8A80001, - 0x81C, 0xE7AA0001, - 0x81C, 0xE6AC0001, - 0x81C, 0xE5AE0001, - 0x81C, 0xE4B00001, - 0x81C, 0xE3B20001, - 0x81C, 0xA8B40001, - 0x81C, 0xA7B60001, - 0x81C, 0xA6B80001, - 0x81C, 0xA5BA0001, - 0x81C, 0xA4BC0001, - 0x81C, 0xA3BE0001, - 0x81C, 0xA2C00001, - 0x81C, 0xA1C20001, - 0x81C, 0x68C40001, - 0x81C, 0x67C60001, - 0x81C, 0x66C80001, - 0x81C, 0x65CA0001, - 0x81C, 0x64CC0001, - 0x81C, 0x47CE0001, - 0x81C, 0x46D00001, - 0x81C, 0x45D20001, - 0x81C, 0x44D40001, - 0x81C, 0x43D60001, - 0x81C, 0x42D80001, - 0x81C, 0x08DA0001, - 0x81C, 0x07DC0001, - 0x81C, 0x06DE0001, - 0x81C, 0x05E00001, - 0x81C, 0x04E20001, - 0x81C, 0x03E40001, - 0x81C, 0x02E60001, - 0x81C, 0x01E80001, - 0x81C, 0x01EA0001, - 0x81C, 0x01EC0001, - 0x81C, 0x01EE0001, - 0x81C, 0x01F00001, - 0x81C, 0x01F20001, - 0x81C, 0x01F40001, - 0x81C, 0x01F60001, - 0x81C, 0x01F80001, - 0x81C, 0x01FA0001, - 0x81C, 0x01FC0001, - 0x81C, 0x01FE0001, - 0xFF0F01C0, 0xCDEF, - 0x81C, 0xFC800001, - 0x81C, 0xFB820001, - 0x81C, 0xFA840001, - 0x81C, 0xF9860001, - 0x81C, 0xF8880001, - 0x81C, 0xF78A0001, - 0x81C, 0xF68C0001, - 0x81C, 0xF58E0001, - 0x81C, 0xF4900001, - 0x81C, 0xF3920001, - 0x81C, 0xF2940001, - 0x81C, 0xF1960001, - 0x81C, 0xF0980001, - 0x81C, 0xEF9A0001, - 0x81C, 0xEE9C0001, - 0x81C, 0xED9E0001, - 0x81C, 0xECA00001, - 0x81C, 0xEBA20001, - 0x81C, 0xEAA40001, - 0x81C, 0xE9A60001, - 0x81C, 0xE8A80001, - 0x81C, 0xE7AA0001, - 0x81C, 0xE6AC0001, - 0x81C, 0xE5AE0001, - 0x81C, 0xE4B00001, - 0x81C, 0xE3B20001, - 0x81C, 0xA8B40001, - 0x81C, 0xA7B60001, - 0x81C, 0xA6B80001, - 0x81C, 0xA5BA0001, - 0x81C, 0xA4BC0001, - 0x81C, 0xA3BE0001, - 0x81C, 0xA2C00001, - 0x81C, 0xA1C20001, - 0x81C, 0x68C40001, - 0x81C, 0x67C60001, - 0x81C, 0x66C80001, - 0x81C, 0x65CA0001, - 0x81C, 0x64CC0001, - 0x81C, 0x47CE0001, - 0x81C, 0x46D00001, - 0x81C, 0x45D20001, - 0x81C, 0x44D40001, - 0x81C, 0x43D60001, - 0x81C, 0x42D80001, - 0x81C, 0x08DA0001, - 0x81C, 0x07DC0001, - 0x81C, 0x06DE0001, - 0x81C, 0x05E00001, - 0x81C, 0x04E20001, - 0x81C, 0x03E40001, - 0x81C, 0x02E60001, - 0x81C, 0x01E80001, - 0x81C, 0x01EA0001, - 0x81C, 0x01EC0001, - 0x81C, 0x01EE0001, - 0x81C, 0x01F00001, - 0x81C, 0x01F20001, - 0x81C, 0x01F40001, - 0x81C, 0x01F60001, - 0x81C, 0x01F80001, - 0x81C, 0x01FA0001, - 0x81C, 0x01FC0001, - 0x81C, 0x01FE0001, - 0xFF0F02C0, 0xCDEF, - 0x81C, 0xFC800001, - 0x81C, 0xFB820001, - 0x81C, 0xFA840001, - 0x81C, 0xF9860001, - 0x81C, 0xF8880001, - 0x81C, 0xF78A0001, - 0x81C, 0xF68C0001, - 0x81C, 0xF58E0001, - 0x81C, 0xF4900001, - 0x81C, 0xF3920001, - 0x81C, 0xF2940001, - 0x81C, 0xF1960001, - 0x81C, 0xF0980001, - 0x81C, 0xEF9A0001, - 0x81C, 0xEE9C0001, - 0x81C, 0xED9E0001, - 0x81C, 0xECA00001, - 0x81C, 0xEBA20001, - 0x81C, 0xEAA40001, - 0x81C, 0xE9A60001, - 0x81C, 0xE8A80001, - 0x81C, 0xE7AA0001, - 0x81C, 0xE6AC0001, - 0x81C, 0xE5AE0001, - 0x81C, 0xE4B00001, - 0x81C, 0xE3B20001, - 0x81C, 0xA8B40001, - 0x81C, 0xA7B60001, - 0x81C, 0xA6B80001, - 0x81C, 0xA5BA0001, - 0x81C, 0xA4BC0001, - 0x81C, 0xA3BE0001, - 0x81C, 0xA2C00001, - 0x81C, 0xA1C20001, - 0x81C, 0x68C40001, - 0x81C, 0x67C60001, - 0x81C, 0x66C80001, - 0x81C, 0x65CA0001, - 0x81C, 0x64CC0001, - 0x81C, 0x47CE0001, - 0x81C, 0x46D00001, - 0x81C, 0x45D20001, - 0x81C, 0x44D40001, - 0x81C, 0x43D60001, - 0x81C, 0x42D80001, - 0x81C, 0x08DA0001, - 0x81C, 0x07DC0001, - 0x81C, 0x06DE0001, - 0x81C, 0x05E00001, - 0x81C, 0x04E20001, - 0x81C, 0x03E40001, - 0x81C, 0x02E60001, - 0x81C, 0x01E80001, - 0x81C, 0x01EA0001, - 0x81C, 0x01EC0001, - 0x81C, 0x01EE0001, - 0x81C, 0x01F00001, - 0x81C, 0x01F20001, - 0x81C, 0x01F40001, - 0x81C, 0x01F60001, - 0x81C, 0x01F80001, - 0x81C, 0x01FA0001, - 0x81C, 0x01FC0001, - 0x81C, 0x01FE0001, - 0xFF0F07D8, 0xCDEF, - 0x81C, 0xFC800001, - 0x81C, 0xFB820001, - 0x81C, 0xFA840001, - 0x81C, 0xF9860001, - 0x81C, 0xF8880001, - 0x81C, 0xF78A0001, - 0x81C, 0xF68C0001, - 0x81C, 0xF58E0001, - 0x81C, 0xF4900001, - 0x81C, 0xF3920001, - 0x81C, 0xF2940001, - 0x81C, 0xF1960001, - 0x81C, 0xF0980001, - 0x81C, 0xEF9A0001, - 0x81C, 0xEE9C0001, - 0x81C, 0xED9E0001, - 0x81C, 0xECA00001, - 0x81C, 0xEBA20001, - 0x81C, 0xEAA40001, - 0x81C, 0xE9A60001, - 0x81C, 0xE8A80001, - 0x81C, 0xE7AA0001, - 0x81C, 0xE6AC0001, - 0x81C, 0xE5AE0001, - 0x81C, 0xE4B00001, - 0x81C, 0xE3B20001, - 0x81C, 0xA8B40001, - 0x81C, 0xA7B60001, - 0x81C, 0xA6B80001, - 0x81C, 0xA5BA0001, - 0x81C, 0xA4BC0001, - 0x81C, 0xA3BE0001, - 0x81C, 0xA2C00001, - 0x81C, 0xA1C20001, - 0x81C, 0x68C40001, - 0x81C, 0x67C60001, - 0x81C, 0x66C80001, - 0x81C, 0x65CA0001, - 0x81C, 0x64CC0001, - 0x81C, 0x47CE0001, - 0x81C, 0x46D00001, - 0x81C, 0x45D20001, - 0x81C, 0x44D40001, - 0x81C, 0x43D60001, - 0x81C, 0x42D80001, - 0x81C, 0x08DA0001, - 0x81C, 0x07DC0001, - 0x81C, 0x06DE0001, - 0x81C, 0x05E00001, - 0x81C, 0x04E20001, - 0x81C, 0x03E40001, - 0x81C, 0x02E60001, - 0x81C, 0x01E80001, - 0x81C, 0x01EA0001, - 0x81C, 0x01EC0001, - 0x81C, 0x01EE0001, - 0x81C, 0x01F00001, - 0x81C, 0x01F20001, - 0x81C, 0x01F40001, - 0x81C, 0x01F60001, - 0x81C, 0x01F80001, - 0x81C, 0x01FA0001, - 0x81C, 0x01FC0001, - 0x81C, 0x01FE0001, - 0xFF0F07D0, 0xCDEF, + 0xB0000000, 0x00000000, + 0x80000004, 0x00000000, 0x40000000, 0x00000000, 0x81C, 0xFC800001, 0x81C, 0xFB820001, 0x81C, 0xFA840001, @@ -3165,7 +2407,7 @@ u32 RTL8812AE_AGC_TAB_ARRAY[] = { 0x81C, 0x01FA0001, 0x81C, 0x01FC0001, 0x81C, 0x01FE0001, - 0xCDCDCDCD, 0xCDCD, + 0xA0000000, 0x00000000, 0x81C, 0xFF800001, 0x81C, 0xFF820001, 0x81C, 0xFF840001, @@ -3230,14 +2472,16 @@ u32 RTL8812AE_AGC_TAB_ARRAY[] = { 0x81C, 0x01FA0001, 0x81C, 0x01FC0001, 0x81C, 0x01FE0001, - 0xFF0F0180, 0xDEAD, + 0xB0000000, 0x00000000, 0xC50, 0x00000022, 0xC50, 0x00000020, 0xE50, 0x00000022, 0xE50, 0x00000020, - }; +u32 RTL8812AE_AGC_TAB_1TARRAYLEN = + sizeof(RTL8812AE_AGC_TAB_ARRAY) / sizeof(u32); + u32 RTL8821AE_AGC_TAB_ARRAY[] = { 0x81C, 0xBF000001, 0x81C, 0xBF020001, @@ -3430,9 +2674,11 @@ u32 RTL8821AE_AGC_TAB_ARRAY[] = { 0x81C, 0x017E0101, 0xC50, 0x00000022, 0xC50, 0x00000020, - }; +u32 RTL8821AE_AGC_TAB_1TARRAYLEN = + sizeof(RTL8821AE_AGC_TAB_ARRAY) / sizeof(u32); + /****************************************************************************** * TXPWR_LMT.TXT ******************************************************************************/ @@ -3717,9 +2963,9 @@ u8 *RTL8812AE_TXPWR_LMT[] = { "FCC", "5G", "20M", "OFDM", "1T", "100", "30", "ETSI", "5G", "20M", "OFDM", "1T", "100", "32", "MKK", "5G", "20M", "OFDM", "1T", "100", "32", - "FCC", "5G", "20M", "OFDM", "1T", "114", "30", - "ETSI", "5G", "20M", "OFDM", "1T", "114", "32", - "MKK", "5G", "20M", "OFDM", "1T", "114", "32", + "FCC", "5G", "20M", "OFDM", "1T", "104", "30", + "ETSI", "5G", "20M", "OFDM", "1T", "104", "32", + "MKK", "5G", "20M", "OFDM", "1T", "104", "32", "FCC", "5G", "20M", "OFDM", "1T", "108", "32", "ETSI", "5G", "20M", "OFDM", "1T", "108", "32", "MKK", "5G", "20M", "OFDM", "1T", "108", "32", @@ -3789,9 +3035,9 @@ u8 *RTL8812AE_TXPWR_LMT[] = { "FCC", "5G", "20M", "HT", "1T", "100", "30", "ETSI", "5G", "20M", "HT", "1T", "100", "32", "MKK", "5G", "20M", "HT", "1T", "100", "32", - "FCC", "5G", "20M", "HT", "1T", "114", "30", - "ETSI", "5G", "20M", "HT", "1T", "114", "32", - "MKK", "5G", "20M", "HT", "1T", "114", "32", + "FCC", "5G", "20M", "HT", "1T", "104", "30", + "ETSI", "5G", "20M", "HT", "1T", "104", "32", + "MKK", "5G", "20M", "HT", "1T", "104", "32", "FCC", "5G", "20M", "HT", "1T", "108", "32", "ETSI", "5G", "20M", "HT", "1T", "108", "32", "MKK", "5G", "20M", "HT", "1T", "108", "32", @@ -3861,9 +3107,9 @@ u8 *RTL8812AE_TXPWR_LMT[] = { "FCC", "5G", "20M", "HT", "2T", "100", "28", "ETSI", "5G", "20M", "HT", "2T", "100", "30", "MKK", "5G", "20M", "HT", "2T", "100", "30", - "FCC", "5G", "20M", "HT", "2T", "114", "28", - "ETSI", "5G", "20M", "HT", "2T", "114", "30", - "MKK", "5G", "20M", "HT", "2T", "114", "30", + "FCC", "5G", "20M", "HT", "2T", "104", "28", + "ETSI", "5G", "20M", "HT", "2T", "104", "30", + "MKK", "5G", "20M", "HT", "2T", "104", "30", "FCC", "5G", "20M", "HT", "2T", "108", "30", "ETSI", "5G", "20M", "HT", "2T", "108", "30", "MKK", "5G", "20M", "HT", "2T", "108", "30", @@ -4004,6 +3250,8 @@ u8 *RTL8812AE_TXPWR_LMT[] = { "MKK", "5G", "80M", "VHT", "2T", "155", "63" }; +u32 RTL8812AE_TXPWR_LMT_ARRAY_LEN = sizeof(RTL8812AE_TXPWR_LMT) / sizeof(u8 *); + u8 *RTL8821AE_TXPWR_LMT[] = { "FCC", "2.4G", "20M", "CCK", "1T", "01", "32", "ETSI", "2.4G", "20M", "CCK", "1T", "01", "32", @@ -4284,9 +3532,9 @@ u8 *RTL8821AE_TXPWR_LMT[] = { "FCC", "5G", "20M", "OFDM", "1T", "100", "32", "ETSI", "5G", "20M", "OFDM", "1T", "100", "30", "MKK", "5G", "20M", "OFDM", "1T", "100", "30", - "FCC", "5G", "20M", "OFDM", "1T", "114", "32", - "ETSI", "5G", "20M", "OFDM", "1T", "114", "30", - "MKK", "5G", "20M", "OFDM", "1T", "114", "30", + "FCC", "5G", "20M", "OFDM", "1T", "104", "32", + "ETSI", "5G", "20M", "OFDM", "1T", "104", "30", + "MKK", "5G", "20M", "OFDM", "1T", "104", "30", "FCC", "5G", "20M", "OFDM", "1T", "108", "32", "ETSI", "5G", "20M", "OFDM", "1T", "108", "30", "MKK", "5G", "20M", "OFDM", "1T", "108", "30", @@ -4356,9 +3604,9 @@ u8 *RTL8821AE_TXPWR_LMT[] = { "FCC", "5G", "20M", "HT", "1T", "100", "32", "ETSI", "5G", "20M", "HT", "1T", "100", "30", "MKK", "5G", "20M", "HT", "1T", "100", "30", - "FCC", "5G", "20M", "HT", "1T", "114", "32", - "ETSI", "5G", "20M", "HT", "1T", "114", "30", - "MKK", "5G", "20M", "HT", "1T", "114", "30", + "FCC", "5G", "20M", "HT", "1T", "104", "32", + "ETSI", "5G", "20M", "HT", "1T", "104", "30", + "MKK", "5G", "20M", "HT", "1T", "104", "30", "FCC", "5G", "20M", "HT", "1T", "108", "32", "ETSI", "5G", "20M", "HT", "1T", "108", "30", "MKK", "5G", "20M", "HT", "1T", "108", "30", @@ -4428,9 +3676,9 @@ u8 *RTL8821AE_TXPWR_LMT[] = { "FCC", "5G", "20M", "HT", "2T", "100", "28", "ETSI", "5G", "20M", "HT", "2T", "100", "30", "MKK", "5G", "20M", "HT", "2T", "100", "30", - "FCC", "5G", "20M", "HT", "2T", "114", "28", - "ETSI", "5G", "20M", "HT", "2T", "114", "30", - "MKK", "5G", "20M", "HT", "2T", "114", "30", + "FCC", "5G", "20M", "HT", "2T", "104", "28", + "ETSI", "5G", "20M", "HT", "2T", "104", "30", + "MKK", "5G", "20M", "HT", "2T", "104", "30", "FCC", "5G", "20M", "HT", "2T", "108", "30", "ETSI", "5G", "20M", "HT", "2T", "108", "30", "MKK", "5G", "20M", "HT", "2T", "108", "30", @@ -4570,3 +3818,5 @@ u8 *RTL8821AE_TXPWR_LMT[] = { "ETSI", "5G", "80M", "VHT", "2T", "155", "30", "MKK", "5G", "80M", "VHT", "2T", "155", "63" }; + +u32 RTL8821AE_TXPWR_LMT_ARRAY_LEN = sizeof(RTL8821AE_TXPWR_LMT) / sizeof(u8 *); diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/table.h b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/table.h index 24bcff6bc507..36c2388b60bc 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/table.h +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/table.h @@ -29,32 +29,30 @@ #define __RTL8821AE_TABLE__H_ #include <linux/types.h> -#define RTL8821AEPHY_REG_1TARRAYLEN 344 +extern u32 RTL8821AE_PHY_REG_1TARRAYLEN; extern u32 RTL8821AE_PHY_REG_ARRAY[]; -#define RTL8812AEPHY_REG_1TARRAYLEN 490 +extern u32 RTL8812AE_PHY_REG_1TARRAYLEN; extern u32 RTL8812AE_PHY_REG_ARRAY[]; -#define RTL8821AEPHY_REG_ARRAY_PGLEN 90 +extern u32 RTL8821AE_PHY_REG_ARRAY_PGLEN; extern u32 RTL8821AE_PHY_REG_ARRAY_PG[]; -#define RTL8812AEPHY_REG_ARRAY_PGLEN 276 +extern u32 RTL8812AE_PHY_REG_ARRAY_PGLEN; extern u32 RTL8812AE_PHY_REG_ARRAY_PG[]; -/* #define RTL8723BE_RADIOA_1TARRAYLEN 206 */ -/* extern u8 *RTL8821AE_TXPWR_LMT_ARRAY[]; */ -#define RTL8812AE_RADIOA_1TARRAYLEN 1264 +extern u32 RTL8812AE_RADIOA_1TARRAYLEN; extern u32 RTL8812AE_RADIOA_ARRAY[]; -#define RTL8812AE_RADIOB_1TARRAYLEN 1240 +extern u32 RTL8812AE_RADIOB_1TARRAYLEN; extern u32 RTL8812AE_RADIOB_ARRAY[]; -#define RTL8821AE_RADIOA_1TARRAYLEN 1176 +extern u32 RTL8821AE_RADIOA_1TARRAYLEN; extern u32 RTL8821AE_RADIOA_ARRAY[]; -#define RTL8821AEMAC_1T_ARRAYLEN 194 +extern u32 RTL8821AE_MAC_1T_ARRAYLEN; extern u32 RTL8821AE_MAC_REG_ARRAY[]; -#define RTL8812AEMAC_1T_ARRAYLEN 214 +extern u32 RTL8812AE_MAC_1T_ARRAYLEN; extern u32 RTL8812AE_MAC_REG_ARRAY[]; -#define RTL8821AEAGCTAB_1TARRAYLEN 382 +extern u32 RTL8821AE_AGC_TAB_1TARRAYLEN; extern u32 RTL8821AE_AGC_TAB_ARRAY[]; -#define RTL8812AEAGCTAB_1TARRAYLEN 1312 +extern u32 RTL8812AE_AGC_TAB_1TARRAYLEN; extern u32 RTL8812AE_AGC_TAB_ARRAY[]; -#define RTL8812AE_TXPWR_LMT_ARRAY_LEN 3948 +extern u32 RTL8812AE_TXPWR_LMT_ARRAY_LEN; extern u8 *RTL8812AE_TXPWR_LMT[]; -#define RTL8821AE_TXPWR_LMT_ARRAY_LEN 3948 +extern u32 RTL8821AE_TXPWR_LMT_ARRAY_LEN; extern u8 *RTL8821AE_TXPWR_LMT[]; #endif diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/trx.c b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/trx.c index 108098152cf3..03665e82065f 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/trx.c +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/trx.c @@ -520,18 +520,18 @@ bool rtl8821ae_rx_query_desc(struct ieee80211_hw *hw, rx_status->flag |= RX_FLAG_FAILED_FCS_CRC; if (status->rx_packet_bw == HT_CHANNEL_WIDTH_20_40) - rx_status->flag |= RX_FLAG_40MHZ; + rx_status->bw = RATE_INFO_BW_40; else if (status->rx_packet_bw == HT_CHANNEL_WIDTH_80) - rx_status->vht_flag |= RX_VHT_FLAG_80MHZ; + rx_status->bw = RATE_INFO_BW_80; if (status->is_ht) - rx_status->flag |= RX_FLAG_HT; + rx_status->encoding = RX_ENC_HT; if (status->is_vht) - rx_status->flag |= RX_FLAG_VHT; + rx_status->encoding = RX_ENC_VHT; if (status->is_short_gi) - rx_status->flag |= RX_FLAG_SHORT_GI; + rx_status->enc_flags |= RX_ENC_FLAG_SHORT_GI; - rx_status->vht_nss = status->vht_nss; + rx_status->nss = status->vht_nss; rx_status->flag |= RX_FLAG_MACTIME_START; /* hw will set status->decrypted true, if it finds the |