From 37d1d67c60716e26ae464b855f1a25be628b1da6 Mon Sep 17 00:00:00 2001 From: Shobek Attupurath Date: Wed, 23 Nov 2022 02:37:15 -0800 Subject: [PATCH] rtl8822ce: Update to _v5.9.0.3e_nv for k-5.15 Update driver to _v5.9.0.3e_nv for k-5.15 Version: v5.9.0.3e_nv-16-g319d9877b.20221101_COEX20200103-0000 Bug 3750163 Change-Id: Ic6b689c100b7e14215793be26943fa46964fc89b Signed-off-by: Shobek Attupurath Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2814784 GVS: Gerrit_Virtual_Submit Tested-by: Revanth Kumar Uppala Reviewed-by: Revanth Kumar Uppala Reviewed-by: Narayan Reddy Reviewed-by: Sushil Kumar Singh Reviewed-by: Bitan Biswas --- .../rtl8822ce/core/crypto/aes-internal-enc.c | 2 +- .../rtl8822ce/core/crypto/aes-internal.c | 8 +- .../realtek/rtl8822ce/core/crypto/aes_i.h | 2 +- .../wireless/realtek/rtl8822ce/core/rtw_ap.c | 0 .../realtek/rtl8822ce/core/rtw_br_ext.c | 9 + .../realtek/rtl8822ce/core/rtw_btcoex.c | 2 + .../realtek/rtl8822ce/core/rtw_chplan.c | 1050 ++++++++--------- .../realtek/rtl8822ce/core/rtw_chplan.h | 388 +++--- .../wireless/realtek/rtl8822ce/core/rtw_cmd.c | 19 +- .../realtek/rtl8822ce/core/rtw_debug.c | 4 +- .../realtek/rtl8822ce/core/rtw_ieee80211.c | 1 + .../wireless/realtek/rtl8822ce/core/rtw_io.c | 2 + .../realtek/rtl8822ce/core/rtw_mlme.c | 0 .../realtek/rtl8822ce/core/rtw_mlme_ext.c | 14 +- .../realtek/rtl8822ce/core/rtw_recv.c | 0 .../realtek/rtl8822ce/core/rtw_security.c | 9 +- .../realtek/rtl8822ce/core/rtw_tdls.c | 14 +- .../wireless/realtek/rtl8822ce/core/rtw_vht.c | 1 + .../realtek/rtl8822ce/core/rtw_wapi.c | 2 +- .../realtek/rtl8822ce/core/rtw_wlan_util.c | 10 +- .../realtek/rtl8822ce/core/rtw_xmit.c | 2 +- .../realtek/rtl8822ce/hal/btc/halbtc8822c.c | 0 .../realtek/rtl8822ce/hal/btc/halbtc8822c.h | 0 .../rtl8822ce/hal/btc/halbtc8822cwifionly.c | 0 .../rtl8822ce/hal/btc/halbtc8822cwifionly.h | 0 .../realtek/rtl8822ce/hal/btc/halbtccommon.c | 2 - .../realtek/rtl8822ce/hal/btc/halbtccommon.h | 0 .../efuse/rtl8822c/HalEfuseMask8822C_PCIE.c | 0 .../efuse/rtl8822c/HalEfuseMask8822C_PCIE.h | 0 .../efuse/rtl8822c/HalEfuseMask8822C_SDIO.c | 0 .../efuse/rtl8822c/HalEfuseMask8822C_SDIO.h | 0 .../efuse/rtl8822c/HalEfuseMask8822C_USB.c | 0 .../efuse/rtl8822c/HalEfuseMask8822C_USB.h | 0 .../realtek/rtl8822ce/hal/hal_com_phycfg.c | 1 - .../realtek/rtl8822ce/hal/hal_halmac.c | 3 +- .../wireless/realtek/rtl8822ce/hal/hal_intf.c | 12 + .../halmac_8822c/halmac_init_8822c.c | 17 + .../realtek/rtl8822ce/hal/phydm/halrf/halrf.c | 2 +- .../phydm/halrf/rtl8822c/halrf_iqk_8822c.c | 4 +- .../rtl8822ce/hal/rtl8822c/hal8822c_fw.c | 0 .../rtl8822ce/hal/rtl8822c/hal8822c_fw.h | 0 .../rtl8822ce/hal/rtl8822c/pci/rtl8822ce.h | 0 .../hal/rtl8822c/pci/rtl8822ce_halinit.c | 4 + .../hal/rtl8822c/pci/rtl8822ce_halmac.c | 2 + .../rtl8822ce/hal/rtl8822c/pci/rtl8822ce_io.c | 0 .../hal/rtl8822c/pci/rtl8822ce_led.c | 0 .../hal/rtl8822c/pci/rtl8822ce_ops.c | 8 +- .../hal/rtl8822c/pci/rtl8822ce_recv.c | 0 .../hal/rtl8822c/pci/rtl8822ce_xmit.c | 1 - .../realtek/rtl8822ce/hal/rtl8822c/rtl8822c.h | 0 .../rtl8822ce/hal/rtl8822c/rtl8822c_cmd.c | 2 + .../rtl8822ce/hal/rtl8822c/rtl8822c_halinit.c | 5 + .../rtl8822ce/hal/rtl8822c/rtl8822c_mac.c | 0 .../rtl8822ce/hal/rtl8822c/rtl8822c_ops.c | 3 + .../rtl8822ce/hal/rtl8822c/rtl8822c_phy.c | 4 + .../realtek/rtl8822ce/include/drv_conf.h | 0 .../realtek/rtl8822ce/include/drv_types.h | 9 - .../realtek/rtl8822ce/include/hal_com_h2c.h | 0 .../realtek/rtl8822ce/include/hal_data.h | 0 .../realtek/rtl8822ce/include/hal_ic_cfg.h | 3 +- .../realtek/rtl8822ce/include/hal_intf.h | 0 .../realtek/rtl8822ce/include/hal_pg.h | 0 .../realtek/rtl8822ce/include/rtl8188e_xmit.h | 0 .../realtek/rtl8822ce/include/rtl8188f_xmit.h | 0 .../realtek/rtl8822ce/include/rtl8192e_xmit.h | 0 .../realtek/rtl8822ce/include/rtl8192f_xmit.h | 0 .../realtek/rtl8822ce/include/rtl8703b_xmit.h | 0 .../realtek/rtl8822ce/include/rtl8710b_xmit.h | 0 .../realtek/rtl8822ce/include/rtl8723b_hal.h | 0 .../realtek/rtl8822ce/include/rtl8723b_led.h | 0 .../realtek/rtl8822ce/include/rtl8723b_recv.h | 0 .../realtek/rtl8822ce/include/rtl8723b_spec.h | 0 .../realtek/rtl8822ce/include/rtl8723b_xmit.h | 0 .../realtek/rtl8822ce/include/rtl8723d_xmit.h | 0 .../realtek/rtl8822ce/include/rtl8812a_xmit.h | 0 .../realtek/rtl8822ce/include/rtl8814a_cmd.h | 0 .../realtek/rtl8822ce/include/rtl8814a_hal.h | 0 .../realtek/rtl8822ce/include/rtl8814a_recv.h | 0 .../realtek/rtl8822ce/include/rtl8814a_spec.h | 0 .../realtek/rtl8822ce/include/rtl8814a_xmit.h | 0 .../realtek/rtl8822ce/include/rtl8814b_hal.h | 0 .../realtek/rtl8822ce/include/rtl8814bu_hal.h | 0 .../realtek/rtl8822ce/include/rtl8821ce_hal.h | 0 .../realtek/rtl8822ce/include/rtl8822be_hal.h | 0 .../realtek/rtl8822ce/include/rtl8822c_hal.h | 0 .../realtek/rtl8822ce/include/rtl8822ce_hal.h | 0 .../realtek/rtl8822ce/include/rtl8822cs_hal.h | 0 .../realtek/rtl8822ce/include/rtl8822cu_hal.h | 0 .../realtek/rtl8822ce/include/rtw_mlme_ext.h | 2 +- .../realtek/rtl8822ce/include/rtw_recv.h | 2 + .../realtek/rtl8822ce/include/rtw_security.h | 0 .../realtek/rtl8822ce/include/rtw_version.h | 4 +- .../realtek/rtl8822ce/include/rtw_xmit.h | 0 .../rtl8822ce/os_dep/linux/ioctl_cfg80211.c | 1 - .../rtl8822ce/os_dep/linux/ioctl_linux.c | 68 +- .../realtek/rtl8822ce/os_dep/linux/ioctl_mp.c | 20 +- .../realtek/rtl8822ce/os_dep/linux/os_intfs.c | 8 +- .../realtek/rtl8822ce/os_dep/linux/pci_intf.c | 15 +- .../rtl8822ce/os_dep/linux/recv_linux.c | 12 +- .../realtek/rtl8822ce/os_dep/linux/rtw_proc.h | 0 .../realtek/rtl8822ce/os_dep/osdep_service.c | 59 - 101 files changed, 897 insertions(+), 915 deletions(-) mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/core/rtw_ap.c mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/core/rtw_cmd.c mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/core/rtw_mlme.c mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/core/rtw_mlme_ext.c mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/core/rtw_recv.c mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/core/rtw_wlan_util.c mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/core/rtw_xmit.c mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/hal/btc/halbtc8822c.c mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/hal/btc/halbtc8822c.h mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/hal/btc/halbtc8822cwifionly.c mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/hal/btc/halbtc8822cwifionly.h mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/hal/btc/halbtccommon.c mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/hal/btc/halbtccommon.h mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/hal/efuse/rtl8822c/HalEfuseMask8822C_PCIE.c mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/hal/efuse/rtl8822c/HalEfuseMask8822C_PCIE.h mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/hal/efuse/rtl8822c/HalEfuseMask8822C_SDIO.c mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/hal/efuse/rtl8822c/HalEfuseMask8822C_SDIO.h mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/hal/efuse/rtl8822c/HalEfuseMask8822C_USB.c mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/hal/efuse/rtl8822c/HalEfuseMask8822C_USB.h mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/hal/hal_intf.c mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/hal/rtl8822c/hal8822c_fw.c mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/hal/rtl8822c/hal8822c_fw.h mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/hal/rtl8822c/pci/rtl8822ce.h mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/hal/rtl8822c/pci/rtl8822ce_halinit.c mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/hal/rtl8822c/pci/rtl8822ce_halmac.c mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/hal/rtl8822c/pci/rtl8822ce_io.c mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/hal/rtl8822c/pci/rtl8822ce_led.c mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/hal/rtl8822c/pci/rtl8822ce_ops.c mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/hal/rtl8822c/pci/rtl8822ce_recv.c mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/hal/rtl8822c/pci/rtl8822ce_xmit.c mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/hal/rtl8822c/rtl8822c.h mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/hal/rtl8822c/rtl8822c_cmd.c mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/hal/rtl8822c/rtl8822c_halinit.c mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/hal/rtl8822c/rtl8822c_mac.c mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/hal/rtl8822c/rtl8822c_ops.c mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/hal/rtl8822c/rtl8822c_phy.c mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/include/drv_conf.h mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/include/hal_com_h2c.h mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/include/hal_data.h mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/include/hal_ic_cfg.h mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/include/hal_intf.h mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/include/hal_pg.h mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/include/rtl8188e_xmit.h mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/include/rtl8188f_xmit.h mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/include/rtl8192e_xmit.h mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/include/rtl8192f_xmit.h mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/include/rtl8703b_xmit.h mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/include/rtl8710b_xmit.h mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/include/rtl8723b_hal.h mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/include/rtl8723b_led.h mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/include/rtl8723b_recv.h mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/include/rtl8723b_spec.h mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/include/rtl8723b_xmit.h mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/include/rtl8723d_xmit.h mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/include/rtl8812a_xmit.h mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/include/rtl8814a_cmd.h mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/include/rtl8814a_hal.h mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/include/rtl8814a_recv.h mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/include/rtl8814a_spec.h mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/include/rtl8814a_xmit.h mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/include/rtl8814b_hal.h mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/include/rtl8814bu_hal.h mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/include/rtl8821ce_hal.h mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/include/rtl8822be_hal.h mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/include/rtl8822c_hal.h mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/include/rtl8822ce_hal.h mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/include/rtl8822cs_hal.h mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/include/rtl8822cu_hal.h mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/include/rtw_mlme_ext.h mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/include/rtw_security.h mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/include/rtw_xmit.h mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/os_dep/linux/ioctl_cfg80211.c mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/os_dep/linux/os_intfs.c mode change 100644 => 100755 drivers/net/wireless/realtek/rtl8822ce/os_dep/linux/rtw_proc.h diff --git a/drivers/net/wireless/realtek/rtl8822ce/core/crypto/aes-internal-enc.c b/drivers/net/wireless/realtek/rtl8822ce/core/crypto/aes-internal-enc.c index 69e256be..8e2fc5a9 100644 --- a/drivers/net/wireless/realtek/rtl8822ce/core/crypto/aes-internal-enc.c +++ b/drivers/net/wireless/realtek/rtl8822ce/core/crypto/aes-internal-enc.c @@ -104,7 +104,7 @@ void * aes_encrypt_init(const u8 *key, size_t len) rk = os_malloc(AES_PRIV_SIZE); if (rk == NULL) return NULL; - res = rijndaelKeySetupEnc(rk, key, len * 8); + res = rijndaelKeySetupEnc(rk, key, len); if (res < 0) { rtw_mfree(rk, AES_PRIV_SIZE); return NULL; diff --git a/drivers/net/wireless/realtek/rtl8822ce/core/crypto/aes-internal.c b/drivers/net/wireless/realtek/rtl8822ce/core/crypto/aes-internal.c index 57d65394..726a05b7 100644 --- a/drivers/net/wireless/realtek/rtl8822ce/core/crypto/aes-internal.c +++ b/drivers/net/wireless/realtek/rtl8822ce/core/crypto/aes-internal.c @@ -774,7 +774,7 @@ const u8 rcons[] = { * * @return the number of rounds for the given cipher key size. */ -int rijndaelKeySetupEnc(u32 rk[], const u8 cipherKey[], int keyBits) +int rijndaelKeySetupEnc(u32 rk[], const u8 cipherKey[], int key_bytes) { int i; u32 temp; @@ -784,7 +784,7 @@ int rijndaelKeySetupEnc(u32 rk[], const u8 cipherKey[], int keyBits) rk[2] = GETU32(cipherKey + 8); rk[3] = GETU32(cipherKey + 12); - if (keyBits == 128) { + if (key_bytes == 16) { for (i = 0; i < 10; i++) { temp = rk[3]; rk[4] = rk[0] ^ TE421(temp) ^ TE432(temp) ^ @@ -800,7 +800,7 @@ int rijndaelKeySetupEnc(u32 rk[], const u8 cipherKey[], int keyBits) rk[4] = GETU32(cipherKey + 16); rk[5] = GETU32(cipherKey + 20); - if (keyBits == 192) { + if (key_bytes == 24) { for (i = 0; i < 8; i++) { temp = rk[5]; rk[6] = rk[0] ^ TE421(temp) ^ TE432(temp) ^ @@ -819,7 +819,7 @@ int rijndaelKeySetupEnc(u32 rk[], const u8 cipherKey[], int keyBits) rk[6] = GETU32(cipherKey + 24); rk[7] = GETU32(cipherKey + 28); - if (keyBits == 256) { + if (key_bytes == 32) { for (i = 0; i < 7; i++) { temp = rk[7]; rk[8] = rk[0] ^ TE421(temp) ^ TE432(temp) ^ diff --git a/drivers/net/wireless/realtek/rtl8822ce/core/crypto/aes_i.h b/drivers/net/wireless/realtek/rtl8822ce/core/crypto/aes_i.h index 54375cf3..a3822800 100644 --- a/drivers/net/wireless/realtek/rtl8822ce/core/crypto/aes_i.h +++ b/drivers/net/wireless/realtek/rtl8822ce/core/crypto/aes_i.h @@ -120,6 +120,6 @@ static inline u32 rotr(u32 val, int bits) #define AES_PRIV_SIZE (4 * 4 * 15 + 4) #define AES_PRIV_NR_POS (4 * 15) -int rijndaelKeySetupEnc(u32 rk[], const u8 cipherKey[], int keyBits); +int rijndaelKeySetupEnc(u32 rk[], const u8 cipherKey[], int key_bytes); #endif /* AES_I_H */ diff --git a/drivers/net/wireless/realtek/rtl8822ce/core/rtw_ap.c b/drivers/net/wireless/realtek/rtl8822ce/core/rtw_ap.c old mode 100644 new mode 100755 diff --git a/drivers/net/wireless/realtek/rtl8822ce/core/rtw_br_ext.c b/drivers/net/wireless/realtek/rtl8822ce/core/rtw_br_ext.c index 9a0effd8..2738340c 100644 --- a/drivers/net/wireless/realtek/rtl8822ce/core/rtw_br_ext.c +++ b/drivers/net/wireless/realtek/rtl8822ce/core/rtw_br_ext.c @@ -17,7 +17,10 @@ #ifdef __KERNEL__ #include #include + #include +#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,15,0)) #include +#endif #include #include #include @@ -169,6 +172,7 @@ static __inline__ void __nat25_generate_ipv4_network_addr(unsigned char *network } +#ifdef _NET_INET_IPX_H_ static __inline__ void __nat25_generate_ipx_network_addr_with_node(unsigned char *networkAddr, unsigned int *ipxNetAddr, unsigned char *ipxNodeAddr) { @@ -200,6 +204,7 @@ static __inline__ void __nat25_generate_apple_network_addr(unsigned char *networ memcpy(networkAddr + 1, (unsigned char *)network, 2); networkAddr[3] = *node; } +#endif static __inline__ void __nat25_generate_pppoe_network_addr(unsigned char *networkAddr, @@ -330,6 +335,7 @@ static __inline__ int __nat25_network_hash(unsigned char *networkAddr) x = networkAddr[7] ^ networkAddr[8] ^ networkAddr[9] ^ networkAddr[10]; return x & (NAT25_HASH_SIZE - 1); +#ifdef _NET_INET_IPX_H_ } else if (networkAddr[0] == NAT25_IPX) { unsigned long x; @@ -343,6 +349,7 @@ static __inline__ int __nat25_network_hash(unsigned char *networkAddr) x = networkAddr[1] ^ networkAddr[2] ^ networkAddr[3]; return x & (NAT25_HASH_SIZE - 1); +#endif } else if (networkAddr[0] == NAT25_PPPOE) { unsigned long x; @@ -889,6 +896,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method) } } +#ifdef _NET_INET_IPX_H /*---------------------------------------------------*/ /* Handle IPX and Apple Talk frame */ /*---------------------------------------------------*/ @@ -1109,6 +1117,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method) return -1; } +#endif /*---------------------------------------------------*/ /* Handle PPPoE frame */ diff --git a/drivers/net/wireless/realtek/rtl8822ce/core/rtw_btcoex.c b/drivers/net/wireless/realtek/rtl8822ce/core/rtw_btcoex.c index 20196aec..63dcc23a 100644 --- a/drivers/net/wireless/realtek/rtl8822ce/core/rtw_btcoex.c +++ b/drivers/net/wireless/realtek/rtl8822ce/core/rtw_btcoex.c @@ -19,7 +19,9 @@ void rtw_btcoex_Initialize(PADAPTER padapter) { + RTW_INFO(" ====> %s\n", __func__); hal_btcoex_Initialize(padapter); + RTW_INFO(" %s <====\n", __func__); } void rtw_btcoex_PowerOnSetting(PADAPTER padapter) diff --git a/drivers/net/wireless/realtek/rtl8822ce/core/rtw_chplan.c b/drivers/net/wireless/realtek/rtl8822ce/core/rtw_chplan.c index d1ebfefd..1b48aa41 100644 --- a/drivers/net/wireless/realtek/rtl8822ce/core/rtw_chplan.c +++ b/drivers/net/wireless/realtek/rtl8822ce/core/rtw_chplan.c @@ -1,525 +1,525 @@ -/****************************************************************************** - * - * Copyright(c) 2007 - 2018 Realtek Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - *****************************************************************************/ -#define _RTW_CHPLAN_C_ - -#include - -#define RTW_DOMAIN_MAP_VER "43e" -#define RTW_COUNTRY_MAP_VER "25" - -#define RTW_RD_2G_MAX 13 -#define RTW_RD_5G_MAX 73 - -struct ch_list_t { - u8 *len_ch; -}; - -#define CH_LIST_ENT(_len, arg...) \ - {.len_ch = (u8[_len + 1]) {_len, ##arg}, } - -#define CH_LIST_LEN(_ch_list) (_ch_list.len_ch[0]) -#define CH_LIST_CH(_ch_list, _i) (_ch_list.len_ch[_i + 1]) - -struct chplan_ent_t { - u8 rd_2g; -#if CONFIG_IEEE80211_BAND_5GHZ - u8 rd_5g; -#endif - u8 regd; /* value of REGULATION_TXPWR_LMT */ -}; - -#if CONFIG_IEEE80211_BAND_5GHZ -#define CHPLAN_ENT(i2g, i5g, regd) {i2g, i5g, regd} -#else -#define CHPLAN_ENT(i2g, i5g, regd) {i2g, regd} -#endif - -static u8 rtw_hex_setting_buf[RTW_HEXFILE_LEN]; -static struct ch_list_t RTW_ChannelPlan2G[RTW_RD_2G_MAX]; - -#ifdef CONFIG_IEEE80211_BAND_5GHZ -static struct ch_list_t RTW_ChannelPlan5G[RTW_RD_5G_MAX]; -#endif /* CONFIG_IEEE80211_BAND_5GHZ */ - -static struct chplan_ent_t RTW_ChannelPlanMap[RTW_CHPLAN_HEXFILE_MAX]; -static struct country_chplan country_chplan_map[238]; -int rtw_get_channel_plan_from_file(const char *path) -{ - u32 len, idx; - u32 i = 0, j = 0; - u8 sec_1, sec_2; - u16 sec_3, chksum; - - len = rtw_retrieve_from_file(path, rtw_hex_setting_buf, RTW_HEXFILE_LEN); - if (len > RTW_HEXFILE_LEN) { - RTW_WARN("channel plan hexfile oversize\n"); - return -1; - } - if (len == 0) { - RTW_WARN("read channel plan hexfile fail\n"); - return -1; - } - chksum = *(u16 *)(rtw_hex_setting_buf); - if (rtw_calc_crc(rtw_hex_setting_buf + 2, len - 2) != chksum) { - RTW_WARN("read channel plan fail(tainted)\n"); - return -1; - } - sec_1 = rtw_hex_setting_buf[2]; - sec_2 = sec_1 + rtw_hex_setting_buf[3]; - sec_3 = sec_2 + rtw_hex_setting_buf[4]; - i += 5; - while (i < len) { - if (j < sec_1) { - RTW_ChannelPlan2G[j].len_ch = rtw_hex_setting_buf + i; - i += (rtw_hex_setting_buf[i] + 1); - } else if (j >= sec_1 && j < sec_2) { - idx = j - sec_1; - RTW_ChannelPlan5G[idx].len_ch = rtw_hex_setting_buf + i; - i += (rtw_hex_setting_buf[i] + 1); - } else if (j >= sec_2 && j < sec_3) { - if (i + 2 >= len) - return -1; - idx = j - sec_2; - RTW_ChannelPlanMap[idx].rd_2g = - *(rtw_hex_setting_buf + i); - RTW_ChannelPlanMap[idx].rd_5g = - *(rtw_hex_setting_buf + i + 1); - RTW_ChannelPlanMap[idx].regd = - *(rtw_hex_setting_buf + i + 2); - i += 3; - } else { - break; - } - j++; - } - return 0; -} - -u8 rtw_chplan_get_default_regd(u8 id) -{ - u8 regd; - - regd = RTW_ChannelPlanMap[id].regd; - - return regd; -} - -bool rtw_chplan_is_empty(u8 id) -{ - struct chplan_ent_t *chplan_map; - - chplan_map = &RTW_ChannelPlanMap[id]; - - if (chplan_map->rd_2g == 8 - #if CONFIG_IEEE80211_BAND_5GHZ - && chplan_map->rd_5g == 0 - #endif - ) - return _TRUE; - - return _FALSE; -} - -bool rtw_regsty_is_excl_chs(struct registry_priv *regsty, u8 ch) -{ - int i; - - for (i = 0; i < MAX_CHANNEL_NUM; i++) { - if (regsty->excl_chs[i] == 0) - break; - if (regsty->excl_chs[i] == ch) - return _TRUE; - } - return _FALSE; -} - -inline static u8 rtw_rd_5g_band1_passive(u8 rtw_rd_5g) -{ - u8 passive = 0; - - switch (rtw_rd_5g) { - case 41: - case 44: - case 45: - case 46: - case 52: - case 55: - case 59: - case 60: - case 63: - case 64: - case 65: - case 66: - case 67: - passive = 1; - }; - - return passive; -} - -inline static u8 rtw_rd_5g_band4_passive(u8 rtw_rd_5g) -{ - u8 passive = 0; - - switch (rtw_rd_5g) { - case 37: - case 38: - case 45: - case 46: - case 52: - case 61: - case 63: - case 64: - case 65: - case 66: - case 67: - passive = 1; - }; - - return passive; -} - -u8 init_channel_set(_adapter *padapter, u8 ChannelPlan, RT_CHANNEL_INFO *channel_set) -{ - struct registry_priv *regsty = adapter_to_regsty(padapter); - u8 index, chanset_size = 0; - u8 b5GBand = _FALSE, b2_4GBand = _FALSE; - u8 rd_2g = 0, rd_5g = 0; -#ifdef CONFIG_DFS_MASTER - int i; -#endif - - if (!rtw_is_channel_plan_valid(ChannelPlan)) { - RTW_ERR("ChannelPlan ID 0x%02X error !!!!!\n", ChannelPlan); - return chanset_size; - } - - _rtw_memset(channel_set, 0, sizeof(RT_CHANNEL_INFO) * MAX_CHANNEL_NUM); - - if (IsSupported24G(regsty->wireless_mode) && hal_chk_band_cap(padapter, BAND_CAP_2G)) - b2_4GBand = _TRUE; - - if (is_supported_5g(regsty->wireless_mode) && hal_chk_band_cap(padapter, BAND_CAP_5G)) - b5GBand = _TRUE; - - if (b2_4GBand == _FALSE && b5GBand == _FALSE) { - RTW_WARN("HW band_cap has no intersection with SW wireless_mode setting\n"); - return chanset_size; - } - - if (b2_4GBand) { - rd_2g = RTW_ChannelPlanMap[ChannelPlan].rd_2g; - - for (index = 0; index < CH_LIST_LEN(RTW_ChannelPlan2G[rd_2g]); index++) { - if (rtw_regsty_is_excl_chs(regsty, CH_LIST_CH(RTW_ChannelPlan2G[rd_2g], index)) == _TRUE) - continue; - - if (chanset_size >= MAX_CHANNEL_NUM) { - RTW_WARN("chset size can't exceed MAX_CHANNEL_NUM(%u)\n", MAX_CHANNEL_NUM); - break; - } - - channel_set[chanset_size].ChannelNum = CH_LIST_CH(RTW_ChannelPlan2G[rd_2g], index); - - if (ChannelPlan == RTW_CHPLAN_GLOBAL_DOAMIN - || rd_2g == 5 - ) { - /* Channel 1~11 is active, and 12~14 is passive */ - if (channel_set[chanset_size].ChannelNum >= 1 && channel_set[chanset_size].ChannelNum <= 11) - channel_set[chanset_size].ScanType = SCAN_ACTIVE; - else if ((channel_set[chanset_size].ChannelNum >= 12 && channel_set[chanset_size].ChannelNum <= 14)) - channel_set[chanset_size].ScanType = SCAN_PASSIVE; - } else if (ChannelPlan == RTW_CHPLAN_WORLD_WIDE_13 - || ChannelPlan == RTW_CHPLAN_WORLD_WIDE_5G - || rd_2g == 0 - ) { - /* channel 12~13, passive scan */ - if (channel_set[chanset_size].ChannelNum <= 11) - channel_set[chanset_size].ScanType = SCAN_ACTIVE; - else - channel_set[chanset_size].ScanType = SCAN_PASSIVE; - } else - channel_set[chanset_size].ScanType = SCAN_ACTIVE; - - chanset_size++; - } - } - -#if CONFIG_IEEE80211_BAND_5GHZ - if (b5GBand) { - rd_5g = RTW_ChannelPlanMap[ChannelPlan].rd_5g; - - for (index = 0; index < CH_LIST_LEN(RTW_ChannelPlan5G[rd_5g]); index++) { - if (rtw_regsty_is_excl_chs(regsty, CH_LIST_CH(RTW_ChannelPlan5G[rd_5g], index)) == _TRUE) - continue; - #if !CONFIG_DFS - if (rtw_is_dfs_ch(CH_LIST_CH(RTW_ChannelPlan5G[rd_5g], index))) - continue; - #endif - - if (chanset_size >= MAX_CHANNEL_NUM) { - RTW_WARN("chset size can't exceed MAX_CHANNEL_NUM(%u)\n", MAX_CHANNEL_NUM); - break; - } - - channel_set[chanset_size].ChannelNum = CH_LIST_CH(RTW_ChannelPlan5G[rd_5g], index); - - if ((ChannelPlan == RTW_CHPLAN_WORLD_WIDE_5G) /* all channels passive */ - || (rtw_is_5g_band1(channel_set[chanset_size].ChannelNum) - && rtw_rd_5g_band1_passive(rd_5g)) /* band1 passive */ - || (rtw_is_5g_band4(channel_set[chanset_size].ChannelNum) - && rtw_rd_5g_band4_passive(rd_5g)) /* band4 passive */ - || (rtw_is_dfs_ch(channel_set[chanset_size].ChannelNum)) /* DFS channel(band2, 3) passive */ - ) - channel_set[chanset_size].ScanType = SCAN_PASSIVE; - else - channel_set[chanset_size].ScanType = SCAN_ACTIVE; - - chanset_size++; - } - } - - #ifdef CONFIG_DFS_MASTER - for (i = 0; i < chanset_size; i++) - channel_set[i].non_ocp_end_time = rtw_get_current_time(); - #endif -#endif /* CONFIG_IEEE80211_BAND_5GHZ */ - - if (chanset_size) - RTW_INFO(FUNC_ADPT_FMT" ChannelPlan ID:0x%02x, ch num:%d\n" - , FUNC_ADPT_ARG(padapter), ChannelPlan, chanset_size); - else - RTW_WARN(FUNC_ADPT_FMT" ChannelPlan ID:0x%02x, final chset has no channel\n" - , FUNC_ADPT_ARG(padapter), ChannelPlan); - - return chanset_size; -} - -#ifdef CONFIG_80211AC_VHT -#define COUNTRY_CHPLAN_ASSIGN_EN_11AC(_val) , .en_11ac = (_val) -#else -#define COUNTRY_CHPLAN_ASSIGN_EN_11AC(_val) -#endif - -#if RTW_DEF_MODULE_REGULATORY_CERT -#define COUNTRY_CHPLAN_ASSIGN_DEF_MODULE_FLAGS(_val) , .def_module_flags = (_val) -#else -#define COUNTRY_CHPLAN_ASSIGN_DEF_MODULE_FLAGS(_val) -#endif - -/* has def_module_flags specified, used by common map and HAL dfference map */ -#define COUNTRY_CHPLAN_ENT(_alpha2, _chplan, _en_11ac, _def_module_flags) \ - {.alpha2 = (_alpha2), .chplan = (_chplan) \ - COUNTRY_CHPLAN_ASSIGN_EN_11AC(_en_11ac) \ - COUNTRY_CHPLAN_ASSIGN_DEF_MODULE_FLAGS(_def_module_flags) \ - } - -#ifdef CONFIG_CUSTOMIZED_COUNTRY_CHPLAN_MAP - -#include "../platform/custom_country_chplan.h" - -#elif RTW_DEF_MODULE_REGULATORY_CERT - -/** - * rtw_def_module_get_chplan_from_country - - * @country_code: string of country code - * @return: - * Return NULL for case referring to common map - */ -static const struct country_chplan *rtw_def_module_get_chplan_from_country(const char *country_code) -{ - const struct country_chplan *ent = NULL; - const struct country_chplan *hal_map = NULL; - u16 hal_map_sz = 0; - int i; - - /* TODO: runtime selection for multi driver */ -#if (RTW_DEF_MODULE_REGULATORY_CERT == RTW_MODULE_RTL8821AE_HMC_M2) - hal_map = RTL8821AE_HMC_M2_country_chplan_exc_map; - hal_map_sz = sizeof(RTL8821AE_HMC_M2_country_chplan_exc_map) / sizeof(struct country_chplan); -#elif (RTW_DEF_MODULE_REGULATORY_CERT == RTW_MODULE_RTL8821AU) - hal_map = RTL8821AU_country_chplan_exc_map; - hal_map_sz = sizeof(RTL8821AU_country_chplan_exc_map) / sizeof(struct country_chplan); -#elif (RTW_DEF_MODULE_REGULATORY_CERT == RTW_MODULE_RTL8812AENF_NGFF) - hal_map = RTL8812AENF_NGFF_country_chplan_exc_map; - hal_map_sz = sizeof(RTL8812AENF_NGFF_country_chplan_exc_map) / sizeof(struct country_chplan); -#elif (RTW_DEF_MODULE_REGULATORY_CERT == RTW_MODULE_RTL8812AEBT_HMC) - hal_map = RTL8812AEBT_HMC_country_chplan_exc_map; - hal_map_sz = sizeof(RTL8812AEBT_HMC_country_chplan_exc_map) / sizeof(struct country_chplan); -#elif (RTW_DEF_MODULE_REGULATORY_CERT == RTW_MODULE_RTL8188EE_HMC_M2) - hal_map = RTL8188EE_HMC_M2_country_chplan_exc_map; - hal_map_sz = sizeof(RTL8188EE_HMC_M2_country_chplan_exc_map) / sizeof(struct country_chplan); -#elif (RTW_DEF_MODULE_REGULATORY_CERT == RTW_MODULE_RTL8723BE_HMC_M2) - hal_map = RTL8723BE_HMC_M2_country_chplan_exc_map; - hal_map_sz = sizeof(RTL8723BE_HMC_M2_country_chplan_exc_map) / sizeof(struct country_chplan); -#elif (RTW_DEF_MODULE_REGULATORY_CERT == RTW_MODULE_RTL8723BS_NGFF1216) - hal_map = RTL8723BS_NGFF1216_country_chplan_exc_map; - hal_map_sz = sizeof(RTL8723BS_NGFF1216_country_chplan_exc_map) / sizeof(struct country_chplan); -#elif (RTW_DEF_MODULE_REGULATORY_CERT == RTW_MODULE_RTL8192EEBT_HMC_M2) - hal_map = RTL8192EEBT_HMC_M2_country_chplan_exc_map; - hal_map_sz = sizeof(RTL8192EEBT_HMC_M2_country_chplan_exc_map) / sizeof(struct country_chplan); -#elif (RTW_DEF_MODULE_REGULATORY_CERT == RTW_MODULE_RTL8723DE_NGFF1630) - hal_map = RTL8723DE_NGFF1630_country_chplan_exc_map; - hal_map_sz = sizeof(RTL8723DE_NGFF1630_country_chplan_exc_map) / sizeof(struct country_chplan); -#elif (RTW_DEF_MODULE_REGULATORY_CERT == RTW_MODULE_RTL8822BE) - hal_map = RTL8822BE_country_chplan_exc_map; - hal_map_sz = sizeof(RTL8822BE_country_chplan_exc_map) / sizeof(struct country_chplan); -#elif (RTW_DEF_MODULE_REGULATORY_CERT == RTW_MODULE_RTL8821CE) - hal_map = RTL8821CE_country_chplan_exc_map; - hal_map_sz = sizeof(RTL8821CE_country_chplan_exc_map) / sizeof(struct country_chplan); -#elif (RTW_DEF_MODULE_REGULATORY_CERT == RTW_MODULE_RTL8822CE) - hal_map = RTL8822CE_country_chplan_exc_map; - hal_map_sz = sizeof(RTL8822CE_country_chplan_exc_map) / sizeof(struct country_chplan); -#endif - - if (hal_map == NULL || hal_map_sz == 0) - goto exit; - - for (i = 0; i < hal_map_sz; i++) { - if (strncmp(country_code, hal_map[i].alpha2, 2) == 0) { - ent = &hal_map[i]; - break; - } - } - -exit: - return ent; -} -#endif /* CONFIG_CUSTOMIZED_COUNTRY_CHPLAN_MAP or RTW_DEF_MODULE_REGULATORY_CERT */ - -/* -* rtw_get_chplan_from_country - -* @country_code: string of country code -* -* Return pointer of struct country_chplan entry or NULL when unsupported country_code is given -*/ -const struct country_chplan *rtw_get_chplan_from_country(const char *country_code) -{ -#if RTW_DEF_MODULE_REGULATORY_CERT - const struct country_chplan *exc_ent = NULL; -#endif - const struct country_chplan *ent = NULL; - const struct country_chplan *map = NULL; - u16 map_sz = 0; - char code[2]; - int i; - - code[0] = alpha_to_upper(country_code[0]); - code[1] = alpha_to_upper(country_code[1]); - -#ifdef CONFIG_CUSTOMIZED_COUNTRY_CHPLAN_MAP - map = CUSTOMIZED_country_chplan_map; - map_sz = sizeof(CUSTOMIZED_country_chplan_map) / sizeof(struct country_chplan); -#else - #if RTW_DEF_MODULE_REGULATORY_CERT - exc_ent = rtw_def_module_get_chplan_from_country(code); - #endif - map = country_chplan_map; - map_sz = sizeof(country_chplan_map) / sizeof(struct country_chplan); -#endif - - for (i = 0; i < map_sz; i++) { - if (strncmp(code, map[i].alpha2, 2) == 0) { - ent = &map[i]; - break; - } - } - - #if RTW_DEF_MODULE_REGULATORY_CERT - if (!ent || !(COUNTRY_CHPLAN_DEF_MODULE_FALGS(ent) & RTW_DEF_MODULE_REGULATORY_CERT)) - exc_ent = ent = NULL; - if (exc_ent) - ent = exc_ent; - #endif - - return ent; -} - -void dump_country_chplan(void *sel, const struct country_chplan *ent) -{ - RTW_PRINT_SEL(sel, "\"%c%c\", 0x%02X%s\n" - , ent->alpha2[0], ent->alpha2[1], ent->chplan - , COUNTRY_CHPLAN_EN_11AC(ent) ? " ac" : "" - ); -} - -void dump_country_chplan_map(void *sel) -{ - const struct country_chplan *ent; - u8 code[2]; - -#if RTW_DEF_MODULE_REGULATORY_CERT - RTW_PRINT_SEL(sel, "RTW_DEF_MODULE_REGULATORY_CERT:0x%x\n", RTW_DEF_MODULE_REGULATORY_CERT); -#endif -#ifdef CONFIG_CUSTOMIZED_COUNTRY_CHPLAN_MAP - RTW_PRINT_SEL(sel, "CONFIG_CUSTOMIZED_COUNTRY_CHPLAN_MAP\n"); -#endif - - for (code[0] = 'A'; code[0] <= 'Z'; code[0]++) { - for (code[1] = 'A'; code[1] <= 'Z'; code[1]++) { - ent = rtw_get_chplan_from_country(code); - if (!ent) - continue; - - dump_country_chplan(sel, ent); - } - } -} - -void dump_chplan_id_list(void *sel) -{ - u8 first = 1; - int i; - - for (i = 0; i < RTW_CHPLAN_MAX; i++) { - if (!rtw_is_channel_plan_valid(i)) - continue; - - if (first) { - RTW_PRINT_SEL(sel, "0x%02X ", i); - first = 0; - } else - _RTW_PRINT_SEL(sel, "0x%02X ", i); - } - - _RTW_PRINT_SEL(sel, "0x7F\n"); -} - -void dump_chplan_test(void *sel) -{ - int i, j; - - /* check invalid channel */ - for (i = 0; i < RTW_RD_2G_MAX; i++) { - for (j = 0; j < CH_LIST_LEN(RTW_ChannelPlan2G[i]); j++) { - if (rtw_ch2freq(CH_LIST_CH(RTW_ChannelPlan2G[i], j)) == 0) - RTW_PRINT_SEL(sel, "invalid ch:%u at (%d,%d)\n", CH_LIST_CH(RTW_ChannelPlan2G[i], j), i, j); - } - } - -#if CONFIG_IEEE80211_BAND_5GHZ - for (i = 0; i < RTW_RD_5G_MAX; i++) { - for (j = 0; j < CH_LIST_LEN(RTW_ChannelPlan5G[i]); j++) { - if (rtw_ch2freq(CH_LIST_CH(RTW_ChannelPlan5G[i], j)) == 0) - RTW_PRINT_SEL(sel, "invalid ch:%u at (%d,%d)\n", CH_LIST_CH(RTW_ChannelPlan5G[i], j), i, j); - } - } -#endif -} - -void dump_chplan_ver(void *sel) -{ - RTW_PRINT_SEL(sel, "%s-%s\n", RTW_DOMAIN_MAP_VER, RTW_COUNTRY_MAP_VER); -} +/****************************************************************************** + * + * Copyright(c) 2007 - 2018 Realtek Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + *****************************************************************************/ +#define _RTW_CHPLAN_C_ + +#include + +#define RTW_DOMAIN_MAP_VER "43e" +#define RTW_COUNTRY_MAP_VER "25" + +#define RTW_RD_2G_MAX 13 +#define RTW_RD_5G_MAX 73 + +struct ch_list_t { + u8 *len_ch; +}; + +#define CH_LIST_ENT(_len, arg...) \ + {.len_ch = (u8[_len + 1]) {_len, ##arg}, } + +#define CH_LIST_LEN(_ch_list) (_ch_list.len_ch[0]) +#define CH_LIST_CH(_ch_list, _i) (_ch_list.len_ch[_i + 1]) + +struct chplan_ent_t { + u8 rd_2g; +#if CONFIG_IEEE80211_BAND_5GHZ + u8 rd_5g; +#endif + u8 regd; /* value of REGULATION_TXPWR_LMT */ +}; + +#if CONFIG_IEEE80211_BAND_5GHZ +#define CHPLAN_ENT(i2g, i5g, regd) {i2g, i5g, regd} +#else +#define CHPLAN_ENT(i2g, i5g, regd) {i2g, regd} +#endif + +static u8 rtw_hex_setting_buf[RTW_HEXFILE_LEN]; +static struct ch_list_t RTW_ChannelPlan2G[RTW_RD_2G_MAX]; + +#ifdef CONFIG_IEEE80211_BAND_5GHZ +static struct ch_list_t RTW_ChannelPlan5G[RTW_RD_5G_MAX]; +#endif /* CONFIG_IEEE80211_BAND_5GHZ */ + +static struct chplan_ent_t RTW_ChannelPlanMap[RTW_CHPLAN_HEXFILE_MAX]; +static struct country_chplan country_chplan_map[238]; +int rtw_get_channel_plan_from_file(const char *path) +{ + u32 len, idx; + u32 i = 0, j = 0; + u8 sec_1, sec_2; + u16 sec_3, chksum; + + len = rtw_retrieve_from_file(path, rtw_hex_setting_buf, RTW_HEXFILE_LEN); + if (len > RTW_HEXFILE_LEN) { + RTW_WARN("channel plan hexfile oversize\n"); + return -1; + } + if (len == 0) { + RTW_WARN("read channel plan hexfile fail\n"); + return -1; + } + chksum = *(u16 *)(rtw_hex_setting_buf); + if (rtw_calc_crc(rtw_hex_setting_buf + 2, len - 2) != chksum) { + RTW_WARN("read channel plan fail(tainted)\n"); + return -1; + } + sec_1 = rtw_hex_setting_buf[2]; + sec_2 = sec_1 + rtw_hex_setting_buf[3]; + sec_3 = sec_2 + rtw_hex_setting_buf[4]; + i += 5; + while (i < len) { + if (j < sec_1) { + RTW_ChannelPlan2G[j].len_ch = rtw_hex_setting_buf + i; + i += (rtw_hex_setting_buf[i] + 1); + } else if (j >= sec_1 && j < sec_2) { + idx = j - sec_1; + RTW_ChannelPlan5G[idx].len_ch = rtw_hex_setting_buf + i; + i += (rtw_hex_setting_buf[i] + 1); + } else if (j >= sec_2 && j < sec_3) { + if (i + 2 >= len) + return -1; + idx = j - sec_2; + RTW_ChannelPlanMap[idx].rd_2g = + *(rtw_hex_setting_buf + i); + RTW_ChannelPlanMap[idx].rd_5g = + *(rtw_hex_setting_buf + i + 1); + RTW_ChannelPlanMap[idx].regd = + *(rtw_hex_setting_buf + i + 2); + i += 3; + } else { + break; + } + j++; + } + return 0; +} + +u8 rtw_chplan_get_default_regd(u8 id) +{ + u8 regd; + + regd = RTW_ChannelPlanMap[id].regd; + + return regd; +} + +bool rtw_chplan_is_empty(u8 id) +{ + struct chplan_ent_t *chplan_map; + + chplan_map = &RTW_ChannelPlanMap[id]; + + if (chplan_map->rd_2g == 8 + #if CONFIG_IEEE80211_BAND_5GHZ + && chplan_map->rd_5g == 0 + #endif + ) + return _TRUE; + + return _FALSE; +} + +bool rtw_regsty_is_excl_chs(struct registry_priv *regsty, u8 ch) +{ + int i; + + for (i = 0; i < MAX_CHANNEL_NUM; i++) { + if (regsty->excl_chs[i] == 0) + break; + if (regsty->excl_chs[i] == ch) + return _TRUE; + } + return _FALSE; +} + +inline static u8 rtw_rd_5g_band1_passive(u8 rtw_rd_5g) +{ + u8 passive = 0; + + switch (rtw_rd_5g) { + case 41: + case 44: + case 45: + case 46: + case 52: + case 55: + case 59: + case 60: + case 63: + case 64: + case 65: + case 66: + case 67: + passive = 1; + }; + + return passive; +} + +inline static u8 rtw_rd_5g_band4_passive(u8 rtw_rd_5g) +{ + u8 passive = 0; + + switch (rtw_rd_5g) { + case 37: + case 38: + case 45: + case 46: + case 52: + case 61: + case 63: + case 64: + case 65: + case 66: + case 67: + passive = 1; + }; + + return passive; +} + +u8 init_channel_set(_adapter *padapter, u8 ChannelPlan, RT_CHANNEL_INFO *channel_set) +{ + struct registry_priv *regsty = adapter_to_regsty(padapter); + u8 index, chanset_size = 0; + u8 b5GBand = _FALSE, b2_4GBand = _FALSE; + u8 rd_2g = 0, rd_5g = 0; +#ifdef CONFIG_DFS_MASTER + int i; +#endif + + if (!rtw_is_channel_plan_valid(ChannelPlan)) { + RTW_ERR("ChannelPlan ID 0x%02X error !!!!!\n", ChannelPlan); + return chanset_size; + } + + _rtw_memset(channel_set, 0, sizeof(RT_CHANNEL_INFO) * MAX_CHANNEL_NUM); + + if (IsSupported24G(regsty->wireless_mode) && hal_chk_band_cap(padapter, BAND_CAP_2G)) + b2_4GBand = _TRUE; + + if (is_supported_5g(regsty->wireless_mode) && hal_chk_band_cap(padapter, BAND_CAP_5G)) + b5GBand = _TRUE; + + if (b2_4GBand == _FALSE && b5GBand == _FALSE) { + RTW_WARN("HW band_cap has no intersection with SW wireless_mode setting\n"); + return chanset_size; + } + + if (b2_4GBand) { + rd_2g = RTW_ChannelPlanMap[ChannelPlan].rd_2g; + + for (index = 0; index < CH_LIST_LEN(RTW_ChannelPlan2G[rd_2g]); index++) { + if (rtw_regsty_is_excl_chs(regsty, CH_LIST_CH(RTW_ChannelPlan2G[rd_2g], index)) == _TRUE) + continue; + + if (chanset_size >= MAX_CHANNEL_NUM) { + RTW_WARN("chset size can't exceed MAX_CHANNEL_NUM(%u)\n", MAX_CHANNEL_NUM); + break; + } + + channel_set[chanset_size].ChannelNum = CH_LIST_CH(RTW_ChannelPlan2G[rd_2g], index); + + if (ChannelPlan == RTW_CHPLAN_GLOBAL_DOAMIN + || rd_2g == 5 + ) { + /* Channel 1~11 is active, and 12~14 is passive */ + if (channel_set[chanset_size].ChannelNum >= 1 && channel_set[chanset_size].ChannelNum <= 11) + channel_set[chanset_size].ScanType = SCAN_ACTIVE; + else if ((channel_set[chanset_size].ChannelNum >= 12 && channel_set[chanset_size].ChannelNum <= 14)) + channel_set[chanset_size].ScanType = SCAN_PASSIVE; + } else if (ChannelPlan == RTW_CHPLAN_WORLD_WIDE_13 + || ChannelPlan == RTW_CHPLAN_WORLD_WIDE_5G + || rd_2g == 0 + ) { + /* channel 12~13, passive scan */ + if (channel_set[chanset_size].ChannelNum <= 11) + channel_set[chanset_size].ScanType = SCAN_ACTIVE; + else + channel_set[chanset_size].ScanType = SCAN_PASSIVE; + } else + channel_set[chanset_size].ScanType = SCAN_ACTIVE; + + chanset_size++; + } + } + +#if CONFIG_IEEE80211_BAND_5GHZ + if (b5GBand) { + rd_5g = RTW_ChannelPlanMap[ChannelPlan].rd_5g; + + for (index = 0; index < CH_LIST_LEN(RTW_ChannelPlan5G[rd_5g]); index++) { + if (rtw_regsty_is_excl_chs(regsty, CH_LIST_CH(RTW_ChannelPlan5G[rd_5g], index)) == _TRUE) + continue; + #if !CONFIG_DFS + if (rtw_is_dfs_ch(CH_LIST_CH(RTW_ChannelPlan5G[rd_5g], index))) + continue; + #endif + + if (chanset_size >= MAX_CHANNEL_NUM) { + RTW_WARN("chset size can't exceed MAX_CHANNEL_NUM(%u)\n", MAX_CHANNEL_NUM); + break; + } + + channel_set[chanset_size].ChannelNum = CH_LIST_CH(RTW_ChannelPlan5G[rd_5g], index); + + if ((ChannelPlan == RTW_CHPLAN_WORLD_WIDE_5G) /* all channels passive */ + || (rtw_is_5g_band1(channel_set[chanset_size].ChannelNum) + && rtw_rd_5g_band1_passive(rd_5g)) /* band1 passive */ + || (rtw_is_5g_band4(channel_set[chanset_size].ChannelNum) + && rtw_rd_5g_band4_passive(rd_5g)) /* band4 passive */ + || (rtw_is_dfs_ch(channel_set[chanset_size].ChannelNum)) /* DFS channel(band2, 3) passive */ + ) + channel_set[chanset_size].ScanType = SCAN_PASSIVE; + else + channel_set[chanset_size].ScanType = SCAN_ACTIVE; + + chanset_size++; + } + } + + #ifdef CONFIG_DFS_MASTER + for (i = 0; i < chanset_size; i++) + channel_set[i].non_ocp_end_time = rtw_get_current_time(); + #endif +#endif /* CONFIG_IEEE80211_BAND_5GHZ */ + + if (chanset_size) + RTW_INFO(FUNC_ADPT_FMT" ChannelPlan ID:0x%02x, ch num:%d\n" + , FUNC_ADPT_ARG(padapter), ChannelPlan, chanset_size); + else + RTW_WARN(FUNC_ADPT_FMT" ChannelPlan ID:0x%02x, final chset has no channel\n" + , FUNC_ADPT_ARG(padapter), ChannelPlan); + + return chanset_size; +} + +#ifdef CONFIG_80211AC_VHT +#define COUNTRY_CHPLAN_ASSIGN_EN_11AC(_val) , .en_11ac = (_val) +#else +#define COUNTRY_CHPLAN_ASSIGN_EN_11AC(_val) +#endif + +#if RTW_DEF_MODULE_REGULATORY_CERT +#define COUNTRY_CHPLAN_ASSIGN_DEF_MODULE_FLAGS(_val) , .def_module_flags = (_val) +#else +#define COUNTRY_CHPLAN_ASSIGN_DEF_MODULE_FLAGS(_val) +#endif + +/* has def_module_flags specified, used by common map and HAL dfference map */ +#define COUNTRY_CHPLAN_ENT(_alpha2, _chplan, _en_11ac, _def_module_flags) \ + {.alpha2 = (_alpha2), .chplan = (_chplan) \ + COUNTRY_CHPLAN_ASSIGN_EN_11AC(_en_11ac) \ + COUNTRY_CHPLAN_ASSIGN_DEF_MODULE_FLAGS(_def_module_flags) \ + } + +#ifdef CONFIG_CUSTOMIZED_COUNTRY_CHPLAN_MAP + +#include "../platform/custom_country_chplan.h" + +#elif RTW_DEF_MODULE_REGULATORY_CERT + +/** + * rtw_def_module_get_chplan_from_country - + * @country_code: string of country code + * @return: + * Return NULL for case referring to common map + */ +static const struct country_chplan *rtw_def_module_get_chplan_from_country(const char *country_code) +{ + const struct country_chplan *ent = NULL; + const struct country_chplan *hal_map = NULL; + u16 hal_map_sz = 0; + int i; + + /* TODO: runtime selection for multi driver */ +#if (RTW_DEF_MODULE_REGULATORY_CERT == RTW_MODULE_RTL8821AE_HMC_M2) + hal_map = RTL8821AE_HMC_M2_country_chplan_exc_map; + hal_map_sz = sizeof(RTL8821AE_HMC_M2_country_chplan_exc_map) / sizeof(struct country_chplan); +#elif (RTW_DEF_MODULE_REGULATORY_CERT == RTW_MODULE_RTL8821AU) + hal_map = RTL8821AU_country_chplan_exc_map; + hal_map_sz = sizeof(RTL8821AU_country_chplan_exc_map) / sizeof(struct country_chplan); +#elif (RTW_DEF_MODULE_REGULATORY_CERT == RTW_MODULE_RTL8812AENF_NGFF) + hal_map = RTL8812AENF_NGFF_country_chplan_exc_map; + hal_map_sz = sizeof(RTL8812AENF_NGFF_country_chplan_exc_map) / sizeof(struct country_chplan); +#elif (RTW_DEF_MODULE_REGULATORY_CERT == RTW_MODULE_RTL8812AEBT_HMC) + hal_map = RTL8812AEBT_HMC_country_chplan_exc_map; + hal_map_sz = sizeof(RTL8812AEBT_HMC_country_chplan_exc_map) / sizeof(struct country_chplan); +#elif (RTW_DEF_MODULE_REGULATORY_CERT == RTW_MODULE_RTL8188EE_HMC_M2) + hal_map = RTL8188EE_HMC_M2_country_chplan_exc_map; + hal_map_sz = sizeof(RTL8188EE_HMC_M2_country_chplan_exc_map) / sizeof(struct country_chplan); +#elif (RTW_DEF_MODULE_REGULATORY_CERT == RTW_MODULE_RTL8723BE_HMC_M2) + hal_map = RTL8723BE_HMC_M2_country_chplan_exc_map; + hal_map_sz = sizeof(RTL8723BE_HMC_M2_country_chplan_exc_map) / sizeof(struct country_chplan); +#elif (RTW_DEF_MODULE_REGULATORY_CERT == RTW_MODULE_RTL8723BS_NGFF1216) + hal_map = RTL8723BS_NGFF1216_country_chplan_exc_map; + hal_map_sz = sizeof(RTL8723BS_NGFF1216_country_chplan_exc_map) / sizeof(struct country_chplan); +#elif (RTW_DEF_MODULE_REGULATORY_CERT == RTW_MODULE_RTL8192EEBT_HMC_M2) + hal_map = RTL8192EEBT_HMC_M2_country_chplan_exc_map; + hal_map_sz = sizeof(RTL8192EEBT_HMC_M2_country_chplan_exc_map) / sizeof(struct country_chplan); +#elif (RTW_DEF_MODULE_REGULATORY_CERT == RTW_MODULE_RTL8723DE_NGFF1630) + hal_map = RTL8723DE_NGFF1630_country_chplan_exc_map; + hal_map_sz = sizeof(RTL8723DE_NGFF1630_country_chplan_exc_map) / sizeof(struct country_chplan); +#elif (RTW_DEF_MODULE_REGULATORY_CERT == RTW_MODULE_RTL8822BE) + hal_map = RTL8822BE_country_chplan_exc_map; + hal_map_sz = sizeof(RTL8822BE_country_chplan_exc_map) / sizeof(struct country_chplan); +#elif (RTW_DEF_MODULE_REGULATORY_CERT == RTW_MODULE_RTL8821CE) + hal_map = RTL8821CE_country_chplan_exc_map; + hal_map_sz = sizeof(RTL8821CE_country_chplan_exc_map) / sizeof(struct country_chplan); +#elif (RTW_DEF_MODULE_REGULATORY_CERT == RTW_MODULE_RTL8822CE) + hal_map = RTL8822CE_country_chplan_exc_map; + hal_map_sz = sizeof(RTL8822CE_country_chplan_exc_map) / sizeof(struct country_chplan); +#endif + + if (hal_map == NULL || hal_map_sz == 0) + goto exit; + + for (i = 0; i < hal_map_sz; i++) { + if (strncmp(country_code, hal_map[i].alpha2, 2) == 0) { + ent = &hal_map[i]; + break; + } + } + +exit: + return ent; +} +#endif /* CONFIG_CUSTOMIZED_COUNTRY_CHPLAN_MAP or RTW_DEF_MODULE_REGULATORY_CERT */ + +/* +* rtw_get_chplan_from_country - +* @country_code: string of country code +* +* Return pointer of struct country_chplan entry or NULL when unsupported country_code is given +*/ +const struct country_chplan *rtw_get_chplan_from_country(const char *country_code) +{ +#if RTW_DEF_MODULE_REGULATORY_CERT + const struct country_chplan *exc_ent = NULL; +#endif + const struct country_chplan *ent = NULL; + const struct country_chplan *map = NULL; + u16 map_sz = 0; + char code[2]; + int i; + + code[0] = alpha_to_upper(country_code[0]); + code[1] = alpha_to_upper(country_code[1]); + +#ifdef CONFIG_CUSTOMIZED_COUNTRY_CHPLAN_MAP + map = CUSTOMIZED_country_chplan_map; + map_sz = sizeof(CUSTOMIZED_country_chplan_map) / sizeof(struct country_chplan); +#else + #if RTW_DEF_MODULE_REGULATORY_CERT + exc_ent = rtw_def_module_get_chplan_from_country(code); + #endif + map = country_chplan_map; + map_sz = sizeof(country_chplan_map) / sizeof(struct country_chplan); +#endif + + for (i = 0; i < map_sz; i++) { + if (strncmp(code, map[i].alpha2, 2) == 0) { + ent = &map[i]; + break; + } + } + + #if RTW_DEF_MODULE_REGULATORY_CERT + if (!ent || !(COUNTRY_CHPLAN_DEF_MODULE_FALGS(ent) & RTW_DEF_MODULE_REGULATORY_CERT)) + exc_ent = ent = NULL; + if (exc_ent) + ent = exc_ent; + #endif + + return ent; +} + +void dump_country_chplan(void *sel, const struct country_chplan *ent) +{ + RTW_PRINT_SEL(sel, "\"%c%c\", 0x%02X%s\n" + , ent->alpha2[0], ent->alpha2[1], ent->chplan + , COUNTRY_CHPLAN_EN_11AC(ent) ? " ac" : "" + ); +} + +void dump_country_chplan_map(void *sel) +{ + const struct country_chplan *ent; + u8 code[2]; + +#if RTW_DEF_MODULE_REGULATORY_CERT + RTW_PRINT_SEL(sel, "RTW_DEF_MODULE_REGULATORY_CERT:0x%x\n", RTW_DEF_MODULE_REGULATORY_CERT); +#endif +#ifdef CONFIG_CUSTOMIZED_COUNTRY_CHPLAN_MAP + RTW_PRINT_SEL(sel, "CONFIG_CUSTOMIZED_COUNTRY_CHPLAN_MAP\n"); +#endif + + for (code[0] = 'A'; code[0] <= 'Z'; code[0]++) { + for (code[1] = 'A'; code[1] <= 'Z'; code[1]++) { + ent = rtw_get_chplan_from_country(code); + if (!ent) + continue; + + dump_country_chplan(sel, ent); + } + } +} + +void dump_chplan_id_list(void *sel) +{ + u8 first = 1; + int i; + + for (i = 0; i < RTW_CHPLAN_MAX; i++) { + if (!rtw_is_channel_plan_valid(i)) + continue; + + if (first) { + RTW_PRINT_SEL(sel, "0x%02X ", i); + first = 0; + } else + _RTW_PRINT_SEL(sel, "0x%02X ", i); + } + + _RTW_PRINT_SEL(sel, "0x7F\n"); +} + +void dump_chplan_test(void *sel) +{ + int i, j; + + /* check invalid channel */ + for (i = 0; i < RTW_RD_2G_MAX; i++) { + for (j = 0; j < CH_LIST_LEN(RTW_ChannelPlan2G[i]); j++) { + if (rtw_ch2freq(CH_LIST_CH(RTW_ChannelPlan2G[i], j)) == 0) + RTW_PRINT_SEL(sel, "invalid ch:%u at (%d,%d)\n", CH_LIST_CH(RTW_ChannelPlan2G[i], j), i, j); + } + } + +#if CONFIG_IEEE80211_BAND_5GHZ + for (i = 0; i < RTW_RD_5G_MAX; i++) { + for (j = 0; j < CH_LIST_LEN(RTW_ChannelPlan5G[i]); j++) { + if (rtw_ch2freq(CH_LIST_CH(RTW_ChannelPlan5G[i], j)) == 0) + RTW_PRINT_SEL(sel, "invalid ch:%u at (%d,%d)\n", CH_LIST_CH(RTW_ChannelPlan5G[i], j), i, j); + } + } +#endif +} + +void dump_chplan_ver(void *sel) +{ + RTW_PRINT_SEL(sel, "%s-%s\n", RTW_DOMAIN_MAP_VER, RTW_COUNTRY_MAP_VER); +} diff --git a/drivers/net/wireless/realtek/rtl8822ce/core/rtw_chplan.h b/drivers/net/wireless/realtek/rtl8822ce/core/rtw_chplan.h index a0466308..25ea5910 100644 --- a/drivers/net/wireless/realtek/rtl8822ce/core/rtw_chplan.h +++ b/drivers/net/wireless/realtek/rtl8822ce/core/rtw_chplan.h @@ -1,194 +1,194 @@ -/****************************************************************************** - * - * Copyright(c) 2007 - 2018 Realtek Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - *****************************************************************************/ -#ifndef __RTW_CHPLAN_H__ -#define __RTW_CHPLAN_H__ - -enum rtw_chplan_id { - /* ===== 0x00 ~ 0x1F, legacy channel plan ===== */ - RTW_CHPLAN_FCC = 0x00, - RTW_CHPLAN_IC = 0x01, - RTW_CHPLAN_ETSI = 0x02, - RTW_CHPLAN_SPAIN = 0x03, - RTW_CHPLAN_FRANCE = 0x04, - RTW_CHPLAN_MKK = 0x05, - RTW_CHPLAN_MKK1 = 0x06, - RTW_CHPLAN_ISRAEL = 0x07, - RTW_CHPLAN_TELEC = 0x08, - RTW_CHPLAN_GLOBAL_DOAMIN = 0x09, - RTW_CHPLAN_WORLD_WIDE_13 = 0x0A, - RTW_CHPLAN_TAIWAN = 0x0B, - RTW_CHPLAN_CHINA = 0x0C, - RTW_CHPLAN_SINGAPORE_INDIA_MEXICO = 0x0D, - RTW_CHPLAN_KOREA = 0x0E, - RTW_CHPLAN_TURKEY = 0x0F, - RTW_CHPLAN_JAPAN = 0x10, - RTW_CHPLAN_FCC_NO_DFS = 0x11, - RTW_CHPLAN_JAPAN_NO_DFS = 0x12, - RTW_CHPLAN_WORLD_WIDE_5G = 0x13, - RTW_CHPLAN_TAIWAN_NO_DFS = 0x14, - - /* ===== 0x20 ~ 0x7F, new channel plan ===== */ - RTW_CHPLAN_WORLD_NULL = 0x20, - RTW_CHPLAN_ETSI1_NULL = 0x21, - RTW_CHPLAN_FCC1_NULL = 0x22, - RTW_CHPLAN_MKK1_NULL = 0x23, - RTW_CHPLAN_ETSI2_NULL = 0x24, - RTW_CHPLAN_FCC1_FCC1 = 0x25, - RTW_CHPLAN_WORLD_ETSI1 = 0x26, - RTW_CHPLAN_MKK1_MKK1 = 0x27, - RTW_CHPLAN_WORLD_KCC1 = 0x28, - RTW_CHPLAN_WORLD_FCC2 = 0x29, - RTW_CHPLAN_FCC2_NULL = 0x2A, - RTW_CHPLAN_IC1_IC2 = 0x2B, - RTW_CHPLAN_MKK2_NULL = 0x2C, - RTW_CHPLAN_WORLD_CHILE1= 0x2D, - RTW_CHPLAN_WORLD1_WORLD1 = 0x2E, - RTW_CHPLAN_WORLD_CHILE2 = 0x2F, - RTW_CHPLAN_WORLD_FCC3 = 0x30, - RTW_CHPLAN_WORLD_FCC4 = 0x31, - RTW_CHPLAN_WORLD_FCC5 = 0x32, - RTW_CHPLAN_WORLD_FCC6 = 0x33, - RTW_CHPLAN_FCC1_FCC7 = 0x34, - RTW_CHPLAN_WORLD_ETSI2 = 0x35, - RTW_CHPLAN_WORLD_ETSI3 = 0x36, - RTW_CHPLAN_MKK1_MKK2 = 0x37, - RTW_CHPLAN_MKK1_MKK3 = 0x38, - RTW_CHPLAN_FCC1_NCC1 = 0x39, - RTW_CHPLAN_ETSI1_ETSI1 = 0x3A, - RTW_CHPLAN_ETSI1_ACMA1 = 0x3B, - RTW_CHPLAN_ETSI1_ETSI6 = 0x3C, - RTW_CHPLAN_ETSI1_ETSI12 = 0x3D, - RTW_CHPLAN_KCC1_KCC2 = 0x3E, - RTW_CHPLAN_FCC1_FCC11 = 0x3F, - RTW_CHPLAN_FCC1_NCC2 = 0x40, - RTW_CHPLAN_GLOBAL_NULL = 0x41, - RTW_CHPLAN_ETSI1_ETSI4 = 0x42, - RTW_CHPLAN_FCC1_FCC2 = 0x43, - RTW_CHPLAN_FCC1_NCC3 = 0x44, - RTW_CHPLAN_WORLD_ACMA1 = 0x45, - RTW_CHPLAN_FCC1_FCC8 = 0x46, - RTW_CHPLAN_WORLD_ETSI6 = 0x47, - RTW_CHPLAN_WORLD_ETSI7 = 0x48, - RTW_CHPLAN_WORLD_ETSI8 = 0x49, - RTW_CHPLAN_IC2_IC2 = 0x4A, - RTW_CHPLAN_KCC1_KCC3 = 0x4B, - RTW_CHPLAN_FCC1_FCC15 = 0x4C, - RTW_CHPLAN_FCC2_MEX1 = 0x4D, - RTW_CHPLAN_ETSI1_ETSI22 = 0x4E, - RTW_CHPLAN_NULL_MKK9 = 0x4F, - RTW_CHPLAN_WORLD_ETSI9 = 0x50, - RTW_CHPLAN_WORLD_ETSI10 = 0x51, - RTW_CHPLAN_WORLD_ETSI11 = 0x52, - RTW_CHPLAN_FCC1_NCC4 = 0x53, - RTW_CHPLAN_WORLD_ETSI12 = 0x54, - RTW_CHPLAN_FCC1_FCC9 = 0x55, - RTW_CHPLAN_WORLD_ETSI13 = 0x56, - RTW_CHPLAN_FCC1_FCC10 = 0x57, - RTW_CHPLAN_MKK2_MKK4 = 0x58, - RTW_CHPLAN_WORLD_ETSI14 = 0x59, - RTW_CHPLAN_NULL_FCC19 = 0x5A, - RTW_CHPLAN_NULL_FCC20 = 0x5B, - RTW_CHPLAN_NULL_FCC21 = 0x5C, - RTW_CHPLAN_ETSI1_ETSI23 = 0x5D, - RTW_CHPLAN_ETSI1_ETSI2 = 0x5E, - RTW_CHPLAN_FCC1_FCC5 = 0x60, - RTW_CHPLAN_FCC2_FCC7 = 0x61, - RTW_CHPLAN_FCC2_FCC1 = 0x62, - RTW_CHPLAN_WORLD_ETSI15 = 0x63, - RTW_CHPLAN_MKK2_MKK5 = 0x64, - RTW_CHPLAN_ETSI1_ETSI16 = 0x65, - RTW_CHPLAN_FCC1_FCC14 = 0x66, - RTW_CHPLAN_FCC1_FCC12 = 0x67, - RTW_CHPLAN_FCC2_FCC14 = 0x68, - RTW_CHPLAN_FCC2_FCC12 = 0x69, - RTW_CHPLAN_ETSI1_ETSI17 = 0x6A, - RTW_CHPLAN_WORLD_FCC16 = 0x6B, - RTW_CHPLAN_WORLD_FCC13 = 0x6C, - RTW_CHPLAN_FCC2_FCC15 = 0x6D, - RTW_CHPLAN_WORLD_FCC12 = 0x6E, - RTW_CHPLAN_NULL_ETSI8 = 0x6F, - RTW_CHPLAN_NULL_ETSI18 = 0x70, - RTW_CHPLAN_NULL_ETSI17 = 0x71, - RTW_CHPLAN_NULL_ETSI19 = 0x72, - RTW_CHPLAN_WORLD_FCC7 = 0x73, - RTW_CHPLAN_FCC2_FCC17 = 0x74, - RTW_CHPLAN_WORLD_ETSI20 = 0x75, - RTW_CHPLAN_FCC2_FCC11 = 0x76, - RTW_CHPLAN_WORLD_ETSI21 = 0x77, - RTW_CHPLAN_FCC1_FCC18 = 0x78, - RTW_CHPLAN_MKK2_MKK1 = 0x79, - - RTW_CHPLAN_MAX, - RTW_CHPLAN_REALTEK_DEFINE = 0x7F, - RTW_CHPLAN_HEXFILE_MAX, - RTW_CHPLAN_UNSPECIFIED = 0xFF, -}; - -int rtw_get_channel_plan_from_file(const char *path); -u8 rtw_chplan_get_default_regd(u8 id); -bool rtw_chplan_is_empty(u8 id); -#define rtw_is_channel_plan_valid(chplan) (((chplan) < RTW_CHPLAN_MAX || (chplan) == RTW_CHPLAN_REALTEK_DEFINE) && !rtw_chplan_is_empty(chplan)) -#define rtw_is_legacy_channel_plan(chplan) ((chplan) < 0x20) - -struct _RT_CHANNEL_INFO; -u8 init_channel_set(_adapter *padapter, u8 ChannelPlan, struct _RT_CHANNEL_INFO *channel_set); - -#define IS_ALPHA2_NO_SPECIFIED(_alpha2) ((*((u16 *)(_alpha2))) == 0xFFFF) - -#define RTW_MODULE_RTL8821AE_HMC_M2 BIT0 /* RTL8821AE(HMC + M.2) */ -#define RTW_MODULE_RTL8821AU BIT1 /* RTL8821AU */ -#define RTW_MODULE_RTL8812AENF_NGFF BIT2 /* RTL8812AENF(8812AE+8761)_NGFF */ -#define RTW_MODULE_RTL8812AEBT_HMC BIT3 /* RTL8812AEBT(8812AE+8761)_HMC */ -#define RTW_MODULE_RTL8188EE_HMC_M2 BIT4 /* RTL8188EE(HMC + M.2) */ -#define RTW_MODULE_RTL8723BE_HMC_M2 BIT5 /* RTL8723BE(HMC + M.2) */ -#define RTW_MODULE_RTL8723BS_NGFF1216 BIT6 /* RTL8723BS(NGFF1216) */ -#define RTW_MODULE_RTL8192EEBT_HMC_M2 BIT7 /* RTL8192EEBT(8192EE+8761AU)_(HMC + M.2) */ -#define RTW_MODULE_RTL8723DE_NGFF1630 BIT8 /* RTL8723DE(NGFF1630) */ -#define RTW_MODULE_RTL8822BE BIT9 /* RTL8822BE */ -#define RTW_MODULE_RTL8821CE BIT10 /* RTL8821CE */ -#define RTW_MODULE_RTL8822CE BIT11 /* RTL8822CE */ - -struct country_chplan { - char alpha2[2]; - u8 chplan; -#ifdef CONFIG_80211AC_VHT - u8 en_11ac; -#endif -#if RTW_DEF_MODULE_REGULATORY_CERT - u16 def_module_flags; /* RTW_MODULE_RTLXXX */ -#endif -}; - -#ifdef CONFIG_80211AC_VHT -#define COUNTRY_CHPLAN_EN_11AC(_ent) ((_ent)->en_11ac) -#else -#define COUNTRY_CHPLAN_EN_11AC(_ent) 0 -#endif - -#if RTW_DEF_MODULE_REGULATORY_CERT -#define COUNTRY_CHPLAN_DEF_MODULE_FALGS(_ent) ((_ent)->def_module_flags) -#else -#define COUNTRY_CHPLAN_DEF_MODULE_FALGS(_ent) 0 -#endif - -const struct country_chplan *rtw_get_chplan_from_country(const char *country_code); - -void dump_country_chplan(void *sel, const struct country_chplan *ent); -void dump_country_chplan_map(void *sel); -void dump_chplan_id_list(void *sel); -void dump_chplan_test(void *sel); -void dump_chplan_ver(void *sel); - -#endif /* __RTW_CHPLAN_H__ */ +/****************************************************************************** + * + * Copyright(c) 2007 - 2018 Realtek Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + *****************************************************************************/ +#ifndef __RTW_CHPLAN_H__ +#define __RTW_CHPLAN_H__ + +enum rtw_chplan_id { + /* ===== 0x00 ~ 0x1F, legacy channel plan ===== */ + RTW_CHPLAN_FCC = 0x00, + RTW_CHPLAN_IC = 0x01, + RTW_CHPLAN_ETSI = 0x02, + RTW_CHPLAN_SPAIN = 0x03, + RTW_CHPLAN_FRANCE = 0x04, + RTW_CHPLAN_MKK = 0x05, + RTW_CHPLAN_MKK1 = 0x06, + RTW_CHPLAN_ISRAEL = 0x07, + RTW_CHPLAN_TELEC = 0x08, + RTW_CHPLAN_GLOBAL_DOAMIN = 0x09, + RTW_CHPLAN_WORLD_WIDE_13 = 0x0A, + RTW_CHPLAN_TAIWAN = 0x0B, + RTW_CHPLAN_CHINA = 0x0C, + RTW_CHPLAN_SINGAPORE_INDIA_MEXICO = 0x0D, + RTW_CHPLAN_KOREA = 0x0E, + RTW_CHPLAN_TURKEY = 0x0F, + RTW_CHPLAN_JAPAN = 0x10, + RTW_CHPLAN_FCC_NO_DFS = 0x11, + RTW_CHPLAN_JAPAN_NO_DFS = 0x12, + RTW_CHPLAN_WORLD_WIDE_5G = 0x13, + RTW_CHPLAN_TAIWAN_NO_DFS = 0x14, + + /* ===== 0x20 ~ 0x7F, new channel plan ===== */ + RTW_CHPLAN_WORLD_NULL = 0x20, + RTW_CHPLAN_ETSI1_NULL = 0x21, + RTW_CHPLAN_FCC1_NULL = 0x22, + RTW_CHPLAN_MKK1_NULL = 0x23, + RTW_CHPLAN_ETSI2_NULL = 0x24, + RTW_CHPLAN_FCC1_FCC1 = 0x25, + RTW_CHPLAN_WORLD_ETSI1 = 0x26, + RTW_CHPLAN_MKK1_MKK1 = 0x27, + RTW_CHPLAN_WORLD_KCC1 = 0x28, + RTW_CHPLAN_WORLD_FCC2 = 0x29, + RTW_CHPLAN_FCC2_NULL = 0x2A, + RTW_CHPLAN_IC1_IC2 = 0x2B, + RTW_CHPLAN_MKK2_NULL = 0x2C, + RTW_CHPLAN_WORLD_CHILE1= 0x2D, + RTW_CHPLAN_WORLD1_WORLD1 = 0x2E, + RTW_CHPLAN_WORLD_CHILE2 = 0x2F, + RTW_CHPLAN_WORLD_FCC3 = 0x30, + RTW_CHPLAN_WORLD_FCC4 = 0x31, + RTW_CHPLAN_WORLD_FCC5 = 0x32, + RTW_CHPLAN_WORLD_FCC6 = 0x33, + RTW_CHPLAN_FCC1_FCC7 = 0x34, + RTW_CHPLAN_WORLD_ETSI2 = 0x35, + RTW_CHPLAN_WORLD_ETSI3 = 0x36, + RTW_CHPLAN_MKK1_MKK2 = 0x37, + RTW_CHPLAN_MKK1_MKK3 = 0x38, + RTW_CHPLAN_FCC1_NCC1 = 0x39, + RTW_CHPLAN_ETSI1_ETSI1 = 0x3A, + RTW_CHPLAN_ETSI1_ACMA1 = 0x3B, + RTW_CHPLAN_ETSI1_ETSI6 = 0x3C, + RTW_CHPLAN_ETSI1_ETSI12 = 0x3D, + RTW_CHPLAN_KCC1_KCC2 = 0x3E, + RTW_CHPLAN_FCC1_FCC11 = 0x3F, + RTW_CHPLAN_FCC1_NCC2 = 0x40, + RTW_CHPLAN_GLOBAL_NULL = 0x41, + RTW_CHPLAN_ETSI1_ETSI4 = 0x42, + RTW_CHPLAN_FCC1_FCC2 = 0x43, + RTW_CHPLAN_FCC1_NCC3 = 0x44, + RTW_CHPLAN_WORLD_ACMA1 = 0x45, + RTW_CHPLAN_FCC1_FCC8 = 0x46, + RTW_CHPLAN_WORLD_ETSI6 = 0x47, + RTW_CHPLAN_WORLD_ETSI7 = 0x48, + RTW_CHPLAN_WORLD_ETSI8 = 0x49, + RTW_CHPLAN_IC2_IC2 = 0x4A, + RTW_CHPLAN_KCC1_KCC3 = 0x4B, + RTW_CHPLAN_FCC1_FCC15 = 0x4C, + RTW_CHPLAN_FCC2_MEX1 = 0x4D, + RTW_CHPLAN_ETSI1_ETSI22 = 0x4E, + RTW_CHPLAN_NULL_MKK9 = 0x4F, + RTW_CHPLAN_WORLD_ETSI9 = 0x50, + RTW_CHPLAN_WORLD_ETSI10 = 0x51, + RTW_CHPLAN_WORLD_ETSI11 = 0x52, + RTW_CHPLAN_FCC1_NCC4 = 0x53, + RTW_CHPLAN_WORLD_ETSI12 = 0x54, + RTW_CHPLAN_FCC1_FCC9 = 0x55, + RTW_CHPLAN_WORLD_ETSI13 = 0x56, + RTW_CHPLAN_FCC1_FCC10 = 0x57, + RTW_CHPLAN_MKK2_MKK4 = 0x58, + RTW_CHPLAN_WORLD_ETSI14 = 0x59, + RTW_CHPLAN_NULL_FCC19 = 0x5A, + RTW_CHPLAN_NULL_FCC20 = 0x5B, + RTW_CHPLAN_NULL_FCC21 = 0x5C, + RTW_CHPLAN_ETSI1_ETSI23 = 0x5D, + RTW_CHPLAN_ETSI1_ETSI2 = 0x5E, + RTW_CHPLAN_FCC1_FCC5 = 0x60, + RTW_CHPLAN_FCC2_FCC7 = 0x61, + RTW_CHPLAN_FCC2_FCC1 = 0x62, + RTW_CHPLAN_WORLD_ETSI15 = 0x63, + RTW_CHPLAN_MKK2_MKK5 = 0x64, + RTW_CHPLAN_ETSI1_ETSI16 = 0x65, + RTW_CHPLAN_FCC1_FCC14 = 0x66, + RTW_CHPLAN_FCC1_FCC12 = 0x67, + RTW_CHPLAN_FCC2_FCC14 = 0x68, + RTW_CHPLAN_FCC2_FCC12 = 0x69, + RTW_CHPLAN_ETSI1_ETSI17 = 0x6A, + RTW_CHPLAN_WORLD_FCC16 = 0x6B, + RTW_CHPLAN_WORLD_FCC13 = 0x6C, + RTW_CHPLAN_FCC2_FCC15 = 0x6D, + RTW_CHPLAN_WORLD_FCC12 = 0x6E, + RTW_CHPLAN_NULL_ETSI8 = 0x6F, + RTW_CHPLAN_NULL_ETSI18 = 0x70, + RTW_CHPLAN_NULL_ETSI17 = 0x71, + RTW_CHPLAN_NULL_ETSI19 = 0x72, + RTW_CHPLAN_WORLD_FCC7 = 0x73, + RTW_CHPLAN_FCC2_FCC17 = 0x74, + RTW_CHPLAN_WORLD_ETSI20 = 0x75, + RTW_CHPLAN_FCC2_FCC11 = 0x76, + RTW_CHPLAN_WORLD_ETSI21 = 0x77, + RTW_CHPLAN_FCC1_FCC18 = 0x78, + RTW_CHPLAN_MKK2_MKK1 = 0x79, + + RTW_CHPLAN_MAX, + RTW_CHPLAN_REALTEK_DEFINE = 0x7F, + RTW_CHPLAN_HEXFILE_MAX, + RTW_CHPLAN_UNSPECIFIED = 0xFF, +}; + +int rtw_get_channel_plan_from_file(const char *path); +u8 rtw_chplan_get_default_regd(u8 id); +bool rtw_chplan_is_empty(u8 id); +#define rtw_is_channel_plan_valid(chplan) (((chplan) < RTW_CHPLAN_MAX || (chplan) == RTW_CHPLAN_REALTEK_DEFINE) && !rtw_chplan_is_empty(chplan)) +#define rtw_is_legacy_channel_plan(chplan) ((chplan) < 0x20) + +struct _RT_CHANNEL_INFO; +u8 init_channel_set(_adapter *padapter, u8 ChannelPlan, struct _RT_CHANNEL_INFO *channel_set); + +#define IS_ALPHA2_NO_SPECIFIED(_alpha2) ((*((u16 *)(_alpha2))) == 0xFFFF) + +#define RTW_MODULE_RTL8821AE_HMC_M2 BIT0 /* RTL8821AE(HMC + M.2) */ +#define RTW_MODULE_RTL8821AU BIT1 /* RTL8821AU */ +#define RTW_MODULE_RTL8812AENF_NGFF BIT2 /* RTL8812AENF(8812AE+8761)_NGFF */ +#define RTW_MODULE_RTL8812AEBT_HMC BIT3 /* RTL8812AEBT(8812AE+8761)_HMC */ +#define RTW_MODULE_RTL8188EE_HMC_M2 BIT4 /* RTL8188EE(HMC + M.2) */ +#define RTW_MODULE_RTL8723BE_HMC_M2 BIT5 /* RTL8723BE(HMC + M.2) */ +#define RTW_MODULE_RTL8723BS_NGFF1216 BIT6 /* RTL8723BS(NGFF1216) */ +#define RTW_MODULE_RTL8192EEBT_HMC_M2 BIT7 /* RTL8192EEBT(8192EE+8761AU)_(HMC + M.2) */ +#define RTW_MODULE_RTL8723DE_NGFF1630 BIT8 /* RTL8723DE(NGFF1630) */ +#define RTW_MODULE_RTL8822BE BIT9 /* RTL8822BE */ +#define RTW_MODULE_RTL8821CE BIT10 /* RTL8821CE */ +#define RTW_MODULE_RTL8822CE BIT11 /* RTL8822CE */ + +struct country_chplan { + char alpha2[2]; + u8 chplan; +#ifdef CONFIG_80211AC_VHT + u8 en_11ac; +#endif +#if RTW_DEF_MODULE_REGULATORY_CERT + u16 def_module_flags; /* RTW_MODULE_RTLXXX */ +#endif +}; + +#ifdef CONFIG_80211AC_VHT +#define COUNTRY_CHPLAN_EN_11AC(_ent) ((_ent)->en_11ac) +#else +#define COUNTRY_CHPLAN_EN_11AC(_ent) 0 +#endif + +#if RTW_DEF_MODULE_REGULATORY_CERT +#define COUNTRY_CHPLAN_DEF_MODULE_FALGS(_ent) ((_ent)->def_module_flags) +#else +#define COUNTRY_CHPLAN_DEF_MODULE_FALGS(_ent) 0 +#endif + +const struct country_chplan *rtw_get_chplan_from_country(const char *country_code); + +void dump_country_chplan(void *sel, const struct country_chplan *ent); +void dump_country_chplan_map(void *sel); +void dump_chplan_id_list(void *sel); +void dump_chplan_test(void *sel); +void dump_chplan_ver(void *sel); + +#endif /* __RTW_CHPLAN_H__ */ diff --git a/drivers/net/wireless/realtek/rtl8822ce/core/rtw_cmd.c b/drivers/net/wireless/realtek/rtl8822ce/core/rtw_cmd.c old mode 100644 new mode 100755 index a05d3ff5..d178cf2f --- a/drivers/net/wireless/realtek/rtl8822ce/core/rtw_cmd.c +++ b/drivers/net/wireless/realtek/rtl8822ce/core/rtw_cmd.c @@ -1289,7 +1289,7 @@ u8 rtw_stop_ap_cmd(_adapter *adapter, u8 flags) parm->type = 0; parm->size = 0; parm->pbuf = NULL; - + /* need enqueue, prepare cmd_obj and enqueue */ cmdobj = (struct cmd_obj *)rtw_zmalloc(sizeof(*cmdobj)); if (cmdobj == NULL) { @@ -1434,13 +1434,18 @@ u8 rtw_setstakey_cmd(_adapter *padapter, struct sta_info *sta, u8 key_type, bool else GET_ENCRY_ALGO(psecuritypriv, sta, psetstakey_para->algorithm, _FALSE); -#ifdef CONFIG_TDLS - /* TDLS_KEY doesn't support 256-bit key length yet */ - if (key_type != TDLS_KEY) -#endif + if ((psetstakey_para->algorithm == _GCMP_256_) || (psetstakey_para->algorithm == _CCMP_256_)) { - if ((psetstakey_para->algorithm == _GCMP_256_) || (psetstakey_para->algorithm == _CCMP_256_)) - key_len = 32; +#ifdef CONFIG_TDLS + /* TDLS_KEY doesn't support 256-bit key length yet */ + if (key_type == TDLS_KEY) { + RTW_WARN("%s: not support 256-bit key length if TDLS\n", __func__); + rtw_mfree((u8 *) psetstakey_para, sizeof(struct set_stakey_parm)); + res = _FAIL; + goto exit; + } +#endif + key_len = 32; } if (key_type == GROUP_KEY) { diff --git a/drivers/net/wireless/realtek/rtl8822ce/core/rtw_debug.c b/drivers/net/wireless/realtek/rtl8822ce/core/rtw_debug.c index 18cad13f..d8b5e485 100644 --- a/drivers/net/wireless/realtek/rtl8822ce/core/rtw_debug.c +++ b/drivers/net/wireless/realtek/rtl8822ce/core/rtw_debug.c @@ -6246,7 +6246,7 @@ ssize_t proc_set_tx_deauth(struct file *file, const char __user *buffer, size_t char tmp[16]; u8 mac_addr[NUM_STA][ETH_ALEN]; u8 bc_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; - u32 key_type; + u32 key_type = 0; u8 index; @@ -6265,7 +6265,7 @@ ssize_t proc_set_tx_deauth(struct file *file, const char __user *buffer, size_t } RTW_INFO("key_type=%d\n", key_type); } - if (key_type < 0 || key_type > 4) + if (key_type > 4) return count; if ((check_fwstate(pmlmepriv, WIFI_STATION_STATE) == _TRUE) diff --git a/drivers/net/wireless/realtek/rtl8822ce/core/rtw_ieee80211.c b/drivers/net/wireless/realtek/rtl8822ce/core/rtw_ieee80211.c index 76156098..163edaa4 100644 --- a/drivers/net/wireless/realtek/rtl8822ce/core/rtw_ieee80211.c +++ b/drivers/net/wireless/realtek/rtl8822ce/core/rtw_ieee80211.c @@ -1773,6 +1773,7 @@ err_chk: _rtw_memcpy(out, mac, ETH_ALEN); RTW_INFO("%s mac addr:"MAC_FMT"\n", __func__, MAC_ARG(out)); + RTW_INFO(" %s <====\n", __func__); } #ifdef CONFIG_80211N_HT diff --git a/drivers/net/wireless/realtek/rtl8822ce/core/rtw_io.c b/drivers/net/wireless/realtek/rtl8822ce/core/rtw_io.c index 734d3e59..7a2be91e 100644 --- a/drivers/net/wireless/realtek/rtl8822ce/core/rtw_io.c +++ b/drivers/net/wireless/realtek/rtl8822ce/core/rtw_io.c @@ -443,6 +443,7 @@ int rtw_init_io_priv(_adapter *padapter, void (*set_intf_ops)(_adapter *padapter struct io_priv *piopriv = &padapter->iopriv; struct intf_hdl *pintf = &piopriv->intf; + RTW_INFO(" ====> %s\n", __func__); if (set_intf_ops == NULL) return _FAIL; @@ -452,6 +453,7 @@ int rtw_init_io_priv(_adapter *padapter, void (*set_intf_ops)(_adapter *padapter set_intf_ops(padapter, &pintf->io_ops); + RTW_INFO(" %s <====\n", __func__); return _SUCCESS; } diff --git a/drivers/net/wireless/realtek/rtl8822ce/core/rtw_mlme.c b/drivers/net/wireless/realtek/rtl8822ce/core/rtw_mlme.c old mode 100644 new mode 100755 diff --git a/drivers/net/wireless/realtek/rtl8822ce/core/rtw_mlme_ext.c b/drivers/net/wireless/realtek/rtl8822ce/core/rtw_mlme_ext.c old mode 100644 new mode 100755 index 8f69d15c..9f90e5da --- a/drivers/net/wireless/realtek/rtl8822ce/core/rtw_mlme_ext.c +++ b/drivers/net/wireless/realtek/rtl8822ce/core/rtw_mlme_ext.c @@ -1,7 +1,6 @@ /****************************************************************************** * * Copyright(c) 2007 - 2019 Realtek Corporation. - * Copyright(c) 2022, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of version 2 of the GNU General Public License as @@ -10416,7 +10415,7 @@ static int issue_action_ba(_adapter *padapter, unsigned char *raddr, unsigned ch u16 start_seq; u16 BA_para_set; u16 BA_timeout_value; - u16 BA_starting_seqctrl; + u16 BA_starting_seqctrl = 0; struct xmit_frame *pmgntframe; struct pkt_attrib *pattrib; u8 *pframe; @@ -15716,7 +15715,7 @@ operation_by_state: #ifdef CONFIG_SCAN_BACKOP case SCAN_BACKING_OP: { - u8 back_ch, back_bw, back_ch_offset; + u8 back_ch = 0, back_bw = 0, back_ch_offset = 0; u8 need_ch_setting_union = _TRUE; #ifdef CONFIG_MCC_MODE @@ -16041,7 +16040,9 @@ u8 setkey_hdl(_adapter *padapter, u8 *pbuf) if (amsdu_spp_enable(padapter, pparm->algorithm) == _SUCCESS) ctrl |= BIT(7); - write_cam(padapter, cam_id, ctrl, addr, pparm->key); + + write_cam(padapter, cam_id, ctrl, addr, pparm->key, + pparm->algorithm & _SEC_TYPE_256_); /* if ((cam_id > 3) && (((pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE) || ((pmlmeinfo->state&0x03) == WIFI_FW_ADHOC_STATE)))*/ #ifndef SEC_DEFAULT_KEY_SEARCH @@ -16189,7 +16190,10 @@ write_to_cam: } if (amsdu_spp_enable(padapter, pparm->algorithm) == _SUCCESS) ctrl |= BIT(7); - write_cam(padapter, cam_id, ctrl, pparm->addr, pparm->key); + + write_cam(padapter, cam_id, ctrl, pparm->addr, pparm->key, + pparm->algorithm & _SEC_TYPE_256_); + if (!(pparm->gk)) ATOMIC_INC(&psta->keytrack); /*CVE-2020-24587*/ } diff --git a/drivers/net/wireless/realtek/rtl8822ce/core/rtw_recv.c b/drivers/net/wireless/realtek/rtl8822ce/core/rtw_recv.c old mode 100644 new mode 100755 diff --git a/drivers/net/wireless/realtek/rtl8822ce/core/rtw_security.c b/drivers/net/wireless/realtek/rtl8822ce/core/rtw_security.c index 59f76af6..b5e41d80 100644 --- a/drivers/net/wireless/realtek/rtl8822ce/core/rtw_security.c +++ b/drivers/net/wireless/realtek/rtl8822ce/core/rtw_security.c @@ -1631,8 +1631,8 @@ u32 rtw_aes_encrypt(_adapter *padapter, u8 *pxmitframe) pframe = ((struct xmit_frame *)pxmitframe)->buf_addr + hw_hdr_offset; /* start to encrypt each fragment */ - if ((pattrib->encrypt == _AES_) || - (pattrib->encrypt == _CCMP_256_)) { + if ((pattrib->encrypt == _CCMP_256_) || + (pattrib->encrypt == _AES_) ) { if (IS_MCAST(pattrib->ra)) prwskey = psecuritypriv->dot118021XGrpKey[psecuritypriv->dot118021XGrpKeyid].skey; @@ -1647,13 +1647,16 @@ u32 rtw_aes_encrypt(_adapter *padapter, u8 *pxmitframe) ptdls_sta = rtw_get_stainfo(&padapter->stapriv, &pattrib->dst[0]); if ((ptdls_sta != NULL) && (ptdls_sta->tdls_sta_state & TDLS_LINKED_STATE)) { RTW_INFO("[%s] for tdls link\n", __FUNCTION__); + if (pattrib->encrypt == _CCMP_256_) { + RTW_WARN("%s: not support 256-bit key length if TDLS\n", __func__); + return _FAIL; + } prwskey = &ptdls_sta->tpk.tk[0]; } } #endif /* CONFIG_TDLS */ prwskeylen = (pattrib->encrypt == _CCMP_256_) ? 32 : 16; - for (curfragnum = 0; curfragnum < pattrib->nr_frags; curfragnum++) { if ((curfragnum + 1) == pattrib->nr_frags) { /* the last fragment */ diff --git a/drivers/net/wireless/realtek/rtl8822ce/core/rtw_tdls.c b/drivers/net/wireless/realtek/rtl8822ce/core/rtw_tdls.c index 6b7480ec..ee4537e6 100644 --- a/drivers/net/wireless/realtek/rtl8822ce/core/rtw_tdls.c +++ b/drivers/net/wireless/realtek/rtl8822ce/core/rtw_tdls.c @@ -1831,7 +1831,7 @@ sint On_TDLS_Setup_Req(_adapter *padapter, union recv_frame *precv_frame, struct struct security_priv *psecuritypriv = &padapter->securitypriv; _irqL irqL; struct rx_pkt_attrib *prx_pkt_attrib = &precv_frame->u.hdr.attrib; - u8 *prsnie, *ppairwise_cipher; + u8 *pftie = NULL, *prsnie, *ppairwise_cipher; u8 i, k; u8 ccmp_included = 0, rsnie_included = 0; u16 j, pairwise_count; @@ -1946,6 +1946,7 @@ sint On_TDLS_Setup_Req(_adapter *padapter, union recv_frame *precv_frame, struct case _VENDOR_SPECIFIC_IE_: break; case _FTIE_: + pftie = (u8 *)pIE; if (prx_pkt_attrib->encrypt) _rtw_memcpy(SNonce, (ptr + j + 52), 32); break; @@ -1999,7 +2000,10 @@ sint On_TDLS_Setup_Req(_adapter *padapter, union recv_frame *precv_frame, struct ptdls_sta->tdls_sta_state |= TDLS_INITIATOR_STATE; if (prx_pkt_attrib->encrypt) { - _rtw_memcpy(ptdls_sta->SNonce, SNonce, 32); + if (pftie == NULL) + RTW_WARN("%s: SNonce is null\n", __func__); + else + _rtw_memcpy(ptdls_sta->SNonce, SNonce, 32); if (timeout_interval <= 300) ptdls_sta->TDLS_PeerKey_Lifetime = TDLS_TPK_RESEND_COUNT; @@ -2165,7 +2169,11 @@ int On_TDLS_Setup_Rsp(_adapter *padapter, union recv_frame *precv_frame, struct ptdls_sta->bssratelen = supportRateNum; _rtw_memcpy(ptdls_sta->bssrateset, supportRate, supportRateNum); - _rtw_memcpy(ptdls_sta->ANonce, ANonce, 32); + + if (pftie == NULL) + RTW_WARN("%s: ANonce is null\n", __func__); + else + _rtw_memcpy(ptdls_sta->ANonce, ANonce, 32); #ifdef CONFIG_WFD rtw_tdls_process_wfd_ie(ptdlsinfo, ptr + FIXED_IE, parsing_length); diff --git a/drivers/net/wireless/realtek/rtl8822ce/core/rtw_vht.c b/drivers/net/wireless/realtek/rtl8822ce/core/rtw_vht.c index 52e404df..63f2487d 100644 --- a/drivers/net/wireless/realtek/rtl8822ce/core/rtw_vht.c +++ b/drivers/net/wireless/realtek/rtl8822ce/core/rtw_vht.c @@ -927,6 +927,7 @@ u32 rtw_build_vht_cap_ie(_adapter *padapter, u8 *pbuf) pbuf = rtw_set_ie(pbuf, EID_VHTCapability, 12, pcap, &len); + return len; } diff --git a/drivers/net/wireless/realtek/rtl8822ce/core/rtw_wapi.c b/drivers/net/wireless/realtek/rtl8822ce/core/rtw_wapi.c index 94b26e72..07a14646 100644 --- a/drivers/net/wireless/realtek/rtl8822ce/core/rtw_wapi.c +++ b/drivers/net/wireless/realtek/rtl8822ce/core/rtw_wapi.c @@ -284,7 +284,7 @@ u8 WapiWriteOneCamEntry( usConfig |= (0x01 << 5); } - write_cam(padapter, EntryId, usConfig, pMacAddr, pKey); + write_cam(padapter, EntryId, usConfig, pMacAddr, pKey, false); WAPI_TRACE(WAPI_API, "===========> %s\n", __FUNCTION__); return 1; diff --git a/drivers/net/wireless/realtek/rtl8822ce/core/rtw_wlan_util.c b/drivers/net/wireless/realtek/rtl8822ce/core/rtw_wlan_util.c old mode 100644 new mode 100755 index 36ac9d28..12ac39e5 --- a/drivers/net/wireless/realtek/rtl8822ce/core/rtw_wlan_util.c +++ b/drivers/net/wireless/realtek/rtl8822ce/core/rtw_wlan_util.c @@ -788,7 +788,7 @@ void _clear_cam_entry(_adapter *padapter, u8 entry) rtw_sec_write_cam_ent(padapter, entry, 0, null_sta, null_key); } -inline void _write_cam(_adapter *adapter, u8 id, u16 ctrl, u8 *mac, u8 *key) +static void _write_cam(_adapter *adapter, u8 id, u16 ctrl, u8 *mac, u8 *key) { #ifdef CONFIG_WRITE_CACHE_ONLY write_cam_cache(adapter, id , ctrl, mac, key); @@ -798,9 +798,9 @@ inline void _write_cam(_adapter *adapter, u8 id, u16 ctrl, u8 *mac, u8 *key) #endif } -inline void write_cam(_adapter *adapter, u8 id, u16 ctrl, u8 *mac, u8 *key) +void write_cam(_adapter *adapter, u8 id, u16 ctrl, u8 *mac, u8 *key, bool ext) { - if (ctrl & BIT(9)) { + if (ext) { _write_cam(adapter, id, ctrl, mac, key); _write_cam(adapter, (id + 1), ctrl | BIT(5), mac, (key + 16)); RTW_INFO_DUMP("key-0: ", key, 16); @@ -1389,12 +1389,12 @@ inline void rtw_sec_cam_swap(_adapter *adapter, u8 cam_id_a, u8 cam_id_b) /*setp-3. set cam_info*/ if (cam_a_used) { - write_cam(adapter, cam_id_b, cache_a.ctrl, cache_a.mac, cache_a.key); + _write_cam(adapter, cam_id_b, cache_a.ctrl, cache_a.mac, cache_a.key); rtw_camid_set(adapter, cam_id_b); } if (cam_b_used) { - write_cam(adapter, cam_id_a, cache_b.ctrl, cache_b.mac, cache_b.key); + _write_cam(adapter, cam_id_a, cache_b.ctrl, cache_b.mac, cache_b.key); rtw_camid_set(adapter, cam_id_a); } } diff --git a/drivers/net/wireless/realtek/rtl8822ce/core/rtw_xmit.c b/drivers/net/wireless/realtek/rtl8822ce/core/rtw_xmit.c old mode 100644 new mode 100755 index 39534f1b..a26156f0 --- a/drivers/net/wireless/realtek/rtl8822ce/core/rtw_xmit.c +++ b/drivers/net/wireless/realtek/rtl8822ce/core/rtw_xmit.c @@ -565,7 +565,7 @@ void rtw_get_adapter_tx_rate_bmp(_adapter *adapter, u16 r_bmp_cck_ofdm[], u32 r_ bmp_vht |= tmp_vht; } if (bw == CHANNEL_WIDTH_20) - r_bmp_cck_ofdm[bw] = bmp_cck_ofdm; + r_bmp_cck_ofdm[0] = bmp_cck_ofdm; if (bw <= CHANNEL_WIDTH_40) r_bmp_ht[bw] = bmp_ht; if (bw <= CHANNEL_WIDTH_160) diff --git a/drivers/net/wireless/realtek/rtl8822ce/hal/btc/halbtc8822c.c b/drivers/net/wireless/realtek/rtl8822ce/hal/btc/halbtc8822c.c old mode 100644 new mode 100755 diff --git a/drivers/net/wireless/realtek/rtl8822ce/hal/btc/halbtc8822c.h b/drivers/net/wireless/realtek/rtl8822ce/hal/btc/halbtc8822c.h old mode 100644 new mode 100755 diff --git a/drivers/net/wireless/realtek/rtl8822ce/hal/btc/halbtc8822cwifionly.c b/drivers/net/wireless/realtek/rtl8822ce/hal/btc/halbtc8822cwifionly.c old mode 100644 new mode 100755 diff --git a/drivers/net/wireless/realtek/rtl8822ce/hal/btc/halbtc8822cwifionly.h b/drivers/net/wireless/realtek/rtl8822ce/hal/btc/halbtc8822cwifionly.h old mode 100644 new mode 100755 diff --git a/drivers/net/wireless/realtek/rtl8822ce/hal/btc/halbtccommon.c b/drivers/net/wireless/realtek/rtl8822ce/hal/btc/halbtccommon.c old mode 100644 new mode 100755 index 04a713bb..eed15240 --- a/drivers/net/wireless/realtek/rtl8822ce/hal/btc/halbtccommon.c +++ b/drivers/net/wireless/realtek/rtl8822ce/hal/btc/halbtccommon.c @@ -1,7 +1,6 @@ /****************************************************************************** * * Copyright(c) 2016 - 2017 Realtek Corporation. - * Copyright(c) 2022, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of version 2 of the GNU General Public License as @@ -2447,7 +2446,6 @@ static void rtw_btc_action_bt_hid(struct btc_coexist *btc) slot_type = TDMA_4SLOT; table_case = 32; tdma_case = 27; - is_toggle_table = TRUE; } else if (coex_sta->bt_ble_hid_exist && coex_sta->wl_gl_busy) { table_case = 32; diff --git a/drivers/net/wireless/realtek/rtl8822ce/hal/btc/halbtccommon.h b/drivers/net/wireless/realtek/rtl8822ce/hal/btc/halbtccommon.h old mode 100644 new mode 100755 diff --git a/drivers/net/wireless/realtek/rtl8822ce/hal/efuse/rtl8822c/HalEfuseMask8822C_PCIE.c b/drivers/net/wireless/realtek/rtl8822ce/hal/efuse/rtl8822c/HalEfuseMask8822C_PCIE.c old mode 100644 new mode 100755 diff --git a/drivers/net/wireless/realtek/rtl8822ce/hal/efuse/rtl8822c/HalEfuseMask8822C_PCIE.h b/drivers/net/wireless/realtek/rtl8822ce/hal/efuse/rtl8822c/HalEfuseMask8822C_PCIE.h old mode 100644 new mode 100755 diff --git a/drivers/net/wireless/realtek/rtl8822ce/hal/efuse/rtl8822c/HalEfuseMask8822C_SDIO.c b/drivers/net/wireless/realtek/rtl8822ce/hal/efuse/rtl8822c/HalEfuseMask8822C_SDIO.c old mode 100644 new mode 100755 diff --git a/drivers/net/wireless/realtek/rtl8822ce/hal/efuse/rtl8822c/HalEfuseMask8822C_SDIO.h b/drivers/net/wireless/realtek/rtl8822ce/hal/efuse/rtl8822c/HalEfuseMask8822C_SDIO.h old mode 100644 new mode 100755 diff --git a/drivers/net/wireless/realtek/rtl8822ce/hal/efuse/rtl8822c/HalEfuseMask8822C_USB.c b/drivers/net/wireless/realtek/rtl8822ce/hal/efuse/rtl8822c/HalEfuseMask8822C_USB.c old mode 100644 new mode 100755 diff --git a/drivers/net/wireless/realtek/rtl8822ce/hal/efuse/rtl8822c/HalEfuseMask8822C_USB.h b/drivers/net/wireless/realtek/rtl8822ce/hal/efuse/rtl8822c/HalEfuseMask8822C_USB.h old mode 100644 new mode 100755 diff --git a/drivers/net/wireless/realtek/rtl8822ce/hal/hal_com_phycfg.c b/drivers/net/wireless/realtek/rtl8822ce/hal/hal_com_phycfg.c index 3e5bf8fd..cc572fe9 100644 --- a/drivers/net/wireless/realtek/rtl8822ce/hal/hal_com_phycfg.c +++ b/drivers/net/wireless/realtek/rtl8822ce/hal/hal_com_phycfg.c @@ -1,7 +1,6 @@ /****************************************************************************** * * Copyright(c) 2007 - 2017 Realtek Corporation. - * Copyright(c) 2022, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of version 2 of the GNU General Public License as diff --git a/drivers/net/wireless/realtek/rtl8822ce/hal/hal_halmac.c b/drivers/net/wireless/realtek/rtl8822ce/hal/hal_halmac.c index e53bd76f..cb9252a2 100644 --- a/drivers/net/wireless/realtek/rtl8822ce/hal/hal_halmac.c +++ b/drivers/net/wireless/realtek/rtl8822ce/hal/hal_halmac.c @@ -1,7 +1,6 @@ /****************************************************************************** * * Copyright(c) 2015 - 2019 Realtek Corporation. - * Copyright(c) 2022, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of version 2 of the GNU General Public License as @@ -3673,7 +3672,9 @@ int rtw_halmac_init_hal(struct dvobj_priv *d) */ int rtw_halmac_init_hal_fw(struct dvobj_priv *d, u8 *fw, u32 fwsize) { + RTW_INFO(" ====> %s\n", __func__); return _halmac_init_hal(d, fw, fwsize); + RTW_INFO(" %s <====\n", __func__); } /* diff --git a/drivers/net/wireless/realtek/rtl8822ce/hal/hal_intf.c b/drivers/net/wireless/realtek/rtl8822ce/hal/hal_intf.c old mode 100644 new mode 100755 index 8471f9a5..f6cd3ea3 --- a/drivers/net/wireless/realtek/rtl8822ce/hal/hal_intf.c +++ b/drivers/net/wireless/realtek/rtl8822ce/hal/hal_intf.c @@ -41,7 +41,9 @@ const u32 _chip_type_to_odm_ic_type[] = { void rtw_hal_chip_configure(_adapter *padapter) { + RTW_INFO(" ====> %s\n", __func__); padapter->hal_func.intf_chip_configure(padapter); + RTW_INFO(" %s <====\n", __func__); } /* @@ -58,6 +60,7 @@ u8 rtw_hal_read_chip_info(_adapter *padapter) u8 hci_type = rtw_get_intf_type(padapter); systime start = rtw_get_current_time(); + RTW_INFO(" ====> %s\n", __func__); /* before access eFuse, make sure card enable has been called */ if ((hci_type == RTW_SDIO || hci_type == RTW_GSPI) && !rtw_is_hw_init_completed(padapter)) @@ -71,13 +74,16 @@ u8 rtw_hal_read_chip_info(_adapter *padapter) RTW_INFO("%s in %d ms\n", __func__, rtw_get_passing_time_ms(start)); + RTW_INFO(" %s <====\n", __func__); return rtn; } void rtw_hal_read_chip_version(_adapter *padapter) { + RTW_INFO(" ====> %s\n", __func__); padapter->hal_func.read_chip_version(padapter); rtw_odm_init_ic_type(padapter); + RTW_INFO(" %s <====\n", __func__); } static void rtw_init_wireless_mode(_adapter *padapter) @@ -137,6 +143,7 @@ void rtw_hal_def_value_init(_adapter *padapter) u8 rtw_hal_data_init(_adapter *padapter) { + RTW_INFO(" ====> %s\n", __func__); if (is_primary_adapter(padapter)) { padapter->hal_data_sz = sizeof(HAL_DATA_TYPE); padapter->HalData = rtw_zvmalloc(padapter->hal_data_sz); @@ -146,6 +153,7 @@ u8 rtw_hal_data_init(_adapter *padapter) } rtw_phydm_priv_init(padapter); } + RTW_INFO(" %s <====\n", __func__); return _SUCCESS; } @@ -689,9 +697,11 @@ void rtw_hal_enable_interrupt(_adapter *padapter) /* FOR SDIO & PCIE */ void rtw_hal_disable_interrupt(_adapter *padapter) { + RTW_INFO(" ====> %s\n", __func__); #if defined(CONFIG_PCI_HCI) || defined(CONFIG_SDIO_HCI) || defined (CONFIG_GSPI_HCI) padapter->hal_func.disable_interrupt(padapter); #endif /* #if defined(CONFIG_PCI_HCI) || defined (CONFIG_SDIO_HCI) || defined (CONFIG_GSPI_HCI) */ + RTW_INFO(" %s <====\n", __func__); } @@ -750,8 +760,10 @@ void rtw_hal_clear_interrupt(_adapter *padapter) #if defined(CONFIG_USB_HCI) || defined(CONFIG_PCI_HCI) u32 rtw_hal_inirp_init(_adapter *padapter) { + RTW_INFO(" ====> %s\n", __func__); if (is_primary_adapter(padapter)) return padapter->hal_func.inirp_init(padapter); + RTW_INFO(" %s <====\n", __func__); return _SUCCESS; } u32 rtw_hal_inirp_deinit(_adapter *padapter) diff --git a/drivers/net/wireless/realtek/rtl8822ce/hal/halmac/halmac_88xx/halmac_8822c/halmac_init_8822c.c b/drivers/net/wireless/realtek/rtl8822ce/hal/halmac/halmac_88xx/halmac_8822c/halmac_init_8822c.c index a7218ef7..6d9822e8 100644 --- a/drivers/net/wireless/realtek/rtl8822ce/hal/halmac/halmac_88xx/halmac_8822c/halmac_init_8822c.c +++ b/drivers/net/wireless/realtek/rtl8822ce/hal/halmac/halmac_88xx/halmac_8822c/halmac_init_8822c.c @@ -472,35 +472,52 @@ init_trx_cfg_8822c(struct halmac_adapter *adapter, enum halmac_trx_mode mode) PLTFM_MSG_TRACE("[TRACE]%s ===>\n", __func__); + printk("%s: 1\n", __func__); + status = txdma_queue_mapping_8822c(adapter, mode); if (status != HALMAC_RET_SUCCESS) { PLTFM_MSG_ERR("[ERR]queue mapping\n"); return status; } + printk("%s: 2\n", __func__); en_fwff = HALMAC_REG_R8(REG_WMAC_FWPKT_CR) & BIT_FWEN; if (en_fwff) { HALMAC_REG_W8_CLR(REG_WMAC_FWPKT_CR, BIT_FWEN); if (fwff_is_empty_88xx(adapter) != HALMAC_RET_SUCCESS) PLTFM_MSG_ERR("[ERR]fwff is not empty\n"); } + + printk("%s: 3\n", __func__); +#if 1 + value16 = HALMAC_REG_R16(REG_CR); + printk("value16=0x%x\n", value16); + HALMAC_REG_W16(REG_CR, value16&0xFF00); +#else value8 = 0; HALMAC_REG_W8(REG_CR, value8); +#endif + printk("%s: 4\n", __func__); + value16 = HALMAC_REG_R16(REG_FWFF_PKT_INFO); HALMAC_REG_W16(REG_FWFF_CTRL, value16); + printk("%s: 5\n", __func__); value8 = MAC_TRX_ENABLE; HALMAC_REG_W8(REG_CR, value8); + printk("%s: 6\n", __func__); if (en_fwff) HALMAC_REG_W8_SET(REG_WMAC_FWPKT_CR, BIT_FWEN); HALMAC_REG_W32(REG_H2CQ_CSR, BIT(31)); + printk("%s: 7\n", __func__); status = priority_queue_cfg_8822c(adapter, mode); if (status != HALMAC_RET_SUCCESS) { PLTFM_MSG_ERR("[ERR]priority queue cfg\n"); return status; } + printk("%s: 8\n", __func__); status = init_h2c_8822c(adapter); if (status != HALMAC_RET_SUCCESS) { PLTFM_MSG_ERR("[ERR]init h2cq!\n"); diff --git a/drivers/net/wireless/realtek/rtl8822ce/hal/phydm/halrf/halrf.c b/drivers/net/wireless/realtek/rtl8822ce/hal/phydm/halrf/halrf.c index 17a53298..443bdc01 100644 --- a/drivers/net/wireless/realtek/rtl8822ce/hal/phydm/halrf/halrf.c +++ b/drivers/net/wireless/realtek/rtl8822ce/hal/phydm/halrf/halrf.c @@ -1501,7 +1501,7 @@ void halrf_bbreset(void *dm_void) void halrf_rf_k_connect_trigger(void *dm_void, boolean is_recovery, enum halrf_k_segment_time seg_time) { - struct dm_struct *dm = (struct dm_struct *)dm_void; + struct dm_struct *dm = (struct dm_struct *)dm_void; struct dm_dpk_info *dpk_info = &dm->dpk_info; struct _hal_rf_ *rf = &dm->rf_table; diff --git a/drivers/net/wireless/realtek/rtl8822ce/hal/phydm/halrf/rtl8822c/halrf_iqk_8822c.c b/drivers/net/wireless/realtek/rtl8822ce/hal/phydm/halrf/rtl8822c/halrf_iqk_8822c.c index 3ab70d6c..576c6b2f 100644 --- a/drivers/net/wireless/realtek/rtl8822ce/hal/phydm/halrf/rtl8822c/halrf_iqk_8822c.c +++ b/drivers/net/wireless/realtek/rtl8822ce/hal/phydm/halrf/rtl8822c/halrf_iqk_8822c.c @@ -3599,8 +3599,8 @@ _iqk_rx_iqk_gain_search_fail_8822c( if (iqk->isbnd) fail = false; - if (idx < 5) - iqk->tmp1bcc = IQMUX[idx]; + if(idx < 5) + iqk->tmp1bcc = IQMUX[idx]; if (fail == false){ tmp = (iqk->tmp1bcc << 8) | bb_idx ; diff --git a/drivers/net/wireless/realtek/rtl8822ce/hal/rtl8822c/hal8822c_fw.c b/drivers/net/wireless/realtek/rtl8822ce/hal/rtl8822c/hal8822c_fw.c old mode 100644 new mode 100755 diff --git a/drivers/net/wireless/realtek/rtl8822ce/hal/rtl8822c/hal8822c_fw.h b/drivers/net/wireless/realtek/rtl8822ce/hal/rtl8822c/hal8822c_fw.h old mode 100644 new mode 100755 diff --git a/drivers/net/wireless/realtek/rtl8822ce/hal/rtl8822c/pci/rtl8822ce.h b/drivers/net/wireless/realtek/rtl8822ce/hal/rtl8822c/pci/rtl8822ce.h old mode 100644 new mode 100755 diff --git a/drivers/net/wireless/realtek/rtl8822ce/hal/rtl8822c/pci/rtl8822ce_halinit.c b/drivers/net/wireless/realtek/rtl8822ce/hal/rtl8822c/pci/rtl8822ce_halinit.c old mode 100644 new mode 100755 index 1499d01b..0fd761f0 --- a/drivers/net/wireless/realtek/rtl8822ce/hal/rtl8822c/pci/rtl8822ce_halinit.c +++ b/drivers/net/wireless/realtek/rtl8822ce/hal/rtl8822c/pci/rtl8822ce_halinit.c @@ -409,6 +409,7 @@ static void init_hwled(PADAPTER adapter, u8 enable) static void hal_init_misc(PADAPTER adapter) { + RTW_INFO(" ====> %s\n", __func__); #ifdef CONFIG_RTW_LED struct led_priv *ledpriv = adapter_to_led(adapter); #ifdef CONFIG_SW_LED @@ -419,6 +420,7 @@ static void hal_init_misc(PADAPTER adapter) #endif /* CONFIG_SW_LED */ init_hwled(adapter, 1); #endif + RTW_INFO(" %s <====\n", __func__); } u32 rtl8822ce_init(PADAPTER padapter) @@ -428,6 +430,7 @@ u32 rtl8822ce_init(PADAPTER padapter) PHAL_DATA_TYPE hal; struct registry_priv *registry_par = &padapter->registrypriv; + RTW_INFO(" ====> %s\n", __func__); hal = GET_HAL_DATA(padapter); #if 0 @@ -502,6 +505,7 @@ u32 rtl8822ce_init(PADAPTER padapter) /* TX interrupt migration - 3pkts or 7*64=448us */ rtw_write32(padapter, REG_INT_MIG_8822C, 0x03070000); #endif + RTW_INFO(" %s <====\n", __func__); return _SUCCESS; } diff --git a/drivers/net/wireless/realtek/rtl8822ce/hal/rtl8822c/pci/rtl8822ce_halmac.c b/drivers/net/wireless/realtek/rtl8822ce/hal/rtl8822c/pci/rtl8822ce_halmac.c old mode 100644 new mode 100755 index 9ca08d91..b22c3755 --- a/drivers/net/wireless/realtek/rtl8822ce/hal/rtl8822c/pci/rtl8822ce_halmac.c +++ b/drivers/net/wireless/realtek/rtl8822ce/hal/rtl8822c/pci/rtl8822ce_halmac.c @@ -335,6 +335,7 @@ int rtl8822ce_halmac_init_adapter(PADAPTER padapter) struct halmac_platform_api *api; int err; + RTW_INFO(" ====> %s\n", __func__); d = adapter_to_dvobj(padapter); api = &rtw_halmac_platform_api; api->SEND_RSVD_PAGE = pci_write_data_rsvd_page; @@ -342,5 +343,6 @@ int rtl8822ce_halmac_init_adapter(PADAPTER padapter) err = rtw_halmac_init_adapter(d, api); + RTW_INFO(" %s <====\n", __func__); return err; } diff --git a/drivers/net/wireless/realtek/rtl8822ce/hal/rtl8822c/pci/rtl8822ce_io.c b/drivers/net/wireless/realtek/rtl8822ce/hal/rtl8822c/pci/rtl8822ce_io.c old mode 100644 new mode 100755 diff --git a/drivers/net/wireless/realtek/rtl8822ce/hal/rtl8822c/pci/rtl8822ce_led.c b/drivers/net/wireless/realtek/rtl8822ce/hal/rtl8822c/pci/rtl8822ce_led.c old mode 100644 new mode 100755 diff --git a/drivers/net/wireless/realtek/rtl8822ce/hal/rtl8822c/pci/rtl8822ce_ops.c b/drivers/net/wireless/realtek/rtl8822ce/hal/rtl8822c/pci/rtl8822ce_ops.c old mode 100644 new mode 100755 index 30ccb52b..459e0c2f --- a/drivers/net/wireless/realtek/rtl8822ce/hal/rtl8822c/pci/rtl8822ce_ops.c +++ b/drivers/net/wireless/realtek/rtl8822ce/hal/rtl8822c/pci/rtl8822ce_ops.c @@ -1,7 +1,6 @@ /****************************************************************************** * * Copyright(c) 2015 - 2017 Realtek Corporation. - * Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of version 2 of the GNU General Public License as @@ -58,6 +57,8 @@ void rtl8822ce_reset_bd(_adapter *padapter) u8 *tx_bd, *rx_bd; int i, rx_queue_idx; + RTW_INFO(" ====> %s\n", __func__); + InitMAC_TRXBD_8822CE(padapter); for (rx_queue_idx = 0; rx_queue_idx < 1; rx_queue_idx++) { @@ -101,6 +102,7 @@ void rtl8822ce_reset_bd(_adapter *padapter) } } _exit_critical(&pdvobjpriv->irq_th_lock, &irqL); + RTW_INFO(" %s <====\n", __func__); } static void intf_chip_configure(PADAPTER padapter) @@ -835,6 +837,8 @@ void rtl8822ce_set_hal_ops(PADAPTER padapter) struct hal_ops *ops; int err; + RTW_INFO(" ====> %s\n", __func__); + err = rtl8822ce_halmac_init_adapter(padapter); if (err) { RTW_INFO("%s: [ERROR]HALMAC initialize FAIL!\n", __func__); @@ -902,4 +906,6 @@ void rtl8822ce_set_hal_ops(PADAPTER padapter) ops->tx_poll_handler = rtl8822ce_tx_poll_handler; #endif ops->unmap_beacon_icf = rtl8822ce_unmap_beacon_icf; + + RTW_INFO(" %s <====\n", __func__); } diff --git a/drivers/net/wireless/realtek/rtl8822ce/hal/rtl8822c/pci/rtl8822ce_recv.c b/drivers/net/wireless/realtek/rtl8822ce/hal/rtl8822c/pci/rtl8822ce_recv.c old mode 100644 new mode 100755 diff --git a/drivers/net/wireless/realtek/rtl8822ce/hal/rtl8822c/pci/rtl8822ce_xmit.c b/drivers/net/wireless/realtek/rtl8822ce/hal/rtl8822c/pci/rtl8822ce_xmit.c old mode 100644 new mode 100755 index 3bc0ba1d..dda7ffd7 --- a/drivers/net/wireless/realtek/rtl8822ce/hal/rtl8822c/pci/rtl8822ce_xmit.c +++ b/drivers/net/wireless/realtek/rtl8822ce/hal/rtl8822c/pci/rtl8822ce_xmit.c @@ -1,7 +1,6 @@ /****************************************************************************** * * Copyright(c) 2015 - 2017 Realtek Corporation. - * Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of version 2 of the GNU General Public License as diff --git a/drivers/net/wireless/realtek/rtl8822ce/hal/rtl8822c/rtl8822c.h b/drivers/net/wireless/realtek/rtl8822ce/hal/rtl8822c/rtl8822c.h old mode 100644 new mode 100755 diff --git a/drivers/net/wireless/realtek/rtl8822ce/hal/rtl8822c/rtl8822c_cmd.c b/drivers/net/wireless/realtek/rtl8822ce/hal/rtl8822c/rtl8822c_cmd.c old mode 100644 new mode 100755 index 5eb63363..75463be5 --- a/drivers/net/wireless/realtek/rtl8822ce/hal/rtl8822c/rtl8822c_cmd.c +++ b/drivers/net/wireless/realtek/rtl8822ce/hal/rtl8822c/rtl8822c_cmd.c @@ -342,8 +342,10 @@ void rtl8822c_set_usb_suspend_mode(PADAPTER padapter) struct pwrctrl_priv *ppwrpriv = adapter_to_pwrctl(padapter); u8 param[H2C_BT_UNKNOWN_DEVICE_WA_LEN] = {0}; + RTW_INFO(" ====> %s\n", __func__); SET_H2CCMD_BT_UNKNOWN_DEVICE_WA_PARM(param, 1); rtl8822c_fillh2ccmd(padapter, H2C_BT_UNKNOWN_DEVICE_WA, H2C_BT_UNKNOWN_DEVICE_WA_LEN, param); + RTW_INFO(" %s <====\n", __func__); } #ifdef CONFIG_BT_COEXIST diff --git a/drivers/net/wireless/realtek/rtl8822ce/hal/rtl8822c/rtl8822c_halinit.c b/drivers/net/wireless/realtek/rtl8822ce/hal/rtl8822c/rtl8822c_halinit.c old mode 100644 new mode 100755 index b093c6d7..366dae70 --- a/drivers/net/wireless/realtek/rtl8822ce/hal/rtl8822c/rtl8822c_halinit.c +++ b/drivers/net/wireless/realtek/rtl8822ce/hal/rtl8822c/rtl8822c_halinit.c @@ -150,6 +150,8 @@ u8 rtl8822c_hal_init(PADAPTER adapter) hal->bFWReady = _FALSE; hal->fw_ractrl = _FALSE; + RTW_INFO(" ====> %s\n", __func__); + #ifdef CONFIG_NO_FW err = rtw_halmac_init_hal(d); if(!err) { @@ -193,6 +195,7 @@ u8 rtl8822c_hal_init(PADAPTER adapter) hal->bFWReady = _TRUE; hal->fw_ractrl = _TRUE; + RTW_INFO(" %s <====\n", __func__); return _TRUE; } @@ -220,6 +223,7 @@ void rtl8822c_init_misc(PADAPTER adapter) u8 v8 = 0; u32 v32 = 0; + RTW_INFO(" ====> %s\n", __func__); hal = GET_HAL_DATA(adapter); @@ -245,6 +249,7 @@ void rtl8822c_init_misc(PADAPTER adapter) #ifdef CONFIG_TCP_CSUM_OFFLOAD_RX rtw_hal_rcr_add(adapter, BIT_TCPOFLD_EN_8822C); #endif /* CONFIG_TCP_CSUM_OFFLOAD_RX*/ + RTW_INFO(" %s <====\n", __func__); } u32 rtl8822c_init(PADAPTER adapter) diff --git a/drivers/net/wireless/realtek/rtl8822ce/hal/rtl8822c/rtl8822c_mac.c b/drivers/net/wireless/realtek/rtl8822ce/hal/rtl8822c/rtl8822c_mac.c old mode 100644 new mode 100755 diff --git a/drivers/net/wireless/realtek/rtl8822ce/hal/rtl8822c/rtl8822c_ops.c b/drivers/net/wireless/realtek/rtl8822ce/hal/rtl8822c/rtl8822c_ops.c old mode 100644 new mode 100755 index e5be7f21..24938d9d --- a/drivers/net/wireless/realtek/rtl8822ce/hal/rtl8822c/rtl8822c_ops.c +++ b/drivers/net/wireless/realtek/rtl8822ce/hal/rtl8822c/rtl8822c_ops.c @@ -4010,6 +4010,7 @@ void rtl8822c_set_hal_ops(PADAPTER adapter) struct hal_com_data *hal; struct hal_ops *ops; + RTW_INFO(" ====> %s\n", __func__); hal = GET_HAL_DATA(adapter); ops = &adapter->hal_func; @@ -4167,5 +4168,7 @@ void rtl8822c_set_hal_ops(PADAPTER adapter) #ifdef CONFIG_SUPPORT_DYNAMIC_TXPWR ops->dtp_macid_set = rtl8822c_dtp_macid_set; #endif + + RTW_INFO(" %s <====\n", __func__); } diff --git a/drivers/net/wireless/realtek/rtl8822ce/hal/rtl8822c/rtl8822c_phy.c b/drivers/net/wireless/realtek/rtl8822ce/hal/rtl8822c/rtl8822c_phy.c old mode 100644 new mode 100755 index fbc98a6b..9b52523d --- a/drivers/net/wireless/realtek/rtl8822ce/hal/rtl8822c/rtl8822c_phy.c +++ b/drivers/net/wireless/realtek/rtl8822ce/hal/rtl8822c/rtl8822c_phy.c @@ -513,7 +513,9 @@ void rtl8822c_phy_deinit_dm_priv(PADAPTER adapter) void rtl8822c_phy_init_haldm(PADAPTER adapter) { + RTW_INFO(" ====> %s\n", __func__); rtw_phydm_init(adapter); + RTW_INFO(" %s <====\n", __func__); } static void check_rxfifo_full(PADAPTER adapter) @@ -2089,6 +2091,7 @@ void rtl8822c_phy_bf_init(PADAPTER adapter) u8 v8; u32 v32; + RTW_INFO(" ====> %s\n", __func__); v32 = rtw_read32(adapter, REG_MU_TX_CTL_8822C); /* Enable P1 aggr new packet according to P0 transfer time */ v32 |= BIT_R_MU_P1_WAIT_STATE_EN_8822C; @@ -2120,6 +2123,7 @@ void rtl8822c_phy_bf_init(PADAPTER adapter) v8 = rtw_read8(adapter, 0x6DF); v8 = (v8 & 0xC0) | 0x4; rtw_write8(adapter, 0x6DF, v8); + RTW_INFO(" %s <====\n", __func__); } void rtl8822c_phy_bf_enter(PADAPTER adapter, struct sta_info *sta) diff --git a/drivers/net/wireless/realtek/rtl8822ce/include/drv_conf.h b/drivers/net/wireless/realtek/rtl8822ce/include/drv_conf.h old mode 100644 new mode 100755 diff --git a/drivers/net/wireless/realtek/rtl8822ce/include/drv_types.h b/drivers/net/wireless/realtek/rtl8822ce/include/drv_types.h index 48454731..9bdb1fbd 100644 --- a/drivers/net/wireless/realtek/rtl8822ce/include/drv_types.h +++ b/drivers/net/wireless/realtek/rtl8822ce/include/drv_types.h @@ -1591,15 +1591,6 @@ struct _ADAPTER { #ifdef PLATFORM_LINUX _nic_hdl pnetdev; char old_ifname[IFNAMSIZ]; - - /* used by rtw_rereg_nd_name related function */ - struct rereg_nd_name_data { - _nic_hdl old_pnetdev; - char old_ifname[IFNAMSIZ]; - u8 old_ips_mode; - u8 old_bRegUseLed; - } rereg_nd_name_priv; - u8 ndev_unregistering; int bup; struct net_device_stats stats; diff --git a/drivers/net/wireless/realtek/rtl8822ce/include/hal_com_h2c.h b/drivers/net/wireless/realtek/rtl8822ce/include/hal_com_h2c.h old mode 100644 new mode 100755 diff --git a/drivers/net/wireless/realtek/rtl8822ce/include/hal_data.h b/drivers/net/wireless/realtek/rtl8822ce/include/hal_data.h old mode 100644 new mode 100755 diff --git a/drivers/net/wireless/realtek/rtl8822ce/include/hal_ic_cfg.h b/drivers/net/wireless/realtek/rtl8822ce/include/hal_ic_cfg.h old mode 100644 new mode 100755 index 76eab071..c20630a5 --- a/drivers/net/wireless/realtek/rtl8822ce/include/hal_ic_cfg.h +++ b/drivers/net/wireless/realtek/rtl8822ce/include/hal_ic_cfg.h @@ -489,7 +489,8 @@ #ifndef CONFIG_TXPWR_PG_WITH_PWR_IDX #define CONFIG_TXPWR_PG_WITH_PWR_IDX #endif -#define CONFIG_BT_EFUSE_MASK + + #define CONFIG_BT_EFUSE_MASK #endif /*CONFIG_RTL8821C*/ #ifdef CONFIG_RTL8710B diff --git a/drivers/net/wireless/realtek/rtl8822ce/include/hal_intf.h b/drivers/net/wireless/realtek/rtl8822ce/include/hal_intf.h old mode 100644 new mode 100755 diff --git a/drivers/net/wireless/realtek/rtl8822ce/include/hal_pg.h b/drivers/net/wireless/realtek/rtl8822ce/include/hal_pg.h old mode 100644 new mode 100755 diff --git a/drivers/net/wireless/realtek/rtl8822ce/include/rtl8188e_xmit.h b/drivers/net/wireless/realtek/rtl8822ce/include/rtl8188e_xmit.h old mode 100644 new mode 100755 diff --git a/drivers/net/wireless/realtek/rtl8822ce/include/rtl8188f_xmit.h b/drivers/net/wireless/realtek/rtl8822ce/include/rtl8188f_xmit.h old mode 100644 new mode 100755 diff --git a/drivers/net/wireless/realtek/rtl8822ce/include/rtl8192e_xmit.h b/drivers/net/wireless/realtek/rtl8822ce/include/rtl8192e_xmit.h old mode 100644 new mode 100755 diff --git a/drivers/net/wireless/realtek/rtl8822ce/include/rtl8192f_xmit.h b/drivers/net/wireless/realtek/rtl8822ce/include/rtl8192f_xmit.h old mode 100644 new mode 100755 diff --git a/drivers/net/wireless/realtek/rtl8822ce/include/rtl8703b_xmit.h b/drivers/net/wireless/realtek/rtl8822ce/include/rtl8703b_xmit.h old mode 100644 new mode 100755 diff --git a/drivers/net/wireless/realtek/rtl8822ce/include/rtl8710b_xmit.h b/drivers/net/wireless/realtek/rtl8822ce/include/rtl8710b_xmit.h old mode 100644 new mode 100755 diff --git a/drivers/net/wireless/realtek/rtl8822ce/include/rtl8723b_hal.h b/drivers/net/wireless/realtek/rtl8822ce/include/rtl8723b_hal.h old mode 100644 new mode 100755 diff --git a/drivers/net/wireless/realtek/rtl8822ce/include/rtl8723b_led.h b/drivers/net/wireless/realtek/rtl8822ce/include/rtl8723b_led.h old mode 100644 new mode 100755 diff --git a/drivers/net/wireless/realtek/rtl8822ce/include/rtl8723b_recv.h b/drivers/net/wireless/realtek/rtl8822ce/include/rtl8723b_recv.h old mode 100644 new mode 100755 diff --git a/drivers/net/wireless/realtek/rtl8822ce/include/rtl8723b_spec.h b/drivers/net/wireless/realtek/rtl8822ce/include/rtl8723b_spec.h old mode 100644 new mode 100755 diff --git a/drivers/net/wireless/realtek/rtl8822ce/include/rtl8723b_xmit.h b/drivers/net/wireless/realtek/rtl8822ce/include/rtl8723b_xmit.h old mode 100644 new mode 100755 diff --git a/drivers/net/wireless/realtek/rtl8822ce/include/rtl8723d_xmit.h b/drivers/net/wireless/realtek/rtl8822ce/include/rtl8723d_xmit.h old mode 100644 new mode 100755 diff --git a/drivers/net/wireless/realtek/rtl8822ce/include/rtl8812a_xmit.h b/drivers/net/wireless/realtek/rtl8822ce/include/rtl8812a_xmit.h old mode 100644 new mode 100755 diff --git a/drivers/net/wireless/realtek/rtl8822ce/include/rtl8814a_cmd.h b/drivers/net/wireless/realtek/rtl8822ce/include/rtl8814a_cmd.h old mode 100644 new mode 100755 diff --git a/drivers/net/wireless/realtek/rtl8822ce/include/rtl8814a_hal.h b/drivers/net/wireless/realtek/rtl8822ce/include/rtl8814a_hal.h old mode 100644 new mode 100755 diff --git a/drivers/net/wireless/realtek/rtl8822ce/include/rtl8814a_recv.h b/drivers/net/wireless/realtek/rtl8822ce/include/rtl8814a_recv.h old mode 100644 new mode 100755 diff --git a/drivers/net/wireless/realtek/rtl8822ce/include/rtl8814a_spec.h b/drivers/net/wireless/realtek/rtl8822ce/include/rtl8814a_spec.h old mode 100644 new mode 100755 diff --git a/drivers/net/wireless/realtek/rtl8822ce/include/rtl8814a_xmit.h b/drivers/net/wireless/realtek/rtl8822ce/include/rtl8814a_xmit.h old mode 100644 new mode 100755 diff --git a/drivers/net/wireless/realtek/rtl8822ce/include/rtl8814b_hal.h b/drivers/net/wireless/realtek/rtl8822ce/include/rtl8814b_hal.h old mode 100644 new mode 100755 diff --git a/drivers/net/wireless/realtek/rtl8822ce/include/rtl8814bu_hal.h b/drivers/net/wireless/realtek/rtl8822ce/include/rtl8814bu_hal.h old mode 100644 new mode 100755 diff --git a/drivers/net/wireless/realtek/rtl8822ce/include/rtl8821ce_hal.h b/drivers/net/wireless/realtek/rtl8822ce/include/rtl8821ce_hal.h old mode 100644 new mode 100755 diff --git a/drivers/net/wireless/realtek/rtl8822ce/include/rtl8822be_hal.h b/drivers/net/wireless/realtek/rtl8822ce/include/rtl8822be_hal.h old mode 100644 new mode 100755 diff --git a/drivers/net/wireless/realtek/rtl8822ce/include/rtl8822c_hal.h b/drivers/net/wireless/realtek/rtl8822ce/include/rtl8822c_hal.h old mode 100644 new mode 100755 diff --git a/drivers/net/wireless/realtek/rtl8822ce/include/rtl8822ce_hal.h b/drivers/net/wireless/realtek/rtl8822ce/include/rtl8822ce_hal.h old mode 100644 new mode 100755 diff --git a/drivers/net/wireless/realtek/rtl8822ce/include/rtl8822cs_hal.h b/drivers/net/wireless/realtek/rtl8822ce/include/rtl8822cs_hal.h old mode 100644 new mode 100755 diff --git a/drivers/net/wireless/realtek/rtl8822ce/include/rtl8822cu_hal.h b/drivers/net/wireless/realtek/rtl8822ce/include/rtl8822cu_hal.h old mode 100644 new mode 100755 diff --git a/drivers/net/wireless/realtek/rtl8822ce/include/rtw_mlme_ext.h b/drivers/net/wireless/realtek/rtl8822ce/include/rtw_mlme_ext.h old mode 100644 new mode 100755 index 9edb6f6c..573d90a6 --- a/drivers/net/wireless/realtek/rtl8822ce/include/rtw_mlme_ext.h +++ b/drivers/net/wireless/realtek/rtl8822ce/include/rtw_mlme_ext.h @@ -683,7 +683,7 @@ void rtw_clean_dk_section(_adapter *adapter); void rtw_clean_hw_dk_cam(_adapter *adapter); /* modify both HW and cache */ -void write_cam(_adapter *padapter, u8 id, u16 ctrl, u8 *mac, u8 *key); +void write_cam(_adapter *padapter, u8 id, u16 ctrl, u8 *mac, u8 *key, bool ext); void clear_cam_entry(_adapter *padapter, u8 id); /* modify cache only */ diff --git a/drivers/net/wireless/realtek/rtl8822ce/include/rtw_recv.h b/drivers/net/wireless/realtek/rtl8822ce/include/rtw_recv.h index adc020a8..b37b840a 100644 --- a/drivers/net/wireless/realtek/rtl8822ce/include/rtw_recv.h +++ b/drivers/net/wireless/realtek/rtl8822ce/include/rtw_recv.h @@ -759,6 +759,7 @@ __inline static u8 *recvframe_pull_tail(union recv_frame *precvframe, sint sz) } +#if 0 __inline static union recv_frame *rxmem_to_recvframe(u8 *rxmem) { /* due to the design of 2048 bytes alignment of recv_frame, we can reference the union recv_frame */ @@ -798,6 +799,7 @@ __inline static u8 *pkt_to_recvdata(_pkt *pkt) return precv_frame->u.hdr.rx_data; } +#endif __inline static sint get_recvframe_len(union recv_frame *precvframe) diff --git a/drivers/net/wireless/realtek/rtl8822ce/include/rtw_security.h b/drivers/net/wireless/realtek/rtl8822ce/include/rtw_security.h old mode 100644 new mode 100755 diff --git a/drivers/net/wireless/realtek/rtl8822ce/include/rtw_version.h b/drivers/net/wireless/realtek/rtl8822ce/include/rtw_version.h index 588c1cf9..27dcf3d4 100644 --- a/drivers/net/wireless/realtek/rtl8822ce/include/rtw_version.h +++ b/drivers/net/wireless/realtek/rtl8822ce/include/rtw_version.h @@ -1,2 +1,2 @@ -#define DRIVERVERSION "v5.9.0.3e_nv-1-gdafe03f15.20220505_COEX20200103-1717" -#define BTCOEXVERSION "COEX20200103-1717" +#define DRIVERVERSION "v5.9.0.3e_nv-16-g319d9877b.20221101_COEX20200103-0000" +#define BTCOEXVERSION "COEX20200103-0000" diff --git a/drivers/net/wireless/realtek/rtl8822ce/include/rtw_xmit.h b/drivers/net/wireless/realtek/rtl8822ce/include/rtw_xmit.h old mode 100644 new mode 100755 diff --git a/drivers/net/wireless/realtek/rtl8822ce/os_dep/linux/ioctl_cfg80211.c b/drivers/net/wireless/realtek/rtl8822ce/os_dep/linux/ioctl_cfg80211.c old mode 100644 new mode 100755 index 1beb9263..737028bf --- a/drivers/net/wireless/realtek/rtl8822ce/os_dep/linux/ioctl_cfg80211.c +++ b/drivers/net/wireless/realtek/rtl8822ce/os_dep/linux/ioctl_cfg80211.c @@ -1,7 +1,6 @@ /****************************************************************************** * * Copyright(c) 2007 - 2019 Realtek Corporation. - * Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of version 2 of the GNU General Public License as diff --git a/drivers/net/wireless/realtek/rtl8822ce/os_dep/linux/ioctl_linux.c b/drivers/net/wireless/realtek/rtl8822ce/os_dep/linux/ioctl_linux.c index 0d87e78f..05709baa 100644 --- a/drivers/net/wireless/realtek/rtl8822ce/os_dep/linux/ioctl_linux.c +++ b/drivers/net/wireless/realtek/rtl8822ce/os_dep/linux/ioctl_linux.c @@ -1,7 +1,6 @@ /****************************************************************************** * * Copyright(c) 2007 - 2019 Realtek Corporation. - * Copyright(c) 2022, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of version 2 of the GNU General Public License as @@ -5754,68 +5753,6 @@ static int rtw_cta_test_start(struct net_device *dev, return ret; } #endif -extern int rtw_change_ifname(_adapter *padapter, const char *ifname); -static int rtw_rereg_nd_name(struct net_device *dev, - struct iw_request_info *info, - union iwreq_data *wrqu, char *extra) -{ - int ret = 0; - _adapter *padapter = rtw_netdev_priv(dev); - struct dvobj_priv *dvobj = adapter_to_dvobj(padapter); - struct rereg_nd_name_data *rereg_priv = &padapter->rereg_nd_name_priv; - char new_ifname[IFNAMSIZ]; - - if (rereg_priv->old_ifname[0] == 0) { - char *reg_ifname; -#ifdef CONFIG_CONCURRENT_MODE - if (padapter->isprimary) - reg_ifname = padapter->registrypriv.ifname; - else -#endif - reg_ifname = padapter->registrypriv.if2name; - - strncpy(rereg_priv->old_ifname, reg_ifname, IFNAMSIZ); - rereg_priv->old_ifname[IFNAMSIZ - 1] = 0; - } - - /* RTW_INFO("%s wrqu->data.length:%d\n", __FUNCTION__, wrqu->data.length); */ - if (wrqu->data.length > IFNAMSIZ) - return -EFAULT; - - if (copy_from_user(new_ifname, wrqu->data.pointer, IFNAMSIZ)) - return -EFAULT; - - if (strncmp(rereg_priv->old_ifname, new_ifname, IFNAMSIZ) == 0) - return ret; - - RTW_INFO("%s new_ifname:%s\n", __FUNCTION__, new_ifname); - rtw_set_rtnl_lock_holder(dvobj, current); - ret = rtw_change_ifname(padapter, new_ifname); - rtw_set_rtnl_lock_holder(dvobj, NULL); - if (0 != ret) - goto exit; - - if (_rtw_memcmp(rereg_priv->old_ifname, "disable%d", 9) == _TRUE) { - /* rtw_ips_mode_req(&padapter->pwrctrlpriv, rereg_priv->old_ips_mode); */ - } - - strncpy(rereg_priv->old_ifname, new_ifname, IFNAMSIZ); - rereg_priv->old_ifname[IFNAMSIZ - 1] = 0; - - if (_rtw_memcmp(new_ifname, "disable%d", 9) == _TRUE) { - - RTW_INFO("%s disable\n", __FUNCTION__); - /* free network queue for Android's timming issue */ - rtw_free_network_queue(padapter, _TRUE); - - /* the interface is being "disabled", we can do deeper IPS */ - /* rereg_priv->old_ips_mode = rtw_get_ips_mode_req(&padapter->pwrctrlpriv); */ - /* rtw_ips_mode_req(&padapter->pwrctrlpriv, IPS_NORMAL); */ - } -exit: - return ret; - -} #ifdef CONFIG_IOL #include @@ -7820,6 +7757,7 @@ static int rtw_wx_set_priv(struct net_device *dev, len = dwrq->length; ext = rtw_vmalloc(len); + if (!ext) return -ENOMEM; @@ -7938,9 +7876,7 @@ static int rtw_wx_set_priv(struct net_device *dev, #endif sprintf(ext, "OK"); - } - if (copy_to_user(dwrq->pointer, ext, min(dwrq->length, (u16)(strlen(ext) + 1)))) ret = -EFAULT; @@ -12370,7 +12306,7 @@ static iw_handler rtw_private_handler[] = { #else rtw_wx_priv_null, /* 0x17 */ #endif - rtw_rereg_nd_name, /* 0x18 */ + NULL, /* 0x18 */ rtw_wx_priv_null, /* 0x19 */ #ifdef CONFIG_MP_INCLUDED rtw_wx_priv_null, /* 0x1A */ diff --git a/drivers/net/wireless/realtek/rtl8822ce/os_dep/linux/ioctl_mp.c b/drivers/net/wireless/realtek/rtl8822ce/os_dep/linux/ioctl_mp.c index 2deb1a36..98894d31 100644 --- a/drivers/net/wireless/realtek/rtl8822ce/os_dep/linux/ioctl_mp.c +++ b/drivers/net/wireless/realtek/rtl8822ce/os_dep/linux/ioctl_mp.c @@ -704,8 +704,10 @@ int rtw_mp_txpower(struct net_device *dev, if (rtw_do_mp_iwdata_len_chk(__func__, wrqu->length)) return -EFAULT; + _rtw_memset(input, 0, sizeof(input)); if (copy_from_user(input, wrqu->pointer, wrqu->length)) return -EFAULT; + input[sizeof(input) - 1] = 0; MsetPower = strncmp(input, "off", 3); if (MsetPower == 0) { @@ -1892,23 +1894,29 @@ int rtw_mp_set_tsside(struct net_device *dev, sprintf(extra, "Set TSSI DE path_A: %d", tsside_a); halrf_tssi_set_de_for_tx_verify(pDM_Odm, tsside_a, RF_PATH_A); mpt_trigger_tssi_tracking(padapter, RF_PATH_A); - - } else if (sscanf(input, "pathb=%d", &tsside_b) == 1) { + } + else if (sscanf(input, "pathb=%d", &tsside_b) == 1) { sprintf(extra, "Set TSSI DE path_B: %d", tsside_b); halrf_tssi_set_de_for_tx_verify(pDM_Odm, tsside_b, RF_PATH_B); mpt_trigger_tssi_tracking(padapter, RF_PATH_B); - - } else if (sscanf(input, "pathc=%d", &tsside_c) == 1) { + } +#if defined(PHYDM_COMPILE_ABOVE_3SS) + else if (sscanf(input, "pathc=%d", &tsside_c) == 1) { sprintf(extra, "Set TSSI DE path_C: %d", tsside_c); halrf_tssi_set_de_for_tx_verify(pDM_Odm, tsside_c, RF_PATH_C); mpt_trigger_tssi_tracking(padapter, RF_PATH_C); - } else if (sscanf(input, "pathd=%d", &tsside_d) == 1) { + } +#endif +#if defined(PHYDM_COMPILE_ABOVE_4SS) + else if (sscanf(input, "pathd=%d", &tsside_d) == 1) { sprintf(extra, "Set TSSI DE path_D: %d", tsside_d); halrf_tssi_set_de_for_tx_verify(pDM_Odm, tsside_d, RF_PATH_D); mpt_trigger_tssi_tracking(padapter, RF_PATH_D); - } else + } +#endif + else sprintf(extra, "Invalid command format, please input TSSI DE value within patha/b/c/d=xyz"); wrqu->length = strlen(extra); diff --git a/drivers/net/wireless/realtek/rtl8822ce/os_dep/linux/os_intfs.c b/drivers/net/wireless/realtek/rtl8822ce/os_dep/linux/os_intfs.c old mode 100644 new mode 100755 index c122398c..47294c4c --- a/drivers/net/wireless/realtek/rtl8822ce/os_dep/linux/os_intfs.c +++ b/drivers/net/wireless/realtek/rtl8822ce/os_dep/linux/os_intfs.c @@ -1925,12 +1925,6 @@ void rtw_os_ndev_free(_adapter *adapter) rtw_cfg80211_ndev_res_free(adapter); #endif - /* free the old_pnetdev */ - if (adapter->rereg_nd_name_priv.old_pnetdev) { - rtw_free_netdev(adapter->rereg_nd_name_priv.old_pnetdev); - adapter->rereg_nd_name_priv.old_pnetdev = NULL; - } - if (adapter->pnetdev) { rtw_free_netdev(adapter->pnetdev); adapter->pnetdev = NULL; @@ -3534,6 +3528,7 @@ int rtw_os_ndevs_init(struct dvobj_priv *dvobj) { int ret = _FAIL; + RTW_INFO(" ====> %s\n", __func__); if (rtw_os_ndevs_alloc(dvobj) != _SUCCESS) goto exit; @@ -3546,6 +3541,7 @@ os_ndevs_free: if (ret != _SUCCESS) rtw_os_ndevs_free(dvobj); exit: + RTW_INFO(" %s <====\n", __func__); return ret; } diff --git a/drivers/net/wireless/realtek/rtl8822ce/os_dep/linux/pci_intf.c b/drivers/net/wireless/realtek/rtl8822ce/os_dep/linux/pci_intf.c index 4f3d6ba7..b75101f0 100644 --- a/drivers/net/wireless/realtek/rtl8822ce/os_dep/linux/pci_intf.c +++ b/drivers/net/wireless/realtek/rtl8822ce/os_dep/linux/pci_intf.c @@ -374,10 +374,12 @@ void rtw_pci_dump_aspm_info(_adapter *padapter) void rtw_pci_aspm_config(_adapter *padapter) { + RTW_INFO(" ====> %s\n", __func__); rtw_pci_aspm_config_clkreql0sl1(padapter); rtw_pci_aspm_config_l1off(padapter); rtw_pci_dynamic_aspm_set_mode(padapter, ASPM_MODE_PERF); rtw_pci_dump_aspm_info(padapter); + RTW_INFO(" %s <====\n", __func__); } static u8 rtw_pci_get_amd_l1_patch(struct dvobj_priv *pdvobjpriv, struct pci_dev *pdev) @@ -629,6 +631,7 @@ int pci_alloc_irq(struct dvobj_priv *dvobj) struct pci_dev *pdev = dvobj->ppcidev; int ret; + RTW_INFO(" ====> %s\n", __func__); #ifndef CONFIG_RTW_PCI_MSI_DISABLE ret = pci_enable_msi(pdev); @@ -648,6 +651,7 @@ int pci_alloc_irq(struct dvobj_priv *dvobj) RTW_INFO("Request_irq OK, IRQ %d\n", pdev->irq); } + RTW_INFO(" %s <====\n", __func__); return err ? _FAIL : _SUCCESS; } @@ -748,6 +752,7 @@ static struct dvobj_priv *pci_dvobj_init(struct pci_dev *pdev, const struct pci_ unsigned long pmem_start, pmem_len, pmem_flags; int i; + RTW_INFO(" ====> %s\n", __func__); dvobj = devobj_init(); if (dvobj == NULL) @@ -914,6 +919,7 @@ free_dvobj: dvobj = NULL; } exit: + RTW_INFO("%s <=====\n", __func__); return dvobj; } @@ -956,6 +962,7 @@ static void pci_dvobj_deinit(struct pci_dev *pdev) u8 rtw_set_hal_ops(_adapter *padapter) { + RTW_INFO(" ====> %s\n", __func__); /* alloc memory for HAL DATA */ if (rtw_hal_data_init(padapter) == _FAIL) return _FAIL; @@ -1019,6 +1026,7 @@ u8 rtw_set_hal_ops(_adapter *padapter) if (hal_spec_init(padapter) == _FAIL) return _FAIL; + RTW_INFO(" %s <====\n", __func__); return _SUCCESS; } @@ -1271,6 +1279,8 @@ _adapter *rtw_pci_primary_adapter_init(struct dvobj_priv *dvobj, struct pci_dev _adapter *padapter = NULL; int status = _FAIL; + RTW_INFO(" ====> %s\n", __func__); + padapter = (_adapter *)rtw_zvmalloc(sizeof(*padapter)); if (padapter == NULL) goto exit; @@ -1361,6 +1371,7 @@ free_adapter: padapter = NULL; } exit: + RTW_INFO(" %s <====\n", __func__); return padapter; } @@ -1422,7 +1433,7 @@ static int rtw_drv_init(struct pci_dev *pdev, const struct pci_device_id *pdid) _adapter *padapter = NULL; struct dvobj_priv *dvobj; - /* RTW_INFO("+rtw_drv_init\n"); */ + RTW_INFO("+rtw_drv_init\n"); /* step 0. */ disable_ht_for_spec_devid(pdid); @@ -1479,7 +1490,7 @@ static int rtw_drv_init(struct pci_dev *pdev, const struct pci_device_id *pdid) if (pci_alloc_irq(dvobj) != _SUCCESS) goto os_ndevs_deinit; - /* RTW_INFO("-871x_drv - drv_init, success!\n"); */ + RTW_INFO("-871x_drv - drv_init, success!\n"); status = _SUCCESS; diff --git a/drivers/net/wireless/realtek/rtl8822ce/os_dep/linux/recv_linux.c b/drivers/net/wireless/realtek/rtl8822ce/os_dep/linux/recv_linux.c index d8e7ee88..3a3049a3 100644 --- a/drivers/net/wireless/realtek/rtl8822ce/os_dep/linux/recv_linux.c +++ b/drivers/net/wireless/realtek/rtl8822ce/os_dep/linux/recv_linux.c @@ -354,9 +354,19 @@ static int napi_recv(_adapter *padapter, int budget) rx_ok = _FALSE; #ifdef CONFIG_RTW_GRO - if (pregistrypriv->en_gro) { + /* + cloned SKB use dataref to avoid kernel release it. + But dataref changed in napi_gro_receive. + So, we should prevent cloned SKB go into napi_gro_receive. + */ + if (pregistrypriv->en_gro && !skb_cloned(pskb)) { +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 12, 0)) + rtw_napi_gro_receive(&padapter->napi, pskb); + rx_ok = _TRUE; +#else if (rtw_napi_gro_receive(&padapter->napi, pskb) != GRO_DROP) rx_ok = _TRUE; +#endif goto next; } #endif /* CONFIG_RTW_GRO */ diff --git a/drivers/net/wireless/realtek/rtl8822ce/os_dep/linux/rtw_proc.h b/drivers/net/wireless/realtek/rtl8822ce/os_dep/linux/rtw_proc.h old mode 100644 new mode 100755 diff --git a/drivers/net/wireless/realtek/rtl8822ce/os_dep/osdep_service.c b/drivers/net/wireless/realtek/rtl8822ce/os_dep/osdep_service.c index beb7c30c..0fe28cc0 100644 --- a/drivers/net/wireless/realtek/rtl8822ce/os_dep/osdep_service.c +++ b/drivers/net/wireless/realtek/rtl8822ce/os_dep/osdep_service.c @@ -2540,65 +2540,6 @@ RETURN: return; } -int rtw_change_ifname(_adapter *padapter, const char *ifname) -{ - struct dvobj_priv *dvobj; - struct net_device *pnetdev; - struct net_device *cur_pnetdev; - struct rereg_nd_name_data *rereg_priv; - int ret; - u8 rtnl_lock_needed; - - if (!padapter) - goto error; - - dvobj = adapter_to_dvobj(padapter); - cur_pnetdev = padapter->pnetdev; - rereg_priv = &padapter->rereg_nd_name_priv; - - /* free the old_pnetdev */ - if (rereg_priv->old_pnetdev) { - free_netdev(rereg_priv->old_pnetdev); - rereg_priv->old_pnetdev = NULL; - } - - rtnl_lock_needed = rtw_rtnl_lock_needed(dvobj); - - if (rtnl_lock_needed) - unregister_netdev(cur_pnetdev); - else - unregister_netdevice(cur_pnetdev); - - rereg_priv->old_pnetdev = cur_pnetdev; - - pnetdev = rtw_init_netdev(padapter); - if (!pnetdev) { - ret = -1; - goto error; - } - - SET_NETDEV_DEV(pnetdev, dvobj_to_dev(adapter_to_dvobj(padapter))); - - rtw_init_netdev_name(pnetdev, ifname); - - _rtw_memcpy(pnetdev->dev_addr, adapter_mac_addr(padapter), ETH_ALEN); - - if (rtnl_lock_needed) - ret = register_netdev(pnetdev); - else - ret = register_netdevice(pnetdev); - - if (ret != 0) { - goto error; - } - - return 0; - -error: - - return -1; - -} #endif #ifdef PLATFORM_FREEBSD