From c65ec1aa8fbcbafdc568c4206286ca77f3234caf Mon Sep 17 00:00:00 2001 From: Florian Fainelli Date: Sat, 27 Sep 2014 19:10:51 +0000 Subject: brcm2708: update 3.10 patches with raspberrypi/rpi-3.10.y of 27 Apr. 2014 Update the 3.10 rasperry patches by rebasing raspberry/rpi-3.10-y against linux-stable/v3.10.49. Signed-off-by: Florian Fainelli git-svn-id: svn://svn.openwrt.org/openwrt/trunk@42678 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- ...-Update-to-newer-rtl8192cu-driver-release.patch | 13519 +++++++++---------- 1 file changed, 6533 insertions(+), 6986 deletions(-) (limited to 'target/linux/brcm2708/patches-3.10/0097-wifi-Update-to-newer-rtl8192cu-driver-release.patch') diff --git a/target/linux/brcm2708/patches-3.10/0097-wifi-Update-to-newer-rtl8192cu-driver-release.patch b/target/linux/brcm2708/patches-3.10/0097-wifi-Update-to-newer-rtl8192cu-driver-release.patch index d390129de9..bf0b95f1f4 100644 --- a/target/linux/brcm2708/patches-3.10/0097-wifi-Update-to-newer-rtl8192cu-driver-release.patch +++ b/target/linux/brcm2708/patches-3.10/0097-wifi-Update-to-newer-rtl8192cu-driver-release.patch @@ -1,7 +1,7 @@ -From f74f54da3639f0dc1fb203c7d5b987b9b9fb0bb4 Mon Sep 17 00:00:00 2001 +From 5aec58e64fb0ba4e582150d0506e9dddea6efbe3 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 9 Nov 2013 12:17:56 +0000 -Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release +Subject: [PATCH 097/196] wifi: Update to newer rtl8192cu driver release --- drivers/net/wireless/rtl8192cu/Kconfig | 4 +- @@ -205,6 +205,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release create mode 100755 drivers/net/wireless/rtl8192cu/runwpa mode change 100644 => 100755 drivers/net/wireless/rtl8192cu/wlan0dhcp +diff --git a/drivers/net/wireless/rtl8192cu/Kconfig b/drivers/net/wireless/rtl8192cu/Kconfig +index ef46361..bee5ed6 100644 --- a/drivers/net/wireless/rtl8192cu/Kconfig +++ b/drivers/net/wireless/rtl8192cu/Kconfig @@ -1,8 +1,6 @@ @@ -217,6 +219,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - Enable wireless network adapters based on Realtek RTL8192C chipset family, such as EDUP nano series + Help message of RTL8192CU +diff --git a/drivers/net/wireless/rtl8192cu/Makefile b/drivers/net/wireless/rtl8192cu/Makefile +index b52cace..c399011 100644 --- a/drivers/net/wireless/rtl8192cu/Makefile +++ b/drivers/net/wireless/rtl8192cu/Makefile @@ -1,15 +1,15 @@ @@ -259,6 +263,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release -CONFIG_BT_COEXISTENCE = n -CONFIG_RTL8192CU_REDEFINE_1X1 =n -CONFIG_WAKE_ON_WLAN = n +- +-CONFIG_PLATFORM_I386_PC = n +CONFIG_POWER_SAVING = y +CONFIG_USB_AUTOSUSPEND = n +CONFIG_HW_PWRP_DETECTION = n @@ -267,8 +273,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release +CONFIG_RTL8192CU_REDEFINE_1X1 = n +CONFIG_INTEL_WIDI = n +CONFIG_WAKE_ON_WLAN = n - --CONFIG_PLATFORM_I386_PC = n ++ +CONFIG_PLATFORM_I386_PC = y CONFIG_PLATFORM_TI_AM3517 = n CONFIG_PLATFORM_ANDROID_X86 = n @@ -552,7 +557,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release endif ifeq ($(CONFIG_PLATFORM_ANDROID_X86), y) -@@ -291,6 +280,18 @@ KSRC := /media/DATA-2/android-x86/ics-x8 +@@ -291,6 +280,18 @@ KSRC := /media/DATA-2/android-x86/ics-x86_20120130/out/target/product/generic_x8 MODULE_NAME :=wlan endif @@ -600,7 +605,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release endif ifeq ($(CONFIG_PLATFORM_MT53XX), y) -@@ -385,7 +386,16 @@ CROSS_COMPILE := /opt/freescale/usr/loca +@@ -385,7 +386,16 @@ CROSS_COMPILE := /opt/freescale/usr/local/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-li KVER := 2.6.31 KSRC ?= /lib/modules/2.6.31-770-g0e46b52/source endif @@ -688,7 +693,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release MODULE_NAME := wlan endif -@@ -461,11 +501,39 @@ KSRC := /home/winuser/work/Plat_sLD2T_V3 +@@ -461,11 +501,39 @@ KSRC := /home/winuser/work/Plat_sLD2T_V3010/usr/src/linux-2.6.32.2 INSTALL_PREFIX := endif @@ -794,6 +799,10 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + cd os_dep ; rm -fr *.mod.c *.mod *.o .*.cmd *.ko endif +diff --git a/drivers/net/wireless/rtl8192cu/clean b/drivers/net/wireless/rtl8192cu/clean +old mode 100644 +new mode 100755 +index 34686a0..8766421 --- a/drivers/net/wireless/rtl8192cu/clean +++ b/drivers/net/wireless/rtl8192cu/clean @@ -3,7 +3,3 @@ rmmod 8192cu @@ -805,6 +814,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release -rmmod rtl8192c_common -rmmod rtlwifi \ No newline at end of file +diff --git a/drivers/net/wireless/rtl8192cu/core/efuse/rtw_efuse.c b/drivers/net/wireless/rtl8192cu/core/efuse/rtw_efuse.c +index 4908d6e..3d341ac 100644 --- a/drivers/net/wireless/rtl8192cu/core/efuse/rtw_efuse.c +++ b/drivers/net/wireless/rtl8192cu/core/efuse/rtw_efuse.c @@ -1,7 +1,7 @@ @@ -889,7 +900,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release void EFUSE_Write1Byte( IN PADAPTER Adapter, -@@ -709,12 +736,12 @@ u8 rtw_efuse_map_write(PADAPTER padapter +@@ -709,12 +736,12 @@ u8 rtw_efuse_map_write(PADAPTER padapter, u16 addr, u16 cnts, u8 *data) if (word_en != 0xF) { ret = Efuse_PgPacketWrite(padapter, offset, word_en, newdata, _FALSE); @@ -958,7 +969,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release ) { u8 i; -@@ -1056,7 +1106,7 @@ int storeAdaptorInfoFile(char *path, str +@@ -1056,7 +1106,7 @@ int storeAdaptorInfoFile(char *path, struct eeprom_priv * eeprom_priv) else ret = _FAIL; } else { @@ -967,7 +978,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release ret = _FAIL; } return ret; -@@ -1086,7 +1136,7 @@ int retriveAdaptorInfoFile(char *path, s +@@ -1086,7 +1136,7 @@ int retriveAdaptorInfoFile(char *path, struct eeprom_priv * eeprom_priv) #endif } else { @@ -976,6 +987,9 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release ret = _FAIL; } return ret; +diff --git a/drivers/net/wireless/rtl8192cu/core/rtw_ap.c b/drivers/net/wireless/rtl8192cu/core/rtw_ap.c +new file mode 100644 +index 0000000..405e7fe --- /dev/null +++ b/drivers/net/wireless/rtl8192cu/core/rtw_ap.c @@ -0,0 +1,2940 @@ @@ -3919,9 +3933,11 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release +#endif //CONFIG_NATIVEAP_MLME +#endif //CONFIG_AP_MODE + +diff --git a/drivers/net/wireless/rtl8192cu/core/rtw_br_ext.c b/drivers/net/wireless/rtl8192cu/core/rtw_br_ext.c +index 1fcdf1e..6bb924e 100644 --- a/drivers/net/wireless/rtl8192cu/core/rtw_br_ext.c +++ b/drivers/net/wireless/rtl8192cu/core/rtw_br_ext.c -@@ -126,10 +126,10 @@ static int skb_pull_and_merge(struct sk_ +@@ -126,10 +126,10 @@ static int skb_pull_and_merge(struct sk_buff *skb, unsigned char *src, int len) int tail_len; unsigned long end, tail; @@ -3934,7 +3950,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release end = (unsigned long)src+len; if (tail < end) return -1; -@@ -522,7 +522,7 @@ static void __nat25_db_network_insert(_a +@@ -522,7 +522,7 @@ static void __nat25_db_network_insert(_adapter *priv, db = db->next_hash; } @@ -3979,7 +3995,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } } -@@ -848,6 +848,11 @@ int nat25_db_handle(_adapter *priv, stru +@@ -848,6 +848,11 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method) else { // forward unknow IP packet to upper TCP/IP DEBUG_INFO("NAT25: Replace DA with BR's MAC\n"); @@ -3991,7 +4007,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release memcpy(skb->data, priv->br_mac, ETH_ALEN); } } -@@ -1533,7 +1538,7 @@ int nat25_handle_frame(_adapter *priv, s +@@ -1533,7 +1538,7 @@ int nat25_handle_frame(_adapter *priv, struct sk_buff *skb) _exit_critical_bh(&priv->br_ext_lock, &irqL); retval = nat25_db_handle(priv, skb, NAT25_LOOKUP); @@ -4000,7 +4016,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } else { if (((*((unsigned short *)(skb->data+ETH_ALEN*2)) == __constant_htons(ETH_P_IP)) && -@@ -1633,13 +1638,13 @@ void dhcp_flag_bcast(_adapter *priv, str +@@ -1633,13 +1638,13 @@ void dhcp_flag_bcast(_adapter *priv, struct sk_buff *skb) if(iph->protocol == IPPROTO_UDP) // UDP { @@ -4016,6 +4032,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if(dhcph->cookie == __constant_htonl(DHCP_MAGIC)) // match magic word { +diff --git a/drivers/net/wireless/rtl8192cu/core/rtw_cmd.c b/drivers/net/wireless/rtl8192cu/core/rtw_cmd.c +index bdfec5d..f906eb3 100644 --- a/drivers/net/wireless/rtl8192cu/core/rtw_cmd.c +++ b/drivers/net/wireless/rtl8192cu/core/rtw_cmd.c @@ -16,7 +16,7 @@ @@ -4120,7 +4138,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release RT_TRACE(_module_rtl871x_cmd_c_,_drv_info_,("-_rtw_free_evt_priv \n")); _func_exit_; -@@ -229,8 +247,7 @@ struct cmd_obj *_rtw_dequeue_cmd(_queue +@@ -229,8 +247,7 @@ struct cmd_obj *_rtw_dequeue_cmd(_queue *queue) _func_enter_; //_enter_critical_bh(&(queue->lock), &irqL); @@ -4147,7 +4165,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release int rtw_cmd_filter(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj) { u8 bAllow = _FALSE; //set to _TRUE to allow enqueuing cmd when hw_init_completed is _FALSE -@@ -292,23 +310,23 @@ int rtw_cmd_filter(struct cmd_priv *pcmd +@@ -292,23 +310,23 @@ int rtw_cmd_filter(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj) ) { if(cmd_obj->cmdcode == GEN_CMD_CODE(_Set_Drv_Extra) ) @@ -4176,7 +4194,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { //DBG_871X("%s:%s: drop cmdcode:%u, hw_init_completed:%u, cmdthd_running:%u\n", caller_func, __FUNCTION__, // cmd_obj->cmdcode, -@@ -326,6 +344,7 @@ int rtw_cmd_filter(struct cmd_priv *pcmd +@@ -326,6 +344,7 @@ int rtw_cmd_filter(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj) u32 rtw_enqueue_cmd(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj) { int res = _FAIL; @@ -4216,7 +4234,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release thread_return rtw_cmd_thread(thread_context context) { -@@ -408,11 +445,12 @@ thread_return rtw_cmd_thread(thread_cont +@@ -408,11 +445,12 @@ thread_return rtw_cmd_thread(thread_context context) _func_enter_; @@ -4606,22 +4624,19 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release u8 rtw_setrttbl_cmd(_adapter *padapter, struct setratable_parm *prate_table) { struct cmd_obj* ph2c; -@@ -1570,8 +1708,47 @@ _func_enter_; +@@ -1570,7 +1708,7 @@ _func_enter_; init_h2fwcmd_w_parm_no_rsp(ph2c, paddbareq_parm, GEN_CMD_CODE(_AddBAReq)); - //DBG_8192C("rtw_addbareq_cmd, tid=%d\n", tid); + //DBG_871X("rtw_addbareq_cmd, tid=%d\n", tid); -+ -+ //rtw_enqueue_cmd(pcmdpriv, ph2c); -+ res = rtw_enqueue_cmd(pcmdpriv, ph2c); -+ -+exit: -+ -+_func_exit_; -+ -+ return res; -+} + + //rtw_enqueue_cmd(pcmdpriv, ph2c); + res = rtw_enqueue_cmd(pcmdpriv, ph2c); +@@ -1581,6 +1719,87 @@ _func_exit_; + + return res; + } +//add for CONFIG_IEEE80211W, none 11w can use it +u8 rtw_reset_securitypriv_cmd(_adapter*padapter) +{ @@ -4648,20 +4663,21 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + pdrvextra_cmd_parm->ec_id = RESET_SECURITYPRIV; + pdrvextra_cmd_parm->type_size = 0; + pdrvextra_cmd_parm->pbuf = (u8 *)padapter; - ++ + init_h2fwcmd_w_parm_no_rsp(ph2c, pdrvextra_cmd_parm, GEN_CMD_CODE(_Set_Drv_Extra)); + + - //rtw_enqueue_cmd(pcmdpriv, ph2c); - res = rtw_enqueue_cmd(pcmdpriv, ph2c); - -@@ -1580,8 +1757,50 @@ exit: - _func_exit_; - - return res; ++ //rtw_enqueue_cmd(pcmdpriv, ph2c); ++ res = rtw_enqueue_cmd(pcmdpriv, ph2c); ++ ++exit: ++ ++_func_exit_; ++ ++ return res; ++ ++} + - } - +u8 rtw_free_assoc_resources_cmd(_adapter*padapter) +{ + struct cmd_obj* ph2c; @@ -4702,11 +4718,10 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + +} + -+ + u8 rtw_dynamic_chk_wk_cmd(_adapter*padapter) { - struct cmd_obj* ph2c; -@@ -1591,6 +1810,15 @@ u8 rtw_dynamic_chk_wk_cmd(_adapter*padap +@@ -1591,6 +1810,15 @@ u8 rtw_dynamic_chk_wk_cmd(_adapter*padapter) _func_enter_; @@ -4807,7 +4822,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if(setChannelSwitch_param == NULL) { rtw_mfree((u8 *)pcmdobj, sizeof(struct cmd_obj)); res= _FAIL; -@@ -1806,9 +2088,8 @@ static void traffic_status_watchdog(_ada +@@ -1806,9 +2088,8 @@ static void traffic_status_watchdog(_adapter *padapter) { #ifdef CONFIG_LPS u8 bEnterPS; @@ -4818,7 +4833,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release u8 bBusyTraffic = _FALSE, bTxBusyTraffic = _FALSE, bRxBusyTraffic = _FALSE; u8 bHigherBusyTraffic = _FALSE, bHigherBusyRxTraffic = _FALSE, bHigherBusyTxTraffic = _FALSE; struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); -@@ -1816,6 +2097,8 @@ static void traffic_status_watchdog(_ada +@@ -1816,6 +2097,8 @@ static void traffic_status_watchdog(_adapter *padapter) struct tdls_info *ptdlsinfo = &(padapter->tdlsinfo); #endif //CONFIG_TDLS @@ -4827,7 +4842,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release // // Determine if our traffic is busy now // -@@ -1823,15 +2106,18 @@ static void traffic_status_watchdog(_ada +@@ -1823,15 +2106,18 @@ static void traffic_status_watchdog(_adapter *padapter) /*&& !MgntInitAdapterInProgress(pMgntInfo)*/) { @@ -4850,7 +4865,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release bTxBusyTraffic = _TRUE; } -@@ -1849,29 +2135,39 @@ static void traffic_status_watchdog(_ada +@@ -1849,29 +2135,39 @@ static void traffic_status_watchdog(_adapter *padapter) if(pmlmepriv->LinkDetectInfo.NumTxOkInPeriod > 5000) bHigherBusyTxTraffic = _TRUE; } @@ -4904,7 +4919,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release bEnterPS= _FALSE; } else -@@ -1905,15 +2201,39 @@ static void traffic_status_watchdog(_ada +@@ -1905,15 +2201,39 @@ static void traffic_status_watchdog(_adapter *padapter) pmlmepriv->LinkDetectInfo.bRxBusyTraffic = bRxBusyTraffic; pmlmepriv->LinkDetectInfo.bHigherBusyTraffic = bHigherBusyTraffic; pmlmepriv->LinkDetectInfo.bHigherBusyRxTraffic = bHigherBusyRxTraffic; @@ -4948,7 +4963,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #endif //if(check_fwstate(pmlmepriv, _FW_UNDER_LINKING|_FW_UNDER_SURVEY)==_FALSE) -@@ -1922,13 +2242,15 @@ void dynamic_chk_wk_hdl(_adapter *padapt +@@ -1922,13 +2242,15 @@ void dynamic_chk_wk_hdl(_adapter *padapter, u8 *pbuf, int sz) traffic_status_watchdog(padapter); } @@ -5001,7 +5016,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release pwrpriv->DelayLPSLastTimeStamp = rtw_get_current_time(); LPS_Leave(padapter); break; -@@ -1984,7 +2306,7 @@ u8 rtw_lps_ctrl_wk_cmd(_adapter*padapter +@@ -1984,7 +2306,7 @@ u8 rtw_lps_ctrl_wk_cmd(_adapter*padapter, u8 lps_ctrl_type, u8 enqueue) struct cmd_obj *ph2c; struct drvextra_cmd_parm *pdrvextra_cmd_parm; struct cmd_priv *pcmdpriv = &padapter->cmdpriv; @@ -5031,7 +5046,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } u8 rtw_antenna_select_cmd(_adapter*padapter, u8 antenna,u8 enqueue) -@@ -2045,7 +2372,7 @@ u8 rtw_antenna_select_cmd(_adapter*padap +@@ -2045,7 +2372,7 @@ u8 rtw_antenna_select_cmd(_adapter*padapter, u8 antenna,u8 enqueue) u8 res = _SUCCESS; _func_enter_; @@ -5064,7 +5079,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #ifdef CONFIG_P2P u8 p2p_protocol_wk_cmd(_adapter*padapter, int intCmdType ) { -@@ -2098,7 +2437,7 @@ u8 p2p_protocol_wk_cmd(_adapter*padapter +@@ -2098,7 +2437,7 @@ u8 p2p_protocol_wk_cmd(_adapter*padapter, int intCmdType ) _func_enter_; @@ -5202,7 +5217,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release u8 rtw_drvextra_cmd_hdl(_adapter *padapter, unsigned char *pbuf) { struct drvextra_cmd_parm *pdrvextra_cmd; -@@ -2268,24 +2713,39 @@ u8 rtw_drvextra_cmd_hdl(_adapter *padapt +@@ -2268,24 +2713,39 @@ u8 rtw_drvextra_cmd_hdl(_adapter *padapter, unsigned char *pbuf) antenna_select_wk_hdl(padapter, pdrvextra_cmd->type_size); break; #endif @@ -5264,6 +5279,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release void rtw_getrttbl_cmd_cmdrsp_callback(_adapter* padapter, struct cmd_obj *pcmd) { _func_enter_; +diff --git a/drivers/net/wireless/rtl8192cu/core/rtw_debug.c b/drivers/net/wireless/rtl8192cu/core/rtw_debug.c +index 04e472d..f70fcb7 100644 --- a/drivers/net/wireless/rtl8192cu/core/rtw_debug.c +++ b/drivers/net/wireless/rtl8192cu/core/rtw_debug.c @@ -1,7 +1,7 @@ @@ -5304,7 +5321,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #ifdef CONFIG_PROC_DEBUG #include -@@ -76,6 +77,65 @@ int proc_get_drv_version(char *page, cha +@@ -76,6 +77,65 @@ int proc_get_drv_version(char *page, char **start, return len; } @@ -5370,7 +5387,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release int proc_get_write_reg(char *page, char **start, off_t offset, int count, int *eof, void *data) -@@ -94,7 +154,7 @@ int proc_set_write_reg(struct file *file +@@ -94,7 +154,7 @@ int proc_set_write_reg(struct file *file, const char *buffer, if (count < 3) { @@ -5379,7 +5396,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return -EFAULT; } -@@ -103,7 +163,7 @@ int proc_set_write_reg(struct file *file +@@ -103,7 +163,7 @@ int proc_set_write_reg(struct file *file, const char *buffer, int num = sscanf(tmp, "%x %x %x", &addr, &val, &len); if (num != 3) { @@ -5388,7 +5405,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return count; } -@@ -119,7 +179,7 @@ int proc_set_write_reg(struct file *file +@@ -119,7 +179,7 @@ int proc_set_write_reg(struct file *file, const char *buffer, rtw_write32(padapter, addr, val); break; default: @@ -5397,7 +5414,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release break; } -@@ -171,14 +231,12 @@ int proc_get_read_reg(char *page, char * +@@ -171,14 +231,12 @@ int proc_get_read_reg(char *page, char **start, int proc_set_read_reg(struct file *file, const char *buffer, unsigned long count, void *data) { @@ -5413,7 +5430,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return -EFAULT; } -@@ -187,7 +245,7 @@ int proc_set_read_reg(struct file *file, +@@ -187,7 +245,7 @@ int proc_set_read_reg(struct file *file, const char *buffer, int num = sscanf(tmp, "%x %x", &addr, &len); if (num != 2) { @@ -5422,7 +5439,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return count; } -@@ -289,17 +347,17 @@ int proc_get_rf_info(char *page, char ** +@@ -289,17 +347,17 @@ int proc_get_rf_info(char *page, char **start, int *eof, void *data) { struct net_device *dev = data; @@ -5447,7 +5464,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } int proc_get_ap_info(char *page, char **start, -@@ -371,23 +429,282 @@ int proc_get_trx_info(char *page, char * +@@ -371,23 +429,282 @@ int proc_get_trx_info(char *page, char **start, off_t offset, int count, int *eof, void *data) { @@ -5513,10 +5530,10 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + if((j++)%4 == 0) len += snprintf(page + len, count - len,"\n"); + } + - *eof = 1; - return len; - - } ++ *eof = 1; ++ return len; ++ ++} + +int proc_get_mac_reg_dump2(char *page, char **start, + off_t offset, int count, @@ -5536,10 +5553,10 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + if((j++)%4 == 0) len += snprintf(page + len, count - len,"\n"); + } + -+ *eof = 1; -+ return len; -+ -+} + *eof = 1; + return len; + + } + +int proc_get_mac_reg_dump3(char *page, char **start, + off_t offset, int count, @@ -5733,7 +5750,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release int proc_get_rx_signal(char *page, char **start, off_t offset, int count, -@@ -453,6 +770,101 @@ int proc_set_rx_signal(struct file *file +@@ -453,6 +770,101 @@ int proc_set_rx_signal(struct file *file, const char *buffer, } @@ -5835,7 +5852,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release int proc_get_ampdu_enable(char *page, char **start, off_t offset, int count, int *eof, void *data) -@@ -500,6 +912,112 @@ int proc_set_ampdu_enable(struct file *f +@@ -500,6 +912,112 @@ int proc_set_ampdu_enable(struct file *file, const char *buffer, } @@ -5948,7 +5965,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release int proc_get_rssi_disp(char *page, char **start, off_t offset, int count, int *eof, void *data) -@@ -703,7 +1221,117 @@ int proc_get_best_channel(char *page, ch +@@ -703,7 +1221,117 @@ int proc_get_best_channel(char *page, char **start, return len; } @@ -6066,6 +6083,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + #endif +diff --git a/drivers/net/wireless/rtl8192cu/core/rtw_eeprom.c b/drivers/net/wireless/rtl8192cu/core/rtw_eeprom.c +index 4a0832b..fd07d64 100644 --- a/drivers/net/wireless/rtl8192cu/core/rtw_eeprom.c +++ b/drivers/net/wireless/rtl8192cu/core/rtw_eeprom.c @@ -16,8 +16,7 @@ @@ -6078,6 +6097,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #define _RTW_EEPROM_C_ #include +diff --git a/drivers/net/wireless/rtl8192cu/core/rtw_ieee80211.c b/drivers/net/wireless/rtl8192cu/core/rtw_ieee80211.c +index 2b85af9..6305ba3 100644 --- a/drivers/net/wireless/rtl8192cu/core/rtw_ieee80211.c +++ b/drivers/net/wireless/rtl8192cu/core/rtw_ieee80211.c @@ -25,7 +25,27 @@ @@ -6132,7 +6153,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + return HAL_PRIME_CHNL_OFFSET_UPPER; + else if(ch_offset == SCB) + return HAL_PRIME_CHNL_OFFSET_LOWER; - ++ + return HAL_PRIME_CHNL_OFFSET_DONT_CARE; +} + @@ -6162,7 +6183,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + ie_data[1] = flags; + RTW_PUT_LE16((u8*)&ie_data[2], reason); + RTW_PUT_LE16((u8*)&ie_data[4], precedence); -+ + + return rtw_set_ie(buf, 0x118, 6, ie_data, buf_len); +} @@ -6286,7 +6307,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release u8 *pbuf = pie; while(1) -@@ -351,34 +520,31 @@ unsigned char *rtw_get_wpa_ie(unsigned c +@@ -351,34 +520,31 @@ unsigned char *rtw_get_wpa_ie(unsigned char *pie, int *wpa_ie_len, int limit) val16 = le16_to_cpu(val16); if (val16 != 0x0001) @@ -6326,7 +6347,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } unsigned char *rtw_get_wpa2_ie(unsigned char *pie, int *rsn_ie_len, int limit) -@@ -434,7 +600,7 @@ int rtw_parse_wpa_ie(u8* wpa_ie, int wpa +@@ -434,7 +600,7 @@ int rtw_parse_wpa_ie(u8* wpa_ie, int wpa_ie_len, int *group_cipher, int *pairwis if ((*wpa_ie != _WPA_IE_ID_) || (*(wpa_ie+1) != (u8)(wpa_ie_len - 2)) || @@ -6335,7 +6356,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { return _FAIL; } -@@ -787,7 +953,7 @@ u8 *rtw_get_wps_attr_content(u8 *wps_ie, +@@ -787,7 +953,7 @@ u8 *rtw_get_wps_attr_content(u8 *wps_ie, uint wps_ielen, u16 target_attr_id ,u8 } static int rtw_ieee802_11_parse_vendor_specific(u8 *pos, uint elen, @@ -6344,7 +6365,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release int show_errors) { unsigned int oui; -@@ -892,7 +1058,7 @@ static int rtw_ieee802_11_parse_vendor_s +@@ -892,7 +1058,7 @@ static int rtw_ieee802_11_parse_vendor_specific(u8 *pos, uint elen, * Returns: Parsing result */ ParseRes rtw_ieee802_11_parse_elems(u8 *start, uint len, @@ -6353,7 +6374,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release int show_errors) { uint left = len; -@@ -1018,7 +1184,8 @@ ParseRes rtw_ieee802_11_parse_elems(u8 * +@@ -1018,7 +1184,8 @@ ParseRes rtw_ieee802_11_parse_elems(u8 *start, uint len, } @@ -6487,7 +6508,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { uint cnt = 0; u8 *p2p_ie_ptr; -@@ -1166,7 +1411,12 @@ u8 *rtw_get_p2p_ie(u8 *in_ie, uint in_le +@@ -1166,7 +1411,12 @@ u8 *rtw_get_p2p_ie(u8 *in_ie, uint in_len, u8 *p2p_ie, uint *p2p_ielen) while(cntio_ops._write16; @@ -6807,7 +6830,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release ret = _write16(pintfhdl, addr, val); _func_exit_; -@@ -174,7 +173,7 @@ int _rtw_writeN(_adapter *adapter, u32 a +@@ -174,7 +173,7 @@ int _rtw_writeN(_adapter *adapter, u32 addr ,u32 length , u8 *pdata) _func_enter_; _writeN = pintfhdl->io_ops._writeN; @@ -6816,7 +6839,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release _func_exit_; return RTW_STATUS_CODE(ret); -@@ -188,8 +187,8 @@ int _rtw_write8_async(_adapter *adapter, +@@ -188,8 +187,8 @@ int _rtw_write8_async(_adapter *adapter, u32 addr, u8 val) int ret; _func_enter_; _write8_async = pintfhdl->io_ops._write8_async; @@ -6827,7 +6850,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release _func_exit_; return RTW_STATUS_CODE(ret); -@@ -203,8 +202,8 @@ int _rtw_write16_async(_adapter *adapter +@@ -203,8 +202,8 @@ int _rtw_write16_async(_adapter *adapter, u32 addr, u16 val) int ret; _func_enter_; _write16_async = pintfhdl->io_ops._write16_async; @@ -6838,7 +6861,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release _func_exit_; return RTW_STATUS_CODE(ret); -@@ -218,71 +217,71 @@ int _rtw_write32_async(_adapter *adapter +@@ -218,71 +217,71 @@ int _rtw_write32_async(_adapter *adapter, u32 addr, u32 val) int ret; _func_enter_; _write32_async = pintfhdl->io_ops._write32_async; @@ -6933,7 +6956,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release _func_exit_; } -@@ -292,51 +291,48 @@ void _rtw_read_port_cancel(_adapter *ada +@@ -292,51 +291,48 @@ void _rtw_read_port_cancel(_adapter *adapter) void (*_read_port_cancel)(struct intf_hdl *pintfhdl); struct io_priv *pio_priv = &adapter->iopriv; struct intf_hdl *pintfhdl = &(pio_priv->intf); @@ -7007,7 +7030,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } void _rtw_write_port_cancel(_adapter *adapter) -@@ -344,143 +340,121 @@ void _rtw_write_port_cancel(_adapter *ad +@@ -344,143 +340,121 @@ void _rtw_write_port_cancel(_adapter *adapter) void (*_write_port_cancel)(struct intf_hdl *pintfhdl); struct io_priv *pio_priv = &adapter->iopriv; struct intf_hdl *pintfhdl = &(pio_priv->intf); @@ -7092,15 +7115,39 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release -#ifdef CONFIG_RTL8192C - set_intf_ops = &rtl8192cu_set_intf_ops; -#endif +- } +- else if(padapter->chip_type == RTL8192D) +- { +-#ifdef CONFIG_RTL8192D +- set_intf_ops = &rtl8192du_set_intf_ops; +-#endif +- } +- else +- { +- set_intf_ops = NULL; +- } +-#endif //END OF CONFIG_USB_HCI +u16 read_sniff_ranges[][2] = { + //{0x550, 0x551}, +}; -+ + +-#ifdef CONFIG_PCI_HCI +u16 write_sniff_ranges[][2] = { + //{0x550, 0x551}, + //{0x4c, 0x4c}, +}; -+ + +- if(padapter->chip_type == RTL8188C_8192C) +- { +-#ifdef CONFIG_RTL8192C +- set_intf_ops = &rtl8192ce_set_intf_ops; +-#endif +- } +- else if(padapter->chip_type == RTL8192D) +- { +-#ifdef CONFIG_RTL8192D +- set_intf_ops = &rtl8192de_set_intf_ops; +-#endif +int read_sniff_num = sizeof(read_sniff_ranges)/sizeof(u16)/2; +int write_sniff_num = sizeof(write_sniff_ranges)/sizeof(u16)/2; + @@ -7111,12 +7158,6 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + if (addr + len > read_sniff_ranges[i][0] && addr <= read_sniff_ranges[i][1]) + return _TRUE; } -- else if(padapter->chip_type == RTL8192D) -- { --#ifdef CONFIG_RTL8192D -- set_intf_ops = &rtl8192du_set_intf_ops; --#endif -- } - else - { - set_intf_ops = NULL; @@ -7131,41 +7172,25 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + if (addr + len > write_sniff_ranges[i][0] && addr <= write_sniff_ranges[i][1]) + return _TRUE; } --#endif //END OF CONFIG_USB_HCI +-#endif //END OF CONFIG_PCI_HCI + + return _FALSE; +} --#ifdef CONFIG_PCI_HCI +u8 dbg_rtw_read8(_adapter *adapter, u32 addr, const char *caller, const int line) +{ + u8 val = _rtw_read8(adapter, addr); -- if(padapter->chip_type == RTL8188C_8192C) -- { --#ifdef CONFIG_RTL8192C -- set_intf_ops = &rtl8192ce_set_intf_ops; --#endif -- } -- else if(padapter->chip_type == RTL8192D) -- { --#ifdef CONFIG_RTL8192D -- set_intf_ops = &rtl8192de_set_intf_ops; --#endif -- } -- else -- { -- set_intf_ops = NULL; -- } --#endif //END OF CONFIG_PCI_HCI +- if(set_intf_ops==NULL) +- return _FAIL; + if (match_read_sniff_ranges(addr, 1)) + DBG_871X("DBG_IO %s:%d rtw_read8(0x%04x) return 0x%02x\n", caller, line, addr, val); +- set_intf_ops(&pintf->io_ops); + return val; +} -- if(set_intf_ops==NULL) -- return _FAIL; +- return _SUCCESS; +u16 dbg_rtw_read16(_adapter *adapter, u32 addr, const char *caller, const int line) +{ + u16 val = _rtw_read16(adapter, addr); @@ -7173,18 +7198,16 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + if (match_read_sniff_ranges(addr, 2)) + DBG_871X("DBG_IO %s:%d rtw_read16(0x%04x) return 0x%04x\n", caller, line, addr, val); -- set_intf_ops(&pintf->io_ops); + return val; +} - -- return _SUCCESS; ++ +u32 dbg_rtw_read32(_adapter *adapter, u32 addr, const char *caller, const int line) +{ + u32 val = _rtw_read32(adapter, addr); + + if (match_read_sniff_ranges(addr, 4)) + DBG_871X("DBG_IO %s:%d rtw_read32(0x%04x) return 0x%08x\n", caller, line, addr, val); - ++ + return val; } @@ -7220,6 +7243,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release DBG_871X("DBG_IO %s:%d rtw_writeN(0x%04x, %u)\n", caller, line, addr, length); return _rtw_writeN(adapter, addr, length, data); +diff --git a/drivers/net/wireless/rtl8192cu/core/rtw_ioctl_query.c b/drivers/net/wireless/rtl8192cu/core/rtw_ioctl_query.c +index 156640c..0601886 100644 --- a/drivers/net/wireless/rtl8192cu/core/rtw_ioctl_query.c +++ b/drivers/net/wireless/rtl8192cu/core/rtw_ioctl_query.c @@ -16,8 +16,7 @@ @@ -7232,6 +7257,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #define _RTW_IOCTL_QUERY_C_ #include +diff --git a/drivers/net/wireless/rtl8192cu/core/rtw_ioctl_rtl.c b/drivers/net/wireless/rtl8192cu/core/rtw_ioctl_rtl.c +index 87348a2..31b4704 100644 --- a/drivers/net/wireless/rtl8192cu/core/rtw_ioctl_rtl.c +++ b/drivers/net/wireless/rtl8192cu/core/rtw_ioctl_rtl.c @@ -16,8 +16,7 @@ @@ -7244,6 +7271,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #define _RTW_IOCTL_RTL_C_ #include +diff --git a/drivers/net/wireless/rtl8192cu/core/rtw_ioctl_set.c b/drivers/net/wireless/rtl8192cu/core/rtw_ioctl_set.c +index 946d875..e67f219 100644 --- a/drivers/net/wireless/rtl8192cu/core/rtw_ioctl_set.c +++ b/drivers/net/wireless/rtl8192cu/core/rtw_ioctl_set.c @@ -16,7 +16,7 @@ @@ -7264,7 +7293,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #ifdef CONFIG_USB_HCI #include -@@ -43,6 +43,20 @@ extern void indicate_wx_scan_complete_ev +@@ -43,6 +43,20 @@ extern void indicate_wx_scan_complete_event(_adapter *padapter); (addr[4] == 0xff) && (addr[5] == 0xff) ) ? _TRUE : _FALSE \ ) @@ -7372,7 +7401,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("do_join(): site survey return error\n.")); } } -@@ -317,8 +330,8 @@ u8 rtw_set_802_11_bssid(_adapter* padapt +@@ -317,8 +330,8 @@ u8 rtw_set_802_11_bssid(_adapter* padapter, u8 *bssid) _irqL irqL; u8 status=_SUCCESS; u32 cur_time = 0; @@ -7419,7 +7448,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release _rtw_memcpy(&pmlmepriv->assoc_bssid, bssid, ETH_ALEN); pmlmepriv->assoc_by_bssid=_TRUE; -@@ -419,7 +418,6 @@ u8 rtw_set_802_11_ssid(_adapter* padapte +@@ -419,7 +418,6 @@ u8 rtw_set_802_11_ssid(_adapter* padapter, NDIS_802_11_SSID *ssid) struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct wlan_network *pnetwork = &pmlmepriv->cur_network; @@ -7820,7 +7849,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } return max_rate; -@@ -1408,19 +1453,42 @@ int rtw_set_channel_plan(_adapter *adapt +@@ -1408,19 +1453,42 @@ int rtw_set_channel_plan(_adapter *adapter, u8 channel_plan) */ int rtw_set_country(_adapter *adapter, const char *country_code) { @@ -7865,9 +7894,11 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + return _FAIL; +} + +diff --git a/drivers/net/wireless/rtl8192cu/core/rtw_iol.c b/drivers/net/wireless/rtl8192cu/core/rtw_iol.c +index f725ad4..872cc42 100644 --- a/drivers/net/wireless/rtl8192cu/core/rtw_iol.c +++ b/drivers/net/wireless/rtl8192cu/core/rtw_iol.c -@@ -38,7 +38,7 @@ struct xmit_frame *rtw_IOL_accquire_xmit +@@ -38,7 +38,7 @@ struct xmit_frame *rtw_IOL_accquire_xmit_frame(ADAPTER *adapter) if ((xmitbuf = rtw_alloc_xmitbuf(pxmitpriv)) == NULL) { DBG_871X("%s rtw_alloc_xmitbuf return null\n", __FUNCTION__); @@ -7876,7 +7907,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release xmit_frame=NULL; goto exit; } -@@ -145,7 +145,7 @@ int _rtw_IOL_append_WD_cmd(struct xmit_f +@@ -145,7 +145,7 @@ int _rtw_IOL_append_WD_cmd(struct xmit_frame *xmit_frame, u16 addr, u32 value) #ifdef DBG_IO int dbg_rtw_IOL_append_WB_cmd(struct xmit_frame *xmit_frame, u16 addr, u8 value, const char *caller, const int line) { @@ -7885,7 +7916,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release DBG_871X("DBG_IO %s:%d IOL_WB(0x%04x, 0x%02x)\n", caller, line, addr, value); return _rtw_IOL_append_WB_cmd(xmit_frame, addr, value); -@@ -153,7 +153,7 @@ int dbg_rtw_IOL_append_WB_cmd(struct xmi +@@ -153,7 +153,7 @@ int dbg_rtw_IOL_append_WB_cmd(struct xmit_frame *xmit_frame, u16 addr, u8 value, int dbg_rtw_IOL_append_WW_cmd(struct xmit_frame *xmit_frame, u16 addr, u16 value, const char *caller, const int line) { @@ -7894,7 +7925,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release DBG_871X("DBG_IO %s:%d IOL_WW(0x%04x, 0x%04x)\n", caller, line, addr, value); return _rtw_IOL_append_WW_cmd(xmit_frame, addr, value); -@@ -161,7 +161,7 @@ int dbg_rtw_IOL_append_WW_cmd(struct xmi +@@ -161,7 +161,7 @@ int dbg_rtw_IOL_append_WW_cmd(struct xmit_frame *xmit_frame, u16 addr, u16 value int dbg_rtw_IOL_append_WD_cmd(struct xmit_frame *xmit_frame, u16 addr, u32 value, const char *caller, const int line) { @@ -7903,7 +7934,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release DBG_871X("DBG_IO %s:%d IOL_WD(0x%04x, 0x%08x)\n", caller, line, addr, value); return _rtw_IOL_append_WD_cmd(xmit_frame, addr, value); -@@ -224,10 +224,7 @@ int rtw_IOL_append_END_cmd(struct xmit_f +@@ -224,10 +224,7 @@ int rtw_IOL_append_END_cmd(struct xmit_frame *xmit_frame) int rtw_IOL_exec_cmds_sync(ADAPTER *adapter, struct xmit_frame *xmit_frame, u32 max_wating_ms) { @@ -7924,6 +7955,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return _TRUE; #endif +diff --git a/drivers/net/wireless/rtl8192cu/core/rtw_mlme.c b/drivers/net/wireless/rtl8192cu/core/rtw_mlme.c +index 2e11d9d..00edd9c 100644 --- a/drivers/net/wireless/rtl8192cu/core/rtw_mlme.c +++ b/drivers/net/wireless/rtl8192cu/core/rtw_mlme.c @@ -16,7 +16,7 @@ @@ -7987,7 +8020,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release void rtw_mfree_mlme_priv_lock (struct mlme_priv *pmlmepriv) { _rtw_spinlock_free(&pmlmepriv->lock); -@@ -108,7 +115,7 @@ static void rtw_free_mlme_ie_data(u8 **p +@@ -108,7 +115,7 @@ static void rtw_free_mlme_ie_data(u8 **ppie, u32 *plen) { if(*ppie) { @@ -7996,7 +8029,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release *plen = 0; *ppie=NULL; } -@@ -117,6 +124,8 @@ static void rtw_free_mlme_ie_data(u8 **p +@@ -117,6 +124,8 @@ static void rtw_free_mlme_ie_data(u8 **ppie, u32 *plen) void rtw_free_mlme_priv_ie_data(struct mlme_priv *pmlmepriv) { #if defined (CONFIG_AP_MODE) && defined (CONFIG_NATIVEAP_MLME) @@ -8005,7 +8038,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release rtw_free_mlme_ie_data(&pmlmepriv->wps_beacon_ie, &pmlmepriv->wps_beacon_ie_len); rtw_free_mlme_ie_data(&pmlmepriv->wps_probe_req_ie, &pmlmepriv->wps_probe_req_ie_len); rtw_free_mlme_ie_data(&pmlmepriv->wps_probe_resp_ie, &pmlmepriv->wps_probe_resp_ie_len); -@@ -128,6 +137,15 @@ void rtw_free_mlme_priv_ie_data(struct m +@@ -128,6 +137,15 @@ void rtw_free_mlme_priv_ie_data(struct mlme_priv *pmlmepriv) rtw_free_mlme_ie_data(&pmlmepriv->p2p_go_probe_resp_ie, &pmlmepriv->p2p_go_probe_resp_ie_len); rtw_free_mlme_ie_data(&pmlmepriv->p2p_assoc_req_ie, &pmlmepriv->p2p_assoc_req_ie_len); #endif @@ -8039,7 +8072,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } _enter_critical_bh(&free_queue->lock, &irqL); -@@ -385,8 +414,6 @@ void _rtw_free_network_queue(_adapter *p +@@ -385,8 +414,6 @@ void _rtw_free_network_queue(_adapter *padapter, u8 isfreeall) struct wlan_network *pnetwork; struct mlme_priv* pmlmepriv = &padapter->mlmepriv; _queue *scanned_queue = &pmlmepriv->scanned_queue; @@ -8093,7 +8126,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release void rtw_free_network_nolock(struct mlme_priv *pmlmepriv, struct wlan_network *pnetwork ) { _func_enter_; -@@ -585,6 +615,7 @@ int rtw_is_same_ibss(_adapter *adapter, +@@ -585,6 +615,7 @@ int rtw_is_same_ibss(_adapter *adapter, struct wlan_network *pnetwork) } @@ -8101,7 +8134,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release inline int is_same_ess(WLAN_BSSID_EX *a, WLAN_BSSID_EX *b) { //RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("(%s,%d)(%s,%d)\n", -@@ -593,7 +624,7 @@ inline int is_same_ess(WLAN_BSSID_EX *a, +@@ -593,7 +624,7 @@ inline int is_same_ess(WLAN_BSSID_EX *a, WLAN_BSSID_EX *b) && _rtw_memcmp(a->Ssid.Ssid, b->Ssid.Ssid, a->Ssid.SsidLength)==_TRUE; } @@ -8122,7 +8155,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release u8 ss_ori = dst->PhyInfo.SignalStrength; u8 sq_ori = dst->PhyInfo.SignalQuality; long rssi_ori = dst->Rssi; -@@ -678,16 +709,20 @@ static void update_network(WLAN_BSSID_EX +@@ -678,16 +709,20 @@ static void update_network(WLAN_BSSID_EX *dst, WLAN_BSSID_EX *src,_adapter * pad u8 sq_smp = src->PhyInfo.SignalQuality; long rssi_smp = src->Rssi; @@ -8265,7 +8298,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release rtw_update_protection(adapter, (pmlmepriv->cur_network.network.IEs) + sizeof (NDIS_802_11_FIXED_IEs), pmlmepriv->cur_network.network.IELength); } -@@ -824,6 +855,7 @@ void rtw_update_scanned_network(_adapter +@@ -824,6 +855,7 @@ void rtw_update_scanned_network(_adapter *adapter, WLAN_BSSID_EX *target) struct wlan_network *oldest = NULL; _func_enter_; @@ -8356,7 +8389,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release int rtw_is_desired_network(_adapter *adapter, struct wlan_network *pnetwork) { struct security_priv *psecuritypriv = &adapter->securitypriv; -@@ -965,7 +1009,7 @@ int rtw_is_desired_network(_adapter *ada +@@ -965,7 +1009,7 @@ int rtw_is_desired_network(_adapter *adapter, struct wlan_network *pnetwork) desired_encmode = psecuritypriv->ndisencryptstatus; privacy = pnetwork->network.Privacy; @@ -8365,7 +8398,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { if(rtw_get_wps_ie(pnetwork->network.IEs+_FIXED_IE_LENGTH_, pnetwork->network.IELength-_FIXED_IE_LENGTH_, NULL, &wps_ielen)!=NULL) { -@@ -978,8 +1022,20 @@ int rtw_is_desired_network(_adapter *ada +@@ -978,8 +1022,20 @@ int rtw_is_desired_network(_adapter *adapter, struct wlan_network *pnetwork) } if (adapter->registrypriv.wifi_spec == 1) //for correct flow of 8021X to do.... { @@ -8394,7 +8427,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release struct mlme_priv *pmlmepriv = &(adapter->mlmepriv); #ifdef CONFIG_MLME_EXT -@@ -1108,7 +1165,6 @@ void rtw_surveydone_event_callback(_adap +@@ -1108,7 +1165,6 @@ void rtw_surveydone_event_callback(_adapter *adapter, u8 *pbuf) _func_enter_; _enter_critical_bh(&pmlmepriv->lock, &irqL); @@ -8519,7 +8552,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #ifdef CONFIG_IOCTL_CFG80211 rtw_cfg80211_surveydone_event_callback(adapter); -@@ -1297,19 +1374,15 @@ void rtw_free_assoc_resources(_adapter * +@@ -1297,19 +1374,15 @@ void rtw_free_assoc_resources(_adapter *adapter, int lock_scanned_queue) _irqL irqL; struct wlan_network* pwlan = NULL; struct mlme_priv *pmlmepriv = &adapter->mlmepriv; @@ -8721,7 +8754,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release _func_exit_; } -@@ -1468,16 +1590,45 @@ inline void rtw_indicate_scan_done( _ada +@@ -1468,16 +1590,45 @@ inline void rtw_indicate_scan_done( _adapter *padapter, bool aborted) rtw_os_indicate_scan_done(padapter, aborted); } @@ -8771,7 +8804,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release psta = rtw_get_stainfo(pstapriv, pnetwork->network.MacAddress); if(psta==NULL) { -@@ -1490,16 +1641,16 @@ static struct sta_info *rtw_joinbss_upda +@@ -1490,16 +1641,16 @@ static struct sta_info *rtw_joinbss_update_stainfo(_adapter *padapter, struct wl psta->aid = pnetwork->join_res; #ifdef CONFIG_CONCURRENT_MODE @@ -8797,7 +8830,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release //security related if(padapter->securitypriv.dot11AuthAlgrthm== dot11AuthAlgrthm_8021X) -@@ -1516,10 +1667,22 @@ static struct sta_info *rtw_joinbss_upda +@@ -1516,10 +1667,22 @@ static struct sta_info *rtw_joinbss_update_stainfo(_adapter *padapter, struct wl _rtw_memset((u8 *)&psta->dot11tkiprxmickey, 0, sizeof (union Keytype)); _rtw_memset((u8 *)&psta->dot11tkiptxmickey, 0, sizeof (union Keytype)); @@ -8821,7 +8854,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release //for A-MPDU Rx reordering buffer control for bmc_sta & sta_info //if A-MPDU Rx is enabled, reseting rx_ordering_ctrl wstart_b(indicate_seq) to default value=0xffff -@@ -1582,7 +1745,6 @@ static void rtw_joinbss_update_network(_ +@@ -1582,7 +1745,6 @@ static void rtw_joinbss_update_network(_adapter *padapter, struct wlan_network * // why not use ptarget_wlan?? _rtw_memcpy(&cur_network->network, &pnetwork->network, pnetwork->network.Length); @@ -8829,7 +8862,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release cur_network->aid = pnetwork->join_res; -@@ -1594,15 +1756,29 @@ static void rtw_joinbss_update_network(_ +@@ -1594,15 +1756,29 @@ static void rtw_joinbss_update_network(_adapter *padapter, struct wlan_network * padapter->recvpriv.signal_qual = ptarget_wlan->network.PhyInfo.SignalQuality; //the ptarget_wlan->network.Rssi is raw data, we use ptarget_wlan->network.PhyInfo.SignalStrength instead (has scaled) padapter->recvpriv.rssi = translate_percentage_to_dbm(ptarget_wlan->network.PhyInfo.SignalStrength); @@ -8861,7 +8894,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release break; case Ndis802_11IBSS: pmlmepriv->fw_state = WIFI_ADHOC_STATE; -@@ -1617,7 +1793,7 @@ static void rtw_joinbss_update_network(_ +@@ -1617,7 +1793,7 @@ static void rtw_joinbss_update_network(_adapter *padapter, struct wlan_network * (cur_network->network.IELength)); #ifdef CONFIG_80211N_HT @@ -8870,7 +8903,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #endif -@@ -1634,7 +1810,6 @@ static void rtw_joinbss_update_network(_ +@@ -1634,7 +1810,6 @@ static void rtw_joinbss_update_network(_adapter *padapter, struct wlan_network * void rtw_joinbss_event_prehandle(_adapter *adapter, u8 *pbuf) { _irqL irqL,irqL2; @@ -8954,7 +8987,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release _func_exit_; } -@@ -1871,8 +2051,7 @@ void rtw_stassoc_event_callback(_adapter +@@ -1871,8 +2051,7 @@ void rtw_stassoc_event_callback(_adapter *adapter, u8 *pbuf) _func_enter_; @@ -9004,7 +9037,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } goto exit; -@@ -1992,15 +2173,19 @@ void rtw_stadel_event_callback(_adapter +@@ -1992,15 +2173,19 @@ void rtw_stadel_event_callback(_adapter *adapter, u8 *pbuf) _func_enter_; @@ -9098,7 +9131,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #endif _func_exit_; -@@ -2120,7 +2313,9 @@ void _rtw_join_timeout_handler (_adapter +@@ -2120,7 +2313,9 @@ void _rtw_join_timeout_handler (_adapter *adapter) { _irqL irqL; struct mlme_priv *pmlmepriv = &adapter->mlmepriv; @@ -9108,7 +9141,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #if 0 if (adapter->bDriverStopped == _TRUE){ -@@ -2130,6 +2325,24 @@ void _rtw_join_timeout_handler (_adapter +@@ -2130,6 +2325,24 @@ void _rtw_join_timeout_handler (_adapter *adapter) #endif _func_enter_; @@ -9190,7 +9223,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release /* * rtw_scan_timeout_handler - Timeout/Faliure handler for CMD SiteSurvey * @adapter: pointer to _adapter structure -@@ -2185,18 +2414,16 @@ void rtw_scan_timeout_handler (_adapter +@@ -2185,18 +2414,16 @@ void rtw_scan_timeout_handler (_adapter *adapter) _irqL irqL; struct mlme_priv *pmlmepriv = &adapter->mlmepriv; @@ -9212,7 +9245,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } static void rtw_auto_scan_handler(_adapter *padapter) -@@ -2210,26 +2437,35 @@ static void rtw_auto_scan_handler(_adapt +@@ -2210,26 +2437,35 @@ static void rtw_auto_scan_handler(_adapter *padapter) pmlmepriv->scan_interval--; if(pmlmepriv->scan_interval==0) { @@ -9254,7 +9287,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release pmlmepriv->scan_interval = SCAN_INTERVAL;// 30*2 sec = 60sec -@@ -2245,6 +2481,12 @@ void rtw_dynamic_check_timer_handlder(_a +@@ -2245,6 +2481,12 @@ void rtw_dynamic_check_timer_handlder(_adapter *adapter) struct mlme_priv *pmlmepriv = &adapter->mlmepriv; #endif //CONFIG_AP_MODE struct registry_priv *pregistrypriv = &adapter->registrypriv; @@ -9267,7 +9300,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if(adapter->hw_init_completed == _FALSE) return; -@@ -2252,8 +2494,21 @@ void rtw_dynamic_check_timer_handlder(_a +@@ -2252,8 +2494,21 @@ void rtw_dynamic_check_timer_handlder(_adapter *adapter) if ((adapter->bDriverStopped == _TRUE)||(adapter->bSurpriseRemoved== _TRUE)) return; @@ -9289,7 +9322,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release rtw_dynamic_chk_wk_cmd(adapter); -@@ -2269,12 +2524,14 @@ void rtw_dynamic_check_timer_handlder(_a +@@ -2269,12 +2524,14 @@ void rtw_dynamic_check_timer_handlder(_adapter *adapter) } } @@ -9304,7 +9337,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #ifdef CONFIG_BR_EXT -@@ -2313,27 +2570,58 @@ void rtw_dynamic_check_timer_handlder(_a +@@ -2313,27 +2570,58 @@ void rtw_dynamic_check_timer_handlder(_adapter *adapter) #ifdef CONFIG_SET_SCAN_DENY_TIMER @@ -9367,7 +9400,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release /* * Select a new join candidate from the original @param candidate and @param competitor * @return _TRUE: candidate is updated -@@ -2364,7 +2652,7 @@ static int rtw_check_join_candidate(stru +@@ -2364,7 +2652,7 @@ static int rtw_check_join_candidate(struct mlme_priv *pmlmepriv goto exit; #ifdef CONFIG_LAYER2_ROAMING @@ -9376,7 +9409,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if( rtw_get_passing_time_ms((u32)competitor->last_scanned) >= RTW_SCAN_RESULT_EXPIRE || is_same_ess(&competitor->network, &pmlmepriv->cur_network.network) == _FALSE ) -@@ -2393,7 +2681,7 @@ static int rtw_check_join_candidate(stru +@@ -2393,7 +2681,7 @@ static int rtw_check_join_candidate(struct mlme_priv *pmlmepriv } } else #ifdef CONFIG_LAYER2_ROAMING @@ -9385,7 +9418,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if( (*candidate == NULL ||(*candidate)->network.Rssinetwork.Rssi ) && is_same_ess(&competitor->network, &pmlmepriv->cur_network.network) //&&(!is_same_network(&competitor->network, &pmlmepriv->cur_network.network)) -@@ -2423,14 +2711,15 @@ static int rtw_check_join_candidate(stru +@@ -2423,14 +2711,15 @@ static int rtw_check_join_candidate(struct mlme_priv *pmlmepriv #ifdef CONFIG_LAYER2_ROAMING "[to_roaming:%u] " #endif @@ -9612,7 +9645,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release iEntry = SecIsInPMKIDList(adapter, pmlmepriv->assoc_bssid); if(iEntry<0) { -@@ -3097,7 +3384,7 @@ void rtw_update_registrypriv_dev_network +@@ -3097,7 +3384,7 @@ void rtw_update_registrypriv_dev_network(_adapter* adapter) WLAN_BSSID_EX *pdev_network = &pregistrypriv->dev_network; struct security_priv* psecuritypriv = &adapter->securitypriv; struct wlan_network *cur_network = &adapter->mlmepriv.cur_network; @@ -9631,7 +9664,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release _func_enter_; -@@ -3211,12 +3495,12 @@ void rtw_joinbss_reset(_adapter *padapte +@@ -3211,12 +3495,12 @@ void rtw_joinbss_reset(_adapter *padapter) threshold = 1; else threshold = 0; @@ -9646,7 +9679,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } #endif -@@ -3228,7 +3512,7 @@ void rtw_joinbss_reset(_adapter *padapte +@@ -3228,7 +3512,7 @@ void rtw_joinbss_reset(_adapter *padapter) #ifdef CONFIG_80211N_HT //the fucntion is >= passive_level @@ -9655,7 +9688,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { u32 ielen, out_len; unsigned char *p, *pframe; -@@ -3237,7 +3521,8 @@ unsigned int rtw_restructure_ht_ie(_adap +@@ -3237,7 +3521,8 @@ unsigned int rtw_restructure_ht_ie(_adapter *padapter, u8 *in_ie, u8 *out_ie, ui struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct qos_priv *pqospriv= &pmlmepriv->qospriv; struct ht_priv *phtpriv = &pmlmepriv->htpriv; @@ -9665,7 +9698,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release phtpriv->ht_option = _FALSE; -@@ -3258,19 +3543,31 @@ unsigned int rtw_restructure_ht_ie(_adap +@@ -3258,19 +3543,31 @@ unsigned int rtw_restructure_ht_ie(_adapter *padapter, u8 *in_ie, u8 *out_ie, ui _rtw_memset(&ht_capie, 0, sizeof(struct rtw_ieee80211_ht_cap)); @@ -9705,7 +9738,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } ht_capie.ampdu_params_info = (IEEE80211_HT_CAP_AMPDU_FACTOR&0x03); -@@ -3305,7 +3602,7 @@ unsigned int rtw_restructure_ht_ie(_adap +@@ -3305,7 +3602,7 @@ unsigned int rtw_restructure_ht_ie(_adapter *padapter, u8 *in_ie, u8 *out_ie, ui } //the fucntion is > passive_level (in critical_section) @@ -9714,7 +9747,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { u8 *p, max_ampdu_sz; int len; -@@ -3320,7 +3617,7 @@ void rtw_update_ht_cap(_adapter *padapte +@@ -3320,7 +3617,7 @@ void rtw_update_ht_cap(_adapter *padapter, u8 *pie, uint ie_len) //struct wlan_network *pcur_network = &(pmlmepriv->cur_network);; struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); @@ -9723,7 +9756,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if(!phtpriv->ht_option) return; -@@ -3333,11 +3630,12 @@ void rtw_update_ht_cap(_adapter *padapte +@@ -3333,11 +3630,12 @@ void rtw_update_ht_cap(_adapter *padapter, u8 *pie, uint ie_len) //maybe needs check if ap supports rx ampdu. if((phtpriv->ampdu_enable==_FALSE) &&(pregistrypriv->ampdu_enable==1)) { @@ -9738,7 +9771,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { phtpriv->ampdu_enable = _TRUE; } -@@ -3357,13 +3655,13 @@ void rtw_update_ht_cap(_adapter *padapte +@@ -3357,13 +3655,13 @@ void rtw_update_ht_cap(_adapter *padapter, u8 *pie, uint ie_len) max_ampdu_sz = (pht_capie->ampdu_params_info & IEEE80211_HT_CAP_AMPDU_FACTOR); max_ampdu_sz = 1 << (max_ampdu_sz+3); // max_ampdu_sz (kbytes); @@ -9755,7 +9788,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release p = rtw_get_ie(pie+sizeof (NDIS_802_11_FIXED_IEs), _HT_ADD_INFO_IE_, &len, ie_len-sizeof (NDIS_802_11_FIXED_IEs)); if(p && len>0) { -@@ -3371,12 +3669,56 @@ void rtw_update_ht_cap(_adapter *padapte +@@ -3371,12 +3669,56 @@ void rtw_update_ht_cap(_adapter *padapter, u8 *pie, uint ie_len) //todo: } @@ -9814,7 +9847,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release //switch to the 40M Hz mode accoring to the AP pmlmeext->cur_bwmode = HT_CHANNEL_WIDTH_40; switch ((pmlmeinfo->HT_info.infos[0] & 0x3)) -@@ -3392,13 +3734,13 @@ void rtw_update_ht_cap(_adapter *padapte +@@ -3392,13 +3734,13 @@ void rtw_update_ht_cap(_adapter *padapter, u8 *pie, uint ie_len) default: pmlmeext->cur_ch_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE; break; @@ -9831,7 +9864,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if(pmlmeinfo->SM_PS == WLAN_HT_CAP_SM_PS_STATIC) { /*u8 i; -@@ -3467,7 +3809,6 @@ void rtw_issue_addbareq_cmd(_adapter *pa +@@ -3467,7 +3809,6 @@ void rtw_issue_addbareq_cmd(_adapter *padapter, struct xmit_frame *pxmitframe) struct sta_info *psta=NULL; struct ht_priv *phtpriv; struct pkt_attrib *pattrib =&pxmitframe->attrib; @@ -9839,7 +9872,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release s32 bmcst = IS_MCAST(pattrib->ra); if(bmcst || (padapter->mlmepriv.LinkDetectInfo.bTxBusyTraffic == _FALSE)) -@@ -3478,10 +3819,23 @@ void rtw_issue_addbareq_cmd(_adapter *pa +@@ -3478,10 +3819,23 @@ void rtw_issue_addbareq_cmd(_adapter *padapter, struct xmit_frame *pxmitframe) if (pattrib->psta) psta = pattrib->psta; else @@ -9863,7 +9896,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release phtpriv = &psta->htpriv; -@@ -3503,6 +3857,18 @@ void rtw_issue_addbareq_cmd(_adapter *pa +@@ -3503,6 +3857,18 @@ void rtw_issue_addbareq_cmd(_adapter *padapter, struct xmit_frame *pxmitframe) #endif #ifdef CONFIG_LAYER2_ROAMING @@ -9882,7 +9915,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release void rtw_roaming(_adapter *padapter, struct wlan_network *tgt_network) { _irqL irqL; -@@ -3524,7 +3890,7 @@ void _rtw_roaming(_adapter *padapter, st +@@ -3524,7 +3890,7 @@ void _rtw_roaming(_adapter *padapter, struct wlan_network *tgt_network) else pnetwork = &pmlmepriv->cur_network; @@ -9891,7 +9924,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release DBG_871X("roaming from %s("MAC_FMT"), length:%d\n", pnetwork->network.Ssid.Ssid, MAC_ARG(pnetwork->network.MacAddress), pnetwork->network.Ssid.SsidLength); -@@ -3539,7 +3905,7 @@ void _rtw_roaming(_adapter *padapter, st +@@ -3539,7 +3905,7 @@ void _rtw_roaming(_adapter *padapter, struct wlan_network *tgt_network) DBG_871X("roaming do_join return %d\n", do_join_r); pmlmepriv->to_roaming--; @@ -9900,7 +9933,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release continue; } else { DBG_871X("%s(%d) -to roaming fail, indicate_disconnect\n", __FUNCTION__,__LINE__); -@@ -3553,3 +3919,49 @@ void _rtw_roaming(_adapter *padapter, st +@@ -3553,3 +3919,49 @@ void _rtw_roaming(_adapter *padapter, struct wlan_network *tgt_network) } #endif @@ -9950,6 +9983,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release +} +#endif //CONFIG_CONCURRENT_MODE + +diff --git a/drivers/net/wireless/rtl8192cu/core/rtw_mlme_ext.c b/drivers/net/wireless/rtl8192cu/core/rtw_mlme_ext.c +index e1e496d..d29a20c 100644 --- a/drivers/net/wireless/rtl8192cu/core/rtw_mlme_ext.c +++ b/drivers/net/wireless/rtl8192cu/core/rtw_mlme_ext.c @@ -1,6 +1,6 @@ @@ -10007,7 +10042,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #else //CONFIG_DISABLE_MCS13TO15 unsigned char MCS_rate_2R[16] = {0xff, 0xff, 0x0, 0x0, 0x01, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; #endif //CONFIG_DISABLE_MCS13TO15 -@@ -147,6 +157,7 @@ static RT_CHANNEL_PLAN_2G RTW_ChannelPla +@@ -147,6 +157,7 @@ static RT_CHANNEL_PLAN_2G RTW_ChannelPlan2G[RT_CHANNEL_DOMAIN_2G_MAX] = { {{1,2,3,4,5,6,7,8,9,10,11},11}, // 0x02, RT_CHANNEL_DOMAIN_2G_FCC1 {{1,2,3,4,5,6,7,8,9,10,11,12,13,14},14}, // 0x03, RT_CHANNEL_DOMAIN_2G_MIKK1 {{10,11,12,13},4}, // 0x04, RT_CHANNEL_DOMAIN_2G_ETSI2 @@ -10015,7 +10050,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release }; static RT_CHANNEL_PLAN_5G RTW_ChannelPlan5G[RT_CHANNEL_DOMAIN_5G_MAX] = { -@@ -171,6 +182,7 @@ static RT_CHANNEL_PLAN_5G RTW_ChannelPla +@@ -171,6 +182,7 @@ static RT_CHANNEL_PLAN_5G RTW_ChannelPlan5G[RT_CHANNEL_DOMAIN_5G_MAX] = { //===== Driver self defined for old channel plan Compatible ,Remember to modify if have new channel plan definition ===== {{36,40,44,48,52,56,60,64,100,104,108,112,116,132,136,140,149,153,157,161,165},21}, // 0x11, RT_CHANNEL_DOMAIN_5G_FCC {{36,40,44,48},4}, // 0x12, RT_CHANNEL_DOMAIN_5G_JAPAN_NO_DFS @@ -10023,7 +10058,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release }; static RT_CHANNEL_PLAN_MAP RTW_ChannelPlanMap[RT_CHANNEL_DOMAIN_MAX] = { -@@ -180,8 +192,8 @@ static RT_CHANNEL_PLAN_MAP RTW_ChannelPl +@@ -180,8 +192,8 @@ static RT_CHANNEL_PLAN_MAP RTW_ChannelPlanMap[RT_CHANNEL_DOMAIN_MAX] = { {0x01,0x01}, //0x02, RT_CHANNEL_DOMAIN_ETSI {0x01,0x00}, //0x03, RT_CHANNEL_DOMAIN_SPAIN {0x01,0x00}, //0x04, RT_CHANNEL_DOMAIN_FRANCE @@ -10034,7 +10069,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release {0x01,0x09}, //0x07, RT_CHANNEL_DOMAIN_ISRAEL {0x03,0x09}, //0x08, RT_CHANNEL_DOMAIN_TELEC {0x03,0x00}, //0x09, RT_CHANNEL_DOMAIN_GLOBAL_DOAMIN -@@ -196,18 +208,17 @@ static RT_CHANNEL_PLAN_MAP RTW_ChannelPl +@@ -196,18 +208,17 @@ static RT_CHANNEL_PLAN_MAP RTW_ChannelPlanMap[RT_CHANNEL_DOMAIN_MAX] = { {0x01,0x12}, //0x12, RT_CHANNEL_DOMAIN_JAPAN_NO_DFS {0x00,0x04}, //0x13, RT_CHANNEL_DOMAIN_WORLD_WIDE_5G {0x02,0x10}, //0x14, RT_CHANNEL_DOMAIN_TAIWAN_NO_DFS @@ -10059,7 +10094,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release //===== 0x20 ~ 0x7F ,New Define ===== {0x00,0x00}, //0x20, RT_CHANNEL_DOMAIN_WORLD_NULL {0x01,0x00}, //0x21, RT_CHANNEL_DOMAIN_ETSI1_NULL -@@ -244,24 +255,44 @@ static RT_CHANNEL_PLAN_MAP RTW_ChannelPl +@@ -244,24 +255,44 @@ static RT_CHANNEL_PLAN_MAP RTW_ChannelPlanMap[RT_CHANNEL_DOMAIN_MAX] = { {0x02,0x10}, //0x40, RT_CHANNEL_DOMAIN_FCC1_NCC2 }; @@ -10117,7 +10152,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } /**************************************************************************** -@@ -286,20 +317,21 @@ static void init_mlme_ext_priv_value(_ad +@@ -286,20 +317,21 @@ static void init_mlme_ext_priv_value(_adapter* padapter) struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); @@ -10145,7 +10180,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release pmlmeext->retry = 0; pmlmeext->cur_wireless_mode = padapter->registrypriv.wireless_mode; -@@ -309,10 +341,14 @@ static void init_mlme_ext_priv_value(_ad +@@ -309,10 +341,14 @@ static void init_mlme_ext_priv_value(_adapter* padapter) _rtw_memcpy(pmlmeext->datarate, mixed_datarate, NumRates); _rtw_memcpy(pmlmeext->basicrate, mixed_basicrate, NumRates); @@ -10161,7 +10196,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release pmlmeext->scan_abort = _FALSE; pmlmeinfo->state = WIFI_FW_NULL_STATE; -@@ -333,6 +369,79 @@ static void init_mlme_ext_priv_value(_ad +@@ -333,6 +369,79 @@ static void init_mlme_ext_priv_value(_adapter* padapter) pmlmeinfo->preamble_mode = PREAMBLE_AUTO; pmlmeinfo->dialogToken = 0; @@ -10241,7 +10276,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } static u8 init_channel_set(_adapter* padapter, u8 ChannelPlan, RT_CHANNEL_INFO *channel_set) -@@ -407,7 +516,7 @@ static u8 init_channel_set(_adapter* pad +@@ -407,7 +516,7 @@ static u8 init_channel_set(_adapter* padapter, u8 ChannelPlan, RT_CHANNEL_INFO * if ( channel_set[chanset_size].ChannelNum <= 48 || channel_set[chanset_size].ChannelNum >= 149 ) { @@ -10250,7 +10285,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release channel_set[chanset_size].ScanType = SCAN_PASSIVE; else channel_set[chanset_size].ScanType = SCAN_ACTIVE; -@@ -421,7 +530,7 @@ static u8 init_channel_set(_adapter* pad +@@ -421,7 +530,7 @@ static u8 init_channel_set(_adapter* padapter, u8 ChannelPlan, RT_CHANNEL_INFO * if ( RTW_ChannelPlan5G[Index5G].Channel[index] <= 48 || RTW_ChannelPlan5G[Index5G].Channel[index] >= 149 ) { channel_set[chanset_size].ChannelNum = RTW_ChannelPlan5G[Index5G].Channel[index]; @@ -10259,7 +10294,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release channel_set[chanset_size].ScanType = SCAN_PASSIVE; else channel_set[chanset_size].ScanType = SCAN_ACTIVE; -@@ -460,10 +569,16 @@ int init_mlme_ext_priv(_adapter* padapte +@@ -460,10 +569,16 @@ int init_mlme_ext_priv(_adapter* padapter) #endif pmlmeext->max_chan_nums = init_channel_set(padapter, pmlmepriv->ChannelPlan,pmlmeext->channel_set); @@ -10277,7 +10312,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return res; } -@@ -483,69 +598,6 @@ void free_mlme_ext_priv (struct mlme_ext +@@ -483,69 +598,6 @@ void free_mlme_ext_priv (struct mlme_ext_priv *pmlmeext) } } @@ -10347,7 +10382,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release static u8 cmp_pkt_chnl_diff(_adapter *padapter,u8* pframe,uint packet_len) { // if the channel is same, return 0. else return channel differential uint len; -@@ -569,11 +621,11 @@ static u8 cmp_pkt_chnl_diff(_adapter *pa +@@ -569,11 +621,11 @@ static u8 cmp_pkt_chnl_diff(_adapter *padapter,u8* pframe,uint packet_len) return 0; } } @@ -10360,7 +10395,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if(ptable->func) { -@@ -593,10 +645,12 @@ void mgt_dispatcher(_adapter *padapter, +@@ -593,10 +645,12 @@ void mgt_dispatcher(_adapter *padapter, union recv_frame *precv_frame) { int index; struct mlme_handler *ptable; @@ -10374,7 +10409,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("+mgt_dispatcher: type(0x%x) subtype(0x%x)\n", -@@ -606,11 +660,11 @@ void mgt_dispatcher(_adapter *padapter, +@@ -606,11 +660,11 @@ void mgt_dispatcher(_adapter *padapter, union recv_frame *precv_frame) { u8 *pbuf; pbuf = GetAddr1Ptr(pframe); @@ -10389,7 +10424,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } #endif -@@ -633,13 +687,15 @@ void mgt_dispatcher(_adapter *padapter, +@@ -633,13 +687,15 @@ void mgt_dispatcher(_adapter *padapter, union recv_frame *precv_frame) #ifdef CONFIG_TDLS if((index << 4)==WIFI_ACTION){ @@ -10409,7 +10444,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if (index > 13) { -@@ -648,18 +704,19 @@ void mgt_dispatcher(_adapter *padapter, +@@ -648,18 +704,19 @@ void mgt_dispatcher(_adapter *padapter, union recv_frame *precv_frame) } ptable += index; @@ -10438,7 +10473,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } #else -@@ -723,7 +780,37 @@ void mgt_dispatcher(_adapter *padapter, +@@ -723,7 +780,37 @@ void mgt_dispatcher(_adapter *padapter, union recv_frame *precv_frame) #ifdef CONFIG_P2P u32 p2p_listen_state_process(_adapter *padapter, unsigned char *da) { @@ -10477,7 +10512,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return _SUCCESS; } #endif //CONFIG_P2P -@@ -750,6 +837,7 @@ unsigned int OnProbeReq(_adapter *padapt +@@ -750,6 +837,7 @@ unsigned int OnProbeReq(_adapter *padapter, union recv_frame *precv_frame) #ifdef CONFIG_P2P struct wifidirect_info *pwdinfo = &(padapter->wdinfo); struct rx_pkt_attrib *pattrib = &precv_frame->u.hdr.attrib; @@ -10485,7 +10520,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if ( !rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE) && !rtw_p2p_chk_state(pwdinfo, P2P_STATE_IDLE) && -@@ -764,7 +852,17 @@ unsigned int OnProbeReq(_adapter *padapt +@@ -764,7 +852,17 @@ unsigned int OnProbeReq(_adapter *padapter, union recv_frame *precv_frame) // mcs_rate = 2 -> CCK 5.5M rate // mcs_rate = 3 -> CCK 11M rate // In the P2P mode, the driver should not support the CCK rate @@ -10645,7 +10680,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } -@@ -857,7 +1080,6 @@ unsigned int OnProbeRsp(_adapter *padapt +@@ -857,7 +1080,6 @@ unsigned int OnProbeRsp(_adapter *padapter, union recv_frame *precv_frame) { pwdinfo->tx_prov_disc_info.benable = _FALSE; issue_p2p_provision_request( padapter, @@ -10653,7 +10688,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release pwdinfo->tx_prov_disc_info.ssid.Ssid, pwdinfo->tx_prov_disc_info.ssid.SsidLength, pwdinfo->tx_prov_disc_info.peerDevAddr ); -@@ -866,7 +1088,6 @@ unsigned int OnProbeRsp(_adapter *padapt +@@ -866,7 +1088,6 @@ unsigned int OnProbeRsp(_adapter *padapter, union recv_frame *precv_frame) { pwdinfo->tx_prov_disc_info.benable = _FALSE; issue_p2p_provision_request( padapter, @@ -10661,7 +10696,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release NULL, 0, pwdinfo->tx_prov_disc_info.peerDevAddr ); -@@ -887,12 +1108,30 @@ unsigned int OnProbeRsp(_adapter *padapt +@@ -887,12 +1108,30 @@ unsigned int OnProbeRsp(_adapter *padapter, union recv_frame *precv_frame) } } } @@ -10692,7 +10727,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return _SUCCESS; } -@@ -922,10 +1161,33 @@ unsigned int OnBeacon(_adapter *padapter +@@ -922,10 +1161,33 @@ unsigned int OnBeacon(_adapter *padapter, union recv_frame *precv_frame) struct sta_priv *pstapriv = &padapter->stapriv; u8 *pframe = precv_frame->u.hdr.rx_data; uint len = precv_frame->u.hdr.len; @@ -10726,7 +10761,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return _SUCCESS; } -@@ -935,6 +1197,10 @@ unsigned int OnBeacon(_adapter *padapter +@@ -935,6 +1197,10 @@ unsigned int OnBeacon(_adapter *padapter, union recv_frame *precv_frame) { //check the vendor of the assoc AP pmlmeinfo->assoc_AP_vendor = check_assoc_AP(pframe+sizeof(struct rtw_ieee80211_hdr_3addr), len-sizeof(struct rtw_ieee80211_hdr_3addr)); @@ -10737,7 +10772,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release //update TSF Value update_TSF(pmlmeext, pframe, len); -@@ -973,9 +1239,10 @@ unsigned int OnBeacon(_adapter *padapter +@@ -973,9 +1239,10 @@ unsigned int OnBeacon(_adapter *padapter, union recv_frame *precv_frame) process_csa_ie(padapter, pframe, len); //channel switch announcement #endif //CONFIG_DFS @@ -10750,7 +10785,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #if 0 //move to validate_recv_mgnt_frame psta->sta_stats.rx_mgnt_pkts++; -@@ -1045,6 +1312,16 @@ unsigned int OnAuth(_adapter *padapter, +@@ -1045,6 +1312,16 @@ unsigned int OnAuth(_adapter *padapter, union recv_frame *precv_frame) u8 *pframe = precv_frame->u.hdr.rx_data; uint len = precv_frame->u.hdr.len; @@ -10767,7 +10802,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if((pmlmeinfo->state&0x03) != WIFI_FW_AP_STATE) return _FAIL; -@@ -1053,8 +1330,8 @@ unsigned int OnAuth(_adapter *padapter, +@@ -1053,8 +1330,8 @@ unsigned int OnAuth(_adapter *padapter, union recv_frame *precv_frame) sa = GetAddr2Ptr(pframe); auth_mode = psecuritypriv->dot11AuthAlgrthm; @@ -10778,7 +10813,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if (GetPrivacy(pframe)) { -@@ -1096,7 +1373,7 @@ unsigned int OnAuth(_adapter *padapter, +@@ -1096,7 +1373,7 @@ unsigned int OnAuth(_adapter *padapter, union recv_frame *precv_frame) goto auth_fail; } @@ -10787,7 +10822,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release phead = &priv->wlan_acl_list; plist = phead->next; //check sa -@@ -1125,13 +1402,19 @@ unsigned int OnAuth(_adapter *padapter, +@@ -1125,13 +1402,19 @@ unsigned int OnAuth(_adapter *padapter, union recv_frame *precv_frame) RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,"auth abort because ACL!\n"); return FAIL; } @@ -10808,7 +10843,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release pstat = rtw_alloc_stainfo(pstapriv, sa); if (pstat == NULL) { -@@ -1152,6 +1435,7 @@ unsigned int OnAuth(_adapter *padapter, +@@ -1152,6 +1435,7 @@ unsigned int OnAuth(_adapter *padapter, union recv_frame *precv_frame) if(rtw_is_list_empty(&pstat->asoc_list)==_FALSE) { rtw_list_delete(&pstat->asoc_list); @@ -10816,7 +10851,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if (pstat->expire_to > 0) { //TODO: STA re_auth within expire_to -@@ -1168,6 +1452,7 @@ unsigned int OnAuth(_adapter *padapter, +@@ -1168,6 +1452,7 @@ unsigned int OnAuth(_adapter *padapter, union recv_frame *precv_frame) if (rtw_is_list_empty(&pstat->auth_list)) { rtw_list_insert_tail(&pstat->auth_list, &pstapriv->auth_list); @@ -10824,7 +10859,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } _exit_critical_bh(&pstapriv->auth_list_lock, &irqL); -@@ -1266,13 +1551,13 @@ unsigned int OnAuth(_adapter *padapter, +@@ -1266,13 +1551,13 @@ unsigned int OnAuth(_adapter *padapter, union recv_frame *precv_frame) auth_fail: @@ -10845,7 +10880,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #ifdef CONFIG_NATIVEAP_MLME issue_auth(padapter, pstat, (unsigned short)status); -@@ -1334,7 +1619,7 @@ unsigned int OnAuthClient(_adapter *pada +@@ -1334,7 +1619,7 @@ unsigned int OnAuthClient(_adapter *padapter, union recv_frame *precv_frame) if (p == NULL) { @@ -10854,7 +10889,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release goto authclnt_fail; } -@@ -1365,7 +1650,7 @@ unsigned int OnAuthClient(_adapter *pada +@@ -1365,7 +1650,7 @@ unsigned int OnAuthClient(_adapter *padapter, union recv_frame *precv_frame) else { // this is also illegal @@ -10863,7 +10898,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release goto authclnt_fail; } -@@ -1388,13 +1673,11 @@ unsigned int OnAssocReq(_adapter *padapt +@@ -1388,13 +1673,11 @@ unsigned int OnAssocReq(_adapter *padapter, union recv_frame *precv_frame) #ifdef CONFIG_AP_MODE _irqL irqL; u16 capab_info, listen_interval; @@ -10878,7 +10913,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release unsigned char supportRate[16]; int supportRateNum; unsigned short status = _STATS_SUCCESSFUL_; -@@ -1418,6 +1701,15 @@ unsigned int OnAssocReq(_adapter *padapt +@@ -1418,6 +1701,15 @@ unsigned int OnAssocReq(_adapter *padapter, union recv_frame *precv_frame) #endif // CONFIG_WFD #endif //CONFIG_P2P @@ -10894,7 +10929,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if((pmlmeinfo->state&0x03) != WIFI_FW_AP_STATE) return _FAIL; -@@ -1668,7 +1960,7 @@ unsigned int OnAssocReq(_adapter *padapt +@@ -1668,7 +1960,7 @@ unsigned int OnAssocReq(_adapter *padapter, union recv_frame *precv_frame) { u8 selected_registrar = 0; @@ -10903,7 +10938,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if(!selected_registrar) { -@@ -1709,7 +2001,7 @@ unsigned int OnAssocReq(_adapter *padapt +@@ -1709,7 +2001,7 @@ unsigned int OnAssocReq(_adapter *padapter, union recv_frame *precv_frame) copy_len = ((wpa_ie_len+2) > sizeof(pstat->wpa_ie)) ? (sizeof(pstat->wpa_ie)):(wpa_ie_len+2); } @@ -10912,7 +10947,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if(copy_len>0) _rtw_memcpy(pstat->wpa_ie, wpa_ie-2, copy_len); -@@ -1859,12 +2151,12 @@ unsigned int OnAssocReq(_adapter *padapt +@@ -1859,12 +2151,12 @@ unsigned int OnAssocReq(_adapter *padapter, union recv_frame *precv_frame) rtw_get_wfd_attr_content( wfd_ie, wfd_ielen, WFD_ATTR_DEVICE_INFO, attr_content, &attr_contentlen); if ( attr_contentlen ) { @@ -10928,7 +10963,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release pstat->p2p_status_code = p2p_status_code; #endif //CONFIG_P2P -@@ -1910,6 +2202,7 @@ unsigned int OnAssocReq(_adapter *padapt +@@ -1910,6 +2202,7 @@ unsigned int OnAssocReq(_adapter *padapter, union recv_frame *precv_frame) if (!rtw_is_list_empty(&pstat->auth_list)) { rtw_list_delete(&pstat->auth_list); @@ -10936,7 +10971,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } _exit_critical_bh(&pstapriv->auth_list_lock, &irqL); -@@ -1917,7 +2210,8 @@ unsigned int OnAssocReq(_adapter *padapt +@@ -1917,7 +2210,8 @@ unsigned int OnAssocReq(_adapter *padapter, union recv_frame *precv_frame) if (rtw_is_list_empty(&pstat->asoc_list)) { pstat->expire_to = pstapriv->expire_to; @@ -10946,7 +10981,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } _exit_critical_bh(&pstapriv->asoc_list_lock, &irqL); -@@ -1926,53 +2220,54 @@ unsigned int OnAssocReq(_adapter *padapt +@@ -1926,53 +2220,54 @@ unsigned int OnAssocReq(_adapter *padapter, union recv_frame *precv_frame) { #ifdef CONFIG_NATIVEAP_MLME //.1 bss_cap_update & sta_info_update @@ -11034,7 +11069,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #endif } -@@ -2011,6 +2306,7 @@ unsigned int OnAssocRsp(_adapter *padapt +@@ -2011,6 +2306,7 @@ unsigned int OnAssocRsp(_adapter *padapter, union recv_frame *precv_frame) int res; unsigned short status; PNDIS_802_11_VARIABLE_IEs pIE; @@ -11042,7 +11077,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); //WLAN_BSSID_EX *cur_network = &(pmlmeinfo->network); -@@ -2063,13 +2359,13 @@ unsigned int OnAssocRsp(_adapter *padapt +@@ -2063,13 +2359,13 @@ unsigned int OnAssocRsp(_adapter *padapter, union recv_frame *precv_frame) { WMM_param_handler(padapter, pIE); } @@ -11059,7 +11094,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release break; case _HT_CAPABILITY_IE_: //HT caps -@@ -2096,10 +2392,22 @@ unsigned int OnAssocRsp(_adapter *padapt +@@ -2096,10 +2392,22 @@ unsigned int OnAssocRsp(_adapter *padapter, union recv_frame *precv_frame) //Update Basic Rate Table for spec, 2010-12-28 , by thomas UpdateBrateTbl(padapter, pmlmeinfo->network.SupportedRates); @@ -11083,7 +11118,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return _SUCCESS; } -@@ -2110,11 +2418,22 @@ unsigned int OnDeAuth(_adapter *padapter +@@ -2110,11 +2418,22 @@ unsigned int OnDeAuth(_adapter *padapter, union recv_frame *precv_frame) struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); u8 *pframe = precv_frame->u.hdr.rx_data; @@ -11106,7 +11141,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release reason = le16_to_cpu(*(unsigned short *)(pframe + WLAN_HDR_A3_LEN)); DBG_871X("%s Reason code(%d)\n", __FUNCTION__,reason); -@@ -2128,48 +2447,87 @@ unsigned int OnDeAuth(_adapter *padapter +@@ -2128,31 +2447,59 @@ unsigned int OnDeAuth(_adapter *padapter, union recv_frame *precv_frame) //_enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL); //rtw_free_stainfo(padapter, psta); @@ -11145,13 +11180,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - - receive_disconnect(padapter, GetAddr3Ptr(pframe) ,reason); - } -- pmlmepriv->LinkDetectInfo.bBusyTraffic = _FALSE; -- return _SUCCESS; -- --} + int ignore_received_deauth = 0; - --unsigned int OnDisassoc(_adapter *padapter, union recv_frame *precv_frame) ++ + // Commented by Albert 20130604 + // Before sending the auth frame to start the STA/GC mode connection with AP/GO, + // we will send the deauth first. @@ -11175,15 +11205,10 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + receive_disconnect(padapter, GetAddr3Ptr(pframe) ,reason); + } + } -+ pmlmepriv->LinkDetectInfo.bBusyTraffic = _FALSE; -+ return _SUCCESS; -+ -+} -+ -+unsigned int OnDisassoc(_adapter *padapter, union recv_frame *precv_frame) - { - unsigned short reason; - struct mlme_priv *pmlmepriv = &padapter->mlmepriv; + pmlmepriv->LinkDetectInfo.bBusyTraffic = _FALSE; + return _SUCCESS; + +@@ -2165,11 +2512,22 @@ unsigned int OnDisassoc(_adapter *padapter, union recv_frame *precv_frame) struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); u8 *pframe = precv_frame->u.hdr.rx_data; @@ -11206,7 +11231,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release reason = le16_to_cpu(*(unsigned short *)(pframe + WLAN_HDR_A3_LEN)); DBG_871X("%s Reason code(%d)\n", __FUNCTION__,reason); -@@ -2183,21 +2541,26 @@ unsigned int OnDisassoc(_adapter *padapt +@@ -2183,21 +2541,26 @@ unsigned int OnDisassoc(_adapter *padapter, union recv_frame *precv_frame) //_enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL); //rtw_free_stainfo(padapter, psta); @@ -11236,7 +11261,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } return _SUCCESS; -@@ -2220,6 +2583,107 @@ unsigned int OnAtim(_adapter *padapter, +@@ -2220,6 +2583,107 @@ unsigned int OnAtim(_adapter *padapter, union recv_frame *precv_frame) return _SUCCESS; } @@ -11344,7 +11369,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release unsigned int OnAction_qos(_adapter *padapter, union recv_frame *precv_frame) { return _SUCCESS; -@@ -2242,8 +2706,6 @@ unsigned int OnAction_back(_adapter *pad +@@ -2242,8 +2706,6 @@ unsigned int OnAction_back(_adapter *padapter, union recv_frame *precv_frame) struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); u8 *pframe = precv_frame->u.hdr.rx_data; struct sta_priv *pstapriv = &padapter->stapriv; @@ -11353,7 +11378,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release //check RA matches or not if (!_rtw_memcmp(myid(&(padapter->eeprompriv)), GetAddr1Ptr(pframe), ETH_ALEN))//for if1, sta/ap mode -@@ -2271,6 +2733,15 @@ unsigned int OnAction_back(_adapter *pad +@@ -2271,6 +2733,15 @@ unsigned int OnAction_back(_adapter *padapter, union recv_frame *precv_frame) category = frame_body[0]; if (category == RTW_WLAN_CATEGORY_BACK)// representing Block Ack { @@ -11369,7 +11394,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if (!pmlmeinfo->HT_enable) { return _SUCCESS; -@@ -2314,7 +2785,7 @@ unsigned int OnAction_back(_adapter *pad +@@ -2314,7 +2785,7 @@ unsigned int OnAction_back(_adapter *padapter, union recv_frame *precv_frame) psta->htpriv.agg_enable_bitmap &= ~BIT(tid); } @@ -11378,7 +11403,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release break; case RTW_WLAN_ACTION_DELBA: //DELBA -@@ -2339,7 +2810,7 @@ unsigned int OnAction_back(_adapter *pad +@@ -2339,7 +2810,7 @@ unsigned int OnAction_back(_adapter *padapter, union recv_frame *precv_frame) #endif } @@ -11387,7 +11412,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release //todo: how to notify the host while receiving DELETE BA break; -@@ -2352,6 +2823,45 @@ unsigned int OnAction_back(_adapter *pad +@@ -2352,6 +2823,45 @@ unsigned int OnAction_back(_adapter *padapter, union recv_frame *precv_frame) } #ifdef CONFIG_P2P @@ -11433,7 +11458,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release void issue_p2p_GO_request(_adapter *padapter, u8* raddr) { -@@ -2361,10 +2871,11 @@ void issue_p2p_GO_request(_adapter *pada +@@ -2361,10 +2871,11 @@ void issue_p2p_GO_request(_adapter *padapter, u8* raddr) u8 oui_subtype = P2P_GO_NEGO_REQ; u8 wpsie[ 255 ] = { 0x00 }, p2pie[ 255 ] = { 0x00 }; u8 wpsielen = 0, p2pielen = 0, i; @@ -11447,7 +11472,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release struct xmit_frame *pmgntframe; struct pkt_attrib *pattrib; -@@ -2382,7 +2893,7 @@ void issue_p2p_GO_request(_adapter *pada +@@ -2382,7 +2893,7 @@ void issue_p2p_GO_request(_adapter *padapter, u8* raddr) return; } @@ -11456,7 +11481,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release //update attribute pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); -@@ -2494,12 +3005,18 @@ void issue_p2p_GO_request(_adapter *pada +@@ -2494,12 +3005,18 @@ void issue_p2p_GO_request(_adapter *padapter, u8* raddr) // Value: // Device Capability Bitmap, 1 byte @@ -11480,7 +11505,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release // Group Owner Intent // Type: -@@ -2536,8 +3053,8 @@ void issue_p2p_GO_request(_adapter *pada +@@ -2536,8 +3053,8 @@ void issue_p2p_GO_request(_adapter *padapter, u8* raddr) // Value: // Country String @@ -11491,7 +11516,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release // The third byte should be set to 0x04. // Described in the "Operating Channel Attribute" section. -@@ -2585,33 +3102,104 @@ void issue_p2p_GO_request(_adapter *pada +@@ -2585,33 +3102,104 @@ void issue_p2p_GO_request(_adapter *padapter, u8* raddr) // Type: p2pie[ p2pielen++ ] = P2P_ATTR_CH_LIST; @@ -11609,7 +11634,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release // Device Info // Type: -@@ -2637,7 +3225,7 @@ void issue_p2p_GO_request(_adapter *pada +@@ -2637,7 +3225,7 @@ void issue_p2p_GO_request(_adapter *padapter, u8* raddr) // Primary Device Type // Category ID @@ -11618,7 +11643,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release p2pielen += 2; // OUI -@@ -2645,7 +3233,7 @@ void issue_p2p_GO_request(_adapter *pada +@@ -2645,7 +3233,7 @@ void issue_p2p_GO_request(_adapter *padapter, u8* raddr) p2pielen += 4; // Sub Category ID @@ -11627,7 +11652,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release p2pielen += 2; // Number of Secondary Device Types -@@ -2675,16 +3263,30 @@ void issue_p2p_GO_request(_adapter *pada +@@ -2675,16 +3263,30 @@ void issue_p2p_GO_request(_adapter *padapter, u8* raddr) // Value: // Country String @@ -11662,7 +11687,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release // Channel Number p2pie[ p2pielen++ ] = pwdinfo->operating_channel; // operating channel number -@@ -2717,10 +3319,8 @@ void issue_p2p_GO_response(_adapter *pad +@@ -2717,10 +3319,8 @@ void issue_p2p_GO_response(_adapter *padapter, u8* raddr, u8* frame_body,uint le uint wpsielen = 0; u16 wps_devicepassword_id = 0x0000; uint wps_devicepassword_id_len = 0; @@ -11675,7 +11700,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release struct xmit_frame *pmgntframe; struct pkt_attrib *pattrib; -@@ -2732,13 +3332,16 @@ void issue_p2p_GO_response(_adapter *pad +@@ -2732,13 +3332,16 @@ void issue_p2p_GO_response(_adapter *padapter, u8* raddr, u8* frame_body,uint le struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); struct wifidirect_info *pwdinfo = &( padapter->wdinfo); @@ -11693,7 +11718,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release //update attribute pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); -@@ -2839,7 +3442,7 @@ void issue_p2p_GO_response(_adapter *pad +@@ -2839,7 +3442,7 @@ void issue_p2p_GO_response(_adapter *padapter, u8* raddr, u8* frame_body,uint le _rtw_memcpy( pwdinfo->rx_prov_disc_info.strconfig_method_desc_of_prov_disc_req, "pbc", 3 ); } } @@ -11702,7 +11727,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, wpsielen, (unsigned char *) wpsie, &pattrib->pktlen ); -@@ -2899,13 +3502,18 @@ void issue_p2p_GO_response(_adapter *pad +@@ -2899,13 +3502,18 @@ void issue_p2p_GO_response(_adapter *padapter, u8* raddr, u8* frame_body,uint le else { // Be group owner or meet the error case @@ -11725,7 +11750,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release // Group Owner Intent // Type: -@@ -2950,15 +3558,29 @@ void issue_p2p_GO_response(_adapter *pad +@@ -2950,15 +3558,29 @@ void issue_p2p_GO_response(_adapter *padapter, u8* raddr, u8* frame_body,uint le // Value: // Country String @@ -11758,7 +11783,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release // Channel Number p2pie[ p2pielen++ ] = pwdinfo->operating_channel; // operating channel number -@@ -2979,33 +3601,103 @@ void issue_p2p_GO_response(_adapter *pad +@@ -2979,33 +3601,103 @@ void issue_p2p_GO_response(_adapter *padapter, u8* raddr, u8* frame_body,uint le // Type: p2pie[ p2pielen++ ] = P2P_ATTR_CH_LIST; @@ -11839,7 +11864,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + p2pie[ p2pielen++ ] = pbuddy_mlmeext->cur_channel; + } + else -+ { + { +- p2pie[ p2pielen++ ] = pmlmeext->channel_set[ i ].ChannelNum; + int i, j; + for (j = 0; j < pmlmeext->channel_list.reg_classes; j++) { + // Operating Class @@ -11855,8 +11881,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + } + } +#else // CONFIG_CONCURRENT_MODE - { -- p2pie[ p2pielen++ ] = pmlmeext->channel_set[ i ].ChannelNum; ++ { + int i, j; + for (j = 0; j < pmlmeext->channel_list.reg_classes; j++) { + // Operating Class @@ -11875,7 +11900,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release // Device Info // Type: -@@ -3031,7 +3723,7 @@ void issue_p2p_GO_response(_adapter *pad +@@ -3031,7 +3723,7 @@ void issue_p2p_GO_response(_adapter *padapter, u8* raddr, u8* frame_body,uint le // Primary Device Type // Category ID @@ -11884,7 +11909,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release p2pielen += 2; // OUI -@@ -3039,7 +3731,7 @@ void issue_p2p_GO_response(_adapter *pad +@@ -3039,7 +3731,7 @@ void issue_p2p_GO_response(_adapter *padapter, u8* raddr, u8* frame_body,uint le p2pielen += 4; // Sub Category ID @@ -11893,7 +11918,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release p2pielen += 2; // Number of Secondary Device Types -@@ -3080,12 +3772,12 @@ void issue_p2p_GO_response(_adapter *pad +@@ -3080,12 +3772,12 @@ void issue_p2p_GO_response(_adapter *padapter, u8* raddr, u8* frame_body,uint le } pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, p2pielen, (unsigned char *) p2pie, &pattrib->pktlen ); @@ -11908,7 +11933,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release pattrib->last_txcmdsz = pattrib->pktlen; -@@ -3104,9 +3796,6 @@ void issue_p2p_GO_confirm(_adapter *pada +@@ -3104,9 +3796,6 @@ void issue_p2p_GO_confirm(_adapter *padapter, u8* raddr, u8 result) u8 oui_subtype = P2P_GO_NEGO_CONF; u8 wpsie[ 255 ] = { 0x00 }, p2pie[ 255 ] = { 0x00 }; u8 wpsielen = 0, p2pielen = 0; @@ -11918,7 +11943,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release struct xmit_frame *pmgntframe; struct pkt_attrib *pattrib; -@@ -3117,14 +3806,16 @@ void issue_p2p_GO_confirm(_adapter *pada +@@ -3117,14 +3806,16 @@ void issue_p2p_GO_confirm(_adapter *padapter, u8* raddr, u8 result) struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); struct wifidirect_info *pwdinfo = &( padapter->wdinfo); @@ -11937,7 +11962,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release //update attribute pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); -@@ -3194,12 +3885,17 @@ void issue_p2p_GO_confirm(_adapter *pada +@@ -3194,12 +3885,17 @@ void issue_p2p_GO_confirm(_adapter *padapter, u8* raddr, u8 result) // Value: // Device Capability Bitmap, 1 byte @@ -11959,7 +11984,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release // Operating Channel -@@ -3212,24 +3908,54 @@ void issue_p2p_GO_confirm(_adapter *pada +@@ -3212,22 +3908,52 @@ void issue_p2p_GO_confirm(_adapter *padapter, u8* raddr, u8 result) // Value: // Country String @@ -11977,12 +12002,6 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if ( rtw_p2p_chk_role(pwdinfo, P2P_ROLE_CLIENT) ) { -- p2pie[ p2pielen++ ] = pwdinfo->peer_operating_ch; -- } -- else -- { -- // Channel Number -- p2pie[ p2pielen++ ] = pwdinfo->operating_channel; // Use the listen channel as the operating channel + if ( pwdinfo->peer_operating_ch <= 14 ) + { + // Operating Class @@ -11999,10 +12018,10 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + p2pie[ p2pielen++ ] = 0x7c; + } + -+ p2pie[ p2pielen++ ] = pwdinfo->peer_operating_ch; -+ } -+ else -+ { + p2pie[ p2pielen++ ] = pwdinfo->peer_operating_ch; + } + else + { + if ( pwdinfo->operating_channel <= 14 ) + { + // Operating Class @@ -12019,12 +12038,10 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + p2pie[ p2pielen++ ] = 0x7c; + } + -+ // Channel Number -+ p2pie[ p2pielen++ ] = pwdinfo->operating_channel; // Use the listen channel as the operating channel + // Channel Number + p2pie[ p2pielen++ ] = pwdinfo->operating_channel; // Use the listen channel as the operating channel } - - -@@ -3237,29 +3963,60 @@ void issue_p2p_GO_confirm(_adapter *pada +@@ -3237,29 +3963,60 @@ void issue_p2p_GO_confirm(_adapter *padapter, u8* raddr, u8 result) // Type: p2pie[ p2pielen++ ] = P2P_ATTR_CH_LIST; @@ -12100,7 +12117,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if (rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO) ) { -@@ -3282,12 +4039,12 @@ void issue_p2p_GO_confirm(_adapter *pada +@@ -3282,12 +4039,12 @@ void issue_p2p_GO_confirm(_adapter *padapter, u8* raddr, u8 result) } pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, p2pielen, (unsigned char *) p2pie, &pattrib->pktlen ); @@ -12115,7 +12132,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release pattrib->last_txcmdsz = pattrib->pktlen; -@@ -3305,9 +4062,20 @@ void issue_p2p_invitation_request(_adapt +@@ -3305,9 +4062,20 @@ void issue_p2p_invitation_request(_adapter *padapter, u8* raddr ) u32 p2poui = cpu_to_be32(P2POUI); u8 oui_subtype = P2P_INVIT_REQ; u8 p2pie[ 255 ] = { 0x00 }; @@ -12138,7 +12155,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release struct xmit_frame *pmgntframe; struct pkt_attrib *pattrib; unsigned char *pframe; -@@ -3367,7 +4135,7 @@ void issue_p2p_invitation_request(_adapt +@@ -3367,7 +4135,7 @@ void issue_p2p_invitation_request(_adapter *padapter, u8* raddr ) // 1. Configuration Timeout // 2. Invitation Flags // 3. Operating Channel ( Only GO ) @@ -12147,7 +12164,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release // 5. Channel List // 6. P2P Group ID // 7. P2P Device Info -@@ -3396,42 +4164,153 @@ void issue_p2p_invitation_request(_adapt +@@ -3396,42 +4164,153 @@ void issue_p2p_invitation_request(_adapter *padapter, u8* raddr ) p2pie[ p2pielen++ ] = P2P_INVITATION_FLAGS_PERSISTENT; @@ -12185,15 +12202,15 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + + // Channel Number + p2pie[ p2pielen++ ] = pwdinfo->invitereq_info.operating_ch; // operating channel number -+ + +- // Number of Channels +- p2pie[ p2pielen++ ] = 0x0B; // support channel 1 - 11 + if ( _rtw_memcmp( myid( &padapter->eeprompriv ), pwdinfo->invitereq_info.go_bssid, ETH_ALEN ) ) + { + // P2P Group BSSID + // Type: + p2pie[ p2pielen++ ] = P2P_ATTR_GROUP_BSSID; - -- // Number of Channels -- p2pie[ p2pielen++ ] = 0x0B; // support channel 1 - 11 ++ + // Length: + *(u16*) ( p2pie + p2pielen ) = cpu_to_le16( ETH_ALEN ); + p2pielen += 2; @@ -12320,7 +12337,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release // P2P Group ID // Type: -@@ -3443,11 +4322,11 @@ void issue_p2p_invitation_request(_adapt +@@ -3443,11 +4322,11 @@ void issue_p2p_invitation_request(_adapter *padapter, u8* raddr ) // Value: // P2P Device Address for GO @@ -12334,7 +12351,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release p2pielen += pwdinfo->invitereq_info.ssidlen; -@@ -3473,7 +4352,7 @@ void issue_p2p_invitation_request(_adapt +@@ -3473,7 +4352,7 @@ void issue_p2p_invitation_request(_adapter *padapter, u8* raddr ) // Primary Device Type // Category ID @@ -12343,7 +12360,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release p2pielen += 2; // OUI -@@ -3481,7 +4360,7 @@ void issue_p2p_invitation_request(_adapt +@@ -3481,7 +4360,7 @@ void issue_p2p_invitation_request(_adapter *padapter, u8* raddr ) p2pielen += 4; // Sub Category ID @@ -12352,7 +12369,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release p2pielen += 2; // Number of Secondary Device Types -@@ -3501,7 +4380,12 @@ void issue_p2p_invitation_request(_adapt +@@ -3501,7 +4380,12 @@ void issue_p2p_invitation_request(_adapter *padapter, u8* raddr ) p2pielen += pwdinfo->device_name_len; pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, p2pielen, (unsigned char *) p2pie, &pattrib->pktlen ); @@ -12366,7 +12383,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release pattrib->last_txcmdsz = pattrib->pktlen; -@@ -3511,7 +4395,7 @@ void issue_p2p_invitation_request(_adapt +@@ -3511,7 +4395,7 @@ void issue_p2p_invitation_request(_adapter *padapter, u8* raddr ) } @@ -12375,7 +12392,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { unsigned char category = RTW_WLAN_CATEGORY_PUBLIC; -@@ -3519,7 +4403,18 @@ void issue_p2p_invitation_response(_adap +@@ -3519,7 +4403,18 @@ void issue_p2p_invitation_response(_adapter *padapter, u8* raddr, u8 dialogToken u32 p2poui = cpu_to_be32(P2POUI); u8 oui_subtype = P2P_INVIT_RESP; u8 p2pie[ 255 ] = { 0x00 }; @@ -12395,7 +12412,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release struct xmit_frame *pmgntframe; struct pkt_attrib *pattrib; -@@ -3592,19 +4487,13 @@ void issue_p2p_invitation_response(_adap +@@ -3592,19 +4487,13 @@ void issue_p2p_invitation_response(_adapter *padapter, u8* raddr, u8 dialogToken p2pielen += 2; // Value: @@ -12422,7 +12439,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release // Configuration Timeout // Type: -@@ -3618,49 +4507,164 @@ void issue_p2p_invitation_response(_adap +@@ -3618,49 +4507,164 @@ void issue_p2p_invitation_response(_adapter *padapter, u8* raddr, u8 dialogToken p2pie[ p2pielen++ ] = 200; // 2 seconds needed to be the P2P GO p2pie[ p2pielen++ ] = 200; // 2 seconds needed to be the P2P Client @@ -12609,7 +12626,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release pattrib->last_txcmdsz = pattrib->pktlen; -@@ -3670,7 +4674,7 @@ void issue_p2p_invitation_response(_adap +@@ -3670,7 +4674,7 @@ void issue_p2p_invitation_response(_adapter *padapter, u8* raddr, u8 dialogToken } @@ -12618,7 +12635,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { unsigned char category = RTW_WLAN_CATEGORY_PUBLIC; u8 action = P2P_PUB_ACTION_ACTION; -@@ -3700,7 +4704,7 @@ void issue_p2p_provision_request(_adapte +@@ -3700,7 +4704,7 @@ void issue_p2p_provision_request(_adapter *padapter, u8* pinterface_raddr, u8* p return; } @@ -12627,7 +12644,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release //update attribute pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); -@@ -3713,10 +4717,9 @@ void issue_p2p_provision_request(_adapte +@@ -3713,10 +4717,9 @@ void issue_p2p_provision_request(_adapter *padapter, u8* pinterface_raddr, u8* p fctrl = &(pwlanhdr->frame_ctl); *(fctrl) = 0; @@ -12640,7 +12657,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); pmlmeext->mgnt_seq++; -@@ -3783,21 +4786,22 @@ void issue_p2p_provision_request(_adapte +@@ -3783,21 +4786,22 @@ void issue_p2p_provision_request(_adapter *padapter, u8* pinterface_raddr, u8* p } @@ -12666,7 +12683,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release break; } } -@@ -3816,6 +4820,7 @@ void issue_probersp_p2p(_adapter *padapt +@@ -3816,6 +4820,7 @@ void issue_probersp_p2p(_adapter *padapter, unsigned char *da) struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); @@ -12674,7 +12691,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release //WLAN_BSSID_EX *cur_network = &(pmlmeinfo->network); u16 beacon_interval = 100; u16 capInfo = 0; -@@ -3825,13 +4830,10 @@ void issue_probersp_p2p(_adapter *padapt +@@ -3825,13 +4830,10 @@ void issue_probersp_p2p(_adapter *padapter, unsigned char *da) #ifdef CONFIG_WFD u32 wfdielen = 0; #endif //CONFIG_WFD @@ -12692,7 +12709,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release //DBG_871X("%s\n", __FUNCTION__); if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) -@@ -3893,20 +4895,10 @@ void issue_probersp_p2p(_adapter *padapt +@@ -3893,20 +4895,10 @@ void issue_probersp_p2p(_adapter *padapter, unsigned char *da) pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_, 8, pwdinfo->support_rate, &pattrib->pktlen); // DS parameter set @@ -12715,7 +12732,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { if( pmlmepriv->wps_probe_resp_ie != NULL && pmlmepriv->p2p_probe_resp_ie != NULL ) { -@@ -3922,7 +4914,7 @@ void issue_probersp_p2p(_adapter *padapt +@@ -3922,7 +4914,7 @@ void issue_probersp_p2p(_adapter *padapter, unsigned char *da) } } else @@ -12724,10 +12741,13 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { // Todo: WPS IE -@@ -3946,6 +4938,41 @@ void issue_probersp_p2p(_adapter *padapt +@@ -3946,9 +4938,44 @@ void issue_probersp_p2p(_adapter *padapter, unsigned char *da) // Value: wpsie[wpsielen++] = WPS_VERSION_1; // Version 1.0 +- // WiFi Simple Config State +- // Type: +- *(u16*) ( wpsie + wpsielen ) = cpu_to_be16( WPS_ATTR_SIMPLE_CONF_STATE ); +#ifdef CONFIG_INTEL_WIDI + // Commented by Kurt + // Appended WiDi info. only if we did issued_probereq_widi(), and then we saved ven. ext. in pmlmepriv->sa_ext. @@ -12763,10 +12783,13 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + } +#endif //CONFIG_INTEL_WIDI + - // WiFi Simple Config State - // Type: - *(u16*) ( wpsie + wpsielen ) = cpu_to_be16( WPS_ATTR_SIMPLE_CONF_STATE ); -@@ -3980,7 +5007,12 @@ void issue_probersp_p2p(_adapter *padapt ++ // WiFi Simple Config State ++ // Type: ++ *(u16*) ( wpsie + wpsielen ) = cpu_to_be16( WPS_ATTR_SIMPLE_CONF_STATE ); + wpsielen += 2; + + // Length: +@@ -3980,7 +5007,12 @@ void issue_probersp_p2p(_adapter *padapter, unsigned char *da) wpsielen += 2; // Value: @@ -12780,7 +12803,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release wpsielen += 0x10; // Manufacturer -@@ -4081,7 +5113,7 @@ void issue_probersp_p2p(_adapter *padapt +@@ -4081,7 +5113,7 @@ void issue_probersp_p2p(_adapter *padapter, unsigned char *da) // Value: *(u16*) ( wpsie + wpsielen ) = cpu_to_be16( pwdinfo->supported_wps_cm ); wpsielen += 2; @@ -12789,7 +12812,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, wpsielen, (unsigned char *) wpsie, &pattrib->pktlen ); -@@ -4092,10 +5124,24 @@ void issue_probersp_p2p(_adapter *padapt +@@ -4092,10 +5124,24 @@ void issue_probersp_p2p(_adapter *padapter, unsigned char *da) } #ifdef CONFIG_WFD @@ -12818,7 +12841,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release pattrib->last_txcmdsz = pattrib->pktlen; -@@ -4106,8 +5152,9 @@ void issue_probersp_p2p(_adapter *padapt +@@ -4106,8 +5152,9 @@ void issue_probersp_p2p(_adapter *padapter, unsigned char *da) } @@ -12829,7 +12852,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release struct xmit_frame *pmgntframe; struct pkt_attrib *pattrib; unsigned char *pframe; -@@ -4126,12 +5173,13 @@ void issue_probereq_p2p(_adapter *padapt +@@ -4126,12 +5173,13 @@ void issue_probereq_p2p(_adapter *padapter) #ifdef CONFIG_WFD u32 wfdielen = 0; #endif //CONFIG_WFD @@ -12846,7 +12869,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } //update attribute -@@ -4149,9 +5197,23 @@ void issue_probereq_p2p(_adapter *padapt +@@ -4149,9 +5197,23 @@ void issue_probereq_p2p(_adapter *padapter) fctrl = &(pwlanhdr->frame_ctl); *(fctrl) = 0; @@ -12873,7 +12896,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release _rtw_memcpy(pwlanhdr->addr2, mac, ETH_ALEN); SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); -@@ -4168,14 +5230,14 @@ void issue_probereq_p2p(_adapter *padapt +@@ -4168,14 +5230,14 @@ void issue_probereq_p2p(_adapter *padapter) else { pframe = rtw_set_ie(pframe, _SSID_IE_, P2P_WILDCARD_SSID_LEN, pwdinfo->p2p_wildcard_ssid, &(pattrib->pktlen)); @@ -12891,7 +12914,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { //WPS IE _rtw_memcpy(pframe, pmlmepriv->wps_probe_req_ie, pmlmepriv->wps_probe_req_ie_len); -@@ -4213,6 +5275,40 @@ void issue_probereq_p2p(_adapter *padapt +@@ -4213,6 +5275,40 @@ void issue_probereq_p2p(_adapter *padapter) // Value: wpsie[wpsielen++] = WPS_VERSION_1; // Version 1.0 @@ -12932,7 +12955,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release // Device Name // Type: *(u16*) ( wpsie + wpsielen ) = cpu_to_be16( WPS_ATTR_DEVICE_NAME ); -@@ -4237,7 +5333,7 @@ void issue_probereq_p2p(_adapter *padapt +@@ -4237,7 +5333,7 @@ void issue_probereq_p2p(_adapter *padapter) // Value: // Category ID @@ -12941,7 +12964,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release wpsielen += 2; // OUI -@@ -4245,7 +5341,20 @@ void issue_probereq_p2p(_adapter *padapt +@@ -4245,7 +5341,20 @@ void issue_probereq_p2p(_adapter *padapter) wpsielen += 4; // Sub Category ID @@ -12963,7 +12986,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release wpsielen += 2; pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, wpsielen, (unsigned char *) wpsie, &pattrib->pktlen ); -@@ -4275,12 +5384,13 @@ void issue_probereq_p2p(_adapter *padapt +@@ -4275,12 +5384,13 @@ void issue_probereq_p2p(_adapter *padapter) // Value: // Device Capability Bitmap, 1 byte @@ -12981,7 +13004,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release // Listen Channel // Type: -@@ -4292,8 +5402,8 @@ void issue_probereq_p2p(_adapter *padapt +@@ -4292,8 +5402,8 @@ void issue_probereq_p2p(_adapter *padapter) // Value: // Country String @@ -12992,7 +13015,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release // The third byte should be set to 0x04. // Described in the "Operating Channel Attribute" section. -@@ -4335,8 +5445,8 @@ void issue_probereq_p2p(_adapter *padapt +@@ -4335,8 +5445,8 @@ void issue_probereq_p2p(_adapter *padapter) // Value: // Country String @@ -13003,7 +13026,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release // The third byte should be set to 0x04. // Described in the "Operating Channel Attribute" section. -@@ -4349,283 +5459,702 @@ void issue_probereq_p2p(_adapter *padapt +@@ -4349,283 +5459,702 @@ void issue_probereq_p2p(_adapter *padapter) p2pie[ p2pielen++ ] = pwdinfo->operating_channel; // operating channel number } @@ -13455,6 +13478,14 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + // After having the peer interface address, the sigma can find the correct conf file for wpa_supplicant. + + if ( attr_contentlen ) ++ { ++ DBG_871X( "[%s] GO's BSSID = %.2X %.2X %.2X %.2X %.2X %.2X\n", __FUNCTION__, ++ pwdinfo->p2p_peer_interface_addr[0], pwdinfo->p2p_peer_interface_addr[1], ++ pwdinfo->p2p_peer_interface_addr[2], pwdinfo->p2p_peer_interface_addr[3], ++ pwdinfo->p2p_peer_interface_addr[4], pwdinfo->p2p_peer_interface_addr[5] ); ++ } ++ ++ if ( invitation_flag & P2P_INVITATION_FLAGS_PERSISTENT ) { - // Parse the necessary information from the P2P Invitation Request frame. - // For example: The MAC address of sending this P2P Invitation Request frame. @@ -13467,15 +13498,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - rtw_p2p_set_state(pwdinfo, P2P_STATE_RECV_INVITE_REQ); - DBG_871X( "[%s] peer address %.2X %.2X %.2X %.2X %.2X %.2X\n", __FUNCTION__, - groupid[0], groupid[1], groupid[2], groupid[3], groupid[4], groupid[5] ); -+ DBG_871X( "[%s] GO's BSSID = %.2X %.2X %.2X %.2X %.2X %.2X\n", __FUNCTION__, -+ pwdinfo->p2p_peer_interface_addr[0], pwdinfo->p2p_peer_interface_addr[1], -+ pwdinfo->p2p_peer_interface_addr[2], pwdinfo->p2p_peer_interface_addr[3], -+ pwdinfo->p2p_peer_interface_addr[4], pwdinfo->p2p_peer_interface_addr[5] ); -+ } - +- - if ( is_matched_in_profilelist( pwdinfo->p2p_peer_interface_addr, &pwdinfo->profileinfo[ 0 ] ) ) -+ if ( invitation_flag & P2P_INVITATION_FLAGS_PERSISTENT ) -+ { + // Re-invoke the persistent group. + + _rtw_memset( &group_id, 0x00, sizeof( struct group_id_info ) ); @@ -13618,9 +13642,11 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + DBG_871X( "[%s] P2P Invitation Flags Attribute NOT FOUND!\n", __FUNCTION__ ); + status_code = P2P_STATUS_FAIL_INFO_UNAVAILABLE; + } -+ + +- process_p2p_devdisc_req(pwdinfo, pframe, len); + DBG_871X( "[%s] status_code = %d\n", __FUNCTION__, status_code ); -+ + +- break; + pwdinfo->inviteresp_info.token = frame_body[ 7 ]; + issue_p2p_invitation_response( padapter, GetAddr2Ptr(pframe), pwdinfo->inviteresp_info.token, status_code ); + _set_timer( &pwdinfo->restore_p2p_state_timer, 3000 ); @@ -13650,8 +13676,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + { + DBG_871X( "[%s] Status = %d\n", __FUNCTION__, attr_content ); + pwdinfo->invitereq_info.benable = _FALSE; - -- process_p2p_devdisc_req(pwdinfo, pframe, len); ++ + if ( attr_content == P2P_STATUS_SUCCESS ) + { + if ( _rtw_memcmp( pwdinfo->invitereq_info.go_bssid, myid( &padapter->eeprompriv ), ETH_ALEN )) @@ -13682,7 +13707,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + rtw_p2p_set_state( pwdinfo, P2P_STATE_RX_INVITE_RESP_FAIL ); + } -- break; +- case P2P_DEVDISC_RESP: + if ( rtw_p2p_chk_state( pwdinfo, P2P_STATE_RX_INVITE_RESP_FAIL ) ) + { + _set_timer( &pwdinfo->restore_p2p_state_timer, 5000 ); @@ -13691,20 +13716,18 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + } + case P2P_DEVDISC_REQ: -- case P2P_DEVDISC_RESP: -+ process_p2p_devdisc_req(pwdinfo, pframe, len); - - process_p2p_devdisc_resp(pwdinfo, pframe, len); -+ break; ++ process_p2p_devdisc_req(pwdinfo, pframe, len); - break; -+ case P2P_DEVDISC_RESP: ++ break; - case P2P_PROVISION_DISC_REQ: - DBG_871X( "[%s] Got Provisioning Discovery Request Frame\n", __FUNCTION__ ); - process_p2p_provdisc_req(pwdinfo, pframe, len); - _rtw_memcpy(pwdinfo->rx_prov_disc_info.peerDevAddr, GetAddr2Ptr(pframe), ETH_ALEN); -- ++ case P2P_DEVDISC_RESP: + - //20110902 Kurt - //Add the following statement to avoid receiving duplicate prov disc req. such that pre_p2p_state would be covered. - if(!rtw_p2p_chk_state(pwdinfo, P2P_STATE_RX_PROVISION_DIS_REQ)) @@ -13732,8 +13755,6 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + process_p2p_provdisc_req(pwdinfo, pframe, len); + _rtw_memcpy(pwdinfo->rx_prov_disc_info.peerDevAddr, GetAddr2Ptr(pframe), ETH_ALEN); -- } -- } + //20110902 Kurt + //Add the following statement to avoid receiving duplicate prov disc req. such that pre_p2p_state would be covered. + if(!rtw_p2p_chk_state(pwdinfo, P2P_STATE_RX_PROVISION_DIS_REQ)) @@ -13747,10 +13768,12 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + padapter->mlmepriv.widi_state = INTEL_WIDI_STATE_WFD_CONNECTION; + _cancel_timer_ex(&(padapter->mlmepriv.listen_timer)); + intel_widi_wk_cmd(padapter, INTEL_WIDI_LISTEN_STOP_WK, NULL); -+ } + } +- } +#endif //CONFIG_INTEL_WIDI + break; -+ + +- } + case P2P_PROVISION_DISC_RESP: + // Commented by Albert 20110707 + // Should we check the pwdinfo->tx_prov_disc_info.bsent flag here?? @@ -13762,8 +13785,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + process_p2p_provdisc_resp(pwdinfo, pframe); + _set_timer( &pwdinfo->restore_p2p_state_timer, P2P_PROVISION_TIMEOUT ); + break; - -- } ++ + } + } #endif //CONFIG_P2P @@ -13897,7 +13919,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release unsigned int OnAction_wmm(_adapter *padapter, union recv_frame *precv_frame) { return _SUCCESS; -@@ -4657,7 +6186,7 @@ unsigned int OnAction_p2p(_adapter *pada +@@ -4657,7 +6186,7 @@ unsigned int OnAction_p2p(_adapter *padapter, union recv_frame *precv_frame) return _SUCCESS; #ifdef CONFIG_IOCTL_CFG80211 @@ -13906,7 +13928,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { rtw_cfg80211_rx_action_p2p(padapter, pframe, len); return _SUCCESS; -@@ -4665,7 +6194,7 @@ unsigned int OnAction_p2p(_adapter *pada +@@ -4665,7 +6194,7 @@ unsigned int OnAction_p2p(_adapter *padapter, union recv_frame *precv_frame) else #endif //CONFIG_IOCTL_CFG80211 { @@ -13915,7 +13937,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release OUI_Subtype = frame_body[5]; dialogToken = frame_body[6]; -@@ -4694,7 +6223,6 @@ unsigned int OnAction_p2p(_adapter *pada +@@ -4694,7 +6223,6 @@ unsigned int OnAction_p2p(_adapter *padapter, union recv_frame *precv_frame) } } @@ -13923,7 +13945,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #endif //CONFIG_P2P return _SUCCESS; -@@ -4728,43 +6256,53 @@ unsigned int OnAction(_adapter *padapter +@@ -4728,43 +6256,53 @@ unsigned int OnAction(_adapter *padapter, union recv_frame *precv_frame) unsigned int DoReserved(_adapter *padapter, union recv_frame *precv_frame) { @@ -13994,7 +14016,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release /**************************************************************************** -@@ -4772,6 +6310,15 @@ Following are some TX fuctions for WiFi +@@ -4772,6 +6310,15 @@ Following are some TX fuctions for WiFi MLME *****************************************************************************/ @@ -14010,7 +14032,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release void update_mgntframe_attrib(_adapter *padapter, struct pkt_attrib *pattrib) { struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); -@@ -4810,810 +6357,135 @@ void dump_mgntframe(_adapter *padapter, +@@ -4810,1305 +6357,1051 @@ void dump_mgntframe(_adapter *padapter, struct xmit_frame *pmgntframe) { if(padapter->bSurpriseRemoved == _TRUE || padapter->bDriverStopped == _TRUE) @@ -14073,14 +14095,14 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - _rtw_memcpy(pwlanhdr->addr1, ptdls_sta->hwaddr, ETH_ALEN); - _rtw_memcpy(pwlanhdr->addr2, myid(&(padapter->eeprompriv)), ETH_ALEN); - _rtw_memcpy(pwlanhdr->addr3, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN); -- ++ rtw_sctx_init(&sctx, timeout_ms); ++ pxmitbuf->sctx = &sctx; + - ptdls_sta->sta_xmitpriv.txseq_tid[pattrib->priority]++; - ptdls_sta->sta_xmitpriv.txseq_tid[pattrib->priority] &= 0xFFF; - pattrib->seqnum = ptdls_sta->sta_xmitpriv.txseq_tid[pattrib->priority]; - SetSeqNum(pwlanhdr, pattrib->seqnum); -+ rtw_sctx_init(&sctx, timeout_ms); -+ pxmitbuf->sctx = &sctx; - +- - SetFrameSubType(pframe, WIFI_DATA_NULL); + ret = rtw_hal_mgnt_xmit(padapter, pmgntframe); @@ -14116,33 +14138,46 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - struct security_priv *psecuritypriv = &padapter->securitypriv; - struct mlme_priv *pmlmepriv = &padapter->mlmepriv; - struct qos_priv *pqospriv= &pmlmepriv->qospriv; -- ++ if(padapter->bSurpriseRemoved == _TRUE || ++ padapter->bDriverStopped == _TRUE) ++ { ++ rtw_free_xmitbuf(&padapter->xmitpriv, pmgntframe->pxmitbuf); ++ rtw_free_xmitframe(&padapter->xmitpriv, pmgntframe); ++ return -1; ++ } + - s32 res=_SUCCESS; - sint bmcast; -- ++ _enter_critical_mutex(&pxmitpriv->ack_tx_mutex, NULL); ++ pxmitpriv->ack_tx = _TRUE; + - bmcast = IS_MCAST(pattrib->ra); - - psta = rtw_get_stainfo(pstapriv, pattrib->ra); - if (psta == NULL) { - res =_FAIL; - goto exit; -+ if(padapter->bSurpriseRemoved == _TRUE || -+ padapter->bDriverStopped == _TRUE) -+ { -+ rtw_free_xmitbuf(&padapter->xmitpriv, pmgntframe->pxmitbuf); -+ rtw_free_xmitframe(&padapter->xmitpriv, pmgntframe); -+ return -1; ++ pmgntframe->ack_report = 1; ++ if (rtw_hal_mgnt_xmit(padapter, pmgntframe) == _SUCCESS) { ++ ret = rtw_ack_tx_wait(pxmitpriv, timeout_ms); } - pattrib->mac_id = psta->mac_id; - - pattrib->psta = psta; -- ++ pxmitpriv->ack_tx = _FALSE; ++ _exit_critical_mutex(&pxmitpriv->ack_tx_mutex, NULL); + - pattrib->ack_policy = 0; - // get ether_hdr_len - pattrib->pkt_hdrlen = ETH_HLEN;//(pattrib->ether_type == 0x8100) ? (14 + 4 ): 14; //vlan tag -+ _enter_critical_mutex(&pxmitpriv->ack_tx_mutex, NULL); -+ pxmitpriv->ack_tx = _TRUE; ++ return ret; ++#else //!CONFIG_XMIT_ACK ++ dump_mgntframe(padapter, pmgntframe); ++ rtw_msleep_os(50); ++ return _SUCCESS; ++#endif //!CONFIG_XMIT_ACK ++} - if (pqospriv->qos_option && psta->qos_option) { - pattrib->priority = 1; //tdls management frame should be AC_BK @@ -14152,29 +14187,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - pattrib->hdrlen = WLAN_HDR_A3_LEN; - pattrib->subtype = WIFI_DATA_TYPE; - pattrib->priority = 0; -+ pmgntframe->ack_report = 1; -+ if (rtw_hal_mgnt_xmit(padapter, pmgntframe) == _SUCCESS) { -+ ret = rtw_ack_tx_wait(pxmitpriv, timeout_ms); - } - -- if (psta->ieee8021x_blocked == _TRUE) -- { -- pattrib->encrypt = 0; - } -- else -- { -- GET_ENCRY_ALGO(psecuritypriv, psta, pattrib->encrypt, bmcast); -+ pxmitpriv->ack_tx = _FALSE; -+ _exit_critical_mutex(&pxmitpriv->ack_tx_mutex, NULL); -+ -+ return ret; -+#else //!CONFIG_XMIT_ACK -+ dump_mgntframe(padapter, pmgntframe); -+ rtw_msleep_os(50); -+ return _SUCCESS; -+#endif //!CONFIG_XMIT_ACK -+} -+ +int update_hidden_ssid(u8 *ies, u32 ies_len, u8 hidden_ssid_mode) +{ + u8 *ssid_ie; @@ -14183,11 +14196,18 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + + ssid_ie = rtw_get_ie(ies, WLAN_EID_SSID, &ssid_len_ori, ies_len); -- switch(psecuritypriv->dot11AuthAlgrthm) +- if (psta->ieee8021x_blocked == _TRUE) +- { +- pattrib->encrypt = 0; +- } +- else + //DBG_871X("%s hidden_ssid_mode:%u, ssid_ie:%p, ssid_len_ori:%d\n", __FUNCTION__, hidden_ssid_mode, ssid_ie, ssid_len_ori); + + if(ssid_ie && ssid_len_ori>0) -+ { + { +- GET_ENCRY_ALGO(psecuritypriv, psta, pattrib->encrypt, bmcast); +- +- switch(psecuritypriv->dot11AuthAlgrthm) + switch(hidden_ssid_mode) { - case dot11AuthAlgrthm_Open: @@ -14274,10 +14294,19 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } -void free_tdls_sta(_adapter *padapter, struct sta_info *ptdls_sta) --{ ++void issue_beacon(_adapter *padapter) + { - struct tdls_info *ptdlsinfo = &padapter->tdlsinfo; - struct sta_priv *pstapriv = &padapter->stapriv; -- _irqL irqL; ++ struct xmit_frame *pmgntframe; ++ struct pkt_attrib *pattrib; ++ unsigned char *pframe; ++ struct rtw_ieee80211_hdr *pwlanhdr; ++ unsigned short *fctrl; ++ unsigned int rate_len; ++ struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); ++#if defined (CONFIG_AP_MODE) && defined (CONFIG_NATIVEAP_MLME) + _irqL irqL; - - //free peer sta_info - DBG_8192C("Free sta_info\n"); @@ -14303,7 +14332,16 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - rtw_free_stainfo(padapter, ptdls_sta); - -} -- ++ struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); ++#endif //#if defined (CONFIG_AP_MODE) && defined (CONFIG_NATIVEAP_MLME) ++ struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); ++ struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); ++ WLAN_BSSID_EX *cur_network = &(pmlmeinfo->network); ++ u8 bc_addr[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; ++#ifdef CONFIG_P2P ++ struct wifidirect_info *pwdinfo = &(padapter->wdinfo); ++#endif //CONFIG_P2P + -void issue_tdls_setup_req(_adapter *padapter, u8 *mac_addr) -{ - struct tdls_info *ptdlsinfo = &padapter->tdlsinfo; @@ -14316,30 +14354,75 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - _irqL irqL; - static u8 dialogtoken = 0; - u32 timeout_interval= TPK_RESEND_COUNT * 1000; //retry timer should set at least 301 sec, using TPK_count counting 301 times. -- + - if(ptdlsinfo->ap_prohibited == _TRUE) - goto exit; -- -- if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) -- { -- return; -- } ++ //DBG_871X("%s\n", __FUNCTION__); + + if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) + { ++ DBG_871X("%s, alloc mgnt frame fail\n", __FUNCTION__); + return; + } - -- //update attribute -- pattrib = &pmgntframe->attrib; -- ++#if defined (CONFIG_AP_MODE) && defined (CONFIG_NATIVEAP_MLME) ++ _enter_critical_bh(&pmlmepriv->bcn_update_lock, &irqL); ++#endif //#if defined (CONFIG_AP_MODE) && defined (CONFIG_NATIVEAP_MLME) ++ + //update attribute + pattrib = &pmgntframe->attrib; ++ update_mgntframe_attrib(padapter, pattrib); ++ pattrib->qsel = 0x10; ++ ++ _rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); ++ ++ pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; ++ pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; ++ ++ ++ fctrl = &(pwlanhdr->frame_ctl); ++ *(fctrl) = 0; ++ ++ _rtw_memcpy(pwlanhdr->addr1, bc_addr, ETH_ALEN); ++ _rtw_memcpy(pwlanhdr->addr2, myid(&(padapter->eeprompriv)), ETH_ALEN); ++ _rtw_memcpy(pwlanhdr->addr3, get_my_bssid(cur_network), ETH_ALEN); + - pmgntframe->frame_tag = DATA_FRAMETAG; - pattrib->ether_type = 0x890d; - pattrib->pctrl =0; - - _rtw_memcpy(pattrib->dst, mac_addr, ETH_ALEN); - _rtw_memcpy(pattrib->src, myid(&(padapter->eeprompriv)), ETH_ALEN); -- ++ SetSeqNum(pwlanhdr, 0/*pmlmeext->mgnt_seq*/); ++ //pmlmeext->mgnt_seq++; ++ SetFrameSubType(pframe, WIFI_BEACON); ++ ++ pframe += sizeof(struct rtw_ieee80211_hdr_3addr); ++ pattrib->pktlen = sizeof (struct rtw_ieee80211_hdr_3addr); ++ ++ if( (pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE) ++ { ++ //DBG_871X("ie len=%d\n", cur_network->IELength); ++#ifdef CONFIG_P2P ++ // for P2P : Primary Device Type & Device Name ++ u32 wpsielen=0, insert_len=0; ++ u8 *wpsie=NULL; ++ wpsie = rtw_get_wps_ie(cur_network->IEs+_FIXED_IE_LENGTH_, cur_network->IELength-_FIXED_IE_LENGTH_, NULL, &wpsielen); ++ ++ if(rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO) && wpsie && wpsielen>0) ++ { ++ uint wps_offset, remainder_ielen; ++ u8 *premainder_ie, *pframe_wscie; ++ ++ wps_offset = (uint)(wpsie - cur_network->IEs); + - _rtw_memcpy(pattrib->ra, get_bssid(pmlmepriv), ETH_ALEN); - _rtw_memcpy(pattrib->ta, pattrib->src, ETH_ALEN); -- ++ premainder_ie = wpsie + wpsielen; + - update_tdls_attrib(padapter, pattrib); -- ++ remainder_ielen = cur_network->IELength - wps_offset - wpsielen; + - //init peer sta_info - ptdls_sta = rtw_get_stainfo(pstapriv, mac_addr); - if(ptdls_sta==NULL) @@ -14351,9 +14434,32 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - ptdlsinfo->sta_cnt++; - _exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL); - if( ptdlsinfo->sta_cnt == (NUM_STA - 1) ) -- { ++#ifdef CONFIG_IOCTL_CFG80211 ++ if(wdev_to_priv(padapter->rtw_wdev)->p2p_enabled && pwdinfo->driver_interface == DRIVER_CFG80211 ) + { - ptdlsinfo->sta_maximum = _TRUE; -- } ++ if(pmlmepriv->wps_beacon_ie && pmlmepriv->wps_beacon_ie_len>0) ++ { ++ _rtw_memcpy(pframe, cur_network->IEs, wps_offset); ++ pframe += wps_offset; ++ pattrib->pktlen += wps_offset; ++ ++ _rtw_memcpy(pframe, pmlmepriv->wps_beacon_ie, pmlmepriv->wps_beacon_ie_len); ++ pframe += pmlmepriv->wps_beacon_ie_len; ++ pattrib->pktlen += pmlmepriv->wps_beacon_ie_len; ++ ++ //copy remainder_ie to pframe ++ _rtw_memcpy(pframe, premainder_ie, remainder_ielen); ++ pframe += remainder_ielen; ++ pattrib->pktlen += remainder_ielen; ++ } ++ else ++ { ++ _rtw_memcpy(pframe, cur_network->IEs, cur_network->IELength); ++ pframe += cur_network->IELength; ++ pattrib->pktlen += cur_network->IELength; ++ } + } - } - else - { @@ -14371,7 +14477,14 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - ptdls_sta->TDLS_PeerKey_Lifetime = timeout_interval; - _set_timer( &ptdls_sta->handshake_timer, TDLS_HANDSHAKE_TIME ); - } -- ++ else ++#endif //CONFIG_IOCTL_CFG80211 ++ { ++ pframe_wscie = pframe + wps_offset; ++ _rtw_memcpy(pframe, cur_network->IEs, wps_offset+wpsielen); ++ pframe += (wps_offset + wpsielen); ++ pattrib->pktlen += (wps_offset + wpsielen); + - pattrib->qsel=pattrib->priority; - if(rtw_xmit_tdls_coalesce(padapter, pmgntframe, TDLS_SETUP_REQUEST) !=_SUCCESS ){ - rtw_free_xmitbuf(pxmitpriv,pmgntframe->pxmitbuf); @@ -14379,12 +14492,32 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - goto exit; - } - rtw_dump_xframe(padapter, pmgntframe); -- ++ //now pframe is end of wsc ie, insert Primary Device Type & Device Name ++ // Primary Device Type ++ // Type: ++ *(u16*) ( pframe + insert_len) = cpu_to_be16( WPS_ATTR_PRIMARY_DEV_TYPE ); ++ insert_len += 2; ++ ++ // Length: ++ *(u16*) ( pframe + insert_len ) = cpu_to_be16( 0x0008 ); ++ insert_len += 2; ++ ++ // Value: ++ // Category ID ++ *(u16*) ( pframe + insert_len ) = cpu_to_be16( WPS_PDT_CID_MULIT_MEDIA ); ++ insert_len += 2; + -exit: -- ++ // OUI ++ *(u32*) ( pframe + insert_len ) = cpu_to_be32( WPSOUI ); ++ insert_len += 4; + - return; -} -- ++ // Sub Category ID ++ *(u16*) ( pframe + insert_len ) = cpu_to_be16( WPS_PDT_SCID_MEDIA_SERVER ); ++ insert_len += 2; + -void issue_tdls_teardown(_adapter *padapter, u8 *mac_addr) -{ - struct xmit_frame *pmgntframe; @@ -14394,7 +14527,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - struct sta_priv *pstapriv = &padapter->stapriv; - struct sta_info *ptdls_sta=NULL; - _irqL irqL; -- + - ptdls_sta = rtw_get_stainfo(pstapriv, mac_addr); - if(ptdls_sta==NULL){ - DBG_8192C("issue tdls teardown unsuccessful\n"); @@ -14402,7 +14535,11 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - }else{ - ptdls_sta->tdls_sta_state=UN_TDLS_STATE; - } -- ++ // Device Name ++ // Type: ++ *(u16*) ( pframe + insert_len ) = cpu_to_be16( WPS_ATTR_DEVICE_NAME ); ++ insert_len += 2; + - if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) - { - return; @@ -14410,17 +14547,25 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - - //update attribute - pattrib = &pmgntframe->attrib; -- ++ // Length: ++ *(u16*) ( pframe + insert_len ) = cpu_to_be16( pwdinfo->device_name_len ); ++ insert_len += 2; + - pmgntframe->frame_tag = DATA_FRAMETAG; - pattrib->ether_type = 0x890d; - pattrib->pctrl =0; -- ++ // Value: ++ _rtw_memcpy( pframe + insert_len, pwdinfo->device_name, pwdinfo->device_name_len ); ++ insert_len += pwdinfo->device_name_len; + - _rtw_memcpy(pattrib->dst, mac_addr, ETH_ALEN); - _rtw_memcpy(pattrib->src, myid(&(padapter->eeprompriv)), ETH_ALEN); -- + - _rtw_memcpy(pattrib->ra, get_bssid(pmlmepriv), ETH_ALEN); - _rtw_memcpy(pattrib->ta, pattrib->src, ETH_ALEN); -- ++ //update wsc ie length ++ *(pframe_wscie+1) = (wpsielen -2) + insert_len; + - update_tdls_attrib(padapter, pattrib); - pattrib->qsel=pattrib->priority; - if (rtw_xmit_tdls_coalesce(padapter, pmgntframe, TDLS_TEARDOWN) != _SUCCESS) { @@ -14429,7 +14574,10 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - goto exit; - } - rtw_dump_xframe(padapter, pmgntframe); -- ++ //pframe move to end ++ pframe+=insert_len; ++ pattrib->pktlen += insert_len; + - if(ptdls_sta->tdls_sta_state & TDLS_CH_SWITCH_ON_STATE){ - ptdls_sta->option =3; - rtw_tdls_cmd(padapter, ptdls_sta->hwaddr, TDLS_CS_OFF); @@ -14443,13 +14591,89 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - } - else - rtw_tdls_cmd(padapter, mac_addr, TDLS_FREE_STA ); -- -- ++ //copy remainder_ie to pframe ++ _rtw_memcpy(pframe, premainder_ie, remainder_ielen); ++ pframe += remainder_ielen; ++ pattrib->pktlen += remainder_ielen; ++ } ++ } ++ else ++#endif //CONFIG_P2P ++ { ++ int len_diff; ++ _rtw_memcpy(pframe, cur_network->IEs, cur_network->IELength); ++ len_diff = update_hidden_ssid( ++ pframe+_BEACON_IE_OFFSET_ ++ , cur_network->IELength-_BEACON_IE_OFFSET_ ++ , pmlmeinfo->hidden_ssid_mode ++ ); ++ pframe += (cur_network->IELength+len_diff); ++ pattrib->pktlen += (cur_network->IELength+len_diff); ++ } + ++ { ++ u8 *wps_ie; ++ uint wps_ielen; ++ u8 sr = 0; ++ wps_ie = rtw_get_wps_ie(pmgntframe->buf_addr+TXDESC_OFFSET+sizeof (struct rtw_ieee80211_hdr_3addr)+_BEACON_IE_OFFSET_, ++ pattrib->pktlen-sizeof (struct rtw_ieee80211_hdr_3addr)-_BEACON_IE_OFFSET_, NULL, &wps_ielen); ++ if (wps_ie && wps_ielen>0) { ++ rtw_get_wps_attr_content(wps_ie, wps_ielen, WPS_ATTR_SELECTED_REGISTRAR, (u8*)(&sr), NULL); ++ } ++ if (sr != 0) ++ set_fwstate(pmlmepriv, WIFI_UNDER_WPS); ++ else ++ _clr_fwstate_(pmlmepriv, WIFI_UNDER_WPS); ++ } + -exit: -- ++#ifdef CONFIG_P2P ++ if(rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO)) ++ { ++ u32 len; ++#ifdef CONFIG_IOCTL_CFG80211 ++ if(wdev_to_priv(padapter->rtw_wdev)->p2p_enabled && pwdinfo->driver_interface == DRIVER_CFG80211 ) ++ { ++ len = pmlmepriv->p2p_beacon_ie_len; ++ if(pmlmepriv->p2p_beacon_ie && len>0) ++ _rtw_memcpy(pframe, pmlmepriv->p2p_beacon_ie, len); ++ } ++ else ++#endif //CONFIG_IOCTL_CFG80211 ++ { ++ len = build_beacon_p2p_ie(pwdinfo, pframe); ++ } + - return; -} -- ++ pframe += len; ++ pattrib->pktlen += len; ++#ifdef CONFIG_WFD ++#ifdef CONFIG_IOCTL_CFG80211 ++ if(_TRUE == pwdinfo->wfd_info->wfd_enable) ++#endif //CONFIG_IOCTL_CFG80211 ++ { ++ len = build_beacon_wfd_ie( pwdinfo, pframe ); ++ } ++#ifdef CONFIG_IOCTL_CFG80211 ++ else ++ { ++ len = 0; ++ if(pmlmepriv->wfd_beacon_ie && pmlmepriv->wfd_beacon_ie_len>0) ++ { ++ len = pmlmepriv->wfd_beacon_ie_len; ++ _rtw_memcpy(pframe, pmlmepriv->wfd_beacon_ie, len); ++ } ++ } ++#endif //CONFIG_IOCTL_CFG80211 ++ pframe += len; ++ pattrib->pktlen += len; ++#endif //CONFIG_WFD ++ } ++#endif //CONFIG_P2P ++ ++ goto _issue_bcn; + -void issue_tdls_dis_req(_adapter *padapter, u8 *mac_addr) -{ - struct xmit_frame *pmgntframe; @@ -14461,25 +14685,30 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) - { - return; -- } + } - - //update attribute - pattrib = &pmgntframe->attrib; -- + - pmgntframe->frame_tag = DATA_FRAMETAG; - pattrib->ether_type = 0x890d; - pattrib->pctrl =0; -- ++ //below for ad-hoc mode + - if(mac_addr == NULL) - _rtw_memcpy(pattrib->dst, baddr, ETH_ALEN); - else - _rtw_memcpy(pattrib->dst, mac_addr, ETH_ALEN); - - _rtw_memcpy(pattrib->src, myid(&(padapter->eeprompriv)), ETH_ALEN); -- ++ //timestamp will be inserted by hardware ++ pframe += 8; ++ pattrib->pktlen += 8; + - _rtw_memcpy(pattrib->ra, get_bssid(pmlmepriv), ETH_ALEN); - _rtw_memcpy(pattrib->ta, pattrib->src, ETH_ALEN); -- ++ // beacon interval: 2 bytes + - update_tdls_attrib(padapter, pattrib); - pattrib->qsel=pattrib->priority; - if (rtw_xmit_tdls_coalesce(padapter, pmgntframe, TDLS_DISCOVERY_REQUEST) != _SUCCESS) { @@ -14489,12 +14718,16 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - } - rtw_dump_xframe(padapter, pmgntframe); - DBG_8192C("issue tdls dis req\n"); -- ++ _rtw_memcpy(pframe, (unsigned char *)(rtw_get_beacon_interval_from_ie(cur_network->IEs)), 2); + -exit: -- ++ pframe += 2; ++ pattrib->pktlen += 2; + - return; -} -- ++ // capability info: 2 bytes + -void issue_tdls_setup_rsp(_adapter *padapter, union recv_frame *precv_frame) -{ - struct xmit_frame *pmgntframe; @@ -14516,13 +14749,18 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - pmgntframe->frame_tag = DATA_FRAMETAG; - pattrib->ether_type = 0x890d; - pattrib->pctrl =0; -- ++ _rtw_memcpy(pframe, (unsigned char *)(rtw_get_capability_from_ie(cur_network->IEs)), 2); + - _rtw_memcpy(pattrib->dst, rx_pkt_pattrib->src, ETH_ALEN); - _rtw_memcpy(pattrib->src, myid(&(padapter->eeprompriv)), ETH_ALEN); -- ++ pframe += 2; ++ pattrib->pktlen += 2; + - _rtw_memcpy(pattrib->ra, rx_pkt_pattrib->bssid, ETH_ALEN); - _rtw_memcpy(pattrib->ta, pattrib->src, ETH_ALEN); -- ++ // SSID ++ pframe = rtw_set_ie(pframe, _SSID_IE_, cur_network->Ssid.SsidLength, cur_network->Ssid.Ssid, &pattrib->pktlen); + - update_tdls_attrib(padapter, pattrib); - pattrib->qsel=pattrib->priority; - if (rtw_xmit_tdls_coalesce(padapter, pmgntframe, TDLS_SETUP_RESPONSE) != _SUCCESS) { @@ -14531,13 +14769,29 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - goto exit; - } - rtw_dump_xframe(padapter, pmgntframe); -- ++ // supported rates... ++ rate_len = rtw_get_rateset_len(cur_network->SupportedRates); ++ pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_, ((rate_len > 8)? 8: rate_len), cur_network->SupportedRates, &pattrib->pktlen); + -exit: -- ++ // DS parameter set ++ pframe = rtw_set_ie(pframe, _DSSET_IE_, 1, (unsigned char *)&(cur_network->Configuration.DSConfig), &pattrib->pktlen); + - return; -- ++ //if( (pmlmeinfo->state&0x03) == WIFI_FW_ADHOC_STATE) ++ { ++ u8 erpinfo=0; ++ u32 ATIMWindow; ++ // IBSS Parameter Set... ++ //ATIMWindow = cur->Configuration.ATIMWindow; ++ ATIMWindow = 0; ++ pframe = rtw_set_ie(pframe, _IBSS_PARA_IE_, 2, (unsigned char *)(&ATIMWindow), &pattrib->pktlen); + -} -- ++ //ERP IE ++ pframe = rtw_set_ie(pframe, _ERPINFO_IE_, 1, &erpinfo, &pattrib->pktlen); ++ } + -void issue_tdls_setup_cfm(_adapter *padapter, union recv_frame *precv_frame) -{ - struct tdls_info *ptdlsinfo = &padapter->tdlsinfo; @@ -14546,27 +14800,32 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); - struct sta_info *ptdls_sta=NULL; - _irqL irqL; -- + - struct rx_pkt_attrib *rx_pkt_pattrib = & precv_frame->u.hdr.attrib; - - if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) -- { ++ // EXTERNDED SUPPORTED RATE ++ if (rate_len > 8) + { - return; -- } ++ pframe = rtw_set_ie(pframe, _EXT_SUPPORTEDRATES_IE_, (rate_len - 8), (cur_network->SupportedRates + 8), &pattrib->pktlen); + } - - //update attribute - pattrib = &pmgntframe->attrib; -- + - pmgntframe->frame_tag = DATA_FRAMETAG; - pattrib->ether_type = 0x890d; - pattrib->pctrl =0; -- + - _rtw_memcpy(pattrib->dst, rx_pkt_pattrib->src, ETH_ALEN); - _rtw_memcpy(pattrib->src, myid(&(padapter->eeprompriv)), ETH_ALEN); -- ++ //todo:HT for adhoc + - _rtw_memcpy(pattrib->ra, rx_pkt_pattrib->bssid, ETH_ALEN); - _rtw_memcpy(pattrib->ta, pattrib->src, ETH_ALEN); -- ++_issue_bcn: + - update_tdls_attrib(padapter, pattrib); - pattrib->qsel=pattrib->priority; - if (rtw_xmit_tdls_coalesce(padapter, pmgntframe, TDLS_SETUP_CONFIRM) != _SUCCESS) { @@ -14574,45 +14833,94 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - rtw_free_xmitframe_ex(pxmitpriv, pmgntframe); - goto exit; - } -- ++#if defined (CONFIG_AP_MODE) && defined (CONFIG_NATIVEAP_MLME) ++ pmlmepriv->update_bcn = _FALSE; ++ ++ _exit_critical_bh(&pmlmepriv->bcn_update_lock, &irqL); ++#endif //#if defined (CONFIG_AP_MODE) && defined (CONFIG_NATIVEAP_MLME) + - rtw_dump_xframe(padapter, pmgntframe); -- ++ if ((pattrib->pktlen + TXDESC_SIZE) > 512) ++ { ++ DBG_871X("beacon frame too large\n"); ++ return; ++ } ++ ++ pattrib->last_txcmdsz = pattrib->pktlen; + -exit: -- ++ //DBG_871X("issue bcn_sz=%d\n", pattrib->last_txcmdsz); + - return; -- --} -- ++ dump_mgntframe(padapter, pmgntframe); + + } + -//TDLS Discovery Response frame is a management action frame -void issue_tdls_dis_rsp(_adapter *padapter, union recv_frame *precv_frame, u8 dialog) --{ ++void issue_probersp(_adapter *padapter, unsigned char *da, u8 is_valid_p2p_probereq) + { - struct xmit_frame *pmgntframe; - struct pkt_attrib *pattrib; - unsigned char *pframe; -- struct rtw_ieee80211_hdr *pwlanhdr; ++ struct xmit_frame *pmgntframe; ++ struct pkt_attrib *pattrib; ++ unsigned char *pframe; + struct rtw_ieee80211_hdr *pwlanhdr; - unsigned short *fctrl; - struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); -- struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); -- ++ unsigned short *fctrl; ++ unsigned char *mac, *bssid; ++ struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); ++#if defined (CONFIG_AP_MODE) && defined (CONFIG_NATIVEAP_MLME) ++ u8 *pwps_ie; ++ uint wps_ielen; ++ struct mlme_priv *pmlmepriv = &padapter->mlmepriv; ++#endif //#if defined (CONFIG_AP_MODE) && defined (CONFIG_NATIVEAP_MLME) + struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); ++ struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); ++ WLAN_BSSID_EX *cur_network = &(pmlmeinfo->network); ++ unsigned int rate_len; ++#ifdef CONFIG_P2P ++ struct wifidirect_info *pwdinfo = &(padapter->wdinfo); ++#ifdef CONFIG_WFD ++ u32 wfdielen = 0; ++#endif //CONFIG_WFD ++#endif //CONFIG_P2P + - struct rx_pkt_attrib *rx_pkt_pattrib = &precv_frame->u.hdr.attrib; -- -- if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) -- { -- return; -- } -- -- //update attribute -- pattrib = &pmgntframe->attrib; ++ //DBG_871X("%s\n", __FUNCTION__); + + if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) + { ++ DBG_871X("%s, alloc mgnt frame fail\n", __FUNCTION__); + return; + } + ++ + //update attribute + pattrib = &pmgntframe->attrib; - update_mgntframe_attrib(padapter, pattrib); - -- _rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); ++ update_mgntframe_attrib(padapter, pattrib); ++ + _rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); - -- pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; ++ + pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; - pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; - -- fctrl = &(pwlanhdr->frame_ctl); -- *(fctrl) = 0; -- ++ pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; ++ ++ mac = myid(&(padapter->eeprompriv)); ++ bssid = cur_network->MacAddress; ++ + fctrl = &(pwlanhdr->frame_ctl); + *(fctrl) = 0; ++ _rtw_memcpy(pwlanhdr->addr1, da, ETH_ALEN); ++ _rtw_memcpy(pwlanhdr->addr2, mac, ETH_ALEN); ++ _rtw_memcpy(pwlanhdr->addr3, bssid, ETH_ALEN); + - // unicast probe request frame - _rtw_memcpy(pwlanhdr->addr1, rx_pkt_pattrib->src, ETH_ALEN); - _rtw_memcpy(pattrib->dst, pwlanhdr->addr1, ETH_ALEN); @@ -14623,13 +14931,14 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - _rtw_memcpy(pwlanhdr->addr3, rx_pkt_pattrib->bssid, ETH_ALEN); - _rtw_memcpy(pattrib->ra, pwlanhdr->addr3, ETH_ALEN); - -- SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); -- pmlmeext->mgnt_seq++; + SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); + pmlmeext->mgnt_seq++; - SetFrameSubType(pframe, WIFI_ACTION); - - pframe += sizeof (struct rtw_ieee80211_hdr_3addr); - pattrib->pktlen = sizeof (struct rtw_ieee80211_hdr_3addr); -- ++ SetFrameSubType(fctrl, WIFI_PROBERSP); + - rtw_tdls_dis_rsp_fr(padapter, pmgntframe, pframe, dialog); - - pattrib->nr_frags = 1; @@ -14639,21 +14948,29 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - - return; -} -- ++ pattrib->hdrlen = sizeof(struct rtw_ieee80211_hdr_3addr); ++ pattrib->pktlen = pattrib->hdrlen; ++ pframe += pattrib->hdrlen; + -void issue_tdls_peer_traffic_indication(_adapter *padapter, struct sta_info *ptdls_sta) -{ - struct xmit_frame *pmgntframe; - struct pkt_attrib *pattrib; - struct mlme_priv *pmlmepriv = &padapter->mlmepriv; - struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); -- + - static u8 dialogtoken=0; -- ++ if(cur_network->IELength>MAX_IE_SZ) ++ return; + - if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) -- { ++#if defined (CONFIG_AP_MODE) && defined (CONFIG_NATIVEAP_MLME) ++ if( (pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE) + { - return; - } -- ++ pwps_ie = rtw_get_wps_ie(cur_network->IEs+_FIXED_IE_LENGTH_, cur_network->IELength-_FIXED_IE_LENGTH_, NULL, &wps_ielen); + - //update attribute - pattrib = &pmgntframe->attrib; - @@ -14681,20 +14998,27 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - goto exit; - } - rtw_dump_xframe(padapter, pmgntframe); -- ++ //inerset & update wps_probe_resp_ie ++ if((pmlmepriv->wps_probe_resp_ie!=NULL) && pwps_ie && (wps_ielen>0)) ++ { ++ uint wps_offset, remainder_ielen; ++ u8 *premainder_ie; + -exit: -- ++ wps_offset = (uint)(pwps_ie - cur_network->IEs); + - return; -} -- ++ premainder_ie = pwps_ie + wps_ielen; + -void issue_tdls_ch_switch_req(_adapter *padapter, u8 *mac_addr) -+void issue_beacon(_adapter *padapter) - { - struct xmit_frame *pmgntframe; - struct pkt_attrib *pattrib; +-{ +- struct xmit_frame *pmgntframe; +- struct pkt_attrib *pattrib; - struct mlme_priv *pmlmepriv = &padapter->mlmepriv; - struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); -- ++ remainder_ielen = cur_network->IELength - wps_offset - wps_ielen; + - if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) - { - return; @@ -14702,19 +15026,51 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - - //update attribute - pattrib = &pmgntframe->attrib; -- ++ _rtw_memcpy(pframe, cur_network->IEs, wps_offset); ++ pframe += wps_offset; ++ pattrib->pktlen += wps_offset; + - pmgntframe->frame_tag = DATA_FRAMETAG; - pattrib->ether_type = 0x890d; - pattrib->pctrl =0; -- ++ wps_ielen = (uint)pmlmepriv->wps_probe_resp_ie[1];//to get ie data len ++ if((wps_offset+wps_ielen+2)<=MAX_IE_SZ) ++ { ++ _rtw_memcpy(pframe, pmlmepriv->wps_probe_resp_ie, wps_ielen+2); ++ pframe += wps_ielen+2; ++ pattrib->pktlen += wps_ielen+2; ++ } + - _rtw_memcpy(pattrib->dst, mac_addr, ETH_ALEN); - _rtw_memcpy(pattrib->src, myid(&(padapter->eeprompriv)), ETH_ALEN); -- ++ if((wps_offset+wps_ielen+2+remainder_ielen)<=MAX_IE_SZ) ++ { ++ _rtw_memcpy(pframe, premainder_ie, remainder_ielen); ++ pframe += remainder_ielen; ++ pattrib->pktlen += remainder_ielen; ++ } ++ } ++ else ++ { ++ _rtw_memcpy(pframe, cur_network->IEs, cur_network->IELength); ++ pframe += cur_network->IELength; ++ pattrib->pktlen += cur_network->IELength; ++ } + - _rtw_memcpy(pattrib->ra, get_bssid(pmlmepriv), ETH_ALEN); - _rtw_memcpy(pattrib->ta, pattrib->src, ETH_ALEN); -- ++ /* retrieve SSID IE from cur_network->Ssid */ ++ { ++ u8 *ssid_ie; ++ sint ssid_ielen; ++ sint ssid_ielen_diff; ++ u8 buf[MAX_IE_SZ]; ++ u8 *ies = pmgntframe->buf_addr+TXDESC_OFFSET+sizeof(struct rtw_ieee80211_hdr_3addr); + - update_tdls_attrib(padapter, pattrib); -- ++ ssid_ie = rtw_get_ie(ies+_FIXED_IE_LENGTH_, _SSID_IE_, &ssid_ielen, ++ (pframe-ies)-_FIXED_IE_LENGTH_); + - pattrib->qsel=pattrib->priority; - if(rtw_xmit_tdls_coalesce(padapter, pmgntframe, TDLS_CHANNEL_SWITCH_REQUEST) !=_SUCCESS ){ - rtw_free_xmitbuf(pxmitpriv,pmgntframe->pxmitbuf); @@ -14722,41 +15078,70 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - goto exit; - } - rtw_dump_xframe(padapter, pmgntframe); -- ++ ssid_ielen_diff = cur_network->Ssid.SsidLength - ssid_ielen; + -exit: -- ++ if (ssid_ie && cur_network->Ssid.SsidLength) { ++ uint remainder_ielen; ++ u8 *remainder_ie; ++ remainder_ie = ssid_ie+2; ++ remainder_ielen = (pframe-remainder_ie); + - return; -} -- ++ LOG_LEVEL(_drv_warning_, FUNC_ADPT_FMT" remainder_ielen > MAX_IE_SZ\n", FUNC_ADPT_ARG(padapter)); ++ if (remainder_ielen > MAX_IE_SZ) { ++ remainder_ielen = MAX_IE_SZ; ++ } + -void issue_tdls_ch_switch_rsp(_adapter *padapter, u8 *mac_addr) -{ - struct xmit_frame *pmgntframe; - struct pkt_attrib *pattrib; - struct mlme_priv *pmlmepriv = &padapter->mlmepriv; - struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); -- ++ _rtw_memcpy(buf, remainder_ie, remainder_ielen); ++ _rtw_memcpy(remainder_ie+ssid_ielen_diff, buf, remainder_ielen); ++ *(ssid_ie+1) = cur_network->Ssid.SsidLength; ++ _rtw_memcpy(ssid_ie+2, cur_network->Ssid.Ssid, cur_network->Ssid.SsidLength); + - _irqL irqL; - - if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) -- { ++ pframe += ssid_ielen_diff; ++ pattrib->pktlen += ssid_ielen_diff; ++ } ++ } ++ } ++ else ++#endif + { - return; - } -- + - //update attribute - pattrib = &pmgntframe->attrib; -- ++ //timestamp will be inserted by hardware ++ pframe += 8; ++ pattrib->pktlen += 8; + - pmgntframe->frame_tag = DATA_FRAMETAG; - pattrib->ether_type = 0x890d; - pattrib->pctrl =0; -- ++ // beacon interval: 2 bytes + - _rtw_memcpy(pattrib->dst, mac_addr, ETH_ALEN); - _rtw_memcpy(pattrib->src, myid(&(padapter->eeprompriv)), ETH_ALEN); -- ++ _rtw_memcpy(pframe, (unsigned char *)(rtw_get_beacon_interval_from_ie(cur_network->IEs)), 2); + - _rtw_memcpy(pattrib->ra, get_bssid(pmlmepriv), ETH_ALEN); - _rtw_memcpy(pattrib->ta, pattrib->src, ETH_ALEN); -- ++ pframe += 2; ++ pattrib->pktlen += 2; + - update_tdls_attrib(padapter, pattrib); -- ++ // capability info: 2 bytes + - pattrib->qsel=pattrib->priority; -/* - _enter_critical_bh(&pxmitpriv->lock, &irqL); @@ -14771,12 +15156,16 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - goto exit; - } - rtw_dump_xframe(padapter, pmgntframe); -- ++ _rtw_memcpy(pframe, (unsigned char *)(rtw_get_capability_from_ie(cur_network->IEs)), 2); + -exit: -- ++ pframe += 2; ++ pattrib->pktlen += 2; + - return; -} -- ++ //below for ad-hoc mode + -sint On_TDLS_Dis_Rsp(_adapter *adapter, union recv_frame *precv_frame) -{ - struct sta_info *ptdls_sta = NULL; @@ -14785,17 +15174,25 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - struct rx_pkt_attrib *pattrib = &(precv_frame->u.hdr.attrib); - struct tdls_info *ptdlsinfo = &(adapter->tdlsinfo); - u8 empty_addr[ETH_ALEN] = { 0x00 }; -- ++ // SSID ++ pframe = rtw_set_ie(pframe, _SSID_IE_, cur_network->Ssid.SsidLength, cur_network->Ssid.Ssid, &pattrib->pktlen); + - psa = get_sa(ptr); - ptdls_sta = rtw_get_stainfo(&(adapter->stapriv), psa); -- ++ // supported rates... ++ rate_len = rtw_get_rateset_len(cur_network->SupportedRates); ++ pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_, ((rate_len > 8)? 8: rate_len), cur_network->SupportedRates, &pattrib->pktlen); + - if(ptdls_sta != NULL) - { - ptdls_sta->tdls_sta_state |= TDLS_ALIVE_STATE; -- ++ // DS parameter set ++ pframe =rtw_set_ie(pframe, _DSSET_IE_, 1, (unsigned char *)&(cur_network->Configuration.DSConfig), &pattrib->pktlen); + - //Record the tdls sta with lowest signal strength - if( (ptdlsinfo->sta_maximum == _TRUE) && (ptdls_sta->alive_count >= 1) ) -- { ++ if( (pmlmeinfo->state&0x03) == WIFI_FW_ADHOC_STATE) + { - printk("%s %d\n", __FUNCTION__, __LINE__); - if( _rtw_memcmp(ptdlsinfo->ss_record.macaddr, empty_addr, ETH_ALEN) ) - { @@ -14813,13 +15210,39 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - ptdlsinfo->ss_record.signal_strength = pattrib->signal_strength; - } - } -- } -- ++ u8 erpinfo=0; ++ u32 ATIMWindow; ++ // IBSS Parameter Set... ++ //ATIMWindow = cur->Configuration.ATIMWindow; ++ ATIMWindow = 0; ++ pframe = rtw_set_ie(pframe, _IBSS_PARA_IE_, 2, (unsigned char *)(&ATIMWindow), &pattrib->pktlen); ++ ++ //ERP IE ++ pframe = rtw_set_ie(pframe, _ERPINFO_IE_, 1, &erpinfo, &pattrib->pktlen); + } + - } - else -- { ++ ++ // EXTERNDED SUPPORTED RATE ++ if (rate_len > 8) ++ { ++ pframe = rtw_set_ie(pframe, _EXT_SUPPORTEDRATES_IE_, (rate_len - 8), (cur_network->SupportedRates + 8), &pattrib->pktlen); ++ } ++ ++ ++ //todo:HT for adhoc ++ ++ } ++ ++#ifdef CONFIG_P2P ++ if(rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO) /*&& is_valid_p2p_probereq*/) + { - if( ptdlsinfo->sta_maximum == _TRUE) -- { ++ u32 len; ++#ifdef CONFIG_IOCTL_CFG80211 ++ if(wdev_to_priv(padapter->rtw_wdev)->p2p_enabled && pwdinfo->driver_interface == DRIVER_CFG80211 ) + { - printk("%s %d\n", __FUNCTION__, __LINE__); - if( _rtw_memcmp( ptdlsinfo->ss_record.macaddr, empty_addr, ETH_ALEN ) ) - { @@ -14840,346 +15263,27 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - return _FAIL; - } - } -- } -- -- if( pattrib->signal_strength + TDLS_SIGNAL_THRESH >= precvpriv->signal_strength ) -- { -- issue_tdls_setup_req(adapter, psa); -- } -- } -- -- return _FAIL; --} -- --#endif -- --int update_hidden_ssid(u8 *ies, u32 ies_len, u8 hidden_ssid_mode) --{ -- u8 *ssid_ie; -- sint ssid_len_ori; -- int len_diff = 0; -- -- ssid_ie = rtw_get_ie(ies, WLAN_EID_SSID, &ssid_len_ori, ies_len); -- -- //DBG_871X("%s hidden_ssid_mode:%u, ssid_ie:%p, ssid_len_ori:%d\n", __FUNCTION__, hidden_ssid_mode, ssid_ie, ssid_len_ori); -- -- if(ssid_ie && ssid_len_ori>0) -- { -- switch(hidden_ssid_mode) -- { -- case 1: -- { -- u8 *next_ie = ssid_ie + 2 + ssid_len_ori; -- u32 remain_len = 0; -- -- remain_len = ies_len -(next_ie-ies); -- -- ssid_ie[1] = 0; -- _rtw_memcpy(ssid_ie+2, next_ie, remain_len); -- len_diff -= ssid_len_ori; -- -- break; -- } -- case 2: -- _rtw_memset(&ssid_ie[2], 0, ssid_len_ori); -- break; -- default: -- break; -- } -- } -- -- return len_diff; --} -- --void issue_beacon(_adapter *padapter) --{ -- _irqL irqL; -- struct xmit_frame *pmgntframe; -- struct pkt_attrib *pattrib; - unsigned char *pframe; - struct rtw_ieee80211_hdr *pwlanhdr; - unsigned short *fctrl; - unsigned int rate_len; - struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); -+#if defined (CONFIG_AP_MODE) && defined (CONFIG_NATIVEAP_MLME) -+ _irqL irqL; - struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); -+#endif //#if defined (CONFIG_AP_MODE) && defined (CONFIG_NATIVEAP_MLME) - struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); - struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); - WLAN_BSSID_EX *cur_network = &(pmlmeinfo->network); -@@ -5630,8 +6502,9 @@ void issue_beacon(_adapter *padapter) - DBG_871X("%s, alloc mgnt frame fail\n", __FUNCTION__); - return; - } -- -- _enter_critical_bh(&pmlmepriv->bcn_update_lock, &irqL); -+#if defined (CONFIG_AP_MODE) && defined (CONFIG_NATIVEAP_MLME) -+ _enter_critical_bh(&pmlmepriv->bcn_update_lock, &irqL); -+#endif //#if defined (CONFIG_AP_MODE) && defined (CONFIG_NATIVEAP_MLME) - - //update attribute - pattrib = &pmgntframe->attrib; -@@ -5670,7 +6543,7 @@ void issue_beacon(_adapter *padapter) - if(rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO) && wpsie && wpsielen>0) - { - uint wps_offset, remainder_ielen; -- u8 *premainder_ie, *pframe_wscie; -+ u8 *premainder_ie, *pframe_wscie; - - wps_offset = (uint)(wpsie - cur_network->IEs); - -@@ -5679,24 +6552,22 @@ void issue_beacon(_adapter *padapter) - remainder_ielen = cur_network->IELength - wps_offset - wpsielen; - - #ifdef CONFIG_IOCTL_CFG80211 -- if(wdev_to_priv(padapter->rtw_wdev)->p2p_enabled) -+ if(wdev_to_priv(padapter->rtw_wdev)->p2p_enabled && pwdinfo->driver_interface == DRIVER_CFG80211 ) - { - if(pmlmepriv->wps_beacon_ie && pmlmepriv->wps_beacon_ie_len>0) - { - _rtw_memcpy(pframe, cur_network->IEs, wps_offset); - pframe += wps_offset; - pattrib->pktlen += wps_offset; -- -- _rtw_memcpy(pframe, pmlmepriv->wps_beacon_ie, pmlmepriv->wps_beacon_ie_len); - -+ _rtw_memcpy(pframe, pmlmepriv->wps_beacon_ie, pmlmepriv->wps_beacon_ie_len); - pframe += pmlmepriv->wps_beacon_ie_len; -- pattrib->pktlen += pmlmepriv->wps_beacon_ie_len; -+ pattrib->pktlen += pmlmepriv->wps_beacon_ie_len; - - //copy remainder_ie to pframe - _rtw_memcpy(pframe, premainder_ie, remainder_ielen); - pframe += remainder_ielen; -- pattrib->pktlen += remainder_ielen; -- -+ pattrib->pktlen += remainder_ielen; - } - else - { -@@ -5708,7 +6579,6 @@ void issue_beacon(_adapter *padapter) - else - #endif //CONFIG_IOCTL_CFG80211 - { -- - pframe_wscie = pframe + wps_offset; - _rtw_memcpy(pframe, cur_network->IEs, wps_offset+wpsielen); - pframe += (wps_offset + wpsielen); -@@ -5726,7 +6596,7 @@ void issue_beacon(_adapter *padapter) - - // Value: - // Category ID -- *(u16*) ( pframe + insert_len ) = cpu_to_be16( WPS_PDT_CID_RTK_WIDI ); -+ *(u16*) ( pframe + insert_len ) = cpu_to_be16( WPS_PDT_CID_MULIT_MEDIA ); - insert_len += 2; - - // OUI -@@ -5734,7 +6604,7 @@ void issue_beacon(_adapter *padapter) - insert_len += 4; - - // Sub Category ID -- *(u16*) ( pframe + insert_len ) = cpu_to_be16( WPS_PDT_SCID_RTK_DMP ); -+ *(u16*) ( pframe + insert_len ) = cpu_to_be16( WPS_PDT_SCID_MEDIA_SERVER ); - insert_len += 2; - - -@@ -5762,9 +6632,8 @@ void issue_beacon(_adapter *padapter) - //copy remainder_ie to pframe - _rtw_memcpy(pframe, premainder_ie, remainder_ielen); - pframe += remainder_ielen; -- pattrib->pktlen += remainder_ielen; -+ pattrib->pktlen += remainder_ielen; - } -- - } - else - #endif //CONFIG_P2P -@@ -5780,12 +6649,27 @@ void issue_beacon(_adapter *padapter) - pattrib->pktlen += (cur_network->IELength+len_diff); - } - -+ { -+ u8 *wps_ie; -+ uint wps_ielen; -+ u8 sr = 0; -+ wps_ie = rtw_get_wps_ie(pmgntframe->buf_addr+TXDESC_OFFSET+sizeof (struct rtw_ieee80211_hdr_3addr)+_BEACON_IE_OFFSET_, -+ pattrib->pktlen-sizeof (struct rtw_ieee80211_hdr_3addr)-_BEACON_IE_OFFSET_, NULL, &wps_ielen); -+ if (wps_ie && wps_ielen>0) { -+ rtw_get_wps_attr_content(wps_ie, wps_ielen, WPS_ATTR_SELECTED_REGISTRAR, (u8*)(&sr), NULL); -+ } -+ if (sr != 0) -+ set_fwstate(pmlmepriv, WIFI_UNDER_WPS); -+ else -+ _clr_fwstate_(pmlmepriv, WIFI_UNDER_WPS); ++ //if pwdinfo->role == P2P_ROLE_DEVICE will call issue_probersp_p2p() ++ len = pmlmepriv->p2p_go_probe_resp_ie_len; ++ if(pmlmepriv->p2p_go_probe_resp_ie && len>0) ++ _rtw_memcpy(pframe, pmlmepriv->p2p_go_probe_resp_ie, len); + } -+ - #ifdef CONFIG_P2P - if(rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO)) - { - u32 len; - #ifdef CONFIG_IOCTL_CFG80211 -- if(wdev_to_priv(padapter->rtw_wdev)->p2p_enabled) -+ if(wdev_to_priv(padapter->rtw_wdev)->p2p_enabled && pwdinfo->driver_interface == DRIVER_CFG80211 ) - { - len = pmlmepriv->p2p_beacon_ie_len; - if(pmlmepriv->p2p_beacon_ie && len>0) -@@ -5797,11 +6681,26 @@ void issue_beacon(_adapter *padapter) - len = build_beacon_p2p_ie(pwdinfo, pframe); - } - -- - pframe += len; - pattrib->pktlen += len; - #ifdef CONFIG_WFD -- len = build_beacon_wfd_ie( pwdinfo, pframe ); -+#ifdef CONFIG_IOCTL_CFG80211 -+ if(_TRUE == pwdinfo->wfd_info->wfd_enable) -+#endif //CONFIG_IOCTL_CFG80211 -+ { -+ len = build_beacon_wfd_ie( pwdinfo, pframe ); -+ } -+#ifdef CONFIG_IOCTL_CFG80211 -+ else -+ { -+ len = 0; -+ if(pmlmepriv->wfd_beacon_ie && pmlmepriv->wfd_beacon_ie_len>0) -+ { -+ len = pmlmepriv->wfd_beacon_ie_len; -+ _rtw_memcpy(pframe, pmlmepriv->wfd_beacon_ie, len); -+ } -+ } ++ else +#endif //CONFIG_IOCTL_CFG80211 - pframe += len; - pattrib->pktlen += len; - #endif //CONFIG_WFD -@@ -5867,9 +6766,11 @@ void issue_beacon(_adapter *padapter) - - _issue_bcn: - -+#if defined (CONFIG_AP_MODE) && defined (CONFIG_NATIVEAP_MLME) - pmlmepriv->update_bcn = _FALSE; - - _exit_critical_bh(&pmlmepriv->bcn_update_lock, &irqL); -+#endif //#if defined (CONFIG_AP_MODE) && defined (CONFIG_NATIVEAP_MLME) - - if ((pattrib->pktlen + TXDESC_SIZE) > 512) - { -@@ -5887,8 +6788,6 @@ _issue_bcn: - - void issue_probersp(_adapter *padapter, unsigned char *da, u8 is_valid_p2p_probereq) - { -- u8 *pwps_ie; -- uint wps_ielen; - struct xmit_frame *pmgntframe; - struct pkt_attrib *pattrib; - unsigned char *pframe; -@@ -5896,7 +6795,11 @@ void issue_probersp(_adapter *padapter, - unsigned short *fctrl; - unsigned char *mac, *bssid; - struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); -+#if defined (CONFIG_AP_MODE) && defined (CONFIG_NATIVEAP_MLME) -+ u8 *pwps_ie; -+ uint wps_ielen; - struct mlme_priv *pmlmepriv = &padapter->mlmepriv; -+#endif //#if defined (CONFIG_AP_MODE) && defined (CONFIG_NATIVEAP_MLME) - struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); - struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); - WLAN_BSSID_EX *cur_network = &(pmlmeinfo->network); -@@ -5908,8 +6811,6 @@ void issue_probersp(_adapter *padapter, - #endif //CONFIG_WFD - #endif //CONFIG_P2P - -- -- - //DBG_871X("%s\n", __FUNCTION__); - - if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) -@@ -5946,7 +6847,7 @@ void issue_probersp(_adapter *padapter, - pframe += pattrib->hdrlen; - - -- if(cur_network->IELength>MAX_IE_SZ || cur_network->IELength<_FIXED_IE_LENGTH_) -+ if(cur_network->IELength>MAX_IE_SZ) - return; - - #if defined (CONFIG_AP_MODE) && defined (CONFIG_NATIVEAP_MLME) -@@ -5991,7 +6892,40 @@ void issue_probersp(_adapter *padapter, - pframe += cur_network->IELength; - pattrib->pktlen += cur_network->IELength; - } -- -+ -+ /* retrieve SSID IE from cur_network->Ssid */ + { -+ u8 *ssid_ie; -+ sint ssid_ielen; -+ sint ssid_ielen_diff; -+ u8 buf[MAX_IE_SZ]; -+ u8 *ies = pmgntframe->buf_addr+TXDESC_OFFSET+sizeof(struct rtw_ieee80211_hdr_3addr); -+ -+ ssid_ie = rtw_get_ie(ies+_FIXED_IE_LENGTH_, _SSID_IE_, &ssid_ielen, -+ (pframe-ies)-_FIXED_IE_LENGTH_); -+ -+ ssid_ielen_diff = cur_network->Ssid.SsidLength - ssid_ielen; -+ -+ if (ssid_ie && cur_network->Ssid.SsidLength) { -+ uint remainder_ielen; -+ u8 *remainder_ie; -+ remainder_ie = ssid_ie+2; -+ remainder_ielen = (pframe-remainder_ie); -+ -+ LOG_LEVEL(_drv_warning_, FUNC_ADPT_FMT" remainder_ielen > MAX_IE_SZ\n", FUNC_ADPT_ARG(padapter)); -+ if (remainder_ielen > MAX_IE_SZ) { -+ remainder_ielen = MAX_IE_SZ; -+ } -+ -+ _rtw_memcpy(buf, remainder_ie, remainder_ielen); -+ _rtw_memcpy(remainder_ie+ssid_ielen_diff, buf, remainder_ielen); -+ *(ssid_ie+1) = cur_network->Ssid.SsidLength; -+ _rtw_memcpy(ssid_ie+2, cur_network->Ssid.Ssid, cur_network->Ssid.SsidLength); -+ -+ pframe += ssid_ielen_diff; -+ pattrib->pktlen += ssid_ielen_diff; -+ } -+ } - } - else - #endif -@@ -6053,11 +6987,11 @@ void issue_probersp(_adapter *padapter, - } - - #ifdef CONFIG_P2P -- if(rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO) && is_valid_p2p_probereq) -+ if(rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO) /*&& is_valid_p2p_probereq*/) - { - u32 len; - #ifdef CONFIG_IOCTL_CFG80211 -- if(wdev_to_priv(padapter->rtw_wdev)->p2p_enabled) -+ if(wdev_to_priv(padapter->rtw_wdev)->p2p_enabled && pwdinfo->driver_interface == DRIVER_CFG80211 ) - { - //if pwdinfo->role == P2P_ROLE_DEVICE will call issue_probersp_p2p() - len = pmlmepriv->p2p_go_probe_resp_ie_len; -@@ -6065,7 +6999,7 @@ void issue_probersp(_adapter *padapter, - _rtw_memcpy(pframe, pmlmepriv->p2p_go_probe_resp_ie, len); - } - else --#endif //CONFIG_IOCTL_CFG80211 -+#endif //CONFIG_IOCTL_CFG80211 - { - len = build_probe_resp_p2p_ie(pwdinfo, pframe); ++ len = build_probe_resp_p2p_ie(pwdinfo, pframe); } -@@ -6074,15 +7008,62 @@ void issue_probersp(_adapter *padapter, - pattrib->pktlen += len; - - #ifdef CONFIG_WFD -- wfdielen = build_probe_resp_wfd_ie(pwdinfo, pframe); -- pframe += wfdielen; -- pattrib->pktlen += wfdielen; + +- if( pattrib->signal_strength + TDLS_SIGNAL_THRESH >= precvpriv->signal_strength ) ++ pframe += len; ++ pattrib->pktlen += len; ++ ++#ifdef CONFIG_WFD +#ifdef CONFIG_IOCTL_CFG80211 + if(_TRUE == pwdinfo->wfd_info->wfd_enable) +#endif //CONFIG_IOCTL_CFG80211 -+ { + { +- issue_tdls_setup_req(adapter, psa); + len = build_probe_resp_wfd_ie(pwdinfo, pframe, 0); + } +#ifdef CONFIG_IOCTL_CFG80211 @@ -15191,17 +15295,17 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + len = pmlmepriv->wfd_probe_resp_ie_len; + _rtw_memcpy(pframe, pmlmepriv->wfd_probe_resp_ie, len); + } -+ } + } +#endif //CONFIG_IOCTL_CFG80211 + pframe += len; + pattrib->pktlen += len; - #endif //CONFIG_WFD - -- } -+ } - #endif //CONFIG_P2P - ++#endif //CONFIG_WFD ++ + } ++#endif //CONFIG_P2P +- return _FAIL; ++ +#ifdef CONFIG_AUTO_AP_MODE +{ + struct sta_info *psta; @@ -15229,106 +15333,435 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + + pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, sizeof(RC_INFO), RC_INFO, &pattrib->pktlen); + } -+} + } +#endif //CONFIG_AUTO_AP_MODE -+ -+ - pattrib->last_txcmdsz = pattrib->pktlen; + +-#endif + +-int update_hidden_ssid(u8 *ies, u32 ies_len, u8 hidden_ssid_mode) +-{ +- u8 *ssid_ie; +- sint ssid_len_ori; +- int len_diff = 0; ++ pattrib->last_txcmdsz = pattrib->pktlen; +- ssid_ie = rtw_get_ie(ies, WLAN_EID_SSID, &ssid_len_ori, ies_len); -@@ -6092,8 +7073,9 @@ void issue_probersp(_adapter *padapter, +- //DBG_871X("%s hidden_ssid_mode:%u, ssid_ie:%p, ssid_len_ori:%d\n", __FUNCTION__, hidden_ssid_mode, ssid_ie, ssid_len_ori); ++ dump_mgntframe(padapter, pmgntframe); + +- if(ssid_ie && ssid_len_ori>0) +- { +- switch(hidden_ssid_mode) +- { +- case 1: +- { +- u8 *next_ie = ssid_ie + 2 + ssid_len_ori; +- u32 remain_len = 0; +- +- remain_len = ies_len -(next_ie-ies); +- +- ssid_ie[1] = 0; +- _rtw_memcpy(ssid_ie+2, next_ie, remain_len); +- len_diff -= ssid_len_ori; +- +- break; +- } +- case 2: +- _rtw_memset(&ssid_ie[2], 0, ssid_len_ori); +- break; +- default: +- break; +- } +- } ++ return; +- return len_diff; } --void issue_probereq(_adapter *padapter, NDIS_802_11_SSID *pssid, u8 blnbc) +-void issue_beacon(_adapter *padapter) +int _issue_probereq(_adapter *padapter, NDIS_802_11_SSID *pssid, u8 *da, int wait_ack) { +- _irqL irqL; +- struct xmit_frame *pmgntframe; +- struct pkt_attrib *pattrib; +- unsigned char *pframe; +- struct rtw_ieee80211_hdr *pwlanhdr; +- unsigned short *fctrl; +- unsigned int rate_len; +- struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); + int ret = _FAIL; - struct xmit_frame *pmgntframe; - struct pkt_attrib *pattrib; - unsigned char *pframe; -@@ -6108,11 +7090,11 @@ void issue_probereq(_adapter *padapter, - int bssrate_len = 0; ++ struct xmit_frame *pmgntframe; ++ struct pkt_attrib *pattrib; ++ unsigned char *pframe; ++ struct rtw_ieee80211_hdr *pwlanhdr; ++ unsigned short *fctrl; ++ unsigned char *mac; ++ unsigned char bssrate[NumRates]; ++ struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); + struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); + struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); + struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); +- WLAN_BSSID_EX *cur_network = &(pmlmeinfo->network); ++ int bssrate_len = 0; u8 bc_addr[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; +-#ifdef CONFIG_P2P +- struct wifidirect_info *pwdinfo = &(padapter->wdinfo); +-#endif //CONFIG_P2P +- -- RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("+issue_probereq\n")); +- //DBG_871X("%s\n", __FUNCTION__); + RT_TRACE(_module_rtl871x_mlme_c_,_drv_notice_,("+issue_probereq\n")); if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) { +- DBG_871X("%s, alloc mgnt frame fail\n", __FUNCTION__); - return; + goto exit; } +- _enter_critical_bh(&pmlmepriv->bcn_update_lock, &irqL); +- //update attribute -@@ -6130,11 +7112,11 @@ void issue_probereq(_adapter *padapter, + pattrib = &pmgntframe->attrib; + update_mgntframe_attrib(padapter, pattrib); +- pattrib->qsel = 0x10; +- ++ ++ + _rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); +- ++ + pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; +- pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; +- +- ++ pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; ++ ++ mac = myid(&(padapter->eeprompriv)); ++ fctrl = &(pwlanhdr->frame_ctl); *(fctrl) = 0; +- +- _rtw_memcpy(pwlanhdr->addr1, bc_addr, ETH_ALEN); +- _rtw_memcpy(pwlanhdr->addr2, myid(&(padapter->eeprompriv)), ETH_ALEN); +- _rtw_memcpy(pwlanhdr->addr3, get_my_bssid(cur_network), ETH_ALEN); -- if ( 0 == blnbc ) +- SetSeqNum(pwlanhdr, 0/*pmlmeext->mgnt_seq*/); +- //pmlmeext->mgnt_seq++; +- SetFrameSubType(pframe, WIFI_BEACON); +- +- pframe += sizeof(struct rtw_ieee80211_hdr_3addr); +- pattrib->pktlen = sizeof (struct rtw_ieee80211_hdr_3addr); +- +- if( (pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE) + if (da) { - // unicast probe request frame -- _rtw_memcpy(pwlanhdr->addr1, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN); -- _rtw_memcpy(pwlanhdr->addr3, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN); +- //DBG_871X("ie len=%d\n", cur_network->IELength); +-#ifdef CONFIG_P2P +- // for P2P : Primary Device Type & Device Name +- u32 wpsielen=0, insert_len=0; +- u8 *wpsie=NULL; +- wpsie = rtw_get_wps_ie(cur_network->IEs+_FIXED_IE_LENGTH_, cur_network->IELength-_FIXED_IE_LENGTH_, NULL, &wpsielen); +- +- if(rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO) && wpsie && wpsielen>0) +- { +- uint wps_offset, remainder_ielen; +- u8 *premainder_ie, *pframe_wscie; +- +- wps_offset = (uint)(wpsie - cur_network->IEs); +- +- premainder_ie = wpsie + wpsielen; ++ // unicast probe request frame + _rtw_memcpy(pwlanhdr->addr1, da, ETH_ALEN); + _rtw_memcpy(pwlanhdr->addr3, da, ETH_ALEN); - } - else - { -@@ -6191,11 +7173,64 @@ void issue_probereq(_adapter *padapter, ++ } ++ else ++ { ++ // broadcast probe request frame ++ _rtw_memcpy(pwlanhdr->addr1, bc_addr, ETH_ALEN); ++ _rtw_memcpy(pwlanhdr->addr3, bc_addr, ETH_ALEN); ++ } - pattrib->last_txcmdsz = pattrib->pktlen; +- remainder_ielen = cur_network->IELength - wps_offset - wpsielen; ++ _rtw_memcpy(pwlanhdr->addr2, mac, ETH_ALEN); -- RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("issuing probe_req, tx_len=%d\n", pattrib->last_txcmdsz)); +-#ifdef CONFIG_IOCTL_CFG80211 +- if(wdev_to_priv(padapter->rtw_wdev)->p2p_enabled) +- { +- if(pmlmepriv->wps_beacon_ie && pmlmepriv->wps_beacon_ie_len>0) +- { +- _rtw_memcpy(pframe, cur_network->IEs, wps_offset); +- pframe += wps_offset; +- pattrib->pktlen += wps_offset; +- +- _rtw_memcpy(pframe, pmlmepriv->wps_beacon_ie, pmlmepriv->wps_beacon_ie_len); ++ SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); ++ pmlmeext->mgnt_seq++; ++ SetFrameSubType(pframe, WIFI_PROBEREQ); + +- pframe += pmlmepriv->wps_beacon_ie_len; +- pattrib->pktlen += pmlmepriv->wps_beacon_ie_len; ++ pframe += sizeof (struct rtw_ieee80211_hdr_3addr); ++ pattrib->pktlen = sizeof (struct rtw_ieee80211_hdr_3addr); + +- //copy remainder_ie to pframe +- _rtw_memcpy(pframe, premainder_ie, remainder_ielen); +- pframe += remainder_ielen; +- pattrib->pktlen += remainder_ielen; +- +- } +- else +- { +- _rtw_memcpy(pframe, cur_network->IEs, cur_network->IELength); +- pframe += cur_network->IELength; +- pattrib->pktlen += cur_network->IELength; +- } +- } +- else +-#endif //CONFIG_IOCTL_CFG80211 +- { ++ if(pssid) ++ pframe = rtw_set_ie(pframe, _SSID_IE_, pssid->SsidLength, pssid->Ssid, &(pattrib->pktlen)); ++ else ++ pframe = rtw_set_ie(pframe, _SSID_IE_, 0, NULL, &(pattrib->pktlen)); + +- pframe_wscie = pframe + wps_offset; +- _rtw_memcpy(pframe, cur_network->IEs, wps_offset+wpsielen); +- pframe += (wps_offset + wpsielen); +- pattrib->pktlen += (wps_offset + wpsielen); ++ get_rate_set(padapter, bssrate, &bssrate_len); + +- //now pframe is end of wsc ie, insert Primary Device Type & Device Name +- // Primary Device Type +- // Type: +- *(u16*) ( pframe + insert_len) = cpu_to_be16( WPS_ATTR_PRIMARY_DEV_TYPE ); +- insert_len += 2; +- +- // Length: +- *(u16*) ( pframe + insert_len ) = cpu_to_be16( 0x0008 ); +- insert_len += 2; +- +- // Value: +- // Category ID +- *(u16*) ( pframe + insert_len ) = cpu_to_be16( WPS_PDT_CID_RTK_WIDI ); +- insert_len += 2; ++ if (bssrate_len > 8) ++ { ++ pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_ , 8, bssrate, &(pattrib->pktlen)); ++ pframe = rtw_set_ie(pframe, _EXT_SUPPORTEDRATES_IE_ , (bssrate_len - 8), (bssrate + 8), &(pattrib->pktlen)); ++ } ++ else ++ { ++ pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_ , bssrate_len , bssrate, &(pattrib->pktlen)); ++ } + +- // OUI +- *(u32*) ( pframe + insert_len ) = cpu_to_be32( WPSOUI ); +- insert_len += 4; +- +- // Sub Category ID +- *(u16*) ( pframe + insert_len ) = cpu_to_be16( WPS_PDT_SCID_RTK_DMP ); +- insert_len += 2; +- +- +- // Device Name +- // Type: +- *(u16*) ( pframe + insert_len ) = cpu_to_be16( WPS_ATTR_DEVICE_NAME ); +- insert_len += 2; +- +- // Length: +- *(u16*) ( pframe + insert_len ) = cpu_to_be16( pwdinfo->device_name_len ); +- insert_len += 2; +- +- // Value: +- _rtw_memcpy( pframe + insert_len, pwdinfo->device_name, pwdinfo->device_name_len ); +- insert_len += pwdinfo->device_name_len; +- +- +- //update wsc ie length +- *(pframe_wscie+1) = (wpsielen -2) + insert_len; +- +- //pframe move to end +- pframe+=insert_len; +- pattrib->pktlen += insert_len; +- +- //copy remainder_ie to pframe +- _rtw_memcpy(pframe, premainder_ie, remainder_ielen); +- pframe += remainder_ielen; +- pattrib->pktlen += remainder_ielen; +- } +- +- } +- else +-#endif //CONFIG_P2P +- { +- int len_diff; +- _rtw_memcpy(pframe, cur_network->IEs, cur_network->IELength); +- len_diff = update_hidden_ssid( +- pframe+_BEACON_IE_OFFSET_ +- , cur_network->IELength-_BEACON_IE_OFFSET_ +- , pmlmeinfo->hidden_ssid_mode +- ); +- pframe += (cur_network->IELength+len_diff); +- pattrib->pktlen += (cur_network->IELength+len_diff); +- } +- +-#ifdef CONFIG_P2P +- if(rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO)) +- { +- u32 len; +-#ifdef CONFIG_IOCTL_CFG80211 +- if(wdev_to_priv(padapter->rtw_wdev)->p2p_enabled) +- { +- len = pmlmepriv->p2p_beacon_ie_len; +- if(pmlmepriv->p2p_beacon_ie && len>0) +- _rtw_memcpy(pframe, pmlmepriv->p2p_beacon_ie, len); +- } +- else +-#endif //CONFIG_IOCTL_CFG80211 +- { +- len = build_beacon_p2p_ie(pwdinfo, pframe); +- } ++#if 0 ++ //add wps_ie for wps2.0 ++ if(pmlmepriv->probereq_wpsie_len>0 && pmlmepriv->probereq_wpsie_lenprobereq_wpsie, pmlmepriv->probereq_wpsie_len); ++ pframe += pmlmepriv->probereq_wpsie_len; ++ pattrib->pktlen += pmlmepriv->probereq_wpsie_len; ++ //pmlmepriv->probereq_wpsie_len = 0 ;//reset to zero ++ } ++#else ++ //add wps_ie for wps2.0 ++ if(pmlmepriv->wps_probe_req_ie_len>0 && pmlmepriv->wps_probe_req_ie) ++ { ++ _rtw_memcpy(pframe, pmlmepriv->wps_probe_req_ie, pmlmepriv->wps_probe_req_ie_len); ++ pframe += pmlmepriv->wps_probe_req_ie_len; ++ pattrib->pktlen += pmlmepriv->wps_probe_req_ie_len; ++ //pmlmepriv->wps_probe_req_ie_len = 0 ;//reset to zero ++ } ++#endif + +- +- pframe += len; +- pattrib->pktlen += len; +-#ifdef CONFIG_WFD +- len = build_beacon_wfd_ie( pwdinfo, pframe ); +- pframe += len; +- pattrib->pktlen += len; +-#endif //CONFIG_WFD +- } +-#endif //CONFIG_P2P ++ pattrib->last_txcmdsz = pattrib->pktlen; + +- goto _issue_bcn; + RT_TRACE(_module_rtl871x_mlme_c_,_drv_notice_,("issuing probe_req, tx_len=%d\n", pattrib->last_txcmdsz)); -- dump_mgntframe(padapter, pmgntframe); + if (wait_ack) { + ret = dump_mgntframe_and_wait_ack(padapter, pmgntframe); + } else { + dump_mgntframe(padapter, pmgntframe); + ret = _SUCCESS; -+ } + } -- return; +- //below for ad-hoc mode +- +- //timestamp will be inserted by hardware +- pframe += 8; +- pattrib->pktlen += 8; +- +- // beacon interval: 2 bytes +- +- _rtw_memcpy(pframe, (unsigned char *)(rtw_get_beacon_interval_from_ie(cur_network->IEs)), 2); +- +- pframe += 2; +- pattrib->pktlen += 2; +- +- // capability info: 2 bytes +- +- _rtw_memcpy(pframe, (unsigned char *)(rtw_get_capability_from_ie(cur_network->IEs)), 2); +- +- pframe += 2; +- pattrib->pktlen += 2; +- +- // SSID +- pframe = rtw_set_ie(pframe, _SSID_IE_, cur_network->Ssid.SsidLength, cur_network->Ssid.Ssid, &pattrib->pktlen); +- +- // supported rates... +- rate_len = rtw_get_rateset_len(cur_network->SupportedRates); +- pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_, ((rate_len > 8)? 8: rate_len), cur_network->SupportedRates, &pattrib->pktlen); +- +- // DS parameter set +- pframe = rtw_set_ie(pframe, _DSSET_IE_, 1, (unsigned char *)&(cur_network->Configuration.DSConfig), &pattrib->pktlen); +- +- //if( (pmlmeinfo->state&0x03) == WIFI_FW_ADHOC_STATE) +- { +- u8 erpinfo=0; +- u32 ATIMWindow; +- // IBSS Parameter Set... +- //ATIMWindow = cur->Configuration.ATIMWindow; +- ATIMWindow = 0; +- pframe = rtw_set_ie(pframe, _IBSS_PARA_IE_, 2, (unsigned char *)(&ATIMWindow), &pattrib->pktlen); +exit: + return ret; +} -+ + +- //ERP IE +- pframe = rtw_set_ie(pframe, _ERPINFO_IE_, 1, &erpinfo, &pattrib->pktlen); +- } +inline void issue_probereq(_adapter *padapter, NDIS_802_11_SSID *pssid, u8 *da) +{ + _issue_probereq(padapter, pssid, da, _FALSE); +} -+ + +int issue_probereq_ex(_adapter *padapter, NDIS_802_11_SSID *pssid, u8 *da, + int try_cnt, int wait_ms) +{ + int ret; + int i = 0; + u32 start = rtw_get_current_time(); -+ + +- // EXTERNDED SUPPORTED RATE +- if (rate_len > 8) + do -+ { + { +- pframe = rtw_set_ie(pframe, _EXT_SUPPORTEDRATES_IE_, (rate_len - 8), (cur_network->SupportedRates + 8), &pattrib->pktlen); +- } + ret = _issue_probereq(padapter, pssid, da, wait_ms>0?_TRUE:_FALSE); -+ + + i++; -+ + +- //todo:HT for adhoc + if (padapter->bDriverStopped || padapter->bSurpriseRemoved) + break; -+ + +-_issue_bcn: + if(i < try_cnt && wait_ms > 0 && ret==_FAIL) + rtw_msleep_os(wait_ms); -+ + +- pmlmepriv->update_bcn = _FALSE; +- +- _exit_critical_bh(&pmlmepriv->bcn_update_lock, &irqL); + }while((ipktlen + TXDESC_SIZE) > 512) +- { +- DBG_871X("beacon frame too large\n"); +- return; + if (ret != _FAIL) { + ret = _SUCCESS; + #ifndef DBG_XMIT_ACK + goto exit; + #endif -+ } -+ + } +- +- pattrib->last_txcmdsz = pattrib->pktlen; +- +- //DBG_871X("issue bcn_sz=%d\n", pattrib->last_txcmdsz); +- +- dump_mgntframe(padapter, pmgntframe); + + if (try_cnt && wait_ms) { + if (da) + DBG_871X(FUNC_ADPT_FMT" to "MAC_FMT", ch:%u%s, %d/%d in %u ms\n", @@ -15343,49 +15776,685 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + return ret; } - // if psta == NULL, indiate we are station(client) now... -@@ -6211,16 +7246,7 @@ void issue_auth(_adapter *padapter, stru - int use_shared_key = 0; - struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); +-void issue_probersp(_adapter *padapter, unsigned char *da, u8 is_valid_p2p_probereq) ++// if psta == NULL, indiate we are station(client) now... ++void issue_auth(_adapter *padapter, struct sta_info *psta, unsigned short status) + { +- u8 *pwps_ie; +- uint wps_ielen; + struct xmit_frame *pmgntframe; + struct pkt_attrib *pattrib; + unsigned char *pframe; + struct rtw_ieee80211_hdr *pwlanhdr; +- unsigned short *fctrl; +- unsigned char *mac, *bssid; +- struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); +- struct mlme_priv *pmlmepriv = &padapter->mlmepriv; ++ unsigned short *fctrl; ++ unsigned int val32; ++ unsigned short val16; ++ int use_shared_key = 0; ++ struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); -- struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); + struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); +- WLAN_BSSID_EX *cur_network = &(pmlmeinfo->network); +- unsigned int rate_len; +-#ifdef CONFIG_P2P +- struct wifidirect_info *pwdinfo = &(padapter->wdinfo); +-#ifdef CONFIG_WFD +- u32 wfdielen = 0; +-#endif //CONFIG_WFD +-#endif //CONFIG_P2P - --/* -- if( (psta == NULL) && (pmlmeinfo->auth_seq != 3) ) { -- // Because of AP's not receiving deauth before -- // AP may: 1)not response auth or 2)deauth us after link is complete -- // issue deauth before issuing auth to deal with the situation -- issue_deauth(padapter, (&(pmlmeinfo->network))->MacAddress, WLAN_REASON_DEAUTH_LEAVING); -- } --*/ -+ struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); +- +- +- //DBG_871X("%s\n", __FUNCTION__); if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) { -@@ -6298,12 +7324,12 @@ void issue_auth(_adapter *padapter, stru - val16 = cpu_to_le16(val16); - use_shared_key = 1; - } -- //DBG_8192C("%s auth_algo= %s auth_seq=%d\n",__FUNCTION__,(pmlmeinfo->auth_algo==0)?"OPEN":"SHARED",pmlmeinfo->auth_seq); -+ //DBG_871X("%s auth_algo= %s auth_seq=%d\n",__FUNCTION__,(pmlmeinfo->auth_algo==0)?"OPEN":"SHARED",pmlmeinfo->auth_seq); - - //setting IV for auth seq #3 - if ((pmlmeinfo->auth_seq == 3) && (pmlmeinfo->state & WIFI_FW_AUTH_STATE) && (use_shared_key==1)) - { -- //DBG_8192C("==> iv(%d),key_index(%d)\n",pmlmeinfo->iv,pmlmeinfo->key_index); -+ //DBG_871X("==> iv(%d),key_index(%d)\n",pmlmeinfo->iv,pmlmeinfo->key_index); - val32 = ((pmlmeinfo->iv++) | (pmlmeinfo->key_index << 30)); - val32 = cpu_to_le32(val32); - pframe = rtw_set_fixed_ie(pframe, 4, (unsigned char *)&val32, &(pattrib->pktlen)); -@@ -6373,7 +7399,6 @@ void issue_asocrsp(_adapter *padapter, u - #ifdef CONFIG_WFD - u32 wfdielen = 0; - #endif //CONFIG_WFD -- - #endif //CONFIG_P2P +- DBG_871X("%s, alloc mgnt frame fail\n", __FUNCTION__); + return; + } - DBG_871X("%s\n", __FUNCTION__); -@@ -6503,21 +7528,30 @@ void issue_asocrsp(_adapter *padapter, u +- + //update attribute + pattrib = &pmgntframe->attrib; +- update_mgntframe_attrib(padapter, pattrib); +- ++ update_mgntframe_attrib(padapter, pattrib); ++ + _rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); +- ++ + pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; +- pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; +- +- mac = myid(&(padapter->eeprompriv)); +- bssid = cur_network->MacAddress; +- ++ pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; ++ + fctrl = &(pwlanhdr->frame_ctl); + *(fctrl) = 0; +- _rtw_memcpy(pwlanhdr->addr1, da, ETH_ALEN); +- _rtw_memcpy(pwlanhdr->addr2, mac, ETH_ALEN); +- _rtw_memcpy(pwlanhdr->addr3, bssid, ETH_ALEN); + + SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); + pmlmeext->mgnt_seq++; +- SetFrameSubType(fctrl, WIFI_PROBERSP); +- +- pattrib->hdrlen = sizeof(struct rtw_ieee80211_hdr_3addr); +- pattrib->pktlen = pattrib->hdrlen; +- pframe += pattrib->hdrlen; ++ SetFrameSubType(pframe, WIFI_AUTH); + ++ pframe += sizeof(struct rtw_ieee80211_hdr_3addr); ++ pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); + +- if(cur_network->IELength>MAX_IE_SZ || cur_network->IELength<_FIXED_IE_LENGTH_) +- return; +- +-#if defined (CONFIG_AP_MODE) && defined (CONFIG_NATIVEAP_MLME) +- if( (pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE) ++ ++ if(psta)// for AP mode + { +- pwps_ie = rtw_get_wps_ie(cur_network->IEs+_FIXED_IE_LENGTH_, cur_network->IELength-_FIXED_IE_LENGTH_, NULL, &wps_ielen); +- +- //inerset & update wps_probe_resp_ie +- if((pmlmepriv->wps_probe_resp_ie!=NULL) && pwps_ie && (wps_ielen>0)) +- { +- uint wps_offset, remainder_ielen; +- u8 *premainder_ie; ++#ifdef CONFIG_NATIVEAP_MLME ++ ++ _rtw_memcpy(pwlanhdr->addr1, psta->hwaddr, ETH_ALEN); ++ _rtw_memcpy(pwlanhdr->addr2, myid(&(padapter->eeprompriv)), ETH_ALEN); ++ _rtw_memcpy(pwlanhdr->addr3, myid(&(padapter->eeprompriv)), ETH_ALEN); ++ + +- wps_offset = (uint)(pwps_ie - cur_network->IEs); ++ // setting auth algo number ++ val16 = (u16)psta->authalg; + +- premainder_ie = pwps_ie + wps_ielen; ++ if(status != _STATS_SUCCESSFUL_) ++ val16 = 0; + +- remainder_ielen = cur_network->IELength - wps_offset - wps_ielen; ++ if (val16) { ++ val16 = cpu_to_le16(val16); ++ use_shared_key = 1; ++ } + +- _rtw_memcpy(pframe, cur_network->IEs, wps_offset); +- pframe += wps_offset; +- pattrib->pktlen += wps_offset; ++ pframe = rtw_set_fixed_ie(pframe, _AUTH_ALGM_NUM_, (unsigned char *)&val16, &(pattrib->pktlen)); + +- wps_ielen = (uint)pmlmepriv->wps_probe_resp_ie[1];//to get ie data len +- if((wps_offset+wps_ielen+2)<=MAX_IE_SZ) +- { +- _rtw_memcpy(pframe, pmlmepriv->wps_probe_resp_ie, wps_ielen+2); +- pframe += wps_ielen+2; +- pattrib->pktlen += wps_ielen+2; +- } ++ // setting auth seq number ++ val16 =(u16)psta->auth_seq; ++ val16 = cpu_to_le16(val16); ++ pframe = rtw_set_fixed_ie(pframe, _AUTH_SEQ_NUM_, (unsigned char *)&val16, &(pattrib->pktlen)); + +- if((wps_offset+wps_ielen+2+remainder_ielen)<=MAX_IE_SZ) +- { +- _rtw_memcpy(pframe, premainder_ie, remainder_ielen); +- pframe += remainder_ielen; +- pattrib->pktlen += remainder_ielen; +- } +- } +- else ++ // setting status code... ++ val16 = status; ++ val16 = cpu_to_le16(val16); ++ pframe = rtw_set_fixed_ie(pframe, _STATUS_CODE_, (unsigned char *)&val16, &(pattrib->pktlen)); ++ ++ // added challenging text... ++ if ((psta->auth_seq == 2) && (psta->state & WIFI_FW_AUTH_STATE) && (use_shared_key==1)) + { +- _rtw_memcpy(pframe, cur_network->IEs, cur_network->IELength); +- pframe += cur_network->IELength; +- pattrib->pktlen += cur_network->IELength; ++ pframe = rtw_set_ie(pframe, _CHLGETXT_IE_, 128, psta->chg_txt, &(pattrib->pktlen)); + } +- +- } +- else +-#endif +- { ++#endif ++ } ++ else ++ { ++ _rtw_memcpy(pwlanhdr->addr1, get_my_bssid(&pmlmeinfo->network), ETH_ALEN); ++ _rtw_memcpy(pwlanhdr->addr2, myid(&padapter->eeprompriv), ETH_ALEN); ++ _rtw_memcpy(pwlanhdr->addr3, get_my_bssid(&pmlmeinfo->network), ETH_ALEN); + +- //timestamp will be inserted by hardware +- pframe += 8; +- pattrib->pktlen += 8; +- +- // beacon interval: 2 bytes +- +- _rtw_memcpy(pframe, (unsigned char *)(rtw_get_beacon_interval_from_ie(cur_network->IEs)), 2); +- +- pframe += 2; +- pattrib->pktlen += 2; +- +- // capability info: 2 bytes +- +- _rtw_memcpy(pframe, (unsigned char *)(rtw_get_capability_from_ie(cur_network->IEs)), 2); +- +- pframe += 2; +- pattrib->pktlen += 2; +- +- //below for ad-hoc mode +- +- // SSID +- pframe = rtw_set_ie(pframe, _SSID_IE_, cur_network->Ssid.SsidLength, cur_network->Ssid.Ssid, &pattrib->pktlen); +- +- // supported rates... +- rate_len = rtw_get_rateset_len(cur_network->SupportedRates); +- pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_, ((rate_len > 8)? 8: rate_len), cur_network->SupportedRates, &pattrib->pktlen); +- +- // DS parameter set +- pframe =rtw_set_ie(pframe, _DSSET_IE_, 1, (unsigned char *)&(cur_network->Configuration.DSConfig), &pattrib->pktlen); +- +- if( (pmlmeinfo->state&0x03) == WIFI_FW_ADHOC_STATE) ++ // setting auth algo number ++ val16 = (pmlmeinfo->auth_algo == dot11AuthAlgrthm_Shared)? 1: 0;// 0:OPEN System, 1:Shared key ++ if (val16) { ++ val16 = cpu_to_le16(val16); ++ use_shared_key = 1; ++ } ++ //DBG_871X("%s auth_algo= %s auth_seq=%d\n",__FUNCTION__,(pmlmeinfo->auth_algo==0)?"OPEN":"SHARED",pmlmeinfo->auth_seq); ++ ++ //setting IV for auth seq #3 ++ if ((pmlmeinfo->auth_seq == 3) && (pmlmeinfo->state & WIFI_FW_AUTH_STATE) && (use_shared_key==1)) + { +- u8 erpinfo=0; +- u32 ATIMWindow; +- // IBSS Parameter Set... +- //ATIMWindow = cur->Configuration.ATIMWindow; +- ATIMWindow = 0; +- pframe = rtw_set_ie(pframe, _IBSS_PARA_IE_, 2, (unsigned char *)(&ATIMWindow), &pattrib->pktlen); ++ //DBG_871X("==> iv(%d),key_index(%d)\n",pmlmeinfo->iv,pmlmeinfo->key_index); ++ val32 = ((pmlmeinfo->iv++) | (pmlmeinfo->key_index << 30)); ++ val32 = cpu_to_le32(val32); ++ pframe = rtw_set_fixed_ie(pframe, 4, (unsigned char *)&val32, &(pattrib->pktlen)); + +- //ERP IE +- pframe = rtw_set_ie(pframe, _ERPINFO_IE_, 1, &erpinfo, &pattrib->pktlen); ++ pattrib->iv_len = 4; + } + ++ pframe = rtw_set_fixed_ie(pframe, _AUTH_ALGM_NUM_, (unsigned char *)&val16, &(pattrib->pktlen)); + +- // EXTERNDED SUPPORTED RATE +- if (rate_len > 8) +- { +- pframe = rtw_set_ie(pframe, _EXT_SUPPORTEDRATES_IE_, (rate_len - 8), (cur_network->SupportedRates + 8), &pattrib->pktlen); +- } ++ // setting auth seq number ++ val16 = pmlmeinfo->auth_seq; ++ val16 = cpu_to_le16(val16); ++ pframe = rtw_set_fixed_ie(pframe, _AUTH_SEQ_NUM_, (unsigned char *)&val16, &(pattrib->pktlen)); + ++ ++ // setting status code... ++ val16 = status; ++ val16 = cpu_to_le16(val16); ++ pframe = rtw_set_fixed_ie(pframe, _STATUS_CODE_, (unsigned char *)&val16, &(pattrib->pktlen)); + +- //todo:HT for adhoc ++ // then checking to see if sending challenging text... ++ if ((pmlmeinfo->auth_seq == 3) && (pmlmeinfo->state & WIFI_FW_AUTH_STATE) && (use_shared_key==1)) ++ { ++ pframe = rtw_set_ie(pframe, _CHLGETXT_IE_, 128, pmlmeinfo->chg_txt, &(pattrib->pktlen)); + +- } ++ SetPrivacy(fctrl); ++ ++ pattrib->hdrlen = sizeof(struct rtw_ieee80211_hdr_3addr); ++ ++ pattrib->encrypt = _WEP40_; + +-#ifdef CONFIG_P2P +- if(rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO) && is_valid_p2p_probereq) +- { +- u32 len; +-#ifdef CONFIG_IOCTL_CFG80211 +- if(wdev_to_priv(padapter->rtw_wdev)->p2p_enabled) +- { +- //if pwdinfo->role == P2P_ROLE_DEVICE will call issue_probersp_p2p() +- len = pmlmepriv->p2p_go_probe_resp_ie_len; +- if(pmlmepriv->p2p_go_probe_resp_ie && len>0) +- _rtw_memcpy(pframe, pmlmepriv->p2p_go_probe_resp_ie, len); +- } +- else +-#endif //CONFIG_IOCTL_CFG80211 +- { +- len = build_probe_resp_p2p_ie(pwdinfo, pframe); ++ pattrib->icv_len = 4; ++ ++ pattrib->pktlen += pattrib->icv_len; ++ + } +- +- pframe += len; +- pattrib->pktlen += len; + +-#ifdef CONFIG_WFD +- wfdielen = build_probe_resp_wfd_ie(pwdinfo, pframe); +- pframe += wfdielen; +- pattrib->pktlen += wfdielen; +-#endif //CONFIG_WFD +- +- } +-#endif //CONFIG_P2P +- ++ } + + pattrib->last_txcmdsz = pattrib->pktlen; +- ++ ++ rtw_wep_encrypt(padapter, (u8 *)pmgntframe); + + dump_mgntframe(padapter, pmgntframe); +- +- return; + ++ return; + } + +-void issue_probereq(_adapter *padapter, NDIS_802_11_SSID *pssid, u8 blnbc) ++ ++void issue_asocrsp(_adapter *padapter, unsigned short status, struct sta_info *pstat, int pkt_type) + { +- struct xmit_frame *pmgntframe; +- struct pkt_attrib *pattrib; +- unsigned char *pframe; ++#ifdef CONFIG_AP_MODE ++ struct xmit_frame *pmgntframe; + struct rtw_ieee80211_hdr *pwlanhdr; +- unsigned short *fctrl; +- unsigned char *mac; +- unsigned char bssrate[NumRates]; +- struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); ++ struct pkt_attrib *pattrib; ++ unsigned char *pbuf, *pframe; ++ unsigned short val; ++ unsigned short *fctrl; ++ struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); + struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); +- struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); +- struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); +- int bssrate_len = 0; +- u8 bc_addr[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; ++ struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; ++ struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); ++ WLAN_BSSID_EX *pnetwork = &(pmlmeinfo->network); ++ u8 *ie = pnetwork->IEs; ++#ifdef CONFIG_P2P ++ struct wifidirect_info *pwdinfo = &(padapter->wdinfo); ++#ifdef CONFIG_WFD ++ u32 wfdielen = 0; ++#endif //CONFIG_WFD ++#endif //CONFIG_P2P + +- RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("+issue_probereq\n")); ++ DBG_871X("%s\n", __FUNCTION__); + + if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) + { +@@ -6125,313 +7418,45 @@ void issue_probereq(_adapter *padapter, NDIS_802_11_SSID *pssid, u8 blnbc) + pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; + pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; + +- mac = myid(&(padapter->eeprompriv)); +- + fctrl = &(pwlanhdr->frame_ctl); + *(fctrl) = 0; + +- if ( 0 == blnbc ) +- { +- // unicast probe request frame +- _rtw_memcpy(pwlanhdr->addr1, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN); +- _rtw_memcpy(pwlanhdr->addr3, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN); +- } +- else +- { +- // broadcast probe request frame +- _rtw_memcpy(pwlanhdr->addr1, bc_addr, ETH_ALEN); +- _rtw_memcpy(pwlanhdr->addr3, bc_addr, ETH_ALEN); +- } ++ _rtw_memcpy((void *)GetAddr1Ptr(pwlanhdr), pstat->hwaddr, ETH_ALEN); ++ _rtw_memcpy((void *)GetAddr2Ptr(pwlanhdr), myid(&(padapter->eeprompriv)), ETH_ALEN); ++ _rtw_memcpy((void *)GetAddr3Ptr(pwlanhdr), get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN); + +- _rtw_memcpy(pwlanhdr->addr2, mac, ETH_ALEN); + + SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); + pmlmeext->mgnt_seq++; +- SetFrameSubType(pframe, WIFI_PROBEREQ); ++ if ((pkt_type == WIFI_ASSOCRSP) || (pkt_type == WIFI_REASSOCRSP)) ++ SetFrameSubType(pwlanhdr, pkt_type); ++ else ++ return; + +- pframe += sizeof (struct rtw_ieee80211_hdr_3addr); +- pattrib->pktlen = sizeof (struct rtw_ieee80211_hdr_3addr); ++ pattrib->hdrlen = sizeof(struct rtw_ieee80211_hdr_3addr); ++ pattrib->pktlen += pattrib->hdrlen; ++ pframe += pattrib->hdrlen; + +- if(pssid) +- pframe = rtw_set_ie(pframe, _SSID_IE_, pssid->SsidLength, pssid->Ssid, &(pattrib->pktlen)); +- else +- pframe = rtw_set_ie(pframe, _SSID_IE_, 0, NULL, &(pattrib->pktlen)); ++ //capability ++ val = *(unsigned short *)rtw_get_capability_from_ie(ie); + +- get_rate_set(padapter, bssrate, &bssrate_len); ++ pframe = rtw_set_fixed_ie(pframe, _CAPABILITY_ , (unsigned char *)&val, &(pattrib->pktlen)); + +- if (bssrate_len > 8) +- { +- pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_ , 8, bssrate, &(pattrib->pktlen)); +- pframe = rtw_set_ie(pframe, _EXT_SUPPORTEDRATES_IE_ , (bssrate_len - 8), (bssrate + 8), &(pattrib->pktlen)); +- } +- else +- { +- pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_ , bssrate_len , bssrate, &(pattrib->pktlen)); +- } ++ status = cpu_to_le16(status); ++ pframe = rtw_set_fixed_ie(pframe , _STATUS_CODE_ , (unsigned char *)&status, &(pattrib->pktlen)); ++ ++ val = cpu_to_le16(pstat->aid | BIT(14) | BIT(15)); ++ pframe = rtw_set_fixed_ie(pframe, _ASOC_ID_ , (unsigned char *)&val, &(pattrib->pktlen)); + +-#if 0 +- //add wps_ie for wps2.0 +- if(pmlmepriv->probereq_wpsie_len>0 && pmlmepriv->probereq_wpsie_lenbssratelen <= 8) + { +- _rtw_memcpy(pframe, pmlmepriv->probereq_wpsie, pmlmepriv->probereq_wpsie_len); +- pframe += pmlmepriv->probereq_wpsie_len; +- pattrib->pktlen += pmlmepriv->probereq_wpsie_len; +- //pmlmepriv->probereq_wpsie_len = 0 ;//reset to zero ++ pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_, pstat->bssratelen, pstat->bssrateset, &(pattrib->pktlen)); + } +-#else +- //add wps_ie for wps2.0 +- if(pmlmepriv->wps_probe_req_ie_len>0 && pmlmepriv->wps_probe_req_ie) ++ else + { +- _rtw_memcpy(pframe, pmlmepriv->wps_probe_req_ie, pmlmepriv->wps_probe_req_ie_len); +- pframe += pmlmepriv->wps_probe_req_ie_len; +- pattrib->pktlen += pmlmepriv->wps_probe_req_ie_len; +- //pmlmepriv->wps_probe_req_ie_len = 0 ;//reset to zero +- } +-#endif +- +- pattrib->last_txcmdsz = pattrib->pktlen; +- +- RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("issuing probe_req, tx_len=%d\n", pattrib->last_txcmdsz)); +- +- dump_mgntframe(padapter, pmgntframe); +- +- return; +-} +- +-// if psta == NULL, indiate we are station(client) now... +-void issue_auth(_adapter *padapter, struct sta_info *psta, unsigned short status) +-{ +- struct xmit_frame *pmgntframe; +- struct pkt_attrib *pattrib; +- unsigned char *pframe; +- struct rtw_ieee80211_hdr *pwlanhdr; +- unsigned short *fctrl; +- unsigned int val32; +- unsigned short val16; +- int use_shared_key = 0; +- struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); +- struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); +- struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); +- +-/* +- if( (psta == NULL) && (pmlmeinfo->auth_seq != 3) ) { +- // Because of AP's not receiving deauth before +- // AP may: 1)not response auth or 2)deauth us after link is complete +- // issue deauth before issuing auth to deal with the situation +- issue_deauth(padapter, (&(pmlmeinfo->network))->MacAddress, WLAN_REASON_DEAUTH_LEAVING); +- } +-*/ +- +- if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) +- { +- return; +- } +- +- //update attribute +- pattrib = &pmgntframe->attrib; +- update_mgntframe_attrib(padapter, pattrib); +- +- _rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); +- +- pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; +- pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; +- +- fctrl = &(pwlanhdr->frame_ctl); +- *(fctrl) = 0; +- +- SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); +- pmlmeext->mgnt_seq++; +- SetFrameSubType(pframe, WIFI_AUTH); +- +- pframe += sizeof(struct rtw_ieee80211_hdr_3addr); +- pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); +- +- +- if(psta)// for AP mode +- { +-#ifdef CONFIG_NATIVEAP_MLME +- +- _rtw_memcpy(pwlanhdr->addr1, psta->hwaddr, ETH_ALEN); +- _rtw_memcpy(pwlanhdr->addr2, myid(&(padapter->eeprompriv)), ETH_ALEN); +- _rtw_memcpy(pwlanhdr->addr3, myid(&(padapter->eeprompriv)), ETH_ALEN); +- +- +- // setting auth algo number +- val16 = (u16)psta->authalg; +- +- if(status != _STATS_SUCCESSFUL_) +- val16 = 0; +- +- if (val16) { +- val16 = cpu_to_le16(val16); +- use_shared_key = 1; +- } +- +- pframe = rtw_set_fixed_ie(pframe, _AUTH_ALGM_NUM_, (unsigned char *)&val16, &(pattrib->pktlen)); +- +- // setting auth seq number +- val16 =(u16)psta->auth_seq; +- val16 = cpu_to_le16(val16); +- pframe = rtw_set_fixed_ie(pframe, _AUTH_SEQ_NUM_, (unsigned char *)&val16, &(pattrib->pktlen)); +- +- // setting status code... +- val16 = status; +- val16 = cpu_to_le16(val16); +- pframe = rtw_set_fixed_ie(pframe, _STATUS_CODE_, (unsigned char *)&val16, &(pattrib->pktlen)); +- +- // added challenging text... +- if ((psta->auth_seq == 2) && (psta->state & WIFI_FW_AUTH_STATE) && (use_shared_key==1)) +- { +- pframe = rtw_set_ie(pframe, _CHLGETXT_IE_, 128, psta->chg_txt, &(pattrib->pktlen)); +- } +-#endif +- } +- else +- { +- _rtw_memcpy(pwlanhdr->addr1, get_my_bssid(&pmlmeinfo->network), ETH_ALEN); +- _rtw_memcpy(pwlanhdr->addr2, myid(&padapter->eeprompriv), ETH_ALEN); +- _rtw_memcpy(pwlanhdr->addr3, get_my_bssid(&pmlmeinfo->network), ETH_ALEN); +- +- // setting auth algo number +- val16 = (pmlmeinfo->auth_algo == dot11AuthAlgrthm_Shared)? 1: 0;// 0:OPEN System, 1:Shared key +- if (val16) { +- val16 = cpu_to_le16(val16); +- use_shared_key = 1; +- } +- //DBG_8192C("%s auth_algo= %s auth_seq=%d\n",__FUNCTION__,(pmlmeinfo->auth_algo==0)?"OPEN":"SHARED",pmlmeinfo->auth_seq); +- +- //setting IV for auth seq #3 +- if ((pmlmeinfo->auth_seq == 3) && (pmlmeinfo->state & WIFI_FW_AUTH_STATE) && (use_shared_key==1)) +- { +- //DBG_8192C("==> iv(%d),key_index(%d)\n",pmlmeinfo->iv,pmlmeinfo->key_index); +- val32 = ((pmlmeinfo->iv++) | (pmlmeinfo->key_index << 30)); +- val32 = cpu_to_le32(val32); +- pframe = rtw_set_fixed_ie(pframe, 4, (unsigned char *)&val32, &(pattrib->pktlen)); +- +- pattrib->iv_len = 4; +- } +- +- pframe = rtw_set_fixed_ie(pframe, _AUTH_ALGM_NUM_, (unsigned char *)&val16, &(pattrib->pktlen)); +- +- // setting auth seq number +- val16 = pmlmeinfo->auth_seq; +- val16 = cpu_to_le16(val16); +- pframe = rtw_set_fixed_ie(pframe, _AUTH_SEQ_NUM_, (unsigned char *)&val16, &(pattrib->pktlen)); +- +- +- // setting status code... +- val16 = status; +- val16 = cpu_to_le16(val16); +- pframe = rtw_set_fixed_ie(pframe, _STATUS_CODE_, (unsigned char *)&val16, &(pattrib->pktlen)); +- +- // then checking to see if sending challenging text... +- if ((pmlmeinfo->auth_seq == 3) && (pmlmeinfo->state & WIFI_FW_AUTH_STATE) && (use_shared_key==1)) +- { +- pframe = rtw_set_ie(pframe, _CHLGETXT_IE_, 128, pmlmeinfo->chg_txt, &(pattrib->pktlen)); +- +- SetPrivacy(fctrl); +- +- pattrib->hdrlen = sizeof(struct rtw_ieee80211_hdr_3addr); +- +- pattrib->encrypt = _WEP40_; +- +- pattrib->icv_len = 4; +- +- pattrib->pktlen += pattrib->icv_len; +- +- } +- +- } +- +- pattrib->last_txcmdsz = pattrib->pktlen; +- +- rtw_wep_encrypt(padapter, (u8 *)pmgntframe); +- +- dump_mgntframe(padapter, pmgntframe); +- +- return; +-} +- +- +-void issue_asocrsp(_adapter *padapter, unsigned short status, struct sta_info *pstat, int pkt_type) +-{ +-#ifdef CONFIG_AP_MODE +- struct xmit_frame *pmgntframe; +- struct rtw_ieee80211_hdr *pwlanhdr; +- struct pkt_attrib *pattrib; +- unsigned char *pbuf, *pframe; +- unsigned short val; +- unsigned short *fctrl; +- struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); +- struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); +- struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; +- struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); +- WLAN_BSSID_EX *pnetwork = &(pmlmeinfo->network); +- u8 *ie = pnetwork->IEs; +-#ifdef CONFIG_P2P +- struct wifidirect_info *pwdinfo = &(padapter->wdinfo); +-#ifdef CONFIG_WFD +- u32 wfdielen = 0; +-#endif //CONFIG_WFD +- +-#endif //CONFIG_P2P +- +- DBG_871X("%s\n", __FUNCTION__); +- +- if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) +- { +- return; +- } +- +- //update attribute +- pattrib = &pmgntframe->attrib; +- update_mgntframe_attrib(padapter, pattrib); +- +- +- _rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); +- +- pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; +- pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; +- +- fctrl = &(pwlanhdr->frame_ctl); +- *(fctrl) = 0; +- +- _rtw_memcpy((void *)GetAddr1Ptr(pwlanhdr), pstat->hwaddr, ETH_ALEN); +- _rtw_memcpy((void *)GetAddr2Ptr(pwlanhdr), myid(&(padapter->eeprompriv)), ETH_ALEN); +- _rtw_memcpy((void *)GetAddr3Ptr(pwlanhdr), get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN); +- +- +- SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); +- pmlmeext->mgnt_seq++; +- if ((pkt_type == WIFI_ASSOCRSP) || (pkt_type == WIFI_REASSOCRSP)) +- SetFrameSubType(pwlanhdr, pkt_type); +- else +- return; +- +- pattrib->hdrlen = sizeof(struct rtw_ieee80211_hdr_3addr); +- pattrib->pktlen += pattrib->hdrlen; +- pframe += pattrib->hdrlen; +- +- //capability +- val = *(unsigned short *)rtw_get_capability_from_ie(ie); +- +- pframe = rtw_set_fixed_ie(pframe, _CAPABILITY_ , (unsigned char *)&val, &(pattrib->pktlen)); +- +- status = cpu_to_le16(status); +- pframe = rtw_set_fixed_ie(pframe , _STATUS_CODE_ , (unsigned char *)&status, &(pattrib->pktlen)); +- +- val = cpu_to_le16(pstat->aid | BIT(14) | BIT(15)); +- pframe = rtw_set_fixed_ie(pframe, _ASOC_ID_ , (unsigned char *)&val, &(pattrib->pktlen)); +- +- if (pstat->bssratelen <= 8) +- { +- pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_, pstat->bssratelen, pstat->bssrateset, &(pattrib->pktlen)); +- } +- else +- { +- pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_, 8, pstat->bssrateset, &(pattrib->pktlen)); +- pframe = rtw_set_ie(pframe, _EXT_SUPPORTEDRATES_IE_, (pstat->bssratelen-8), pstat->bssrateset+8, &(pattrib->pktlen)); +- } ++ pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_, 8, pstat->bssrateset, &(pattrib->pktlen)); ++ pframe = rtw_set_ie(pframe, _EXT_SUPPORTEDRATES_IE_, (pstat->bssratelen-8), pstat->bssrateset+8, &(pattrib->pktlen)); ++ } + + #ifdef CONFIG_80211N_HT + if ((pstat->flags & WLAN_STA_HT) && (pmlmepriv->htpriv.ht_option)) +@@ -6503,21 +7528,30 @@ void issue_asocrsp(_adapter *padapter, unsigned short status, struct sta_info *p } #ifdef CONFIG_P2P @@ -15425,7 +16494,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #endif //CONFIG_P2P pattrib->last_txcmdsz = pattrib->pktlen; -@@ -6529,6 +7563,7 @@ void issue_asocrsp(_adapter *padapter, u +@@ -6529,6 +7563,7 @@ void issue_asocrsp(_adapter *padapter, unsigned short status, struct sta_info *p void issue_assocreq(_adapter *padapter) { @@ -15797,7 +16866,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } //update attribute -@@ -6997,7 +8130,7 @@ void issue_nulldata(_adapter *padapter, +@@ -6997,7 +8130,7 @@ void issue_nulldata(_adapter *padapter, unsigned int power_mode) SetPwrMgt(fctrl); } @@ -15806,7 +16875,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release _rtw_memcpy(pwlanhdr->addr2, myid(&(padapter->eeprompriv)), ETH_ALEN); _rtw_memcpy(pwlanhdr->addr3, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN); -@@ -7009,14 +8142,75 @@ void issue_nulldata(_adapter *padapter, +@@ -7009,14 +8142,75 @@ void issue_nulldata(_adapter *padapter, unsigned int power_mode) pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); pattrib->last_txcmdsz = pattrib->pktlen; @@ -15885,7 +16954,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release struct xmit_frame *pmgntframe; struct pkt_attrib *pattrib; unsigned char *pframe; -@@ -7030,7 +8224,7 @@ void issue_qos_nulldata(_adapter *padapt +@@ -7030,7 +8224,7 @@ void issue_qos_nulldata(_adapter *padapter, unsigned char *da, u16 tid) if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) { @@ -15894,156 +16963,26 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } //update attribute -@@ -7083,230 +8277,104 @@ void issue_qos_nulldata(_adapter *padapt +@@ -7083,11 +8277,71 @@ void issue_qos_nulldata(_adapter *padapter, unsigned char *da, u16 tid) pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr_qos); pattrib->last_txcmdsz = pattrib->pktlen; - dump_mgntframe(padapter, pmgntframe); -- --} -- --void issue_deauth(_adapter *padapter, unsigned char *da, unsigned short reason) --{ -- struct xmit_frame *pmgntframe; -- struct pkt_attrib *pattrib; -- unsigned char *pframe; -- struct rtw_ieee80211_hdr *pwlanhdr; -- unsigned short *fctrl; -- struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); -- struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); -- struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); -- -- DBG_871X("%s to "MAC_FMT"\n", __func__, MAC_ARG(da)); -- if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) -- { -- return; -- } -- -- //update attribute -- pattrib = &pmgntframe->attrib; -- update_mgntframe_attrib(padapter, pattrib); -- pattrib->retry_ctrl = _FALSE; -- -- _rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); -- -- pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; -- pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; -- -- fctrl = &(pwlanhdr->frame_ctl); -- *(fctrl) = 0; -- -- _rtw_memcpy(pwlanhdr->addr1, da, ETH_ALEN); -- _rtw_memcpy(pwlanhdr->addr2, myid(&(padapter->eeprompriv)), ETH_ALEN); -- _rtw_memcpy(pwlanhdr->addr3, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN); -- -- SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); -- pmlmeext->mgnt_seq++; -- SetFrameSubType(pframe, WIFI_DEAUTH); -- -- pframe += sizeof(struct rtw_ieee80211_hdr_3addr); -- pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); -- -- reason = cpu_to_le16(reason); -- pframe = rtw_set_fixed_ie(pframe, _RSON_CODE_ , (unsigned char *)&reason, &(pattrib->pktlen)); -- -- pattrib->last_txcmdsz = pattrib->pktlen; -- -- dump_mgntframe(padapter, pmgntframe); --} -- --void issue_action_BA(_adapter *padapter, unsigned char *raddr, unsigned char action, unsigned short status) --{ -- u8 category = RTW_WLAN_CATEGORY_BACK; -- u16 start_seq; -- u16 BA_para_set; -- u16 reason_code; -- u16 BA_timeout_value; -- u16 BA_starting_seqctrl; -- struct xmit_frame *pmgntframe; -- struct pkt_attrib *pattrib; -- u8 *pframe; -- struct rtw_ieee80211_hdr *pwlanhdr; -- u16 *fctrl; -- struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); -- struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); -- struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); -- struct sta_info *psta; -- struct sta_priv *pstapriv = &padapter->stapriv; -- struct registry_priv *pregpriv = &padapter->registrypriv; -- -- -- DBG_871X("%s, category=%d, action=%d, status=%d\n", __FUNCTION__, category, action, status); -- -- if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) + if(wait_ack) - { -- return; ++ { + ret = dump_mgntframe_and_wait_ack(padapter, pmgntframe); + } + else + { + dump_mgntframe(padapter, pmgntframe); + ret = _SUCCESS; - } - -- //update attribute -- pattrib = &pmgntframe->attrib; -- update_mgntframe_attrib(padapter, pattrib); -- -- _rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); -- -- pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; -- pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; -- -- fctrl = &(pwlanhdr->frame_ctl); -- *(fctrl) = 0; -- -- //_rtw_memcpy(pwlanhdr->addr1, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN); -- _rtw_memcpy(pwlanhdr->addr1, raddr, ETH_ALEN); -- _rtw_memcpy(pwlanhdr->addr2, myid(&(padapter->eeprompriv)), ETH_ALEN); -- _rtw_memcpy(pwlanhdr->addr3, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN); -- -- SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); -- pmlmeext->mgnt_seq++; -- SetFrameSubType(pframe, WIFI_ACTION); -- -- pframe += sizeof(struct rtw_ieee80211_hdr_3addr); -- pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); -- -- pframe = rtw_set_fixed_ie(pframe, 1, &(category), &(pattrib->pktlen)); -- pframe = rtw_set_fixed_ie(pframe, 1, &(action), &(pattrib->pktlen)); -- -- status = cpu_to_le16(status); -- -- -- if (category == 3) -- { -- switch (action) -- { -- case 0: //ADDBA req -- do { -- pmlmeinfo->dialogToken++; -- } while (pmlmeinfo->dialogToken == 0); -- pframe = rtw_set_fixed_ie(pframe, 1, &(pmlmeinfo->dialogToken), &(pattrib->pktlen)); -- -- BA_para_set = (0x1002 | ((status & 0xf) << 2)); //immediate ack & 64 buffer size -- //sys_mib.BA_para_set = 0x0802; //immediate ack & 32 buffer size -- BA_para_set = cpu_to_le16(BA_para_set); -- pframe = rtw_set_fixed_ie(pframe, 2, (unsigned char *)(&(BA_para_set)), &(pattrib->pktlen)); -- -- //BA_timeout_value = 0xffff;//max: 65535 TUs(~ 65 ms) -- BA_timeout_value = 5000;//~ 5ms -- BA_timeout_value = cpu_to_le16(BA_timeout_value); -- pframe = rtw_set_fixed_ie(pframe, 2, (unsigned char *)(&(BA_timeout_value)), &(pattrib->pktlen)); ++ } ++ +exit: + return ret; +} - -- //if ((psta = rtw_get_stainfo(pstapriv, pmlmeinfo->network.MacAddress)) != NULL) -- if ((psta = rtw_get_stainfo(pstapriv, raddr)) != NULL) -- { -- start_seq = (psta->sta_xmitpriv.txseq_tid[status & 0x07]&0xfff) + 1; ++ +//when wait_ms >0 , this function shoule be called at process context +//da == NULL for station mode +int issue_qos_nulldata(_adapter *padapter, unsigned char *da, u16 tid, int try_cnt, int wait_ms) @@ -16053,17 +16992,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + u32 start = rtw_get_current_time(); + struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); + struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); - -- DBG_871X("BA_starting_seqctrl = %d for TID=%d\n", start_seq, status & 0x07); -- -- psta->BA_starting_seqctrl[status & 0x07] = start_seq; -- -- BA_starting_seqctrl = start_seq << 4; -- } -- -- BA_starting_seqctrl = cpu_to_le16(BA_starting_seqctrl); -- pframe = rtw_set_fixed_ie(pframe, 2, (unsigned char *)(&(BA_starting_seqctrl)), &(pattrib->pktlen)); -- break; ++ + /* da == NULL, assum it's null data for sta to ap*/ + if (da == NULL) + da = get_my_bssid(&(pmlmeinfo->network)); @@ -16071,53 +17000,24 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + do + { + ret = _issue_qos_nulldata(padapter, da, tid, wait_ms>0?_TRUE:_FALSE); - -- case 1: //ADDBA rsp -- pframe = rtw_set_fixed_ie(pframe, 1, &(pmlmeinfo->ADDBA_req.dialog_token), &(pattrib->pktlen)); -- pframe = rtw_set_fixed_ie(pframe, 2, (unsigned char *)(&status), &(pattrib->pktlen)); ++ + i++; - -- //BA_para_set = cpu_to_le16((le16_to_cpu(pmlmeinfo->ADDBA_req.BA_para_set) & 0x3f) | 0x1000); //64 buffer size -- BA_para_set = ((le16_to_cpu(pmlmeinfo->ADDBA_req.BA_para_set) & 0x3f) | 0x1000); //64 buffer size ++ + if (padapter->bDriverStopped || padapter->bSurpriseRemoved) + break; - -- if(pregpriv->ampdu_amsdu==0)//disabled -- BA_para_set = cpu_to_le16(BA_para_set & ~BIT(0)); -- else if(pregpriv->ampdu_amsdu==1)//enabled -- BA_para_set = cpu_to_le16(BA_para_set | BIT(0)); -- else //auto -- BA_para_set = cpu_to_le16(BA_para_set); -- -- pframe = rtw_set_fixed_ie(pframe, 2, (unsigned char *)(&(BA_para_set)), &(pattrib->pktlen)); -- pframe = rtw_set_fixed_ie(pframe, 2, (unsigned char *)(&(pmlmeinfo->ADDBA_req.BA_timeout_value)), &(pattrib->pktlen)); -- break; -- case 2://DELBA -- BA_para_set = (status & 0x1F) << 3; -- BA_para_set = cpu_to_le16(BA_para_set); -- pframe = rtw_set_fixed_ie(pframe, 2, (unsigned char *)(&(BA_para_set)), &(pattrib->pktlen)); ++ + if(i < try_cnt && wait_ms > 0 && ret==_FAIL) + rtw_msleep_os(wait_ms); - -- reason_code = 37;//Requested from peer STA as it does not want to use the mechanism -- reason_code = cpu_to_le16(reason_code); -- pframe = rtw_set_fixed_ie(pframe, 2, (unsigned char *)(&(reason_code)), &(pattrib->pktlen)); -- break; -- default: -- break; -- } -- } ++ + }while((ilast_txcmdsz = pattrib->pktlen; ++ + if (ret != _FAIL) { + ret = _SUCCESS; + #ifndef DBG_XMIT_ACK + goto exit; + #endif + } - -- dump_mgntframe(padapter, pmgntframe); ++ + if (try_cnt && wait_ms) { + if (da) + DBG_871X(FUNC_ADPT_FMT" to "MAC_FMT", ch:%u%s, %d/%d in %u ms\n", @@ -16132,46 +17032,24 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + return ret; } --static void issue_action_BSSCoexistPacket(_adapter *padapter) --{ -- _irqL irqL; -- _list *plist, *phead; -- unsigned char category, action; +-void issue_deauth(_adapter *padapter, unsigned char *da, unsigned short reason) +static int _issue_deauth(_adapter *padapter, unsigned char *da, unsigned short reason, u8 wait_ack) -+{ + { struct xmit_frame *pmgntframe; struct pkt_attrib *pattrib; -- unsigned char *pframe; -+ unsigned char *pframe; - struct rtw_ieee80211_hdr *pwlanhdr; -- unsigned short *fctrl; -- struct wlan_network *pnetwork = NULL; -+ unsigned short *fctrl; +@@ -7097,12 +8351,24 @@ void issue_deauth(_adapter *padapter, unsigned char *da, unsigned short reason) struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); -- struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); -- _queue *queue = &(pmlmepriv->scanned_queue); -- u8 InfoContent[16] = {0}; -- u8 ICS[8][15]; -- -- if((pmlmepriv->num_FortyMHzIntolerant==0) || (pmlmepriv->num_sta_no_ht==0)) -- return; - -- if(_TRUE == pmlmeinfo->bwmode_updated) -- return; +- DBG_871X("%s to "MAC_FMT"\n", __func__, MAC_ARG(da)); + int ret = _FAIL; +#ifdef CONFIG_P2P + struct wifidirect_info *pwdinfo= &(padapter->wdinfo); +#endif //CONFIG_P2P + //DBG_871X("%s to "MAC_FMT"\n", __func__, MAC_ARG(da)); - -- DBG_871X("%s\n", __FUNCTION__); -- -- -- category = RTW_WLAN_CATEGORY_PUBLIC; -- action = ACT_PUBLIC_BSSCOEXIST; ++ +#ifdef CONFIG_P2P + if ( !( rtw_p2p_chk_state( pwdinfo, P2P_STATE_NONE ) ) && ( pwdinfo->rx_invitereq_info.scan_op_ch_only ) ) + { @@ -16179,7 +17057,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + _set_timer( &pwdinfo->reset_ch_sitesurvey, 10 ); + } +#endif //CONFIG_P2P - ++ if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) { - return; @@ -16187,45 +17065,11 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } //update attribute - pattrib = &pmgntframe->attrib; - update_mgntframe_attrib(padapter, pattrib); -+ pattrib->retry_ctrl = _FALSE; - - _rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); - -@@ -7316,4715 +8384,4970 @@ static void issue_action_BSSCoexistPacke - fctrl = &(pwlanhdr->frame_ctl); - *(fctrl) = 0; - -- _rtw_memcpy(pwlanhdr->addr1, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN); -+ _rtw_memcpy(pwlanhdr->addr1, da, ETH_ALEN); - _rtw_memcpy(pwlanhdr->addr2, myid(&(padapter->eeprompriv)), ETH_ALEN); - _rtw_memcpy(pwlanhdr->addr3, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN); - - SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); - pmlmeext->mgnt_seq++; -- SetFrameSubType(pframe, WIFI_ACTION); -+ SetFrameSubType(pframe, WIFI_DEAUTH); - - pframe += sizeof(struct rtw_ieee80211_hdr_3addr); - pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); +@@ -7134,17 +8400,138 @@ void issue_deauth(_adapter *padapter, unsigned char *da, unsigned short reason) -- pframe = rtw_set_fixed_ie(pframe, 1, &(category), &(pattrib->pktlen)); -- pframe = rtw_set_fixed_ie(pframe, 1, &(action), &(pattrib->pktlen)); -+ reason = cpu_to_le16(reason); -+ pframe = rtw_set_fixed_ie(pframe, _RSON_CODE_ , (unsigned char *)&reason, &(pattrib->pktlen)); - -+ pattrib->last_txcmdsz = pattrib->pktlen; - -- // -- if(pmlmepriv->num_FortyMHzIntolerant>0) -- { -- u8 iedata=0; -- -- iedata |= BIT(2);//20 MHz BSS Width Request + pattrib->last_txcmdsz = pattrib->pktlen; -- pframe = rtw_set_ie(pframe, EID_BSSCoexistence, 1, &iedata, &(pattrib->pktlen)); -- ++ + if(wait_ack) + { + ret = dump_mgntframe_and_wait_ack(padapter, pmgntframe); @@ -16234,173 +17078,46 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + { + dump_mgntframe(padapter, pmgntframe); + ret = _SUCCESS; - } -- -- -- // -- _rtw_memset(ICS, 0, sizeof(ICS)); -- if(pmlmepriv->num_sta_no_ht>0) -- { -- int i; -- -- _enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); - -- phead = get_list_head(queue); -- plist = get_next(phead); -- -- while(1) -- { -- int len; -- u8 *p; -- WLAN_BSSID_EX *pbss_network; -- -- if (rtw_end_of_queue_search(phead,plist)== _TRUE) -- break; ++ } ++ +exit: + return ret; +} - -- pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list); -- -- plist = get_next(plist); ++ +int issue_deauth(_adapter *padapter, unsigned char *da, unsigned short reason) +{ + DBG_871X("%s to "MAC_FMT"\n", __func__, MAC_ARG(da)); + return _issue_deauth(padapter, da, reason, _FALSE); +} - -- pbss_network = (WLAN_BSSID_EX *)&pnetwork->network; ++ +int issue_deauth_ex(_adapter *padapter, u8 *da, unsigned short reason, int try_cnt, + int wait_ms) +{ + int ret; + int i = 0; + u32 start = rtw_get_current_time(); - -- p = rtw_get_ie(pbss_network->IEs + _FIXED_IE_LENGTH_, _HT_CAPABILITY_IE_, &len, pbss_network->IELength - _FIXED_IE_LENGTH_); -- if((p==NULL) || (len==0))//non-HT -- { -- if((pbss_network->Configuration.DSConfig<=0) || (pbss_network->Configuration.DSConfig>14)) -- continue; -- -- ICS[0][pbss_network->Configuration.DSConfig]=1; -- -- if(ICS[0][0] == 0) -- ICS[0][0] = 1; -- } -- -- } ++ + do + { + ret = _issue_deauth(padapter, da, reason, wait_ms>0?_TRUE:_FALSE); - -- _exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); ++ + i++; - ++ + if (padapter->bDriverStopped || padapter->bSurpriseRemoved) + break; - -- for(i= 0;i<8;i++) -- { -- if(ICS[i][0] == 1) -- { -- int j, k = 0; -- -- InfoContent[k] = i; -- //SET_BSS_INTOLERANT_ELE_REG_CLASS(InfoContent,i); -- k++; -- -- for(j=1;j<=14;j++) -- { -- if(ICS[i][j]==1) -- { -- if(k<16) -- { -- InfoContent[k] = j; //channel number -- //SET_BSS_INTOLERANT_ELE_CHANNEL(InfoContent+k, j); -- k++; -- } -- } -- } ++ + if(i < try_cnt && wait_ms > 0 && ret==_FAIL) + rtw_msleep_os(wait_ms); - -- pframe = rtw_set_ie(pframe, EID_BSSIntolerantChlReport, k, InfoContent, &(pattrib->pktlen)); -- -- } -- -- } -- ++ + }while((ilast_txcmdsz = pattrib->pktlen; -- -- dump_mgntframe(padapter, pmgntframe); -- --} -- --unsigned int send_delba(_adapter *padapter, u8 initiator, u8 *addr) --{ -- struct sta_priv *pstapriv = &padapter->stapriv; -- struct sta_info *psta = NULL; -- //struct recv_reorder_ctrl *preorder_ctrl; -- struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; -- struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); -- u16 tid; -- -- if((pmlmeinfo->state&0x03) != WIFI_FW_AP_STATE) -- if (!(pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS)) -- return _SUCCESS; -- -- psta = rtw_get_stainfo(pstapriv, addr); -- if(psta==NULL) -- return _SUCCESS; - -- //DBG_8192C("%s:%s\n", __FUNCTION__, (initiator==0)?"RX_DIR":"TX_DIR"); -- -- if(initiator==0) // recipient -- { -- for(tid = 0;tidrecvreorder_ctrl[tid].enable == _TRUE) -- { -- DBG_8192C("rx agg disable tid(%d)\n",tid); -- issue_action_BA(padapter, addr, RTW_WLAN_ACTION_DELBA, (((tid <<1) |initiator)&0x1F)); -- psta->recvreorder_ctrl[tid].enable = _FALSE; -- psta->recvreorder_ctrl[tid].indicate_seq = 0xffff; -- #ifdef DBG_RX_SEQ -- DBG_871X("DBG_RX_SEQ %s:%d indicate_seq:%u \n", __FUNCTION__, __LINE__, -- psta->recvreorder_ctrl[tid].indicate_seq); -- #endif -- } -- } -- } -- else if(initiator == 1)// originator -- { -- //DBG_8192C("tx agg_enable_bitmap(0x%08x)\n", psta->htpriv.agg_enable_bitmap); -- for(tid = 0;tidhtpriv.agg_enable_bitmap & BIT(tid)) -- { -- DBG_8192C("tx agg disable tid(%d)\n",tid); -- issue_action_BA(padapter, addr, RTW_WLAN_ACTION_DELBA, (((tid <<1) |initiator)&0x1F) ); -- psta->htpriv.agg_enable_bitmap &= ~BIT(tid); -- psta->htpriv.candidate_tid_bitmap &= ~BIT(tid); -- -- } -- } -- } -- -- return _SUCCESS; -- ++ } ++ + if (try_cnt && wait_ms) { + if (da) + DBG_871X(FUNC_ADPT_FMT" to "MAC_FMT", ch:%u%s, %d/%d in %u ms\n", @@ -16413,12 +17130,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + } +exit: + return ret; - } - --unsigned int send_beacon(_adapter *padapter) --{ -- u8 bxmitok = _FALSE; -- int retry=0; ++} ++ +void issue_action_spct_ch_switch(_adapter *padapter, u8 *ra, u8 new_ch, u8 ch_offset) +{ + _irqL irqL; @@ -16432,199 +17145,118 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; + struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); + struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); - -- //DBG_871X("%s\n", __FUNCTION__); - --#ifdef CONFIG_PCI_HCI ++ ++ + DBG_871X(FUNC_NDEV_FMT" ra="MAC_FMT", ch:%u, offset:%u\n", + FUNC_NDEV_ARG(padapter->pnetdev), MAC_ARG(ra), new_ch, ch_offset); - -- issue_beacon(padapter); ++ + if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) + return; - -- return _SUCCESS; ++ + //update attribute + pattrib = &pmgntframe->attrib; + update_mgntframe_attrib(padapter, pattrib); - --#endif ++ + _rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); - --#ifdef CONFIG_USB_HCI -- do{ ++ + pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; + pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; - -- issue_beacon(padapter); ++ + fctrl = &(pwlanhdr->frame_ctl); + *(fctrl) = 0; - -- padapter->HalFunc.GetHwRegHandler(padapter, HW_VAR_TX_BCN_DONE, (u8 *)(&bxmitok)); ++ + _rtw_memcpy(pwlanhdr->addr1, ra, ETH_ALEN); /* RA */ + _rtw_memcpy(pwlanhdr->addr2, myid(&(padapter->eeprompriv)), ETH_ALEN); /* TA */ + _rtw_memcpy(pwlanhdr->addr3, ra, ETH_ALEN); /* DA = RA */ - -- }while((_FALSE == bxmitok) &&((retry++)<100 )); ++ + SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); + pmlmeext->mgnt_seq++; + SetFrameSubType(pframe, WIFI_ACTION); - -- if(retry == 100) -- { -- DBG_871X("send_beacon, fail!\n"); -- return _FAIL; -- } -- else ++ + pframe += sizeof(struct rtw_ieee80211_hdr_3addr); + pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); + + /* category, action */ - { -- return _SUCCESS; ++ { + u8 category, action; + category = RTW_WLAN_CATEGORY_SPECTRUM_MGMT; + action = RTW_WLAN_ACTION_SPCT_CHL_SWITCH; + + pframe = rtw_set_fixed_ie(pframe, 1, &(category), &(pattrib->pktlen)); + pframe = rtw_set_fixed_ie(pframe, 1, &(action), &(pattrib->pktlen)); - } --#endif -- --} - --/**************************************************************************** ++ } ++ + pframe = rtw_set_ie_ch_switch(pframe, &(pattrib->pktlen), 0, new_ch, 0); + pframe = rtw_set_ie_secondary_ch_offset(pframe, &(pattrib->pktlen), + hal_ch_offset_to_secondary_ch_offset(ch_offset)); - --Following are some utitity fuctions for WiFi MLME ++ + pattrib->last_txcmdsz = pattrib->pktlen; - --*****************************************************************************/ -+ dump_mgntframe(padapter, pmgntframe); - --BOOLEAN IsLegal5GChannel( -- IN PADAPTER Adapter, -- IN u8 channel) --{ -- -- int i=0; -- u8 Channel_5G[45] = {36,38,40,42,44,46,48,50,52,54,56,58, -- 60,62,64,100,102,104,106,108,110,112,114,116,118,120,122, -- 124,126,128,130,132,134,136,138,140,149,151,153,155,157,159, -- 161,163,165}; -- for(i=0;imlmeextpriv; +- u8 category = RTW_WLAN_CATEGORY_BACK; +- u16 start_seq; +- u16 BA_para_set; + u8 category = RTW_WLAN_CATEGORY_SA_QUERY; -+ u16 reason_code; -+ struct xmit_frame *pmgntframe; -+ struct pkt_attrib *pattrib; -+ u8 *pframe; -+ struct rtw_ieee80211_hdr *pwlanhdr; -+ u16 *fctrl; -+ struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); -+ struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); - struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); -- u32 initialgain = 0; -- --#ifdef CONFIG_P2P -- struct wifidirect_info *pwdinfo= &(padapter->wdinfo); -- static unsigned char prev_survey_channel = 0; -- static unsigned int p2p_scan_count = 0; -- -- if(rtw_p2p_findphase_ex_is_social(pwdinfo)) -+ struct sta_info *psta; -+ struct sta_priv *pstapriv = &padapter->stapriv; -+ struct registry_priv *pregpriv = &padapter->registrypriv; -+ -+ + u16 reason_code; +- u16 BA_timeout_value; +- u16 BA_starting_seqctrl; + struct xmit_frame *pmgntframe; + struct pkt_attrib *pattrib; + u8 *pframe; +@@ -7158,10 +8545,11 @@ void issue_action_BA(_adapter *padapter, unsigned char *raddr, unsigned char act + struct registry_priv *pregpriv = &padapter->registrypriv; + + +- DBG_871X("%s, category=%d, action=%d, status=%d\n", __FUNCTION__, category, action, status); + DBG_871X("%s\n", __FUNCTION__); -+ -+ if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) + + if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) { -- // Commented by Albert 2011/06/03 -- // The driver is in the find phase, it should go through the social channel. -- survey_channel = pwdinfo->social_chan[pmlmeext->sitesurvey_res.channel_idx]; + DBG_871X("%s: alloc_mgtxmitframe fail\n", __FUNCTION__); -+ return; + return; } -+ -+ //update attribute -+ pattrib = &pmgntframe->attrib; -+ update_mgntframe_attrib(padapter, pattrib); -+ -+ _rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); -+ -+ pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; -+ pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; -+ -+ fctrl = &(pwlanhdr->frame_ctl); -+ *(fctrl) = 0; -+ + +@@ -7177,8 +8565,10 @@ void issue_action_BA(_adapter *padapter, unsigned char *raddr, unsigned char act + fctrl = &(pwlanhdr->frame_ctl); + *(fctrl) = 0; + +- //_rtw_memcpy(pwlanhdr->addr1, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN); +- _rtw_memcpy(pwlanhdr->addr1, raddr, ETH_ALEN); + if(raddr) + _rtw_memcpy(pwlanhdr->addr1, raddr, ETH_ALEN); - else --#endif //CONFIG_P2P -- { -- survey_channel = pmlmeext->channel_set[pmlmeext->sitesurvey_res.channel_idx].ChannelNum; -- } ++ else + _rtw_memcpy(pwlanhdr->addr1, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN); -+ _rtw_memcpy(pwlanhdr->addr2, myid(&(padapter->eeprompriv)), ETH_ALEN); -+ _rtw_memcpy(pwlanhdr->addr3, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN); + _rtw_memcpy(pwlanhdr->addr2, myid(&(padapter->eeprompriv)), ETH_ALEN); + _rtw_memcpy(pwlanhdr->addr3, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN); -- ScanType = pmlmeext->channel_set[pmlmeext->sitesurvey_res.channel_idx].ScanType; -- -- //DBG_871X("switching to ch:%d (cnt:%u,idx:%d) at %dms, %c%c%c\n" -- // , survey_channel -- // , pwdinfo->find_phase_state_exchange_cnt, pmlmeext->sitesurvey_res.channel_idx -- // , rtw_get_passing_time_ms(padapter->mlmepriv.scan_start_time) -- // , ScanType?'A':'P', pmlmeext->sitesurvey_res.scan_mode?'A':'P' -- // , pmlmeext->sitesurvey_res.ssid[0].SsidLength?'S':' ' -- //); -+ SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); -+ pmlmeext->mgnt_seq++; -+ SetFrameSubType(pframe, WIFI_ACTION); +@@ -7189,11 +8579,89 @@ void issue_action_BA(_adapter *padapter, unsigned char *raddr, unsigned char act + pframe += sizeof(struct rtw_ieee80211_hdr_3addr); + pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); -- if(survey_channel != 0) -+ pframe += sizeof(struct rtw_ieee80211_hdr_3addr); -+ pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); -+ +- pframe = rtw_set_fixed_ie(pframe, 1, &(category), &(pattrib->pktlen)); +- pframe = rtw_set_fixed_ie(pframe, 1, &(action), &(pattrib->pktlen)); +- +- status = cpu_to_le16(status); +- + pframe = rtw_set_fixed_ie(pframe, 1, &category, &pattrib->pktlen); + pframe = rtw_set_fixed_ie(pframe, 1, &action, &pattrib->pktlen); + + switch (action) - { -- //PAUSE 4-AC Queue when site_survey -- //padapter->HalFunc.GetHwRegHandler(padapter, HW_VAR_TXPAUSE, (u8 *)(&val8)); -- //val8 |= 0x0f; -- //padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_TXPAUSE, (u8 *)(&val8)); ++ { + case 0: //SA Query req + pframe = rtw_set_fixed_ie(pframe, 2, (unsigned char *)&pmlmeext->sa_query_seq, &pattrib->pktlen); + pmlmeext->sa_query_seq++; + //send sa query request to AP, AP should reply sa query response in 1 second + set_sa_query_timer(pmlmeext, 1000); + break; - -- if(pmlmeext->sitesurvey_res.channel_idx == 0) -- { -- set_channel_bwmode(padapter, survey_channel, HAL_PRIME_CHNL_OFFSET_DONT_CARE, HT_CHANNEL_WIDTH_20); -- } -- else -- { -- SelectChannel(padapter, survey_channel); -- } ++ + case 1: //SA Query rsp + tid = cpu_to_le16(tid); + pframe = rtw_set_fixed_ie(pframe, 2, (unsigned char *)&tid, &pattrib->pktlen); @@ -16632,46 +17264,13 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + default: + break; + } - ++ + pattrib->last_txcmdsz = pattrib->pktlen; - -- if(ScanType == SCAN_ACTIVE) //obey the channel plan setting... -- { -- #ifdef CONFIG_P2P -- if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_SCAN) || -- rtw_p2p_chk_state(pwdinfo, P2P_STATE_FIND_PHASE_SEARCH) -- ) -- { -- issue_probereq_p2p(padapter); -- issue_probereq_p2p(padapter); -- issue_probereq_p2p(padapter); -- } -- else -- #endif //CONFIG_P2P -- { -- int i; -- for(i=0;isitesurvey_res.ssid[i].SsidLength) { -- //todo: to issue two probe req??? -- issue_probereq(padapter, &(pmlmeext->sitesurvey_res.ssid[i]),1); -- //rtw_msleep_os(SURVEY_TO>>1); -- issue_probereq(padapter, &(pmlmeext->sitesurvey_res.ssid[i]),1); -- } else { -- break; -- } -- } ++ + dump_mgntframe(padapter, pmgntframe); +} +#endif //CONFIG_IEEE80211W - -- if(pmlmeext->sitesurvey_res.scan_mode == SCAN_ACTIVE) { -- //todo: to issue two probe req??? -- issue_probereq(padapter, NULL, 1); -- //rtw_msleep_os(SURVEY_TO>>1); -- issue_probereq(padapter, NULL, 1); -- } -- } -- } ++ +void issue_action_BA(_adapter *padapter, unsigned char *raddr, unsigned char action, unsigned short status) +{ + u8 category = RTW_WLAN_CATEGORY_BACK; @@ -16691,70 +17290,24 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + struct sta_info *psta; + struct sta_priv *pstapriv = &padapter->stapriv; + struct registry_priv *pregpriv = &padapter->registrypriv; - -- set_survey_timer(pmlmeext, pmlmeext->chan_scan_time); - -- } -- else ++ ++ + DBG_871X("%s, category=%d, action=%d, status=%d\n", __FUNCTION__, category, action, status); + + if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) - { ++ { + return; + } - -- // channel number is 0 or this channel is not valid. --#ifdef CONFIG_P2P -- if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_SCAN) || rtw_p2p_chk_state(pwdinfo, P2P_STATE_FIND_PHASE_SEARCH)) -- { -- #ifdef CONFIG_DBG_P2P -- DBG_8192C( "[%s] find phase exchange cnt = %d\n", __FUNCTION__, pwdinfo->find_phase_state_exchange_cnt ); -- #endif -- } -- -- if(rtw_p2p_findphase_ex_is_needed(pwdinfo)) -- { -- // Set the P2P State to the listen state of find phase and set the current channel to the listen channel -- set_channel_bwmode(padapter, pwdinfo->listen_channel, HAL_PRIME_CHNL_OFFSET_DONT_CARE, HT_CHANNEL_WIDTH_20); -- rtw_p2p_set_state(pwdinfo, P2P_STATE_FIND_PHASE_LISTEN); -- -- pmlmeext->sitesurvey_res.state = SCAN_DISABLE; ++ + //update attribute + pattrib = &pmgntframe->attrib; + update_mgntframe_attrib(padapter, pattrib); - -- _set_timer( &pwdinfo->find_phase_timer, ( u32 ) ( ( u32 ) ( pwdinfo->listen_dwell ) * 100 ) ); -- } -- else --#endif //CONFIG_P2P -- { ++ + _rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); - --#ifdef CONFIG_ANTENNA_DIVERSITY -- // 20100721:Interrupt scan operation here. -- // For SW antenna diversity before link, it needs to switch to another antenna and scan again. -- // It compares the scan result and select beter one to do connection. -- if(padapter->HalFunc.SwAntDivBeforeLinkHandler(padapter)) -- { -- pmlmeext->sitesurvey_res.bss_cnt = 0; -- pmlmeext->sitesurvey_res.channel_idx = -1; -- pmlmeext->chan_scan_time = SURVEY_TO /2; -- set_survey_timer(pmlmeext, pmlmeext->chan_scan_time); -- return; -- } --#endif ++ + pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; + pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; - --#ifdef CONFIG_P2P -- if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_SCAN) || rtw_p2p_chk_state(pwdinfo, P2P_STATE_FIND_PHASE_SEARCH)) -- { -- rtw_p2p_set_state(pwdinfo, P2P_STATE_LISTEN); -- } -- rtw_p2p_findphase_ex_set(pwdinfo, P2P_FINDPHASE_EX_NONE); --#endif //CONFIG_P2P -- -- pmlmeext->sitesurvey_res.state = SCAN_COMPLETE; ++ + fctrl = &(pwlanhdr->frame_ctl); + *(fctrl) = 0; + @@ -16769,547 +17322,55 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + + pframe += sizeof(struct rtw_ieee80211_hdr_3addr); + pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); - -- //switch back to the original channel -- //SelectChannel(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset); ++ + pframe = rtw_set_fixed_ie(pframe, 1, &(category), &(pattrib->pktlen)); + pframe = rtw_set_fixed_ie(pframe, 1, &(action), &(pattrib->pktlen)); - --#ifdef CONFIG_P2P -- if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_GONEGO_OK) -- && pwdinfo->peer_operating_ch != 0 -- ) -- { -- DBG_8192C( "[%s] In P2P WPS mode, stay in the peer operating channel = %d\n", __FUNCTION__, pwdinfo->peer_operating_ch ); -- set_channel_bwmode(padapter, pwdinfo->peer_operating_ch, pmlmeext->cur_ch_offset, pmlmeext->cur_bwmode); -- } -- else --#endif //CONFIG_P2P -- { -- set_channel_bwmode(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset, pmlmeext->cur_bwmode); -- } ++ + status = cpu_to_le16(status); + -- //flush 4-AC Queue after site_survey -- //val8 = 0; -- //padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_TXPAUSE, (u8 *)(&val8)); -+ if (category == 3) -+ { -+ switch (action) -+ { -+ case 0: //ADDBA req -+ do { -+ pmlmeinfo->dialogToken++; -+ } while (pmlmeinfo->dialogToken == 0); -+ pframe = rtw_set_fixed_ie(pframe, 1, &(pmlmeinfo->dialogToken), &(pattrib->pktlen)); - -- val8 = 0; -- padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_MLME_SITESURVEY, (u8 *)(&val8)); -+ BA_para_set = (0x1002 | ((status & 0xf) << 2)); //immediate ack & 64 buffer size -+ //sys_mib.BA_para_set = 0x0802; //immediate ack & 32 buffer size -+ BA_para_set = cpu_to_le16(BA_para_set); -+ pframe = rtw_set_fixed_ie(pframe, 2, (unsigned char *)(&(BA_para_set)), &(pattrib->pktlen)); - -- //config MSR -- Set_NETYPE0_MSR(padapter, (pmlmeinfo->state & 0x3)); -+ //BA_timeout_value = 0xffff;//max: 65535 TUs(~ 65 ms) -+ BA_timeout_value = 5000;//~ 5ms -+ BA_timeout_value = cpu_to_le16(BA_timeout_value); -+ pframe = rtw_set_fixed_ie(pframe, 2, (unsigned char *)(&(BA_timeout_value)), &(pattrib->pktlen)); - -- initialgain = 0xff; //restore RX GAIN -- padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_INITIAL_GAIN, (u8 *)(&initialgain)); -- //turn on dynamic functions -- Restore_DM_Func_Flag(padapter); -- //Switch_DM_Func(padapter, DYNAMIC_FUNC_DIG|DYNAMIC_FUNC_HP|DYNAMIC_FUNC_SS, _TRUE); -+ //if ((psta = rtw_get_stainfo(pstapriv, pmlmeinfo->network.MacAddress)) != NULL) -+ if ((psta = rtw_get_stainfo(pstapriv, raddr)) != NULL) -+ { -+ start_seq = (psta->sta_xmitpriv.txseq_tid[status & 0x07]&0xfff) + 1; - -- if (is_client_associated_to_ap(padapter) == _TRUE) -- { -- //issue null data -- issue_nulldata(padapter, 0); -- } -+ DBG_871X("BA_starting_seqctrl = %d for TID=%d\n", start_seq, status & 0x07); -+ -+ psta->BA_starting_seqctrl[status & 0x07] = start_seq; -+ -+ BA_starting_seqctrl = start_seq << 4; -+ } -+ -+ BA_starting_seqctrl = cpu_to_le16(BA_starting_seqctrl); -+ pframe = rtw_set_fixed_ie(pframe, 2, (unsigned char *)(&(BA_starting_seqctrl)), &(pattrib->pktlen)); -+ break; - -- report_surveydone_event(padapter); -+ case 1: //ADDBA rsp -+ pframe = rtw_set_fixed_ie(pframe, 1, &(pmlmeinfo->ADDBA_req.dialog_token), &(pattrib->pktlen)); -+ pframe = rtw_set_fixed_ie(pframe, 2, (unsigned char *)(&status), &(pattrib->pktlen)); - -- pmlmeext->chan_scan_time = SURVEY_TO; -- pmlmeext->sitesurvey_res.state = SCAN_DISABLE; -+ //BA_para_set = cpu_to_le16((le16_to_cpu(pmlmeinfo->ADDBA_req.BA_para_set) & 0x3f) | 0x1000); //64 buffer size -+ BA_para_set = ((le16_to_cpu(pmlmeinfo->ADDBA_req.BA_para_set) & 0x3f) | 0x1000); //64 buffer size - -- issue_action_BSSCoexistPacket(padapter); -- issue_action_BSSCoexistPacket(padapter); -- issue_action_BSSCoexistPacket(padapter); -+ if(pregpriv->ampdu_amsdu==0)//disabled -+ BA_para_set = cpu_to_le16(BA_para_set & ~BIT(0)); -+ else if(pregpriv->ampdu_amsdu==1)//enabled -+ BA_para_set = cpu_to_le16(BA_para_set | BIT(0)); -+ else //auto -+ BA_para_set = cpu_to_le16(BA_para_set); -+ -+ pframe = rtw_set_fixed_ie(pframe, 2, (unsigned char *)(&(BA_para_set)), &(pattrib->pktlen)); -+ pframe = rtw_set_fixed_ie(pframe, 2, (unsigned char *)(&(pmlmeinfo->ADDBA_req.BA_timeout_value)), &(pattrib->pktlen)); -+ break; -+ case 2://DELBA -+ BA_para_set = (status & 0x1F) << 3; -+ BA_para_set = cpu_to_le16(BA_para_set); -+ pframe = rtw_set_fixed_ie(pframe, 2, (unsigned char *)(&(BA_para_set)), &(pattrib->pktlen)); - -+ reason_code = 37;//Requested from peer STA as it does not want to use the mechanism -+ reason_code = cpu_to_le16(reason_code); -+ pframe = rtw_set_fixed_ie(pframe, 2, (unsigned char *)(&(reason_code)), &(pattrib->pktlen)); -+ break; -+ default: -+ break; - } -- - } - -- return; -+ pattrib->last_txcmdsz = pattrib->pktlen; - -+ dump_mgntframe(padapter, pmgntframe); - } - --//collect bss info from Beacon and Probe response frames. --u8 collect_bss_info(_adapter *padapter, union recv_frame *precv_frame, WLAN_BSSID_EX *bssid) --{ -- int i; -- u32 len; -- u8 *p; -- u16 val16, subtype; -- u8 *pframe = precv_frame->u.hdr.rx_data; -- u32 packet_len = precv_frame->u.hdr.len; -- struct registry_priv *pregistrypriv = &padapter->registrypriv; -- struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; -+static void issue_action_BSSCoexistPacket(_adapter *padapter) -+{ -+ _irqL irqL; -+ _list *plist, *phead; -+ unsigned char category, action; -+ struct xmit_frame *pmgntframe; -+ struct pkt_attrib *pattrib; -+ unsigned char *pframe; -+ struct rtw_ieee80211_hdr *pwlanhdr; -+ unsigned short *fctrl; -+ struct wlan_network *pnetwork = NULL; -+ struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); -+ struct mlme_priv *pmlmepriv = &padapter->mlmepriv; -+ struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); - struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); -+ _queue *queue = &(pmlmepriv->scanned_queue); -+ u8 InfoContent[16] = {0}; -+ u8 ICS[8][15]; -+ -+ if((pmlmepriv->num_FortyMHzIntolerant==0) || (pmlmepriv->num_sta_no_ht==0)) -+ return; - -- len = packet_len - sizeof(struct rtw_ieee80211_hdr_3addr); -+ if(_TRUE == pmlmeinfo->bwmode_updated) -+ return; -+ - -- if (len > MAX_IE_SZ) -+ DBG_871X("%s\n", __FUNCTION__); -+ -+ -+ category = RTW_WLAN_CATEGORY_PUBLIC; -+ action = ACT_PUBLIC_BSSCOEXIST; -+ -+ if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) - { -- //DBG_8192C("IE too long for survey event\n"); -- return _FAIL; -+ return; - } - -- _rtw_memset(bssid, 0, sizeof(WLAN_BSSID_EX)); -+ //update attribute -+ pattrib = &pmgntframe->attrib; -+ update_mgntframe_attrib(padapter, pattrib); - -- subtype = GetFrameSubType(pframe); -+ _rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); - -- if(subtype==WIFI_BEACON) -- bssid->Reserved[0] = 1; -- else -- bssid->Reserved[0] = 0; -- -- bssid->Length = sizeof(WLAN_BSSID_EX) - MAX_IE_SZ + len; -+ pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; -+ pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; - -- //below is to copy the information element -- bssid->IELength = len; -- _rtw_memcpy(bssid->IEs, (pframe + sizeof(struct rtw_ieee80211_hdr_3addr)), bssid->IELength); -+ fctrl = &(pwlanhdr->frame_ctl); -+ *(fctrl) = 0; - -- //get the signal strength -- bssid->PhyInfo.SignalQuality = precv_frame->u.hdr.attrib.signal_qual;//in percentage -- bssid->PhyInfo.SignalStrength = precv_frame->u.hdr.attrib.signal_strength;//in percentage -- bssid->Rssi = precv_frame->u.hdr.attrib.RecvSignalPower; // in dBM.raw data -- --#ifdef CONFIG_ANTENNA_DIVERSITY -- //padapter->HalFunc.GetHwRegHandler(padapter, HW_VAR_CURRENT_ANTENNA, (u8 *)(&bssid->PhyInfo.Optimum_antenna)); -- padapter->HalFunc.GetHalDefVarHandler(padapter, HAL_DEF_CURRENT_ANTENNA, &bssid->PhyInfo.Optimum_antenna); --#endif -+ _rtw_memcpy(pwlanhdr->addr1, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN); -+ _rtw_memcpy(pwlanhdr->addr2, myid(&(padapter->eeprompriv)), ETH_ALEN); -+ _rtw_memcpy(pwlanhdr->addr3, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN); - -- // checking SSID -- if ((p = rtw_get_ie(bssid->IEs + _FIXED_IE_LENGTH_, _SSID_IE_, &len, bssid->IELength - _FIXED_IE_LENGTH_)) == NULL) -- { -- DBG_871X("marc: cannot find SSID for survey event\n"); -- return _FAIL; -- } -+ SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); -+ pmlmeext->mgnt_seq++; -+ SetFrameSubType(pframe, WIFI_ACTION); - -- if (*(p + 1)) -- { -- _rtw_memcpy(bssid->Ssid.Ssid, (p + 2), *(p + 1)); -- bssid->Ssid.SsidLength = *(p + 1); -- } -- else -- { -- bssid->Ssid.SsidLength = 0; -- } -+ pframe += sizeof(struct rtw_ieee80211_hdr_3addr); -+ pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); - -- _rtw_memset(bssid->SupportedRates, 0, NDIS_802_11_LENGTH_RATES_EX); -+ pframe = rtw_set_fixed_ie(pframe, 1, &(category), &(pattrib->pktlen)); -+ pframe = rtw_set_fixed_ie(pframe, 1, &(action), &(pattrib->pktlen)); - -- //checking rate info... -- i = 0; -- p = rtw_get_ie(bssid->IEs + _FIXED_IE_LENGTH_, _SUPPORTEDRATES_IE_, &len, bssid->IELength - _FIXED_IE_LENGTH_); -- if (p != NULL) -- { -- _rtw_memcpy(bssid->SupportedRates, (p + 2), len); -- i = len; -- } - -- p = rtw_get_ie(bssid->IEs + _FIXED_IE_LENGTH_, _EXT_SUPPORTEDRATES_IE_, &len, bssid->IELength - _FIXED_IE_LENGTH_); -- if (p != NULL) -+ // -+ if(pmlmepriv->num_FortyMHzIntolerant>0) + if (category == 3) { -- _rtw_memcpy(bssid->SupportedRates + i, (p + 2), len); -- } -+ u8 iedata=0; -+ -+ iedata |= BIT(2);//20 MHz BSS Width Request - -- //todo: --#if 0 -- if (judge_network_type(bssid->SupportedRates, (len + i)) == WIRELESS_11B) -- { -- bssid->NetworkTypeInUse = Ndis802_11DS; -- } -- else --#endif -- { -- bssid->NetworkTypeInUse = Ndis802_11OFDM24; -+ pframe = rtw_set_ie(pframe, EID_BSSCoexistence, 1, &iedata, &(pattrib->pktlen)); -+ - } -+ - -- // Checking for DSConfig -- p = rtw_get_ie(bssid->IEs + _FIXED_IE_LENGTH_, _DSSET_IE_, &len, bssid->IELength - _FIXED_IE_LENGTH_); -- -- bssid->Configuration.DSConfig = 0; -- bssid->Configuration.Length = 0; -+ // -+ _rtw_memset(ICS, 0, sizeof(ICS)); -+ if(pmlmepriv->num_sta_no_ht>0) -+ { -+ int i; -+ -+ _enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); - -- if (p) -- { -- bssid->Configuration.DSConfig = *(p + 2); -- } -- else -- {// In 5G, some ap do not have DSSET IE -- // checking HT info for channel -- p = rtw_get_ie(bssid->IEs + _FIXED_IE_LENGTH_, _HT_ADD_INFO_IE_, &len, bssid->IELength - _FIXED_IE_LENGTH_); -- if(p) -+ phead = get_list_head(queue); -+ plist = get_next(phead); -+ -+ while(1) - { -- struct HT_info_element *HT_info = (struct HT_info_element *)(p + 2); -- bssid->Configuration.DSConfig = HT_info->primary_channel; -- } -- else -- { // use current channel -- if (padapter->mlmeextpriv.sitesurvey_res.state == SCAN_PROCESS) -- bssid->Configuration.DSConfig = padapter->mlmeextpriv.channel_set[padapter->mlmeextpriv.sitesurvey_res.channel_idx].ChannelNum; -- else -- bssid->Configuration.DSConfig = padapter->mlmeextpriv.cur_channel; -- } -- } -- -- _rtw_memcpy(&bssid->Configuration.BeaconPeriod, rtw_get_beacon_interval_from_ie(bssid->IEs), 2); -- -+ int len; -+ u8 *p; -+ WLAN_BSSID_EX *pbss_network; -+ -+ if (rtw_end_of_queue_search(phead,plist)== _TRUE) -+ break; - -- bssid->Configuration.BeaconPeriod = le32_to_cpu(bssid->Configuration.BeaconPeriod); -+ pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list); -+ -+ plist = get_next(plist); - -- val16 = rtw_get_capability((WLAN_BSSID_EX *)bssid); -+ pbss_network = (WLAN_BSSID_EX *)&pnetwork->network; - -- if (val16 & BIT(0)) -- { -- bssid->InfrastructureMode = Ndis802_11Infrastructure; -- _rtw_memcpy(bssid->MacAddress, GetAddr2Ptr(pframe), ETH_ALEN); -- } -- else -- { -- bssid->InfrastructureMode = Ndis802_11IBSS; -- _rtw_memcpy(bssid->MacAddress, GetAddr3Ptr(pframe), ETH_ALEN); -- } -+ p = rtw_get_ie(pbss_network->IEs + _FIXED_IE_LENGTH_, _HT_CAPABILITY_IE_, &len, pbss_network->IELength - _FIXED_IE_LENGTH_); -+ if((p==NULL) || (len==0))//non-HT -+ { -+ if((pbss_network->Configuration.DSConfig<=0) || (pbss_network->Configuration.DSConfig>14)) -+ continue; -+ -+ ICS[0][pbss_network->Configuration.DSConfig]=1; -+ -+ if(ICS[0][0] == 0) -+ ICS[0][0] = 1; -+ } -+ -+ } - -- if (val16 & BIT(4)) -- bssid->Privacy = 1; -- else -- bssid->Privacy = 0; -+ _exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); - -- bssid->Configuration.ATIMWindow = 0; - -- //20/40 BSS Coexistence check -- if((pregistrypriv->wifi_spec==1) && (_FALSE == pmlmeinfo->bwmode_updated)) -- { -- struct mlme_priv *pmlmepriv = &padapter->mlmepriv; -- -- p = rtw_get_ie(bssid->IEs + _FIXED_IE_LENGTH_, _HT_CAPABILITY_IE_, &len, bssid->IELength - _FIXED_IE_LENGTH_); -- if(p && len>0) -+ for(i= 0;i<8;i++) - { -- struct HT_caps_element *pHT_caps; -- pHT_caps = (struct HT_caps_element *)(p + 2); -- -- if(pHT_caps->HT_cap_element.HT_caps_info&BIT(14)) -- { -- pmlmepriv->num_FortyMHzIntolerant++; -+ if(ICS[i][0] == 1) -+ { -+ int j, k = 0; -+ -+ InfoContent[k] = i; -+ //SET_BSS_INTOLERANT_ELE_REG_CLASS(InfoContent,i); -+ k++; -+ -+ for(j=1;j<=14;j++) -+ { -+ if(ICS[i][j]==1) -+ { -+ if(k<16) -+ { -+ InfoContent[k] = j; //channel number -+ //SET_BSS_INTOLERANT_ELE_CHANNEL(InfoContent+k, j); -+ k++; -+ } -+ } -+ } -+ -+ pframe = rtw_set_ie(pframe, EID_BSSIntolerantChlReport, k, InfoContent, &(pattrib->pktlen)); -+ - } -- } -- else -- { -- pmlmepriv->num_sta_no_ht++; -+ - } - -- } - -- -- #if defined(DBG_RX_SIGNAL_DISPLAY_PROCESSING) & 1 -- if(strcmp(bssid->Ssid.Ssid, DBG_RX_SIGNAL_DISPLAY_SSID_MONITORED) == 0) { -- DBG_871X("Receiving %s("MAC_FMT", DSConfig:%u) from ch%u with ss:%3u, sq:%3u, RawRSSI:%3ld\n" -- , bssid->Ssid.Ssid, MAC_ARG(bssid->MacAddress), bssid->Configuration.DSConfig -- , padapter->mlmeextpriv.channel_set[padapter->mlmeextpriv.sitesurvey_res.channel_idx].ChannelNum -- , bssid->PhyInfo.SignalStrength, bssid->PhyInfo.SignalQuality, bssid->Rssi -- ); - } -- #endif - -- // mark bss info receving from nearby channel as SignalQuality 101 -- if(bssid->Configuration.DSConfig != padapter->mlmeextpriv.channel_set[padapter->mlmeextpriv.sitesurvey_res.channel_idx].ChannelNum) -- { -- bssid->PhyInfo.SignalQuality= 101; -- } - -- return _SUCCESS; -+ pattrib->last_txcmdsz = pattrib->pktlen; -+ -+ dump_mgntframe(padapter, pmgntframe); - - } - --void start_create_ibss(_adapter* padapter) -+unsigned int send_delba(_adapter *padapter, u8 initiator, u8 *addr) - { -- unsigned short caps; -- u32 val32; -- u8 val8; -- u8 join_type; -+ struct sta_priv *pstapriv = &padapter->stapriv; -+ struct sta_info *psta = NULL; -+ //struct recv_reorder_ctrl *preorder_ctrl; - struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; - struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); -- WLAN_BSSID_EX *pnetwork = (WLAN_BSSID_EX*)(&(pmlmeinfo->network)); -- pmlmeext->cur_channel = (u8)pnetwork->Configuration.DSConfig; -- pmlmeinfo->bcn_interval = get_beacon_interval(pnetwork); -+ u16 tid; - -- //update wireless mode -- update_wireless_mode(padapter); -+ if((pmlmeinfo->state&0x03) != WIFI_FW_AP_STATE) -+ if (!(pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS)) -+ return _SUCCESS; -+ -+ psta = rtw_get_stainfo(pstapriv, addr); -+ if(psta==NULL) -+ return _SUCCESS; +@@ -7442,7 +8910,7 @@ unsigned int send_delba(_adapter *padapter, u8 initiator, u8 *addr) + if(psta==NULL) + return _SUCCESS; -- //udpate capability -- caps = rtw_get_capability((WLAN_BSSID_EX *)pnetwork); -- update_capinfo(padapter, caps); -- if(caps&cap_IBSS)//adhoc master +- //DBG_8192C("%s:%s\n", __FUNCTION__, (initiator==0)?"RX_DIR":"TX_DIR"); + //DBG_871X("%s:%s\n", __FUNCTION__, (initiator==0)?"RX_DIR":"TX_DIR"); -+ -+ if(initiator==0) // recipient + + if(initiator==0) // recipient { -- //set_opmode_cmd(padapter, adhoc);//removed -- -- val8 = 0xcf; -- padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_SEC_CFG, (u8 *)(&val8)); -- -- //switch channel -- //SelectChannel(padapter, pmlmeext->cur_channel, HAL_PRIME_CHNL_OFFSET_DONT_CARE); -- set_channel_bwmode(padapter, pmlmeext->cur_channel, HAL_PRIME_CHNL_OFFSET_DONT_CARE, HT_CHANNEL_WIDTH_20); -- -- beacon_timing_control(padapter); -- -- //set msr to WIFI_FW_ADHOC_STATE -- pmlmeinfo->state = WIFI_FW_ADHOC_STATE; -- Set_NETYPE0_MSR(padapter, (pmlmeinfo->state & 0x3)); -- -- //issue beacon -- if(send_beacon(padapter)==_FAIL) -+ for(tid = 0;tidstate = WIFI_FW_NULL_STATE; -- } -- else -- { -- padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_BSSID, padapter->registrypriv.dev_network.MacAddress); -- join_type = 0; -- padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_MLME_JOIN, (u8 *)(&join_type)); -- -- report_join_res(padapter, 1); -- pmlmeinfo->state |= WIFI_FW_ASSOC_SUCCESS; -+ if(psta->recvreorder_ctrl[tid].enable == _TRUE) -+ { + if(psta->recvreorder_ctrl[tid].enable == _TRUE) + { +- DBG_8192C("rx agg disable tid(%d)\n",tid); + DBG_871X("rx agg disable tid(%d)\n",tid); -+ issue_action_BA(padapter, addr, RTW_WLAN_ACTION_DELBA, (((tid <<1) |initiator)&0x1F)); -+ psta->recvreorder_ctrl[tid].enable = _FALSE; -+ psta->recvreorder_ctrl[tid].indicate_seq = 0xffff; -+ #ifdef DBG_RX_SEQ -+ DBG_871X("DBG_RX_SEQ %s:%d indicate_seq:%u \n", __FUNCTION__, __LINE__, -+ psta->recvreorder_ctrl[tid].indicate_seq); -+ #endif -+ } - } + issue_action_BA(padapter, addr, RTW_WLAN_ACTION_DELBA, (((tid <<1) |initiator)&0x1F)); + psta->recvreorder_ctrl[tid].enable = _FALSE; + psta->recvreorder_ctrl[tid].indicate_seq = 0xffff; +@@ -7463,12 +8931,12 @@ unsigned int send_delba(_adapter *padapter, u8 initiator, u8 *addr) } -- else -+ else if(initiator == 1)// originator + else if(initiator == 1)// originator { -- DBG_871X("start_create_ibss, invalid cap:%x\n", caps); -- return; +- //DBG_8192C("tx agg_enable_bitmap(0x%08x)\n", psta->htpriv.agg_enable_bitmap); + //DBG_871X("tx agg_enable_bitmap(0x%08x)\n", psta->htpriv.agg_enable_bitmap); -+ for(tid = 0;tidhtpriv.agg_enable_bitmap & BIT(tid)) -+ { + for(tid = 0;tidhtpriv.agg_enable_bitmap & BIT(tid)) + { +- DBG_8192C("tx agg disable tid(%d)\n",tid); + DBG_871X("tx agg disable tid(%d)\n",tid); -+ issue_action_BA(padapter, addr, RTW_WLAN_ACTION_DELBA, (((tid <<1) |initiator)&0x1F) ); -+ psta->htpriv.agg_enable_bitmap &= ~BIT(tid); -+ psta->htpriv.candidate_tid_bitmap &= ~BIT(tid); -+ -+ } -+ } - } -- -+ -+ return _SUCCESS; -+ - } - --void start_clnt_join(_adapter* padapter) -+unsigned int send_beacon(_adapter *padapter) + issue_action_BA(padapter, addr, RTW_WLAN_ACTION_DELBA, (((tid <<1) |initiator)&0x1F) ); + psta->htpriv.agg_enable_bitmap &= ~BIT(tid); + psta->htpriv.candidate_tid_bitmap &= ~BIT(tid); +@@ -7484,38 +8952,63 @@ unsigned int send_delba(_adapter *padapter, u8 initiator, u8 *addr) + unsigned int send_beacon(_adapter *padapter) { -- unsigned short caps; -- u8 val8; -- struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; -- struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); -- WLAN_BSSID_EX *pnetwork = (WLAN_BSSID_EX*)(&(pmlmeinfo->network)); -+ u8 bxmitok = _FALSE; + u8 bxmitok = _FALSE; +- int retry=0; +- +- //DBG_871X("%s\n", __FUNCTION__); + int issue=0; + int poll = 0; +//#ifdef CONFIG_CONCURRENT_MODE @@ -17319,39 +17380,24 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + //struct mlme_priv *pbuddy_mlmepriv = &(pbuddy_adapter->mlmepriv); +//#endif -+#ifdef CONFIG_PCI_HCI + #ifdef CONFIG_PCI_HCI -- pmlmeext->cur_channel = (u8)pnetwork->Configuration.DSConfig; -- pmlmeinfo->bcn_interval = get_beacon_interval(pnetwork); + //DBG_871X("%s\n", __FUNCTION__); ++ + issue_beacon(padapter); -- //update wireless mode -- update_wireless_mode(padapter); -+ issue_beacon(padapter); - -- //udpate capability -- caps = rtw_get_capability((WLAN_BSSID_EX *)pnetwork); -- update_capinfo(padapter, caps); -- if (caps&cap_ESS) -- { -- Set_NETYPE0_MSR(padapter, WIFI_FW_STATION_STATE); -+ return _SUCCESS; + return _SUCCESS; -- val8 = (pmlmeinfo->auth_algo == dot11AuthAlgrthm_8021X)? 0xcc: 0xcf; -- padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_SEC_CFG, (u8 *)(&val8)); -+#endif + #endif -- //switch channel -- set_channel_bwmode(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset, pmlmeext->cur_bwmode); +-#ifdef CONFIG_USB_HCI +- do{ +#if defined(CONFIG_USB_HCI) || defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) + u32 start = rtw_get_current_time(); -- //here wait for receiving the beacon to start auth -- //and enable a timer -- set_link_timer(pmlmeext, decide_wait_for_beacon_timeout(pmlmeinfo->bcn_interval)); + rtw_hal_set_hwreg(padapter, HW_VAR_BCN_VALID, NULL); + do{ -+ issue_beacon(padapter); + issue_beacon(padapter); + issue++; + do { + rtw_yield_os(); @@ -17359,182 +17405,113 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + poll++; + }while((poll%10)!=0 && _FALSE == bxmitok && !padapter->bSurpriseRemoved && !padapter->bDriverStopped); -- pmlmeinfo->state = WIFI_FW_AUTH_NULL | WIFI_FW_STATION_STATE; +- padapter->HalFunc.GetHwRegHandler(padapter, HW_VAR_TX_BCN_DONE, (u8 *)(&bxmitok)); +- +- }while((_FALSE == bxmitok) &&((retry++)<100 )); + }while(_FALSE == bxmitok && issue<100 && !padapter->bSurpriseRemoved && !padapter->bDriverStopped); -+ + +- if(retry == 100) + if(padapter->bSurpriseRemoved || padapter->bDriverStopped) + { + return _FAIL; - } -- else if (caps&cap_IBSS) //adhoc client ++ } + if(_FALSE == bxmitok) { -- Set_NETYPE0_MSR(padapter, WIFI_FW_ADHOC_STATE); -- -- val8 = 0xcf; -- padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_SEC_CFG, (u8 *)(&val8)); -- -- //switch channel -- set_channel_bwmode(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset, pmlmeext->cur_bwmode); -- -- beacon_timing_control(padapter); -- -- pmlmeinfo->state = WIFI_FW_ADHOC_STATE; -- -- report_join_res(padapter, 1); +- DBG_871X("send_beacon, fail!\n"); + DBG_871X("%s fail! %u ms\n", __FUNCTION__, rtw_get_passing_time_ms(start)); -+ return _FAIL; + return _FAIL; } else { -- //DBG_8192C("marc: invalid cap:%x\n", caps); -- return; -- } -- --} -- --void start_clnt_auth(_adapter* padapter) --{ -- struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; -- struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); -- -- _cancel_timer_ex(&pmlmeext->link_timer); + u32 passing_time = rtw_get_passing_time_ms(start); - -- pmlmeinfo->state &= (~WIFI_FW_AUTH_NULL); -- pmlmeinfo->state |= WIFI_FW_AUTH_STATE; ++ + if(passing_time > 100 || issue > 3) + DBG_871X("%s success, issue:%d, poll:%d, %u ms\n", __FUNCTION__, issue, poll, rtw_get_passing_time_ms(start)); + //else + // DBG_871X("%s success, issue:%d, poll:%d, %u ms\n", __FUNCTION__, issue, poll, rtw_get_passing_time_ms(start)); + -+ return _SUCCESS; -+ } - -- pmlmeinfo->auth_seq = 1; -- pmlmeinfo->reauth_count = 0; -- pmlmeinfo->reassoc_count = 0; -- pmlmeinfo->link_count = 0; + return _SUCCESS; + } +-#endif +- ++ +#endif - -+} - -- // Because of AP's not receiving deauth before -- // AP may: 1)not response auth or 2)deauth us after link is complete -- // issue deauth before issuing auth to deal with the situation -- issue_deauth(padapter, (&(pmlmeinfo->network))->MacAddress, WLAN_REASON_DEAUTH_LEAVING); -+/**************************************************************************** - -- issue_auth(padapter, NULL, 0); -+Following are some utitity fuctions for WiFi MLME - -- set_link_timer(pmlmeext, REAUTH_TO); -+*****************************************************************************/ - -+BOOLEAN IsLegal5GChannel( -+ IN PADAPTER Adapter, -+ IN u8 channel) -+{ -+ -+ int i=0; -+ u8 Channel_5G[45] = {36,38,40,42,44,46,48,50,52,54,56,58, -+ 60,62,64,100,102,104,106,108,110,112,114,116,118,120,122, -+ 124,126,128,130,132,134,136,138,140,149,151,153,155,157,159, -+ 161,163,165}; -+ for(i=0;imlmeextpriv; struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); -+ u32 initialgain = 0; + u32 initialgain = 0; +- + u8 restore_initial_gain = 1; - -- _cancel_timer_ex(&pmlmeext->link_timer); -- -- pmlmeinfo->state &= (~(WIFI_FW_AUTH_NULL | WIFI_FW_AUTH_STATE)); -- pmlmeinfo->state |= (WIFI_FW_AUTH_SUCCESS | WIFI_FW_ASSOC_STATE); -+#ifdef CONFIG_P2P - -- issue_assocreq(padapter); ++ + #ifdef CONFIG_P2P ++ +#ifdef CONFIG_CONCURRENT_MODE - -- set_link_timer(pmlmeext, REASSOC_TO); --} ++ +#ifdef CONFIG_STA_MODE_SCAN_UNDER_AP_MODE + u8 stay_buddy_ch = 0; +#endif //CONFIG_STA_MODE_SCAN_UNDER_AP_MODE - --unsigned int receive_disconnect(_adapter *padapter, unsigned char *MacAddr, unsigned short reason) --{ -- struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; -- struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); ++ + struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); + PADAPTER pbuddy_adapter = padapter->pbuddy_adapter; + struct mlme_ext_priv *pbuddy_mlmeext = &pbuddy_adapter->mlmeextpriv; - -- //check A3 -- if (!(_rtw_memcmp(MacAddr, get_my_bssid(&pmlmeinfo->network), ETH_ALEN))) -- return _SUCCESS; ++ +#endif //CONFIG_CONCURRENT_MODE -+ struct wifidirect_info *pwdinfo= &(padapter->wdinfo); -+ static unsigned char prev_survey_channel = 0; -+ static unsigned int p2p_scan_count = 0; - -- DBG_871X("%s\n", __FUNCTION__); - -- if((pmlmeinfo->state&0x03) == WIFI_FW_STATION_STATE) + struct wifidirect_info *pwdinfo= &(padapter->wdinfo); + static unsigned char prev_survey_channel = 0; + static unsigned int p2p_scan_count = 0; +- +- if(rtw_p2p_findphase_ex_is_social(pwdinfo)) ++ ++ + if ( ( pwdinfo->rx_invitereq_info.scan_op_ch_only ) || ( pwdinfo->p2p_info.scan_op_ch_only ) ) - { -- if (pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS) ++ { + if ( pwdinfo->rx_invitereq_info.scan_op_ch_only ) - { -- pmlmeinfo->state = WIFI_FW_NULL_STATE; -- report_del_sta_event(padapter, MacAddr, reason); ++ { + survey_channel = pwdinfo->rx_invitereq_info.operation_ch[pmlmeext->sitesurvey_res.channel_idx]; - } -- else if (pmlmeinfo->state & WIFI_FW_LINKING_STATE) ++ } + else - { -- pmlmeinfo->state = WIFI_FW_NULL_STATE; -- report_join_res(padapter, -2); ++ { + survey_channel = pwdinfo->p2p_info.operation_ch[pmlmeext->sitesurvey_res.channel_idx]; + } + ScanType = SCAN_ACTIVE; + } + else if(rtw_p2p_findphase_ex_is_social(pwdinfo)) -+ { -+ // Commented by Albert 2011/06/03 -+ // The driver is in the find phase, it should go through the social channel. + { + // Commented by Albert 2011/06/03 + // The driver is in the find phase, it should go through the social channel. + int ch_set_idx; -+ survey_channel = pwdinfo->social_chan[pmlmeext->sitesurvey_res.channel_idx]; + survey_channel = pwdinfo->social_chan[pmlmeext->sitesurvey_res.channel_idx]; + ch_set_idx = rtw_ch_set_search_ch(pmlmeext->channel_set, survey_channel); + if (ch_set_idx >= 0) + ScanType = pmlmeext->channel_set[ch_set_idx].ScanType; + else + ScanType = SCAN_ACTIVE; -+ } -+ else -+#endif //CONFIG_P2P -+ { + } + else + #endif //CONFIG_P2P + { +- survey_channel = pmlmeext->channel_set[pmlmeext->sitesurvey_res.channel_idx].ChannelNum; + struct rtw_ieee80211_channel *ch; + if (pmlmeext->sitesurvey_res.channel_idx < pmlmeext->sitesurvey_res.ch_num) { + ch = &pmlmeext->sitesurvey_res.ch[pmlmeext->sitesurvey_res.channel_idx]; + survey_channel = ch->hw_value; + ScanType = (ch->flags & RTW_IEEE80211_CHAN_PASSIVE_SCAN) ? SCAN_PASSIVE : SCAN_ACTIVE; - } ++ } } -- return _SUCCESS; --} +- ScanType = pmlmeext->channel_set[pmlmeext->sitesurvey_res.channel_idx].ScanType; +- +- //DBG_871X("switching to ch:%d (cnt:%u,idx:%d) at %dms, %c%c%c\n" +- // , survey_channel +- // , pwdinfo->find_phase_state_exchange_cnt, pmlmeext->sitesurvey_res.channel_idx +- // , rtw_get_passing_time_ms(padapter->mlmepriv.scan_start_time) +- // , ScanType?'A':'P', pmlmeext->sitesurvey_res.scan_mode?'A':'P' +- // , pmlmeext->sitesurvey_res.ssid[0].SsidLength?'S':' ' +- //); + if (0) + DBG_871X(FUNC_ADPT_FMT" ch:%u(cnt:%u,idx:%d) at %dms, %c%c%c\n" + , FUNC_ADPT_ARG(padapter) @@ -17545,12 +17522,14 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + , pmlmeext->sitesurvey_res.ssid[0].SsidLength?'S':' ' + ); --/**************************************************************************** -+ if(survey_channel != 0) -+ { -+ //PAUSE 4-AC Queue when site_survey + if(survey_channel != 0) + { + //PAUSE 4-AC Queue when site_survey +- //padapter->HalFunc.GetHwRegHandler(padapter, HW_VAR_TXPAUSE, (u8 *)(&val8)); + //rtw_hal_get_hwreg(padapter, HW_VAR_TXPAUSE, (u8 *)(&val8)); -+ //val8 |= 0x0f; + //val8 |= 0x0f; +- //padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_TXPAUSE, (u8 *)(&val8)); +- + //rtw_hal_set_hwreg(padapter, HW_VAR_TXPAUSE, (u8 *)(&val8)); +#ifdef CONFIG_CONCURRENT_MODE +#ifdef CONFIG_STA_MODE_SCAN_UNDER_AP_MODE @@ -17571,23 +17550,19 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + } +#endif //CONFIG_STA_MODE_SCAN_UNDER_AP_MODE +#endif //CONFIG_CONCURRENT_MODE -+ if(pmlmeext->sitesurvey_res.channel_idx == 0) -+ { -+ set_channel_bwmode(padapter, survey_channel, HAL_PRIME_CHNL_OFFSET_DONT_CARE, HT_CHANNEL_WIDTH_20); -+ } -+ else -+ { -+ SelectChannel(padapter, survey_channel); -+ } + if(pmlmeext->sitesurvey_res.channel_idx == 0) + { + set_channel_bwmode(padapter, survey_channel, HAL_PRIME_CHNL_OFFSET_DONT_CARE, HT_CHANNEL_WIDTH_20); +@@ -7591,17 +9139,35 @@ void site_survey(_adapter *padapter) + SelectChannel(padapter, survey_channel); + } --Following are the functions to report events +#ifdef CONFIG_STA_MODE_SCAN_UNDER_AP_MODE + if( stay_buddy_ch == 1 ) + { + val8 = 0; //survey done + rtw_hal_set_hwreg(padapter, HW_VAR_MLME_SITESURVEY, (u8 *)(&val8)); - --*****************************************************************************/ ++ + if(check_buddy_mlmeinfo_state(padapter, WIFI_FW_AP_STATE) && + check_buddy_fwstate(padapter, _FW_LINKED)) + { @@ -17601,56 +17576,49 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + } +#endif //CONFIG_STA_MODE_SCAN_UNDER_AP_MODE --void report_survey_event(_adapter *padapter, union recv_frame *precv_frame) --{ -- struct cmd_obj *pcmd_obj; -- u8 *pevtcmd; -- u32 cmdsz; -- struct survey_event *psurvey_evt; -- struct C2HEvent_Header *pc2h_evt_hdr; -- struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; -- struct cmd_priv *pcmdpriv = &padapter->cmdpriv; -- //u8 *pframe = precv_frame->u.hdr.rx_data; -- //uint len = precv_frame->u.hdr.len; -+ if(ScanType == SCAN_ACTIVE) //obey the channel plan setting... + if(ScanType == SCAN_ACTIVE) //obey the channel plan setting... +- { + { -+ #ifdef CONFIG_P2P -+ if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_SCAN) || -+ rtw_p2p_chk_state(pwdinfo, P2P_STATE_FIND_PHASE_SEARCH) -+ ) -+ { + #ifdef CONFIG_P2P + if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_SCAN) || + rtw_p2p_chk_state(pwdinfo, P2P_STATE_FIND_PHASE_SEARCH) + ) + { +- issue_probereq_p2p(padapter); +- issue_probereq_p2p(padapter); +- issue_probereq_p2p(padapter); + issue_probereq_p2p(padapter, NULL); + issue_probereq_p2p(padapter, NULL); + issue_probereq_p2p(padapter, NULL); -+ } -+ else -+ #endif //CONFIG_P2P -+ { -+ int i; -+ for(i=0;isitesurvey_res.ssid[i].SsidLength) { -+ //todo: to issue two probe req??? + } + else + #endif //CONFIG_P2P +@@ -7610,9 +9176,9 @@ void site_survey(_adapter *padapter) + for(i=0;isitesurvey_res.ssid[i].SsidLength) { + //todo: to issue two probe req??? +- issue_probereq(padapter, &(pmlmeext->sitesurvey_res.ssid[i]),1); + issue_probereq(padapter, &(pmlmeext->sitesurvey_res.ssid[i]), NULL); -+ //rtw_msleep_os(SURVEY_TO>>1); + //rtw_msleep_os(SURVEY_TO>>1); +- issue_probereq(padapter, &(pmlmeext->sitesurvey_res.ssid[i]),1); + issue_probereq(padapter, &(pmlmeext->sitesurvey_res.ssid[i]), NULL); -+ } else { -+ break; -+ } -+ } + } else { + break; + } +@@ -7620,47 +9186,98 @@ void site_survey(_adapter *padapter) -- if ((pcmd_obj = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj))) == NULL) -- { -- return; -- } -+ if(pmlmeext->sitesurvey_res.scan_mode == SCAN_ACTIVE) { -+ //todo: to issue two probe req??? + if(pmlmeext->sitesurvey_res.scan_mode == SCAN_ACTIVE) { + //todo: to issue two probe req??? +- issue_probereq(padapter, NULL, 1); + issue_probereq(padapter, NULL, NULL); -+ //rtw_msleep_os(SURVEY_TO>>1); + //rtw_msleep_os(SURVEY_TO>>1); +- issue_probereq(padapter, NULL, 1); + issue_probereq(padapter, NULL, NULL); -+ } -+ } -+ } -+ + } + } + } + +- set_survey_timer(pmlmeext, pmlmeext->chan_scan_time); +#ifdef CONFIG_STA_MODE_SCAN_UNDER_AP_MODE + if( stay_buddy_ch == 1 ) + set_survey_timer(pmlmeext, pmlmeext->chan_scan_time * RTW_STAY_AP_CH_MILLISECOND ); @@ -17658,21 +17626,12 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release +#endif //CONFIG_STA_MODE_SCAN_UNDER_AP_MODE + set_survey_timer(pmlmeext, pmlmeext->chan_scan_time); -- cmdsz = (sizeof(struct survey_event) + sizeof(struct C2HEvent_Header)); -- if ((pevtcmd = (u8*)rtw_zmalloc(cmdsz)) == NULL) -- { -- rtw_mfree((u8 *)pcmd_obj, sizeof(struct cmd_obj)); -- return; } -+ else -+ { - -- _rtw_init_listhead(&pcmd_obj->list); -+ // channel number is 0 or this channel is not valid. + else + { -- pcmd_obj->cmdcode = GEN_CMD_CODE(_Set_MLME_EVT); -- pcmd_obj->cmdsz = cmdsz; -- pcmd_obj->parmbuf = pevtcmd; + // channel number is 0 or this channel is not valid. ++ +#ifdef CONFIG_CONCURRENT_MODE + u8 cur_channel; + u8 cur_bwmode; @@ -17703,75 +17662,60 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + cur_ch_offset = pmlmeext->cur_ch_offset; + } +#endif - -- pcmd_obj->rsp = NULL; -- pcmd_obj->rspsz = 0; ++ + -+#ifdef CONFIG_P2P -+ if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_SCAN) || rtw_p2p_chk_state(pwdinfo, P2P_STATE_FIND_PHASE_SEARCH)) -+ { + #ifdef CONFIG_P2P + if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_SCAN) || rtw_p2p_chk_state(pwdinfo, P2P_STATE_FIND_PHASE_SEARCH)) + { + if( ( pwdinfo->rx_invitereq_info.scan_op_ch_only ) || ( pwdinfo->p2p_info.scan_op_ch_only ) ) + { + // Set the find_phase_state_exchange_cnt to P2P_FINDPHASE_EX_CNT. + // This will let the following flow to run the scanning end. + rtw_p2p_findphase_ex_set(pwdinfo, P2P_FINDPHASE_EX_MAX); + } -+ #ifdef CONFIG_DBG_P2P + #ifdef CONFIG_DBG_P2P +- DBG_8192C( "[%s] find phase exchange cnt = %d\n", __FUNCTION__, pwdinfo->find_phase_state_exchange_cnt ); + DBG_871X( "[%s] find phase exchange cnt = %d\n", __FUNCTION__, pwdinfo->find_phase_state_exchange_cnt ); -+ #endif -+ } - -- pc2h_evt_hdr = (struct C2HEvent_Header*)(pevtcmd); -- pc2h_evt_hdr->len = sizeof(struct survey_event); -- pc2h_evt_hdr->ID = GEN_EVT_CODE(_Survey); -- pc2h_evt_hdr->seq = ATOMIC_INC_RETURN(&pmlmeext->event_seq); -+ if(rtw_p2p_findphase_ex_is_needed(pwdinfo)) -+ { -+ // Set the P2P State to the listen state of find phase and set the current channel to the listen channel -+ set_channel_bwmode(padapter, pwdinfo->listen_channel, HAL_PRIME_CHNL_OFFSET_DONT_CARE, HT_CHANNEL_WIDTH_20); -+ rtw_p2p_set_state(pwdinfo, P2P_STATE_FIND_PHASE_LISTEN); -+ pmlmeext->sitesurvey_res.state = SCAN_DISABLE; + #endif + } +- ++ + if(rtw_p2p_findphase_ex_is_needed(pwdinfo)) + { + // Set the P2P State to the listen state of find phase and set the current channel to the listen channel + set_channel_bwmode(padapter, pwdinfo->listen_channel, HAL_PRIME_CHNL_OFFSET_DONT_CARE, HT_CHANNEL_WIDTH_20); + rtw_p2p_set_state(pwdinfo, P2P_STATE_FIND_PHASE_LISTEN); +- + pmlmeext->sitesurvey_res.state = SCAN_DISABLE; -- psurvey_evt = (struct survey_event*)(pevtcmd + sizeof(struct C2HEvent_Header)); + //turn on dynamic functions + Restore_DM_Func_Flag(padapter); + //Switch_DM_Func(padapter, DYNAMIC_FUNC_DIG|DYNAMIC_FUNC_HP|DYNAMIC_FUNC_SS, _TRUE); + -+ _set_timer( &pwdinfo->find_phase_timer, ( u32 ) ( ( u32 ) ( pwdinfo->listen_dwell ) * 100 ) ); -+ } -+ else -+#endif //CONFIG_P2P -+ { + _set_timer( &pwdinfo->find_phase_timer, ( u32 ) ( ( u32 ) ( pwdinfo->listen_dwell ) * 100 ) ); + } + else + #endif //CONFIG_P2P + { -- if (collect_bss_info(padapter, precv_frame, (WLAN_BSSID_EX *)&psurvey_evt->bss) == _FAIL) -- { -- rtw_mfree((u8 *)pcmd_obj, sizeof(struct cmd_obj)); -- rtw_mfree((u8 *)pevtcmd, cmdsz); -- return; -- } +#ifdef CONFIG_STA_MODE_SCAN_UNDER_AP_MODE + pmlmeinfo->scan_cnt = 0; +#endif //CONFIG_DMP_STA_NODE_SCAN_UNDER_AP_MODE - -- rtw_enqueue_cmd(pcmdpriv, pcmd_obj); -+#ifdef CONFIG_ANTENNA_DIVERSITY -+ // 20100721:Interrupt scan operation here. -+ // For SW antenna diversity before link, it needs to switch to another antenna and scan again. -+ // It compares the scan result and select beter one to do connection. ++ + #ifdef CONFIG_ANTENNA_DIVERSITY + // 20100721:Interrupt scan operation here. + // For SW antenna diversity before link, it needs to switch to another antenna and scan again. + // It compares the scan result and select beter one to do connection. +- if(padapter->HalFunc.SwAntDivBeforeLinkHandler(padapter)) + if(rtw_hal_antdiv_before_linked(padapter)) -+ { -+ pmlmeext->sitesurvey_res.bss_cnt = 0; -+ pmlmeext->sitesurvey_res.channel_idx = -1; -+ pmlmeext->chan_scan_time = SURVEY_TO /2; -+ set_survey_timer(pmlmeext, pmlmeext->chan_scan_time); -+ return; -+ } -+#endif - -- pmlmeext->sitesurvey_res.bss_cnt++; -+#ifdef CONFIG_P2P -+ if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_SCAN) || rtw_p2p_chk_state(pwdinfo, P2P_STATE_FIND_PHASE_SEARCH)) -+ { + { + pmlmeext->sitesurvey_res.bss_cnt = 0; + pmlmeext->sitesurvey_res.channel_idx = -1; +@@ -7673,7 +9290,18 @@ void site_survey(_adapter *padapter) + #ifdef CONFIG_P2P + if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_SCAN) || rtw_p2p_chk_state(pwdinfo, P2P_STATE_FIND_PHASE_SEARCH)) + { +- rtw_p2p_set_state(pwdinfo, P2P_STATE_LISTEN); + #ifdef CONFIG_CONCURRENT_MODE + if( pwdinfo->driver_interface == DRIVER_WEXT ) + { @@ -17784,18 +17728,25 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + #else + rtw_p2p_set_state(pwdinfo, rtw_p2p_pre_state(pwdinfo)); + #endif -+ } -+ rtw_p2p_findphase_ex_set(pwdinfo, P2P_FINDPHASE_EX_NONE); -+#endif //CONFIG_P2P -+ -+ pmlmeext->sitesurvey_res.state = SCAN_COMPLETE; - -- return; -+ //switch back to the original channel -+ //SelectChannel(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset); + } + rtw_p2p_findphase_ex_set(pwdinfo, P2P_FINDPHASE_EX_NONE); + #endif //CONFIG_P2P +@@ -7683,41 +9311,77 @@ void site_survey(_adapter *padapter) + //switch back to the original channel + //SelectChannel(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset); --} -+ { +-#ifdef CONFIG_P2P +- if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_GONEGO_OK) +- && pwdinfo->peer_operating_ch != 0 +- ) +- { +- DBG_8192C( "[%s] In P2P WPS mode, stay in the peer operating channel = %d\n", __FUNCTION__, pwdinfo->peer_operating_ch ); +- set_channel_bwmode(padapter, pwdinfo->peer_operating_ch, pmlmeext->cur_ch_offset, pmlmeext->cur_bwmode); +- } +- else +-#endif //CONFIG_P2P + { +- set_channel_bwmode(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset, pmlmeext->cur_bwmode); +#ifdef CONFIG_CONCURRENT_MODE + set_channel_bwmode(padapter, cur_channel, cur_ch_offset, cur_bwmode); +#else @@ -17817,25 +17768,20 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + } +#endif //CONFIG_DUALMAC_CONCURRENT +#endif //CONFIG_CONCURRENT_MODE -+ } + } --void report_surveydone_event(_adapter *padapter) --{ -- struct cmd_obj *pcmd_obj; -- u8 *pevtcmd; -- u32 cmdsz; -- struct surveydone_event *psurveydone_evt; -- struct C2HEvent_Header *pc2h_evt_hdr; -- struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; -- struct cmd_priv *pcmdpriv = &padapter->cmdpriv; -+ //flush 4-AC Queue after site_survey -+ //val8 = 0; + //flush 4-AC Queue after site_survey + //val8 = 0; +- //padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_TXPAUSE, (u8 *)(&val8)); + //rtw_hal_set_hwreg(padapter, HW_VAR_TXPAUSE, (u8 *)(&val8)); -+ + +- val8 = 0; +- padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_MLME_SITESURVEY, (u8 *)(&val8)); + val8 = 0; //survey done + rtw_hal_set_hwreg(padapter, HW_VAR_MLME_SITESURVEY, (u8 *)(&val8)); -+ -+ //config MSR + + //config MSR +- Set_NETYPE0_MSR(padapter, (pmlmeinfo->state & 0x3)); + Set_MSR(padapter, (pmlmeinfo->state & 0x3)); + + @@ -17851,17 +17797,17 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + initialgain = 0xff; //restore RX GAIN + rtw_hal_set_hwreg(padapter, HW_VAR_INITIAL_GAIN, (u8 *)(&initialgain)); + } -+ -+ //turn on dynamic functions -+ Restore_DM_Func_Flag(padapter); -+ //Switch_DM_Func(padapter, DYNAMIC_FUNC_DIG|DYNAMIC_FUNC_HP|DYNAMIC_FUNC_SS, _TRUE); -- if ((pcmd_obj = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj))) == NULL) -- { -- return; -- } -+ if (is_client_associated_to_ap(padapter) == _TRUE) -+ { +- initialgain = 0xff; //restore RX GAIN +- padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_INITIAL_GAIN, (u8 *)(&initialgain)); + //turn on dynamic functions + Restore_DM_Func_Flag(padapter); + //Switch_DM_Func(padapter, DYNAMIC_FUNC_DIG|DYNAMIC_FUNC_HP|DYNAMIC_FUNC_SS, _TRUE); + + if (is_client_associated_to_ap(padapter) == _TRUE) + { +- //issue null data +- issue_nulldata(padapter, 0); + issue_nulldata(padapter, NULL, 0, 3, 500); + +#ifdef CONFIG_CONCURRENT_MODE @@ -17877,537 +17823,230 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + else if(is_client_associated_to_ap(padapter->pbuddy_adapter) == _TRUE) + { + issue_nulldata(padapter->pbuddy_adapter, NULL, 0, 3, 500); -+ } + } +#endif -- cmdsz = (sizeof(struct surveydone_event) + sizeof(struct C2HEvent_Header)); -- if ((pevtcmd = (u8*)rtw_zmalloc(cmdsz)) == NULL) -- { -- rtw_mfree((u8 *)pcmd_obj, sizeof(struct cmd_obj)); -- return; -- } -+ report_surveydone_event(padapter); + report_surveydone_event(padapter); -- _rtw_init_listhead(&pcmd_obj->list); -+ pmlmeext->chan_scan_time = SURVEY_TO; -+ pmlmeext->sitesurvey_res.state = SCAN_DISABLE; +@@ -7730,6 +9394,19 @@ void site_survey(_adapter *padapter) -- pcmd_obj->cmdcode = GEN_CMD_CODE(_Set_MLME_EVT); -- pcmd_obj->cmdsz = cmdsz; -- pcmd_obj->parmbuf = pevtcmd; -+ issue_action_BSSCoexistPacket(padapter); -+ issue_action_BSSCoexistPacket(padapter); -+ issue_action_BSSCoexistPacket(padapter); - -- pcmd_obj->rsp = NULL; -- pcmd_obj->rspsz = 0; -+ } + } -- pc2h_evt_hdr = (struct C2HEvent_Header*)(pevtcmd); -- pc2h_evt_hdr->len = sizeof(struct surveydone_event); -- pc2h_evt_hdr->ID = GEN_EVT_CODE(_SurveyDone); -- pc2h_evt_hdr->seq = ATOMIC_INC_RETURN(&pmlmeext->event_seq); +#ifdef CONFIG_CONCURRENT_MODE + if(check_buddy_mlmeinfo_state(padapter, WIFI_FW_AP_STATE) && + check_buddy_fwstate(padapter, _FW_LINKED)) + { - -- psurveydone_evt = (struct surveydone_event*)(pevtcmd + sizeof(struct C2HEvent_Header)); -- psurveydone_evt->bss_cnt = pmlmeext->sitesurvey_res.bss_cnt; ++ + DBG_871X("survey done, current CH=%d, BW=%d, offset=%d\n", cur_channel, cur_bwmode, cur_ch_offset); - -- DBG_871X("survey done event(%x)\n", psurveydone_evt->bss_cnt); ++ + DBG_871X("restart pbuddy_adapter's beacon\n"); + + update_beacon(padapter->pbuddy_adapter, 0, NULL, _TRUE); + } +#endif - -- rtw_enqueue_cmd(pcmdpriv, pcmd_obj); -+ } ++ + } return; +@@ -7753,7 +9430,7 @@ u8 collect_bss_info(_adapter *padapter, union recv_frame *precv_frame, WLAN_BSSI - } - --void report_join_res(_adapter *padapter, int res) -+//collect bss info from Beacon and Probe response frames. -+u8 collect_bss_info(_adapter *padapter, union recv_frame *precv_frame, WLAN_BSSID_EX *bssid) - { -- struct cmd_obj *pcmd_obj; -- u8 *pevtcmd; -- u32 cmdsz; -- struct joinbss_event *pjoinbss_evt; -- struct C2HEvent_Header *pc2h_evt_hdr; -- struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; -+ int i; -+ u32 len; -+ u8 *p; -+ u16 val16, subtype; -+ u8 *pframe = precv_frame->u.hdr.rx_data; -+ u32 packet_len = precv_frame->u.hdr.len; -+ struct registry_priv *pregistrypriv = &padapter->registrypriv; -+ struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; - struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); -- struct cmd_priv *pcmdpriv = &padapter->cmdpriv; - -- if ((pcmd_obj = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj))) == NULL) -- { -- return; -- } -+ len = packet_len - sizeof(struct rtw_ieee80211_hdr_3addr); - -- cmdsz = (sizeof(struct joinbss_event) + sizeof(struct C2HEvent_Header)); -- if ((pevtcmd = (u8*)rtw_zmalloc(cmdsz)) == NULL) -+ if (len > MAX_IE_SZ) + if (len > MAX_IE_SZ) { -- rtw_mfree((u8 *)pcmd_obj, sizeof(struct cmd_obj)); -- return; +- //DBG_8192C("IE too long for survey event\n"); + //DBG_871X("IE too long for survey event\n"); -+ return _FAIL; + return _FAIL; } -- _rtw_init_listhead(&pcmd_obj->list); -- -- pcmd_obj->cmdcode = GEN_CMD_CODE(_Set_MLME_EVT); -- pcmd_obj->cmdsz = cmdsz; -- pcmd_obj->parmbuf = pevtcmd; -- -- pcmd_obj->rsp = NULL; -- pcmd_obj->rspsz = 0; -+ _rtw_memset(bssid, 0, sizeof(WLAN_BSSID_EX)); - -- pc2h_evt_hdr = (struct C2HEvent_Header*)(pevtcmd); -- pc2h_evt_hdr->len = sizeof(struct joinbss_event); -- pc2h_evt_hdr->ID = GEN_EVT_CODE(_JoinBss); -- pc2h_evt_hdr->seq = ATOMIC_INC_RETURN(&pmlmeext->event_seq); -+ subtype = GetFrameSubType(pframe); - -- pjoinbss_evt = (struct joinbss_event*)(pevtcmd + sizeof(struct C2HEvent_Header)); -- _rtw_memcpy((unsigned char *)(&(pjoinbss_evt->network.network)), &(pmlmeinfo->network), sizeof(WLAN_BSSID_EX)); -- pjoinbss_evt->network.join_res = pjoinbss_evt->network.aid = res; -+ if(subtype==WIFI_BEACON) -+ bssid->Reserved[0] = 1; -+ else -+ bssid->Reserved[0] = 0; -+ -+ bssid->Length = sizeof(WLAN_BSSID_EX) - MAX_IE_SZ + len; - -- DBG_871X("report_join_res(%d)\n", res); -+ //below is to copy the information element -+ bssid->IELength = len; -+ _rtw_memcpy(bssid->IEs, (pframe + sizeof(struct rtw_ieee80211_hdr_3addr)), bssid->IELength); - -+ //get the signal strength -+ bssid->PhyInfo.SignalQuality = precv_frame->u.hdr.attrib.signal_qual;//in percentage -+ bssid->PhyInfo.SignalStrength = precv_frame->u.hdr.attrib.signal_strength;//in percentage -+ bssid->Rssi = precv_frame->u.hdr.attrib.RecvSignalPower; // in dBM.raw data +@@ -7778,8 +9455,8 @@ u8 collect_bss_info(_adapter *padapter, union recv_frame *precv_frame, WLAN_BSSI + bssid->Rssi = precv_frame->u.hdr.attrib.RecvSignalPower; // in dBM.raw data -- rtw_joinbss_event_prehandle(padapter, (u8 *)&pjoinbss_evt->network); -- -+#ifdef CONFIG_ANTENNA_DIVERSITY + #ifdef CONFIG_ANTENNA_DIVERSITY +- //padapter->HalFunc.GetHwRegHandler(padapter, HW_VAR_CURRENT_ANTENNA, (u8 *)(&bssid->PhyInfo.Optimum_antenna)); +- padapter->HalFunc.GetHalDefVarHandler(padapter, HAL_DEF_CURRENT_ANTENNA, &bssid->PhyInfo.Optimum_antenna); + //rtw_hal_get_hwreg(padapter, HW_VAR_CURRENT_ANTENNA, (u8 *)(&bssid->PhyInfo.Optimum_antenna)); + rtw_hal_get_def_var(padapter, HAL_DEF_CURRENT_ANTENNA, &bssid->PhyInfo.Optimum_antenna); -+#endif + #endif -- rtw_enqueue_cmd(pcmdpriv, pcmd_obj); -+ // checking SSID -+ if ((p = rtw_get_ie(bssid->IEs + _FIXED_IE_LENGTH_, _SSID_IE_, &len, bssid->IELength - _FIXED_IE_LENGTH_)) == NULL) -+ { -+ DBG_871X("marc: cannot find SSID for survey event\n"); -+ return _FAIL; -+ } + // checking SSID +@@ -7791,6 +9468,11 @@ u8 collect_bss_info(_adapter *padapter, union recv_frame *precv_frame, WLAN_BSSI -- return; -+ if (*(p + 1)) -+ { + if (*(p + 1)) + { + if (len > NDIS_802_11_LENGTH_SSID) + { + DBG_871X("%s()-%d: IE too long (%d) for survey event\n", __FUNCTION__, __LINE__, len); + return _FAIL; + } -+ _rtw_memcpy(bssid->Ssid.Ssid, (p + 2), *(p + 1)); -+ bssid->Ssid.SsidLength = *(p + 1); -+ } -+ else -+ { -+ bssid->Ssid.SsidLength = 0; -+ } - --} -+ _rtw_memset(bssid->SupportedRates, 0, NDIS_802_11_LENGTH_RATES_EX); - --void report_del_sta_event(_adapter *padapter, unsigned char* MacAddr, unsigned short reason) --{ -- struct cmd_obj *pcmd_obj; -- u8 *pevtcmd; -- u32 cmdsz; -- struct stadel_event *pdel_sta_evt; -- struct C2HEvent_Header *pc2h_evt_hdr; -- struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; -- struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); -- struct cmd_priv *pcmdpriv = &padapter->cmdpriv; -+ //checking rate info... -+ i = 0; -+ p = rtw_get_ie(bssid->IEs + _FIXED_IE_LENGTH_, _SUPPORTEDRATES_IE_, &len, bssid->IELength - _FIXED_IE_LENGTH_); -+ if (p != NULL) -+ { + _rtw_memcpy(bssid->Ssid.Ssid, (p + 2), *(p + 1)); + bssid->Ssid.SsidLength = *(p + 1); + } +@@ -7806,6 +9488,11 @@ u8 collect_bss_info(_adapter *padapter, union recv_frame *precv_frame, WLAN_BSSI + p = rtw_get_ie(bssid->IEs + _FIXED_IE_LENGTH_, _SUPPORTEDRATES_IE_, &len, bssid->IELength - _FIXED_IE_LENGTH_); + if (p != NULL) + { + if (len > NDIS_802_11_LENGTH_RATES_EX) + { + DBG_871X("%s()-%d: IE too long (%d) for survey event\n", __FUNCTION__, __LINE__, len); + return _FAIL; + } -+ _rtw_memcpy(bssid->SupportedRates, (p + 2), len); -+ i = len; -+ } - -- if ((pcmd_obj = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj))) == NULL) -+ p = rtw_get_ie(bssid->IEs + _FIXED_IE_LENGTH_, _EXT_SUPPORTEDRATES_IE_, &len, bssid->IELength - _FIXED_IE_LENGTH_); -+ if (p != NULL) + _rtw_memcpy(bssid->SupportedRates, (p + 2), len); + i = len; + } +@@ -7813,6 +9500,11 @@ u8 collect_bss_info(_adapter *padapter, union recv_frame *precv_frame, WLAN_BSSI + p = rtw_get_ie(bssid->IEs + _FIXED_IE_LENGTH_, _EXT_SUPPORTEDRATES_IE_, &len, bssid->IELength - _FIXED_IE_LENGTH_); + if (p != NULL) { -- return; + if (len > (NDIS_802_11_LENGTH_RATES_EX-i)) + { + DBG_871X("%s()-%d: IE too long (%d) for survey event\n", __FUNCTION__, __LINE__, len); + return _FAIL; + } -+ _rtw_memcpy(bssid->SupportedRates + i, (p + 2), len); + _rtw_memcpy(bssid->SupportedRates + i, (p + 2), len); } -- cmdsz = (sizeof(struct stadel_event) + sizeof(struct C2HEvent_Header)); -- if ((pevtcmd = (u8*)rtw_zmalloc(cmdsz)) == NULL) -+ //todo: -+#if 0 -+ if (judge_network_type(bssid->SupportedRates, (len + i)) == WIRELESS_11B) - { -- rtw_mfree((u8 *)pcmd_obj, sizeof(struct cmd_obj)); -- return; -+ bssid->NetworkTypeInUse = Ndis802_11DS; -+ } -+ else -+#endif -+ { -+ bssid->NetworkTypeInUse = Ndis802_11OFDM24; +@@ -7828,6 +9520,9 @@ u8 collect_bss_info(_adapter *padapter, union recv_frame *precv_frame, WLAN_BSSI + bssid->NetworkTypeInUse = Ndis802_11OFDM24; } -- _rtw_init_listhead(&pcmd_obj->list); + if (bssid->IELength < 12) + return _FAIL; ++ + // Checking for DSConfig + p = rtw_get_ie(bssid->IEs + _FIXED_IE_LENGTH_, _DSSET_IE_, &len, bssid->IELength - _FIXED_IE_LENGTH_); -- pcmd_obj->cmdcode = GEN_CMD_CODE(_Set_MLME_EVT); -- pcmd_obj->cmdsz = cmdsz; -- pcmd_obj->parmbuf = pevtcmd; -+ // Checking for DSConfig -+ p = rtw_get_ie(bssid->IEs + _FIXED_IE_LENGTH_, _DSSET_IE_, &len, bssid->IELength - _FIXED_IE_LENGTH_); - -- pcmd_obj->rsp = NULL; -- pcmd_obj->rspsz = 0; -+ bssid->Configuration.DSConfig = 0; -+ bssid->Configuration.Length = 0; - -- pc2h_evt_hdr = (struct C2HEvent_Header*)(pevtcmd); -- pc2h_evt_hdr->len = sizeof(struct stadel_event); -- pc2h_evt_hdr->ID = GEN_EVT_CODE(_DelSTA); -- pc2h_evt_hdr->seq = ATOMIC_INC_RETURN(&pmlmeext->event_seq); -+ if (p) -+ { -+ bssid->Configuration.DSConfig = *(p + 2); -+ } -+ else -+ {// In 5G, some ap do not have DSSET IE -+ // checking HT info for channel -+ p = rtw_get_ie(bssid->IEs + _FIXED_IE_LENGTH_, _HT_ADD_INFO_IE_, &len, bssid->IELength - _FIXED_IE_LENGTH_); -+ if(p) -+ { -+ struct HT_info_element *HT_info = (struct HT_info_element *)(p + 2); -+ bssid->Configuration.DSConfig = HT_info->primary_channel; -+ } -+ else -+ { // use current channel +@@ -7849,16 +9544,11 @@ u8 collect_bss_info(_adapter *padapter, union recv_frame *precv_frame, WLAN_BSSI + } + else + { // use current channel +- if (padapter->mlmeextpriv.sitesurvey_res.state == SCAN_PROCESS) +- bssid->Configuration.DSConfig = padapter->mlmeextpriv.channel_set[padapter->mlmeextpriv.sitesurvey_res.channel_idx].ChannelNum; +- else +- bssid->Configuration.DSConfig = padapter->mlmeextpriv.cur_channel; + bssid->Configuration.DSConfig = rtw_get_oper_ch(padapter); -+ } -+ } - -- pdel_sta_evt = (struct stadel_event*)(pevtcmd + sizeof(struct C2HEvent_Header)); -- _rtw_memcpy((unsigned char *)(&(pdel_sta_evt->macaddr)), MacAddr, ETH_ALEN); -- _rtw_memcpy((unsigned char *)(pdel_sta_evt->rsvd),(unsigned char *)(&reason),2); -+ _rtw_memcpy(&bssid->Configuration.BeaconPeriod, rtw_get_beacon_interval_from_ie(bssid->IEs), 2); -+ bssid->Configuration.BeaconPeriod = le32_to_cpu(bssid->Configuration.BeaconPeriod); - -- DBG_871X("report_del_sta_event: delete STA\n"); -+ val16 = rtw_get_capability((WLAN_BSSID_EX *)bssid); - -- rtw_enqueue_cmd(pcmdpriv, pcmd_obj); -+ if (val16 & BIT(0)) -+ { -+ bssid->InfrastructureMode = Ndis802_11Infrastructure; -+ _rtw_memcpy(bssid->MacAddress, GetAddr2Ptr(pframe), ETH_ALEN); -+ } -+ else -+ { -+ bssid->InfrastructureMode = Ndis802_11IBSS; -+ _rtw_memcpy(bssid->MacAddress, GetAddr3Ptr(pframe), ETH_ALEN); -+ } - -- return; --} -+ if (val16 & BIT(4)) -+ bssid->Privacy = 1; -+ else -+ bssid->Privacy = 0; + } + } --void report_add_sta_event(_adapter *padapter, unsigned char* MacAddr, int cam_idx) --{ -- struct cmd_obj *pcmd_obj; -- u8 *pevtcmd; -- u32 cmdsz; -- struct stassoc_event *padd_sta_evt; -- struct C2HEvent_Header *pc2h_evt_hdr; -- struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; -- struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); -- struct cmd_priv *pcmdpriv = &padapter->cmdpriv; -+ bssid->Configuration.ATIMWindow = 0; + _rtw_memcpy(&bssid->Configuration.BeaconPeriod, rtw_get_beacon_interval_from_ie(bssid->IEs), 2); +- +- + bssid->Configuration.BeaconPeriod = le32_to_cpu(bssid->Configuration.BeaconPeriod); -- if ((pcmd_obj = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj))) == NULL) -- { -- return; -+ //20/40 BSS Coexistence check -+ if((pregistrypriv->wifi_spec==1) && (_FALSE == pmlmeinfo->bwmode_updated)) -+ { -+ struct mlme_priv *pmlmepriv = &padapter->mlmepriv; -+ -+ p = rtw_get_ie(bssid->IEs + _FIXED_IE_LENGTH_, _HT_CAPABILITY_IE_, &len, bssid->IELength - _FIXED_IE_LENGTH_); -+ if(p && len>0) -+ { -+ struct HT_caps_element *pHT_caps; -+ pHT_caps = (struct HT_caps_element *)(p + 2); -+ + val16 = rtw_get_capability((WLAN_BSSID_EX *)bssid); +@@ -7892,7 +9582,7 @@ u8 collect_bss_info(_adapter *padapter, union recv_frame *precv_frame, WLAN_BSSI + struct HT_caps_element *pHT_caps; + pHT_caps = (struct HT_caps_element *)(p + 2); + +- if(pHT_caps->HT_cap_element.HT_caps_info&BIT(14)) + if(pHT_caps->u.HT_cap_element.HT_caps_info&BIT(14)) -+ { -+ pmlmepriv->num_FortyMHzIntolerant++; -+ } -+ } -+ else -+ { -+ pmlmepriv->num_sta_no_ht++; -+ } -+ + { + pmlmepriv->num_FortyMHzIntolerant++; + } +@@ -7904,31 +9594,36 @@ u8 collect_bss_info(_adapter *padapter, union recv_frame *precv_frame, WLAN_BSSI + } -- cmdsz = (sizeof(struct stassoc_event) + sizeof(struct C2HEvent_Header)); -- if ((pevtcmd = (u8*)rtw_zmalloc(cmdsz)) == NULL) +#ifdef CONFIG_INTEL_WIDI + //process_intel_widi_query_or_tigger(padapter, bssid); + if(process_intel_widi_query_or_tigger(padapter, bssid)) - { -- rtw_mfree((u8 *)pcmd_obj, sizeof(struct cmd_obj)); -- return; ++ { + return _FAIL; - } ++ } +#endif // CONFIG_INTEL_WIDI -- _rtw_init_listhead(&pcmd_obj->list); -- -- pcmd_obj->cmdcode = GEN_CMD_CODE(_Set_MLME_EVT); -- pcmd_obj->cmdsz = cmdsz; -- pcmd_obj->parmbuf = pevtcmd; -- -- pcmd_obj->rsp = NULL; -- pcmd_obj->rspsz = 0; -- -- pc2h_evt_hdr = (struct C2HEvent_Header*)(pevtcmd); -- pc2h_evt_hdr->len = sizeof(struct stassoc_event); -- pc2h_evt_hdr->ID = GEN_EVT_CODE(_AddSTA); -- pc2h_evt_hdr->seq = ATOMIC_INC_RETURN(&pmlmeext->event_seq); -- -- padd_sta_evt = (struct stassoc_event*)(pevtcmd + sizeof(struct C2HEvent_Header)); -- _rtw_memcpy((unsigned char *)(&(padd_sta_evt->macaddr)), MacAddr, ETH_ALEN); -- padd_sta_evt->cam_id = cam_idx; -- -- DBG_871X("report_add_sta_event: add STA\n"); +- #if defined(DBG_RX_SIGNAL_DISPLAY_PROCESSING) & 1 + #if defined(DBG_RX_SIGNAL_DISPLAY_SSID_MONITORED) & 1 -+ if(strcmp(bssid->Ssid.Ssid, DBG_RX_SIGNAL_DISPLAY_SSID_MONITORED) == 0) { -+ DBG_871X("Receiving %s("MAC_FMT", DSConfig:%u) from ch%u with ss:%3u, sq:%3u, RawRSSI:%3ld\n" -+ , bssid->Ssid.Ssid, MAC_ARG(bssid->MacAddress), bssid->Configuration.DSConfig + if(strcmp(bssid->Ssid.Ssid, DBG_RX_SIGNAL_DISPLAY_SSID_MONITORED) == 0) { + DBG_871X("Receiving %s("MAC_FMT", DSConfig:%u) from ch%u with ss:%3u, sq:%3u, RawRSSI:%3ld\n" + , bssid->Ssid.Ssid, MAC_ARG(bssid->MacAddress), bssid->Configuration.DSConfig +- , padapter->mlmeextpriv.channel_set[padapter->mlmeextpriv.sitesurvey_res.channel_idx].ChannelNum + , rtw_get_oper_ch(padapter) -+ , bssid->PhyInfo.SignalStrength, bssid->PhyInfo.SignalQuality, bssid->Rssi -+ ); -+ } -+ #endif - -- rtw_enqueue_cmd(pcmdpriv, pcmd_obj); -+ // mark bss info receving from nearby channel as SignalQuality 101 + , bssid->PhyInfo.SignalStrength, bssid->PhyInfo.SignalQuality, bssid->Rssi + ); + } + #endif +- ++ + // mark bss info receving from nearby channel as SignalQuality 101 +- if(bssid->Configuration.DSConfig != padapter->mlmeextpriv.channel_set[padapter->mlmeextpriv.sitesurvey_res.channel_idx].ChannelNum) + if(bssid->Configuration.DSConfig != rtw_get_oper_ch(padapter)) -+ { -+ bssid->PhyInfo.SignalQuality= 101; -+ } + { + bssid->PhyInfo.SignalQuality= 101; + } -- return; -+ return _SUCCESS; + return _SUCCESS; +- } -- --/**************************************************************************** -- --Following are the event callback functions -- --*****************************************************************************/ -- --//for sta/adhoc mode --void update_sta_info(_adapter *padapter, struct sta_info *psta) -+void start_create_ibss(_adapter* padapter) + void start_create_ibss(_adapter* padapter) { -- struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); -+ unsigned short caps; -+ u8 val8; -+ u8 join_type; + unsigned short caps; +- u32 val32; + u8 val8; + u8 join_type; struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; - struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); -+ WLAN_BSSID_EX *pnetwork = (WLAN_BSSID_EX*)(&(pmlmeinfo->network)); -+ pmlmeext->cur_channel = (u8)pnetwork->Configuration.DSConfig; -+ pmlmeinfo->bcn_interval = get_beacon_interval(pnetwork); +@@ -7948,7 +9643,7 @@ void start_create_ibss(_adapter* padapter) + //set_opmode_cmd(padapter, adhoc);//removed -- //ERP -- VCS_update(padapter, psta); -- -+ //update wireless mode -+ update_wireless_mode(padapter); - -- //HT -- if(pmlmepriv->htpriv.ht_option) -+ //udpate capability -+ caps = rtw_get_capability((WLAN_BSSID_EX *)pnetwork); -+ update_capinfo(padapter, caps); -+ if(caps&cap_IBSS)//adhoc master - { -- psta->htpriv.ht_option = _TRUE; -- -- psta->htpriv.ampdu_enable = pmlmepriv->htpriv.ampdu_enable; -+ //set_opmode_cmd(padapter, adhoc);//removed - -- if (support_short_GI(padapter, &(pmlmeinfo->HT_caps))) -- psta->htpriv.sgi = _TRUE; -+ val8 = 0xcf; + val8 = 0xcf; +- padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_SEC_CFG, (u8 *)(&val8)); + rtw_hal_set_hwreg(padapter, HW_VAR_SEC_CFG, (u8 *)(&val8)); -- psta->qos_option = _TRUE; -- -- } -- else -- { -- psta->htpriv.ht_option = _FALSE; -+ //switch channel -+ //SelectChannel(padapter, pmlmeext->cur_channel, HAL_PRIME_CHNL_OFFSET_DONT_CARE); -+ set_channel_bwmode(padapter, pmlmeext->cur_channel, HAL_PRIME_CHNL_OFFSET_DONT_CARE, HT_CHANNEL_WIDTH_20); - -- psta->htpriv.ampdu_enable = _FALSE; -- -- psta->htpriv.sgi = _FALSE; -+ beacon_timing_control(padapter); + //switch channel + //SelectChannel(padapter, pmlmeext->cur_channel, HAL_PRIME_CHNL_OFFSET_DONT_CARE); +@@ -7958,7 +9653,7 @@ void start_create_ibss(_adapter* padapter) -- psta->qos_option = _FALSE; -+ //set msr to WIFI_FW_ADHOC_STATE -+ pmlmeinfo->state = WIFI_FW_ADHOC_STATE; + //set msr to WIFI_FW_ADHOC_STATE + pmlmeinfo->state = WIFI_FW_ADHOC_STATE; +- Set_NETYPE0_MSR(padapter, (pmlmeinfo->state & 0x3)); + Set_MSR(padapter, (pmlmeinfo->state & 0x3)); -- } -- -- psta->htpriv.bwmode = pmlmeext->cur_bwmode; -- psta->htpriv.ch_offset = pmlmeext->cur_ch_offset; -- -- psta->htpriv.agg_enable_bitmap = 0x0;//reset -- psta->htpriv.candidate_tid_bitmap = 0x0;//reset -- -+ //issue beacon -+ if(send_beacon(padapter)==_FAIL) -+ { -+ RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("issuing beacon frame fail....\n")); - -- //QoS -- if(pmlmepriv->qospriv.qos_option) -- psta->qos_option = _TRUE; -- -+ report_join_res(padapter, -1); -+ pmlmeinfo->state = WIFI_FW_NULL_STATE; -+ } -+ else + //issue beacon + if(send_beacon(padapter)==_FAIL) +@@ -7969,11 +9664,11 @@ void start_create_ibss(_adapter* padapter) + pmlmeinfo->state = WIFI_FW_NULL_STATE; + } + else +- { +- padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_BSSID, padapter->registrypriv.dev_network.MacAddress); + { + rtw_hal_set_hwreg(padapter, HW_VAR_BSSID, padapter->registrypriv.dev_network.MacAddress); -+ join_type = 0; + join_type = 0; +- padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_MLME_JOIN, (u8 *)(&join_type)); +- + rtw_hal_set_hwreg(padapter, HW_VAR_MLME_JOIN, (u8 *)(&join_type)); - -- psta->state = _FW_LINKED; -+ report_join_res(padapter, 1); -+ pmlmeinfo->state |= WIFI_FW_ASSOC_SUCCESS; -+ } -+ } -+ else -+ { -+ DBG_871X("start_create_ibss, invalid cap:%x\n", caps); -+ return; -+ } - - } - --u8 null_addr[ETH_ALEN]= {0,0,0,0,0,0}; -- --void mlmeext_joinbss_event_callback(_adapter *padapter, int join_res) -+void start_clnt_join(_adapter* padapter) - { -- struct sta_info *psta, *psta_bmc; -+ unsigned short caps; -+ u8 val8; - struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; ++ + report_join_res(padapter, 1); + pmlmeinfo->state |= WIFI_FW_ASSOC_SUCCESS; + } +@@ -7994,10 +9689,6 @@ void start_clnt_join(_adapter* padapter) struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); -- WLAN_BSSID_EX *cur_network = &(pmlmeinfo->network); -- struct sta_priv *pstapriv = &padapter->stapriv; -- u8 join_type, init_rts_rate; -+ WLAN_BSSID_EX *pnetwork = (WLAN_BSSID_EX*)(&(pmlmeinfo->network)); - -- if(join_res < 0) -- { -- join_type = 1; -- padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_MLME_JOIN, (u8 *)(&join_type)); -- padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_BSSID, null_addr); -- return; -- } -+ //update wireless mode -+ update_wireless_mode(padapter); + WLAN_BSSID_EX *pnetwork = (WLAN_BSSID_EX*)(&(pmlmeinfo->network)); -- if((pmlmeinfo->state&0x03) == WIFI_FW_ADHOC_STATE) -+ //udpate capability -+ caps = rtw_get_capability((WLAN_BSSID_EX *)pnetwork); -+ update_capinfo(padapter, caps); -+ if (caps&cap_ESS) - { -- //for bc/mc -- psta_bmc = rtw_get_bcmc_stainfo(padapter); -- if(psta_bmc) -- { -- pmlmeinfo->FW_sta_info[psta_bmc->mac_id].psta = psta_bmc; -- update_bmc_sta_support_rate(padapter, psta_bmc->mac_id); -- Update_RA_Entry(padapter, psta_bmc->mac_id); -- } -- } - +- pmlmeext->cur_channel = (u8)pnetwork->Configuration.DSConfig; +- pmlmeinfo->bcn_interval = get_beacon_interval(pnetwork); - -- //turn on dynamic functions -- Switch_DM_Func(padapter, DYNAMIC_FUNC_DIG|DYNAMIC_FUNC_HP|DYNAMIC_FUNC_SS, _TRUE); + //update wireless mode + update_wireless_mode(padapter); + +@@ -8006,13 +9697,53 @@ void start_clnt_join(_adapter* padapter) + update_capinfo(padapter, caps); + if (caps&cap_ESS) + { +- Set_NETYPE0_MSR(padapter, WIFI_FW_STATION_STATE); + Set_MSR(padapter, WIFI_FW_STATION_STATE); -- // update IOT-releated issue -- update_IOT_info(padapter); -+ val8 = (pmlmeinfo->auth_algo == dot11AuthAlgrthm_8021X)? 0xcc: 0xcf; + val8 = (pmlmeinfo->auth_algo == dot11AuthAlgrthm_8021X)? 0xcc: 0xcf; +- padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_SEC_CFG, (u8 *)(&val8)); + rtw_hal_set_hwreg(padapter, HW_VAR_SEC_CFG, (u8 *)(&val8)); -- padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_BASIC_RATE, cur_network->SupportedRates); +- //switch channel +- set_channel_bwmode(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset, pmlmeext->cur_bwmode); + #ifdef CONFIG_DEAUTH_BEFORE_CONNECT + // Because of AP's not receiving deauth before + // AP may: 1)not response auth or 2)deauth us after link is complete + // issue deauth before issuing auth to deal with the situation - -- //BCN interval -- padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_BEACON_INTERVAL, (u8 *)(&pmlmeinfo->bcn_interval)); ++ + // Commented by Albert 2012/07/21 + // For the Win8 P2P connection, it will be hard to have a successful connection if this Wi-Fi doesn't connect to it. + { @@ -18439,187 +18078,65 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + } + + _exit_critical_bh(&(padapter->mlmepriv.scanned_queue.lock), &irqL); - -- //udpate capability -- update_capinfo(padapter, pmlmeinfo->capability); ++ + if (scanned == NULL || rtw_end_of_queue_search(head, pos) || has_p2p_ie == _FALSE) + #endif /* CONFIG_P2P */ + issue_deauth_ex(padapter, pnetwork->MacAddress, WLAN_REASON_DEAUTH_LEAVING, 5, 100); + } + #endif /* CONFIG_DEAUTH_BEFORE_CONNECT */ -- //WMM, Update EDCA param -- WMMOnAssocRsp(padapter); -+ //here wait for receiving the beacon to start auth -+ //and enable a timer -+ set_link_timer(pmlmeext, decide_wait_for_beacon_timeout(pmlmeinfo->bcn_interval)); - -- //HT -- HTOnAssocRsp(padapter); -+ pmlmeinfo->state = WIFI_FW_AUTH_NULL | WIFI_FW_STATION_STATE; -+ } -+ else if (caps&cap_IBSS) //adhoc client -+ { + //here wait for receiving the beacon to start auth + //and enable a timer +@@ -8022,10 +9753,10 @@ void start_clnt_join(_adapter* padapter) + } + else if (caps&cap_IBSS) //adhoc client + { +- Set_NETYPE0_MSR(padapter, WIFI_FW_ADHOC_STATE); + Set_MSR(padapter, WIFI_FW_ADHOC_STATE); -+ val8 = 0xcf; + val8 = 0xcf; +- padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_SEC_CFG, (u8 *)(&val8)); + rtw_hal_set_hwreg(padapter, HW_VAR_SEC_CFG, (u8 *)(&val8)); -- //Set cur_channel&cur_bwmode&cur_ch_offset -- set_channel_bwmode(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset, pmlmeext->cur_bwmode); -+ //switch channel -+ set_channel_bwmode(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset, pmlmeext->cur_bwmode); - -+ beacon_timing_control(padapter); - -- psta = rtw_get_stainfo(pstapriv, cur_network->MacAddress); -- if (psta) //only for infra. mode -- { -- pmlmeinfo->FW_sta_info[psta->mac_id].psta = psta; -+ pmlmeinfo->state = WIFI_FW_ADHOC_STATE; - -- //DBG_871X("set_sta_rate\n"); -- -- //set per sta rate after updating HT cap. -- set_sta_rate(padapter, psta); -+ report_join_res(padapter, 1); + //switch channel + set_channel_bwmode(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset, pmlmeext->cur_bwmode); +@@ -8038,7 +9769,7 @@ void start_clnt_join(_adapter* padapter) } -- -- join_type = 2; -- padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_MLME_JOIN, (u8 *)(&join_type)); -- -- if((pmlmeinfo->state&0x03) == WIFI_FW_STATION_STATE) -+ else + else { -- // correcting TSF -- correct_TSF(padapter, pmlmeext); -- -- //set_link_timer(pmlmeext, DISCONNECT_TO); +- //DBG_8192C("marc: invalid cap:%x\n", caps); + //DBG_871X("marc: invalid cap:%x\n", caps); -+ return; + return; } --#ifdef CONFIG_LPS -- rtw_lps_ctrl_wk_cmd(padapter, LPS_CTRL_CONNECT, 0); --#endif -- -- DBG_871X("=>%s\n", __FUNCTION__); -- - } - --void mlmeext_sta_add_event_callback(_adapter *padapter, struct sta_info *psta) -+void start_clnt_auth(_adapter* padapter) - { -- struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); -+ struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; - struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); -- u8 join_type; - -- DBG_871X("%s\n", __FUNCTION__); -+ _cancel_timer_ex(&pmlmeext->link_timer); - -- if((pmlmeinfo->state&0x03) == WIFI_FW_ADHOC_STATE) -- { -- if(pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS)//adhoc master or sta_count>1 -- { -- //nothing to do -- } -- else//adhoc client -- { -- //update TSF Value -- //update_TSF(pmlmeext, pframe, len); -+ pmlmeinfo->state &= (~WIFI_FW_AUTH_NULL); -+ pmlmeinfo->state |= WIFI_FW_AUTH_STATE; - -- // correcting TSF -- correct_TSF(padapter, pmlmeext); -+ pmlmeinfo->auth_seq = 1; -+ pmlmeinfo->reauth_count = 0; -+ pmlmeinfo->reassoc_count = 0; -+ pmlmeinfo->link_count = 0; +@@ -8058,13 +9789,9 @@ void start_clnt_auth(_adapter* padapter) + pmlmeinfo->reauth_count = 0; + pmlmeinfo->reassoc_count = 0; + pmlmeinfo->link_count = 0; + pmlmeext->retry = 0; -- //start beacon -- if(send_beacon(padapter)==_FAIL) -- { -- pmlmeinfo->FW_sta_info[psta->mac_id].status = 0; - -- pmlmeinfo->state ^= WIFI_FW_ADHOC_STATE; -+ issue_auth(padapter, NULL, 0); -+ -+ set_link_timer(pmlmeext, REAUTH_TO); - -- return; -- } -+} - -- pmlmeinfo->state |= WIFI_FW_ASSOC_SUCCESS; -- -- } - -- join_type = 2; -- padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_MLME_JOIN, (u8 *)(&join_type)); -- } -+void start_clnt_assoc(_adapter* padapter) -+{ -+ struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; -+ struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); - -- pmlmeinfo->FW_sta_info[psta->mac_id].psta = psta; -+ _cancel_timer_ex(&pmlmeext->link_timer); - -- //rate radaptive -- Update_RA_Entry(padapter, psta->mac_id); -+ pmlmeinfo->state &= (~(WIFI_FW_AUTH_NULL | WIFI_FW_AUTH_STATE)); -+ pmlmeinfo->state |= (WIFI_FW_AUTH_SUCCESS | WIFI_FW_ASSOC_STATE); - -- //update adhoc sta_info -- update_sta_info(padapter, psta); -+ issue_assocreq(padapter); - -+ set_link_timer(pmlmeext, REASSOC_TO); - } - --void mlmeext_sta_del_event_callback(_adapter *padapter) -+unsigned int receive_disconnect(_adapter *padapter, unsigned char *MacAddr, unsigned short reason) - { - struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; - struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); -- if (is_client_associated_to_ap(padapter) || is_IBSS_empty(padapter)) -+ //check A3 -+ if (!(_rtw_memcmp(MacAddr, get_my_bssid(&pmlmeinfo->network), ETH_ALEN))) -+ return _SUCCESS; -+ -+ DBG_871X("%s\n", __FUNCTION__); -+ -+ if((pmlmeinfo->state&0x03) == WIFI_FW_STATION_STATE) - { -- //set_opmode_cmd(padapter, infra_client_with_mlme); -+ if (pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS) -+ { -+ pmlmeinfo->state = WIFI_FW_NULL_STATE; -+ report_del_sta_event(padapter, MacAddr, reason); - -- //switch to the 20M Hz mode after disconnect -- pmlmeext->cur_bwmode = HT_CHANNEL_WIDTH_20; -- pmlmeext->cur_ch_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE; -+ } -+ else if (pmlmeinfo->state & WIFI_FW_LINKING_STATE) -+ { -+ pmlmeinfo->state = WIFI_FW_NULL_STATE; -+ report_join_res(padapter, -2); -+ } -+ } +- // Because of AP's not receiving deauth before +- // AP may: 1)not response auth or 2)deauth us after link is complete +- // issue deauth before issuing auth to deal with the situation +- issue_deauth(padapter, (&(pmlmeinfo->network))->MacAddress, WLAN_REASON_DEAUTH_LEAVING); +- + issue_auth(padapter, NULL, 0); -- padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_MLME_DISCONNECT, 0); -- padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_BSSID, null_addr); -+ return _SUCCESS; -+} + set_link_timer(pmlmeext, REAUTH_TO); +@@ -8104,6 +9831,7 @@ unsigned int receive_disconnect(_adapter *padapter, unsigned char *MacAddr, unsi + { + pmlmeinfo->state = WIFI_FW_NULL_STATE; + report_del_sta_event(padapter, MacAddr, reason); ++ + } + else if (pmlmeinfo->state & WIFI_FW_LINKING_STATE) + { +@@ -8115,24 +9843,321 @@ unsigned int receive_disconnect(_adapter *padapter, unsigned char *MacAddr, unsi + return _SUCCESS; + } -- //SelectChannel(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset); -- set_channel_bwmode(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset, pmlmeext->cur_bwmode); -- flush_all_cam_entry(padapter); +-/**************************************************************************** +#ifdef CONFIG_80211D +static void process_80211d(PADAPTER padapter, WLAN_BSSID_EX *bssid) +{ @@ -18629,14 +18146,18 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + u8 channel; + u8 i; -- pmlmeinfo->state = WIFI_FW_NULL_STATE; +-Following are the functions to report events -- //set MSR to no link state -- Set_NETYPE0_MSR(padapter, _HW_STATE_NOLINK_); +-*****************************************************************************/ + pregistrypriv = &padapter->registrypriv; + pmlmeext = &padapter->mlmeextpriv; -- _cancel_timer_ex(&pmlmeext->link_timer); +-void report_survey_event(_adapter *padapter, union recv_frame *precv_frame) +-{ +- struct cmd_obj *pcmd_obj; +- u8 *pevtcmd; +- u32 cmdsz; +- struct survey_event *psurvey_evt; + // Adjust channel plan by AP Country IE + if (pregistrypriv->enable80211d && + (!pmlmeext->update_channel_plan_by_ap_done)) @@ -18649,63 +18170,38 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + u8 fcn; // first channel number + u8 noc; // number of channel + u8 j, k; - -- } ++ + ie = rtw_get_ie(bssid->IEs + _FIXED_IE_LENGTH_, _COUNTRY_IE_, &len, bssid->IELength - _FIXED_IE_LENGTH_); + if (!ie) return; + if (len < 6) return; - --} ++ + ie += 2; + p = ie; + ie += len; - --/**************************************************************************** ++ + _rtw_memset(country, 0, 4); + _rtw_memcpy(country, p, 3); + p += 3; + RT_TRACE(_module_rtl871x_mlme_c_, _drv_notice_, + ("%s: 802.11d country=%s\n", __FUNCTION__, country)); - --Following are the functions for the timer handlers ++ + i = 0; + while ((ie - p) >= 3) + { + fcn = *(p++); + noc = *(p++); + p++; - --*****************************************************************************/ ++ + for (j = 0; j < noc; j++) + { + if (fcn <= 14) channel = fcn + j; // 2.4 GHz + else channel = fcn + j*4; // 5 GHz - --void _linked_rx_signal_strehgth_display(_adapter *padapter) --{ -- int UndecoratedSmoothedPWDB; -- DBG_8192C("============ linked status check ===================\n"); -- DBG_8192C("pathA Rx SNRdb:%d, pathB Rx SNRdb:%d\n",padapter->recvpriv.RxSNRdB[0],padapter->recvpriv.RxSNRdB[1]); -- DBG_8192C("pathA Rx RSSI:%d,pathB Rx RSSI:%d\n",padapter->recvpriv.RxRssi[0],padapter->recvpriv.RxRssi[1]); -- -- DBG_8192C("pathA Rx PWDB:%d\n",padapter->recvpriv.rxpwdb); -- padapter->HalFunc.GetHalDefVarHandler(padapter, HAL_DEF_UNDERCORATEDSMOOTHEDPWDB, &UndecoratedSmoothedPWDB); -- DBG_8192C("UndecoratedSmoothedPWDB:%d\n",UndecoratedSmoothedPWDB); -- DBG_8192C("Rx RSSI:%d\n",padapter->recvpriv.rssi); -- DBG_8192C("Rx Signal_strength:%d\n",padapter->recvpriv.signal_strength); -- DBG_8192C("Rx Signal_qual:%d \n",padapter->recvpriv.signal_qual); -- DBG_8192C("============ linked status check ===================\n"); -- DBG_8192C(" DIG PATH-A(0x%02x), PATH-B(0x%02x)\n",rtw_read8(padapter,0xc50),rtw_read8(padapter,0xc58)); -- DBG_8192C(" OFDM -Alarm DA2(0x%04x),DA4(0x%04x),DA6(0x%04x),DA8(0x%04x)\n", -- rtw_read16(padapter,0xDA2),rtw_read16(padapter,0xDA4),rtw_read16(padapter,0xDA6),rtw_read16(padapter,0xDA8)); ++ + chplan_ap.Channel[i++] = channel; + } + } + chplan_ap.Len = i; - -- DBG_8192C(" CCK -Alarm A5B(0x%02x),A5C(0x%02x)\n",rtw_read8(padapter,0xA5B),rtw_read8(padapter,0xA5C)); -- DBG_8192C(" FalseAlmCnt_all(%d)\n",padapter->recvpriv.FalseAlmCnt_all); --} ++ +#ifdef CONFIG_DEBUG_RTL871X +#ifdef PLATFORM_LINUX + i = 0; @@ -18718,17 +18214,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + printk("}\n"); +#endif +#endif - --void linked_status_chk(_adapter *padapter) --{ -- u32 i; -- struct sta_info *psta; -- struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); -- struct recv_priv *precvpriv = &(padapter->recvpriv); -- struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; -- struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); -- struct sta_priv *pstapriv = &padapter->stapriv; -- struct registry_priv *pregistrypriv = &padapter->registrypriv; ++ + _rtw_memcpy(chplan_sta, pmlmeext->channel_set, sizeof(chplan_sta)); +#ifdef CONFIG_DEBUG_RTL871X +#ifdef PLATFORM_LINUX @@ -18742,98 +18228,38 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + printk("}\n"); +#endif +#endif - -- if(padapter->bRxRSSIDisplay) -- _linked_rx_signal_strehgth_display(padapter); ++ + _rtw_memset(pmlmeext->channel_set, 0, sizeof(pmlmeext->channel_set)); + chplan_new = pmlmeext->channel_set; - -- if (is_client_associated_to_ap(padapter)) -- { -- //linked infrastructure client mode -- if ((psta = rtw_get_stainfo(pstapriv, pmlmeinfo->network.MacAddress)) != NULL) ++ + i = j = k = 0; + if (pregistrypriv->wireless_mode & WIRELESS_11G) - { -- #ifdef DBG_EXPIRATION_CHK -- DBG_871X("%s rx:"STA_PKTS_FMT", BI:%u, retry:%u\n" -- , __FUNCTION__ -- , STA_RX_PKTS_ARG(psta) -- , pmlmeinfo->bcn_interval -- , pmlmeext->retry -- ); -- #endif ++ { + do { + if ((i == MAX_CHANNEL_NUM) || + (chplan_sta[i].ChannelNum == 0) || + (chplan_sta[i].ChannelNum > 14)) + break; - -- /*to monitor whether the AP is alive or not*/ -- if (sta_last_rx_pkts(psta) == sta_rx_pkts(psta)) -- { -- // Commented by Albert 2010/07/21 -- // In this case, there is no any rx packet received by driver. ++ + if ((j == chplan_ap.Len) || (chplan_ap.Channel[j] > 14)) + break; - -- #ifdef DBG_ROAMING_TEST -- if(pmlmeext->retry<1) -- #else -- if(pmlmeext->retry<8)// Alter the retry limit to 8 -- #endif ++ + if (chplan_sta[i].ChannelNum == chplan_ap.Channel[j]) - { -- if(pmlmeext->retry==0) -- { -- #ifdef DBG_CONFIG_ERROR_DETECT -- if(padapter->HalFunc.sreset_linked_status_check) -- padapter->HalFunc.sreset_linked_status_check(padapter); -- #endif -- -- // In order to know the AP's current state, try to send the probe request -- // to trigger the AP to send the probe response. -- #ifdef CONFIG_P2P -- if(!rtw_p2p_chk_state(&padapter->wdinfo, P2P_STATE_NONE)) { -- #ifdef DBG_EXPIRATION_CHK -- DBG_871X("issue_probereq_p2p to trigger probersp, retry=%d\n", pmlmeext->retry); -- #endif -- issue_probereq_p2p(padapter); -- } else -- #endif -- { -- #ifdef DBG_EXPIRATION_CHK -- DBG_871X("issue_probereq to trigger probersp, retry=%d\n", pmlmeext->retry); -- #endif -- issue_probereq(padapter, &(pmlmeinfo->network.Ssid), 0); -- issue_probereq(padapter, &(pmlmeinfo->network.Ssid), 0); -- issue_probereq(padapter, &(pmlmeinfo->network.Ssid), 0); -- } -- } -- -- pmlmeext->retry++; ++ { + chplan_new[k].ChannelNum = chplan_ap.Channel[j]; + chplan_new[k].ScanType = SCAN_ACTIVE; + i++; + j++; + k++; - } -- else ++ } + else if (chplan_sta[i].ChannelNum < chplan_ap.Channel[j]) - { -- pmlmeext->retry = 0; -- DBG_871X("no beacon to call receive_disconnect()\n"); -- receive_disconnect(padapter, pmlmeinfo->network.MacAddress -- , 65535// indicate disconnect caused by no rx -- ); -- pmlmeinfo->link_count = 0; -- return; ++ { + chplan_new[k].ChannelNum = chplan_sta[i].ChannelNum; +// chplan_new[k].ScanType = chplan_sta[i].ScanType; + chplan_new[k].ScanType = SCAN_PASSIVE; + i++; + k++; - } ++ } + else if (chplan_sta[i].ChannelNum > chplan_ap.Channel[j]) + { + chplan_new[k].ChannelNum = chplan_ap.Channel[j]; @@ -18853,41 +18279,16 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + chplan_new[k].ScanType = SCAN_PASSIVE; + i++; + k++; - } -- else -- { -- pmlmeext->retry = 0; -- sta_update_last_rx_pkts(psta); -- //set_link_timer(pmlmeext, DISCONNECT_TO); -- } -- -- #ifdef DBG_EXPIRATION_CHK -- DBG_871X("%s tx_pkts:%llu, link_count:%u\n", __FUNCTION__ -- , pxmitpriv->tx_pkts -- , pmlmeinfo->link_count -- ); -- #endif - -- /*to send the AP a nulldata if no frame is xmitted in order to keep alive*/ -- if(pxmitpriv->last_tx_pkts == pxmitpriv->tx_pkts) ++ } ++ + // add channel AP supported + while ((j < chplan_ap.Len) && (chplan_ap.Channel[j] <= 14)) - { -- if(pmlmeinfo->link_count++ == 0xf) -- { -- //DBG_871X("(Interface %d)issue nulldata to keep alive\n",padapter->dvobjpriv.InterfaceNumber); -- #ifdef DBG_EXPIRATION_CHK -- DBG_871X("%s issue_nulldata 0\n", __FUNCTION__); -- #endif -- issue_nulldata(padapter, 0); -- pmlmeinfo->link_count = 0; -- } ++ { + chplan_new[k].ChannelNum = chplan_ap.Channel[j]; + chplan_new[k].ScanType = SCAN_ACTIVE; + j++; + k++; - } -- else ++ } + } + else + { @@ -18904,67 +18305,37 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + + // skip AP 2.4G channel plan + while ((j < chplan_ap.Len) && (chplan_ap.Channel[j] <= 14)) - { -- pxmitpriv->last_tx_pkts = pxmitpriv->tx_pkts; -- pmlmeinfo->link_count = 0; ++ { + j++; - } ++ } + } - -- } //end of if ((psta = rtw_get_stainfo(pstapriv, passoc_res->network.MacAddress)) != NULL) -- } -- else if (is_client_associated_to_ibss(padapter)) -- { -- //linked IBSS mode -- //for each assoc list entry to check the rx pkt counter -- for (i = IBSS_START_MAC_ID; i < NUM_STA; i++) ++ + if (pregistrypriv->wireless_mode & WIRELESS_11A) - { -- if (pmlmeinfo->FW_sta_info[i].status == 1) -- { -- psta = pmlmeinfo->FW_sta_info[i].psta; ++ { + do { + if ((i == MAX_CHANNEL_NUM) || + (chplan_sta[i].ChannelNum == 0)) + break; - -- if(NULL==psta) continue; ++ + if ((j == chplan_ap.Len) || (chplan_ap.Channel[j] == 0)) + break; - -- if (pmlmeinfo->FW_sta_info[i].rx_pkt == sta_rx_pkts(psta)) ++ + if (chplan_sta[i].ChannelNum == chplan_ap.Channel[j]) - { -- -- if(pmlmeinfo->FW_sta_info[i].retry<3) -- { -- pmlmeinfo->FW_sta_info[i].retry++; -- } -- else -- { -- pmlmeinfo->FW_sta_info[i].retry = 0; -- pmlmeinfo->FW_sta_info[i].status = 0; -- report_del_sta_event(padapter, psta->hwaddr -- , 65535// indicate disconnect caused by no rx -- ); -- } ++ { + chplan_new[k].ChannelNum = chplan_ap.Channel[j]; + chplan_new[k].ScanType = SCAN_ACTIVE; + i++; + j++; + k++; - } -- else ++ } + else if (chplan_sta[i].ChannelNum < chplan_ap.Channel[j]) - { -- pmlmeinfo->FW_sta_info[i].retry = 0; -- pmlmeinfo->FW_sta_info[i].rx_pkt = (u32)sta_rx_pkts(psta); ++ { + chplan_new[k].ChannelNum = chplan_sta[i].ChannelNum; +// chplan_new[k].ScanType = chplan_sta[i].ScanType; + chplan_new[k].ScanType = SCAN_PASSIVE; + i++; + k++; - } ++ } + else if (chplan_sta[i].ChannelNum > chplan_ap.Channel[j]) + { + chplan_new[k].ChannelNum = chplan_ap.Channel[j]; @@ -19002,10 +18373,9 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + chplan_new[k].ScanType = chplan_sta[i].ScanType; + i++; + k++; - } - } - -- //set_link_timer(pmlmeext, DISCONNECT_TO); ++ } ++ } ++ + pmlmeext->update_channel_plan_by_ap_done = 1; + +#ifdef CONFIG_DEBUG_RTL871X @@ -19020,7 +18390,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + printk("}\n"); +#endif +#endif - ++ +#if 0 + // recover the right channel index + channel = chplan_sta[pmlmeext->sitesurvey_res.channel_idx].ChannelNum; @@ -19037,8 +18407,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + k++; + } +#endif - } - ++ } ++ + // If channel is used by AP, set channel scan type to active + channel = bssid->Configuration.DSConfig; + chplan_new = pmlmeext->channel_set; @@ -19062,10 +18432,9 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + } + i++; + } - } ++} +#endif - --void survey_timer_hdl(_adapter *padapter) ++ +/**************************************************************************** + +Following are the functions to report events @@ -19073,148 +18442,655 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release +*****************************************************************************/ + +void report_survey_event(_adapter *padapter, union recv_frame *precv_frame) - { -- struct cmd_obj *ph2c; -- struct sitesurvey_parm *psurveyPara; -- struct cmd_priv *pcmdpriv=&padapter->cmdpriv; -- struct mlme_priv *pmlmepriv = &padapter->mlmepriv; -- struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; --#ifdef CONFIG_P2P -- struct wifidirect_info *pwdinfo= &(padapter->wdinfo); --#endif ++{ + struct cmd_obj *pcmd_obj; + u8 *pevtcmd; + u32 cmdsz; + struct survey_event *psurvey_evt; -+ struct C2HEvent_Header *pc2h_evt_hdr; + struct C2HEvent_Header *pc2h_evt_hdr; +- struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; +- struct cmd_priv *pcmdpriv = &padapter->cmdpriv; + struct mlme_ext_priv *pmlmeext; + struct cmd_priv *pcmdpriv; -+ //u8 *pframe = precv_frame->u.hdr.rx_data; -+ //uint len = precv_frame->u.hdr.len; + //u8 *pframe = precv_frame->u.hdr.rx_data; + //uint len = precv_frame->u.hdr.len; -- //DBG_8192C("marc: survey timer\n"); + if(!padapter) + return; - -- //issue rtw_sitesurvey_cmd -- if (pmlmeext->sitesurvey_res.state > SCAN_START) ++ + pmlmeext = &padapter->mlmeextpriv; + pcmdpriv = &padapter->cmdpriv; + + -+ if ((pcmd_obj = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj))) == NULL) + if ((pcmd_obj = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj))) == NULL) { -- if(pmlmeext->sitesurvey_res.state == SCAN_PROCESS) -- pmlmeext->sitesurvey_res.channel_idx++; -+ return; + return; +@@ -8168,6 +10193,10 @@ void report_survey_event(_adapter *padapter, union recv_frame *precv_frame) + return; + } + ++#ifdef CONFIG_80211D ++ process_80211d(padapter, &psurvey_evt->bss); ++#endif ++ + rtw_enqueue_cmd(pcmdpriv, pcmd_obj); + + pmlmeext->sitesurvey_res.bss_cnt++; +@@ -8215,7 +10244,7 @@ void report_surveydone_event(_adapter *padapter) + psurveydone_evt = (struct surveydone_event*)(pevtcmd + sizeof(struct C2HEvent_Header)); + psurveydone_evt->bss_cnt = pmlmeext->sitesurvey_res.bss_cnt; + +- DBG_871X("survey done event(%x)\n", psurveydone_evt->bss_cnt); ++ DBG_871X("survey done event(%x) band:%d for "ADPT_FMT"\n", psurveydone_evt->bss_cnt, padapter->setband, ADPT_ARG(padapter)); + + rtw_enqueue_cmd(pcmdpriv, pcmd_obj); + +@@ -8265,11 +10294,11 @@ void report_join_res(_adapter *padapter, int res) + pjoinbss_evt->network.join_res = pjoinbss_evt->network.aid = res; + + DBG_871X("report_join_res(%d)\n", res); +- ++ + + rtw_joinbss_event_prehandle(padapter, (u8 *)&pjoinbss_evt->network); + +- ++ + rtw_enqueue_cmd(pcmdpriv, pcmd_obj); + + return; +@@ -8281,10 +10310,11 @@ void report_del_sta_event(_adapter *padapter, unsigned char* MacAddr, unsigned s + struct cmd_obj *pcmd_obj; + u8 *pevtcmd; + u32 cmdsz; ++ struct sta_info *psta; ++ int mac_id; + struct stadel_event *pdel_sta_evt; + struct C2HEvent_Header *pc2h_evt_hdr; + struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; +- struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); + struct cmd_priv *pcmdpriv = &padapter->cmdpriv; + + if ((pcmd_obj = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj))) == NULL) +@@ -8317,7 +10347,16 @@ void report_del_sta_event(_adapter *padapter, unsigned char* MacAddr, unsigned s + _rtw_memcpy((unsigned char *)(&(pdel_sta_evt->macaddr)), MacAddr, ETH_ALEN); + _rtw_memcpy((unsigned char *)(pdel_sta_evt->rsvd),(unsigned char *)(&reason),2); + +- DBG_871X("report_del_sta_event: delete STA\n"); ++ ++ psta = rtw_get_stainfo(&padapter->stapriv, MacAddr); ++ if(psta) ++ mac_id = (int)psta->mac_id; ++ else ++ mac_id = (-1); ++ ++ pdel_sta_evt->mac_id = mac_id; ++ ++ DBG_871X("report_del_sta_event: delete STA, mac_id=%d\n", mac_id); + + rtw_enqueue_cmd(pcmdpriv, pcmd_obj); + +@@ -8332,7 +10371,6 @@ void report_add_sta_event(_adapter *padapter, unsigned char* MacAddr, int cam_id + struct stassoc_event *padd_sta_evt; + struct C2HEvent_Header *pc2h_evt_hdr; + struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; +- struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); + struct cmd_priv *pcmdpriv = &padapter->cmdpriv; + + if ((pcmd_obj = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj))) == NULL) +@@ -8431,8 +10469,6 @@ void update_sta_info(_adapter *padapter, struct sta_info *psta) + + } + +-u8 null_addr[ETH_ALEN]= {0,0,0,0,0,0}; +- + void mlmeext_joinbss_event_callback(_adapter *padapter, int join_res) + { + struct sta_info *psta, *psta_bmc; +@@ -8440,14 +10476,25 @@ void mlmeext_joinbss_event_callback(_adapter *padapter, int join_res) + struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); + WLAN_BSSID_EX *cur_network = &(pmlmeinfo->network); + struct sta_priv *pstapriv = &padapter->stapriv; +- u8 join_type, init_rts_rate; ++ u8 join_type; + + if(join_res < 0) + { + join_type = 1; +- padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_MLME_JOIN, (u8 *)(&join_type)); +- padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_BSSID, null_addr); +- return; ++ rtw_hal_set_hwreg(padapter, HW_VAR_MLME_JOIN, (u8 *)(&join_type)); ++ rtw_hal_set_hwreg(padapter, HW_VAR_BSSID, null_addr); ++ ++ //restore to initial setting. ++ update_tx_basic_rate(padapter, padapter->registrypriv.wireless_mode); ++#if 0 //temply remove ++#ifdef CONFIG_INTEL_WIDI ++#ifdef DBG_CONFIG_ERROR_DETECT ++ DBG_871X("%s(): do silentreset\n",__FUNCTION__); ++ rtw_hal_sreset_reset(padapter); ++#endif ++#endif ++#endif ++ goto exit_mlmeext_joinbss_event_callback; + } + + if((pmlmeinfo->state&0x03) == WIFI_FW_ADHOC_STATE) +@@ -8469,10 +10516,10 @@ void mlmeext_joinbss_event_callback(_adapter *padapter, int join_res) + // update IOT-releated issue + update_IOT_info(padapter); + +- padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_BASIC_RATE, cur_network->SupportedRates); ++ rtw_hal_set_hwreg(padapter, HW_VAR_BASIC_RATE, cur_network->SupportedRates); + + //BCN interval +- padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_BEACON_INTERVAL, (u8 *)(&pmlmeinfo->bcn_interval)); ++ rtw_hal_set_hwreg(padapter, HW_VAR_BEACON_INTERVAL, (u8 *)(&pmlmeinfo->bcn_interval)); + + //udpate capability + update_capinfo(padapter, pmlmeinfo->capability); +@@ -8483,10 +10530,11 @@ void mlmeext_joinbss_event_callback(_adapter *padapter, int join_res) + //HT + HTOnAssocRsp(padapter); + +- ++#ifndef CONFIG_CONCURRENT_MODE ++ // Call set_channel_bwmode when the CONFIG_CONCURRENT_MODE doesn't be defined. + //Set cur_channel&cur_bwmode&cur_ch_offset + set_channel_bwmode(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset, pmlmeext->cur_bwmode); +- ++#endif + + psta = rtw_get_stainfo(pstapriv, cur_network->MacAddress); + if (psta) //only for infra. mode +@@ -8496,11 +10544,11 @@ void mlmeext_joinbss_event_callback(_adapter *padapter, int join_res) + //DBG_871X("set_sta_rate\n"); + + //set per sta rate after updating HT cap. +- set_sta_rate(padapter, psta); ++ set_sta_rate(padapter, psta); + } + + join_type = 2; +- padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_MLME_JOIN, (u8 *)(&join_type)); ++ rtw_hal_set_hwreg(padapter, HW_VAR_MLME_JOIN, (u8 *)(&join_type)); + + if((pmlmeinfo->state&0x03) == WIFI_FW_STATION_STATE) + { +@@ -8513,7 +10561,16 @@ void mlmeext_joinbss_event_callback(_adapter *padapter, int join_res) + #ifdef CONFIG_LPS + rtw_lps_ctrl_wk_cmd(padapter, LPS_CTRL_CONNECT, 0); + #endif +- ++ ++exit_mlmeext_joinbss_event_callback: ++ ++#ifdef CONFIG_DUALMAC_CONCURRENT ++ dc_handle_join_done(padapter, join_res); ++#endif ++#ifdef CONFIG_CONCURRENT_MODE ++ concurrent_chk_joinbss_done(padapter, join_res); ++#endif ++ + DBG_871X("=>%s\n", __FUNCTION__); + + } +@@ -8555,7 +10612,7 @@ void mlmeext_sta_add_event_callback(_adapter *padapter, struct sta_info *psta) + } + + join_type = 2; +- padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_MLME_JOIN, (u8 *)(&join_type)); ++ rtw_hal_set_hwreg(padapter, HW_VAR_MLME_JOIN, (u8 *)(&join_type)); + } + + pmlmeinfo->FW_sta_info[psta->mac_id].psta = psta; +@@ -8577,21 +10634,38 @@ void mlmeext_sta_del_event_callback(_adapter *padapter) + { + //set_opmode_cmd(padapter, infra_client_with_mlme); + ++ rtw_hal_set_hwreg(padapter, HW_VAR_MLME_DISCONNECT, 0); ++ rtw_hal_set_hwreg(padapter, HW_VAR_BSSID, null_addr); ++ ++ //restore to initial setting. ++ update_tx_basic_rate(padapter, padapter->registrypriv.wireless_mode); ++ ++#ifdef CONFIG_DUALMAC_CONCURRENT ++ dc_set_channel_bwmode_disconnect(padapter); ++#else ++#ifdef CONFIG_CONCURRENT_MODE ++ if((check_buddy_fwstate(padapter, _FW_LINKED)) != _TRUE) ++ { ++#endif //CONFIG_CONCURRENT_MODE ++ + //switch to the 20M Hz mode after disconnect + pmlmeext->cur_bwmode = HT_CHANNEL_WIDTH_20; + pmlmeext->cur_ch_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE; + +- padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_MLME_DISCONNECT, 0); +- padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_BSSID, null_addr); +- + //SelectChannel(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset); + set_channel_bwmode(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset, pmlmeext->cur_bwmode); ++ ++#ifdef CONFIG_CONCURRENT_MODE ++ } ++#endif //CONFIG_CONCURRENT_MODE ++#endif //CONFIG_DUALMAC_CONCURRENT ++ + flush_all_cam_entry(padapter); + + pmlmeinfo->state = WIFI_FW_NULL_STATE; + +- //set MSR to no link state +- Set_NETYPE0_MSR(padapter, _HW_STATE_NOLINK_); ++ //set MSR to no link state -> infra. mode ++ Set_MSR(padapter, _HW_STATE_STATION_); + + _cancel_timer_ex(&pmlmeext->link_timer); + +@@ -8604,27 +10678,94 @@ void mlmeext_sta_del_event_callback(_adapter *padapter) + Following are the functions for the timer handlers + + *****************************************************************************/ +- ++void _linked_rx_signal_strehgth_display(_adapter *padapter); + void _linked_rx_signal_strehgth_display(_adapter *padapter) + { + int UndecoratedSmoothedPWDB; +- DBG_8192C("============ linked status check ===================\n"); +- DBG_8192C("pathA Rx SNRdb:%d, pathB Rx SNRdb:%d\n",padapter->recvpriv.RxSNRdB[0],padapter->recvpriv.RxSNRdB[1]); +- DBG_8192C("pathA Rx RSSI:%d,pathB Rx RSSI:%d\n",padapter->recvpriv.RxRssi[0],padapter->recvpriv.RxRssi[1]); +- +- DBG_8192C("pathA Rx PWDB:%d\n",padapter->recvpriv.rxpwdb); +- padapter->HalFunc.GetHalDefVarHandler(padapter, HAL_DEF_UNDERCORATEDSMOOTHEDPWDB, &UndecoratedSmoothedPWDB); +- DBG_8192C("UndecoratedSmoothedPWDB:%d\n",UndecoratedSmoothedPWDB); +- DBG_8192C("Rx RSSI:%d\n",padapter->recvpriv.rssi); +- DBG_8192C("Rx Signal_strength:%d\n",padapter->recvpriv.signal_strength); +- DBG_8192C("Rx Signal_qual:%d \n",padapter->recvpriv.signal_qual); +- DBG_8192C("============ linked status check ===================\n"); +- DBG_8192C(" DIG PATH-A(0x%02x), PATH-B(0x%02x)\n",rtw_read8(padapter,0xc50),rtw_read8(padapter,0xc58)); +- DBG_8192C(" OFDM -Alarm DA2(0x%04x),DA4(0x%04x),DA6(0x%04x),DA8(0x%04x)\n", ++ ++#ifdef CONFIG_CONCURRENT_MODE ++ PADAPTER pbuddy_adapter = padapter->pbuddy_adapter; ++ DBG_871X("============ pbuddy_adapter linked status check ===================\n"); ++ DBG_871X("buddy_adapter_type=%d\n", pbuddy_adapter->adapter_type); ++ DBG_871X("pbuddy_adapter pathA Rx SNRdb:%d\n",pbuddy_adapter->recvpriv.RxSNRdB[0]); ++ DBG_871X("pbuddy_adapter pathA Rx PWDB:%d\n",pbuddy_adapter->recvpriv.rxpwdb); ++ DBG_871X("pbuddy_adapter pathA Rx RSSI:%d,pathB Rx RSSI:%d\n" ++ ,pbuddy_adapter->recvpriv.RxRssi[0],pbuddy_adapter->recvpriv.RxRssi[1]); ++ rtw_hal_get_def_var(pbuddy_adapter, HAL_DEF_UNDERCORATEDSMOOTHEDPWDB, &UndecoratedSmoothedPWDB); ++ DBG_871X("pbuddy_adapter UndecoratedSmoothedPWDB:%d\n",UndecoratedSmoothedPWDB); ++ DBG_871X("Rx RSSI:%d\n",pbuddy_adapter->recvpriv.rssi); ++ DBG_871X("Rx Signal_strength:%d\n",pbuddy_adapter->recvpriv.signal_strength); ++ DBG_871X("Rx Signal_qual:%d \n",pbuddy_adapter->recvpriv.signal_qual); ++ DBG_871X("============ linked status check ===================\n"); ++ DBG_871X("adapter_type=%d\n", padapter->adapter_type); ++#else //CONFIG_CONCURRENT_MODE ++ DBG_871X("============ linked status check ===================\n"); ++#endif //CONFIG_CONCURRENT_MODE ++ DBG_871X("pathA Rx SNRdb:%d, pathB Rx SNRdb:%d\n",padapter->recvpriv.RxSNRdB[0], padapter->recvpriv.RxSNRdB[1]); ++ DBG_871X("pathA Rx PWDB:%d\n",padapter->recvpriv.rxpwdb); ++ DBG_871X("pathA Rx RSSI:%d,pathB Rx RSSI:%d\n",padapter->recvpriv.RxRssi[0],padapter->recvpriv.RxRssi[1]); ++ rtw_hal_get_def_var(padapter, HAL_DEF_UNDERCORATEDSMOOTHEDPWDB, &UndecoratedSmoothedPWDB); ++ DBG_871X("UndecoratedSmoothedPWDB:%d\n",UndecoratedSmoothedPWDB); ++ DBG_871X("Rx RSSI:%d\n",padapter->recvpriv.rssi); ++ DBG_871X("Rx Signal_strength:%d\n",padapter->recvpriv.signal_strength); ++ DBG_871X("Rx Signal_qual:%d \n",padapter->recvpriv.signal_qual); ++ if ( check_fwstate( &padapter->mlmepriv, _FW_LINKED )) ++ { ++ DBG_871X("bw mode: %d, channel: %d\n", padapter->mlmeextpriv.cur_bwmode, padapter->mlmeextpriv.cur_channel ); ++ DBG_871X("received bytes = %d\n", (u32) (padapter->recvpriv.rx_bytes - padapter->recvpriv.last_rx_bytes ) ); + } ++ DBG_871X("============ linked status check ===================\n"); ++ DBG_871X(" DIG PATH-A(0x%02x), PATH-B(0x%02x)\n",rtw_read8(padapter,0xc50),rtw_read8(padapter,0xc58)); ++ DBG_871X(" OFDM -Alarm DA2(0x%04x),DA4(0x%04x),DA6(0x%04x),DA8(0x%04x)\n", + rtw_read16(padapter,0xDA2),rtw_read16(padapter,0xDA4),rtw_read16(padapter,0xDA6),rtw_read16(padapter,0xDA8)); -- if(pmlmeext->scan_abort == _TRUE) -- { -- #ifdef CONFIG_P2P -- if(!rtw_p2p_chk_state(&padapter->wdinfo, P2P_STATE_NONE)) +- DBG_8192C(" CCK -Alarm A5B(0x%02x),A5C(0x%02x)\n",rtw_read8(padapter,0xA5B),rtw_read8(padapter,0xA5C)); +- DBG_8192C(" FalseAlmCnt_all(%d)\n",padapter->recvpriv.FalseAlmCnt_all); ++ DBG_871X(" CCK -Alarm A5B(0x%02x),A5C(0x%02x)\n",rtw_read8(padapter,0xA5B),rtw_read8(padapter,0xA5C)); ++ DBG_871X(" FalseAlmCnt_all(%d)\n",padapter->recvpriv.FalseAlmCnt_all); ++ ++} ++ ++u8 chk_ap_is_alive(_adapter *padapter, struct sta_info *psta) ++{ ++ u8 ret = _FALSE; ++ struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; ++ struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); ++ ++ #ifdef DBG_EXPIRATION_CHK ++ DBG_871X(FUNC_ADPT_FMT" rx:"STA_PKTS_FMT", beacon:%llu, probersp_to_self:%llu" ++ /*", probersp_bm:%llu, probersp_uo:%llu, probereq:%llu, BI:%u"*/ ++ ", retry:%u\n" ++ , FUNC_ADPT_ARG(padapter) ++ , STA_RX_PKTS_DIFF_ARG(psta) ++ , psta->sta_stats.rx_beacon_pkts - psta->sta_stats.last_rx_beacon_pkts ++ , psta->sta_stats.rx_probersp_pkts - psta->sta_stats.last_rx_probersp_pkts ++ /*, psta->sta_stats.rx_probersp_bm_pkts - psta->sta_stats.last_rx_probersp_bm_pkts ++ , psta->sta_stats.rx_probersp_uo_pkts - psta->sta_stats.last_rx_probersp_uo_pkts ++ , psta->sta_stats.rx_probereq_pkts - psta->sta_stats.last_rx_probereq_pkts ++ , pmlmeinfo->bcn_interval*/ ++ , pmlmeext->retry ++ ); ++ ++ DBG_871X(FUNC_ADPT_FMT" tx_pkts:%llu, link_count:%u\n", FUNC_ADPT_ARG(padapter) ++ , padapter->xmitpriv.tx_pkts ++ , pmlmeinfo->link_count ++ ); ++ #endif ++ ++ if((sta_rx_data_pkts(psta) == sta_last_rx_data_pkts(psta)) ++ && sta_rx_beacon_pkts(psta) == sta_last_rx_beacon_pkts(psta) ++ && sta_rx_probersp_pkts(psta) == sta_last_rx_probersp_pkts(psta) ++ ) ++ { ++ ret = _FALSE; ++ } ++ else ++ { ++ ret = _TRUE; ++ } ++ ++ sta_update_last_rx_pkts(psta); ++ ++ return ret; + } + + void linked_status_chk(_adapter *padapter) +@@ -8632,110 +10773,116 @@ void linked_status_chk(_adapter *padapter) + u32 i; + struct sta_info *psta; + struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); +- struct recv_priv *precvpriv = &(padapter->recvpriv); + struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; + struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); + struct sta_priv *pstapriv = &padapter->stapriv; +- struct registry_priv *pregistrypriv = &padapter->registrypriv; + + if(padapter->bRxRSSIDisplay) +- _linked_rx_signal_strehgth_display(padapter); ++ _linked_rx_signal_strehgth_display(padapter); ++ ++ #ifdef DBG_CONFIG_ERROR_DETECT ++ rtw_hal_sreset_linked_status_check(padapter); ++ #endif + + if (is_client_associated_to_ap(padapter)) + { + //linked infrastructure client mode ++ ++ int tx_chk = _SUCCESS, rx_chk = _SUCCESS; ++ int rx_chk_limit; ++ ++ #if defined(DBG_ROAMING_TEST) ++ rx_chk_limit = 1; ++ #elif defined(CONFIG_ACTIVE_KEEP_ALIVE_CHECK) ++ rx_chk_limit = 4; ++ #else ++ rx_chk_limit = 8; ++ #endif ++ ++ // Marked by Kurt 20130715 ++ // For WiDi 3.5 and later on, they don't ask WiDi sink to do roaming, so we could not check rx limit that strictly. ++ // todo: To check why rx_chk would be _FALSE under miracast session. ++ //#ifdef CONFIG_INTEL_WIDI ++ //if (padapter->mlmepriv.widi_state != INTEL_WIDI_STATE_NONE) ++ // rx_chk_limit = 1; ++ //#endif ++ + if ((psta = rtw_get_stainfo(pstapriv, pmlmeinfo->network.MacAddress)) != NULL) + { +- #ifdef DBG_EXPIRATION_CHK +- DBG_871X("%s rx:"STA_PKTS_FMT", BI:%u, retry:%u\n" +- , __FUNCTION__ +- , STA_RX_PKTS_ARG(psta) +- , pmlmeinfo->bcn_interval +- , pmlmeext->retry +- ); ++ bool is_p2p_enable = _FALSE; ++ #ifdef CONFIG_P2P ++ is_p2p_enable = !rtw_p2p_chk_state(&padapter->wdinfo, P2P_STATE_NONE); + #endif ++ ++ if (chk_ap_is_alive(padapter, psta) == _FALSE) ++ rx_chk = _FAIL; + +- /*to monitor whether the AP is alive or not*/ +- if (sta_last_rx_pkts(psta) == sta_rx_pkts(psta)) - { -- rtw_p2p_findphase_ex_set(pwdinfo, P2P_FINDPHASE_EX_MAX); -- pmlmeext->sitesurvey_res.channel_idx = 3; -- DBG_871X("%s idx:%d, cnt:%u\n", __FUNCTION__ -- , pmlmeext->sitesurvey_res.channel_idx -- , pwdinfo->find_phase_state_exchange_cnt -- ); +- // Commented by Albert 2010/07/21 +- // In this case, there is no any rx packet received by driver. ++ if (pxmitpriv->last_tx_pkts == pxmitpriv->tx_pkts) ++ tx_chk = _FAIL; + +- #ifdef DBG_ROAMING_TEST +- if(pmlmeext->retry<1) +- #else +- if(pmlmeext->retry<8)// Alter the retry limit to 8 +- #endif +- { +- if(pmlmeext->retry==0) +- { +- #ifdef DBG_CONFIG_ERROR_DETECT +- if(padapter->HalFunc.sreset_linked_status_check) +- padapter->HalFunc.sreset_linked_status_check(padapter); +- #endif ++ #ifdef CONFIG_ACTIVE_KEEP_ALIVE_CHECK ++ if (pmlmeext->active_keep_alive_check && (rx_chk == _FAIL || tx_chk == _FAIL)) { ++ u8 backup_oper_channel=0; + +- // In order to know the AP's current state, try to send the probe request +- // to trigger the AP to send the probe response. +- #ifdef CONFIG_P2P +- if(!rtw_p2p_chk_state(&padapter->wdinfo, P2P_STATE_NONE)) { +- #ifdef DBG_EXPIRATION_CHK +- DBG_871X("issue_probereq_p2p to trigger probersp, retry=%d\n", pmlmeext->retry); +- #endif +- issue_probereq_p2p(padapter); +- } else +- #endif +- { +- #ifdef DBG_EXPIRATION_CHK +- DBG_871X("issue_probereq to trigger probersp, retry=%d\n", pmlmeext->retry); +- #endif +- issue_probereq(padapter, &(pmlmeinfo->network.Ssid), 0); +- issue_probereq(padapter, &(pmlmeinfo->network.Ssid), 0); +- issue_probereq(padapter, &(pmlmeinfo->network.Ssid), 0); +- } +- } +- +- pmlmeext->retry++; ++ /* switch to correct channel of current network before issue keep-alive frames */ ++ if (rtw_get_oper_ch(padapter) != pmlmeext->cur_channel) { ++ backup_oper_channel = rtw_get_oper_ch(padapter); ++ SelectChannel(padapter, pmlmeext->cur_channel); + } +- else +- { +- pmlmeext->retry = 0; +- DBG_871X("no beacon to call receive_disconnect()\n"); +- receive_disconnect(padapter, pmlmeinfo->network.MacAddress +- , 65535// indicate disconnect caused by no rx +- ); +- pmlmeinfo->link_count = 0; +- return; ++ ++ if (rx_chk != _SUCCESS) ++ issue_probereq_ex(padapter, &pmlmeinfo->network.Ssid, psta->hwaddr, 3, 1); ++ ++ if ((tx_chk != _SUCCESS && pmlmeinfo->link_count++ == 0xf) || rx_chk != _SUCCESS) { ++ tx_chk = issue_nulldata(padapter, psta->hwaddr, 0, 3, 1); ++ /* if tx acked and p2p disabled, set rx_chk _SUCCESS to reset retry count */ ++ if (tx_chk == _SUCCESS && !is_p2p_enable) ++ rx_chk = _SUCCESS; + } ++ ++ /* back to the original operation channel */ ++ if(backup_oper_channel>0) ++ SelectChannel(padapter, backup_oper_channel); ++ + } + else ++ #endif /* CONFIG_ACTIVE_KEEP_ALIVE_CHECK */ + { +- pmlmeext->retry = 0; +- sta_update_last_rx_pkts(psta); +- //set_link_timer(pmlmeext, DISCONNECT_TO); - } -- else +- +- #ifdef DBG_EXPIRATION_CHK +- DBG_871X("%s tx_pkts:%llu, link_count:%u\n", __FUNCTION__ +- , pxmitpriv->tx_pkts +- , pmlmeinfo->link_count +- ); - #endif ++ if (rx_chk != _SUCCESS) { ++ if (pmlmeext->retry == 0) { ++ #ifdef DBG_EXPIRATION_CHK ++ DBG_871X("issue_probereq to trigger probersp, retry=%d\n", pmlmeext->retry); ++ #endif ++ issue_probereq(padapter, &pmlmeinfo->network.Ssid, pmlmeinfo->network.MacAddress); ++ issue_probereq(padapter, &pmlmeinfo->network.Ssid, pmlmeinfo->network.MacAddress); ++ issue_probereq(padapter, &pmlmeinfo->network.Ssid, pmlmeinfo->network.MacAddress); ++ } ++ } + +- /*to send the AP a nulldata if no frame is xmitted in order to keep alive*/ +- if(pxmitpriv->last_tx_pkts == pxmitpriv->tx_pkts) - { -- pmlmeext->sitesurvey_res.channel_idx = pmlmeext->max_chan_nums; -- DBG_871X("%s idx:%d\n", __FUNCTION__ -- , pmlmeext->sitesurvey_res.channel_idx -- ); -- } -+ cmdsz = (sizeof(struct survey_event) + sizeof(struct C2HEvent_Header)); -+ if ((pevtcmd = (u8*)rtw_zmalloc(cmdsz)) == NULL) -+ { -+ rtw_mfree((u8 *)pcmd_obj, sizeof(struct cmd_obj)); -+ return; -+ } +- if(pmlmeinfo->link_count++ == 0xf) +- { +- //DBG_871X("(Interface %d)issue nulldata to keep alive\n",padapter->dvobjpriv.InterfaceNumber); ++ if (tx_chk != _SUCCESS && pmlmeinfo->link_count++ == 0xf) { + #ifdef DBG_EXPIRATION_CHK + DBG_871X("%s issue_nulldata 0\n", __FUNCTION__); + #endif +- issue_nulldata(padapter, 0); +- pmlmeinfo->link_count = 0; ++ tx_chk = issue_nulldata(padapter, NULL, 0, 1, 0); + } + } +- else +- { ++ ++ if (rx_chk == _FAIL) { ++ pmlmeext->retry++; ++ if (pmlmeext->retry > rx_chk_limit) { ++ DBG_871X(FUNC_ADPT_FMT" disconnect or roaming\n", ++ FUNC_ADPT_ARG(padapter)); ++ receive_disconnect(padapter, pmlmeinfo->network.MacAddress ++ , WLAN_REASON_EXPIRATION_CHK); ++ return; ++ } ++ } else { ++ pmlmeext->retry = 0; ++ } ++ ++ if (tx_chk == _FAIL) { ++ pmlmeinfo->link_count &= 0xf; ++ } else { + pxmitpriv->last_tx_pkts = pxmitpriv->tx_pkts; + pmlmeinfo->link_count = 0; + } +@@ -8789,19 +10936,41 @@ void survey_timer_hdl(_adapter *padapter) + struct cmd_obj *ph2c; + struct sitesurvey_parm *psurveyPara; + struct cmd_priv *pcmdpriv=&padapter->cmdpriv; +- struct mlme_priv *pmlmepriv = &padapter->mlmepriv; + struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; + #ifdef CONFIG_P2P + struct wifidirect_info *pwdinfo= &(padapter->wdinfo); + #endif -- pmlmeext->scan_abort = _FALSE;//reset -- } -+ _rtw_init_listhead(&pcmd_obj->list); +- //DBG_8192C("marc: survey timer\n"); ++ //DBG_871X("marc: survey timer\n"); ++#ifdef PLATFORM_FREEBSD ++ rtw_mtx_lock(NULL); ++ if (callout_pending(&padapter->mlmeextpriv.survey_timer.callout)) { ++ /* callout was reset */ ++ //mtx_unlock(&sc->sc_mtx); ++ rtw_mtx_unlock(NULL); ++ return; ++ } ++ if (!callout_active(&padapter->mlmeextpriv.survey_timer.callout)) { ++ /* callout was stopped */ ++ //mtx_unlock(&sc->sc_mtx); ++ rtw_mtx_unlock(NULL); ++ return; ++ } ++ callout_deactivate(&padapter->mlmeextpriv.survey_timer.callout); ++ ++ ++#endif + + //issue rtw_sitesurvey_cmd + if (pmlmeext->sitesurvey_res.state > SCAN_START) + { + if(pmlmeext->sitesurvey_res.state == SCAN_PROCESS) +- pmlmeext->sitesurvey_res.channel_idx++; ++ { ++#ifdef CONFIG_STA_MODE_SCAN_UNDER_AP_MODE ++ if( padapter->mlmeextpriv.mlmext_info.scan_cnt != RTW_SCAN_NUM_OF_CH ) ++#endif //CONFIG_STA_MODE_SCAN_UNDER_AP_MODE ++ pmlmeext->sitesurvey_res.channel_idx++; ++ } + + if(pmlmeext->scan_abort == _TRUE) + { +@@ -8818,7 +10987,7 @@ void survey_timer_hdl(_adapter *padapter) + else + #endif + { +- pmlmeext->sitesurvey_res.channel_idx = pmlmeext->max_chan_nums; ++ pmlmeext->sitesurvey_res.channel_idx = pmlmeext->sitesurvey_res.ch_num; + DBG_871X("%s idx:%d\n", __FUNCTION__ + , pmlmeext->sitesurvey_res.channel_idx + ); +@@ -8827,3204 +10996,2358 @@ void survey_timer_hdl(_adapter *padapter) + pmlmeext->scan_abort = _FALSE;//reset + } - if ((ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj))) == NULL) - { - goto exit_survey_timer_hdl; - } -+ pcmd_obj->cmdcode = GEN_CMD_CODE(_Set_MLME_EVT); -+ pcmd_obj->cmdsz = cmdsz; -+ pcmd_obj->parmbuf = pevtcmd; - +- - if ((psurveyPara = (struct sitesurvey_parm*)rtw_zmalloc(sizeof(struct sitesurvey_parm))) == NULL) - { - rtw_mfree((unsigned char *)ph2c, sizeof(struct cmd_obj)); - goto exit_survey_timer_hdl; - } -+ pcmd_obj->rsp = NULL; -+ pcmd_obj->rspsz = 0; - +- - init_h2fwcmd_w_parm_no_rsp(ph2c, psurveyPara, GEN_CMD_CODE(_SiteSurvey)); - rtw_enqueue_cmd(pcmdpriv, ph2c); -+ pc2h_evt_hdr = (struct C2HEvent_Header*)(pevtcmd); -+ pc2h_evt_hdr->len = sizeof(struct survey_event); -+ pc2h_evt_hdr->ID = GEN_EVT_CODE(_Survey); -+ pc2h_evt_hdr->seq = ATOMIC_INC_RETURN(&pmlmeext->event_seq); -+ -+ psurvey_evt = (struct survey_event*)(pevtcmd + sizeof(struct C2HEvent_Header)); -+ -+ if (collect_bss_info(padapter, precv_frame, (WLAN_BSSID_EX *)&psurvey_evt->bss) == _FAIL) -+ { -+ rtw_mfree((u8 *)pcmd_obj, sizeof(struct cmd_obj)); -+ rtw_mfree((u8 *)pevtcmd, cmdsz); -+ return; - } - -+#ifdef CONFIG_80211D -+ process_80211d(padapter, &psurvey_evt->bss); -+#endif -+ -+ rtw_enqueue_cmd(pcmdpriv, pcmd_obj); - +- } +- +- -exit_survey_timer_hdl: -+ pmlmeext->sitesurvey_res.bss_cnt++; - - return; -+ - } - +- +- return; +-} +- -void link_timer_hdl(_adapter *padapter) -+void report_surveydone_event(_adapter *padapter) - { +-{ - static unsigned int rx_pkt = 0; - static u64 tx_cnt = 0; - struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); - struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; - struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); - struct sta_priv *pstapriv = &padapter->stapriv; -+ struct cmd_obj *pcmd_obj; -+ u8 *pevtcmd; -+ u32 cmdsz; -+ struct surveydone_event *psurveydone_evt; -+ struct C2HEvent_Header *pc2h_evt_hdr; -+ struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; -+ struct cmd_priv *pcmdpriv = &padapter->cmdpriv; - +- - if (pmlmeinfo->state & WIFI_FW_AUTH_NULL) -+ if ((pcmd_obj = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj))) == NULL) - { +- { - DBG_871X("link_timer_hdl:no beacon while connecting\n"); - pmlmeinfo->state = WIFI_FW_NULL_STATE; - report_join_res(padapter, -3); -+ return; - } +- } - else if (pmlmeinfo->state & WIFI_FW_AUTH_STATE) -+ -+ cmdsz = (sizeof(struct surveydone_event) + sizeof(struct C2HEvent_Header)); -+ if ((pevtcmd = (u8*)rtw_zmalloc(cmdsz)) == NULL) - { +- { - //re-auth timer - if (++pmlmeinfo->reauth_count > REAUTH_LIMIT) - { @@ -19235,9 +19111,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - pmlmeinfo->auth_seq = 1; - issue_auth(padapter, NULL, 0); - set_link_timer(pmlmeext, REAUTH_TO); -+ rtw_mfree((u8 *)pcmd_obj, sizeof(struct cmd_obj)); -+ return; - } +- } - else if (pmlmeinfo->state & WIFI_FW_ASSOC_STATE) - { - //re-assoc timer @@ -19247,7 +19121,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - report_join_res(padapter, -2); - return; - } - +- - DBG_871X("link_timer_hdl: assoc timeout and try again\n"); - issue_assocreq(padapter); - set_link_timer(pmlmeext, REASSOC_TO); @@ -19269,14 +19143,10 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - rx_pkt = psta->sta_stats.rx_pkts; - set_link_timer(pmlmeext, DISCONNECT_TO); - } -+ _rtw_init_listhead(&pcmd_obj->list); - +- - //update the EDCA paramter according to the Tx/RX mode - update_EDCA_param(padapter); -+ pcmd_obj->cmdcode = GEN_CMD_CODE(_Set_MLME_EVT); -+ pcmd_obj->cmdsz = cmdsz; -+ pcmd_obj->parmbuf = pevtcmd; - +- - /*to send the AP a nulldata if no frame is xmitted in order to keep alive*/ - if (pmlmeinfo->link_count++ == 0) - { @@ -19288,9 +19158,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - { - issue_nulldata(padapter, 0); - } -+ pcmd_obj->rsp = NULL; -+ pcmd_obj->rspsz = 0; - +- - tx_cnt = pxmitpriv->tx_pkts; - } - } //end of if ((psta = rtw_get_stainfo(pstapriv, passoc_res->network.MacAddress)) != NULL) @@ -19304,11 +19172,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - if (pmlmeinfo->FW_sta_info[i].status == 1) - { - psta = pmlmeinfo->FW_sta_info[i].psta; -+ pc2h_evt_hdr = (struct C2HEvent_Header*)(pevtcmd); -+ pc2h_evt_hdr->len = sizeof(struct surveydone_event); -+ pc2h_evt_hdr->ID = GEN_EVT_CODE(_SurveyDone); -+ pc2h_evt_hdr->seq = ATOMIC_INC_RETURN(&pmlmeext->event_seq); - +- - if (pmlmeinfo->FW_sta_info[i].rx_pkt == psta->sta_stats.rx_pkts) - { - pmlmeinfo->FW_sta_info[i].status = 0; @@ -19320,105 +19184,46 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - } - } - } -+ psurveydone_evt = (struct surveydone_event*)(pevtcmd + sizeof(struct C2HEvent_Header)); -+ psurveydone_evt->bss_cnt = pmlmeext->sitesurvey_res.bss_cnt; - +- - set_link_timer(pmlmeext, DISCONNECT_TO); - } -#endif -+ DBG_871X("survey done event(%x) band:%d for "ADPT_FMT"\n", psurveydone_evt->bss_cnt, padapter->setband, ADPT_ARG(padapter)); -+ -+ rtw_enqueue_cmd(pcmdpriv, pcmd_obj); - - return; -+ - } - +- +- return; +-} +- -void addba_timer_hdl(struct sta_info *psta) -+void report_join_res(_adapter *padapter, int res) - { +-{ - u8 bitmap; - u16 tid; - struct ht_priv *phtpriv; -+ struct cmd_obj *pcmd_obj; -+ u8 *pevtcmd; -+ u32 cmdsz; -+ struct joinbss_event *pjoinbss_evt; -+ struct C2HEvent_Header *pc2h_evt_hdr; -+ struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; -+ struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); -+ struct cmd_priv *pcmdpriv = &padapter->cmdpriv; - +- - if(!psta) -+ if ((pcmd_obj = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj))) == NULL) -+ { - return; +- return; - - phtpriv = &psta->htpriv; -+ } - +- - if((phtpriv->ht_option==_TRUE) && (phtpriv->ampdu_enable==_TRUE)) -+ cmdsz = (sizeof(struct joinbss_event) + sizeof(struct C2HEvent_Header)); -+ if ((pevtcmd = (u8*)rtw_zmalloc(cmdsz)) == NULL) - { +- { - if(phtpriv->candidate_tid_bitmap) - phtpriv->candidate_tid_bitmap=0x0; - -+ rtw_mfree((u8 *)pcmd_obj, sizeof(struct cmd_obj)); -+ return; - } -+ -+ _rtw_init_listhead(&pcmd_obj->list); -+ -+ pcmd_obj->cmdcode = GEN_CMD_CODE(_Set_MLME_EVT); -+ pcmd_obj->cmdsz = cmdsz; -+ pcmd_obj->parmbuf = pevtcmd; -+ -+ pcmd_obj->rsp = NULL; -+ pcmd_obj->rspsz = 0; -+ -+ pc2h_evt_hdr = (struct C2HEvent_Header*)(pevtcmd); -+ pc2h_evt_hdr->len = sizeof(struct joinbss_event); -+ pc2h_evt_hdr->ID = GEN_EVT_CODE(_JoinBss); -+ pc2h_evt_hdr->seq = ATOMIC_INC_RETURN(&pmlmeext->event_seq); -+ -+ pjoinbss_evt = (struct joinbss_event*)(pevtcmd + sizeof(struct C2HEvent_Header)); -+ _rtw_memcpy((unsigned char *)(&(pjoinbss_evt->network.network)), &(pmlmeinfo->network), sizeof(WLAN_BSSID_EX)); -+ pjoinbss_evt->network.join_res = pjoinbss_evt->network.aid = res; -+ -+ DBG_871X("report_join_res(%d)\n", res); - +- } +- -} -+ -+ rtw_joinbss_event_prehandle(padapter, (u8 *)&pjoinbss_evt->network); -+ -+ -+ rtw_enqueue_cmd(pcmdpriv, pcmd_obj); -+ -+ return; - +- -u8 NULL_hdl(_adapter *padapter, u8 *pbuf) -{ - return H2C_SUCCESS; - } - +-} +- -u8 setopmode_hdl(_adapter *padapter, u8 *pbuf) -+void report_del_sta_event(_adapter *padapter, unsigned char* MacAddr, unsigned short reason) - { +-{ - u8 type; - struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; - struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); - struct setopmode_parm *psetop = (struct setopmode_parm *)pbuf; -+ struct cmd_obj *pcmd_obj; -+ u8 *pevtcmd; -+ u32 cmdsz; -+ struct sta_info *psta; -+ int mac_id; -+ struct stadel_event *pdel_sta_evt; -+ struct C2HEvent_Header *pc2h_evt_hdr; -+ struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; -+ struct cmd_priv *pcmdpriv = &padapter->cmdpriv; - +- - if(psetop->mode == Ndis802_11APMode) - { - pmlmeinfo->state = WIFI_FW_AP_STATE; @@ -19428,82 +19233,36 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release -#endif - } - else if(psetop->mode == Ndis802_11Infrastructure) -+ if ((pcmd_obj = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj))) == NULL) - { +- { - type = _HW_STATE_STATION_; -+ return; - } +- } - else if(psetop->mode == Ndis802_11IBSS) -+ -+ cmdsz = (sizeof(struct stadel_event) + sizeof(struct C2HEvent_Header)); -+ if ((pevtcmd = (u8*)rtw_zmalloc(cmdsz)) == NULL) - { +- { - type = _HW_STATE_ADHOC_; -+ rtw_mfree((u8 *)pcmd_obj, sizeof(struct cmd_obj)); -+ return; - } -+ -+ _rtw_init_listhead(&pcmd_obj->list); -+ -+ pcmd_obj->cmdcode = GEN_CMD_CODE(_Set_MLME_EVT); -+ pcmd_obj->cmdsz = cmdsz; -+ pcmd_obj->parmbuf = pevtcmd; -+ -+ pcmd_obj->rsp = NULL; -+ pcmd_obj->rspsz = 0; -+ -+ pc2h_evt_hdr = (struct C2HEvent_Header*)(pevtcmd); -+ pc2h_evt_hdr->len = sizeof(struct stadel_event); -+ pc2h_evt_hdr->ID = GEN_EVT_CODE(_DelSTA); -+ pc2h_evt_hdr->seq = ATOMIC_INC_RETURN(&pmlmeext->event_seq); -+ -+ pdel_sta_evt = (struct stadel_event*)(pevtcmd + sizeof(struct C2HEvent_Header)); -+ _rtw_memcpy((unsigned char *)(&(pdel_sta_evt->macaddr)), MacAddr, ETH_ALEN); -+ _rtw_memcpy((unsigned char *)(pdel_sta_evt->rsvd),(unsigned char *)(&reason),2); -+ -+ -+ psta = rtw_get_stainfo(&padapter->stapriv, MacAddr); -+ if(psta) -+ mac_id = (int)psta->mac_id; - else +- } +- else - { - type = _HW_STATE_NOLINK_; - } -+ mac_id = (-1); - +- - padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_SET_OPMODE, (u8 *)(&type)); - //Set_NETYPE0_MSR(padapter, type); -+ pdel_sta_evt->mac_id = mac_id; - +- - return H2C_SUCCESS; - -+ DBG_871X("report_del_sta_event: delete STA, mac_id=%d\n", mac_id); -+ -+ rtw_enqueue_cmd(pcmdpriv, pcmd_obj); -+ -+ return; - } - +-} +- -u8 createbss_hdl(_adapter *padapter, u8 *pbuf) -+void report_add_sta_event(_adapter *padapter, unsigned char* MacAddr, int cam_idx) - { +-{ - struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; - struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); - WLAN_BSSID_EX *pnetwork = (WLAN_BSSID_EX*)(&(pmlmeinfo->network)); - struct joinbss_parm *pparm = (struct joinbss_parm *)pbuf; - u32 initialgain; -+ struct cmd_obj *pcmd_obj; -+ u8 *pevtcmd; -+ u32 cmdsz; -+ struct stassoc_event *padd_sta_evt; -+ struct C2HEvent_Header *pc2h_evt_hdr; -+ struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; -+ struct cmd_priv *pcmdpriv = &padapter->cmdpriv; - +- - - if(pparm->network.InfrastructureMode == Ndis802_11APMode) -+ if ((pcmd_obj = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj))) == NULL) - { +- { -#ifdef CONFIG_AP_MODE - - if(pmlmeinfo->state == WIFI_FW_AP_STATE) @@ -19512,14 +19271,11 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - return H2C_SUCCESS; - } -#endif -+ return; - } - +- } +- - //below is for ad-hoc master - if(pparm->network.InfrastructureMode == Ndis802_11IBSS) -+ cmdsz = (sizeof(struct stassoc_event) + sizeof(struct C2HEvent_Header)); -+ if ((pevtcmd = (u8*)rtw_zmalloc(cmdsz)) == NULL) - { +- { - rtw_joinbss_reset(padapter); - - pmlmeext->cur_bwmode = HT_CHANNEL_WIDTH_20; @@ -19531,76 +19287,48 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - pmlmeinfo->HT_info_enable = 0; - pmlmeinfo->agg_enable_bitmap = 0; - pmlmeinfo->candidate_tid_bitmap = 0; -+ rtw_mfree((u8 *)pcmd_obj, sizeof(struct cmd_obj)); -+ return; -+ } - +- - //disable dynamic functions, such as high power, DIG - Save_DM_Func_Flag(padapter); - Switch_DM_Func(padapter, DYNAMIC_FUNC_DISABLE, _FALSE); -+ _rtw_init_listhead(&pcmd_obj->list); - +- - //config the initial gain under linking, need to write the BB registers - initialgain = 0x1E; - padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_INITIAL_GAIN, (u8 *)(&initialgain)); -+ pcmd_obj->cmdcode = GEN_CMD_CODE(_Set_MLME_EVT); -+ pcmd_obj->cmdsz = cmdsz; -+ pcmd_obj->parmbuf = pevtcmd; - +- - //cancel link timer - _cancel_timer_ex(&pmlmeext->link_timer); -+ pcmd_obj->rsp = NULL; -+ pcmd_obj->rspsz = 0; - +- - //clear CAM - flush_all_cam_entry(padapter); -+ pc2h_evt_hdr = (struct C2HEvent_Header*)(pevtcmd); -+ pc2h_evt_hdr->len = sizeof(struct stassoc_event); -+ pc2h_evt_hdr->ID = GEN_EVT_CODE(_AddSTA); -+ pc2h_evt_hdr->seq = ATOMIC_INC_RETURN(&pmlmeext->event_seq); - +- - _rtw_memcpy(pnetwork, pbuf, FIELD_OFFSET(WLAN_BSSID_EX, IELength)); - pnetwork->IELength = ((WLAN_BSSID_EX *)pbuf)->IELength; -+ padd_sta_evt = (struct stassoc_event*)(pevtcmd + sizeof(struct C2HEvent_Header)); -+ _rtw_memcpy((unsigned char *)(&(padd_sta_evt->macaddr)), MacAddr, ETH_ALEN); -+ padd_sta_evt->cam_id = cam_idx; - +- - if(pnetwork->IELength>MAX_IE_SZ)//Check pbuf->IELength - return H2C_PARAMETERS_ERROR; -+ DBG_871X("report_add_sta_event: add STA\n"); - +- - _rtw_memcpy(pnetwork->IEs, ((WLAN_BSSID_EX *)pbuf)->IEs, pnetwork->IELength); - - start_create_ibss(padapter); -+ rtw_enqueue_cmd(pcmdpriv, pcmd_obj); - +- - } -+ return; -+} - +- - return H2C_SUCCESS; - +- -} -+/**************************************************************************** - +- -u8 join_cmd_hdl(_adapter *padapter, u8 *pbuf) -+Following are the event callback functions -+ -+*****************************************************************************/ -+ -+//for sta/adhoc mode -+void update_sta_info(_adapter *padapter, struct sta_info *psta) - { +-{ - u8 join_type; - PNDIS_802_11_VARIABLE_IEs pIE; - struct registry_priv *pregpriv = &padapter->registrypriv; -+ struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); - struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; - struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); +- struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; +- struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); - WLAN_BSSID_EX *pnetwork = (WLAN_BSSID_EX*)(&(pmlmeinfo->network)); - struct joinbss_parm *pparm = (struct joinbss_parm *)pbuf; - u32 acparm, initialgain, i; - +- - //check already connecting to AP or not - if (pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS) - { @@ -19608,9 +19336,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - { - issue_deauth(padapter, pnetwork->MacAddress, WLAN_REASON_DEAUTH_LEAVING); - } -+ //ERP -+ VCS_update(padapter, psta); - +- - pmlmeinfo->state = WIFI_FW_NULL_STATE; - - //clear CAM @@ -19620,19 +19346,14 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - - //set MSR to nolink - Set_NETYPE0_MSR(padapter, _HW_STATE_NOLINK_); - +- - padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_MLME_DISCONNECT, 0); - } -+ //HT -+ if(pmlmepriv->htpriv.ht_option) -+ { -+ psta->htpriv.ht_option = _TRUE; - +- -#ifdef CONFIG_ANTENNA_DIVERSITY - rtw_antenna_select_cmd(padapter, pparm->network.PhyInfo.Optimum_antenna, _FALSE); -#endif -+ psta->htpriv.ampdu_enable = pmlmepriv->htpriv.ampdu_enable; - +- - rtw_joinbss_reset(padapter); - - pmlmeext->cur_bwmode = HT_CHANNEL_WIDTH_20; @@ -19646,25 +19367,20 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - pmlmeinfo->candidate_tid_bitmap = 0; - pmlmeinfo->bwmode_updated = _FALSE; - //pmlmeinfo->assoc_AP_vendor = maxAP; -+ if (support_short_GI(padapter, &(pmlmeinfo->HT_caps))) -+ psta->htpriv.sgi = _TRUE; - +- - _rtw_memcpy(pnetwork, pbuf, FIELD_OFFSET(WLAN_BSSID_EX, IELength)); - pnetwork->IELength = ((WLAN_BSSID_EX *)pbuf)->IELength; - - if(pnetwork->IELength>MAX_IE_SZ)//Check pbuf->IELength - return H2C_PARAMETERS_ERROR; -+ psta->qos_option = _TRUE; - +- - _rtw_memcpy(pnetwork->IEs, ((WLAN_BSSID_EX *)pbuf)->IEs, pnetwork->IELength); - - //Check AP vendor to move rtw_joinbss_cmd() - //pmlmeinfo->assoc_AP_vendor = check_assoc_AP(pnetwork->IEs, pnetwork->IELength); - - for (i = sizeof(NDIS_802_11_FIXED_IEs); i < pnetwork->IELength;) -+ } -+ else - { +- { - pIE = (PNDIS_802_11_VARIABLE_IEs)(pnetwork->IEs + i); - - switch (pIE->ElementID) @@ -19715,8 +19431,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - default: - break; - } -+ psta->htpriv.ht_option = _FALSE; - +- - i += (pIE->Length + 2); - } -#if 0 @@ -19750,10 +19465,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release -#endif - //disable dynamic functions, such as high power, DIG - //Switch_DM_Func(padapter, DYNAMIC_FUNC_DISABLE, _FALSE); -+ psta->htpriv.ampdu_enable = _FALSE; -+ -+ psta->htpriv.sgi = _FALSE; - +- - //config the initial gain under linking, need to write the BB registers - #ifndef CONFIG_BEFORE_LINKED_DIG - initialgain = 0x1E; @@ -19763,37 +19475,21 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_BSSID, pmlmeinfo->network.MacAddress); - join_type = 0; - padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_MLME_JOIN, (u8 *)(&join_type)); -+ psta->qos_option = _FALSE; - +- - //cancel link timer - _cancel_timer_ex(&pmlmeext->link_timer); -+ } - +- - start_clnt_join(padapter); -+ psta->htpriv.bwmode = pmlmeext->cur_bwmode; -+ psta->htpriv.ch_offset = pmlmeext->cur_ch_offset; - +- - return H2C_SUCCESS; -+ psta->htpriv.agg_enable_bitmap = 0x0;//reset -+ psta->htpriv.candidate_tid_bitmap = 0x0;//reset - -+ -+ //QoS -+ if(pmlmepriv->qospriv.qos_option) -+ psta->qos_option = _TRUE; -+ -+ -+ psta->state = _FW_LINKED; -+ - } - +- +-} +- -u8 disconnect_hdl(_adapter *padapter, unsigned char *pbuf) -+void mlmeext_joinbss_event_callback(_adapter *padapter, int join_res) - { +-{ - struct disconnect_parm *pparm = (struct disconnect_parm *)pbuf; -+ struct sta_info *psta, *psta_bmc; - struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; - struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); +- struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; +- struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); - WLAN_BSSID_EX *pnetwork = (WLAN_BSSID_EX*)(&(pmlmeinfo->network)); - u8 val8; - @@ -19801,17 +19497,9 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - { - issue_deauth(padapter, pnetwork->MacAddress, WLAN_REASON_DEAUTH_LEAVING); - } -+ WLAN_BSSID_EX *cur_network = &(pmlmeinfo->network); -+ struct sta_priv *pstapriv = &padapter->stapriv; -+ u8 join_type; - +- - //set_opmode_cmd(padapter, infra_client_with_mlme); -+ if(join_res < 0) -+ { -+ join_type = 1; -+ rtw_hal_set_hwreg(padapter, HW_VAR_MLME_JOIN, (u8 *)(&join_type)); -+ rtw_hal_set_hwreg(padapter, HW_VAR_BSSID, null_addr); - +- - pmlmeinfo->state = WIFI_FW_NULL_STATE; - - //switch to the 20M Hz mode after disconnect @@ -19820,38 +19508,17 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - - //set MSR to no link state - Set_NETYPE0_MSR(padapter, _HW_STATE_NOLINK_); -+ //restore to initial setting. -+ update_tx_basic_rate(padapter, padapter->registrypriv.wireless_mode); -+#if 0 //temply remove -+#ifdef CONFIG_INTEL_WIDI -+#ifdef DBG_CONFIG_ERROR_DETECT -+ DBG_871X("%s(): do silentreset\n",__FUNCTION__); -+ rtw_hal_sreset_reset(padapter); -+#endif -+#endif -+#endif -+ goto exit_mlmeext_joinbss_event_callback; -+ } - +- - padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_MLME_DISCONNECT, 0); - padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_BSSID, null_addr); - - if(((pmlmeinfo->state&0x03) == WIFI_FW_ADHOC_STATE) || ((pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE)) -+ if((pmlmeinfo->state&0x03) == WIFI_FW_ADHOC_STATE) - { -- //Stop BCN -- val8 = 0; -- padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_BCN_FUNC, (u8 *)(&val8)); -+ //for bc/mc -+ psta_bmc = rtw_get_bcmc_stainfo(padapter); -+ if(psta_bmc) -+ { -+ pmlmeinfo->FW_sta_info[psta_bmc->mac_id].psta = psta_bmc; -+ update_bmc_sta_support_rate(padapter, psta_bmc->mac_id); -+ Update_RA_Entry(padapter, psta_bmc->mac_id); -+ } - } - +- { +- //Stop BCN +- val8 = 0; +- padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_BCN_FUNC, (u8 *)(&val8)); +- } +- - pmlmeinfo->state = WIFI_FW_NULL_STATE; - - set_channel_bwmode(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset, pmlmeext->cur_bwmode); @@ -19870,22 +19537,18 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - u8 val8; - u32 initialgain; - u32 i; - +- -#ifdef CONFIG_P2P - struct wifidirect_info* pwdinfo = &padapter->wdinfo; -#endif -+ //turn on dynamic functions -+ Switch_DM_Func(padapter, DYNAMIC_FUNC_DIG|DYNAMIC_FUNC_HP|DYNAMIC_FUNC_SS, _TRUE); - +- - if (pmlmeext->sitesurvey_res.state == SCAN_DISABLE) - { - //for first time sitesurvey_cmd - pmlmeext->sitesurvey_res.state = SCAN_START; - pmlmeext->sitesurvey_res.bss_cnt = 0; - pmlmeext->sitesurvey_res.channel_idx = 0; -+ // update IOT-releated issue -+ update_IOT_info(padapter); - +- - for(i=0;issid[i].SsidLength) { - _rtw_memcpy(pmlmeext->sitesurvey_res.ssid[i].Ssid, pparm->ssid[i].Ssid, IW_ESSID_MAX_SIZE); @@ -19894,42 +19557,26 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - pmlmeext->sitesurvey_res.ssid[i].SsidLength= 0; - } - } -+ rtw_hal_set_hwreg(padapter, HW_VAR_BASIC_RATE, cur_network->SupportedRates); - +- - pmlmeext->sitesurvey_res.scan_mode = pparm->scan_mode; -+ //BCN interval -+ rtw_hal_set_hwreg(padapter, HW_VAR_BEACON_INTERVAL, (u8 *)(&pmlmeinfo->bcn_interval)); - +- - //issue null data if associating to the AP - if (is_client_associated_to_ap(padapter) == _TRUE) - { - pmlmeext->sitesurvey_res.state = SCAN_TXNULL; -+ //udpate capability -+ update_capinfo(padapter, pmlmeinfo->capability); - +- - issue_nulldata(padapter, 1); - issue_nulldata(padapter, 1); -+ //WMM, Update EDCA param -+ WMMOnAssocRsp(padapter); - +- - //delay 50ms to protect nulldata(1). - set_survey_timer(pmlmeext, 50); -+ //HT -+ HTOnAssocRsp(padapter); - +- - return H2C_SUCCESS; - } - } -+#ifndef CONFIG_CONCURRENT_MODE -+ // Call set_channel_bwmode when the CONFIG_CONCURRENT_MODE doesn't be defined. -+ //Set cur_channel&cur_bwmode&cur_ch_offset -+ set_channel_bwmode(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset, pmlmeext->cur_bwmode); -+#endif - +- - if ((pmlmeext->sitesurvey_res.state == SCAN_START) || (pmlmeext->sitesurvey_res.state == SCAN_TXNULL)) -+ psta = rtw_get_stainfo(pstapriv, cur_network->MacAddress); -+ if (psta) //only for infra. mode - { +- { -#ifdef CONFIG_FIND_BEST_CHANNEL -#if 0 - for (i=0; pmlmeext->channel_set[i].ChannelNum !=0; i++) { @@ -19937,17 +19584,11 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - } -#endif -#endif /* CONFIG_FIND_BEST_CHANNEL */ -+ pmlmeinfo->FW_sta_info[psta->mac_id].psta = psta; - +- - //disable dynamic functions, such as high power, DIG - Save_DM_Func_Flag(padapter); - Switch_DM_Func(padapter, DYNAMIC_FUNC_DISABLE, _FALSE); -+ //DBG_871X("set_sta_rate\n"); -+ -+ //set per sta rate after updating HT cap. -+ set_sta_rate(padapter, psta); -+ } - +- - //config the initial gain under scaning, need to write the BB registers -#ifdef CONFIG_IOCTL_CFG80211 - if((wdev_to_priv(padapter->rtw_wdev))->p2p_enabled == _TRUE) @@ -19955,102 +19596,46 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - else -#endif - initialgain = 0x17; -+ join_type = 2; -+ rtw_hal_set_hwreg(padapter, HW_VAR_MLME_JOIN, (u8 *)(&join_type)); - +- -#ifdef CONFIG_P2P - if(!rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE) && !rtw_p2p_chk_state(pwdinfo, P2P_STATE_IDLE)) - initialgain = 0x27; -#endif //CONFIG_P2P -+ if((pmlmeinfo->state&0x03) == WIFI_FW_STATION_STATE) -+ { -+ // correcting TSF -+ correct_TSF(padapter, pmlmeext); -+ -+ //set_link_timer(pmlmeext, DISCONNECT_TO); -+ } - +- - padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_INITIAL_GAIN, (u8 *)(&initialgain)); - - //set MSR to no link state - Set_NETYPE0_MSR(padapter, _HW_STATE_NOLINK_); -+#ifdef CONFIG_LPS -+ rtw_lps_ctrl_wk_cmd(padapter, LPS_CTRL_CONNECT, 0); -+#endif - +- - val8 = 1; //before site survey - padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_MLME_SITESURVEY, (u8 *)(&val8)); -+exit_mlmeext_joinbss_event_callback: - +- - // Commented by Albert 2011/08/05 - // The pre_tx_scan_timer_process will issue the scan H2C command. - // However, the driver should NOT enter the scanning mode at that time. - pmlmeext->sitesurvey_res.state = SCAN_PROCESS; - } -+#ifdef CONFIG_DUALMAC_CONCURRENT -+ dc_handle_join_done(padapter, join_res); -+#endif -+#ifdef CONFIG_CONCURRENT_MODE -+ concurrent_chk_joinbss_done(padapter, join_res); -+#endif - +- - site_survey(padapter); -+ DBG_871X("=>%s\n", __FUNCTION__); - +- - return H2C_SUCCESS; - - } - +-} +- -u8 setauth_hdl(_adapter *padapter, unsigned char *pbuf) -+void mlmeext_sta_add_event_callback(_adapter *padapter, struct sta_info *psta) - { +-{ - struct setauth_parm *pparm = (struct setauth_parm *)pbuf; - struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; -+ struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); - struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); +- struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); - - if (pparm->mode < 4) -+ u8 join_type; -+ -+ DBG_871X("%s\n", __FUNCTION__); -+ -+ if((pmlmeinfo->state&0x03) == WIFI_FW_ADHOC_STATE) - { +- { - pmlmeinfo->auth_algo = pparm->mode; -+ if(pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS)//adhoc master or sta_count>1 -+ { -+ //nothing to do -+ } -+ else//adhoc client -+ { -+ //update TSF Value -+ //update_TSF(pmlmeext, pframe, len); -+ -+ // correcting TSF -+ correct_TSF(padapter, pmlmeext); -+ -+ //start beacon -+ if(send_beacon(padapter)==_FAIL) -+ { -+ pmlmeinfo->FW_sta_info[psta->mac_id].status = 0; -+ -+ pmlmeinfo->state ^= WIFI_FW_ADHOC_STATE; -+ -+ return; -+ } -+ -+ pmlmeinfo->state |= WIFI_FW_ASSOC_SUCCESS; -+ -+ } -+ -+ join_type = 2; -+ rtw_hal_set_hwreg(padapter, HW_VAR_MLME_JOIN, (u8 *)(&join_type)); - } - +- } +- - return H2C_SUCCESS; -} -+ pmlmeinfo->FW_sta_info[psta->mac_id].psta = psta; - +- -u8 setkey_hdl(_adapter *padapter, u8 *pbuf) -{ - unsigned short ctrl; @@ -20058,29 +19643,24 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; - struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); - unsigned char null_sta[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; -+ //rate radaptive -+ Update_RA_Entry(padapter, psta->mac_id); - +- - //main tx key for wep. - if(pparm->set_tx) - pmlmeinfo->key_index = pparm->keyid; - - //write cam - ctrl = BIT(15) | ((pparm->algorithm) << 2) | pparm->keyid; -+ //update adhoc sta_info -+ update_sta_info(padapter, psta); - +- - write_cam(padapter, pparm->keyid, ctrl, null_sta, pparm->key); - - return H2C_SUCCESS; - } - +-} +- -u8 set_stakey_hdl(_adapter *padapter, u8 *pbuf) -+void mlmeext_sta_del_event_callback(_adapter *padapter) - { +-{ - unsigned short ctrl=0; - struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; - struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); +- struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; +- struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); - struct set_stakey_parm *pparm = (struct set_stakey_parm *)pbuf; -#ifdef CONFIG_TDLS - struct tdls_info *ptdlsinfo = &padapter->tdlsinfo; @@ -20098,7 +19678,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - if(psta) - { - ctrl = (BIT(15) | ((pparm->algorithm) << 2)); - +- - DBG_8192C("r871x_set_stakey_hdl(): enc_algorithm=%d\n", pparm->algorithm); - - if((psta->mac_id<1) || (psta->mac_id>(NUM_STA-4))) @@ -20108,136 +19688,61 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - } - - cam_id = (psta->mac_id + 3);//0~3 for default key, cmd_id=macid + 3, macid=aid+1; -+ if (is_client_associated_to_ap(padapter) || is_IBSS_empty(padapter)) -+ { -+ //set_opmode_cmd(padapter, infra_client_with_mlme); - +- - DBG_8192C("Write CAM, mac_addr=%x:%x:%x:%x:%x:%x, cam_entry=%d\n", pparm->addr[0], - pparm->addr[1], pparm->addr[2], pparm->addr[3], pparm->addr[4], - pparm->addr[5], cam_id); -+ rtw_hal_set_hwreg(padapter, HW_VAR_MLME_DISCONNECT, 0); -+ rtw_hal_set_hwreg(padapter, HW_VAR_BSSID, null_addr); - +- - write_cam(padapter, cam_id, ctrl, pparm->addr, pparm->key); - - return H2C_SUCCESS_RSP; - - } - else -+ //restore to initial setting. -+ update_tx_basic_rate(padapter, padapter->registrypriv.wireless_mode); -+ -+#ifdef CONFIG_DUALMAC_CONCURRENT -+ dc_set_channel_bwmode_disconnect(padapter); -+#else -+#ifdef CONFIG_CONCURRENT_MODE -+ if((check_buddy_fwstate(padapter, _FW_LINKED)) != _TRUE) - { +- { - DBG_8192C("r871x_set_stakey_hdl(): sta has been free\n"); - return H2C_REJECTED; - } - - } -+#endif //CONFIG_CONCURRENT_MODE - +- - //below for sta mode - - ctrl = BIT(15) | ((pparm->algorithm) << 2); -+ //switch to the 20M Hz mode after disconnect -+ pmlmeext->cur_bwmode = HT_CHANNEL_WIDTH_20; -+ pmlmeext->cur_ch_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE; -+ -+ //SelectChannel(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset); -+ set_channel_bwmode(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset, pmlmeext->cur_bwmode); - +- -#ifdef CONFIG_TDLS - if(ptdlsinfo->cam_entry_to_clear!=0){ - clear_cam_entry(padapter, ptdlsinfo->cam_entry_to_clear); - ptdlsinfo->cam_entry_to_clear=0; -+#ifdef CONFIG_CONCURRENT_MODE -+ } -+#endif //CONFIG_CONCURRENT_MODE -+#endif //CONFIG_DUALMAC_CONCURRENT - +- - return H2C_SUCCESS; - } -+ flush_all_cam_entry(padapter); -+ -+ pmlmeinfo->state = WIFI_FW_NULL_STATE; -+ -+ //set MSR to no link state -> infra. mode -+ Set_MSR(padapter, _HW_STATE_STATION_); -+ -+ _cancel_timer_ex(&pmlmeext->link_timer); - +- - psta = rtw_get_stainfo(pstapriv, pparm->addr);//Get TDLS Peer STA - if( psta->tdls_sta_state&TDLS_LINKED_STATE ){ - write_cam(padapter, psta->cam_entry, ctrl, pparm->addr, pparm->key); - } +- } - else -#endif - write_cam(padapter, 5, ctrl, pparm->addr, pparm->key); - +- - pmlmeinfo->enc_algo = pparm->algorithm; - - return H2C_SUCCESS; - } - +-} +- -u8 add_ba_hdl(_adapter *padapter, unsigned char *pbuf) -{ - struct addBaReq_parm *pparm = (struct addBaReq_parm *)pbuf; - struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; - struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); -+/**************************************************************************** - +- - struct sta_info *psta = rtw_get_stainfo(&padapter->stapriv, pparm->addr); -+Following are the functions for the timer handlers -+ -+*****************************************************************************/ -+void _linked_rx_signal_strehgth_display(_adapter *padapter); -+void _linked_rx_signal_strehgth_display(_adapter *padapter) -+{ -+ int UndecoratedSmoothedPWDB; - +- - if(!psta) - return H2C_SUCCESS; - -+#ifdef CONFIG_CONCURRENT_MODE -+ PADAPTER pbuddy_adapter = padapter->pbuddy_adapter; -+ DBG_871X("============ pbuddy_adapter linked status check ===================\n"); -+ DBG_871X("buddy_adapter_type=%d\n", pbuddy_adapter->adapter_type); -+ DBG_871X("pbuddy_adapter pathA Rx SNRdb:%d\n",pbuddy_adapter->recvpriv.RxSNRdB[0]); -+ DBG_871X("pbuddy_adapter pathA Rx PWDB:%d\n",pbuddy_adapter->recvpriv.rxpwdb); -+ DBG_871X("pbuddy_adapter pathA Rx RSSI:%d,pathB Rx RSSI:%d\n" -+ ,pbuddy_adapter->recvpriv.RxRssi[0],pbuddy_adapter->recvpriv.RxRssi[1]); -+ rtw_hal_get_def_var(pbuddy_adapter, HAL_DEF_UNDERCORATEDSMOOTHEDPWDB, &UndecoratedSmoothedPWDB); -+ DBG_871X("pbuddy_adapter UndecoratedSmoothedPWDB:%d\n",UndecoratedSmoothedPWDB); -+ DBG_871X("Rx RSSI:%d\n",pbuddy_adapter->recvpriv.rssi); -+ DBG_871X("Rx Signal_strength:%d\n",pbuddy_adapter->recvpriv.signal_strength); -+ DBG_871X("Rx Signal_qual:%d \n",pbuddy_adapter->recvpriv.signal_qual); -+ DBG_871X("============ linked status check ===================\n"); -+ DBG_871X("adapter_type=%d\n", padapter->adapter_type); -+#else //CONFIG_CONCURRENT_MODE -+ DBG_871X("============ linked status check ===================\n"); -+#endif //CONFIG_CONCURRENT_MODE -+ DBG_871X("pathA Rx SNRdb:%d, pathB Rx SNRdb:%d\n",padapter->recvpriv.RxSNRdB[0], padapter->recvpriv.RxSNRdB[1]); -+ DBG_871X("pathA Rx PWDB:%d\n",padapter->recvpriv.rxpwdb); -+ DBG_871X("pathA Rx RSSI:%d,pathB Rx RSSI:%d\n",padapter->recvpriv.RxRssi[0],padapter->recvpriv.RxRssi[1]); -+ rtw_hal_get_def_var(padapter, HAL_DEF_UNDERCORATEDSMOOTHEDPWDB, &UndecoratedSmoothedPWDB); -+ DBG_871X("UndecoratedSmoothedPWDB:%d\n",UndecoratedSmoothedPWDB); -+ DBG_871X("Rx RSSI:%d\n",padapter->recvpriv.rssi); -+ DBG_871X("Rx Signal_strength:%d\n",padapter->recvpriv.signal_strength); -+ DBG_871X("Rx Signal_qual:%d \n",padapter->recvpriv.signal_qual); -+ if ( check_fwstate( &padapter->mlmepriv, _FW_LINKED )) -+ { -+ DBG_871X("bw mode: %d, channel: %d\n", padapter->mlmeextpriv.cur_bwmode, padapter->mlmeextpriv.cur_channel ); -+ DBG_871X("received bytes = %d\n", (u32) (padapter->recvpriv.rx_bytes - padapter->recvpriv.last_rx_bytes ) ); -+ } -+ DBG_871X("============ linked status check ===================\n"); -+ DBG_871X(" DIG PATH-A(0x%02x), PATH-B(0x%02x)\n",rtw_read8(padapter,0xc50),rtw_read8(padapter,0xc58)); -+ DBG_871X(" OFDM -Alarm DA2(0x%04x),DA4(0x%04x),DA6(0x%04x),DA8(0x%04x)\n", -+ rtw_read16(padapter,0xDA2),rtw_read16(padapter,0xDA4),rtw_read16(padapter,0xDA6),rtw_read16(padapter,0xDA8)); - +- - if (((pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS) && (pmlmeinfo->HT_enable)) || - ((pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE)) - { @@ -20252,68 +19757,35 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - { - psta->htpriv.candidate_tid_bitmap &= ~BIT(pparm->tid); - } -+ DBG_871X(" CCK -Alarm A5B(0x%02x),A5C(0x%02x)\n",rtw_read8(padapter,0xA5B),rtw_read8(padapter,0xA5C)); -+ DBG_871X(" FalseAlmCnt_all(%d)\n",padapter->recvpriv.FalseAlmCnt_all); - +- - return H2C_SUCCESS; - } - +-} +- -u8 set_tx_beacon_cmd(_adapter* padapter) -+u8 chk_ap_is_alive(_adapter *padapter, struct sta_info *psta) - { +-{ - struct cmd_obj *ph2c; - struct Tx_Beacon_param *ptxBeacon_parm; - struct cmd_priv *pcmdpriv = &(padapter->cmdpriv); -+ u8 ret = _FALSE; - struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; - struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); +- struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; +- struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); - u8 res = _SUCCESS; - int len_diff = 0; - -_func_enter_; - - if ((ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj))) == NULL) -+ -+ #ifdef DBG_EXPIRATION_CHK -+ DBG_871X(FUNC_ADPT_FMT" rx:"STA_PKTS_FMT", beacon:%llu, probersp_to_self:%llu" -+ /*", probersp_bm:%llu, probersp_uo:%llu, probereq:%llu, BI:%u"*/ -+ ", retry:%u\n" -+ , FUNC_ADPT_ARG(padapter) -+ , STA_RX_PKTS_DIFF_ARG(psta) -+ , psta->sta_stats.rx_beacon_pkts - psta->sta_stats.last_rx_beacon_pkts -+ , psta->sta_stats.rx_probersp_pkts - psta->sta_stats.last_rx_probersp_pkts -+ /*, psta->sta_stats.rx_probersp_bm_pkts - psta->sta_stats.last_rx_probersp_bm_pkts -+ , psta->sta_stats.rx_probersp_uo_pkts - psta->sta_stats.last_rx_probersp_uo_pkts -+ , psta->sta_stats.rx_probereq_pkts - psta->sta_stats.last_rx_probereq_pkts -+ , pmlmeinfo->bcn_interval*/ -+ , pmlmeext->retry -+ ); -+ -+ DBG_871X(FUNC_ADPT_FMT" tx_pkts:%llu, link_count:%u\n", FUNC_ADPT_ARG(padapter) -+ , padapter->xmitpriv.tx_pkts -+ , pmlmeinfo->link_count -+ ); -+ #endif -+ -+ if((sta_rx_data_pkts(psta) == sta_last_rx_data_pkts(psta)) -+ && sta_rx_beacon_pkts(psta) == sta_last_rx_beacon_pkts(psta) -+ && sta_rx_probersp_pkts(psta) == sta_last_rx_probersp_pkts(psta) -+ ) - { +- { - res= _FAIL; - goto exit; -+ ret = _FALSE; - } +- } - - if ((ptxBeacon_parm = (struct Tx_Beacon_param *)rtw_zmalloc(sizeof(struct Tx_Beacon_param))) == NULL) -+ else - { +- { - rtw_mfree((unsigned char *)ph2c, sizeof(struct cmd_obj)); - res= _FAIL; - goto exit; -+ ret = _TRUE; - } - +- } +- - _rtw_memcpy(&(ptxBeacon_parm->network), &(pmlmeinfo->network), sizeof(WLAN_BSSID_EX)); - - len_diff = update_hidden_ssid( @@ -20331,28 +19803,19 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release -exit: - -_func_exit_; -+ sta_update_last_rx_pkts(psta); - +- - return res; -+ return ret; - } - +-} +- - -u8 mlme_evt_hdl(_adapter *padapter, unsigned char *pbuf) -+void linked_status_chk(_adapter *padapter) - { +-{ - u8 evt_code, evt_seq; - u16 evt_sz; - uint *peventbuf; - void (*event_callback)(_adapter *dev, u8 *pbuf); - struct evt_priv *pevt_priv = &(padapter->evtpriv); -+ u32 i; -+ struct sta_info *psta; -+ struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); -+ struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; -+ struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); -+ struct sta_priv *pstapriv = &padapter->stapriv; - +- - peventbuf = (uint*)pbuf; - evt_sz = (u16)(*peventbuf&0xffff); - evt_seq = (u8)((*peventbuf>>24)&0x7f); @@ -20366,24 +19829,18 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - RT_TRACE(_module_rtl871x_cmd_c_,_drv_info_,("Evetn Seq Error! %d vs %d\n", (evt_seq & 0x7f), (ATOMIC_READ(&pevt_priv->event_seq) & 0x7f))); - - pevt_priv->event_seq = (evt_seq+1)&0x7f; -+ if(padapter->bRxRSSIDisplay) -+ _linked_rx_signal_strehgth_display(padapter); - +- - goto _abort_event_; - } -+ #ifdef DBG_CONFIG_ERROR_DETECT -+ rtw_hal_sreset_linked_status_check(padapter); - #endif - +- #endif +- - // checking if event code is valid - if (evt_code >= MAX_C2HEVT) -+ if (is_client_associated_to_ap(padapter)) - { +- { - RT_TRACE(_module_rtl871x_cmd_c_,_drv_err_,("\nEvent Code(%d) mismatch!\n", evt_code)); - goto _abort_event_; - } -+ //linked infrastructure client mode - +- - // checking if event size match the event parm size - if ((wlanevents[evt_code].parmsize != 0) && - (wlanevents[evt_code].parmsize != evt_sz)) @@ -20394,17 +19851,12 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - goto _abort_event_; - - } -+ int tx_chk = _SUCCESS, rx_chk = _SUCCESS; -+ int rx_chk_limit; - +- - ATOMIC_INC(&pevt_priv->event_seq); -+ #if defined(DBG_ROAMING_TEST) -+ rx_chk_limit = 1; -+ #elif defined(CONFIG_ACTIVE_KEEP_ALIVE_CHECK) -+ rx_chk_limit = 4; -+ #else -+ rx_chk_limit = 8; -+ #endif ++ if ((ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj))) == NULL) ++ { ++ goto exit_survey_timer_hdl; ++ } - peventbuf += 2; - @@ -20412,93 +19864,75 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - { - event_callback = wlanevents[evt_code].event_callback; - event_callback(padapter, (u8*)peventbuf); -+ // Marked by Kurt 20130715 -+ // For WiDi 3.5 and later on, they don't ask WiDi sink to do roaming, so we could not check rx limit that strictly. -+ // todo: To check why rx_chk would be _FALSE under miracast session. -+ //#ifdef CONFIG_INTEL_WIDI -+ //if (padapter->mlmepriv.widi_state != INTEL_WIDI_STATE_NONE) -+ // rx_chk_limit = 1; -+ //#endif -+ -+ if ((psta = rtw_get_stainfo(pstapriv, pmlmeinfo->network.MacAddress)) != NULL) ++ if ((psurveyPara = (struct sitesurvey_parm*)rtw_zmalloc(sizeof(struct sitesurvey_parm))) == NULL) + { -+ bool is_p2p_enable = _FALSE; -+ #ifdef CONFIG_P2P -+ is_p2p_enable = !rtw_p2p_chk_state(&padapter->wdinfo, P2P_STATE_NONE); -+ #endif -+ -+ if (chk_ap_is_alive(padapter, psta) == _FALSE) -+ rx_chk = _FAIL; ++ rtw_mfree((unsigned char *)ph2c, sizeof(struct cmd_obj)); ++ goto exit_survey_timer_hdl; ++ } - pevt_priv->evt_done_cnt++; -- } -+ if (pxmitpriv->last_tx_pkts == pxmitpriv->tx_pkts) -+ tx_chk = _FAIL; ++ init_h2fwcmd_w_parm_no_rsp(ph2c, psurveyPara, GEN_CMD_CODE(_SiteSurvey)); ++ rtw_enqueue_cmd(pcmdpriv, ph2c); + } -+ #ifdef CONFIG_ACTIVE_KEEP_ALIVE_CHECK -+ if (pmlmeext->active_keep_alive_check && (rx_chk == _FAIL || tx_chk == _FAIL)) { -+ u8 backup_oper_channel=0; -_abort_event_: -+ /* switch to correct channel of current network before issue keep-alive frames */ -+ if (rtw_get_oper_ch(padapter) != pmlmeext->cur_channel) { -+ backup_oper_channel = rtw_get_oper_ch(padapter); -+ SelectChannel(padapter, pmlmeext->cur_channel); -+ } - -+ if (rx_chk != _SUCCESS) -+ issue_probereq_ex(padapter, &pmlmeinfo->network.Ssid, psta->hwaddr, 3, 1); +- ++exit_survey_timer_hdl: ++#ifdef PLATFORM_FREEBSD ++ rtw_mtx_unlock(NULL); ++#endif - return H2C_SUCCESS; - --} -+ if ((tx_chk != _SUCCESS && pmlmeinfo->link_count++ == 0xf) || rx_chk != _SUCCESS) { -+ tx_chk = issue_nulldata(padapter, psta->hwaddr, 0, 3, 1); -+ /* if tx acked and p2p disabled, set rx_chk _SUCCESS to reset retry count */ -+ if (tx_chk == _SUCCESS && !is_p2p_enable) -+ rx_chk = _SUCCESS; -+ } ++ return; + } -u8 h2c_msg_hdl(_adapter *padapter, unsigned char *pbuf) --{ ++void link_timer_hdl(_adapter *padapter) + { - if(!pbuf) - return H2C_PARAMETERS_ERROR; -+ /* back to the original operation channel */ -+ if(backup_oper_channel>0) -+ SelectChannel(padapter, backup_oper_channel); - +- - return H2C_SUCCESS; -} -+ } -+ else -+ #endif /* CONFIG_ACTIVE_KEEP_ALIVE_CHECK */ -+ { -+ if (rx_chk != _SUCCESS) { -+ if (pmlmeext->retry == 0) { -+ #ifdef DBG_EXPIRATION_CHK -+ DBG_871X("issue_probereq to trigger probersp, retry=%d\n", pmlmeext->retry); -+ #endif -+ issue_probereq(padapter, &pmlmeinfo->network.Ssid, pmlmeinfo->network.MacAddress); -+ issue_probereq(padapter, &pmlmeinfo->network.Ssid, pmlmeinfo->network.MacAddress); -+ issue_probereq(padapter, &pmlmeinfo->network.Ssid, pmlmeinfo->network.MacAddress); -+ } -+ } ++ //static unsigned int rx_pkt = 0; ++ //static u64 tx_cnt = 0; ++ //struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); ++ struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; ++ struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); ++ //struct sta_priv *pstapriv = &padapter->stapriv; ++ ++#ifdef PLATFORM_FREEBSD ++ rtw_mtx_lock(NULL); ++ if (callout_pending(&padapter->mlmeextpriv.survey_timer.callout)) { ++ /* callout was reset */ ++ //mtx_unlock(&sc->sc_mtx); ++ rtw_mtx_unlock(NULL); ++ return; ++ } ++ if (!callout_active(&padapter->mlmeextpriv.survey_timer.callout)) { ++ /* callout was stopped */ ++ //mtx_unlock(&sc->sc_mtx); ++ rtw_mtx_unlock(NULL); ++ return; ++ } ++ callout_deactivate(&padapter->mlmeextpriv.survey_timer.callout); -+ if (tx_chk != _SUCCESS && pmlmeinfo->link_count++ == 0xf) { -+ #ifdef DBG_EXPIRATION_CHK -+ DBG_871X("%s issue_nulldata 0\n", __FUNCTION__); -+ #endif -+ tx_chk = issue_nulldata(padapter, NULL, 0, 1, 0); -+ } -+ } ++ ++#endif -u8 tx_beacon_hdl(_adapter *padapter, unsigned char *pbuf) -{ - if(send_beacon(padapter)==_FAIL) -- { ++ if (pmlmeinfo->state & WIFI_FW_AUTH_NULL) + { - DBG_871X("issue_beacon, fail!\n"); - return H2C_PARAMETERS_ERROR; -- } ++ DBG_871X("link_timer_hdl:no beacon while connecting\n"); ++ pmlmeinfo->state = WIFI_FW_NULL_STATE; ++ report_join_res(padapter, -3); + } -#ifdef CONFIG_AP_MODE - else //tx bc/mc frames after update TIM - { @@ -20507,7 +19941,24 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - _list *xmitframe_plist, *xmitframe_phead; - struct xmit_frame *pxmitframe=NULL; - struct sta_priv *pstapriv = &padapter->stapriv; -- ++ else if (pmlmeinfo->state & WIFI_FW_AUTH_STATE) ++ { ++ //re-auth timer ++ if (++pmlmeinfo->reauth_count > REAUTH_LIMIT) ++ { ++ //if (pmlmeinfo->auth_algo != dot11AuthAlgrthm_Auto) ++ //{ ++ pmlmeinfo->state = 0; ++ report_join_res(padapter, -1); ++ return; ++ //} ++ //else ++ //{ ++ // pmlmeinfo->auth_algo = dot11AuthAlgrthm_Shared; ++ // pmlmeinfo->reauth_count = 0; ++ //} ++ } + - //for BC/MC Frames - psta_bmc = rtw_get_bcmc_stainfo(padapter); - if(!psta_bmc) @@ -20519,31 +19970,67 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - rtw_msleep_os(10);// 10ms, ATIM(HIQ) Windows -#endif - _enter_critical_bh(&psta_bmc->sleep_q.lock, &irqL); -+ if (rx_chk == _FAIL) { -+ pmlmeext->retry++; -+ if (pmlmeext->retry > rx_chk_limit) { -+ DBG_871X(FUNC_ADPT_FMT" disconnect or roaming\n", -+ FUNC_ADPT_ARG(padapter)); -+ receive_disconnect(padapter, pmlmeinfo->network.MacAddress -+ , WLAN_REASON_EXPIRATION_CHK); -+ return; -+ } -+ } else { -+ pmlmeext->retry = 0; -+ } ++ DBG_871X("link_timer_hdl: auth timeout and try again\n"); ++ pmlmeinfo->auth_seq = 1; ++ issue_auth(padapter, NULL, 0); ++ set_link_timer(pmlmeext, REAUTH_TO); ++ } ++ else if (pmlmeinfo->state & WIFI_FW_ASSOC_STATE) ++ { ++ //re-assoc timer ++ if (++pmlmeinfo->reassoc_count > REASSOC_LIMIT) ++ { ++ pmlmeinfo->state = WIFI_FW_NULL_STATE; ++ report_join_res(padapter, -2); ++ return; ++ } - xmitframe_phead = get_list_head(&psta_bmc->sleep_q); - xmitframe_plist = get_next(xmitframe_phead); -+ if (tx_chk == _FAIL) { -+ pmlmeinfo->link_count &= 0xf; -+ } else { -+ pxmitpriv->last_tx_pkts = pxmitpriv->tx_pkts; -+ pmlmeinfo->link_count = 0; ++ DBG_871X("link_timer_hdl: assoc timeout and try again\n"); ++ issue_assocreq(padapter); ++ set_link_timer(pmlmeext, REASSOC_TO); ++ } ++#if 0 ++ else if (is_client_associated_to_ap(padapter)) ++ { ++ //linked infrastructure client mode ++ if ((psta = rtw_get_stainfo(pstapriv, pmlmeinfo->network.MacAddress)) != NULL) ++ { ++ /*to monitor whether the AP is alive or not*/ ++ if (rx_pkt == psta->sta_stats.rx_pkts) ++ { ++ receive_disconnect(padapter, pmlmeinfo->network.MacAddress); ++ return; ++ } ++ else ++ { ++ rx_pkt = psta->sta_stats.rx_pkts; ++ set_link_timer(pmlmeext, DISCONNECT_TO); + } - while ((rtw_end_of_queue_search(xmitframe_phead, xmitframe_plist)) == _FALSE) - { - pxmitframe = LIST_CONTAINOR(xmitframe_plist, struct xmit_frame, list); ++ //update the EDCA paramter according to the Tx/RX mode ++ update_EDCA_param(padapter); + +- xmitframe_plist = get_next(xmitframe_plist); ++ /*to send the AP a nulldata if no frame is xmitted in order to keep alive*/ ++ if (pmlmeinfo->link_count++ == 0) ++ { ++ tx_cnt = pxmitpriv->tx_pkts; ++ } ++ else if ((pmlmeinfo->link_count & 0xf) == 0) ++ { ++ if (tx_cnt == pxmitpriv->tx_pkts) ++ { ++ issue_nulldata(padapter, NULL, 0, 0, 0); ++ } + +- rtw_list_delete(&pxmitframe->list); ++ tx_cnt = pxmitpriv->tx_pkts; ++ } + } //end of if ((psta = rtw_get_stainfo(pstapriv, passoc_res->network.MacAddress)) != NULL) + } + else if (is_client_associated_to_ibss(padapter)) @@ -20556,28 +20043,13 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + { + psta = pmlmeinfo->FW_sta_info[i].psta; -- xmitframe_plist = get_next(xmitframe_plist); -+ if(NULL==psta) continue; - -- rtw_list_delete(&pxmitframe->list); -+ if (pmlmeinfo->FW_sta_info[i].rx_pkt == sta_rx_pkts(psta)) -+ { - - psta_bmc->sleepq_len--; - if(psta_bmc->sleepq_len>0) - pxmitframe->attrib.mdata = 1; -+ if(pmlmeinfo->FW_sta_info[i].retry<3) -+ { -+ pmlmeinfo->FW_sta_info[i].retry++; -+ } -+ else -+ { -+ pmlmeinfo->FW_sta_info[i].retry = 0; -+ pmlmeinfo->FW_sta_info[i].status = 0; -+ report_del_sta_event(padapter, psta->hwaddr -+ , 65535// indicate disconnect caused by no rx -+ ); -+ } ++ if (pmlmeinfo->FW_sta_info[i].rx_pkt == psta->sta_stats.rx_pkts) ++ { ++ pmlmeinfo->FW_sta_info[i].status = 0; ++ report_del_sta_event(padapter, psta->hwaddr); + } else - pxmitframe->attrib.mdata = 0; @@ -20590,8 +20062,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - { - rtw_os_xmit_complete(padapter, pxmitframe); + { -+ pmlmeinfo->FW_sta_info[i].retry = 0; -+ pmlmeinfo->FW_sta_info[i].rx_pkt = (u32)sta_rx_pkts(psta); ++ pmlmeinfo->FW_sta_info[i].rx_pkt = psta->sta_stats.rx_pkts; } - - //pstapriv->tim_bitmap &= ~BIT(0); @@ -20603,115 +20074,89 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + } } -+ //set_link_timer(pmlmeext, DISCONNECT_TO); -+ ++ set_link_timer(pmlmeext, DISCONNECT_TO); } --#endif + #endif - return H2C_SUCCESS; - - } +-} ++#ifdef PLATFORM_FREEBSD ++ rtw_mtx_unlock(NULL); ++#endif -#ifdef CONFIG_AP_MODE -- ++ return; ++} + -void init_mlme_ap_info(_adapter *padapter) -+void survey_timer_hdl(_adapter *padapter) ++void addba_timer_hdl(struct sta_info *psta) { - struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; - struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); -+ struct cmd_obj *ph2c; -+ struct sitesurvey_parm *psurveyPara; -+ struct cmd_priv *pcmdpriv=&padapter->cmdpriv; -+ struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; -+#ifdef CONFIG_P2P -+ struct wifidirect_info *pwdinfo= &(padapter->wdinfo); -+#endif - +- - _rtw_spinlock_init(&pmlmepriv->bcn_update_lock); -+ //DBG_871X("marc: survey timer\n"); -+#ifdef PLATFORM_FREEBSD -+ rtw_mtx_lock(NULL); -+ if (callout_pending(&padapter->mlmeextpriv.survey_timer.callout)) { -+ /* callout was reset */ -+ //mtx_unlock(&sc->sc_mtx); -+ rtw_mtx_unlock(NULL); -+ return; -+ } -+ if (!callout_active(&padapter->mlmeextpriv.survey_timer.callout)) { -+ /* callout was stopped */ -+ //mtx_unlock(&sc->sc_mtx); -+ rtw_mtx_unlock(NULL); -+ return; -+ } -+ callout_deactivate(&padapter->mlmeextpriv.survey_timer.callout); ++ struct ht_priv *phtpriv; - //pmlmeext->bstart_bss = _FALSE; ++ if(!psta) ++ return; ++ ++ phtpriv = &psta->htpriv; - start_ap_mode(padapter); --} -+#endif ++ if((phtpriv->ht_option==_TRUE) && (phtpriv->ampdu_enable==_TRUE)) ++ { ++ if(phtpriv->candidate_tid_bitmap) ++ phtpriv->candidate_tid_bitmap=0x0; ++ ++ } + } -void free_mlme_ap_info(_adapter *padapter) --{ -- _irqL irqL; ++#ifdef CONFIG_IEEE80211W ++void sa_query_timer_hdl(_adapter *padapter) + { ++ struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; ++ struct mlme_priv * pmlmepriv = &padapter->mlmepriv; + _irqL irqL; - struct sta_info *psta=NULL; - struct sta_priv *pstapriv = &padapter->stapriv; - struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); - struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; - struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); -+ //issue rtw_sitesurvey_cmd -+ if (pmlmeext->sitesurvey_res.state > SCAN_START) -+ { -+ if(pmlmeext->sitesurvey_res.state == SCAN_PROCESS) -+ { -+#ifdef CONFIG_STA_MODE_SCAN_UNDER_AP_MODE -+ if( padapter->mlmeextpriv.mlmext_info.scan_cnt != RTW_SCAN_NUM_OF_CH ) -+#endif //CONFIG_STA_MODE_SCAN_UNDER_AP_MODE -+ pmlmeext->sitesurvey_res.channel_idx++; -+ } ++ //disconnect ++ _enter_critical_bh(&pmlmepriv->lock, &irqL); - //stop_ap_mode(padapter); -+ if(pmlmeext->scan_abort == _TRUE) -+ { -+ #ifdef CONFIG_P2P -+ if(!rtw_p2p_chk_state(&padapter->wdinfo, P2P_STATE_NONE)) -+ { -+ rtw_p2p_findphase_ex_set(pwdinfo, P2P_FINDPHASE_EX_MAX); -+ pmlmeext->sitesurvey_res.channel_idx = 3; -+ DBG_871X("%s idx:%d, cnt:%u\n", __FUNCTION__ -+ , pmlmeext->sitesurvey_res.channel_idx -+ , pwdinfo->find_phase_state_exchange_cnt -+ ); -+ } -+ else -+ #endif -+ { -+ pmlmeext->sitesurvey_res.channel_idx = pmlmeext->sitesurvey_res.ch_num; -+ DBG_871X("%s idx:%d\n", __FUNCTION__ -+ , pmlmeext->sitesurvey_res.channel_idx -+ ); -+ } ++ if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE) ++ { ++ rtw_disassoc_cmd(padapter, 0, _TRUE); ++ rtw_indicate_disconnect(padapter); ++ rtw_free_assoc_resources(padapter, 1); ++ } - pmlmepriv->update_bcn = _FALSE; - pmlmeext->bstart_bss = _FALSE; - - rtw_sta_flush(padapter); -+ pmlmeext->scan_abort = _FALSE;//reset -+ } ++ _exit_critical_bh(&pmlmepriv->lock, &irqL); ++ DBG_871X("SA query timeout disconnect\n"); ++} ++#endif //CONFIG_IEEE80211W - pmlmeinfo->state = _HW_STATE_NOLINK_; -+ if ((ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj))) == NULL) -+ { -+ goto exit_survey_timer_hdl; -+ } ++u8 NULL_hdl(_adapter *padapter, u8 *pbuf) ++{ ++ return H2C_SUCCESS; ++} - //free_assoc_sta_resources - rtw_free_all_stainfo(padapter); -+ if ((psurveyPara = (struct sitesurvey_parm*)rtw_zmalloc(sizeof(struct sitesurvey_parm))) == NULL) -+ { -+ rtw_mfree((unsigned char *)ph2c, sizeof(struct cmd_obj)); -+ goto exit_survey_timer_hdl; -+ } ++#ifdef CONFIG_AUTO_AP_MODE ++void rtw_start_auto_ap(_adapter *adapter) ++{ ++ DBG_871X("%s\n", __FUNCTION__); - //free bc/mc sta_info - psta = rtw_get_bcmc_stainfo(padapter); @@ -20719,23 +20164,15 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - rtw_free_stainfo(padapter, psta); - _exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL); - -+ init_h2fwcmd_w_parm_no_rsp(ph2c, psurveyPara, GEN_CMD_CODE(_SiteSurvey)); -+ rtw_enqueue_cmd(pcmdpriv, ph2c); -+ } ++ rtw_set_802_11_infrastructure_mode(adapter, Ndis802_11APMode); - _rtw_spinlock_free(&pmlmepriv->bcn_update_lock); - -+ -+exit_survey_timer_hdl: -+#ifdef PLATFORM_FREEBSD -+ rtw_mtx_unlock(NULL); -+#endif -+ -+ return; ++ rtw_setopmode_cmd(adapter, Ndis802_11APMode); } -static void update_BCNTIM(_adapter *padapter) -+void link_timer_hdl(_adapter *padapter) ++static int rtw_auto_ap_start_beacon(_adapter *adapter) { - struct sta_priv *pstapriv = &padapter->stapriv; - struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); @@ -20755,116 +20192,70 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - u8 *p, ie_len; - u16 tim_bitmap_le; - u32 tmp_len, head_len=0; -+ //static unsigned int rx_pkt = 0; -+ //static u64 tx_cnt = 0; -+ //struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); -+ struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; -+ struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); -+ //struct sta_priv *pstapriv = &padapter->stapriv; -+ -+#ifdef PLATFORM_FREEBSD -+ rtw_mtx_lock(NULL); -+ if (callout_pending(&padapter->mlmeextpriv.survey_timer.callout)) { -+ /* callout was reset */ -+ //mtx_unlock(&sc->sc_mtx); -+ rtw_mtx_unlock(NULL); -+ return; -+ } -+ if (!callout_active(&padapter->mlmeextpriv.survey_timer.callout)) { -+ /* callout was stopped */ -+ //mtx_unlock(&sc->sc_mtx); -+ rtw_mtx_unlock(NULL); -+ return; -+ } -+ callout_deactivate(&padapter->mlmeextpriv.survey_timer.callout); ++ int ret=0; ++ u8 *pbuf = NULL; ++ uint len; ++ u8 supportRate[16]; ++ int sz = 0, rateLen; ++ u8 * ie; ++ u8 wireless_mode, oper_channel; ++ u8 ssid[3] = {0}; //hidden ssid ++ u32 ssid_len = sizeof(ssid); ++ struct mlme_priv *pmlmepriv = &(adapter->mlmepriv); - tim_bitmap_le = cpu_to_le16(pstapriv->tim_bitmap); - +- - //calucate head_len - head_len = _FIXED_IE_LENGTH_; - head_len += pnetwork->Ssid.SsidLength + 2; -+#endif - // get supported rates len - p = rtw_get_ie(src_ie + _BEACON_IE_OFFSET_, _SUPPORTEDRATES_IE_, &tmp_len, (pnetwork->IELength - _BEACON_IE_OFFSET_)); - if (p != NULL) - { - head_len += tmp_len+2; -+ if (pmlmeinfo->state & WIFI_FW_AUTH_NULL) -+ { -+ DBG_871X("link_timer_hdl:no beacon while connecting\n"); -+ pmlmeinfo->state = WIFI_FW_NULL_STATE; -+ report_join_res(padapter, -3); -+ } -+ else if (pmlmeinfo->state & WIFI_FW_AUTH_STATE) -+ { -+ //re-auth timer -+ if (++pmlmeinfo->reauth_count > REAUTH_LIMIT) -+ { -+ //if (pmlmeinfo->auth_algo != dot11AuthAlgrthm_Auto) -+ //{ -+ pmlmeinfo->state = 0; -+ report_join_res(padapter, -1); -+ return; -+ //} -+ //else -+ //{ -+ // pmlmeinfo->auth_algo = dot11AuthAlgrthm_Shared; -+ // pmlmeinfo->reauth_count = 0; -+ //} - } -- +- } ++ if(check_fwstate(pmlmepriv, WIFI_AP_STATE) != _TRUE) ++ return -EINVAL; + - //DS Parameter Set IE, len=3 - head_len += 3; -- + - //copy head offset - _rtw_memcpy(dst_ie, src_ie, head_len); - -+ DBG_871X("link_timer_hdl: auth timeout and try again\n"); -+ pmlmeinfo->auth_seq = 1; -+ issue_auth(padapter, NULL, 0); -+ set_link_timer(pmlmeext, REAUTH_TO); -+ } -+ else if (pmlmeinfo->state & WIFI_FW_ASSOC_STATE) -+ { -+ //re-assoc timer -+ if (++pmlmeinfo->reassoc_count > REASSOC_LIMIT) -+ { -+ pmlmeinfo->state = WIFI_FW_NULL_STATE; -+ report_join_res(padapter, -2); -+ return; -+ } +- ++ len = 128; ++ pbuf = rtw_zmalloc(len); ++ if(!pbuf) ++ return -ENOMEM; - //append TIM IE from head_len offset - dst_ie+=head_len; -- + - *dst_ie++=_TIM_IE_; -- ++ //generate beacon ++ ie = pbuf; + - if((pstapriv->tim_bitmap&0xff00) && (pstapriv->tim_bitmap&0x00fc)) - ie_len = 5; - else - ie_len = 4; -+ DBG_871X("link_timer_hdl: assoc timeout and try again\n"); -+ issue_assocreq(padapter); -+ set_link_timer(pmlmeext, REASSOC_TO); -+ } -+#if 0 -+ else if (is_client_associated_to_ap(padapter)) -+ { -+ //linked infrastructure client mode -+ if ((psta = rtw_get_stainfo(pstapriv, pmlmeinfo->network.MacAddress)) != NULL) -+ { -+ /*to monitor whether the AP is alive or not*/ -+ if (rx_pkt == psta->sta_stats.rx_pkts) -+ { -+ receive_disconnect(padapter, pmlmeinfo->network.MacAddress); -+ return; -+ } -+ else -+ { -+ rx_pkt = psta->sta_stats.rx_pkts; -+ set_link_timer(pmlmeext, DISCONNECT_TO); -+ } ++ //timestamp will be inserted by hardware ++ sz += 8; ++ ie += sz; ++ ++ //beacon interval : 2bytes ++ *(u16*)ie = cpu_to_le16((u16)100);//BCN_INTERVAL=100; ++ sz += 2; ++ ie += 2; ++ ++ //capability info ++ *(u16*)ie = 0; ++ *(u16*)ie |= cpu_to_le16(cap_ESS); ++ *(u16*)ie |= cpu_to_le16(cap_ShortPremble); ++ //*(u16*)ie |= cpu_to_le16(cap_Privacy); ++ sz += 2; ++ ie += 2; - *dst_ie++= ie_len; - @@ -20875,8 +20266,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - *dst_ie++ = BIT(0);//bitmap ctrl - else - *dst_ie++ = 0; -+ //update the EDCA paramter according to the Tx/RX mode -+ update_EDCA_param(padapter); ++ //SSID ++ ie = rtw_set_ie(ie, _SSID_IE_, ssid_len, ssid, &sz); - if(ie_len==4) - { @@ -20890,91 +20281,80 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - - //copy remainder IE - _rtw_memcpy(dst_ie, src_ie+head_len, src_ielen-head_len); -+ /*to send the AP a nulldata if no frame is xmitted in order to keep alive*/ -+ if (pmlmeinfo->link_count++ == 0) -+ { -+ tx_cnt = pxmitpriv->tx_pkts; -+ } -+ else if ((pmlmeinfo->link_count & 0xf) == 0) -+ { -+ if (tx_cnt == pxmitpriv->tx_pkts) -+ { -+ issue_nulldata(padapter, NULL, 0, 0, 0); -+ } ++ //supported rates ++ wireless_mode = WIRELESS_11BG_24N; ++ rtw_set_supported_rate(supportRate, wireless_mode) ; ++ rateLen = rtw_get_rateset_len(supportRate); ++ if (rateLen > 8) ++ { ++ ie = rtw_set_ie(ie, _SUPPORTEDRATES_IE_, 8, supportRate, &sz); ++ } ++ else ++ { ++ ie = rtw_set_ie(ie, _SUPPORTEDRATES_IE_, rateLen, supportRate, &sz); ++ } ++ ++ ++ //DS parameter set ++ if(check_buddy_fwstate(adapter, _FW_LINKED) && ++ check_buddy_fwstate(adapter, WIFI_STATION_STATE)) ++ { ++ PADAPTER pbuddy_adapter = adapter->pbuddy_adapter; ++ struct mlme_ext_priv *pbuddy_mlmeext = &pbuddy_adapter->mlmeextpriv; ++ ++ oper_channel = pbuddy_mlmeext->cur_channel; ++ } ++ else ++ { ++ oper_channel = adapter_to_dvobj(adapter)->oper_channel; ++ } ++ ie = rtw_set_ie(ie, _DSSET_IE_, 1, &oper_channel, &sz); ++ ++ //ext supported rates ++ if (rateLen > 8) ++ { ++ ie = rtw_set_ie(ie, _EXT_SUPPORTEDRATES_IE_, (rateLen - 8), (supportRate + 8), &sz); ++ } ++ ++ DBG_871X("%s, start auto ap beacon sz=%d\n", __FUNCTION__, sz); ++ ++ //lunch ap mode & start to issue beacon ++ if(rtw_check_beacon_data(adapter, pbuf, sz) == _SUCCESS) ++ { - //pnetwork_mlmeext->Length += ie_len+2; - //pnetwork_mlmeext->IELength += ie_len+2; - pnetwork_mlmeext->Length = pnetwork->Length+ie_len+2; - pnetwork_mlmeext->IELength = src_ielen+ie_len+2; - -+ tx_cnt = pxmitpriv->tx_pkts; -+ } -+ } //end of if ((psta = rtw_get_stainfo(pstapriv, passoc_res->network.MacAddress)) != NULL) } -- else -+ else if (is_client_associated_to_ibss(padapter)) + else { - _rtw_memcpy(dst_ie, src_ie, src_ielen); - pnetwork_mlmeext->Length = pnetwork->Length; - pnetwork_mlmeext->IELength = src_ielen; -+ //linked IBSS mode -+ //for each assoc list entry to check the rx pkt counter -+ for (i = IBSS_START_MAC_ID; i < NUM_STA; i++) -+ { -+ if (pmlmeinfo->FW_sta_info[i].status == 1) -+ { -+ psta = pmlmeinfo->FW_sta_info[i].psta; -+ -+ if (pmlmeinfo->FW_sta_info[i].rx_pkt == psta->sta_stats.rx_pkts) -+ { -+ pmlmeinfo->FW_sta_info[i].status = 0; -+ report_del_sta_event(padapter, psta->hwaddr); -+ } -+ else -+ { -+ pmlmeinfo->FW_sta_info[i].rx_pkt = psta->sta_stats.rx_pkts; -+ } -+ } -+ } -+ -+ set_link_timer(pmlmeext, DISCONNECT_TO); ++ ret = -EINVAL; } -+#endif -#ifdef CONFIG_USB_HCI - set_tx_beacon_cmd(padapter); -+#ifdef PLATFORM_FREEBSD -+ rtw_mtx_unlock(NULL); - #endif +-#endif -+ return; -+} ++ rtw_mfree(pbuf, len); -/* - if(send_beacon(padapter)==_FAIL) -+void addba_timer_hdl(struct sta_info *psta) -+{ -+ struct ht_priv *phtpriv; -+ -+ if(!psta) -+ return; -+ -+ phtpriv = &psta->htpriv; -+ -+ if((phtpriv->ht_option==_TRUE) && (phtpriv->ampdu_enable==_TRUE)) - { +- { - DBG_871X("issue_beacon, fail!\n"); -+ if(phtpriv->candidate_tid_bitmap) -+ phtpriv->candidate_tid_bitmap=0x0; -+ - } +- } -*/ -- ++ return ret; + } ++#endif//CONFIG_AUTO_AP_MODE -u8 chk_sta_is_alive(struct sta_info *psta) -+#ifdef CONFIG_IEEE80211W -+void sa_query_timer_hdl(_adapter *padapter) ++u8 setopmode_hdl(_adapter *padapter, u8 *pbuf) { - u8 ret = _FALSE; - #ifdef DBG_EXPIRATION_CHK @@ -20984,57 +20364,64 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - , psta->state&WIFI_SLEEP_STATE?"SLEEP":"" - ); - #endif ++ u8 type; + struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; -+ struct mlme_priv * pmlmepriv = &padapter->mlmepriv; -+ _irqL irqL; -+ //disconnect -+ _enter_critical_bh(&pmlmepriv->lock, &irqL); ++ struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); ++ struct setopmode_parm *psetop = (struct setopmode_parm *)pbuf; - //if(sta_last_rx_pkts(psta) == sta_rx_pkts(psta)) - if(psta->sta_stats.last_rx_data_pkts == psta->sta_stats.rx_data_pkts) -- { ++ if(psetop->mode == Ndis802_11APMode) + { - #if 0 - if(psta->state&WIFI_SLEEP_STATE) - ret = _TRUE; - #endif -- } -- else -+ if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE) ++ pmlmeinfo->state = WIFI_FW_AP_STATE; ++ type = _HW_STATE_AP_; ++#ifdef CONFIG_NATIVEAP_MLME ++ //start_ap_mode(padapter); ++#endif ++ } ++ else if(psetop->mode == Ndis802_11Infrastructure) ++ { ++ pmlmeinfo->state &= ~(BIT(0)|BIT(1));// clear state ++ pmlmeinfo->state |= WIFI_FW_STATION_STATE;//set to STATION_STATE ++ type = _HW_STATE_STATION_; ++ } ++ else if(psetop->mode == Ndis802_11IBSS) ++ { ++ type = _HW_STATE_ADHOC_; + } + else { - ret = _TRUE; -+ rtw_disassoc_cmd(padapter, 0, _TRUE); -+ rtw_indicate_disconnect(padapter); -+ rtw_free_assoc_resources(padapter, 1); ++ type = _HW_STATE_NOLINK_; } - - sta_update_last_rx_pkts(psta); - +- - return ret; -+ _exit_critical_bh(&pmlmepriv->lock, &irqL); -+ DBG_871X("SA query timeout disconnect\n"); - } -+#endif //CONFIG_IEEE80211W - +-} +- -void expire_timeout_chk(_adapter *padapter) -+u8 NULL_hdl(_adapter *padapter, u8 *pbuf) - { +-{ - _irqL irqL; - _list *phead, *plist; - struct sta_info *psta=NULL; - struct sta_priv *pstapriv = &padapter->stapriv; -+ return H2C_SUCCESS; -+} -+#ifdef CONFIG_AUTO_AP_MODE -+void rtw_start_auto_ap(_adapter *adapter) -+{ -+ DBG_871X("%s\n", __FUNCTION__); ++ rtw_hal_set_hwreg(padapter, HW_VAR_SET_OPMODE, (u8 *)(&type)); ++ //Set_NETYPE0_MSR(padapter, type); - _enter_critical_bh(&pstapriv->auth_list_lock, &irqL); - - phead = &pstapriv->auth_list; - plist = get_next(phead); -+ rtw_set_802_11_infrastructure_mode(adapter, Ndis802_11APMode); ++#ifdef CONFIG_AUTO_AP_MODE ++ if(psetop->mode == Ndis802_11APMode) ++ rtw_auto_ap_start_beacon(padapter); ++#endif - //check auth_queue - while ((rtw_end_of_queue_search(phead, plist)) == _FALSE) @@ -21042,7 +20429,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - psta = LIST_CONTAINOR(plist, struct sta_info, auth_list); - - plist = get_next(plist); -- ++ return H2C_SUCCESS; + - if(psta->expire_to>0) - { - psta->expire_to--; @@ -21064,52 +20452,50 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - } - - } -+ rtw_setopmode_cmd(adapter, Ndis802_11APMode); -+} - +- - _exit_critical_bh(&pstapriv->auth_list_lock, &irqL); -+static int rtw_auto_ap_start_beacon(_adapter *adapter) -+{ -+ int ret=0; -+ u8 *pbuf = NULL; -+ uint len; -+ u8 supportRate[16]; -+ int sz = 0, rateLen; -+ u8 * ie; -+ u8 wireless_mode, oper_channel; -+ u8 ssid[3] = {0}; //hidden ssid -+ u32 ssid_len = sizeof(ssid); -+ struct mlme_priv *pmlmepriv = &(adapter->mlmepriv); ++} - psta = NULL; - ++u8 createbss_hdl(_adapter *padapter, u8 *pbuf) ++{ ++ struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; ++ struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); ++ WLAN_BSSID_EX *pnetwork = (WLAN_BSSID_EX*)(&(pmlmeinfo->network)); ++ struct joinbss_parm *pparm = (struct joinbss_parm *)pbuf; ++ u32 initialgain; - _enter_critical_bh(&pstapriv->asoc_list_lock, &irqL); -- + - phead = &pstapriv->asoc_list; - plist = get_next(phead); -+ if(check_fwstate(pmlmepriv, WIFI_AP_STATE) != _TRUE) -+ return -EINVAL; - +- - //check asoc_queue - while ((rtw_end_of_queue_search(phead, plist)) == _FALSE) -- { ++ if(pparm->network.InfrastructureMode == Ndis802_11APMode) + { - psta = LIST_CONTAINOR(plist, struct sta_info, asoc_list); - - plist = get_next(plist); -- ++#ifdef CONFIG_AP_MODE + - if(chk_sta_is_alive(psta)) - { - psta->expire_to = pstapriv->expire_to; -#ifdef CONFIG_TX_MCAST2UNI - psta->under_exist_checking = 0; -#endif // CONFIG_TX_MCAST2UNI -- } ++ if(pmlmeinfo->state == WIFI_FW_AP_STATE) ++ { ++ //todo: ++ return H2C_SUCCESS; + } - - if(psta->expire_to>0) - { - psta->expire_to--; - +- -#ifdef CONFIG_TX_MCAST2UNI - if ( (psta->flags & WLAN_STA_HT) && (psta->htpriv.agg_enable_bitmap || psta->under_exist_checking) ) { - // check sta by delba(addba) for 11n STA @@ -21130,10 +20516,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - } - } -#endif // CONFIG_TX_MCAST2UNI -+ len = 128; -+ pbuf = rtw_zmalloc(len); -+ if(!pbuf) -+ return -ENOMEM; ++#endif ++ } - if (psta->expire_to == 0) - { @@ -21146,14 +20530,30 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release -#if 0 - //tear down Rx AMPDU - send_delba(padapter, 0, psta->hwaddr);// recipient -- ++ //below is for ad-hoc master ++ if(pparm->network.InfrastructureMode == Ndis802_11IBSS) ++ { ++ rtw_joinbss_reset(padapter); + - //tear down TX AMPDU - send_delba(padapter, 1, psta->hwaddr);// // originator - psta->htpriv.agg_enable_bitmap = 0x0;//reset - psta->htpriv.candidate_tid_bitmap = 0x0;//reset -- ++ pmlmeext->cur_bwmode = HT_CHANNEL_WIDTH_20; ++ pmlmeext->cur_ch_offset= HAL_PRIME_CHNL_OFFSET_DONT_CARE; ++ pmlmeinfo->ERP_enable = 0; ++ pmlmeinfo->WMM_enable = 0; ++ pmlmeinfo->HT_enable = 0; ++ pmlmeinfo->HT_caps_enable = 0; ++ pmlmeinfo->HT_info_enable = 0; ++ pmlmeinfo->agg_enable_bitmap = 0; ++ pmlmeinfo->candidate_tid_bitmap = 0; + - issue_deauth(padapter, psta->hwaddr, WLAN_REASON_DEAUTH_LEAVING); -- ++ //disable dynamic functions, such as high power, DIG ++ Save_DM_Func_Flag(padapter); ++ Switch_DM_Func(padapter, DYNAMIC_FUNC_DISABLE, _FALSE); + - _enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL); - rtw_free_stainfo(padapter, psta); - _exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL); @@ -21174,28 +20574,20 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - } - - } ++ //config the initial gain under linking, need to write the BB registers ++ initialgain = 0x1E; ++ rtw_hal_set_hwreg(padapter, HW_VAR_INITIAL_GAIN, (u8 *)(&initialgain)); - _exit_critical_bh(&pstapriv->asoc_list_lock, &irqL); -+ //generate beacon -+ ie = pbuf; ++ //cancel link timer ++ _cancel_timer_ex(&pmlmeext->link_timer); -} -+ //timestamp will be inserted by hardware -+ sz += 8; -+ ie += sz; ++ //clear CAM ++ flush_all_cam_entry(padapter); -+ //beacon interval : 2bytes -+ *(u16*)ie = cpu_to_le16((u16)100);//BCN_INTERVAL=100; -+ sz += 2; -+ ie += 2; -+ -+ //capability info -+ *(u16*)ie = 0; -+ *(u16*)ie |= cpu_to_le16(cap_ESS); -+ *(u16*)ie |= cpu_to_le16(cap_ShortPremble); -+ //*(u16*)ie |= cpu_to_le16(cap_Privacy); -+ sz += 2; -+ ie += 2; ++ _rtw_memcpy(pnetwork, pbuf, FIELD_OFFSET(WLAN_BSSID_EX, IELength)); ++ pnetwork->IELength = ((WLAN_BSSID_EX *)pbuf)->IELength; -static void add_RATid(_adapter *padapter, struct sta_info *psta) -{ @@ -21208,76 +20600,69 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - struct ht_priv *psta_ht = NULL; - struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); - WLAN_BSSID_EX *pcur_network = (WLAN_BSSID_EX *)&pmlmepriv->cur_network.network; -+ //SSID -+ ie = rtw_set_ie(ie, _SSID_IE_, ssid_len, ssid, &sz); ++ if(pnetwork->IELength>MAX_IE_SZ)//Check pbuf->IELength ++ return H2C_PARAMETERS_ERROR; -- ++ _rtw_memcpy(pnetwork->IEs, ((WLAN_BSSID_EX *)pbuf)->IEs, pnetwork->IELength); + - if(psta) - psta_ht = &psta->htpriv; -+ //supported rates -+ wireless_mode = WIRELESS_11BG_24N; -+ rtw_set_supported_rate(supportRate, wireless_mode) ; -+ rateLen = rtw_get_rateset_len(supportRate); -+ if (rateLen > 8) -+ { -+ ie = rtw_set_ie(ie, _SUPPORTEDRATES_IE_, 8, supportRate, &sz); -+ } - else +- else - return; - - //b/g mode ra_bitmap - for (i=0; ibssrateset); i++) - { +- { - if (psta->bssrateset[i]) - tx_ra_bitmap |= rtw_get_bit_value_from_ieee_value(psta->bssrateset[i]&0x7f); -+ ie = rtw_set_ie(ie, _SUPPORTEDRATES_IE_, rateLen, supportRate, &sz); - } +- } ++ start_create_ibss(padapter); - //n mode ra_bitmap - if(psta_ht->ht_option) -+ -+ //DS parameter set -+ if(check_buddy_fwstate(adapter, _FW_LINKED) && -+ check_buddy_fwstate(adapter, WIFI_STATION_STATE)) - { +- { - padapter->HalFunc.GetHwRegHandler(padapter, HW_VAR_RF_TYPE, (u8 *)(&rf_type)); - if(rf_type == RF_2T2R) - limit=16;// 2R - else - limit=8;// 1R -+ PADAPTER pbuddy_adapter = adapter->pbuddy_adapter; -+ struct mlme_ext_priv *pbuddy_mlmeext = &pbuddy_adapter->mlmeextpriv; ++ } - for (i=0; iht_cap.supp_mcs_set[i/8] & BIT(i%8)) - tx_ra_bitmap |= BIT(i+12); - } -+ oper_channel = pbuddy_mlmeext->cur_channel; -+ } -+ else -+ { -+ oper_channel = adapter_to_dvobj(adapter)->oper_channel; -+ } -+ ie = rtw_set_ie(ie, _DSSET_IE_, 1, &oper_channel, &sz); ++ return H2C_SUCCESS; - //max short GI rate - shortGIrate = psta_ht->sgi; -+ //ext supported rates -+ if (rateLen > 8) -+ { -+ ie = rtw_set_ie(ie, _EXT_SUPPORTEDRATES_IE_, (rateLen - 8), (supportRate + 8), &sz); - } +- } ++} -+ DBG_871X("%s, start auto ap beacon sz=%d\n", __FUNCTION__, sz); ++u8 join_cmd_hdl(_adapter *padapter, u8 *pbuf) ++{ ++ u8 join_type; ++ PNDIS_802_11_VARIABLE_IEs pIE; ++ struct registry_priv *pregpriv = &padapter->registrypriv; ++ struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; ++ struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); ++ WLAN_BSSID_EX *pnetwork = (WLAN_BSSID_EX*)(&(pmlmeinfo->network)); ++#ifdef CONFIG_ANTENNA_DIVERSITY ++ struct joinbss_parm *pparm = (struct joinbss_parm *)pbuf; ++#endif //CONFIG_ANTENNA_DIVERSITY ++ u32 initialgain, i; ++ u8 cbw40_enable=0; ++ //u32 acparm; -#if 0//gtest - if(get_rf_mimo_mode(padapter) == RTL8712_RF_2T2R) -+ //lunch ap mode & start to issue beacon -+ if(rtw_check_beacon_data(adapter, pbuf, sz) == _SUCCESS) ++ //check already connecting to AP or not ++ if (pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS) { - //is this a 2r STA? - if((pstat->tx_ra_bitmap & 0x0ff00000) != 0 && !(priv->pshare->has_2r_sta & BIT(pstat->aid))) -- { ++ if (pmlmeinfo->state & WIFI_FW_STATION_STATE) + { - priv->pshare->has_2r_sta |= BIT(pstat->aid); - if(rtw_read16(padapter, 0x102501f6) != 0xffff) - { @@ -21297,13 +20682,58 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - Switch_1SS_Antenna(priv, 2); - } - } -- } -- -- } ++ issue_deauth_ex(padapter, pnetwork->MacAddress, WLAN_REASON_DEAUTH_LEAVING, 5, 100); + } ++ ++ pmlmeinfo->state = WIFI_FW_NULL_STATE; ++ ++ //clear CAM ++ flush_all_cam_entry(padapter); ++ ++ _cancel_timer_ex(&pmlmeext->link_timer); ++ ++ //set MSR to nolink -> infra. mode ++ //Set_MSR(padapter, _HW_STATE_NOLINK_); ++ Set_MSR(padapter, _HW_STATE_STATION_); + ++ ++ rtw_hal_set_hwreg(padapter, HW_VAR_MLME_DISCONNECT, 0); + } - if ((pstat->rssi_level < 1) || (pstat->rssi_level > 3)) -+ } -+ else ++#ifdef CONFIG_ANTENNA_DIVERSITY ++ rtw_antenna_select_cmd(padapter, pparm->network.PhyInfo.Optimum_antenna, _FALSE); ++#endif ++ ++ rtw_joinbss_reset(padapter); ++ ++ pmlmeext->cur_bwmode = HT_CHANNEL_WIDTH_20; ++ pmlmeext->cur_ch_offset= HAL_PRIME_CHNL_OFFSET_DONT_CARE; ++ pmlmeinfo->ERP_enable = 0; ++ pmlmeinfo->WMM_enable = 0; ++ pmlmeinfo->HT_enable = 0; ++ pmlmeinfo->HT_caps_enable = 0; ++ pmlmeinfo->HT_info_enable = 0; ++ pmlmeinfo->agg_enable_bitmap = 0; ++ pmlmeinfo->candidate_tid_bitmap = 0; ++ pmlmeinfo->bwmode_updated = _FALSE; ++ //pmlmeinfo->assoc_AP_vendor = maxAP; ++ ++ _rtw_memcpy(pnetwork, pbuf, FIELD_OFFSET(WLAN_BSSID_EX, IELength)); ++ pnetwork->IELength = ((WLAN_BSSID_EX *)pbuf)->IELength; ++ ++ if(pnetwork->IELength>MAX_IE_SZ)//Check pbuf->IELength ++ return H2C_PARAMETERS_ERROR; ++ ++ _rtw_memcpy(pnetwork->IEs, ((WLAN_BSSID_EX *)pbuf)->IEs, pnetwork->IELength); ++ ++ pmlmeext->cur_channel = (u8)pnetwork->Configuration.DSConfig; ++ pmlmeinfo->bcn_interval = get_beacon_interval(pnetwork); ++ ++ //Check AP vendor to move rtw_joinbss_cmd() ++ //pmlmeinfo->assoc_AP_vendor = check_assoc_AP(pnetwork->IEs, pnetwork->IELength); ++ ++ for (i = sizeof(NDIS_802_11_FIXED_IEs); i < pnetwork->IELength;) { - if (pstat->rssi >= priv->pshare->rf_ft_var.raGoDownUpper) - pstat->rssi_level = 1; @@ -21314,8 +20744,59 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - pstat->rssi_level = 2; - else - pstat->rssi_level = 3; -+ ret = -EINVAL; - } +- } ++ pIE = (PNDIS_802_11_VARIABLE_IEs)(pnetwork->IEs + i); ++ ++ switch (pIE->ElementID) ++ { ++ case _VENDOR_SPECIFIC_IE_://Get WMM IE. ++ if ( _rtw_memcmp(pIE->data, WMM_OUI, 4) ) ++ { ++ pmlmeinfo->WMM_enable = 1; ++ } ++ break; ++ ++ case _HT_CAPABILITY_IE_: //Get HT Cap IE. ++ pmlmeinfo->HT_caps_enable = 1; ++ break; ++ ++ case _HT_EXTRA_INFO_IE_: //Get HT Info IE. ++ pmlmeinfo->HT_info_enable = 1; ++ ++ //spec case only for cisco's ap because cisco's ap issue assoc rsp using mcs rate @40MHz or @20MHz ++//#if !defined(CONFIG_CONCURRENT_MODE) && !defined(CONFIG_DUALMAC_CONCURRENT) ++// if(pmlmeinfo->assoc_AP_vendor == ciscoAP) ++//#endif ++ { ++ struct HT_info_element *pht_info = (struct HT_info_element *)(pIE->data); ++ ++ if( pnetwork->Configuration.DSConfig > 14 ) ++ { ++ if( pregpriv->cbw40_enable & BIT(1) ) ++ cbw40_enable = 1; ++ } ++ else ++ if( pregpriv->cbw40_enable & BIT(0) ) ++ cbw40_enable = 1; ++ ++ if ((cbw40_enable) && (pht_info->infos[0] & BIT(2))) ++ { ++ //switch to the 40M Hz mode according to the AP ++ pmlmeext->cur_bwmode = HT_CHANNEL_WIDTH_40; ++ switch (pht_info->infos[0] & 0x3) ++ { ++ case 1: ++ pmlmeext->cur_ch_offset = HAL_PRIME_CHNL_OFFSET_LOWER; ++ break; ++ ++ case 3: ++ pmlmeext->cur_ch_offset = HAL_PRIME_CHNL_OFFSET_UPPER; ++ break; ++ ++ default: ++ pmlmeext->cur_ch_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE; ++ break; ++ } - // rate adaptive by rssi - if ((priv->pmib->dot11BssType.net_work_type & WIRELESS_11N) && pstat->ht_cap_len) @@ -21334,10 +20815,16 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - pstat->tx_ra_bitmap &= 0x100ff005; - else - pstat->tx_ra_bitmap &= 0x100ff001; ++ DBG_871X("set ch/bw before connected\n"); ++ } ++ } ++ break; - break; - } -- } ++ default: ++ break; + } - else - { - switch (pstat->rssi_level) { @@ -21352,40 +20839,22 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - pstat->tx_ra_bitmap &= 0x000ff005; - else - pstat->tx_ra_bitmap &= 0x000ff001; -+ rtw_mfree(pbuf, len); - +- - break; - } -+ return ret; - // Don't need to mask high rates due to new rate adaptive parameters - //if (pstat->is_broadcom_sta) // use MCS12 as the highest rate vs. Broadcom sta - // pstat->tx_ra_bitmap &= 0x81ffffff; -+} -+#endif//CONFIG_AUTO_AP_MODE - +- - // NIC driver will report not supporting MCS15 and MCS14 in asoc req - //if (pstat->is_rtl8190_sta && !pstat->is_2t_mimo_sta) - // pstat->tx_ra_bitmap &= 0x83ffffff; // if Realtek 1x2 sta, don't use MCS15 and MCS14 - } -+u8 setopmode_hdl(_adapter *padapter, u8 *pbuf) -+{ -+ u8 type; -+ struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; -+ struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); -+ struct setopmode_parm *psetop = (struct setopmode_parm *)pbuf; -+ -+ if(psetop->mode == Ndis802_11APMode) -+ { -+ pmlmeinfo->state = WIFI_FW_AP_STATE; -+ type = _HW_STATE_AP_; -+#ifdef CONFIG_NATIVEAP_MLME -+ //start_ap_mode(padapter); -+#endif ++ i += (pIE->Length + 2); } - else if ((priv->pmib->dot11BssType.net_work_type & WIRELESS_11G) && isErpSta(pstat)) -+ else if(psetop->mode == Ndis802_11Infrastructure) - { +- { - switch (pstat->rssi_level) { - case 1: - pstat->tx_ra_bitmap &= 0x00000f00; @@ -21396,29 +20865,59 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - case 3: - pstat->tx_ra_bitmap &= 0x00000ff5; - break; -- } -+ pmlmeinfo->state &= ~(BIT(0)|BIT(1));// clear state -+ pmlmeinfo->state |= WIFI_FW_STATION_STATE;//set to STATION_STATE -+ type = _HW_STATE_STATION_; ++#if 0 ++ if (padapter->registrypriv.wifi_spec) { ++ // for WiFi test, follow WMM test plan spec ++ acparm = 0x002F431C; // VO ++ rtw_hal_set_hwreg(padapter, HW_VAR_AC_PARAM_VO, (u8 *)(&acparm)); ++ acparm = 0x005E541C; // VI ++ rtw_hal_set_hwreg(padapter, HW_VAR_AC_PARAM_VI, (u8 *)(&acparm)); ++ acparm = 0x0000A525; // BE ++ rtw_hal_set_hwreg(padapter, HW_VAR_AC_PARAM_BE, (u8 *)(&acparm)); ++ acparm = 0x0000A549; // BK ++ rtw_hal_set_hwreg(padapter, HW_VAR_AC_PARAM_BK, (u8 *)(&acparm)); ++ ++ // for WiFi test, mixed mode with intel STA under bg mode throughput issue ++ if (padapter->mlmepriv.htpriv.ht_option == _FALSE){ ++ acparm = 0x00004320; ++ rtw_hal_set_hwreg(padapter, HW_VAR_AC_PARAM_BE, (u8 *)(&acparm)); + } } - else -+ else if(psetop->mode == Ndis802_11IBSS) - { +- { - pstat->tx_ra_bitmap &= 0x0000000d; -+ type = _HW_STATE_ADHOC_; ++ else { ++ acparm = 0x002F3217; // VO ++ rtw_hal_set_hwreg(padapter, HW_VAR_AC_PARAM_VO, (u8 *)(&acparm)); ++ acparm = 0x005E4317; // VI ++ rtw_hal_set_hwreg(padapter, HW_VAR_AC_PARAM_VI, (u8 *)(&acparm)); ++ acparm = 0x00105320; // BE ++ rtw_hal_set_hwreg(padapter, HW_VAR_AC_PARAM_BE, (u8 *)(&acparm)); ++ acparm = 0x0000A444; // BK ++ rtw_hal_set_hwreg(padapter, HW_VAR_AC_PARAM_BK, (u8 *)(&acparm)); } -- ++#endif + - // disable tx short GI when station cannot rx MCS15(AP is 2T2R) - // disable tx short GI when station cannot rx MCS7 (AP is 1T2R or 1T1R) - // if there is only 1r STA and we are 2T2R, DO NOT mask SGI rate - if ((!(pstat->tx_ra_bitmap & 0x8000000) && (priv->pshare->has_2r_sta > 0) && (get_rf_mimo_mode(padapter) == RTL8712_RF_2T2R)) || - (!(pstat->tx_ra_bitmap & 0x80000) && (get_rf_mimo_mode(padapter) != RTL8712_RF_2T2R))) -+ else - { +- { - pstat->tx_ra_bitmap &= ~BIT(28); -+ type = _HW_STATE_NOLINK_; ++ /* check channel, bandwidth, offset and switch */ ++#ifdef CONFIG_DUALMAC_CONCURRENT ++ if(dc_handle_join_request(padapter) == _FAIL) { ++ DBG_871X("dc_handle_join_request fail !!!\n"); ++ return H2C_SUCCESS; ++ } ++ set_channel_bwmode(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset, pmlmeext->cur_bwmode); ++#else //NON CONFIG_DUALMAC_CONCURRENT ++ if(rtw_chk_start_clnt_join(padapter) == _FAIL) { ++ report_join_res(padapter, (-4)); ++ return H2C_SUCCESS; } --#endif + #endif - if ( pcur_network->Configuration.DSConfig > 14 ) { - // 5G band @@ -21434,10 +20933,16 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - else - sta_band |= WIRELESS_11B; - } -- ++ //disable dynamic functions, such as high power, DIG ++ //Switch_DM_Func(padapter, DYNAMIC_FUNC_DISABLE, _FALSE); + - raid = networktype_to_raid(sta_band); - init_rate = get_highest_rate_idx(tx_ra_bitmap&0x0fffffff)&0x3f; -- ++ //config the initial gain under linking, need to write the BB registers ++ ++ initialgain = 0x1E; ++ rtw_hal_set_hwreg(padapter, HW_VAR_INITIAL_GAIN, (u8 *)(&initialgain)); + - if (psta->aid < NUM_STA) - { - u8 arg = 0; @@ -21476,23 +20981,14 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - //printk("%s psta->mac_id=%d arg=0x%x\n",__FUNCTION__,psta->mac_id,arg); - } - tx_ra_bitmap |= ((raid<<28)&0xf0000000); -+ rtw_hal_set_hwreg(padapter, HW_VAR_SET_OPMODE, (u8 *)(&type)); -+ //Set_NETYPE0_MSR(padapter, type); - +- - DBG_871X("update raid entry, bitmap=0x%x, arg=0x%x\n", tx_ra_bitmap, arg); -+#ifdef CONFIG_AUTO_AP_MODE -+ if(psetop->mode == Ndis802_11APMode) -+ rtw_auto_ap_start_beacon(padapter); -+#endif - +- - //bitmap[0:27] = tx_rate_bitmap - //bitmap[28:31]= Rate Adaptive id - //arg[0:4] = macid - //arg[5] = Short GI - padapter->HalFunc.Add_RateATid(padapter, tx_ra_bitmap, arg,psta->mac_id); -+ return H2C_SUCCESS; -+ -+} - if (shortGIrate==_TRUE) - init_rate |= BIT(6); @@ -21503,75 +20999,24 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - - } - else -+u8 createbss_hdl(_adapter *padapter, u8 *pbuf) -+{ -+ struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; -+ struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); -+ WLAN_BSSID_EX *pnetwork = (WLAN_BSSID_EX*)(&(pmlmeinfo->network)); -+ struct joinbss_parm *pparm = (struct joinbss_parm *)pbuf; -+ u32 initialgain; -+ -+ -+ if(pparm->network.InfrastructureMode == Ndis802_11APMode) - { +- { - DBG_871X("station aid %d exceed the max number\n", psta->aid); -+#ifdef CONFIG_AP_MODE -+ -+ if(pmlmeinfo->state == WIFI_FW_AP_STATE) -+ { -+ //todo: -+ return H2C_SUCCESS; -+ } -+#endif - } +- } ++ rtw_hal_set_hwreg(padapter, HW_VAR_BSSID, pmlmeinfo->network.MacAddress); ++ join_type = 0; ++ rtw_hal_set_hwreg(padapter, HW_VAR_MLME_JOIN, (u8 *)(&join_type)); -+ //below is for ad-hoc master -+ if(pparm->network.InfrastructureMode == Ndis802_11IBSS) -+ { -+ rtw_joinbss_reset(padapter); ++ //cancel link timer ++ _cancel_timer_ex(&pmlmeext->link_timer); + -+ pmlmeext->cur_bwmode = HT_CHANNEL_WIDTH_20; -+ pmlmeext->cur_ch_offset= HAL_PRIME_CHNL_OFFSET_DONT_CARE; -+ pmlmeinfo->ERP_enable = 0; -+ pmlmeinfo->WMM_enable = 0; -+ pmlmeinfo->HT_enable = 0; -+ pmlmeinfo->HT_caps_enable = 0; -+ pmlmeinfo->HT_info_enable = 0; -+ pmlmeinfo->agg_enable_bitmap = 0; -+ pmlmeinfo->candidate_tid_bitmap = 0; -+ -+ //disable dynamic functions, such as high power, DIG -+ Save_DM_Func_Flag(padapter); -+ Switch_DM_Func(padapter, DYNAMIC_FUNC_DISABLE, _FALSE); -+ -+ //config the initial gain under linking, need to write the BB registers -+ initialgain = 0x1E; -+ rtw_hal_set_hwreg(padapter, HW_VAR_INITIAL_GAIN, (u8 *)(&initialgain)); -+ -+ //cancel link timer -+ _cancel_timer_ex(&pmlmeext->link_timer); -+ -+ //clear CAM -+ flush_all_cam_entry(padapter); -+ -+ _rtw_memcpy(pnetwork, pbuf, FIELD_OFFSET(WLAN_BSSID_EX, IELength)); -+ pnetwork->IELength = ((WLAN_BSSID_EX *)pbuf)->IELength; -+ -+ if(pnetwork->IELength>MAX_IE_SZ)//Check pbuf->IELength -+ return H2C_PARAMETERS_ERROR; -+ -+ _rtw_memcpy(pnetwork->IEs, ((WLAN_BSSID_EX *)pbuf)->IEs, pnetwork->IELength); ++ start_clnt_join(padapter); + -+ start_create_ibss(padapter); -+ -+ } -+ + return H2C_SUCCESS; -+ ++ } -static void update_bmc_sta(_adapter *padapter) -+u8 join_cmd_hdl(_adapter *padapter, u8 *pbuf) ++u8 disconnect_hdl(_adapter *padapter, unsigned char *pbuf) { - _irqL irqL; - u32 init_rate=0; @@ -21582,22 +21027,14 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); - WLAN_BSSID_EX *pcur_network = (WLAN_BSSID_EX *)&pmlmepriv->cur_network.network; - struct sta_info *psta = rtw_get_bcmc_stainfo(padapter); -+ u8 join_type; -+ PNDIS_802_11_VARIABLE_IEs pIE; -+ struct registry_priv *pregpriv = &padapter->registrypriv; ++ struct disconnect_parm *param = (struct disconnect_parm *)pbuf; + struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; + struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); + WLAN_BSSID_EX *pnetwork = (WLAN_BSSID_EX*)(&(pmlmeinfo->network)); -+#ifdef CONFIG_ANTENNA_DIVERSITY -+ struct joinbss_parm *pparm = (struct joinbss_parm *)pbuf; -+#endif //CONFIG_ANTENNA_DIVERSITY -+ u32 initialgain, i; -+ u8 cbw40_enable=0; -+ //u32 acparm; ++ u8 val8; - if(psta) -+ //check already connecting to AP or not -+ if (pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS) ++ if (is_client_associated_to_ap(padapter)) { - psta->aid = 0;//default set to 0 - //psta->mac_id = psta->aid+4; @@ -21607,65 +21044,35 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - psta->htpriv.ht_option = _FALSE; - - psta->ieee8021x_blocked = 0; -+ if (pmlmeinfo->state & WIFI_FW_STATION_STATE) -+ { -+ issue_deauth_ex(padapter, pnetwork->MacAddress, WLAN_REASON_DEAUTH_LEAVING, 5, 100); -+ } - +- - _rtw_memset((void*)&psta->sta_stats, 0, sizeof(struct stainfo_stats)); -+ pmlmeinfo->state = WIFI_FW_NULL_STATE; -+ -+ //clear CAM -+ flush_all_cam_entry(padapter); -+ -+ _cancel_timer_ex(&pmlmeext->link_timer); -+ -+ //set MSR to nolink -> infra. mode -+ //Set_MSR(padapter, _HW_STATE_NOLINK_); -+ Set_MSR(padapter, _HW_STATE_STATION_); -+ - +- - //psta->dot118021XPrivacy = _NO_PRIVACY_;//!!! remove it, because it has been set before this. -+ rtw_hal_set_hwreg(padapter, HW_VAR_MLME_DISCONNECT, 0); ++ issue_deauth_ex(padapter, pnetwork->MacAddress, WLAN_REASON_DEAUTH_LEAVING, param->deauth_timeout_ms/100, 100); + } -+#ifdef CONFIG_ANTENNA_DIVERSITY -+ rtw_antenna_select_cmd(padapter, pparm->network.PhyInfo.Optimum_antenna, _FALSE); -+#endif ++ //set_opmode_cmd(padapter, infra_client_with_mlme); -+ rtw_joinbss_reset(padapter); ++ //pmlmeinfo->state = WIFI_FW_NULL_STATE; + -+ pmlmeext->cur_bwmode = HT_CHANNEL_WIDTH_20; -+ pmlmeext->cur_ch_offset= HAL_PRIME_CHNL_OFFSET_DONT_CARE; -+ pmlmeinfo->ERP_enable = 0; -+ pmlmeinfo->WMM_enable = 0; -+ pmlmeinfo->HT_enable = 0; -+ pmlmeinfo->HT_caps_enable = 0; -+ pmlmeinfo->HT_info_enable = 0; -+ pmlmeinfo->agg_enable_bitmap = 0; -+ pmlmeinfo->candidate_tid_bitmap = 0; -+ pmlmeinfo->bwmode_updated = _FALSE; -+ //pmlmeinfo->assoc_AP_vendor = maxAP; - //prepare for add_RATid - supportRateNum = rtw_get_rateset_len((u8*)&pcur_network->SupportedRates); - network_type = rtw_check_network_type((u8*)&pcur_network->SupportedRates, supportRateNum, 1); -+ _rtw_memcpy(pnetwork, pbuf, FIELD_OFFSET(WLAN_BSSID_EX, IELength)); -+ pnetwork->IELength = ((WLAN_BSSID_EX *)pbuf)->IELength; -+ -+ if(pnetwork->IELength>MAX_IE_SZ)//Check pbuf->IELength -+ return H2C_PARAMETERS_ERROR; - +- - _rtw_memcpy(psta->bssrateset, &pcur_network->SupportedRates, supportRateNum); - psta->bssratelen = supportRateNum; -- ++ rtw_hal_set_hwreg(padapter, HW_VAR_MLME_DISCONNECT, 0); ++ rtw_hal_set_hwreg(padapter, HW_VAR_BSSID, null_addr); + - //b/g mode ra_bitmap - for (i=0; ibssrateset[i]) - tx_ra_bitmap |= rtw_get_bit_value_from_ieee_value(psta->bssrateset[i]&0x7f); - } -+ _rtw_memcpy(pnetwork->IEs, ((WLAN_BSSID_EX *)pbuf)->IEs, pnetwork->IELength); ++ //restore to initial setting. ++ update_tx_basic_rate(padapter, padapter->registrypriv.wireless_mode); - if ( pcur_network->Configuration.DSConfig > 14 ) { - //force to A mode. 5G doesn't support CCK rates @@ -21676,31 +21083,26 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - network_type = WIRELESS_11B; - tx_ra_bitmap = 0xf; - } -+ pmlmeext->cur_channel = (u8)pnetwork->Configuration.DSConfig; -+ pmlmeinfo->bcn_interval = get_beacon_interval(pnetwork); ++ if(((pmlmeinfo->state&0x03) == WIFI_FW_ADHOC_STATE) || ((pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE)) ++ { ++ //Stop BCN ++ val8 = 0; ++ rtw_hal_set_hwreg(padapter, HW_VAR_BCN_FUNC, (u8 *)(&val8)); ++ } - //tx_ra_bitmap = update_basic_rate(pcur_network->SupportedRates, supportRateNum); -+ //Check AP vendor to move rtw_joinbss_cmd() -+ //pmlmeinfo->assoc_AP_vendor = check_assoc_AP(pnetwork->IEs, pnetwork->IELength); - raid = networktype_to_raid(network_type); - init_rate = get_highest_rate_idx(tx_ra_bitmap&0x0fffffff)&0x3f; - - //DBG_871X("Add id %d val %08x to ratr for bmc sta\n", psta->aid, tx_ra_bitmap); -+ for (i = sizeof(NDIS_802_11_FIXED_IEs); i < pnetwork->IELength;) -+ { -+ pIE = (PNDIS_802_11_VARIABLE_IEs)(pnetwork->IEs + i); ++ //set MSR to no link state -> infra. mode ++ Set_MSR(padapter, _HW_STATE_STATION_); - //if(pHalData->fw_ractrl == _TRUE) -+ switch (pIE->ElementID) - { +- { - u8 arg = 0; -+ case _VENDOR_SPECIFIC_IE_://Get WMM IE. -+ if ( _rtw_memcmp(pIE->data, WMM_OUI, 4) ) -+ { -+ pmlmeinfo->WMM_enable = 1; -+ } -+ break; ++ pmlmeinfo->state = WIFI_FW_NULL_STATE; - arg = psta->mac_id&0x1f; - @@ -21708,65 +21110,35 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - - //if (shortGIrate==_TRUE) - // arg |= BIT(5); -+ case _HT_CAPABILITY_IE_: //Get HT Cap IE. -+ pmlmeinfo->HT_caps_enable = 1; -+ break; -+ -+ case _HT_EXTRA_INFO_IE_: //Get HT Info IE. -+ pmlmeinfo->HT_info_enable = 1; -+ -+ //spec case only for cisco's ap because cisco's ap issue assoc rsp using mcs rate @40MHz or @20MHz -+//#if !defined(CONFIG_CONCURRENT_MODE) && !defined(CONFIG_DUALMAC_CONCURRENT) -+// if(pmlmeinfo->assoc_AP_vendor == ciscoAP) -+//#endif -+ { -+ struct HT_info_element *pht_info = (struct HT_info_element *)(pIE->data); -+ -+ if( pnetwork->Configuration.DSConfig > 14 ) -+ { -+ if( pregpriv->cbw40_enable & BIT(1) ) -+ cbw40_enable = 1; -+ } -+ else -+ if( pregpriv->cbw40_enable & BIT(0) ) -+ cbw40_enable = 1; -+ -+ if ((cbw40_enable) && (pht_info->infos[0] & BIT(2))) -+ { -+ //switch to the 40M Hz mode according to the AP -+ pmlmeext->cur_bwmode = HT_CHANNEL_WIDTH_40; -+ switch (pht_info->infos[0] & 0x3) -+ { -+ case 1: -+ pmlmeext->cur_ch_offset = HAL_PRIME_CHNL_OFFSET_LOWER; -+ break; - +- - tx_ra_bitmap |= ((raid<<28)&0xf0000000); -+ case 3: -+ pmlmeext->cur_ch_offset = HAL_PRIME_CHNL_OFFSET_UPPER; -+ break; -+ -+ default: -+ pmlmeext->cur_ch_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE; -+ break; -+ } ++#ifdef CONFIG_DUALMAC_CONCURRENT ++ dc_set_channel_bwmode_disconnect(padapter); ++#else ++#ifdef CONFIG_CONCURRENT_MODE ++ if((check_buddy_fwstate(padapter, _FW_LINKED)) != _TRUE) ++ { ++#endif //CONFIG_CONCURRENT_MODE ++ //switch to the 20M Hz mode after disconnect ++ pmlmeext->cur_bwmode = HT_CHANNEL_WIDTH_20; ++ pmlmeext->cur_ch_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE; - DBG_871X("update_bmc_sta, mask=0x%x, arg=0x%x\n", tx_ra_bitmap, arg); -+ DBG_871X("set ch/bw before connected\n"); -+ } -+ } -+ break; ++ set_channel_bwmode(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset, pmlmeext->cur_bwmode); ++#ifdef CONFIG_CONCURRENT_MODE ++ } ++#endif //CONFIG_CONCURRENT_MODE ++#endif //CONFIG_DUALMAC_CONCURRENT - //bitmap[0:27] = tx_rate_bitmap - //bitmap[28:31]= Rate Adaptive id - //arg[0:4] = macid - //arg[5] = Short GI - padapter->HalFunc.Add_RateATid(padapter, tx_ra_bitmap, arg,psta->mac_id ); -- -+ default: -+ break; - } - ++ flush_all_cam_entry(padapter); + +- } +- - //set ra_id, init_rate - psta->raid = raid; - psta->init_rate = init_rate; @@ -21774,56 +21146,18 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - _enter_critical_bh(&psta->lock, &irqL); - psta->state = _FW_LINKED; - _exit_critical_bh(&psta->lock, &irqL); -+ i += (pIE->Length + 2); -+ } -+#if 0 -+ if (padapter->registrypriv.wifi_spec) { -+ // for WiFi test, follow WMM test plan spec -+ acparm = 0x002F431C; // VO -+ rtw_hal_set_hwreg(padapter, HW_VAR_AC_PARAM_VO, (u8 *)(&acparm)); -+ acparm = 0x005E541C; // VI -+ rtw_hal_set_hwreg(padapter, HW_VAR_AC_PARAM_VI, (u8 *)(&acparm)); -+ acparm = 0x0000A525; // BE -+ rtw_hal_set_hwreg(padapter, HW_VAR_AC_PARAM_BE, (u8 *)(&acparm)); -+ acparm = 0x0000A549; // BK -+ rtw_hal_set_hwreg(padapter, HW_VAR_AC_PARAM_BK, (u8 *)(&acparm)); -+ -+ // for WiFi test, mixed mode with intel STA under bg mode throughput issue -+ if (padapter->mlmepriv.htpriv.ht_option == _FALSE){ -+ acparm = 0x00004320; -+ rtw_hal_set_hwreg(padapter, HW_VAR_AC_PARAM_BE, (u8 *)(&acparm)); -+ } -+ } -+ else { -+ acparm = 0x002F3217; // VO -+ rtw_hal_set_hwreg(padapter, HW_VAR_AC_PARAM_VO, (u8 *)(&acparm)); -+ acparm = 0x005E4317; // VI -+ rtw_hal_set_hwreg(padapter, HW_VAR_AC_PARAM_VI, (u8 *)(&acparm)); -+ acparm = 0x00105320; // BE -+ rtw_hal_set_hwreg(padapter, HW_VAR_AC_PARAM_BE, (u8 *)(&acparm)); -+ acparm = 0x0000A444; // BK -+ rtw_hal_set_hwreg(padapter, HW_VAR_AC_PARAM_BK, (u8 *)(&acparm)); -+ } -+#endif ++ _cancel_timer_ex(&pmlmeext->link_timer); -+ /* check channel, bandwidth, offset and switch */ -+#ifdef CONFIG_DUALMAC_CONCURRENT -+ if(dc_handle_join_request(padapter) == _FAIL) { -+ DBG_871X("dc_handle_join_request fail !!!\n"); -+ return H2C_SUCCESS; - } +- } - else - { - DBG_871X("add_RATid_bmc_sta error!\n"); -+ set_channel_bwmode(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset, pmlmeext->cur_bwmode); -+#else //NON CONFIG_DUALMAC_CONCURRENT -+ if(rtw_chk_start_clnt_join(padapter) == _FAIL) { -+ report_join_res(padapter, (-4)); -+ return H2C_SUCCESS; - } +- } - --} -+#endif ++ rtw_free_uc_swdec_pending_queue(padapter); ++ ++ return H2C_SUCCESS; + } -//notes: -//AID: 1~MAX for sta and 0 for bc/mc in ap/adhoc mode @@ -21831,9 +21165,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release -//MAC_ID = 1 for bc/mc for sta/ap/adhoc -//MAC_ID = 0 for bssid for sta/ap/adhoc -//CAM_ID = //0~3 for default key, cmd_id=macid + 3, macid=aid+1; -+ //disable dynamic functions, such as high power, DIG -+ //Switch_DM_Func(padapter, DYNAMIC_FUNC_DISABLE, _FALSE); - +- -void update_sta_info_apmode(_adapter *padapter, struct sta_info *psta) -{ - _irqL irqL; @@ -21842,61 +21174,58 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); - struct ht_priv *phtpriv_ap = &pmlmepriv->htpriv; - struct ht_priv *phtpriv_sta = &psta->htpriv; -+ //config the initial gain under linking, need to write the BB registers -+ -+ initialgain = 0x1E; -+ rtw_hal_set_hwreg(padapter, HW_VAR_INITIAL_GAIN, (u8 *)(&initialgain)); -+ ++int rtw_scan_ch_decision(_adapter *padapter, struct rtw_ieee80211_channel *out, ++ u32 out_num, struct rtw_ieee80211_channel *in, u32 in_num) ++{ ++ int i, j; ++ int scan_ch_num = 0; ++ int set_idx; ++ struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; - //set intf_tag to if1 - //psta->intf_tag = 0; -+ rtw_hal_set_hwreg(padapter, HW_VAR_BSSID, pmlmeinfo->network.MacAddress); -+ join_type = 0; -+ rtw_hal_set_hwreg(padapter, HW_VAR_MLME_JOIN, (u8 *)(&join_type)); ++ /* clear first */ ++ _rtw_memset(out, 0, sizeof(struct rtw_ieee80211_channel)*out_num); - //psta->mac_id = psta->aid+4; - psta->mac_id = psta->aid+1; -+ //cancel link timer -+ _cancel_timer_ex(&pmlmeext->link_timer); - +- - if(psecuritypriv->dot11AuthAlgrthm==dot11AuthAlgrthm_8021X) - psta->ieee8021x_blocked = _TRUE; - else - psta->ieee8021x_blocked = _FALSE; -+ start_clnt_join(padapter); - -- +- ++ /* acquire channels from in */ ++ j = 0; ++ for (i=0;iht_option) -+} -+ -+u8 disconnect_hdl(_adapter *padapter, unsigned char *pbuf) -+{ -+ struct disconnect_parm *param = (struct disconnect_parm *)pbuf; -+ struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; -+ struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); -+ WLAN_BSSID_EX *pnetwork = (WLAN_BSSID_EX*)(&(pmlmeinfo->network)); -+ u8 val8; -+ -+ if (is_client_associated_to_ap(padapter)) - { +- { - //check if sta supports rx ampdu - phtpriv_sta->ampdu_enable = phtpriv_ap->ampdu_enable; -+ issue_deauth_ex(padapter, pnetwork->MacAddress, WLAN_REASON_DEAUTH_LEAVING, param->deauth_timeout_ms/100, 100); -+ } ++ if (0) ++ DBG_871X(FUNC_ADPT_FMT" "CHAN_FMT"\n", FUNC_ADPT_ARG(padapter), CHAN_ARG(&in[i])); - //check if sta support s Short GI - if((phtpriv_sta->ht_cap.cap_info & phtpriv_ap->ht_cap.cap_info) & cpu_to_le16(IEEE80211_HT_CAP_SGI_20|IEEE80211_HT_CAP_SGI_40)) -- { ++ if(in[i].hw_value && !(in[i].flags & RTW_IEEE80211_CHAN_DISABLED) ++ && (set_idx=rtw_ch_set_search_ch(pmlmeext->channel_set, in[i].hw_value)) >=0 ++ && rtw_mlme_band_check(padapter, in[i].hw_value) == _TRUE ++ ) + { - phtpriv_sta->sgi = _TRUE; - } -+ //set_opmode_cmd(padapter, infra_client_with_mlme); ++ if (j >= out_num) { ++ DBG_871X_LEVEL(_drv_always_, FUNC_ADPT_FMT" out_num:%u not enough\n", ++ FUNC_ADPT_ARG(padapter), out_num); ++ break; ++ } - // bwmode - if((phtpriv_sta->ht_cap.cap_info & phtpriv_ap->ht_cap.cap_info) & cpu_to_le16(IEEE80211_HT_CAP_SUP_WIDTH)) @@ -21904,33 +21233,29 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - //phtpriv_sta->bwmode = HT_CHANNEL_WIDTH_40; - phtpriv_sta->bwmode = pmlmeext->cur_bwmode; - phtpriv_sta->ch_offset = pmlmeext->cur_ch_offset; -- ++ _rtw_memcpy(&out[j], &in[i], sizeof(struct rtw_ieee80211_channel)); + - } -+ //pmlmeinfo->state = WIFI_FW_NULL_STATE; -+ - +- - psta->qos_option = _TRUE; - - } - else -+ rtw_hal_set_hwreg(padapter, HW_VAR_MLME_DISCONNECT, 0); -+ rtw_hal_set_hwreg(padapter, HW_VAR_BSSID, null_addr); -+ -+ //restore to initial setting. -+ update_tx_basic_rate(padapter, padapter->registrypriv.wireless_mode); -+ -+ if(((pmlmeinfo->state&0x03) == WIFI_FW_ADHOC_STATE) || ((pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE)) - { +- { - phtpriv_sta->ampdu_enable = _FALSE; - - phtpriv_sta->sgi = _FALSE; - phtpriv_sta->bwmode = HT_CHANNEL_WIDTH_20; - phtpriv_sta->ch_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE; -+ //Stop BCN -+ val8 = 0; -+ rtw_hal_set_hwreg(padapter, HW_VAR_BCN_FUNC, (u8 *)(&val8)); ++ if(pmlmeext->channel_set[set_idx].ScanType == SCAN_PASSIVE) ++ out[j].flags &= RTW_IEEE80211_CHAN_PASSIVE_SCAN; ++ ++ j++; ++ } ++ if(j>=out_num) ++ break; } - +- - //Rx AMPDU - send_delba(padapter, 0, psta->hwaddr);// recipient - @@ -21938,64 +21263,56 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - send_delba(padapter, 1, psta->hwaddr);// // originator - phtpriv_sta->agg_enable_bitmap = 0x0;//reset - phtpriv_sta->candidate_tid_bitmap = 0x0;//reset -- + ++ /* if out is empty, use channel_set as default */ ++ if(j == 0) { ++ for (i=0;imax_chan_nums;i++) { - //todo: init other variables - - _rtw_memset((void*)&psta->sta_stats, 0, sizeof(struct stainfo_stats)); -+ //set MSR to no link state -> infra. mode -+ Set_MSR(padapter, _HW_STATE_STATION_); -+ -+ pmlmeinfo->state = WIFI_FW_NULL_STATE; ++ if (0) ++ DBG_871X(FUNC_ADPT_FMT" ch:%u\n", FUNC_ADPT_ARG(padapter), pmlmeext->channel_set[i].ChannelNum); -+#ifdef CONFIG_DUALMAC_CONCURRENT -+ dc_set_channel_bwmode_disconnect(padapter); -+#else -+#ifdef CONFIG_CONCURRENT_MODE -+ if((check_buddy_fwstate(padapter, _FW_LINKED)) != _TRUE) -+ { -+#endif //CONFIG_CONCURRENT_MODE -+ //switch to the 20M Hz mode after disconnect -+ pmlmeext->cur_bwmode = HT_CHANNEL_WIDTH_20; -+ pmlmeext->cur_ch_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE; ++ if (rtw_mlme_band_check(padapter, pmlmeext->channel_set[i].ChannelNum) == _TRUE) { - //add ratid - //add_RATid(padapter, psta);//move to ap_sta_info_defer_update() -+ set_channel_bwmode(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset, pmlmeext->cur_bwmode); -+#ifdef CONFIG_CONCURRENT_MODE -+ } -+#endif //CONFIG_CONCURRENT_MODE -+#endif //CONFIG_DUALMAC_CONCURRENT ++ if (j >= out_num) { ++ DBG_871X_LEVEL(_drv_always_, FUNC_ADPT_FMT" out_num:%u not enough\n", ++ FUNC_ADPT_ARG(padapter), out_num); ++ break; ++ } -+ flush_all_cam_entry(padapter); -+ -+ _cancel_timer_ex(&pmlmeext->link_timer); ++ out[j].hw_value = pmlmeext->channel_set[i].ChannelNum; ++ ++ if(pmlmeext->channel_set[i].ScanType == SCAN_PASSIVE) ++ out[j].flags &= RTW_IEEE80211_CHAN_PASSIVE_SCAN; - _enter_critical_bh(&psta->lock, &irqL); - psta->state |= _FW_LINKED; - _exit_critical_bh(&psta->lock, &irqL); -+ rtw_free_uc_swdec_pending_queue(padapter); - -- -+ return H2C_SUCCESS; +- ++ j++; ++ } ++ } ++ } + ++ return j; } -static void update_hw_ht_param(_adapter *padapter) -+int rtw_scan_ch_decision(_adapter *padapter, struct rtw_ieee80211_channel *out, -+ u32 out_num, struct rtw_ieee80211_channel *in, u32 in_num) ++u8 sitesurvey_cmd_hdl(_adapter *padapter, u8 *pbuf) { - unsigned char max_AMPDU_len; - unsigned char min_MPDU_spacing; - struct registry_priv *pregpriv = &padapter->registrypriv; -+ int i, j; -+ int scan_ch_num = 0; -+ int set_idx; struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; - struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); - - DBG_871X("%s\n", __FUNCTION__); - - +- - //handle A-MPDU parameter field - /* - AMPDU_para [1:0]:Max AMPDU Len => 0:8k , 1:16k, 2:32k, 3:64k @@ -22006,34 +21323,25 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - min_MPDU_spacing = (pmlmeinfo->HT_caps.HT_cap_element.AMPDU_para & 0x1c) >> 2; - - padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_AMPDU_MIN_SPACE, (u8 *)(&min_MPDU_spacing)); -+ /* clear first */ -+ _rtw_memset(out, 0, sizeof(struct rtw_ieee80211_channel)*out_num); ++ struct sitesurvey_parm *pparm = (struct sitesurvey_parm *)pbuf; ++ u8 bdelayscan = _FALSE; ++ u8 val8; ++ u32 initialgain; ++ u32 i; ++ u8 write_initial_gain = 1; - padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_AMPDU_FACTOR, (u8 *)(&max_AMPDU_len)); -+ /* acquire channels from in */ -+ j = 0; -+ for (i=0;ichannel_set, in[i].hw_value)) >=0 -+ && rtw_mlme_band_check(padapter, in[i].hw_value) == _TRUE -+ ) -+ { -+ if (j >= out_num) { -+ DBG_871X_LEVEL(_drv_always_, FUNC_ADPT_FMT" out_num:%u not enough\n", -+ FUNC_ADPT_ARG(padapter), out_num); -+ break; -+ } ++#ifdef CONFIG_P2P ++ struct wifidirect_info* pwdinfo = &padapter->wdinfo; ++#endif - // - // Config SM Power Save setting - // - pmlmeinfo->SM_PS = (pmlmeinfo->HT_caps.HT_cap_element.HT_caps_info & 0x0C) >> 2; - if(pmlmeinfo->SM_PS == WLAN_HT_CAP_SM_PS_STATIC) -- { ++ if (pmlmeext->sitesurvey_res.state == SCAN_DISABLE) + { - /*u8 i; - //update the MCS rates - for (i = 0; i < 16; i++) @@ -22041,52 +21349,17 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - pmlmeinfo->HT_caps.HT_cap_element.MCS_rate[i] &= MCS_rate_1R[i]; - }*/ - DBG_8192C("%s(): WLAN_HT_CAP_SM_PS_STATIC\n",__FUNCTION__); -+ _rtw_memcpy(&out[j], &in[i], sizeof(struct rtw_ieee80211_channel)); -+ -+ if(pmlmeext->channel_set[set_idx].ScanType == SCAN_PASSIVE) -+ out[j].flags &= RTW_IEEE80211_CHAN_PASSIVE_SCAN; -+ -+ j++; -+ } -+ if(j>=out_num) -+ break; - } -+ -+ /* if out is empty, use channel_set as default */ -+ if(j == 0) { -+ for (i=0;imax_chan_nums;i++) { -+ -+ if (0) -+ DBG_871X(FUNC_ADPT_FMT" ch:%u\n", FUNC_ADPT_ARG(padapter), pmlmeext->channel_set[i].ChannelNum); -+ -+ if (rtw_mlme_band_check(padapter, pmlmeext->channel_set[i].ChannelNum) == _TRUE) { -+ -+ if (j >= out_num) { -+ DBG_871X_LEVEL(_drv_always_, FUNC_ADPT_FMT" out_num:%u not enough\n", -+ FUNC_ADPT_ARG(padapter), out_num); -+ break; -+ } - +- } +- - // - // Config current HT Protection mode. - // - //pmlmeinfo->HT_protection = pmlmeinfo->HT_info.infos[1] & 0x3; -+ out[j].hw_value = pmlmeext->channel_set[i].ChannelNum; -+ -+ if(pmlmeext->channel_set[i].ScanType == SCAN_PASSIVE) -+ out[j].flags &= RTW_IEEE80211_CHAN_PASSIVE_SCAN; -+ -+ j++; -+ } -+ } -+ } - -+ return j; - } - +- +-} +- -static void start_bss_network(_adapter *padapter, u8 *pbuf) -+u8 sitesurvey_cmd_hdl(_adapter *padapter, u8 *pbuf) - { +-{ - u8 *p; - u8 val8, cur_channel, cur_bwmode, cur_ch_offset; - u16 bcn_interval; @@ -22105,19 +21378,28 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - - - //DBG_8192C("%s\n", __FUNCTION__); -- ++#ifdef CONFIG_CONCURRENT_MODE ++ //for first time sitesurvey_cmd ++ rtw_hal_set_hwreg(padapter, HW_VAR_CHECK_TXBUF, 0); ++#endif //CONFIG_CONCURRENT_MODE ++ ++ pmlmeext->sitesurvey_res.state = SCAN_START; ++ pmlmeext->sitesurvey_res.bss_cnt = 0; ++ pmlmeext->sitesurvey_res.channel_idx = 0; + - bcn_interval = (u16)pnetwork->Configuration.BeaconPeriod; - cur_channel = pnetwork->Configuration.DSConfig; - cur_bwmode = HT_CHANNEL_WIDTH_20;; - cur_ch_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE; - -+ struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; -+ struct sitesurvey_parm *pparm = (struct sitesurvey_parm *)pbuf; -+ u8 bdelayscan = _FALSE; -+ u8 val8; -+ u32 initialgain; -+ u32 i; -+ u8 write_initial_gain = 1; ++ for(i=0;issid[i].SsidLength) { ++ _rtw_memcpy(pmlmeext->sitesurvey_res.ssid[i].Ssid, pparm->ssid[i].Ssid, IW_ESSID_MAX_SIZE); ++ pmlmeext->sitesurvey_res.ssid[i].SsidLength= pparm->ssid[i].SsidLength; ++ } else { ++ pmlmeext->sitesurvey_res.ssid[i].SsidLength= 0; ++ } ++ } - //check if there is wps ie, - //if there is wpsie in beacon, the hostapd will update beacon twice when stating hostapd, @@ -22135,53 +21417,41 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - //pmlmeinfo->HT_enable; - if(pmlmepriv->qospriv.qos_option) - pmlmeinfo->WMM_enable = _TRUE; -+#ifdef CONFIG_P2P -+ struct wifidirect_info* pwdinfo = &padapter->wdinfo; -+#endif ++ pmlmeext->sitesurvey_res.ch_num = rtw_scan_ch_decision(padapter ++ , pmlmeext->sitesurvey_res.ch, RTW_CHANNEL_SCAN_AMOUNT ++ , pparm->ch, pparm->ch_num ++ ); - if(pmlmepriv->htpriv.ht_option) -+ if (pmlmeext->sitesurvey_res.state == SCAN_DISABLE) - { +- { - pmlmeinfo->WMM_enable = _TRUE; - pmlmeinfo->HT_enable = _TRUE; - //pmlmeinfo->HT_info_enable = _TRUE; - //pmlmeinfo->HT_caps_enable = _TRUE; -+#ifdef CONFIG_CONCURRENT_MODE -+ //for first time sitesurvey_cmd -+ rtw_hal_set_hwreg(padapter, HW_VAR_CHECK_TXBUF, 0); -+#endif //CONFIG_CONCURRENT_MODE -+ -+ pmlmeext->sitesurvey_res.state = SCAN_START; -+ pmlmeext->sitesurvey_res.bss_cnt = 0; -+ pmlmeext->sitesurvey_res.channel_idx = 0; ++ pmlmeext->sitesurvey_res.scan_mode = pparm->scan_mode; - update_hw_ht_param(padapter); - } - -+ for(i=0;issid[i].SsidLength) { -+ _rtw_memcpy(pmlmeext->sitesurvey_res.ssid[i].Ssid, pparm->ssid[i].Ssid, IW_ESSID_MAX_SIZE); -+ pmlmeext->sitesurvey_res.ssid[i].SsidLength= pparm->ssid[i].SsidLength; -+ } else { -+ pmlmeext->sitesurvey_res.ssid[i].SsidLength= 0; -+ } -+ } ++#ifdef CONFIG_DUALMAC_CONCURRENT ++ bdelayscan = dc_handle_site_survey(padapter); ++#endif - if(pmlmepriv->cur_network.join_res != _TRUE) //setting only at first time - { - flush_all_cam_entry(padapter); //clear CAM - } -+ pmlmeext->sitesurvey_res.ch_num = rtw_scan_ch_decision(padapter -+ , pmlmeext->sitesurvey_res.ch, RTW_CHANNEL_SCAN_AMOUNT -+ , pparm->ch, pparm->ch_num -+ ); ++ //issue null data if associating to the AP ++ if (is_client_associated_to_ap(padapter) == _TRUE) ++ { ++ pmlmeext->sitesurvey_res.state = SCAN_TXNULL; - //set MSR to AP_Mode - Set_NETYPE0_MSR(padapter, _HW_STATE_AP_); - - //Set BSSID REG - padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_BSSID, pnetwork->MacAddress); -+ pmlmeext->sitesurvey_res.scan_mode = pparm->scan_mode; ++ issue_nulldata(padapter, NULL, 1, 3, 500); - //Set EDCA param reg - acparm = 0x002F3217; // VO @@ -22193,29 +21463,6 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_AC_PARAM_BE, (u8 *)(&acparm)); - acparm = 0x0000A444; // BK - padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_AC_PARAM_BK, (u8 *)(&acparm)); -- -- //Set Security -- val8 = (psecuritypriv->dot11AuthAlgrthm == dot11AuthAlgrthm_8021X)? 0xcc: 0xcf; -- padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_SEC_CFG, (u8 *)(&val8)); -+#ifdef CONFIG_DUALMAC_CONCURRENT -+ bdelayscan = dc_handle_site_survey(padapter); -+#endif - -- //Beacon Control related register -- padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_BEACON_INTERVAL, (u8 *)(&bcn_interval)); -+ //issue null data if associating to the AP -+ if (is_client_associated_to_ap(padapter) == _TRUE) -+ { -+ pmlmeext->sitesurvey_res.state = SCAN_TXNULL; - -- -- UpdateBrateTbl(padapter, pnetwork->SupportedRates); -- padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_BASIC_RATE, pnetwork->SupportedRates); -+ issue_nulldata(padapter, NULL, 1, 3, 500); - -- if(pmlmepriv->cur_network.join_res != _TRUE) //setting only at first time -- { -- u32 initialgain; +#ifdef CONFIG_CONCURRENT_MODE + if(is_client_associated_to_ap(padapter->pbuddy_adapter) == _TRUE) + { @@ -22236,19 +21483,55 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + } + #endif //CONFIG_TDLS -- //disable dynamic functions, such as high power, DIG +- //Set Security +- val8 = (psecuritypriv->dot11AuthAlgrthm == dot11AuthAlgrthm_8021X)? 0xcc: 0xcf; +- padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_SEC_CFG, (u8 *)(&val8)); ++ pmlmeext->sitesurvey_res.state = SCAN_TXNULL; + +- //Beacon Control related register +- padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_BEACON_INTERVAL, (u8 *)(&bcn_interval)); ++ issue_nulldata(padapter->pbuddy_adapter, NULL, 1, 3, 500); + +- +- UpdateBrateTbl(padapter, pnetwork->SupportedRates); +- padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_BASIC_RATE, pnetwork->SupportedRates); ++ bdelayscan = _TRUE; ++ } ++#endif ++ if(bdelayscan) ++ { ++ //delay 50ms to protect nulldata(1). ++ set_survey_timer(pmlmeext, 50); ++ return H2C_SUCCESS; ++ } ++ } + +- if(pmlmepriv->cur_network.join_res != _TRUE) //setting only at first time ++ if ((pmlmeext->sitesurvey_res.state == SCAN_START) || (pmlmeext->sitesurvey_res.state == SCAN_TXNULL)) + { +- u32 initialgain; ++#ifdef CONFIG_FIND_BEST_CHANNEL ++#if 0 ++ for (i=0; pmlmeext->channel_set[i].ChannelNum !=0; i++) { ++ pmlmeext->channel_set[i].rx_count = 0; ++ } ++#endif ++#endif /* CONFIG_FIND_BEST_CHANNEL */ + + //disable dynamic functions, such as high power, DIG - //Save_DM_Func_Flag(padapter); - //Switch_DM_Func(padapter, DYNAMIC_FUNC_DISABLE, _FALSE); - - //turn on dynamic functions - Switch_DM_Func(padapter, DYNAMIC_FUNC_DIG|DYNAMIC_FUNC_HP|DYNAMIC_FUNC_SS, _TRUE); -+ pmlmeext->sitesurvey_res.state = SCAN_TXNULL; ++ Save_DM_Func_Flag(padapter); ++ Switch_DM_Func(padapter, DYNAMIC_FUNC_DISABLE, _FALSE); - initialgain = 0x30; - padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_INITIAL_GAIN, (u8 *)(&initialgain)); - - } -+ issue_nulldata(padapter->pbuddy_adapter, NULL, 1, 3, 500); ++ //config the initial gain under scaning, need to write the BB registers - //set channel, bwmode - p = rtw_get_ie((pnetwork->IEs + sizeof(NDIS_802_11_FIXED_IEs)), _HT_ADD_INFO_IE_, &ie_len, (pnetwork->IELength - sizeof(NDIS_802_11_FIXED_IEs))); @@ -22257,10 +21540,9 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - struct HT_info_element *pht_info = (struct HT_info_element *)(p+2); - - if ((pregpriv->cbw40_enable) && (pht_info->infos[0] & BIT(2))) -+ bdelayscan = _TRUE; -+ } -+#endif -+ if(bdelayscan) ++#ifdef CONFIG_P2P ++#ifdef CONFIG_IOCTL_CFG80211 ++ if((wdev_to_priv(padapter->rtw_wdev))->p2p_enabled == _TRUE && pwdinfo->driver_interface == DRIVER_CFG80211 ) { - //switch to the 40M Hz mode - //pmlmeext->cur_bwmode = HT_CHANNEL_WIDTH_40; @@ -22283,78 +21565,57 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - break; - } - -+ //delay 50ms to protect nulldata(1). -+ set_survey_timer(pmlmeext, 50); -+ return H2C_SUCCESS; ++ write_initial_gain = 0; } - - } - +- } +- - //TODO: need to judge the phy parameters on concurrent mode for single phy - //set_channel_bwmode(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset, pmlmeext->cur_bwmode); - set_channel_bwmode(padapter, cur_channel, cur_ch_offset, cur_bwmode); - - DBG_871X("CH=%d, BW=%d, offset=%d\n", cur_channel, cur_bwmode, cur_ch_offset); -+ if ((pmlmeext->sitesurvey_res.state == SCAN_START) || (pmlmeext->sitesurvey_res.state == SCAN_TXNULL)) -+ { -+#ifdef CONFIG_FIND_BEST_CHANNEL -+#if 0 -+ for (i=0; pmlmeext->channel_set[i].ChannelNum !=0; i++) { -+ pmlmeext->channel_set[i].rx_count = 0; -+ } -+#endif -+#endif /* CONFIG_FIND_BEST_CHANNEL */ - +- - // - pmlmeext->cur_channel = cur_channel; - pmlmeext->cur_bwmode = cur_bwmode; - pmlmeext->cur_ch_offset = cur_ch_offset; - pmlmeext->cur_wireless_mode = pmlmepriv->cur_network.network_type; -+ //disable dynamic functions, such as high power, DIG -+ Save_DM_Func_Flag(padapter); -+ Switch_DM_Func(padapter, DYNAMIC_FUNC_DISABLE, _FALSE); ++ else ++#endif //CONFIG_IOCTL_CFG80211 ++ if ( !rtw_p2p_chk_state( pwdinfo, P2P_STATE_NONE ) ) ++ initialgain = 0x28; ++ else ++#endif //CONFIG_P2P ++ initialgain = 0x17; - //update cur_wireless_mode - update_wireless_mode(padapter); - - //let pnetwork_mlmeext == pnetwork_mlme. - _rtw_memcpy(pnetwork_mlmeext, pnetwork, pnetwork->Length); -+ //config the initial gain under scaning, need to write the BB registers ++ if(write_initial_gain == 1) ++ rtw_hal_set_hwreg(padapter, HW_VAR_INITIAL_GAIN, (u8 *)(&initialgain)); - #ifdef CONFIG_P2P +-#ifdef CONFIG_P2P - _rtw_memcpy(pwdinfo->p2p_group_ssid, pnetwork->Ssid.Ssid, pnetwork->Ssid.SsidLength); - pwdinfo->p2p_group_ssid_len = pnetwork->Ssid.SsidLength; -+#ifdef CONFIG_IOCTL_CFG80211 -+ if((wdev_to_priv(padapter->rtw_wdev))->p2p_enabled == _TRUE && pwdinfo->driver_interface == DRIVER_CFG80211 ) -+ { -+ write_initial_gain = 0; -+ } -+ else -+#endif //CONFIG_IOCTL_CFG80211 -+ if ( !rtw_p2p_chk_state( pwdinfo, P2P_STATE_NONE ) ) -+ initialgain = 0x28; -+ else - #endif //CONFIG_P2P -+ initialgain = 0x17; +-#endif //CONFIG_P2P ++ //set MSR to no link state ++ Set_MSR(padapter, _HW_STATE_NOLINK_); - - if(_TRUE == pmlmeext->bstart_bss) - { - update_beacon(padapter, _TIM_IE_, NULL, _FALSE); -+ if(write_initial_gain == 1) -+ rtw_hal_set_hwreg(padapter, HW_VAR_INITIAL_GAIN, (u8 *)(&initialgain)); ++ val8 = 1; //under site survey ++ rtw_hal_set_hwreg(padapter, HW_VAR_MLME_SITESURVEY, (u8 *)(&val8)); - //issue beacon frame - if(send_beacon(padapter)==_FAIL) - { - DBG_871X("issue_beacon, fail!\n"); - } -+ //set MSR to no link state -+ Set_MSR(padapter, _HW_STATE_NOLINK_); -+ -+ val8 = 1; //under site survey -+ rtw_hal_set_hwreg(padapter, HW_VAR_MLME_SITESURVEY, (u8 *)(&val8)); -+ + pmlmeext->sitesurvey_res.state = SCAN_PROCESS; } @@ -22463,14 +21724,14 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release +#endif //CONFIG_TDLS - _rtw_memcpy(pbss_network->MacAddress, myid(&(padapter->eeprompriv)), ETH_ALEN); -+ //cam_entry: -+ //0~3 for default key - +- - //beacon interval - p = rtw_get_beacon_interval_from_ie(ie);//ie + 8; // 8: TimeStamp, 2: Beacon Interval 2:Capability - //pbss_network->Configuration.BeaconPeriod = le16_to_cpu(*(unsigned short*)p); - pbss_network->Configuration.BeaconPeriod = RTW_GET_LE16(p); -- ++ //cam_entry: ++ //0~3 for default key + - //capability - //cap = *(unsigned short *)rtw_get_capability_from_ie(ie); - //cap = le16_to_cpu(cap); @@ -22479,26 +21740,33 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + //default key is disable, using sw encrypt/decrypt + //cam_entry = 4 //for sta mode (macid=0) + //cam_entry(macid+3) = 5 ~ N//for ap mode (aid=1~N, macid=2 ~N) -+ -+ //for concurrent mode (sta+sta): -+ //default key is disable, using sw encrypt/decrypt -+ //cam_entry = 4 //mapping to macid=0 -+ //cam_entry = 5 //mapping to macid=2 - //SSID - p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _SSID_IE_, &ie_len, (pbss_network->IELength -_BEACON_IE_OFFSET_)); - if(p && ie_len>0) ++ //for concurrent mode (sta+sta): ++ //default key is disable, using sw encrypt/decrypt ++ //cam_entry = 4 //mapping to macid=0 ++ //cam_entry = 5 //mapping to macid=2 ++ +#ifdef CONFIG_CONCURRENT_MODE + if((pmlmeinfo->state&0x03) == WIFI_FW_STATION_STATE) { - _rtw_memset(&pbss_network->Ssid, 0, sizeof(NDIS_802_11_SSID)); - _rtw_memcpy(pbss_network->Ssid.Ssid, (p + 2), ie_len); - pbss_network->Ssid.SsidLength = ie_len; +- } + struct sta_priv *pstapriv = &padapter->stapriv; + struct sta_info *psta; + + psta = rtw_get_stainfo(pstapriv, pmlmeinfo->network.MacAddress); -+ + +- //chnnel +- channel = 0; +- pbss_network->Configuration.Length = 0; +- p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _DSSET_IE_, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_)); +- if(p && ie_len>0) +- channel = *(p + 2); + if(psta && psta->mac_id==2) + { + cam_id = 5; @@ -22517,20 +21785,13 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + cam_id = 4; + } +*/ - } ++ } +#else + cam_id = 4; +#endif -- //chnnel -- channel = 0; -- pbss_network->Configuration.Length = 0; -- p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _DSSET_IE_, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_)); -- if(p && ie_len>0) -- channel = *(p + 2); -- - pbss_network->Configuration.DSConfig = channel; -- + - - _rtw_memset(supportRate, 0, NDIS_802_11_LENGTH_RATES_EX); - // get supported rates @@ -22544,7 +21805,6 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - //get ext_supported rates - p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _EXT_SUPPORTEDRATES_IE_, &ie_len, pbss_network->IELength - _BEACON_IE_OFFSET_); - if (p != NULL) -+ + if((pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE) { - _rtw_memcpy(supportRate+supportRateNum, p+2, ie_len); @@ -22553,11 +21813,10 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - } - - network_type = rtw_check_network_type(supportRate, supportRateNum, channel); -- -- rtw_set_supported_rate(pbss_network->SupportedRates, network_type); + struct sta_info *psta; + struct sta_priv *pstapriv = &padapter->stapriv; +- rtw_set_supported_rate(pbss_network->SupportedRates, network_type); + if(pparm->algorithm == _NO_PRIVACY_) // clear cam entry + { + clear_cam_entry(padapter, pparm->id); @@ -22569,6 +21828,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + { + ctrl = (BIT(15) | ((pparm->algorithm) << 2)); ++ DBG_871X("r871x_set_stakey_hdl(): enc_algorithm=%d\n", pparm->algorithm); + - //parsing ERP_IE - p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _ERPINFO_IE_, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_)); - if(p && ie_len>0) @@ -22645,7 +21906,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - { - DBG_8192C("%s id=0x%x len=%d rem=%d next p %p\n",__FUNCTION__,*p,p[1],rem,p + (p[1]+2)); - if ((p) && (_rtw_memcmp(p+2, OUI1, 4))) -- { ++ if((psta->mac_id<1) || (psta->mac_id>(NUM_STA-4))) + { - //remove wpa ie - u32 remain=0; - u8 *ptr; @@ -22674,15 +21936,12 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - } - } -#else //SUPPORT_64_STA -+ DBG_871X("r871x_set_stakey_hdl(): enc_algorithm=%d\n", pparm->algorithm); - +- - //update privacy/security - if (cap & BIT(4)) - pbss_network->Privacy = 1; - else - pbss_network->Privacy = 0; -+ if((psta->mac_id<1) || (psta->mac_id>(NUM_STA-4))) -+ { + DBG_871X("r871x_set_stakey_hdl():set_stakey failed, mac_id(aid)=%d\n", psta->mac_id); + return H2C_REJECTED; + } @@ -22779,8 +22038,6 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - psecuritypriv->dot11AuthAlgrthm= dot11AuthAlgrthm_8021X; - - psecuritypriv->dot8021xalg = 1;//psk, todo:802.1x -- -- psecuritypriv->wpa_psk |= BIT(0); + clear_cam_entry(padapter, pparm->id); + return H2C_SUCCESS; + } @@ -22792,10 +22049,19 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + clear_cam_entry(padapter, ptdlsinfo->clear_cam); + ptdlsinfo->clear_cam=0; +- psecuritypriv->wpa_psk |= BIT(0); ++ return H2C_SUCCESS; ++ } + - psecuritypriv->wpa_group_cipher = group_cipher; - psecuritypriv->wpa_pairwise_cipher = pairwise_cipher; -+ return H2C_SUCCESS; ++ psta = rtw_get_stainfo(pstapriv, pparm->addr);//Get TDLS Peer STA ++ if( psta->tdls_sta_state&TDLS_LINKED_STATE ){ ++ write_cam(padapter, psta->mac_id, ctrl, pparm->addr, pparm->key); + } ++ else ++#endif //CONFIG_TDLS ++ write_cam(padapter, cam_id, ctrl, pparm->addr, pparm->key); -#if 0 - switch(group_cipher) @@ -22816,13 +22082,10 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - psecuritypriv->wpa_group_cipher = _WEP104_; - break; - } -+ psta = rtw_get_stainfo(pstapriv, pparm->addr);//Get TDLS Peer STA -+ if( psta->tdls_sta_state&TDLS_LINKED_STATE ){ -+ write_cam(padapter, psta->mac_id, ctrl, pparm->addr, pparm->key); -+ } -+ else -+#endif //CONFIG_TDLS -+ write_cam(padapter, cam_id, ctrl, pparm->addr, pparm->key); ++ pmlmeinfo->enc_algo = pparm->algorithm; ++ ++ return H2C_SUCCESS; ++} - switch(pairwise_cipher) - { @@ -22844,10 +22107,11 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - } -#endif - } -+ pmlmeinfo->enc_algo = pparm->algorithm; -+ -+ return H2C_SUCCESS; -+} ++u8 add_ba_hdl(_adapter *padapter, unsigned char *pbuf) ++{ ++ struct addBaReq_parm *pparm = (struct addBaReq_parm *)pbuf; ++ struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; ++ struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); - break; - @@ -22857,12 +22121,6 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - { - break; - } -+u8 add_ba_hdl(_adapter *padapter, unsigned char *pbuf) -+{ -+ struct addBaReq_parm *pparm = (struct addBaReq_parm *)pbuf; -+ struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; -+ struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); -+ + struct sta_info *psta = rtw_get_stainfo(&padapter->stapriv, pparm->addr); + + if(!psta) @@ -23256,21 +22514,14 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - WLAN_BSSID_EX *pnetwork = &(pmlmeinfo->network); - unsigned char *ie = pnetwork->IEs; - u32 ielen = pnetwork->IELength; -- -- -- DBG_871X("%s\n", __FUNCTION__); + u8 network_type,rate_len, total_rate_len,remainder_rate_len; + struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); + struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); + u8 erpinfo=0x4; -- pwps_ie = rtw_get_wps_ie(ie+_FIXED_IE_LENGTH_, ielen-_FIXED_IE_LENGTH_, NULL, &wps_ielen); -- -- if(pwps_ie==NULL || wps_ielen==0) -- return; + //DBG_871X("%s\n", __FUNCTION__); -- wps_offset = (uint)(pwps_ie-ie); +- DBG_871X("%s\n", __FUNCTION__); + if(pmlmeext->cur_channel >= 36) + { + network_type = WIRELESS_11A; @@ -23286,19 +22537,17 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + rtw_add_bcn_ie(padapter, pnetwork, _ERPINFO_IE_, &erpinfo, 1); + } -- premainder_ie = pwps_ie + wps_ielen; +- pwps_ie = rtw_get_wps_ie(ie+_FIXED_IE_LENGTH_, ielen-_FIXED_IE_LENGTH_, NULL, &wps_ielen); +- +- if(pwps_ie==NULL || wps_ielen==0) +- return; + rtw_set_supported_rate(pnetwork->SupportedRates, network_type); - -- remainder_ielen = ielen - wps_offset - wps_ielen; ++ + UpdateBrateTbl(padapter, pnetwork->SupportedRates); + rtw_hal_set_hwreg(padapter, HW_VAR_BASIC_RATE, pnetwork->SupportedRates); - -- if(remainder_ielen>0) ++ + if(total_rate_len > 8) - { -- pbackup_remainder_ie = rtw_malloc(remainder_ielen); -- if(pbackup_remainder_ie) -- _rtw_memcpy(pbackup_remainder_ie, premainder_ie, remainder_ielen); ++ { + rate_len = 8; + remainder_rate_len = total_rate_len - 8; + } @@ -23306,21 +22555,13 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + { + rate_len = total_rate_len; + remainder_rate_len = 0; - } - -- -- pwps_ie_src = pmlmepriv->wps_beacon_ie; -- if(pwps_ie_src == NULL) -- return; -- ++ } ++ + rtw_add_bcn_ie(padapter, pnetwork, _SUPPORTEDRATES_IE_, pnetwork->SupportedRates, rate_len); -- wps_ielen = (uint)pwps_ie_src[1];//to get ie data len -- if((wps_offset+wps_ielen+2+remainder_ielen)<=MAX_IE_SZ) +- wps_offset = (uint)(pwps_ie-ie); + if(remainder_rate_len) - { -- _rtw_memcpy(pwps_ie, pwps_ie_src, wps_ielen+2); -- pwps_ie += (wps_ielen+2); ++ { + rtw_add_bcn_ie(padapter, pnetwork, _EXT_SUPPORTEDRATES_IE_, (pnetwork->SupportedRates+8), remainder_rate_len); + } + else @@ -23329,19 +22570,15 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + } +} -- if(pbackup_remainder_ie) -- _rtw_memcpy(pwps_ie, pbackup_remainder_ie, remainder_ielen); +- premainder_ie = pwps_ie + wps_ielen; -- //update IELength -- pnetwork->IELength = wps_offset + (wps_ielen+2) + remainder_ielen; -- } +- remainder_ielen = ielen - wps_offset - wps_ielen; +#ifdef CONFIG_DUALMAC_CONCURRENT +void dc_SelectChannel(_adapter *padapter, unsigned char channel) +{ + PADAPTER ptarget_adapter; -- if(pbackup_remainder_ie) -- rtw_mfree(pbackup_remainder_ie, remainder_ielen); +- if(remainder_ielen>0) + if( (padapter->pbuddy_adapter != NULL) && + (padapter->DualMacConcurrent == _TRUE) && + (padapter->adapter_type == SECONDARY_ADAPTER)) @@ -23350,60 +22587,79 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + ptarget_adapter = padapter->pbuddy_adapter; + } + else -+ { + { +- pbackup_remainder_ie = rtw_malloc(remainder_ielen); +- if(pbackup_remainder_ie) +- _rtw_memcpy(pbackup_remainder_ie, premainder_ie, remainder_ielen); + ptarget_adapter = padapter; -+ } + } --} +- +- pwps_ie_src = pmlmepriv->wps_beacon_ie; +- if(pwps_ie_src == NULL) +- return; + _enter_critical_mutex(&(adapter_to_dvobj(ptarget_adapter)->setch_mutex), NULL); --static void update_bcn_p2p_ie(_adapter *padapter) --{ + rtw_hal_set_chan(ptarget_adapter, channel); +- wps_ielen = (uint)pwps_ie_src[1];//to get ie data len +- if((wps_offset+wps_ielen+2+remainder_ielen)<=MAX_IE_SZ) +- { +- _rtw_memcpy(pwps_ie, pwps_ie_src, wps_ielen+2); +- pwps_ie += (wps_ielen+2); + _exit_critical_mutex(&(adapter_to_dvobj(ptarget_adapter)->setch_mutex), NULL); - } ++} --static void update_bcn_vendor_spec_ie(_adapter *padapter, u8*oui) +- if(pbackup_remainder_ie) +- _rtw_memcpy(pwps_ie, pbackup_remainder_ie, remainder_ielen); +void dc_SetBWMode(_adapter *padapter, unsigned short bwmode, unsigned char channel_offset) - { -- DBG_871X("%s\n", __FUNCTION__); ++{ + PADAPTER ptarget_adapter; -- if(_rtw_memcmp(WPA_OUI, oui, 4)) +- //update IELength +- pnetwork->IELength = wps_offset + (wps_ielen+2) + remainder_ielen; + if( (padapter->pbuddy_adapter != NULL) && + (padapter->DualMacConcurrent == _TRUE) && + (padapter->adapter_type == SECONDARY_ADAPTER)) - { -- update_bcn_wpa_ie(padapter); ++ { + // only mac0 could control BB&RF + ptarget_adapter = padapter->pbuddy_adapter; - } -- else if(_rtw_memcmp(WMM_OUI, oui, 4)) ++ } + else - { -- update_bcn_wmm_ie(padapter); ++ { + ptarget_adapter = padapter; } -- else if(_rtw_memcmp(WPS_OUI, oui, 4)) -+ + +- if(pbackup_remainder_ie) +- rtw_mfree(pbackup_remainder_ie, remainder_ielen); +- +-} + _enter_critical_mutex(&(adapter_to_dvobj(ptarget_adapter)->setbw_mutex), NULL); -+ + +-static void update_bcn_p2p_ie(_adapter *padapter) +-{ + rtw_hal_set_bwmode(ptarget_adapter, (HT_CHANNEL_WIDTH)bwmode, channel_offset); -+ + + _exit_critical_mutex(&(adapter_to_dvobj(ptarget_adapter)->setbw_mutex), NULL); -+} -+ + } + +-static void update_bcn_vendor_spec_ie(_adapter *padapter, u8*oui) +void dc_set_channel_bwmode_disconnect(_adapter *padapter) -+{ + { +- DBG_871X("%s\n", __FUNCTION__); + struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; + PADAPTER pbuddy_adapter = padapter->pbuddy_adapter; + struct mlme_priv *pbuddy_mlmepriv = NULL; -+ + +- if(_rtw_memcmp(WPA_OUI, oui, 4)) +- { +- update_bcn_wpa_ie(padapter); +- } +- else if(_rtw_memcmp(WMM_OUI, oui, 4)) + if(pbuddy_adapter != NULL && + padapter->DualMacConcurrent == _TRUE) { -- update_bcn_wps_ie(padapter); +- update_bcn_wmm_ie(padapter); + pbuddy_mlmepriv = &(pbuddy_adapter->mlmepriv); + if((check_fwstate(pbuddy_mlmepriv, _FW_LINKED)) != _TRUE) + { @@ -23414,17 +22670,17 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + set_channel_bwmode(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset, pmlmeext->cur_bwmode); + } } -- else if(_rtw_memcmp(P2P_OUI, oui, 4)) +- else if(_rtw_memcmp(WPS_OUI, oui, 4)) + else { -- update_bcn_p2p_ie(padapter); +- update_bcn_wps_ie(padapter); + //switch to the 20M Hz mode after disconnect + pmlmeext->cur_bwmode = HT_CHANNEL_WIDTH_20; + pmlmeext->cur_ch_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE; + + set_channel_bwmode(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset, pmlmeext->cur_bwmode); } -- else +- else if(_rtw_memcmp(P2P_OUI, oui, 4)) +} + +u8 dc_handle_join_request(_adapter *padapter) @@ -23440,10 +22696,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + if(pbuddy_adapter != NULL && + padapter->DualMacConcurrent == _TRUE) { -- DBG_871X("unknown OUI type!\n"); -- } -- -- +- update_bcn_p2p_ie(padapter); + pbuddy_mlmeext = &pbuddy_adapter->mlmeextpriv; + pbuddy_mlmepriv = &(pbuddy_adapter->mlmepriv); + @@ -23482,7 +22735,13 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + { + issue_nulldata(pbuddy_adapter, NULL, 1, 0, 0); + } -+ } + } +- else +- { +- DBG_871X("unknown OUI type!\n"); +- } +- +- + + return ret; } @@ -23708,17 +22967,13 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - int op_mode_changes = 0; - struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); - struct ht_priv *phtpriv_ap = &pmlmepriv->htpriv; -+ PADAPTER pbuddy_adapter = padapter->pbuddy_adapter; -+ struct mlme_priv *pbuddy_mlmepriv = NULL; - +- - if(pmlmepriv->htpriv.ht_option == _TRUE) - return 0; - - //if (!iface->conf->ieee80211n || iface->conf->ht_op_mode_fixed) - // return 0; -+ if(padapter->pbuddy_adapter != NULL && -+ padapter->DualMacConcurrent == _TRUE) - +- - DBG_871X("%s current operation mode=0x%X\n", - __FUNCTION__, pmlmepriv->ht_op_mode); - @@ -23762,13 +23017,18 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - new_op_mode = OP_MODE_MAY_BE_LEGACY_STAS; - else - new_op_mode = OP_MODE_PURE; -- ++ PADAPTER pbuddy_adapter = padapter->pbuddy_adapter; ++ struct mlme_priv *pbuddy_mlmepriv = NULL; + - cur_op_mode = pmlmepriv->ht_op_mode & HT_INFO_OPERATION_MODE_OP_MODE_MASK; - if (cur_op_mode != new_op_mode) { - pmlmepriv->ht_op_mode &= ~HT_INFO_OPERATION_MODE_OP_MODE_MASK; - pmlmepriv->ht_op_mode |= new_op_mode; - op_mode_changes++; - } ++ if(padapter->pbuddy_adapter != NULL && ++ padapter->DualMacConcurrent == _TRUE) ++ + { + pbuddy_mlmepriv = &(pbuddy_adapter->mlmepriv); @@ -23858,19 +23118,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } -#endif +} - -- if(!(psta->capability & WLAN_CAPABILITY_SHORT_SLOT)) -- { -- if(!psta->no_short_slot_time_set) -- { -- psta->no_short_slot_time_set = 1; -- -- pmlmepriv->num_sta_no_short_slot_time++; -- -- if ((pmlmeext->cur_wireless_mode > WIRELESS_11B) && -- (pmlmepriv->num_sta_no_short_slot_time == 1)) -- update_beacon(padapter, 0xFF, NULL, _TRUE); -- ++ +void dc_set_channel_bwmode_survey_done(_adapter *padapter) +{ + struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); @@ -23882,16 +23130,26 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + u8 cur_channel; + u8 cur_bwmode; + u8 cur_ch_offset; -+ + +- if(!(psta->capability & WLAN_CAPABILITY_SHORT_SLOT)) + if(pbuddy_adapter != NULL && + padapter->DualMacConcurrent == _TRUE) -+ { + { +- if(!psta->no_short_slot_time_set) + pbuddy_mlmepriv = &(pbuddy_adapter->mlmepriv); + pbuddy_mlmeext = &pbuddy_adapter->mlmeextpriv; + pbuddy_mlmeinfo = &(pbuddy_mlmeext->mlmext_info); + + if(check_fwstate(pbuddy_mlmepriv, _FW_LINKED)) -+ { + { +- psta->no_short_slot_time_set = 1; +- +- pmlmepriv->num_sta_no_short_slot_time++; +- +- if ((pmlmeext->cur_wireless_mode > WIRELESS_11B) && +- (pmlmepriv->num_sta_no_short_slot_time == 1)) +- update_beacon(padapter, 0xFF, NULL, _TRUE); +- + if(check_fwstate(pmlmepriv, _FW_LINKED) && + (pmlmeext->cur_bwmode == HT_CHANNEL_WIDTH_40)) + { @@ -23983,7 +23241,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + set_channel_bwmode(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset, pmlmeext->cur_bwmode); } +} - ++ +void dc_set_ap_channel_bandwidth(_adapter *padapter, u8 channel, u8 channel_offset, u8 bwmode) +{ + u8 *p; @@ -23998,16 +23256,15 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + _adapter *pbuddy_adapter = padapter->pbuddy_adapter; + struct mlme_priv *pbuddy_mlmepriv = NULL; + struct mlme_ext_priv *pbuddy_mlmeext = NULL; -+ + + DBG_871X("dualmac_concurrent_ap_set_channel_bwmode ==>\n"); -+ + +-#ifdef CONFIG_80211N_HT + cur_channel = channel; + cur_bwmode = bwmode; + cur_ch_offset = channel_offset; + change_band = _FALSE; --#ifdef CONFIG_80211N_HT -- - if (psta->flags & WLAN_STA_HT) + p = rtw_get_ie((pnetwork->IEs + sizeof(NDIS_802_11_FIXED_IEs)), _HT_ADD_INFO_IE_, &ie_len, (pnetwork->IELength - sizeof(NDIS_802_11_FIXED_IEs))); + if( p && ie_len) @@ -24080,10 +23337,6 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + { + if(pht_info) + pht_info->infos[0] &= ~(BIT(0)|BIT(1)); -+ -+ if(pbuddy_mlmeext->cur_bwmode == HT_CHANNEL_WIDTH_40) -+ { -+ cur_ch_offset = pbuddy_mlmeext->cur_ch_offset; - if (rtw_ht_operation_update(padapter) > 0) - { @@ -24092,6 +23345,11 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - } - -#endif /* CONFIG_80211N_HT */ ++ if(pbuddy_mlmeext->cur_bwmode == HT_CHANNEL_WIDTH_40) ++ { ++ cur_ch_offset = pbuddy_mlmeext->cur_ch_offset; + +-} + //to update cur_ch_offset value in beacon + if(pht_info) + { @@ -24114,40 +23372,38 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + cur_bwmode = HT_CHANNEL_WIDTH_20; + cur_ch_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE; --} -+ if(cur_channel>0 && cur_channel<5) -+ { -+ if(pht_info) -+ pht_info->infos[0] |= 0x1; - -void ap_free_sta(_adapter *padapter, struct sta_info *psta) -{ - _irqL irqL; - struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); - struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); - struct sta_priv *pstapriv = &padapter->stapriv; ++ if(cur_channel>0 && cur_channel<5) ++ { ++ if(pht_info) ++ pht_info->infos[0] |= 0x1; + +- if(!psta) +- return; + cur_bwmode = HT_CHANNEL_WIDTH_40; + cur_ch_offset = HAL_PRIME_CHNL_OFFSET_LOWER; + } -- if(!psta) -- return; + if(cur_channel>7 && cur_channel<(14+1)) + { + if(pht_info) + pht_info->infos[0] |= 0x3; -+ cur_bwmode = HT_CHANNEL_WIDTH_40; -+ cur_ch_offset = HAL_PRIME_CHNL_OFFSET_UPPER; -+ } - - if (psta->nonerp_set) { - psta->nonerp_set = 0; - pmlmepriv->num_sta_non_erp--; - if (pmlmepriv->num_sta_non_erp == 0) - update_beacon(padapter, _ERPINFO_IE_, NULL, _TRUE); - } -- ++ cur_bwmode = HT_CHANNEL_WIDTH_40; ++ cur_ch_offset = HAL_PRIME_CHNL_OFFSET_UPPER; ++ } + - if (psta->no_short_slot_time_set) { - psta->no_short_slot_time_set = 0; - pmlmepriv->num_sta_no_short_slot_time--; @@ -24155,7 +23411,10 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - && pmlmepriv->num_sta_no_short_slot_time == 0) - update_beacon(padapter, 0xFF, NULL, _TRUE); - } -- ++ set_channel_bwmode(padapter, cur_channel, cur_ch_offset, cur_bwmode); ++ } ++ } + - if (psta->no_short_preamble_set) { - psta->no_short_preamble_set = 0; - pmlmepriv->num_sta_no_short_preamble--; @@ -24165,39 +23424,35 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - } - -#ifdef CONFIG_80211N_HT -+ set_channel_bwmode(padapter, cur_channel, cur_ch_offset, cur_bwmode); -+ } -+ } - -- if (psta->no_ht_gf_set) { -- psta->no_ht_gf_set = 0; -- pmlmepriv->num_sta_ht_no_gf--; -- } + // to update channel value in beacon + pnetwork->Configuration.DSConfig = cur_channel; + p = rtw_get_ie((pnetwork->IEs + sizeof(NDIS_802_11_FIXED_IEs)), _DSSET_IE_, &ie_len, (pnetwork->IELength - sizeof(NDIS_802_11_FIXED_IEs))); + if(p && ie_len>0) + *(p + 2) = cur_channel; -- if (psta->no_ht_set) { -- psta->no_ht_set = 0; -- pmlmepriv->num_sta_no_ht--; +- if (psta->no_ht_gf_set) { +- psta->no_ht_gf_set = 0; +- pmlmepriv->num_sta_ht_no_gf--; + if(pht_info) + pht_info->primary_channel = cur_channel; + } } - -- if (psta->ht_20mhz_set) { -- psta->ht_20mhz_set = 0; -- pmlmepriv->num_sta_ht_20mhz--; +- if (psta->no_ht_set) { +- psta->no_ht_set = 0; +- pmlmepriv->num_sta_no_ht--; + else + { + set_channel_bwmode(padapter, cur_channel, cur_ch_offset, cur_bwmode); } -- if (rtw_ht_operation_update(padapter) > 0) +- if (psta->ht_20mhz_set) { +- psta->ht_20mhz_set = 0; +- pmlmepriv->num_sta_ht_20mhz--; +- } + DBG_871X("CH=%d, BW=%d, offset=%d\n", cur_channel, cur_bwmode, cur_ch_offset); -+ + +- if (rtw_ht_operation_update(padapter) > 0) + if((channel <= 14 && cur_channel >= 36) || + (channel >= 36 && cur_channel <= 14)) { @@ -24316,19 +23571,19 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - plist = get_next(plist); - - rtw_list_delete(&psta->asoc_list); -+ pbuddy_adapter = padapter->pbuddy_adapter; - +- - //_exit_critical_bh(&pstapriv->asoc_list_lock, &irqL); - ap_free_sta(padapter, psta); - //_enter_critical_bh(&pstapriv->asoc_list_lock, &irqL); - } - _exit_critical_bh(&pstapriv->asoc_list_lock, &irqL); ++ pbuddy_adapter = padapter->pbuddy_adapter; + + if(pbuddy_adapter == NULL) + return _FALSE; - - issue_deauth(padapter, bc_addr, WLAN_REASON_DEAUTH_LEAVING); -- + - return ret; + pbuddy_mlmeext = &pbuddy_adapter->mlmeextpriv; + pbuddy_mlmeinfo = &(pbuddy_mlmeext->mlmext_info); @@ -24371,61 +23626,50 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release -#ifdef CONFIG_80211N_HT - //update 802.11n ht cap. - if(WLAN_STA_HT&flags) -- { -- psta->htpriv.ht_option = _TRUE; -- psta->qos_option = 1; -- } -- else + + if(!rtw_buddy_adapter_up(padapter)) { -- psta->htpriv.ht_option = _FALSE; +- psta->htpriv.ht_option = _TRUE; +- psta->qos_option = 1; + set_channel_bwmode(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset, pmlmeext->cur_bwmode); + return; } -- -- if(pmlmepriv->htpriv.ht_option == _FALSE) -- psta->htpriv.ht_option = _FALSE; --#endif - +- else ++ + pbuddy_adapter = padapter->pbuddy_adapter; + pbuddy_mlmepriv = &(pbuddy_adapter->mlmepriv); + pbuddy_mlmeext = &pbuddy_adapter->mlmeextpriv; + pbuddy_mlmeinfo = &(pbuddy_mlmeext->mlmext_info); + pbuddy_network_mlmeext = &(pbuddy_mlmeinfo->network); - -- update_sta_info_apmode(padapter, psta); -- ++ + if(((pbuddy_mlmeinfo->state&0x03) == WIFI_FW_AP_STATE) && + check_fwstate(pbuddy_mlmepriv, _FW_LINKED)) -+ { + { +- psta->htpriv.ht_option = _FALSE; +- } + //restart and update beacon - --} ++ + DBG_871X("after join,primary adapter, CH=%d, BW=%d, offset=%d\n" + , pmlmeext->cur_channel, pmlmeext->cur_bwmode, pmlmeext->cur_ch_offset); -+ + +- if(pmlmepriv->htpriv.ht_option == _FALSE) +- psta->htpriv.ht_option = _FALSE; +-#endif --/* called >= TSR LEVEL for USB or SDIO Interface*/ --void ap_sta_info_defer_update(_adapter *padapter, struct sta_info *psta) --{ -- if(psta->state & _FW_LINKED) -- { -- //add ratid -- add_RATid(padapter, psta); -- } --} + if(join_res >= 0) + { + u8 *p; + int ie_len; + u8 change_band = _FALSE; + struct HT_info_element *pht_info=NULL; -+ + +- update_sta_info_apmode(padapter, psta); +- + if((pmlmeext->cur_channel <= 14 && pbuddy_mlmeext->cur_channel >= 36) || + (pmlmeext->cur_channel >= 36 && pbuddy_mlmeext->cur_channel <= 14)) + change_band = _TRUE; -+ + +-} + //sync channel/bwmode/ch_offset with primary adapter + pbuddy_mlmeext->cur_channel = pmlmeext->cur_channel; + if(pbuddy_mlmeext->cur_bwmode == HT_CHANNEL_WIDTH_40) @@ -24441,17 +23685,15 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + { + pbuddy_mlmeext->cur_ch_offset = pmlmeext->cur_ch_offset; --void start_ap_mode(_adapter *padapter) +-/* called >= TSR LEVEL for USB or SDIO Interface*/ +-void ap_sta_info_defer_update(_adapter *padapter, struct sta_info *psta) -{ -- int i; -- struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); -- struct sta_priv *pstapriv = &padapter->stapriv; -- struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; -- -- pmlmepriv->update_bcn = _FALSE; -- -- //init_mlme_ap_info(padapter); -- pmlmeext->bstart_bss = _FALSE; +- if(psta->state & _FW_LINKED) +- { +- //add ratid +- add_RATid(padapter, psta); +- } +-} + //to update cur_ch_offset value in beacon + if( pht_info ) + { @@ -24478,7 +23720,17 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + if(pht_info) + pht_info->infos[0] |= HT_INFO_HT_PARAM_SECONDARY_CHNL_ABOVE; -- pmlmepriv->num_sta_non_erp = 0; +-void start_ap_mode(_adapter *padapter) +-{ +- int i; +- struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); +- struct sta_priv *pstapriv = &padapter->stapriv; +- struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; +- +- pmlmepriv->update_bcn = _FALSE; +- +- //init_mlme_ap_info(padapter); +- pmlmeext->bstart_bss = _FALSE; + pbuddy_mlmeext->cur_bwmode = HT_CHANNEL_WIDTH_40; + pbuddy_mlmeext->cur_ch_offset = HAL_PRIME_CHNL_OFFSET_LOWER; + } @@ -24538,15 +23790,15 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + pbuddy_mlmeext->cur_ch_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE; + break; -- pmlmepriv->num_sta_no_short_slot_time = 0; +- pmlmepriv->num_sta_non_erp = 0; + } + + } -- pmlmepriv->num_sta_no_short_preamble = 0; +- pmlmepriv->num_sta_no_short_slot_time = 0; + } -- pmlmepriv->num_sta_ht_no_gf = 0; +- pmlmepriv->num_sta_no_short_preamble = 0; + set_channel_bwmode(padapter, pbuddy_mlmeext->cur_channel, pbuddy_mlmeext->cur_ch_offset, pbuddy_mlmeext->cur_bwmode); + + } @@ -24555,24 +23807,30 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + set_channel_bwmode(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset, pmlmeext->cur_bwmode); + } +- pmlmepriv->num_sta_ht_no_gf = 0; + - pmlmepriv->num_sta_no_ht = 0; - - pmlmepriv->num_sta_ht_20mhz = 0; - -- pmlmepriv->olbc = _FALSE; + // to update channel value in beacon + pbuddy_network_mlmeext->Configuration.DSConfig = pmlmeext->cur_channel; + p = rtw_get_ie((pbuddy_network_mlmeext->IEs + sizeof(NDIS_802_11_FIXED_IEs)), _DSSET_IE_, &ie_len, (pbuddy_network_mlmeext->IELength - sizeof(NDIS_802_11_FIXED_IEs))); + if(p && ie_len>0) + *(p + 2) = pmlmeext->cur_channel; -+ + +- pmlmepriv->olbc = _FALSE; + p = rtw_get_ie((pbuddy_network_mlmeext->IEs + sizeof(NDIS_802_11_FIXED_IEs)), _HT_ADD_INFO_IE_, &ie_len, (pbuddy_network_mlmeext->IELength - sizeof(NDIS_802_11_FIXED_IEs))); + if( p && ie_len) + { + pht_info = (struct HT_info_element *)(p+2); + pht_info->primary_channel = pmlmeext->cur_channel; + } -+ + +- pmlmepriv->olbc_ht = _FALSE; +- +-#ifdef CONFIG_80211N_HT +- pmlmepriv->ht_op_mode = 0; +-#endif + //buddy interface band is different from current interface, update ERP, support rate, ext support rate IE + if(change_band == _TRUE) + change_band_update_ie(pbuddy_adapter, pbuddy_network_mlmeext); @@ -24583,22 +23841,20 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + set_channel_bwmode(padapter, pbuddy_mlmeext->cur_channel, pbuddy_mlmeext->cur_ch_offset, pbuddy_mlmeext->cur_bwmode); + } -- pmlmepriv->olbc_ht = _FALSE; -- --#ifdef CONFIG_80211N_HT -- pmlmepriv->ht_op_mode = 0; --#endif -+ DBG_871X("after join, second adapter, CH=%d, BW=%d, offset=%d\n", pbuddy_mlmeext->cur_channel, pbuddy_mlmeext->cur_bwmode, pbuddy_mlmeext->cur_ch_offset); - - for(i=0; ista_aid[i] = NULL; -+ DBG_871X("update pbuddy_adapter's beacon\n"); -+ -+ update_beacon(pbuddy_adapter, 0, NULL, _TRUE); ++ DBG_871X("after join, second adapter, CH=%d, BW=%d, offset=%d\n", pbuddy_mlmeext->cur_channel, pbuddy_mlmeext->cur_bwmode, pbuddy_mlmeext->cur_ch_offset); - pmlmepriv->wps_beacon_ie = NULL; - pmlmepriv->wps_probe_resp_ie = NULL; - pmlmepriv->wps_assoc_resp_ie = NULL; +- +- pmlmepriv->p2p_beacon_ie = NULL; +- pmlmepriv->p2p_probe_resp_ie = NULL; ++ DBG_871X("update pbuddy_adapter's beacon\n"); ++ ++ update_beacon(pbuddy_adapter, 0, NULL, _TRUE); + + } + else if(((pbuddy_mlmeinfo->state&0x03) == WIFI_FW_STATION_STATE) && + check_fwstate(pbuddy_mlmepriv, _FW_LINKED)) @@ -24623,10 +23879,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + { + set_channel_bwmode(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset, pmlmeext->cur_bwmode); + } - -- pmlmepriv->p2p_beacon_ie = NULL; -- pmlmepriv->p2p_probe_resp_ie = NULL; -- ++ } +#endif //CONFIG_CONCURRENT_MODE @@ -24902,7 +24155,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release u8 set_chplan_hdl(_adapter *padapter, unsigned char *pbuf) { -@@ -12038,6 +13361,7 @@ u8 set_chplan_hdl(_adapter *padapter, un +@@ -12038,6 +13361,7 @@ u8 set_chplan_hdl(_adapter *padapter, unsigned char *pbuf) setChannelPlan_param = (struct SetChannelPlan_param *)pbuf; pmlmeext->max_chan_nums = init_channel_set(padapter, setChannelPlan_param->channel_plan, pmlmeext->channel_set); @@ -24910,7 +24163,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return H2C_SUCCESS; } -@@ -12062,6 +13386,7 @@ u8 set_csa_hdl(_adapter *padapter, unsig +@@ -12062,6 +13386,7 @@ u8 set_csa_hdl(_adapter *padapter, unsigned char *pbuf) { #ifdef CONFIG_DFS struct SetChannelSwitch_param *setChannelSwitch_param; @@ -24918,7 +24171,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info; -@@ -12073,22 +13398,22 @@ u8 set_csa_hdl(_adapter *padapter, unsig +@@ -12073,22 +13398,22 @@ u8 set_csa_hdl(_adapter *padapter, unsigned char *pbuf) setChannelSwitch_param = (struct SetChannelSwitch_param *)pbuf; new_ch_no = setChannelSwitch_param->new_ch_no; @@ -24949,7 +24202,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return H2C_SUCCESS; #else -@@ -12136,14 +13461,18 @@ u8 tdls_hdl(_adapter *padapter, unsigned +@@ -12136,14 +13461,18 @@ u8 tdls_hdl(_adapter *padapter, unsigned char *pbuf) } //_enter_critical_bh(&(ptdlsinfo->hdl_lock), &irqL); @@ -24971,7 +24224,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release break; case TDLS_SD_PTI: issue_tdls_peer_traffic_indication(padapter, ptdls_sta); -@@ -12155,11 +13484,11 @@ u8 tdls_hdl(_adapter *padapter, unsigned +@@ -12155,11 +13484,11 @@ u8 tdls_hdl(_adapter *padapter, unsigned char *pbuf) ptdls_sta->tdls_sta_state &= ~(TDLS_CH_SWITCH_ON_STATE | TDLS_PEER_AT_OFF_STATE | TDLS_AT_OFF_CH_STATE); @@ -24986,7 +24239,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release pmlmeext->sitesurvey_res.channel_idx = 0; ptdls_sta->option = TDLS_DONE_CH_SEN; rtw_tdls_cmd(padapter, ptdls_sta->hwaddr, TDLS_DONE_CH_SEN); -@@ -12174,7 +13503,7 @@ u8 tdls_hdl(_adapter *padapter, unsigned +@@ -12174,7 +13503,7 @@ u8 tdls_hdl(_adapter *padapter, unsigned char *pbuf) }else{ SelectChannel(padapter, pmlmeext->cur_channel); @@ -24995,7 +24248,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if(ptdlsinfo->ch_sensing==1){ ptdlsinfo->ch_sensing=0; -@@ -12189,7 +13518,7 @@ u8 tdls_hdl(_adapter *padapter, unsigned +@@ -12189,7 +13518,7 @@ u8 tdls_hdl(_adapter *padapter, unsigned char *pbuf) } ptdlsinfo->collect_pkt_num[0]=0; ptdlsinfo->candidate_ch=ptdlsinfo->cur_channel; @@ -25004,7 +24257,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release ptdlsinfo->cur_channel=0; } -@@ -12198,20 +13527,20 @@ u8 tdls_hdl(_adapter *padapter, unsigned +@@ -12198,20 +13527,20 @@ u8 tdls_hdl(_adapter *padapter, unsigned char *pbuf) ptdls_sta->tdls_sta_state |= TDLS_APSD_CHSW_STATE; }else{ //send null data with pwrbit==1 before send ch_switching_req to peer STA. @@ -25029,7 +24282,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release ptdls_sta->tdls_sta_state |= TDLS_AT_OFF_CH_STATE; ptdls_sta->tdls_sta_state &= ~(TDLS_PEER_AT_OFF_STATE); _set_timer(&ptdls_sta->option_timer, (u32)ptdls_sta->ch_switch_time); -@@ -12223,21 +13552,21 @@ u8 tdls_hdl(_adapter *padapter, unsigned +@@ -12223,21 +13552,21 @@ u8 tdls_hdl(_adapter *padapter, unsigned char *pbuf) ptdls_sta->tdls_sta_state &= ~(TDLS_CH_SWITCH_ON_STATE | TDLS_PEER_AT_OFF_STATE | TDLS_AT_OFF_CH_STATE); @@ -25057,7 +24310,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release ptdls_sta->tdls_sta_state |= TDLS_AT_OFF_CH_STATE; if((ptdls_sta->tdls_sta_state & TDLS_PEER_AT_OFF_STATE) != TDLS_PEER_AT_OFF_STATE){ issue_nulldata_to_TDLS_peer_STA(padapter, ptdls_sta, 0); -@@ -12245,8 +13574,8 @@ u8 tdls_hdl(_adapter *padapter, unsigned +@@ -12245,8 +13574,8 @@ u8 tdls_hdl(_adapter *padapter, unsigned char *pbuf) _set_timer(&ptdls_sta->base_ch_timer, TDLS_STAY_TIME); break; case TDLS_RS_RCR: @@ -25068,11 +24321,13 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release break; case TDLS_CKALV_PH1: _set_timer(&ptdls_sta->alive_timer2, TDLS_ALIVE_TIMER_PH2); -@@ -12268,3 +13597,4 @@ u8 tdls_hdl(_adapter *padapter, unsigned +@@ -12268,3 +13597,4 @@ u8 tdls_hdl(_adapter *padapter, unsigned char *pbuf) #endif //CONFIG_TDLS } + +diff --git a/drivers/net/wireless/rtl8192cu/core/rtw_mp.c b/drivers/net/wireless/rtl8192cu/core/rtw_mp.c +index bb76dae..9af42cd 100644 --- a/drivers/net/wireless/rtl8192cu/core/rtw_mp.c +++ b/drivers/net/wireless/rtl8192cu/core/rtw_mp.c @@ -1,7 +1,7 @@ @@ -25105,7 +24360,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #ifdef CONFIG_MP_INCLUDED -@@ -79,35 +86,34 @@ void write_macreg(_adapter *padapter, u3 +@@ -79,35 +86,34 @@ void write_macreg(_adapter *padapter, u32 addr, u32 val, u32 sz) u32 read_bbreg(_adapter *padapter, u32 addr, u32 bitmask) { @@ -25156,7 +24411,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release //------------------------------------------------------------------------- // HW Initialization for 8190 MPT. -@@ -503,16 +509,22 @@ void GetPowerTracking(PADAPTER padapter, +@@ -503,16 +509,22 @@ void GetPowerTracking(PADAPTER padapter, u8 *enable) static void disable_dm(PADAPTER padapter) { @@ -25188,7 +24443,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release rtw_indicate_disconnect(padapter); rtw_free_assoc_resources(padapter, 1); } -@@ -765,7 +777,7 @@ static VOID mpt_AdjustRFRegByRateByChan9 +@@ -765,7 +777,7 @@ static VOID mpt_AdjustRFRegByRateByChan92CU(PADAPTER pAdapter, u8 RateIdx, u8 Ch static void mpt_SwitchRfSetting(PADAPTER pAdapter) { Hal_mpt_SwitchRfSetting(pAdapter); @@ -25197,7 +24452,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release /*---------------------------hal\rtl8192c\MPT_Phy.c---------------------------*/ /*---------------------------hal\rtl8192c\MPT_HelperFunc.c---------------------------*/ -@@ -827,7 +839,7 @@ void SetAntennaPathPower(PADAPTER pAdapt +@@ -827,7 +839,7 @@ void SetAntennaPathPower(PADAPTER pAdapter) void SetTxPower(PADAPTER pAdapter) { Hal_SetTxPower(pAdapter); @@ -25206,7 +24461,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release void SetTxAGCOffset(PADAPTER pAdapter, u32 ulTxAGCOffset) { -@@ -904,12 +916,12 @@ void SetCarrierSuppressionTx(PADAPTER pA +@@ -904,12 +916,12 @@ void SetCarrierSuppressionTx(PADAPTER pAdapter, u8 bStart) } void SetCCKContinuousTx(PADAPTER pAdapter, u8 bStart) @@ -25221,7 +24476,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release Hal_SetOFDMContinuousTx( pAdapter, bStart); }/* mpt_StartOfdmContTx */ -@@ -919,12 +931,12 @@ void SetContinuousTx(PADAPTER pAdapter, +@@ -919,12 +931,12 @@ void SetContinuousTx(PADAPTER pAdapter, u8 bStart) } //------------------------------------------------------------------------------ @@ -25237,7 +24492,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { struct xmit_frame *pmpframe; struct xmit_buf *pxmitbuf; -@@ -936,7 +948,7 @@ struct xmit_frame *alloc_mp_xmitframe(st +@@ -936,7 +948,7 @@ struct xmit_frame *alloc_mp_xmitframe(struct xmit_priv *pxmitpriv) if ((pxmitbuf = rtw_alloc_xmitbuf(pxmitpriv)) == NULL) { @@ -25246,7 +24501,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return NULL; } -@@ -952,7 +964,7 @@ struct xmit_frame *alloc_mp_xmitframe(st +@@ -952,7 +964,7 @@ struct xmit_frame *alloc_mp_xmitframe(struct xmit_priv *pxmitpriv) } @@ -25255,7 +24510,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { struct xmit_frame *pxmitframe; struct mp_tx *pmptx; -@@ -965,9 +977,9 @@ thread_return mp_xmit_packet_thread(thre +@@ -965,9 +977,9 @@ thread_return mp_xmit_packet_thread(thread_context context) padapter = pmp_priv->papdater; pxmitpriv = &(padapter->xmitpriv); @@ -25267,7 +24522,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release while (1) { pxmitframe = alloc_mp_xmitframe(pxmitpriv); if (pxmitframe == NULL) { -@@ -1002,7 +1014,7 @@ thread_return mp_xmit_packet_thread(thre +@@ -1002,7 +1014,7 @@ thread_return mp_xmit_packet_thread(thread_context context) } exit: @@ -25309,7 +24564,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } void SetPacketRx(PADAPTER pAdapter, u8 bStartRx) -@@ -1151,9 +1176,14 @@ void SetPacketRx(PADAPTER pAdapter, u8 b +@@ -1151,9 +1176,14 @@ void SetPacketRx(PADAPTER pAdapter, u8 bStartRx) if(bStartRx) { @@ -25326,7 +24581,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } else { -@@ -1244,15 +1274,15 @@ static u32 GetPSDData(PADAPTER pAdapter, +@@ -1244,15 +1274,15 @@ static u32 GetPSDData(PADAPTER pAdapter, u32 point) */ u32 mp_query_psd(PADAPTER pAdapter, u8 *data) { @@ -25345,7 +24600,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if (check_fwstate(&pAdapter->mlmepriv, WIFI_MP_STATE) == _FALSE) { RT_TRACE(_module_mp_, _drv_warning_, ("mp_query_psd: Fail! not in MP mode!\n")); -@@ -1290,28 +1320,5 @@ u32 mp_query_psd(PADAPTER pAdapter, u8 * +@@ -1290,28 +1320,5 @@ u32 mp_query_psd(PADAPTER pAdapter, u8 *data) return strlen(data)+1; } @@ -25374,6 +24629,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - #endif +diff --git a/drivers/net/wireless/rtl8192cu/core/rtw_mp_ioctl.c b/drivers/net/wireless/rtl8192cu/core/rtw_mp_ioctl.c +index a851568..b941e2c 100644 --- a/drivers/net/wireless/rtl8192cu/core/rtw_mp_ioctl.c +++ b/drivers/net/wireless/rtl8192cu/core/rtw_mp_ioctl.c @@ -1,7 +1,7 @@ @@ -25618,7 +24875,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release u32 bStartTest; NDIS_STATUS status = NDIS_STATUS_SUCCESS; PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); -@@ -820,7 +859,9 @@ NDIS_STATUS oid_rt_pro_trigger_gpio_hdl( +@@ -820,7 +859,9 @@ NDIS_STATUS oid_rt_pro_trigger_gpio_hdl(struct oid_par_priv *poid_par_priv) { PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); @@ -25637,7 +24894,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release _irqlevel_changed_(&oldirql, RAISE); _func_exit_; -@@ -842,7 +883,9 @@ NDIS_STATUS oid_rt_pro8711_join_bss_hdl( +@@ -842,7 +883,9 @@ NDIS_STATUS oid_rt_pro8711_join_bss_hdl(struct oid_par_priv *poid_par_priv) #if 0 PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); @@ -25870,7 +25127,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } //------------------------------------------------------------------------------ NDIS_STATUS oid_rt_pro8711_wi_poll_hdl(struct oid_par_priv *poid_par_priv) -@@ -1227,7 +1295,9 @@ NDIS_STATUS oid_rt_rd_attrib_mem_hdl(str +@@ -1227,7 +1295,9 @@ NDIS_STATUS oid_rt_rd_attrib_mem_hdl(struct oid_par_priv *poid_par_priv) struct io_queue *pio_queue = (struct io_queue *)Adapter->pio_queue; struct intf_hdl *pintfhdl = &pio_queue->intf; @@ -25881,7 +25138,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release NDIS_STATUS status = NDIS_STATUS_SUCCESS; #ifdef CONFIG_SDIO_HCI -@@ -1268,7 +1338,9 @@ NDIS_STATUS oid_rt_wr_attrib_mem_hdl (st +@@ -1268,7 +1338,9 @@ NDIS_STATUS oid_rt_wr_attrib_mem_hdl (struct oid_par_priv *poid_par_priv) struct io_queue *pio_queue = (struct io_queue *)Adapter->pio_queue; struct intf_hdl *pintfhdl = &pio_queue->intf; @@ -25891,7 +25148,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release NDIS_STATUS status = NDIS_STATUS_SUCCESS; #ifdef CONFIG_SDIO_HCI -@@ -1304,7 +1376,9 @@ NDIS_STATUS oid_rt_pro_set_rf_intfs_hdl +@@ -1304,7 +1376,9 @@ NDIS_STATUS oid_rt_pro_set_rf_intfs_hdl(struct oid_par_priv *poid_par_priv) #if 0 PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); @@ -25901,7 +25158,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release NDIS_STATUS status = NDIS_STATUS_SUCCESS; _func_enter_; -@@ -1404,7 +1478,9 @@ NDIS_STATUS oid_rt_pro_set_data_rate_ex_ +@@ -1404,7 +1478,9 @@ NDIS_STATUS oid_rt_pro_set_data_rate_ex_hdl(struct oid_par_priv *poid_par_priv) { PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); @@ -25921,7 +25178,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release NDIS_STATUS status = NDIS_STATUS_SUCCESS; u8 thermal = 0; PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); -@@ -1460,7 +1538,9 @@ NDIS_STATUS oid_rt_pro_read_tssi_hdl(str +@@ -1460,7 +1538,9 @@ NDIS_STATUS oid_rt_pro_read_tssi_hdl(struct oid_par_priv *poid_par_priv) #if 0 PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); @@ -25980,7 +25237,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } //------------------------------------------------------------------------------ NDIS_STATUS oid_rt_pro_qry_pwrstate_hdl(struct oid_par_priv *poid_par_priv) -@@ -1646,7 +1732,9 @@ NDIS_STATUS oid_rt_pro_h2c_set_rate_tabl +@@ -1646,7 +1732,9 @@ NDIS_STATUS oid_rt_pro_h2c_set_rate_table_hdl(struct oid_par_priv *poid_par_priv #if 0 PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); @@ -25990,7 +25247,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release NDIS_STATUS status = NDIS_STATUS_SUCCESS; struct setratable_parm *prate_table; -@@ -1833,13 +1921,15 @@ NDIS_STATUS oid_rt_pro_encryption_ctrl_h +@@ -1833,13 +1921,15 @@ NDIS_STATUS oid_rt_pro_encryption_ctrl_hdl(struct oid_par_priv *poid_par_priv) NDIS_STATUS oid_rt_pro_add_sta_info_hdl(struct oid_par_priv *poid_par_priv) { #if 0 @@ -26011,7 +25268,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if (poid_par_priv->type_of_oid != SET_OID) -@@ -1881,13 +1971,15 @@ NDIS_STATUS oid_rt_pro_add_sta_info_hdl( +@@ -1881,13 +1971,15 @@ NDIS_STATUS oid_rt_pro_add_sta_info_hdl(struct oid_par_priv *poid_par_priv) NDIS_STATUS oid_rt_pro_dele_sta_info_hdl(struct oid_par_priv *poid_par_priv) { #if 0 @@ -26032,7 +25289,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if (poid_par_priv->type_of_oid != SET_OID) -@@ -1914,17 +2006,17 @@ NDIS_STATUS oid_rt_pro_dele_sta_info_hdl +@@ -1914,17 +2006,17 @@ NDIS_STATUS oid_rt_pro_dele_sta_info_hdl(struct oid_par_priv *poid_par_priv) #endif } //------------------------------------------------------------------------------ @@ -26054,7 +25311,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release RT_TRACE(_module_mp_,_drv_err_, ("Query Information, mp_query_drv_var call recv rx\n")); // sd_recv_rxfifo(padapter); } -@@ -1973,37 +2065,37 @@ u32 mp_query_drv_var(_adapter *padapter, +@@ -1973,37 +2065,37 @@ u32 mp_query_drv_var(_adapter *padapter, u8 offset, u32 var) else if(offset >110 &&offset <116){ if(115==offset){ RT_TRACE(_module_mp_, _drv_emerg_, (" mp_query_drv_var(_drv_emerg_): offset(%d): query TRX access type: [tx_block_mode=%x,rx_block_mode=%x]\n",\ @@ -26105,7 +25362,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release break; default : break; -@@ -2088,20 +2180,20 @@ u32 mp_query_drv_var(_adapter *padapter, +@@ -2088,20 +2180,20 @@ u32 mp_query_drv_var(_adapter *padapter, u8 offset, u32 var) #endif return var; @@ -26133,7 +25390,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if (poid_par_priv->type_of_oid != QUERY_OID) -@@ -2133,12 +2225,12 @@ NDIS_STATUS oid_rt_pro_query_dr_variable +@@ -2133,12 +2225,12 @@ NDIS_STATUS oid_rt_pro_query_dr_variable_hdl(struct oid_par_priv *poid_par_priv) //------------------------------------------------------------------------------ NDIS_STATUS oid_rt_pro_rx_packet_type_hdl(struct oid_par_priv *poid_par_priv) { @@ -26147,7 +25404,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if (poid_par_priv->information_buf_len < sizeof (UCHAR)) { status = NDIS_STATUS_INVALID_LENGTH; -@@ -2178,7 +2270,9 @@ NDIS_STATUS oid_rt_pro_rx_packet_type_hd +@@ -2178,7 +2270,9 @@ NDIS_STATUS oid_rt_pro_rx_packet_type_hdl(struct oid_par_priv *poid_par_priv) //------------------------------------------------------------------------------ NDIS_STATUS oid_rt_pro_read_efuse_hdl(struct oid_par_priv *poid_par_priv) { @@ -26190,7 +25447,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release u16 size; u8 ret; NDIS_STATUS status = NDIS_STATUS_SUCCESS; -@@ -2354,7 +2452,6 @@ NDIS_STATUS oid_rt_get_efuse_max_size_hd +@@ -2354,7 +2452,6 @@ NDIS_STATUS oid_rt_get_efuse_max_size_hdl(struct oid_par_priv *poid_par_priv) { NDIS_STATUS status = NDIS_STATUS_SUCCESS; PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); @@ -26208,7 +25465,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release u8 *data; NDIS_STATUS status = NDIS_STATUS_SUCCESS; PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); -@@ -2461,7 +2560,9 @@ NDIS_STATUS oid_rt_set_crystal_cap_hdl(s +@@ -2461,7 +2560,9 @@ NDIS_STATUS oid_rt_set_crystal_cap_hdl(struct oid_par_priv *poid_par_priv) #if 0 PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); @@ -26263,7 +25520,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #endif _irqlevel_changed_(&oldirql, RAISE); -@@ -2585,7 +2688,9 @@ NDIS_STATUS oid_rt_pro_set_tx_agc_offset +@@ -2585,7 +2688,9 @@ NDIS_STATUS oid_rt_pro_set_tx_agc_offset_hdl(struct oid_par_priv *poid_par_priv) #if 0 PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); @@ -26273,7 +25530,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release NDIS_STATUS status = NDIS_STATUS_SUCCESS; u32 txagc; -@@ -2701,7 +2806,7 @@ unsigned int mp_ioctl_xmit_packet_hdl(st +@@ -2701,7 +2806,7 @@ unsigned int mp_ioctl_xmit_packet_hdl(struct oid_par_priv *poid_par_priv) struct mp_xmit_packet *pmp_xmitpkt = (struct mp_xmit_packet*)param; u8 addr3[] = {0x02, 0xE0, 0x4C, 0x87, 0x66, 0x55}; @@ -26282,7 +25539,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release pxframe = alloc_mp_xmitframe(&padapter->mppriv); if (pxframe == NULL) -@@ -2715,10 +2820,10 @@ unsigned int mp_ioctl_xmit_packet_hdl(st +@@ -2715,10 +2820,10 @@ unsigned int mp_ioctl_xmit_packet_hdl(struct oid_par_priv *poid_par_priv) pmp_pkt = (unsigned char*)pmp_xmitpkt->mem; pethhdr = (struct ethhdr *)pmp_pkt; @@ -26296,7 +25553,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release //update attribute pattrib = &pxframe->attrib; -@@ -2771,10 +2876,16 @@ unsigned int mp_ioctl_xmit_packet_hdl(st +@@ -2771,10 +2876,16 @@ unsigned int mp_ioctl_xmit_packet_hdl(struct oid_par_priv *poid_par_priv) //------------------------------------------------------------------------------ NDIS_STATUS oid_rt_set_power_down_hdl(struct oid_par_priv *poid_par_priv) { @@ -26324,7 +25581,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #endif #endif _irqlevel_changed_(&oldirql, RAISE); -@@ -2810,7 +2921,9 @@ NDIS_STATUS oid_rt_get_power_mode_hdl(st +@@ -2810,7 +2921,9 @@ NDIS_STATUS oid_rt_get_power_mode_hdl(struct oid_par_priv *poid_par_priv) #if 0 NDIS_STATUS status = NDIS_STATUS_SUCCESS; PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); @@ -26334,6 +25591,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release _func_enter_; +diff --git a/drivers/net/wireless/rtl8192cu/core/rtw_p2p.c b/drivers/net/wireless/rtl8192cu/core/rtw_p2p.c +index 1df9d62..66c5f96 100644 --- a/drivers/net/wireless/rtl8192cu/core/rtw_p2p.c +++ b/drivers/net/wireless/rtl8192cu/core/rtw_p2p.c @@ -25,31 +25,24 @@ @@ -26381,7 +25640,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } static u32 go_add_group_info_attr(struct wifidirect_info *pwdinfo, u8 *pbuf) -@@ -544,7 +537,7 @@ u32 build_beacon_wfd_ie(struct wifidirec +@@ -544,7 +537,7 @@ u32 build_beacon_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) u32 len=0, wfdielen = 0; _adapter *padapter = pwdinfo->padapter; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; @@ -26390,7 +25649,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release // WFD OUI wfdielen = 0; -@@ -572,24 +565,24 @@ u32 build_beacon_wfd_ie(struct wifidirec +@@ -572,24 +565,24 @@ u32 build_beacon_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) // Value1: // WFD device information @@ -26422,7 +25681,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } wfdielen += 2; -@@ -634,13 +627,20 @@ u32 build_beacon_wfd_ie(struct wifidirec +@@ -634,13 +627,20 @@ u32 build_beacon_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) // Length: // Note: In the WFD specification, the size of length field is 2. @@ -26444,7 +25703,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release pbuf = rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len); -@@ -654,7 +654,7 @@ u32 build_probe_req_wfd_ie(struct wifidi +@@ -654,7 +654,7 @@ u32 build_probe_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) u32 len=0, wfdielen = 0; _adapter *padapter = pwdinfo->padapter; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; @@ -26453,7 +25712,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release // WFD OUI wfdielen = 0; -@@ -681,8 +681,23 @@ u32 build_probe_req_wfd_ie(struct wifidi +@@ -681,8 +681,23 @@ u32 build_probe_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) // Value1: // WFD device information @@ -26479,7 +25738,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release wfdielen += 2; // Value2: -@@ -725,13 +740,20 @@ u32 build_probe_req_wfd_ie(struct wifidi +@@ -725,13 +740,20 @@ u32 build_probe_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) // Length: // Note: In the WFD specification, the size of length field is 2. @@ -26501,7 +25760,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release pbuf = rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len); -@@ -739,13 +761,13 @@ u32 build_probe_req_wfd_ie(struct wifidi +@@ -739,13 +761,13 @@ u32 build_probe_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) } @@ -26517,7 +25776,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release // WFD OUI wfdielen = 0; -@@ -773,25 +795,65 @@ u32 build_probe_resp_wfd_ie(struct wifid +@@ -773,25 +795,65 @@ u32 build_probe_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) // Value1: // WFD device information @@ -26592,7 +25851,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } wfdielen += 2; -@@ -836,15 +898,22 @@ u32 build_probe_resp_wfd_ie(struct wifid +@@ -836,15 +898,22 @@ u32 build_probe_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) // Length: // Note: In the WFD specification, the size of length field is 2. @@ -26617,7 +25876,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { // WFD Session Information ATTR // Type: -@@ -858,6 +927,28 @@ u32 build_probe_resp_wfd_ie(struct wifid +@@ -858,6 +927,28 @@ u32 build_probe_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) // Todo: to add the list of WFD device info descriptor in WFD group. } @@ -26646,7 +25905,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release pbuf = rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len); -@@ -881,7 +972,7 @@ u32 build_assoc_req_wfd_ie(struct wifidi +@@ -881,7 +972,7 @@ u32 build_assoc_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) padapter = pwdinfo->padapter; pmlmepriv = &padapter->mlmepriv; @@ -26655,7 +25914,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release wfdielen = 0; wfdie[ wfdielen++ ] = 0x50; -@@ -907,8 +998,8 @@ u32 build_assoc_req_wfd_ie(struct wifidi +@@ -907,8 +998,8 @@ u32 build_assoc_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) // Value1: // WFD device information @@ -26666,7 +25925,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release wfdielen += 2; // Value2: -@@ -951,13 +1042,20 @@ u32 build_assoc_req_wfd_ie(struct wifidi +@@ -951,13 +1042,20 @@ u32 build_assoc_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) // Length: // Note: In the WFD specification, the size of length field is 2. @@ -26688,7 +25947,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release pbuf = rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len); -@@ -971,7 +1069,7 @@ u32 build_assoc_resp_wfd_ie(struct wifid +@@ -971,7 +1069,7 @@ u32 build_assoc_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) u32 len=0, wfdielen = 0; _adapter *padapter = pwdinfo->padapter; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; @@ -26697,7 +25956,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release // WFD OUI wfdielen = 0; -@@ -998,8 +1096,8 @@ u32 build_assoc_resp_wfd_ie(struct wifid +@@ -998,8 +1096,8 @@ u32 build_assoc_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) // Value1: // WFD device information @@ -26708,7 +25967,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release wfdielen += 2; // Value2: -@@ -1042,13 +1140,20 @@ u32 build_assoc_resp_wfd_ie(struct wifid +@@ -1042,13 +1140,20 @@ u32 build_assoc_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) // Length: // Note: In the WFD specification, the size of length field is 2. @@ -26730,7 +25989,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release pbuf = rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len); -@@ -1062,7 +1167,7 @@ u32 build_nego_req_wfd_ie(struct wifidir +@@ -1062,7 +1167,7 @@ u32 build_nego_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) u32 len=0, wfdielen = 0; _adapter *padapter = pwdinfo->padapter; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; @@ -26739,7 +25998,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release // WFD OUI wfdielen = 0; -@@ -1089,8 +1194,8 @@ u32 build_nego_req_wfd_ie(struct wifidir +@@ -1089,8 +1194,8 @@ u32 build_nego_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) // Value1: // WFD device information @@ -26750,7 +26009,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release wfdielen += 2; // Value2: -@@ -1133,13 +1238,20 @@ u32 build_nego_req_wfd_ie(struct wifidir +@@ -1133,13 +1238,20 @@ u32 build_nego_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) // Length: // Note: In the WFD specification, the size of length field is 2. @@ -26772,7 +26031,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release pbuf = rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len); -@@ -1153,7 +1265,7 @@ u32 build_nego_resp_wfd_ie(struct wifidi +@@ -1153,7 +1265,7 @@ u32 build_nego_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) u32 len=0, wfdielen = 0; _adapter *padapter = pwdinfo->padapter; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; @@ -26781,7 +26040,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release // WFD OUI wfdielen = 0; -@@ -1180,8 +1292,8 @@ u32 build_nego_resp_wfd_ie(struct wifidi +@@ -1180,8 +1292,8 @@ u32 build_nego_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) // Value1: // WFD device information @@ -26792,7 +26051,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release wfdielen += 2; // Value2: -@@ -1224,13 +1336,20 @@ u32 build_nego_resp_wfd_ie(struct wifidi +@@ -1224,13 +1336,20 @@ u32 build_nego_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) // Length: // Note: In the WFD specification, the size of length field is 2. @@ -26814,7 +26073,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release pbuf = rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len); -@@ -1245,7 +1364,7 @@ u32 build_nego_confirm_wfd_ie(struct wif +@@ -1245,7 +1364,7 @@ u32 build_nego_confirm_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) u32 len=0, wfdielen = 0; _adapter *padapter = pwdinfo->padapter; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; @@ -26823,7 +26082,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release // WFD OUI wfdielen = 0; -@@ -1272,8 +1391,8 @@ u32 build_nego_confirm_wfd_ie(struct wif +@@ -1272,8 +1391,8 @@ u32 build_nego_confirm_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) // Value1: // WFD device information @@ -26834,7 +26093,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release wfdielen += 2; // Value2: -@@ -1316,13 +1435,20 @@ u32 build_nego_confirm_wfd_ie(struct wif +@@ -1316,13 +1435,20 @@ u32 build_nego_confirm_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) // Length: // Note: In the WFD specification, the size of length field is 2. @@ -26856,7 +26115,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release pbuf = rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len); -@@ -1331,13 +1457,13 @@ u32 build_nego_confirm_wfd_ie(struct wif +@@ -1331,13 +1457,13 @@ u32 build_nego_confirm_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) } @@ -26872,7 +26131,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release // WFD OUI wfdielen = 0; -@@ -1364,8 +1490,8 @@ u32 build_provdisc_req_wfd_ie(struct wif +@@ -1364,8 +1490,8 @@ u32 build_provdisc_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) // Value1: // WFD device information @@ -26883,7 +26142,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release wfdielen += 2; // Value2: -@@ -1408,14 +1534,35 @@ u32 build_provdisc_req_wfd_ie(struct wif +@@ -1408,14 +1534,35 @@ u32 build_provdisc_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) // Length: // Note: In the WFD specification, the size of length field is 2. @@ -26920,7 +26179,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release pbuf = rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len); -@@ -1423,13 +1570,13 @@ u32 build_provdisc_req_wfd_ie(struct wif +@@ -1423,13 +1570,13 @@ u32 build_provdisc_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) } @@ -26936,7 +26195,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release // WFD OUI wfdielen = 0; -@@ -1439,7 +1586,7 @@ u32 build_provdisc_resp_wfd_ie(struct wi +@@ -1439,7 +1586,7 @@ u32 build_provdisc_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) wfdie[ wfdielen++ ] = 0x0A; // WFA WFD v1.0 // Commented by Albert 20110825 @@ -26945,7 +26204,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release // 1. WFD Device Information // 2. Associated BSSID ( Optional ) // 3. Local IP Adress ( Optional ) -@@ -1456,8 +1603,8 @@ u32 build_provdisc_resp_wfd_ie(struct wi +@@ -1456,8 +1603,8 @@ u32 build_provdisc_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) // Value1: // WFD device information @@ -26956,7 +26215,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release wfdielen += 2; // Value2: -@@ -1500,13 +1647,35 @@ u32 build_provdisc_resp_wfd_ie(struct wi +@@ -1500,13 +1647,35 @@ u32 build_provdisc_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) // Length: // Note: In the WFD specification, the size of length field is 2. @@ -26993,7 +26252,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release pbuf = rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len); -@@ -1514,68 +1683,280 @@ u32 build_provdisc_resp_wfd_ie(struct wi +@@ -1514,68 +1683,280 @@ u32 build_provdisc_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) } @@ -27318,7 +26577,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release // Value: // Availability Period -@@ -1606,6 +1987,17 @@ u32 build_probe_resp_p2p_ie(struct wifid +@@ -1606,6 +1987,17 @@ u32 build_probe_resp_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) // 21 -> P2P Device Address (6bytes) + Config Methods (2bytes) + Primary Device Type (8bytes) // + NumofSecondDevType (1byte) + WPS Device Name ID field (2bytes) + WPS Device Name Len field (2bytes) //*(u16*) ( p2pie + p2pielen ) = cpu_to_le16( 21 + pwdinfo->device_name_len ); @@ -27336,7 +26595,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release RTW_PUT_LE16(p2pie + p2pielen, 21 + pwdinfo->device_name_len); p2pielen += 2; -@@ -1620,23 +2012,77 @@ u32 build_probe_resp_p2p_ie(struct wifid +@@ -1620,23 +2012,77 @@ u32 build_probe_resp_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) RTW_PUT_BE16(p2pie + p2pielen, pwdinfo->supported_wps_cm); p2pielen += 2; @@ -27362,7 +26621,11 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + //*(u32*) ( p2pie + p2pielen ) = cpu_to_be32( WPSOUI ); + RTW_PUT_BE32(p2pie + p2pielen, WPSOUI); + p2pielen += 4; -+ + +- // Sub Category ID +- //*(u16*) ( p2pie + p2pielen ) = cpu_to_be16( WPS_PDT_SCID_RTK_DMP ); +- RTW_PUT_BE16(p2pie + p2pielen, WPS_PDT_SCID_RTK_DMP); +- p2pielen += 2; + // Sub Category ID + //*(u16*) ( p2pie + p2pielen ) = cpu_to_be16( WPS_PDT_SCID_MEDIA_SERVER ); + RTW_PUT_BE16(p2pie + p2pielen, pmlmepriv->p2p_pdt_scid); @@ -27376,11 +26639,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + //*(u16*) ( p2pie + p2pielen ) = cpu_to_be16( WPS_PDT_CID_MULIT_MEDIA ); + RTW_PUT_BE16(p2pie + p2pielen, WPS_PDT_CID_MULIT_MEDIA); + p2pielen += 2; - -- // Sub Category ID -- //*(u16*) ( p2pie + p2pielen ) = cpu_to_be16( WPS_PDT_SCID_RTK_DMP ); -- RTW_PUT_BE16(p2pie + p2pielen, WPS_PDT_SCID_RTK_DMP); -- p2pielen += 2; ++ + // OUI + //*(u32*) ( p2pie + p2pielen ) = cpu_to_be32( WPSOUI ); + RTW_PUT_BE32(p2pie + p2pielen, WPSOUI); @@ -27427,7 +26686,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release p2pie[ p2pielen++ ] = 0x00; // No Secondary Device Type List // Device Name -@@ -1654,7 +2100,6 @@ u32 build_probe_resp_p2p_ie(struct wifid +@@ -1654,7 +2100,6 @@ u32 build_probe_resp_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) _rtw_memcpy( p2pie + p2pielen, pwdinfo->device_name, pwdinfo->device_name_len ); p2pielen += pwdinfo->device_name_len; @@ -27435,7 +26694,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release // Group Info ATTR // Type: // Length: -@@ -1701,12 +2146,13 @@ u32 build_prov_disc_request_p2p_ie(struc +@@ -1701,12 +2146,13 @@ u32 build_prov_disc_request_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8 // Value: // Device Capability Bitmap, 1 byte @@ -27453,7 +26712,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release // Device Info ATTR -@@ -1742,8 +2188,8 @@ u32 build_prov_disc_request_p2p_ie(struc +@@ -1742,8 +2188,8 @@ u32 build_prov_disc_request_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8 // Primary Device Type // Category ID @@ -27464,7 +26723,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release p2pielen += 2; // OUI -@@ -1752,8 +2198,8 @@ u32 build_prov_disc_request_p2p_ie(struc +@@ -1752,8 +2198,8 @@ u32 build_prov_disc_request_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8 p2pielen += 4; // Sub Category ID @@ -27475,7 +26734,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release p2pielen += 2; // Number of Secondary Device Types -@@ -1896,6 +2342,7 @@ u32 process_probe_req_p2p_ie(struct wifi +@@ -1896,6 +2342,7 @@ u32 process_probe_req_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pframe, uint l p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + _PROBEREQ_IE_OFFSET_, _SSID_IE_, (int *)&ssid_len, len - WLAN_HDR_A3_LEN - _PROBEREQ_IE_OFFSET_); @@ -27483,7 +26742,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if(rtw_p2p_chk_role(pwdinfo, P2P_ROLE_DEVICE) || rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO)) { if((p2pie=rtw_get_p2p_ie( pframe + WLAN_HDR_A3_LEN + _PROBEREQ_IE_OFFSET_ , len - WLAN_HDR_A3_LEN - _PROBEREQ_IE_OFFSET_ , NULL, &p2pielen))) -@@ -1907,6 +2354,10 @@ u32 process_probe_req_p2p_ie(struct wifi +@@ -1907,6 +2354,10 @@ u32 process_probe_req_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pframe, uint l //Check Device ID attribute in P2P IE ret = _TRUE; @@ -27494,7 +26753,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } } else -@@ -2182,7 +2633,7 @@ u8 process_p2p_provdisc_req(struct wifid +@@ -2182,7 +2633,7 @@ u8 process_p2p_provdisc_req(struct wifidirect_info *pwdinfo, u8 *pframe, uint l issue_p2p_provision_resp( pwdinfo, GetAddr2Ptr(pframe), frame_body, uconfig_method); } } @@ -27503,7 +26762,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return _TRUE; } -@@ -2193,31 +2644,93 @@ u8 process_p2p_provdisc_resp(struct wifi +@@ -2193,31 +2644,93 @@ u8 process_p2p_provdisc_resp(struct wifidirect_info *pwdinfo, u8 *pframe) return _TRUE; } @@ -27607,7 +26866,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { // Commented by Kurt 20120113 // If some device wants to do p2p handshake without sending prov_disc_req -@@ -2243,12 +2756,19 @@ u8 process_p2p_group_negotation_req( str +@@ -2243,12 +2756,19 @@ u8 process_p2p_group_negotation_req( struct wifidirect_info *pwdinfo, u8 *pframe } else { @@ -27628,7 +26887,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release ies = pframe + _PUBLIC_ACTION_IE_OFFSET_; ies_len = len - _PUBLIC_ACTION_IE_OFFSET_; -@@ -2256,7 +2776,7 @@ u8 process_p2p_group_negotation_req( str +@@ -2256,7 +2776,7 @@ u8 process_p2p_group_negotation_req( struct wifidirect_info *pwdinfo, u8 *pframe if ( !p2p_ie ) { @@ -27637,7 +26896,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release result = P2P_STATUS_FAIL_INCOMPATIBLE_PARAM; rtw_p2p_set_state(pwdinfo, P2P_STATE_GONEGO_FAIL); } -@@ -2265,12 +2785,30 @@ u8 process_p2p_group_negotation_req( str +@@ -2265,12 +2785,30 @@ u8 process_p2p_group_negotation_req( struct wifidirect_info *pwdinfo, u8 *pframe { u8 attr_content = 0x00; u32 attr_contentlen = 0; @@ -27670,7 +26929,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release pwdinfo->peer_intent = attr_content; // include both intent and tie breaker values. if ( pwdinfo->intent == ( pwdinfo->peer_intent >> 1 ) ) -@@ -2320,6 +2858,64 @@ u8 process_p2p_group_negotation_req( str +@@ -2320,6 +2858,64 @@ u8 process_p2p_group_negotation_req( struct wifidirect_info *pwdinfo, u8 *pframe } } @@ -27735,7 +26994,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release //Get the next P2P IE p2p_ie = rtw_get_p2p_ie(p2p_ie+p2p_ielen, ies_len -(p2p_ie -ies + p2p_ielen), NULL, &p2p_ielen); } -@@ -2332,12 +2928,12 @@ u8 process_p2p_group_negotation_req( str +@@ -2332,12 +2928,12 @@ u8 process_p2p_group_negotation_req( struct wifidirect_info *pwdinfo, u8 *pframe u8 attr_content[ 10 ] = { 0x00 }; u32 attr_contentlen = 0; @@ -27751,7 +27010,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } } #endif // CONFIG_WFD -@@ -2347,6 +2943,7 @@ u8 process_p2p_group_negotation_req( str +@@ -2347,6 +2943,7 @@ u8 process_p2p_group_negotation_req( struct wifidirect_info *pwdinfo, u8 *pframe u8 process_p2p_group_negotation_resp( struct wifidirect_info *pwdinfo, u8 *pframe, uint len ) { @@ -27759,7 +27018,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release u8 result = P2P_STATUS_SUCCESS; u32 p2p_ielen, wps_ielen; u8 * ies; -@@ -2355,7 +2952,10 @@ u8 process_p2p_group_negotation_resp( st +@@ -2355,7 +2952,10 @@ u8 process_p2p_group_negotation_resp( struct wifidirect_info *pwdinfo, u8 *pfram #ifdef CONFIG_WFD u8 wfd_ie[ 128 ] = { 0x00 }; u32 wfd_ielen = 0; @@ -27771,7 +27030,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release ies = pframe + _PUBLIC_ACTION_IE_OFFSET_; ies_len = len - _PUBLIC_ACTION_IE_OFFSET_; -@@ -2368,7 +2968,7 @@ u8 process_p2p_group_negotation_resp( st +@@ -2368,7 +2968,7 @@ u8 process_p2p_group_negotation_resp( struct wifidirect_info *pwdinfo, u8 *pfram } else { @@ -27780,7 +27039,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release result = P2P_STATUS_FAIL_INCOMPATIBLE_PARAM; rtw_p2p_set_state(pwdinfo, P2P_STATE_GONEGO_FAIL); } -@@ -2382,28 +2982,48 @@ u8 process_p2p_group_negotation_resp( st +@@ -2382,28 +2982,48 @@ u8 process_p2p_group_negotation_resp( struct wifidirect_info *pwdinfo, u8 *pfram } else { @@ -27833,7 +27092,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release result = attr_content; break; } -@@ -2424,7 +3044,7 @@ u8 process_p2p_group_negotation_resp( st +@@ -2424,7 +3044,7 @@ u8 process_p2p_group_negotation_resp( struct wifidirect_info *pwdinfo, u8 *pfram attr_contentlen = 0; if ( rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_GO_INTENT , &attr_content, &attr_contentlen) ) { @@ -27842,7 +27101,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release pwdinfo->peer_intent = attr_content; // include both intent and tie breaker values. if ( pwdinfo->intent == ( pwdinfo->peer_intent >> 1 ) ) -@@ -2439,6 +3059,7 @@ u8 process_p2p_group_negotation_resp( st +@@ -2439,6 +3059,7 @@ u8 process_p2p_group_negotation_resp( struct wifidirect_info *pwdinfo, u8 *pfram else { rtw_p2p_set_state(pwdinfo, P2P_STATE_GONEGO_OK); @@ -27850,7 +27109,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if ( attr_content & 0x01 ) { rtw_p2p_set_role(pwdinfo, P2P_ROLE_CLIENT); -@@ -2452,11 +3073,13 @@ u8 process_p2p_group_negotation_resp( st +@@ -2452,11 +3073,13 @@ u8 process_p2p_group_negotation_resp( struct wifidirect_info *pwdinfo, u8 *pfram else if ( pwdinfo->intent > ( pwdinfo->peer_intent >> 1 ) ) { rtw_p2p_set_state(pwdinfo, P2P_STATE_GONEGO_OK); @@ -27864,7 +27123,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release rtw_p2p_set_role(pwdinfo, P2P_ROLE_CLIENT); } -@@ -2474,20 +3097,74 @@ u8 process_p2p_group_negotation_resp( st +@@ -2474,20 +3097,74 @@ u8 process_p2p_group_negotation_resp( struct wifidirect_info *pwdinfo, u8 *pfram attr_contentlen = 0; if ( rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_OPERATING_CH, operatingch_info, &attr_contentlen)) { @@ -27945,7 +27204,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } // Try to get the group id information if peer is GO -@@ -2517,8 +3194,8 @@ u8 process_p2p_group_negotation_resp( st +@@ -2517,8 +3194,8 @@ u8 process_p2p_group_negotation_resp( struct wifidirect_info *pwdinfo, u8 *pfram rtw_get_wfd_attr_content( wfd_ie, wfd_ielen, WFD_ATTR_DEVICE_INFO, attr_content, &attr_contentlen); if ( attr_contentlen ) { @@ -27956,7 +27215,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } } #endif // CONFIG_WFD -@@ -2534,7 +3211,6 @@ u8 process_p2p_group_negotation_confirm( +@@ -2534,7 +3211,6 @@ u8 process_p2p_group_negotation_confirm( struct wifidirect_info *pwdinfo, u8 *pf u8 * p2p_ie; u32 p2p_ielen = 0; u8 result = P2P_STATUS_SUCCESS; @@ -27964,7 +27223,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release ies = pframe + _PUBLIC_ACTION_IE_OFFSET_; ies_len = len - _PUBLIC_ACTION_IE_OFFSET_; -@@ -2549,7 +3225,7 @@ u8 process_p2p_group_negotation_confirm( +@@ -2549,7 +3225,7 @@ u8 process_p2p_group_negotation_confirm( struct wifidirect_info *pwdinfo, u8 *pf rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_STATUS, &attr_content, &attr_contentlen); if ( attr_contentlen == 1 ) { @@ -27973,7 +27232,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release result = attr_content; if ( attr_content == P2P_STATUS_SUCCESS ) -@@ -2561,6 +3237,7 @@ u8 process_p2p_group_negotation_confirm( +@@ -2561,6 +3237,7 @@ u8 process_p2p_group_negotation_confirm( struct wifidirect_info *pwdinfo, u8 *pf // Commented by Albert 20100911 // Todo: Need to handle the case which both Intents are the same. rtw_p2p_set_state(pwdinfo, P2P_STATE_GONEGO_OK); @@ -27981,7 +27240,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if ( ( pwdinfo->intent ) > ( pwdinfo->peer_intent >> 1 ) ) { rtw_p2p_set_role(pwdinfo, P2P_ROLE_GO); -@@ -2581,6 +3258,14 @@ u8 process_p2p_group_negotation_confirm( +@@ -2581,6 +3258,14 @@ u8 process_p2p_group_negotation_confirm( struct wifidirect_info *pwdinfo, u8 *pf rtw_p2p_set_role(pwdinfo, P2P_ROLE_GO); } } @@ -27996,7 +27255,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } else { -@@ -2595,7 +3280,7 @@ u8 process_p2p_group_negotation_confirm( +@@ -2595,7 +3280,7 @@ u8 process_p2p_group_negotation_confirm( struct wifidirect_info *pwdinfo, u8 *pf _rtw_memset( groupid, 0x00, 38 ); if ( rtw_get_p2p_attr_content( p2p_ie, p2p_ielen, P2P_ATTR_GROUP_ID, groupid, &attr_contentlen) ) { @@ -28005,7 +27264,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release _rtw_memcpy( pwdinfo->groupid_info.go_device_addr, &groupid[0], ETH_ALEN ); _rtw_memcpy( pwdinfo->groupid_info.ssid, &groupid[6], attr_contentlen - ETH_ALEN ); } -@@ -2603,7 +3288,7 @@ u8 process_p2p_group_negotation_confirm( +@@ -2603,7 +3288,7 @@ u8 process_p2p_group_negotation_confirm( struct wifidirect_info *pwdinfo, u8 *pf attr_contentlen = 0; if ( rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_OPERATING_CH, operatingch_info, &attr_contentlen) ) { @@ -28014,7 +27273,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release pwdinfo->peer_operating_ch = operatingch_info[4]; } -@@ -2632,114 +3317,6 @@ u8 process_p2p_presence_req(struct wifid +@@ -2632,114 +3317,6 @@ u8 process_p2p_presence_req(struct wifidirect_info *pwdinfo, u8 *pframe, uint le return _TRUE; } @@ -28146,7 +27405,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release void restore_p2p_state_handler( _adapter* padapter ) { struct wifidirect_info *pwdinfo = &padapter->wdinfo; -@@ -2771,16 +3350,56 @@ void restore_p2p_state_handler( _adapter +@@ -2771,16 +3350,56 @@ void restore_p2p_state_handler( _adapter* padapter ) _func_enter_; @@ -28203,7 +27462,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release void pre_tx_provdisc_handler( _adapter* padapter ) { struct wifidirect_info *pwdinfo = &padapter->wdinfo; -@@ -2788,8 +3407,8 @@ void pre_tx_provdisc_handler( _adapter* +@@ -2788,8 +3407,8 @@ void pre_tx_provdisc_handler( _adapter* padapter ) _func_enter_; set_channel_bwmode(padapter, pwdinfo->tx_prov_disc_info.peer_channel_num[0], HAL_PRIME_CHNL_OFFSET_DONT_CARE, HT_CHANNEL_WIDTH_20); @@ -28214,7 +27473,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release _set_timer( &pwdinfo->pre_tx_scan_timer, P2P_TX_PRESCAN_TIMEOUT ); _func_exit_; -@@ -2802,71 +3421,966 @@ void pre_tx_negoreq_handler( _adapter* p +@@ -2802,67 +3421,962 @@ void pre_tx_negoreq_handler( _adapter* padapter ) _func_enter_; set_channel_bwmode(padapter, pwdinfo->nego_req_info.peer_channel_num[0], HAL_PRIME_CHNL_OFFSET_DONT_CARE, HT_CHANNEL_WIDTH_20); @@ -28314,10 +27573,6 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + } -void p2p_protocol_wk_hdl(_adapter *padapter, int intCmdType) --{ -- struct wifidirect_info *pwdinfo= &(padapter->wdinfo); -- --_func_enter_; + rtw_p2p_set_state(pwdinfo, P2P_STATE_LISTEN); + val8 = 1; + rtw_hal_set_hwreg(padapter, HW_VAR_MLME_SITESURVEY, (u8 *)(&val8)); @@ -29224,13 +28479,9 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release +#endif //CONFIG_IOCTL_CFG80211 + +void p2p_protocol_wk_hdl(_adapter *padapter, int intCmdType) -+{ -+ struct wifidirect_info *pwdinfo= &(padapter->wdinfo); -+ -+_func_enter_; - - switch(intCmdType) - { + { + struct wifidirect_info *pwdinfo= &(padapter->wdinfo); + @@ -2882,14 +4396,61 @@ _func_enter_; } case P2P_PRE_TX_PROVDISC_PROCESS_WK: @@ -29418,7 +28669,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release void p2p_ps_wk_hdl(_adapter *padapter, u8 p2p_ps_state) { -@@ -2911,42 +4584,53 @@ void p2p_ps_wk_hdl(_adapter *padapter, u +@@ -2911,42 +4584,53 @@ void p2p_ps_wk_hdl(_adapter *padapter, u8 p2p_ps_state) _func_enter_; @@ -29499,7 +28750,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } _func_exit_; -@@ -2962,44 +4646,41 @@ u8 p2p_ps_wk_cmd(_adapter*padapter, u8 p +@@ -2962,44 +4646,41 @@ u8 p2p_ps_wk_cmd(_adapter*padapter, u8 p2p_ps_state, u8 enqueue) _func_enter_; @@ -29617,7 +28868,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release static void restore_p2p_state_timer_process (void *FunctionContext) { -@@ -3042,7 +4762,7 @@ static void pre_tx_scan_timer_process (v +@@ -3042,7 +4762,7 @@ static void pre_tx_scan_timer_process (void *FunctionContext) if ( _TRUE == pwdinfo->tx_prov_disc_info.benable ) // the provision discovery request frame is trigger to send or not { p2p_protocol_wk_cmd( adapter, P2P_PRE_TX_PROVDISC_PROCESS_WK ); @@ -29626,7 +28877,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release //_set_timer( &pwdinfo->pre_tx_scan_timer, P2P_TX_PRESCAN_TIMEOUT ); } } -@@ -3051,10 +4771,17 @@ static void pre_tx_scan_timer_process (v +@@ -3051,10 +4771,17 @@ static void pre_tx_scan_timer_process (void *FunctionContext) if ( _TRUE == pwdinfo->nego_req_info.benable ) { p2p_protocol_wk_cmd( adapter, P2P_PRE_TX_NEGOREQ_PROCESS_WK ); @@ -29645,7 +28896,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release else { DBG_8192C( "[%s] p2p_state is %d, ignore!!\n", __FUNCTION__, rtw_p2p_state(pwdinfo) ); -@@ -3076,69 +4803,167 @@ static void find_phase_timer_process (vo +@@ -3076,69 +4803,167 @@ static void find_phase_timer_process (void *FunctionContext) p2p_protocol_wk_cmd( adapter, P2P_FIND_PHASE_WK ); } @@ -29835,7 +29086,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release // Use the OFDM rate in the P2P probe response frame. ( 6(B), 9(B), 12, 18, 24, 36, 48, 54 ) pwdinfo->support_rate[0] = 0x8c; // 6(B) pwdinfo->support_rate[1] = 0x92; // 9(B) -@@ -3152,12 +4977,10 @@ void init_wifidirect_info( _adapter* pad +@@ -3152,12 +4977,10 @@ void init_wifidirect_info( _adapter* padapter, enum P2P_ROLE role) _rtw_memcpy( ( void* ) pwdinfo->p2p_wildcard_ssid, "DIRECT-", 7 ); _rtw_memset( pwdinfo->device_name, 0x00, WPS_MAX_DEVICE_NAME_LEN ); @@ -29849,7 +29100,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release _rtw_memset( &pwdinfo->inviteresp_info, 0x00, sizeof( struct tx_invite_resp_info ) ); pwdinfo->inviteresp_info.token = 0; -@@ -3165,10 +4988,6 @@ void init_wifidirect_info( _adapter* pad +@@ -3165,10 +4988,6 @@ void init_wifidirect_info( _adapter* padapter, enum P2P_ROLE role) pwdinfo->profileindex = 0; _rtw_memset( &pwdinfo->profileinfo[ 0 ], 0x00, sizeof( struct profile_info ) * P2P_MAX_PERSISTENT_GROUP_NUM ); @@ -29860,7 +29111,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release rtw_p2p_findphase_ex_set(pwdinfo, P2P_FINDPHASE_EX_NONE); pwdinfo->listen_dwell = ( u8 ) (( rtw_get_current_time() % 3 ) + 1); -@@ -3187,197 +5006,140 @@ void init_wifidirect_info( _adapter* pad +@@ -3187,197 +5006,140 @@ void init_wifidirect_info( _adapter* padapter, enum P2P_ROLE role) pwdinfo->ui_got_wps_info = P2P_NO_WPSINFO; #ifdef CONFIG_WFD @@ -30084,9 +29335,37 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + return "P2P_ROLE_GO"; + default: + return "UNKNOWN"; -+ } -+} -+ + } +- +- return is_p2p_frame; + } +-#endif //CONFIG_IOCTL_CFG80211 + +-#ifdef CONFIG_DBG_P2P +-char * p2p_role_str[] = { +- "P2P_ROLE_DISABLE", +- "P2P_ROLE_DEVICE", +- "P2P_ROLE_CLIENT", +- "P2P_ROLE_GO" +-}; +- +-char * p2p_state_str[] = { +- "P2P_STATE_NONE", +- "P2P_STATE_IDLE", +- "P2P_STATE_LISTEN", +- "P2P_STATE_SCAN", +- "P2P_STATE_FIND_PHASE_LISTEN", +- "P2P_STATE_FIND_PHASE_SEARCH", +- "P2P_STATE_TX_PROVISION_DIS_REQ", +- "P2P_STATE_RX_PROVISION_DIS_RSP", +- "P2P_STATE_RX_PROVISION_DIS_REQ", +- "P2P_STATE_GONEGO_ING", +- "P2P_STATE_GONEGO_OK", +- "P2P_STATE_GONEGO_FAIL", +- "P2P_STATE_RECV_INVITE_REQ", +- "P2P_STATE_PROVISIONING_ING", +- "P2P_STATE_PROVISIONING_DONE" +-}; +/** + * rtw_p2p_state_txt - Get the p2p state name as a text string + * @state: P2P state @@ -30143,41 +29422,12 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + return "P2P_STATE_TX_INFOR_NOREADY"; + default: + return "UNKNOWN"; - } -- -- return is_p2p_frame; - } --#endif //CONFIG_IOCTL_CFG80211 -- --#ifdef CONFIG_DBG_P2P --char * p2p_role_str[] = { -- "P2P_ROLE_DISABLE", -- "P2P_ROLE_DEVICE", -- "P2P_ROLE_CLIENT", -- "P2P_ROLE_GO" --}; -- --char * p2p_state_str[] = { -- "P2P_STATE_NONE", -- "P2P_STATE_IDLE", -- "P2P_STATE_LISTEN", -- "P2P_STATE_SCAN", -- "P2P_STATE_FIND_PHASE_LISTEN", -- "P2P_STATE_FIND_PHASE_SEARCH", -- "P2P_STATE_TX_PROVISION_DIS_REQ", -- "P2P_STATE_RX_PROVISION_DIS_RSP", -- "P2P_STATE_RX_PROVISION_DIS_REQ", -- "P2P_STATE_GONEGO_ING", -- "P2P_STATE_GONEGO_OK", -- "P2P_STATE_GONEGO_FAIL", -- "P2P_STATE_RECV_INVITE_REQ", -- "P2P_STATE_PROVISIONING_ING", -- "P2P_STATE_PROVISIONING_DONE" --}; ++ } ++} void dbg_rtw_p2p_set_state(struct wifidirect_info *wdinfo, enum P2P_STATE state, const char *caller, int line) { -@@ -3385,11 +5147,11 @@ void dbg_rtw_p2p_set_state(struct wifidi +@@ -3385,11 +5147,11 @@ void dbg_rtw_p2p_set_state(struct wifidirect_info *wdinfo, enum P2P_STATE state, enum P2P_STATE old_state = _rtw_p2p_state(wdinfo); _rtw_p2p_set_state(wdinfo, state); DBG_871X("[CONFIG_DBG_P2P]%s:%d set_state from %s to %s\n", caller, line @@ -30191,7 +29441,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release ); } } -@@ -3399,11 +5161,11 @@ void dbg_rtw_p2p_set_pre_state(struct wi +@@ -3399,11 +5161,11 @@ void dbg_rtw_p2p_set_pre_state(struct wifidirect_info *wdinfo, enum P2P_STATE st enum P2P_STATE old_state = _rtw_p2p_pre_state(wdinfo); _rtw_p2p_set_pre_state(wdinfo, state); DBG_871X("[CONFIG_DBG_P2P]%s:%d set_pre_state from %s to %s\n", caller, line @@ -30205,7 +29455,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release ); } } -@@ -3428,11 +5190,11 @@ void dbg_rtw_p2p_set_role(struct wifidir +@@ -3428,11 +5190,11 @@ void dbg_rtw_p2p_set_role(struct wifidirect_info *wdinfo, enum P2P_ROLE role, co enum P2P_ROLE old_role = wdinfo->role; _rtw_p2p_set_role(wdinfo, role); DBG_871X("[CONFIG_DBG_P2P]%s:%d set_role from %s to %s\n", caller, line @@ -30219,7 +29469,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release ); } } -@@ -3450,29 +5212,45 @@ int rtw_p2p_enable(_adapter *padapter, e +@@ -3450,29 +5212,45 @@ int rtw_p2p_enable(_adapter *padapter, enum P2P_ROLE role) u8 channel, ch_offset; u16 bwmode; @@ -30278,7 +29528,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release //Disable P2P function if(!rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)) -@@ -3480,16 +5258,34 @@ int rtw_p2p_enable(_adapter *padapter, e +@@ -3480,16 +5258,34 @@ int rtw_p2p_enable(_adapter *padapter, enum P2P_ROLE role) _cancel_timer_ex( &pwdinfo->find_phase_timer ); _cancel_timer_ex( &pwdinfo->restore_p2p_state_timer ); _cancel_timer_ex( &pwdinfo->pre_tx_scan_timer); @@ -30318,6 +29568,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release exit: return ret; } +diff --git a/drivers/net/wireless/rtl8192cu/core/rtw_pwrctrl.c b/drivers/net/wireless/rtl8192cu/core/rtw_pwrctrl.c +index 92b3cb8..d1c11fa 100644 --- a/drivers/net/wireless/rtl8192cu/core/rtw_pwrctrl.c +++ b/drivers/net/wireless/rtl8192cu/core/rtw_pwrctrl.c @@ -16,8 +16,7 @@ @@ -31848,7 +31100,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #endif static void resume_workitem_callback(struct work_struct *work) { -@@ -991,9 +1164,8 @@ static void resume_workitem_callback(str +@@ -991,9 +1164,8 @@ static void resume_workitem_callback(struct work_struct *work) DBG_871X("%s\n",__FUNCTION__); @@ -31860,7 +31112,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #endif } -@@ -1011,17 +1183,33 @@ void rtw_resume_in_workqueue(struct pwrc +@@ -1011,17 +1183,33 @@ void rtw_resume_in_workqueue(struct pwrctrl_priv *pwrpriv) } #endif //CONFIG_RESUME_IN_WORKQUEUE @@ -31899,7 +31151,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } static void rtw_late_resume(struct early_suspend *h) -@@ -1031,16 +1219,22 @@ static void rtw_late_resume(struct early +@@ -1031,16 +1219,22 @@ static void rtw_late_resume(struct early_suspend *h) DBG_871X("%s\n",__FUNCTION__); if(pwrpriv->do_late_resume) { @@ -31926,7 +31178,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release DBG_871X("%s\n", __FUNCTION__); //jeff: set the early suspend level before blank screen, so we wll do late resume after scree is lit -@@ -1054,9 +1248,16 @@ void rtw_register_early_suspend(struct p +@@ -1054,9 +1248,16 @@ void rtw_register_early_suspend(struct pwrctrl_priv *pwrpriv) void rtw_unregister_early_suspend(struct pwrctrl_priv *pwrpriv) { @@ -31944,7 +31196,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if (pwrpriv->early_suspend.suspend) unregister_early_suspend(&pwrpriv->early_suspend); -@@ -1067,16 +1268,15 @@ void rtw_unregister_early_suspend(struct +@@ -1067,16 +1268,15 @@ void rtw_unregister_early_suspend(struct pwrctrl_priv *pwrpriv) #endif //CONFIG_HAS_EARLYSUSPEND #ifdef CONFIG_ANDROID_POWER @@ -31965,7 +31217,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } static void rtw_late_resume(android_early_suspend_t *h) -@@ -1086,16 +1286,22 @@ static void rtw_late_resume(android_earl +@@ -1086,16 +1286,22 @@ static void rtw_late_resume(android_early_suspend_t *h) DBG_871X("%s\n",__FUNCTION__); if(pwrpriv->do_late_resume) { @@ -31992,7 +31244,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release DBG_871X("%s\n", __FUNCTION__); //jeff: set the early suspend level before blank screen, so we wll do late resume after scree is lit -@@ -1107,9 +1313,16 @@ void rtw_register_early_suspend(struct p +@@ -1107,9 +1313,16 @@ void rtw_register_early_suspend(struct pwrctrl_priv *pwrpriv) void rtw_unregister_early_suspend(struct pwrctrl_priv *pwrpriv) { @@ -32010,7 +31262,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if (pwrpriv->early_suspend.suspend) android_unregister_early_suspend(&pwrpriv->early_suspend); -@@ -1122,24 +1335,81 @@ void rtw_unregister_early_suspend(struct +@@ -1122,24 +1335,81 @@ void rtw_unregister_early_suspend(struct pwrctrl_priv *pwrpriv) u8 rtw_interface_ps_func(_adapter *padapter,HAL_INTF_PS_FUNC efunc_id,u8* val) { u8 bResult = _TRUE; @@ -32098,7 +31350,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release //System suspend is not allowed to wakeup if((pwrpriv->bInternalAutoSuspend == _FALSE) && (_TRUE == pwrpriv->bInSuspend )){ -@@ -1147,11 +1417,6 @@ int _rtw_pwr_wakeup(_adapter *padapter, +@@ -1147,11 +1417,6 @@ int _rtw_pwr_wakeup(_adapter *padapter, const char *caller) goto exit; } @@ -32110,7 +31362,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release //block??? if((pwrpriv->bInternalAutoSuspend == _TRUE) && (padapter->net_closed == _TRUE)) { ret = _FAIL; -@@ -1164,7 +1429,7 @@ int _rtw_pwr_wakeup(_adapter *padapter, +@@ -1164,7 +1429,7 @@ int _rtw_pwr_wakeup(_adapter *padapter, const char *caller) ret = _SUCCESS; goto exit; } @@ -32119,7 +31371,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if(rf_off == pwrpriv->rf_pwrstate ) { #ifdef CONFIG_USB_HCI -@@ -1177,7 +1442,7 @@ int _rtw_pwr_wakeup(_adapter *padapter, +@@ -1177,7 +1442,7 @@ int _rtw_pwr_wakeup(_adapter *padapter, const char *caller) } else if(padapter->registrypriv.usbss_enable) { @@ -32128,7 +31380,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if(_FAIL == autoresume_enter(padapter)) { DBG_8192C("======> autoresume fail.............\n"); -@@ -1190,7 +1455,7 @@ int _rtw_pwr_wakeup(_adapter *padapter, +@@ -1190,7 +1455,7 @@ int _rtw_pwr_wakeup(_adapter *padapter, const char *caller) #endif { #ifdef CONFIG_IPS @@ -32137,7 +31389,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if(_FAIL == ips_leave(padapter)) { DBG_8192C("======> ips_leave fail.............\n"); -@@ -1199,10 +1464,6 @@ int _rtw_pwr_wakeup(_adapter *padapter, +@@ -1199,10 +1464,6 @@ int _rtw_pwr_wakeup(_adapter *padapter, const char *caller) } #endif } @@ -32148,7 +31400,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } //TODO: the following checking need to be merged... -@@ -1220,8 +1481,60 @@ int _rtw_pwr_wakeup(_adapter *padapter, +@@ -1220,8 +1481,60 @@ int _rtw_pwr_wakeup(_adapter *padapter, const char *caller) } exit: @@ -32209,6 +31461,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } +diff --git a/drivers/net/wireless/rtl8192cu/core/rtw_recv.c b/drivers/net/wireless/rtl8192cu/core/rtw_recv.c +index 0d5143b..2cc8faa 100644 --- a/drivers/net/wireless/rtl8192cu/core/rtw_recv.c +++ b/drivers/net/wireless/rtl8192cu/core/rtw_recv.c @@ -16,7 +16,7 @@ @@ -32250,7 +31504,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release void rtw_mfree_recv_priv_lock(struct recv_priv *precvpriv) { _rtw_spinlock_free(&precvpriv->lock); -@@ -171,6 +178,8 @@ void _rtw_free_recv_priv (struct recv_pr +@@ -171,6 +178,8 @@ void _rtw_free_recv_priv (struct recv_priv *precvpriv) _func_enter_; @@ -32328,7 +31582,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release int rtw_free_recvframe(union recv_frame *precvframe, _queue *pfree_recv_queue) { _irqL irqL; -@@ -247,41 +260,34 @@ int rtw_free_recvframe(union recv_frame +@@ -247,41 +260,34 @@ int rtw_free_recvframe(union recv_frame *precvframe, _queue *pfree_recv_queue) _func_enter_; @@ -32479,7 +31733,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release sint rtw_enqueue_recvbuf(struct recv_buf *precvbuf, _queue *queue) { _irqL irqL; -@@ -435,14 +471,16 @@ struct recv_buf *rtw_dequeue_recvbuf (_q +@@ -435,14 +471,16 @@ struct recv_buf *rtw_dequeue_recvbuf (_queue *queue) } @@ -32611,7 +31865,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { #ifdef CONFIG_AP_MODE unsigned char pwrbit; -@@ -826,11 +866,11 @@ static void process_pwrbit_data(_adapter +@@ -826,11 +866,11 @@ static void process_pwrbit_data(_adapter *padapter, union recv_frame *precv_fram { //psta->state |= WIFI_SLEEP_STATE; //pstapriv->sta_dz_bitmap |= BIT(psta->aid); @@ -32626,36 +31880,33 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } else { -@@ -838,897 +878,118 @@ static void process_pwrbit_data(_adapter +@@ -838,10 +878,10 @@ static void process_pwrbit_data(_adapter *padapter, union recv_frame *precv_fram { //psta->state ^= WIFI_SLEEP_STATE; //pstapriv->sta_dz_bitmap &= ~BIT(psta->aid); - -- wakeup_sta_to_xmit(padapter, psta); -- ++ + wakeup_sta_to_xmit(padapter, psta); + - //DBG_871X("to wakeup, sta_dz_bitmap=%x\n", pstapriv->sta_dz_bitmap); -- } -- } -- -- } -- --#endif --} -- ++ //DBG_871X("to wakeup, sta_dz_bitmap=%x\n", pstapriv->sta_dz_bitmap); + } + } + +@@ -850,7 +890,8 @@ static void process_pwrbit_data(_adapter *padapter, union recv_frame *precv_fram + #endif + } + -static void process_wmmps_data(_adapter *padapter, union recv_frame *precv_frame) --{ --#ifdef CONFIG_AP_MODE -- struct rx_pkt_attrib *pattrib = &precv_frame->u.hdr.attrib; -- struct sta_priv *pstapriv = &padapter->stapriv; -- struct sta_info *psta=NULL; -- -- psta = rtw_get_stainfo(pstapriv, pattrib->src); -- -- if(!psta) return; -- --#ifdef CONFIG_TDLS -- if( !(psta->tdls_sta_state & TDLS_LINKED_STATE ) ) -- { ++void process_wmmps_data(_adapter *padapter, union recv_frame *precv_frame); ++void process_wmmps_data(_adapter *padapter, union recv_frame *precv_frame) + { + #ifdef CONFIG_AP_MODE + struct rx_pkt_attrib *pattrib = &precv_frame->u.hdr.attrib; +@@ -864,871 +905,91 @@ static void process_wmmps_data(_adapter *padapter, union recv_frame *precv_frame + #ifdef CONFIG_TDLS + if( !(psta->tdls_sta_state & TDLS_LINKED_STATE ) ) + { -#endif //CONFIG_TDLS - - if(!psta->qos_option) @@ -33398,17 +32649,12 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - _rtw_memcpy(&ptdls_sta->ch_switch_timeout, pIE->data+2, 2); - default: - break; -+ -+ wakeup_sta_to_xmit(padapter, psta); -+ -+ //DBG_871X("to wakeup, sta_dz_bitmap=%x\n", pstapriv->sta_dz_bitmap); -+ } - } - +- } +- - j += (pIE->Length + 2); - - } - +- } +- - //todo: check status - ptdls_sta->stat_code=0; - ptdls_sta->tdls_sta_state |= TDLS_CH_SWITCH_ON_STATE; @@ -33428,13 +32674,10 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - rtw_tdls_cmd(adapter, ptdls_sta->hwaddr, TDLS_OFF_CH); - } - return _FAIL; -+#endif - } - +-} +- -sint On_TDLS_Ch_Switch_Rsp(_adapter *adapter, union recv_frame *precv_frame) -+void process_wmmps_data(_adapter *padapter, union recv_frame *precv_frame); -+void process_wmmps_data(_adapter *padapter, union recv_frame *precv_frame) - { +-{ - struct sta_info *ptdls_sta= NULL; - struct sta_priv *pstapriv = &adapter->stapriv; - u8 *ptr = precv_frame->u.hdr.rx_data; @@ -33445,7 +32688,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - u8 FIXED_IE =4; - u16 stat_code, j, switch_time, switch_timeout; - struct mlme_ext_priv *pmlmeext = &adapter->mlmeextpriv; -- ++#endif //CONFIG_TDLS + - psa = get_sa(ptr); - ptdls_sta = rtw_get_stainfo(pstapriv, psa); - @@ -33463,16 +32707,13 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - } - return _FAIL; - } -+#ifdef CONFIG_AP_MODE -+ struct rx_pkt_attrib *pattrib = &precv_frame->u.hdr.attrib; -+ struct sta_priv *pstapriv = &padapter->stapriv; -+ struct sta_info *psta=NULL; ++ if(!psta->qos_option) ++ return; - //avoiding duplicated or unconditional ch. switch. rsp - if((ptdls_sta->tdls_sta_state & TDLS_CH_SW_INITIATOR_STATE) != TDLS_CH_SW_INITIATOR_STATE) - return _FAIL; -+ psta = rtw_get_stainfo(pstapriv, pattrib->src); - +- - //[+1]: payload type - ptr +=prx_pkt_attrib->hdrlen + prx_pkt_attrib->iv_len+LLC_HEADER_SIZE+TYPE_LENGTH_FIELD_SIZE+1; - parsing_length= ((union recv_frame *)precv_frame)->u.hdr.len @@ -33483,29 +32724,21 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - -TYPE_LENGTH_FIELD_SIZE - -1 - -FIXED_IE; -+ if(!psta) return; - +- - _rtw_memcpy(&stat_code, ptr+2, 2); -+#ifdef CONFIG_TDLS -+ if( !(psta->tdls_sta_state & TDLS_LINKED_STATE ) ) -+ { -+#endif //CONFIG_TDLS - +- - if(stat_code!=0){ - return _FAIL; -- } -- -- //parsing information element -- for(j=FIXED_IE; jqos_option) -+ return; - -- pIE = (PNDIS_802_11_VARIABLE_IEs)(ptr+ j); + if(!(psta->qos_info&0xf)) + return; + +#ifdef CONFIG_TDLS -+ } + } +- +- //parsing information element +- for(j=FIXED_IE; jElementID) @@ -33581,6 +32814,9 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release struct rx_pkt_attrib *pattrib = & precv_frame->u.hdr.attrib; sint ret = _SUCCESS; u8 *paction = get_recvframe_data(precv_frame); +- +- //point to action field, [+8]: snap+ether_type, [+1]: payload_type, [+1]: category field +- paction+=pattrib->hdrlen + pattrib->iv_len+8+1+1; + u8 category_field = 1; +#ifdef CONFIG_WFD + u8 WFA_OUI[3] = { 0x50, 0x6f, 0x9a }; @@ -33594,9 +32830,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + + ETH_TYPE_LEN + + PAYLOAD_TYPE_LEN + + category_field; - -- //point to action field, [+8]: snap+ether_type, [+1]: payload_type, [+1]: category field -- paction+=pattrib->hdrlen + pattrib->iv_len+8+1+1; ++ + if(ptdlsinfo->enable == 0) + { + DBG_871X("recv tdls frame, " @@ -33607,7 +32841,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release switch(*paction){ case TDLS_SETUP_REQUEST: -@@ -1763,6 +1024,26 @@ sint OnTDLS(_adapter *adapter, union rec +@@ -1763,6 +1024,26 @@ sint OnTDLS(_adapter *adapter, union recv_frame *precv_frame) DBG_871X("recv tdls channel switch response frame\n"); ret=On_TDLS_Ch_Switch_Rsp(adapter, precv_frame); break; @@ -33647,7 +32881,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { int sz; struct sta_info *psta = NULL; -@@ -1791,7 +1073,7 @@ static void count_rx_stats(_adapter *pad +@@ -1791,7 +1073,7 @@ static void count_rx_stats(_adapter *padapter, union recv_frame *prframe, struct if( (!MacAddr_isBcst(pattrib->dst)) && (!IS_MCAST(pattrib->dst))){ padapter->mlmepriv.LinkDetectInfo.NumRxUnicastOkInPeriod++; } @@ -33656,7 +32890,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if(sta) psta = sta; else -@@ -1807,7 +1089,12 @@ static void count_rx_stats(_adapter *pad +@@ -1807,7 +1089,12 @@ static void count_rx_stats(_adapter *padapter, union recv_frame *prframe, struct } @@ -34054,7 +33288,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { #ifdef CONFIG_AP_MODE struct rx_pkt_attrib *pattrib = &precv_frame->u.hdr.attrib; -@@ -2346,13 +1602,22 @@ static sint validate_recv_ctrl_frame(_ad +@@ -2346,13 +1602,22 @@ static sint validate_recv_ctrl_frame(_adapter *padapter, union recv_frame *precv if(wmmps_ac) return _FAIL; @@ -34078,7 +33312,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release xmitframe_phead = get_list_head(&psta->sleep_q); xmitframe_plist = get_next(xmitframe_phead); -@@ -2376,10 +1641,15 @@ static sint validate_recv_ctrl_frame(_ad +@@ -2376,10 +1641,15 @@ static sint validate_recv_ctrl_frame(_adapter *padapter, union recv_frame *precv //DBG_871X("handling ps-poll, q_len=%d, tim=%x\n", psta->sleepq_len, pstapriv->tim_bitmap); @@ -34095,7 +33329,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if(psta->sleepq_len==0) { -@@ -2392,15 +1662,24 @@ static sint validate_recv_ctrl_frame(_ad +@@ -2392,15 +1662,24 @@ static sint validate_recv_ctrl_frame(_adapter *padapter, union recv_frame *precv update_beacon(padapter, _TIM_IE_, NULL, _FALSE); } @@ -34120,7 +33354,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } else { -@@ -2415,9 +1694,7 @@ static sint validate_recv_ctrl_frame(_ad +@@ -2415,9 +1694,7 @@ static sint validate_recv_ctrl_frame(_adapter *padapter, union recv_frame *precv update_beacon(padapter, _TIM_IE_, NULL, _FALSE); } @@ -34131,7 +33365,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } -@@ -2429,37 +1706,58 @@ static sint validate_recv_ctrl_frame(_ad +@@ -2429,37 +1706,58 @@ static sint validate_recv_ctrl_frame(_adapter *padapter, union recv_frame *precv } @@ -34201,7 +33435,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { struct rx_pkt_attrib * pattrib=&precv_frame->u.hdr.attrib; struct recv_stat* prxstat=( struct recv_stat * ) precv_frame->u.hdr.rx_head ; -@@ -2505,32 +1803,28 @@ static sint validate_recv_mgnt_frame(_ad +@@ -2505,32 +1803,28 @@ static sint validate_recv_mgnt_frame(_adapter *adapter, union recv_frame *precv_ pattrib->priority=0; pattrib->hdrlen = pattrib->to_fr_ds==3 ? 30 : 24; @@ -34735,7 +33969,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release nr_subframes = 0; pattrib = &prframe->u.hdr.attrib; -@@ -3271,26 +2787,29 @@ static int amsdu_to_msdu(_adapter *padap +@@ -3271,26 +2787,29 @@ static int amsdu_to_msdu(_adapter *padapter, union recv_frame *prframe) while(a_len > ETH_HLEN) { /* Offset 12 denote 2 mac address */ @@ -34771,7 +34005,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if(sub_skb) { skb_reserve(sub_skb, 12); -@@ -3298,26 +2817,43 @@ static int amsdu_to_msdu(_adapter *padap +@@ -3298,26 +2817,43 @@ static int amsdu_to_msdu(_adapter *padapter, union recv_frame *prframe) _rtw_memcpy(data_ptr, pdata, nSubframe_Length); } else @@ -34820,7 +34054,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release break; } -@@ -3338,11 +2874,15 @@ static int amsdu_to_msdu(_adapter *padap +@@ -3338,11 +2874,15 @@ static int amsdu_to_msdu(_adapter *padapter, union recv_frame *prframe) } for(i=0; ilen >= 8 && ((_rtw_memcmp(sub_skb->data, rtw_rfc1042_header, SNAP_SIZE) && eth_type != ETH_P_AARP && eth_type != ETH_P_IPX) || -@@ -3378,7 +2918,7 @@ static int amsdu_to_msdu(_adapter *padap +@@ -3378,7 +2918,7 @@ static int amsdu_to_msdu(_adapter *padapter, union recv_frame *prframe) #endif // (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35)) @@ -34846,7 +34080,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { int nat25_handle_frame(_adapter *priv, struct sk_buff *skb); if (nat25_handle_frame(padapter, sub_skb) == -1) { -@@ -3389,7 +2929,7 @@ static int amsdu_to_msdu(_adapter *padap +@@ -3389,7 +2929,7 @@ static int amsdu_to_msdu(_adapter *padapter, union recv_frame *prframe) #if 1 // bypass this frame to upper layer!! #else @@ -34855,7 +34089,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release continue; #endif } -@@ -3407,10 +2947,74 @@ static int amsdu_to_msdu(_adapter *padap +@@ -3407,10 +2947,74 @@ static int amsdu_to_msdu(_adapter *padapter, union recv_frame *prframe) } #else /* !CONFIG_TCP_CSUM_OFFLOAD_RX */ sub_skb->ip_summed = CHECKSUM_NONE; @@ -35049,7 +34283,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { u8 wsize = preorder_ctrl->wsize_b; u16 wend = (preorder_ctrl->indicate_seq + wsize -1) & 0xFFF;//% 4096; -@@ -3740,7 +3345,7 @@ static int check_indicate_seq(struct rec +@@ -3740,7 +3345,7 @@ static int check_indicate_seq(struct recv_reorder_ctrl *preorder_ctrl, u16 seq_n //DbgPrint("CheckRxTsIndicateSeq(): Packet Drop! IndicateSeq: %d, NewSeq: %d\n", precvpriv->indicate_seq, seq_num); #ifdef DBG_RX_DROP_FRAME @@ -35058,7 +34292,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release preorder_ctrl->indicate_seq, seq_num); #endif -@@ -3783,8 +3388,8 @@ static int check_indicate_seq(struct rec +@@ -3783,8 +3388,8 @@ static int check_indicate_seq(struct recv_reorder_ctrl *preorder_ctrl, u16 seq_n return _TRUE; } @@ -35069,7 +34303,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { struct rx_pkt_attrib *pattrib = &prframe->u.hdr.attrib; _queue *ppending_recvframe_queue = &preorder_ctrl->pending_recvframe_queue; -@@ -3845,10 +3450,10 @@ static int enqueue_reorder_recvframe(str +@@ -3845,10 +3450,10 @@ static int enqueue_reorder_recvframe(struct recv_reorder_ctrl *preorder_ctrl, un } @@ -35083,7 +34317,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release //u8 bcancelled; _list *phead, *plist; union recv_frame *prframe; -@@ -3894,7 +3499,7 @@ static int recv_indicatepkts_in_order(_a +@@ -3894,7 +3499,7 @@ static int recv_indicatepkts_in_order(_adapter *padapter, struct recv_reorder_ct // Prepare indication list and indication. // Check if there is any packet need indicate. while(!rtw_is_list_empty(phead)) @@ -35092,7 +34326,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release prframe = LIST_CONTAINOR(plist, union recv_frame, u); pattrib = &prframe->u.hdr.attrib; -@@ -3935,7 +3540,7 @@ static int recv_indicatepkts_in_order(_a +@@ -3935,7 +3540,7 @@ static int recv_indicatepkts_in_order(_adapter *padapter, struct recv_reorder_ct //PlatformCancelTimer(Adapter, &pTS->RxPktPendingTimer); if(bforced!=_TRUE) { @@ -35101,7 +34335,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release _cancel_timer(&preorder_ctrl->reordering_ctrl_timer, &bcancelled); } } -@@ -3952,14 +3557,14 @@ static int recv_indicatepkts_in_order(_a +@@ -3952,14 +3557,14 @@ static int recv_indicatepkts_in_order(_adapter *padapter, struct recv_reorder_ct //DbgPrint("recv_indicatepkts_in_order, indicate_seq=%d, seq_num=%d\n", precvpriv->indicate_seq, pattrib->seq_num); if(!pattrib->amsdu) { @@ -35120,7 +34354,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } } else if(pattrib->amsdu==1) -@@ -3999,7 +3604,7 @@ static int recv_indicatepkts_in_order(_a +@@ -3999,7 +3604,7 @@ static int recv_indicatepkts_in_order(_adapter *padapter, struct recv_reorder_ct // Set new pending timer. //pTS->RxIndicateState = RXTS_INDICATE_REORDER; //PlatformSetTimer(Adapter, &pTS->RxPktPendingTimer, pHTInfo->RxReorderPendingTime); @@ -35129,7 +34363,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release _set_timer(&preorder_ctrl->reordering_ctrl_timer, REORDER_WAIT_TIME); } else -@@ -4014,12 +3619,11 @@ static int recv_indicatepkts_in_order(_a +@@ -4014,12 +3619,11 @@ static int recv_indicatepkts_in_order(_adapter *padapter, struct recv_reorder_ct } @@ -35144,7 +34378,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release struct rx_pkt_attrib *pattrib = &prframe->u.hdr.attrib; struct recv_reorder_ctrl *preorder_ctrl = prframe->u.hdr.preorder_ctrl; _queue *ppending_recvframe_queue = &preorder_ctrl->pending_recvframe_queue; -@@ -4029,7 +3633,9 @@ static int recv_indicatepkt_reorder(_ada +@@ -4029,7 +3633,9 @@ static int recv_indicatepkt_reorder(_adapter *padapter, union recv_frame *prfram //s1. wlanhdr_to_ethhdr(prframe); @@ -35155,7 +34389,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { if ((padapter->bDriverStopped == _FALSE) && (padapter->bSurpriseRemoved == _FALSE)) -@@ -4126,7 +3732,15 @@ static int recv_indicatepkt_reorder(_ada +@@ -4126,7 +3732,15 @@ static int recv_indicatepkt_reorder(_adapter *padapter, union recv_frame *prfram #ifdef DBG_RX_DROP_FRAME DBG_871X("DBG_RX_DROP_FRAME %s check_indicate_seq fail\n", __FUNCTION__); #endif @@ -35171,7 +34405,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } -@@ -4166,6 +3780,8 @@ static int recv_indicatepkt_reorder(_ada +@@ -4166,6 +3780,8 @@ static int recv_indicatepkt_reorder(_adapter *padapter, union recv_frame *prfram } @@ -35180,7 +34414,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return _SUCCESS; _err_exit: -@@ -4189,7 +3805,7 @@ void rtw_reordering_ctrl_timeout_handler +@@ -4189,7 +3805,7 @@ void rtw_reordering_ctrl_timeout_handler(void *pcontext) return; } @@ -35189,7 +34423,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release _enter_critical_bh(&ppending_recvframe_queue->lock, &irql); -@@ -4202,19 +3818,29 @@ void rtw_reordering_ctrl_timeout_handler +@@ -4202,19 +3818,29 @@ void rtw_reordering_ctrl_timeout_handler(void *pcontext) } @@ -35224,7 +34458,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { //prframe->u.hdr.preorder_ctrl = &precvpriv->recvreorder_ctrl[pattrib->priority]; -@@ -4267,24 +3893,17 @@ static int process_recv_indicatepkts(_ad +@@ -4267,24 +3893,17 @@ static int process_recv_indicatepkts(_adapter *padapter, union recv_frame *prfra return retval; } @@ -35256,7 +34490,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #ifdef CONFIG_MP_INCLUDED if ((check_fwstate(pmlmepriv, WIFI_MP_STATE) == _TRUE))//&&(padapter->mppriv.check_mp_pkt == 0)) -@@ -4296,21 +3915,44 @@ static int recv_func(_adapter *padapter, +@@ -4296,21 +3915,44 @@ static int recv_func(_adapter *padapter, void *pcontext) if (check_fwstate(pmlmepriv, WIFI_MP_LPBK_STATE) == _FALSE) { RT_TRACE(_module_rtl871x_recv_c_, _drv_alert_, ("MP - Not in loopback mode , drop pkt \n")); @@ -35308,7 +34542,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release // DATA FRAME rtw_led_control(padapter, LED_CTL_RX); -@@ -4320,22 +3962,38 @@ static int recv_func(_adapter *padapter, +@@ -4320,22 +3962,38 @@ static int recv_func(_adapter *padapter, void *pcontext) #ifdef DBG_RX_DROP_FRAME DBG_871X("DBG_RX_DROP_FRAME %s decryptor: drop pkt\n", __FUNCTION__); #endif @@ -35354,7 +34588,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release prframe = recvframe_chk_defrag(padapter, prframe); if(prframe==NULL) { -@@ -4352,16 +4010,22 @@ static int recv_func(_adapter *padapter, +@@ -4352,16 +4010,22 @@ static int recv_func(_adapter *padapter, void *pcontext) #ifdef DBG_RX_DROP_FRAME DBG_871X("DBG_RX_DROP_FRAME %s portctrl: drop pkt\n", __FUNCTION__); #endif @@ -35380,7 +34614,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("recv_func: process_recv_indicatepkts fail! \n")); #ifdef DBG_RX_DROP_FRAME -@@ -4371,12 +4035,12 @@ static int recv_func(_adapter *padapter, +@@ -4371,12 +4035,12 @@ static int recv_func(_adapter *padapter, void *pcontext) goto _recv_data_drop; } @@ -35396,7 +34630,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("wlanhdr_to_ethhdr: drop pkt \n")); #ifdef DBG_RX_DROP_FRAME -@@ -4390,8 +4054,8 @@ static int recv_func(_adapter *padapter, +@@ -4390,8 +4054,8 @@ static int recv_func(_adapter *padapter, void *pcontext) { RT_TRACE(_module_rtl871x_recv_c_, _drv_alert_, ("@@@@ recv_func: recv_func rtw_recv_indicatepkt\n" )); //indicate this recv_frame @@ -35407,7 +34641,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { #ifdef DBG_RX_DROP_FRAME DBG_871X("DBG_RX_DROP_FRAME %s rtw_recv_indicatepkt fail!\n", __FUNCTION__); -@@ -4407,7 +4071,7 @@ static int recv_func(_adapter *padapter, +@@ -4407,7 +4071,7 @@ static int recv_func(_adapter *padapter, void *pcontext) DBG_871X("DBG_RX_DROP_FRAME %s ecv_func:bDriverStopped(%d) OR bSurpriseRemoved(%d)\n", __FUNCTION__, padapter->bDriverStopped, padapter->bSurpriseRemoved); #endif @@ -35416,7 +34650,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release rtw_free_recvframe(orig_prframe, pfree_recv_queue); //free this recv_frame } -@@ -4415,8 +4079,8 @@ static int recv_func(_adapter *padapter, +@@ -4415,8 +4079,8 @@ static int recv_func(_adapter *padapter, void *pcontext) else if(pattrib->amsdu==1) { @@ -35427,7 +34661,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { #ifdef DBG_RX_DROP_FRAME DBG_871X("DBG_RX_DROP_FRAME %s amsdu_to_msdu fail\n", __FUNCTION__); -@@ -4430,14 +4094,60 @@ static int recv_func(_adapter *padapter, +@@ -4430,14 +4094,60 @@ static int recv_func(_adapter *padapter, void *pcontext) #ifdef DBG_RX_DROP_FRAME DBG_871X("DBG_RX_DROP_FRAME %s what is this condition??\n", __FUNCTION__); #endif @@ -35491,7 +34725,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } -@@ -4445,59 +4155,23 @@ s32 rtw_recv_entry(union recv_frame *pre +@@ -4445,59 +4155,23 @@ s32 rtw_recv_entry(union recv_frame *precvframe) { _adapter *padapter; struct recv_priv *precvpriv; @@ -35562,7 +34796,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #ifdef CONFIG_MP_INCLUDED padapter->mppriv.rx_pktloss = precvpriv->rx_drop; #endif -@@ -4541,53 +4212,74 @@ void rtw_signal_stat_timer_hdl(RTW_TIMER +@@ -4541,53 +4212,74 @@ void rtw_signal_stat_timer_hdl(RTW_TIMER_HDL_ARGS){ if(recvpriv->signal_strength_data.update_req == 0) {// update_req is clear, means we got rx avg_signal_strength = recvpriv->signal_strength_data.avg_val; @@ -35593,7 +34827,14 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - tmp_s = tmp_s/_alpha; - if(tmp_s>100) - tmp_s = 100; -- ++ if (num_signal_strength == 0) { ++ if (rtw_get_on_cur_ch_time(adapter) == 0 ++ || rtw_get_passing_time_ms(rtw_get_on_cur_ch_time(adapter)) < 2 * adapter->mlmeextpriv.mlmext_info.bcn_interval ++ ) { ++ goto set_timer; ++ } ++ } + - tmp_q = (avg_signal_qual+(_alpha-1)*recvpriv->signal_qual); - if(tmp_q %_alpha) - tmp_q = tmp_q/_alpha + 1; @@ -35617,14 +34858,6 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - , num_signal_strength, num_signal_qual - ); - #endif -+ if (num_signal_strength == 0) { -+ if (rtw_get_on_cur_ch_time(adapter) == 0 -+ || rtw_get_passing_time_ms(rtw_get_on_cur_ch_time(adapter)) < 2 * adapter->mlmeextpriv.mlmext_info.bcn_interval -+ ) { -+ goto set_timer; -+ } -+ } -+ + if(check_fwstate(&adapter->mlmepriv, _FW_UNDER_SURVEY) == _TRUE + || check_fwstate(&adapter->mlmepriv, _FW_LINKED) == _FALSE + ) { @@ -35676,6 +34909,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release rtw_set_signal_stat_timer(recvpriv); } +diff --git a/drivers/net/wireless/rtl8192cu/core/rtw_rf.c b/drivers/net/wireless/rtl8192cu/core/rtw_rf.c +index 665c7e5..7ae8635 100644 --- a/drivers/net/wireless/rtl8192cu/core/rtw_rf.c +++ b/drivers/net/wireless/rtl8192cu/core/rtw_rf.c @@ -16,8 +16,7 @@ @@ -35688,6 +34923,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #define _RTW_RF_C_ #include +diff --git a/drivers/net/wireless/rtl8192cu/core/rtw_security.c b/drivers/net/wireless/rtl8192cu/core/rtw_security.c +index 58601b6..8fa8ed5 100644 --- a/drivers/net/wireless/rtl8192cu/core/rtw_security.c +++ b/drivers/net/wireless/rtl8192cu/core/rtw_security.c @@ -16,8 +16,7 @@ @@ -35834,7 +35071,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release static void xor_128(u8 *a, u8 *b, u8 *out); static void xor_32(u8 *a, u8 *b, u8 *out); static u8 sbox(u8 a); -@@ -922,11 +960,13 @@ static void next_key(u8 *key, sint round +@@ -922,11 +960,13 @@ static void next_key(u8 *key, sint round); static void byte_sub(u8 *in, u8 *out); static void shift_row(u8 *in, u8 *out); static void mix_column(u8 *in, u8 *out); @@ -36023,7 +35260,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release for (j = 0; j < 16; j++) padded_buffer[j] = 0x00; for (j = 0; j < 8; j++) -@@ -1508,7 +1578,7 @@ u32 rtw_aes_encrypt(_adapter *padapter, +@@ -1508,7 +1578,7 @@ u32 rtw_aes_encrypt(_adapter *padapter, u8 *pxmitframe) sint curfragnum,length; u32 prwskeylen; u8 *pframe,*prwskey; //, *payload,*iv @@ -36078,7 +35315,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release res=_FAIL; } -@@ -1591,7 +1682,6 @@ static sint aes_decipher(u8 *key, uint h +@@ -1591,7 +1682,6 @@ static sint aes_decipher(u8 *key, uint hdrlen, static u8 message[MAX_MSG_SIZE]; uint qc_exists, a4_exists, i, j, payload_remainder, num_blocks, payload_index; @@ -36204,7 +35441,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + i,pframe[hdrlen+8+plen-8+i],message[hdrlen+8+plen-8+i]); + res = _FAIL; + } - } ++ } + + if(res == _FAIL) + { @@ -36212,12 +35449,12 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + for(gg=0; gg < 32; gg++) + DBG_871X(" [%d]=%02x ", gg, pframe[gg]); + DBG_871X("error packet header \n"); -+ } + } + _func_exit_; return res; } -@@ -1861,7 +1971,6 @@ u32 rtw_aes_decrypt(_adapter *padapter, +@@ -1861,7 +1971,6 @@ u32 rtw_aes_decrypt(_adapter *padapter, u8 *precvframe) sint length; @@ -36405,7 +35642,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release /* compress 512-bits */ static int sha256_compress(struct sha256_state *md, unsigned char *buf) { -@@ -2179,7 +2417,7 @@ static void hmac_sha256_vector(u8 *key, +@@ -2179,7 +2417,7 @@ static void hmac_sha256_vector(u8 *key, size_t key_len, size_t num_elem, _len[1] = 32; sha256_vector(2, _addr, _len, mac); } @@ -36414,7 +35651,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release /** * sha256_prf - SHA256-based Pseudo-Random Function (IEEE 802.11r, 8.5.1.5.2) * @key: Key for PRF -@@ -2193,6 +2431,7 @@ static void hmac_sha256_vector(u8 *key, +@@ -2193,6 +2431,7 @@ static void hmac_sha256_vector(u8 *key, size_t key_len, size_t num_elem, * This function is used to derive new, cryptographically separate keys from a * given key. */ @@ -36422,7 +35659,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release static void sha256_prf(u8 *key, size_t key_len, char *label, u8 *data, size_t data_len, u8 *buf, size_t buf_len) { -@@ -2229,6 +2468,7 @@ static void sha256_prf(u8 *key, size_t k +@@ -2229,6 +2468,7 @@ static void sha256_prf(u8 *key, size_t key_len, char *label, counter++; } } @@ -36438,7 +35675,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release static void rijndaelKeySetupEnc(u32 rk[/*44*/], const u8 cipherKey[]) { int i; -@@ -2617,11 +2858,12 @@ static int omac1_aes_128_vector(u8 *key, +@@ -2617,11 +2858,12 @@ static int omac1_aes_128_vector(u8 *key, size_t num_elem, * This is a mode for using block cipher (AES in this case) for authentication. * OMAC1 was standardized with the name CMAC by NIST in a Special Publication * (SP) 800-38B. @@ -36453,7 +35690,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #ifdef CONFIG_TDLS void wpa_tdls_generate_tpk(_adapter *padapter, struct sta_info *psta) -@@ -2695,7 +2937,7 @@ int wpa_tdls_ftie_mic(u8 *kck, u8 trans_ +@@ -2695,7 +2937,7 @@ int wpa_tdls_ftie_mic(u8 *kck, u8 trans_seq, 2 + timeoutie[1] + 2 + ftie[1]; buf = rtw_zmalloc(len); if (!buf) { @@ -36462,7 +35699,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return -1; } -@@ -2741,7 +2983,6 @@ int tdls_verify_mic(u8 *kck, u8 trans_se +@@ -2741,7 +2983,6 @@ int tdls_verify_mic(u8 *kck, u8 trans_seq, if (lnkid == NULL || rsnie == NULL || timeoutie == NULL || ftie == NULL){ @@ -36470,7 +35707,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return 0; } -@@ -2783,16 +3024,16 @@ int tdls_verify_mic(u8 *kck, u8 trans_se +@@ -2783,16 +3024,16 @@ int tdls_verify_mic(u8 *kck, u8 trans_seq, rx_ftie = ftie+4; if (os_memcmp(mic, rx_ftie, 16) == 0) { @@ -36545,6 +35782,9 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + return status; +} + +diff --git a/drivers/net/wireless/rtl8192cu/core/rtw_sreset.c b/drivers/net/wireless/rtl8192cu/core/rtw_sreset.c +new file mode 100644 +index 0000000..e08b1f7 --- /dev/null +++ b/drivers/net/wireless/rtl8192cu/core/rtw_sreset.c @@ -0,0 +1,352 @@ @@ -36900,6 +36140,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release +#endif +} + +diff --git a/drivers/net/wireless/rtl8192cu/core/rtw_sta_mgt.c b/drivers/net/wireless/rtl8192cu/core/rtw_sta_mgt.c +index 70b25c9..f818a0c 100644 --- a/drivers/net/wireless/rtl8192cu/core/rtw_sta_mgt.c +++ b/drivers/net/wireless/rtl8192cu/core/rtw_sta_mgt.c @@ -15,8 +15,8 @@ @@ -36931,7 +36173,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #endif // CONFIG_AP_MODE _func_exit_; -@@ -94,7 +96,7 @@ u32 _rtw_init_sta_priv(struct sta_priv * +@@ -94,7 +96,7 @@ u32 _rtw_init_sta_priv(struct sta_priv *pstapriv) { struct sta_info *psta; s32 i; @@ -37034,7 +36276,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release rtw_mfree_all_stainfo(pstapriv); //be done before free sta_hash_lock _rtw_spinlock_free(&pstapriv->free_sta_queue.lock); -@@ -235,15 +268,46 @@ void rtw_mfree_sta_priv_lock(struct sta_ +@@ -235,15 +268,46 @@ void rtw_mfree_sta_priv_lock(struct sta_priv *pstapriv) #ifdef CONFIG_AP_MODE _rtw_spinlock_free(&pstapriv->asoc_list_lock); @@ -37156,7 +36398,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return psta; -@@ -388,6 +458,7 @@ u32 rtw_free_stainfo(_adapter *padapter +@@ -388,6 +458,7 @@ u32 rtw_free_stainfo(_adapter *padapter , struct sta_info *psta) struct sta_xmit_priv *pstaxmitpriv; struct xmit_priv *pxmitpriv= &padapter->xmitpriv; struct sta_priv *pstapriv = &padapter->stapriv; @@ -37357,6 +36599,9 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + } +diff --git a/drivers/net/wireless/rtl8192cu/core/rtw_tdls.c b/drivers/net/wireless/rtl8192cu/core/rtw_tdls.c +new file mode 100644 +index 0000000..e8c4d4c --- /dev/null +++ b/drivers/net/wireless/rtl8192cu/core/rtw_tdls.c @@ -0,0 +1,2941 @@ @@ -40301,6 +39546,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + +#endif //CONFIG_TDLS + +diff --git a/drivers/net/wireless/rtl8192cu/core/rtw_wlan_util.c b/drivers/net/wireless/rtl8192cu/core/rtw_wlan_util.c +index 539b74f..56dac60d 100644 --- a/drivers/net/wireless/rtl8192cu/core/rtw_wlan_util.c +++ b/drivers/net/wireless/rtl8192cu/core/rtw_wlan_util.c @@ -16,8 +16,7 @@ @@ -40313,7 +39560,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #define _RTW_WLAN_UTIL_C_ #include -@@ -42,8 +41,11 @@ unsigned char AIRGOCAP_OUI[] = {0x00, 0x +@@ -42,8 +41,11 @@ unsigned char AIRGOCAP_OUI[] = {0x00, 0x0a, 0xf5}; unsigned char REALTEK_96B_IE[] = {0x00, 0xe0, 0x4c, 0x02, 0x01, 0x20}; extern unsigned char MCS_rate_2R[16]; @@ -40350,7 +39597,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release int cckrates_included(unsigned char *rate, int ratelen) { -@@ -160,6 +179,7 @@ int judge_network_type(_adapter *padapte +@@ -160,6 +179,7 @@ int judge_network_type(_adapter *padapter, unsigned char *rate, int ratelen) return network_type; } @@ -40358,7 +39605,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release unsigned char ratetbl_val_2wifirate(unsigned char rate) { unsigned char val = 0; -@@ -220,6 +240,7 @@ unsigned char ratetbl_val_2wifirate(unsi +@@ -220,6 +240,7 @@ unsigned char ratetbl_val_2wifirate(unsigned char rate) } @@ -40366,7 +39613,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release int is_basicrate(_adapter *padapter, unsigned char rate) { int i; -@@ -242,7 +263,7 @@ int is_basicrate(_adapter *padapter, uns +@@ -242,7 +263,7 @@ int is_basicrate(_adapter *padapter, unsigned char rate) return _FALSE; } @@ -40375,7 +39622,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release unsigned int ratetbl2rateset(_adapter *padapter, unsigned char *rateset) { int i; -@@ -288,29 +309,101 @@ void get_rate_set(_adapter *padapter, un +@@ -288,29 +309,101 @@ void get_rate_set(_adapter *padapter, unsigned char *pbssrate, int *bssrate_len) _rtw_memcpy(pbssrate, supportedrates, *bssrate_len); } @@ -40482,26 +39729,24 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } #if 0 -@@ -330,54 +423,176 @@ void Switch_DM_Func(_adapter *padapter, +@@ -330,54 +423,176 @@ void Switch_DM_Func(_adapter *padapter, u8 mode, u8 enable) } -void Set_NETYPE1_MSR(_adapter *padapter, u8 type) +static void Set_NETYPE1_MSR(_adapter *padapter, u8 type) - { -- padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_MEDIA_STATUS1, (u8 *)(&type)); ++{ + rtw_hal_set_hwreg(padapter, HW_VAR_MEDIA_STATUS1, (u8 *)(&type)); - } - --void Set_NETYPE0_MSR(_adapter *padapter, u8 type) ++} ++ +static void Set_NETYPE0_MSR(_adapter *padapter, u8 type) - { -- padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_MEDIA_STATUS, (u8 *)(&type)); ++{ + rtw_hal_set_hwreg(padapter, HW_VAR_MEDIA_STATUS, (u8 *)(&type)); +} + +void Set_MSR(_adapter *padapter, u8 type) -+{ + { +- padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_MEDIA_STATUS1, (u8 *)(&type)); +#ifdef CONFIG_CONCURRENT_MODE + if(padapter->iface_type == IFACE_PORT1) + { @@ -40512,10 +39757,12 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + { + Set_NETYPE0_MSR(padapter, type); + } -+} -+ + } + +-void Set_NETYPE0_MSR(_adapter *padapter, u8 type) +inline u8 rtw_get_oper_ch(_adapter *adapter) -+{ + { +- padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_MEDIA_STATUS, (u8 *)(&type)); + return adapter_to_dvobj(adapter)->oper_channel; +} + @@ -40673,7 +39920,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release SetBWMode(padapter, bwmode, channel_offset); } -@@ -414,8 +629,14 @@ u16 get_beacon_interval(WLAN_BSSID_EX *b +@@ -414,8 +629,14 @@ u16 get_beacon_interval(WLAN_BSSID_EX *bss) int is_client_associated_to_ap(_adapter *padapter) { @@ -40702,7 +39949,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { - padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_CAM_INVALID_ALL, 0); + rtw_hal_set_hwreg(padapter, HW_VAR_CAM_INVALID_ALL, 0); -+} + } +#if 0 +static u32 _ReadCAM(_adapter *padapter ,u32 addr) +{ @@ -40730,7 +39977,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + printk("offset:0x%02x => 0x%08x \n",addr+j,cmd); + } + printk("*********************************\n"); - } ++} +#endif void write_cam(_adapter *padapter, u8 entry, u16 ctrl, u8 *mac, u8 *key) @@ -40741,7 +39988,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release int j; u32 cam_val[2]; -@@ -519,14 +770,14 @@ void write_cam(_adapter *padapter, u8 en +@@ -519,14 +770,14 @@ void write_cam(_adapter *padapter, u8 entry, u16 ctrl, u8 *mac, u8 *key) cam_val[0] = val; cam_val[1] = addr + (unsigned int)j; @@ -40758,7 +40005,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } -@@ -544,14 +795,14 @@ void clear_cam_entry(_adapter *padapter, +@@ -544,14 +795,14 @@ void clear_cam_entry(_adapter *padapter, u8 entry) cam_val[0] = val; cam_val[1] = addr + (unsigned int)0; @@ -40775,7 +40022,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #else unsigned char null_sta[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; -@@ -586,21 +837,54 @@ void flush_all_cam_entry(_adapter *padap +@@ -586,21 +837,54 @@ void flush_all_cam_entry(_adapter *padapter) { struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); @@ -40839,7 +40086,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release int WFD_info_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE) { struct registry_priv *pregpriv = &padapter->registrypriv; -@@ -622,8 +906,8 @@ int WFD_info_handler(_adapter *padapter, +@@ -622,8 +906,8 @@ int WFD_info_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE) rtw_get_wfd_attr_content( wfd_ie, wfd_ielen, WFD_ATTR_DEVICE_INFO, attr_content, &attr_contentlen); if ( attr_contentlen ) { @@ -40850,7 +40097,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return( _TRUE ); } } -@@ -638,7 +922,7 @@ int WFD_info_handler(_adapter *padapter, +@@ -638,7 +922,7 @@ int WFD_info_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE) int WMM_param_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE) { @@ -40903,7 +40150,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release else padapter->mlmepriv.acm_mask = acm_mask; -@@ -751,18 +1034,35 @@ static void bwmode_update_check(_adapter +@@ -751,18 +1034,35 @@ static void bwmode_update_check(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pI unsigned char new_bwmode; unsigned char new_ch_offset; struct HT_info_element *pHT_info; @@ -40941,7 +40188,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release switch (pHT_info->infos[0] & 0x3) { case 1: -@@ -791,6 +1091,9 @@ static void bwmode_update_check(_adapter +@@ -791,6 +1091,9 @@ static void bwmode_update_check(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pI pmlmeext->cur_bwmode = new_bwmode; pmlmeext->cur_ch_offset = new_ch_offset; @@ -40951,7 +40198,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } else { -@@ -842,7 +1145,8 @@ void HT_caps_handler(_adapter *padapter, +@@ -842,7 +1145,8 @@ void HT_caps_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE) struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct ht_priv *phtpriv = &pmlmepriv->htpriv; @@ -40961,7 +40208,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if(pIE==NULL) return; if(phtpriv->ht_option == _FALSE) return; -@@ -855,57 +1159,68 @@ void HT_caps_handler(_adapter *padapter, +@@ -855,57 +1159,68 @@ void HT_caps_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE) { // Commented by Albert 2010/07/12 // Got the endian issue here. @@ -41091,7 +40338,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } // -@@ -1081,6 +1395,24 @@ void VCS_update(_adapter *padapter, stru +@@ -1081,6 +1395,24 @@ void VCS_update(_adapter *padapter, struct sta_info *psta) } } @@ -41116,7 +40363,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release void update_beacon_info(_adapter *padapter, u8 *pframe, uint pkt_len, struct sta_info *psta) { unsigned int i; -@@ -1090,8 +1422,8 @@ void update_beacon_info(_adapter *padapt +@@ -1090,8 +1422,8 @@ void update_beacon_info(_adapter *padapter, u8 *pframe, uint pkt_len, struct sta #ifdef CONFIG_TDLS struct tdls_info *ptdlsinfo = &padapter->tdlsinfo; u8 tdls_prohibited[] = { 0x00, 0x00, 0x00, 0x00, 0x10 }; //bit(38): TDLS_prohibited @@ -41127,7 +40374,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release len = pkt_len - (_BEACON_IE_OFFSET_ + WLAN_HDR_A3_LEN); for (i = 0; i < len;) -@@ -1122,10 +1454,10 @@ void update_beacon_info(_adapter *padapt +@@ -1122,10 +1454,10 @@ void update_beacon_info(_adapter *padapter, u8 *pframe, uint pkt_len, struct sta #ifdef CONFIG_TDLS case _EXT_CAP_IE_: @@ -41140,7 +40387,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release default: break; } -@@ -1181,7 +1513,7 @@ unsigned int is_ap_in_tkip(_adapter *pad +@@ -1181,7 +1513,7 @@ unsigned int is_ap_in_tkip(_adapter *padapter) switch (pIE->ElementID) { case _VENDOR_SPECIFIC_IE_: @@ -41149,7 +40396,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { return _TRUE; } -@@ -1209,6 +1541,7 @@ unsigned int is_ap_in_tkip(_adapter *pad +@@ -1209,6 +1541,7 @@ unsigned int is_ap_in_tkip(_adapter *padapter) } @@ -41157,7 +40404,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release int wifirate2_ratetbl_inx(unsigned char rate) { int inx = 0; -@@ -1303,7 +1636,7 @@ unsigned int update_MSC_rate(struct HT_c +@@ -1303,7 +1636,7 @@ unsigned int update_MSC_rate(struct HT_caps_element *pHT_caps) { unsigned int mask = 0; @@ -41166,7 +40413,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return mask; } -@@ -1322,7 +1655,7 @@ int support_short_GI(_adapter *padapter, +@@ -1322,7 +1655,7 @@ int support_short_GI(_adapter *padapter, struct HT_caps_element *pHT_caps) bit_offset = (pmlmeext->cur_bwmode & HT_CHANNEL_WIDTH_40)? 6: 5; @@ -41175,7 +40422,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { return _SUCCESS; } -@@ -1349,11 +1682,12 @@ unsigned char get_highest_rate_idx(u32 m +@@ -1349,11 +1682,12 @@ unsigned char get_highest_rate_idx(u32 mask) return rate_idx; } @@ -41189,7 +40436,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release for (i = 15; i >= 0; i--) { -@@ -1368,9 +1702,10 @@ unsigned char get_highest_mcs_rate(struc +@@ -1368,9 +1702,10 @@ unsigned char get_highest_mcs_rate(struct HT_caps_element *pHT_caps) void Update_RA_Entry(_adapter *padapter, u32 mac_id) { @@ -41201,7 +40448,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release void enable_rate_adaptive(_adapter *padapter, u32 mac_id) { Update_RA_Entry(padapter, mac_id); -@@ -1382,6 +1717,47 @@ void set_sta_rate(_adapter *padapter, st +@@ -1382,6 +1717,47 @@ void set_sta_rate(_adapter *padapter, struct sta_info *psta) enable_rate_adaptive(padapter, psta->mac_id); } @@ -41249,7 +40496,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release unsigned char check_assoc_AP(u8 *pframe, uint len) { unsigned int i; -@@ -1496,7 +1872,7 @@ void update_capinfo(PADAPTER Adapter, u1 +@@ -1496,7 +1872,7 @@ void update_capinfo(PADAPTER Adapter, u16 updateCap) { ShortPreamble = _TRUE; pmlmeinfo->preamble_mode = PREAMBLE_SHORT; @@ -41258,7 +40505,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } } else -@@ -1505,7 +1881,7 @@ void update_capinfo(PADAPTER Adapter, u1 +@@ -1505,7 +1881,7 @@ void update_capinfo(PADAPTER Adapter, u16 updateCap) { ShortPreamble = _FALSE; pmlmeinfo->preamble_mode = PREAMBLE_LONG; @@ -41267,7 +40514,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } } } -@@ -1545,18 +1921,22 @@ void update_capinfo(PADAPTER Adapter, u1 +@@ -1545,18 +1921,22 @@ void update_capinfo(PADAPTER Adapter, u16 updateCap) } } @@ -41293,7 +40540,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release ratelen = rtw_get_rateset_len(cur_network->SupportedRates); -@@ -1596,16 +1976,39 @@ void update_wireless_mode(_adapter *pada +@@ -1596,16 +1976,39 @@ void update_wireless_mode(_adapter *padapter) } pmlmeext->cur_wireless_mode = network_type & padapter->registrypriv.wireless_mode; @@ -41337,7 +40584,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release void fire_write_MAC_cmd(_adapter *padapter, unsigned int addr, unsigned int value) { #if 0 -@@ -1633,13 +2036,6 @@ void fire_write_MAC_cmd(_adapter *padapt +@@ -1633,13 +2036,6 @@ void fire_write_MAC_cmd(_adapter *padapter, unsigned int addr, unsigned int valu #endif } @@ -41351,7 +40598,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release void update_bmc_sta_support_rate(_adapter *padapter, u32 mac_id) { struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); -@@ -1648,11 +2044,11 @@ void update_bmc_sta_support_rate(_adapte +@@ -1648,11 +2044,11 @@ void update_bmc_sta_support_rate(_adapter *padapter, u32 mac_id) if(pmlmeext->cur_wireless_mode & WIRELESS_11B) { // Only B, B/G, and B/G/N AP could use CCK rate @@ -41365,7 +40612,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } } -@@ -1736,12 +2132,12 @@ void update_TSF(struct mlme_ext_priv *pm +@@ -1736,12 +2132,12 @@ void update_TSF(struct mlme_ext_priv *pmlmeext, u8 *pframe, uint len) void correct_TSF(_adapter *padapter, struct mlme_ext_priv *pmlmeext) { @@ -41380,7 +40627,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } #if 0 -@@ -1818,7 +2214,7 @@ unsigned int setup_beacon_frame(_adapter +@@ -1818,7 +2214,7 @@ unsigned int setup_beacon_frame(_adapter *padapter, unsigned char *beacon_frame) if ((len + TXDESC_SIZE) > 256) { @@ -41389,7 +40636,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return 0; } -@@ -1846,3 +2242,64 @@ unsigned int setup_beacon_frame(_adapter +@@ -1846,3 +2242,64 @@ unsigned int setup_beacon_frame(_adapter *padapter, unsigned char *beacon_frame) } #endif @@ -41454,6 +40701,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + return status; +} + +diff --git a/drivers/net/wireless/rtl8192cu/core/rtw_xmit.c b/drivers/net/wireless/rtl8192cu/core/rtw_xmit.c +index 178a5b7..18f1fdb 100644 --- a/drivers/net/wireless/rtl8192cu/core/rtw_xmit.c +++ b/drivers/net/wireless/rtl8192cu/core/rtw_xmit.c @@ -15,8 +15,8 @@ @@ -41604,7 +40853,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release void rtw_mfree_xmit_priv_lock (struct xmit_priv *pxmitpriv) { _rtw_spinlock_free(&pxmitpriv->lock); -@@ -327,7 +370,7 @@ void _rtw_free_xmit_priv (struct xmit_pr +@@ -327,7 +370,7 @@ void _rtw_free_xmit_priv (struct xmit_priv *pxmitpriv) _func_enter_; @@ -41613,7 +40862,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release rtw_mfree_xmit_priv_lock(pxmitpriv); -@@ -336,7 +379,7 @@ void _rtw_free_xmit_priv (struct xmit_pr +@@ -336,7 +379,7 @@ void _rtw_free_xmit_priv (struct xmit_priv *pxmitpriv) for(i=0; ipallocated_xmitbuf, NR_XMITBUFF * sizeof(struct xmit_buf) + 4); } @@ -41640,7 +40889,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release // free xmit extension buff _rtw_spinlock_free(&pxmitpriv->free_xmit_extbuf_queue.lock); -@@ -380,6 +434,10 @@ void _rtw_free_xmit_priv (struct xmit_pr +@@ -380,6 +434,10 @@ void _rtw_free_xmit_priv (struct xmit_priv *pxmitpriv) rtw_free_hwxmits(padapter); @@ -41651,7 +40900,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release out: _func_exit_; -@@ -394,6 +452,27 @@ static void update_attrib_vcs_info(_adap +@@ -394,6 +452,27 @@ static void update_attrib_vcs_info(_adapter *padapter, struct xmit_frame *pxmitf struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); @@ -41679,7 +40928,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if (pattrib->nr_frags != 1) { -@@ -496,8 +575,6 @@ static void update_attrib_vcs_info(_adap +@@ -496,8 +575,6 @@ static void update_attrib_vcs_info(_adapter *padapter, struct xmit_frame *pxmitf break; } } @@ -41688,7 +40937,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } static void update_attrib_phy_info(struct pkt_attrib *pattrib, struct sta_info *psta) -@@ -527,20 +604,22 @@ static void update_attrib_phy_info(struc +@@ -527,20 +604,22 @@ static void update_attrib_phy_info(struct pkt_attrib *pattrib, struct sta_info * // if(psta->htpriv.agg_enable_bitmap & BIT(pattrib->priority)) // pattrib->ampdu_en = _TRUE; //} @@ -41716,7 +40965,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release break; case 1: case 2: -@@ -548,17 +627,19 @@ static void qos_acm(u8 acm_mask, struct +@@ -548,17 +627,19 @@ static void qos_acm(u8 acm_mask, struct pkt_attrib *pattrib) case 4: case 5: if(acm_mask & BIT(2)) @@ -41739,7 +40988,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } static void set_qos(struct pkt_file *ppktfile, struct pkt_attrib *pattrib) -@@ -628,7 +709,7 @@ static s32 update_attrib(_adapter *padap +@@ -628,7 +709,7 @@ static s32 update_attrib(_adapter *padapter, _pkt *pkt, struct pkt_attrib *pattr _rtw_memcpy(pattrib->ta, get_bssid(pmlmepriv), ETH_ALEN); } @@ -41748,7 +40997,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if (ETH_P_IP == pattrib->ether_type) { -@@ -659,12 +740,10 @@ static s32 update_attrib(_adapter *padap +@@ -659,12 +740,10 @@ static s32 update_attrib(_adapter *padapter, _pkt *pkt, struct pkt_attrib *pattr } } @@ -41762,7 +41011,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #ifdef CONFIG_LPS // If EAPOL , ARP , OR DHCP packet, driver must be in active mode. -@@ -730,9 +809,10 @@ static s32 update_attrib(_adapter *padap +@@ -730,9 +809,10 @@ static s32 update_attrib(_adapter *padapter, _pkt *pkt, struct pkt_attrib *pattr if(pqospriv->qos_option) { set_qos(&pktfile, pattrib); @@ -41774,7 +41023,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } } } -@@ -831,6 +911,13 @@ static s32 update_attrib(_adapter *padap +@@ -831,6 +911,13 @@ static s32 update_attrib(_adapter *padapter, _pkt *pkt, struct pkt_attrib *pattr RT_TRACE(_module_rtl871x_xmit_c_,_drv_info_,("update_attrib: bswenc=_FALSE\n")); } @@ -41788,7 +41037,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release rtw_set_tx_chksum_offload(pkt, pattrib); update_attrib_phy_info(pattrib, psta); -@@ -860,10 +947,21 @@ static s32 xmitframe_addmic(_adapter *pa +@@ -860,10 +947,21 @@ static s32 xmitframe_addmic(_adapter *padapter, struct xmit_frame *pxmitframe){ } else { @@ -41819,7 +41068,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release RT_TRACE(_module_rtl871x_xmit_c_,_drv_alert_,("### xmitframe_swencrypt\n")); switch(pattrib->encrypt){ case _WEP40_: -@@ -1015,17 +1113,13 @@ s32 rtw_make_wlanhdr (_adapter *padapter +@@ -1015,17 +1113,13 @@ s32 rtw_make_wlanhdr (_adapter *padapter , u8 *hdr, struct pkt_attrib *pattrib) struct rtw_ieee80211_hdr *pwlanhdr = (struct rtw_ieee80211_hdr *)hdr; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct qos_priv *pqospriv = &pmlmepriv->qospriv; @@ -41986,7 +41235,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } } -@@ -1235,7 +1346,27 @@ s32 rtw_txframes_sta_ac_pending(_adapter +@@ -1235,7 +1346,27 @@ s32 rtw_txframes_sta_ac_pending(_adapter *padapter, struct pkt_attrib *pattrib) struct tx_servq *ptxservq; int priority = pattrib->priority; @@ -42014,7 +41263,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release switch(priority) { -@@ -1263,871 +1394,121 @@ s32 rtw_txframes_sta_ac_pending(_adapter +@@ -1263,871 +1394,121 @@ s32 rtw_txframes_sta_ac_pending(_adapter *padapter, struct pkt_attrib *pattrib) } #ifdef CONFIG_TDLS @@ -42158,10 +41407,10 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - - //extended capabilities - pframe = rtw_set_ie(pframe, _EXT_CAP_IE_ , 5, TDLS_EXT_CAPIE, &(pattrib->pktlen)); - +- - //QoS capability(WMM_IE) - pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, 7, TDLS_WMMIE, &(pattrib->pktlen)); -- + - //FTIE(optional) - if(pattrib->encrypt){ - _rtw_memset(pframe, 0, 84); //All fields except SNonce shall be set to 0 @@ -42265,7 +41514,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - - pframe = rtw_set_ie(pframe, _HT_CAPABILITY_IE_, - sizeof(struct rtw_ieee80211_ht_cap), (unsigned char*)&ht_capie, &(pattrib->pktlen)); -- + - //20/40 BSS coexistence - if(pmlmepriv->num_FortyMHzIntolerant>0) - iedata |= BIT(2);//20 MHz BSS Width Request @@ -42278,7 +41527,9 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - pframe = rtw_set_ie(pframe, _LINK_ID_IE_, 18, link_id_addr, &(pattrib->pktlen)); - -} -- ++ if (pattrib->encrypt) ++ SetPrivacy(fctrl); + -void rtw_tdls_setup_rsp_fr(_adapter * padapter, struct xmit_frame * pxmitframe, u8 *pframe) -{ - struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); @@ -42306,11 +41557,9 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - u8 k; //for random ANonce - u8 *pftie, *ptimeout_ie, *plinkid_ie, *prsnie, *pftie_mic; - u32 time; - +- - ptdls_sta = rtw_get_stainfo( &(padapter->stapriv) , pattrib->dst); -+ if (pattrib->encrypt) -+ SetPrivacy(fctrl); - +- - if(ptdls_sta == NULL ) + if (pqospriv->qos_option) { @@ -43024,7 +42273,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release /* -@@ -2311,17 +1709,33 @@ s32 rtw_xmitframe_coalesce(_adapter *pad +@@ -2311,17 +1709,33 @@ s32 rtw_xmitframe_coalesce(_adapter *padapter, _pkt *pkt, struct xmit_frame *pxm _func_enter_; @@ -43051,12 +42300,12 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + if(!(psta->state &_FW_LINKED)) + { + DBG_871X("%s, psta->state(0x%x) != _FW_LINKED\n", __func__, psta->state); -+ return _FAIL; + return _FAIL; + } + + if (pxmitframe->buf_addr == NULL){ + DBG_8192C("==> %s buf_addr==NULL \n",__FUNCTION__); - return _FAIL; ++ return _FAIL; + } pbuf_start = pxmitframe->buf_addr; @@ -43371,7 +42620,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } _exit_critical(&pfree_queue->lock, &irqL); -@@ -2690,7 +2328,7 @@ struct xmit_buf *rtw_alloc_xmitbuf(struc +@@ -2690,7 +2328,7 @@ struct xmit_buf *rtw_alloc_xmitbuf(struct xmit_priv *pxmitpriv) _func_enter_; @@ -43406,7 +42655,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } #ifdef DBG_XMIT_BUF else -@@ -2747,13 +2389,18 @@ s32 rtw_free_xmitbuf(struct xmit_priv *p +@@ -2747,13 +2389,18 @@ s32 rtw_free_xmitbuf(struct xmit_priv *pxmitpriv, struct xmit_buf *pxmitbuf) _func_enter_; @@ -43476,7 +42725,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release /* Calling context: 1. OS_TXENTRY -@@ -2790,7 +2471,6 @@ Otherwise, we must use _enter/_exit crit +@@ -2790,7 +2471,6 @@ Otherwise, we must use _enter/_exit critical to protect free_xmit_queue... Must be very very cautious... */ @@ -43484,7 +42733,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release struct xmit_frame *rtw_alloc_xmitframe(struct xmit_priv *pxmitpriv)//(_queue *pfree_xmit_queue) { /* -@@ -2803,7 +2483,9 @@ struct xmit_frame *rtw_alloc_xmitframe(s +@@ -2803,7 +2483,9 @@ struct xmit_frame *rtw_alloc_xmitframe(struct xmit_priv *pxmitpriv)//(_queue *pf struct xmit_frame *pxframe = NULL; _list *plist, *phead; _queue *pfree_xmit_queue = &pxmitpriv->free_xmit_queue; @@ -43521,9 +42770,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - pxframe->buf_addr = NULL; - pxframe->pxmitbuf = NULL; + rtw_init_xmitframe(pxframe); - -- _rtw_memset(&pxframe->attrib, 0, sizeof(struct pkt_attrib)); -- //pxframe->attrib.psta = NULL; ++ +_func_exit_; + + return pxframe; @@ -43557,24 +42804,25 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + + rtw_init_xmitframe(pxframe); -- pxframe->frame_tag = DATA_FRAMETAG; +- _rtw_memset(&pxframe->attrib, 0, sizeof(struct pkt_attrib)); +- //pxframe->attrib.psta = NULL; +_func_exit_; --#ifdef CONFIG_USB_HCI -- pxframe->pkt = NULL; -- pxframe->pkt_offset = 1;//default use pkt_offset to fill tx desc +- pxframe->frame_tag = DATA_FRAMETAG; + return pxframe; +} --#ifdef CONFIG_USB_TX_AGGREGATION -- pxframe->agg_num = 1; --#endif +-#ifdef CONFIG_USB_HCI +- pxframe->pkt = NULL; +- pxframe->pkt_offset = 1;//default use pkt_offset to fill tx desc +struct xmit_frame *rtw_alloc_xmitframe_once(struct xmit_priv *pxmitpriv) +{ + struct xmit_frame *pxframe = NULL; + u8 *alloc_addr; --#endif //#ifdef CONFIG_USB_HCI +-#ifdef CONFIG_USB_TX_AGGREGATION +- pxframe->agg_num = 1; +-#endif + alloc_addr = rtw_zmalloc(sizeof(struct xmit_frame) + 4); + + if (alloc_addr == NULL) @@ -43583,6 +42831,10 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + pxframe = (struct xmit_frame *)N_BYTE_ALIGMENT((SIZE_PTR)(alloc_addr), 4); + pxframe->alloc_addr = alloc_addr; +-#endif //#ifdef CONFIG_USB_HCI ++ pxframe->padapter = pxmitpriv->adapter; ++ pxframe->frame_tag = NULL_FRAMETAG; + -#ifdef PLATFORM_LINUX - if(pxmitpriv->free_xmitframe_cnt==1) - { @@ -43590,21 +42842,18 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - netif_stop_queue(padapter->pnetdev); - } -#endif -+ pxframe->padapter = pxmitpriv->adapter; -+ pxframe->frame_tag = NULL_FRAMETAG; - -- } + pxframe->pkt = NULL; -- _exit_critical_bh(&pfree_xmit_queue->lock, &irqL); +- } + pxframe->buf_addr = NULL; + pxframe->pxmitbuf = NULL; --_func_exit_; +- _exit_critical_bh(&pfree_xmit_queue->lock, &irqL); + rtw_init_xmitframe(pxframe); +-_func_exit_; + DBG_871X("################## %s ##################\n", __func__); -+ + +exit: return pxframe; } @@ -43659,9 +42908,9 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + RT_TRACE(_module_rtl871x_xmit_c_, _drv_debug_, ("rtw_free_xmitframe():free_xframe_ext_cnt=%d\n", pxmitpriv->free_xframe_ext_cnt)); + } else { + } -+ -+ _exit_critical_bh(&queue->lock, &irqL); ++ _exit_critical_bh(&queue->lock, &irqL); ++ +check_pkt_complete: if(pndis_pkt) @@ -43693,7 +42942,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release void rtw_free_xmitframe_queue(struct xmit_priv *pxmitpriv, _queue *pframequeue) { _irqL irqL; -@@ -2995,11 +2717,7 @@ static struct xmit_frame *dequeue_one_xm +@@ -2995,11 +2717,7 @@ static struct xmit_frame *dequeue_one_xmitframe(struct xmit_priv *pxmitpriv, str ptxservq->qcnt--; @@ -43748,7 +42997,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #ifdef CONFIG_BR_EXT int rtw_br_client_tx(_adapter *padapter, struct sk_buff **pskb) { -@@ -3411,7 +3135,7 @@ int rtw_br_client_tx(_adapter *padapter, +@@ -3411,7 +3135,7 @@ int rtw_br_client_tx(_adapter *padapter, struct sk_buff **pskb) *((unsigned short *)(skb->data+MACADDRLEN*2+2-i*2)) = *((unsigned short *)(skb->data+MACADDRLEN*2-2-i*2)); skb_pull(skb, 4); } @@ -43757,7 +43006,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if (!memcmp(skb->data+MACADDRLEN, padapter->br_mac, MACADDRLEN) && (*((unsigned short *)(skb->data+MACADDRLEN*2)) == __constant_htons(ETH_P_IP))) memcpy(padapter->br_ip, skb->data+WLAN_ETHHDR_LEN+12, 4); -@@ -3455,14 +3179,14 @@ int rtw_br_client_tx(_adapter *padapter, +@@ -3455,14 +3179,14 @@ int rtw_br_client_tx(_adapter *padapter, struct sk_buff **pskb) *((unsigned short *)(skb->data+MACADDRLEN*2+2)) = vlan_hdr; } @@ -43775,7 +43024,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release *pskb = skb = newskb; if (is_vlan_tag) { -@@ -3498,7 +3222,7 @@ int rtw_br_client_tx(_adapter *padapter, +@@ -3498,7 +3222,7 @@ int rtw_br_client_tx(_adapter *padapter, struct sk_buff **pskb) } // we just print warning message and let it go @@ -43784,7 +43033,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release //return -1; // return -1 will cause system crash on 2011/08/30! return 0; } -@@ -3556,8 +3280,8 @@ static void do_queue_select(_adapter *pa +@@ -3556,8 +3280,8 @@ static void do_queue_select(_adapter *padapter, struct pkt_attrib *pattrib) RT_TRACE(_module_rtl871x_xmit_c_,_drv_info_,("### do_queue_select priority=%d ,qsel = %d\n",pattrib->priority ,qsel)); #ifdef CONFIG_CONCURRENT_MODE @@ -43795,7 +43044,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #endif pattrib->qsel = qsel; -@@ -3573,6 +3297,8 @@ static void do_queue_select(_adapter *pa +@@ -3573,6 +3297,8 @@ static void do_queue_select(_adapter *padapter, struct pkt_attrib *pattrib) */ s32 rtw_xmit(_adapter *padapter, _pkt **ppkt) { @@ -43804,7 +43053,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #ifdef CONFIG_AP_MODE _irqL irqL0; #endif -@@ -3585,13 +3311,21 @@ s32 rtw_xmit(_adapter *padapter, _pkt ** +@@ -3585,13 +3311,21 @@ s32 rtw_xmit(_adapter *padapter, _pkt **ppkt) s32 res; @@ -43829,7 +43078,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return -1; } -@@ -3605,11 +3339,14 @@ s32 rtw_xmit(_adapter *padapter, _pkt ** +@@ -3605,11 +3339,14 @@ s32 rtw_xmit(_adapter *padapter, _pkt **ppkt) rcu_read_unlock(); #endif // (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35)) @@ -43845,7 +43094,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } #endif // CONFIG_BR_EXT -@@ -3629,7 +3366,7 @@ s32 rtw_xmit(_adapter *padapter, _pkt ** +@@ -3629,7 +3366,7 @@ s32 rtw_xmit(_adapter *padapter, _pkt **ppkt) do_queue_select(padapter, &pxmitframe->attrib); @@ -43854,7 +43103,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release _enter_critical_bh(&pxmitpriv->lock, &irqL0); if(xmitframe_enqueue_for_sleeping_sta(padapter, pxmitframe) == _TRUE) { -@@ -3637,57 +3374,15 @@ s32 rtw_xmit(_adapter *padapter, _pkt ** +@@ -3637,57 +3374,15 @@ s32 rtw_xmit(_adapter *padapter, _pkt **ppkt) return 1; } _exit_critical_bh(&pxmitpriv->lock, &irqL0); @@ -43914,7 +43163,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release sint xmitframe_enqueue_for_tdls_sleeping_sta(_adapter *padapter, struct xmit_frame *pxmitframe) { sint ret=_FALSE; -@@ -3697,7 +3392,6 @@ sint xmitframe_enqueue_for_tdls_sleeping +@@ -3697,7 +3392,6 @@ sint xmitframe_enqueue_for_tdls_sleeping_sta(_adapter *padapter, struct xmit_fra struct sta_priv *pstapriv = &padapter->stapriv; struct pkt_attrib *pattrib = &pxmitframe->attrib; struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); @@ -43922,7 +43171,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release int i; ptdls_sta=rtw_get_stainfo(pstapriv, pattrib->dst); -@@ -3709,7 +3403,7 @@ sint xmitframe_enqueue_for_tdls_sleeping +@@ -3709,7 +3403,7 @@ sint xmitframe_enqueue_for_tdls_sleeping_sta(_adapter *padapter, struct xmit_fra { ret = _TRUE; return ret; @@ -43931,7 +43180,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release _enter_critical_bh(&ptdls_sta->sleep_q.lock, &irqL); -@@ -3749,7 +3443,6 @@ sint xmitframe_enqueue_for_tdls_sleeping +@@ -3749,7 +3443,6 @@ sint xmitframe_enqueue_for_tdls_sleeping_sta(_adapter *padapter, struct xmit_fra if(ptdls_sta->sleepq_len==1) { //transmit TDLS PTI via AP @@ -43939,7 +43188,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release rtw_tdls_cmd(padapter, ptdls_sta->hwaddr, TDLS_SD_PTI); } ret = _TRUE; -@@ -3762,9 +3455,9 @@ sint xmitframe_enqueue_for_tdls_sleeping +@@ -3762,9 +3455,9 @@ sint xmitframe_enqueue_for_tdls_sleeping_sta(_adapter *padapter, struct xmit_fra return ret; } @@ -43951,7 +43200,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release sint xmitframe_enqueue_for_sleeping_sta(_adapter *padapter, struct xmit_frame *pxmitframe) { -@@ -3778,7 +3471,7 @@ sint xmitframe_enqueue_for_sleeping_sta( +@@ -3778,7 +3471,7 @@ sint xmitframe_enqueue_for_sleeping_sta(_adapter *padapter, struct xmit_frame *p #ifdef CONFIG_TDLS struct tdls_info *ptdlsinfo = &padapter->tdlsinfo; @@ -43960,7 +43209,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { ret = xmitframe_enqueue_for_tdls_sleeping_sta(padapter, pxmitframe); return ret; -@@ -3794,11 +3487,21 @@ sint xmitframe_enqueue_for_sleeping_sta( +@@ -3794,11 +3487,21 @@ sint xmitframe_enqueue_for_sleeping_sta(_adapter *padapter, struct xmit_frame *p } else { @@ -43983,7 +43232,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if(pattrib->triggered==1) { -@@ -3925,6 +3628,7 @@ sint xmitframe_enqueue_for_sleeping_sta( +@@ -3925,6 +3628,7 @@ sint xmitframe_enqueue_for_sleeping_sta(_adapter *padapter, struct xmit_frame *p static void dequeue_xmitframes_to_sleeping_queue(_adapter *padapter, struct sta_info *psta, _queue *pframequeue) { @@ -43991,7 +43240,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release _list *plist, *phead; u8 ac_index; struct tx_servq *ptxservq; -@@ -3941,8 +3645,10 @@ static void dequeue_xmitframes_to_sleepi +@@ -3941,8 +3645,10 @@ static void dequeue_xmitframes_to_sleeping_queue(_adapter *padapter, struct sta_ plist = get_next(plist); @@ -44003,7 +43252,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release pattrib = &pxmitframe->attrib; ptxservq = rtw_get_sta_pending(padapter, psta, pattrib->priority, (u8 *)(&ac_index)); -@@ -3950,6 +3656,12 @@ static void dequeue_xmitframes_to_sleepi +@@ -3950,6 +3656,12 @@ static void dequeue_xmitframes_to_sleeping_queue(_adapter *padapter, struct sta_ ptxservq->qcnt--; phwxmits[ac_index].accnt--; } @@ -44016,7 +43265,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } -@@ -3973,7 +3685,7 @@ void stop_sta_xmit(_adapter *padapter, s +@@ -3973,7 +3685,7 @@ void stop_sta_xmit(_adapter *padapter, struct sta_info *psta) #ifdef CONFIG_TDLS if( !(psta->tdls_sta_state & TDLS_LINKED_STATE) ) @@ -44025,7 +43274,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release pstapriv->sta_dz_bitmap |= BIT(psta->aid); -@@ -4014,7 +3726,7 @@ void stop_sta_xmit(_adapter *padapter, s +@@ -4014,7 +3726,7 @@ void stop_sta_xmit(_adapter *padapter, struct sta_info *psta) _exit_critical_bh(&pxmitpriv->lock, &irqL0); @@ -44034,7 +43283,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release void wakeup_sta_to_xmit(_adapter *padapter, struct sta_info *psta) { -@@ -4024,8 +3736,13 @@ void wakeup_sta_to_xmit(_adapter *padapt +@@ -4024,8 +3736,13 @@ void wakeup_sta_to_xmit(_adapter *padapter, struct sta_info *psta) _list *xmitframe_plist, *xmitframe_phead; struct xmit_frame *pxmitframe=NULL; struct sta_priv *pstapriv = &padapter->stapriv; @@ -44049,7 +43298,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release xmitframe_phead = get_list_head(&psta->sleep_q); xmitframe_plist = get_next(xmitframe_phead); -@@ -4082,53 +3799,25 @@ void wakeup_sta_to_xmit(_adapter *padapt +@@ -4082,53 +3799,25 @@ void wakeup_sta_to_xmit(_adapter *padapter, struct sta_info *psta) pxmitframe->attrib.triggered = 1; @@ -44108,7 +43357,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release xmitframe_phead = get_list_head(&psta_bmc->sleep_q); xmitframe_plist = get_next(xmitframe_phead); -@@ -4148,36 +3837,71 @@ void wakeup_sta_to_xmit(_adapter *padapt +@@ -4148,36 +3837,71 @@ void wakeup_sta_to_xmit(_adapter *padapter, struct sta_info *psta) pxmitframe->attrib.triggered = 1; @@ -44151,7 +43400,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + } + + } - ++ + if(psta->sleepq_len==0) + { +#ifdef CONFIG_TDLS @@ -44159,12 +43408,12 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + { + if(psta->state&WIFI_SLEEP_STATE) + psta->state ^= WIFI_SLEEP_STATE; -+ + + goto _exit; } +#endif //CONFIG_TDLS + pstapriv->tim_bitmap &= ~BIT(psta->aid); -+ + + //DBG_871X("wakeup to xmit, qlen==0, update_BCNTIM, tim=%x\n", pstapriv->tim_bitmap); + //upate BCN for TIM IE + //update_BCNTIM(padapter); @@ -44183,7 +43432,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + } + +_exit: - ++ + //_exit_critical_bh(&psta_bmc->sleep_q.lock, &irqL); + _exit_critical_bh(&pxmitpriv->lock, &irqL); @@ -44194,7 +43443,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release update_beacon(padapter, _TIM_IE_, NULL, _FALSE); } -@@ -4190,8 +3914,11 @@ void xmit_delivery_enabled_frames(_adapt +@@ -4190,8 +3914,11 @@ void xmit_delivery_enabled_frames(_adapter *padapter, struct sta_info *psta) _list *xmitframe_plist, *xmitframe_phead; struct xmit_frame *pxmitframe=NULL; struct sta_priv *pstapriv = &padapter->stapriv; @@ -44207,7 +43456,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release xmitframe_phead = get_list_head(&psta->sleep_q); xmitframe_plist = get_next(xmitframe_phead); -@@ -4244,17 +3971,21 @@ void xmit_delivery_enabled_frames(_adapt +@@ -4244,17 +3971,21 @@ void xmit_delivery_enabled_frames(_adapter *padapter, struct sta_info *psta) pxmitframe->attrib.triggered = 1; @@ -44231,7 +43480,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return; } #endif //CONFIG_TDLS -@@ -4267,11 +3998,159 @@ void xmit_delivery_enabled_frames(_adapt +@@ -4267,11 +3998,159 @@ void xmit_delivery_enabled_frames(_adapter *padapter, struct sta_info *psta) //update_mask = BIT(0); } @@ -44241,11 +43490,11 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - _exit_critical_bh(&psta->sleep_q.lock, &irqL); + //_exit_critical_bh(&psta->sleep_q.lock, &irqL); + _exit_critical_bh(&pxmitpriv->lock, &irqL); - - } - - #endif - ++ ++} ++ ++#endif ++ +void rtw_sctx_init(struct submit_ctx *sctx, int timeout_ms) +{ + sctx->timeout_ms = timeout_ms; @@ -44353,7 +43602,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + + rtw_msleep_os(10); + } while (rtw_get_passing_time_ms(pack_tx_ops->submit_time) < timeout_ms); -+ + + if (pack_tx_ops->status == RTW_SCTX_SUBMITTED) { + pack_tx_ops->status = RTW_SCTX_DONE_TIMEOUT; + DBG_871X("%s timeout\n", __func__); @@ -44363,7 +43612,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + ret = _SUCCESS; + + return ret; -+} + } +#endif + +int rtw_ack_tx_wait(struct xmit_priv *pxmitpriv, u32 timeout_ms) @@ -44372,13 +43621,13 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + return rtw_ack_tx_polling(pxmitpriv, timeout_ms); +#else + struct submit_ctx *pack_tx_ops = &pxmitpriv->ack_tx_ops; -+ + + pack_tx_ops->submit_time = rtw_get_current_time(); + pack_tx_ops->timeout_ms = timeout_ms; + pack_tx_ops->status = RTW_SCTX_SUBMITTED; + + return rtw_sctx_wait(pack_tx_ops); -+#endif + #endif +} + +void rtw_ack_tx_done(struct xmit_priv *pxmitpriv, int status) @@ -44392,7 +43641,10 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + } +} +#endif //CONFIG_XMIT_ACK -+ + +diff --git a/drivers/net/wireless/rtl8192cu/hal/HalPwrSeqCmd.c b/drivers/net/wireless/rtl8192cu/hal/HalPwrSeqCmd.c +new file mode 100644 +index 0000000..c59bb66 --- /dev/null +++ b/drivers/net/wireless/rtl8192cu/hal/HalPwrSeqCmd.c @@ -0,0 +1,177 @@ @@ -44573,6 +43825,9 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release +} + + +diff --git a/drivers/net/wireless/rtl8192cu/hal/dm.c b/drivers/net/wireless/rtl8192cu/hal/dm.c +new file mode 100644 +index 0000000..465ca82 --- /dev/null +++ b/drivers/net/wireless/rtl8192cu/hal/dm.c @@ -0,0 +1,314 @@ @@ -44890,6 +44145,9 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release +#endif /* CONFIG_DM_ADAPTIVITY */ +} + +diff --git a/drivers/net/wireless/rtl8192cu/hal/dm.h b/drivers/net/wireless/rtl8192cu/hal/dm.h +new file mode 100644 +index 0000000..dd9a57d --- /dev/null +++ b/drivers/net/wireless/rtl8192cu/hal/dm.h @@ -0,0 +1,30 @@ @@ -44923,6 +44181,9 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release +void dm_adaptivity(_adapter *pAdapter); + +#endif /* __DM_H__ */ +diff --git a/drivers/net/wireless/rtl8192cu/hal/hal_com.c b/drivers/net/wireless/rtl8192cu/hal/hal_com.c +new file mode 100644 +index 0000000..4dcafd6 --- /dev/null +++ b/drivers/net/wireless/rtl8192cu/hal/hal_com.c @@ -0,0 +1,371 @@ @@ -45297,6 +44558,9 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + return ret; +} + +diff --git a/drivers/net/wireless/rtl8192cu/hal/hal_init.c b/drivers/net/wireless/rtl8192cu/hal/hal_init.c +deleted file mode 100644 +index edef678..0000000 --- a/drivers/net/wireless/rtl8192cu/hal/hal_init.c +++ /dev/null @@ -1,120 +0,0 @@ @@ -45420,6 +44684,9 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - padapter->HalFunc.sreset_init_value(padapter); -} -#endif +diff --git a/drivers/net/wireless/rtl8192cu/hal/hal_intf.c b/drivers/net/wireless/rtl8192cu/hal/hal_intf.c +new file mode 100644 +index 0000000..6c56e72 --- /dev/null +++ b/drivers/net/wireless/rtl8192cu/hal/hal_intf.c @@ -0,0 +1,546 @@ @@ -45969,6 +45236,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + return adapter->HalFunc.c2h_id_filter_ccx; +} + +diff --git a/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_cmd.c b/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_cmd.c +index 971ef6c..33921e2 100644 --- a/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_cmd.c +++ b/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_cmd.c @@ -16,8 +16,7 @@ @@ -46050,7 +45319,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { u8 read_down = _FALSE; int retry_cnts = 100; -@@ -103,17 +47,10 @@ static u8 _is_fw_read_cmd_down(_adapter* +@@ -103,17 +47,10 @@ static u8 _is_fw_read_cmd_down(_adapter* padapter, u8 isvern, u8 msgbox_num) // DBG_8192C(" _is_fw_read_cmd_down ,isnormal_chip(%x),reg_1cc(%x),msg_box(%d)...\n",isvern,rtw_read8(padapter,REG_HMETFR),msgbox_num); do{ @@ -46072,7 +45341,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release }while( (!read_down) && (retry_cnts--)); return read_down; -@@ -129,19 +66,28 @@ static u8 _is_fw_read_cmd_down(_adapter* +@@ -129,19 +66,28 @@ static u8 _is_fw_read_cmd_down(_adapter* padapter, u8 isvern, u8 msgbox_num) ******************************************/ int rtl8192c_FillH2CCmd(_adapter* padapter, u8 ElementID, u32 CmdLen, u8* pCmdBuffer) { @@ -46104,7 +45373,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if(!pCmdBuffer){ goto exit; -@@ -153,7 +99,7 @@ int rtl8192c_FillH2CCmd(_adapter* padapt +@@ -153,7 +99,7 @@ int rtl8192c_FillH2CCmd(_adapter* padapter, u8 ElementID, u32 CmdLen, u8* pCmdBu do{ h2c_box_num = pHalData->LastHMEBoxNum; @@ -46113,7 +45382,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release DBG_8192C(" fw read cmd failed...\n"); goto exit; } -@@ -179,14 +125,6 @@ int rtl8192c_FillH2CCmd(_adapter* padapt +@@ -179,14 +125,6 @@ int rtl8192c_FillH2CCmd(_adapter* padapter, u8 ElementID, u32 CmdLen, u8* pCmdBu h2c_cmd = cpu_to_le32( h2c_cmd ); rtw_write32(padapter,msgbox_addr, h2c_cmd); @@ -46128,7 +45397,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release bcmd_down = _TRUE; // DBG_8192C("MSG_BOX:%d,CmdLen(%d), reg:0x%x =>h2c_cmd:0x%x, reg:0x%x =>h2c_cmd_ex:0x%x ..\n" -@@ -202,178 +140,13 @@ int rtl8192c_FillH2CCmd(_adapter* padapt +@@ -202,178 +140,13 @@ int rtl8192c_FillH2CCmd(_adapter* padapter, u8 ElementID, u32 CmdLen, u8* pCmdBu DBG_8192C("H2C Cmd exe failed. \n" ); */ ret = _SUCCESS; @@ -46379,7 +45648,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } else { -@@ -976,7 +700,7 @@ static void SetFwRsvdPagePkt(PADAPTER Ad +@@ -976,7 +700,7 @@ static void SetFwRsvdPagePkt(PADAPTER Adapter, BOOLEAN bDLFinished) pattrib->pktlen = pattrib->last_txcmdsz = TotalPacketLen - TxDescLen; _rtw_memcpy(pmgntframe->buf_addr, ReservedPagePacket, TotalPacketLen); @@ -46525,7 +45794,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #ifdef CONFIG_IOL #include -@@ -1199,9 +920,8 @@ int rtl8192c_IOL_exec_cmds_sync(ADAPTER +@@ -1199,9 +920,8 @@ int rtl8192c_IOL_exec_cmds_sync(ADAPTER *adapter, struct xmit_frame *xmit_frame, if (rtw_IOL_append_END_cmd(xmit_frame) != _SUCCESS) goto exit; @@ -46639,13 +45908,13 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release //keep alive period = 3 * 10 BCN interval pwowlan_parm.mode =3; pwowlan_parm.gpio_index=3; -@@ -1356,6 +1155,5 @@ _func_exit_; +@@ -1358,4 +1157,3 @@ _func_exit_; - - - +diff --git a/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_dm.c b/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_dm.c +index be1e800..6e5634c 100644 --- a/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_dm.c +++ b/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_dm.c @@ -15,8 +15,8 @@ @@ -46776,7 +46045,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release value_IGI = DM_DIG_FA_LOWER; if(FalseAlmCnt->Cnt_all > 10000) -@@ -276,7 +319,10 @@ VOID dm_CtrlInitGainByRssi( IN PADAPTER +@@ -276,7 +319,10 @@ VOID dm_CtrlInitGainByRssi( IN PADAPTER pAdapter) HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pAdapter); struct dm_priv *pdmpriv = &pHalData->dmpriv; DIG_T *pDigTable = &pdmpriv->DM_DigTable; @@ -46788,7 +46057,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release //modify DIG upper bound if((pDigTable->Rssi_val_min + 20) > DM_DIG_MAX ) -@@ -393,6 +439,22 @@ VOID dm_CtrlInitGainByRssi( IN PADAPTER +@@ -393,6 +439,22 @@ VOID dm_CtrlInitGainByRssi( IN PADAPTER pAdapter) if(pDigTable->CurIGValue < pDigTable->rx_gain_range_min) pDigTable->CurIGValue = pDigTable->rx_gain_range_min; @@ -46811,7 +46080,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release //printk("%s => rx_gain_range_max(0x%02x) rx_gain_range_min(0x%02x)\n",__FUNCTION__, // pDigTable->rx_gain_range_max,pDigTable->rx_gain_range_min); //printk("%s CurIGValue(0x%02x) <====\n",__FUNCTION__,pDigTable->CurIGValue ); -@@ -408,6 +470,10 @@ static VOID dm_CtrlInitGainByRssi(IN PAD +@@ -408,6 +470,10 @@ static VOID dm_CtrlInitGainByRssi(IN PADAPTER pAdapter) struct dm_priv *pdmpriv = &pHalData->dmpriv; DIG_T *pDigTable = &pdmpriv->DM_DigTable; PFALSE_ALARM_STATISTICS FalseAlmCnt = &(pdmpriv->FalseAlmCnt); @@ -46822,7 +46091,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release //modify DIG upper bound if((pDigTable->Rssi_val_min + 20) > DM_DIG_MAX ) -@@ -415,7 +481,6 @@ static VOID dm_CtrlInitGainByRssi(IN PAD +@@ -415,7 +481,6 @@ static VOID dm_CtrlInitGainByRssi(IN PADAPTER pAdapter) else pDigTable->rx_gain_range_max = pDigTable->Rssi_val_min + 20; //printk("%s Rssi_val_min(0x%02x),rx_gain_range_max(0x%02x)\n",__FUNCTION__,pDigTable->Rssi_val_min,pDigTable->rx_gain_range_max); @@ -46830,7 +46099,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release //modify DIG lower bound, deal with abnorally large false alarm if(FalseAlmCnt->Cnt_all > 10000) { -@@ -515,6 +580,14 @@ static VOID dm_CtrlInitGainByRssi(IN PAD +@@ -515,6 +580,14 @@ static VOID dm_CtrlInitGainByRssi(IN PADAPTER pAdapter) } #endif @@ -46845,7 +46114,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release //Check initial gain by upper/lower bound if(pDigTable->CurIGValue >pDigTable->rx_gain_range_max) pDigTable->CurIGValue = pDigTable->rx_gain_range_max; -@@ -522,6 +595,22 @@ static VOID dm_CtrlInitGainByRssi(IN PAD +@@ -522,6 +595,22 @@ static VOID dm_CtrlInitGainByRssi(IN PADAPTER pAdapter) if(pDigTable->CurIGValue < pDigTable->rx_gain_range_min) pDigTable->CurIGValue = pDigTable->rx_gain_range_min; @@ -47012,7 +46281,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release //RTPRINT(FDM, DM_Monitor, ("dm_DIG() ==>\n")); if(pdmpriv->bDMInitialGainEnable == _FALSE) -@@ -854,7 +993,11 @@ static void dm_InitDynamicTxPower(IN PAD +@@ -854,7 +993,11 @@ static void dm_InitDynamicTxPower(IN PADAPTER Adapter) struct dm_priv *pdmpriv = &pHalData->dmpriv; #ifdef CONFIG_USB_HCI @@ -47024,7 +46293,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { dm_SavePowerIndex(Adapter); pdmpriv->bDynamicTxPowerEnable = _TRUE; -@@ -900,7 +1043,47 @@ static void dm_DynamicTxPower(IN PADAPTE +@@ -900,7 +1043,47 @@ static void dm_DynamicTxPower(IN PADAPTER Adapter) pdmpriv->LastDTPLvl=TxHighPwrLevel_Normal; return; } @@ -47072,7 +46341,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if(check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE) // Default port { //todo: AP Mode -@@ -938,7 +1121,7 @@ static void dm_DynamicTxPower(IN PADAPTE +@@ -938,7 +1121,7 @@ static void dm_DynamicTxPower(IN PADAPTER Adapter) pdmpriv->DynamicTxHighPowerLvl = TxHighPwrLevel_Normal; //RT_TRACE(COMP_HIPWR, DBG_LOUD, ("TxHighPwrLevel_Normal\n")); } @@ -47132,7 +46401,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release u32 DPK_delta_mapping[2][DPK_DELTA_MAPPING_NUM] = { {0x1c, 0x1c, 0x1d, 0x1d, 0x1e, 0x1f, 0x00, 0x00, 0x01, 0x01, -@@ -1291,14 +1470,18 @@ dm_TXPowerTrackingCallback_ThermalMeter_ +@@ -1291,14 +1470,18 @@ dm_TXPowerTrackingCallback_ThermalMeter_92C( {0x1c, 0x1d, 0x1e, 0x1e, 0x1e, 0x1f, 0x00, 0x00, 0x01, 0x02, 0x02, 0x03, 0x03}}; @@ -47153,7 +46422,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release pdmpriv->TXPowerTrackingCallbackCnt++; //cosa add for debug pdmpriv->bTXPowerTrackingInit = _TRUE; -@@ -1310,12 +1493,11 @@ dm_TXPowerTrackingCallback_ThermalMeter_ +@@ -1310,12 +1493,11 @@ dm_TXPowerTrackingCallback_ThermalMeter_92C( //DBG_8192C("===>dm_TXPowerTrackingCallback_ThermalMeter_92C\n"); @@ -47167,7 +46436,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if(is2T) rf = 2; -@@ -1328,7 +1510,7 @@ dm_TXPowerTrackingCallback_ThermalMeter_ +@@ -1328,7 +1510,7 @@ dm_TXPowerTrackingCallback_ThermalMeter_92C( { //Query OFDM path A default setting ele_D = PHY_QueryBBReg(Adapter, rOFDM0_XATxIQImbalance, bMaskDWord)&bMaskOFDM_D; @@ -47176,7 +46445,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { if(ele_D == (OFDMSwingTable[i]&bMaskOFDM_D)) { -@@ -1342,7 +1524,7 @@ dm_TXPowerTrackingCallback_ThermalMeter_ +@@ -1342,7 +1524,7 @@ dm_TXPowerTrackingCallback_ThermalMeter_92C( if(is2T) { ele_D = PHY_QueryBBReg(Adapter, rOFDM0_XBTxIQImbalance, bMaskDWord)&bMaskOFDM_D; @@ -47185,7 +46454,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { if(ele_D == (OFDMSwingTable[i]&bMaskOFDM_D)) { -@@ -1434,7 +1616,6 @@ dm_TXPowerTrackingCallback_ThermalMeter_ +@@ -1434,7 +1616,6 @@ dm_TXPowerTrackingCallback_ThermalMeter_92C( } delta_LCK = (ThermalValue > pdmpriv->ThermalValue_LCK)?(ThermalValue - pdmpriv->ThermalValue_LCK):(pdmpriv->ThermalValue_LCK - ThermalValue); delta_IQK = (ThermalValue > pdmpriv->ThermalValue_IQK)?(ThermalValue - pdmpriv->ThermalValue_IQK):(pdmpriv->ThermalValue_IQK - ThermalValue); @@ -47193,7 +46462,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release //DBG_8192C("Readback Thermal Meter = 0x%lx pre thermal meter 0x%lx EEPROMthermalmeter 0x%lx delta 0x%lx delta_LCK 0x%lx delta_IQK 0x%lx\n", ThermalValue, pHalData->ThermalValue, pHalData->EEPROMThermalMeter, delta, delta_LCK, delta_IQK); -@@ -1480,29 +1661,26 @@ dm_TXPowerTrackingCallback_ThermalMeter_ +@@ -1480,29 +1661,26 @@ dm_TXPowerTrackingCallback_ThermalMeter_92C( { for(i = 0; i < rf; i++) pdmpriv->OFDM_index[i] -= delta; @@ -47228,7 +46497,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release //no adjust #ifdef CONFIG_USB_HCI -@@ -1521,8 +1699,8 @@ dm_TXPowerTrackingCallback_ThermalMeter_ +@@ -1521,8 +1699,8 @@ dm_TXPowerTrackingCallback_ThermalMeter_92C( OFDM_index[i] = pdmpriv->OFDM_index[i]; CCK_index = pdmpriv->CCK_index; } @@ -47239,7 +46508,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release for(i = 0; i < rf; i++) { if(TxPwrLevel[i] >=0 && TxPwrLevel[i] <=26) -@@ -1584,34 +1762,33 @@ dm_TXPowerTrackingCallback_ThermalMeter_ +@@ -1584,34 +1762,33 @@ dm_TXPowerTrackingCallback_ThermalMeter_92C( for(i = 0; i < rf; i++) { @@ -47285,7 +46554,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release X = pdmpriv->RegE94; Y = pdmpriv->RegE9C; -@@ -1642,7 +1819,7 @@ dm_TXPowerTrackingCallback_ThermalMeter_ +@@ -1642,7 +1819,7 @@ dm_TXPowerTrackingCallback_ThermalMeter_92C( } else { @@ -47294,7 +46563,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release PHY_SetBBReg(Adapter, rOFDM0_XCTxAFE, bMaskH4Bits, 0x00); PHY_SetBBReg(Adapter, rOFDM0_ECCAThreshold, BIT31|BIT29, 0x00); } -@@ -1651,24 +1828,24 @@ dm_TXPowerTrackingCallback_ThermalMeter_ +@@ -1651,24 +1828,24 @@ dm_TXPowerTrackingCallback_ThermalMeter_92C( //Adjust CCK according to IQK result if(!pdmpriv->bCCKinCH14){ @@ -47335,7 +46604,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } if(is2T) -@@ -1704,7 +1881,7 @@ dm_TXPowerTrackingCallback_ThermalMeter_ +@@ -1704,7 +1881,7 @@ dm_TXPowerTrackingCallback_ThermalMeter_92C( } else{ @@ -47344,7 +46613,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release PHY_SetBBReg(Adapter, rOFDM0_XDTxAFE, bMaskH4Bits, 0x00); PHY_SetBBReg(Adapter, rOFDM0_ECCAThreshold, BIT27|BIT25, 0x00); } -@@ -1716,7 +1893,7 @@ dm_TXPowerTrackingCallback_ThermalMeter_ +@@ -1716,7 +1893,7 @@ dm_TXPowerTrackingCallback_ThermalMeter_92C( DBG_8192C("TxPwrTracking 0xc80 = 0x%x, 0xc94 = 0x%x RF 0x24 = 0x%x\n", \ PHY_QueryBBReg(Adapter, 0xc80, bMaskDWord),\ PHY_QueryBBReg(Adapter, 0xc94, bMaskDWord), \ @@ -47353,7 +46622,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release */ } -@@ -1730,20 +1907,6 @@ dm_TXPowerTrackingCallback_ThermalMeter_ +@@ -1730,20 +1907,6 @@ dm_TXPowerTrackingCallback_ThermalMeter_92C( rtl8192c_PHY_IQCalibrate(Adapter,_FALSE); } @@ -47412,7 +46681,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #endif } -@@ -3275,10 +3438,14 @@ static void dm_CheckPbcGPIO(_adapter *pa +@@ -3275,10 +3438,14 @@ static void dm_CheckPbcGPIO(_adapter *padapter) { u8 tmp1byte; u8 bPbcPressed = _FALSE; @@ -47427,7 +46696,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #ifdef CONFIG_USB_HCI tmp1byte = rtw_read8(padapter, GPIO_IO_SEL); tmp1byte |= (HAL_8192C_HW_GPIO_WPS_BIT); -@@ -3294,30 +3461,44 @@ static void dm_CheckPbcGPIO(_adapter *pa +@@ -3294,30 +3461,44 @@ static void dm_CheckPbcGPIO(_adapter *padapter) tmp1byte =rtw_read8(padapter, GPIO_IN); if (tmp1byte == 0xff) @@ -47476,7 +46745,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #ifdef RTK_DMP_PLATFORM #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,12)) -@@ -3336,7 +3517,7 @@ static void dm_CheckPbcGPIO(_adapter *pa +@@ -3336,7 +3517,7 @@ static void dm_CheckPbcGPIO(_adapter *padapter) rtw_signal_process(padapter->pid[0], SIGUSR1); #endif #endif @@ -47496,7 +46765,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if(pdmpriv->initialize == 0){ pdmpriv->rf_saving_Reg874 = (PHY_QueryBBReg(pAdapter, rFPGA0_XCD_RFInterfaceSW, bMaskDWord)&0x1CC000)>>14; pdmpriv->rf_saving_RegC70 = (PHY_QueryBBReg(pAdapter, rOFDM0_AGCParameter1, bMaskDWord)&BIT3)>>3; -@@ -4424,7 +4603,7 @@ void rtl8192c_init_dm_priv(IN PADAPTER A +@@ -4424,7 +4603,7 @@ void rtl8192c_init_dm_priv(IN PADAPTER Adapter) PHAL_DATA_TYPE pHalData = GET_HAL_DATA(Adapter); struct dm_priv *pdmpriv = &pHalData->dmpriv; @@ -47526,6 +46795,41 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { - u8 trigger=0,evt_id=0,evt_len=0,idx=0,tmp8=0,evt_seq=0; - u8 evt_buf[15]; +- +- trigger=rtw_read8(padapter,REG_C2HEVT_CLEAR); +- while (trigger ==0xFF) +- { +- tmp8=rtw_read8(padapter,REG_C2HEVT_MSG_NORMAL); +- evt_id=tmp8&0xf; +- evt_len=(tmp8&0xf0)>>4; +- evt_seq=rtw_read8(padapter,REG_C2HEVT_MSG_NORMAL+1); +- DBG_8192C(" %s evt_id =0x%x evt_len=0x%x evt_seq=0x%x\n",__FUNCTION__,evt_id,evt_len,evt_seq); +- for(idx=0;idxstapriv; +- struct sta_info *psta=NULL; +- DBG_8192C(" %s mac_id=%d\n",__FUNCTION__,mac_id); +- for(idx=0;idxsta_aid[mac_id-2+idx]; +- if(psta !=NULL){ +- psta->init_rate=evt_buf[idx]; +- DBG_8192C(" %s mac_id=%d psta->init_rate=0x%x\n",__FUNCTION__,mac_id,psta->init_rate); +- } +- } +- +- } +- default: +- DBG_8192C(" %s evt_id =0x%x evt_len=0x%x\n",__FUNCTION__,evt_id,evt_len); +- } +- rtw_write8(padapter, REG_C2HEVT_CLEAR,0x0); +- rtw_mdelay_os(1); +- trigger=rtw_read8(padapter,REG_C2HEVT_CLEAR); + PHAL_DATA_TYPE pbuddy_HalData; + struct dm_priv *pbuddy_dmpriv; + PHAL_DATA_TYPE pHalData = GET_HAL_DATA(Adapter); @@ -47538,9 +46842,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + + pbuddy_HalData = GET_HAL_DATA(pbuddy_adapter); + pbuddy_dmpriv = &pbuddy_HalData->dmpriv; - -- trigger=rtw_read8(padapter,REG_C2HEVT_CLEAR); -- while (trigger ==0xFF) ++ + //get min. [PWDB] when both interfaces are connected + if((check_fwstate(pmlmepriv, WIFI_AP_STATE) == _TRUE + && Adapter->stapriv.asoc_sta_count > 2 @@ -47562,48 +46864,17 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + && check_buddy_fwstate(Adapter,_FW_LINKED))) + { + pdmpriv->UndecoratedSmoothedPWDB = pbuddy_dmpriv->UndecoratedSmoothedPWDB; -+ } + } +- //DBG_8192C(" %s End\n",__FUNCTION__); +-} + //secondary is not connected + else if((check_fwstate(pmlmepriv, WIFI_AP_STATE) == _TRUE + && Adapter->stapriv.asoc_sta_count > 2) || + (check_fwstate(pmlmepriv, WIFI_STATION_STATE) + && check_fwstate(pmlmepriv, _FW_LINKED))) - { -- tmp8=rtw_read8(padapter,REG_C2HEVT_MSG_NORMAL); -- evt_id=tmp8&0xf; -- evt_len=(tmp8&0xf0)>>4; -- evt_seq=rtw_read8(padapter,REG_C2HEVT_MSG_NORMAL+1); -- DBG_8192C(" %s evt_id =0x%x evt_len=0x%x evt_seq=0x%x\n",__FUNCTION__,evt_id,evt_len,evt_seq); -- for(idx=0;idxstapriv; -- struct sta_info *psta=NULL; -- DBG_8192C(" %s mac_id=%d\n",__FUNCTION__,mac_id); -- for(idx=0;idxsta_aid[mac_id-2+idx]; -- if(psta !=NULL){ -- psta->init_rate=evt_buf[idx]; -- DBG_8192C(" %s mac_id=%d psta->init_rate=0x%x\n",__FUNCTION__,mac_id,psta->init_rate); -- } -- } -- -- } -- default: -- DBG_8192C(" %s evt_id =0x%x evt_len=0x%x\n",__FUNCTION__,evt_id,evt_len); -- } -- rtw_write8(padapter, REG_C2HEVT_CLEAR,0x0); -- rtw_mdelay_os(1); -- trigger=rtw_read8(padapter,REG_C2HEVT_CLEAR); ++ { + pbuddy_dmpriv->UndecoratedSmoothedPWDB = 0; - } -- //DBG_8192C(" %s End\n",__FUNCTION__); --} ++ } + //both interfaces are not connected + else + { @@ -47774,6 +47045,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release // Check GPIO to determine current RF on/off and Pbc status. // Check Hardware Radio ON/OFF or not //if(Adapter->MgntInfo.PowerSaveControl.bGpioRfSw) +diff --git a/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_hal_init.c b/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_hal_init.c +index e3e2ae9..b9e91d7 100644 --- a/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_hal_init.c +++ b/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_hal_init.c @@ -16,7 +16,7 @@ @@ -47862,7 +47135,14 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - pageNums = size / MAX_PAGE_SIZE ; - //RT_ASSERT((pageNums <= 4), ("Page numbers should not greater then 4 \n")); - remainSize = size % MAX_PAGE_SIZE; -- ++ pageNums = size / MAX_PAGE_SIZE ; ++ //RT_ASSERT((pageNums <= 4), ("Page numbers should not greater then 4 \n")); ++ remainSize = size % MAX_PAGE_SIZE; ++ ++ for(page = 0; page < pageNums; page++){ ++ offset = page *MAX_PAGE_SIZE; ++ ret = _PageWrite(Adapter,page, (bufferPtr+offset),MAX_PAGE_SIZE); + - for(page = 0; page < pageNums; page++){ - offset = page *MAX_PAGE_SIZE; - ret = _PageWrite(Adapter,page, (bufferPtr+offset),MAX_PAGE_SIZE); @@ -47879,14 +47159,6 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - goto exit; - } - //RT_TRACE(COMP_INIT, DBG_LOUD, ("_WriteFW Done- for Normal chip.\n")); -+ pageNums = size / MAX_PAGE_SIZE ; -+ //RT_ASSERT((pageNums <= 4), ("Page numbers should not greater then 4 \n")); -+ remainSize = size % MAX_PAGE_SIZE; -+ -+ for(page = 0; page < pageNums; page++){ -+ offset = page *MAX_PAGE_SIZE; -+ ret = _PageWrite(Adapter,page, (bufferPtr+offset),MAX_PAGE_SIZE); -+ + if(ret == _FAIL) + goto exit; } @@ -47959,7 +47231,10 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - pFwImageFileName = R92CFwImageFileName_UMC; - FwImage = Rtl819XFwUMCACutImageArray; - FwImageLen = UMCACutImgArrayLength; --#ifdef CONFIG_WOWLAN ++ pFwImageFileName = R92CFwImageFileName_UMC; ++ FwImage = Rtl819XFwUMCACutImageArray; ++ FwImageLen = UMCACutImgArrayLength; + #ifdef CONFIG_WOWLAN - pFwImageFileName_WoWLAN = R92CFwImageFileName_UMC_WW; - FwImageWoWLAN= Rtl8192C_FwUMCWWImageArray; - FwImageWoWLANLen =UMCACutWWImgArrayLength ; @@ -47972,22 +47247,6 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - pFwImageFileName = R92CFwImageFileName_UMC_B; - FwImage = Rtl819XFwUMCBCutImageArray; - FwImageLen = UMCBCutImgArrayLength; -+ pFwImageFileName = R92CFwImageFileName_UMC; -+ FwImage = Rtl819XFwUMCACutImageArray; -+ FwImageLen = UMCACutImgArrayLength; - #ifdef CONFIG_WOWLAN -- pFwImageFileName_WoWLAN = R92CFwImageFileName_UMC_B_WW; -- FwImageWoWLAN= Rtl8192C_FwUMCBCutWWImageArray; -- FwImageWoWLANLen =UMCBCutWWImgArrayLength ; --#endif -- -- DBG_8192C(" ===> FirmwareDownload91C() fw:Rtl819XFwImageArray_UMC_B\n"); -- } -- else -- { -- pFwImageFileName = R92CFwImageFileName_TSMC; -- FwImage = Rtl819XFwTSMCImageArray; -- FwImageLen = TSMCImgArrayLength; + pFwImageFileName_WoWLAN = R92CFwImageFileName_UMC_WW; + FwImageWoWLAN= Rtl8192C_FwUMCWWImageArray; + FwImageWoWLANLen =UMCACutWWImgArrayLength ; @@ -48001,6 +47260,19 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + FwImage = Rtl819XFwUMCBCutImageArray; + FwImageLen = UMCBCutImgArrayLength; #ifdef CONFIG_WOWLAN +- pFwImageFileName_WoWLAN = R92CFwImageFileName_UMC_B_WW; +- FwImageWoWLAN= Rtl8192C_FwUMCBCutWWImageArray; +- FwImageWoWLANLen =UMCBCutWWImgArrayLength ; +-#endif +- +- DBG_8192C(" ===> FirmwareDownload91C() fw:Rtl819XFwImageArray_UMC_B\n"); +- } +- else +- { +- pFwImageFileName = R92CFwImageFileName_TSMC; +- FwImage = Rtl819XFwTSMCImageArray; +- FwImageLen = TSMCImgArrayLength; +-#ifdef CONFIG_WOWLAN - pFwImageFileName_WoWLAN = R92CFwImageFileName_TSMC_WW; - FwImageWoWLAN= Rtl8192C_FwTSMCWWImageArray; - FwImageWoWLANLen =TSMCWWImgArrayLength ; @@ -48161,27 +47433,18 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return ChipVersion; } +- +-RT_CHANNEL_DOMAIN +-_HalMapChannelPlan8192C( +- IN PADAPTER Adapter, +- IN u8 HalChannelPlan +void +rtl8192c_EfuseParseChnlPlan( + IN PADAPTER padapter, + IN u8* hwinfo, + IN BOOLEAN AutoLoadFail -+ ) -+{ -+ padapter->mlmepriv.ChannelPlan = hal_com_get_channel_plan( -+ padapter -+ , hwinfo?hwinfo[EEPROM_CHANNEL_PLAN]:0xFF -+ , padapter->registrypriv.channel_plan -+ , RT_CHANNEL_DOMAIN_WORLD_WIDE_13 -+ , AutoLoadFail -+ ); - --RT_CHANNEL_DOMAIN --_HalMapChannelPlan8192C( -- IN PADAPTER Adapter, -- IN u8 HalChannelPlan -- ) --{ + ) + { - RT_CHANNEL_DOMAIN rtChannelDomain; - - switch(HalChannelPlan) @@ -48204,6 +47467,14 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - - return rtChannelDomain; - ++ padapter->mlmepriv.ChannelPlan = hal_com_get_channel_plan( ++ padapter ++ , hwinfo?hwinfo[EEPROM_CHANNEL_PLAN]:0xFF ++ , padapter->registrypriv.channel_plan ++ , RT_CHANNEL_DOMAIN_WORLD_WIDE_13 ++ , AutoLoadFail ++ ); ++ + DBG_871X("mlmepriv.ChannelPlan = 0x%02x\n", padapter->mlmepriv.ChannelPlan); } @@ -48318,7 +47589,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { *pu2Tmp = (u16)EFUSE_MAP_LEN_8723; } -@@ -2320,7 +2245,7 @@ hal_EfuseGetCurrentSize_8723(IN PADAPTER +@@ -2320,7 +2245,7 @@ hal_EfuseGetCurrentSize_8723(IN PADAPTER pAdapter, } else { @@ -48327,7 +47598,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } //RTPRINT(FEEPROM, EFUSE_PG, ("hal_EfuseGetCurrentSize_8723(), start_efuse_addr = %d\n", efuse_addr)); -@@ -2368,7 +2293,7 @@ hal_EfuseGetCurrentSize_8723(IN PADAPTER +@@ -2368,7 +2293,7 @@ hal_EfuseGetCurrentSize_8723(IN PADAPTER pAdapter, } else { @@ -48345,7 +47616,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { ret = hal_EfuseGetCurrentSize_8723(pAdapter, bPseudoTest); } -@@ -2631,7 +2556,7 @@ Hal_EfusePgPacketRead( IN PADAPTER pAdap +@@ -2631,7 +2556,7 @@ Hal_EfusePgPacketRead( IN PADAPTER pAdapter, { ret = hal_EfusePgPacketRead_8192C(pAdapter, offset, data, bPseudoTest); } @@ -48363,7 +47634,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release startAddr%=EFUSE_REAL_CONTENT_LEN; } } -@@ -3533,7 +3458,7 @@ Hal_EfusePgPacketWrite(IN PADAPTER pAdap +@@ -3533,7 +3458,7 @@ Hal_EfusePgPacketWrite(IN PADAPTER pAdapter, { ret = hal_EfusePgPacketWrite_8192C(pAdapter, offset, word_en, data, bPseudoTest); } @@ -48372,7 +47643,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { ret = hal_EfusePgPacketWrite_8723(pAdapter, offset, word_en, data, bPseudoTest); } -@@ -3591,7 +3516,62 @@ void rtl8192c_read_chip_version(PADAPTER +@@ -3591,7 +3516,62 @@ void rtl8192c_read_chip_version(PADAPTER pAdapter) HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pAdapter); pHalData->VersionID = rtl8192c_ReadChipVersion(pAdapter); } @@ -48435,7 +47706,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release void rtl8192c_set_hal_ops(struct hal_ops *pHalFunc) { pHalFunc->free_hal_data = &rtl8192c_free_hal_data; -@@ -3608,15 +3588,15 @@ void rtl8192c_set_hal_ops(struct hal_ops +@@ -3608,15 +3588,15 @@ void rtl8192c_set_hal_ops(struct hal_ops *pHalFunc) pHalFunc->Add_RateATid = &rtl8192c_Add_RateATid; #ifdef CONFIG_ANTENNA_DIVERSITY @@ -48455,7 +47726,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release //Efuse related function pHalFunc->EfusePowerSwitch = &rtl8192c_EfusePowerSwitch; pHalFunc->ReadEFuse = &rtl8192c_ReadEFuse; -@@ -3627,16 +3607,22 @@ void rtl8192c_set_hal_ops(struct hal_ops +@@ -3627,16 +3607,22 @@ void rtl8192c_set_hal_ops(struct hal_ops *pHalFunc) pHalFunc->Efuse_WordEnableDataWrite = &rtl8192c_Efuse_WordEnableDataWrite; #ifdef DBG_CONFIG_ERROR_DETECT @@ -48482,9 +47753,11 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + pHalFunc->c2h_id_filter_ccx = c2h_id_filter_ccx_8192c; } +diff --git a/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_mp.c b/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_mp.c +index a3021a9..a4194c4 100644 --- a/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_mp.c +++ b/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_mp.c -@@ -107,7 +107,7 @@ void Hal_mpt_SwitchRfSetting(PADAPTER pA +@@ -107,7 +107,7 @@ void Hal_mpt_SwitchRfSetting(PADAPTER pAdapter) { HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pAdapter); struct mp_priv *pmp = &pAdapter->mppriv; @@ -48493,7 +47766,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release u8 ulRateIdx = pmp->rateidx; u8 ulbandwidth = pmp->bandwidth; PMPT_CONTEXT pMptCtx = &(pAdapter->mppriv.MptCtx); -@@ -340,7 +340,7 @@ void Hal_MPT_CCKTxPowerAdjustbyIndex(PAD +@@ -340,7 +340,7 @@ void Hal_MPT_CCKTxPowerAdjustbyIndex(PADAPTER pAdapter, BOOLEAN beven) PMPT_CONTEXT pMptCtx = &pAdapter->mppriv.MptCtx; @@ -48525,7 +47798,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #endif } -@@ -538,14 +531,6 @@ void Hal_SetOFDMTxPower(PADAPTER pAdapte +@@ -538,14 +531,6 @@ void Hal_SetOFDMTxPower(PADAPTER pAdapter, u8 *TxPower) write_bbreg(pAdapter, rTxAGC_A_Mcs11_Mcs08, bMaskDWord, TxAGC); write_bbreg(pAdapter, rTxAGC_A_Mcs15_Mcs12, bMaskDWord, TxAGC); @@ -48540,7 +47813,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release // HT Tx-rf(B) tmpval = TxPower[RF_PATH_B]; TxAGC = (tmpval<<24) | (tmpval<<16) | (tmpval<<8) | tmpval; -@@ -557,14 +542,6 @@ void Hal_SetOFDMTxPower(PADAPTER pAdapte +@@ -557,14 +542,6 @@ void Hal_SetOFDMTxPower(PADAPTER pAdapter, u8 *TxPower) write_bbreg(pAdapter, rTxAGC_B_Mcs11_Mcs08, bMaskDWord, TxAGC); write_bbreg(pAdapter, rTxAGC_B_Mcs15_Mcs12, bMaskDWord, TxAGC); @@ -48564,6 +47837,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } #endif // 2009/01/08 MH From Sd3 Willis. We need to enable RFA/B by SW control +diff --git a/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_phycfg.c b/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_phycfg.c +index e527028..1bae6da 100644 --- a/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_phycfg.c +++ b/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_phycfg.c @@ -16,8 +16,7 @@ @@ -49054,22 +48329,22 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release // 2009/10/21 by SD1 Jong. Modified by tynli. Not in Documented in V8.1. - if(!IS_NORMAL_CHIP(pHalData->VersionID)) - { - #ifdef CONFIG_USB_HCI +-#ifdef CONFIG_USB_HCI - rtw_write8(Adapter, REG_LDOHCI12_CTRL, 0x1f); -#else - rtw_write8(Adapter, REG_LDOHCI12_CTRL, 0x1b); -+ //To Fix MAC loopback mode fail. Suggested by SD4 Johnny. 2010.03.23. -+ rtw_write8(Adapter, REG_LDOHCI12_CTRL, 0x0f); -+ rtw_write8(Adapter, 0x15, 0xe9); - #endif +-#endif - } - else - { --#ifdef CONFIG_USB_HCI + #ifdef CONFIG_USB_HCI - //To Fix MAC loopback mode fail. Suggested by SD4 Johnny. 2010.03.23. - rtw_write8(Adapter, REG_LDOHCI12_CTRL, 0x0f); - rtw_write8(Adapter, 0x15, 0xe9); --#endif ++ //To Fix MAC loopback mode fail. Suggested by SD4 Johnny. 2010.03.23. ++ rtw_write8(Adapter, REG_LDOHCI12_CTRL, 0x0f); ++ rtw_write8(Adapter, 0x15, 0xe9); + #endif - } rtw_write8(Adapter, REG_AFE_XTAL_CTRL+1, 0x80); @@ -49143,7 +48418,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release ) { HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); -@@ -1992,7 +1908,7 @@ u32 Rtl8192S_HighPower_RadioA_Array[High +@@ -1992,7 +1908,7 @@ u32 Rtl8192S_HighPower_RadioA_Array[HighPowerRadioAArrayLen] = { int PHY_ConfigRFExternalPA( IN PADAPTER Adapter, @@ -49333,7 +48608,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release switch(pHalData->CurrentChannelBW) { -@@ -3041,6 +2941,11 @@ static void _PHY_SwChnl8192C(PADAPTER Ad +@@ -3041,6 +2941,11 @@ static void _PHY_SwChnl8192C(PADAPTER Adapter, u8 channel) u32 param1, param2; HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); @@ -49345,7 +48620,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release //s1. pre common command - CmdID_SetTxPowerLevel PHY_SetTxPowerLevel8192C(Adapter, channel); -@@ -3050,7 +2955,7 @@ static void _PHY_SwChnl8192C(PADAPTER Ad +@@ -3050,7 +2955,7 @@ static void _PHY_SwChnl8192C(PADAPTER Adapter, u8 channel) for(eRFPath = 0; eRFPath NumTotalRFPath; eRFPath++) { pHalData->RfRegChnlVal[eRFPath] = ((pHalData->RfRegChnlVal[eRFPath] & 0xfffffc00) | param2); @@ -50016,7 +49291,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - APK_value[index] = APK_normal_value[index]; - AFE_on_off[index] = 0x6fdb25a4; - } -- + - for(index = 0; index < APK_BB_REG_NUM; index ++) - { - for(path = 0; path < pathbound; path++) @@ -50026,7 +49301,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - } - BB_AP_MODE[index] = BB_normal_AP_MODE[index]; - } - +- - apkbound = 6; + //settings adjust for normal chip + for(index = 0; index < PATH_NUM; index ++) @@ -50181,9 +49456,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - PHY_SetBBReg(pAdapter, 0xb28, bMaskDWord, 0x12680000); - - PHY_SetBBReg(pAdapter, 0xb98, bMaskDWord, 0x12680000); -+ PHY_SetBBReg(pAdapter, offset, bMaskDWord, APK_normal_setting_value_1[index]); -+ //RTPRINT(FINIT, INIT_IQK, ("PHY_APCalibrate() offset 0x%x value 0x%x\n", offset, PHY_QueryBBReg(pAdapter, offset, bMaskDWord))); - +- - offset = 0xb68; - index = 11; - for(; index < 13; index ++) //offset 0xb68, 0xb6c @@ -50193,7 +49466,9 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - - offset += 0x04; - } -- ++ PHY_SetBBReg(pAdapter, offset, bMaskDWord, APK_normal_setting_value_1[index]); ++ //RTPRINT(FINIT, INIT_IQK, ("PHY_APCalibrate() offset 0x%x value 0x%x\n", offset, PHY_QueryBBReg(pAdapter, offset, bMaskDWord))); + - //page-B1 - PHY_SetBBReg(pAdapter, 0xe28, bMaskDWord, 0x40000000); + offset += 0x04; @@ -50406,9 +49681,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { - PHY_SetRFReg(pAdapter, RF90_PATH_A, 0x10, bMaskDWord, 0x1000f); - PHY_SetRFReg(pAdapter, RF90_PATH_A, 0x11, bMaskDWord, 0x20101); -+ PHY_SetRFReg(pAdapter, RF_PATH_A, RF_MODE1, bRFRegOffsetMask, 0x1000f); -+ PHY_SetRFReg(pAdapter, RF_PATH_A, RF_MODE2, bRFRegOffsetMask, 0x20101); - } +- } -#if 1 - if(!isNormal) - { @@ -50445,7 +49718,9 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - RTPRINT(FINIT, INIT_IQK, ("apk result %d 0x%x \t", 4, APK_result[path][4])); -#endif - -- } ++ PHY_SetRFReg(pAdapter, RF_PATH_A, RF_MODE1, bRFRegOffsetMask, 0x1000f); ++ PHY_SetRFReg(pAdapter, RF_PATH_A, RF_MODE2, bRFRegOffsetMask, 0x20101); + } -#endif + + //note no index == 0 @@ -50998,25 +50273,26 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + rOFDM0_XATxIQImbalance, rOFDM0_XBTxIQImbalance, + rOFDM0_XCTxAFE, rOFDM0_XDTxAFE, + rOFDM0_RxIQExtAnta}; - - --#if (MP_DRIVER == 1) ++ ++ +#if MP_DRIVER == 1 + bStartContTx = pAdapter->mppriv.MptCtx.bStartContTx; + bSingleTone = pAdapter->mppriv.MptCtx.bSingleTone; + bCarrierSuppression = pAdapter->mppriv.MptCtx.bCarrierSuppression; +#endif -+ + +- +-#if (MP_DRIVER == 1) //ignore IQK when continuous Tx - if (pAdapter->mppriv.MptCtx.bStartContTx == _TRUE) - return; - if (pAdapter->mppriv.MptCtx.bCarrierSuppression == _TRUE) - return; - if (pAdapter->mppriv.MptCtx.bSingleCarrier == _TRUE) +- return; +- if (pAdapter->mppriv.MptCtx.bSingleTone == _TRUE) + if(bStartContTx || bSingleTone || bCarrierSuppression) return; -- if (pAdapter->mppriv.MptCtx.bSingleTone == _TRUE) -- return; -#endif #if DISABLE_BB_RF @@ -51209,6 +50485,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release -} -#endif - +diff --git a/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_rf6052.c b/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_rf6052.c +index 593ea09..cf46969 100644 --- a/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_rf6052.c +++ b/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_rf6052.c @@ -16,8 +16,7 @@ @@ -51221,7 +50499,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release /****************************************************************************** * * -@@ -109,35 +108,35 @@ void rtl8192c_RF_ChangeTxPath( IN PADAPT +@@ -109,35 +108,35 @@ void rtl8192c_RF_ChangeTxPath( IN PADAPTER Adapter, if (RF_Path_Type == 2 && (DataRate&0xF) <= 0x7) { // Set TX SYNC power G2G3 loop filter @@ -51600,6 +50878,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } } +diff --git a/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_rxdesc.c b/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_rxdesc.c +index 5aa6e61..3e0d795 100644 --- a/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_rxdesc.c +++ b/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_rxdesc.c @@ -16,7 +16,7 @@ @@ -51611,7 +50891,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #define _RTL8192C_REDESC_C_ #include #include -@@ -196,7 +196,7 @@ static s32 translate2dbm(u8 signal_stre +@@ -196,7 +196,7 @@ static s32 translate2dbm(u8 signal_strength_idx) return signal_power; } @@ -51620,7 +50900,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { PHY_STS_OFDM_8192CD_T *pOfdm_buf; PHY_STS_CCK_8192CD_T *pCck_buf; -@@ -383,9 +383,9 @@ void rtl8192c_query_rx_phy_status(union +@@ -383,9 +383,9 @@ void rtl8192c_query_rx_phy_status(union recv_frame *prframe, struct phy_stat *pp //continue; rx_pwr[i] = ((pOfdm_buf->trsw_gain_X[i]&0x3F)*2) - 110; @@ -51632,7 +50912,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release total_rssi += rssi; RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("RF-%d RXPWR=%x RSSI=%d\n", i, rx_pwr[i], rssi)); -@@ -733,8 +733,7 @@ static void process_link_qual(_adapter * +@@ -733,8 +733,7 @@ static void process_link_qual(_adapter *padapter,union recv_frame *prframe) }// Process_UiLinkQuality8192S @@ -51642,11 +50922,10 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { union recv_frame *precvframe = (union recv_frame *)prframe; -@@ -764,4 +763,114 @@ void rtl8192c_process_phy_info(_adapter - +@@ -765,3 +764,113 @@ void rtl8192c_process_phy_info(_adapter *padapter, void *prframe) } -+ + +void rtl8192c_translate_rx_signal_stuff(union recv_frame *precvframe, struct phy_stat *pphy_info) +{ + struct rx_pkt_attrib *pattrib = &precvframe->u.hdr.attrib; @@ -51756,7 +51035,9 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + +} + - ++ +diff --git a/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_sreset.c b/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_sreset.c +index e2817f3..1368d66 100644 --- a/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_sreset.c +++ b/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_sreset.c @@ -16,189 +16,10 @@ @@ -51950,7 +51231,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release void rtl8192c_sreset_xmit_status_check(_adapter *padapter) { HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter); -@@ -210,34 +31,44 @@ void rtl8192c_sreset_xmit_status_check(_ +@@ -210,34 +31,44 @@ void rtl8192c_sreset_xmit_status_check(_adapter *padapter) u32 txdma_status; if( (txdma_status=rtw_read32(padapter, REG_TXDMA_STATUS)) !=0x00){ DBG_871X("%s REG_TXDMA_STATUS:0x%08x\n", __FUNCTION__, txdma_status); @@ -52008,7 +51289,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release u32 regc50,regc58,reg824,reg800; regc50 = rtw_read32(padapter,0xc50); regc58 = rtw_read32(padapter,0xc58); -@@ -250,44 +81,14 @@ void rtl8192c_sreset_linked_status_check +@@ -250,44 +81,14 @@ void rtl8192c_sreset_linked_status_check(_adapter *padapter) { DBG_8192C("%s regc50:0x%08x, regc58:0x%08x, reg824:0x%08x, reg800:0x%08x,\n", __FUNCTION__, regc50, regc58, reg824, reg800); @@ -52058,6 +51339,9 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #endif -#endif +diff --git a/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_xmit.c b/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_xmit.c +new file mode 100644 +index 0000000..2cfd851 --- /dev/null +++ b/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_xmit.c @@ -0,0 +1,63 @@ @@ -52124,6 +51408,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release +} +#endif //CONFIG_XMIT_ACK + +diff --git a/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/Hal8192CUHWImg.c b/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/Hal8192CUHWImg.c +index 1615b5d..b49486b 100644 --- a/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/Hal8192CUHWImg.c +++ b/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/Hal8192CUHWImg.c @@ -24,9 +24,994 @@ @@ -53123,7 +52409,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release 0x61,0x80,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x02,0x43,0xba,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x02,0x5a,0x45,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -@@ -99,7 +1084,7 @@ u8 Rtl8192CUFwTSMCImgArray[TSMCImgArrayL +@@ -99,7 +1084,7 @@ u8 Rtl8192CUFwTSMCImgArray[TSMCImgArrayLength] = { 0x00,0x41,0x9e,0xae,0x00,0x41,0x9e,0x4d,0x80,0x41,0x9e,0x4e,0x80,0x41,0x9e,0xb0, 0x00,0x00,0xf0,0x90,0x9e,0x57,0xe0,0x90,0x9e,0x8a,0xf0,0xe4,0xfb,0xfd,0x7f,0x54, 0x7e,0x01,0xd3,0x10,0xaf,0x01,0xc3,0xc0,0xd0,0x90,0x9e,0x88,0xeb,0xf0,0xa3,0xe0, @@ -53132,7 +52418,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release 0x90,0x01,0x5f,0xe4,0xf0,0x90,0x01,0x3c,0x74,0x08,0xf0,0xe4,0x90,0x9e,0x89,0xf0, 0x90,0x9e,0x55,0xe0,0x90,0x9e,0x8a,0xf0,0xe4,0xfb,0xfd,0x7f,0x5c,0x7e,0x01,0x91, 0x62,0x90,0x01,0x5f,0x74,0x05,0xf0,0x90,0x06,0x92,0x74,0x02,0xf0,0x90,0x9e,0x5c, -@@ -111,7 +1096,7 @@ u8 Rtl8192CUFwTSMCImgArray[TSMCImgArrayL +@@ -111,7 +1096,7 @@ u8 Rtl8192CUFwTSMCImgArray[TSMCImgArrayLength] = { 0x22,0x22,0x00,0x02,0x60,0x8d,0x02,0x60,0x94,0xd3,0x10,0xaf,0x01,0xc3,0xc0,0xd0, 0x8b,0x1b,0x8a,0x1c,0x89,0x1d,0x90,0x9e,0x8b,0x71,0x8b,0xab,0x1e,0xaa,0x1f,0xa9, 0x20,0x90,0x9e,0x8e,0x71,0x8b,0xaf,0x21,0x15,0x21,0xef,0x60,0x1b,0x90,0x9e,0x8e, @@ -53141,7 +52427,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release 0x01,0x71,0x74,0xef,0x51,0x4d,0x80,0xde,0xab,0x1b,0xaa,0x1c,0xa9,0x1d,0xd0,0xd0, 0x92,0xaf,0x22,0x90,0x06,0xa9,0xe0,0xf5,0x50,0x54,0xc0,0x70,0x0d,0x90,0x9e,0x63, 0xe0,0x54,0xfe,0xf0,0xe0,0x54,0xfd,0xf0,0x91,0xd3,0xe5,0x50,0x30,0xe6,0x17,0x90, -@@ -168,21 +1153,21 @@ u8 Rtl8192CUFwTSMCImgArray[TSMCImgArrayL +@@ -168,21 +1153,21 @@ u8 Rtl8192CUFwTSMCImgArray[TSMCImgArrayLength] = { 0x60,0x0b,0x90,0x9e,0x77,0xe0,0xb4,0x01,0x10,0xe4,0xff,0x80,0x09,0x90,0x9e,0x77, 0xe0,0xb4,0x01,0x05,0x7f,0x01,0x12,0x77,0x66,0x22,0x90,0x01,0x37,0x74,0x02,0xf0, 0x90,0x05,0x22,0x74,0xff,0xf0,0x12,0x77,0x1c,0xef,0x70,0x06,0x90,0x01,0xc8,0x74, @@ -53176,7 +52462,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release 0x08,0xf4,0xff,0x90,0x00,0x43,0xe0,0x5f,0xf0,0xd3,0x10,0xaf,0x01,0xc3,0xc0,0xd0, 0x7f,0x10,0xdf,0xfe,0xd0,0xd0,0x92,0xaf,0x22,0xd3,0x10,0xaf,0x01,0xc3,0xc0,0xd0, 0x90,0x9e,0xad,0xed,0xf0,0x90,0x9e,0xac,0xef,0xf0,0xd3,0x94,0x07,0x50,0x63,0xe0, -@@ -205,15 +1190,15 @@ u8 Rtl8192CUFwTSMCImgArray[TSMCImgArrayL +@@ -205,15 +1190,15 @@ u8 Rtl8192CUFwTSMCImgArray[TSMCImgArrayLength] = { 0x02,0x61,0x7d,0x90,0x9e,0x1a,0x74,0x02,0xf0,0x90,0x00,0x48,0xe0,0x44,0x0c,0xfd, 0x7f,0x48,0x51,0xc1,0x90,0x00,0x47,0xe0,0x44,0x08,0xfd,0x7f,0x47,0x51,0xc1,0x90, 0x00,0x45,0xe0,0x44,0x10,0xfd,0x7f,0x45,0x80,0x71,0xe4,0x90,0x9e,0x1a,0xf0,0x90, @@ -53196,7 +52482,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release 0xf0,0x90,0x05,0x60,0xe0,0x90,0x9e,0x2a,0xf0,0x90,0x05,0x61,0xe0,0x90,0x9e,0x2b, 0xf0,0x90,0x05,0x62,0xe0,0x90,0x9e,0x2c,0xf0,0x90,0x05,0x63,0xe0,0x90,0x9e,0x2d, 0xf0,0xa2,0xaf,0xe4,0x33,0x90,0x9e,0x3f,0xf0,0xc2,0xaf,0x90,0x9e,0x1b,0xe0,0xff, -@@ -222,25 +1207,25 @@ u8 Rtl8192CUFwTSMCImgArray[TSMCImgArrayL +@@ -222,25 +1207,25 @@ u8 Rtl8192CUFwTSMCImgArray[TSMCImgArrayLength] = { 0x81,0x84,0xa2,0xaf,0xe4,0x33,0x90,0x9e,0x3f,0xf0,0xc2,0xaf,0x90,0x9e,0x2e,0x74, 0x01,0xf0,0x90,0x9e,0x3f,0xe0,0x24,0xff,0x92,0xaf,0x51,0xb8,0x90,0x00,0x46,0xe0, 0x44,0x01,0xfd,0x7f,0x46,0x51,0xc1,0x90,0x9e,0x14,0xe0,0x60,0x15,0x90,0x9e,0x20, @@ -53231,7 +52517,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release 0xc1,0x90,0x00,0x48,0xe0,0x44,0x0c,0xfd,0x7f,0x48,0x51,0xc1,0x90,0x00,0x46,0xe0, 0x44,0x10,0x80,0x1c,0x90,0x00,0x47,0xe0,0x54,0xf3,0xfd,0x7f,0x47,0x51,0xc1,0x90, 0x00,0x48,0xe0,0x54,0xf3,0xfd,0x7f,0x48,0x51,0xc1,0x90,0x00,0x46,0xe0,0x54,0xef, -@@ -256,13 +1241,13 @@ u8 Rtl8192CUFwTSMCImgArray[TSMCImgArrayL +@@ -256,13 +1241,13 @@ u8 Rtl8192CUFwTSMCImgArray[TSMCImgArrayLength] = { 0x46,0x51,0xc1,0x7f,0x02,0xf1,0xea,0x8f,0x26,0x90,0x01,0xc9,0xe5,0x26,0xf0,0xb4, 0x01,0x02,0xf1,0x2a,0x22,0x90,0x9e,0x1c,0xe0,0x64,0x01,0x60,0x02,0xc1,0xd7,0x90, 0x00,0x46,0xe0,0x44,0x01,0xfd,0x7f,0x46,0x51,0xc1,0x90,0x9e,0x2e,0xe0,0x70,0x31, @@ -53249,7 +52535,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release 0x90,0x05,0x87,0xe0,0x64,0x80,0xf0,0x90,0x9e,0x2a,0xe0,0x90,0x05,0x84,0xf0,0x90, 0x9e,0x2b,0xe0,0x90,0x05,0x85,0xf0,0x90,0x9e,0x2c,0xe0,0x90,0x05,0x86,0xf0,0x90, 0x9e,0x2d,0xe0,0x90,0x05,0x87,0xf0,0x22,0x90,0x05,0x60,0xe0,0x90,0x9e,0x2a,0xf0, -@@ -296,7 +1281,7 @@ u8 Rtl8192CUFwTSMCImgArray[TSMCImgArrayL +@@ -296,7 +1281,7 @@ u8 Rtl8192CUFwTSMCImgArray[TSMCImgArrayLength] = { 0x29,0x75,0x2a,0x03,0xf5,0x2b,0x90,0x01,0x30,0xe5,0x28,0xf0,0xa3,0xe5,0x29,0xf0, 0xa3,0xe5,0x2a,0xf0,0xa3,0xe5,0x2b,0xf0,0x22,0xe4,0x90,0x9e,0x31,0xf0,0xa3,0xf0, 0x75,0x8e,0x02,0x12,0x4f,0xda,0x12,0x5f,0xa9,0x12,0x5f,0xbc,0xe4,0xf5,0x12,0x12, @@ -53258,7 +52544,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release 0x90,0x00,0xf3,0xe0,0x30,0xe2,0x0d,0x90,0x05,0x41,0x74,0x10,0xf0,0x90,0x05,0x5a, 0xf0,0xa3,0xe4,0xf0,0x12,0x5f,0xf4,0x12,0x5f,0x91,0x12,0x44,0xfe,0x12,0x7d,0x1d, 0x90,0x9e,0x33,0xe5,0xd9,0xf0,0x12,0x4d,0x8b,0xc2,0xaf,0x90,0x00,0x80,0xe0,0x44, -@@ -353,7 +1338,7 @@ u8 Rtl8192CUFwTSMCImgArray[TSMCImgArrayL +@@ -353,7 +1338,7 @@ u8 Rtl8192CUFwTSMCImgArray[TSMCImgArrayLength] = { 0x43,0x6b,0x90,0x00,0x02,0x12,0x42,0x20,0xff,0x90,0x9e,0x48,0x12,0x43,0x6b,0x90, 0x00,0x01,0xef,0x12,0x42,0x5f,0x90,0x9e,0x41,0x12,0x43,0x6b,0x90,0x00,0x01,0x12, 0x42,0x20,0xff,0x90,0x9e,0x46,0xe0,0xfc,0xa3,0xe0,0xfd,0xf5,0x82,0x8c,0x83,0xef, @@ -53267,7 +52553,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release 0x9e,0x3f,0xe0,0xff,0x24,0x82,0xf5,0x82,0xe4,0x34,0x95,0xf5,0x83,0xee,0xf0,0x90, 0x9e,0x40,0xe0,0xfe,0x75,0xf0,0x09,0xef,0x90,0x96,0x4a,0x12,0x43,0x5f,0xee,0xf0, 0x75,0xf0,0x09,0xef,0x90,0x96,0x4b,0x12,0x43,0x5f,0x74,0x01,0xf0,0x90,0x9e,0x45, -@@ -389,10 +1374,10 @@ u8 Rtl8192CUFwTSMCImgArray[TSMCImgArrayL +@@ -389,10 +1374,10 @@ u8 Rtl8192CUFwTSMCImgArray[TSMCImgArrayLength] = { 0xe0,0xab,0x5d,0xaa,0x5e,0xa9,0x5f,0x12,0x42,0x4d,0x90,0x04,0x52,0xe0,0xab,0x5d, 0xaa,0x5e,0xa9,0x5f,0x90,0x00,0x01,0x12,0x42,0x5f,0x90,0x04,0x51,0xe0,0x85,0x5c, 0x82,0x85,0x5b,0x83,0xf0,0x90,0x04,0x50,0xe0,0x85,0x5c,0x82,0x85,0x5b,0x83,0xa3, @@ -53281,7 +52567,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release 0x00,0x01,0x12,0x42,0x20,0x5f,0xd0,0x01,0xd0,0x02,0xd0,0x03,0x12,0x42,0x4d,0x85, 0x5c,0x82,0x85,0x5b,0x83,0xc0,0x83,0xc0,0x82,0xe0,0xff,0x85,0x61,0x82,0x85,0x60, 0x83,0xe0,0xfe,0xef,0x5e,0xd0,0x82,0xd0,0x83,0xf0,0x85,0x5c,0x82,0x85,0x5b,0x83, -@@ -472,7 +1457,7 @@ u8 Rtl8192CUFwTSMCImgArray[TSMCImgArrayL +@@ -472,7 +1457,7 @@ u8 Rtl8192CUFwTSMCImgArray[TSMCImgArrayLength] = { 0x4d,0x31,0x76,0xe5,0x74,0x14,0x24,0xfd,0x50,0x02,0x80,0x45,0x90,0x9e,0x61,0xe0, 0x60,0x37,0x90,0x01,0x5b,0xe4,0xf0,0x90,0x01,0x3c,0x74,0x04,0xf0,0xd1,0x05,0xef, 0x64,0x01,0x70,0x2d,0x90,0x9e,0x55,0xe0,0xf5,0x44,0x75,0x45,0x00,0xe4,0xfb,0xfd, @@ -53290,7 +52576,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release 0x74,0x01,0xf0,0x90,0x9e,0x5d,0xf0,0x80,0x08,0xd1,0x05,0xbf,0x01,0x03,0x12,0x44, 0xd3,0xe5,0x2c,0x30,0xe1,0x20,0x90,0x01,0x34,0x74,0x02,0xf0,0x85,0xd1,0x13,0x85, 0xd2,0x14,0x85,0xd3,0x15,0x85,0xd4,0x16,0x85,0xd5,0x17,0x85,0xd6,0x18,0x85,0xd7, -@@ -515,12 +1500,12 @@ u8 Rtl8192CUFwTSMCImgArray[TSMCImgArrayL +@@ -515,12 +1500,12 @@ u8 Rtl8192CUFwTSMCImgArray[TSMCImgArrayLength] = { 0x01,0xef,0x12,0x42,0x5f,0x7f,0xaf,0x7e,0x01,0xf1,0x3b,0xef,0x60,0x49,0x90,0x9e, 0x91,0x12,0x43,0x6b,0x8b,0x1e,0x8a,0x1f,0x89,0x20,0x75,0x21,0x02,0x7b,0x01,0x7a, 0x01,0x79,0xa0,0x12,0x45,0x09,0x90,0x9e,0x94,0x12,0x43,0x6b,0x8b,0x1e,0x8a,0x1f, @@ -53305,7 +52591,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release 0xe0,0x60,0x06,0x7d,0x01,0x7f,0x0c,0x80,0x0f,0x90,0x9e,0x5e,0xe0,0x54,0x0f,0xc3, 0x94,0x04,0x50,0x07,0x7d,0x01,0x7f,0x04,0x12,0x47,0x1a,0xe4,0xff,0x12,0x48,0x8f, 0x22,0xd1,0x05,0xef,0x64,0x01,0x60,0x08,0x90,0x01,0xb9,0x74,0x01,0xf0,0x80,0x32, -@@ -532,7 +1517,7 @@ u8 Rtl8192CUFwTSMCImgArray[TSMCImgArrayL +@@ -532,7 +1517,7 @@ u8 Rtl8192CUFwTSMCImgArray[TSMCImgArrayLength] = { 0x9e,0xa0,0xe0,0xfe,0xa3,0xe0,0xf5,0x82,0x8e,0x83,0xe0,0x60,0x2d,0xc3,0x90,0x9e, 0xa3,0xe0,0x94,0xe8,0x90,0x9e,0xa2,0xe0,0x94,0x03,0x40,0x0b,0x90,0x01,0xc6,0xe0, 0x44,0x10,0xf0,0x7f,0x00,0x80,0x15,0x90,0x9e,0xa2,0xe4,0x75,0xf0,0x01,0x12,0x42, @@ -53314,7 +52600,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release 0x22,0x75,0x30,0x1f,0x75,0x31,0x01,0xe4,0xf5,0x32,0x90,0x01,0x38,0xe5,0x30,0xf0, 0xa3,0xe5,0x31,0xf0,0xa3,0xe5,0x32,0xf0,0x22,0x90,0x00,0x02,0xe0,0x54,0xe0,0x90, 0x9e,0x75,0x60,0x04,0x74,0x01,0xf0,0x22,0x74,0x02,0xf0,0x22,0x90,0x00,0xf3,0xe0, -@@ -558,7 +1543,7 @@ u8 Rtl8192CUFwTSMCImgArray[TSMCImgArrayL +@@ -558,7 +1543,7 @@ u8 Rtl8192CUFwTSMCImgArray[TSMCImgArrayLength] = { 0x9e,0x5b,0x74,0x05,0xf0,0xe4,0x90,0x9e,0x54,0xf0,0x90,0x9e,0x4f,0xf0,0x90,0x9e, 0x76,0xf0,0x22,0xe4,0x90,0x9e,0x62,0xf0,0x90,0x9e,0x51,0xf0,0x90,0x9e,0x63,0xf0, 0x22,0x8b,0x59,0x8a,0x5a,0x89,0x5b,0x31,0x03,0xab,0x59,0xaa,0x5a,0xa9,0x5b,0x12, @@ -53323,7 +52609,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release 0x40,0x7f,0x01,0x80,0x3a,0xab,0x59,0xaa,0x5a,0xa9,0x5b,0x90,0x00,0x02,0x12,0x42, 0x20,0xfd,0xe4,0xff,0x31,0x72,0x80,0x27,0xab,0x59,0xaa,0x5a,0xa9,0x5b,0x90,0x00, 0x02,0x12,0x42,0x20,0xfd,0x7f,0x01,0x31,0x72,0x1f,0x80,0x13,0xab,0x59,0xaa,0x5a, -@@ -567,13 +1552,13 @@ u8 Rtl8192CUFwTSMCImgArray[TSMCImgArrayL +@@ -567,13 +1552,13 @@ u8 Rtl8192CUFwTSMCImgArray[TSMCImgArrayLength] = { 0x80,0x16,0xed,0x70,0x0a,0x90,0x9e,0x5b,0xe0,0x90,0x9e,0x5f,0xf0,0x80,0x05,0x90, 0x9e,0x5f,0xed,0xf0,0x90,0x9e,0x5f,0xe0,0x90,0x9e,0x50,0xf0,0x22,0xd3,0x10,0xaf, 0x01,0xc3,0xc0,0xd0,0x90,0x00,0x01,0x12,0x42,0x20,0x90,0x9e,0x61,0xf0,0x90,0x00, @@ -53341,7 +52627,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release 0x90,0x9e,0x58,0xe0,0xa3,0xe0,0x90,0x05,0x58,0xf0,0xe5,0x73,0x30,0xe0,0x1b,0x90, 0x9e,0x52,0xe0,0x70,0x1a,0xe0,0x04,0xf0,0x90,0x9e,0x5e,0xe0,0x54,0x0f,0xc3,0x94, 0x04,0x50,0x0c,0x7d,0x01,0x7f,0x04,0x02,0x47,0x1a,0xe4,0x90,0x9e,0x52,0xf0,0x22, -@@ -600,17 +1585,17 @@ u8 Rtl8192CUFwTSMCImgArray[TSMCImgArrayL +@@ -600,17 +1585,17 @@ u8 Rtl8192CUFwTSMCImgArray[TSMCImgArrayLength] = { 0xf0,0x22,0x90,0x9e,0xaf,0xef,0xf0,0x71,0xb0,0x90,0x9e,0xaf,0xe0,0x60,0x05,0x90, 0x05,0x22,0xe4,0xf0,0x90,0x9e,0x5e,0xe0,0x54,0xf0,0xf0,0xe0,0x44,0x04,0xf0,0x22, 0x90,0x00,0x11,0xe0,0x44,0x09,0xf0,0x12,0x49,0xb9,0x90,0x9d,0xff,0x12,0x43,0x53, @@ -53367,7 +52653,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release 0xd3,0x90,0x9e,0xa9,0xe0,0x94,0x32,0x90,0x9e,0xa8,0xe0,0x94,0x00,0x40,0xb9,0x90, 0x01,0xc7,0xe0,0x30,0xe0,0xb2,0x22,0x90,0x9e,0x5e,0xe0,0x54,0xf0,0xf0,0xe0,0x44, 0x01,0xf0,0x12,0x44,0xff,0x12,0x45,0x00,0xe0,0x54,0xf0,0xf0,0xe0,0x44,0x02,0xf0, -@@ -717,21 +1702,21 @@ u8 Rtl8192CUFwTSMCImgArray[TSMCImgArrayL +@@ -717,21 +1702,21 @@ u8 Rtl8192CUFwTSMCImgArray[TSMCImgArrayLength] = { 0x93,0xff,0xd3,0x90,0x9e,0x3b,0xe0,0x9f,0x90,0x9e,0x3a,0xe0,0x94,0x00,0x40,0x09, 0xe4,0xfd,0xaf,0x59,0x12,0x67,0xb1,0xe1,0x2c,0xe5,0x59,0x25,0xe0,0x24,0xc2,0xf5, 0x82,0xe4,0x34,0x95,0xf5,0x83,0xe0,0xf5,0x61,0xa3,0xe0,0xf5,0x62,0xab,0x5b,0xaa, @@ -53396,7 +52682,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release 0x0c,0xe5,0x62,0x9f,0xf5,0x62,0xe5,0x61,0x9e,0xf5,0x61,0x80,0x05,0xe4,0xf5,0x61, 0xf5,0x62,0xe5,0x59,0x25,0xe0,0x24,0xc2,0xf5,0x82,0xe4,0x34,0x95,0xf5,0x83,0xe5, 0x61,0xf0,0xa3,0xe5,0x62,0xf0,0x90,0x9e,0x34,0xe0,0x25,0xe0,0x24,0x66,0xf5,0x82, -@@ -766,11 +1751,11 @@ u8 Rtl8192CUFwTSMCImgArray[TSMCImgArrayL +@@ -766,11 +1751,11 @@ u8 Rtl8192CUFwTSMCImgArray[TSMCImgArrayLength] = { 0x5f,0xe0,0xb4,0x01,0x10,0xe4,0xf5,0x63,0x74,0xe6,0x25,0x59,0xf5,0x82,0xe4,0x34, 0x9c,0xf5,0x83,0xe4,0xf0,0xad,0x63,0xc1,0xfb,0xec,0x64,0x06,0x60,0x02,0xe1,0x00, 0xf5,0x61,0xf5,0x62,0x90,0x42,0x13,0x93,0xff,0x7e,0x00,0x90,0x9e,0x38,0xe0,0xfc, @@ -53410,7 +52696,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release 0xe0,0x95,0x62,0x90,0x9e,0x36,0xe0,0x95,0x61,0x40,0x07,0x05,0x5a,0xe5,0x5a,0xb4, 0x05,0xbd,0xe5,0x5a,0xc3,0x13,0xf5,0x5a,0xe5,0x63,0xb4,0x01,0x06,0xe5,0x5a,0x70, 0x46,0x80,0x13,0xe5,0x63,0xb4,0x03,0x15,0xe5,0x5a,0x70,0x05,0x75,0x63,0x03,0x80, -@@ -819,36 +1804,36 @@ u8 Rtl8192CUFwTSMCImgArray[TSMCImgArrayL +@@ -819,36 +1804,36 @@ u8 Rtl8192CUFwTSMCImgArray[TSMCImgArrayLength] = { 0x90,0x96,0x49,0x12,0x43,0x5f,0xe4,0xf0,0xed,0xc3,0x94,0x20,0x50,0x0f,0x74,0x84, 0x2d,0xf5,0x82,0xe4,0x34,0x04,0xf5,0x83,0x74,0x13,0xf0,0x80,0x0d,0x74,0xa6,0x2d, 0xf5,0x82,0xe4,0x34,0x9c,0xf5,0x83,0x74,0x13,0xf0,0x0d,0xed,0x64,0x40,0x60,0x03, @@ -53456,7 +52742,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release 0x90,0x9e,0x44,0xef,0xf0,0xd3,0x94,0x07,0x50,0x4f,0xa3,0xe0,0x70,0x1a,0x90,0x9e, 0x44,0xe0,0xff,0x74,0x01,0xa8,0x07,0x08,0x80,0x02,0xc3,0x33,0xd8,0xfc,0xf4,0xff, 0x90,0x00,0x47,0xe0,0x5f,0xf0,0x80,0x17,0x90,0x9e,0x44,0xe0,0xff,0x74,0x01,0xa8, -@@ -875,24 +1860,24 @@ u8 Rtl8192CUFwTSMCImgArray[TSMCImgArrayL +@@ -875,24 +1860,24 @@ u8 Rtl8192CUFwTSMCImgArray[TSMCImgArrayLength] = { 0x80,0x1a,0xc3,0x74,0x03,0x95,0x61,0x24,0x66,0xf8,0xe6,0xff,0xe5,0x61,0x7c,0x00, 0x25,0x65,0xfd,0xec,0x35,0x64,0x8d,0x82,0xf5,0x83,0xef,0xf0,0x05,0x61,0x80,0xba, 0xc3,0xe5,0x64,0x94,0x10,0x40,0x02,0xa1,0x93,0x90,0x9e,0x40,0xe0,0x64,0x04,0x60, @@ -53494,7 +52780,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release 0x75,0x5a,0x80,0x80,0x05,0xe4,0xf5,0x59,0xf5,0x5a,0xe5,0x5e,0xc3,0x13,0x90,0xfd, 0x10,0xf0,0x74,0x20,0x25,0x5b,0xf5,0x5b,0xad,0x5a,0xe5,0x5b,0x2d,0xff,0x24,0x01, 0xf5,0x82,0xe4,0x34,0xfc,0xf5,0x83,0xe0,0x90,0x9e,0x6d,0xf0,0x74,0x02,0x2f,0xf5, -@@ -902,8 +1887,8 @@ u8 Rtl8192CUFwTSMCImgArray[TSMCImgArrayL +@@ -902,8 +1887,8 @@ u8 Rtl8192CUFwTSMCImgArray[TSMCImgArrayLength] = { 0x83,0xe0,0xfe,0x74,0x6c,0x2f,0xf5,0x82,0xe4,0x34,0x9e,0xf5,0x83,0xee,0xf0,0x0f, 0xbf,0x08,0xe0,0x91,0x0e,0xef,0x70,0x3f,0x90,0x01,0xc3,0xe0,0x60,0x25,0xc3,0xe5, 0x60,0x94,0xe8,0xe5,0x5f,0x94,0x03,0x40,0x09,0x90,0x01,0xc6,0xe0,0x44,0x10,0xf0, @@ -53505,7 +52791,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release 0x80,0x43,0x74,0xff,0xf0,0x80,0x3e,0xe5,0x5b,0xb4,0x78,0x23,0xe4,0xf5,0x5b,0x05, 0x5e,0xe5,0x5a,0x64,0x80,0x45,0x59,0x70,0x06,0xf5,0x59,0xf5,0x5a,0x80,0x06,0x75, 0x59,0x00,0x75,0x5a,0x80,0xe5,0x5e,0xc3,0x13,0x90,0xfd,0x10,0xf0,0x80,0x06,0x74, -@@ -912,4208 +1897,146 @@ u8 Rtl8192CUFwTSMCImgArray[TSMCImgArrayL +@@ -912,4208 +1897,146 @@ u8 Rtl8192CUFwTSMCImgArray[TSMCImgArrayLength] = { 0xe4,0xa3,0xf0,0xa3,0xf0,0xa3,0xf0,0x22,0xe4,0xf5,0x25,0x22,0xe4,0x90,0x9e,0xaa, 0xf0,0xa3,0xf0,0x90,0x05,0xf8,0xe0,0x70,0x0f,0xa3,0xe0,0x70,0x0b,0xa3,0xe0,0x70, 0x07,0xa3,0xe0,0x70,0x03,0x7f,0x01,0x22,0xd3,0x90,0x9e,0xab,0xe0,0x94,0xe8,0x90, @@ -57848,7 +57134,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release 0x05,0x04,0x03,0x02,0x00,0x03,0x06,0x05,0x04,0x03,0x00,0x04,0x06,0x05,0x04,0x02, 0x00,0x04,0x08,0x07,0x06,0x04,0x00,0x06,0x0a,0x09,0x08,0x06,0x00,0x08,0x0a,0x09, 0x08,0x04,0x00,0x08,0x0a,0x09,0x08,0x02,0x00,0x08,0x0a,0x09,0x08,0x00,0x00,0x08, -@@ -5168,7 +2091,7 @@ u8 Rtl8192CUFwUMCBCutImgArray[UMCBCutImg +@@ -5168,7 +2091,7 @@ u8 Rtl8192CUFwUMCBCutImgArray[UMCBCutImgArrayLength] = { 0x15,0x82,0x70,0x02,0x15,0x83,0xe0,0xfa,0x38,0xf0,0x22,0xeb,0xf0,0xa3,0xea,0xf0, 0xa3,0xe9,0xf0,0x22,0xd0,0x83,0xd0,0x82,0xf8,0xe4,0x93,0x70,0x12,0x74,0x01,0x93, 0x70,0x0d,0xa3,0xa3,0x93,0xf8,0x74,0x01,0x93,0xf5,0x82,0x88,0x83,0xe4,0x73,0x74, @@ -57857,7 +57143,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release 0xe4,0x93,0xa3,0xf8,0xe4,0x93,0xa3,0x40,0x03,0xf6,0x80,0x01,0xf2,0x08,0xdf,0xf4, 0x80,0x29,0xe4,0x93,0xa3,0xf8,0x54,0x07,0x24,0x0c,0xc8,0xc3,0x33,0xc4,0x54,0x0f, 0x44,0x20,0xc8,0x83,0x40,0x04,0xf4,0x56,0x80,0x01,0x46,0xf6,0xdf,0xe4,0x80,0x0b, -@@ -5176,833 +2099,797 @@ u8 Rtl8192CUFwUMCBCutImgArray[UMCBCutImg +@@ -5176,833 +2099,797 @@ u8 Rtl8192CUFwUMCBCutImgArray[UMCBCutImgArrayLength] = { 0xbc,0xa3,0xff,0x54,0x3f,0x30,0xe5,0x09,0x54,0x1f,0xfe,0xe4,0x93,0xa3,0x60,0x01, 0x0e,0xcf,0x54,0xc0,0x25,0xe0,0x60,0xa8,0x40,0xb8,0xe4,0x93,0xa3,0xfa,0xe4,0x93, 0xa3,0xf8,0xe4,0x93,0xa3,0xc8,0xc5,0x82,0xc8,0xca,0xc5,0x83,0xca,0xf0,0xa3,0xc8, @@ -59464,7 +58750,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release 0x90,0x9d,0xfb,0x12,0x43,0x53,0x90,0x80,0x85,0x12,0x2a,0x7f,0x7f,0x8c,0x7e,0x08, 0x12,0x2f,0xd9,0x90,0x9d,0xa7,0x12,0x43,0x53,0x90,0x80,0x85,0x12,0x2a,0x7f,0x7f, 0x44,0x7e,0x08,0x12,0x2f,0xd9,0x90,0x9d,0xab,0x12,0x43,0x53,0x90,0x80,0x85,0x12, -@@ -6030,1114 +2917,3136 @@ u8 Rtl8192CUFwUMCBCutImgArray[UMCBCutImg +@@ -6030,1114 +2917,3136 @@ u8 Rtl8192CUFwUMCBCutImgArray[UMCBCutImgArrayLength] = { 0x43,0x53,0x90,0x80,0x85,0x12,0x2a,0x7f,0x7f,0x0c,0x7e,0x09,0x12,0x2f,0xd9,0x90, 0x9d,0xf7,0x12,0x43,0x53,0x90,0x80,0x85,0x12,0x2a,0x7f,0x7f,0x04,0x7e,0x08,0x12, 0x2f,0xd9,0x90,0x9e,0x0f,0x74,0x01,0xf0,0x22,0x90,0x9e,0x0f,0xe0,0x64,0x01,0x60, @@ -63706,7 +62992,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release u32 Rtl8192CUPHY_REG_2TArray[PHY_REG_2TArrayLength] = { 0x024,0x0011800f, -@@ -7146,7 +6055,7 @@ u32 Rtl8192CUPHY_REG_2TArray[PHY_REG_2TA +@@ -7146,7 +6055,7 @@ u32 Rtl8192CUPHY_REG_2TArray[PHY_REG_2TArrayLength] = { 0x804,0x00000003, 0x808,0x0000fc00, 0x80c,0x0000000a, @@ -63715,7 +63001,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release 0x814,0x020c3d10, 0x818,0x02200385, 0x81c,0x00000000, -@@ -7220,22 +6129,22 @@ u32 Rtl8192CUPHY_REG_2TArray[PHY_REG_2TA +@@ -7220,22 +6129,22 @@ u32 Rtl8192CUPHY_REG_2TArray[PHY_REG_2TArrayLength] = { 0xc44,0x000100b7, 0xc48,0xec020107, 0xc4c,0x007f037f, @@ -63742,7 +63028,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release 0xc90,0x00121820, 0xc94,0x00000000, 0xc98,0x00121820, -@@ -7336,7 +6245,7 @@ u32 Rtl8192CUPHY_REG_1TArray[PHY_REG_1TA +@@ -7336,7 +6245,7 @@ u32 Rtl8192CUPHY_REG_1TArray[PHY_REG_1TArrayLength] = { 0x804,0x00000001, 0x808,0x0000fc00, 0x80c,0x0000000a, @@ -63751,7 +63037,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release 0x814,0x020c3d10, 0x818,0x02200385, 0x81c,0x00000000, -@@ -7410,9 +6319,9 @@ u32 Rtl8192CUPHY_REG_1TArray[PHY_REG_1TA +@@ -7410,9 +6319,9 @@ u32 Rtl8192CUPHY_REG_1TArray[PHY_REG_1TArrayLength] = { 0xc44,0x000100b7, 0xc48,0xec020107, 0xc4c,0x007f037f, @@ -63763,7 +63049,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release 0xc5c,0x433c0094, 0xc60,0x00000000, 0xc64,0x5116848b, -@@ -7450,7 +6359,7 @@ u32 Rtl8192CUPHY_REG_1TArray[PHY_REG_1TA +@@ -7450,7 +6359,7 @@ u32 Rtl8192CUPHY_REG_1TArray[PHY_REG_1TArrayLength] = { 0xce4,0x00000000, 0xce8,0x37644302, 0xcec,0x2f97d40c, @@ -63772,7 +63058,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release 0xd04,0x00020401, 0xd08,0x0000907f, 0xd0c,0x20010201, -@@ -7771,7 +6680,7 @@ u32 Rtl8192CUPHY_REG_1T_HPArray[PHY_REG_ +@@ -7771,7 +6680,7 @@ u32 Rtl8192CUPHY_REG_1T_HPArray[PHY_REG_1T_HPArrayLength] = { 0x804,0x00000001, 0x808,0x0000fc00, 0x80c,0x0000000a, @@ -63781,7 +63067,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release 0x814,0x020c3d10, 0x818,0x02200385, 0x81c,0x00000000, -@@ -7885,7 +6794,7 @@ u32 Rtl8192CUPHY_REG_1T_HPArray[PHY_REG_ +@@ -7885,7 +6794,7 @@ u32 Rtl8192CUPHY_REG_1T_HPArray[PHY_REG_1T_HPArrayLength] = { 0xce4,0x00000000, 0xce8,0x37644302, 0xcec,0x2f97d40c, @@ -63790,7 +63076,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release 0xd04,0x00020401, 0xd08,0x0000907f, 0xd0c,0x20010201, -@@ -7962,7 +6871,7 @@ u32 Rtl8192CUPHY_REG_1T_mCardArray[PHY_R +@@ -7962,7 +6871,7 @@ u32 Rtl8192CUPHY_REG_1T_mCardArray[PHY_REG_1T_mCardArrayLength] = { 0x804,0x00000001, 0x808,0x0000fc00, 0x80c,0x0000000a, @@ -63799,7 +63085,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release 0x814,0x020c3d10, 0x818,0x02200385, 0x81c,0x00000000, -@@ -8036,9 +6945,9 @@ u32 Rtl8192CUPHY_REG_1T_mCardArray[PHY_R +@@ -8036,9 +6945,9 @@ u32 Rtl8192CUPHY_REG_1T_mCardArray[PHY_REG_1T_mCardArrayLength] = { 0xc44,0x000100b7, 0xc48,0xec020107, 0xc4c,0x007f037f, @@ -63811,7 +63097,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release 0xc5c,0x433c0094, 0xc60,0x00000000, 0xc64,0x5116848b, -@@ -8076,7 +6985,7 @@ u32 Rtl8192CUPHY_REG_1T_mCardArray[PHY_R +@@ -8076,7 +6985,7 @@ u32 Rtl8192CUPHY_REG_1T_mCardArray[PHY_REG_1T_mCardArrayLength] = { 0xce4,0x00000000, 0xce8,0x37644302, 0xcec,0x2f97d40c, @@ -63820,7 +63106,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release 0xd04,0x00020401, 0xd08,0x0000907f, 0xd0c,0x20010201, -@@ -8152,7 +7061,7 @@ u32 Rtl8192CUPHY_REG_2T_mCardArray[PHY_R +@@ -8152,7 +7061,7 @@ u32 Rtl8192CUPHY_REG_2T_mCardArray[PHY_REG_2T_mCardArrayLength] = { 0x804,0x00000003, 0x808,0x0000fc00, 0x80c,0x0000000a, @@ -63829,7 +63115,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release 0x814,0x020c3d10, 0x818,0x02200385, 0x81c,0x00000000, -@@ -8226,22 +7135,22 @@ u32 Rtl8192CUPHY_REG_2T_mCardArray[PHY_R +@@ -8226,22 +7135,22 @@ u32 Rtl8192CUPHY_REG_2T_mCardArray[PHY_REG_2T_mCardArrayLength] = { 0xc44,0x000100b7, 0xc48,0xec020107, 0xc4c,0x007f037f, @@ -63856,7 +63142,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release 0xc90,0x00121820, 0xc94,0x00000000, 0xc98,0x00121820, -@@ -8784,6 +7693,192 @@ u32 Rtl8192CURadioB_1TArray[RadioB_1TArr +@@ -8784,6 +7693,192 @@ u32 Rtl8192CURadioB_1TArray[RadioB_1TArrayLength] = { 0x0, }; @@ -64049,7 +63335,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release u32 Rtl8192CURadioA_1T_mCardArray[RadioA_1T_mCardArrayLength] = { 0x000,0x00030159, 0x001,0x00031284, -@@ -9043,7 +8138,7 @@ u32 Rtl8192CURadioA_1T_HPArray[RadioA_1T +@@ -9043,7 +8138,7 @@ u32 Rtl8192CURadioA_1T_HPArray[RadioA_1T_HPArrayLength] = { 0x013,0x00028fb4, 0x013,0x00024fa8, 0x013,0x000207a4, @@ -64058,7 +63344,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release 0x013,0x000183a4, 0x013,0x00014398, 0x013,0x000101a4, -@@ -9078,7 +8173,7 @@ u32 Rtl8192CURadioA_1T_HPArray[RadioA_1T +@@ -9078,7 +8173,7 @@ u32 Rtl8192CURadioA_1T_HPArray[RadioA_1T_HPArrayLength] = { u32 Rtl8192CURadioB_GM_Array[RadioB_GM_ArrayLength] = { 0x0, }; @@ -64067,7 +63353,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release u32 Rtl8192CUMAC_2T_Array[MAC_2T_ArrayLength] = { 0x420,0x00000080, 0x423,0x00000000, -@@ -9153,10 +8248,11 @@ u32 Rtl8192CUMAC_2T_Array[MAC_2T_ArrayLe +@@ -9153,10 +8248,11 @@ u32 Rtl8192CUMAC_2T_Array[MAC_2T_ArrayLength] = { 0x608,0x0000000e, 0x609,0x0000002a, 0x652,0x00000020, @@ -64083,6 +63369,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release 0x66e,0x00000005, 0x700,0x00000021, 0x701,0x00000043, +diff --git a/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/rtl8192cu_led.c b/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/rtl8192cu_led.c +index f39b4cb..0d7af4a 100644 --- a/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/rtl8192cu_led.c +++ b/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/rtl8192cu_led.c @@ -16,8 +16,7 @@ @@ -65296,6 +64584,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } +diff --git a/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/rtl8192cu_recv.c b/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/rtl8192cu_recv.c +index 4285d60..1119cf8 100644 --- a/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/rtl8192cu_recv.c +++ b/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/rtl8192cu_recv.c @@ -16,8 +16,7 @@ @@ -65308,7 +64598,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #define _RTL8192CU_RECV_C_ #include #include -@@ -150,12 +149,7 @@ int rtl8192cu_init_recv_priv(_adapter *p +@@ -150,12 +149,7 @@ int rtl8192cu_init_recv_priv(_adapter *padapter) for(i=0; ifree_recv_skb_queue)); } @@ -65340,7 +64630,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #endif -@@ -232,149 +226,4 @@ void rtl8192cu_free_recv_priv (_adapter +@@ -232,149 +226,4 @@ void rtl8192cu_free_recv_priv (_adapter *padapter) } @@ -65490,6 +64780,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - -} +diff --git a/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/rtl8192cu_xmit.c b/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/rtl8192cu_xmit.c +index c276b51..3a4137b 100644 --- a/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/rtl8192cu_xmit.c +++ b/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/rtl8192cu_xmit.c @@ -16,8 +16,7 @@ @@ -65502,7 +64794,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #define _RTL8192C_XMIT_C_ #include #include -@@ -95,7 +94,7 @@ u32 rtw_get_ff_hwaddr(struct xmit_frame +@@ -95,7 +94,7 @@ u32 rtw_get_ff_hwaddr(struct xmit_frame *pxmitframe) int urb_zero_packet_chk(_adapter *padapter, int sz) { int blnSetTxDescOffset; @@ -65511,7 +64803,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if ( pdvobj->ishighspeed ) { -@@ -165,7 +164,7 @@ void fill_txdesc_sectype(struct pkt_attr +@@ -165,7 +164,7 @@ void fill_txdesc_sectype(struct pkt_attrib *pattrib, struct tx_desc *ptxdesc) } @@ -65520,7 +64812,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { //DBG_8192C("cvs_mode=%d\n", pattrib->vcs_mode); -@@ -182,14 +181,27 @@ void fill_txdesc_vcs(struct pkt_attrib * +@@ -182,14 +181,27 @@ void fill_txdesc_vcs(struct pkt_attrib *pattrib, u32 *pdw) break; } @@ -65530,12 +64822,12 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - } + if(pattrib->vcs_mode) { + *pdw |= cpu_to_le32(BIT(13)); -+ + + // Set RTS BW + if(pattrib->ht_en) + { + *pdw |= (pattrib->bwmode&HT_CHANNEL_WIDTH_40)? cpu_to_le32(BIT(27)):0; - ++ + if(pattrib->ch_offset == HAL_PRIME_CHNL_OFFSET_LOWER) + *pdw |= cpu_to_le32((0x01<<28)&0x30000000); + else if(pattrib->ch_offset == HAL_PRIME_CHNL_OFFSET_UPPER) @@ -65553,7 +64845,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { //DBG_8192C("bwmode=%d, ch_off=%d\n", pattrib->bwmode, pattrib->ch_offset); -@@ -198,220 +210,17 @@ void fill_txdesc_phy(struct pkt_attrib * +@@ -198,220 +210,17 @@ void fill_txdesc_phy(struct pkt_attrib *pattrib, u32 *pdw) *pdw |= (pattrib->bwmode&HT_CHANNEL_WIDTH_40)? cpu_to_le32(BIT(25)):0; if(pattrib->ch_offset == HAL_PRIME_CHNL_OFFSET_LOWER) @@ -65566,10 +64858,9 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release *pdw |= 0; else - *pdw |= cpu_to_le32((0x03<<20)&0x003f0000); -+ *pdw |= cpu_to_le32((0x03<<20)&0x00300000); - } - } - +- } +-} +- -#ifdef CONFIG_USB_TX_AGGREGATION -static void _update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, int sz) -{ @@ -65767,18 +65058,19 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - { - ptxdesc->txdw4 |= cpu_to_le32(BIT(7)); // Hw set sequence number - ptxdesc->txdw3 |= cpu_to_le32((8 <<28)); //set bit3 to 1. Suugested by TimChen. 2009.12.29. -- } ++ *pdw |= cpu_to_le32((0x03<<20)&0x00300000); + } - - rtl8192cu_cal_txdesc_chksum(ptxdesc); --} + } -#endif -- + -static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz) +static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz, u8 bagg_pkt) { int pull=0; uint qsel; -@@ -422,17 +231,19 @@ static s32 update_txdesc(struct xmit_fra +@@ -422,17 +231,19 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz) struct dm_priv *pdmpriv = &pHalData->dmpriv; struct tx_desc *ptxdesc = (struct tx_desc *)pmem; struct ht_priv *phtpriv = &pmlmepriv->htpriv; @@ -65800,7 +65092,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } #endif // CONFIG_USE_USB_BUFFER_ALLOC_TX -@@ -452,14 +263,13 @@ static s32 update_txdesc(struct xmit_fra +@@ -452,14 +263,13 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz) fill_txdesc_sectype(pattrib, ptxdesc); @@ -65816,7 +65108,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release //offset 12 ptxdesc->txdw3 |= cpu_to_le32((pattrib->seqnum<<16)&0xffff0000); -@@ -480,26 +290,9 @@ static s32 update_txdesc(struct xmit_fra +@@ -480,26 +290,9 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz) ptxdesc->txdw5 |= cpu_to_le32(0x0001ff00);// //ptxdesc->txdw5 |= cpu_to_le32(0x0000000b);//DataRate - 54M @@ -65844,7 +65136,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if(0)//for driver dbg { ptxdesc->txdw4 |= cpu_to_le32(BIT(8));//driver uses rate -@@ -521,20 +314,13 @@ static s32 update_txdesc(struct xmit_fra +@@ -521,20 +314,13 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz) ptxdesc->txdw4 |= cpu_to_le32(BIT(8));//driver uses rate @@ -65868,7 +65160,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #ifdef CONFIG_TCP_CSUM_OFFLOAD_TX if ( pattrib->hw_tcp_csum == 1 ) { // ptxdesc->txdw6 = 0; // clear TCP_CHECKSUM and IP_CHECKSUM. It's zero already!! -@@ -559,6 +345,15 @@ static s32 update_txdesc(struct xmit_fra +@@ -559,6 +345,15 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz) //fill_txdesc_sectype(pattrib, ptxdesc); //offset 8 @@ -65884,7 +65176,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release //offset 12 ptxdesc->txdw3 |= cpu_to_le32((pattrib->seqnum<<16)&0xffff0000); -@@ -569,26 +364,34 @@ static s32 update_txdesc(struct xmit_fra +@@ -569,26 +364,34 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz) //offset 20 ptxdesc->txdw5 |= cpu_to_le32(BIT(17));//retry limit enable if(pattrib->retry_ctrl == _TRUE) @@ -65930,7 +65222,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } else if((pxmitframe->frame_tag&0x0f) == TXAGG_FRAMETAG) { -@@ -618,6 +421,7 @@ static s32 update_txdesc(struct xmit_fra +@@ -618,6 +421,7 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz) ptxdesc->txdw4 |= cpu_to_le32(BIT(8));//driver uses rate //offset 20 @@ -65938,7 +65230,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } // 2009.11.05. tynli_test. Suggested by SD4 Filen for FW LPS. -@@ -647,7 +451,14 @@ static s32 update_txdesc(struct xmit_fra +@@ -647,7 +451,14 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz) RT_TRACE(_module_rtl871x_xmit_c_,_drv_info_,("offset0-txdesc=0x%x\n", ptxdesc->txdw0)); //offset 4 @@ -65954,7 +65246,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release rtl8192cu_cal_txdesc_chksum(ptxdesc); -@@ -655,8 +466,10 @@ static s32 update_txdesc(struct xmit_fra +@@ -655,8 +466,10 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz) } @@ -65966,7 +65258,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release int t, sz, w_sz, pull=0; u8 *mem_addr; u32 ff_hwaddr; -@@ -679,6 +492,9 @@ static void _rtw_dump_xframe(_adapter *p +@@ -679,6 +492,9 @@ static void _rtw_dump_xframe(_adapter *padapter, struct xmit_frame *pxmitframe, for (t = 0; t < pattrib->nr_frags; t++) { @@ -65976,7 +65268,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if (t != (pattrib->nr_frags - 1)) { RT_TRACE(_module_rtl871x_xmit_c_,_drv_err_,("pattrib->nr_frags=%d\n", pattrib->nr_frags)); -@@ -691,7 +507,7 @@ static void _rtw_dump_xframe(_adapter *p +@@ -691,7 +507,7 @@ static void _rtw_dump_xframe(_adapter *padapter, struct xmit_frame *pxmitframe, sz = pattrib->last_txcmdsz; } @@ -65985,7 +65277,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if(pull) { -@@ -709,10 +525,7 @@ static void _rtw_dump_xframe(_adapter *p +@@ -709,10 +525,7 @@ static void _rtw_dump_xframe(_adapter *padapter, struct xmit_frame *pxmitframe, ff_hwaddr = rtw_get_ff_hwaddr(pxmitframe); @@ -65997,7 +65289,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release rtw_count_tx_stats(padapter, pxmitframe, sz); -@@ -726,18 +539,12 @@ static void _rtw_dump_xframe(_adapter *p +@@ -726,18 +539,12 @@ static void _rtw_dump_xframe(_adapter *padapter, struct xmit_frame *pxmitframe, } @@ -66020,7 +65312,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } #ifdef CONFIG_USB_TX_AGGREGATION -@@ -767,7 +574,7 @@ s32 rtl8192cu_xmitframe_complete(_adapte +@@ -767,7 +574,7 @@ s32 rtl8192cu_xmitframe_complete(_adapter *padapter, struct xmit_priv *pxmitpriv struct xmit_frame *pfirstframe = NULL; // aggregate variable @@ -66029,7 +65321,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release struct sta_info *psta = NULL; struct tx_servq *ptxservq = NULL; -@@ -801,7 +608,7 @@ s32 rtl8192cu_xmitframe_complete(_adapte +@@ -801,7 +608,7 @@ s32 rtl8192cu_xmitframe_complete(_adapter *padapter, struct xmit_priv *pxmitpriv //3 1. pick up first frame do { @@ -66038,7 +65330,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release pxmitframe = rtw_dequeue_xframe(pxmitpriv, pxmitpriv->hwxmits, pxmitpriv->hwxmit_entry); if (pxmitframe == NULL) { -@@ -816,7 +623,7 @@ s32 rtl8192cu_xmitframe_complete(_adapte +@@ -816,7 +623,7 @@ s32 rtl8192cu_xmitframe_complete(_adapter *padapter, struct xmit_priv *pxmitpriv RT_TRACE(_module_rtl8192c_xmit_c_, _drv_err_, ("xmitframe_complete: frame tag(%d) is not DATA_FRAMETAG(%d)!\n", pxmitframe->frame_tag, DATA_FRAMETAG)); @@ -66047,7 +65339,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release continue; } -@@ -826,7 +633,7 @@ s32 rtl8192cu_xmitframe_complete(_adapte +@@ -826,7 +633,7 @@ s32 rtl8192cu_xmitframe_complete(_adapter *padapter, struct xmit_priv *pxmitpriv RT_TRACE(_module_rtl8192c_xmit_c_, _drv_err_, ("xmitframe_complete: TID(%d) should be 0~15!\n", pxmitframe->attrib.priority)); @@ -66056,7 +65348,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release continue; } #endif -@@ -838,15 +645,12 @@ s32 rtl8192cu_xmitframe_complete(_adapte +@@ -838,15 +645,12 @@ s32 rtl8192cu_xmitframe_complete(_adapter *padapter, struct xmit_priv *pxmitpriv //pxmitframe->agg_num = 1; // alloc xmitframe should assign to 1. pxmitframe->pkt_offset = 1; // first frame of aggregation, reserve offset @@ -66076,7 +65368,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release // always return ndis_packet after rtw_xmitframe_coalesce rtw_os_xmit_complete(padapter, pxmitframe); -@@ -876,26 +680,26 @@ s32 rtl8192cu_xmitframe_complete(_adapte +@@ -876,26 +680,26 @@ s32 rtl8192cu_xmitframe_complete(_adapter *padapter, struct xmit_priv *pxmitpriv case 1: case 2: ptxservq = &(psta->sta_xmitpriv.bk_q); @@ -66107,7 +65399,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release break; } -@@ -913,6 +717,7 @@ s32 rtl8192cu_xmitframe_complete(_adapte +@@ -913,6 +717,7 @@ s32 rtl8192cu_xmitframe_complete(_adapter *padapter, struct xmit_priv *pxmitpriv rtw_list_delete(&pxmitframe->list); ptxservq->qcnt--; @@ -66115,7 +65407,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #ifndef IDEA_CONDITION // suppose only data frames would be in queue -@@ -920,7 +725,7 @@ s32 rtl8192cu_xmitframe_complete(_adapte +@@ -920,7 +725,7 @@ s32 rtl8192cu_xmitframe_complete(_adapter *padapter, struct xmit_priv *pxmitpriv RT_TRACE(_module_rtl8192c_xmit_c_, _drv_err_, ("xmitframe_complete: frame tag(%d) is not DATA_FRAMETAG(%d)!\n", pxmitframe->frame_tag, DATA_FRAMETAG)); @@ -66124,7 +65416,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release continue; } -@@ -930,7 +735,7 @@ s32 rtl8192cu_xmitframe_complete(_adapte +@@ -930,7 +735,7 @@ s32 rtl8192cu_xmitframe_complete(_adapter *padapter, struct xmit_priv *pxmitpriv RT_TRACE(_module_rtl8192c_xmit_c_, _drv_err_, ("xmitframe_complete: TID(%d) should be 0~15!\n", pxmitframe->attrib.priority)); @@ -66133,7 +65425,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release continue; } #endif -@@ -941,24 +746,20 @@ s32 rtl8192cu_xmitframe_complete(_adapte +@@ -941,24 +746,20 @@ s32 rtl8192cu_xmitframe_complete(_adapter *padapter, struct xmit_priv *pxmitpriv pxmitframe->agg_num = 0; // not first frame of aggregation pxmitframe->pkt_offset = 0; // not first frame of aggregation, no need to reserve offset @@ -66163,7 +65455,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release // handle pointer and stop condition pbuf_tail = pbuf + len; -@@ -998,7 +799,7 @@ s32 rtl8192cu_xmitframe_complete(_adapte +@@ -998,7 +799,7 @@ s32 rtl8192cu_xmitframe_complete(_adapter *padapter, struct xmit_priv *pxmitpriv pfirstframe->pkt_offset = 0; } #endif // CONFIG_USE_USB_BUFFER_ALLOC_TX @@ -66172,7 +65464,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release //3 4. write xmit buffer to USB FIFO ff_hwaddr = rtw_get_ff_hwaddr(pfirstframe); -@@ -1013,7 +814,7 @@ s32 rtl8192cu_xmitframe_complete(_adapte +@@ -1013,7 +814,7 @@ s32 rtl8192cu_xmitframe_complete(_adapter *padapter, struct xmit_priv *pxmitpriv rtw_count_tx_stats(padapter, pfirstframe, pbuf_tail); @@ -66181,7 +65473,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return _TRUE; } -@@ -1063,7 +864,7 @@ s32 rtl8192cu_xmitframe_complete(_adapte +@@ -1063,7 +864,7 @@ s32 rtl8192cu_xmitframe_complete(_adapter *padapter, struct xmit_priv *pxmitpriv } rtw_os_xmit_complete(padapter, pxmitframe);//always return ndis_packet after rtw_xmitframe_coalesce @@ -66190,7 +65482,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release RT_TRACE(_module_rtl871x_xmit_c_,_drv_info_,("xmitframe_complete(): rtw_dump_xframe\n")); -@@ -1071,12 +872,12 @@ s32 rtl8192cu_xmitframe_complete(_adapte +@@ -1071,12 +872,12 @@ s32 rtl8192cu_xmitframe_complete(_adapter *padapter, struct xmit_priv *pxmitpriv if(res == _SUCCESS) { @@ -66205,7 +65497,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } xcnt++; -@@ -1125,15 +926,22 @@ static s32 pre_xmitframe(_adapter *padap +@@ -1125,15 +926,22 @@ static s32 pre_xmitframe(_adapter *padapter, struct xmit_frame *pxmitframe) struct xmit_priv *pxmitpriv = &padapter->xmitpriv; struct pkt_attrib *pattrib = &pxmitframe->attrib; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; @@ -66230,7 +65522,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release pxmitbuf = rtw_alloc_xmitbuf(pxmitpriv); if (pxmitbuf == NULL) -@@ -1147,7 +955,7 @@ static s32 pre_xmitframe(_adapter *padap +@@ -1147,7 +955,7 @@ static s32 pre_xmitframe(_adapter *padapter, struct xmit_frame *pxmitframe) if (xmitframe_direct(padapter, pxmitframe) != _SUCCESS) { rtw_free_xmitbuf(pxmitpriv, pxmitbuf); @@ -66260,7 +65552,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } /* -@@ -1184,6 +992,30 @@ s32 rtl8192cu_hal_xmit(_adapter *padapte +@@ -1184,6 +992,30 @@ s32 rtl8192cu_hal_xmit(_adapter *padapter, struct xmit_frame *pxmitframe) return pre_xmitframe(padapter, pxmitframe); } @@ -66291,7 +65583,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #ifdef CONFIG_HOSTAPD_MLME static void rtl8192cu_hostap_mgnt_xmit_cb(struct urb *urb) -@@ -1193,7 +1025,7 @@ static void rtl8192cu_hostap_mgnt_xmit_c +@@ -1193,7 +1025,7 @@ static void rtl8192cu_hostap_mgnt_xmit_cb(struct urb *urb) //DBG_8192C("%s\n", __FUNCTION__); @@ -66300,7 +65592,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #endif } -@@ -1211,7 +1043,7 @@ s32 rtl8192cu_hostap_mgnt_xmit_entry(_ad +@@ -1211,7 +1043,7 @@ s32 rtl8192cu_hostap_mgnt_xmit_entry(_adapter *padapter, _pkt *pkt) struct hostapd_priv *phostapdpriv = padapter->phostapdpriv; struct net_device *pnetdev = padapter->pnetdev; HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter); @@ -66309,7 +65601,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release //DBG_8192C("%s\n", __FUNCTION__); -@@ -1226,11 +1058,7 @@ s32 rtl8192cu_hostap_mgnt_xmit_entry(_ad +@@ -1226,11 +1058,7 @@ s32 rtl8192cu_hostap_mgnt_xmit_entry(_adapter *padapter, _pkt *pkt) if ((fc & RTW_IEEE80211_FCTL_FTYPE) != RTW_IEEE80211_FTYPE_MGMT) goto _exit; @@ -66322,7 +65614,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if(!pxmit_skb) goto _exit; -@@ -1311,7 +1139,7 @@ s32 rtl8192cu_hostap_mgnt_xmit_entry(_ad +@@ -1311,7 +1139,7 @@ s32 rtl8192cu_hostap_mgnt_xmit_entry(_adapter *padapter, _pkt *pkt) _exit: @@ -66331,6 +65623,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #endif +diff --git a/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/usb_halinit.c b/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/usb_halinit.c +index 6cac2d5..ff89473 100644 --- a/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/usb_halinit.c +++ b/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/usb_halinit.c @@ -16,7 +16,7 @@ @@ -66471,7 +65765,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if((value8 >> USB_NORMAL_SIE_EP_SHIFT) & USB_NORMAL_SIE_EP_MASK){ pHalData->OutEpQueueSel |= TX_SELE_NQ; pHalData->OutEpNumber++; -@@ -328,38 +262,18 @@ static BOOLEAN HalUsbSetQueuePipeMapping +@@ -328,38 +262,18 @@ static BOOLEAN HalUsbSetQueuePipeMapping8192CUsb( { HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pAdapter); BOOLEAN result = _FALSE; @@ -66515,7 +65809,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return result; -@@ -368,7 +282,7 @@ static BOOLEAN HalUsbSetQueuePipeMapping +@@ -368,7 +282,7 @@ static BOOLEAN HalUsbSetQueuePipeMapping8192CUsb( void rtl8192cu_interface_configure(_adapter *padapter) { HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter); @@ -66524,7 +65818,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if (pdvobjpriv->ishighspeed == _TRUE) { -@@ -399,8 +313,13 @@ void rtl8192cu_interface_configure(_adap +@@ -399,8 +313,13 @@ void rtl8192cu_interface_configure(_adapter *padapter) pHalData->UsbRxAggPageTimeout = 0x4; //6, absolute time = 34ms/(2^6) #endif @@ -66540,7 +65834,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } -@@ -570,7 +489,6 @@ static void _InitPABias(_adapter *padapt +@@ -570,7 +489,6 @@ static void _InitPABias(_adapter *padapter) { HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter); u8 pa_setting; @@ -66548,7 +65842,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release BOOLEAN is92C = IS_92C_SERIAL(pHalData->VersionID); //FIXED PA current issue -@@ -581,19 +499,19 @@ static void _InitPABias(_adapter *padapt +@@ -581,19 +499,19 @@ static void _InitPABias(_adapter *padapter) if(!(pa_setting & BIT0)) { @@ -66905,7 +66199,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release u8 is92C = IS_92C_SERIAL(pHalData->VersionID); rt_rf_power_state eRfPowerStateToSet; #ifdef CONFIG_BT_COEXIST -@@ -2244,7 +2035,6 @@ HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_DOW +@@ -2244,7 +2035,6 @@ HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_DOWNLOAD_FW); //HalDetectPwrDownMode(Adapter); // 2010/08/26 MH If Efuse does not support sective suspend then disable the function. //HalDetectSelectiveSuspendMode(Adapter); @@ -66913,7 +66207,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release // Set RF type for BB/RF configuration _InitRFType(Adapter);//->_ReadRFType() -@@ -2258,8 +2048,7 @@ HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_INI +@@ -2258,8 +2048,7 @@ HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_INIT_LLTT); boundary = TX_PAGE_BOUNDARY; } else{// for WMM @@ -66923,7 +66217,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } status = InitLLTTable(Adapter, boundary); if(status == _FAIL){ -@@ -2281,7 +2070,7 @@ HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_MIS +@@ -2281,7 +2070,7 @@ HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_MISC02); _InitDriverInfoSize(Adapter, DRVINFO_SZ); _InitInterrupt(Adapter); @@ -66932,7 +66226,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release _InitNetworkType(Adapter);//set msr _InitWMACSetting(Adapter); _InitAdaptiveCtrl(Adapter); -@@ -2340,16 +2129,16 @@ HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_RF) +@@ -2340,16 +2129,16 @@ HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_RF); if(IS_VENDOR_UMC_A_CUT(pHalData->VersionID) && !IS_92C_SERIAL(pHalData->VersionID)) { @@ -66953,7 +66247,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_TURN_ON_BLOCK); _BBTurnOnBlock(Adapter); -@@ -2424,7 +2213,7 @@ HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_MIS +@@ -2424,7 +2213,7 @@ HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_MISC11); // Those action will be discard in MgntActSet_RF_State because off the same state //for(eRFPath = 0; eRFPath NumTotalRFPath; eRFPath++) @@ -66962,7 +66256,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } else if(pwrctrlpriv->rfoff_reason > RF_CHANGE_BY_PS) { // H/W or S/W RF OFF before sleep. -@@ -2462,7 +2251,7 @@ HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_MIS +@@ -2462,7 +2251,7 @@ HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_MISC11); pwrctrlpriv->rfoff_reason = 0; pwrctrlpriv->b_hw_radio_off = _FALSE; pwrctrlpriv->rf_pwrstate = rf_on; @@ -66971,7 +66265,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } -@@ -2478,7 +2267,7 @@ HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_MIS +@@ -2478,7 +2267,7 @@ HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_MISC11); // our HW will be set in power-down mode if PDn source from all functions are configured. // 2010.10.06. // @@ -66980,7 +66274,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release //{ // u1bTmp = rtw_read8(Adapter, REG_MULTI_FUNC_CTRL); // rtw_write8(Adapter, REG_MULTI_FUNC_CTRL, (u1bTmp|WL_HWPDN_EN)); -@@ -2572,23 +2361,20 @@ HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_INI +@@ -2572,23 +2361,20 @@ HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_INIT_HAL_DM); HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_MISC31); rtw_write8(Adapter, 0x15, 0xe9);//suggest by Johnny for lower temperature @@ -67256,7 +66550,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release //reset BB value16 = rtw_read16(Adapter, REG_SYS_FUNC_EN); value16 &= ~(FEN_BBRSTB | FEN_BB_GLB_RSTn); -@@ -3072,11 +2857,12 @@ e. SYS_FUNC_EN 0x02[7:0] = 0x14 //reset +@@ -3072,11 +2857,12 @@ e. SYS_FUNC_EN 0x02[7:0] = 0x14 //reset BB state machine ***************************************/ u8 eRFPath = 0,value8 = 0; rtw_write8(Adapter, REG_TXPAUSE, 0xFF); @@ -67271,7 +66565,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release value8 = 0 ; value8 |=( FEN_USBD | FEN_USBA | FEN_BB_GLB_RSTn); rtw_write8(Adapter, REG_SYS_FUNC_EN,value8 );//0x16 -@@ -3435,7 +3221,7 @@ unsigned int rtl8192cu_inirp_init(PADAPT +@@ -3435,7 +3221,7 @@ unsigned int rtl8192cu_inirp_init(PADAPTER Adapter) u8 i; struct recv_buf *precvbuf; uint status; @@ -67280,7 +66574,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release struct intf_hdl * pintfhdl=&Adapter->iopriv.intf; struct recv_priv *precvpriv = &(Adapter->recvpriv); u32 (*_read_port)(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *pmem); -@@ -3498,69 +3284,6 @@ unsigned int rtl8192cu_inirp_deinit(PADA +@@ -3498,69 +3284,6 @@ unsigned int rtl8192cu_inirp_deinit(PADAPTER Adapter) return _SUCCESS; } @@ -67499,7 +66793,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release // readAdapterInfo_8723U(Adapter); //else readAdapterInfo_8192CU(Adapter); -@@ -4287,7 +3977,7 @@ static int _ReadAdapterInfo8192CU(PADAPT +@@ -4287,7 +3977,7 @@ static int _ReadAdapterInfo8192CU(PADAPTER Adapter) //Efuse_InitSomeVar(Adapter); @@ -67508,7 +66802,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release // _EfuseCellSel(Adapter); _ReadRFType(Adapter);//rf_chip -> _InitRFType() -@@ -4339,20 +4029,8 @@ static void ResumeTxBeacon(_adapter *pad +@@ -4339,20 +4029,8 @@ static void ResumeTxBeacon(_adapter *padapter) // 2010.03.01. Marked by tynli. No need to call workitem beacause we record the value // which should be read from register to a global variable. @@ -67531,7 +66825,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } static void StopTxBeacon(_adapter *padapter) -@@ -4362,19 +4040,8 @@ static void StopTxBeacon(_adapter *padap +@@ -4362,19 +4040,8 @@ static void StopTxBeacon(_adapter *padapter) // 2010.03.01. Marked by tynli. No need to call workitem beacause we record the value // which should be read from register to a global variable. @@ -67873,7 +67167,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release content=0; } DBG_8192C("\nrtw_wowlan_set_pattern offset[0] content 0x%x [cpu_to_le32 0x%x]\n", content,__cpu_to_le32(content)); -@@ -4624,6 +4553,374 @@ void rtw_wowlan_reload_pattern(_adapter +@@ -4624,6 +4553,374 @@ void rtw_wowlan_reload_pattern(_adapter *padapter){ } #endif //CONFIG_WOWLAN @@ -68578,11 +67872,11 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + case HW_VAR_ON_RCR_AM: + rtw_write32(Adapter, REG_RCR, rtw_read32(Adapter, REG_RCR)|RCR_AM); + DBG_871X("%s, %d, RCR= %x \n", __FUNCTION__,__LINE__, rtw_read32(Adapter, REG_RCR)); -+ break; + break; + case HW_VAR_OFF_RCR_AM: + rtw_write32(Adapter, REG_RCR, rtw_read32(Adapter, REG_RCR)& (~RCR_AM)); + DBG_871X("%s, %d, RCR= %x \n", __FUNCTION__,__LINE__, rtw_read32(Adapter, REG_RCR)); - break; ++ break; + case HW_VAR_BEACON_INTERVAL: rtw_write16(Adapter, REG_BCN_INTERVAL, *((u16 *)val)); @@ -68811,7 +68105,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release default: //RT_TRACE(COMP_INIT, DBG_WARNING, ("GetHalDefVar8192CUsb(): Unkown variable: %d!\n", eVariable)); bResult = _FALSE; -@@ -5724,6 +5924,7 @@ void _update_response_rate(_adapter *pad +@@ -5724,6 +5924,7 @@ void _update_response_rate(_adapter *padapter,unsigned int mask) // Set RRSR rate table. rtw_write8(padapter, REG_RRSR, mask&0xff); rtw_write8(padapter,REG_RRSR+1, (mask>>8)&0xff); @@ -68819,7 +68113,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release // Set RTS initial rate while(mask > 0x1) -@@ -5766,6 +5967,9 @@ void UpdateHalRAMask8192CUsb(PADAPTER pa +@@ -5766,6 +5967,9 @@ void UpdateHalRAMask8192CUsb(PADAPTER padapter, u32 mac_id) switch (mac_id) { case 0:// for infra mode @@ -68829,7 +68123,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release supportRateNum = rtw_get_rateset_len(cur_network->SupportedRates); networkType = judge_network_type(padapter, cur_network->SupportedRates, supportRateNum) & 0xf; //pmlmeext->cur_wireless_mode = networkType; -@@ -5796,17 +6000,29 @@ void UpdateHalRAMask8192CUsb(PADAPTER pa +@@ -5796,17 +6000,29 @@ void UpdateHalRAMask8192CUsb(PADAPTER padapter, u32 mac_id) break; default: //for each sta in IBSS @@ -68869,7 +68163,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } #ifdef CONFIG_BT_COEXIST -@@ -5942,6 +6158,7 @@ static void rtl8192cu_init_default_value +@@ -5942,6 +6158,7 @@ static void rtl8192cu_init_default_value(_adapter * padapter) for(i = 0; i < HP_THERMAL_NUM; i++) pdmpriv->ThermalValue_HP[i] = 0; } @@ -68877,7 +68171,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release static u8 rtl8192cu_ps_func(PADAPTER Adapter,HAL_INTF_PS_FUNC efunc_id, u8 *val) { u8 bResult = _TRUE; -@@ -5949,10 +6166,10 @@ static u8 rtl8192cu_ps_func(PADAPTER Ada +@@ -5949,10 +6166,10 @@ static u8 rtl8192cu_ps_func(PADAPTER Adapter,HAL_INTF_PS_FUNC efunc_id, u8 *val) #if defined(CONFIG_AUTOSUSPEND) && defined(SUPPORT_HW_RFOFF_DETECTED) case HAL_USB_SELECT_SUSPEND: @@ -68890,7 +68184,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release break; #endif //CONFIG_AUTOSUSPEND && SUPPORT_HW_RFOFF_DETECTED -@@ -5961,6 +6178,7 @@ static u8 rtl8192cu_ps_func(PADAPTER Ada +@@ -5961,6 +6178,7 @@ static u8 rtl8192cu_ps_func(PADAPTER Adapter,HAL_INTF_PS_FUNC efunc_id, u8 *val) } return bResult; } @@ -68942,6 +68236,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release rtl8192c_set_hal_ops(pHalFunc); _func_exit_; +diff --git a/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/usb_ops_ce.c b/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/usb_ops_ce.c +index 4d01b3c..9523337 100644 --- a/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/usb_ops_ce.c +++ b/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/usb_ops_ce.c @@ -16,8 +16,7 @@ @@ -68963,6 +68259,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #if 1 +diff --git a/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/usb_ops_linux.c b/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/usb_ops_linux.c +index d6f3376..2d627d3 100644 --- a/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/usb_ops_linux.c +++ b/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/usb_ops_linux.c @@ -16,8 +16,7 @@ @@ -69021,7 +68319,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release unsigned int pipe; int status = 0; -@@ -84,6 +53,16 @@ static int usbctrl_vendorreq(struct dvob +@@ -84,6 +53,16 @@ static int usbctrl_vendorreq(struct dvobj_priv *pdvobjpriv, u8 request, u16 val u8 tmp_buf[MAX_USB_IO_CTL_SIZE]; #endif @@ -69038,7 +68336,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release //DBG_871X("%s %s:%d\n",__FUNCTION__, current->comm, current->pid); if((padapter->bSurpriseRemoved) ||(padapter->pwrctrlpriv.pnp_bstop_trx)){ -@@ -153,7 +132,7 @@ static int usbctrl_vendorreq(struct dvob +@@ -153,7 +132,7 @@ static int usbctrl_vendorreq(struct dvobj_priv *pdvobjpriv, u8 request, u16 val if ( status == len) // Success this control transfer. { @@ -69047,7 +68345,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if ( requesttype == 0x01 ) { // For Control read transfer, we have to copy the read data from pIo_buf to pdata. _rtw_memcpy( pdata, pIo_buf, len ); -@@ -186,7 +165,7 @@ static int usbctrl_vendorreq(struct dvob +@@ -186,7 +165,7 @@ static int usbctrl_vendorreq(struct dvobj_priv *pdvobjpriv, u8 request, u16 val } } @@ -69056,7 +68354,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release padapter->bSurpriseRemoved = _TRUE; break; } -@@ -220,8 +199,7 @@ static u8 usb_read8(struct intf_hdl *pin +@@ -220,8 +199,7 @@ static u8 usb_read8(struct intf_hdl *pintfhdl, u32 addr) u16 wvalue; u16 index; u16 len; @@ -69066,7 +68364,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release _func_enter_; -@@ -232,7 +210,7 @@ static u8 usb_read8(struct intf_hdl *pin +@@ -232,7 +210,7 @@ static u8 usb_read8(struct intf_hdl *pintfhdl, u32 addr) wvalue = (u16)(addr&0x0000ffff); len = 1; @@ -69075,7 +68373,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release _func_exit_; -@@ -248,7 +226,6 @@ static u16 usb_read16(struct intf_hdl *p +@@ -248,7 +226,6 @@ static u16 usb_read16(struct intf_hdl *pintfhdl, u32 addr) u16 index; u16 len; u32 data=0; @@ -69083,7 +68381,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release _func_enter_; -@@ -259,7 +236,7 @@ static u16 usb_read16(struct intf_hdl *p +@@ -259,7 +236,7 @@ static u16 usb_read16(struct intf_hdl *pintfhdl, u32 addr) wvalue = (u16)(addr&0x0000ffff); len = 2; @@ -69092,7 +68390,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release _func_exit_; -@@ -275,7 +252,6 @@ static u32 usb_read32(struct intf_hdl *p +@@ -275,7 +252,6 @@ static u32 usb_read32(struct intf_hdl *pintfhdl, u32 addr) u16 index; u16 len; u32 data=0; @@ -69100,7 +68398,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release _func_enter_; -@@ -286,7 +262,7 @@ static u32 usb_read32(struct intf_hdl *p +@@ -286,7 +262,7 @@ static u32 usb_read32(struct intf_hdl *pintfhdl, u32 addr) wvalue = (u16)(addr&0x0000ffff); len = 4; @@ -69109,7 +68407,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release _func_exit_; -@@ -303,7 +279,6 @@ static int usb_write8(struct intf_hdl *p +@@ -303,7 +279,6 @@ static int usb_write8(struct intf_hdl *pintfhdl, u32 addr, u8 val) u16 len; u32 data; int ret; @@ -69117,7 +68415,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release _func_enter_; -@@ -317,7 +292,7 @@ static int usb_write8(struct intf_hdl *p +@@ -317,7 +292,7 @@ static int usb_write8(struct intf_hdl *pintfhdl, u32 addr, u8 val) data = val; data = cpu_to_le32(data&0x000000ff); @@ -69126,7 +68424,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release _func_exit_; -@@ -334,7 +309,6 @@ static int usb_write16(struct intf_hdl * +@@ -334,7 +309,6 @@ static int usb_write16(struct intf_hdl *pintfhdl, u32 addr, u16 val) u16 len; u32 data; int ret; @@ -69134,7 +68432,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release _func_enter_; -@@ -348,7 +322,7 @@ static int usb_write16(struct intf_hdl * +@@ -348,7 +322,7 @@ static int usb_write16(struct intf_hdl *pintfhdl, u32 addr, u16 val) data = val; data = cpu_to_le32(data&0x0000ffff); @@ -69143,7 +68441,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release _func_exit_; -@@ -365,7 +339,6 @@ static int usb_write32(struct intf_hdl * +@@ -365,7 +339,6 @@ static int usb_write32(struct intf_hdl *pintfhdl, u32 addr, u32 val) u16 len; u32 data; int ret; @@ -69151,7 +68449,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release _func_enter_; -@@ -378,14 +351,14 @@ static int usb_write32(struct intf_hdl * +@@ -378,14 +351,14 @@ static int usb_write32(struct intf_hdl *pintfhdl, u32 addr, u32 val) data = cpu_to_le32(val); @@ -69168,7 +68466,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release static int usb_writeN(struct intf_hdl *pintfhdl, u32 addr, u32 length, u8 *pdata) { u8 request; -@@ -395,7 +368,6 @@ static int usb_writeN(struct intf_hdl *p +@@ -395,7 +368,6 @@ static int usb_writeN(struct intf_hdl *pintfhdl, u32 addr, u32 length, u8 *pdata u16 len; u8 buf[VENDOR_CMD_MAX_DATA_LEN]={0}; int ret; @@ -69176,7 +68474,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release _func_enter_; -@@ -407,7 +379,7 @@ static int usb_writeN(struct intf_hdl *p +@@ -407,7 +379,7 @@ static int usb_writeN(struct intf_hdl *pintfhdl, u32 addr, u32 length, u8 *pdata len = length; _rtw_memcpy(buf, pdata, len ); @@ -69185,7 +68483,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release _func_exit_; -@@ -415,271 +387,6 @@ static int usb_writeN(struct intf_hdl *p +@@ -415,271 +387,6 @@ static int usb_writeN(struct intf_hdl *pintfhdl, u32 addr, u32 length, u8 *pdata } @@ -69457,7 +68755,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #ifdef CONFIG_USB_INTERRUPT_IN_PIPE static void usb_read_interrupt_complete(struct urb *purb, struct pt_regs *regs) { -@@ -731,8 +438,8 @@ static u32 usb_read_interrupt(struct int +@@ -731,8 +438,8 @@ static u32 usb_read_interrupt(struct intf_hdl *pintfhdl, u32 addr) int err; unsigned int pipe; u32 ret = _SUCCESS; @@ -69693,7 +68991,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter); struct recv_priv *precvpriv = &padapter->recvpriv; _queue *pfree_recv_queue = &precvpriv->free_recv_queue; -@@ -795,28 +705,41 @@ static int recvbuf2recvframe(_adapter *p +@@ -795,28 +705,41 @@ static int recvbuf2recvframe(_adapter *padapter, struct recv_buf *precvbuf) ("recvbuf2recvframe: rxdesc=offsset 0:0x%08x, 4:0x%08x, 8:0x%08x, C:0x%08x\n", prxstat->rxdw0, prxstat->rxdw1, prxstat->rxdw2, prxstat->rxdw4)); @@ -69701,9 +68999,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - pkt_len = le32_to_cpu(prxstat->rxdw0)&0x00003fff; - + prxstat = (struct recv_stat *)pbuf; - -- mf = (le32_to_cpu(prxstat->rxdw1) >> 27) & 0x1;//more fragment bit -- frag = (le32_to_cpu(prxstat->rxdw2) >> 12) & 0xf;//fragmentation number ++ + precvframe = rtw_alloc_recvframe(pfree_recv_queue); + if(precvframe==NULL) + { @@ -69716,11 +69012,13 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + precvframe->u.hdr.precvbuf = NULL; //can't access the precvbuf for new arch. + precvframe->u.hdr.len=0; +- mf = (le32_to_cpu(prxstat->rxdw1) >> 27) & 0x1;//more fragment bit +- frag = (le32_to_cpu(prxstat->rxdw2) >> 12) & 0xf;//fragmentation number ++ rtl8192c_query_rx_desc_status(precvframe, prxstat); + - drvinfo_sz = (le32_to_cpu(prxstat->rxdw0) & 0x000f0000) >> 16; - drvinfo_sz = drvinfo_sz << 3;//uint (2^3) = 8 bytes; REG_RX_DRVINFO_SZ - RT_TRACE(_module_rtl871x_recv_c_,_drv_info_,("recvbuf2recvframe: DRV_INFO_SIZE=%d\n", drvinfo_sz)); -+ rtl8192c_query_rx_desc_status(precvframe, prxstat); -+ + pattrib = &precvframe->u.hdr.attrib; + if(pattrib->physt) + { @@ -69747,7 +69045,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { shift_sz = 6; } -@@ -825,23 +748,11 @@ static int recvbuf2recvframe(_adapter *p +@@ -825,23 +748,11 @@ static int recvbuf2recvframe(_adapter *padapter, struct recv_buf *precvbuf) shift_sz = 0; } @@ -69773,7 +69071,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release //alloc_sz = 1664; //1664 is 128 alignment. if(skb_len <= 1650) alloc_sz = 1664; -@@ -854,27 +765,24 @@ static int recvbuf2recvframe(_adapter *p +@@ -854,27 +765,24 @@ static int recvbuf2recvframe(_adapter *padapter, struct recv_buf *precvbuf) // 8 is for skb->data 4 bytes alignment. alloc_sz += 14; } @@ -69809,13 +69107,17 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release //precvframe->u.hdr.rx_head = precvframe->u.hdr.rx_data = precvframe->u.hdr.rx_tail = pbuf; //precvframe->u.hdr.rx_end = pbuf + (pkt_offset>1612?pkt_offset:1612); -@@ -903,13 +811,30 @@ static int recvbuf2recvframe(_adapter *p +@@ -901,15 +809,32 @@ static int recvbuf2recvframe(_adapter *padapter, struct recv_buf *precvbuf) + default: + break; } - #endif - +-#endif +- - //because the endian issue, driver avoid reference to the rxstat after calling update_recvframe_attrib_from_recvstat(); - rtl8192cu_update_recvframe_attrib_from_recvstat(precvframe, prxstat); - ++#endif ++ +#ifdef CONFIG_CONCURRENT_MODE + if(rtw_buddy_adapter_up(padapter)) + { @@ -69843,7 +69145,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release pkt_cnt--; transfer_len -= pkt_offset; -@@ -924,7 +849,7 @@ static int recvbuf2recvframe(_adapter *p +@@ -924,7 +849,7 @@ static int recvbuf2recvframe(_adapter *padapter, struct recv_buf *precvbuf) _exit_recvbuf2recvframe: @@ -69852,7 +69154,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } void rtl8192cu_recv_tasklet(void *priv) -@@ -977,7 +902,7 @@ static void usb_read_port_complete(struc +@@ -977,7 +902,7 @@ static void usb_read_port_complete(struct urb *purb, struct pt_regs *regs) } else { @@ -69861,7 +69163,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release precvbuf->transfer_len = purb->actual_length; -@@ -993,7 +918,7 @@ static void usb_read_port_complete(struc +@@ -993,7 +918,7 @@ static void usb_read_port_complete(struct urb *purb, struct pt_regs *regs) DBG_8192C("###=> usb_read_port_complete => urb status(%d)\n", purb->status); @@ -69870,7 +69172,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release padapter->bSurpriseRemoved = _TRUE; } -@@ -1009,6 +934,10 @@ static void usb_read_port_complete(struc +@@ -1009,6 +934,10 @@ static void usb_read_port_complete(struct urb *purb, struct pt_regs *regs) RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_read_port_complete:bDriverStopped=TRUE\n")); break; case -EPROTO: @@ -69881,7 +69183,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #ifdef DBG_CONFIG_ERROR_DETECT { HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter); -@@ -1037,10 +966,10 @@ static u32 usb_read_port(struct intf_hdl +@@ -1037,10 +966,10 @@ static u32 usb_read_port(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *rmem) int err; unsigned int pipe; u32 ret = _SUCCESS; @@ -69914,7 +69216,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter); struct recv_priv *precvpriv = &padapter->recvpriv; _queue *pfree_recv_queue = &precvpriv->free_recv_queue; -@@ -1116,7 +1047,7 @@ static int recvbuf2recvframe(_adapter *p +@@ -1116,7 +1047,7 @@ static int recvbuf2recvframe(_adapter *padapter, _pkt *pskb) prxstat = (struct recv_stat *)pbuf; pkt_cnt = (le32_to_cpu(prxstat->rxdw2)>>16) & 0xff; @@ -69923,7 +69225,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #if 0 //temp remove when disable usb rx aggregation if((pkt_cnt > 10) || (pkt_cnt < 1) || (transfer_lenrxdw0, prxstat->rxdw1, prxstat->rxdw2, prxstat->rxdw4)); @@ -69976,7 +69278,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { shift_sz = 6; } -@@ -1158,23 +1103,11 @@ static int recvbuf2recvframe(_adapter *p +@@ -1158,23 +1103,11 @@ static int recvbuf2recvframe(_adapter *padapter, _pkt *pskb) shift_sz = 0; } @@ -70002,7 +69304,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release //alloc_sz = 1664; //1664 is 128 alignment. if(skb_len <= 1650) alloc_sz = 1664; -@@ -1187,26 +1120,24 @@ static int recvbuf2recvframe(_adapter *p +@@ -1187,26 +1120,24 @@ static int recvbuf2recvframe(_adapter *padapter, _pkt *pskb) // 8 is for skb->data 4 bytes alignment. alloc_sz += 14; } @@ -70037,7 +69339,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if(pkt_copy) { precvframe->u.hdr.rx_head = precvframe->u.hdr.rx_data = precvframe->u.hdr.rx_tail = pbuf; -@@ -1214,7 +1145,8 @@ static int recvbuf2recvframe(_adapter *p +@@ -1214,7 +1145,8 @@ static int recvbuf2recvframe(_adapter *padapter, _pkt *pskb) } else { @@ -70047,7 +69349,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release goto _exit_recvbuf2recvframe; } } -@@ -1238,13 +1170,30 @@ static int recvbuf2recvframe(_adapter *p +@@ -1238,13 +1170,30 @@ static int recvbuf2recvframe(_adapter *padapter, _pkt *pskb) } #endif @@ -70110,7 +69412,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #endif } -@@ -1331,10 +1277,11 @@ static void usb_read_port_complete(struc +@@ -1331,10 +1277,11 @@ static void usb_read_port_complete(struct urb *purb, struct pt_regs *regs) #else if(precvbuf->pskb){ DBG_8192C("==> free skb(%p)\n",precvbuf->pskb); @@ -70124,7 +69426,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release goto exit; } -@@ -1345,10 +1292,11 @@ static void usb_read_port_complete(struc +@@ -1345,10 +1292,11 @@ static void usb_read_port_complete(struct urb *purb, struct pt_regs *regs) RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_read_port_complete: (purb->actual_length > MAX_RECVBUF_SZ) || (purb->actual_length < RXDESC_SIZE)\n")); precvbuf->reuse = _TRUE; rtw_read_port(padapter, precvpriv->ff_hwaddr, 0, (unsigned char *)precvbuf); @@ -70137,7 +69439,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release precvbuf->transfer_len = purb->actual_length; skb_put(precvbuf->pskb, purb->actual_length); -@@ -1368,7 +1316,7 @@ static void usb_read_port_complete(struc +@@ -1368,7 +1316,7 @@ static void usb_read_port_complete(struct urb *purb, struct pt_regs *regs) DBG_8192C("###=> usb_read_port_complete => urb status(%d)\n", purb->status); @@ -70146,7 +69448,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release padapter->bSurpriseRemoved = _TRUE; } -@@ -1384,6 +1332,10 @@ static void usb_read_port_complete(struc +@@ -1384,6 +1332,10 @@ static void usb_read_port_complete(struct urb *purb, struct pt_regs *regs) RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_read_port_complete:bDriverStopped=TRUE\n")); break; case -EPROTO: @@ -70157,7 +69459,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #ifdef DBG_CONFIG_ERROR_DETECT { HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter); -@@ -1394,9 +1346,11 @@ static void usb_read_port_complete(struc +@@ -1394,9 +1346,11 @@ static void usb_read_port_complete(struct urb *purb, struct pt_regs *regs) rtw_read_port(padapter, precvpriv->ff_hwaddr, 0, (unsigned char *)precvbuf); break; case -EINPROGRESS: @@ -70169,7 +69471,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release break; } -@@ -1418,12 +1372,11 @@ static u32 usb_read_port(struct intf_hdl +@@ -1418,12 +1372,11 @@ static u32 usb_read_port(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *rmem) u32 ret = _SUCCESS; PURB purb = NULL; struct recv_buf *precvbuf = (struct recv_buf *)rmem; @@ -70705,7 +70007,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release void rtl8192cu_set_intf_ops(struct _io_ops *pops) { _func_enter_; -@@ -2029,8 +1521,7 @@ void rtl8192cu_set_intf_ops(struct _io_o +@@ -2029,8 +1521,7 @@ void rtl8192cu_set_intf_ops(struct _io_ops *pops) pops->_write32_async = &usb_async_write32; #endif pops->_write_mem = &usb_write_mem; @@ -70715,6 +70017,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release pops->_read_port_cancel = &usb_read_port_cancel; pops->_write_port_cancel = &usb_write_port_cancel; +diff --git a/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/usb_ops_xp.c b/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/usb_ops_xp.c +index 82adeff..32ff645 100644 --- a/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/usb_ops_xp.c +++ b/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/usb_ops_xp.c @@ -16,8 +16,7 @@ @@ -70745,6 +70049,11 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #endif +diff --git a/drivers/net/wireless/rtl8192cu/ifcfg-wlan0 b/drivers/net/wireless/rtl8192cu/ifcfg-wlan0 +old mode 100644 +new mode 100755 +diff --git a/drivers/net/wireless/rtl8192cu/include/Hal8192CEHWImg.h b/drivers/net/wireless/rtl8192cu/include/Hal8192CEHWImg.h +index 2ecb65d..4ae3630 100644 --- a/drivers/net/wireless/rtl8192cu/include/Hal8192CEHWImg.h +++ b/drivers/net/wireless/rtl8192cu/include/Hal8192CEHWImg.h @@ -25,26 +25,29 @@ @@ -70782,7 +70091,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #define PHY_REG_2TArrayLength 374 extern u32 Rtl8192CEPHY_REG_2TArray[PHY_REG_2TArrayLength]; #define PHY_REG_1TArrayLength 374 -@@ -69,7 +72,8 @@ extern u32 Rtl8192CERadioA_1TArray[Radio +@@ -69,7 +72,8 @@ extern u32 Rtl8192CERadioA_1TArray[RadioA_1TArrayLength]; extern u32 Rtl8192CERadioB_1TArray[RadioB_1TArrayLength]; #define RadioB_GM_ArrayLength 1 extern u32 Rtl8192CERadioB_GM_Array[RadioB_GM_ArrayLength]; @@ -70792,6 +70101,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release extern u32 Rtl8192CEMAC_2T_Array[MAC_2T_ArrayLength]; #define MACPHY_Array_PGLength 1 extern u32 Rtl8192CEMACPHY_Array_PG[MACPHY_Array_PGLength]; +diff --git a/drivers/net/wireless/rtl8192cu/include/Hal8192CPhyCfg.h b/drivers/net/wireless/rtl8192cu/include/Hal8192CPhyCfg.h +index 6ecb754..3afb292 100644 --- a/drivers/net/wireless/rtl8192cu/include/Hal8192CPhyCfg.h +++ b/drivers/net/wireless/rtl8192cu/include/Hal8192CPhyCfg.h @@ -111,15 +111,7 @@ typedef enum _HW90_BLOCK{ @@ -70831,7 +70142,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release typedef struct _BB_REGISTER_DEFINITION{ u32 rfintfs; // set software control: // 0x870~0x877[8 bytes] -@@ -294,11 +273,11 @@ void rtl8192c_PHY_SetBBReg( IN PADAPTER +@@ -294,11 +273,11 @@ void rtl8192c_PHY_SetBBReg( IN PADAPTER Adapter, IN u32 BitMask, IN u32 Data ); u32 rtl8192c_PHY_QueryRFReg( IN PADAPTER Adapter, @@ -70845,7 +70156,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release IN u32 RegAddr, IN u32 BitMask, IN u32 Data ); -@@ -313,14 +292,14 @@ int PHY_RFConfig8192C( IN PADAPTER Adapt +@@ -313,14 +292,14 @@ int PHY_RFConfig8192C( IN PADAPTER Adapter ); /* RF config */ int rtl8192c_PHY_ConfigRFWithParaFile( IN PADAPTER Adapter, IN u8* pFileName, @@ -70863,7 +70174,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release /* Read initi reg value for tx power setting. */ void rtl8192c_PHY_GetHWRegOriginalValue( IN PADAPTER Adapter ); -@@ -409,8 +388,6 @@ VOID rtl8192c_PHY_LCCalibrate(IN PADAPTE +@@ -409,8 +388,6 @@ VOID rtl8192c_PHY_LCCalibrate(IN PADAPTER pAdapter); // VOID rtl8192c_PHY_APCalibrate(IN PADAPTER pAdapter, IN char delta); @@ -70872,6 +70183,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release VOID rtl8192c_PHY_SetRFPathSwitch(IN PADAPTER pAdapter, IN BOOLEAN bMain); // +diff --git a/drivers/net/wireless/rtl8192cu/include/Hal8192CPhyReg.h b/drivers/net/wireless/rtl8192cu/include/Hal8192CPhyReg.h +index 1f9f330..6364166 100644 --- a/drivers/net/wireless/rtl8192cu/include/Hal8192CPhyReg.h +++ b/drivers/net/wireless/rtl8192cu/include/Hal8192CPhyReg.h @@ -197,6 +197,19 @@ @@ -70915,6 +70228,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #define RF_BS_IQGEN 0x0F // #define RF_MODE1 0x10 // +diff --git a/drivers/net/wireless/rtl8192cu/include/Hal8192CUHWImg.h b/drivers/net/wireless/rtl8192cu/include/Hal8192CUHWImg.h +index 254a060..ba3c282 100644 --- a/drivers/net/wireless/rtl8192cu/include/Hal8192CUHWImg.h +++ b/drivers/net/wireless/rtl8192cu/include/Hal8192CUHWImg.h @@ -20,31 +20,31 @@ @@ -70958,7 +70273,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #define PHY_REG_2TArrayLength 374 extern u32 Rtl8192CUPHY_REG_2TArray[PHY_REG_2TArrayLength]; #define PHY_REG_1TArrayLength 374 -@@ -77,6 +77,10 @@ extern u32 Rtl8192CURadioB_2TArray[Radio +@@ -77,6 +77,10 @@ extern u32 Rtl8192CURadioB_2TArray[RadioB_2TArrayLength]; extern u32 Rtl8192CURadioA_1TArray[RadioA_1TArrayLength]; #define RadioB_1TArrayLength 1 extern u32 Rtl8192CURadioB_1TArray[RadioB_1TArrayLength]; @@ -70969,7 +70284,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #define RadioA_1T_mCardArrayLength 282 extern u32 Rtl8192CURadioA_1T_mCardArray[RadioA_1T_mCardArrayLength]; #define RadioB_1T_mCardArrayLength 1 -@@ -85,7 +89,9 @@ extern u32 Rtl8192CURadioB_1T_mCardArray +@@ -85,7 +89,9 @@ extern u32 Rtl8192CURadioB_1T_mCardArray[RadioB_1T_mCardArrayLength]; extern u32 Rtl8192CURadioA_1T_HPArray[RadioA_1T_HPArrayLength]; #define RadioB_GM_ArrayLength 1 extern u32 Rtl8192CURadioB_GM_Array[RadioB_GM_ArrayLength]; @@ -70980,6 +70295,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release extern u32 Rtl8192CUMAC_2T_Array[MAC_2T_ArrayLength]; #define MACPHY_Array_PGLength 1 extern u32 Rtl8192CUMACPHY_Array_PG[MACPHY_Array_PGLength]; +diff --git a/drivers/net/wireless/rtl8192cu/include/Hal8192DEHWImg.h b/drivers/net/wireless/rtl8192cu/include/Hal8192DEHWImg.h +index dc2bc17..0639775 100644 --- a/drivers/net/wireless/rtl8192cu/include/Hal8192DEHWImg.h +++ b/drivers/net/wireless/rtl8192cu/include/Hal8192DEHWImg.h @@ -17,50 +17,50 @@ @@ -71074,6 +70391,9 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release +extern const u32 Rtl8192DEAGCTAB_1TArray[Rtl8192DEAGCTAB_1TArrayLength]; #endif //__INC_HAL8192CU_FW_IMG_H +diff --git a/drivers/net/wireless/rtl8192cu/include/Hal8192DETestHWImg.h b/drivers/net/wireless/rtl8192cu/include/Hal8192DETestHWImg.h +deleted file mode 100644 +index 2432bcd..0000000 --- a/drivers/net/wireless/rtl8192cu/include/Hal8192DETestHWImg.h +++ /dev/null @@ -1,54 +0,0 @@ @@ -71131,6 +70451,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release -extern u32 Rtl8192DTestAGCTAB_2GArray[Rtl8192DTestAGCTAB_2GArrayLength]; - -#endif //__INC_HAL8192CU_FW_IMG_H +diff --git a/drivers/net/wireless/rtl8192cu/include/Hal8192DPhyCfg.h b/drivers/net/wireless/rtl8192cu/include/Hal8192DPhyCfg.h +index 475cf36..624fbda 100644 --- a/drivers/net/wireless/rtl8192cu/include/Hal8192DPhyCfg.h +++ b/drivers/net/wireless/rtl8192cu/include/Hal8192DPhyCfg.h @@ -157,6 +157,16 @@ typedef enum _MACPHY_MODE_8192D{ @@ -71180,6 +70502,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release /*--------------------------Exported Function prototype---------------------*/ #define PHY_SetBBReg1Byte(Adapter, RegAddr, BitMask, Data) rtl8192d_PHY_SetBBReg1Byte((Adapter), (RegAddr), (BitMask), (Data)) +diff --git a/drivers/net/wireless/rtl8192cu/include/Hal8192DUHWImg.h b/drivers/net/wireless/rtl8192cu/include/Hal8192DUHWImg.h +index d931001..d6c66d9 100644 --- a/drivers/net/wireless/rtl8192cu/include/Hal8192DUHWImg.h +++ b/drivers/net/wireless/rtl8192cu/include/Hal8192DUHWImg.h @@ -24,7 +24,7 @@ @@ -71191,7 +70515,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release extern const u8 Rtl8192DUFwImgArray[Rtl8192DUImgArrayLength]; #define Rtl8192DUMainArrayLength 1 extern const u8 Rtl8192DUFwMainArray[Rtl8192DUMainArrayLength]; -@@ -36,7 +36,7 @@ extern const u32 Rtl8192DUPHY_REG_2TArra +@@ -36,7 +36,7 @@ extern const u32 Rtl8192DUPHY_REG_2TArray[Rtl8192DUPHY_REG_2TArrayLength]; extern const u32 Rtl8192DUPHY_REG_1TArray[Rtl8192DUPHY_REG_1TArrayLength]; #define Rtl8192DUPHY_REG_Array_PGLength 624 extern const u32 Rtl8192DUPHY_REG_Array_PG[Rtl8192DUPHY_REG_Array_PGLength]; @@ -71200,6 +70524,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release extern const u32 Rtl8192DUPHY_REG_Array_MP[Rtl8192DUPHY_REG_Array_MPLength]; #define Rtl8192DURadioA_2TArrayLength 378 extern const u32 Rtl8192DURadioA_2TArray[Rtl8192DURadioA_2TArrayLength]; +diff --git a/drivers/net/wireless/rtl8192cu/include/Hal8192DUHWImg_wowlan.h b/drivers/net/wireless/rtl8192cu/include/Hal8192DUHWImg_wowlan.h +index a297e76..cc27a77 100644 --- a/drivers/net/wireless/rtl8192cu/include/Hal8192DUHWImg_wowlan.h +++ b/drivers/net/wireless/rtl8192cu/include/Hal8192DUHWImg_wowlan.h @@ -23,7 +23,7 @@ @@ -71211,6 +70537,9 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release extern u8 Rtl8192DUFwWWImgArray[DUWWImgArrayLength]; #endif //__INC_HAL8192DU_FW_IMG_WOWLAN_H +diff --git a/drivers/net/wireless/rtl8192cu/include/Hal8192DUTestHWImg.h b/drivers/net/wireless/rtl8192cu/include/Hal8192DUTestHWImg.h +deleted file mode 100644 +index e0491ff..0000000 --- a/drivers/net/wireless/rtl8192cu/include/Hal8192DUTestHWImg.h +++ /dev/null @@ -1,54 +0,0 @@ @@ -71268,6 +70597,9 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release -extern u32 Rtl8192DTestAGCTAB_2GArray[Rtl8192DTestAGCTAB_2GArrayLength]; - -#endif //__INC_HAL8192CU_FW_IMG_H +diff --git a/drivers/net/wireless/rtl8192cu/include/HalPwrSeqCmd.h b/drivers/net/wireless/rtl8192cu/include/HalPwrSeqCmd.h +new file mode 100644 +index 0000000..e5d151c --- /dev/null +++ b/drivers/net/wireless/rtl8192cu/include/HalPwrSeqCmd.h @@ -0,0 +1,137 @@ @@ -71408,6 +70740,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + WLAN_PWR_CFG PwrCfgCmd[]); + +#endif +diff --git a/drivers/net/wireless/rtl8192cu/include/autoconf.h b/drivers/net/wireless/rtl8192cu/include/autoconf.h +index 7d6db40..12294df 100644 --- a/drivers/net/wireless/rtl8192cu/include/autoconf.h +++ b/drivers/net/wireless/rtl8192cu/include/autoconf.h @@ -31,11 +31,13 @@ @@ -71489,7 +70823,17 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release // Added by Albert 20110314 #define CONFIG_P2P 1 -+#ifdef CONFIG_P2P +- +- + #ifdef CONFIG_P2P +-// Added by Albert 20110812 +-// The CONFIG_WFD is for supporting the Wi-Fi display +-//#define CONFIG_WFD 1 +- +-// Unmarked if there is low p2p scanned ratio; Kurt +-//#define CONFIG_P2P_AGAINST_NOISE 1 +-#define CONFIG_P2P_REMOVE_GROUP_INFO +-//#define CONFIG_DBG_P2P + //Added by Albert 20110812 + //The CONFIG_WFD is for supporting the Wi-Fi display + #define CONFIG_WFD @@ -71498,19 +70842,10 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + #define CONFIG_P2P_REMOVE_GROUP_INFO + #endif + //#define CONFIG_DBG_P2P - ++ + //#define CONFIG_P2P_PS + //#define CONFIG_P2P_IPS - --#ifdef CONFIG_P2P --// Added by Albert 20110812 --// The CONFIG_WFD is for supporting the Wi-Fi display --//#define CONFIG_WFD 1 -- --// Unmarked if there is low p2p scanned ratio; Kurt --//#define CONFIG_P2P_AGAINST_NOISE 1 --#define CONFIG_P2P_REMOVE_GROUP_INFO --//#define CONFIG_DBG_P2P ++ + #define P2P_OP_CHECK_SOCIAL_CH + // Added comment by Borg 2013/06/21 + // Issue: Nexus 4 is hard to do miracast. @@ -71623,6 +70958,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + +//turn off power tracking when traffic is busy +//#define CONFIG_BUSY_TRAFFIC_SKIP_PWR_TRACK +diff --git a/drivers/net/wireless/rtl8192cu/include/basic_types.h b/drivers/net/wireless/rtl8192cu/include/basic_types.h +index f880224..f76e68f 100644 --- a/drivers/net/wireless/rtl8192cu/include/basic_types.h +++ b/drivers/net/wireless/rtl8192cu/include/basic_types.h @@ -106,6 +106,51 @@ @@ -71677,6 +71014,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #define MEM_ALIGNMENT_OFFSET (sizeof (SIZE_T)) #define MEM_ALIGNMENT_PADDING (sizeof(SIZE_T) - 1) +diff --git a/drivers/net/wireless/rtl8192cu/include/byteorder/generic.h b/drivers/net/wireless/rtl8192cu/include/byteorder/generic.h +index 246ba89..7c8d4d7 100644 --- a/drivers/net/wireless/rtl8192cu/include/byteorder/generic.h +++ b/drivers/net/wireless/rtl8192cu/include/byteorder/generic.h @@ -98,7 +98,7 @@ @@ -71707,6 +71046,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #if defined(__GNUC__) && (__GNUC__ >= 2) && defined(__OPTIMIZE__) || defined(PLATFORM_MPIXEL) +diff --git a/drivers/net/wireless/rtl8192cu/include/byteorder/swab.h b/drivers/net/wireless/rtl8192cu/include/byteorder/swab.h +index 117c84d..a3ca9ea 100644 --- a/drivers/net/wireless/rtl8192cu/include/byteorder/swab.h +++ b/drivers/net/wireless/rtl8192cu/include/byteorder/swab.h @@ -16,12 +16,11 @@ @@ -71724,7 +71065,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #ifndef __u16 typedef unsigned short __u16; #endif -@@ -74,7 +73,7 @@ __inline static __u64 ___swab64(__u64 x +@@ -74,7 +73,7 @@ __inline static __u64 ___swab64(__u64 x) (__u64)(((__u64)(__x) & (__u64)0x00ff000000000000ULL) >> 40) | \ (__u64)(((__u64)(__x) & (__u64)0xff00000000000000ULL) >> 56) )); \ } @@ -71733,7 +71074,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #ifndef __arch__swab16 __inline static __u16 __arch__swab16(__u16 x) -@@ -109,11 +108,19 @@ __inline static __u64 __arch__swab64(__u +@@ -109,11 +108,19 @@ __inline static __u64 __arch__swab64(__u64 x) #define __swab64(x) __fswab64(x) #endif // __swab16 @@ -71753,6 +71094,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { return __arch__swab32(x); } +diff --git a/drivers/net/wireless/rtl8192cu/include/byteorder/swabb.h b/drivers/net/wireless/rtl8192cu/include/byteorder/swabb.h +index 1735349..7e2a118 100644 --- a/drivers/net/wireless/rtl8192cu/include/byteorder/swabb.h +++ b/drivers/net/wireless/rtl8192cu/include/byteorder/swabb.h @@ -16,8 +16,7 @@ @@ -71765,6 +71108,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #ifndef _LINUX_BYTEORDER_SWABB_H #define _LINUX_BYTEORDER_SWABB_H +diff --git a/drivers/net/wireless/rtl8192cu/include/drv_conf.h b/drivers/net/wireless/rtl8192cu/include/drv_conf.h +index a2b6cc4..1317687 100644 --- a/drivers/net/wireless/rtl8192cu/include/drv_conf.h +++ b/drivers/net/wireless/rtl8192cu/include/drv_conf.h @@ -38,7 +38,7 @@ @@ -71776,6 +71121,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release //Android expect dbm as the rx signal strength unit #define CONFIG_SIGNAL_DISPLAY_DBM +diff --git a/drivers/net/wireless/rtl8192cu/include/drv_types.h b/drivers/net/wireless/rtl8192cu/include/drv_types.h +index 95e20cc..0ac34f2 100644 --- a/drivers/net/wireless/rtl8192cu/include/drv_types.h +++ b/drivers/net/wireless/rtl8192cu/include/drv_types.h @@ -1,7 +1,7 @@ @@ -71817,7 +71164,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release }; typedef struct _ADAPTER _adapter, ADAPTER,*PADAPTER; -@@ -65,11 +65,12 @@ typedef struct _ADAPTER _adapter, ADAPTE +@@ -65,11 +65,12 @@ typedef struct _ADAPTER _adapter, ADAPTER,*PADAPTER; #include #include @@ -71832,7 +71179,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #include #include #include -@@ -81,6 +82,8 @@ typedef struct _ADAPTER _adapter, ADAPTE +@@ -81,6 +82,8 @@ typedef struct _ADAPTER _adapter, ADAPTER,*PADAPTER; #include #include #include @@ -71841,7 +71188,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #ifdef CONFIG_DRVEXT_MODULE #include -@@ -106,23 +109,23 @@ typedef struct _ADAPTER _adapter, ADAPTE +@@ -106,23 +109,23 @@ typedef struct _ADAPTER _adapter, ADAPTER,*PADAPTER; #define SPEC_DEV_ID_ASSIGN_IFNAME BIT(5) struct specific_device_id{ @@ -71929,7 +71276,9 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #endif + u8 special_rf_path; //0: 2T2R ,1: only turn on path A 1T1R, 2: only turn on path B 1T1R + u8 mac_phy_mode; //0:by efuse, 1:smsp, 2:dmdp, 3:dmsp. -+ + +-#ifdef SUPPORT_64_STA +- u8 bcmc_rate; +#ifdef CONFIG_80211D + u8 enable80211d; +#endif @@ -71938,9 +71287,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + u8 if2name[16]; + + u8 notch_filter; - --#ifdef SUPPORT_64_STA -- u8 bcmc_rate; ++ +#ifdef CONFIG_MULTI_VIR_IFACES + u8 ext_iface_num;//primary/secondary iface is excluded #endif @@ -72004,7 +71351,10 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + _mutex h2c_fwcmd_mutex; + _mutex setch_mutex; + _mutex setbw_mutex; -+ + +-#ifdef PLATFORM_LINUX +- struct sdio_func *func; +-#endif//PLATFORM_LINUX + unsigned char oper_channel; //saved channel info when call set_channel_bw + unsigned char oper_bwmode; + unsigned char oper_ch_offset;//PRIME_CHNL_OFFSET @@ -72015,17 +71365,12 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + //padapters[IFACE_ID1] == if2 + _adapter *padapters[IFACE_ID_MAX]; + u8 iface_nums; // total number of ifaces used runtime - --#ifdef PLATFORM_LINUX -- struct sdio_func *func; --#endif//PLATFORM_LINUX ++ + //For 92D, DMDP have 2 interface. + u8 InterfaceNumber; + u8 NumInterfaces; + u8 DualMacMode; + u8 irq_alloc; -+ -+/*-------- below is for SDIO INTERFACE --------*/ - u8 func_number;//unsigned char FunctionNumber; - u32 block_transfer_len;//unsigned long BLOCK_TRANSFER_LEN; @@ -72041,6 +71386,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - u16 sdio_hisr; - u16 sdio_himr; -#endif// CONFIG_SDIO_HCI ++/*-------- below is for SDIO INTERFACE --------*/ ++ +#ifdef INTF_DATA + INTF_DATA intf_data; +#endif @@ -72258,15 +71605,14 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - _thread_hdl_ evtThread; - _thread_hdl_ xmitThread; - _thread_hdl_ recvThread; -- -- NDIS_STATUS (*dvobj_init)(_adapter * adapter); -- void (*dvobj_deinit)(_adapter * adapter); + _thread_hdl_ cmdThread; + _thread_hdl_ evtThread; + _thread_hdl_ xmitThread; + _thread_hdl_ recvThread; -+ + +- NDIS_STATUS (*dvobj_init)(_adapter * adapter); +- void (*dvobj_deinit)(_adapter * adapter); +#ifndef PLATFORM_LINUX + NDIS_STATUS (*dvobj_init)(struct dvobj_priv *dvobj); + void (*dvobj_deinit)(struct dvobj_priv *dvobj); @@ -72386,6 +71732,9 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release __inline static u8 *myid(struct eeprom_priv *peepriv) { return (peepriv->mac_addr); +diff --git a/drivers/net/wireless/rtl8192cu/include/drv_types_sdio.h b/drivers/net/wireless/rtl8192cu/include/drv_types_sdio.h +new file mode 100644 +index 0000000..fd467ca --- /dev/null +++ b/drivers/net/wireless/rtl8192cu/include/drv_types_sdio.h @@ -0,0 +1,70 @@ @@ -72459,6 +71808,9 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + +#endif + +diff --git a/drivers/net/wireless/rtl8192cu/include/farray.h b/drivers/net/wireless/rtl8192cu/include/farray.h +deleted file mode 100644 +index 79d2a42..0000000 --- a/drivers/net/wireless/rtl8192cu/include/farray.h +++ /dev/null @@ -1,31480 +0,0 @@ @@ -103942,6 +103294,9 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release -0x08,0xFB,0x90,0xB8, -0xFF,0xFF,0xFF,0xFF, -}; +diff --git a/drivers/net/wireless/rtl8192cu/include/hal_com.h b/drivers/net/wireless/rtl8192cu/include/hal_com.h +new file mode 100644 +index 0000000..42aae0e --- /dev/null +++ b/drivers/net/wireless/rtl8192cu/include/hal_com.h @@ -0,0 +1,146 @@ @@ -104091,6 +103446,9 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + +#endif //__HAL_COMMON_H__ + +diff --git a/drivers/net/wireless/rtl8192cu/include/hal_init.h b/drivers/net/wireless/rtl8192cu/include/hal_init.h +deleted file mode 100644 +index ec48f83..0000000 --- a/drivers/net/wireless/rtl8192cu/include/hal_init.h +++ /dev/null @@ -1,305 +0,0 @@ @@ -104399,6 +103757,9 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - -#endif //__HAL_INIT_H__ - +diff --git a/drivers/net/wireless/rtl8192cu/include/hal_intf.h b/drivers/net/wireless/rtl8192cu/include/hal_intf.h +new file mode 100644 +index 0000000..dd82662 --- /dev/null +++ b/drivers/net/wireless/rtl8192cu/include/hal_intf.h @@ -0,0 +1,432 @@ @@ -104834,6 +104195,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + +#endif //__HAL_INTF_H__ + +diff --git a/drivers/net/wireless/rtl8192cu/include/ieee80211.h b/drivers/net/wireless/rtl8192cu/include/ieee80211.h +index 5c17a28..e283a5f 100644 --- a/drivers/net/wireless/rtl8192cu/include/ieee80211.h +++ b/drivers/net/wireless/rtl8192cu/include/ieee80211.h @@ -43,6 +43,8 @@ @@ -105060,9 +104423,6 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #define RTW_IEEE80211_STYPE_CFACKPOLL 0x0070 -#define RTW_IEEE80211_QOS_DATAGRP 0x0080 -#define RTW_IEEE80211_QoS_DATAGRP RTW_IEEE80211_QOS_DATAGRP -- --#define RTW_IEEE80211_SCTL_FRAG 0x000F --#define RTW_IEEE80211_SCTL_SEQ 0xFFF0 +#define RTW_IEEE80211_STYPE_QOS_DATA 0x0080 +#define RTW_IEEE80211_STYPE_QOS_DATA_CFACK 0x0090 +#define RTW_IEEE80211_STYPE_QOS_DATA_CFPOLL 0x00A0 @@ -105075,7 +104435,9 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release +/* sequence control field */ +#define RTW_IEEE80211_SCTL_FRAG 0x000F +#define RTW_IEEE80211_SCTL_SEQ 0xFFF0 -+ + +-#define RTW_IEEE80211_SCTL_FRAG 0x000F +-#define RTW_IEEE80211_SCTL_SEQ 0xFFF0 + +#define RTW_ERP_INFO_NON_ERP_PRESENT BIT(0) +#define RTW_ERP_INFO_USE_PROTECTION BIT(1) @@ -105220,7 +104582,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release extern __inline int is_multicast_mac_addr(const u8 *addr) { return ((addr[0] != 0xff) && (0x01 & addr[0])); -@@ -1175,6 +1205,13 @@ extern __inline int is_broadcast_mac_add +@@ -1175,6 +1205,13 @@ extern __inline int is_broadcast_mac_addr(const u8 *addr) (addr[3] == 0xff) && (addr[4] == 0xff) && (addr[5] == 0xff)); } @@ -105296,7 +104658,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release RTW_WLAN_CATEGORY_WMM = 17, RTW_WLAN_CATEGORY_P2P = 0x7f,//P2P action frames }; -@@ -1276,8 +1276,22 @@ enum rtw_ieee80211_spectrum_mgmt_actionc +@@ -1276,8 +1276,22 @@ enum rtw_ieee80211_spectrum_mgmt_actioncode { enum _PUBLIC_ACTION{ ACT_PUBLIC_BSSCOEXIST = 0, // 20/40 BSS Coexistence @@ -105450,7 +104812,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release void rtw_set_supported_rate(u8* SupportedRates, uint mode) ; unsigned char *rtw_get_wpa_ie(unsigned char *pie, int *wpa_ie_len, int limit); -@@ -1426,19 +1527,31 @@ u8 *rtw_get_wps_ie(u8 *in_ie, uint in_le +@@ -1426,19 +1527,31 @@ u8 *rtw_get_wps_ie(u8 *in_ie, uint in_len, u8 *wps_ie, uint *wps_ielen); u8 *rtw_get_wps_attr(u8 *wps_ie, uint wps_ielen, u16 target_attr_id ,u8 *buf_attr, u32 *len_attr); u8 *rtw_get_wps_attr_content(u8 *wps_ie, uint wps_ielen, u16 target_attr_id ,u8 *buf_content, uint *len_content); @@ -105487,7 +104849,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release int rtw_get_wfd_attr_content(u8 *wfd_ie, uint wfd_ielen, u8 target_attr_id ,u8 *attr_content, uint *attr_contentlen); #endif // CONFIG_WFD -@@ -1457,5 +1570,11 @@ uint rtw_is_cckratesonly_included(u8 *ra +@@ -1457,5 +1570,11 @@ uint rtw_is_cckratesonly_included(u8 *rate); int rtw_check_network_type(unsigned char *rate, int ratelen, int channel); void rtw_macaddr_cfg(u8 *mac_addr); @@ -105499,6 +104861,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + #endif /* IEEE80211_H */ +diff --git a/drivers/net/wireless/rtl8192cu/include/if_ether.h b/drivers/net/wireless/rtl8192cu/include/if_ether.h +index 045c067..9e36d7f 100644 --- a/drivers/net/wireless/rtl8192cu/include/if_ether.h +++ b/drivers/net/wireless/rtl8192cu/include/if_ether.h @@ -1,22 +1,22 @@ @@ -105539,6 +104903,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #ifndef _LINUX_IF_ETHER_H #define _LINUX_IF_ETHER_H +diff --git a/drivers/net/wireless/rtl8192cu/include/ioctl_cfg80211.h b/drivers/net/wireless/rtl8192cu/include/ioctl_cfg80211.h +index 7846927..ceb0db8 100644 --- a/drivers/net/wireless/rtl8192cu/include/ioctl_cfg80211.h +++ b/drivers/net/wireless/rtl8192cu/include/ioctl_cfg80211.h @@ -27,6 +27,62 @@ @@ -105641,7 +105007,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release void rtw_cfg80211_indicate_connect(_adapter *padapter); void rtw_cfg80211_indicate_disconnect(_adapter *padapter); void rtw_cfg80211_indicate_scan_done(struct rtw_wdev_priv *pwdev_priv, bool aborted); -@@ -74,8 +139,42 @@ void rtw_cfg80211_indicate_sta_disassoc( +@@ -74,8 +139,42 @@ void rtw_cfg80211_indicate_sta_disassoc(_adapter *padapter, unsigned char *da, u void rtw_cfg80211_issue_p2p_provision_request(_adapter *padapter, const u8 *buf, size_t len); void rtw_cfg80211_rx_p2p_action_public(_adapter *padapter, u8 *pmgmt_frame, uint frame_len); void rtw_cfg80211_rx_action_p2p(_adapter *padapter, u8 *pmgmt_frame, uint frame_len); @@ -105684,6 +105050,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + #endif //__IOCTL_CFG80211_H__ +diff --git a/drivers/net/wireless/rtl8192cu/include/ip.h b/drivers/net/wireless/rtl8192cu/include/ip.h +index 5846347..d7f723d 100644 --- a/drivers/net/wireless/rtl8192cu/include/ip.h +++ b/drivers/net/wireless/rtl8192cu/include/ip.h @@ -1,19 +1,22 @@ @@ -105721,6 +105089,9 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #ifndef _LINUX_IP_H #define _LINUX_IP_H #include +diff --git a/drivers/net/wireless/rtl8192cu/include/linux/wireless.h b/drivers/net/wireless/rtl8192cu/include/linux/wireless.h +new file mode 100644 +index 0000000..24a22d6 --- /dev/null +++ b/drivers/net/wireless/rtl8192cu/include/linux/wireless.h @@ -0,0 +1,90 @@ @@ -105814,9 +105185,11 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release +}; + +#endif /* _LINUX_WIRELESS_H */ +diff --git a/drivers/net/wireless/rtl8192cu/include/mlme_osdep.h b/drivers/net/wireless/rtl8192cu/include/mlme_osdep.h +index 1583053..75754db 100644 --- a/drivers/net/wireless/rtl8192cu/include/mlme_osdep.h +++ b/drivers/net/wireless/rtl8192cu/include/mlme_osdep.h -@@ -34,10 +34,6 @@ extern void rtw_os_indicate_connect( _ad +@@ -34,10 +34,6 @@ extern void rtw_os_indicate_connect( _adapter *adapter ); void rtw_os_indicate_scan_done( _adapter *padapter, bool aborted); extern void rtw_report_sec_ie(_adapter *adapter,u8 authmode,u8 *sec_ie); @@ -105827,6 +105200,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release void rtw_reset_securitypriv( _adapter *adapter ); #endif //_MLME_OSDEP_H_ +diff --git a/drivers/net/wireless/rtl8192cu/include/osdep_intf.h b/drivers/net/wireless/rtl8192cu/include/osdep_intf.h +index 86b3f1f..3cd1659 100644 --- a/drivers/net/wireless/rtl8192cu/include/osdep_intf.h +++ b/drivers/net/wireless/rtl8192cu/include/osdep_intf.h @@ -1,7 +1,7 @@ @@ -105864,7 +105239,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release /* Under Sync. IRP (SDIO/USB) -@@ -53,9 +50,9 @@ The protection mechanism is through the +@@ -53,9 +50,9 @@ The protection mechanism is through the pending queue. _mutex ioctl_mutex; @@ -105877,7 +105252,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release // when in USB, IO is through interrupt in/out endpoints struct usb_device *udev; PURB piorw_urb; -@@ -70,7 +67,7 @@ The protection mechanism is through the +@@ -70,7 +67,7 @@ The protection mechanism is through the pending queue. #ifdef PLATFORM_OS_XP #ifdef CONFIG_SDIO_HCI @@ -105886,7 +105261,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release PMDL pmdl; PSDBUS_REQUEST_PACKET sdrp; PSDBUS_REQUEST_PACKET recv_sdrp; -@@ -84,11 +81,11 @@ The protection mechanism is through the +@@ -84,11 +81,11 @@ The protection mechanism is through the pending queue. PIRP piorw_irp; u8 io_irp_cnt; u8 bio_irp_pending; @@ -105901,7 +105276,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #ifdef CONFIG_R871X_TEST -@@ -96,6 +93,9 @@ int rtw_start_pseudo_adhoc(_adapter *pad +@@ -96,6 +93,9 @@ int rtw_start_pseudo_adhoc(_adapter *padapter); int rtw_stop_pseudo_adhoc(_adapter *padapter); #endif @@ -105911,7 +105286,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release u8 rtw_init_drv_sw(_adapter *padapter); u8 rtw_free_drv_sw(_adapter *padapter); u8 rtw_reset_drv_sw(_adapter *padapter); -@@ -109,20 +109,47 @@ int rtw_ioctl(struct net_device *dev, st +@@ -109,20 +109,47 @@ int rtw_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); int rtw_init_netdev_name(struct net_device *pnetdev, const char *ifname); struct net_device *rtw_init_netdev(_adapter *padapter); @@ -105961,6 +105336,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #endif //_OSDEP_INTF_H_ +diff --git a/drivers/net/wireless/rtl8192cu/include/osdep_service.h b/drivers/net/wireless/rtl8192cu/include/osdep_service.h +index 6fedff4..c5c465e 100644 --- a/drivers/net/wireless/rtl8192cu/include/osdep_service.h +++ b/drivers/net/wireless/rtl8192cu/include/osdep_service.h @@ -24,8 +24,9 @@ @@ -106777,7 +106154,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #endif __inline static _list *get_next(_list *list) -@@ -271,6 +994,15 @@ __inline static void _set_workitem(_work +@@ -271,6 +994,15 @@ __inline static void _set_workitem(_workitem *pwork) schedule_work(pwork); } @@ -106793,7 +106170,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release // // Global Mutex: can only be used at PASSIVE level. // -@@ -289,6 +1021,45 @@ __inline static void _set_workitem(_work +@@ -289,6 +1021,45 @@ __inline static void _set_workitem(_workitem *pwork) atomic_dec((atomic_t *)&(_MutexCounter)); \ } @@ -106839,7 +106216,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #endif // PLATFORM_LINUX -@@ -296,7 +1067,6 @@ __inline static void _set_workitem(_work +@@ -296,7 +1067,6 @@ __inline static void _set_workitem(_workitem *pwork) #include #include @@ -106847,7 +106224,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #include #include -@@ -470,46 +1240,160 @@ extern int RTW_STATUS_CODE(int error_cod +@@ -470,46 +1240,160 @@ extern int RTW_STATUS_CODE(int error_code); #define CONFIG_USE_VMALLOC @@ -107036,7 +106413,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release extern void _rtw_memcpy(void* dec, void* sour, u32 sz); extern int _rtw_memcmp(void *dst, void *src, u32 sz); -@@ -517,8 +1401,11 @@ extern void _rtw_memset(void *pbuf, int +@@ -517,8 +1401,11 @@ extern void _rtw_memset(void *pbuf, int c, u32 sz); extern void _rtw_init_listhead(_list *list); extern u32 rtw_is_list_empty(_list *phead); @@ -107058,7 +106435,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release extern void _rtw_spinlock_free(_lock *plock); extern void _rtw_spinlock(_lock *plock); extern void _rtw_spinunlock(_lock *plock); -@@ -539,6 +1428,7 @@ extern u32 rtw_end_of_queue_search(_list +@@ -539,6 +1428,7 @@ extern u32 rtw_end_of_queue_search(_list *queue, _list *pelement); extern u32 rtw_get_current_time(void); extern u32 rtw_systime_to_ms(u32 systime); @@ -107066,7 +106443,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release extern s32 rtw_get_passing_time_ms(u32 start); extern s32 rtw_get_time_interval_ms(u32 start, u32 end); -@@ -547,6 +1437,8 @@ extern void rtw_sleep_schedulable(int ms +@@ -547,6 +1437,8 @@ extern void rtw_sleep_schedulable(int ms); extern void rtw_msleep_os(int ms); extern void rtw_usleep_os(int us); @@ -107083,7 +106460,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release __inline static unsigned char _cancel_timer_ex(_timer *ptimer) -@@ -564,7 +1457,10 @@ __inline static unsigned char _cancel_ti +@@ -564,7 +1457,10 @@ __inline static unsigned char _cancel_timer_ex(_timer *ptimer) #ifdef PLATFORM_LINUX return del_timer_sync(ptimer); #endif @@ -107095,7 +106472,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #ifdef PLATFORM_WINDOWS u8 bcancelled; -@@ -574,16 +1470,25 @@ __inline static unsigned char _cancel_ti +@@ -574,16 +1470,25 @@ __inline static unsigned char _cancel_timer_ex(_timer *ptimer) #endif } @@ -107125,7 +106502,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release __inline static void flush_signals_thread(void) { #ifdef PLATFORM_LINUX -@@ -598,7 +1503,7 @@ __inline static _OS_STATUS res_to_status +@@ -598,7 +1503,7 @@ __inline static _OS_STATUS res_to_status(sint res) { @@ -107134,7 +106511,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return res; #endif -@@ -613,6 +1518,22 @@ __inline static _OS_STATUS res_to_status +@@ -613,6 +1518,22 @@ __inline static _OS_STATUS res_to_status(sint res) } @@ -107174,7 +106551,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #endif extern void ATOMIC_SET(ATOMIC_T *v, int i); -@@ -738,7 +1662,6 @@ extern int rtw_retrive_from_file(char *p +@@ -738,7 +1662,6 @@ extern int rtw_retrive_from_file(char *path, u8* buf, u32 sz); extern int rtw_store_to_file(char *path, u8* buf, u32 sz); @@ -107272,6 +106649,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #endif + +diff --git a/drivers/net/wireless/rtl8192cu/include/pci_ops.h b/drivers/net/wireless/rtl8192cu/include/pci_ops.h +index dd63f5f..9404ff4 100644 --- a/drivers/net/wireless/rtl8192cu/include/pci_ops.h +++ b/drivers/net/wireless/rtl8192cu/include/pci_ops.h @@ -37,6 +37,7 @@ void rtl8192ce_xmit_tasklet(void *priv); @@ -107290,6 +106669,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release u32 MpReadPCIDwordDBI8192D(IN PADAPTER Adapter, IN u16 Offset, IN u8 Direct); void MpWritePCIDwordDBI8192D(IN PADAPTER Adapter, IN u16 Offset, IN u32 Value, IN u8 Direct); #endif +diff --git a/drivers/net/wireless/rtl8192cu/include/rtl8192c_cmd.h b/drivers/net/wireless/rtl8192cu/include/rtl8192c_cmd.h +index 1689c54..c54cc31 100644 --- a/drivers/net/wireless/rtl8192cu/include/rtl8192c_cmd.h +++ b/drivers/net/wireless/rtl8192cu/include/rtl8192c_cmd.h @@ -16,8 +16,7 @@ @@ -107368,7 +106749,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release struct H2C_SS_RFOFF_PARAM{ u8 ROFOn; // 1: on, 0:off -@@ -132,8 +122,7 @@ void rtl8192c_set_FwPwrMode_cmd(_adapter +@@ -132,8 +122,7 @@ void rtl8192c_set_FwPwrMode_cmd(_adapter*padapter, u8 Mode); void rtl8192c_set_FwJoinBssReport_cmd(_adapter* padapter, u8 mstatus); u8 rtl8192c_set_rssi_cmd(_adapter*padapter, u8 *param); u8 rtl8192c_set_raid_cmd(_adapter*padapter, u32 mask, u8 arg); @@ -107399,6 +106780,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + +#endif // __RTL8192C_CMD_H_ + +diff --git a/drivers/net/wireless/rtl8192cu/include/rtl8192c_dm.h b/drivers/net/wireless/rtl8192cu/include/rtl8192c_dm.h +index 80b4a67..9d06540 100644 --- a/drivers/net/wireless/rtl8192cu/include/rtl8192c_dm.h +++ b/drivers/net/wireless/rtl8192cu/include/rtl8192c_dm.h @@ -16,8 +16,7 @@ @@ -107539,7 +106922,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release //============================================================ // structure and define //============================================================ -@@ -211,6 +95,7 @@ typedef struct _Dynamic_Initial_Gain_Thr +@@ -211,6 +95,7 @@ typedef struct _Dynamic_Initial_Gain_Threshold_ u8 LargeFAHit; u8 ForbiddenIGI; u32 Recover_cnt; @@ -107578,6 +106961,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release }; +diff --git a/drivers/net/wireless/rtl8192cu/include/rtl8192c_event.h b/drivers/net/wireless/rtl8192cu/include/rtl8192c_event.h +index 131b658..1013f74 100644 --- a/drivers/net/wireless/rtl8192cu/include/rtl8192c_event.h +++ b/drivers/net/wireless/rtl8192cu/include/rtl8192c_event.h @@ -16,8 +16,7 @@ @@ -107590,6 +106975,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #ifndef _RTL8192C_EVENT_H_ #define _RTL8192C_EVENT_H_ +diff --git a/drivers/net/wireless/rtl8192cu/include/rtl8192c_hal.h b/drivers/net/wireless/rtl8192cu/include/rtl8192c_hal.h +index cddd998..3348971 100644 --- a/drivers/net/wireless/rtl8192cu/include/rtl8192c_hal.h +++ b/drivers/net/wireless/rtl8192cu/include/rtl8192c_hal.h @@ -16,11 +16,11 @@ @@ -107698,7 +107085,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release u8 LegacyHTTxPowerDiff;// Legacy to HT rate power diff -@@ -672,7 +689,7 @@ typedef struct hal_data_8192ce HAL_DATA_ +@@ -672,7 +689,7 @@ typedef struct hal_data_8192ce HAL_DATA_TYPE, *PHAL_DATA_TYPE; #define IS_MULTI_FUNC_CHIP(_Adapter) (((((PHAL_DATA_TYPE)(_Adapter->HalData))->MultiFunc) & (RT_MULTI_FUNC_BT|RT_MULTI_FUNC_GPS)) ? _TRUE : _FALSE) void InterruptRecognized8192CE(PADAPTER Adapter, PRT_ISR_CONTENT pIsrContent); @@ -107729,7 +107116,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release u8 LegacyHTTxPowerDiff;// Legacy to HT rate power diff -@@ -876,12 +893,45 @@ VOID rtl8192c_FirmwareSelfReset(IN PADAP +@@ -876,12 +893,45 @@ VOID rtl8192c_FirmwareSelfReset(IN PADAPTER Adapter); int FirmwareDownload92C(IN PADAPTER Adapter,IN BOOLEAN bUsedWoWLANFw); VOID InitializeFirmwareVars92C(PADAPTER Adapter); u8 GetEEPROMSize8192C(PADAPTER Adapter); @@ -107777,6 +107164,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + + + +diff --git a/drivers/net/wireless/rtl8192cu/include/rtl8192c_led.h b/drivers/net/wireless/rtl8192cu/include/rtl8192c_led.h +index b361ba5..1ccf935 100644 --- a/drivers/net/wireless/rtl8192cu/include/rtl8192c_led.h +++ b/drivers/net/wireless/rtl8192cu/include/rtl8192c_led.h @@ -16,8 +16,7 @@ @@ -107789,6 +107178,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #ifndef __RTL8192C_LED_H_ #define __RTL8192C_LED_H_ +diff --git a/drivers/net/wireless/rtl8192cu/include/rtl8192c_recv.h b/drivers/net/wireless/rtl8192cu/include/rtl8192c_recv.h +index b532a59..d5656f5 100644 --- a/drivers/net/wireless/rtl8192cu/include/rtl8192c_recv.h +++ b/drivers/net/wireless/rtl8192cu/include/rtl8192c_recv.h @@ -16,8 +16,7 @@ @@ -107850,6 +107241,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #endif +diff --git a/drivers/net/wireless/rtl8192cu/include/rtl8192c_rf.h b/drivers/net/wireless/rtl8192cu/include/rtl8192c_rf.h +index d3c4b67..26c678a 100644 --- a/drivers/net/wireless/rtl8192cu/include/rtl8192c_rf.h +++ b/drivers/net/wireless/rtl8192cu/include/rtl8192c_rf.h @@ -16,8 +16,7 @@ @@ -107862,6 +107255,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release /****************************************************************************** * * +diff --git a/drivers/net/wireless/rtl8192cu/include/rtl8192c_spec.h b/drivers/net/wireless/rtl8192cu/include/rtl8192c_spec.h +index 27e0f0e..8ff13a7 100644 --- a/drivers/net/wireless/rtl8192cu/include/rtl8192c_spec.h +++ b/drivers/net/wireless/rtl8192cu/include/rtl8192c_spec.h @@ -16,8 +16,7 @@ @@ -107995,6 +107390,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release // The same function but different bit field. #define DIS_TSF_UDT0_NORMAL_CHIP BIT(4) #define DIS_TSF_UDT0_TEST_CHIP BIT(5) +diff --git a/drivers/net/wireless/rtl8192cu/include/rtl8192c_sreset.h b/drivers/net/wireless/rtl8192cu/include/rtl8192c_sreset.h +index dace413..20e88b5 100644 --- a/drivers/net/wireless/rtl8192cu/include/rtl8192c_sreset.h +++ b/drivers/net/wireless/rtl8192cu/include/rtl8192c_sreset.h @@ -16,39 +16,17 @@ @@ -108039,6 +107436,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release -extern u8 rtl8192c_sreset_get_wifi_status(_adapter *padapter); #endif #endif +diff --git a/drivers/net/wireless/rtl8192cu/include/rtl8192c_xmit.h b/drivers/net/wireless/rtl8192cu/include/rtl8192c_xmit.h +index efb5f99..7d2059d 100644 --- a/drivers/net/wireless/rtl8192cu/include/rtl8192c_xmit.h +++ b/drivers/net/wireless/rtl8192cu/include/rtl8192c_xmit.h @@ -16,22 +16,10 @@ @@ -108117,7 +107516,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #ifdef CONFIG_USB_HCI #ifdef CONFIG_USB_TX_AGGREGATION -@@ -58,10 +91,12 @@ void rtl8192cu_cal_txdesc_chksum(struct +@@ -58,10 +91,12 @@ void rtl8192cu_cal_txdesc_chksum(struct tx_desc *ptxdesc); s32 rtl8192cu_xmitframe_complete(_adapter *padapter, struct xmit_priv *pxmitpriv, struct xmit_buf *pxmitbuf); @@ -108131,7 +107530,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #ifdef CONFIG_HOSTAPD_MLME s32 rtl8192cu_hostap_mgnt_xmit_entry(_adapter *padapter, _pkt *pkt); #endif -@@ -77,10 +112,13 @@ struct xmit_buf *rtl8192ce_dequeue_xmitb +@@ -77,10 +112,13 @@ struct xmit_buf *rtl8192ce_dequeue_xmitbuf(struct rtw_tx_ring *ring); void rtl8192ce_xmitframe_resume(_adapter *padapter); @@ -108146,6 +107545,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #ifdef CONFIG_HOSTAPD_MLME s32 rtl8192ce_hostap_mgnt_xmit_entry(_adapter *padapter, _pkt *pkt); #endif +diff --git a/drivers/net/wireless/rtl8192cu/include/rtl8192d_cmd.h b/drivers/net/wireless/rtl8192cu/include/rtl8192d_cmd.h +index cb414a1..ad7e783 100644 --- a/drivers/net/wireless/rtl8192cu/include/rtl8192d_cmd.h +++ b/drivers/net/wireless/rtl8192cu/include/rtl8192d_cmd.h @@ -16,8 +16,7 @@ @@ -108177,7 +107578,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release H2C_CMD_MAX }RTL8192D_H2C_CMD; -@@ -98,12 +103,14 @@ void rtl8192d_set_FwPwrMode_cmd(_adapter +@@ -98,12 +103,14 @@ void rtl8192d_set_FwPwrMode_cmd(_adapter*padapter, u8 Mode); void rtl8192d_set_FwJoinBssReport_cmd(_adapter* padapter, u8 mstatus); u8 rtl8192d_set_rssi_cmd(_adapter*padapter, u8 *param); u8 rtl8192d_set_raid_cmd(_adapter*padapter, u32 mask, u8 arg); @@ -108194,13 +107595,15 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #ifdef CONFIG_WOWLAN typedef struct _SETWOWLAN_PARM{ -@@ -130,4 +137,6 @@ void rtl8192d_set_wowlan_cmd(_adapter* p +@@ -130,4 +137,6 @@ void rtl8192d_set_wowlan_cmd(_adapter* padapter); void SetFwRelatedForWoWLAN8192DU(_adapter* padapter,u8 bHostIsGoingtoSleep); #endif // CONFIG_WOWLAN +#endif // __RTL8192D_CMD_H_ + +diff --git a/drivers/net/wireless/rtl8192cu/include/rtl8192d_dm.h b/drivers/net/wireless/rtl8192cu/include/rtl8192d_dm.h +index ce674f8..ab5e5f7 100644 --- a/drivers/net/wireless/rtl8192cu/include/rtl8192d_dm.h +++ b/drivers/net/wireless/rtl8192cu/include/rtl8192d_dm.h @@ -16,7 +16,7 @@ @@ -108228,7 +107631,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release //============================================================ // structure and define //============================================================ -@@ -101,7 +92,9 @@ typedef struct _Dynamic_Initial_Gain_Thr +@@ -101,7 +92,9 @@ typedef struct _Dynamic_Initial_Gain_Threshold_ u8 LargeFAHit; u8 ForbiddenIGI; u32 Recover_cnt; @@ -108305,6 +107708,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release }; +diff --git a/drivers/net/wireless/rtl8192cu/include/rtl8192d_hal.h b/drivers/net/wireless/rtl8192cu/include/rtl8192d_hal.h +index 30f2955..1ab5f98 100644 --- a/drivers/net/wireless/rtl8192cu/include/rtl8192d_hal.h +++ b/drivers/net/wireless/rtl8192cu/include/rtl8192d_hal.h @@ -20,6 +20,7 @@ @@ -108544,7 +107949,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #if 1 IQK_MATRIX_REGS_SETTING IQKMatrixRegSetting[IQK_Matrix_Settings_NUM]; #else -@@ -935,11 +1079,10 @@ typedef struct hal_data_8192du HAL_DATA_ +@@ -935,11 +1079,10 @@ typedef struct hal_data_8192du HAL_DATA_TYPE, *PHAL_DATA_TYPE; int FirmwareDownload92D(IN PADAPTER Adapter,IN BOOLEAN bUsedWoWLANFw); VOID rtl8192d_FirmwareSelfReset(IN PADAPTER Adapter); void rtl8192d_ReadChipVersion(IN PADAPTER Adapter); @@ -108557,6 +107962,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release BOOLEAN PHY_CheckPowerOffFor8192D(PADAPTER Adapter); VOID PHY_SetPowerOnFor8192D(PADAPTER Adapter); //void PHY_ConfigMacPhyMode92D(PADAPTER Adapter); +diff --git a/drivers/net/wireless/rtl8192cu/include/rtl8192d_led.h b/drivers/net/wireless/rtl8192cu/include/rtl8192d_led.h +index 454a1b8..d736bda4 100644 --- a/drivers/net/wireless/rtl8192cu/include/rtl8192d_led.h +++ b/drivers/net/wireless/rtl8192cu/include/rtl8192d_led.h @@ -16,8 +16,7 @@ @@ -108569,6 +107976,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #ifndef __RTL8192D_LED_H_ #define __RTL8192D_LED_H_ +diff --git a/drivers/net/wireless/rtl8192cu/include/rtl8192d_recv.h b/drivers/net/wireless/rtl8192cu/include/rtl8192d_recv.h +index 3ffc646..36cc232 100644 --- a/drivers/net/wireless/rtl8192cu/include/rtl8192d_recv.h +++ b/drivers/net/wireless/rtl8192cu/include/rtl8192d_recv.h @@ -61,7 +61,11 @@ @@ -108584,6 +107993,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #else #define MAX_RECVBUF_SZ (4000) // about 4K #endif +diff --git a/drivers/net/wireless/rtl8192cu/include/rtl8192d_rf.h b/drivers/net/wireless/rtl8192cu/include/rtl8192d_rf.h +index 6995464..0b439a3 100644 --- a/drivers/net/wireless/rtl8192cu/include/rtl8192d_rf.h +++ b/drivers/net/wireless/rtl8192cu/include/rtl8192d_rf.h @@ -16,8 +16,7 @@ @@ -108596,6 +108007,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release /****************************************************************************** * * +diff --git a/drivers/net/wireless/rtl8192cu/include/rtl8192d_spec.h b/drivers/net/wireless/rtl8192cu/include/rtl8192d_spec.h +index 9bba78a..bef7184 100644 --- a/drivers/net/wireless/rtl8192cu/include/rtl8192d_spec.h +++ b/drivers/net/wireless/rtl8192cu/include/rtl8192d_spec.h @@ -113,7 +113,9 @@ @@ -108694,6 +108107,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release // The same function but different bit field. #define DIS_TSF_UDT0_NORMAL_CHIP BIT(4) #define DIS_TSF_UDT0_TEST_CHIP BIT(5) +diff --git a/drivers/net/wireless/rtl8192cu/include/rtl8192d_xmit.h b/drivers/net/wireless/rtl8192cu/include/rtl8192d_xmit.h +index 0babb27..d01fb4a 100644 --- a/drivers/net/wireless/rtl8192cu/include/rtl8192d_xmit.h +++ b/drivers/net/wireless/rtl8192cu/include/rtl8192d_xmit.h @@ -16,22 +16,10 @@ @@ -108773,7 +108188,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #ifdef CONFIG_USB_HCI #ifdef CONFIG_USB_TX_AGGREGATION -@@ -72,10 +106,13 @@ void rtl8192du_cal_txdesc_chksum(struct +@@ -72,10 +106,13 @@ void rtl8192du_cal_txdesc_chksum(struct tx_desc *ptxdesc); s32 rtl8192du_xmitframe_complete(_adapter *padapter, struct xmit_priv *pxmitpriv, struct xmit_buf *pxmitbuf); @@ -108788,7 +108203,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #ifdef CONFIG_HOSTAPD_MLME s32 rtl8192du_hostap_mgnt_xmit_entry(_adapter *padapter, _pkt *pkt); #endif -@@ -91,10 +128,12 @@ struct xmit_buf *rtl8192de_dequeue_xmitb +@@ -91,10 +128,12 @@ struct xmit_buf *rtl8192de_dequeue_xmitbuf(struct rtw_tx_ring *ring); void rtl8192de_xmitframe_resume(_adapter *padapter); @@ -108802,6 +108217,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #ifdef CONFIG_HOSTAPD_MLME s32 rtl8192de_hostap_mgnt_xmit_entry(_adapter *padapter, _pkt *pkt); #endif +diff --git a/drivers/net/wireless/rtl8192cu/include/rtw_android.h b/drivers/net/wireless/rtl8192cu/include/rtw_android.h +index e1a0432..f9214c2 100644 --- a/drivers/net/wireless/rtl8192cu/include/rtw_android.h +++ b/drivers/net/wireless/rtl8192cu/include/rtw_android.h @@ -59,22 +59,32 @@ enum ANDROID_WIFI_CMD { @@ -108841,6 +108258,9 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #endif //__RTW_ANDROID_H__ +diff --git a/drivers/net/wireless/rtl8192cu/include/rtw_ap.h b/drivers/net/wireless/rtl8192cu/include/rtw_ap.h +new file mode 100644 +index 0000000..42be4c6 --- /dev/null +++ b/drivers/net/wireless/rtl8192cu/include/rtw_ap.h @@ -0,0 +1,64 @@ @@ -108908,6 +108328,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + +#endif + +diff --git a/drivers/net/wireless/rtl8192cu/include/rtw_byteorder.h b/drivers/net/wireless/rtl8192cu/include/rtw_byteorder.h +index 1313a25..0f06b7a 100644 --- a/drivers/net/wireless/rtl8192cu/include/rtw_byteorder.h +++ b/drivers/net/wireless/rtl8192cu/include/rtw_byteorder.h @@ -16,8 +16,7 @@ @@ -108920,6 +108342,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #ifndef _RTL871X_BYTEORDER_H_ #define _RTL871X_BYTEORDER_H_ +diff --git a/drivers/net/wireless/rtl8192cu/include/rtw_cmd.h b/drivers/net/wireless/rtl8192cu/include/rtw_cmd.h +index 0556d0b..ab115c5 100644 --- a/drivers/net/wireless/rtl8192cu/include/rtw_cmd.h +++ b/drivers/net/wireless/rtl8192cu/include/rtw_cmd.h @@ -16,8 +16,7 @@ @@ -108981,7 +108405,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release extern u32 rtw_enqueue_cmd(struct cmd_priv *pcmdpriv, struct cmd_obj *obj); extern struct cmd_obj *rtw_dequeue_cmd(struct cmd_priv *pcmdpriv); extern void rtw_free_cmd_obj(struct cmd_obj *pcmd); -@@ -131,6 +149,7 @@ extern struct evt_obj *rtw_dequeue_evt(_ +@@ -131,6 +149,7 @@ extern struct evt_obj *rtw_dequeue_evt(_queue *queue); extern void rtw_free_evt_obj(struct evt_obj *pcmd); #endif @@ -109065,7 +108489,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release extern u8 rtw_setopmode_cmd(_adapter *padapter, NDIS_802_11_NETWORK_INFRASTRUCTURE networktype); extern u8 rtw_setdatarate_cmd(_adapter *padapter, u8 *rateset); extern u8 rtw_setbasicrate_cmd(_adapter *padapter, u8 *rateset); -@@ -931,7 +960,9 @@ extern u8 rtw_setfwdig_cmd(_adapter*pada +@@ -931,7 +960,9 @@ extern u8 rtw_setfwdig_cmd(_adapter*padapter, u8 type); extern u8 rtw_setfwra_cmd(_adapter*padapter, u8 type); extern u8 rtw_addbareq_cmd(_adapter*padapter, u8 tid, u8 *addr); @@ -109101,7 +108525,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release GEN_CMD_CODE(_SetChannelSwitch), /*61*/ GEN_CMD_CODE(_TDLS), /*62*/ -@@ -1123,6 +1157,7 @@ struct _cmd_callback rtw_cmd_callback[] +@@ -1123,6 +1157,7 @@ struct _cmd_callback rtw_cmd_callback[] = {GEN_CMD_CODE(_Set_H2C_MSG), NULL},/*58*/ {GEN_CMD_CODE(_SetChannelPlan), NULL},/*59*/ {GEN_CMD_CODE(_LedBlink), NULL},/*60*/ @@ -109109,6 +108533,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release {GEN_CMD_CODE(_SetChannelSwitch), NULL},/*61*/ {GEN_CMD_CODE(_TDLS), NULL},/*62*/ }; +diff --git a/drivers/net/wireless/rtl8192cu/include/rtw_debug.h b/drivers/net/wireless/rtl8192cu/include/rtw_debug.h +index eca6692..0ccf220 100644 --- a/drivers/net/wireless/rtl8192cu/include/rtw_debug.h +++ b/drivers/net/wireless/rtl8192cu/include/rtw_debug.h @@ -1,7 +1,7 @@ @@ -109132,8 +108558,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #define _drv_info_ 7 #define _drv_dump_ 8 #define _drv_debug_ 9 -+#define _drv_always_ _drv_emerg_ - +- - -#define _module_rtl871x_xmit_c_ BIT(0) -#define _module_xmit_osdep_c_ BIT(1) @@ -109158,6 +108583,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release -#define _module_hci_intfs_c_ BIT(20) -#define _module_hci_ops_c_ BIT(21) -#define _module_osdep_service_c_ BIT(22) ++#define _drv_always_ _drv_emerg_ ++ +#define _module_rtl871x_xmit_c_ BIT(0) +#define _module_xmit_osdep_c_ BIT(1) +#define _module_rtl871x_recv_c_ BIT(2) @@ -109269,38 +108696,38 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #elif defined _RTL8712_RECV_C_ #define _MODULE_DEFINE_ _module_rtl8712_recv_c_ #elif defined _RTL8192CU_RECV_C_ -@@ -161,19 +171,23 @@ extern void rtl871x_cedbg(const char *fm +@@ -161,19 +171,23 @@ extern void rtl871x_cedbg(const char *fmt, ...); #ifdef PLATFORM_WINDOWS - #ifdef PLATFORM_OS_XP + #ifdef PLATFORM_OS_XP -+ -+ #define _dbgdump DbgPrint - #define _dbgdump DbgPrint -+ #elif defined PLATFORM_OS_CE ++ #define _dbgdump DbgPrint - #elif defined PLATFORM_OS_CE -+ #define _dbgdump rtl871x_cedbg ++ #elif defined PLATFORM_OS_CE - #define _dbgdump rtl871x_cedbg -+ #endif -+ -+#elif defined PLATFORM_LINUX ++ #define _dbgdump rtl871x_cedbg - #endif -+ #define _dbgdump printk ++ #endif - #elif defined PLATFORM_LINUX -+#elif defined PLATFORM_FREEBSD ++#elif defined PLATFORM_LINUX - #define _dbgdump printk ++ #define _dbgdump printk ++ ++#elif defined PLATFORM_FREEBSD ++ + #define _dbgdump printf #endif -@@ -186,8 +200,8 @@ extern void rtl871x_cedbg(const char *fm +@@ -186,8 +200,8 @@ extern void rtl871x_cedbg(const char *fmt, ...); #define RT_TRACE(_Comp, _Level, Fmt)\ do {\ if((_Comp & GlobalDebugComponents) && (_Level <= GlobalDebugLevel)) {\ @@ -109311,7 +108738,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release }\ }while(0) -@@ -233,21 +247,34 @@ extern void rtl871x_cedbg(const char *fm +@@ -233,21 +247,34 @@ extern void rtl871x_cedbg(const char *fmt, ...); #ifdef CONFIG_DEBUG_RTL819X @@ -109355,7 +108782,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #ifdef PLATFORM_WINDOWS #define DBG_871X do {} while(0) #define MSG_8192C do {} while(0) -@@ -264,15 +291,38 @@ extern void rtl871x_cedbg(const char *fm +@@ -264,15 +291,38 @@ extern void rtl871x_cedbg(const char *fmt, ...); #define ERR_8192C(x,...) do {} while(0) #endif @@ -109370,9 +108797,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + #define WRN_8192C(x,...) do {} while(0) + #define ERR_8192C(x,...) do {} while(0) +#endif - -- #undef MSG_8192C -- #define MSG_8192C _dbgdump ++ +extern u32 GlobalDebugLevel; +#define LOG_LEVEL(level, ...)\ + do {\ @@ -109382,7 +108807,9 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + }while(0) + +#define DBG_871X_LEVEL LOG_LEVEL -+ + +- #undef MSG_8192C +- #define MSG_8192C _dbgdump +#if defined (_dbgdump) + #undef DBG_871X +// #define DBG_871X _dbgdump @@ -109401,7 +108828,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #undef WRN_8192C #define WRN_8192C _dbgdump -@@ -282,13 +332,25 @@ extern void rtl871x_cedbg(const char *fm +@@ -282,13 +332,25 @@ extern void rtl871x_cedbg(const char *fmt, ...); #endif @@ -109428,7 +108855,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release int proc_get_write_reg(char *page, char **start, off_t offset, int count, int *eof, void *data); -@@ -340,6 +402,45 @@ extern void rtl871x_cedbg(const char *fm +@@ -340,6 +402,45 @@ extern void rtl871x_cedbg(const char *fmt, ...); off_t offset, int count, int *eof, void *data); @@ -109474,7 +108901,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #ifdef CONFIG_AP_MODE -@@ -359,6 +460,8 @@ extern void rtl871x_cedbg(const char *fm +@@ -359,6 +460,8 @@ extern void rtl871x_cedbg(const char *fmt, ...); int proc_get_best_channel(char *page, char **start, off_t offset, int count, int *eof, void *data); @@ -109483,7 +108910,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #endif int proc_get_rx_signal(char *page, char **start, -@@ -367,13 +470,47 @@ extern void rtl871x_cedbg(const char *fm +@@ -367,13 +470,47 @@ extern void rtl871x_cedbg(const char *fmt, ...); int proc_set_rx_signal(struct file *file, const char *buffer, unsigned long count, void *data); @@ -109531,7 +108958,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release int proc_get_rssi_disp(char *page, char **start, off_t offset, int count, -@@ -381,7 +518,19 @@ extern void rtl871x_cedbg(const char *fm +@@ -381,7 +518,19 @@ extern void rtl871x_cedbg(const char *fmt, ...); int proc_set_rssi_disp(struct file *file, const char *buffer, unsigned long count, void *data); @@ -109552,6 +108979,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #endif //CONFIG_PROC_DEBUG +diff --git a/drivers/net/wireless/rtl8192cu/include/rtw_eeprom.h b/drivers/net/wireless/rtl8192cu/include/rtw_eeprom.h +index 9d31998..ce834dd 100644 --- a/drivers/net/wireless/rtl8192cu/include/rtw_eeprom.h +++ b/drivers/net/wireless/rtl8192cu/include/rtw_eeprom.h @@ -16,8 +16,7 @@ @@ -109564,6 +108993,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #ifndef __RTW_EEPROM_H__ #define __RTW_EEPROM_H__ +diff --git a/drivers/net/wireless/rtl8192cu/include/rtw_efuse.h b/drivers/net/wireless/rtl8192cu/include/rtw_efuse.h +index 66be910..224aa4f 100644 --- a/drivers/net/wireless/rtl8192cu/include/rtw_efuse.h +++ b/drivers/net/wireless/rtl8192cu/include/rtw_efuse.h @@ -1,7 +1,7 @@ @@ -109575,7 +109006,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release * 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. -@@ -106,7 +106,7 @@ u8 rtw_efuse_map_write(PADAPTER padapter +@@ -106,7 +106,7 @@ u8 rtw_efuse_map_write(PADAPTER padapter, u16 addr, u16 cnts, u8 *data); u16 Efuse_GetCurrentSize(PADAPTER pAdapter, u8 efuseType, BOOLEAN bPseudoTest); u8 Efuse_CalculateWordCnts(u8 word_en); void ReadEFuseByte(PADAPTER Adapter, u16 _offset, u8 *pbuf, BOOLEAN bPseudoTest) ; @@ -109584,11 +109015,13 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release u8 efuse_OneByteRead(PADAPTER pAdapter, u16 addr, u8 *data, BOOLEAN bPseudoTest); u8 efuse_OneByteWrite(PADAPTER pAdapter, u16 addr, u8 data, BOOLEAN bPseudoTest); -@@ -121,3 +121,4 @@ void EFUSE_ShadowMapUpdate(PADAPTER pAda +@@ -121,3 +121,4 @@ void EFUSE_ShadowMapUpdate(PADAPTER pAdapter, u8 efuseType, BOOLEAN bPseudoTest) void EFUSE_ShadowRead(PADAPTER pAdapter, u8 Type, u16 Offset, u32 *Value); #endif + +diff --git a/drivers/net/wireless/rtl8192cu/include/rtw_event.h b/drivers/net/wireless/rtl8192cu/include/rtw_event.h +index dd9f097..4299ddc 100644 --- a/drivers/net/wireless/rtl8192cu/include/rtw_event.h +++ b/drivers/net/wireless/rtl8192cu/include/rtw_event.h @@ -16,8 +16,7 @@ @@ -109611,6 +109044,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release }; struct addba_event +diff --git a/drivers/net/wireless/rtl8192cu/include/rtw_ht.h b/drivers/net/wireless/rtl8192cu/include/rtw_ht.h +index 4dcad2b..3cd904d 100644 --- a/drivers/net/wireless/rtl8192cu/include/rtw_ht.h +++ b/drivers/net/wireless/rtl8192cu/include/rtw_ht.h @@ -16,8 +16,7 @@ @@ -109623,6 +109058,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #ifndef _RTW_HT_H_ #define _RTW_HT_H_ +diff --git a/drivers/net/wireless/rtl8192cu/include/rtw_io.h b/drivers/net/wireless/rtl8192cu/include/rtw_io.h +index b1f57c1..c66845c 100644 --- a/drivers/net/wireless/rtl8192cu/include/rtw_io.h +++ b/drivers/net/wireless/rtl8192cu/include/rtw_io.h @@ -16,8 +16,8 @@ @@ -109731,7 +109168,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release }; struct io_req { -@@ -424,26 +381,30 @@ extern int _rtw_write16_async(_adapter * +@@ -424,26 +381,30 @@ extern int _rtw_write16_async(_adapter *adapter, u32 addr, u16 val); extern int _rtw_write32_async(_adapter *adapter, u32 addr, u32 val); extern void _rtw_write_mem(_adapter *adapter, u32 addr, u32 cnt, u8 *pmem); @@ -109770,7 +109207,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #define rtw_write8(adapter, addr, val) dbg_rtw_write8((adapter), (addr), (val), __FUNCTION__, __LINE__) #define rtw_write16(adapter, addr, val) dbg_rtw_write16((adapter), (addr), (val), __FUNCTION__, __LINE__) #define rtw_write32(adapter, addr, val) dbg_rtw_write32((adapter), (addr), (val), __FUNCTION__, __LINE__) -@@ -455,7 +416,7 @@ extern int dbg_rtw_writeN(_adapter *adap +@@ -455,7 +416,7 @@ extern int dbg_rtw_writeN(_adapter *adapter, u32 addr ,u32 length , u8 *data, co #define rtw_write_mem(adapter, addr, cnt, mem) _rtw_write_mem((adapter), addr, cnt, mem) #define rtw_write_port(adapter, addr, cnt, mem) _rtw_write_port(adapter, addr, cnt, mem) @@ -109779,7 +109216,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #define rtw_write_port_cancel(adapter) _rtw_write_port_cancel(adapter) #else //DBG_IO #define rtw_read8(adapter, addr) _rtw_read8((adapter), (addr)) -@@ -476,7 +437,7 @@ extern int dbg_rtw_writeN(_adapter *adap +@@ -476,7 +437,7 @@ extern int dbg_rtw_writeN(_adapter *adapter, u32 addr ,u32 length , u8 *data, co #define rtw_write_mem(adapter, addr, cnt, mem) _rtw_write_mem((adapter), (addr), (cnt), (mem)) #define rtw_write_port(adapter, addr, cnt, mem) _rtw_write_port((adapter), (addr), (cnt), (mem)) @@ -109788,7 +109225,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #define rtw_write_port_cancel(adapter) _rtw_write_port_cancel((adapter)) #endif //DBG_IO -@@ -512,7 +473,7 @@ extern void async_write_mem(_adapter *ad +@@ -512,7 +473,7 @@ extern void async_write_mem(_adapter *adapter, u32 addr, u32 cnt, u8 *pmem); extern void async_write_port(_adapter *adapter, u32 addr, u32 cnt, u8 *pmem); @@ -109797,6 +109234,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release extern uint alloc_io_queue(_adapter *adapter); +diff --git a/drivers/net/wireless/rtl8192cu/include/rtw_ioctl.h b/drivers/net/wireless/rtl8192cu/include/rtw_ioctl.h +index e6d34f0..c4da301 100644 --- a/drivers/net/wireless/rtl8192cu/include/rtw_ioctl.h +++ b/drivers/net/wireless/rtl8192cu/include/rtw_ioctl.h @@ -16,8 +16,7 @@ @@ -109840,7 +109279,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release static NDIS_STATUS oid_null_function(struct oid_par_priv* poid_par_priv) { _func_enter_; -@@ -243,10 +243,8 @@ void Set_802_3_MULTICAST_LIST(ADAPTER *p +@@ -243,10 +243,8 @@ void Set_802_3_MULTICAST_LIST(ADAPTER *pAdapter, UCHAR *MCListbuf, ULONG MCListl #endif// end of PLATFORM_WINDOWS @@ -109852,6 +109291,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #endif extern NDIS_STATUS drv_query_info( +diff --git a/drivers/net/wireless/rtl8192cu/include/rtw_ioctl_query.h b/drivers/net/wireless/rtl8192cu/include/rtw_ioctl_query.h +index e9ad16f1..5b6018a 100644 --- a/drivers/net/wireless/rtl8192cu/include/rtw_ioctl_query.h +++ b/drivers/net/wireless/rtl8192cu/include/rtw_ioctl_query.h @@ -16,8 +16,7 @@ @@ -109864,6 +109305,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #ifndef _RTW_IOCTL_QUERY_H_ #define _RTW_IOCTL_QUERY_H_ +diff --git a/drivers/net/wireless/rtl8192cu/include/rtw_ioctl_rtl.h b/drivers/net/wireless/rtl8192cu/include/rtw_ioctl_rtl.h +index 1ea8f21..3bff766 100644 --- a/drivers/net/wireless/rtl8192cu/include/rtw_ioctl_rtl.h +++ b/drivers/net/wireless/rtl8192cu/include/rtw_ioctl_rtl.h @@ -16,8 +16,7 @@ @@ -109876,6 +109319,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #ifndef _RTW_IOCTL_RTL_H_ #define _RTW_IOCTL_RTL_H_ +diff --git a/drivers/net/wireless/rtl8192cu/include/rtw_ioctl_set.h b/drivers/net/wireless/rtl8192cu/include/rtw_ioctl_set.h +index 577af51..82f9810 100644 --- a/drivers/net/wireless/rtl8192cu/include/rtw_ioctl_set.h +++ b/drivers/net/wireless/rtl8192cu/include/rtw_ioctl_set.h @@ -16,8 +16,7 @@ @@ -109888,7 +109333,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #ifndef __RTW_IOCTL_SET_H_ #define __RTW_IOCTL_SET_H_ -@@ -60,19 +59,21 @@ u8 rtw_set_802_11_authentication_mode(_a +@@ -60,19 +59,21 @@ u8 rtw_set_802_11_authentication_mode(_adapter *pdapter, NDIS_802_11_AUTHENTICAT u8 rtw_set_802_11_bssid(_adapter* padapter, u8 *bssid); u8 rtw_set_802_11_add_wep(_adapter * padapter, NDIS_802_11_WEP * wep); u8 rtw_set_802_11_disassociate(_adapter * padapter); @@ -109913,6 +109358,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #endif +diff --git a/drivers/net/wireless/rtl8192cu/include/rtw_led.h b/drivers/net/wireless/rtl8192cu/include/rtw_led.h +index 72634f8..b5365ba 100644 --- a/drivers/net/wireless/rtl8192cu/include/rtw_led.h +++ b/drivers/net/wireless/rtl8192cu/include/rtw_led.h @@ -16,8 +16,7 @@ @@ -109983,6 +109430,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } LED_871x, *PLED_871x; +diff --git a/drivers/net/wireless/rtl8192cu/include/rtw_mlme.h b/drivers/net/wireless/rtl8192cu/include/rtw_mlme.h +index 0beca93..d9d6456 100644 --- a/drivers/net/wireless/rtl8192cu/include/rtw_mlme.h +++ b/drivers/net/wireless/rtl8192cu/include/rtw_mlme.h @@ -16,18 +16,21 @@ @@ -110442,7 +109891,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release extern int event_thread(void *context); extern void rtw_join_timeout_handler(void* FunctionContext); extern void _rtw_scan_timeout_handler(void* FunctionContext); -@@ -563,6 +721,11 @@ __inline static void up_scanned_network( +@@ -563,6 +721,11 @@ __inline static void up_scanned_network(struct mlme_priv *pmlmepriv) _exit_critical_bh(&pmlmepriv->lock, &irqL); } @@ -110454,7 +109903,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release __inline static void down_scanned_network(struct mlme_priv *pmlmepriv) { _irqL irqL; -@@ -592,6 +755,7 @@ extern void rtw_free_assoc_resources(_ad +@@ -592,6 +755,7 @@ extern void rtw_free_assoc_resources(_adapter* adapter, int lock_scanned_queue); extern void rtw_indicate_disconnect(_adapter* adapter); extern void rtw_indicate_connect(_adapter* adapter); void rtw_indicate_scan_done( _adapter *padapter, bool aborted); @@ -110462,7 +109911,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release extern int rtw_restruct_sec_ie(_adapter *adapter,u8 *in_ie,u8 *out_ie,uint in_len); extern int rtw_restruct_wmm_ie(_adapter *adapter, u8 *in_ie, u8 *out_ie, uint in_len, uint initial_out_len); -@@ -606,8 +770,15 @@ extern void rtw_scan_timeout_handler(_ad +@@ -606,8 +770,15 @@ extern void rtw_scan_timeout_handler(_adapter *adapter); extern void rtw_dynamic_check_timer_handlder(_adapter *adapter); #ifdef CONFIG_SET_SCAN_DENY_TIMER @@ -110480,7 +109929,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #endif -@@ -643,16 +814,24 @@ u8 *rtw_get_beacon_interval_from_ie(u8 * +@@ -643,16 +814,24 @@ u8 *rtw_get_beacon_interval_from_ie(u8 *ie); void rtw_joinbss_reset(_adapter *padapter); #ifdef CONFIG_80211N_HT @@ -110509,6 +109958,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #endif +diff --git a/drivers/net/wireless/rtl8192cu/include/rtw_mlme_ext.h b/drivers/net/wireless/rtl8192cu/include/rtw_mlme_ext.h +index d9a203f..5cddca4 100644 --- a/drivers/net/wireless/rtl8192cu/include/rtw_mlme_ext.h +++ b/drivers/net/wireless/rtl8192cu/include/rtw_mlme_ext.h @@ -16,8 +16,7 @@ @@ -110789,7 +110240,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release }; int init_mlme_ext_priv(_adapter* padapter); -@@ -444,26 +515,34 @@ int init_hw_mlme_ext(_adapter *padapter) +@@ -444,26 +515,34 @@ int init_hw_mlme_ext(_adapter *padapter); void free_mlme_ext_priv (struct mlme_ext_priv *pmlmeext); extern void init_mlme_ext_timer(_adapter *padapter); extern void init_addba_retry_timer(_adapter *padapter, struct sta_info *psta); @@ -110832,7 +110283,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release void set_channel_bwmode(_adapter *padapter, unsigned char channel, unsigned char channel_offset, unsigned short bwmode); void SelectChannel(_adapter *padapter, unsigned char channel); -@@ -500,7 +579,6 @@ int WMM_param_handler(_adapter *padapter +@@ -500,7 +579,6 @@ int WMM_param_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE); #ifdef CONFIG_WFD int WFD_info_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE); #endif @@ -110840,7 +110291,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release void WMMOnAssocRsp(_adapter *padapter); void HT_caps_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE); -@@ -517,6 +595,7 @@ void process_csa_ie(_adapter *padapter, +@@ -517,6 +595,7 @@ void process_csa_ie(_adapter *padapter, u8 *pframe, uint len); void update_IOT_info(_adapter *padapter); void update_capinfo(PADAPTER Adapter, u16 updateCap); void update_wireless_mode(_adapter * padapter); @@ -110848,7 +110299,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release void update_bmc_sta_support_rate(_adapter *padapter, u32 mac_id); int update_sta_support_rate(_adapter *padapter, u8* pvar_ie, uint var_ie_len, int cam_idx); -@@ -544,50 +623,37 @@ void report_add_sta_event(_adapter *pada +@@ -544,50 +623,37 @@ void report_add_sta_event(_adapter *padapter, unsigned char* MacAddr, int cam_id void beacon_timing_control(_adapter *padapter); extern u8 set_tx_beacon_cmd(_adapter*padapter); unsigned int setup_beacon_frame(_adapter *padapter, unsigned char *beacon_frame); @@ -110915,7 +110366,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release unsigned int send_delba(_adapter *padapter, u8 initiator, u8 *addr); unsigned int send_beacon(_adapter *padapter); -@@ -609,11 +675,15 @@ unsigned int OnAuthClient(_adapter *pada +@@ -609,11 +675,15 @@ unsigned int OnAuthClient(_adapter *padapter, union recv_frame *precv_frame); unsigned int OnDeAuth(_adapter *padapter, union recv_frame *precv_frame); unsigned int OnAction(_adapter *padapter, union recv_frame *precv_frame); @@ -110932,7 +110383,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release unsigned int OnAction_wmm(_adapter *padapter, union recv_frame *precv_frame); unsigned int OnAction_p2p(_adapter *padapter, union recv_frame *precv_frame); -@@ -627,6 +697,9 @@ void linked_status_chk(_adapter *padapte +@@ -627,6 +697,9 @@ void linked_status_chk(_adapter *padapter); void survey_timer_hdl (_adapter *padapter); void link_timer_hdl (_adapter *padapter); void addba_timer_hdl(struct sta_info *psta); @@ -110942,7 +110393,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release //void reauth_timer_hdl(_adapter *padapter); //void reassoc_timer_hdl(_adapter *padapter); -@@ -641,7 +714,13 @@ void addba_timer_hdl(struct sta_info *ps +@@ -641,7 +714,13 @@ void addba_timer_hdl(struct sta_info *psta); /*DBG_871X("%s set_link_timer(%p, %d)\n", __FUNCTION__, (mlmeext), (ms));*/ \ _set_timer(&(mlmeext)->link_timer, (ms)); \ } while(0) @@ -110957,7 +110408,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release extern int cckrates_included(unsigned char *rate, int ratelen); extern int cckratesonly_included(unsigned char *rate, int ratelen); -@@ -650,24 +729,29 @@ extern void process_addba_req(_adapter * +@@ -650,24 +729,29 @@ extern void process_addba_req(_adapter *padapter, u8 *paddba_req, u8 *addr); extern void update_TSF(struct mlme_ext_priv *pmlmeext, u8 *pframe, uint len); extern void correct_TSF(_adapter *padapter, struct mlme_ext_priv *pmlmeext); @@ -111004,7 +110455,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release struct cmd_hdl { uint parmsize; -@@ -699,6 +783,7 @@ u8 add_ba_hdl(_adapter *padapter, unsign +@@ -699,6 +783,7 @@ u8 add_ba_hdl(_adapter *padapter, unsigned char *pbuf); u8 mlme_evt_hdl(_adapter *padapter, unsigned char *pbuf); u8 h2c_msg_hdl(_adapter *padapter, unsigned char *pbuf); u8 tx_beacon_hdl(_adapter *padapter, unsigned char *pbuf); @@ -111021,6 +110472,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release GEN_MLME_EXT_HANDLER(0, NULL) GEN_MLME_EXT_HANDLER(0, NULL) GEN_MLME_EXT_HANDLER(0, NULL) +diff --git a/drivers/net/wireless/rtl8192cu/include/rtw_mp.h b/drivers/net/wireless/rtl8192cu/include/rtw_mp.h +index a468714..0ebb1ba 100644 --- a/drivers/net/wireless/rtl8192cu/include/rtw_mp.h +++ b/drivers/net/wireless/rtl8192cu/include/rtw_mp.h @@ -192,7 +192,7 @@ struct mp_tx @@ -111045,7 +110498,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release //======================================================================= //extern struct mp_xmit_frame *alloc_mp_xmitframe(struct mp_priv *pmp_priv); -@@ -673,8 +679,6 @@ extern void GetPowerTracking(PADAPTER pa +@@ -673,8 +679,6 @@ extern void GetPowerTracking(PADAPTER padapter, u8 *enable); extern u32 mp_query_psd(PADAPTER pAdapter, u8 *data); @@ -111054,6 +110507,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release extern void Hal_SetAntenna(PADAPTER pAdapter); extern void Hal_SetBandwidth(PADAPTER pAdapter); +diff --git a/drivers/net/wireless/rtl8192cu/include/rtw_mp_ioctl.h b/drivers/net/wireless/rtl8192cu/include/rtw_mp_ioctl.h +index e16df40..962bc38 100644 --- a/drivers/net/wireless/rtl8192cu/include/rtw_mp_ioctl.h +++ b/drivers/net/wireless/rtl8192cu/include/rtw_mp_ioctl.h @@ -1,7 +1,7 @@ @@ -111065,6 +110520,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release * 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. +diff --git a/drivers/net/wireless/rtl8192cu/include/rtw_mp_phy_regdef.h b/drivers/net/wireless/rtl8192cu/include/rtw_mp_phy_regdef.h +index 4906005..0b47cb5 100644 --- a/drivers/net/wireless/rtl8192cu/include/rtw_mp_phy_regdef.h +++ b/drivers/net/wireless/rtl8192cu/include/rtw_mp_phy_regdef.h @@ -16,8 +16,7 @@ @@ -111077,9 +110534,11 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release /***************************************************************************** * * Module: __RTW_MP_PHY_REGDEF_H_ +diff --git a/drivers/net/wireless/rtl8192cu/include/rtw_p2p.h b/drivers/net/wireless/rtl8192cu/include/rtw_p2p.h +index a29ceaa..4249bc9 100644 --- a/drivers/net/wireless/rtl8192cu/include/rtw_p2p.h +++ b/drivers/net/wireless/rtl8192cu/include/rtw_p2p.h -@@ -29,11 +29,13 @@ u32 build_assoc_resp_p2p_ie(struct wifid +@@ -29,11 +29,13 @@ u32 build_assoc_resp_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8 status u32 build_deauth_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf); #ifdef CONFIG_WFD u32 build_probe_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf); @@ -111094,7 +110553,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release u32 build_assoc_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf); u32 build_assoc_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf); u32 build_provdisc_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf); -@@ -51,16 +53,24 @@ u8 process_p2p_group_negotation_resp( st +@@ -51,16 +53,24 @@ u8 process_p2p_group_negotation_resp( struct wifidirect_info *pwdinfo, u8 *pfram u8 process_p2p_group_negotation_confirm( struct wifidirect_info *pwdinfo, u8 *pframe, uint len ); u8 process_p2p_presence_req(struct wifidirect_info *pwdinfo, u8 *pframe, uint len); @@ -111122,6 +110581,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release void init_wifidirect_info( _adapter* padapter, enum P2P_ROLE role); int rtw_p2p_enable(_adapter *padapter, enum P2P_ROLE role); +diff --git a/drivers/net/wireless/rtl8192cu/include/rtw_pwrctrl.h b/drivers/net/wireless/rtl8192cu/include/rtw_pwrctrl.h +index 2b00beb..a4cb292 100644 --- a/drivers/net/wireless/rtl8192cu/include/rtw_pwrctrl.h +++ b/drivers/net/wireless/rtl8192cu/include/rtw_pwrctrl.h @@ -16,8 +16,7 @@ @@ -111144,50 +110605,45 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release -#define PS_ALL_ON BIT(2) -#define PS_ST_ACTIVE BIT(3) -#define PS_LP BIT(4) // low performance -- --#define PS_STATE_MASK (0x0F) --#define PS_STATE_HW_MASK (0x07) --#define PS_SEQ_MASK (0xc0) -- --#define PS_STATE(x) (PS_STATE_MASK & (x)) --#define PS_STATE_HW(x) (PS_STATE_HW_MASK & (x)) --#define PS_SEQ(x) (PS_SEQ_MASK & (x)) -- --#define PS_STATE_S0 (PS_DPS) --#define PS_STATE_S1 (PS_LCLK) --#define PS_STATE_S2 (PS_RF_OFF) --#define PS_STATE_S3 (PS_ALL_ON) --#define PS_STATE_S4 ((PS_ST_ACTIVE) | (PS_ALL_ON)) -- -- --#define PS_IS_RF_ON(x) ((x) & (PS_ALL_ON)) --#define PS_IS_ACTIVE(x) ((x) & (PS_ST_ACTIVE)) --#define CLR_PS_STATE(x) ((x) = ((x) & (0xF0))) +#define PS_DPS BIT(0) +#define PS_LCLK (PS_DPS) +#define PS_RF_OFF BIT(1) +#define PS_ALL_ON BIT(2) +#define PS_ST_ACTIVE BIT(3) -+ + +-#define PS_STATE_MASK (0x0F) +-#define PS_STATE_HW_MASK (0x07) +-#define PS_SEQ_MASK (0xc0) +#define PS_ISR_ENABLE BIT(4) +#define PS_IMR_ENABLE BIT(5) +#define PS_ACK BIT(6) +#define PS_TOGGLE BIT(7) -+ + +-#define PS_STATE(x) (PS_STATE_MASK & (x)) +-#define PS_STATE_HW(x) (PS_STATE_HW_MASK & (x)) +-#define PS_SEQ(x) (PS_SEQ_MASK & (x)) +#define PS_STATE_MASK (0x0F) +#define PS_STATE_HW_MASK (0x07) +#define PS_SEQ_MASK (0xc0) -+ + +-#define PS_STATE_S0 (PS_DPS) +-#define PS_STATE_S1 (PS_LCLK) +-#define PS_STATE_S2 (PS_RF_OFF) +-#define PS_STATE_S3 (PS_ALL_ON) +-#define PS_STATE_S4 ((PS_ST_ACTIVE) | (PS_ALL_ON)) +#define PS_STATE(x) (PS_STATE_MASK & (x)) +#define PS_STATE_HW(x) (PS_STATE_HW_MASK & (x)) +#define PS_SEQ(x) (PS_SEQ_MASK & (x)) -+ + +#define PS_STATE_S0 (PS_DPS) +#define PS_STATE_S1 (PS_LCLK) +#define PS_STATE_S2 (PS_RF_OFF) +#define PS_STATE_S3 (PS_ALL_ON) +#define PS_STATE_S4 ((PS_ST_ACTIVE) | (PS_ALL_ON)) -+ + +-#define PS_IS_RF_ON(x) ((x) & (PS_ALL_ON)) +-#define PS_IS_ACTIVE(x) ((x) & (PS_ST_ACTIVE)) +-#define CLR_PS_STATE(x) ((x) = ((x) & (0xF0))) + +#define PS_IS_RF_ON(x) ((x) & (PS_ALL_ON)) +#define PS_IS_ACTIVE(x) ((x) & (PS_ST_ACTIVE)) @@ -111341,7 +110797,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release int ips_leave(_adapter * padapter); #endif -@@ -331,13 +338,25 @@ void rtw_resume_in_workqueue(struct pwrc +@@ -331,13 +338,25 @@ void rtw_resume_in_workqueue(struct pwrctrl_priv *pwrpriv); #endif //CONFIG_RESUME_IN_WORKQUEUE #if defined(CONFIG_HAS_EARLYSUSPEND ) || defined(CONFIG_ANDROID_POWER) @@ -111371,6 +110827,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release +int rtw_pm_set_lps(_adapter *padapter, u8 mode); #endif //__RTL871X_PWRCTRL_H_ +diff --git a/drivers/net/wireless/rtl8192cu/include/rtw_qos.h b/drivers/net/wireless/rtl8192cu/include/rtw_qos.h +index e35b77f..a359c5f 100644 --- a/drivers/net/wireless/rtl8192cu/include/rtw_qos.h +++ b/drivers/net/wireless/rtl8192cu/include/rtw_qos.h @@ -16,8 +16,7 @@ @@ -111383,6 +110841,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #ifndef _RTW_QOS_H_ +diff --git a/drivers/net/wireless/rtl8192cu/include/rtw_recv.h b/drivers/net/wireless/rtl8192cu/include/rtw_recv.h +index e204ef3..3a4b14b 100644 --- a/drivers/net/wireless/rtl8192cu/include/rtw_recv.h +++ b/drivers/net/wireless/rtl8192cu/include/rtw_recv.h @@ -1,7 +1,7 @@ @@ -111511,7 +110971,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release struct rtw_rx_ring { struct recv_stat *desc; -@@ -207,27 +210,28 @@ accesser of recv_priv: rtw_recv_entry(di +@@ -207,27 +210,28 @@ accesser of recv_priv: rtw_recv_entry(dispatch / passive level); recv_thread(pas using enter_critical section to protect */ @@ -111763,7 +111223,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release sint rtw_enqueue_recvbuf(struct recv_buf *precvbuf, _queue *queue); struct recv_buf *rtw_dequeue_recvbuf (_queue *queue); -@@ -479,32 +502,32 @@ __inline static u8 *get_rxmem(union recv +@@ -479,32 +502,32 @@ __inline static u8 *get_rxmem(union recv_frame *precvframe) __inline static u8 *get_rx_status(union recv_frame *precvframe) { @@ -111804,7 +111264,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if(precvframe==NULL) return NULL; -@@ -519,7 +542,7 @@ __inline static u8 *recvframe_push(union +@@ -519,7 +542,7 @@ __inline static u8 *recvframe_push(union recv_frame *precvframe, sint sz) precvframe->u.hdr.len +=sz; return precvframe->u.hdr.rx_data; @@ -111813,7 +111273,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } -@@ -533,7 +556,7 @@ __inline static u8 *recvframe_pull(union +@@ -533,7 +556,7 @@ __inline static u8 *recvframe_pull(union recv_frame *precvframe, sint sz) if(precvframe==NULL) return NULL; @@ -111822,7 +111282,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release precvframe->u.hdr.rx_data += sz; if(precvframe->u.hdr.rx_data > precvframe->u.hdr.rx_tail) -@@ -543,9 +566,9 @@ __inline static u8 *recvframe_pull(union +@@ -543,9 +566,9 @@ __inline static u8 *recvframe_pull(union recv_frame *precvframe, sint sz) } precvframe->u.hdr.len -=sz; @@ -111834,7 +111294,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } __inline static u8 *recvframe_put(union recv_frame *precvframe, sint sz) -@@ -553,16 +576,16 @@ __inline static u8 *recvframe_put(union +@@ -553,16 +576,16 @@ __inline static u8 *recvframe_put(union recv_frame *precvframe, sint sz) // rx_tai += sz; move rx_tail sz bytes hereafter //used for append sz bytes from ptr to rx_tail, update rx_tail and return the updated rx_tail to the caller @@ -111854,7 +111314,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if(precvframe->u.hdr.rx_tail > precvframe->u.hdr.rx_end) { precvframe->u.hdr.rx_tail -= sz; -@@ -580,7 +603,7 @@ __inline static u8 *recvframe_put(union +@@ -580,7 +603,7 @@ __inline static u8 *recvframe_put(union recv_frame *precvframe, sint sz) __inline static u8 *recvframe_pull_tail(union recv_frame *precvframe, sint sz) { // rmv data from rx_tail (by yitsen) @@ -111863,7 +111323,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release //used for extract sz bytes from rx_end, update rx_end and return the updated rx_end to the caller //after pulling, rx_end must be still larger than rx_data. -@@ -606,10 +629,10 @@ __inline static u8 *recvframe_pull_tail( +@@ -606,10 +629,10 @@ __inline static u8 *recvframe_pull_tail(union recv_frame *precvframe, sint sz) __inline static _buffer * get_rxbuf_desc(union recv_frame *precvframe) { _buffer * buf_desc; @@ -111876,7 +111336,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release NdisQueryPacket(precvframe->u.hdr.pkt, NULL, NULL, &buf_desc, NULL); #endif -@@ -619,18 +642,17 @@ __inline static _buffer * get_rxbuf_desc +@@ -619,18 +642,17 @@ __inline static _buffer * get_rxbuf_desc(union recv_frame *precvframe) __inline static union recv_frame *rxmem_to_recvframe(u8 *rxmem) { @@ -111900,7 +111360,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release u8 * buf_star; union recv_frame * precv_frame; #ifdef PLATFORM_WINDOWS -@@ -648,7 +670,7 @@ __inline static union recv_frame *pkt_to +@@ -648,7 +670,7 @@ __inline static union recv_frame *pkt_to_recvframe(_pkt *pkt) __inline static u8 *pkt_to_recvmem(_pkt *pkt) { // return the rx_head @@ -111909,7 +111369,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release union recv_frame * precv_frame = pkt_to_recvframe(pkt); return precv_frame->u.hdr.rx_head; -@@ -662,7 +684,7 @@ __inline static u8 *pkt_to_recvdata(_pkt +@@ -662,7 +684,7 @@ __inline static u8 *pkt_to_recvdata(_pkt *pkt) union recv_frame * precv_frame =pkt_to_recvframe(pkt); return precv_frame->u.hdr.rx_data; @@ -111918,7 +111378,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } -@@ -686,13 +708,14 @@ __inline static u8 query_rx_pwr_percenta +@@ -686,13 +708,14 @@ __inline static u8 query_rx_pwr_percentage(s8 antpower ) return (100+antpower); } } @@ -111935,6 +111395,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return SignalPower; } +diff --git a/drivers/net/wireless/rtl8192cu/include/rtw_rf.h b/drivers/net/wireless/rtl8192cu/include/rtw_rf.h +index 7414c1b6..697dd4e 100644 --- a/drivers/net/wireless/rtl8192cu/include/rtw_rf.h +++ b/drivers/net/wireless/rtl8192cu/include/rtw_rf.h @@ -16,7 +16,7 @@ @@ -111946,6 +111408,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #ifndef __RTW_RF_H_ #define __RTW_RF_H_ +diff --git a/drivers/net/wireless/rtl8192cu/include/rtw_security.h b/drivers/net/wireless/rtl8192cu/include/rtw_security.h +index 02ef9b0..835677c3 100644 --- a/drivers/net/wireless/rtl8192cu/include/rtw_security.h +++ b/drivers/net/wireless/rtl8192cu/include/rtw_security.h @@ -16,8 +16,7 @@ @@ -112026,7 +111490,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release void rtw_secmicsetkey(struct mic_data *pmicdata, u8 * key ); void rtw_secmicappendbyte(struct mic_data *pmicdata, u8 b ); void rtw_secmicappend(struct mic_data *pmicdata, u8 * src, u32 nBytes ); -@@ -398,7 +412,9 @@ void rtw_wep_encrypt(_adapter *padapter, +@@ -398,7 +412,9 @@ void rtw_wep_encrypt(_adapter *padapter, u8 *pxmitframe); u32 rtw_aes_decrypt(_adapter *padapter, u8 *precvframe); u32 rtw_tkip_decrypt(_adapter *padapter, u8 *precvframe); void rtw_wep_decrypt(_adapter *padapter, u8 *precvframe); @@ -112037,7 +111501,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #ifdef CONFIG_TDLS void wpa_tdls_generate_tpk(_adapter *padapter, struct sta_info *psta); int wpa_tdls_ftie_mic(u8 *kck, u8 trans_seq, -@@ -406,7 +422,7 @@ int wpa_tdls_ftie_mic(u8 *kck, u8 trans_ +@@ -406,7 +422,7 @@ int wpa_tdls_ftie_mic(u8 *kck, u8 trans_seq, u8 *mic); int tdls_verify_mic(u8 *kck, u8 trans_seq, u8 *lnkid, u8 *rsnie, u8 *timeoutie, u8 *ftie); @@ -112060,6 +111524,9 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + #endif //__RTL871X_SECURITY_H_ +diff --git a/drivers/net/wireless/rtl8192cu/include/rtw_sreset.h b/drivers/net/wireless/rtl8192cu/include/rtw_sreset.h +new file mode 100644 +index 0000000..45dd2bf --- /dev/null +++ b/drivers/net/wireless/rtl8192cu/include/rtw_sreset.h @@ -0,0 +1,74 @@ @@ -112137,6 +111604,9 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + +#endif + +diff --git a/drivers/net/wireless/rtl8192cu/include/rtw_tdls.h b/drivers/net/wireless/rtl8192cu/include/rtw_tdls.h +new file mode 100644 +index 0000000..1005331 --- /dev/null +++ b/drivers/net/wireless/rtl8192cu/include/rtw_tdls.h @@ -0,0 +1,143 @@ @@ -112283,11 +111753,15 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + +#endif + +diff --git a/drivers/net/wireless/rtl8192cu/include/rtw_version.h b/drivers/net/wireless/rtl8192cu/include/rtw_version.h +index f88ea77..4fb9dd4 100644 --- a/drivers/net/wireless/rtl8192cu/include/rtw_version.h +++ b/drivers/net/wireless/rtl8192cu/include/rtw_version.h @@ -1 +1 @@ -#define DRIVERVERSION "v3.4.4_4749.20121105" +#define DRIVERVERSION "v4.0.2_9000.20130911" +diff --git a/drivers/net/wireless/rtl8192cu/include/rtw_xmit.h b/drivers/net/wireless/rtl8192cu/include/rtw_xmit.h +index 54e0b2d..f7eaf4a 100644 --- a/drivers/net/wireless/rtl8192cu/include/rtw_xmit.h +++ b/drivers/net/wireless/rtl8192cu/include/rtw_xmit.h @@ -1,7 +1,7 @@ @@ -112786,7 +112260,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release }; extern struct xmit_buf *rtw_alloc_xmitbuf_ext(struct xmit_priv *pxmitpriv); -@@ -622,6 +694,8 @@ extern s32 rtw_make_wlanhdr(_adapter *pa +@@ -622,6 +694,8 @@ extern s32 rtw_make_wlanhdr(_adapter *padapter, u8 *hdr, struct pkt_attrib *patt extern s32 rtw_put_snap(u8 *data, u16 h_proto); extern struct xmit_frame *rtw_alloc_xmitframe(struct xmit_priv *pxmitpriv); @@ -112795,7 +112269,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release extern s32 rtw_free_xmitframe(struct xmit_priv *pxmitpriv, struct xmit_frame *pxmitframe); extern void rtw_free_xmitframe_queue(struct xmit_priv *pxmitpriv, _queue *pframequeue); struct tx_servq *rtw_get_sta_pending(_adapter *padapter, struct sta_info *psta, sint up, u8 *ac); -@@ -630,15 +704,15 @@ extern struct xmit_frame* rtw_dequeue_xf +@@ -630,15 +704,15 @@ extern struct xmit_frame* rtw_dequeue_xframe(struct xmit_priv *pxmitpriv, struct extern s32 rtw_xmit_classifier(_adapter *padapter, struct xmit_frame *pxmitframe); extern thread_return rtw_xmit_thread(thread_context context); @@ -112818,7 +112292,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release s32 _rtw_init_hw_txqueue(struct hw_txqueue* phw_txqueue, u8 ac_tag); void _rtw_init_sta_xmit_priv(struct sta_xmit_priv *psta_xmitpriv); -@@ -655,20 +729,26 @@ void _rtw_free_xmit_priv (struct xmit_pr +@@ -655,20 +729,26 @@ void _rtw_free_xmit_priv (struct xmit_priv *pxmitpriv); void rtw_alloc_hwxmits(_adapter *padapter); void rtw_free_hwxmits(_adapter *padapter); @@ -112851,6 +112325,9 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + #endif //_RTL871X_XMIT_H_ +diff --git a/drivers/net/wireless/rtl8192cu/include/sdio_hal.h b/drivers/net/wireless/rtl8192cu/include/sdio_hal.h +deleted file mode 100644 +index 51139bb..0000000 --- a/drivers/net/wireless/rtl8192cu/include/sdio_hal.h +++ /dev/null @@ -1,34 +0,0 @@ @@ -112888,6 +112365,9 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - -#endif //__SDIO_HAL_H__ - +diff --git a/drivers/net/wireless/rtl8192cu/include/sdio_ops.h b/drivers/net/wireless/rtl8192cu/include/sdio_ops.h +deleted file mode 100644 +index b1e9b63..0000000 --- a/drivers/net/wireless/rtl8192cu/include/sdio_ops.h +++ /dev/null @@ -1,80 +0,0 @@ @@ -112971,6 +112451,9 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - -#endif - +diff --git a/drivers/net/wireless/rtl8192cu/include/sdio_ops_ce.h b/drivers/net/wireless/rtl8192cu/include/sdio_ops_ce.h +deleted file mode 100644 +index 81687c9..0000000 --- a/drivers/net/wireless/rtl8192cu/include/sdio_ops_ce.h +++ /dev/null @@ -1,56 +0,0 @@ @@ -113030,6 +112513,9 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - -#endif - +diff --git a/drivers/net/wireless/rtl8192cu/include/sdio_ops_linux.h b/drivers/net/wireless/rtl8192cu/include/sdio_ops_linux.h +deleted file mode 100644 +index c58ab08..0000000 --- a/drivers/net/wireless/rtl8192cu/include/sdio_ops_linux.h +++ /dev/null @@ -1,55 +0,0 @@ @@ -113088,6 +112574,9 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - -#endif - +diff --git a/drivers/net/wireless/rtl8192cu/include/sdio_ops_xp.h b/drivers/net/wireless/rtl8192cu/include/sdio_ops_xp.h +deleted file mode 100644 +index 3569611..0000000 --- a/drivers/net/wireless/rtl8192cu/include/sdio_ops_xp.h +++ /dev/null @@ -1,56 +0,0 @@ @@ -113147,6 +112636,9 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - -#endif - +diff --git a/drivers/net/wireless/rtl8192cu/include/sdio_osintf.h b/drivers/net/wireless/rtl8192cu/include/sdio_osintf.h +deleted file mode 100644 +index 099262b..0000000 --- a/drivers/net/wireless/rtl8192cu/include/sdio_osintf.h +++ /dev/null @@ -1,48 +0,0 @@ @@ -113198,6 +112690,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - -#endif - +diff --git a/drivers/net/wireless/rtl8192cu/include/sta_info.h b/drivers/net/wireless/rtl8192cu/include/sta_info.h +index 8f01f21..75763db 100644 --- a/drivers/net/wireless/rtl8192cu/include/sta_info.h +++ b/drivers/net/wireless/rtl8192cu/include/sta_info.h @@ -15,8 +15,8 @@ @@ -113419,7 +112913,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #endif }; -@@ -342,12 +415,18 @@ __inline static u32 wifi_mac_hash(u8 *ma +@@ -342,12 +415,18 @@ __inline static u32 wifi_mac_hash(u8 *mac) extern u32 _rtw_init_sta_priv(struct sta_priv *pstapriv); extern u32 _rtw_free_sta_priv(struct sta_priv *pstapriv); @@ -113439,6 +112933,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #endif //_STA_INFO_H_ + +diff --git a/drivers/net/wireless/rtl8192cu/include/usb_hal.h b/drivers/net/wireless/rtl8192cu/include/usb_hal.h +index 9cd21f3..d765b82 100644 --- a/drivers/net/wireless/rtl8192cu/include/usb_hal.h +++ b/drivers/net/wireless/rtl8192cu/include/usb_hal.h @@ -16,8 +16,7 @@ @@ -113451,7 +112947,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #ifndef __USB_HAL_H__ #define __USB_HAL_H__ -@@ -28,5 +27,11 @@ void rtl8192du_set_hal_ops(_adapter * pa +@@ -28,5 +27,11 @@ void rtl8192du_set_hal_ops(_adapter * padapter); #ifdef CONFIG_INTEL_PROXIM extern _adapter *rtw_usb_get_sw_pointer(void); #endif //CONFIG_INTEL_PROXIM @@ -113463,6 +112959,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release +#endif //CONFIG_WOWLAN #endif //__USB_HAL_H__ +diff --git a/drivers/net/wireless/rtl8192cu/include/usb_ops.h b/drivers/net/wireless/rtl8192cu/include/usb_ops.h +index 3868bc0..8bbec2d 100644 --- a/drivers/net/wireless/rtl8192cu/include/usb_ops.h +++ b/drivers/net/wireless/rtl8192cu/include/usb_ops.h @@ -16,8 +16,7 @@ @@ -113525,7 +113023,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } return ret; } -@@ -92,9 +101,10 @@ static inline int rtw_inc_and_chk_contin +@@ -92,9 +101,10 @@ static inline int rtw_inc_and_chk_continual_urb_error(struct dvobj_priv *dvobjpr /* * Set the continual_urb_error of this @param dvobjprive to 0 */ @@ -113538,6 +113036,9 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #endif //__USB_OPS_H_ + +diff --git a/drivers/net/wireless/rtl8192cu/include/usb_ops_linux.h b/drivers/net/wireless/rtl8192cu/include/usb_ops_linux.h +new file mode 100644 +index 0000000..d418ba2 --- /dev/null +++ b/drivers/net/wireless/rtl8192cu/include/usb_ops_linux.h @@ -0,0 +1,63 @@ @@ -113604,6 +113105,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + +#endif + +diff --git a/drivers/net/wireless/rtl8192cu/include/usb_osintf.h b/drivers/net/wireless/rtl8192cu/include/usb_osintf.h +index 8642aa2..753013d 100644 --- a/drivers/net/wireless/rtl8192cu/include/usb_osintf.h +++ b/drivers/net/wireless/rtl8192cu/include/usb_osintf.h @@ -16,8 +16,7 @@ @@ -113616,6 +113119,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #ifndef __USB_OSINTF_H #define __USB_OSINTF_H +diff --git a/drivers/net/wireless/rtl8192cu/include/usb_vendor_req.h b/drivers/net/wireless/rtl8192cu/include/usb_vendor_req.h +index 72864de..f33e982 100644 --- a/drivers/net/wireless/rtl8192cu/include/usb_vendor_req.h +++ b/drivers/net/wireless/rtl8192cu/include/usb_vendor_req.h @@ -16,8 +16,7 @@ @@ -113628,6 +113133,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #ifndef _USB_VENDOR_REQUEST_H_ #define _USB_VENDOR_REQUEST_H_ +diff --git a/drivers/net/wireless/rtl8192cu/include/wifi.h b/drivers/net/wireless/rtl8192cu/include/wifi.h +index a80a805..0bb55bb 100644 --- a/drivers/net/wireless/rtl8192cu/include/wifi.h +++ b/drivers/net/wireless/rtl8192cu/include/wifi.h @@ -16,8 +16,7 @@ @@ -113640,7 +113147,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #ifndef _WIFI_H_ #define _WIFI_H_ -@@ -551,6 +550,7 @@ __inline static int IsFrameTypeCtrl(unsi +@@ -551,6 +550,7 @@ __inline static int IsFrameTypeCtrl(unsigned char *pframe) #define _IBSS_PARA_IE_ 6 #define _COUNTRY_IE_ 7 #define _CHLGETXT_IE_ 16 @@ -113648,7 +113155,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #define _SUPPORTED_CH_IE_ 36 #define _CH_SWTICH_ANNOUNCE_ 37 //Secondary Channel Offset #define _RSN_IE_2_ 48 -@@ -561,6 +561,7 @@ __inline static int IsFrameTypeCtrl(unsi +@@ -561,6 +561,7 @@ __inline static int IsFrameTypeCtrl(unsigned char *pframe) #define _HT_CAPABILITY_IE_ 45 #define _FTIE_ 55 #define _TIMEOUT_ITVL_IE_ 56 @@ -113656,7 +113163,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #define _HT_EXTRA_INFO_IE_ 61 #define _HT_ADD_INFO_IE_ 61 //_HT_EXTRA_INFO_IE_ -@@ -568,6 +569,9 @@ __inline static int IsFrameTypeCtrl(unsi +@@ -568,6 +569,9 @@ __inline static int IsFrameTypeCtrl(unsigned char *pframe) #define EID_BSSIntolerantChlReport 73 #define _RIC_Descriptor_IE_ 75 @@ -113666,7 +113173,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #define _LINK_ID_IE_ 101 #define _CH_SWITCH_TIMING_ 104 #define _PTI_BUFFER_STATUS_ 106 -@@ -624,7 +628,10 @@ __inline static int IsFrameTypeCtrl(unsi +@@ -624,7 +628,10 @@ __inline static int IsFrameTypeCtrl(unsigned char *pframe) #define _WEP_104_PRIVACY_ 5 #define _WEP_WPA_MIXED_PRIVACY_ 6 // WEP + WPA */ @@ -113678,7 +113185,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release /*----------------------------------------------------------------------------- Below is the definition for WMM ------------------------------------------------------------------------------*/ -@@ -654,7 +661,7 @@ __inline static int IsFrameTypeCtrl(unsi +@@ -654,7 +661,7 @@ __inline static int IsFrameTypeCtrl(unsigned char *pframe) /** @@ -113856,11 +113363,17 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + P2P_PRE_TX_INVITEREQ_PROCESS_WK = 4, + P2P_AP_P2P_CH_SWITCH_PROCESS_WK =5, + P2P_RO_CH_WK = 6, -+}; -+ + }; + +-enum P2P_PS +#ifdef CONFIG_P2P_PS +enum P2P_PS_STATE -+{ + { +- P2P_PS_DISABLE=0, +- P2P_PS_ENABLE=1, +- P2P_PS_SCAN=2, +- P2P_PS_SCAN_DONE=3, +- P2P_PS_ALLSTASLEEP=4, // for owner + P2P_PS_DISABLE = 0, + P2P_PS_ENABLE = 1, + P2P_PS_SCAN = 2, @@ -113868,21 +113381,15 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + P2P_PS_ALLSTASLEEP = 4, // for P2P GO }; --enum P2P_PS +enum P2P_PS_MODE - { -- P2P_PS_DISABLE=0, -- P2P_PS_ENABLE=1, -- P2P_PS_SCAN=2, -- P2P_PS_SCAN_DONE=3, -- P2P_PS_ALLSTASLEEP=4, // for owner ++{ + P2P_PS_NONE = 0, + P2P_PS_CTWINDOW = 1, + P2P_PS_NOA = 2, + P2P_PS_MIX = 3, // CTWindow and NoA - }; ++}; +#endif // CONFIG_P2P_PS - ++ // =====================WFD Section===================== // For Wi-Fi Display #define WFD_ATTR_DEVICE_INFO 0x00 @@ -113912,6 +113419,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #ifdef CONFIG_TX_MCAST2UNI #define IP_MCAST_MAC(mac) ((mac[0]==0x01)&&(mac[1]==0x00)&&(mac[2]==0x5e)) +diff --git a/drivers/net/wireless/rtl8192cu/include/wlan_bssdef.h b/drivers/net/wireless/rtl8192cu/include/wlan_bssdef.h +index fe555c6..1cf93dc 100644 --- a/drivers/net/wireless/rtl8192cu/include/wlan_bssdef.h +++ b/drivers/net/wireless/rtl8192cu/include/wlan_bssdef.h @@ -16,8 +16,7 @@ @@ -114227,6 +113736,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } struct wlan_network { +diff --git a/drivers/net/wireless/rtl8192cu/include/xmit_osdep.h b/drivers/net/wireless/rtl8192cu/include/xmit_osdep.h +index 7d28d43..e5848ec 100644 --- a/drivers/net/wireless/rtl8192cu/include/xmit_osdep.h +++ b/drivers/net/wireless/rtl8192cu/include/xmit_osdep.h @@ -16,8 +16,7 @@ @@ -114259,13 +113770,15 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release extern int rtw_xmit_entry(_pkt *pkt, _nic_hdl pnetdev); #endif -@@ -86,5 +91,5 @@ extern sint rtw_endofpktfile (struct pkt +@@ -86,5 +91,5 @@ extern sint rtw_endofpktfile (struct pkt_file *pfile); extern void rtw_os_pkt_complete(_adapter *padapter, _pkt *pkt); extern void rtw_os_xmit_complete(_adapter *padapter, struct xmit_frame *pxframe); -#endif // +#endif //__XMIT_OSDEP_H_ +diff --git a/drivers/net/wireless/rtl8192cu/os_dep/linux/ioctl_cfg80211.c b/drivers/net/wireless/rtl8192cu/os_dep/linux/ioctl_cfg80211.c +index b592e27..5975d1e 100644 --- a/drivers/net/wireless/rtl8192cu/os_dep/linux/ioctl_cfg80211.c +++ b/drivers/net/wireless/rtl8192cu/os_dep/linux/ioctl_cfg80211.c @@ -1,6 +1,6 @@ @@ -114295,7 +113808,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release }; #define RATETAB_ENT(_rate, _rateid, _flags) \ -@@ -85,9 +90,12 @@ static struct ieee80211_rate rtw_rates[] +@@ -85,9 +90,12 @@ static struct ieee80211_rate rtw_rates[] = { }; #define rtw_a_rates (rtw_rates + 4) @@ -114310,7 +113823,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release static struct ieee80211_channel rtw_2ghz_channels[] = { CHAN2G(1, 2412, 0), -@@ -106,8 +114,6 @@ static struct ieee80211_channel rtw_2ghz +@@ -106,8 +114,6 @@ static struct ieee80211_channel rtw_2ghz_channels[] = { CHAN2G(14, 2484, 0), }; @@ -114319,7 +113832,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release static struct ieee80211_channel rtw_5ghz_a_channels[] = { CHAN5G(34, 0), CHAN5G(36, 0), CHAN5G(38, 0), CHAN5G(40, 0), -@@ -130,23 +136,116 @@ static struct ieee80211_channel rtw_5ghz +@@ -130,23 +136,116 @@ static struct ieee80211_channel rtw_5ghz_a_channels[] = { CHAN5G(216, 0), }; @@ -114451,7 +113964,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release static const struct ieee80211_txrx_stypes rtw_cfg80211_default_mgmt_stypes[NUM_NL80211_IFTYPES] = { [NL80211_IFTYPE_ADHOC] = { -@@ -217,6 +316,7 @@ static int rtw_ieee80211_channel_to_freq +@@ -217,6 +316,7 @@ static int rtw_ieee80211_channel_to_frequency(int chan, int band) } } @@ -114459,7 +113972,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release static int rtw_cfg80211_inform_bss(_adapter *padapter, struct wlan_network *pnetwork) { int ret=0; -@@ -231,30 +331,102 @@ static int rtw_cfg80211_inform_bss(_adap +@@ -231,30 +331,102 @@ static int rtw_cfg80211_inform_bss(_adapter *padapter, struct wlan_network *pnet u8 *notify_ie; size_t notify_ielen; s32 notify_signal; @@ -114479,7 +113992,9 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - //printk("%s\n", __func__); - + //DBG_8192C("%s\n", __func__); -+ + +- channel = pnetwork->network.Configuration.DSConfig; +- if (channel <= RTW_CH_MAX_2G_CHANNEL) + bssinf_len = pnetwork->network.IELength+sizeof (struct rtw_ieee80211_hdr_3addr); + if(bssinf_len > MAX_BSSINFO_LEN){ + DBG_871X("%s IE Length too long > %d byte \n",__FUNCTION__,MAX_BSSINFO_LEN); @@ -114489,7 +114004,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + //To reduce PBC Overlap rate + //_enter_critical_bh(&pwdev_priv->scan_req_lock, &irqL); + if(wdev_to_priv(wdev)->scan_request != NULL) -+ { + { +- //band = wiphy->bands[IEEE80211_BAND_2GHZ]; + u8 *psr=NULL, sr = 0; + NDIS_802_11_SSID *pssid = &pnetwork->network.Ssid; + struct cfg80211_scan_request *request = wdev_to_priv(wdev)->scan_request; @@ -114557,12 +114073,9 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + } + } + //_exit_critical_bh(&pwdev_priv->scan_req_lock, &irqL); - -- channel = pnetwork->network.Configuration.DSConfig; ++ + channel = pnetwork->network.Configuration.DSConfig; - if (channel <= RTW_CH_MAX_2G_CHANNEL) -- { -- //band = wiphy->bands[IEEE80211_BAND_2GHZ]; ++ if (channel <= RTW_CH_MAX_2G_CHANNEL) freq = rtw_ieee80211_channel_to_frequency(channel, IEEE80211_BAND_2GHZ); - } else @@ -114573,7 +114086,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release notify_channel = ieee80211_get_channel(wiphy, freq); -@@ -267,53 +439,59 @@ static int rtw_cfg80211_inform_bss(_adap +@@ -267,53 +439,59 @@ static int rtw_cfg80211_inform_bss(_adapter *padapter, struct wlan_network *pnet notify_ie = pnetwork->network.IEs+_FIXED_IE_LENGTH_; notify_ielen = pnetwork->network.IELength-_FIXED_IE_LENGTH_; @@ -114652,7 +114165,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #if 1 -@@ -327,26 +505,96 @@ static int rtw_cfg80211_inform_bss(_adap +@@ -327,26 +505,96 @@ static int rtw_cfg80211_inform_bss(_adapter *padapter, struct wlan_network *pnet #endif if (unlikely(!bss)) { @@ -114754,7 +114267,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release && pwdev->iftype != NL80211_IFTYPE_P2P_CLIENT #endif ) { -@@ -355,33 +603,59 @@ void rtw_cfg80211_indicate_connect(_adap +@@ -355,33 +603,59 @@ void rtw_cfg80211_indicate_connect(_adapter *padapter) if(check_fwstate(pmlmepriv, WIFI_AP_STATE) == _TRUE) return; @@ -114831,7 +114344,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } } -@@ -389,12 +663,14 @@ void rtw_cfg80211_indicate_disconnect(_a +@@ -389,12 +663,14 @@ void rtw_cfg80211_indicate_disconnect(_adapter *padapter) { struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct wireless_dev *pwdev = padapter->rtw_wdev; @@ -114848,7 +114361,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release && pwdev->iftype != NL80211_IFTYPE_P2P_CLIENT #endif ) { -@@ -404,28 +680,36 @@ void rtw_cfg80211_indicate_disconnect(_a +@@ -404,28 +680,36 @@ void rtw_cfg80211_indicate_disconnect(_adapter *padapter) if(check_fwstate(pmlmepriv, WIFI_AP_STATE) == _TRUE) return; @@ -114887,7 +114400,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - printk("pwdev->sme_state=%d\n", pwdev->sme_state); + if (!padapter->mlmepriv.not_indic_disco) { + DBG_8192C("pwdev->sme_state(b)=%d\n", pwdev->sme_state); -+ + + if(pwdev->sme_state==CFG80211_SME_CONNECTING) + cfg80211_connect_result(padapter->pnetdev, NULL, NULL, 0, NULL, 0, + WLAN_STATUS_UNSPECIFIED_FAILURE, GFP_ATOMIC/*GFP_KERNEL*/); @@ -114895,13 +114408,13 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + cfg80211_disconnected(padapter->pnetdev, 0, NULL, 0, GFP_ATOMIC); + //else + //DBG_8192C("pwdev->sme_state=%d\n", pwdev->sme_state); - ++ + DBG_8192C("pwdev->sme_state(a)=%d\n", pwdev->sme_state); + } } -@@ -493,6 +777,8 @@ static int set_group_key(_adapter *padap +@@ -493,6 +777,8 @@ static int set_group_key(_adapter *padapter, u8 *key, u8 alg, int keyid) _rtw_memset(psetkeyparm, 0, sizeof(struct setkey_parm)); psetkeyparm->keyid=(u8)keyid; @@ -114910,7 +114423,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release psetkeyparm->algorithm = alg; -@@ -558,7 +844,6 @@ static int rtw_cfg80211_ap_set_encryptio +@@ -558,7 +844,6 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, struct ieee_pa { int ret = 0; u32 wep_key_idx, wep_key_len,wep_total_len; @@ -114918,7 +114431,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release struct sta_info *psta = NULL, *pbcmc_sta = NULL; _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); struct mlme_priv *pmlmepriv = &padapter->mlmepriv; -@@ -624,67 +909,33 @@ static int rtw_cfg80211_ap_set_encryptio +@@ -624,67 +909,33 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, struct ieee_pa goto exit; } @@ -114981,10 +114494,10 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + _rtw_memcpy(&(psecuritypriv->dot11DefKey[wep_key_idx].skey[0]), param->u.crypt.key, wep_key_len); - _rtw_memcpy(&(psecuritypriv->dot11DefKey[wep_key_idx].skey[0]), pwep->KeyMaterial, pwep->KeyLength); -- -- psecuritypriv->dot11DefKeylen[wep_key_idx] = pwep->KeyLength; + psecuritypriv->dot11DefKeylen[wep_key_idx] = wep_key_len; +- psecuritypriv->dot11DefKeylen[wep_key_idx] = pwep->KeyLength; +- - set_wep_key(padapter, pwep->KeyMaterial, pwep->KeyLength, wep_key_idx); - - } @@ -114992,7 +114505,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release goto exit; -@@ -693,8 +944,7 @@ static int rtw_cfg80211_ap_set_encryptio +@@ -693,8 +944,7 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, struct ieee_pa if(!psta && check_fwstate(pmlmepriv, WIFI_AP_STATE)) // //group key { @@ -115002,7 +114515,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { if(strcmp(param->u.crypt.alg, "WEP") == 0) { -@@ -765,7 +1015,7 @@ static int rtw_cfg80211_ap_set_encryptio +@@ -765,7 +1015,7 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, struct ieee_pa { if(check_fwstate(pmlmepriv, WIFI_AP_STATE)) { @@ -115011,7 +114524,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { _rtw_memcpy(psta->dot118021x_UncstKey.skey, param->u.crypt.key, (param->u.crypt.key_len>16 ?16:param->u.crypt.key_len)); -@@ -874,11 +1124,6 @@ static int rtw_cfg80211_ap_set_encryptio +@@ -874,11 +1124,6 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, struct ieee_pa exit: @@ -115023,7 +114536,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return ret; } -@@ -888,7 +1133,6 @@ static int rtw_cfg80211_set_encryption(s +@@ -888,7 +1133,6 @@ static int rtw_cfg80211_set_encryption(struct net_device *dev, struct ieee_param { int ret = 0; u32 wep_key_idx, wep_key_len,wep_total_len; @@ -115031,7 +114544,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct security_priv *psecuritypriv = &padapter->securitypriv; -@@ -898,7 +1142,7 @@ static int rtw_cfg80211_set_encryption(s +@@ -898,7 +1142,7 @@ static int rtw_cfg80211_set_encryption(struct net_device *dev, struct ieee_param _func_enter_; @@ -115266,7 +114779,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release u8 key_index, bool pairwise, const u8 *mac_addr, #else // (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) u8 key_index, const u8 *mac_addr, -@@ -1128,22 +1355,15 @@ static int cfg80211_rtw_add_key(struct w +@@ -1128,22 +1355,15 @@ static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev, _adapter *padapter = wiphy_to_adapter(wiphy); struct mlme_priv *pmlmepriv = &padapter->mlmepriv; @@ -115296,7 +114809,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release param_len = sizeof(struct ieee_param) + params->key_len; param = (struct ieee_param *)rtw_malloc(param_len); if (param == NULL) -@@ -1170,6 +1390,11 @@ static int cfg80211_rtw_add_key(struct w +@@ -1170,6 +1390,11 @@ static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev, case WLAN_CIPHER_SUITE_CCMP: alg_name = "CCMP"; break; @@ -115308,7 +114821,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release default: return -ENOTSUPP; } -@@ -1179,9 +1404,9 @@ static int cfg80211_rtw_add_key(struct w +@@ -1179,9 +1404,9 @@ static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev, if (!mac_addr || is_broadcast_ether_addr(mac_addr)) { @@ -115320,7 +114833,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } -@@ -1199,12 +1424,11 @@ static int cfg80211_rtw_add_key(struct w +@@ -1199,12 +1424,11 @@ static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev, _rtw_memcpy(param->u.crypt.key, params->key, params->key_len); } @@ -115334,7 +114847,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { #ifdef CONFIG_AP_MODE if(mac_addr) -@@ -1215,7 +1439,7 @@ static int cfg80211_rtw_add_key(struct w +@@ -1215,7 +1439,7 @@ static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev, } else { @@ -115343,7 +114856,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } -@@ -1229,7 +1453,7 @@ static int cfg80211_rtw_add_key(struct w +@@ -1229,7 +1453,7 @@ static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev, } static int cfg80211_rtw_get_key(struct wiphy *wiphy, struct net_device *ndev, @@ -115352,7 +114865,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release u8 key_index, bool pairwise, const u8 *mac_addr, #else // (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) u8 key_index, const u8 *mac_addr, -@@ -1256,123 +1480,165 @@ static int cfg80211_rtw_get_key(struct w +@@ -1256,123 +1480,165 @@ static int cfg80211_rtw_get_key(struct wiphy *wiphy, struct net_device *ndev, callback(cookie, ¶ms); return key->key_len ? 0 : -ENOENT; @@ -115414,7 +114927,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - struct iwm_priv *iwm = ndev_to_iwm(ndev); + _adapter *padapter = (_adapter *)rtw_netdev_priv(ndev); + struct security_priv *psecuritypriv = &padapter->securitypriv; -+ + +- IWM_DBG_WEXT(iwm, DBG, "Default key index is: %d\n", key_index); + DBG_871X(FUNC_NDEV_FMT" key_index=%d" + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)) || defined(COMPAT_KERNEL_RELEASE) + ", unicast=%d, multicast=%d" @@ -115425,18 +114939,17 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + #endif + ); -- IWM_DBG_WEXT(iwm, DBG, "Default key index is: %d\n", key_index); -+ if ((key_index < WEP_KEYS) && ((psecuritypriv->dot11PrivacyAlgrthm == _WEP40_) || (psecuritypriv->dot11PrivacyAlgrthm == _WEP104_))) //set wep default key -+ { -+ psecuritypriv->ndisencryptstatus = Ndis802_11Encryption1Enabled; - - if (!iwm->keys[key_index].key_len) { - IWM_ERR(iwm, "Key %d not used\n", key_index); - return -EINVAL; - } -+ psecuritypriv->dot11PrivacyKeyIndex = key_index; ++ if ((key_index < WEP_KEYS) && ((psecuritypriv->dot11PrivacyAlgrthm == _WEP40_) || (psecuritypriv->dot11PrivacyAlgrthm == _WEP104_))) //set wep default key ++ { ++ psecuritypriv->ndisencryptstatus = Ndis802_11Encryption1Enabled; - iwm->default_key = key_index; ++ psecuritypriv->dot11PrivacyKeyIndex = key_index; ++ + psecuritypriv->dot11PrivacyAlgrthm = _WEP40_; + psecuritypriv->dot118021XGrpPrivacy = _WEP40_; + if (psecuritypriv->dot11DefKeylen[key_index] == 13) @@ -115574,7 +115087,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release static int cfg80211_rtw_change_iface(struct wiphy *wiphy, struct net_device *ndev, enum nl80211_iftype type, u32 *flags, -@@ -1381,60 +1647,99 @@ static int cfg80211_rtw_change_iface(str +@@ -1381,60 +1647,99 @@ static int cfg80211_rtw_change_iface(struct wiphy *wiphy, enum nl80211_iftype old_type; NDIS_802_11_NETWORK_INFRASTRUCTURE networkType ; _adapter *padapter = wiphy_to_adapter(wiphy); @@ -115696,7 +115209,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release break; default: return -EOPNOTSUPP; -@@ -1442,12 +1747,19 @@ static int cfg80211_rtw_change_iface(str +@@ -1442,12 +1747,19 @@ static int cfg80211_rtw_change_iface(struct wiphy *wiphy, rtw_wdev->iftype = type; @@ -115716,7 +115229,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release rtw_setopmode_cmd(padapter, networkType); -@@ -1465,18 +1777,27 @@ void rtw_cfg80211_indicate_scan_done(str +@@ -1465,18 +1777,27 @@ void rtw_cfg80211_indicate_scan_done(struct rtw_wdev_priv *pwdev_priv, bool abor { //struct cfg80211_scan_request *scan_request = pwdev_priv->scan_request; @@ -115748,7 +115261,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } _exit_critical_bh(&pwdev_priv->scan_req_lock, &irqL); } -@@ -1498,46 +1819,7 @@ void rtw_cfg80211_surveydone_event_callb +@@ -1498,46 +1819,7 @@ void rtw_cfg80211_surveydone_event_callback(_adapter *padapter) struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv; #ifdef CONFIG_DEBUG_CFG80211 @@ -115796,7 +115309,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #endif _enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); -@@ -1553,10 +1835,9 @@ void rtw_cfg80211_surveydone_event_callb +@@ -1553,10 +1835,9 @@ void rtw_cfg80211_surveydone_event_callback(_adapter *padapter) pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list); //report network only if the current channel set contains the channel to which this network belongs @@ -115809,7 +115322,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release ) { //ev=translate_scan(padapter, a, pnetwork, ev, stop); -@@ -1568,44 +1849,24 @@ void rtw_cfg80211_surveydone_event_callb +@@ -1568,44 +1849,24 @@ void rtw_cfg80211_surveydone_event_callback(_adapter *padapter) } _exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); @@ -115860,7 +115373,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #endif if(len>0) -@@ -1613,7 +1874,7 @@ static int rtw_cfg80211_set_probe_req_wp +@@ -1613,7 +1874,7 @@ static int rtw_cfg80211_set_probe_req_wpsp2pie(struct net_device *net, char *buf if((wps_ie = rtw_get_wps_ie(buf, len, NULL, &wps_ielen))) { #ifdef CONFIG_DEBUG_CFG80211 @@ -115869,7 +115382,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #endif if(pmlmepriv->wps_probe_req_ie) -@@ -1626,7 +1887,7 @@ static int rtw_cfg80211_set_probe_req_wp +@@ -1626,7 +1887,7 @@ static int rtw_cfg80211_set_probe_req_wpsp2pie(struct net_device *net, char *buf pmlmepriv->wps_probe_req_ie = rtw_malloc(wps_ielen); if ( pmlmepriv->wps_probe_req_ie == NULL) { @@ -115878,7 +115391,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return -EINVAL; } -@@ -1634,12 +1895,18 @@ static int rtw_cfg80211_set_probe_req_wp +@@ -1634,12 +1895,18 @@ static int rtw_cfg80211_set_probe_req_wpsp2pie(struct net_device *net, char *buf pmlmepriv->wps_probe_req_ie_len = wps_ielen; } @@ -115900,7 +115413,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #endif if(pmlmepriv->p2p_probe_req_ie) -@@ -1650,58 +1917,67 @@ static int rtw_cfg80211_set_probe_req_wp +@@ -1650,58 +1917,67 @@ static int rtw_cfg80211_set_probe_req_wpsp2pie(struct net_device *net, char *buf pmlmepriv->p2p_probe_req_ie = NULL; } @@ -116005,7 +115518,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { int i; u8 _status = _FALSE; -@@ -1709,11 +1985,14 @@ static int cfg80211_rtw_scan(struct wiph +@@ -1709,11 +1985,14 @@ static int cfg80211_rtw_scan(struct wiphy *wiphy, struct net_device *ndev, _adapter *padapter = wiphy_to_adapter(wiphy); struct mlme_priv *pmlmepriv= &padapter->mlmepriv; NDIS_802_11_SSID ssid[RTW_SSID_SCAN_AMOUNT]; @@ -116020,7 +115533,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #ifdef CONFIG_P2P struct wifidirect_info *pwdinfo= &(padapter->wdinfo); #endif //CONFIG_P2P -@@ -1721,10 +2000,21 @@ static int cfg80211_rtw_scan(struct wiph +@@ -1721,10 +2000,21 @@ static int cfg80211_rtw_scan(struct wiphy *wiphy, struct net_device *ndev, struct cfg80211_ssid *ssids = request->ssids; int social_channel = 0, j = 0; bool need_indicate_scan_done = _FALSE; @@ -116046,7 +115559,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #ifdef CONFIG_MP_INCLUDED if (check_fwstate(pmlmepriv, WIFI_MP_STATE) == _TRUE) -@@ -1740,8 +2030,22 @@ static int cfg80211_rtw_scan(struct wiph +@@ -1740,8 +2030,22 @@ static int cfg80211_rtw_scan(struct wiphy *wiphy, struct net_device *ndev, if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == _TRUE) { @@ -116071,7 +115584,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } if(_FAIL == rtw_pwr_wakeup(padapter)) { -@@ -1749,26 +2053,31 @@ static int cfg80211_rtw_scan(struct wiph +@@ -1749,26 +2053,31 @@ static int cfg80211_rtw_scan(struct wiphy *wiphy, struct net_device *ndev, goto check_need_indicate_scan_done; } @@ -116107,7 +115620,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if(request->n_channels == 3 && request->channels[0]->hw_value == 1 && request->channels[1]->hw_value == 6 && -@@ -1779,37 +2088,72 @@ static int cfg80211_rtw_scan(struct wiph +@@ -1779,37 +2088,72 @@ static int cfg80211_rtw_scan(struct wiphy *wiphy, struct net_device *ndev, } } } @@ -116191,7 +115704,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } #endif //CONFIG_P2P -@@ -1818,20 +2162,38 @@ static int cfg80211_rtw_scan(struct wiph +@@ -1818,20 +2162,38 @@ static int cfg80211_rtw_scan(struct wiphy *wiphy, struct net_device *ndev, //parsing request ssids, n_ssids for (i = 0; i < request->n_ssids && i < RTW_SSID_SCAN_AMOUNT; i++) { #ifdef CONFIG_DEBUG_CFG80211 @@ -116237,7 +115750,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release _exit_critical_bh(&pmlmepriv->lock, &irqL); -@@ -1881,11 +2243,11 @@ static int cfg80211_rtw_set_wiphy_params +@@ -1881,11 +2243,11 @@ static int cfg80211_rtw_set_wiphy_params(struct wiphy *wiphy, u32 changed) return ret; } #endif @@ -116251,7 +115764,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release struct cfg80211_ibss_params *params) { #if 0 -@@ -1908,11 +2270,11 @@ static int cfg80211_rtw_join_ibss(struct +@@ -1908,11 +2270,11 @@ static int cfg80211_rtw_join_ibss(struct wiphy *wiphy, struct net_device *dev, return iwm_send_mlme_profile(iwm); #endif @@ -116265,7 +115778,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { #if 0 struct iwm_priv *iwm = wiphy_to_iwm(wiphy); -@@ -1920,14 +2282,13 @@ static int cfg80211_rtw_leave_ibss(struc +@@ -1920,14 +2282,13 @@ static int cfg80211_rtw_leave_ibss(struct wiphy *wiphy, struct net_device *dev) if (iwm->umac_profile_active) return iwm_invalidate_mlme_profile(iwm); #endif @@ -116282,7 +115795,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if (!wpa_version) { psecuritypriv->ndisauthtype = Ndis802_11AuthModeOpen; -@@ -1954,7 +2315,7 @@ static int rtw_cfg80211_set_wpa_version( +@@ -1954,7 +2315,7 @@ static int rtw_cfg80211_set_wpa_version(struct security_priv *psecuritypriv, u32 static int rtw_cfg80211_set_auth_type(struct security_priv *psecuritypriv, enum nl80211_auth_type sme_auth_type) { @@ -116291,7 +115804,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release switch (sme_auth_type) { -@@ -1995,7 +2356,7 @@ static int rtw_cfg80211_set_cipher(struc +@@ -1995,7 +2356,7 @@ static int rtw_cfg80211_set_cipher(struct security_priv *psecuritypriv, u32 ciph u32 *profile_cipher = ucast ? &psecuritypriv->dot11PrivacyAlgrthm : &psecuritypriv->dot118021XGrpPrivacy; @@ -116300,7 +115813,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if (!cipher) { -@@ -2026,7 +2387,7 @@ static int rtw_cfg80211_set_cipher(struc +@@ -2026,7 +2387,7 @@ static int rtw_cfg80211_set_cipher(struct security_priv *psecuritypriv, u32 ciph ndisencryptstatus = Ndis802_11Encryption3Enabled; break; default: @@ -116309,7 +115822,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return -ENOTSUPP; } -@@ -2043,7 +2404,7 @@ static int rtw_cfg80211_set_cipher(struc +@@ -2043,7 +2404,7 @@ static int rtw_cfg80211_set_cipher(struct security_priv *psecuritypriv, u32 ciph static int rtw_cfg80211_set_key_mgt(struct security_priv *psecuritypriv, u32 key_mgt) { @@ -116318,7 +115831,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if (key_mgt == WLAN_AKM_SUITE_8021X) //*auth_type = UMAC_AUTH_TYPE_8021X; -@@ -2051,7 +2412,7 @@ static int rtw_cfg80211_set_key_mgt(stru +@@ -2051,7 +2412,7 @@ static int rtw_cfg80211_set_key_mgt(struct security_priv *psecuritypriv, u32 key else if (key_mgt == WLAN_AKM_SUITE_PSK) { psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_8021X; } else { @@ -116327,7 +115840,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release //return -EINVAL; } -@@ -2064,230 +2425,225 @@ static int rtw_cfg80211_set_wpa_ie(_adap +@@ -2064,230 +2425,225 @@ static int rtw_cfg80211_set_wpa_ie(_adapter *padapter, u8 *pie, size_t ielen) u32 left; int group_cipher = 0, pairwise_cipher = 0; int ret = 0; @@ -116744,7 +116257,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release struct cfg80211_connect_params *sme) { int ret=0; -@@ -2306,10 +2662,9 @@ static int cfg80211_rtw_connect(struct w +@@ -2306,10 +2662,9 @@ static int cfg80211_rtw_connect(struct wiphy *wiphy, struct net_device *dev, struct security_priv *psecuritypriv = &padapter->securitypriv; _queue *queue = &pmlmepriv->scanned_queue; @@ -116758,7 +116271,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if(wdev_to_priv(padapter->rtw_wdev)->block == _TRUE) -@@ -2319,6 +2674,22 @@ static int cfg80211_rtw_connect(struct w +@@ -2319,6 +2674,22 @@ static int cfg80211_rtw_connect(struct wiphy *wiphy, struct net_device *dev, goto exit; } @@ -116781,7 +116294,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if(_FAIL == rtw_pwr_wakeup(padapter)) { ret= -EPERM; goto exit; -@@ -2329,6 +2700,17 @@ static int cfg80211_rtw_connect(struct w +@@ -2329,6 +2700,17 @@ static int cfg80211_rtw_connect(struct wiphy *wiphy, struct net_device *dev, goto exit; } @@ -116799,7 +116312,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if (!sme->ssid || !sme->ssid_len) { ret = -EINVAL; -@@ -2341,104 +2723,25 @@ static int cfg80211_rtw_connect(struct w +@@ -2341,104 +2723,25 @@ static int cfg80211_rtw_connect(struct wiphy *wiphy, struct net_device *dev, goto exit; } @@ -116910,7 +116423,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release psecuritypriv->ndisencryptstatus = Ndis802_11EncryptionDisabled; psecuritypriv->dot11PrivacyAlgrthm = _NO_PRIVACY_; -@@ -2455,6 +2758,11 @@ static int cfg80211_rtw_connect(struct w +@@ -2455,6 +2758,11 @@ static int cfg80211_rtw_connect(struct wiphy *wiphy, struct net_device *dev, if (ret < 0) goto exit; @@ -116922,7 +116435,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if (sme->crypto.n_ciphers_pairwise) { ret = rtw_cfg80211_set_cipher(psecuritypriv, sme->crypto.ciphers_pairwise[0], _TRUE); -@@ -2534,24 +2842,17 @@ static int cfg80211_rtw_connect(struct w +@@ -2534,24 +2842,17 @@ static int cfg80211_rtw_connect(struct wiphy *wiphy, struct net_device *dev, goto exit; } @@ -116980,7 +116493,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release rtw_free_assoc_resources(padapter, 1); } -@@ -2582,11 +2889,14 @@ static int cfg80211_rtw_disconnect(struc +@@ -2582,11 +2889,14 @@ static int cfg80211_rtw_disconnect(struct wiphy *wiphy, struct net_device *dev, } static int cfg80211_rtw_set_txpower(struct wiphy *wiphy, @@ -117000,7 +116513,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { #if 0 struct iwm_priv *iwm = wiphy_to_iwm(wiphy); -@@ -2614,44 +2924,47 @@ static int cfg80211_rtw_set_txpower(stru +@@ -2614,44 +2924,47 @@ static int cfg80211_rtw_set_txpower(struct wiphy *wiphy, return -EOPNOTSUPP; } #endif @@ -117069,7 +116582,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return 0; } -@@ -2660,12 +2973,52 @@ static int cfg80211_rtw_set_pmksa(struct +@@ -2660,12 +2973,52 @@ static int cfg80211_rtw_set_pmksa(struct wiphy *wiphy, struct net_device *netdev, struct cfg80211_pmksa *pmksa) { @@ -117103,14 +116616,14 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + break; + } + } -+ + +- printk("%s\n", __func__); + if(!blInserted) + { + // Find a new entry + DBG_871X(FUNC_NDEV_FMT" Use the new entry index = %d for this PMKID.\n", + FUNC_NDEV_ARG(netdev), psecuritypriv->PMKIDIndex ); - -- printk("%s\n", __func__); ++ + _rtw_memcpy(psecuritypriv->PMKIDList[psecuritypriv->PMKIDIndex].Bssid, pmksa->bssid, ETH_ALEN); + _rtw_memcpy(psecuritypriv->PMKIDList[psecuritypriv->PMKIDIndex].PMKID, pmksa->pmkid, WLAN_PMKID_LEN); + @@ -117126,7 +116639,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return 0; } -@@ -2673,28 +3026,45 @@ static int cfg80211_rtw_del_pmksa(struct +@@ -2673,28 +3026,45 @@ static int cfg80211_rtw_del_pmksa(struct wiphy *wiphy, struct net_device *netdev, struct cfg80211_pmksa *pmksa) { @@ -117183,7 +116696,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return 0; } -@@ -2705,30 +3075,50 @@ void rtw_cfg80211_indicate_sta_assoc(_ad +@@ -2705,30 +3075,50 @@ void rtw_cfg80211_indicate_sta_assoc(_adapter *padapter, u8 *pmgmt_frame, uint f int channel; struct wireless_dev *pwdev = padapter->rtw_wdev; struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); @@ -117218,8 +116731,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - { freq = rtw_ieee80211_channel_to_frequency(channel, IEEE80211_BAND_5GHZ); - } -- +- -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) && !defined(CONFIG_CFG80211_FORCE_COMPATIBLE_2_6_37_UNDER) - cfg80211_rx_mgmt(padapter->pnetdev, freq, pmgmt_frame, frame_len, GFP_ATOMIC); -#else @@ -117250,7 +116763,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } -@@ -2743,21 +3133,18 @@ void rtw_cfg80211_indicate_sta_disassoc( +@@ -2743,21 +3133,18 @@ void rtw_cfg80211_indicate_sta_disassoc(_adapter *padapter, unsigned char *da, u u8 mgmt_buf[128] = {0}; struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); @@ -117277,7 +116790,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release pmgmt_frame = mgmt_buf; pwlanhdr = (struct rtw_ieee80211_hdr *)pmgmt_frame; -@@ -2781,20 +3168,22 @@ void rtw_cfg80211_indicate_sta_disassoc( +@@ -2781,20 +3168,22 @@ void rtw_cfg80211_indicate_sta_disassoc(_adapter *padapter, unsigned char *da, u reason = cpu_to_le16(reason); pmgmt_frame = rtw_set_fixed_ie(pmgmt_frame, _RSON_CODE_ , (unsigned char *)&reason, &frame_len); @@ -117306,7 +116819,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return ret; } -@@ -2803,7 +3192,7 @@ static int rtw_cfg80211_monitor_if_close +@@ -2803,7 +3192,7 @@ static int rtw_cfg80211_monitor_if_close(struct net_device *ndev) { int ret = 0; @@ -117315,7 +116828,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return ret; } -@@ -2816,14 +3205,17 @@ static int rtw_cfg80211_monitor_if_xmit_ +@@ -2816,14 +3205,17 @@ static int rtw_cfg80211_monitor_if_xmit_entry(struct sk_buff *skb, struct net_de int dot11_hdr_len = 24; int snap_len = 6; unsigned char *pdata; @@ -117335,7 +116848,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if (unlikely(skb->len < sizeof(struct ieee80211_radiotap_header))) goto fail; -@@ -2838,7 +3230,7 @@ static int rtw_cfg80211_monitor_if_xmit_ +@@ -2838,7 +3230,7 @@ static int rtw_cfg80211_monitor_if_xmit_entry(struct sk_buff *skb, struct net_de if(rtap_len != 14) { @@ -117344,7 +116857,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release goto fail; } -@@ -2848,7 +3240,7 @@ static int rtw_cfg80211_monitor_if_xmit_ +@@ -2848,7 +3240,7 @@ static int rtw_cfg80211_monitor_if_xmit_entry(struct sk_buff *skb, struct net_de dot11_hdr = (struct ieee80211_hdr *)skb->data; frame_ctl = le16_to_cpu(dot11_hdr->frame_control); /* Check if the QoS bit is set */ @@ -117353,7 +116866,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release /* Check if this ia a Wireless Distribution System (WDS) frame * which has 4 MAC addresses */ -@@ -2868,15 +3260,17 @@ static int rtw_cfg80211_monitor_if_xmit_ +@@ -2868,15 +3260,17 @@ static int rtw_cfg80211_monitor_if_xmit_entry(struct sk_buff *skb, struct net_de memcpy(pdata, dst_mac_addr, sizeof(dst_mac_addr)); memcpy(pdata + sizeof(dst_mac_addr), src_mac_addr, sizeof(src_mac_addr)); @@ -117374,7 +116887,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { //only for action frames struct xmit_frame *pmgntframe; -@@ -2889,50 +3283,27 @@ static int rtw_cfg80211_monitor_if_xmit_ +@@ -2889,50 +3283,27 @@ static int rtw_cfg80211_monitor_if_xmit_entry(struct sk_buff *skb, struct net_de struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); u8 *buf = skb->data; u32 len = skb->len; @@ -117442,7 +116955,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release //starting alloc mgmt frame to dump it if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) { -@@ -2949,6 +3320,19 @@ static int rtw_cfg80211_monitor_if_xmit_ +@@ -2949,6 +3320,19 @@ static int rtw_cfg80211_monitor_if_xmit_entry(struct sk_buff *skb, struct net_de pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; _rtw_memcpy(pframe, (void*)buf, len); @@ -117462,7 +116975,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release pattrib->pktlen = len; pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; -@@ -2961,12 +3345,11 @@ static int rtw_cfg80211_monitor_if_xmit_ +@@ -2961,12 +3345,11 @@ static int rtw_cfg80211_monitor_if_xmit_entry(struct sk_buff *skb, struct net_de pattrib->last_txcmdsz = pattrib->pktlen; dump_mgntframe(padapter, pmgntframe); @@ -117493,7 +117006,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return ret; } -@@ -2997,181 +3380,210 @@ static const struct net_device_ops rtw_c +@@ -2997,181 +3380,210 @@ static const struct net_device_ops rtw_cfg80211_monitor_if_ops = { .ndo_open = rtw_cfg80211_monitor_if_open, .ndo_stop = rtw_cfg80211_monitor_if_close, .ndo_start_xmit = rtw_cfg80211_monitor_if_xmit_entry, @@ -117728,17 +117241,23 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + struct net_device *ndev; + ndev = wdev ? wdev->netdev : NULL; +#endif - -- printk("%s\n", __func__); ++ + if (!ndev) + goto exit; +- printk("%s\n", __func__); ++ unregister_netdevice(ndev); + - if(dev) - { - unregister_netdev(dev); - - free_netdev(dev); -+ unregister_netdevice(ndev); ++ if (ndev == pwdev_priv->pmon_ndev) { ++ pwdev_priv->pmon_ndev = NULL; ++ pwdev_priv->ifname_mon[0] = '\0'; ++ DBG_871X(FUNC_NDEV_FMT" remove monitor interface\n", FUNC_NDEV_ARG(ndev)); ++ } - if(dev == pwdev_priv->pmon_ndev) - { @@ -117748,12 +117267,6 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - } - } - -+ if (ndev == pwdev_priv->pmon_ndev) { -+ pwdev_priv->pmon_ndev = NULL; -+ pwdev_priv->ifname_mon[0] = '\0'; -+ DBG_871X(FUNC_NDEV_FMT" remove monitor interface\n", FUNC_NDEV_ARG(ndev)); -+ } -+ +exit: return 0; } @@ -117791,7 +117304,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if(!pbuf) return -ENOMEM; -@@ -3182,38 +3594,33 @@ static int cfg80211_rtw_add_beacon(struc +@@ -3182,38 +3594,33 @@ static int cfg80211_rtw_add_beacon(struct wiphy *wiphy, struct net_device *dev, // pstapriv->max_num_sta = NUM_STA; @@ -117846,7 +117359,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } else { -@@ -3221,20 +3628,32 @@ static int cfg80211_rtw_add_beacon(struc +@@ -3221,20 +3628,32 @@ static int cfg80211_rtw_add_beacon(struct wiphy *wiphy, struct net_device *dev, _cancel_timer_ex( &pwdinfo->restore_p2p_state_timer ); _cancel_timer_ex( &pwdinfo->pre_tx_scan_timer); @@ -117861,11 +117374,11 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + } + } +#endif // CONFIG_P2P - ++ + /* pbss_network->IEs will not include p2p_ie, wfd ie */ + rtw_ies_remove_ie(pbuf, &len, _BEACON_IE_OFFSET_, _VENDOR_SPECIFIC_IE_, P2P_OUI, 4); + rtw_ies_remove_ie(pbuf, &len, _BEACON_IE_OFFSET_, _VENDOR_SPECIFIC_IE_, WFD_OUI, 4); -+ + + if (rtw_check_beacon_data(adapter, pbuf, len) == _SUCCESS) + { +#ifdef CONFIG_P2P @@ -117884,7 +117397,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } else { -@@ -3242,66 +3661,136 @@ static int cfg80211_rtw_add_beacon(struc +@@ -3242,66 +3661,136 @@ static int cfg80211_rtw_add_beacon(struct wiphy *wiphy, struct net_device *dev, } @@ -117931,16 +117444,16 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { - printk("%s\n", __func__); + DBG_871X(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev)); - - return 0; - } ++ ++ return 0; ++} +#else +static int cfg80211_rtw_start_ap(struct wiphy *wiphy, struct net_device *ndev, + struct cfg80211_ap_settings *settings) +{ + int ret = 0; + _adapter *adapter = wiphy_to_adapter(wiphy); -+ + + DBG_871X(FUNC_NDEV_FMT" hidden_ssid:%d, auth_type:%d\n", FUNC_NDEV_ARG(ndev), + settings->hidden_ssid, settings->auth_type); + @@ -117977,10 +117490,9 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release +{ + int ret = 0; + _adapter *adapter = wiphy_to_adapter(wiphy); - ++ + DBG_871X(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev)); - --static int cfg80211_rtw_add_station(struct wiphy *wiphy, struct net_device *dev, ++ + ret = rtw_add_beacon(adapter, info->head, info->head_len, info->tail, info->tail_len); + + return ret; @@ -117989,11 +117501,12 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release +static int cfg80211_rtw_stop_ap(struct wiphy *wiphy, struct net_device *ndev) +{ + DBG_871X(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev)); -+ return 0; -+} -+ + return 0; + } + +#endif //(LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)) -+ + +-static int cfg80211_rtw_add_station(struct wiphy *wiphy, struct net_device *dev, +static int cfg80211_rtw_add_station(struct wiphy *wiphy, struct net_device *ndev, u8 *mac, struct station_parameters *params) { @@ -118035,7 +117548,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release flush_all_cam_entry(padapter); //clear CAM -@@ -3311,7 +3800,7 @@ static int cfg80211_rtw_del_station(stru +@@ -3311,7 +3800,7 @@ static int cfg80211_rtw_del_station(struct wiphy *wiphy, struct net_device *dev, } @@ -118044,7 +117557,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if (mac[0] == 0xff && mac[1] == 0xff && mac[2] == 0xff && mac[3] == 0xff && -@@ -3344,9 +3833,10 @@ static int cfg80211_rtw_del_station(stru +@@ -3344,9 +3833,10 @@ static int cfg80211_rtw_del_station(struct wiphy *wiphy, struct net_device *dev, DBG_8192C("free psta=%p, aid=%d\n", psta, psta->aid); rtw_list_delete(&psta->asoc_list); @@ -118056,7 +117569,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release //_enter_critical_bh(&pstapriv->asoc_list_lock, &irqL); psta = NULL; -@@ -3360,73 +3850,48 @@ static int cfg80211_rtw_del_station(stru +@@ -3360,73 +3850,48 @@ static int cfg80211_rtw_del_station(struct wiphy *wiphy, struct net_device *dev, _exit_critical_bh(&pstapriv->asoc_list_lock, &irqL); @@ -118144,7 +117657,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } */ -@@ -3434,27 +3899,31 @@ static int cfg80211_rtw_change_bss(struc +@@ -3434,27 +3899,31 @@ static int cfg80211_rtw_change_bss(struct wiphy *wiphy, struct net_device *dev, } @@ -118184,7 +117697,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return 0; } -@@ -3462,66 +3931,108 @@ static int cfg80211_rtw_assoc(struct wip +@@ -3462,66 +3931,108 @@ static int cfg80211_rtw_assoc(struct wiphy *wiphy, struct net_device *dev, void rtw_cfg80211_rx_action_p2p(_adapter *padapter, u8 *pmgmt_frame, uint frame_len) { @@ -118241,13 +117754,9 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); + struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); + u8 category, action; - --#ifdef CONFIG_DEBUG_CFG80211 -- printk("%s\n", __func__); --#endif ++ + channel = rtw_get_oper_ch(padapter); - -- rtw_p2p_check_frames(padapter, pmgmt_frame, frame_len, _FALSE); ++ + DBG_8192C("RTW_Rx:cur_ch=%d\n", channel); + #ifdef CONFIG_P2P + type = rtw_p2p_check_frames(padapter, pmgmt_frame, frame_len, _FALSE); @@ -118265,27 +117774,22 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + rtw_action_frame_parse(pmgmt_frame, frame_len, &category, &action); + DBG_871X("RTW_Rx:category(%u), action(%u)\n", category, action); -- channel = pmlmeext->cur_channel; -- +-#ifdef CONFIG_DEBUG_CFG80211 +- printk("%s\n", __func__); +indicate: - if (channel <= RTW_CH_MAX_2G_CHANNEL) -- { - freq = rtw_ieee80211_channel_to_frequency(channel, IEEE80211_BAND_2GHZ); -- } - else -- { - freq = rtw_ieee80211_channel_to_frequency(channel, IEEE80211_BAND_5GHZ); -- } - --#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) -- cfg80211_rx_mgmt(padapter->pnetdev, freq, pmgmt_frame, frame_len, GFP_ATOMIC); ++ if (channel <= RTW_CH_MAX_2G_CHANNEL) ++ freq = rtw_ieee80211_channel_to_frequency(channel, IEEE80211_BAND_2GHZ); ++ else ++ freq = rtw_ieee80211_channel_to_frequency(channel, IEEE80211_BAND_5GHZ); ++ +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) || defined(COMPAT_KERNEL_RELEASE) + rtw_cfg80211_rx_mgmt(padapter, freq, 0, pmgmt_frame, frame_len, GFP_ATOMIC); - #else - cfg80211_rx_action(padapter->pnetdev, freq, pmgmt_frame, frame_len, GFP_ATOMIC); ++#else ++ cfg80211_rx_action(padapter->pnetdev, freq, pmgmt_frame, frame_len, GFP_ATOMIC); #endif +} -+ + +- rtw_p2p_check_frames(padapter, pmgmt_frame, frame_len, _FALSE); +void rtw_cfg80211_rx_action(_adapter *adapter, u8 *frame, uint frame_len, const char*msg) +{ + s32 freq; @@ -118303,17 +117807,26 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + DBG_871X("RTW_Rx:%s\n", msg); + else + DBG_871X("RTW_Rx:category(%u), action(%u)\n", category, action); -+ -+ if (channel <= RTW_CH_MAX_2G_CHANNEL) -+ freq = rtw_ieee80211_channel_to_frequency(channel, IEEE80211_BAND_2GHZ); -+ else -+ freq = rtw_ieee80211_channel_to_frequency(channel, IEEE80211_BAND_5GHZ); -+ + +- channel = pmlmeext->cur_channel; +- + if (channel <= RTW_CH_MAX_2G_CHANNEL) +- { + freq = rtw_ieee80211_channel_to_frequency(channel, IEEE80211_BAND_2GHZ); +- } + else +- { + freq = rtw_ieee80211_channel_to_frequency(channel, IEEE80211_BAND_5GHZ); +- } + +-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) +- cfg80211_rx_mgmt(padapter->pnetdev, freq, pmgmt_frame, frame_len, GFP_ATOMIC); +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) || defined(COMPAT_KERNEL_RELEASE) + rtw_cfg80211_rx_mgmt(adapter, freq, 0, frame, frame_len, GFP_ATOMIC); -+#else + #else +- cfg80211_rx_action(padapter->pnetdev, freq, pmgmt_frame, frame_len, GFP_ATOMIC); + cfg80211_rx_action(adapter->pnetdev, freq, frame, frame_len, GFP_ATOMIC); -+#endif + #endif } @@ -118321,7 +117834,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release void rtw_cfg80211_issue_p2p_provision_request(_adapter *padapter, const u8 *buf, size_t len) { u16 wps_devicepassword_id = 0x0000; -@@ -3625,9 +4136,9 @@ void rtw_cfg80211_issue_p2p_provision_re +@@ -3625,9 +4136,9 @@ void rtw_cfg80211_issue_p2p_provision_request(_adapter *padapter, const u8 *buf, fctrl = &(pwlanhdr->frame_ctl); *(fctrl) = 0; @@ -118333,7 +117846,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); pmlmeext->mgnt_seq++; -@@ -3668,8 +4179,7 @@ void rtw_cfg80211_issue_p2p_provision_re +@@ -3668,8 +4179,7 @@ void rtw_cfg80211_issue_p2p_provision_request(_adapter *padapter, const u8 *buf, // Value: // Device Capability Bitmap, 1 byte @@ -118343,7 +117856,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release _rtw_memcpy(p2p_ie + p2pielen, &capability, 2); p2pielen += 2; -@@ -3736,344 +4246,528 @@ void rtw_cfg80211_issue_p2p_provision_re +@@ -3736,344 +4246,528 @@ void rtw_cfg80211_issue_p2p_provision_request(_adapter *padapter, const u8 *buf, pattrib->last_txcmdsz = pattrib->pktlen; @@ -118417,37 +117930,37 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + DBG_8192C("%s, cancel ro ch timer\n", __func__); + + _cancel_timer_ex(&padapter->cfg80211_wdinfo.remain_on_ch_timer); - ++ +#ifdef CONFIG_CONCURRENT_MODE + ATOMIC_SET(&pwdev_priv->ro_ch_to, 1); +#endif //CONFIG_CONCURRENT_MODE - -- printk("%s, len=%d, ch=%d, ch_type=%d\n", __func__, len, -- ieee80211_frequency_to_channel(chan->center_freq), channel_type); ++ + p2p_protocol_wk_hdl(padapter, P2P_RO_CH_WK); + } + + pcfg80211_wdinfo->is_ro_ch = _TRUE; - --#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) -- printk("channel_type_valid=%d\n", channel_type_valid); ++ + if(_FAIL == rtw_pwr_wakeup(padapter)) { + err = -EFAULT; + goto exit; + } -+ + + _rtw_memcpy(&pcfg80211_wdinfo->remain_on_ch_channel, channel, sizeof(struct ieee80211_channel)); + #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0)) + pcfg80211_wdinfo->remain_on_ch_type= channel_type; + #endif + pcfg80211_wdinfo->remain_on_ch_cookie= *cookie; -+ + +- printk("%s, len=%d, ch=%d, ch_type=%d\n", __func__, len, +- ieee80211_frequency_to_channel(chan->center_freq), channel_type); + rtw_scan_abort(padapter); +#ifdef CONFIG_CONCURRENT_MODE + if(rtw_buddy_adapter_up(padapter)) + rtw_scan_abort(padapter->pbuddy_adapter); +#endif //CONFIG_CONCURRENT_MODE -+ + +-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) +- printk("channel_type_valid=%d\n", channel_type_valid); + //if(!rtw_p2p_chk_role(pwdinfo, P2P_ROLE_CLIENT) && !rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO)) + if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)) + { @@ -118468,20 +117981,16 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + + if(duration < 400) + duration = duration*3;//extend from exper. -+ - mgmt = (const struct ieee80211_mgmt *) buf; - fc = mgmt->frame_control; - if (fc != IEEE80211_STYPE_ACTION) ++ +#ifdef CONFIG_CONCURRENT_MODE + if(check_buddy_fwstate(padapter, _FW_LINKED) && + (durationext_listen_interval)) { - if (fc == IEEE80211_STYPE_PROBE_RESP) -- { -- printk("%s, fc == IEEE80211_STYPE_PROBE_RESP\n", __func__); -- } -- else + duration = duration + pwdinfo->ext_listen_interval; + } +#endif @@ -118492,12 +118001,9 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release +#ifdef CONFIG_CONCURRENT_MODE + if ( check_buddy_fwstate(padapter, _FW_LINKED ) ) { -- printk("%s, frame_control == 0x%x\n", __func__, fc); +- printk("%s, fc == IEEE80211_STYPE_PROBE_RESP\n", __func__); - } -- -- //cfg80211_mgmt_tx_status(dev, *cookie, buf, len, ack, GFP_KERNEL); -- -- goto exit; +- else + PADAPTER pbuddy_adapter = padapter->pbuddy_adapter; + struct mlme_ext_priv *pbuddy_mlmeext = &pbuddy_adapter->mlmeextpriv; + @@ -118515,38 +118021,54 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + _set_timer(&pwdinfo->ap_p2p_switch_timer, duration-pwdinfo->ext_listen_interval); + } + } - -- } -- else -- { -- u32 cnt=0; -- u32 wait_for_surveydone; -- struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); ++ + ready_on_channel = _TRUE; + //pmlmeext->cur_channel = remain_ch; + //set_channel_bwmode(padapter, remain_ch, HAL_PRIME_CHNL_OFFSET_DONT_CARE, HT_CHANNEL_WIDTH_20); + }else +#endif //CONFIG_CONCURRENT_MODE + if(remain_ch != pmlmeext->cur_channel ) -+ { + { +- printk("%s, frame_control == 0x%x\n", __func__, fc); + ready_on_channel = _TRUE; + //pmlmeext->cur_channel = remain_ch; + //set_channel_bwmode(padapter, remain_ch, HAL_PRIME_CHNL_OFFSET_DONT_CARE, HT_CHANNEL_WIDTH_20); -+ } + } +- +- //cfg80211_mgmt_tx_status(dev, *cookie, buf, len, ack, GFP_KERNEL); +- +- goto exit; +- +- } +- else + } else { + DBG_871X("%s remain_ch:%u not in channel plan!!!!\n", __FUNCTION__, remain_ch); + } + - --#ifdef CONFIG_DEBUG_CFG80211 -- printk("%s, do: scan_abort\n", __func__); ++ + //call this after other things have been done +#ifdef CONFIG_CONCURRENT_MODE + if(ATOMIC_READ(&pwdev_priv->ro_ch_to)==1 || + (remain_ch != pmlmeext->cur_channel)) -+ { + { +- u32 cnt=0; +- u32 wait_for_surveydone; +- struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); + u8 co_channel = 0xff; + ATOMIC_SET(&pwdev_priv->ro_ch_to, 0); ++#endif + +-#ifdef CONFIG_DEBUG_CFG80211 +- printk("%s, do: scan_abort\n", __func__); ++ if(ready_on_channel == _TRUE) ++ { ++ if ( !check_fwstate(&padapter->mlmepriv, _FW_LINKED ) ) ++ pmlmeext->cur_channel = remain_ch; ++ ++#ifdef CONFIG_CONCURRENT_MODE ++ co_channel = rtw_get_oper_ch(padapter); ++ ++ if(co_channel !=remain_ch) #endif - - /* Abort the dwell time of any previous off-channel action frame that may @@ -118555,7 +118077,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - * still in progress (including the dwell time), then this new action - * frame will not be sent out. - */ - +- - rtw_cfg80211_scan_abort(padapter); - } -#if 0 @@ -118575,16 +118097,6 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - wldev_iovar_setint(dev, "mpc", 1); - } else if (act_frm->subtype == P2P_PAF_DEVDIS_REQ) { - af_params->dwell_time = WL_LONG_DWELL_TIME; -+ if(ready_on_channel == _TRUE) -+ { -+ if ( !check_fwstate(&padapter->mlmepriv, _FW_LINKED ) ) -+ pmlmeext->cur_channel = remain_ch; -+ -+#ifdef CONFIG_CONCURRENT_MODE -+ co_channel = rtw_get_oper_ch(padapter); -+ -+ if(co_channel !=remain_ch) -+#endif + { + if (!padapter->mlmepriv.LinkDetectInfo.bBusyTraffic) + set_channel_bwmode(padapter, remain_ch, HAL_PRIME_CHNL_OFFSET_DONT_CARE, HT_CHANNEL_WIDTH_20); @@ -118747,7 +118259,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + if(rtw_buddy_adapter_up(padapter)) + rtw_scan_abort(padapter->pbuddy_adapter); + #endif /* CONFIG_CONCURRENT_MODE */ -+ + +- pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; + if (padapter->cfg80211_wdinfo.is_ro_ch == _TRUE) { + //DBG_8192C("%s, cancel ro ch timer\n", __func__); + //_cancel_timer_ex(&padapter->cfg80211_wdinfo.remain_on_ch_timer); @@ -118761,13 +118274,6 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + #endif //CONFIG_CONCURRENT_MODE + } -- pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; -+#ifdef CONFIG_CONCURRENT_MODE -+ if (check_buddy_fwstate(padapter, _FW_LINKED )) { -+ u8 co_channel=0xff; -+ PADAPTER pbuddy_adapter = padapter->pbuddy_adapter; -+ struct mlme_ext_priv *pbuddy_mlmeext = &pbuddy_adapter->mlmeextpriv; - - _rtw_memcpy(pframe, (void*)buf, len); - pattrib->pktlen = len; - @@ -118776,7 +118282,11 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - pmlmeext->mgnt_seq = GetSequence(pwlanhdr); - pattrib->seqnum = pmlmeext->mgnt_seq; - pmlmeext->mgnt_seq++; -+ co_channel = rtw_get_oper_ch(padapter); ++#ifdef CONFIG_CONCURRENT_MODE ++ if (check_buddy_fwstate(padapter, _FW_LINKED )) { ++ u8 co_channel=0xff; ++ PADAPTER pbuddy_adapter = padapter->pbuddy_adapter; ++ struct mlme_ext_priv *pbuddy_mlmeext = &pbuddy_adapter->mlmeextpriv; - - pattrib->last_txcmdsz = pattrib->pktlen; @@ -118784,7 +118294,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release -#ifdef CONFIG_DEBUG_CFG80211 - printk("%s, ack=%d, ok!\n", __func__, ack ); -#endif -+ if (tx_ch != pbuddy_mlmeext->cur_channel) { ++ co_channel = rtw_get_oper_ch(padapter); - //indicate ack before issue frame to avoid racing with rsp frame -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) @@ -118800,7 +118310,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release -exit: - - printk("%s, ack=%d \n", __func__, ack ); -+ u16 ext_listen_period; ++ if (tx_ch != pbuddy_mlmeext->cur_channel) { -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) - cfg80211_mgmt_tx_status(dev, *cookie, buf, len, ack, GFP_KERNEL); @@ -118809,13 +118319,13 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release -#endif - - return ret; ++ u16 ext_listen_period; + +-} + if (ATOMIC_READ(&pwdev_priv->switch_ch_to)==1) { + DBG_8192C("%s, issue nulldata pwrbit=1\n", __func__); + issue_nulldata(padapter->pbuddy_adapter, NULL, 1, 3, 500); --} -+ ATOMIC_SET(&pwdev_priv->switch_ch_to, 0); - -static s32 cfg80211_rtw_remain_on_channel(struct wiphy *wiphy, struct net_device *dev, - struct ieee80211_channel * channel, - enum nl80211_channel_type channel_type, @@ -118827,6 +118337,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - struct wifidirect_info *pwdinfo = &padapter->wdinfo; - struct cfg80211_wifidirect_info *pcfg80211_wdinfo = &padapter->cfg80211_wdinfo; - u8 remain_ch = (u8) ieee80211_frequency_to_channel(channel->center_freq); ++ ATOMIC_SET(&pwdev_priv->switch_ch_to, 0); ++ + //DBG_8192C("%s, set switch ch timer, period=%d\n", __func__, pwdinfo->ext_listen_period); + //_set_timer(&pwdinfo->ap_p2p_switch_timer, pwdinfo->ext_listen_period); + } @@ -118848,9 +118360,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - printk("%s channel %02u duration %d\n", __func__, remain_ch, duration); + if (!check_fwstate(&padapter->mlmepriv, _FW_LINKED )) + pmlmeext->cur_channel = tx_ch; - -- if(_FAIL == rtw_pwr_wakeup(padapter)) { -- err = -EFAULT; ++ + if (tx_ch != co_channel) + set_channel_bwmode(padapter, tx_ch, HAL_PRIME_CHNL_OFFSET_DONT_CARE, HT_CHANNEL_WIDTH_20); + }else @@ -118861,7 +118371,9 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + pmlmeext->cur_channel = tx_ch; + set_channel_bwmode(padapter, tx_ch, HAL_PRIME_CHNL_OFFSET_DONT_CARE, HT_CHANNEL_WIDTH_20); + } -+ + +- if(_FAIL == rtw_pwr_wakeup(padapter)) { +- err = -EFAULT; + //starting alloc mgmt frame to dump it + if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) + { @@ -119129,7 +118641,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #endif if (frame_type != (IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_PROBE_REQ)) -@@ -4082,7 +4776,7 @@ static void cfg80211_rtw_mgmt_frame_regi +@@ -4082,7 +4776,7 @@ static void cfg80211_rtw_mgmt_frame_register(struct wiphy *wiphy, struct net_dev return; } @@ -119138,7 +118650,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { int ret = 0; uint wps_ielen = 0; -@@ -4090,18 +4784,20 @@ static int rtw_cfg80211_set_beacon_wpsp2 +@@ -4090,18 +4784,20 @@ static int rtw_cfg80211_set_beacon_wpsp2pie(struct net_device *net, char *buf, i u32 p2p_ielen = 0; u8 wps_oui[8]={0x0,0x50,0xf2,0x04}; u8 *p2p_ie; @@ -119162,7 +118674,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #endif if(pmlmepriv->wps_beacon_ie) -@@ -4114,7 +4810,7 @@ static int rtw_cfg80211_set_beacon_wpsp2 +@@ -4114,7 +4810,7 @@ static int rtw_cfg80211_set_beacon_wpsp2pie(struct net_device *net, char *buf, i pmlmepriv->wps_beacon_ie = rtw_malloc(wps_ielen); if ( pmlmepriv->wps_beacon_ie == NULL) { @@ -119171,7 +118683,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return -EINVAL; } -@@ -4126,13 +4822,14 @@ static int rtw_cfg80211_set_beacon_wpsp2 +@@ -4126,13 +4822,14 @@ static int rtw_cfg80211_set_beacon_wpsp2pie(struct net_device *net, char *buf, i } @@ -119190,7 +118702,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #endif if(pmlmepriv->p2p_beacon_ie) -@@ -4145,7 +4842,7 @@ static int rtw_cfg80211_set_beacon_wpsp2 +@@ -4145,7 +4842,7 @@ static int rtw_cfg80211_set_beacon_wpsp2pie(struct net_device *net, char *buf, i pmlmepriv->p2p_beacon_ie = rtw_malloc(p2p_ielen); if ( pmlmepriv->p2p_beacon_ie == NULL) { @@ -119199,7 +118711,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return -EINVAL; } -@@ -4154,6 +4851,35 @@ static int rtw_cfg80211_set_beacon_wpsp2 +@@ -4154,6 +4851,35 @@ static int rtw_cfg80211_set_beacon_wpsp2pie(struct net_device *net, char *buf, i pmlmepriv->p2p_beacon_ie_len = p2p_ielen; } @@ -119235,7 +118747,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release pmlmeext->bstart_bss = _TRUE; -@@ -4170,11 +4896,13 @@ static int rtw_cfg80211_set_probe_resp_w +@@ -4170,11 +4896,13 @@ static int rtw_cfg80211_set_probe_resp_wpsp2pie(struct net_device *net, char *bu u8 *wps_ie; u32 p2p_ielen = 0; u8 *p2p_ie; @@ -119250,7 +118762,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #endif if(len>0) -@@ -4185,9 +4913,25 @@ static int rtw_cfg80211_set_probe_resp_w +@@ -4185,9 +4913,25 @@ static int rtw_cfg80211_set_probe_resp_wpsp2pie(struct net_device *net, char *bu u16 uconfig_method, *puconfig_method = NULL; #ifdef CONFIG_DEBUG_CFG80211 @@ -119278,7 +118790,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if(pmlmepriv->wps_probe_resp_ie) { u32 free_len = pmlmepriv->wps_probe_resp_ie_len; -@@ -4198,7 +4942,7 @@ static int rtw_cfg80211_set_probe_resp_w +@@ -4198,7 +4942,7 @@ static int rtw_cfg80211_set_probe_resp_wpsp2pie(struct net_device *net, char *bu pmlmepriv->wps_probe_resp_ie = rtw_malloc(wps_ielen); if ( pmlmepriv->wps_probe_resp_ie == NULL) { @@ -119287,7 +118799,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return -EINVAL; } -@@ -4221,9 +4965,10 @@ static int rtw_cfg80211_set_probe_resp_w +@@ -4221,9 +4965,10 @@ static int rtw_cfg80211_set_probe_resp_wpsp2pie(struct net_device *net, char *bu } @@ -119301,7 +118813,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if((p2p_ie=rtw_get_p2p_ie(buf, len, NULL, &p2p_ielen))) { u8 is_GO = _FALSE; -@@ -4231,7 +4976,7 @@ static int rtw_cfg80211_set_probe_resp_w +@@ -4231,7 +4976,7 @@ static int rtw_cfg80211_set_probe_resp_wpsp2pie(struct net_device *net, char *bu u16 cap_attr=0; #ifdef CONFIG_DEBUG_CFG80211 @@ -119310,7 +118822,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #endif //Check P2P Capability ATTR -@@ -4245,7 +4990,7 @@ static int rtw_cfg80211_set_probe_resp_w +@@ -4245,7 +4990,7 @@ static int rtw_cfg80211_set_probe_resp_wpsp2pie(struct net_device *net, char *bu is_GO = (grp_cap&BIT(0)) ? _TRUE:_FALSE; if(is_GO) @@ -119319,7 +118831,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } -@@ -4261,7 +5006,7 @@ static int rtw_cfg80211_set_probe_resp_w +@@ -4261,7 +5006,7 @@ static int rtw_cfg80211_set_probe_resp_wpsp2pie(struct net_device *net, char *bu pmlmepriv->p2p_probe_resp_ie = rtw_malloc(p2p_ielen); if ( pmlmepriv->p2p_probe_resp_ie == NULL) { @@ -119328,7 +118840,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return -EINVAL; } -@@ -4280,7 +5025,7 @@ static int rtw_cfg80211_set_probe_resp_w +@@ -4280,7 +5025,7 @@ static int rtw_cfg80211_set_probe_resp_wpsp2pie(struct net_device *net, char *bu pmlmepriv->p2p_go_probe_resp_ie = rtw_malloc(p2p_ielen); if ( pmlmepriv->p2p_go_probe_resp_ie == NULL) { @@ -119337,7 +118849,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return -EINVAL; } -@@ -4288,7 +5033,36 @@ static int rtw_cfg80211_set_probe_resp_w +@@ -4288,7 +5033,36 @@ static int rtw_cfg80211_set_probe_resp_wpsp2pie(struct net_device *net, char *bu pmlmepriv->p2p_go_probe_resp_ie_len = p2p_ielen; } @@ -119375,7 +118887,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } -@@ -4302,7 +5076,7 @@ static int rtw_cfg80211_set_assoc_resp_w +@@ -4302,7 +5076,7 @@ static int rtw_cfg80211_set_assoc_resp_wpsp2pie(struct net_device *net, char *bu _adapter *padapter = (_adapter *)rtw_netdev_priv(net); struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); @@ -119384,7 +118896,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if(len>0) { -@@ -4316,7 +5090,7 @@ static int rtw_cfg80211_set_assoc_resp_w +@@ -4316,7 +5090,7 @@ static int rtw_cfg80211_set_assoc_resp_wpsp2pie(struct net_device *net, char *bu pmlmepriv->wps_assoc_resp_ie = rtw_malloc(len); if ( pmlmepriv->wps_assoc_resp_ie == NULL) { @@ -119393,7 +118905,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return -EINVAL; } -@@ -4336,11 +5110,14 @@ int rtw_cfg80211_set_mgnt_wpsp2pie(struc +@@ -4336,11 +5110,14 @@ int rtw_cfg80211_set_mgnt_wpsp2pie(struct net_device *net, char *buf, int len, u32 p2p_ielen = 0; #ifdef CONFIG_DEBUG_CFG80211 @@ -119411,7 +118923,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { if (net != NULL) { -@@ -4382,24 +5159,39 @@ static struct cfg80211_ops rtw_cfg80211_ +@@ -4382,24 +5159,39 @@ static struct cfg80211_ops rtw_cfg80211_ops = { .set_pmksa = cfg80211_rtw_set_pmksa, .del_pmksa = cfg80211_rtw_del_pmksa, .flush_pmksa = cfg80211_rtw_flush_pmksa, @@ -119453,7 +118965,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release .mgmt_tx = cfg80211_rtw_mgmt_tx, .mgmt_frame_register = cfg80211_rtw_mgmt_frame_register, #elif (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,34) && LINUX_VERSION_CODE<=KERNEL_VERSION(2,6,35)) -@@ -4458,7 +5250,7 @@ static void rtw_cfg80211_init_ht_capab(s +@@ -4458,7 +5250,7 @@ static void rtw_cfg80211_init_ht_capab(struct ieee80211_sta_ht_cap *ht_cap, enum } else { @@ -119462,7 +118974,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } } -@@ -4470,18 +5262,48 @@ void rtw_cfg80211_init_wiphy(_adapter *p +@@ -4470,18 +5262,48 @@ void rtw_cfg80211_init_wiphy(_adapter *padapter) struct wireless_dev *pwdev = padapter->rtw_wdev; struct wiphy *wiphy = pwdev->wiphy; @@ -119518,7 +119030,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release static void rtw_cfg80211_preinit_wiphy(_adapter *padapter, struct wiphy *wiphy) { -@@ -4491,95 +5313,134 @@ static void rtw_cfg80211_preinit_wiphy(_ +@@ -4491,95 +5313,134 @@ static void rtw_cfg80211_preinit_wiphy(_adapter *padapter, struct wiphy *wiphy) wiphy->max_scan_ie_len = RTW_SCAN_IE_LEN_MAX; wiphy->max_num_pmkids = RTW_MAX_NUM_PMKIDS; @@ -119696,7 +119208,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return ret; } -@@ -4588,30 +5449,40 @@ void rtw_wdev_free(struct wireless_dev * +@@ -4588,30 +5449,40 @@ void rtw_wdev_free(struct wireless_dev *wdev) { struct rtw_wdev_priv *pwdev_priv; @@ -119751,6 +119263,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } #endif //CONFIG_IOCTL_CFG80211 +diff --git a/drivers/net/wireless/rtl8192cu/os_dep/linux/ioctl_linux.c b/drivers/net/wireless/rtl8192cu/os_dep/linux/ioctl_linux.c +index f999502..9adbeaf 100644 --- a/drivers/net/wireless/rtl8192cu/os_dep/linux/ioctl_linux.c +++ b/drivers/net/wireless/rtl8192cu/os_dep/linux/ioctl_linux.c @@ -34,7 +34,7 @@ @@ -119772,7 +119286,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release u32 rtw_rates[] = {1000000,2000000,5500000,11000000, 6000000,9000000,12000000,18000000,24000000,36000000,48000000,54000000}; -@@ -139,11 +138,12 @@ static int hwaddr_aton_i(const char *txt +@@ -139,11 +138,12 @@ static int hwaddr_aton_i(const char *txt, u8 *addr) static void indicate_wx_custom_event(_adapter *padapter, char *msg) { @@ -119787,7 +119301,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return; } -@@ -152,90 +152,96 @@ static void indicate_wx_custom_event(_ad +@@ -152,90 +152,96 @@ static void indicate_wx_custom_event(_adapter *padapter, char *msg) return; _rtw_memcpy(buff, msg, strlen(msg)); @@ -119909,7 +119423,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } /* -@@ -291,36 +297,87 @@ static char *translate_scan(_adapter *pa +@@ -291,36 +297,87 @@ static char *translate_scan(_adapter *padapter, #endif //CONFIG_P2P #ifdef CONFIG_P2P @@ -120012,7 +119526,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release /* AP MAC address */ iwe.cmd = SIOCGIWAP; iwe.u.ap_addr.sa_family = ARPHRD_ETHER; -@@ -335,7 +392,7 @@ static char *translate_scan(_adapter *pa +@@ -335,7 +392,7 @@ static char *translate_scan(_adapter *padapter, start = iwe_stream_add_point(info, start, stop, &iwe, pnetwork->network.Ssid.Ssid); //parsing HT_CAP_IE @@ -120021,7 +119535,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if(p && ht_ielen>0) { -@@ -445,7 +502,7 @@ static char *translate_scan(_adapter *pa +@@ -445,7 +502,7 @@ static char *translate_scan(_adapter *padapter, } else//default MCS7 { @@ -120030,7 +119544,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release max_rate = (bw_40MHz) ? ((short_GI)?150:135):((short_GI)?72:65); } -@@ -508,58 +565,56 @@ static char *translate_scan(_adapter *pa +@@ -508,58 +565,56 @@ static char *translate_scan(_adapter *padapter, } { //parsing WPS IE @@ -120118,7 +119632,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #ifdef CONFIG_PLATFORM_ROCKCHIPS iwe.u.qual.noise = -100; // noise level suggest by zhf@rockchips -@@ -567,14 +622,10 @@ static char *translate_scan(_adapter *pa +@@ -567,14 +622,10 @@ static char *translate_scan(_adapter *padapter, iwe.u.qual.noise = 0; // noise level #endif //CONFIG_PLATFORM_ROCKCHIPS @@ -120135,7 +119649,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return start; } -@@ -586,14 +637,14 @@ static int wpa_set_auth_algs(struct net_ +@@ -586,14 +637,14 @@ static int wpa_set_auth_algs(struct net_device *dev, u32 value) if ((value & AUTH_ALG_SHARED_KEY)&&(value & AUTH_ALG_OPEN_SYSTEM)) { @@ -120152,7 +119666,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release padapter->securitypriv.ndisencryptstatus = Ndis802_11Encryption1Enabled; #ifdef CONFIG_PLATFORM_MT53XX -@@ -606,7 +657,7 @@ static int wpa_set_auth_algs(struct net_ +@@ -606,7 +657,7 @@ static int wpa_set_auth_algs(struct net_device *dev, u32 value) } else if(value & AUTH_ALG_OPEN_SYSTEM) { @@ -120161,7 +119675,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release //padapter->securitypriv.ndisencryptstatus = Ndis802_11EncryptionDisabled; if(padapter->securitypriv.ndisauthtype < Ndis802_11AuthModeWPAPSK) { -@@ -622,11 +673,11 @@ static int wpa_set_auth_algs(struct net_ +@@ -622,11 +673,11 @@ static int wpa_set_auth_algs(struct net_device *dev, u32 value) } else if(value & AUTH_ALG_LEAP) { @@ -120299,7 +119813,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } _func_exit_; -@@ -857,12 +941,13 @@ static int rtw_set_wpa_ie(_adapter *pada +@@ -857,12 +941,13 @@ static int rtw_set_wpa_ie(_adapter *padapter, char *pie, unsigned short ielen) u32 left; int group_cipher = 0, pairwise_cipher = 0; int ret = 0; @@ -120314,7 +119828,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if(pie == NULL) return ret; else -@@ -882,9 +967,9 @@ static int rtw_set_wpa_ie(_adapter *pada +@@ -882,9 +967,9 @@ static int rtw_set_wpa_ie(_adapter *padapter, char *pie, unsigned short ielen) //dump { int i; @@ -120326,7 +119840,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } pos = buf; -@@ -923,6 +1008,15 @@ static int rtw_set_wpa_ie(_adapter *pada +@@ -923,6 +1008,15 @@ static int rtw_set_wpa_ie(_adapter *padapter, char *pie, unsigned short ielen) _rtw_memcpy(padapter->securitypriv.supplicant_ie, &buf[0], ielen); } @@ -120342,7 +119856,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release switch(group_cipher) { case WPA_CIPHER_NONE: -@@ -971,7 +1065,7 @@ static int rtw_set_wpa_ie(_adapter *pada +@@ -971,7 +1065,7 @@ static int rtw_set_wpa_ie(_adapter *padapter, char *pie, unsigned short ielen) break; } @@ -120351,7 +119865,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release {//set wps_ie u16 cnt = 0; u8 eid, wps_oui[4]={0x0,0x50,0xf2,0x04}; -@@ -982,13 +1076,13 @@ static int rtw_set_wpa_ie(_adapter *pada +@@ -982,13 +1076,13 @@ static int rtw_set_wpa_ie(_adapter *padapter, char *pie, unsigned short ielen) if((eid==_VENDOR_SPECIFIC_IE_)&&(_rtw_memcmp(&buf[cnt+2], wps_oui, 4)==_TRUE)) { @@ -120367,7 +119881,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #ifdef CONFIG_P2P if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_GONEGO_OK)) -@@ -996,8 +1090,6 @@ static int rtw_set_wpa_ie(_adapter *pada +@@ -996,8 +1090,6 @@ static int rtw_set_wpa_ie(_adapter *padapter, char *pie, unsigned short ielen) rtw_p2p_set_state(pwdinfo, P2P_STATE_PROVISIONING_ING); } #endif //CONFIG_P2P @@ -120376,7 +119890,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release cnt += buf[cnt+1]+2; break; -@@ -1007,7 +1099,15 @@ static int rtw_set_wpa_ie(_adapter *pada +@@ -1007,7 +1099,15 @@ static int rtw_set_wpa_ie(_adapter *padapter, char *pie, unsigned short ielen) } } } @@ -120393,7 +119907,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release RT_TRACE(_module_rtl871x_ioctl_os_c, _drv_info_, ("rtw_set_wpa_ie: pairwise_cipher=0x%08x padapter->securitypriv.ndisencryptstatus=%d padapter->securitypriv.ndisauthtype=%d\n", pairwise_cipher, padapter->securitypriv.ndisencryptstatus, padapter->securitypriv.ndisauthtype)); -@@ -1135,10 +1235,12 @@ static int rtw_wx_set_mode(struct net_de +@@ -1135,10 +1235,12 @@ static int rtw_wx_set_mode(struct net_device *dev, struct iw_request_info *a, _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); NDIS_802_11_NETWORK_INFRASTRUCTURE networkType ; int ret = 0; @@ -120408,7 +119922,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release ret= -EPERM; goto exit; } -@@ -1152,20 +1254,20 @@ static int rtw_wx_set_mode(struct net_de +@@ -1152,20 +1254,20 @@ static int rtw_wx_set_mode(struct net_device *dev, struct iw_request_info *a, { case IW_MODE_AUTO: networkType = Ndis802_11AutoUnknown; @@ -120433,7 +119947,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release break; default : -@@ -1184,14 +1286,18 @@ static int rtw_wx_set_mode(struct net_de +@@ -1184,14 +1286,18 @@ static int rtw_wx_set_mode(struct net_device *dev, struct iw_request_info *a, rtw_setopmode_cmd(padapter, Ndis802_11AutoUnknown); } */ @@ -120454,7 +119968,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release rtw_setopmode_cmd(padapter, networkType); exit: -@@ -1267,7 +1373,7 @@ static int rtw_wx_set_pmkid(struct net_d +@@ -1267,7 +1373,7 @@ static int rtw_wx_set_pmkid(struct net_device *dev, _rtw_memcpy( strIssueBssid, pPMK->bssid.sa_data, ETH_ALEN); if ( pPMK->cmd == IW_PMKSA_ADD ) { @@ -120463,7 +119977,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if ( _rtw_memcmp( strIssueBssid, strZeroMacAddress, ETH_ALEN ) == _TRUE ) { return( intReturn ); -@@ -1284,7 +1390,7 @@ static int rtw_wx_set_pmkid(struct net_d +@@ -1284,7 +1390,7 @@ static int rtw_wx_set_pmkid(struct net_device *dev, if( _rtw_memcmp( psecuritypriv->PMKIDList[j].Bssid, strIssueBssid, ETH_ALEN) ==_TRUE ) { // BSSID is matched, the same AP => rewrite with new PMKID. @@ -120472,7 +119986,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release _rtw_memcpy( psecuritypriv->PMKIDList[j].PMKID, pPMK->pmkid, IW_PMKID_LEN); psecuritypriv->PMKIDList[ j ].bUsed = _TRUE; -@@ -1297,7 +1403,7 @@ static int rtw_wx_set_pmkid(struct net_d +@@ -1297,7 +1403,7 @@ static int rtw_wx_set_pmkid(struct net_device *dev, if(!blInserted) { // Find a new entry @@ -120481,7 +119995,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release psecuritypriv->PMKIDIndex ); _rtw_memcpy(psecuritypriv->PMKIDList[psecuritypriv->PMKIDIndex].Bssid, strIssueBssid, ETH_ALEN); -@@ -1313,7 +1419,7 @@ static int rtw_wx_set_pmkid(struct net_d +@@ -1313,7 +1419,7 @@ static int rtw_wx_set_pmkid(struct net_device *dev, } else if ( pPMK->cmd == IW_PMKSA_REMOVE ) { @@ -120490,7 +120004,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release intReturn = _TRUE; for(j=0 ; jcmd == IW_PMKSA_FLUSH ) { @@ -120499,7 +120013,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release _rtw_memset( &psecuritypriv->PMKIDList[ 0 ], 0x00, sizeof( RT_PMKID_LIST ) * NUM_PMKID_CACHE ); psecuritypriv->PMKIDIndex = 0; intReturn = _TRUE; -@@ -1509,10 +1615,39 @@ static int rtw_wx_set_wap(struct net_dev +@@ -1509,10 +1615,39 @@ static int rtw_wx_set_wap(struct net_device *dev, _queue *queue = &(pmlmepriv->scanned_queue); struct wlan_network *pnetwork = NULL; NDIS_802_11_AUTHENTICATION_MODE authmode; @@ -120542,7 +120056,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { ret= -1; goto exit; -@@ -1530,6 +1665,7 @@ static int rtw_wx_set_wap(struct net_dev +@@ -1530,6 +1665,7 @@ static int rtw_wx_set_wap(struct net_device *dev, } authmode = padapter->securitypriv.ndisauthtype; @@ -120550,7 +120064,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release _enter_critical_bh(&queue->lock, &irqL); phead = get_list_head(queue); pmlmepriv->pscanned = get_next(phead); -@@ -1572,6 +1708,7 @@ static int rtw_wx_set_wap(struct net_dev +@@ -1572,6 +1708,7 @@ static int rtw_wx_set_wap(struct net_device *dev, { ret = -1; _exit_critical_bh(&queue->lock, &irqL); @@ -120558,7 +120072,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release goto exit; } -@@ -1580,7 +1717,7 @@ static int rtw_wx_set_wap(struct net_dev +@@ -1580,7 +1717,7 @@ static int rtw_wx_set_wap(struct net_device *dev, } _exit_critical_bh(&queue->lock, &irqL); @@ -120659,7 +120173,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release static int rtw_wx_set_scan(struct net_device *dev, struct iw_request_info *a, union iwreq_data *wrqu, char *extra) { -@@ -1756,7 +1827,6 @@ static int rtw_wx_set_scan(struct net_de +@@ -1756,7 +1827,6 @@ static int rtw_wx_set_scan(struct net_device *dev, struct iw_request_info *a, struct mlme_priv *pmlmepriv= &padapter->mlmepriv; NDIS_802_11_SSID ssid[RTW_SSID_SCAN_AMOUNT]; _irqL irqL; @@ -120791,7 +120305,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } if(_status == _FALSE) -@@ -1972,7 +2074,7 @@ static int rtw_wx_get_scan(struct net_de +@@ -1972,7 +2074,7 @@ static int rtw_wx_get_scan(struct net_device *dev, struct iw_request_info *a, _irqL irqL; _list *plist, *phead; _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); @@ -120800,7 +120314,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release _queue *queue = &(pmlmepriv->scanned_queue); struct wlan_network *pnetwork = NULL; char *ev = extra; -@@ -1981,6 +2083,10 @@ static int rtw_wx_get_scan(struct net_de +@@ -1981,6 +2083,10 @@ static int rtw_wx_get_scan(struct net_device *dev, struct iw_request_info *a, u32 cnt=0; u32 wait_for_surveydone; sint wait_status; @@ -120811,7 +120325,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #ifdef CONFIG_P2P struct wifidirect_info* pwdinfo = &padapter->wdinfo; #endif //CONFIG_P2P -@@ -1993,6 +2099,15 @@ static int rtw_wx_get_scan(struct net_de +@@ -1993,6 +2099,15 @@ static int rtw_wx_get_scan(struct net_device *dev, struct iw_request_info *a, DBG_871X("DBG_IOCTL %s:%d\n",__FUNCTION__, __LINE__); #endif @@ -120827,7 +120341,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if(padapter->pwrctrlpriv.brfoffbyhw && padapter->bDriverStopped) { ret = -EINVAL; -@@ -2003,7 +2118,10 @@ static int rtw_wx_get_scan(struct net_de +@@ -2003,7 +2118,10 @@ static int rtw_wx_get_scan(struct net_device *dev, struct iw_request_info *a, if(!rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)) { // P2P is enabled @@ -120839,7 +120353,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } else { -@@ -2016,14 +2134,39 @@ static int rtw_wx_get_scan(struct net_de +@@ -2016,14 +2134,39 @@ static int rtw_wx_get_scan(struct net_device *dev, struct iw_request_info *a, } #endif //CONFIG_P2P @@ -120881,7 +120395,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release rtw_msleep_os(30); cnt++; if(cnt > wait_for_surveydone ) -@@ -2048,10 +2191,9 @@ static int rtw_wx_get_scan(struct net_de +@@ -2048,10 +2191,9 @@ static int rtw_wx_get_scan(struct net_device *dev, struct iw_request_info *a, pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list); //report network only if the current channel set contains the channel to which this network belongs @@ -120894,7 +120408,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release ) { ev=translate_scan(padapter, a, pnetwork, ev, stop); -@@ -2095,7 +2237,6 @@ static int rtw_wx_set_essid(struct net_d +@@ -2095,7 +2237,6 @@ static int rtw_wx_set_essid(struct net_device *dev, _list *phead; s8 status = _TRUE; struct wlan_network *pnetwork = NULL; @@ -120902,7 +120416,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release NDIS_802_11_AUTHENTICATION_MODE authmode; NDIS_802_11_SSID ndis_ssid; u8 *dst_ssid, *src_ssid; -@@ -2108,9 +2249,39 @@ static int rtw_wx_set_essid(struct net_d +@@ -2108,9 +2249,39 @@ static int rtw_wx_set_essid(struct net_device *dev, DBG_871X("DBG_IOCTL %s:%d\n",__FUNCTION__, __LINE__); #endif @@ -120943,7 +120457,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { ret = -1; goto exit; -@@ -2136,7 +2307,7 @@ static int rtw_wx_set_essid(struct net_d +@@ -2136,7 +2307,7 @@ static int rtw_wx_set_essid(struct net_device *dev, } authmode = padapter->securitypriv.ndisauthtype; @@ -120952,7 +120466,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if (wrqu->essid.flags && wrqu->essid.length) { // Commented by Albert 20100519 -@@ -2153,7 +2324,8 @@ static int rtw_wx_set_essid(struct net_d +@@ -2153,7 +2324,8 @@ static int rtw_wx_set_essid(struct net_device *dev, len = (wrqu->essid.length < IW_ESSID_MAX_SIZE) ? wrqu->essid.length : IW_ESSID_MAX_SIZE; #endif @@ -120962,7 +120476,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release _rtw_memset(&ndis_ssid, 0, sizeof(NDIS_802_11_SSID)); ndis_ssid.SsidLength = len; -@@ -2161,6 +2333,7 @@ static int rtw_wx_set_essid(struct net_d +@@ -2161,6 +2333,7 @@ static int rtw_wx_set_essid(struct net_device *dev, src_ssid = ndis_ssid.Ssid; RT_TRACE(_module_rtl871x_ioctl_os_c, _drv_info_, ("rtw_wx_set_essid: ssid=[%s]\n", src_ssid)); @@ -120970,7 +120484,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release _enter_critical_bh(&queue->lock, &irqL); phead = get_list_head(queue); pmlmepriv->pscanned = get_next(phead); -@@ -2215,6 +2388,7 @@ static int rtw_wx_set_essid(struct net_d +@@ -2215,6 +2388,7 @@ static int rtw_wx_set_essid(struct net_device *dev, { ret = -1; _exit_critical_bh(&queue->lock, &irqL); @@ -120978,7 +120492,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release goto exit; } -@@ -2222,6 +2396,7 @@ static int rtw_wx_set_essid(struct net_d +@@ -2222,6 +2396,7 @@ static int rtw_wx_set_essid(struct net_device *dev, } } _exit_critical_bh(&queue->lock, &irqL); @@ -120986,7 +120500,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release RT_TRACE(_module_rtl871x_ioctl_os_c, _drv_info_, ("set ssid: set_802_11_auth. mode=%d\n", authmode)); rtw_set_802_11_authentication_mode(padapter, authmode); -@@ -2234,7 +2409,7 @@ static int rtw_wx_set_essid(struct net_d +@@ -2234,7 +2409,7 @@ static int rtw_wx_set_essid(struct net_device *dev, exit: @@ -120995,7 +120509,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #ifdef DBG_IOCTL DBG_871X("DBG_IOCTL %s:%d return %d\n",__FUNCTION__, __LINE__, ret); -@@ -2379,94 +2554,43 @@ static int rtw_wx_get_rate(struct net_de +@@ -2379,94 +2554,43 @@ static int rtw_wx_get_rate(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { @@ -121118,7 +120632,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } static int rtw_wx_get_rts(struct net_device *dev, -@@ -2476,7 +2600,8 @@ static int rtw_wx_get_rts(struct net_dev +@@ -2476,7 +2600,8 @@ static int rtw_wx_get_rts(struct net_device *dev, _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); _func_enter_; @@ -121128,7 +120642,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release wrqu->rts.value = padapter->registrypriv.rts_thresh; wrqu->rts.fixed = 0; /* no auto select */ -@@ -2504,6 +2629,8 @@ static int rtw_wx_set_frag(struct net_de +@@ -2504,6 +2629,8 @@ static int rtw_wx_set_frag(struct net_device *dev, padapter->xmitpriv.frag_len = wrqu->frag.value & ~0x1; } @@ -121137,7 +120651,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release _func_exit_; -@@ -2511,7 +2638,6 @@ static int rtw_wx_set_frag(struct net_de +@@ -2511,7 +2638,6 @@ static int rtw_wx_set_frag(struct net_device *dev, } @@ -121145,7 +120659,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release static int rtw_wx_get_frag(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) -@@ -2519,6 +2645,8 @@ static int rtw_wx_get_frag(struct net_de +@@ -2519,6 +2645,8 @@ static int rtw_wx_get_frag(struct net_device *dev, _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); _func_enter_; @@ -121154,7 +120668,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release wrqu->frag.value = padapter->xmitpriv.frag_len; wrqu->frag.fixed = 0; /* no auto select */ -@@ -2579,7 +2707,7 @@ static int rtw_wx_set_enc(struct net_dev +@@ -2579,7 +2707,7 @@ static int rtw_wx_set_enc(struct net_device *dev, struct iw_point *erq = &(wrqu->encoding); _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv; @@ -121163,7 +120677,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release _rtw_memset(&wep, 0, sizeof(NDIS_802_11_WEP)); -@@ -2589,7 +2717,7 @@ static int rtw_wx_set_enc(struct net_dev +@@ -2589,7 +2717,7 @@ static int rtw_wx_set_enc(struct net_device *dev, if (erq->flags & IW_ENCODE_DISABLED) { @@ -121172,7 +120686,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release padapter->securitypriv.ndisencryptstatus = Ndis802_11EncryptionDisabled; padapter->securitypriv.dot11PrivacyAlgrthm=_NO_PRIVACY_; padapter->securitypriv.dot118021XGrpPrivacy=_NO_PRIVACY_; -@@ -2610,13 +2738,13 @@ static int rtw_wx_set_enc(struct net_dev +@@ -2610,13 +2738,13 @@ static int rtw_wx_set_enc(struct net_device *dev, { keyindex_provided = 0; key = padapter->securitypriv.dot11PrivacyKeyIndex; @@ -121188,7 +120702,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release padapter->securitypriv.ndisencryptstatus = Ndis802_11Encryption1Enabled;//Ndis802_11EncryptionDisabled; #ifdef CONFIG_PLATFORM_MT53XX -@@ -2632,7 +2760,7 @@ static int rtw_wx_set_enc(struct net_dev +@@ -2632,7 +2760,7 @@ static int rtw_wx_set_enc(struct net_device *dev, } else if(erq->flags & IW_ENCODE_RESTRICTED) { @@ -121197,7 +120711,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release padapter->securitypriv.ndisencryptstatus = Ndis802_11Encryption1Enabled; #ifdef CONFIG_PLATFORM_MT53XX -@@ -2648,7 +2776,7 @@ static int rtw_wx_set_enc(struct net_dev +@@ -2648,7 +2776,7 @@ static int rtw_wx_set_enc(struct net_device *dev, } else { @@ -121206,7 +120720,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release padapter->securitypriv.ndisencryptstatus = Ndis802_11Encryption1Enabled;//Ndis802_11EncryptionDisabled; padapter->securitypriv.dot11AuthAlgrthm= dot11AuthAlgrthm_Open; //open system -@@ -2673,7 +2801,7 @@ static int rtw_wx_set_enc(struct net_dev +@@ -2673,7 +2801,7 @@ static int rtw_wx_set_enc(struct net_device *dev, { padapter->securitypriv.dot11PrivacyKeyIndex = key; @@ -121215,7 +120729,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release switch(padapter->securitypriv.dot11DefKeylen[key]) { -@@ -2910,7 +3038,8 @@ static int rtw_wx_set_auth(struct net_de +@@ -2910,7 +3038,8 @@ static int rtw_wx_set_auth(struct net_device *dev, * It's the starting point of a link layer connection using wpa_supplicant */ if(check_fwstate(&padapter->mlmepriv, _FW_LINKED)) { @@ -121225,7 +120739,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release DBG_871X("%s...call rtw_indicate_disconnect\n ",__FUNCTION__); rtw_indicate_disconnect(padapter); rtw_free_assoc_resources(padapter, 1); -@@ -2987,6 +3116,11 @@ static int rtw_wx_set_enc_ext(struct net +@@ -2987,6 +3116,11 @@ static int rtw_wx_set_enc_ext(struct net_device *dev, case IW_ENCODE_ALG_CCMP: alg_name = "CCMP"; break; @@ -121237,7 +120751,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release default: return -1; } -@@ -2994,7 +3128,11 @@ static int rtw_wx_set_enc_ext(struct net +@@ -2994,7 +3128,11 @@ static int rtw_wx_set_enc_ext(struct net_device *dev, strncpy((char *)param->u.crypt.alg, alg_name, IEEE_CRYPT_ALG_NAME_LEN); @@ -121250,7 +120764,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { param->u.crypt.set_tx = 0; } -@@ -3065,40 +3203,40 @@ static int rtw_wx_get_nick(struct net_de +@@ -3065,40 +3203,40 @@ static int rtw_wx_get_nick(struct net_device *dev, u32 ndisencryptstatus; */ @@ -121312,7 +120826,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #endif return 0; -@@ -3109,15 +3247,51 @@ static int rtw_wx_read32(struct net_devi +@@ -3109,15 +3247,51 @@ static int rtw_wx_read32(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { @@ -121369,7 +120883,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return 0; } -@@ -3126,15 +3300,35 @@ static int rtw_wx_write32(struct net_dev +@@ -3126,15 +3300,35 @@ static int rtw_wx_write32(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { @@ -121409,7 +120923,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return 0; } -@@ -3149,8 +3343,8 @@ static int rtw_wx_read_rf(struct net_dev +@@ -3149,8 +3343,8 @@ static int rtw_wx_read_rf(struct net_device *dev, path = *(u32*)extra; addr = *((u32*)extra + 1); @@ -121420,7 +120934,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release /* * IMPORTANT!! * Only when wireless private ioctl is at odd order, -@@ -3172,8 +3366,8 @@ static int rtw_wx_write_rf(struct net_de +@@ -3172,8 +3366,8 @@ static int rtw_wx_write_rf(struct net_device *dev, path = *(u32*)extra; addr = *((u32*)extra + 1); data32 = *((u32*)extra + 2); @@ -121431,7 +120945,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return 0; } -@@ -3190,7 +3384,7 @@ static int dummy(struct net_device *dev, +@@ -3190,7 +3384,7 @@ static int dummy(struct net_device *dev, struct iw_request_info *a, //_adapter *padapter = (_adapter *)rtw_netdev_priv(dev); //struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); @@ -121440,7 +120954,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return -1; -@@ -3213,7 +3407,7 @@ static int rtw_wx_set_channel_plan(struc +@@ -3213,7 +3407,7 @@ static int rtw_wx_set_channel_plan(struct net_device *dev, #endif if( _SUCCESS == rtw_set_chplan_cmd(padapter, channel_plan_req, 1) ) { @@ -121449,7 +120963,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } else return -EPERM; -@@ -3245,7 +3439,7 @@ static int rtw_wx_get_sensitivity(struct +@@ -3245,7 +3439,7 @@ static int rtw_wx_get_sensitivity(struct net_device *dev, // Modified by Albert 20110914 // This is in dbm format for MTK platform. wrqu->qual.level = padapter->recvpriv.rssi; @@ -121458,7 +120972,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #endif return 0; } -@@ -3391,12 +3585,12 @@ static void rtw_dbg_mode_hdl(_adapter *p +@@ -3391,12 +3585,12 @@ static void rtw_dbg_mode_hdl(_adapter *padapter, u32 id, u8 *pdata, u32 len) u8 offset; u32 value; @@ -121473,7 +120987,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release break; case GEN_MP_IOCTL_SUBCODE(READ_REG): RegRWStruct = (pRW_Reg)pdata; -@@ -3441,7 +3635,7 @@ static void rtw_dbg_mode_hdl(_adapter *p +@@ -3441,7 +3635,7 @@ static void rtw_dbg_mode_hdl(_adapter *padapter, u32 id, u8 *pdata, u32 len) path = (u8)prfreg->path; offset = (u8)prfreg->offset; @@ -121482,7 +120996,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release prfreg->value = value; -@@ -3454,27 +3648,26 @@ static void rtw_dbg_mode_hdl(_adapter *p +@@ -3454,27 +3648,26 @@ static void rtw_dbg_mode_hdl(_adapter *padapter, u32 id, u8 *pdata, u32 len) offset = (u8)prfreg->offset; value = prfreg->value; @@ -121518,7 +121032,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release break; #endif -@@ -3495,10 +3688,10 @@ static int rtw_mp_ioctl_hdl(struct net_d +@@ -3495,10 +3688,10 @@ static int rtw_mp_ioctl_hdl(struct net_device *dev, struct iw_request_info *info uint status=0; u16 len; u8 *pparmbuf = NULL, bset; @@ -121531,7 +121045,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release //mutex_lock(&ioctl_mutex); -@@ -3532,7 +3725,7 @@ static int rtw_mp_ioctl_hdl(struct net_d +@@ -3532,7 +3725,7 @@ static int rtw_mp_ioctl_hdl(struct net_device *dev, struct iw_request_info *info goto _rtw_mp_ioctl_hdl_exit; } @@ -121540,7 +121054,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #ifdef CONFIG_MP_INCLUDED phandler = mp_ioctl_hdl + poidparam->subcode; -@@ -3572,7 +3765,7 @@ static int rtw_mp_ioctl_hdl(struct net_d +@@ -3572,7 +3765,7 @@ static int rtw_mp_ioctl_hdl(struct net_device *dev, struct iw_request_info *info //todo:check status, BytesNeeded, etc. } else { @@ -121549,7 +121063,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release poidparam->subcode, phandler->oid, phandler->handler); ret = -EFAULT; goto _rtw_mp_ioctl_hdl_exit; -@@ -3620,7 +3813,7 @@ static int rtw_get_ap_info(struct net_de +@@ -3620,7 +3813,7 @@ static int rtw_get_ap_info(struct net_device *dev, _queue *queue = &(pmlmepriv->scanned_queue); struct iw_point *pdata = &wrqu->data; @@ -121558,7 +121072,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if((padapter->bDriverStopped) || (pdata==NULL)) { -@@ -3669,7 +3862,7 @@ static int rtw_get_ap_info(struct net_de +@@ -3669,7 +3862,7 @@ static int rtw_get_ap_info(struct net_device *dev, //if(hwaddr_aton_i(pdata->pointer, bssid)) if(hwaddr_aton_i(data, bssid)) { @@ -121567,7 +121081,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release _exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); return -EINVAL; } -@@ -3677,7 +3870,7 @@ static int rtw_get_ap_info(struct net_de +@@ -3677,7 +3870,7 @@ static int rtw_get_ap_info(struct net_device *dev, if(_rtw_memcmp(bssid, pnetwork->network.MacAddress, ETH_ALEN) == _TRUE)//BSSID match, then check if supporting wpa/wpa2 { @@ -121576,7 +121090,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release pbuf = rtw_get_wpa_ie(&pnetwork->network.IEs[12], &wpa_ielen, pnetwork->network.IELength-12); if(pbuf && (wpa_ielen>0)) -@@ -3768,17 +3961,17 @@ static int rtw_wps_start(struct net_devi +@@ -3768,17 +3961,17 @@ static int rtw_wps_start(struct net_device *dev, goto exit; } @@ -121602,7 +121116,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release else if ( u32wps_start == 2 ) // WPS Stop because of wps success { rtw_led_control(padapter, LED_CTL_STOP_WPS); -@@ -3787,6 +3980,11 @@ static int rtw_wps_start(struct net_devi +@@ -3787,6 +3980,11 @@ static int rtw_wps_start(struct net_device *dev, { rtw_led_control(padapter, LED_CTL_STOP_WPS_FAIL); } @@ -121622,7 +121136,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release static int rtw_wext_p2p_enable(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) -@@ -3834,9 +4031,34 @@ static int rtw_wext_p2p_enable(struct ne +@@ -3834,9 +4031,34 @@ static int rtw_wext_p2p_enable(struct net_device *dev, { // Stay at the listen state and wait for discovery. channel = pwdinfo->listen_channel; @@ -121658,7 +121172,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release else { pwdinfo->operating_channel = pmlmeext->cur_channel; -@@ -3865,7 +4087,7 @@ static int rtw_p2p_set_go_nego_ssid(stru +@@ -3865,7 +4087,7 @@ static int rtw_p2p_set_go_nego_ssid(struct net_device *dev, struct iw_point *pdata = &wrqu->data; struct wifidirect_info *pwdinfo= &(padapter->wdinfo); @@ -121667,7 +121181,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release _rtw_memcpy( pwdinfo->nego_ssid, extra, strlen( extra ) ); pwdinfo->nego_ssidlen = strlen( extra ); -@@ -3878,28 +4100,15 @@ static int rtw_p2p_set_intent(struct net +@@ -3878,28 +4100,15 @@ static int rtw_p2p_set_intent(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { @@ -121703,7 +121217,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if ( intent <= 15 ) { pwdinfo->intent= intent; -@@ -3909,10 +4118,10 @@ static int rtw_p2p_set_intent(struct net +@@ -3909,10 +4118,10 @@ static int rtw_p2p_set_intent(struct net_device *dev, ret = -1; } @@ -121717,7 +121231,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } static int rtw_p2p_set_listen_ch(struct net_device *dev, -@@ -3922,26 +4131,13 @@ static int rtw_p2p_set_listen_ch(struct +@@ -3922,26 +4131,13 @@ static int rtw_p2p_set_listen_ch(struct net_device *dev, int ret = 0; _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); @@ -121747,7 +121261,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { pwdinfo->listen_channel = listen_ch; set_channel_bwmode(padapter, pwdinfo->listen_channel, HAL_PRIME_CHNL_OFFSET_DONT_CARE, HT_CHANNEL_WIDTH_20); -@@ -3951,7 +4147,7 @@ static int rtw_p2p_set_listen_ch(struct +@@ -3951,7 +4147,7 @@ static int rtw_p2p_set_listen_ch(struct net_device *dev, ret = -1; } @@ -121756,7 +121270,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return ret; -@@ -3966,30 +4162,13 @@ static int rtw_p2p_set_op_ch(struct net_ +@@ -3966,30 +4162,13 @@ static int rtw_p2p_set_op_ch(struct net_device *dev, int ret = 0; _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); @@ -121790,7 +121304,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { pwdinfo->operating_channel = op_ch; } -@@ -3998,10 +4177,10 @@ static int rtw_p2p_set_op_ch(struct net_ +@@ -3998,10 +4177,10 @@ static int rtw_p2p_set_op_ch(struct net_device *dev, ret = -1; } @@ -121803,7 +121317,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } -@@ -4012,8 +4191,6 @@ static int rtw_p2p_profilefound(struct n +@@ -4012,8 +4191,6 @@ static int rtw_p2p_profilefound(struct net_device *dev, int ret = 0; _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); @@ -121812,7 +121326,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release struct wifidirect_info *pwdinfo= &(padapter->wdinfo); // Comment by Albert 2010/10/13 -@@ -4026,7 +4203,7 @@ static int rtw_p2p_profilefound(struct n +@@ -4026,7 +4203,7 @@ static int rtw_p2p_profilefound(struct net_device *dev, // YY => SSID Length // SSID => SSID for persistence group @@ -121821,7 +121335,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release // The upper application should pass the SSID to driver by using this rtw_p2p_profilefound function. -@@ -4055,8 +4232,8 @@ static int rtw_p2p_profilefound(struct n +@@ -4055,8 +4232,8 @@ static int rtw_p2p_profilefound(struct net_device *dev, pwdinfo->profileinfo[ pwdinfo->profileindex ].peermac[ jj ] = key_2char2num(extra[ kk ], extra[ kk+ 1 ]); } @@ -121832,7 +121346,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release pwdinfo->profileindex++; } } -@@ -4073,16 +4250,14 @@ static int rtw_p2p_setDN(struct net_devi +@@ -4073,16 +4250,14 @@ static int rtw_p2p_setDN(struct net_device *dev, int ret = 0; _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); @@ -121853,7 +121367,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return ret; } -@@ -4098,23 +4273,20 @@ static int rtw_p2p_get_status(struct net +@@ -4098,23 +4273,20 @@ static int rtw_p2p_get_status(struct net_device *dev, struct iw_point *pdata = &wrqu->data; struct wifidirect_info *pwdinfo = &( padapter->wdinfo ); @@ -121884,7 +121398,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return ret; } -@@ -4152,7 +4324,7 @@ static int rtw_p2p_get_role(struct net_d +@@ -4152,7 +4324,7 @@ static int rtw_p2p_get_role(struct net_device *dev, struct wifidirect_info *pwdinfo = &( padapter->wdinfo ); @@ -121893,7 +121407,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release pwdinfo->p2p_peer_interface_addr[ 0 ], pwdinfo->p2p_peer_interface_addr[ 1 ], pwdinfo->p2p_peer_interface_addr[ 2 ], pwdinfo->p2p_peer_interface_addr[ 3 ], pwdinfo->p2p_peer_interface_addr[ 4 ], pwdinfo->p2p_peer_interface_addr[ 5 ]); -@@ -4174,7 +4346,7 @@ static int rtw_p2p_get_peer_ifaddr(struc +@@ -4174,7 +4346,7 @@ static int rtw_p2p_get_peer_ifaddr(struct net_device *dev, struct wifidirect_info *pwdinfo = &( padapter->wdinfo ); @@ -121902,7 +121416,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release pwdinfo->p2p_peer_interface_addr[ 0 ], pwdinfo->p2p_peer_interface_addr[ 1 ], pwdinfo->p2p_peer_interface_addr[ 2 ], pwdinfo->p2p_peer_interface_addr[ 3 ], pwdinfo->p2p_peer_interface_addr[ 4 ], pwdinfo->p2p_peer_interface_addr[ 5 ]); -@@ -4197,7 +4369,7 @@ static int rtw_p2p_get_peer_devaddr(stru +@@ -4197,7 +4369,7 @@ static int rtw_p2p_get_peer_devaddr(struct net_device *dev, struct iw_point *pdata = &wrqu->data; struct wifidirect_info *pwdinfo = &( padapter->wdinfo ); @@ -121911,7 +121425,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release pwdinfo->rx_prov_disc_info.peerDevAddr[ 0 ], pwdinfo->rx_prov_disc_info.peerDevAddr[ 1 ], pwdinfo->rx_prov_disc_info.peerDevAddr[ 2 ], pwdinfo->rx_prov_disc_info.peerDevAddr[ 3 ], pwdinfo->rx_prov_disc_info.peerDevAddr[ 4 ], pwdinfo->rx_prov_disc_info.peerDevAddr[ 5 ]); -@@ -4210,6 +4382,30 @@ static int rtw_p2p_get_peer_devaddr(stru +@@ -4210,6 +4382,30 @@ static int rtw_p2p_get_peer_devaddr(struct net_device *dev, } @@ -121942,7 +121456,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release static int rtw_p2p_get_groupid(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) -@@ -4221,7 +4417,7 @@ static int rtw_p2p_get_groupid(struct ne +@@ -4221,7 +4417,7 @@ static int rtw_p2p_get_groupid(struct net_device *dev, struct iw_point *pdata = &wrqu->data; struct wifidirect_info *pwdinfo = &( padapter->wdinfo ); @@ -121951,7 +121465,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release pwdinfo->groupid_info.go_device_addr[ 0 ], pwdinfo->groupid_info.go_device_addr[ 1 ], pwdinfo->groupid_info.go_device_addr[ 2 ], pwdinfo->groupid_info.go_device_addr[ 3 ], pwdinfo->groupid_info.go_device_addr[ 4 ], pwdinfo->groupid_info.go_device_addr[ 5 ], -@@ -4231,46 +4427,551 @@ static int rtw_p2p_get_groupid(struct ne +@@ -4231,46 +4427,551 @@ static int rtw_p2p_get_groupid(struct net_device *dev, } @@ -122531,7 +122045,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } _enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); -@@ -4286,67 +4987,441 @@ static int rtw_p2p_get_wps_configmethod( +@@ -4286,67 +4987,441 @@ static int rtw_p2p_get_wps_configmethod(struct net_device *dev, pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list); if ( _rtw_memcmp( pnetwork->network.MacAddress, peerMAC, ETH_ALEN ) ) { @@ -122698,12 +122212,18 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + { + // The P2P Device ID attribute is included in the Beacon frame. + // The P2P Device Info attribute is included in the probe response frame. -+ + +- if ( (wpsie=rtw_get_wps_ie( &pnetwork->network.IEs[ 12 ], pnetwork->network.IELength - 12, NULL, &wpsie_len )) ) + if ( rtw_get_p2p_attr_content( p2pie, p2pielen, P2P_ATTR_DEVICE_ID, attr_content, &attr_contentlen) ) -+ { + { +- rtw_get_wps_attr_content( wpsie, wpsie_len, WPS_ATTR_CONF_METHOD, ( u8* ) &attr_content, &attr_contentlen); +- if ( attr_contentlen ) + // Handle the P2P Device ID attribute of Beacon first + if ( _rtw_memcmp( attr_content, pinvite_req_info->peer_macaddr, ETH_ALEN ) ) -+ { + { +- attr_content = be16_to_cpu( attr_content ); +- sprintf( attr_content_str, "\n\nM=%.4d", attr_content ); +- blnMatch = 1; + uintPeerChannel = pnetwork->network.Configuration.DSConfig; + break; + } @@ -122736,13 +122256,10 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + { + u8 wfd_devinfo[ 6 ] = { 0x00 }; + uint wfd_devlen = 6; - -- if ( (wpsie=rtw_get_wps_ie( &pnetwork->network.IEs[ 12 ], pnetwork->network.IELength - 12, NULL, &wpsie_len )) ) ++ + DBG_871X( "[%s] Found WFD IE!\n", __FUNCTION__ ); + if ( rtw_get_wfd_attr_content( wfd_ie, wfd_ielen, WFD_ATTR_DEVICE_INFO, wfd_devinfo, &wfd_devlen ) ) - { -- rtw_get_wps_attr_content( wpsie, wpsie_len, WPS_ATTR_CONF_METHOD, ( u8* ) &attr_content, &attr_contentlen); -- if ( attr_contentlen ) ++ { + u16 wfd_devinfo_field = 0; + + // Commented by Albert 20120319 @@ -122750,10 +122267,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + // In big endian format. + wfd_devinfo_field = RTW_GET_BE16(wfd_devinfo); + if ( wfd_devinfo_field & WFD_DEVINFO_SESSION_AVAIL ) - { -- attr_content = be16_to_cpu( attr_content ); -- sprintf( attr_content_str, "\n\nM=%.4d", attr_content ); -- blnMatch = 1; ++ { + pwfd_info->peer_session_avail = _TRUE; + } + else @@ -122927,47 +122441,47 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release +{ + const char *pos; + u8 *opos; -+ + +- plist = get_next(plist); +- +- } + pos = str; + opos = bin; -+ + +- _exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); + if (hexstr2bin(pos, opos, 4)) + return -1; + pos += 8; + opos += 4; -+ + +- if ( !blnMatch ) +- { +- sprintf( attr_content_str, "\n\nM=0000" ); +- } + if (*pos++ != '-' || hexstr2bin(pos, opos, 2)) + return -1; + pos += 4; + opos += 2; -- plist = get_next(plist); +- if ( copy_to_user(wrqu->data.pointer, attr_content_str, 6 + 17)) { +- return -EFAULT; +- } - -- } +- return ret; +- + if (*pos++ != '-' || hexstr2bin(pos, opos, 2)) + return -1; + pos += 4; + opos += 2; - -- _exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); ++ + if (*pos++ != '-' || hexstr2bin(pos, opos, 2)) + return -1; + pos += 4; + opos += 2; - -- if ( !blnMatch ) -- { -- sprintf( attr_content_str, "\n\nM=0000" ); -- } ++ + if (*pos++ != '-' || hexstr2bin(pos, opos, 6)) + return -1; - -- if ( copy_to_user(wrqu->data.pointer, attr_content_str, 6 + 17)) { -- return -EFAULT; -- } -- -- return ret; -- ++ + return 0; } @@ -123016,7 +122530,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { -@@ -4357,32 +5432,37 @@ static int rtw_p2p_get_device_name(struc +@@ -4357,32 +5432,37 @@ static int rtw_p2p_get_device_name(struct net_device *dev, struct wifidirect_info *pwdinfo = &( padapter->wdinfo ); u8 peerMAC[ ETH_ALEN ] = { 0x00 }; int jj,kk; @@ -123072,7 +122586,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } _enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); -@@ -4396,146 +5476,260 @@ static int rtw_p2p_get_device_name(struc +@@ -4396,146 +5476,260 @@ static int rtw_p2p_get_device_name(struct net_device *dev, break; pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list); @@ -123130,9 +122644,12 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release _exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); + printk( "[%s] channel = %d\n", __FUNCTION__, uintPeerChannel ); -+ + +- if ( !blnMatch ) + if ( uintPeerChannel ) -+ { + { +- sprintf( dev_name_str, "\n\nN=0000" ); +- } + u8 wfd_ie[ 128 ] = { 0x00 }; + uint wfd_ielen = 0; + @@ -123141,7 +122658,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + u8 wfd_devinfo[ 6 ] = { 0x00 }; + uint wfd_devlen = 6; -- if ( !blnMatch ) +- if ( copy_to_user(wrqu->data.pointer, dev_name_str, 5+ (( dev_len > 17 )? dev_len : 17) )) { +- return -EFAULT; + DBG_871X( "[%s] Found WFD IE!\n", __FUNCTION__ ); + if ( rtw_get_wfd_attr_content( wfd_ie, wfd_ielen, WFD_ATTR_DEVICE_INFO, wfd_devinfo, &wfd_devlen ) ) + { @@ -123163,14 +122681,10 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + } + } + else - { -- sprintf( dev_name_str, "\n\nN=0000" ); ++ { + DBG_871X( "[%s] NOT Found in the Scanning Queue!\n", __FUNCTION__ ); } - -- if ( copy_to_user(wrqu->data.pointer, dev_name_str, 5+ (( dev_len > 17 )? dev_len : 17) )) { -- return -EFAULT; -- } ++ +exit: return ret; @@ -123267,7 +122781,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + else if ( extra[ 0 ] == '1' ) + { + pwfd_info->scan_result_type = SCAN_RESULT_ALL; -+ } + } + else if ( extra[ 0 ] == '2' ) + { + pwfd_info->scan_result_type = SCAN_RESULT_WFD_TYPE; @@ -123275,7 +122789,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + else + { + pwfd_info->scan_result_type = SCAN_RESULT_P2P_ONLY; - } ++ } + +exit: + @@ -123418,7 +122932,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release struct wifidirect_info *pwdinfo = &( padapter->wdinfo ); u8 peerMAC[ ETH_ALEN ] = { 0x00 }; int jj,kk; -@@ -4545,10 +5739,19 @@ static int rtw_p2p_prov_disc(struct net_ +@@ -4545,10 +5739,19 @@ static int rtw_p2p_prov_disc(struct net_device *dev, _queue *queue = &(pmlmepriv->scanned_queue); struct wlan_network *pnetwork = NULL; uint uintPeerChannel = 0; @@ -123439,7 +122953,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release // Commented by Albert 20110301 // The input data contains two informations. -@@ -4559,21 +5762,28 @@ static int rtw_p2p_prov_disc(struct net_ +@@ -4559,21 +5762,28 @@ static int rtw_p2p_prov_disc(struct net_device *dev, // Format: 00:E0:4C:00:00:05_pbc // Format: 00:E0:4C:00:00:05_label @@ -123472,7 +122986,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release pwdinfo->tx_prov_disc_info.benable = _FALSE; } -@@ -4600,10 +5810,11 @@ static int rtw_p2p_prov_disc(struct net_ +@@ -4600,10 +5810,11 @@ static int rtw_p2p_prov_disc(struct net_device *dev, } else { @@ -123485,7 +122999,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release _enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); phead = get_list_head(queue); -@@ -4614,37 +5825,64 @@ static int rtw_p2p_prov_disc(struct net_ +@@ -4614,37 +5825,64 @@ static int rtw_p2p_prov_disc(struct net_device *dev, if (rtw_end_of_queue_search(phead,plist)== _TRUE) break; @@ -123565,7 +123079,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release plist = get_next(plist); -@@ -4654,6 +5892,51 @@ static int rtw_p2p_prov_disc(struct net_ +@@ -4654,6 +5892,51 @@ static int rtw_p2p_prov_disc(struct net_device *dev, if ( uintPeerChannel ) { @@ -123617,7 +123131,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release _rtw_memcpy( pwdinfo->tx_prov_disc_info.peerIFAddr, pnetwork->network.MacAddress, ETH_ALEN ); _rtw_memcpy( pwdinfo->tx_prov_disc_info.peerDevAddr, peerMAC, ETH_ALEN ); pwdinfo->tx_prov_disc_info.peer_channel_num[0] = ( u16 ) uintPeerChannel; -@@ -4665,20 +5948,56 @@ static int rtw_p2p_prov_disc(struct net_ +@@ -4665,20 +5948,56 @@ static int rtw_p2p_prov_disc(struct net_device *dev, { _rtw_memcpy( &pwdinfo->tx_prov_disc_info.ssid, &pnetwork->network.Ssid, sizeof( NDIS_802_11_SSID ) ); } @@ -123676,7 +123190,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } exit: -@@ -4697,11 +6016,10 @@ static int rtw_p2p_got_wpsinfo(struct ne +@@ -4697,11 +6016,10 @@ static int rtw_p2p_got_wpsinfo(struct net_device *dev, int ret = 0; _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); @@ -123689,7 +123203,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release // Added by Albert 20110328 // if the input data is P2P_NO_WPSINFO -> reset the wpsinfo // if the input data is P2P_GOT_WPSINFO_PEER_DISPLAY_PIN -> the utility just input the PIN code got from the peer P2P device. -@@ -4749,7 +6067,7 @@ static int rtw_p2p_set(struct net_device +@@ -4749,7 +6067,7 @@ static int rtw_p2p_set(struct net_device *dev, struct wifidirect_info *pwdinfo= &(padapter->wdinfo); struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; @@ -123698,7 +123212,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if ( _rtw_memcmp( extra, "enable=", 7 ) ) { -@@ -4809,8 +6127,56 @@ static int rtw_p2p_set(struct net_device +@@ -4809,8 +6127,56 @@ static int rtw_p2p_set(struct net_device *dev, wrqu->data.length -= 7; rtw_p2p_set_op_ch( dev, info, wrqu, &extra[6] ); } @@ -123757,7 +123271,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #endif //CONFIG_P2P return ret; -@@ -4832,7 +6198,10 @@ static int rtw_p2p_get(struct net_device +@@ -4832,7 +6198,10 @@ static int rtw_p2p_get(struct net_device *dev, struct wifidirect_info *pwdinfo= &(padapter->wdinfo); struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; @@ -123769,7 +123283,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if ( _rtw_memcmp( wrqu->data.pointer, "status", 6 ) ) { -@@ -4852,16 +6221,34 @@ static int rtw_p2p_get(struct net_device +@@ -4852,16 +6221,34 @@ static int rtw_p2p_get(struct net_device *dev, } else if ( _rtw_memcmp( wrqu->data.pointer, "peer_deva", 9 ) ) { @@ -123805,7 +123319,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } #endif // CONFIG_WFD -@@ -4872,40 +6259,64 @@ static int rtw_p2p_get(struct net_device +@@ -4872,40 +6259,64 @@ static int rtw_p2p_get(struct net_device *dev, } static int rtw_p2p_get2(struct net_device *dev, @@ -123891,7 +123405,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release 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, -@@ -4917,7 +6328,15 @@ static int rtw_rereg_nd_name(struct net_ +@@ -4917,7 +6328,15 @@ static int rtw_rereg_nd_name(struct net_device *dev, char new_ifname[IFNAMSIZ]; if(rereg_priv->old_ifname[0] == 0) { @@ -123908,7 +123422,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release rereg_priv->old_ifname[IFNAMSIZ-1] = 0; } -@@ -4940,7 +6359,7 @@ static int rtw_rereg_nd_name(struct net_ +@@ -4940,7 +6359,7 @@ static int rtw_rereg_nd_name(struct net_device *dev, if(_rtw_memcmp(rereg_priv->old_ifname, "disable%d", 9) == _TRUE) { padapter->ledpriv.bRegUseLed= rereg_priv->old_bRegUseLed; @@ -123917,7 +123431,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release rtw_ips_mode_req(&padapter->pwrctrlpriv, rereg_priv->old_ips_mode); } -@@ -4957,7 +6376,7 @@ static int rtw_rereg_nd_name(struct net_ +@@ -4957,7 +6376,7 @@ static int rtw_rereg_nd_name(struct net_device *dev, rtw_led_control(padapter, LED_CTL_POWER_OFF); rereg_priv->old_bRegUseLed = padapter->ledpriv.bRegUseLed; padapter->ledpriv.bRegUseLed= _FALSE; @@ -124073,7 +123587,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release static int rtw_dbg_port(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) -@@ -5111,13 +6533,13 @@ static int rtw_dbg_port(struct net_devic +@@ -5111,13 +6533,13 @@ static int rtw_dbg_port(struct net_device *dev, switch(minor_cmd) { case 1: @@ -124090,7 +123604,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release break; } break; -@@ -5126,31 +6548,31 @@ static int rtw_dbg_port(struct net_devic +@@ -5126,31 +6548,31 @@ static int rtw_dbg_port(struct net_device *dev, { case 1: rtw_write8(padapter, arg, extra_arg); @@ -124131,7 +123645,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release break; case 0x76: -@@ -5315,29 +6737,33 @@ static int rtw_dbg_port(struct net_devic +@@ -5315,29 +6737,33 @@ static int rtw_dbg_port(struct net_device *dev, #endif //CONFIG_IOL } break; @@ -124173,7 +123687,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release break; case 0x05: psta = rtw_get_stainfo(pstapriv, cur_network->network.MacAddress); -@@ -5346,41 +6772,43 @@ static int rtw_dbg_port(struct net_devic +@@ -5346,41 +6772,43 @@ static int rtw_dbg_port(struct net_device *dev, int i; struct recv_reorder_ctrl *preorder_ctrl; @@ -124231,7 +123745,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release padapter->bSurpriseRemoved, padapter->bDriverStopped); break; case 0x08: -@@ -5388,10 +6816,14 @@ static int rtw_dbg_port(struct net_devic +@@ -5388,10 +6816,14 @@ static int rtw_dbg_port(struct net_device *dev, struct xmit_priv *pxmitpriv = &padapter->xmitpriv; struct recv_priv *precvpriv = &padapter->recvpriv; @@ -124249,7 +123763,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #endif } break; -@@ -5402,7 +6834,7 @@ static int rtw_dbg_port(struct net_devic +@@ -5402,7 +6834,7 @@ static int rtw_dbg_port(struct net_device *dev, struct recv_reorder_ctrl *preorder_ctrl; #ifdef CONFIG_AP_MODE @@ -124258,7 +123772,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #endif _enter_critical_bh(&pstapriv->sta_hash_lock, &irqL); -@@ -5419,20 +6851,22 @@ static int rtw_dbg_port(struct net_devic +@@ -5419,20 +6851,22 @@ static int rtw_dbg_port(struct net_device *dev, if(extra_arg == psta->aid) { @@ -124295,7 +123809,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release -@@ -5441,7 +6875,7 @@ static int rtw_dbg_port(struct net_devic +@@ -5441,7 +6875,7 @@ static int rtw_dbg_port(struct net_device *dev, preorder_ctrl = &psta->recvreorder_ctrl[j]; if(preorder_ctrl->enable) { @@ -124304,7 +123818,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } } -@@ -5457,9 +6891,9 @@ static int rtw_dbg_port(struct net_devic +@@ -5457,9 +6891,9 @@ static int rtw_dbg_port(struct net_device *dev, case 0x0c://dump rx packet { @@ -124316,7 +123830,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } break; #if 0 -@@ -5477,31 +6911,88 @@ static int rtw_dbg_port(struct net_devic +@@ -5477,31 +6911,88 @@ static int rtw_dbg_port(struct net_device *dev, case 0x0f: { if(extra_arg == 0){ @@ -124412,7 +123926,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #if 1 case 0xdd://registers dump , 0 for mac reg,1 for bb reg, 2 for rf reg { -@@ -5523,15 +7014,15 @@ static int rtw_dbg_port(struct net_devic +@@ -5523,15 +7014,15 @@ static int rtw_dbg_port(struct net_device *dev, u8 dm_flag; if(0xf==extra_arg){ @@ -124437,7 +123951,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } else{ /* extra_arg = 0 - disable all dynamic func -@@ -5539,56 +7030,56 @@ static int rtw_dbg_port(struct net_devic +@@ -5539,56 +7030,56 @@ static int rtw_dbg_port(struct net_device *dev, extra_arg = 2 - disable tx power tracking extra_arg = 3 - turn on all dynamic func */ @@ -124519,7 +124033,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release break; } -@@ -5688,7 +7179,7 @@ static int wpa_set_param(struct net_devi +@@ -5688,7 +7179,7 @@ static int wpa_set_param(struct net_device *dev, u8 name, u32 value) case IEEE_PARAM_WPAX_SELECT: // added for WPA2 mixed mode @@ -124528,7 +124042,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release /* spin_lock_irqsave(&ieee->wpax_suitlist_lock,flags); ieee->wpax_type_set = 1; -@@ -5789,7 +7280,7 @@ static int wpa_supplicant_ioctl(struct n +@@ -5789,7 +7280,7 @@ static int wpa_supplicant_ioctl(struct net_device *dev, struct iw_point *p) break; default: @@ -124537,7 +124051,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release ret = -EOPNOTSUPP; break; -@@ -5855,7 +7346,7 @@ static int set_group_key(_adapter *padap +@@ -5855,7 +7346,7 @@ static int set_group_key(_adapter *padapter, u8 *key, u8 alg, int keyid) struct cmd_priv *pcmdpriv=&(padapter->cmdpriv); int res=_SUCCESS; @@ -124546,7 +124060,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release pcmd = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj)); if(pcmd==NULL){ -@@ -5872,6 +7363,8 @@ static int set_group_key(_adapter *padap +@@ -5872,6 +7363,8 @@ static int set_group_key(_adapter *padapter, u8 *key, u8 alg, int keyid) _rtw_memset(psetkeyparm, 0, sizeof(struct setkey_parm)); psetkeyparm->keyid=(u8)keyid; @@ -124555,7 +124069,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release psetkeyparm->algorithm = alg; -@@ -5945,7 +7438,7 @@ static int rtw_set_encryption(struct net +@@ -5945,7 +7438,7 @@ static int rtw_set_encryption(struct net_device *dev, struct ieee_param *param, struct security_priv* psecuritypriv=&(padapter->securitypriv); struct sta_priv *pstapriv = &padapter->stapriv; @@ -124564,7 +124078,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release param->u.crypt.err = 0; param->u.crypt.alg[IEEE_CRYPT_ALG_NAME_LEN - 1] = '\0'; -@@ -5974,7 +7467,7 @@ static int rtw_set_encryption(struct net +@@ -5974,7 +7467,7 @@ static int rtw_set_encryption(struct net_device *dev, struct ieee_param *param, if(!psta) { //ret = -EINVAL; @@ -124573,7 +124087,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release goto exit; } } -@@ -5983,7 +7476,7 @@ static int rtw_set_encryption(struct net +@@ -5983,7 +7476,7 @@ static int rtw_set_encryption(struct net_device *dev, struct ieee_param *param, { //todo:clear default encryption keys @@ -124582,7 +124096,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release goto exit; } -@@ -5991,12 +7484,12 @@ static int rtw_set_encryption(struct net +@@ -5991,12 +7484,12 @@ static int rtw_set_encryption(struct net_device *dev, struct ieee_param *param, if (strcmp(param->u.crypt.alg, "WEP") == 0 && (psta==NULL)) { @@ -124597,7 +124111,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if((wep_key_idx >= WEP_KEYS) || (wep_key_len<=0)) { -@@ -6011,7 +7504,7 @@ static int rtw_set_encryption(struct net +@@ -6011,7 +7504,7 @@ static int rtw_set_encryption(struct net_device *dev, struct ieee_param *param, wep_total_len = wep_key_len + FIELD_OFFSET(NDIS_802_11_WEP, KeyMaterial); pwep =(NDIS_802_11_WEP *)rtw_malloc(wep_total_len); if(pwep == NULL){ @@ -124606,7 +124120,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release goto exit; } -@@ -6028,7 +7521,7 @@ static int rtw_set_encryption(struct net +@@ -6028,7 +7521,7 @@ static int rtw_set_encryption(struct net_device *dev, struct ieee_param *param, if(param->u.crypt.set_tx) { @@ -124615,7 +124129,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release psecuritypriv->ndisencryptstatus = Ndis802_11Encryption1Enabled; psecuritypriv->dot11PrivacyAlgrthm=_WEP40_; -@@ -6053,7 +7546,7 @@ static int rtw_set_encryption(struct net +@@ -6053,7 +7546,7 @@ static int rtw_set_encryption(struct net_device *dev, struct ieee_param *param, } else { @@ -124624,7 +124138,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release //don't update "psecuritypriv->dot11PrivacyAlgrthm" and //"psecuritypriv->dot11PrivacyKeyIndex=keyid", but can rtw_set_key to cam -@@ -6077,7 +7570,7 @@ static int rtw_set_encryption(struct net +@@ -6077,7 +7570,7 @@ static int rtw_set_encryption(struct net_device *dev, struct ieee_param *param, { if(strcmp(param->u.crypt.alg, "WEP") == 0) { @@ -124633,7 +124147,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release _rtw_memcpy(psecuritypriv->dot118021XGrpKey[param->u.crypt.idx].skey, param->u.crypt.key, (param->u.crypt.key_len>16 ?16:param->u.crypt.key_len)); -@@ -6090,7 +7583,7 @@ static int rtw_set_encryption(struct net +@@ -6090,7 +7583,7 @@ static int rtw_set_encryption(struct net_device *dev, struct ieee_param *param, } else if(strcmp(param->u.crypt.alg, "TKIP") == 0) { @@ -124642,7 +124156,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release psecuritypriv->dot118021XGrpPrivacy = _TKIP_; -@@ -6106,7 +7599,7 @@ static int rtw_set_encryption(struct net +@@ -6106,7 +7599,7 @@ static int rtw_set_encryption(struct net_device *dev, struct ieee_param *param, } else if(strcmp(param->u.crypt.alg, "CCMP") == 0) { @@ -124651,7 +124165,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release psecuritypriv->dot118021XGrpPrivacy = _AES_; -@@ -6114,7 +7607,7 @@ static int rtw_set_encryption(struct net +@@ -6114,7 +7607,7 @@ static int rtw_set_encryption(struct net_device *dev, struct ieee_param *param, } else { @@ -124660,7 +124174,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release psecuritypriv->dot118021XGrpPrivacy = _NO_PRIVACY_; } -@@ -6150,7 +7643,7 @@ static int rtw_set_encryption(struct net +@@ -6150,7 +7643,7 @@ static int rtw_set_encryption(struct net_device *dev, struct ieee_param *param, if(strcmp(param->u.crypt.alg, "WEP") == 0) { @@ -124669,7 +124183,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release psta->dot118021XPrivacy = _WEP40_; if(param->u.crypt.key_len==13) -@@ -6160,7 +7653,7 @@ static int rtw_set_encryption(struct net +@@ -6160,7 +7653,7 @@ static int rtw_set_encryption(struct net_device *dev, struct ieee_param *param, } else if(strcmp(param->u.crypt.alg, "TKIP") == 0) { @@ -124678,7 +124192,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release psta->dot118021XPrivacy = _TKIP_; -@@ -6175,13 +7668,13 @@ static int rtw_set_encryption(struct net +@@ -6175,13 +7668,13 @@ static int rtw_set_encryption(struct net_device *dev, struct ieee_param *param, else if(strcmp(param->u.crypt.alg, "CCMP") == 0) { @@ -124703,7 +124217,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } return ret; -@@ -6269,25 +7762,23 @@ static int rtw_set_beacon(struct net_dev +@@ -6269,25 +7762,23 @@ static int rtw_set_beacon(struct net_device *dev, struct ieee_param *param, int unsigned char *pbuf = param->u.bcn_ie.buf; @@ -124733,7 +124247,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return ret; } -@@ -6301,40 +7792,10 @@ static int rtw_hostapd_sta_flush(struct +@@ -6301,40 +7792,10 @@ static int rtw_hostapd_sta_flush(struct net_device *dev) _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); //struct sta_priv *pstapriv = &padapter->stapriv; @@ -124775,7 +124289,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release ret = rtw_sta_flush(padapter); return ret; -@@ -6350,7 +7811,7 @@ static int rtw_add_sta(struct net_device +@@ -6350,7 +7811,7 @@ static int rtw_add_sta(struct net_device *dev, struct ieee_param *param) struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); struct sta_priv *pstapriv = &padapter->stapriv; @@ -124784,7 +124298,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if(check_fwstate(pmlmepriv, (_FW_LINKED|WIFI_AP_STATE)) != _TRUE) { -@@ -6368,7 +7829,7 @@ static int rtw_add_sta(struct net_device +@@ -6368,7 +7829,7 @@ static int rtw_add_sta(struct net_device *dev, struct ieee_param *param) psta = rtw_get_stainfo(pstapriv, param->sta_addr); if(psta) { @@ -124793,7 +124307,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release _enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL); rtw_free_stainfo(padapter, psta); _exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL); -@@ -6382,7 +7843,7 @@ static int rtw_add_sta(struct net_device +@@ -6382,7 +7843,7 @@ static int rtw_add_sta(struct net_device *dev, struct ieee_param *param) { int flags = param->u.add_sta.flags; @@ -124802,11 +124316,19 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release psta->aid = param->u.add_sta.aid;//aid=1~2007 -@@ -6430,75 +7891,149 @@ static int rtw_add_sta(struct net_device - - } - --static int rtw_del_sta(struct net_device *dev, struct ieee_param *param) +@@ -6423,82 +7884,156 @@ static int rtw_add_sta(struct net_device *dev, struct ieee_param *param) + } + else + { +- ret = -ENOMEM; +- } ++ ret = -ENOMEM; ++ } ++ ++ return ret; ++ ++} ++ +static int rtw_del_sta(struct net_device *dev, struct ieee_param *param) +{ + _irqL irqL; @@ -124859,11 +124381,12 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + //ret = -1; + } + -+ -+ return ret; -+ -+} -+ + + return ret; + + } + +-static int rtw_del_sta(struct net_device *dev, struct ieee_param *param) +static int rtw_ioctl_get_sta_data(struct net_device *dev, struct ieee_param *param, int len) { - _irqL irqL; @@ -124917,7 +124440,6 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - - pstapriv->sta_dz_bitmap &=~BIT(psta->aid); - pstapriv->tim_bitmap &=~BIT(psta->aid); --#endif +#if 0 + struct { + u16 aid; @@ -124934,7 +124456,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + u64 tx_bytes; + u64 tx_drops; + } get_sta; -+#endif + #endif + psta_data->aid = (u16)psta->aid; + psta_data->capability = psta->capability; + psta_data->flags = psta->flags; @@ -124995,7 +124517,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } static int rtw_get_sta_wpaie(struct net_device *dev, struct ieee_param *param) -@@ -6509,7 +8044,7 @@ static int rtw_get_sta_wpaie(struct net_ +@@ -6509,7 +8044,7 @@ static int rtw_get_sta_wpaie(struct net_device *dev, struct ieee_param *param) struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); struct sta_priv *pstapriv = &padapter->stapriv; @@ -125004,7 +124526,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if(check_fwstate(pmlmepriv, (_FW_LINKED|WIFI_AP_STATE)) != _TRUE) { -@@ -6542,7 +8077,7 @@ static int rtw_get_sta_wpaie(struct net_ +@@ -6542,7 +8077,7 @@ static int rtw_get_sta_wpaie(struct net_device *dev, struct ieee_param *param) else { //ret = -1; @@ -125013,7 +124535,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } } else -@@ -6564,7 +8099,7 @@ static int rtw_set_wps_beacon(struct net +@@ -6564,7 +8099,7 @@ static int rtw_set_wps_beacon(struct net_device *dev, struct ieee_param *param, struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); int ie_len; @@ -125022,7 +124544,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if(check_fwstate(pmlmepriv, WIFI_AP_STATE) != _TRUE) return -EINVAL; -@@ -6583,7 +8118,7 @@ static int rtw_set_wps_beacon(struct net +@@ -6583,7 +8118,7 @@ static int rtw_set_wps_beacon(struct net_device *dev, struct ieee_param *param, pmlmepriv->wps_beacon_ie = rtw_malloc(ie_len); pmlmepriv->wps_beacon_ie_len = ie_len; if ( pmlmepriv->wps_beacon_ie == NULL) { @@ -125031,7 +124553,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return -EINVAL; } -@@ -6607,7 +8142,7 @@ static int rtw_set_wps_probe_resp(struct +@@ -6607,7 +8142,7 @@ static int rtw_set_wps_probe_resp(struct net_device *dev, struct ieee_param *par struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); int ie_len; @@ -125040,7 +124562,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if(check_fwstate(pmlmepriv, WIFI_AP_STATE) != _TRUE) return -EINVAL; -@@ -6626,7 +8161,7 @@ static int rtw_set_wps_probe_resp(struct +@@ -6626,7 +8161,7 @@ static int rtw_set_wps_probe_resp(struct net_device *dev, struct ieee_param *par pmlmepriv->wps_probe_resp_ie = rtw_malloc(ie_len); pmlmepriv->wps_probe_resp_ie_len = ie_len; if ( pmlmepriv->wps_probe_resp_ie == NULL) { @@ -125049,7 +124571,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return -EINVAL; } _rtw_memcpy(pmlmepriv->wps_probe_resp_ie, param->u.bcn_ie.buf, ie_len); -@@ -6637,38 +8172,6 @@ static int rtw_set_wps_probe_resp(struct +@@ -6637,38 +8172,6 @@ static int rtw_set_wps_probe_resp(struct net_device *dev, struct ieee_param *par } @@ -125088,7 +124610,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release static int rtw_set_wps_assoc_resp(struct net_device *dev, struct ieee_param *param, int len) { int ret=0; -@@ -6676,7 +8179,7 @@ static int rtw_set_wps_assoc_resp(struct +@@ -6676,7 +8179,7 @@ static int rtw_set_wps_assoc_resp(struct net_device *dev, struct ieee_param *par struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); int ie_len; @@ -125097,7 +124619,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if(check_fwstate(pmlmepriv, WIFI_AP_STATE) != _TRUE) return -EINVAL; -@@ -6695,7 +8198,7 @@ static int rtw_set_wps_assoc_resp(struct +@@ -6695,7 +8198,7 @@ static int rtw_set_wps_assoc_resp(struct net_device *dev, struct ieee_param *par pmlmepriv->wps_assoc_resp_ie = rtw_malloc(ie_len); pmlmepriv->wps_assoc_resp_ie_len = ie_len; if ( pmlmepriv->wps_assoc_resp_ie == NULL) { @@ -125106,7 +124628,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return -EINVAL; } -@@ -6707,13 +8210,125 @@ static int rtw_set_wps_assoc_resp(struct +@@ -6707,13 +8210,125 @@ static int rtw_set_wps_assoc_resp(struct net_device *dev, struct ieee_param *par } @@ -125233,7 +124755,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release /* * this function is expect to call in master mode, which allows no power saving -@@ -6746,7 +8361,7 @@ static int rtw_hostapd_ioctl(struct net_ +@@ -6746,7 +8361,7 @@ static int rtw_hostapd_ioctl(struct net_device *dev, struct iw_point *p) goto out; } @@ -125242,7 +124764,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release switch (param->cmd) { -@@ -6809,9 +8424,33 @@ static int rtw_hostapd_ioctl(struct net_ +@@ -6809,9 +8424,33 @@ static int rtw_hostapd_ioctl(struct net_device *dev, struct iw_point *p) ret = rtw_set_hidden_ssid(dev, param, p->length); break; @@ -125277,7 +124799,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release ret = -EOPNOTSUPP; break; -@@ -6850,7 +8489,8 @@ static int rtw_wx_set_priv(struct net_de +@@ -6850,7 +8489,8 @@ static int rtw_wx_set_priv(struct net_device *dev, struct iw_point *dwrq = (struct iw_point*)awrq; //RT_TRACE(_module_rtl871x_ioctl_os_c, _drv_notice_, ("+rtw_wx_set_priv\n")); @@ -125287,7 +124809,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release len = dwrq->length; if (!(ext = rtw_vmalloc(len))) return -ENOMEM; -@@ -6952,16 +8592,7 @@ static int rtw_wx_set_priv(struct net_de +@@ -6952,16 +8592,7 @@ static int rtw_wx_set_priv(struct net_device *dev, break; case ANDROID_WIFI_CMD_LINKSPEED : { @@ -125305,7 +124827,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release sprintf(ext, "LINKSPEED %d", mbps); } break; -@@ -6970,15 +8601,13 @@ static int rtw_wx_set_priv(struct net_de +@@ -6970,15 +8601,13 @@ static int rtw_wx_set_priv(struct net_device *dev, break; case ANDROID_WIFI_CMD_SCAN_ACTIVE : { @@ -125323,7 +124845,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release sprintf(ext, "OK"); } break; -@@ -6986,33 +8615,11 @@ static int rtw_wx_set_priv(struct net_de +@@ -6986,33 +8615,11 @@ static int rtw_wx_set_priv(struct net_device *dev, case ANDROID_WIFI_CMD_COUNTRY : { char country_code[10]; @@ -125359,7 +124881,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release default : #ifdef CONFIG_DEBUG_RTW_WX_SET_PRIV DBG_871X("%s: %s unknowned req=%s\n", __FUNCTION__, -@@ -7069,7 +8676,7 @@ static int rtw_mp_efuse_get(struct net_d +@@ -7069,7 +8676,7 @@ static int rtw_mp_efuse_get(struct net_device *dev, return -EFAULT; pch = extra; @@ -125368,7 +124890,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release i=0; //mac 16 "00e04c871200" rmap,00,2 -@@ -7082,38 +8689,38 @@ static int rtw_mp_efuse_get(struct net_d +@@ -7082,38 +8689,38 @@ static int rtw_mp_efuse_get(struct net_device *dev, if ( strcmp(tmp[0],"realmap") == 0 ) { @@ -125417,7 +124939,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release wrqu->length = strlen(extra); return 0; -@@ -7123,39 +8730,39 @@ static int rtw_mp_efuse_get(struct net_d +@@ -7123,39 +8730,39 @@ static int rtw_mp_efuse_get(struct net_device *dev, // rmap addr cnts addr = simple_strtoul(tmp[1], &ptmp, 16); @@ -125465,7 +124987,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return 0; } -@@ -7165,24 +8772,24 @@ static int rtw_mp_efuse_get(struct net_d +@@ -7165,24 +8772,24 @@ static int rtw_mp_efuse_get(struct net_device *dev, if (rtw_efuse_access(padapter, _FALSE, addr, mapLen, rawdata) == _FAIL) { @@ -125495,7 +125017,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release sprintf(extra, "%s\t", extra); } } -@@ -7201,21 +8808,21 @@ static int rtw_mp_efuse_get(struct net_d +@@ -7201,21 +8808,21 @@ static int rtw_mp_efuse_get(struct net_device *dev, #endif EFUSE_GetEfuseDefinition(padapter, EFUSE_WIFI, TYPE_AVAILABLE_EFUSE_BYTES_TOTAL, (PVOID)&max_available_size, _FALSE); if ((addr + mapLen) > max_available_size) { @@ -125522,7 +125044,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release sprintf(extra,"%s ",extra); } wrqu->length = strlen(extra); -@@ -7232,21 +8839,21 @@ static int rtw_mp_efuse_get(struct net_d +@@ -7232,21 +8839,21 @@ static int rtw_mp_efuse_get(struct net_device *dev, cnts = 4; EFUSE_GetEfuseDefinition(padapter, EFUSE_WIFI, TYPE_AVAILABLE_EFUSE_BYTES_TOTAL, (PVOID)&max_available_size, _FALSE); if ((addr + mapLen) > max_available_size) { @@ -125549,7 +125071,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release sprintf(extra,"%s ",extra); } wrqu->length = strlen(extra); -@@ -7271,7 +8878,7 @@ static int rtw_mp_efuse_get(struct net_d +@@ -7271,7 +8878,7 @@ static int rtw_mp_efuse_get(struct net_device *dev, static int rtw_mp_efuse_set(struct net_device *dev, struct iw_request_info *info, @@ -125558,7 +125080,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { struct iw_point *wrqu = (struct iw_point *)wdata; PADAPTER padapter = rtw_netdev_priv(dev); -@@ -7286,7 +8893,7 @@ static int rtw_mp_efuse_set(struct net_d +@@ -7286,7 +8893,7 @@ static int rtw_mp_efuse_set(struct net_device *dev, u32 cnts = 0; pch = extra; @@ -125567,7 +125089,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release i=0; while ( (token = strsep (&pch,",") )!=NULL ) -@@ -7304,13 +8911,13 @@ static int rtw_mp_efuse_set(struct net_d +@@ -7304,13 +8911,13 @@ static int rtw_mp_efuse_set(struct net_device *dev, addr = simple_strtoul( tmp[1], &ptmp, 16 ); addr = addr & 0xFF; @@ -125584,7 +125106,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release for( jj = 0, kk = 0; jj < cnts; jj++, kk += 2 ) { -@@ -7320,14 +8927,14 @@ static int rtw_mp_efuse_set(struct net_d +@@ -7320,14 +8927,14 @@ static int rtw_mp_efuse_set(struct net_device *dev, EFUSE_GetEfuseDefinition(padapter, EFUSE_WIFI, TYPE_AVAILABLE_EFUSE_BYTES_TOTAL, (PVOID)&max_available_size, _FALSE); if ((addr + cnts) > max_available_size) { @@ -125602,7 +125124,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return 0; } -@@ -7336,13 +8943,13 @@ static int rtw_mp_efuse_set(struct net_d +@@ -7336,13 +8943,13 @@ static int rtw_mp_efuse_set(struct net_device *dev, if ( ! strlen( tmp[2] )/2 > 1 ) return -EFAULT; addr = simple_strtoul( tmp[1], &ptmp, 16 ); addr = addr & 0xFF; @@ -125619,7 +125141,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release for( jj = 0, kk = 0; jj < cnts; jj++, kk += 2 ) { -@@ -7350,10 +8957,10 @@ static int rtw_mp_efuse_set(struct net_d +@@ -7350,10 +8957,10 @@ static int rtw_mp_efuse_set(struct net_device *dev, } if ( rtw_efuse_access( padapter, _TRUE, addr, cnts, setrawdata ) == _FAIL ){ @@ -125632,7 +125154,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return 0; } -@@ -7369,11 +8976,11 @@ static int rtw_mp_efuse_set(struct net_d +@@ -7369,11 +8976,11 @@ static int rtw_mp_efuse_set(struct net_device *dev, cnts = strlen( tmp[1] )/2; if ( cnts == 0) return -EFAULT; if ( cnts > 6 ){ @@ -125646,7 +125168,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release for( jj = 0, kk = 0; jj < cnts; jj++, kk += 2 ) { -@@ -7383,14 +8990,14 @@ static int rtw_mp_efuse_set(struct net_d +@@ -7383,14 +8990,14 @@ static int rtw_mp_efuse_set(struct net_device *dev, EFUSE_GetEfuseDefinition(padapter, EFUSE_WIFI, TYPE_AVAILABLE_EFUSE_BYTES_TOTAL, (PVOID)&max_available_size, _FALSE); if ((addr + cnts) > max_available_size) { @@ -125664,7 +125186,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return 0; } -@@ -7406,7 +9013,7 @@ static int rtw_mp_efuse_set(struct net_d +@@ -7406,7 +9013,7 @@ static int rtw_mp_efuse_set(struct net_device *dev, cnts=strlen( tmp[1] )/2; if ( cnts == 0) return -EFAULT; @@ -125673,7 +125195,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release for( jj = 0, kk = 0; jj < cnts; jj++, kk += 2 ) { -@@ -7416,20 +9023,20 @@ static int rtw_mp_efuse_set(struct net_d +@@ -7416,20 +9023,20 @@ static int rtw_mp_efuse_set(struct net_device *dev, EFUSE_GetEfuseDefinition(padapter, EFUSE_WIFI, TYPE_AVAILABLE_EFUSE_BYTES_TOTAL, (PVOID)&max_available_size, _FALSE); if ((addr + cnts) > max_available_size) { @@ -125698,7 +125220,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return 0; } -@@ -7534,12 +9141,15 @@ static int rtw_mp_read_reg(struct net_de +@@ -7534,12 +9141,15 @@ static int rtw_mp_read_reg(struct net_device *dev, u32 ret, i=0, j=0, strtout=0; PADAPTER padapter = rtw_netdev_priv(dev); @@ -125715,7 +125237,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release pch = input; pnext = strpbrk(pch, " ,.-"); if (pnext == NULL) return -EINVAL; -@@ -7559,7 +9169,7 @@ static int rtw_mp_read_reg(struct net_de +@@ -7559,7 +9169,7 @@ static int rtw_mp_read_reg(struct net_device *dev, // 1 byte // *(u8*)data = rtw_read8(padapter, addr); sprintf(extra, "%d\n", rtw_read8(padapter, addr)); @@ -125724,7 +125246,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release break; case 'w': // 2 bytes -@@ -7578,7 +9188,7 @@ static int rtw_mp_read_reg(struct net_de +@@ -7578,7 +9188,7 @@ static int rtw_mp_read_reg(struct net_device *dev, j++; } pch = tmp; @@ -125733,7 +125255,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release while( *pch != '\0' ) { -@@ -7594,7 +9204,7 @@ static int rtw_mp_read_reg(struct net_de +@@ -7594,7 +9204,7 @@ static int rtw_mp_read_reg(struct net_device *dev, } pch = pnext; } @@ -125742,7 +125264,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release break; case 'd': // 4 bytes -@@ -7612,7 +9222,7 @@ static int rtw_mp_read_reg(struct net_de +@@ -7612,7 +9222,7 @@ static int rtw_mp_read_reg(struct net_device *dev, j++; } pch = tmp; @@ -125751,7 +125273,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release while( *pch != '\0' ) { -@@ -7628,7 +9238,7 @@ static int rtw_mp_read_reg(struct net_de +@@ -7628,7 +9238,7 @@ static int rtw_mp_read_reg(struct net_device *dev, } pch = pnext; } @@ -125760,7 +125282,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release break; default: -@@ -7666,9 +9276,12 @@ static int rtw_mp_read_reg(struct net_de +@@ -7666,9 +9276,12 @@ static int rtw_mp_read_reg(struct net_device *dev, if (path >= MAX_RF_PATH_NUMS) return -EINVAL; if (addr > 0xFF) return -EINVAL; if (data > 0xFFFFF) return -EINVAL; @@ -125773,7 +125295,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return 0; } -@@ -7697,12 +9310,14 @@ static int rtw_mp_read_rf(struct net_dev +@@ -7697,12 +9310,14 @@ static int rtw_mp_read_rf(struct net_device *dev, if (copy_from_user(input, wrqu->pointer, wrqu->length)) return -EFAULT; @@ -125789,7 +125311,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release //*data = read_rfreg(padapter, path, addr); sprintf(data, "%08x", read_rfreg(padapter, path, addr)); //add read data format blank -@@ -7717,7 +9332,7 @@ static int rtw_mp_read_rf(struct net_dev +@@ -7717,7 +9332,7 @@ static int rtw_mp_read_rf(struct net_device *dev, j++; } pch = tmp; @@ -125798,7 +125320,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release while( *pch != '\0' ) { -@@ -7733,7 +9348,7 @@ static int rtw_mp_read_rf(struct net_dev +@@ -7733,7 +9348,7 @@ static int rtw_mp_read_rf(struct net_device *dev, } pch = pnext; } @@ -125807,7 +125329,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return 0; } -@@ -7794,7 +9409,7 @@ static int rtw_mp_rate(struct net_device +@@ -7794,7 +9409,7 @@ static int rtw_mp_rate(struct net_device *dev, else rate =(rate-0x80+MPT_RATE_MCS0); @@ -125816,7 +125338,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if (rate >= MPT_RATE_LAST ) return -EINVAL; -@@ -7819,7 +9434,7 @@ static int rtw_mp_channel(struct net_dev +@@ -7819,7 +9434,7 @@ static int rtw_mp_channel(struct net_device *dev, return -EFAULT; channel = rtw_atoi(input); @@ -125825,7 +125347,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release sprintf( extra, "Change channel %d to channel %d", padapter->mppriv.channel , channel ); padapter->mppriv.channel = channel; -@@ -7839,14 +9454,14 @@ static int rtw_mp_bandwidth(struct net_d +@@ -7839,14 +9454,14 @@ static int rtw_mp_bandwidth(struct net_device *dev, //if (copy_from_user(buffer, (void*)wrqu->data.pointer, wrqu->data.length)) // return -EFAULT; @@ -125842,7 +125364,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release padapter->mppriv.bandwidth = (u8)bandwidth; padapter->mppriv.preamble = sg; -@@ -7869,7 +9484,7 @@ static int rtw_mp_txpower(struct net_dev +@@ -7869,7 +9484,7 @@ static int rtw_mp_txpower(struct net_device *dev, return -EFAULT; sscanf(input,"patha=%d,pathb=%d",&idx_a,&idx_b); @@ -125851,7 +125373,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release sprintf( extra, "Set power level path_A:%d path_B:%d", idx_a , idx_b ); padapter->mppriv.txpoweridx = (u8)idx_a; -@@ -7893,7 +9508,7 @@ static int rtw_mp_ant_tx(struct net_devi +@@ -7893,7 +9508,7 @@ static int rtw_mp_ant_tx(struct net_device *dev, if (copy_from_user(input, wrqu->pointer, wrqu->length)) return -EFAULT; @@ -125860,7 +125382,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release sprintf( extra, "switch Tx antenna to %s", input ); -@@ -7910,9 +9525,9 @@ static int rtw_mp_ant_tx(struct net_devi +@@ -7910,9 +9525,9 @@ static int rtw_mp_ant_tx(struct net_device *dev, } } //antenna |= BIT(extra[i]-'a'); @@ -125872,7 +125394,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release Hal_SetAntenna(padapter); -@@ -7931,8 +9546,11 @@ static int rtw_mp_ant_rx(struct net_devi +@@ -7931,8 +9546,11 @@ static int rtw_mp_ant_rx(struct net_device *dev, if (copy_from_user(input, wrqu->pointer, wrqu->length)) return -EFAULT; @@ -125886,7 +125408,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release for (i=0; i < strlen(input); i++) { switch( input[i] ) -@@ -7946,11 +9564,11 @@ static int rtw_mp_ant_rx(struct net_devi +@@ -7946,11 +9564,11 @@ static int rtw_mp_ant_rx(struct net_device *dev, } } @@ -125901,7 +125423,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return 0; } -@@ -7973,7 +9591,7 @@ static int rtw_mp_ctx(struct net_device +@@ -7973,7 +9591,7 @@ static int rtw_mp_ctx(struct net_device *dev, if (copy_from_user(extra, wrqu->pointer, wrqu->length)) return -EFAULT; @@ -125910,7 +125432,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release countPkTx = strncmp(extra, "count=", 5); // strncmp TRUE is 0 cotuTx = strncmp(extra, "background", 20); -@@ -7984,9 +9602,9 @@ static int rtw_mp_ctx(struct net_device +@@ -7984,9 +9602,9 @@ static int rtw_mp_ctx(struct net_device *dev, stop = strncmp(extra, "stop", 5); sscanf(extra, "count=%d,pkt", &count); @@ -125922,7 +125444,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if (stop == 0) { bStartTest = 0; // To set Stop pmp_priv->tx.stop = 1; -@@ -7995,7 +9613,7 @@ static int rtw_mp_ctx(struct net_device +@@ -7995,7 +9613,7 @@ static int rtw_mp_ctx(struct net_device *dev, bStartTest = 1; if (pmp_priv->mode != MP_ON) { if (pmp_priv->tx.stop != 1) { @@ -125931,7 +125453,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return -EFAULT; } } -@@ -8016,7 +9634,7 @@ static int rtw_mp_ctx(struct net_device +@@ -8016,7 +9634,7 @@ static int rtw_mp_ctx(struct net_device *dev, { case MP_PACKET_TX: @@ -125940,7 +125462,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if (bStartTest == 0) { pmp_priv->tx.stop = 1; -@@ -8026,7 +9644,7 @@ static int rtw_mp_ctx(struct net_device +@@ -8026,7 +9644,7 @@ static int rtw_mp_ctx(struct net_device *dev, else if (pmp_priv->tx.stop == 1) { sprintf( extra, "Start continuous DA=ffffffffffff len=1500 count=%u,\n",count); @@ -125949,7 +125471,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release pmp_priv->tx.stop = 0; pmp_priv->tx.count = count; pmp_priv->tx.payload = 2; -@@ -8036,50 +9654,51 @@ static int rtw_mp_ctx(struct net_device +@@ -8036,50 +9654,51 @@ static int rtw_mp_ctx(struct net_device *dev, SetPacketTx(padapter); } else { @@ -126013,7 +125535,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release sprintf( extra, "Error! Continuous-Tx is not on-going."); return -EFAULT; } -@@ -8088,7 +9707,7 @@ static int rtw_mp_ctx(struct net_device +@@ -8088,7 +9707,7 @@ static int rtw_mp_ctx(struct net_device *dev, struct mp_priv *pmp_priv = &padapter->mppriv; if (pmp_priv->tx.stop == 0) { pmp_priv->tx.stop = 1; @@ -126022,7 +125544,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release rtw_msleep_os(5); } pmp_priv->tx.stop = 0; -@@ -8113,7 +9732,7 @@ static int rtw_mp_arx(struct net_device +@@ -8113,7 +9732,7 @@ static int rtw_mp_arx(struct net_device *dev, if (copy_from_user(input, wrqu->pointer, wrqu->length)) return -EFAULT; @@ -126031,7 +125553,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release bStartRx = (strncmp(input, "start", 5)==0)?1:0; // strncmp TRUE is 0 bStopRx = (strncmp(input, "stop", 5)==0)?1:0; // strncmp TRUE is 0 -@@ -8166,23 +9785,33 @@ static int rtw_mp_pwrtrk(struct net_devi +@@ -8166,23 +9785,33 @@ static int rtw_mp_pwrtrk(struct net_device *dev, u32 thermal; s32 ret; PADAPTER padapter = rtw_netdev_priv(dev); @@ -126070,7 +125592,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return 0; } -@@ -8192,13 +9821,15 @@ static int rtw_mp_psd(struct net_device +@@ -8192,13 +9821,15 @@ static int rtw_mp_psd(struct net_device *dev, struct iw_point *wrqu, char *extra) { PADAPTER padapter = rtw_netdev_priv(dev); @@ -126089,7 +125611,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return 0; } -@@ -8206,7 +9837,7 @@ static int rtw_mp_thermal(struct net_dev +@@ -8206,7 +9837,7 @@ static int rtw_mp_thermal(struct net_device *dev, struct iw_request_info *info, struct iw_point *wrqu, char *extra) { @@ -126098,7 +125620,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release u16 bwrite=1; #ifdef CONFIG_RTL8192C u16 addr=0x78; -@@ -8221,7 +9852,7 @@ static int rtw_mp_thermal(struct net_dev +@@ -8221,7 +9852,7 @@ static int rtw_mp_thermal(struct net_device *dev, if (copy_from_user(extra, wrqu->pointer, wrqu->length)) return -EFAULT; @@ -126107,7 +125629,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release bwrite = strncmp(extra, "write", 6); // strncmp TRUE is 0 -@@ -8229,16 +9860,16 @@ static int rtw_mp_thermal(struct net_dev +@@ -8229,16 +9860,16 @@ static int rtw_mp_thermal(struct net_device *dev, if( bwrite == 0 ) { @@ -126127,7 +125649,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return -EFAULT; } else -@@ -8248,7 +9879,7 @@ static int rtw_mp_thermal(struct net_dev +@@ -8248,7 +9879,7 @@ static int rtw_mp_thermal(struct net_device *dev, } else { @@ -126136,7 +125658,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } wrqu->length = strlen(extra); -@@ -8291,24 +9922,24 @@ static int rtw_mp_dump(struct net_device +@@ -8291,24 +9922,24 @@ static int rtw_mp_dump(struct net_device *dev, if ( strncmp(extra, "all", 4)==0 ) { @@ -126170,7 +125692,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if(( RF_1T2R == rf_type ) ||( RF_1T1R ==rf_type )) path_nums = 1; else -@@ -8323,10 +9954,10 @@ static int rtw_mp_dump(struct net_device +@@ -8323,10 +9954,10 @@ static int rtw_mp_dump(struct net_device *dev, #endif { //value = PHY_QueryRFReg(padapter, (RF90_RADIO_PATH_E)path,i, bMaskDWord); @@ -126185,7 +125707,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } } } -@@ -8345,7 +9976,7 @@ static int rtw_mp_phypara(struct net_dev +@@ -8345,7 +9976,7 @@ static int rtw_mp_phypara(struct net_device *dev, if (copy_from_user(input, wrqu->pointer, wrqu->length)) return -EFAULT; @@ -126194,7 +125716,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release sscanf(input, "xcap=%d", &valxcap); -@@ -8407,31 +10038,27 @@ static int rtw_mp_set(struct net_device +@@ -8407,31 +10038,27 @@ static int rtw_mp_set(struct net_device *dev, break; case MP_START: @@ -126231,7 +125753,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release rtw_mp_efuse_set (dev,info,wdata,extra); break; -@@ -8450,7 +10077,7 @@ static int rtw_mp_get(struct net_device +@@ -8450,7 +10077,7 @@ static int rtw_mp_get(struct net_device *dev, u32 subcmd = wrqu->flags; PADAPTER padapter = rtw_netdev_priv(dev); @@ -126240,7 +125762,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if (padapter == NULL) { -@@ -8465,86 +10092,212 @@ static int rtw_mp_get(struct net_device +@@ -8465,86 +10092,212 @@ static int rtw_mp_get(struct net_device *dev, switch(subcmd) { case MP_PHYPARA: @@ -126366,8 +125888,9 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + else + { + padapter->wdinfo.wfd_tdls_enable = 1; -+ } -+ + } + +-return 0; +#endif //CONFIG_WFD +#endif //CONFIG_TDLS + @@ -126394,9 +125917,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + else + { + padapter->wdinfo.wfd_tdls_weaksec = 1; - } -- --return 0; ++ } +#endif + + return ret; @@ -126475,7 +125996,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release static int rtw_tdls_setup(struct net_device *dev, struct iw_request_info *info, -@@ -8558,20 +10311,40 @@ static int rtw_tdls_setup(struct net_dev +@@ -8558,20 +10311,40 @@ static int rtw_tdls_setup(struct net_device *dev, _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); u8 mac_addr[ETH_ALEN]; @@ -126520,7 +126041,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release static int rtw_tdls_teardown(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) -@@ -8585,12 +10358,12 @@ static int rtw_tdls_teardown(struct net_ +@@ -8585,12 +10358,12 @@ static int rtw_tdls_teardown(struct net_device *dev, struct sta_info *ptdls_sta = NULL; u8 mac_addr[ETH_ALEN]; @@ -126535,7 +126056,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release ptdls_sta = rtw_get_stainfo( &(padapter->stapriv), mac_addr); if(ptdls_sta != NULL) -@@ -8599,12 +10372,11 @@ static int rtw_tdls_teardown(struct net_ +@@ -8599,12 +10372,11 @@ static int rtw_tdls_teardown(struct net_device *dev, issue_tdls_teardown(padapter, mac_addr); } @@ -126549,7 +126070,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release static int rtw_tdls_discovery(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) -@@ -8617,11 +10389,11 @@ static int rtw_tdls_discovery(struct net +@@ -8617,11 +10389,11 @@ static int rtw_tdls_discovery(struct net_device *dev, struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); @@ -126563,7 +126084,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return ret; } -@@ -8639,7 +10411,7 @@ static int rtw_tdls_ch_switch(struct net +@@ -8639,7 +10411,7 @@ static int rtw_tdls_ch_switch(struct net_device *dev, u8 i, j, mac_addr[ETH_ALEN]; struct sta_info *ptdls_sta = NULL; @@ -126572,7 +126093,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release for( i=0, j=0 ; i < ETH_ALEN; i++, j+=3 ){ mac_addr[i]=key_2char2num(*(extra+j), *(extra+j+1)); -@@ -8648,15 +10420,14 @@ static int rtw_tdls_ch_switch(struct net +@@ -8648,15 +10420,14 @@ static int rtw_tdls_ch_switch(struct net_device *dev, ptdls_sta = rtw_get_stainfo(&padapter->stapriv, mac_addr); if( ptdls_sta == NULL ) return ret; @@ -126591,7 +126112,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release static int rtw_tdls_pson(struct net_device *dev, struct iw_request_info *info, -@@ -8672,7 +10443,7 @@ static int rtw_tdls_pson(struct net_devi +@@ -8672,7 +10443,7 @@ static int rtw_tdls_pson(struct net_device *dev, u8 i, j, mac_addr[ETH_ALEN]; struct sta_info *ptdls_sta = NULL; @@ -126600,7 +126121,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release for( i=0, j=0 ; i < ETH_ALEN; i++, j+=3 ){ mac_addr[i]=key_2char2num(*(extra+j), *(extra+j+1)); -@@ -8682,9 +10453,9 @@ static int rtw_tdls_pson(struct net_devi +@@ -8682,9 +10453,9 @@ static int rtw_tdls_pson(struct net_device *dev, issue_nulldata_to_TDLS_peer_STA(padapter, ptdls_sta, 1); @@ -126612,7 +126133,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } static int rtw_tdls_psoff(struct net_device *dev, -@@ -8701,7 +10472,7 @@ static int rtw_tdls_psoff(struct net_dev +@@ -8701,7 +10472,7 @@ static int rtw_tdls_psoff(struct net_device *dev, u8 i, j, mac_addr[ETH_ALEN]; struct sta_info *ptdls_sta = NULL; @@ -126621,7 +126142,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release for( i=0, j=0 ; i < ETH_ALEN; i++, j+=3 ){ mac_addr[i]=key_2char2num(*(extra+j), *(extra+j+1)); -@@ -8711,9 +10482,185 @@ static int rtw_tdls_psoff(struct net_dev +@@ -8711,11 +10482,187 @@ static int rtw_tdls_psoff(struct net_device *dev, issue_nulldata_to_TDLS_peer_STA(padapter, ptdls_sta, 0); @@ -126708,10 +126229,10 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + +#endif //CONFIG_WFD +#endif //CONFIG_TDLS -+ -+ return ret; -+} -+ + + return ret; + } + +static int rtw_tdls_getport(struct net_device *dev, + struct iw_request_info *info, + union iwreq_data *wrqu, char *extra) @@ -126802,13 +126323,15 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + +#endif //CONFIG_WFD +#endif //CONFIG_TDLS - - return ret; ++ ++ return ret; + - } - ++} ++ static int rtw_tdls_ch_switch_off(struct net_device *dev, -@@ -8728,7 +10675,7 @@ static int rtw_tdls_ch_switch_off(struct + struct iw_request_info *info, + union iwreq_data *wrqu, char *extra) +@@ -8728,7 +10675,7 @@ static int rtw_tdls_ch_switch_off(struct net_device *dev, u8 i, j, mac_addr[ETH_ALEN]; struct sta_info *ptdls_sta = NULL; @@ -126817,7 +126340,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release for( i=0, j=0 ; i < ETH_ALEN; i++, j+=3 ){ mac_addr[i]=key_2char2num(*(extra+j), *(extra+j+1)); -@@ -8741,11 +10688,11 @@ static int rtw_tdls_ch_switch_off(struct +@@ -8741,11 +10688,11 @@ static int rtw_tdls_ch_switch_off(struct net_device *dev, if((ptdls_sta->tdls_sta_state & TDLS_AT_OFF_CH_STATE) && (ptdls_sta->tdls_sta_state & TDLS_PEER_AT_OFF_STATE)){ pmlmeinfo->tdls_candidate_ch= pmlmeext->cur_channel; issue_tdls_ch_switch_req(padapter, mac_addr); @@ -126831,7 +126354,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return ret; } -@@ -8757,8 +10704,34 @@ static int rtw_tdls(struct net_device *d +@@ -8757,8 +10704,34 @@ static int rtw_tdls(struct net_device *dev, int ret = 0; #ifdef CONFIG_TDLS @@ -126867,7 +126390,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if ( _rtw_memcmp( extra, "setup=", 6 ) ) { -@@ -8795,89 +10768,56 @@ static int rtw_tdls(struct net_device *d +@@ -8795,89 +10768,56 @@ static int rtw_tdls(struct net_device *dev, wrqu->data.length -= 6; rtw_tdls_psoff( dev, info, wrqu, &extra[6] ); } @@ -126969,20 +126492,20 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + if ( _rtw_memcmp( wrqu->data.pointer, "ip", 2 ) ) + { + rtw_tdls_getip( dev, info, wrqu, extra ); -+ } + } +- else { +- return -EFAULT; + if ( _rtw_memcmp( wrqu->data.pointer, "port", 4 ) ) + { + rtw_tdls_getport( dev, info, wrqu, extra ); } -- else { -- return -EFAULT; +- return 0; + + //WFDTDLS, for sigma test + if ( _rtw_memcmp( wrqu->data.pointer, "dis", 3 ) ) + { + rtw_tdls_dis_result( dev, info, wrqu, extra ); - } -- return 0; ++ } + if ( _rtw_memcmp( wrqu->data.pointer, "status", 6 ) ) + { + rtw_wfd_tdls_status( dev, info, wrqu, extra ); @@ -126994,7 +126517,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } static int rtw_pm_set(struct net_device *dev, -@@ -8885,27 +10825,32 @@ static int rtw_pm_set(struct net_device +@@ -8885,27 +10825,32 @@ static int rtw_pm_set(struct net_device *dev, union iwreq_data *wrqu, char *extra) { int ret = 0; @@ -127035,7 +126558,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { int ret = 0; struct oid_par_priv oid_par; -@@ -8946,7 +10891,7 @@ static int rtw_wowlan_ctrl(struct net_de +@@ -8946,7 +10891,7 @@ static int rtw_wowlan_ctrl(struct net_device *dev, DBG_871X("+rtw_wowlan_ctrl: Device didn't support the remote wakeup!!\n"); goto _rtw_wowlan_ctrl_exit_free; } @@ -127366,7 +126889,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + rtw_free_xmitframe(pxmitpriv, pframe); + rtw_free_xmitbuf(pxmitpriv, pxmitbuf); +} -+ + +extern u32 get_txfifo_hwaddr(struct xmit_frame *pxmitframe); + +thread_return lbk_thread(thread_context context) @@ -127563,7 +127086,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + printk("%s: no memory!\n", __func__); + return -ENOMEM; + } - ++ + if (copy_from_user(pbuf, wrqu->data.pointer, len)) { + rtw_mfree(pbuf, len); + printk("%s: copy from user fail!\n", __func__); @@ -127657,7 +127180,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #include int rtw_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) -@@ -8981,6 +11531,11 @@ int rtw_ioctl(struct net_device *dev, st +@@ -8981,6 +11531,11 @@ int rtw_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) case RTL_IOCTL_HOSTAPD: ret = rtw_hostapd_ioctl(dev, &wrq->u.data); break; @@ -127678,7 +127201,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release rtw_wx_get_rts, /* SIOCGIWRTS */ rtw_wx_set_frag, /* SIOCSIWFRAG */ rtw_wx_get_frag, /* SIOCGIWFRAG */ -@@ -9060,44 +11615,45 @@ static const struct iw_priv_args rtw_pri +@@ -9060,44 +11615,45 @@ static const struct iw_priv_args rtw_private_args[] = { SIOCIWFIRSTPRIV + 0x00, IW_PRIV_TYPE_CHAR | 1024, 0 , ""}, //set { SIOCIWFIRSTPRIV + 0x01, IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK , ""},//get /* --- sub-ioctls definitions --- */ @@ -127744,7 +127267,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { SIOCIWFIRSTPRIV + 0x02, IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK , "test"},//set -@@ -9110,23 +11666,23 @@ static iw_handler rtw_private_handler[] +@@ -9110,23 +11666,23 @@ static iw_handler rtw_private_handler[] = rtw_mp_get, }; @@ -127772,7 +127295,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release }, { SIOCIWFIRSTPRIV + 0x4, -@@ -9172,40 +11728,57 @@ static const struct iw_priv_args rtw_pri +@@ -9172,40 +11728,57 @@ static const struct iw_priv_args rtw_private_args[] = { SIOCIWFIRSTPRIV + 0xD, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_FIXED | IFNAMSIZ, "rfr" }, @@ -127841,7 +127364,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release }; static iw_handler rtw_private_handler[] = -@@ -9234,18 +11807,20 @@ static iw_handler rtw_private_handler[] +@@ -9234,18 +11807,20 @@ static iw_handler rtw_private_handler[] = rtw_wx_write_rf, //0x0C rtw_wx_read_rf, //0x0D @@ -127867,7 +127390,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release rtw_pm_set, //0x16 rtw_wx_priv_null, //0x17 -@@ -9254,7 +11829,12 @@ static iw_handler rtw_private_handler[] +@@ -9254,7 +11829,12 @@ static iw_handler rtw_private_handler[] = rtw_mp_efuse_set, //0x1A rtw_mp_efuse_get, //0x1B @@ -127881,7 +127404,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release }; #endif // #if defined(CONFIG_MP_INCLUDED) && defined(CONFIG_MP_IWPRIV_SUPPORT) -@@ -9273,7 +11853,7 @@ static struct iw_statistics *rtw_get_wir +@@ -9273,7 +11853,7 @@ static struct iw_statistics *rtw_get_wireless_stats(struct net_device *dev) piwstats->qual.qual = 0; piwstats->qual.level = 0; piwstats->qual.noise = 0; @@ -127890,7 +127413,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } else{ #ifdef CONFIG_SIGNAL_DISPLAY_DBM -@@ -9284,7 +11864,7 @@ static struct iw_statistics *rtw_get_wir +@@ -9284,7 +11864,7 @@ static struct iw_statistics *rtw_get_wireless_stats(struct net_device *dev) tmp_qual = padapter->recvpriv.signal_qual; tmp_noise =padapter->recvpriv.noise; @@ -127899,7 +127422,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release piwstats->qual.level = tmp_level; piwstats->qual.qual = tmp_qual; -@@ -9310,16 +11890,20 @@ static struct iw_statistics *rtw_get_wir +@@ -9310,16 +11890,20 @@ static struct iw_statistics *rtw_get_wireless_stats(struct net_device *dev) } #endif @@ -127920,9 +127443,11 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release }; +#endif +diff --git a/drivers/net/wireless/rtl8192cu/os_dep/linux/mlme_linux.c b/drivers/net/wireless/rtl8192cu/os_dep/linux/mlme_linux.c +index 0175ea2..6fc9f03 100644 --- a/drivers/net/wireless/rtl8192cu/os_dep/linux/mlme_linux.c +++ b/drivers/net/wireless/rtl8192cu/os_dep/linux/mlme_linux.c -@@ -135,7 +135,6 @@ extern void rtw_indicate_wx_disassoc_eve +@@ -135,7 +135,6 @@ extern void rtw_indicate_wx_disassoc_event(_adapter *padapter); void rtw_os_indicate_connect(_adapter *adapter) { @@ -127946,7 +127471,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #endif _func_exit_; -@@ -173,7 +171,12 @@ void rtw_reset_securitypriv( _adapter *a +@@ -173,7 +171,12 @@ void rtw_reset_securitypriv( _adapter *adapter ) u8 backupPMKIDIndex = 0; u8 backupTKIPCountermeasure = 0x00; u32 backupTKIPcountermeasure_time = 0; @@ -127960,7 +127485,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if(adapter->securitypriv.dot11AuthAlgrthm == dot11AuthAlgrthm_8021X)//802.1x { // Added by Albert 2009/02/18 -@@ -187,8 +190,11 @@ void rtw_reset_securitypriv( _adapter *a +@@ -187,8 +190,11 @@ void rtw_reset_securitypriv( _adapter *adapter ) _rtw_memcpy( &backupPMKIDList[ 0 ], &adapter->securitypriv.PMKIDList[ 0 ], sizeof( RT_PMKID_LIST ) * NUM_PMKID_CACHE ); backupPMKIDIndex = adapter->securitypriv.PMKIDIndex; backupTKIPCountermeasure = adapter->securitypriv.btkip_countermeasure; @@ -127974,7 +127499,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release _rtw_memset((unsigned char *)&adapter->securitypriv, 0, sizeof (struct security_priv)); //_init_timer(&(adapter->securitypriv.tkip_timer),adapter->pnetdev, rtw_use_tkipkey_handler, adapter); -@@ -197,7 +203,7 @@ void rtw_reset_securitypriv( _adapter *a +@@ -197,7 +203,7 @@ void rtw_reset_securitypriv( _adapter *adapter ) _rtw_memcpy( &adapter->securitypriv.PMKIDList[ 0 ], &backupPMKIDList[ 0 ], sizeof( RT_PMKID_LIST ) * NUM_PMKID_CACHE ); adapter->securitypriv.PMKIDIndex = backupPMKIDIndex; adapter->securitypriv.btkip_countermeasure = backupTKIPCountermeasure; @@ -127983,7 +127508,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release adapter->securitypriv.ndisauthtype = Ndis802_11AuthModeOpen; adapter->securitypriv.ndisencryptstatus = Ndis802_11WEPDisabled; -@@ -218,9 +224,10 @@ void rtw_reset_securitypriv( _adapter *a +@@ -218,9 +224,10 @@ void rtw_reset_securitypriv( _adapter *adapter ) psec_priv->ndisauthtype = Ndis802_11AuthModeOpen; psec_priv->ndisencryptstatus = Ndis802_11WEPDisabled; @@ -127995,7 +127520,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } void rtw_os_indicate_disconnect( _adapter *adapter ) -@@ -229,17 +236,19 @@ void rtw_os_indicate_disconnect( _adapte +@@ -229,17 +236,19 @@ void rtw_os_indicate_disconnect( _adapter *adapter ) _func_enter_; @@ -128017,7 +127542,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release _func_exit_; -@@ -313,186 +322,20 @@ void _addba_timer_hdl(void *FunctionCont +@@ -313,185 +322,19 @@ void _addba_timer_hdl(void *FunctionContext) addba_timer_hdl(psta); } @@ -128088,9 +127613,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release -} - -void _off_ch_timer_hdl(void *FunctionContext) -+#ifdef CONFIG_IEEE80211W -+void _sa_query_timer_hdl (void *FunctionContext) - { +-{ - struct sta_info *ptdls_sta = (struct sta_info *)FunctionContext; - rtw_tdls_cmd(ptdls_sta->padapter, ptdls_sta->hwaddr, TDLS_P_BASE_CH ); - } @@ -128102,7 +127625,9 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release -} - -void _tdls_handshake_timer_hdl(void *FunctionContext) --{ ++#ifdef CONFIG_IEEE80211W ++void _sa_query_timer_hdl (void *FunctionContext) + { - struct sta_info *ptdls_sta = (struct sta_info *)FunctionContext; - - if(ptdls_sta != NULL) @@ -128196,22 +127721,21 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - ptdls_sta->timer_flag = 0; - _exit_critical_bh(&ptdlsinfo->hdl_lock, &irqL); -} - -+ _init_timer(&psta->addba_retry_timer, padapter->pnetdev, _addba_timer_hdl, psta); - } +- +-} -void init_tdls_alive_timer(_adapter *padapter, struct sta_info *psta) -{ - psta->padapter=padapter; - _init_timer(&psta->alive_timer1, padapter->pnetdev, _tdls_alive_timer_phase1_hdl, psta); - _init_timer(&psta->alive_timer2, padapter->pnetdev, _tdls_alive_timer_phase2_hdl, psta); --} ++ _init_timer(&psta->addba_retry_timer, padapter->pnetdev, _addba_timer_hdl, psta); + } -#endif //CONFIG_TDLS -- + /* void _reauth_timer_hdl(void *FunctionContext) - { -@@ -513,6 +356,9 @@ void init_mlme_ext_timer(_adapter *padap +@@ -513,6 +356,9 @@ void init_mlme_ext_timer(_adapter *padapter) _init_timer(&pmlmeext->survey_timer, padapter->pnetdev, _survey_timer_hdl, padapter); _init_timer(&pmlmeext->link_timer, padapter->pnetdev, _link_timer_hdl, padapter); @@ -128221,7 +127745,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release //_init_timer(&pmlmeext->ADDBA_timer, padapter->pnetdev, _addba_timer_hdl, padapter); //_init_timer(&pmlmeext->reauth_timer, padapter->pnetdev, _reauth_timer_hdl, padapter); -@@ -579,24 +425,24 @@ static int mgnt_xmit_entry(struct sk_buf +@@ -579,24 +425,24 @@ static int mgnt_xmit_entry(struct sk_buff *skb, struct net_device *pnetdev) struct hostapd_priv *phostapdpriv = rtw_netdev_priv(pnetdev); _adapter *padapter = (_adapter *)phostapdpriv->padapter; @@ -128252,7 +127776,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release netif_carrier_on(pnetdev); -@@ -609,14 +455,14 @@ static int mgnt_netdev_close(struct net_ +@@ -609,14 +455,14 @@ static int mgnt_netdev_close(struct net_device *pnetdev) { struct hostapd_priv *phostapdpriv = rtw_netdev_priv(pnetdev); @@ -128270,7 +127794,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release //rtw_write16(phostapdpriv->padapter, 0x0116, 0x3f3f); -@@ -658,7 +504,7 @@ int hostapd_mode_init(_adapter *padapter +@@ -658,7 +504,7 @@ int hostapd_mode_init(_adapter *padapter) #if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,29)) @@ -128279,7 +127803,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release pnetdev->netdev_ops = &rtl871x_mgnt_netdev_ops; -@@ -690,7 +536,7 @@ int hostapd_mode_init(_adapter *padapter +@@ -690,7 +536,7 @@ int hostapd_mode_init(_adapter *padapter) if(dev_alloc_name(pnetdev,"mgnt.wlan%d") < 0) { @@ -128288,7 +127812,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } -@@ -713,7 +559,7 @@ int hostapd_mode_init(_adapter *padapter +@@ -713,7 +559,7 @@ int hostapd_mode_init(_adapter *padapter) /* Tell the network stack we exist */ if (register_netdev(pnetdev) != 0) { @@ -128297,6 +127821,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if(pnetdev) { +diff --git a/drivers/net/wireless/rtl8192cu/os_dep/linux/os_intfs.c b/drivers/net/wireless/rtl8192cu/os_dep/linux/os_intfs.c +index b88a5eb..82dee6d 100644 --- a/drivers/net/wireless/rtl8192cu/os_dep/linux/os_intfs.c +++ b/drivers/net/wireless/rtl8192cu/os_dep/linux/os_intfs.c @@ -1,7 +1,7 @@ @@ -128336,7 +127862,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release int rtw_wireless_mode = WIRELESS_11BG_24N; int rtw_vrtl_carrier_sense = AUTO_VCS; int rtw_vcs_type = RTS_CTS;//* -@@ -74,18 +70,18 @@ int rtw_preamble = PREAMBLE_LONG;//long, +@@ -74,18 +70,18 @@ int rtw_preamble = PREAMBLE_LONG;//long, short, auto int rtw_scan_mode = 1;//active, passive int rtw_adhoc_tx_pwr = 1; int rtw_soft_ap = 0; @@ -128387,7 +127913,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release int rtw_ampdu_enable = 1;//for enable tx_ampdu int rtw_rx_stbc = 1;// 0: disable, bit(0):enable 2.4g, bit(1):enable 5g, default is set to enable 2.4GHZ for IOT issue with bufflao's AP at 5GHZ int rtw_ampdu_amsdu = 0;// 0: disabled, 1:enabled, 2:auto -@@ -123,7 +119,7 @@ int rtw_ampdu_amsdu = 0;// 0: disabled, +@@ -123,7 +119,7 @@ int rtw_ampdu_amsdu = 0;// 0: disabled, 1:enabled, 2:auto int rtw_lowrate_two_xmit = 1;//Use 2 path Tx to transmit MCS0~7 and legacy mode @@ -128479,7 +128005,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #ifdef CONFIG_FILE_FWIMG char *rtw_fw_file_path= ""; module_param(rtw_fw_file_path, charp, 0644); -@@ -243,7 +252,18 @@ MODULE_PARM_DESC(rtw_fw_file_path, "The +@@ -243,7 +252,18 @@ MODULE_PARM_DESC(rtw_fw_file_path, "The path of fw image"); module_param(rtw_mc2u_disable, int, 0644); #endif // CONFIG_TX_MCAST2UNI @@ -128524,7 +128050,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if(rtw_proc == NULL) { -@@ -283,6 +294,18 @@ void rtw_proc_init_one(struct net_device +@@ -283,6 +294,18 @@ void rtw_proc_init_one(struct net_device *dev) { _rtw_memcpy(rtw_proc_name, RTL8192D_PROC_NAME, sizeof(RTL8192D_PROC_NAME)); } @@ -128543,7 +128069,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #if(LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)) rtw_proc=create_proc_entry(rtw_proc_name, S_IFDIR, proc_net); -@@ -290,23 +313,40 @@ void rtw_proc_init_one(struct net_device +@@ -290,23 +313,40 @@ void rtw_proc_init_one(struct net_device *dev) rtw_proc=create_proc_entry(rtw_proc_name, S_IFDIR, init_net.proc_net); #endif if (rtw_proc == NULL) { @@ -128590,7 +128116,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release rtw_proc); dir_dev = padapter->dir_dev; -@@ -320,12 +360,12 @@ void rtw_proc_init_one(struct net_device +@@ -320,12 +360,12 @@ void rtw_proc_init_one(struct net_device *dev) remove_proc_entry(rtw_proc_name, proc_net); #else remove_proc_entry(rtw_proc_name, init_net.proc_net); @@ -128605,7 +128131,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return; } } -@@ -337,147 +377,283 @@ void rtw_proc_init_one(struct net_device +@@ -337,147 +377,283 @@ void rtw_proc_init_one(struct net_device *dev) rtw_proc_cnt++; entry = create_proc_read_entry("write_reg", S_IFREG | S_IRUGO, @@ -128926,7 +128452,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release dir_dev = padapter->dir_dev; padapter->dir_dev = NULL; -@@ -491,29 +667,64 @@ void rtw_proc_remove_one(struct net_devi +@@ -491,29 +667,64 @@ void rtw_proc_remove_one(struct net_device *dev) remove_proc_entry("mlmext_state", dir_dev); remove_proc_entry("qos_option", dir_dev); remove_proc_entry("ht_option", dir_dev); @@ -128997,7 +128523,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } else { -@@ -526,22 +737,26 @@ void rtw_proc_remove_one(struct net_devi +@@ -526,22 +737,26 @@ void rtw_proc_remove_one(struct net_device *dev) { if(rtw_proc){ remove_proc_entry("ver_info", rtw_proc); @@ -129154,7 +128680,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release //addr->sa_data[4], addr->sa_data[5]); _rtw_memcpy(padapter->eeprompriv.mac_addr, addr->sa_data, ETH_ALEN); //_rtw_memcpy(pnetdev->dev_addr, addr->sa_data, ETH_ALEN); -@@ -673,20 +901,103 @@ static struct net_device_stats *rtw_net_ +@@ -673,20 +901,103 @@ static struct net_device_stats *rtw_net_get_stats(struct net_device *pnetdev) struct recv_priv *precvpriv = &(padapter->recvpriv); padapter->stats.tx_packets = pxmitpriv->tx_pkts;//pxmitpriv->tx_pkts++; @@ -129261,7 +128787,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release .ndo_set_mac_address = rtw_net_set_mac_address, .ndo_get_stats = rtw_net_get_stats, .ndo_do_ioctl = rtw_ioctl, -@@ -715,24 +1026,24 @@ int rtw_init_netdev_name(struct net_devi +@@ -715,24 +1026,24 @@ int rtw_init_netdev_name(struct net_device *pnetdev, const char *ifname) TargetNetdev = dev_get_by_name(devnet, "wlan0"); #endif if(TargetNetdev) { @@ -129291,7 +128817,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if(dev_alloc_name(pnetdev, ifname) < 0) { -@@ -740,41 +1051,41 @@ int rtw_init_netdev_name(struct net_devi +@@ -740,41 +1051,41 @@ int rtw_init_netdev_name(struct net_device *pnetdev, const char *ifname) } netif_carrier_off(pnetdev); @@ -129343,7 +128869,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release pnetdev->hard_start_xmit = rtw_xmit_entry; pnetdev->set_mac_address = rtw_net_set_mac_address; pnetdev->get_stats = rtw_net_get_stats; -@@ -784,11 +1095,12 @@ struct net_device *rtw_init_netdev(_adap +@@ -784,11 +1095,12 @@ struct net_device *rtw_init_netdev(_adapter *old_padapter) #ifdef CONFIG_TCP_CSUM_OFFLOAD_TX pnetdev->features |= NETIF_F_IP_CSUM; @@ -129358,7 +128884,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #ifdef WIRELESS_SPY //priv->wireless_data.spy_data = &priv->spy_data; -@@ -797,36 +1109,72 @@ struct net_device *rtw_init_netdev(_adap +@@ -797,36 +1109,72 @@ struct net_device *rtw_init_netdev(_adapter *old_padapter) //step 2. loadparam(padapter, pnetdev); @@ -129443,7 +128969,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #endif return _status; -@@ -835,13 +1183,13 @@ u32 rtw_start_drv_threads(_adapter *pada +@@ -835,13 +1183,13 @@ u32 rtw_start_drv_threads(_adapter *padapter) void rtw_stop_drv_threads (_adapter *padapter) { @@ -129463,7 +128989,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } #ifdef CONFIG_EVENT_THREAD_MODE -@@ -853,12 +1201,12 @@ void rtw_stop_drv_threads (_adapter *pad +@@ -853,12 +1201,12 @@ void rtw_stop_drv_threads (_adapter *padapter) #ifdef CONFIG_XMIT_THREAD_MODE // Below is to termindate tx_thread... @@ -129479,7 +129005,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release // Below is to termindate rx_thread... _rtw_up_sema(&padapter->recvpriv.recv_sema); _rtw_down_sema(&padapter->recvpriv.terminate_recvthread_sema); -@@ -868,12 +1216,12 @@ void rtw_stop_drv_threads (_adapter *pad +@@ -868,12 +1216,12 @@ void rtw_stop_drv_threads (_adapter *padapter) } @@ -129493,7 +129019,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release struct mlme_priv *pmlmepriv= &padapter->mlmepriv; struct security_priv *psecuritypriv = &padapter->securitypriv; -@@ -883,30 +1231,30 @@ u8 rtw_init_default_value(_adapter *pada +@@ -883,30 +1231,30 @@ u8 rtw_init_default_value(_adapter *padapter) pxmitpriv->vcs_type = pregistrypriv->vcs_type; //pxmitpriv->rts_thresh = pregistrypriv->rts_thresh; pxmitpriv->frag_len = pregistrypriv->frag_thresh; @@ -129532,7 +129058,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_Open; //open system psecuritypriv->dot11PrivacyAlgrthm = _NO_PRIVACY_; -@@ -917,44 +1265,77 @@ u8 rtw_init_default_value(_adapter *pada +@@ -917,44 +1265,77 @@ u8 rtw_init_default_value(_adapter *padapter) psecuritypriv->ndisauthtype = Ndis802_11AuthModeOpen; psecuritypriv->ndisencryptstatus = Ndis802_11WEPDisabled; @@ -129557,19 +129083,17 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release padapter->bWritePortCancel = _FALSE; padapter->bRxRSSIDisplay = 0; - +- return ret; + padapter->bForceWriteInitGain = 1; + padapter->bNotifyChannelChange = 0; +#ifdef CONFIG_P2P + padapter->bShowGetP2PState = 1; +#endif - return ret; - } - --u8 rtw_reset_drv_sw(_adapter *padapter) ++ return ret; ++} ++ +struct dvobj_priv *devobj_init(void) - { -- u8 ret8=_SUCCESS; -- struct mlme_priv *pmlmepriv= &padapter->mlmepriv; ++{ + struct dvobj_priv *pdvobj = NULL; + + if ((pdvobj = (struct dvobj_priv*)rtw_zmalloc(sizeof(*pdvobj))) == NULL) @@ -129583,8 +129107,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + pdvobj->processing_dev_remove = _FALSE; + + return pdvobj; -+} -+ + } + +void devobj_deinit(struct dvobj_priv *pdvobj) +{ + if(!pdvobj) @@ -129598,10 +129122,11 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + rtw_mfree((u8*)pdvobj, sizeof(*pdvobj)); +} + -+u8 rtw_reset_drv_sw(_adapter *padapter) -+{ + u8 rtw_reset_drv_sw(_adapter *padapter) + { +- u8 ret8=_SUCCESS; + u8 ret8=_SUCCESS; -+ struct mlme_priv *pmlmepriv= &padapter->mlmepriv; + struct mlme_priv *pmlmepriv= &padapter->mlmepriv; struct pwrctrl_priv *pwrctrlpriv = &padapter->pwrctrlpriv; //hal_priv @@ -129775,7 +129300,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } void rtw_cancel_all_timer(_adapter *padapter) -@@ -1115,13 +1512,13 @@ void rtw_cancel_all_timer(_adapter *pada +@@ -1115,13 +1512,13 @@ void rtw_cancel_all_timer(_adapter *padapter) //RT_TRACE(_module_os_intfs_c_,_drv_info_,("rtw_cancel_all_timer:cancel tkip_timer! \n")); _cancel_timer_ex(&padapter->mlmepriv.scan_to_timer); @@ -129792,7 +129317,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release RT_TRACE(_module_os_intfs_c_,_drv_info_,("rtw_cancel_all_timer:cancel DeInitSwLeds! \n")); _cancel_timer_ex(&padapter->pwrctrlpriv.pwr_state_check_timer); -@@ -1134,6 +1531,7 @@ void rtw_cancel_all_timer(_adapter *pada +@@ -1134,6 +1531,7 @@ void rtw_cancel_all_timer(_adapter *padapter) #ifdef CONFIG_SET_SCAN_DENY_TIMER _cancel_timer_ex(&padapter->mlmepriv.set_scan_deny_timer); @@ -129800,7 +129325,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release RT_TRACE(_module_os_intfs_c_,_drv_info_,("rtw_cancel_all_timer:cancel set_scan_deny_timer! \n")); #endif -@@ -1142,15 +1540,16 @@ void rtw_cancel_all_timer(_adapter *pada +@@ -1142,15 +1540,16 @@ void rtw_cancel_all_timer(_adapter *padapter) #endif // cancel dm timer @@ -129883,7 +129408,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release RT_TRACE(_module_os_intfs_c_,_drv_info_,("<==rtw_free_drv_sw\n")); -@@ -1211,267 +1617,1028 @@ u8 rtw_free_drv_sw(_adapter *padapter) +@@ -1211,265 +1617,1026 @@ u8 rtw_free_drv_sw(_adapter *padapter) if(padapter->rereg_nd_name_priv.old_pnetdev) { free_netdev(padapter->rereg_nd_name_priv.old_pnetdev); padapter->rereg_nd_name_priv.old_pnetdev = NULL; @@ -130025,7 +129550,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - netif_wake_queue(pnetdev); - -#ifdef CONFIG_BR_EXT -- ++ rtw_netif_wake_queue(pnetdev); + -#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 35)) - rcu_read_lock(); -#endif // (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 35)) @@ -130053,8 +129579,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - - br_netdev = dev_get_by_name(devnet, CONFIG_BR_EXT_BRNAME); -#endif // (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)) -+ rtw_netif_wake_queue(pnetdev); - +- - if (br_netdev) { - memcpy(padapter->br_mac, br_netdev->dev_addr, ETH_ALEN); - dev_put(br_netdev); @@ -130281,8 +129806,6 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release +#endif //CONFIG_IOCTL_CFG80211 - //s5. -- if(padapter->bSurpriseRemoved == _FALSE) -- { + //set interface_type/chip_type/HardwareType + padapter->interface_type = primary_padapter->interface_type; + padapter->chip_type = primary_padapter->chip_type; @@ -131095,12 +130618,10 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + } + + //s5. -+ if(padapter->bSurpriseRemoved == _FALSE) -+ { + if(padapter->bSurpriseRemoved == _FALSE) + { rtw_hal_deinit(padapter); - } - -@@ -1481,7 +2648,7 @@ int pm_netdev_open(struct net_device *pn +@@ -1481,7 +2648,7 @@ int pm_netdev_open(struct net_device *pnetdev,u8 bnormal) { int status; if(bnormal) @@ -131109,7 +130630,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #ifdef CONFIG_IPS else status = (_SUCCESS == ips_netdrv_open((_adapter *)rtw_netdev_priv(pnetdev)))?(0):(-1); -@@ -1489,16 +2656,16 @@ int pm_netdev_open(struct net_device *pn +@@ -1489,16 +2656,16 @@ int pm_netdev_open(struct net_device *pnetdev,u8 bnormal) return status; } @@ -131129,7 +130650,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if(padapter->pwrctrlpriv.rf_pwrstate == rf_off) padapter->pwrctrlpriv.ps_flag = _TRUE; } -@@ -1506,7 +2673,7 @@ static int netdev_close(struct net_devic +@@ -1506,7 +2673,7 @@ static int netdev_close(struct net_device *pnetdev) /* if(!padapter->hw_init_completed) { @@ -131138,7 +130659,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release padapter->bDriverStopped = _TRUE; -@@ -1514,22 +2681,22 @@ static int netdev_close(struct net_devic +@@ -1514,22 +2681,22 @@ static int netdev_close(struct net_device *pnetdev) } else*/ if(padapter->pwrctrlpriv.rf_pwrstate == rf_on){ @@ -131171,7 +130692,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release rtw_free_assoc_resources(padapter, 1); //s2-4. rtw_free_network_queue(padapter,_TRUE); -@@ -1539,7 +2706,7 @@ static int netdev_close(struct net_devic +@@ -1539,7 +2706,7 @@ static int netdev_close(struct net_device *pnetdev) } #ifdef CONFIG_BR_EXT @@ -131180,7 +130701,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { //void nat25_db_cleanup(_adapter *priv); nat25_db_cleanup(padapter); -@@ -1547,22 +2714,36 @@ static int netdev_close(struct net_devic +@@ -1547,22 +2714,36 @@ static int netdev_close(struct net_device *pnetdev) #endif // CONFIG_BR_EXT #ifdef CONFIG_P2P @@ -131227,6 +130748,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + free_netdev(ndev); } +diff --git a/drivers/net/wireless/rtl8192cu/os_dep/linux/pci_intf.c b/drivers/net/wireless/rtl8192cu/os_dep/linux/pci_intf.c +index 0848297..5bf576f 100644 --- a/drivers/net/wireless/rtl8192cu/os_dep/linux/pci_intf.c +++ b/drivers/net/wireless/rtl8192cu/os_dep/linux/pci_intf.c @@ -1,7 +1,7 @@ @@ -131247,7 +130770,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #include #ifndef CONFIG_PCI_HCI -@@ -79,23 +79,21 @@ struct pci_device_id rtw_pci_id_tbl[] = +@@ -79,23 +79,21 @@ struct pci_device_id rtw_pci_id_tbl[] = { {}, }; @@ -131276,7 +130799,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release .rtw_pci_drv.suspend = NULL, .rtw_pci_drv.resume = NULL, #endif -@@ -114,7 +112,7 @@ static u16 pcibridge_vendors[PCI_BRIDGE_ +@@ -114,7 +112,7 @@ static u16 pcibridge_vendors[PCI_BRIDGE_VENDOR_MAX] = { static u8 rtw_pci_platform_switch_device_pci_aspm(_adapter *padapter, u8 value) { @@ -131285,7 +130808,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release u8 bresult = _SUCCESS; int error; -@@ -125,18 +123,18 @@ static u8 rtw_pci_platform_switch_device +@@ -125,18 +123,18 @@ static u8 rtw_pci_platform_switch_device_pci_aspm(_adapter *padapter, u8 value) if(error != 0) { bresult = _FALSE; @@ -131309,7 +130832,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release u8 buffer, bresult = _SUCCESS; int error; -@@ -150,18 +148,18 @@ static u8 rtw_pci_switch_clk_req(_adapte +@@ -150,18 +148,18 @@ static u8 rtw_pci_switch_clk_req(_adapter *padapter, u8 value) if(error != 0) { bresult = _FALSE; @@ -131331,7 +130854,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv; struct pci_priv *pcipriv = &(pdvobjpriv->pcipriv); u32 pcicfg_addrport = 0; -@@ -170,8 +168,8 @@ void rtw_pci_disable_aspm(_adapter *pada +@@ -170,8 +168,8 @@ void rtw_pci_disable_aspm(_adapter *padapter) u16 pcibridge_linkctrlreg, aspmlevel = 0; // When there exists anyone's busnum, devnum, and funcnum that are set to 0xff, @@ -131342,7 +130865,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if ((pcipriv->busnumber == 0xff && pcipriv->devnumber == 0xff && pcipriv->funcnumber == 0xff) -@@ -179,12 +177,12 @@ void rtw_pci_disable_aspm(_adapter *pada +@@ -179,12 +177,12 @@ void rtw_pci_disable_aspm(_adapter *padapter) && pcipriv->pcibridge_devnum == 0xff && pcipriv->pcibridge_funcnum == 0xff)) { @@ -131357,7 +130880,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } if (pwrpriv->reg_rfps_level & RT_RF_OFF_LEVL_CLK_REQ) { -@@ -224,7 +222,7 @@ void rtw_pci_disable_aspm(_adapter *pada +@@ -224,7 +222,7 @@ void rtw_pci_disable_aspm(_adapter *padapter) } else { @@ -131366,7 +130889,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release pcicfg_addrport = (pcipriv->pcibridge_busnum << 16) | (pcipriv->pcibridge_devnum << 11) | (pcipriv->pcibridge_funcnum << 8) | (1 << 31); -@@ -236,9 +234,9 @@ void rtw_pci_disable_aspm(_adapter *pada +@@ -236,9 +234,9 @@ void rtw_pci_disable_aspm(_adapter *padapter) // now grab data port with device|vendor 4 byte dword NdisRawWritePortUchar(PCI_CONF_DATA, pcibridge_linkctrlreg); @@ -131379,7 +130902,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release (pcipriv->pcibridge_pciehdr_offset+0x10), pcibridge_linkctrlreg); rtw_udelay_os(50); -@@ -246,13 +244,13 @@ void rtw_pci_disable_aspm(_adapter *pada +@@ -246,13 +244,13 @@ void rtw_pci_disable_aspm(_adapter *padapter) } //[ASPM] @@ -131395,7 +130918,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv; struct pci_priv *pcipriv = &(pdvobjpriv->pcipriv); u16 aspmlevel = 0; -@@ -262,8 +260,8 @@ void rtw_pci_enable_aspm(_adapter *padap +@@ -262,8 +260,8 @@ void rtw_pci_enable_aspm(_adapter *padapter) u8 u_device_aspmsetting = 0; // When there exists anyone's busnum, devnum, and funcnum that are set to 0xff, @@ -131406,7 +130929,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if ((pcipriv->busnumber == 0xff && pcipriv->devnumber == 0xff -@@ -272,12 +270,12 @@ void rtw_pci_enable_aspm(_adapter *padap +@@ -272,12 +270,12 @@ void rtw_pci_enable_aspm(_adapter *padapter) && pcipriv->pcibridge_devnum == 0xff && pcipriv->pcibridge_funcnum == 0xff)) { @@ -131422,7 +130945,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release | (pcipriv->pcibridge_devnum << 11) | (pcipriv->pcibridge_funcnum << 8) | (1 << 31); num4bytes = (pcipriv->pcibridge_pciehdr_offset + 0x10) / 4; -@@ -293,11 +291,11 @@ void rtw_pci_enable_aspm(_adapter *padap +@@ -293,11 +291,11 @@ void rtw_pci_enable_aspm(_adapter *padapter) NdisRawWritePortUchar(PCI_CONF_DATA, u_pcibridge_aspmsetting); @@ -131439,7 +130962,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release u_pcibridge_aspmsetting); rtw_udelay_os(50); -@@ -318,14 +316,14 @@ void rtw_pci_enable_aspm(_adapter *padap +@@ -318,14 +316,14 @@ void rtw_pci_enable_aspm(_adapter *padapter) } // @@ -131456,7 +130979,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release struct pci_priv *pcipriv = &(pdvobjpriv->pcipriv); struct rt_pci_capabilities_header capability_hdr; u8 capability_offset, num4bytes; -@@ -335,7 +333,7 @@ rtw_get_link_control_field(_adapter *pad +@@ -335,7 +333,7 @@ rtw_get_link_control_field(_adapter *padapter, u8 busnum, u8 devnum, //If busnum, devnum, funcnum are set to 0xff. if (busnum == 0xff && devnum == 0xff && funcnum == 0xff) { @@ -131465,7 +130988,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return _FALSE; } -@@ -351,15 +349,15 @@ rtw_get_link_control_field(_adapter *pad +@@ -351,15 +349,15 @@ rtw_get_link_control_field(_adapter *padapter, u8 busnum, u8 devnum, // now grab data port with device|vendor 4 byte dword NdisRawReadPortUchar(PCI_CONF_DATA, &capability_offset); @@ -131484,7 +131007,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release // next capability and continue looping. //4 get capability_hdr -@@ -397,16 +395,16 @@ rtw_get_link_control_field(_adapter *pad +@@ -397,16 +395,16 @@ rtw_get_link_control_field(_adapter *padapter, u8 busnum, u8 devnum, } else { @@ -131558,7 +131081,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return _FALSE; } -@@ -588,7 +586,7 @@ rtw_get_pci_brideg_info(_adapter *padapt +@@ -588,7 +586,7 @@ rtw_get_pci_brideg_info(_adapter *padapter, NdisRawWritePortUlong(PCI_CONF_ADDRESS, pcicfg_addrport + (3 << 2)); NdisRawReadPortUlong(PCI_CONF_DATA, &headertype); headertype = ((headertype >> 16) & 0x0080) >> 7; // address 0x0e[7]. @@ -131567,7 +131090,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release b_singlefunc = _TRUE; } else -@@ -636,7 +634,7 @@ rtw_get_pci_brideg_info(_adapter *padapt +@@ -636,7 +634,7 @@ rtw_get_pci_brideg_info(_adapter *padapter, *vendorid = venId; *deviceid = devId; @@ -131576,7 +131099,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release venId, devId, busnum_idx, devicenum_idx, functionnum_idx); return _TRUE; -@@ -645,18 +643,18 @@ rtw_get_pci_brideg_info(_adapter *padapt +@@ -645,18 +643,18 @@ rtw_get_pci_brideg_info(_adapter *padapter, } } @@ -131598,7 +131121,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release struct pci_priv *pcipriv = &(pdvobjpriv->pcipriv); u8 pcibridge_busnum = 0xff; u8 pcibridge_devnum = 0xff; -@@ -679,11 +677,11 @@ static void rtw_find_bridge_info(_adapte +@@ -679,11 +677,11 @@ static void rtw_find_bridge_info(_adapter *padapter) for (tmp = 0; tmp < PCI_BRIDGE_VENDOR_MAX; tmp++) { if (pcibridge_vendorid == pcibridge_vendors[tmp]) { pcipriv->pcibridge_vendor = tmp; @@ -131612,7 +131135,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release // Update corresponding PCI bus info. pcipriv->pcibridge_busnum = pcibridge_busnum; -@@ -726,7 +724,7 @@ rtw_get_amd_l1_patch(_adapter *padapter, +@@ -726,7 +724,7 @@ rtw_get_amd_l1_patch(_adapter *padapter, u8 busnum, u8 devnum, /*Disable RTL8192SE ASPM & Disable Pci Bridge ASPM*/ void rtw_pci_disable_aspm(_adapter *padapter) { @@ -131621,7 +131144,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv; struct pci_dev *pdev = pdvobjpriv->ppcidev; struct pci_dev *bridge_pdev = pdev->bus->self; -@@ -762,7 +760,7 @@ void rtw_pci_disable_aspm(_adapter *pada +@@ -762,7 +760,7 @@ void rtw_pci_disable_aspm(_adapter *padapter) } { @@ -131630,7 +131153,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release u8 tmp_u1b; pci_read_config_byte(pdev, 0x80, &tmp_u1b); } -@@ -779,14 +777,14 @@ void rtw_pci_disable_aspm(_adapter *pada +@@ -779,14 +777,14 @@ void rtw_pci_disable_aspm(_adapter *padapter) } else { @@ -131649,7 +131172,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release (pcipriv->pcibridge_pciehdr_offset+0x10), pcibridge_linkctrlreg); rtw_udelay_os(50); -@@ -794,18 +792,18 @@ void rtw_pci_disable_aspm(_adapter *pada +@@ -794,18 +792,18 @@ void rtw_pci_disable_aspm(_adapter *padapter) } @@ -131672,7 +131195,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release u8 u_pcibridge_aspmsetting = 0; u8 u_device_aspmsetting = 0; u32 u_device_aspmsupportsetting = 0; -@@ -816,11 +814,11 @@ void rtw_pci_enable_aspm(_adapter *padap +@@ -816,11 +814,11 @@ void rtw_pci_enable_aspm(_adapter *padapter) return; //When there exists anyone's BusNum, DevNum, and FuncNum that are set to 0xff, @@ -131686,7 +131209,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return; } -@@ -834,19 +832,19 @@ void rtw_pci_enable_aspm(_adapter *padap +@@ -834,19 +832,19 @@ void rtw_pci_enable_aspm(_adapter *padapter) //NdisRawWritePortUlong((ULONG_PTR)PCI_CONF_ADDRESS , PciCfgAddrPort+(Num4Bytes << 2)); //NdisRawReadPortUlong((ULONG_PTR)PCI_CONF_DATA,&uDeviceASPMSupportSetting); pci_read_config_dword(bridge_pdev, (pcipriv->pcibridge_pciehdr_offset+0x0C), &u_device_aspmsupportsetting); @@ -131709,7 +131232,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return; } } -@@ -854,7 +852,7 @@ void rtw_pci_enable_aspm(_adapter *padap +@@ -854,7 +852,7 @@ void rtw_pci_enable_aspm(_adapter *padapter) { if((u_device_aspmsupportsetting & BIT(10)) != BIT(10)) { @@ -131718,7 +131241,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return; } -@@ -862,12 +860,12 @@ void rtw_pci_enable_aspm(_adapter *padap +@@ -862,12 +860,12 @@ void rtw_pci_enable_aspm(_adapter *padapter) } else { @@ -131733,7 +131256,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release //PciCfgAddrPort = (pcipriv->pcibridge_busnum << 16)|(pcipriv->pcibridge_devnum<< 11) |(pcipriv->pcibridge_funcnum << 8)|(1 << 31); //Num4Bytes = (pcipriv->pcibridge_pciehdr_offset+0x10)/4; // set up address port at 0xCF8 offset field= 0 (dev|vend) -@@ -884,14 +882,14 @@ void rtw_pci_enable_aspm(_adapter *padap +@@ -884,14 +882,14 @@ void rtw_pci_enable_aspm(_adapter *padapter) //NdisRawWritePortUchar(PCI_CONF_DATA, u_pcibridge_aspmsetting); pci_write_config_byte(bridge_pdev, (pcipriv->pcibridge_pciehdr_offset+0x10), u_pcibridge_aspmsetting); @@ -131752,7 +131275,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release aspmlevel |= pdvobjpriv->const_devicepci_aspm_setting; u_device_aspmsetting = pcipriv->linkctrl_reg; u_device_aspmsetting |= aspmlevel; // device 43 -@@ -906,10 +904,9 @@ void rtw_pci_enable_aspm(_adapter *padap +@@ -906,10 +904,9 @@ void rtw_pci_enable_aspm(_adapter *padapter) rtw_udelay_os(50); } @@ -131765,7 +131288,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release struct pci_dev *bridge_pdev = pdev->bus->self; u8 status = _FALSE; u8 offset_e0; -@@ -934,15 +931,14 @@ static u8 rtw_pci_get_amd_l1_patch(_adap +@@ -934,15 +931,14 @@ static u8 rtw_pci_get_amd_l1_patch(_adapter *padapter) return status; } @@ -131786,7 +131309,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release /*Read Link Control Register*/ pci_read_config_byte(bridge_pdev, capabilityoffset + PCI_EXP_LNKCTL, &linkctrl_reg); -@@ -950,10 +946,10 @@ static void rtw_pci_get_linkcontrol_fiel +@@ -950,10 +946,10 @@ static void rtw_pci_get_linkcontrol_field(_adapter *padapter) } #endif @@ -131800,7 +131323,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release u8 tmp; int pos; u8 linkctrl_reg; -@@ -963,7 +959,7 @@ static void rtw_pci_parse_configuration( +@@ -963,7 +959,7 @@ static void rtw_pci_parse_configuration(struct pci_dev *pdev, _adapter *padapter pci_read_config_byte(pdev, pos + PCI_EXP_LNKCTL, &linkctrl_reg); pcipriv->linkctrl_reg = linkctrl_reg; @@ -131809,7 +131332,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release pci_read_config_byte(pdev, 0x98, &tmp); tmp |= BIT(4); -@@ -978,7 +974,7 @@ static void rtw_pci_parse_configuration( +@@ -978,7 +974,7 @@ static void rtw_pci_parse_configuration(struct pci_dev *pdev, _adapter *padapter // static void rtw_pci_update_default_setting(_adapter *padapter) { @@ -131818,7 +131341,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release struct pci_priv *pcipriv = &(pdvobjpriv->pcipriv); struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv; -@@ -986,8 +982,8 @@ static void rtw_pci_update_default_setti +@@ -986,8 +982,8 @@ static void rtw_pci_update_default_setting(_adapter *padapter) pwrpriv->reg_rfps_level = 0; pwrpriv->b_support_aspm = 0; @@ -131829,7 +131352,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release // Update PCI ASPM setting pwrpriv->const_amdpci_aspm = pdvobjpriv->const_amdpci_aspm; -@@ -1056,7 +1052,7 @@ static void rtw_pci_update_default_setti +@@ -1056,7 +1052,7 @@ static void rtw_pci_update_default_setting(_adapter *padapter) pwrpriv->b_support_aspm = b_support_aspm; /*if(pAdapter->MgntInfo.CustomerID == RT_CID_TOSHIBA && @@ -131838,7 +131361,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release !pcipriv->amd_l1_patch) b_support_backdoor = _FALSE;*/ -@@ -1065,7 +1061,7 @@ static void rtw_pci_update_default_setti +@@ -1065,7 +1061,7 @@ static void rtw_pci_update_default_setting(_adapter *padapter) break; case 2: // Set by Chipset. @@ -131847,16 +131370,16 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if (pcipriv->pcibridge_vendor == PCI_BRIDGE_VENDOR_INTEL) { u8 b_support_aspm = _TRUE; pwrpriv->b_support_aspm = b_support_aspm; -@@ -1098,32 +1094,119 @@ static void rtw_pci_initialize_adapter_c +@@ -1098,32 +1094,119 @@ static void rtw_pci_initialize_adapter_common(_adapter *padapter) static irqreturn_t rtw_pci_interrupt(int irq, void *priv, struct pt_regs *regs) { - _adapter *padapter = (_adapter *)priv; - struct dvobj_priv *pdvobjpriv = &padapter->dvobjpriv; -- + struct dvobj_priv *dvobj = (struct dvobj_priv *)priv; + _adapter *adapter = dvobj->if1; +- - if (pdvobjpriv->irq_enabled == 0) { + if (dvobj->irq_enabled == 0) { return IRQ_HANDLED; @@ -132110,7 +131633,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release venderid = pdev->vendor; -@@ -1261,13 +1367,13 @@ static void decide_chip_type_by_pci_devi +@@ -1261,13 +1367,13 @@ static void decide_chip_type_by_pci_device_id(_adapter *padapter, struct pci_dev // @@ -132126,7 +131649,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release padapter->HardwareType=HARDWARE_TYPE_RTL8185; } else if (deviceid == HAL_HW_PCI_8190_DEVICE_ID || -@@ -1275,7 +1381,7 @@ static void decide_chip_type_by_pci_devi +@@ -1275,7 +1381,7 @@ static void decide_chip_type_by_pci_device_id(_adapter *padapter, struct pci_dev deviceid == HAL_HW_PCI_0046_DEVICE_ID || deviceid == HAL_HW_PCI_DLINK_DEVICE_ID) { @@ -132135,7 +131658,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release padapter->HardwareType = HARDWARE_TYPE_RTL8190P; } else if (deviceid == HAL_HW_PCI_8192_DEVICE_ID || -@@ -1292,19 +1398,19 @@ static void decide_chip_type_by_pci_devi +@@ -1292,19 +1398,19 @@ static void decide_chip_type_by_pci_device_id(_adapter *padapter, struct pci_dev // Added for 92DE. We deferentiate it from SVID,SDID. if( pdev->subsystem_vendor == 0x10EC && pdev->subsystem_device == 0xE020){ padapter->HardwareType = HARDWARE_TYPE_RTL8192DE; @@ -132159,7 +131682,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release padapter->HardwareType = HARDWARE_TYPE_RTL8192SE; break; } -@@ -1312,25 +1418,25 @@ static void decide_chip_type_by_pci_devi +@@ -1312,25 +1418,25 @@ static void decide_chip_type_by_pci_device_id(_adapter *padapter, struct pci_dev } else if(deviceid==HAL_HW_PCI_8723E_DEVICE_ID ) {//RTL8723E may have the same device ID with RTL8192CET @@ -132191,7 +131714,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release //padapter->HardwareType = HAL_DEFAULT_HARDWARE_TYPE; } -@@ -1355,13 +1461,16 @@ static void pci_intf_start(_adapter *pad +@@ -1355,13 +1461,16 @@ static void pci_intf_start(_adapter *padapter) { RT_TRACE(_module_hci_intfs_c_,_drv_err_,("+pci_intf_start\n")); @@ -132211,7 +131734,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } static void pci_intf_stop(_adapter *padapter) -@@ -1373,13 +1482,27 @@ static void pci_intf_stop(_adapter *pada +@@ -1373,13 +1482,27 @@ static void pci_intf_stop(_adapter *padapter) if(padapter->bSurpriseRemoved == _FALSE) { //device still exists, so driver can do i/o operation @@ -132241,7 +131764,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } RT_TRACE(_module_hci_intfs_c_,_drv_err_,("-pci_intf_stop\n")); -@@ -1395,25 +1518,13 @@ static void rtw_dev_unload(_adapter *pad +@@ -1395,25 +1518,13 @@ static void rtw_dev_unload(_adapter *padapter) if(padapter->bup == _TRUE) { @@ -132272,7 +131795,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release //s3. if(padapter->intf_stop) -@@ -1428,7 +1539,7 @@ static void rtw_dev_unload(_adapter *pad +@@ -1428,7 +1539,7 @@ static void rtw_dev_unload(_adapter *padapter) //s5. if(padapter->bSurpriseRemoved == _FALSE) { @@ -132281,7 +131804,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release rtw_hal_deinit(padapter); padapter->bSurpriseRemoved = _TRUE; -@@ -1442,7 +1553,7 @@ static void rtw_dev_unload(_adapter *pad +@@ -1442,7 +1553,7 @@ static void rtw_dev_unload(_adapter *padapter) RT_TRACE(_module_hci_intfs_c_,_drv_err_,("r871x_dev_unload():padapter->bup == _FALSE\n" )); } @@ -132290,7 +131813,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release RT_TRACE(_module_hci_intfs_c_,_drv_err_,("-rtw_dev_unload\n")); -@@ -1475,7 +1586,7 @@ static void disable_ht_for_spec_devid(co +@@ -1475,7 +1586,7 @@ static void disable_ht_for_spec_devid(const struct pci_device_id *pdid) #ifdef CONFIG_PM static int rtw_suspend(struct pci_dev *pdev, pm_message_t state) @@ -132299,7 +131822,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release _func_enter_; -@@ -1489,270 +1600,291 @@ static int rtw_resume(struct pci_dev *pd +@@ -1489,270 +1600,291 @@ static int rtw_resume(struct pci_dev *pdev) _func_exit_; @@ -132360,21 +131883,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - } - bdma64 = _TRUE; - } else -+ padapter->bDriverStopped=_TRUE; -+ -+ dvobj->padapters[dvobj->iface_nums++] = padapter; -+ padapter->iface_id = IFACE_ID0; -+ -+#if defined(CONFIG_CONCURRENT_MODE) || defined(CONFIG_DUALMAC_CONCURRENT) -+ //set adapter_type/iface type for primary padapter -+ padapter->isprimary = _TRUE; -+ padapter->adapter_type = PRIMARY_ADAPTER; -+ #ifndef CONFIG_HWPORT_SWAP -+ padapter->iface_type = IFACE_PORT0; -+ #else -+ padapter->iface_type = IFACE_PORT1; -+ #endif - #endif +-#endif - { - if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) { - if (pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32))) { @@ -132385,11 +131894,24 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - } - } - } -- ++ padapter->bDriverStopped=_TRUE; + - pci_set_master(pdev); -- ++ dvobj->padapters[dvobj->iface_nums++] = padapter; ++ padapter->iface_id = IFACE_ID0; + - //step 0. - disable_ht_for_spec_devid(pdid); ++#if defined(CONFIG_CONCURRENT_MODE) || defined(CONFIG_DUALMAC_CONCURRENT) ++ //set adapter_type/iface type for primary padapter ++ padapter->isprimary = _TRUE; ++ padapter->adapter_type = PRIMARY_ADAPTER; ++ #ifndef CONFIG_HWPORT_SWAP ++ padapter->iface_type = IFACE_PORT0; ++ #else ++ padapter->iface_type = IFACE_PORT1; ++ #endif ++#endif + //step 1-1., decide the chip_type via vid/pid + padapter->interface_type = RTW_PCIE; @@ -132455,10 +131977,10 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - pci_write_config_byte(pdev, 0x04, 0x06); - pci_write_config_byte(pdev, 0x04, 0x07); - - +- - //set interface_type to usb - padapter->interface_type = RTW_PCIE; -- + - //step 1-1., decide the chip_type via vid/pid - decide_chip_type_by_pci_device_id(padapter, pdev); - @@ -132582,6 +132104,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - if (register_netdev(pnetdev) != 0) { - RT_TRACE(_module_hci_intfs_c_,_drv_err_,("register_netdev() failed\n")); - goto error; +- } + DBG_871X("bDriverStopped:%d, bSurpriseRemoved:%d, bup:%d, hw_init_completed:%d\n" + ,padapter->bDriverStopped + ,padapter->bSurpriseRemoved @@ -132617,7 +132140,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + else if (padapter) + rtw_vmfree((u8*)padapter, sizeof(*padapter)); + padapter = NULL; - } ++ } +exit: + return padapter; +} @@ -132700,43 +132223,43 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + + //step 0. + disable_ht_for_spec_devid(did); - -- if (pdvobjpriv->irq_alloc) { -- free_irq(pdev->irq, padapter); -- pdvobjpriv->irq_alloc = 0; ++ + /* Initialize dvobj_priv */ + if ((dvobj = pci_dvobj_init(pdev)) == NULL) { + RT_TRACE(_module_hci_intfs_c_, _drv_err_, ("initialize device object priv Failed!\n")); + goto exit; - } ++ } -- if (pdvobjpriv->pci_mem_start != 0) { -- pci_iounmap(pdev, (void *)pdvobjpriv->pci_mem_start); +- if (pdvobjpriv->irq_alloc) { +- free_irq(pdev->irq, padapter); +- pdvobjpriv->irq_alloc = 0; + /* Initialize if1 */ + if ((if1 = rtw_pci_if1_init(dvobj, pdev, did)) == NULL) { + DBG_871X("rtw_pci_if1_init Failed!\n"); + goto free_dvobj; } -- pci_dvobj_deinit(padapter); +- if (pdvobjpriv->pci_mem_start != 0) { +- pci_iounmap(pdev, (void *)pdvobjpriv->pci_mem_start); + /* Initialize if2 */ +#ifdef CONFIG_CONCURRENT_MODE + if((if2 = rtw_drv_if2_init(if1, pci_set_intf_ops)) == NULL) { + goto free_if1; -+ } + } +#endif -- if (pnetdev) -- { -- //unregister_netdev(pnetdev); -- rtw_free_netdev(pnetdev); +- pci_dvobj_deinit(padapter); +#ifdef CONFIG_GLOBAL_UI_PID + if (ui_pid[1]!=0) { + DBG_871X("ui_pid[1]:%d\n",ui_pid[1]); + rtw_signal_process(ui_pid[1], SIGUSR2); + } +#endif -+ + +- if (pnetdev) +- { +- //unregister_netdev(pnetdev); +- rtw_free_netdev(pnetdev); + //dev_alloc_name && register_netdev + if((status = rtw_drv_register_netdev(if1)) != _SUCCESS) { + goto free_if1; @@ -132754,21 +132277,21 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + DBG_871X("wlan link up\n"); + rtd2885_wlan_netlink_sendMsg("linkup", "8712"); +#endif - -- DBG_8192C("-871x_pci - drv_init, fail!\n"); ++ +#ifdef RTK_DMP_PLATFORM + rtw_proc_init_one(if1->pnetdev); +#endif -+ -+ + +- DBG_8192C("-871x_pci - drv_init, fail!\n"); + +- return err; + /* alloc irq */ + if (pci_alloc_irq(dvobj) != _SUCCESS) + goto free_if2; + + RT_TRACE(_module_hci_intfs_c_,_drv_err_,("-871x_drv - drv_init, success!\n")); + //DBG_871X("-871x_drv - drv_init, success!\n"); - -- return err; ++ + status = _SUCCESS; + +free_if2: @@ -132812,12 +132335,12 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } - DBG_8192C("+rtw_dev_remove\n"); -- ++ rtw_unregister_netdevs(pdvobjpriv); + -#if defined(CONFIG_HAS_EARLYSUSPEND ) || defined(CONFIG_ANDROID_POWER) - rtw_unregister_early_suspend(&padapter->pwrctrlpriv); -#endif -+ rtw_unregister_netdevs(pdvobjpriv); - +- - LeaveAllPowerSaveMode(padapter); - -#ifdef RTK_DMP_PLATFORM @@ -132960,6 +132483,9 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } +diff --git a/drivers/net/wireless/rtl8192cu/os_dep/linux/pci_ops_linux.c b/drivers/net/wireless/rtl8192cu/os_dep/linux/pci_ops_linux.c +new file mode 100644 +index 0000000..7d671df --- /dev/null +++ b/drivers/net/wireless/rtl8192cu/os_dep/linux/pci_ops_linux.c @@ -0,0 +1,24 @@ @@ -132987,6 +132513,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + + + +diff --git a/drivers/net/wireless/rtl8192cu/os_dep/linux/recv_linux.c b/drivers/net/wireless/rtl8192cu/os_dep/linux/recv_linux.c +index 4a76c3f..9c92019 100644 --- a/drivers/net/wireless/rtl8192cu/os_dep/linux/recv_linux.c +++ b/drivers/net/wireless/rtl8192cu/os_dep/linux/recv_linux.c @@ -1,7 +1,7 @@ @@ -133007,7 +132535,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release int res=_SUCCESS; return res; -@@ -43,7 +43,7 @@ int rtw_os_recv_resource_init(struct rec +@@ -43,7 +43,7 @@ int rtw_os_recv_resource_init(struct recv_priv *precvpriv, _adapter *padapter) //alloc os related resource in union recv_frame int rtw_os_recv_resource_alloc(_adapter *padapter, union recv_frame *precvframe) @@ -133016,7 +132544,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release int res=_SUCCESS; precvframe->u.hdr.pkt_newalloc = precvframe->u.hdr.pkt = NULL; -@@ -64,8 +64,8 @@ int rtw_os_recvbuf_resource_alloc(_adapt +@@ -64,8 +64,8 @@ int rtw_os_recvbuf_resource_alloc(_adapter *padapter, struct recv_buf *precvbuf) { int res=_SUCCESS; @@ -133027,7 +132555,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release struct usb_device *pusbd = pdvobjpriv->pusbdev; precvbuf->irp_pending = _FALSE; -@@ -85,9 +85,9 @@ int rtw_os_recvbuf_resource_alloc(_adapt +@@ -85,9 +85,9 @@ int rtw_os_recvbuf_resource_alloc(_adapter *padapter, struct recv_buf *precvbuf) precvbuf->transfer_len = 0; precvbuf->len = 0; @@ -133039,7 +132567,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release precvbuf->pbuf = precvbuf->pallocated_buf; if(precvbuf->pallocated_buf == NULL) return _FAIL; -@@ -95,18 +95,7 @@ int rtw_os_recvbuf_resource_alloc(_adapt +@@ -95,18 +95,7 @@ int rtw_os_recvbuf_resource_alloc(_adapter *padapter, struct recv_buf *precvbuf) #endif //CONFIG_USB_HCI @@ -133058,7 +132586,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } //free os related resource in struct recv_buf -@@ -118,7 +107,7 @@ int rtw_os_recvbuf_resource_free(_adapte +@@ -118,7 +107,7 @@ int rtw_os_recvbuf_resource_free(_adapter *padapter, struct recv_buf *precvbuf) #ifdef CONFIG_USE_USB_BUFFER_ALLOC_RX @@ -133067,7 +132595,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release struct usb_device *pusbd = pdvobjpriv->pusbdev; rtw_usb_buffer_free(pusbd, (size_t)precvbuf->alloc_sz, precvbuf->pallocated_buf, precvbuf->dma_transfer_addr); -@@ -132,13 +121,13 @@ int rtw_os_recvbuf_resource_free(_adapte +@@ -132,13 +121,13 @@ int rtw_os_recvbuf_resource_free(_adapter *padapter, struct recv_buf *precvbuf) //usb_kill_urb(precvbuf->purb); usb_free_urb(precvbuf->purb); } @@ -133084,7 +132612,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return ret; -@@ -151,10 +140,10 @@ void rtw_handle_tkip_mic_err(_adapter *p +@@ -151,10 +140,10 @@ void rtw_handle_tkip_mic_err(_adapter *padapter,u8 bgroup) #endif union iwreq_data wrqu; struct iw_michaelmicfailure ev; @@ -133098,7 +132626,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if( psecuritypriv->last_mic_err_time == 0 ) { psecuritypriv->last_mic_err_time = rtw_get_current_time(); -@@ -192,11 +181,11 @@ void rtw_handle_tkip_mic_err(_adapter *p +@@ -192,11 +181,11 @@ void rtw_handle_tkip_mic_err(_adapter *padapter,u8 bgroup) _rtw_memset( &ev, 0x00, sizeof( ev ) ); if ( bgroup ) { @@ -133112,7 +132640,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } ev.src_addr.sa_family = ARPHRD_ETHER; -@@ -210,47 +199,47 @@ void rtw_handle_tkip_mic_err(_adapter *p +@@ -210,47 +199,47 @@ void rtw_handle_tkip_mic_err(_adapter *padapter,u8 bgroup) void rtw_hostapd_mlme_rx(_adapter *padapter, union recv_frame *precv_frame) { @@ -133177,7 +132705,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release struct recv_priv *precvpriv; _queue *pfree_recv_queue; _pkt *skb; -@@ -265,20 +254,20 @@ int rtw_recv_indicatepkt(_adapter *padap +@@ -265,20 +254,20 @@ int rtw_recv_indicatepkt(_adapter *padapter, union recv_frame *precv_frame) _func_enter_; @@ -133322,7 +132850,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release struct recv_priv *precvpriv = &padapter->recvpriv; #ifdef CONFIG_USB_HCI -@@ -428,7 +414,7 @@ void rtw_os_read_port(_adapter *padapter +@@ -428,7 +414,7 @@ void rtw_os_read_port(_adapter *padapter, struct recv_buf *precvbuf) precvbuf->ref_cnt--; //free skb in recv_buf @@ -133331,7 +132859,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release precvbuf->pskb = NULL; precvbuf->reuse = _FALSE; -@@ -436,8 +422,8 @@ void rtw_os_read_port(_adapter *padapter +@@ -436,8 +422,8 @@ void rtw_os_read_port(_adapter *padapter, struct recv_buf *precvbuf) if(precvbuf->irp_pending == _FALSE) { rtw_read_port(padapter, precvpriv->ff_hwaddr, 0, (unsigned char *)precvbuf); @@ -133342,7 +132870,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #endif #ifdef CONFIG_SDIO_HCI -@@ -457,6 +443,6 @@ void rtw_init_recv_timer(struct recv_reo +@@ -457,6 +443,6 @@ void rtw_init_recv_timer(struct recv_reorder_ctrl *preorder_ctrl) _adapter *padapter = preorder_ctrl->padapter; _init_timer(&(preorder_ctrl->reordering_ctrl_timer), padapter->pnetdev, _rtw_reordering_ctrl_timeout_handler, preorder_ctrl); @@ -133350,6 +132878,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + } +diff --git a/drivers/net/wireless/rtl8192cu/os_dep/linux/rtw_android.c b/drivers/net/wireless/rtl8192cu/os_dep/linux/rtw_android.c +index aceaaa7..a4bb073 100644 --- a/drivers/net/wireless/rtl8192cu/os_dep/linux/rtw_android.c +++ b/drivers/net/wireless/rtl8192cu/os_dep/linux/rtw_android.c @@ -27,15 +27,14 @@ @@ -133370,7 +132900,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release const char *android_wifi_cmd_str[ANDROID_WIFI_CMD_MAX] = { "START", -@@ -71,7 +70,11 @@ const char *android_wifi_cmd_str[ANDROID +@@ -71,7 +70,11 @@ const char *android_wifi_cmd_str[ANDROID_WIFI_CMD_MAX] = { "MACADDR", "BLOCK", @@ -133402,7 +132932,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release /** * Local (static) functions and variables */ -@@ -147,7 +155,7 @@ static int wl_android_set_pno_setup(stru +@@ -147,7 +155,7 @@ static int wl_android_set_pno_setup(struct net_device *dev, char *command, int t DHD_INFO(("%s: command=%s, len=%d\n", __FUNCTION__, command, total_len)); if (total_len < (strlen(CMD_PNOSETUP_SET) + sizeof(cmd_tlv_t))) { @@ -133411,7 +132941,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release goto exit_proc; } -@@ -174,12 +182,12 @@ static int wl_android_set_pno_setup(stru +@@ -174,12 +182,12 @@ static int wl_android_set_pno_setup(struct net_device *dev, char *command, int t if ((nssid = wl_iw_parse_ssid_list_tlv(&str_ptr, ssids_local, MAX_PFN_LIST_COUNT, &tlv_size_left)) <= 0) { @@ -133427,7 +132957,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release goto exit_proc; } str_ptr++; -@@ -188,16 +196,16 @@ static int wl_android_set_pno_setup(stru +@@ -188,16 +196,16 @@ static int wl_android_set_pno_setup(struct net_device *dev, char *command, int t if (str_ptr[0] != 0) { if ((str_ptr[0] != PNO_TLV_FREQ_REPEAT)) { @@ -133448,7 +132978,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release goto exit_proc; } str_ptr++; -@@ -207,7 +215,7 @@ static int wl_android_set_pno_setup(stru +@@ -207,7 +215,7 @@ static int wl_android_set_pno_setup(struct net_device *dev, char *command, int t } } } else { @@ -133457,7 +132987,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release goto exit_proc; } -@@ -251,7 +259,7 @@ int rtw_android_get_link_speed(struct ne +@@ -251,7 +259,7 @@ int rtw_android_get_link_speed(struct net_device *net, char *command, int total_ int bytes_written = 0; u16 link_speed = 0; @@ -133466,7 +132996,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release bytes_written = snprintf(command, total_len, "LinkSpeed %d", link_speed); return bytes_written; -@@ -270,7 +278,7 @@ int rtw_android_set_country(struct net_d +@@ -270,7 +278,7 @@ int rtw_android_set_country(struct net_device *net, char *command, int total_len { _adapter *adapter = (_adapter *)rtw_netdev_priv(net); char *country_code = command + strlen(android_wifi_cmd_str[ANDROID_WIFI_CMD_COUNTRY]) + 1; @@ -133475,7 +133005,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release ret = rtw_set_country(adapter, country_code); -@@ -279,7 +287,6 @@ int rtw_android_set_country(struct net_d +@@ -279,7 +287,6 @@ int rtw_android_set_country(struct net_device *net, char *command, int total_len int rtw_android_get_p2p_dev_addr(struct net_device *net, char *command, int total_len) { @@ -133483,7 +133013,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release int bytes_written = 0; //We use the same address as our HW MAC address -@@ -291,7 +298,6 @@ int rtw_android_get_p2p_dev_addr(struct +@@ -291,7 +298,6 @@ int rtw_android_get_p2p_dev_addr(struct net_device *net, char *command, int tota int rtw_android_set_block(struct net_device *net, char *command, int total_len) { @@ -133491,7 +133021,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release _adapter *adapter = (_adapter *)rtw_netdev_priv(net); char *block_value = command + strlen(android_wifi_cmd_str[ANDROID_WIFI_CMD_BLOCK]) + 1; -@@ -302,6 +308,45 @@ int rtw_android_set_block(struct net_dev +@@ -302,6 +308,45 @@ int rtw_android_set_block(struct net_device *net, char *command, int total_len) return 0; } @@ -133537,7 +133067,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd) { int ret = 0; -@@ -320,14 +365,21 @@ int rtw_android_priv_cmd(struct net_devi +@@ -320,14 +365,21 @@ int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd) ret = -EFAULT; goto exit; } @@ -133561,7 +133091,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release ret = -EFAULT; goto exit; } -@@ -359,10 +411,15 @@ int rtw_android_priv_cmd(struct net_devi +@@ -359,10 +411,15 @@ int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd) break; case ANDROID_WIFI_CMD_SCAN_ACTIVE: @@ -133579,7 +133109,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release break; case ANDROID_WIFI_CMD_RSSI: -@@ -419,11 +476,11 @@ int rtw_android_priv_cmd(struct net_devi +@@ -419,11 +476,11 @@ int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd) break; case ANDROID_WIFI_CMD_SETBAND: @@ -133594,7 +133124,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release break; case ANDROID_WIFI_CMD_COUNTRY: -@@ -467,6 +524,74 @@ int rtw_android_priv_cmd(struct net_devi +@@ -467,6 +524,74 @@ int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd) } #endif //CONFIG_IOCTL_CFG80211 @@ -133696,7 +133226,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release static int g_wifidev_registered = 0; static struct semaphore wifi_control_sem; -@@ -516,14 +641,14 @@ static struct resource *wifi_irqres = NU +@@ -516,14 +641,14 @@ static struct resource *wifi_irqres = NULL; static int wifi_add_dev(void); static void wifi_del_dev(void); @@ -133729,7 +133259,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { if (g_wifidev_registered) { -@@ -552,14 +677,14 @@ void *wl_android_prealloc(int section, u +@@ -552,14 +677,14 @@ void *wl_android_prealloc(int section, unsigned long size) if (wifi_control_data && wifi_control_data->mem_prealloc) { alloc_ptr = wifi_control_data->mem_prealloc(section, size); if (alloc_ptr) { @@ -133747,7 +133277,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release return NULL; } -@@ -578,7 +703,7 @@ int wifi_get_irq_number(unsigned long *i +@@ -578,7 +703,7 @@ int wifi_get_irq_number(unsigned long *irq_flags_ptr) int wifi_set_power(int on, unsigned long msec) { @@ -133756,7 +133286,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if (wifi_control_data && wifi_control_data->set_power) { wifi_control_data->set_power(on); } -@@ -590,7 +715,7 @@ int wifi_set_power(int on, unsigned long +@@ -590,7 +715,7 @@ int wifi_set_power(int on, unsigned long msec) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35)) int wifi_get_mac_addr(unsigned char *buf) { @@ -133765,7 +133295,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if (!buf) return -EINVAL; if (wifi_control_data && wifi_control_data->get_mac_addr) { -@@ -600,10 +725,10 @@ int wifi_get_mac_addr(unsigned char *buf +@@ -600,10 +725,10 @@ int wifi_get_mac_addr(unsigned char *buf) } #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35)) */ @@ -133787,7 +133317,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if (wifi_control_data && wifi_control_data->set_carddetect) { wifi_control_data->set_carddetect(on); } -@@ -627,7 +752,7 @@ static int wifi_probe(struct platform_de +@@ -627,7 +752,7 @@ static int wifi_probe(struct platform_device *pdev) struct wifi_platform_data *wifi_ctrl = (struct wifi_platform_data *)(pdev->dev.platform_data); @@ -133796,7 +133326,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release wifi_irqres = platform_get_resource_byname(pdev, IORESOURCE_IRQ, "bcmdhd_wlan_irq"); if (wifi_irqres == NULL) wifi_irqres = platform_get_resource_byname(pdev, -@@ -646,7 +771,7 @@ static int wifi_remove(struct platform_d +@@ -646,7 +771,7 @@ static int wifi_remove(struct platform_device *pdev) struct wifi_platform_data *wifi_ctrl = (struct wifi_platform_data *)(pdev->dev.platform_data); @@ -133805,7 +133335,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release wifi_control_data = wifi_ctrl; wifi_set_power(0, 0); /* Power Off */ -@@ -658,7 +783,7 @@ static int wifi_remove(struct platform_d +@@ -658,7 +783,7 @@ static int wifi_remove(struct platform_device *pdev) static int wifi_suspend(struct platform_device *pdev, pm_message_t state) { @@ -133814,7 +133344,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #if (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 39)) && defined(OOB_INTR_ONLY) bcmsdh_oob_intr_set(0); #endif -@@ -667,7 +792,7 @@ static int wifi_suspend(struct platform_ +@@ -667,7 +792,7 @@ static int wifi_suspend(struct platform_device *pdev, pm_message_t state) static int wifi_resume(struct platform_device *pdev) { @@ -133823,7 +133353,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #if (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 39)) && defined(OOB_INTR_ONLY) if (dhd_os_check_if_up(bcmsdh_get_drvdata())) bcmsdh_oob_intr_set(1); -@@ -675,6 +800,7 @@ static int wifi_resume(struct platform_d +@@ -675,6 +800,7 @@ static int wifi_resume(struct platform_device *pdev) return 0; } @@ -133831,7 +133361,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release static struct platform_driver wifi_device = { .probe = wifi_probe, .remove = wifi_remove, -@@ -697,7 +823,7 @@ static struct platform_driver wifi_devic +@@ -697,7 +823,7 @@ static struct platform_driver wifi_device_legacy = { static int wifi_add_dev(void) { @@ -133852,6 +133382,9 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release -#endif /* defined(CONFIG_WIFI_CONTROL_FUNC) */ +#endif /* defined(RTW_ENABLE_WIFI_CONTROL_FUNC) */ +diff --git a/drivers/net/wireless/rtl8192cu/os_dep/linux/sdio_intf.c b/drivers/net/wireless/rtl8192cu/os_dep/linux/sdio_intf.c +deleted file mode 100644 +index 52faefc..0000000 --- a/drivers/net/wireless/rtl8192cu/os_dep/linux/sdio_intf.c +++ /dev/null @@ -1,922 +0,0 @@ @@ -134777,6 +134310,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - -module_init(r8712s_drv_entry); -module_exit(r8712s_drv_halt); +diff --git a/drivers/net/wireless/rtl8192cu/os_dep/linux/usb_intf.c b/drivers/net/wireless/rtl8192cu/os_dep/linux/usb_intf.c +index 2e54e74..4c1089a 100644 --- a/drivers/net/wireless/rtl8192cu/os_dep/linux/usb_intf.c +++ b/drivers/net/wireless/rtl8192cu/os_dep/linux/usb_intf.c @@ -1,7 +1,7 @@ @@ -134816,7 +134351,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release static int rtw_drv_init(struct usb_interface *pusb_intf,const struct usb_device_id *pdid); -@@ -70,117 +69,142 @@ static void rtw_dev_remove(struct usb_in +@@ -70,117 +69,142 @@ static void rtw_dev_remove(struct usb_interface *pusb_intf); #define USB_VENDER_ID_REALTEK 0x0BDA @@ -135029,10 +134564,6 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release +#ifndef CONFIG_RTL8192C + #undef RTL8192C_USB_IDS + #define RTL8192C_USB_IDS -+#endif -+#ifndef CONFIG_RTL8192D -+ #undef RTL8192D_USB_IDS -+ #define RTL8192D_USB_IDS #endif -#ifdef CONFIG_RTL8192D - /*=== Realtek demoboard ===*/ @@ -135052,10 +134583,14 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - - /****** 8192DU-VS ********/ - {USB_DEVICE(0x20F4, 0x664B)},//TRENDnet - +- - /****** 8192DU-WiFi Display Dongle ********/ - {USB_DEVICE(0x2019, 0xAB2D)},//Planex - Abocom ,5G dongle for WiFi Display --#endif ++#ifndef CONFIG_RTL8192D ++ #undef RTL8192D_USB_IDS ++ #define RTL8192D_USB_IDS + #endif ++ + +static struct usb_device_id rtw_usb_id_tbl[] ={ + RTL8192C_USB_IDS @@ -135066,7 +134601,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release int const rtw_usb_id_len = sizeof(rtw_usb_id_tbl) / sizeof(struct usb_device_id); -@@ -189,7 +213,7 @@ static struct specific_device_id specifi +@@ -189,7 +213,7 @@ static struct specific_device_id specific_device_id_tbl[] = { {.idVendor=USB_VENDER_ID_REALTEK, .idProduct=0x817E, .flags=SPEC_DEV_ID_DISABLE_HT},//8188CE-VAU USB minCard (b/g mode only) {.idVendor=0x0b05, .idProduct=0x1791, .flags=SPEC_DEV_ID_DISABLE_HT}, {.idVendor=0x13D3, .idProduct=0x3311, .flags=SPEC_DEV_ID_DISABLE_HT}, @@ -135075,7 +134610,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #ifdef RTK_DMP_PLATFORM {.idVendor=USB_VENDER_ID_REALTEK, .idProduct=0x8111, .flags=SPEC_DEV_ID_ASSIGN_IFNAME}, // Realtek 5G dongle for WiFi Display {.idVendor=0x2019, .idProduct=0xAB2D, .flags=SPEC_DEV_ID_ASSIGN_IFNAME}, // PCI-Abocom 5G dongle for WiFi Display -@@ -197,31 +221,86 @@ static struct specific_device_id specifi +@@ -197,31 +221,86 @@ static struct specific_device_id specific_device_id_tbl[] = { {} }; @@ -135138,14 +134673,14 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + #ifdef CONFIG_AUTOSUSPEND + .usbdrv.supports_autosuspend = 1, + #endif -+ + + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19)) + .usbdrv.drvwrap.driver.shutdown = rtw_dev_shutdown, + #else + .usbdrv.driver.shutdown = rtw_dev_shutdown, + #endif +}; - ++ +static struct rtw_usb_drv *usb_drv = &rtl8192c_usb_drv; +#endif /* CONFIG_RTL8192C */ + @@ -135180,7 +134715,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release static inline int RT_usb_endpoint_dir_in(const struct usb_endpoint_descriptor *epd) { -@@ -263,58 +342,54 @@ static inline int RT_usb_endpoint_num(co +@@ -263,58 +342,54 @@ static inline int RT_usb_endpoint_num(const struct usb_endpoint_descriptor *epd) return epd->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK; } @@ -135262,7 +134797,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release struct usb_device_descriptor *pdev_desc; struct usb_host_config *phost_conf; struct usb_config_descriptor *pconf_desc; -@@ -322,78 +397,78 @@ static u32 usb_dvobj_init(_adapter *pada +@@ -322,78 +397,78 @@ static u32 usb_dvobj_init(_adapter *padapter) struct usb_interface_descriptor *piface_desc; struct usb_host_endpoint *phost_endp; struct usb_endpoint_descriptor *pendp_desc; @@ -135469,22 +135004,22 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release //.3 misc - _rtw_init_sema(&(padapter->dvobjpriv.usb_suspend_sema), 0); + _rtw_init_sema(&(pdvobjpriv->usb_suspend_sema), 0); ++ ++ rtw_reset_continual_urb_error(pdvobjpriv); - intf_read_chip_version(padapter); -+ rtw_reset_continual_urb_error(pdvobjpriv); ++ usb_get_dev(pusbd); - //.4 usb endpoint mapping - intf_chip_configure(padapter); -+ usb_get_dev(pusbd); ++ //DBG_871X("%s %d\n", __func__, ATOMIC_READ(&usb_intf->dev.kobj.kref.refcount)); - rtw_reset_continual_urb_error(pdvobjpriv); - -_func_exit_; -+ //DBG_871X("%s %d\n", __func__, ATOMIC_READ(&usb_intf->dev.kobj.kref.refcount)); ++ status = _SUCCESS; - return status; -+ status = _SUCCESS; -+ +free_dvobj: + if (status != _SUCCESS && pdvobjpriv) { + usb_set_intfdata(usb_intf, NULL); @@ -135576,7 +135111,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } static void usb_intf_stop(_adapter *padapter) -@@ -541,10 +609,7 @@ static void usb_intf_stop(_adapter *pada +@@ -541,10 +609,7 @@ static void usb_intf_stop(_adapter *padapter) } //cancel in irp @@ -135588,7 +135123,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release //cancel out irp rtw_write_port_cancel(padapter); -@@ -563,9 +628,13 @@ static void rtw_dev_unload(_adapter *pad +@@ -563,9 +628,13 @@ static void rtw_dev_unload(_adapter *padapter) if(padapter->bup == _TRUE) { @@ -135603,7 +135138,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release //s3. if(padapter->intf_stop) -@@ -574,20 +643,20 @@ static void rtw_dev_unload(_adapter *pad +@@ -574,20 +643,20 @@ static void rtw_dev_unload(_adapter *padapter) } //s4. @@ -135630,7 +135165,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { rtw_hal_deinit(padapter); } -@@ -595,14 +664,16 @@ static void rtw_dev_unload(_adapter *pad +@@ -595,14 +664,16 @@ static void rtw_dev_unload(_adapter *padapter) } padapter->bup = _FALSE; @@ -135649,7 +135184,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release RT_TRACE(_module_hci_intfs_c_,_drv_err_,("-rtw_dev_unload\n")); -@@ -636,8 +707,8 @@ static void process_spec_devid(const str +@@ -636,8 +707,8 @@ static void process_spec_devid(const struct usb_device_id *pdid) if((pdid->idVendor==vid) && (pdid->idProduct==pid) && (flags&SPEC_DEV_ID_ASSIGN_IFNAME)) { extern char* ifname; @@ -135660,7 +135195,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } #endif /* RTK_DMP_PLATFORM */ -@@ -645,29 +716,26 @@ static void process_spec_devid(const str +@@ -645,29 +716,26 @@ static void process_spec_devid(const struct usb_device_id *pdid) } #ifdef SUPPORT_HW_RFOFF_DETECTED @@ -135853,13 +135388,23 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - padapter->bup, padapter->bDriverStopped,padapter->bSurpriseRemoved); - return 0; - } -- ++ DBG_871X("padapter->bup=%d bDriverStopped=%d bSurpriseRemoved = %d\n", ++ padapter->bup, padapter->bDriverStopped,padapter->bSurpriseRemoved); ++ goto exit; ++ } + - DBG_8192C("########### rtw_suspend #################\n"); - - if(padapter)//system suspend - { - if(pwrpriv->bInternalAutoSuspend ) -- { ++ if(pwrpriv->bInternalAutoSuspend ) ++ { ++ #ifdef CONFIG_AUTOSUSPEND ++ #ifdef SUPPORT_HW_RFOFF_DETECTED ++ // The FW command register update must after MAC and FW init ready. ++ if((padapter->bFWReady) && ( padapter->pwrctrlpriv.bHWPwrPindetect ) && (padapter->registrypriv.usbss_enable )) + { - #ifdef CONFIG_AUTOSUSPEND - #ifdef SUPPORT_HW_RFOFF_DETECTED - // The FW command register update must after MAC and FW init ready. @@ -135871,39 +135416,28 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - } - #endif - #endif -- } ++ u8 bOpen = _TRUE; ++ rtw_interface_ps_func(padapter,HAL_USB_SELECT_SUSPEND,&bOpen); ++ //rtl8192c_set_FwSelectSuspend_cmd(padapter,_TRUE ,500);//note fw to support hw power down ping detect + } - pwrpriv->bInSuspend = _TRUE; - rtw_cancel_all_timer(padapter); - LeaveAllPowerSaveMode(padapter); -+ DBG_871X("padapter->bup=%d bDriverStopped=%d bSurpriseRemoved = %d\n", -+ padapter->bup, padapter->bDriverStopped,padapter->bSurpriseRemoved); -+ goto exit; ++ #endif ++ #endif + } ++ pwrpriv->bInSuspend = _TRUE; ++ rtw_cancel_all_timer(padapter); ++ LeaveAllPowerSaveMode(padapter); - _enter_pwrlock(&pwrpriv->lock); - //padapter->net_closed = _TRUE; - //s1. - if(pnetdev) -+ if(pwrpriv->bInternalAutoSuspend ) -+ { -+ #ifdef CONFIG_AUTOSUSPEND -+ #ifdef SUPPORT_HW_RFOFF_DETECTED -+ // The FW command register update must after MAC and FW init ready. -+ if((padapter->bFWReady) && ( padapter->pwrctrlpriv.bHWPwrPindetect ) && (padapter->registrypriv.usbss_enable )) - { +- { - netif_carrier_off(pnetdev); - netif_stop_queue(pnetdev); -+ u8 bOpen = _TRUE; -+ rtw_interface_ps_func(padapter,HAL_USB_SELECT_SUSPEND,&bOpen); -+ //rtl8192c_set_FwSelectSuspend_cmd(padapter,_TRUE ,500);//note fw to support hw power down ping detect - } -+ #endif -+ #endif -+ } -+ pwrpriv->bInSuspend = _TRUE; -+ rtw_cancel_all_timer(padapter); -+ LeaveAllPowerSaveMode(padapter); -+ +- } + rtw_stop_cmd_thread(padapter); + + _enter_pwrlock(&pwrpriv->lock); @@ -136369,7 +135903,9 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release _adapter *padapter = NULL; - struct dvobj_priv *pdvobjpriv; - struct net_device *pnetdev; -- ++ struct net_device *pnetdev = NULL; ++ int status = _FAIL; + - RT_TRACE(_module_hci_intfs_c_, _drv_err_, ("+rtw_drv_init\n")); - //DBG_8192C("+rtw_drv_init\n"); - @@ -136377,9 +135913,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - // In this probe function, O.S. will provide the usb interface pointer to driver. - // We have to increase the reference count of the usb device structure by using the usb_get_dev function. - usb_get_dev(interface_to_usbdev(pusb_intf)); -+ struct net_device *pnetdev = NULL; -+ int status = _FAIL; - +- - //step 0. - process_spec_devid(pdid); - @@ -136402,17 +135936,17 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - pdvobjpriv->padapter = padapter; - pdvobjpriv->pusbintf = pusb_intf ; - pdvobjpriv->pusbdev = interface_to_usbdev(pusb_intf); - +- -#ifdef CONFIG_IOCTL_CFG80211 - rtw_wdev_alloc(padapter, &pusb_intf->dev); -#endif //CONFIG_IOCTL_CFG80211 - -+ dvobj->padapters[dvobj->iface_nums++] = padapter; -+ padapter->iface_id = IFACE_ID0; - // set data - usb_set_intfdata(pusb_intf, pnetdev); -- ++ dvobj->padapters[dvobj->iface_nums++] = padapter; ++ padapter->iface_id = IFACE_ID0; + - //set interface_type to usb - padapter->interface_type = RTW_USB; +#if defined(CONFIG_CONCURRENT_MODE) || defined(CONFIG_DUALMAC_CONCURRENT) @@ -136534,7 +136068,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } #endif #endif -@@ -1232,101 +1262,204 @@ static int rtw_drv_init(struct usb_inter +@@ -1232,101 +1262,204 @@ static int rtw_drv_init(struct usb_interface *pusb_intf, const struct usb_device { if(padapter->registrypriv.usbss_enable ){ /* autosuspend (2s delay) */ #if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,38)) @@ -136599,7 +136133,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + rtw_wdev_unregister(padapter->rtw_wdev); + rtw_wdev_free(padapter->rtw_wdev); + #endif - } ++ } +handle_dualmac: + if (status != _SUCCESS) + rtw_handle_dualmac(padapter, 0); @@ -136613,7 +136147,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + else if (padapter) + rtw_vmfree((u8*)padapter, sizeof(*padapter)); + padapter = NULL; -+ } + } +exit: + return padapter; +} @@ -136669,8 +136203,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - rtd2885_wlan_netlink_sendMsg("linkup", "8712"); + DBG_871X("wlan link down\n"); + rtd2885_wlan_netlink_sendMsg("linkdown", "8712"); -+#endif -+ + #endif + +} + +/* @@ -136723,8 +136257,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + } + } +#endif //CONFIG_MULTI_VIR_IFACES - #endif - ++#endif ++ +#ifdef CONFIG_INTEL_PROXIM + rtw_sw_export=if1; +#endif @@ -136810,13 +136344,10 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release _func_exit_; - usb_set_intfdata(pusb_intf, NULL); -+ DBG_871X("+rtw_dev_remove\n"); -+ RT_TRACE(_module_hci_intfs_c_,_drv_err_,("+dev_remove()\n")); - +- - if(padapter) - { -+ dvobj->processing_dev_remove = _TRUE; - +- -#ifdef CONFIG_IOCTL_CFG80211 - struct wireless_dev *wdev = padapter->rtw_wdev; -#endif //CONFIG_IOCTL_CFG80211 @@ -136827,11 +136358,13 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - rtw_unregister_early_suspend(&padapter->pwrctrlpriv); -#endif - LeaveAllPowerSaveMode(padapter); -+ rtw_unregister_netdevs(dvobj); ++ DBG_871X("+rtw_dev_remove\n"); ++ RT_TRACE(_module_hci_intfs_c_,_drv_err_,("+dev_remove()\n")); - if(check_fwstate(pmlmepriv, _FW_LINKED)) - disconnect_hdl(padapter, NULL); -- ++ dvobj->processing_dev_remove = _TRUE; + - if(drvpriv.drv_registered == _TRUE) - { - //DBG_8192C("r871xu_dev_remove():padapter->bSurpriseRemoved == _TRUE\n"); @@ -136842,7 +136375,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - //DBG_8192C("r871xu_dev_remove():module removed\n"); - padapter->hw_init_completed = _FALSE; - }*/ -- ++ rtw_unregister_netdevs(dvobj); + -#ifdef CONFIG_AP_MODE - free_mlme_ap_info(padapter); -#ifdef CONFIG_HOSTAPD_MLME @@ -136965,7 +136499,6 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release tmp |= 0x55; writel(tmp,(volatile unsigned int*)0xb801a608);//write dummy register for 1055 #endif -- +#ifdef CONFIG_PLATFORM_ARM_SUNxI +#ifndef CONFIG_RTL8723A + int ret = 0; @@ -136989,7 +136522,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + printk("ERR: script_get_item wifi_usbc_id failed\n"); + return -ENOMEM; + } -+ + + printk("sw_usb_enable_hcd: usbc_num = %d\n", item.val); + wifi_pm_power(1); + mdelay(10); @@ -137096,6 +136629,9 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release _adapter *rtw_usb_get_sw_pointer(void) { return rtw_sw_export; +diff --git a/drivers/net/wireless/rtl8192cu/os_dep/linux/usb_ops_linux.c b/drivers/net/wireless/rtl8192cu/os_dep/linux/usb_ops_linux.c +new file mode 100644 +index 0000000..f54cfb4 --- /dev/null +++ b/drivers/net/wireless/rtl8192cu/os_dep/linux/usb_ops_linux.c @@ -0,0 +1,649 @@ @@ -137748,6 +137284,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + } +} + +diff --git a/drivers/net/wireless/rtl8192cu/os_dep/linux/xmit_linux.c b/drivers/net/wireless/rtl8192cu/os_dep/linux/xmit_linux.c +index 02eec93..9105e29 100644 --- a/drivers/net/wireless/rtl8192cu/os_dep/linux/xmit_linux.c +++ b/drivers/net/wireless/rtl8192cu/os_dep/linux/xmit_linux.c @@ -16,7 +16,7 @@ @@ -137759,7 +137297,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #define _XMIT_OSDEP_C_ #include -@@ -98,11 +98,11 @@ void rtw_set_tx_chksum_offload(_pkt *pkt +@@ -98,11 +98,11 @@ void rtw_set_tx_chksum_offload(_pkt *pkt, struct pkt_attrib *pattrib) const struct iphdr *ip = ip_hdr(skb); if (ip->protocol == IPPROTO_TCP) { // TCP checksum offload by HW @@ -137773,7 +137311,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #if 1 skb_checksum_help(skb); #else -@@ -111,12 +111,12 @@ void rtw_set_tx_chksum_offload(_pkt *pkt +@@ -111,12 +111,12 @@ void rtw_set_tx_chksum_offload(_pkt *pkt, struct pkt_attrib *pattrib) udp->check = 0; #endif } else { @@ -137788,7 +137326,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release skb_checksum_help(skb); } } -@@ -128,11 +128,11 @@ int rtw_os_xmit_resource_alloc(_adapter +@@ -128,11 +128,11 @@ int rtw_os_xmit_resource_alloc(_adapter *padapter, struct xmit_buf *pxmitbuf,u32 { #ifdef CONFIG_USB_HCI int i; @@ -137802,7 +137340,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release pxmitbuf->pbuf = pxmitbuf->pallocated_buf; if(pxmitbuf->pallocated_buf == NULL) return _FAIL; -@@ -154,13 +154,13 @@ int rtw_os_xmit_resource_alloc(_adapter +@@ -154,13 +154,13 @@ int rtw_os_xmit_resource_alloc(_adapter *padapter, struct xmit_buf *pxmitbuf,u32 pxmitbuf->pxmit_urb[i] = usb_alloc_urb(0, GFP_KERNEL); if(pxmitbuf->pxmit_urb[i] == NULL) { @@ -137818,7 +137356,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release pxmitbuf->pallocated_buf = rtw_zmalloc(alloc_sz); if (pxmitbuf->pallocated_buf == NULL) { -@@ -177,7 +177,7 @@ void rtw_os_xmit_resource_free(_adapter +@@ -177,7 +177,7 @@ void rtw_os_xmit_resource_free(_adapter *padapter, struct xmit_buf *pxmitbuf,u32 { #ifdef CONFIG_USB_HCI int i; @@ -137827,7 +137365,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release struct usb_device *pusbd = pdvobjpriv->pusbdev; -@@ -193,14 +193,14 @@ void rtw_os_xmit_resource_free(_adapter +@@ -193,14 +193,14 @@ void rtw_os_xmit_resource_free(_adapter *padapter, struct xmit_buf *pxmitbuf,u32 #ifdef CONFIG_USE_USB_BUFFER_ALLOC_TX rtw_usb_buffer_free(pusbd, (size_t)free_sz, pxmitbuf->pallocated_buf, pxmitbuf->dma_transfer_addr); pxmitbuf->pallocated_buf = NULL; @@ -137844,7 +137382,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release if(pxmitbuf->pallocated_buf) rtw_mfree(pxmitbuf->pallocated_buf, free_sz); #endif -@@ -208,39 +208,58 @@ void rtw_os_xmit_resource_free(_adapter +@@ -208,39 +208,58 @@ void rtw_os_xmit_resource_free(_adapter *padapter, struct xmit_buf *pxmitbuf,u32 void rtw_os_pkt_complete(_adapter *padapter, _pkt *pkt) { @@ -137912,7 +137450,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } -@@ -254,6 +273,12 @@ int rtw_mlcst2unicst(_adapter *padapter, +@@ -254,6 +273,12 @@ int rtw_mlcst2unicst(_adapter *padapter, struct sk_buff *skb) _list *phead, *plist; struct sk_buff *newskb; struct sta_info *psta = NULL; @@ -137925,7 +137463,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release s32 res; _enter_critical_bh(&pstapriv->asoc_list_lock, &irqL); -@@ -261,45 +286,54 @@ int rtw_mlcst2unicst(_adapter *padapter, +@@ -261,45 +286,54 @@ int rtw_mlcst2unicst(_adapter *padapter, struct sk_buff *skb) plist = get_next(phead); //free sta asoc_queue @@ -137997,7 +137535,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release { _adapter *padapter = (_adapter *)rtw_netdev_priv(pnetdev); struct xmit_priv *pxmitpriv = &padapter->xmitpriv; -@@ -308,7 +342,9 @@ int rtw_xmit_entry(_pkt *pkt, _nic_hdl p +@@ -308,7 +342,9 @@ int rtw_xmit_entry(_pkt *pkt, _nic_hdl pnetdev) extern int rtw_mc2u_disable; #endif // CONFIG_TX_MCAST2UNI s32 res = 0; @@ -138059,6 +137597,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + return _rtw_xmit_entry(pkt, pnetdev); +} + +diff --git a/drivers/net/wireless/rtl8192cu/os_dep/osdep_service.c b/drivers/net/wireless/rtl8192cu/os_dep/osdep_service.c +index 343cd82..e73a068 100644 --- a/drivers/net/wireless/rtl8192cu/os_dep/osdep_service.c +++ b/drivers/net/wireless/rtl8192cu/os_dep/osdep_service.c @@ -25,8 +25,13 @@ @@ -138076,7 +137616,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #ifdef RTK_DMP_PLATFORM #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,12)) #include -@@ -66,6 +71,27 @@ inline int RTW_STATUS_CODE(int error_cod +@@ -66,6 +71,27 @@ inline int RTW_STATUS_CODE(int error_code){ } #endif @@ -138125,7 +137665,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release #ifdef PLATFORM_WINDOWS NdisAllocateMemoryWithTag(&pbuf,sz, RT_TAG); if (pbuf != NULL) -@@ -113,7 +144,9 @@ inline void _rtw_vmfree(u8 *pbuf, u32 sz +@@ -113,7 +144,9 @@ inline void _rtw_vmfree(u8 *pbuf, u32 sz) #ifdef PLATFORM_LINUX vfree(pbuf); #endif @@ -138208,7 +137748,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + skb->end = (unsigned char*)data + size; + skb->len = 0; + //printf("%s()-%d: skb=%p, skb->head = %p\n", __FUNCTION__, __LINE__, skb, skb->head); -+ + +-#ifdef DBG_MEM_ALLOC +out: + return skb; +nodata: @@ -138271,7 +137812,11 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + return skb_clone(skb); +#endif /* PLATFORM_FREEBSD */ +} -+ + +-struct rtw_dbg_mem_stat { +- ATOMIC_T vir_alloc; // the memory bytes we allocate now +- ATOMIC_T vir_peak; // the peak memory bytes we allocate +- ATOMIC_T vir_alloc_err; // the error times we fail to allocate memory +inline int _rtw_netif_rx(_nic_hdl ndev, struct sk_buff *skb) +{ +#ifdef PLATFORM_LINUX @@ -138302,7 +137847,19 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + return usb_buffer_alloc(dev, size, (in_interrupt() ? GFP_ATOMIC : GFP_KERNEL), dma); +#endif +#endif /* PLATFORM_LINUX */ -+ + +- ATOMIC_T phy_alloc; +- ATOMIC_T phy_peak; +- ATOMIC_T phy_alloc_err; +-} rtw_dbg_mem_stat; +- +-enum { +- MEM_STAT_VIR_ALLOC_SUCCESS, +- MEM_STAT_VIR_ALLOC_FAIL, +- MEM_STAT_VIR_FREE, +- MEM_STAT_PHY_ALLOC_SUCCESS, +- MEM_STAT_PHY_ALLOC_FAIL, +- MEM_STAT_PHY_FREE +#ifdef PLATFORM_FREEBSD + return (malloc(size, M_USBDEV, M_NOWAIT | M_ZERO)); +#endif /* PLATFORM_FREEBSD */ @@ -138322,33 +137879,17 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release +#endif /* PLATFORM_FREEBSD */ +} +#endif /* CONFIG_USB_HCI */ - - #ifdef DBG_MEM_ALLOC - --struct rtw_dbg_mem_stat { -- ATOMIC_T vir_alloc; // the memory bytes we allocate now -- ATOMIC_T vir_peak; // the peak memory bytes we allocate -- ATOMIC_T vir_alloc_err; // the error times we fail to allocate memory -- -- ATOMIC_T phy_alloc; -- ATOMIC_T phy_peak; -- ATOMIC_T phy_alloc_err; --} rtw_dbg_mem_stat; -- --enum { -- MEM_STAT_VIR_ALLOC_SUCCESS, -- MEM_STAT_VIR_ALLOC_FAIL, -- MEM_STAT_VIR_FREE, -- MEM_STAT_PHY_ALLOC_SUCCESS, -- MEM_STAT_PHY_ALLOC_FAIL, -- MEM_STAT_PHY_FREE ++ ++#ifdef DBG_MEM_ALLOC ++ +struct rtw_mem_stat { + ATOMIC_T alloc; // the memory bytes we allocate currently + ATOMIC_T peak; // the peak memory bytes we allocate + ATOMIC_T alloc_cnt; // the alloc count for alloc currently + ATOMIC_T alloc_err_cnt; // the error times we fail to allocate memory -+}; -+ + }; + +-void rtw_dump_mem_stat (void) +struct rtw_mem_stat rtw_mem_type_stat[mstat_tf_idx(MSTAT_TYPE_MAX)]; +struct rtw_mem_stat rtw_mem_func_stat[mstat_ff_idx(MSTAT_FUNC_MAX)]; + @@ -138357,9 +137898,8 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release + "PHY", + "SKB", + "USB", - }; - --void rtw_dump_mem_stat (void) ++}; ++ +char *MSTAT_FUNC_str[] = { + "UNSP", + "IO", @@ -138380,25 +137920,23 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release - vir_alloc=ATOMIC_READ(&rtw_dbg_mem_stat.vir_alloc); - vir_peak=ATOMIC_READ(&rtw_dbg_mem_stat.vir_peak); - vir_alloc_err=ATOMIC_READ(&rtw_dbg_mem_stat.vir_alloc_err); -- ++ int vir_alloc, vir_peak, vir_alloc_err, phy_alloc, phy_peak, phy_alloc_err; ++ int tx_alloc, tx_peak, tx_alloc_err, rx_alloc, rx_peak, rx_alloc_err; + - phy_alloc=ATOMIC_READ(&rtw_dbg_mem_stat.phy_alloc); - phy_peak=ATOMIC_READ(&rtw_dbg_mem_stat.phy_peak); - phy_alloc_err=ATOMIC_READ(&rtw_dbg_mem_stat.phy_alloc_err); -- -- DBG_871X("vir_alloc:%d, vir_peak:%d,vir_alloc_err:%d, phy_alloc:%d, phy_peak:%d, phy_alloc_err:%d\n" -- , vir_alloc, vir_peak, vir_alloc_err -- , phy_alloc, phy_peak, phy_alloc_err -- ); -+ int vir_alloc, vir_peak, vir_alloc_err, phy_alloc, phy_peak, phy_alloc_err; -+ int tx_alloc, tx_peak, tx_alloc_err, rx_alloc, rx_peak, rx_alloc_err; -+ + for(i=0;iold_pnetdev=cur_pnetdev; -@@ -1488,21 +2032,7 @@ int rtw_change_ifname(_adapter *padapter +@@ -1488,21 +2032,7 @@ int rtw_change_ifname(_adapter *padapter, const char *ifname) goto error; } @@ -139541,7 +139079,7 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release rtw_init_netdev_name(pnetdev, ifname); -@@ -1520,9 +2050,7 @@ int rtw_change_ifname(_adapter *padapter +@@ -1520,9 +2050,7 @@ int rtw_change_ifname(_adapter *padapter, const char *ifname) goto error; } @@ -139801,6 +139339,9 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release } -#endif +diff --git a/drivers/net/wireless/rtl8192cu/runwpa b/drivers/net/wireless/rtl8192cu/runwpa +new file mode 100755 +index 0000000..f825e8b --- /dev/null +++ b/drivers/net/wireless/rtl8192cu/runwpa @@ -0,0 +1,20 @@ @@ -139824,3 +139365,9 @@ Subject: [PATCH 097/174] wifi: Update to newer rtl8192cu driver release +fi + + +diff --git a/drivers/net/wireless/rtl8192cu/wlan0dhcp b/drivers/net/wireless/rtl8192cu/wlan0dhcp +old mode 100644 +new mode 100755 +-- +1.9.1 + -- cgit v1.2.3