├── include ├── cmn_info │ └── .svn │ │ ├── entries │ │ ├── format │ │ ├── wc.db-journal │ │ └── wc.db ├── Hal8821APwrSeq.h ├── rtw_version.h ├── gspi_ops_linux.h ├── drv_types_linux.h ├── rtl8821cs_hal.h ├── rtl8723d_rf.h ├── rtl8821ce_hal.h ├── circ_buf.h ├── h2clbk.h ├── rtl8188f_rf.h ├── rtl8703b_rf.h ├── rtl8723b_rf.h ├── rtl8821c_dm.h ├── rtl8821cu_hal.h ├── rtl8814a_dm.h ├── rtl8192e_rf.h ├── rtl8812a_rf.h ├── rtl8814a_rf.h ├── hal_phy_reg.h ├── rtl8188e_sreset.h ├── rtl8188f_sreset.h ├── rtl8192e_sreset.h ├── rtl8703b_sreset.h ├── rtl8723b_sreset.h ├── rtl8723d_sreset.h ├── rtl8812a_sreset.h ├── rtl8814a_sreset.h ├── gspi_osintf.h ├── sdio_osintf.h ├── rtw_ioctl_query.h ├── rtw_btcoex_wifionly.h ├── usb_osintf.h ├── rtl8188e_rf.h ├── gspi_hal.h ├── rtl8822be_hal.h ├── rtl8812a_dm.h ├── rtl8188e_dm.h ├── rtl8192e_dm.h ├── rtw_wifi_regd.h ├── cmd_osdep.h ├── rtl8822bs_hal.h ├── rtw_sdio.h ├── hal_gspi.h ├── rtw_byteorder.h ├── mlme_osdep.h ├── rtw_mem.h ├── nic_spec.h ├── custom_gpio.h ├── hal_sdio.h ├── rtl8192e_led.h ├── rtl8188e_led.h ├── sdio_hal.h ├── pci_hal.h ├── rtl8723b_dm.h ├── drv_types_gspi.h ├── rtl8188f_dm.h ├── rtl8703b_dm.h ├── rtl8723d_dm.h ├── rtl8814a_led.h ├── rtl8812a_led.h ├── ethernet.h ├── rtl8188f_led.h ├── rtl8723b_led.h ├── rtl8723d_led.h ├── rtl8703b_led.h ├── pci_osintf.h ├── sdio_ops_xp.h ├── sdio_ops_ce.h ├── usb_hal.h ├── rtw_sreset.h ├── rtl8822bu_hal.h ├── usb_vendor_req.h ├── rtw_br_ext.h ├── rtw_qos.h ├── hal_btcoex_wifionly.h ├── rtl8188f_recv.h ├── rtw_rson.h ├── recv_osdep.h ├── sdio_ops_linux.h ├── drv_types_ce.h └── drv_types_sdio.h ├── core ├── rtw_cmd.c └── rtw_btcoex_wifionly.c ├── hal ├── btc │ ├── halbtc8812a2ant.c │ ├── halbtc8821a2ant.c │ ├── halbtc8723bwifionly.h │ ├── halbtc8822bwifionly.h │ ├── halbtc8822bwifionly.c │ └── mp_precomp.h ├── phydm │ ├── halrf │ │ ├── halrf_txgapcal.h │ │ ├── halrf_features.h │ │ ├── halrf_powertracking.h │ │ └── halrf_iqk.h │ ├── phydm_beamforming.c │ ├── mp_precomp.h │ ├── rtl8192e │ │ ├── phydm_rtl8192e.h │ │ ├── phydm_rtl8192e.c │ │ ├── version_rtl8192e.h │ │ ├── halhwimg8192e_mac.h │ │ ├── halhwimg8192e_bb.h │ │ └── phydm_regconfig8192e.h │ ├── phydm_noisemonitor.h │ ├── phydm_features.h │ ├── txbf │ │ ├── phydm_hal_txbf_api.h │ │ ├── haltxbf8192e.h │ │ ├── haltxbfjaguar.h │ │ ├── haltxbf8822b.h │ │ └── haltxbf8814a.h │ ├── phydm_cfotracking.h │ ├── phydm_math_lib.h │ ├── phydm_psd.h │ ├── phydm_rssi_monitor.h │ ├── phydm_pow_train.h │ ├── phydm_antdect.h │ ├── phydm_cck_pd.h │ └── phydm_hwconfig.h ├── rtl8192e │ ├── usb │ │ ├── usb_halinit.c │ │ └── rtl8192eu_recv.c │ ├── rtl8192e_hal_init.c │ └── hal8192e_fw.h ├── efuse │ └── rtl8192e │ │ ├── HalEfuseMask8192E_SDIO.h │ │ ├── HalEfuseMask8192E_USB.h │ │ ├── HalEfuseMask8192E_PCIE.h │ │ ├── HalEfuseMask8192E_PCIE.c │ │ ├── HalEfuseMask8192E_SDIO.c │ │ └── HalEfuseMask8192E_USB.c └── hal_dm.h ├── Kconfig ├── .gitignore ├── rtl8192eu-toggle-monitor.desktop ├── docs ├── TROUBLESHOOTING.md ├── OPTIONAL.md ├── NETWORKMANAGER.md ├── BUILD_FOR_NETHUNTER.md └── MODES.md ├── platform ├── platform_ops.h ├── platform_ops.c ├── platform_RTK_DMP_usb.c ├── custom_country_chplan.h ├── platform_arm_act_sdio.c ├── platform_ARM_WMT_sdio.c ├── platform_sprd_sdio.c └── platform_ARM_SUN50IW1P1_sdio.c ├── LICENSE ├── os_dep └── linux │ └── rtw_proc.h ├── README.md └── scripts └── build.sh /include/cmn_info/.svn/entries: -------------------------------------------------------------------------------- 1 | 12 2 | -------------------------------------------------------------------------------- /include/cmn_info/.svn/format: -------------------------------------------------------------------------------- 1 | 12 2 | -------------------------------------------------------------------------------- /include/cmn_info/.svn/wc.db-journal: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /core/rtw_cmd.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimplyCEO/rtl8192eu/HEAD/core/rtw_cmd.c -------------------------------------------------------------------------------- /include/Hal8821APwrSeq.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimplyCEO/rtl8192eu/HEAD/include/Hal8821APwrSeq.h -------------------------------------------------------------------------------- /hal/btc/halbtc8812a2ant.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimplyCEO/rtl8192eu/HEAD/hal/btc/halbtc8812a2ant.c -------------------------------------------------------------------------------- /hal/btc/halbtc8821a2ant.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimplyCEO/rtl8192eu/HEAD/hal/btc/halbtc8821a2ant.c -------------------------------------------------------------------------------- /hal/phydm/halrf/halrf_txgapcal.h: -------------------------------------------------------------------------------- 1 | void 2 | odm_tx_gain_gap_calibration( 3 | void *p_dm_void 4 | ); 5 | 6 | -------------------------------------------------------------------------------- /hal/phydm/phydm_beamforming.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimplyCEO/rtl8192eu/HEAD/hal/phydm/phydm_beamforming.c -------------------------------------------------------------------------------- /include/cmn_info/.svn/wc.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimplyCEO/rtl8192eu/HEAD/include/cmn_info/.svn/wc.db -------------------------------------------------------------------------------- /hal/rtl8192e/usb/usb_halinit.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimplyCEO/rtl8192eu/HEAD/hal/rtl8192e/usb/usb_halinit.c -------------------------------------------------------------------------------- /hal/rtl8192e/rtl8192e_hal_init.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimplyCEO/rtl8192eu/HEAD/hal/rtl8192e/rtl8192e_hal_init.c -------------------------------------------------------------------------------- /include/rtw_version.h: -------------------------------------------------------------------------------- 1 | #define DRIVERVERSION "v5.2.19.1_25633.20171222_COEX20171113-0047" 2 | #define BTCOEXVERSION "COEX20171113-0047" 3 | -------------------------------------------------------------------------------- /Kconfig: -------------------------------------------------------------------------------- 1 | config RTL8192EU 2 | tristate "Realtek 8192E USB WiFi" 3 | depends on USB 4 | ---help--- 5 | Help message of RTL8192EU 6 | 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Build 2 | build/ 3 | 4 | # Raw build 5 | *.mod 6 | *.mod.c 7 | *.o 8 | *.o.d 9 | .*.cmd 10 | *.ko 11 | Module.symvers 12 | Module.markers 13 | modules.order 14 | .tmp_versions 15 | -------------------------------------------------------------------------------- /rtl8192eu-toggle-monitor.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Type=Application 3 | Version=1.0 4 | Name=rtl8192eu toggle 5 | GenericName=rtl8192eu toggle 6 | Comment=Toggle to and from monitor mode 7 | Exec=toggle-monitor 8 | Terminal=true 9 | Categories=Application;Utility;Network; 10 | StartupNotify=true 11 | -------------------------------------------------------------------------------- /docs/TROUBLESHOOTING.md: -------------------------------------------------------------------------------- 1 | # Troubleshooting 2 | · If your system is old, you can check your device's interface by running `iw dev info` or `ip address | grep `.
3 | · "NetworkManager.conf" is normally located under `/etc/NetworkManager/NetworkManager.conf`.
4 | · You **need** your linux headers installed in order to build this driver.
5 | 6 | [Scripts](./OPTIONAL.md) | [Main page](../../..) 7 | -------------------------------------------------------------------------------- /docs/OPTIONAL.md: -------------------------------------------------------------------------------- 1 | toggle-monitor 2 | ============== 3 | 4 | With this, the toggle script will appear in your DE's menu. Under `Accessories` and `Internet`. 5 | ```sh 6 | cp toggle-monitor.sh /usr/local/bin/toggle-monitor 7 | chown $USER:$USER /usr/local/bin/toggle-monitor 8 | chmod +x /usr/local/bin/toggle-monitor 9 | cp rtl8192eu-toggle-monitor.desktop /usr/share/applications 10 | ``` 11 | 12 | [NetworkManager configuration](./NETWORKMANAGER.md) | [Troubleshooting](./TROUBLESHOOTING.md) 13 | -------------------------------------------------------------------------------- /docs/NETWORKMANAGER.md: -------------------------------------------------------------------------------- 1 | NetworkManager Configuration 2 | ============================ 3 | 4 | Copy "NetworkManager.conf" to "NetworkManager.conf.bak" to create a backup.
5 | Add these lines below to "NetworkManager.conf" and ADD YOUR ADAPTER MAC below `[keyfile]`.
6 | This will make the Network-Manager ignore the device, and therefore don't cause problems. 7 | 8 | ```sh 9 | [device] 10 | wifi.scan-rand-mac-address=no 11 | 12 | [ifupdown] 13 | managed=false 14 | 15 | [connection] 16 | wifi.powersave=0 17 | 18 | [main] 19 | plugins=keyfile 20 | 21 | [keyfile] 22 | unmanaged-devices=A0:B1:C2:D3:E4:F5 23 | ``` 24 | 25 | [Enabling/Disabling monitor mode](./MODES.md) | [Scripts](./OPTIONAL.md) 26 | -------------------------------------------------------------------------------- /hal/phydm/mp_precomp.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | -------------------------------------------------------------------------------- /include/gspi_ops_linux.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef __SDIO_OPS_LINUX_H__ 16 | #define __SDIO_OPS_LINUX_H__ 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /include/drv_types_linux.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef __DRV_TYPES_LINUX_H__ 16 | #define __DRV_TYPES_LINUX_H__ 17 | 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /hal/phydm/rtl8192e/phydm_rtl8192e.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef __ODM_RTL8192E_H__ 16 | #define __ODM_RTL8192E_H__ 17 | 18 | 19 | 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /hal/btc/halbtc8723bwifionly.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2016 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef __INC_HAL8723BWIFIONLYHWCFG_H 16 | #define __INC_HAL8723BWIFIONLYHWCFG_H 17 | 18 | VOID 19 | ex_hal8723b_wifi_only_hw_config( 20 | IN struct wifi_only_cfg *pwifionlycfg 21 | ); 22 | #endif 23 | -------------------------------------------------------------------------------- /include/rtl8821cs_hal.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2016 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef _RTL8821CS_HAL_H_ 16 | #define _RTL8821CS_HAL_H_ 17 | 18 | #include /* PADAPTER */ 19 | 20 | /* rtl8821cs_ops.c */ 21 | u8 rtl8821cs_set_hal_ops(PADAPTER); 22 | 23 | #endif /* _RTL8821CS_HAL_H_ */ 24 | -------------------------------------------------------------------------------- /include/rtl8723d_rf.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef __RTL8723D_RF_H__ 16 | #define __RTL8723D_RF_H__ 17 | 18 | int PHY_RF6052_Config8723D(IN PADAPTER pdapter); 19 | 20 | void PHY_RF6052SetBandwidth8723D(IN PADAPTER Adapter, IN enum channel_width Bandwidth); 21 | #endif 22 | -------------------------------------------------------------------------------- /include/rtl8821ce_hal.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2016 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef _RTL8821CE_HAL_H_ 16 | #define _RTL8821CE_HAL_H_ 17 | 18 | #include /* PADAPTER */ 19 | 20 | /* rtl8821ce_ops.c */ 21 | void rtl8821ce_set_hal_ops(PADAPTER); 22 | 23 | #endif /* _RTL8821CE_HAL_H_ */ 24 | -------------------------------------------------------------------------------- /include/circ_buf.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef __CIRC_BUF_H_ 16 | #define __CIRC_BUF_H_ 1 17 | 18 | #define CIRC_CNT(head,tail,size) (((head) - (tail)) & ((size)-1)) 19 | 20 | #define CIRC_SPACE(head,tail,size) CIRC_CNT((tail),((head)+1),(size)) 21 | 22 | #endif //_CIRC_BUF_H_ 23 | 24 | -------------------------------------------------------------------------------- /include/h2clbk.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | 16 | 17 | #define _H2CLBK_H_ 18 | 19 | 20 | void _lbk_cmd(PADAPTER Adapter); 21 | 22 | void _lbk_rsp(PADAPTER Adapter); 23 | 24 | void _lbk_evt(IN PADAPTER Adapter); 25 | 26 | void h2c_event_callback(unsigned char *dev, unsigned char *pbuf); 27 | -------------------------------------------------------------------------------- /hal/phydm/rtl8192e/phydm_rtl8192e.c: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | 16 | /* ************************************************************ 17 | * include files 18 | * ************************************************************ */ 19 | 20 | #include "mp_precomp.h" 21 | #include "../phydm_precomp.h" 22 | 23 | -------------------------------------------------------------------------------- /include/rtl8188f_rf.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef __RTL8188F_RF_H__ 16 | #define __RTL8188F_RF_H__ 17 | 18 | int PHY_RF6052_Config8188F(IN PADAPTER Adapter); 19 | 20 | VOID 21 | PHY_RF6052SetBandwidth8188F( 22 | IN PADAPTER Adapter, 23 | IN enum channel_width Bandwidth); 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /include/rtl8703b_rf.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef __RTL8703B_RF_H__ 16 | #define __RTL8703B_RF_H__ 17 | 18 | int PHY_RF6052_Config8703B(IN PADAPTER Adapter); 19 | 20 | VOID 21 | PHY_RF6052SetBandwidth8703B( 22 | IN PADAPTER Adapter, 23 | IN enum channel_width Bandwidth); 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /include/rtl8723b_rf.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef __RTL8723B_RF_H__ 16 | #define __RTL8723B_RF_H__ 17 | 18 | int PHY_RF6052_Config8723B(IN PADAPTER Adapter); 19 | 20 | VOID 21 | PHY_RF6052SetBandwidth8723B( 22 | IN PADAPTER Adapter, 23 | IN enum channel_width Bandwidth); 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /include/rtl8821c_dm.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2016 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef __RTL8812C_DM_H__ 16 | #define __RTL8812C_DM_H__ 17 | 18 | void rtl8821c_phy_init_dm_priv(PADAPTER); 19 | void rtl8821c_phy_deinit_dm_priv(PADAPTER); 20 | void rtl8821c_phy_init_haldm(PADAPTER); 21 | void rtl8821c_phy_haldm_watchdog(PADAPTER); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /include/rtl8821cu_hal.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2016 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef _RTL8821CU_HAL_H_ 16 | #define _RTL8821CU_HAL_H_ 17 | 18 | #include /* PADAPTER */ 19 | 20 | /* rtl8821cu_ops.c */ 21 | u8 rtl8821cu_set_hal_ops(PADAPTER); 22 | void rtl8821cu_set_hw_type(struct dvobj_priv *pdvobj); 23 | 24 | #endif /* _RTL8821CU_HAL_H_ */ 25 | -------------------------------------------------------------------------------- /platform/platform_ops.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2013 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef __PLATFORM_OPS_H__ 16 | #define __PLATFORM_OPS_H__ 17 | 18 | /* 19 | * Return: 20 | * 0: power on successfully 21 | * others: power on failed 22 | */ 23 | int platform_wifi_power_on(void); 24 | void platform_wifi_power_off(void); 25 | 26 | #endif /* __PLATFORM_OPS_H__ */ 27 | -------------------------------------------------------------------------------- /include/rtl8814a_dm.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef __RTL8814A_DM_H__ 16 | #define __RTL8814A_DM_H__ 17 | 18 | void rtl8814_init_dm_priv(IN PADAPTER Adapter); 19 | void rtl8814_deinit_dm_priv(IN PADAPTER Adapter); 20 | void rtl8814_InitHalDm(IN PADAPTER Adapter); 21 | void rtl8814_HalDmWatchDog(IN PADAPTER Adapter); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /include/rtl8192e_rf.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2012 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef __RTL8192E_RF_H__ 16 | #define __RTL8192E_RF_H__ 17 | 18 | VOID 19 | PHY_RF6052SetBandwidth8192E( 20 | IN PADAPTER Adapter, 21 | IN enum channel_width Bandwidth); 22 | 23 | 24 | int 25 | PHY_RF6052_Config_8192E( 26 | IN PADAPTER Adapter); 27 | 28 | #endif/* __RTL8192E_RF_H__ */ 29 | -------------------------------------------------------------------------------- /include/rtl8812a_rf.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef __RTL8812A_RF_H__ 16 | #define __RTL8812A_RF_H__ 17 | 18 | VOID 19 | PHY_RF6052SetBandwidth8812( 20 | IN PADAPTER Adapter, 21 | IN enum channel_width Bandwidth); 22 | 23 | 24 | int 25 | PHY_RF6052_Config_8812( 26 | IN PADAPTER Adapter); 27 | 28 | #endif/* __RTL8188E_RF_H__ */ 29 | -------------------------------------------------------------------------------- /include/rtl8814a_rf.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef __RTL8814A_RF_H__ 16 | #define __RTL8814A_RF_H__ 17 | 18 | VOID 19 | PHY_RF6052SetBandwidth8814A( 20 | IN PADAPTER Adapter, 21 | IN enum channel_width Bandwidth); 22 | 23 | 24 | int 25 | PHY_RF6052_Config_8814A( 26 | IN PADAPTER Adapter); 27 | 28 | #endif/* __RTL8188E_RF_H__ */ 29 | -------------------------------------------------------------------------------- /include/hal_phy_reg.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef __HAL_PHY_REG_H__ 16 | #define __HAL_PHY_REG_H__ 17 | 18 | /* for PutRFRegsetting & GetRFRegSetting BitMask 19 | * #if (RTL92SE_FPGA_VERIFY == 1) 20 | * #define bRFRegOffsetMask 0xfff 21 | * #else */ 22 | #define bRFRegOffsetMask 0xfffff 23 | /* #endif */ 24 | 25 | #endif /* __HAL_PHY_REG_H__ */ 26 | -------------------------------------------------------------------------------- /include/rtl8188e_sreset.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef _RTL8188E_SRESET_H_ 16 | #define _RTL8188E_SRESET_H_ 17 | 18 | #include 19 | 20 | #ifdef DBG_CONFIG_ERROR_DETECT 21 | extern void rtl8188e_sreset_xmit_status_check(_adapter *padapter); 22 | extern void rtl8188e_sreset_linked_status_check(_adapter *padapter); 23 | #endif 24 | #endif 25 | -------------------------------------------------------------------------------- /include/rtl8188f_sreset.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef _RTL8188F_SRESET_H_ 16 | #define _RTL8188F_SRESET_H_ 17 | 18 | #include 19 | 20 | #ifdef DBG_CONFIG_ERROR_DETECT 21 | extern void rtl8188f_sreset_xmit_status_check(_adapter *padapter); 22 | extern void rtl8188f_sreset_linked_status_check(_adapter *padapter); 23 | #endif 24 | #endif 25 | -------------------------------------------------------------------------------- /include/rtl8192e_sreset.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2012 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef _RTL88812A_SRESET_H_ 16 | #define _RTL8812A_SRESET_H_ 17 | 18 | #include 19 | 20 | #ifdef DBG_CONFIG_ERROR_DETECT 21 | extern void rtl8192e_sreset_xmit_status_check(_adapter *padapter); 22 | extern void rtl8192e_sreset_linked_status_check(_adapter *padapter); 23 | #endif 24 | #endif 25 | -------------------------------------------------------------------------------- /include/rtl8703b_sreset.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef _RTL8703B_SRESET_H_ 16 | #define _RTL8703B_SRESET_H_ 17 | 18 | #include 19 | 20 | #ifdef DBG_CONFIG_ERROR_DETECT 21 | extern void rtl8703b_sreset_xmit_status_check(_adapter *padapter); 22 | extern void rtl8703b_sreset_linked_status_check(_adapter *padapter); 23 | #endif 24 | #endif 25 | -------------------------------------------------------------------------------- /include/rtl8723b_sreset.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef _RTL8723B_SRESET_H_ 16 | #define _RTL8723B_SRESET_H_ 17 | 18 | #include 19 | 20 | #ifdef DBG_CONFIG_ERROR_DETECT 21 | extern void rtl8723b_sreset_xmit_status_check(_adapter *padapter); 22 | extern void rtl8723b_sreset_linked_status_check(_adapter *padapter); 23 | #endif 24 | #endif 25 | -------------------------------------------------------------------------------- /include/rtl8723d_sreset.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef _RTL8723D_SRESET_H_ 16 | #define _RTL8723D_SRESET_H_ 17 | 18 | #include 19 | 20 | #ifdef DBG_CONFIG_ERROR_DETECT 21 | extern void rtl8723d_sreset_xmit_status_check(_adapter *padapter); 22 | extern void rtl8723d_sreset_linked_status_check(_adapter *padapter); 23 | #endif 24 | #endif 25 | -------------------------------------------------------------------------------- /include/rtl8812a_sreset.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef _RTL88812A_SRESET_H_ 16 | #define _RTL8812A_SRESET_H_ 17 | 18 | #include 19 | 20 | #ifdef DBG_CONFIG_ERROR_DETECT 21 | extern void rtl8812_sreset_xmit_status_check(_adapter *padapter); 22 | extern void rtl8812_sreset_linked_status_check(_adapter *padapter); 23 | #endif 24 | #endif 25 | -------------------------------------------------------------------------------- /include/rtl8814a_sreset.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef _RTL88814A_SRESET_H_ 16 | #define _RTL8814A_SRESET_H_ 17 | 18 | #include 19 | 20 | #ifdef DBG_CONFIG_ERROR_DETECT 21 | extern void rtl8814_sreset_xmit_status_check(_adapter *padapter); 22 | extern void rtl8814_sreset_linked_status_check(_adapter *padapter); 23 | #endif 24 | #endif 25 | -------------------------------------------------------------------------------- /include/gspi_osintf.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef __SDIO_OSINTF_H__ 16 | #define __SDIO_OSINTF_H__ 17 | 18 | 19 | #ifdef PLATFORM_OS_CE 20 | extern NDIS_STATUS ce_sd_get_dev_hdl(PADAPTER padapter); 21 | SD_API_STATUS ce_sd_int_callback(SD_DEVICE_HANDLE hDevice, PADAPTER padapter); 22 | extern void sd_setup_irs(PADAPTER padapter); 23 | #endif 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /include/sdio_osintf.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef __SDIO_OSINTF_H__ 16 | #define __SDIO_OSINTF_H__ 17 | 18 | 19 | #ifdef PLATFORM_OS_CE 20 | extern NDIS_STATUS ce_sd_get_dev_hdl(PADAPTER padapter); 21 | SD_API_STATUS ce_sd_int_callback(SD_DEVICE_HANDLE hDevice, PADAPTER padapter); 22 | extern void sd_setup_irs(PADAPTER padapter); 23 | #endif 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /platform/platform_ops.c: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2013 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef CONFIG_PLATFORM_OPS 16 | /* 17 | * Return: 18 | * 0: power on successfully 19 | * others: power on failed 20 | */ 21 | int platform_wifi_power_on(void) 22 | { 23 | int ret = 0; 24 | 25 | 26 | return ret; 27 | } 28 | 29 | void platform_wifi_power_off(void) 30 | { 31 | } 32 | #endif /* !CONFIG_PLATFORM_OPS */ 33 | -------------------------------------------------------------------------------- /include/rtw_ioctl_query.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef _RTW_IOCTL_QUERY_H_ 16 | #define _RTW_IOCTL_QUERY_H_ 17 | 18 | 19 | #ifdef PLATFORM_WINDOWS 20 | u8 query_802_11_capability(_adapter *padapter, u8 *pucBuf, u32 *pulOutLen); 21 | u8 query_802_11_association_information(_adapter *padapter, PNDIS_802_11_ASSOCIATION_INFORMATION pAssocInfo); 22 | #endif 23 | 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /include/rtw_btcoex_wifionly.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2013 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef __RTW_BTCOEX_WIFIONLY_H__ 16 | #define __RTW_BTCOEX_WIFIONLY_H__ 17 | 18 | void rtw_btcoex_wifionly_switchband_notify(PADAPTER padapter); 19 | void rtw_btcoex_wifionly_scan_notify(PADAPTER padapter); 20 | void rtw_btcoex_wifionly_hw_config(PADAPTER padapter); 21 | void rtw_btcoex_wifionly_initialize(PADAPTER padapter); 22 | #endif 23 | -------------------------------------------------------------------------------- /include/usb_osintf.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef __USB_OSINTF_H 16 | #define __USB_OSINTF_H 17 | 18 | #include 19 | 20 | #define USBD_HALTED(Status) ((ULONG)(Status) >> 30 == 3) 21 | 22 | 23 | u8 usbvendorrequest(struct dvobj_priv *pdvobjpriv, RT_USB_BREQUEST brequest, RT_USB_WVALUE wvalue, u8 windex, void *data, u8 datalen, u8 isdirectionin); 24 | 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /include/rtl8188e_rf.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef __RTL8188E_RF_H__ 16 | #define __RTL8188E_RF_H__ 17 | 18 | 19 | 20 | int PHY_RF6052_Config8188E(IN PADAPTER Adapter); 21 | void rtl8188e_RF_ChangeTxPath(IN PADAPTER Adapter, 22 | IN u16 DataRate); 23 | void rtl8188e_PHY_RF6052SetBandwidth( 24 | IN PADAPTER Adapter, 25 | IN enum channel_width Bandwidth); 26 | 27 | #endif/* __RTL8188E_RF_H__ */ 28 | -------------------------------------------------------------------------------- /hal/phydm/rtl8192e/version_rtl8192e.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2016 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | /*RTL8192E PHY Parameters*/ 16 | /* 17 | [Caution] 18 | Since 01/Aug/2015, the commit rules will be simplified. 19 | You do not need to fill up the version.h anymore, 20 | only the maintenance supervisor fills it before formal release. 21 | */ 22 | #define RELEASE_DATE_8192E 20160314 23 | #define COMMIT_BY_8192E "BB_DINO" 24 | #define RELEASE_VERSION_8192E 58 25 | -------------------------------------------------------------------------------- /hal/rtl8192e/usb/rtl8192eu_recv.c: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2012 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #define _RTL8192E_RECV_C_ 16 | 17 | /* #include */ 18 | #include 19 | 20 | int rtl8192eu_init_recv_priv(_adapter *padapter) 21 | { 22 | return usb_init_recv_priv(padapter, INTERRUPT_MSG_FORMAT_LEN); 23 | } 24 | 25 | void rtl8192eu_free_recv_priv(_adapter *padapter) 26 | { 27 | usb_free_recv_priv(padapter, INTERRUPT_MSG_FORMAT_LEN); 28 | } 29 | -------------------------------------------------------------------------------- /platform/platform_RTK_DMP_usb.c: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2013 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #include 16 | 17 | int platform_wifi_power_on(void) 18 | { 19 | int ret = 0; 20 | u32 tmp; 21 | tmp = readl((volatile unsigned int *)0xb801a608); 22 | tmp &= 0xffffff00; 23 | tmp |= 0x55; 24 | writel(tmp, (volatile unsigned int *)0xb801a608); /* write dummy register for 1055 */ 25 | return ret; 26 | } 27 | 28 | void platform_wifi_power_off(void) 29 | { 30 | } 31 | -------------------------------------------------------------------------------- /include/gspi_hal.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef __GSPI_HAL_H__ 16 | #define __GSPI_HAL_H__ 17 | 18 | 19 | void spi_int_dpc(PADAPTER padapter, u32 sdio_hisr); 20 | u8 rtw_set_hal_ops(_adapter *padapter); 21 | 22 | #ifdef CONFIG_RTL8188E 23 | void rtl8188es_set_hal_ops(PADAPTER padapter); 24 | #endif 25 | 26 | #ifdef CONFIG_RTL8723B 27 | void rtl8723bs_set_hal_ops(PADAPTER padapter); 28 | #endif 29 | 30 | #endif /* __GSPI_HAL_H__ */ 31 | -------------------------------------------------------------------------------- /include/rtl8822be_hal.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2015 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef _RTL8822BE_HAL_H_ 16 | #define _RTL8822BE_HAL_H_ 17 | 18 | #include /* PADAPTER */ 19 | 20 | #define RT_BCN_INT_MASKS (BIT20 | BIT25 | BIT26 | BIT16) 21 | 22 | /* rtl8822be_ops.c */ 23 | void UpdateInterruptMask8822BE(PADAPTER, u32 AddMSR, u32 AddMSR1, u32 RemoveMSR, u32 RemoveMSR1); 24 | u16 get_txbd_rw_reg(u16 q_idx); 25 | 26 | 27 | #endif /* _RTL8822BE_HAL_H_ */ 28 | -------------------------------------------------------------------------------- /hal/phydm/halrf/halrf_features.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | 16 | #ifndef __HALRF_FEATURES_H__ 17 | #define __HALRF_FEATURES 18 | 19 | #if (DM_ODM_SUPPORT_TYPE == ODM_WIN) 20 | 21 | #define CONFIG_HALRF_POWERTRACKING 1 22 | 23 | #elif (DM_ODM_SUPPORT_TYPE == ODM_AP) 24 | 25 | #define CONFIG_HALRF_POWERTRACKING 1 26 | 27 | #elif (DM_ODM_SUPPORT_TYPE == ODM_CE) 28 | 29 | #define CONFIG_HALRF_POWERTRACKING 1 30 | 31 | #endif 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Juan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /platform/custom_country_chplan.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2013 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | 16 | #error "You have defined CONFIG_CUSTOMIZED_COUNTRY_CHPLAN_MAP to use a customized map of your own instead of the default one" 17 | #error "Before removing these error notifications, please make sure regulatory certification requirements of your target markets" 18 | 19 | static const struct country_chplan CUSTOMIZED_country_chplan_map[] = { 20 | COUNTRY_CHPLAN_ENT("TW", 0x76, 1, 0x3FF), /* Taiwan */ 21 | }; 22 | 23 | -------------------------------------------------------------------------------- /include/rtl8812a_dm.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef __RTL8812A_DM_H__ 16 | #define __RTL8812A_DM_H__ 17 | 18 | void rtl8812_init_dm_priv(IN PADAPTER Adapter); 19 | void rtl8812_deinit_dm_priv(IN PADAPTER Adapter); 20 | void rtl8812_InitHalDm(IN PADAPTER Adapter); 21 | void rtl8812_HalDmWatchDog(IN PADAPTER Adapter); 22 | 23 | /* VOID rtl8192c_dm_CheckTXPowerTracking(IN PADAPTER Adapter); */ 24 | 25 | /* void rtl8192c_dm_RF_Saving(IN PADAPTER pAdapter, IN u8 bForceInNormal); */ 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /include/rtl8188e_dm.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef __RTL8188E_DM_H__ 16 | #define __RTL8188E_DM_H__ 17 | 18 | void rtl8188e_init_dm_priv(IN PADAPTER Adapter); 19 | void rtl8188e_deinit_dm_priv(IN PADAPTER Adapter); 20 | void rtl8188e_InitHalDm(IN PADAPTER Adapter); 21 | void rtl8188e_HalDmWatchDog(IN PADAPTER Adapter); 22 | 23 | /* VOID rtl8192c_dm_CheckTXPowerTracking(IN PADAPTER Adapter); */ 24 | 25 | /* void rtl8192c_dm_RF_Saving(IN PADAPTER pAdapter, IN u8 bForceInNormal); */ 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /include/rtl8192e_dm.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2012 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef __RTL8192E_DM_H__ 16 | #define __RTL8192E_DM_H__ 17 | 18 | 19 | void rtl8192e_init_dm_priv(IN PADAPTER Adapter); 20 | void rtl8192e_deinit_dm_priv(IN PADAPTER Adapter); 21 | void rtl8192e_InitHalDm(IN PADAPTER Adapter); 22 | void rtl8192e_HalDmWatchDog(IN PADAPTER Adapter); 23 | 24 | /* VOID rtl8192c_dm_CheckTXPowerTracking(IN PADAPTER Adapter); */ 25 | 26 | /* void rtl8192c_dm_RF_Saving(IN PADAPTER pAdapter, IN u8 bForceInNormal); */ 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /hal/efuse/rtl8192e/HalEfuseMask8192E_SDIO.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | 16 | 17 | 18 | /****************************************************************************** 19 | * MSDIO.TXT 20 | ******************************************************************************/ 21 | u2Byte EFUSE_GetArrayLen_MP_8192E_MSDIO(VOID); 22 | 23 | VOID EFUSE_GetMaskArray_MP_8192E_MSDIO(pu1Byte Array); 24 | 25 | BOOLEAN EFUSE_IsAddressMasked_MP_8192E_MSDIO(/* TC: Test Chip, MP: MP Chip */ 26 | u2Byte Offset); 27 | -------------------------------------------------------------------------------- /include/rtw_wifi_regd.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2009-2010 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | 16 | #ifndef __RTW_WIFI_REGD_H__ 17 | #define __RTW_WIFI_REGD_H__ 18 | 19 | struct country_code_to_enum_rd { 20 | u16 countrycode; 21 | const char *iso_name; 22 | }; 23 | 24 | enum country_code_type_t { 25 | COUNTRY_CODE_USER = 0, 26 | 27 | /*add new channel plan above this line */ 28 | COUNTRY_CODE_MAX 29 | }; 30 | 31 | int rtw_regd_init(_adapter *padapter); 32 | void rtw_reg_notify_by_driver(_adapter *adapter); 33 | 34 | #endif /* __RTW_WIFI_REGD_H__ */ 35 | -------------------------------------------------------------------------------- /include/cmd_osdep.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef __CMD_OSDEP_H_ 16 | #define __CMD_OSDEP_H_ 17 | 18 | 19 | extern sint _rtw_init_cmd_priv(struct cmd_priv *pcmdpriv); 20 | extern sint _rtw_init_evt_priv(struct evt_priv *pevtpriv); 21 | extern void _rtw_free_evt_priv(struct evt_priv *pevtpriv); 22 | extern void _rtw_free_cmd_priv(struct cmd_priv *pcmdpriv); 23 | extern sint _rtw_enqueue_cmd(_queue *queue, struct cmd_obj *obj, bool to_head); 24 | extern struct cmd_obj *_rtw_dequeue_cmd(_queue *queue); 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /hal/efuse/rtl8192e/HalEfuseMask8192E_USB.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | 16 | 17 | 18 | /****************************************************************************** 19 | * MUSB.TXT 20 | ******************************************************************************/ 21 | u2Byte EFUSE_GetArrayLen_MP_8192E_MUSB(VOID); 22 | 23 | VOID 24 | EFUSE_GetMaskArray_MP_8192E_MUSB( 25 | IN OUT pu1Byte Array 26 | ); 27 | 28 | BOOLEAN EFUSE_IsAddressMasked_MP_8192E_MUSB(/* TC: Test Chip, MP: MP Chip */ 29 | IN u2Byte Offset 30 | ); 31 | -------------------------------------------------------------------------------- /include/rtl8822bs_hal.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2015 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef _RTL8822BS_HAL_H_ 16 | #define _RTL8822BS_HAL_H_ 17 | 18 | #include /* PADAPTER */ 19 | 20 | /* rtl8822bs_ops.c */ 21 | void rtl8822bs_set_hal_ops(PADAPTER); 22 | 23 | #if defined(CONFIG_WOWLAN) || defined(CONFIG_AP_WOWLAN) 24 | void rtl8822bs_disable_interrupt_but_cpwm2(PADAPTER adapter); 25 | #endif 26 | 27 | /* rtl8822bs_xmit.c */ 28 | s32 rtl8822bs_dequeue_writeport(PADAPTER); 29 | #define _dequeue_writeport(a) rtl8822bs_dequeue_writeport(a) 30 | 31 | #endif /* _RTL8822BS_HAL_H_ */ 32 | -------------------------------------------------------------------------------- /hal/efuse/rtl8192e/HalEfuseMask8192E_PCIE.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | 16 | 17 | 18 | /****************************************************************************** 19 | * MPCIE.TXT 20 | ******************************************************************************/ 21 | 22 | 23 | u2Byte 24 | EFUSE_GetArrayLen_MP_8192E_MPCIE(VOID); 25 | 26 | VOID 27 | EFUSE_GetMaskArray_MP_8192E_MPCIE( 28 | IN OUT pu1Byte Array 29 | ); 30 | 31 | BOOLEAN 32 | EFUSE_IsAddressMasked_MP_8192E_MPCIE(/* TC: Test Chip, MP: MP Chip */ 33 | IN u2Byte Offset 34 | ); 35 | -------------------------------------------------------------------------------- /hal/phydm/halrf/halrf_powertracking.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | 16 | #ifndef __HALRF_POWER_TRACKING_H__ 17 | #define __HALRF_POWER_TRACKING_H__ 18 | 19 | #define HALRF_POWRTRACKING_ALL_VER "1.0" 20 | 21 | boolean 22 | odm_check_power_status( 23 | void *p_dm_void 24 | ); 25 | 26 | #if (DM_ODM_SUPPORT_TYPE & (ODM_WIN | ODM_CE)) 27 | void 28 | halrf_update_pwr_track( 29 | void *p_dm_void, 30 | u8 rate 31 | ); 32 | #endif 33 | 34 | #if (DM_ODM_SUPPORT_TYPE == ODM_WIN) 35 | void 36 | halrf_update_init_rate_work_item_callback( 37 | void *p_context 38 | ); 39 | #endif 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /include/rtw_sdio.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2015 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef _RTW_SDIO_H_ 16 | #define _RTW_SDIO_H_ 17 | 18 | #include /* struct dvobj_priv and etc. */ 19 | 20 | u8 rtw_sdio_read_cmd52(struct dvobj_priv *, u32 addr, void *buf, size_t len); 21 | u8 rtw_sdio_read_cmd53(struct dvobj_priv *, u32 addr, void *buf, size_t len); 22 | u8 rtw_sdio_write_cmd52(struct dvobj_priv *, u32 addr, void *buf, size_t len); 23 | u8 rtw_sdio_write_cmd53(struct dvobj_priv *, u32 addr, void *buf, size_t len); 24 | u8 rtw_sdio_f0_read(struct dvobj_priv *, u32 addr, void *buf, size_t len); 25 | 26 | #endif /* _RTW_SDIO_H_ */ 27 | -------------------------------------------------------------------------------- /include/hal_gspi.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef __HAL_GSPI_H_ 16 | #define __HAL_GSPI_H_ 17 | 18 | #define ffaddr2deviceId(pdvobj, addr) (pdvobj->Queue2Pipe[addr]) 19 | 20 | u8 rtw_hal_gspi_max_txoqt_free_space(_adapter *padapter); 21 | u8 rtw_hal_gspi_query_tx_freepage(_adapter *padapter, u8 PageIdx, u8 RequiredPageNum); 22 | void rtw_hal_gspi_update_tx_freepage(_adapter *padapter, u8 PageIdx, u8 RequiredPageNum); 23 | void rtw_hal_set_gspi_tx_max_length(PADAPTER padapter, u8 numHQ, u8 numNQ, u8 numLQ, u8 numPubQ); 24 | u32 rtw_hal_get_gspi_tx_max_length(PADAPTER padapter, u8 queue_idx); 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /include/rtw_byteorder.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef _RTL871X_BYTEORDER_H_ 16 | #define _RTL871X_BYTEORDER_H_ 17 | 18 | 19 | #if defined(CONFIG_LITTLE_ENDIAN) && defined (CONFIG_BIG_ENDIAN) 20 | #error "Shall be CONFIG_LITTLE_ENDIAN or CONFIG_BIG_ENDIAN, but not both!\n" 21 | #endif 22 | 23 | #if defined(CONFIG_LITTLE_ENDIAN) 24 | #ifndef CONFIG_PLATFORM_MSTAR389 25 | #include 26 | #endif 27 | #elif defined (CONFIG_BIG_ENDIAN) 28 | #include 29 | #else 30 | # error "Must be LITTLE/BIG Endian Host" 31 | #endif 32 | 33 | #endif /* _RTL871X_BYTEORDER_H_ */ 34 | -------------------------------------------------------------------------------- /hal/btc/halbtc8822bwifionly.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2016 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef __INC_HAL8822BWIFIONLYHWCFG_H 16 | #define __INC_HAL8822BWIFIONLYHWCFG_H 17 | 18 | VOID 19 | ex_hal8822b_wifi_only_hw_config( 20 | IN struct wifi_only_cfg *pwifionlycfg 21 | ); 22 | VOID 23 | ex_hal8822b_wifi_only_scannotify( 24 | IN struct wifi_only_cfg *pwifionlycfg, 25 | IN u1Byte is_5g 26 | ); 27 | VOID 28 | ex_hal8822b_wifi_only_switchbandnotify( 29 | IN struct wifi_only_cfg *pwifionlycfg, 30 | IN u1Byte is_5g 31 | ); 32 | VOID 33 | hal8822b_wifi_only_switch_antenna(IN struct wifi_only_cfg *pwifionlycfg, 34 | IN u1Byte is_5g 35 | ); 36 | #endif 37 | -------------------------------------------------------------------------------- /include/mlme_osdep.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef __MLME_OSDEP_H_ 16 | #define __MLME_OSDEP_H_ 17 | 18 | 19 | #if defined(PLATFORM_WINDOWS) || defined(PLATFORM_MPIXEL) 20 | extern int time_after(systime now, systime old); 21 | #endif 22 | 23 | extern void rtw_os_indicate_disconnect(_adapter *adapter, u16 reason, u8 locally_generated); 24 | extern void rtw_os_indicate_connect(_adapter *adapter); 25 | void rtw_os_indicate_scan_done(_adapter *padapter, bool aborted); 26 | extern void rtw_report_sec_ie(_adapter *adapter, u8 authmode, u8 *sec_ie); 27 | 28 | void rtw_reset_securitypriv(_adapter *adapter); 29 | 30 | #endif /* _MLME_OSDEP_H_ */ 31 | -------------------------------------------------------------------------------- /core/rtw_btcoex_wifionly.c: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2013 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #include 16 | #include 17 | #include 18 | 19 | void rtw_btcoex_wifionly_switchband_notify(PADAPTER padapter) 20 | { 21 | hal_btcoex_wifionly_switchband_notify(padapter); 22 | } 23 | 24 | void rtw_btcoex_wifionly_scan_notify(PADAPTER padapter) 25 | { 26 | hal_btcoex_wifionly_scan_notify(padapter); 27 | } 28 | 29 | void rtw_btcoex_wifionly_hw_config(PADAPTER padapter) 30 | { 31 | hal_btcoex_wifionly_hw_config(padapter); 32 | } 33 | 34 | void rtw_btcoex_wifionly_initialize(PADAPTER padapter) 35 | { 36 | hal_btcoex_wifionly_initlizevariables(padapter); 37 | } 38 | -------------------------------------------------------------------------------- /hal/phydm/rtl8192e/halhwimg8192e_mac.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | 16 | /*Image2HeaderVersion: 2.18*/ 17 | #if (RTL8192E_SUPPORT == 1) 18 | #ifndef __INC_MP_MAC_HW_IMG_8192E_H 19 | #define __INC_MP_MAC_HW_IMG_8192E_H 20 | 21 | 22 | /****************************************************************************** 23 | * MAC_REG.TXT 24 | ******************************************************************************/ 25 | 26 | void 27 | odm_read_and_config_mp_8192e_mac_reg(/* TC: Test Chip, MP: MP Chip*/ 28 | struct PHY_DM_STRUCT *p_dm_odm 29 | ); 30 | u32 odm_get_version_mp_8192e_mac_reg(void); 31 | 32 | #endif 33 | #endif /* end of HWIMG_SUPPORT*/ 34 | -------------------------------------------------------------------------------- /docs/BUILD_FOR_NETHUNTER.md: -------------------------------------------------------------------------------- 1 | ## Build Kernel Headers 2 | 3 | ``` 4 | cd [your kernel source directory] 5 | make module_prepare 6 | make modules_install INSTALL_MOD_PATH=../ 7 | ``` 8 | 9 | ## Build RTL8192EU driver/modules 10 | 11 | ``` 12 | cd ../ 13 | curl -L https://gitlab.com/KanuX/rtl8192eu/-/archive/master/rtl8192eu-master.tar.gz --output rtl8192eu-master.tar.gz 14 | tar -xvf rtl8192eu-master.tar.gz 15 | cd rtl8192eu-master/ 16 | ``` 17 | 18 | That command places this driver behind your kernel source directory (RECOMMENDED). 19 | If you put it anywhere you might need to set the Makefile in this driver, but i won't explain it. 20 | Now, do: 21 | 22 | ``` 23 | export ARCH=arm64 24 | export SUBARCH=arm64 25 | export CROSS_COMPILE=../toolchain/toolchain64/bin/aarch64-linux-android- 26 | export KBUILD_KVER=3.10.73-NetHunter-something 27 | ``` 28 | 29 | arm64 is the device architecture. 30 | CROSS_COMPILE is your toolchain directory. 31 | KBUILD_KVER is your kernel build version, you can search for it in ../lib/modules (the place of your modules_install when you build kernel headers). 32 | 33 | Now, do: 34 | ``` 35 | make 36 | ``` 37 | 38 | If there is no error or success you will see a file named 8188eu.ko in this driver directory. 39 | 40 | 41 | ## Load the driver (8188eu.ko) 42 | ``` 43 | su 44 | cd /system/lib/modules 45 | insmod 8188eu.ko 46 | ``` 47 | -------------------------------------------------------------------------------- /include/rtw_mem.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef __RTW_MEM_H__ 16 | #define __RTW_MEM_H__ 17 | 18 | #include 19 | #include 20 | #include 21 | 22 | #ifdef CONFIG_PLATFORM_MSTAR_HIGH 23 | #define MAX_RTKM_RECVBUF_SZ (31744) /* 31k */ 24 | #else 25 | #define MAX_RTKM_RECVBUF_SZ (15360) /* 15k */ 26 | #endif /* CONFIG_PLATFORM_MSTAR_HIGH */ 27 | #define MAX_RTKM_NR_PREALLOC_RECV_SKB 16 28 | 29 | u16 rtw_rtkm_get_buff_size(void); 30 | u8 rtw_rtkm_get_nr_recv_skb(void); 31 | struct u8 *rtw_alloc_revcbuf_premem(void); 32 | struct sk_buff *rtw_alloc_skb_premem(u16 in_size); 33 | int rtw_free_skb_premem(struct sk_buff *pskb); 34 | 35 | 36 | #endif /* __RTW_MEM_H__ */ 37 | -------------------------------------------------------------------------------- /hal/phydm/phydm_noisemonitor.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef __ODMNOISEMONITOR_H__ 16 | #define __ODMNOISEMONITOR_H__ 17 | 18 | #define ODM_MAX_CHANNEL_NUM 38/* 14+24 */ 19 | struct noise_level { 20 | u8 value[PHYDM_MAX_RF_PATH]; 21 | s8 sval[PHYDM_MAX_RF_PATH]; 22 | s32 sum[PHYDM_MAX_RF_PATH]; 23 | u8 valid[PHYDM_MAX_RF_PATH]; 24 | u8 valid_cnt[PHYDM_MAX_RF_PATH]; 25 | }; 26 | 27 | 28 | struct _ODM_NOISE_MONITOR_ { 29 | s8 noise[PHYDM_MAX_RF_PATH]; 30 | s16 noise_all; 31 | }; 32 | 33 | s16 odm_inband_noise_monitor( 34 | void *p_dm_void, 35 | u8 is_pause_dig, 36 | u8 igi_value, 37 | u32 max_time 38 | ); 39 | 40 | void 41 | phydm_noisy_detection( 42 | void *p_dm_void 43 | ); 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /include/nic_spec.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | 16 | 17 | #ifndef __NIC_SPEC_H__ 18 | #define __NIC_SPEC_H__ 19 | 20 | #include 21 | 22 | #define RTL8711_MCTRL_ (0x20000) 23 | #define RTL8711_UART_ (0x30000) 24 | #define RTL8711_TIMER_ (0x40000) 25 | #define RTL8711_FINT_ (0x50000) 26 | #define RTL8711_HINT_ (0x50000) 27 | #define RTL8711_GPIO_ (0x60000) 28 | #define RTL8711_WLANCTRL_ (0x200000) 29 | #define RTL8711_WLANFF_ (0xe00000) 30 | #define RTL8711_HCICTRL_ (0x600000) 31 | #define RTL8711_SYSCFG_ (0x620000) 32 | #define RTL8711_SYSCTRL_ (0x620000) 33 | #define RTL8711_MCCTRL_ (0x020000) 34 | 35 | 36 | #include 37 | 38 | #include 39 | 40 | 41 | #endif /* __RTL8711_SPEC_H__ */ 42 | -------------------------------------------------------------------------------- /include/custom_gpio.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2016 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef __CUSTOM_GPIO_H__ 16 | #define __CUSTOM_GPIO_H___ 17 | 18 | #include 19 | #include 20 | 21 | #ifdef PLATFORM_OS_XP 22 | #include 23 | #endif 24 | 25 | #ifdef PLATFORM_OS_CE 26 | #include 27 | #endif 28 | 29 | #ifdef PLATFORM_LINUX 30 | #include 31 | #endif 32 | 33 | typedef enum cust_gpio_modes { 34 | WLAN_PWDN_ON, 35 | WLAN_PWDN_OFF, 36 | WLAN_POWER_ON, 37 | WLAN_POWER_OFF, 38 | WLAN_BT_PWDN_ON, 39 | WLAN_BT_PWDN_OFF 40 | } cust_gpio_modes_t; 41 | 42 | extern int rtw_wifi_gpio_init(void); 43 | extern int rtw_wifi_gpio_deinit(void); 44 | extern void rtw_wifi_gpio_wlan_ctrl(int onoff); 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /include/hal_sdio.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef __HAL_SDIO_H_ 16 | #define __HAL_SDIO_H_ 17 | 18 | #define ffaddr2deviceId(pdvobj, addr) (pdvobj->Queue2Pipe[addr]) 19 | 20 | u8 rtw_hal_sdio_max_txoqt_free_space(_adapter *padapter); 21 | u8 rtw_hal_sdio_query_tx_freepage(_adapter *padapter, u8 PageIdx, u8 RequiredPageNum); 22 | void rtw_hal_sdio_update_tx_freepage(_adapter *padapter, u8 PageIdx, u8 RequiredPageNum); 23 | void rtw_hal_set_sdio_tx_max_length(PADAPTER padapter, u8 numHQ, u8 numNQ, u8 numLQ, u8 numPubQ); 24 | u32 rtw_hal_get_sdio_tx_max_length(PADAPTER padapter, u8 queue_idx); 25 | bool sdio_power_on_check(PADAPTER padapter); 26 | 27 | #ifdef CONFIG_FW_C2H_REG 28 | void sd_c2h_hisr_hdl(_adapter *adapter); 29 | #endif 30 | 31 | #endif /* __HAL_SDIO_H_ */ 32 | -------------------------------------------------------------------------------- /include/rtl8192e_led.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2012 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef __RTL8192E_LED_H__ 16 | #define __RTL8192E_LED_H__ 17 | 18 | #ifdef CONFIG_RTW_SW_LED 19 | /* ******************************************************************************** 20 | * Interface to manipulate LED objects. 21 | * ******************************************************************************** */ 22 | #ifdef CONFIG_USB_HCI 23 | void rtl8192eu_InitSwLeds(PADAPTER padapter); 24 | void rtl8192eu_DeInitSwLeds(PADAPTER padapter); 25 | #endif 26 | #ifdef CONFIG_PCI_HCI 27 | void rtl8192ee_InitSwLeds(PADAPTER padapter); 28 | void rtl8192ee_DeInitSwLeds(PADAPTER padapter); 29 | #endif 30 | #ifdef CONFIG_SDIO_HCI 31 | void rtl8192es_InitSwLeds(PADAPTER padapter); 32 | void rtl8192es_DeInitSwLeds(PADAPTER padapter); 33 | #endif 34 | 35 | #endif 36 | #endif/*CONFIG_RTW_SW_LED*/ 37 | -------------------------------------------------------------------------------- /include/rtl8188e_led.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef __RTL8188E_LED_H__ 16 | #define __RTL8188E_LED_H__ 17 | 18 | #ifdef CONFIG_RTW_SW_LED 19 | 20 | /* ******************************************************************************** 21 | * Interface to manipulate LED objects. 22 | * ******************************************************************************** */ 23 | #ifdef CONFIG_USB_HCI 24 | void rtl8188eu_InitSwLeds(PADAPTER padapter); 25 | void rtl8188eu_DeInitSwLeds(PADAPTER padapter); 26 | #endif 27 | #ifdef CONFIG_PCI_HCI 28 | void rtl8188ee_InitSwLeds(PADAPTER padapter); 29 | void rtl8188ee_DeInitSwLeds(PADAPTER padapter); 30 | #endif 31 | #if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) 32 | void rtl8188es_InitSwLeds(PADAPTER padapter); 33 | void rtl8188es_DeInitSwLeds(PADAPTER padapter); 34 | #endif 35 | 36 | #endif 37 | #endif /*CONFIG_RTW_SW_LED*/ 38 | -------------------------------------------------------------------------------- /include/sdio_hal.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef __SDIO_HAL_H__ 16 | #define __SDIO_HAL_H__ 17 | 18 | void sd_int_dpc(PADAPTER padapter); 19 | u8 rtw_set_hal_ops(_adapter *padapter); 20 | 21 | #ifdef CONFIG_RTL8188E 22 | void rtl8188es_set_hal_ops(PADAPTER padapter); 23 | #endif 24 | 25 | #ifdef CONFIG_RTL8723B 26 | void rtl8723bs_set_hal_ops(PADAPTER padapter); 27 | #endif 28 | 29 | #ifdef CONFIG_RTL8821A 30 | void rtl8821as_set_hal_ops(PADAPTER padapter); 31 | #endif 32 | 33 | #ifdef CONFIG_RTL8192E 34 | void rtl8192es_set_hal_ops(PADAPTER padapter); 35 | #endif 36 | 37 | #ifdef CONFIG_RTL8703B 38 | void rtl8703bs_set_hal_ops(PADAPTER padapter); 39 | #endif 40 | 41 | #ifdef CONFIG_RTL8723D 42 | void rtl8723ds_set_hal_ops(PADAPTER padapter); 43 | #endif 44 | 45 | #ifdef CONFIG_RTL8188F 46 | void rtl8188fs_set_hal_ops(PADAPTER padapter); 47 | #endif 48 | 49 | #endif /* __SDIO_HAL_H__ */ 50 | -------------------------------------------------------------------------------- /include/pci_hal.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef __PCI_HAL_H__ 16 | #define __PCI_HAL_H__ 17 | 18 | #ifdef CONFIG_RTL8188E 19 | void rtl8188ee_set_hal_ops(_adapter *padapter); 20 | #endif 21 | 22 | #if defined(CONFIG_RTL8812A) || defined(CONFIG_RTL8821A) 23 | void rtl8812ae_set_hal_ops(_adapter *padapter); 24 | #endif 25 | 26 | #if defined(CONFIG_RTL8192E) 27 | void rtl8192ee_set_hal_ops(_adapter *padapter); 28 | #endif 29 | 30 | #ifdef CONFIG_RTL8723B 31 | void rtl8723be_set_hal_ops(_adapter *padapter); 32 | #endif 33 | 34 | #ifdef CONFIG_RTL8723D 35 | void rtl8723de_set_hal_ops(_adapter *padapter); 36 | #endif 37 | 38 | #ifdef CONFIG_RTL8814A 39 | void rtl8814ae_set_hal_ops(_adapter *padapter); 40 | #endif 41 | 42 | #ifdef CONFIG_RTL8822B 43 | void rtl8822be_set_hal_ops(PADAPTER padapter); 44 | #endif 45 | 46 | u8 rtw_set_hal_ops(_adapter *padapter); 47 | 48 | #endif /* __PCIE_HAL_H__ */ 49 | -------------------------------------------------------------------------------- /include/rtl8723b_dm.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef __RTL8723B_DM_H__ 16 | #define __RTL8723B_DM_H__ 17 | /* ************************************************************ 18 | * Description: 19 | * 20 | * This file is for 8723B dynamic mechanism only 21 | * 22 | * 23 | * ************************************************************ */ 24 | 25 | /* ************************************************************ 26 | * structure and define 27 | * ************************************************************ */ 28 | 29 | /* ************************************************************ 30 | * function prototype 31 | * ************************************************************ */ 32 | 33 | void rtl8723b_init_dm_priv(PADAPTER padapter); 34 | void rtl8723b_deinit_dm_priv(PADAPTER padapter); 35 | 36 | void rtl8723b_InitHalDm(PADAPTER padapter); 37 | void rtl8723b_HalDmWatchDog(PADAPTER padapter); 38 | #endif 39 | -------------------------------------------------------------------------------- /include/drv_types_gspi.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef __DRV_TYPES_GSPI_H__ 16 | #define __DRV_TYPES_GSPI_H__ 17 | 18 | /* SPI Header Files */ 19 | #ifdef PLATFORM_LINUX 20 | #include 21 | #include 22 | #include 23 | /* #include */ 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #endif 32 | 33 | 34 | typedef struct gspi_data { 35 | u8 func_number; 36 | 37 | u8 tx_block_mode; 38 | u8 rx_block_mode; 39 | u32 block_transfer_len; 40 | 41 | #ifdef PLATFORM_LINUX 42 | struct spi_device *func; 43 | 44 | struct workqueue_struct *priv_wq; 45 | struct delayed_work irq_work; 46 | #endif 47 | } GSPI_DATA, *PGSPI_DATA; 48 | 49 | #endif /* #ifndef __DRV_TYPES_GSPI_H__ */ 50 | -------------------------------------------------------------------------------- /include/rtl8188f_dm.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef __RTL8188F_DM_H__ 16 | #define __RTL8188F_DM_H__ 17 | /* ************************************************************ 18 | * Description: 19 | * 20 | * This file is for 8188F dynamic mechanism only 21 | * 22 | * 23 | * ************************************************************ */ 24 | 25 | /* ************************************************************ 26 | * structure and define 27 | * ************************************************************ */ 28 | 29 | /* ************************************************************ 30 | * function prototype 31 | * ************************************************************ */ 32 | 33 | void rtl8188f_init_dm_priv(PADAPTER padapter); 34 | void rtl8188f_deinit_dm_priv(PADAPTER padapter); 35 | 36 | void rtl8188f_InitHalDm(PADAPTER padapter); 37 | void rtl8188f_HalDmWatchDog(PADAPTER padapter); 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /include/rtl8703b_dm.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef __RTL8703B_DM_H__ 16 | #define __RTL8703B_DM_H__ 17 | /* ************************************************************ 18 | * Description: 19 | * 20 | * This file is for 8703B dynamic mechanism only 21 | * 22 | * 23 | * ************************************************************ */ 24 | 25 | /* ************************************************************ 26 | * structure and define 27 | * ************************************************************ */ 28 | 29 | /* ************************************************************ 30 | * function prototype 31 | * ************************************************************ */ 32 | 33 | void rtl8703b_init_dm_priv(PADAPTER padapter); 34 | void rtl8703b_deinit_dm_priv(PADAPTER padapter); 35 | 36 | void rtl8703b_InitHalDm(PADAPTER padapter); 37 | void rtl8703b_HalDmWatchDog(PADAPTER padapter); 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /include/rtl8723d_dm.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef __RTL8723D_DM_H__ 16 | #define __RTL8723D_DM_H__ 17 | /* ************************************************************ 18 | * Description: 19 | * 20 | * This file is for 8723D dynamic mechanism only 21 | * 22 | * 23 | * ************************************************************ */ 24 | 25 | /* ************************************************************ 26 | * structure and define 27 | * ************************************************************ */ 28 | 29 | /* ************************************************************ 30 | * function prototype 31 | * ************************************************************ */ 32 | 33 | void rtl8723d_init_dm_priv(PADAPTER padapter); 34 | void rtl8723d_deinit_dm_priv(PADAPTER padapter); 35 | 36 | void rtl8723d_InitHalDm(PADAPTER padapter); 37 | void rtl8723d_HalDmWatchDog(PADAPTER padapter); 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /include/rtl8814a_led.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef __RTL8814A_LED_H__ 16 | #define __RTL8814A_LED_H__ 17 | 18 | #ifdef CONFIG_RTW_SW_LED 19 | /* ******************************************************************************** 20 | * Interface to manipulate LED objects. 21 | * ******************************************************************************** */ 22 | #ifdef CONFIG_USB_HCI 23 | void rtl8814au_InitSwLeds(PADAPTER padapter); 24 | void rtl8814au_DeInitSwLeds(PADAPTER padapter); 25 | #endif /* CONFIG_USB_HCI */ 26 | #ifdef CONFIG_PCI_HCI 27 | void rtl8814ae_InitSwLeds(PADAPTER padapter); 28 | void rtl8814ae_DeInitSwLeds(PADAPTER padapter); 29 | #endif /* CONFIG_PCI_HCI */ 30 | #ifdef CONFIG_SDIO_HCI 31 | void rtl8814s_InitSwLeds(PADAPTER padapter); 32 | void rtl8814s_DeInitSwLeds(PADAPTER padapter); 33 | #endif /* CONFIG_SDIO_HCI */ 34 | 35 | #endif /* __RTL8814A_LED_H__ */ 36 | #endif /*CONFIG_RTW_SW_LED*/ 37 | -------------------------------------------------------------------------------- /platform/platform_arm_act_sdio.c: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2013 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | /* 16 | * Description: 17 | * This file can be applied to following platforms: 18 | * CONFIG_PLATFORM_ACTIONS_ATM703X 19 | */ 20 | #include 21 | 22 | #ifdef CONFIG_PLATFORM_ACTIONS_ATM705X 23 | extern int acts_wifi_init(void); 24 | extern void acts_wifi_cleanup(void); 25 | #endif 26 | 27 | /* 28 | * Return: 29 | * 0: power on successfully 30 | * others: power on failed 31 | */ 32 | int platform_wifi_power_on(void) 33 | { 34 | int ret = 0; 35 | 36 | #ifdef CONFIG_PLATFORM_ACTIONS_ATM705X 37 | ret = acts_wifi_init(); 38 | if (unlikely(ret < 0)) { 39 | pr_err("%s Failed to register the power control driver.\n", __FUNCTION__); 40 | goto exit; 41 | } 42 | #endif 43 | 44 | exit: 45 | return ret; 46 | } 47 | 48 | void platform_wifi_power_off(void) 49 | { 50 | #ifdef CONFIG_PLATFORM_ACTIONS_ATM705X 51 | acts_wifi_cleanup(); 52 | #endif 53 | } 54 | -------------------------------------------------------------------------------- /hal/phydm/phydm_features.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | 16 | #ifndef __PHYDM_FEATURES_H__ 17 | #define __PHYDM_FEATURES 18 | 19 | #define ODM_DC_CANCELLATION_SUPPORT (ODM_RTL8188F | ODM_RTL8710B) 20 | #define ODM_RECEIVER_BLOCKING_SUPPORT (ODM_RTL8188E | ODM_RTL8192E) 21 | 22 | #if ((RTL8814A_SUPPORT == 1) || (RTL8821C_SUPPORT == 1) || (RTL8822B_SUPPORT == 1) || (RTL8197F_SUPPORT == 1)) 23 | #define PHYDM_LA_MODE_SUPPORT 1 24 | #else 25 | #define PHYDM_LA_MODE_SUPPORT 0 26 | #endif 27 | 28 | /*20170103 YuChen add for FW API*/ 29 | #define PHYDM_FW_API_ENABLE_8822B 1 30 | #define PHYDM_FW_API_FUNC_ENABLE_8822B 1 31 | #define PHYDM_FW_API_ENABLE_8821C 1 32 | #define PHYDM_FW_API_FUNC_ENABLE_8821C 1 33 | 34 | #if (DM_ODM_SUPPORT_TYPE == ODM_WIN) 35 | #include "phydm_features_win.h" 36 | #elif (DM_ODM_SUPPORT_TYPE == ODM_CE) 37 | #include "phydm_features_ce.h" 38 | #elif (DM_ODM_SUPPORT_TYPE == ODM_AP) 39 | #include "phydm_features_ap.h" 40 | #endif 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /include/rtl8812a_led.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef __RTL8812A_LED_H__ 16 | #define __RTL8812A_LED_H__ 17 | #ifdef CONFIG_RTW_LED 18 | #ifdef CONFIG_RTW_SW_LED 19 | /* ******************************************************************************** 20 | * Interface to manipulate LED objects. 21 | * ******************************************************************************** */ 22 | #ifdef CONFIG_USB_HCI 23 | void rtl8812au_InitSwLeds(PADAPTER padapter); 24 | void rtl8812au_DeInitSwLeds(PADAPTER padapter); 25 | #endif 26 | #ifdef CONFIG_PCI_HCI 27 | void rtl8812ae_InitSwLeds(PADAPTER padapter); 28 | void rtl8812ae_DeInitSwLeds(PADAPTER padapter); 29 | #endif 30 | #ifdef CONFIG_SDIO_HCI 31 | void rtl8821as_InitSwLeds(PADAPTER padapter); 32 | void rtl8821as_DeInitSwLeds(PADAPTER padapter); 33 | #endif 34 | #endif/*CONFIG_RTW_SW_LED*/ 35 | #endif/*#ifdef CONFIG_RTW_LED*/ 36 | 37 | #ifdef CONFIG_SDIO_HCI 38 | void rtl8821as_init_led_circuit(PADAPTER adapter); 39 | #endif 40 | 41 | #endif /*__RTL8812A_LED_H__*/ 42 | -------------------------------------------------------------------------------- /include/ethernet.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | /*! \file */ 16 | #ifndef __INC_ETHERNET_H 17 | #define __INC_ETHERNET_H 18 | 19 | #define ETHERNET_ADDRESS_LENGTH 6 /* !< Ethernet Address Length */ 20 | #define ETHERNET_HEADER_SIZE 14 /* !< Ethernet Header Length */ 21 | #define LLC_HEADER_SIZE 6 /* !< LLC Header Length */ 22 | #define TYPE_LENGTH_FIELD_SIZE 2 /* !< Type/Length Size */ 23 | #define MINIMUM_ETHERNET_PACKET_SIZE 60 /* !< Minimum Ethernet Packet Size */ 24 | #define MAXIMUM_ETHERNET_PACKET_SIZE 1514 /* !< Maximum Ethernet Packet Size */ 25 | 26 | #define RT_ETH_IS_MULTICAST(_pAddr) ((((UCHAR *)(_pAddr))[0]&0x01) != 0) /* !< Is Multicast Address? */ 27 | #define RT_ETH_IS_BROADCAST(_pAddr) (\ 28 | ((UCHAR *)(_pAddr))[0] == 0xff && \ 29 | ((UCHAR *)(_pAddr))[1] == 0xff && \ 30 | ((UCHAR *)(_pAddr))[2] == 0xff && \ 31 | ((UCHAR *)(_pAddr))[3] == 0xff && \ 32 | ((UCHAR *)(_pAddr))[4] == 0xff && \ 33 | ((UCHAR *)(_pAddr))[5] == 0xff) /* !< Is Broadcast Address? */ 34 | 35 | 36 | #endif /* #ifndef __INC_ETHERNET_H */ 37 | -------------------------------------------------------------------------------- /platform/platform_ARM_WMT_sdio.c: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2013 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #include 16 | #include 17 | #include 18 | 19 | extern void wmt_detect_sdio2(void); 20 | extern void force_remove_sdio2(void); 21 | 22 | int platform_wifi_power_on(void) 23 | { 24 | int err = 0; 25 | err = gpio_request(WMT_PIN_GP62_SUSGPIO1, "wifi_chip_en"); 26 | if (err < 0) { 27 | printk("request gpio for rtl8188eu failed!\n"); 28 | return err; 29 | } 30 | gpio_direction_output(WMT_PIN_GP62_SUSGPIO1, 0);/* pull sus_gpio1 to 0 to open vcc_wifi. */ 31 | printk("power on rtl8189.\n"); 32 | msleep(500); 33 | wmt_detect_sdio2(); 34 | printk("[rtl8189es] %s: new card, power on.\n", __FUNCTION__); 35 | return err; 36 | } 37 | 38 | void platform_wifi_power_off(void) 39 | { 40 | force_remove_sdio2(); 41 | 42 | gpio_direction_output(WMT_PIN_GP62_SUSGPIO1, 1);/* pull sus_gpio1 to 1 to close vcc_wifi. */ 43 | printk("power off rtl8189.\n"); 44 | gpio_free(WMT_PIN_GP62_SUSGPIO1); 45 | printk("[rtl8189es] %s: remove card, power off.\n", __FUNCTION__); 46 | } 47 | -------------------------------------------------------------------------------- /include/rtl8188f_led.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef __RTL8188F_LED_H__ 16 | #define __RTL8188F_LED_H__ 17 | #ifdef CONFIG_RTW_SW_LED 18 | 19 | #include 20 | #include 21 | #include 22 | 23 | 24 | /* ******************************************************************************** 25 | * Interface to manipulate LED objects. 26 | * ******************************************************************************** */ 27 | #ifdef CONFIG_USB_HCI 28 | void rtl8188fu_InitSwLeds(PADAPTER padapter); 29 | void rtl8188fu_DeInitSwLeds(PADAPTER padapter); 30 | #endif 31 | #ifdef CONFIG_SDIO_HCI 32 | void rtl8188fs_InitSwLeds(PADAPTER padapter); 33 | void rtl8188fs_DeInitSwLeds(PADAPTER padapter); 34 | #endif 35 | #ifdef CONFIG_GSPI_HCI 36 | void rtl8188fs_InitSwLeds(PADAPTER padapter); 37 | void rtl8188fs_DeInitSwLeds(PADAPTER padapter); 38 | #endif 39 | #ifdef CONFIG_PCI_HCI 40 | void rtl8188fe_InitSwLeds(PADAPTER padapter); 41 | void rtl8188fe_DeInitSwLeds(PADAPTER padapter); 42 | #endif 43 | 44 | #endif 45 | #endif/*CONFIG_RTW_SW_LED*/ 46 | -------------------------------------------------------------------------------- /include/rtl8723b_led.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef __RTL8723B_LED_H__ 16 | #define __RTL8723B_LED_H__ 17 | 18 | #include 19 | #include 20 | #include 21 | 22 | #ifdef CONFIG_RTW_SW_LED 23 | /* ******************************************************************************** 24 | * Interface to manipulate LED objects. 25 | * ******************************************************************************** */ 26 | #ifdef CONFIG_USB_HCI 27 | void rtl8723bu_InitSwLeds(PADAPTER padapter); 28 | void rtl8723bu_DeInitSwLeds(PADAPTER padapter); 29 | #endif 30 | #ifdef CONFIG_SDIO_HCI 31 | void rtl8723bs_InitSwLeds(PADAPTER padapter); 32 | void rtl8723bs_DeInitSwLeds(PADAPTER padapter); 33 | #endif 34 | #ifdef CONFIG_GSPI_HCI 35 | void rtl8723bs_InitSwLeds(PADAPTER padapter); 36 | void rtl8723bs_DeInitSwLeds(PADAPTER padapter); 37 | #endif 38 | #ifdef CONFIG_PCI_HCI 39 | void rtl8723be_InitSwLeds(PADAPTER padapter); 40 | void rtl8723be_DeInitSwLeds(PADAPTER padapter); 41 | #endif 42 | 43 | #endif 44 | #endif/*CONFIG_RTW_SW_LED*/ 45 | -------------------------------------------------------------------------------- /hal/rtl8192e/hal8192e_fw.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2016 Realtek Corporation. All rights reserved. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * 19 | ******************************************************************************/ 20 | 21 | #ifdef CONFIG_RTL8192E 22 | 23 | #ifndef _FW_HEADER_8192E_H 24 | #define _FW_HEADER_8192E_H 25 | 26 | #ifdef LOAD_FW_HEADER_FROM_DRIVER 27 | #if (defined(CONFIG_AP_WOWLAN) || (DM_ODM_SUPPORT_TYPE & (ODM_AP))) 28 | extern u8 array_mp_8192e_fw_ap[25816]; 29 | extern u32 array_length_mp_8192e_fw_ap; 30 | #endif 31 | 32 | #if (DM_ODM_SUPPORT_TYPE & (ODM_WIN)) || (DM_ODM_SUPPORT_TYPE & (ODM_CE)) 33 | extern u8 array_mp_8192e_fw_nic[32286]; 34 | extern u32 array_length_mp_8192e_fw_nic; 35 | extern u8 array_mp_8192e_fw_nic_setupbox[28554]; 36 | extern u32 array_length_mp_8192e_fw_nic_setupbox; 37 | extern u8 array_mp_8192e_fw_wowlan[29008]; 38 | extern u32 array_length_mp_8192e_fw_wowlan; 39 | #endif 40 | #endif /* end of LOAD_FW_HEADER_FROM_DRIVER */ 41 | 42 | #endif 43 | 44 | #endif 45 | 46 | -------------------------------------------------------------------------------- /include/rtl8723d_led.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef __RTL8723D_LED_H__ 16 | #define __RTL8723D_LED_H__ 17 | 18 | #include 19 | #include 20 | #include 21 | 22 | #ifdef CONFIG_RTW_SW_LED 23 | /* ******************************************************************************** 24 | * Interface to manipulate LED objects. 25 | * ******************************************************************************** */ 26 | #ifdef CONFIG_USB_HCI 27 | void rtl8723du_InitSwLeds(PADAPTER padapter); 28 | void rtl8723du_DeInitSwLeds(PADAPTER padapter); 29 | #endif 30 | #ifdef CONFIG_SDIO_HCI 31 | void rtl8723ds_InitSwLeds(PADAPTER padapter); 32 | void rtl8723ds_DeInitSwLeds(PADAPTER padapter); 33 | #endif 34 | #ifdef CONFIG_GSPI_HCI 35 | void rtl8723ds_InitSwLeds(PADAPTER padapter); 36 | void rtl8723ds_DeInitSwLeds(PADAPTER padapter); 37 | #endif 38 | #ifdef CONFIG_PCI_HCI 39 | void rtl8723de_InitSwLeds(PADAPTER padapter); 40 | void rtl8723de_DeInitSwLeds(PADAPTER padapter); 41 | #endif 42 | 43 | #endif /*#ifdef CONFIG_RTW_SW_LED*/ 44 | #endif 45 | -------------------------------------------------------------------------------- /include/rtl8703b_led.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef __RTL8703B_LED_H__ 16 | #define __RTL8703B_LED_H__ 17 | 18 | #include 19 | #include 20 | #include 21 | 22 | #ifdef CONFIG_RTW_SW_LED 23 | /* ******************************************************************************** 24 | * Interface to manipulate LED objects. 25 | * ******************************************************************************** */ 26 | #ifdef CONFIG_USB_HCI 27 | void rtl8703bu_InitSwLeds(PADAPTER padapter); 28 | void rtl8703bu_DeInitSwLeds(PADAPTER padapter); 29 | #endif 30 | #ifdef CONFIG_SDIO_HCI 31 | void rtl8703bs_InitSwLeds(PADAPTER padapter); 32 | void rtl8703bs_DeInitSwLeds(PADAPTER padapter); 33 | #endif 34 | #ifdef CONFIG_GSPI_HCI 35 | void rtl8703bs_InitSwLeds(PADAPTER padapter); 36 | void rtl8703bs_DeInitSwLeds(PADAPTER padapter); 37 | #endif 38 | #ifdef CONFIG_PCI_HCI 39 | void rtl8703be_InitSwLeds(PADAPTER padapter); 40 | void rtl8703be_DeInitSwLeds(PADAPTER padapter); 41 | #endif 42 | 43 | #endif/*CONFIG_RTW_SW_LED*/ 44 | #endif /*__RTL8703B_LED_H__*/ 45 | -------------------------------------------------------------------------------- /hal/phydm/txbf/phydm_hal_txbf_api.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2011 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef __PHYDM_HAL_TXBF_API_H__ 16 | #define __PHYDM_HAL_TXBF_API_H__ 17 | 18 | #if (defined(CONFIG_BB_TXBF_API)) 19 | 20 | #if (DM_ODM_SUPPORT_TYPE != ODM_AP) 21 | #define tx_bf_nr(a, b) ((a > b) ? (b) : (a)) 22 | 23 | u8 24 | beamforming_get_htndp_tx_rate( 25 | void *p_dm_void, 26 | u8 comp_steering_num_of_bfer 27 | ); 28 | 29 | u8 30 | beamforming_get_vht_ndp_tx_rate( 31 | void *p_dm_void, 32 | u8 comp_steering_num_of_bfer 33 | ); 34 | 35 | #endif 36 | 37 | #if (RTL8822B_SUPPORT == 1) 38 | u8 39 | phydm_get_beamforming_sounding_info( 40 | void *p_dm_void, 41 | u16 *troughput, 42 | u8 total_bfee_num, 43 | u8 *tx_rate 44 | ); 45 | 46 | u8 47 | phydm_get_ndpa_rate( 48 | void *p_dm_void 49 | ); 50 | 51 | u8 52 | phydm_get_mu_bfee_snding_decision( 53 | void *p_dm_void, 54 | u16 throughput 55 | ); 56 | 57 | #else 58 | #define phydm_get_beamforming_sounding_info(p_dm_void, troughput, total_bfee_num, tx_rate) 59 | #define phydm_get_ndpa_rate(p_dm_void) 60 | #define phydm_get_mu_bfee_snding_decision(p_dm_void, troughput) 61 | 62 | #endif 63 | 64 | #endif 65 | #endif 66 | -------------------------------------------------------------------------------- /include/pci_osintf.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef __PCI_OSINTF_H 16 | #define __PCI_OSINTF_H 17 | 18 | #ifdef RTK_129X_PLATFORM 19 | #define PCIE_SLOT1_MEM_START 0x9804F000 20 | #define PCIE_SLOT1_MEM_LEN 0x1000 21 | #define PCIE_SLOT1_CTRL_START 0x9804EC00 22 | 23 | #define PCIE_SLOT2_MEM_START 0x9803C000 24 | #define PCIE_SLOT2_MEM_LEN 0x1000 25 | #define PCIE_SLOT2_CTRL_START 0x9803BC00 26 | 27 | #define PCIE_MASK_OFFSET 0x100 /* mask offset from CTRL_START */ 28 | #define PCIE_TRANSLATE_OFFSET 0x104 /* translate offset from CTRL_START */ 29 | #endif 30 | 31 | #define PCI_BC_CLK_REQ BIT0 32 | #define PCI_BC_ASPM_L0s BIT1 33 | #define PCI_BC_ASPM_L1 BIT2 34 | #define PCI_BC_ASPM_L1Off BIT3 35 | //#define PCI_BC_ASPM_LTR BIT4 36 | //#define PCI_BC_ASPM_OBFF BIT5 37 | 38 | void rtw_pci_disable_aspm(_adapter *padapter); 39 | void rtw_pci_enable_aspm(_adapter *padapter); 40 | void PlatformClearPciPMEStatus(PADAPTER Adapter); 41 | void rtw_pci_aspm_config(_adapter *padapter); 42 | void rtw_pci_aspm_config_l1off_general(_adapter *padapter, u8 eanble); 43 | #ifdef CONFIG_64BIT_DMA 44 | u8 PlatformEnableDMA64(PADAPTER Adapter); 45 | #endif 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /hal/phydm/phydm_cfotracking.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | 16 | #ifndef __PHYDMCFOTRACK_H__ 17 | #define __PHYDMCFOTRACK_H__ 18 | 19 | #define CFO_TRACKING_VERSION "1.4" /*2015.10.01 Stanley, Modify for 8822B*/ 20 | 21 | #define CFO_TH_XTAL_HIGH 20 /* kHz */ 22 | #define CFO_TH_XTAL_LOW 10 /* kHz */ 23 | #define CFO_TH_ATC 80 /* kHz */ 24 | 25 | struct phydm_cfo_track_struct { 26 | boolean is_atc_status; 27 | boolean large_cfo_hit; 28 | boolean is_adjust; 29 | u8 crystal_cap; 30 | u8 def_x_cap; 31 | s32 CFO_tail[4]; 32 | u32 CFO_cnt[4]; 33 | s32 CFO_ave_pre; 34 | u32 packet_count; 35 | u32 packet_count_pre; 36 | 37 | boolean is_force_xtal_cap; 38 | boolean is_reset; 39 | }; 40 | 41 | void 42 | phydm_set_crystal_cap( 43 | void *p_dm_void, 44 | u8 crystal_cap 45 | ); 46 | 47 | void 48 | odm_cfo_tracking_reset( 49 | void *p_dm_void 50 | ); 51 | 52 | void 53 | phydm_cfo_tracking_init( 54 | void *p_dm_void 55 | ); 56 | 57 | void 58 | odm_cfo_tracking( 59 | void *p_dm_void 60 | ); 61 | 62 | void 63 | odm_parsing_cfo( 64 | void *p_dm_void, 65 | void *p_pktinfo_void, 66 | s8 *pcfotail, 67 | u8 num_ss 68 | ); 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /hal/phydm/txbf/haltxbf8192e.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2016 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef __HAL_TXBF_8192E_H__ 16 | #define __HAL_TXBF_8192E_H__ 17 | 18 | #if (RTL8192E_SUPPORT == 1) 19 | #if (BEAMFORMING_SUPPORT == 1) 20 | 21 | void 22 | hal_txbf_8192e_set_ndpa_rate( 23 | void *p_dm_void, 24 | u8 BW, 25 | u8 rate 26 | ); 27 | 28 | void 29 | hal_txbf_8192e_enter( 30 | void *p_dm_void, 31 | u8 idx 32 | ); 33 | 34 | 35 | void 36 | hal_txbf_8192e_leave( 37 | void *p_dm_void, 38 | u8 idx 39 | ); 40 | 41 | 42 | void 43 | hal_txbf_8192e_status( 44 | void *p_dm_void, 45 | u8 idx 46 | ); 47 | 48 | 49 | void 50 | hal_txbf_8192e_fw_tx_bf( 51 | void *p_dm_void, 52 | u8 idx 53 | ); 54 | #else 55 | 56 | #define hal_txbf_8192e_set_ndpa_rate(p_dm_void, BW, rate) 57 | #define hal_txbf_8192e_enter(p_dm_void, idx) 58 | #define hal_txbf_8192e_leave(p_dm_void, idx) 59 | #define hal_txbf_8192e_status(p_dm_void, idx) 60 | #define hal_txbf_8192e_fw_tx_bf(p_dm_void, idx) 61 | 62 | #endif 63 | 64 | #else 65 | 66 | #define hal_txbf_8192e_set_ndpa_rate(p_dm_void, BW, rate) 67 | #define hal_txbf_8192e_enter(p_dm_void, idx) 68 | #define hal_txbf_8192e_leave(p_dm_void, idx) 69 | #define hal_txbf_8192e_status(p_dm_void, idx) 70 | #define hal_txbf_8192e_fw_tx_bf(p_dm_void, idx) 71 | 72 | #endif 73 | 74 | #endif 75 | -------------------------------------------------------------------------------- /include/sdio_ops_xp.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef _SDIO_OPS_XP_H_ 16 | #define _SDIO_OPS_XP_H_ 17 | 18 | #include 19 | #include 20 | #include 21 | #include 22 | 23 | 24 | #ifdef PLATFORM_OS_XP 25 | 26 | 27 | extern u8 sdbus_cmd52r_xp(struct intf_priv *pintfpriv, u32 addr); 28 | 29 | 30 | extern void sdbus_cmd52w_xp(struct intf_priv *pintfpriv, u32 addr, u8 val8); 31 | 32 | 33 | uint sdbus_read_blocks_to_membuf_xp(struct intf_priv *pintfpriv, u32 addr, u32 cnt, u8 *pbuf); 34 | 35 | extern uint sdbus_read_bytes_to_membuf_xp(struct intf_priv *pintfpriv, u32 addr, u32 cnt, u8 *pbuf); 36 | 37 | 38 | extern uint sdbus_write_blocks_from_membuf_xp(struct intf_priv *pintfpriv, u32 addr, u32 cnt, u8 *pbuf, u8 async); 39 | 40 | extern uint sdbus_write_bytes_from_membuf_xp(struct intf_priv *pintfpriv, u32 addr, u32 cnt, u8 *pbuf); 41 | extern u8 sdbus_func1cmd52r_xp(struct intf_priv *pintfpriv, u32 addr); 42 | extern void sdbus_func1cmd52w_xp(struct intf_priv *pintfpriv, u32 addr, u8 val8); 43 | extern uint sdbus_read_reg(struct intf_priv *pintfpriv, u32 addr, u32 cnt, void *pdata); 44 | extern uint sdbus_write_reg(struct intf_priv *pintfpriv, u32 addr, u32 cnt, void *pdata); 45 | extern void sdio_read_int(_adapter *padapter, u32 addr, u8 sz, void *pdata); 46 | 47 | #endif 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /include/sdio_ops_ce.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef _SDIO_OPS_WINCE_H_ 16 | #define _SDIO_OPS_WINCE_H_ 17 | 18 | #include 19 | #include 20 | #include 21 | #include 22 | 23 | 24 | #ifdef PLATFORM_OS_CE 25 | 26 | 27 | extern u8 sdbus_cmd52r_ce(struct intf_priv *pintfpriv, u32 addr); 28 | 29 | 30 | extern void sdbus_cmd52w_ce(struct intf_priv *pintfpriv, u32 addr, u8 val8); 31 | 32 | 33 | uint sdbus_read_blocks_to_membuf_ce(struct intf_priv *pintfpriv, u32 addr, u32 cnt, u8 *pbuf); 34 | 35 | extern uint sdbus_read_bytes_to_membuf_ce(struct intf_priv *pintfpriv, u32 addr, u32 cnt, u8 *pbuf); 36 | 37 | 38 | extern uint sdbus_write_blocks_from_membuf_ce(struct intf_priv *pintfpriv, u32 addr, u32 cnt, u8 *pbuf, u8 async); 39 | 40 | extern uint sdbus_write_bytes_from_membuf_ce(struct intf_priv *pintfpriv, u32 addr, u32 cnt, u8 *pbuf); 41 | extern u8 sdbus_func1cmd52r_ce(struct intf_priv *pintfpriv, u32 addr); 42 | extern void sdbus_func1cmd52w_ce(struct intf_priv *pintfpriv, u32 addr, u8 val8); 43 | extern uint sdbus_read_reg(struct intf_priv *pintfpriv, u32 addr, u32 cnt, void *pdata); 44 | extern uint sdbus_write_reg(struct intf_priv *pintfpriv, u32 addr, u32 cnt, void *pdata); 45 | extern void sdio_read_int(_adapter *padapter, u32 addr, u8 sz, void *pdata); 46 | 47 | #endif 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /include/usb_hal.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef __USB_HAL_H__ 16 | #define __USB_HAL_H__ 17 | 18 | int usb_init_recv_priv(_adapter *padapter, u16 ini_in_buf_sz); 19 | void usb_free_recv_priv(_adapter *padapter, u16 ini_in_buf_sz); 20 | #ifdef CONFIG_FW_C2H_REG 21 | void usb_c2h_hisr_hdl(_adapter *adapter, u8 *buf); 22 | #endif 23 | 24 | u8 rtw_set_hal_ops(_adapter *padapter); 25 | 26 | #ifdef CONFIG_RTL8188E 27 | void rtl8188eu_set_hal_ops(_adapter *padapter); 28 | #endif 29 | 30 | #if defined(CONFIG_RTL8812A) || defined(CONFIG_RTL8821A) 31 | void rtl8812au_set_hal_ops(_adapter *padapter); 32 | #endif 33 | 34 | #ifdef CONFIG_RTL8192E 35 | void rtl8192eu_set_hal_ops(_adapter *padapter); 36 | #endif 37 | 38 | 39 | #ifdef CONFIG_RTL8723B 40 | void rtl8723bu_set_hal_ops(_adapter *padapter); 41 | #endif 42 | 43 | #ifdef CONFIG_RTL8814A 44 | void rtl8814au_set_hal_ops(_adapter *padapter); 45 | #endif /* CONFIG_RTL8814A */ 46 | 47 | #ifdef CONFIG_RTL8188F 48 | void rtl8188fu_set_hal_ops(_adapter *padapter); 49 | #endif 50 | 51 | #ifdef CONFIG_RTL8703B 52 | void rtl8703bu_set_hal_ops(_adapter *padapter); 53 | #endif 54 | 55 | #ifdef CONFIG_RTL8723D 56 | void rtl8723du_set_hal_ops(_adapter *padapter); 57 | #endif 58 | 59 | #ifdef CONFIG_INTEL_PROXIM 60 | extern _adapter *rtw_usb_get_sw_pointer(void); 61 | #endif /* CONFIG_INTEL_PROXIM */ 62 | #endif /* __USB_HAL_H__ */ 63 | -------------------------------------------------------------------------------- /hal/phydm/phydm_math_lib.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | 16 | 17 | #ifndef __PHYDM_MATH_LIB_H__ 18 | #define __PHYDM_MATH_LIB_H__ 19 | 20 | #define AUTO_MATH_LIB_VERSION "1.0" /* 2017.06.06*/ 21 | 22 | 23 | /* 1 ============================================================ 24 | * 1 Definition 25 | * 1 ============================================================ */ 26 | 27 | 28 | 29 | 30 | /* 1 ============================================================ 31 | * 1 enumeration 32 | * 1 ============================================================ */ 33 | 34 | 35 | 36 | /* 1 ============================================================ 37 | * 1 structure 38 | * 1 ============================================================ */ 39 | 40 | 41 | /* 1 ============================================================ 42 | * 1 function prototype 43 | * 1 ============================================================ */ 44 | 45 | s32 46 | odm_pwdb_conversion( 47 | s32 X, 48 | u32 total_bit, 49 | u32 decimal_bit 50 | ); 51 | 52 | s32 53 | odm_sign_conversion( 54 | s32 value, 55 | u32 total_bit 56 | ); 57 | 58 | void 59 | phydm_seq_sorting( 60 | void *p_dm_void, 61 | u32 *p_value, 62 | u32 *rank_idx, 63 | u32 *p_idx_out, 64 | u8 seq_length 65 | ); 66 | 67 | u32 68 | odm_convert_to_db( 69 | u32 value 70 | ); 71 | 72 | u32 73 | odm_convert_to_linear( 74 | u32 value 75 | ); 76 | 77 | #endif 78 | -------------------------------------------------------------------------------- /hal/phydm/rtl8192e/halhwimg8192e_bb.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | 16 | /*Image2HeaderVersion: 2.18*/ 17 | #if (RTL8192E_SUPPORT == 1) 18 | #ifndef __INC_MP_BB_HW_IMG_8192E_H 19 | #define __INC_MP_BB_HW_IMG_8192E_H 20 | 21 | 22 | /****************************************************************************** 23 | * AGC_TAB.TXT 24 | ******************************************************************************/ 25 | 26 | void 27 | odm_read_and_config_mp_8192e_agc_tab(/* TC: Test Chip, MP: MP Chip*/ 28 | struct PHY_DM_STRUCT *p_dm_odm 29 | ); 30 | u32 odm_get_version_mp_8192e_agc_tab(void); 31 | 32 | /****************************************************************************** 33 | * PHY_REG.TXT 34 | ******************************************************************************/ 35 | 36 | void 37 | odm_read_and_config_mp_8192e_phy_reg(/* TC: Test Chip, MP: MP Chip*/ 38 | struct PHY_DM_STRUCT *p_dm_odm 39 | ); 40 | u32 odm_get_version_mp_8192e_phy_reg(void); 41 | 42 | /****************************************************************************** 43 | * PHY_REG_PG.TXT 44 | ******************************************************************************/ 45 | 46 | void 47 | odm_read_and_config_mp_8192e_phy_reg_pg(/* TC: Test Chip, MP: MP Chip*/ 48 | struct PHY_DM_STRUCT *p_dm_odm 49 | ); 50 | u32 odm_get_version_mp_8192e_phy_reg_pg(void); 51 | 52 | #endif 53 | #endif /* end of HWIMG_SUPPORT*/ 54 | -------------------------------------------------------------------------------- /include/rtw_sreset.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef _RTW_SRESET_H_ 16 | #define _RTW_SRESET_H_ 17 | 18 | /* #include */ 19 | 20 | enum { 21 | SRESET_TGP_NULL = 0, 22 | SRESET_TGP_XMIT_STATUS = 1, 23 | SRESET_TGP_LINK_STATUS = 2, 24 | SRESET_TGP_INFO = 99, 25 | }; 26 | 27 | struct sreset_priv { 28 | _mutex silentreset_mutex; 29 | u8 silent_reset_inprogress; 30 | u8 Wifi_Error_Status; 31 | systime last_tx_time; 32 | systime last_tx_complete_time; 33 | 34 | s32 dbg_trigger_point; 35 | u64 self_dect_tx_cnt; 36 | u64 self_dect_rx_cnt; 37 | u64 self_dect_fw_cnt; 38 | u64 tx_dma_status_cnt; 39 | u64 rx_dma_status_cnt; 40 | u8 rx_cnt; 41 | u8 self_dect_fw; 42 | u8 self_dect_case; 43 | u16 last_mac_rxff_ptr; 44 | u8 dbg_sreset_ctrl; 45 | }; 46 | 47 | 48 | 49 | #define WIFI_STATUS_SUCCESS 0 50 | #define USB_VEN_REQ_CMD_FAIL BIT0 51 | #define USB_READ_PORT_FAIL BIT1 52 | #define USB_WRITE_PORT_FAIL BIT2 53 | #define WIFI_MAC_TXDMA_ERROR BIT3 54 | #define WIFI_TX_HANG BIT4 55 | #define WIFI_RX_HANG BIT5 56 | #define WIFI_IF_NOT_EXIST BIT6 57 | 58 | void sreset_init_value(_adapter *padapter); 59 | void sreset_reset_value(_adapter *padapter); 60 | u8 sreset_get_wifi_status(_adapter *padapter); 61 | void sreset_set_wifi_error_status(_adapter *padapter, u32 status); 62 | void sreset_set_trigger_point(_adapter *padapter, s32 tgp); 63 | bool sreset_inprogress(_adapter *padapter); 64 | void sreset_reset(_adapter *padapter); 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /docs/MODES.md: -------------------------------------------------------------------------------- 1 | Monitor Mode 2 | ============ 3 | 4 | Interface can be both identified as `wlan0` or `wlp1s0`. It may depend on how much wireless devices are connected.
5 | Use the command to list all the available interfaces: 6 | ```sh 7 | ip address 8 | ``` 9 | 10 | Use these steps to enter monitor mode. 11 | 12 | | Init System | Command | 13 | |-----------------|---------------------------------------------| 14 | | OpenRC | rc-service NetworkManager stop | 15 | | SystemD | systemctl stop NetworkManager.service | 16 | 17 | ```sh 18 | ip link set down 19 | iw dev set type monitor 20 | ip link set name # optional 21 | ``` 22 | Note: `new_interface_name` can be anything such as `[wlan0mon, mon0, monitor0]`. 23 | 24 | Frame injection test may be performed with.
25 | (after kernel v5.2 scanning is slow, run a scan or simply an airodump-ng first!) 26 | 27 | ```sh 28 | aireplay-ng -9 29 | ``` 30 | 31 | Managed Mode 32 | ============ 33 | 34 | Use these steps to disable monitor mode. (not possible if your device's MAC address is added to `unmanaged-devices` variable under "NetworkManager.conf") 35 | 36 | | Init System | Command | 37 | |-----------------|---------------------------------------------| 38 | | OpenRC | rc-service NetworkManager start | 39 | | SystemD | systemctl start NetworkManager.service | 40 | 41 | ```sh 42 | iw dev set type managed 43 | ip link set name # optional 44 | ip link set up 45 | ``` 46 | Note: Most of the cases the `old_interface_name` is wlan0. 47 | 48 | If the adapter still refuses to go back, try: 49 | 50 | | Init System | Command | 51 | |-----------------|-----------------------------------------------| 52 | | OpenRC | rc-service NetworkManager restart | 53 | | SystemD | systemctl restart NetworkManager.service | 54 | 55 | [Building](./BUILDING.md) | [NetworkManager configuration](./NETWORKMANAGER.md) 56 | -------------------------------------------------------------------------------- /hal/phydm/rtl8192e/phydm_regconfig8192e.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef __INC_ODM_REGCONFIG_H_8192E 16 | #define __INC_ODM_REGCONFIG_H_8192E 17 | 18 | #if (RTL8192E_SUPPORT == 1) 19 | 20 | void 21 | odm_config_rf_reg_8192e( 22 | struct PHY_DM_STRUCT *p_dm, 23 | u32 addr, 24 | u32 data, 25 | enum rf_path RF_PATH, 26 | u32 reg_addr 27 | ); 28 | 29 | void 30 | odm_config_rf_radio_a_8192e( 31 | struct PHY_DM_STRUCT *p_dm, 32 | u32 addr, 33 | u32 data 34 | ); 35 | 36 | void 37 | odm_config_rf_radio_b_8192e( 38 | struct PHY_DM_STRUCT *p_dm, 39 | u32 addr, 40 | u32 data 41 | ); 42 | 43 | void 44 | odm_config_mac_8192e( 45 | struct PHY_DM_STRUCT *p_dm, 46 | u32 addr, 47 | u8 data 48 | ); 49 | 50 | void 51 | odm_config_bb_agc_8192e( 52 | struct PHY_DM_STRUCT *p_dm, 53 | u32 addr, 54 | u32 bitmask, 55 | u32 data 56 | ); 57 | 58 | void 59 | odm_config_bb_phy_reg_pg_8192e( 60 | struct PHY_DM_STRUCT *p_dm, 61 | u32 band, 62 | u32 rf_path, 63 | u32 tx_num, 64 | u32 addr, 65 | u32 bitmask, 66 | u32 data 67 | ); 68 | 69 | void 70 | odm_config_bb_phy_8192e( 71 | struct PHY_DM_STRUCT *p_dm, 72 | u32 addr, 73 | u32 bitmask, 74 | u32 data 75 | ); 76 | 77 | void 78 | odm_config_bb_txpwr_lmt_8192e( 79 | struct PHY_DM_STRUCT *p_dm, 80 | u8 *regulation, 81 | u8 *band, 82 | u8 *bandwidth, 83 | u8 *rate_section, 84 | u8 *rf_path, 85 | u8 *channel, 86 | u8 *power_limit 87 | ); 88 | 89 | 90 | #endif 91 | #endif /* end of SUPPORT */ 92 | -------------------------------------------------------------------------------- /hal/phydm/phydm_psd.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | 16 | #ifndef __PHYDMPSD_H__ 17 | #define __PHYDMPSD_H__ 18 | 19 | /*#define PSD_VERSION "1.0"*/ /*2016.09.22 Dino*/ 20 | #define PSD_VERSION "1.1" /*2016.10.07 Dino, Add Option for PSD Tone index Selection */ 21 | 22 | #ifdef CONFIG_PSD_TOOL 23 | 24 | 25 | struct _PHYDM_PSD_ { 26 | 27 | u8 psd_in_progress; 28 | u32 psd_reg; 29 | u32 psd_report_reg; 30 | u8 psd_pwr_common_offset; 31 | u16 sw_avg_time; 32 | u16 fft_smp_point; 33 | u32 initial_gain_backup; 34 | u32 rf_0x18_bkp; 35 | u32 rf_0x18_bkp_b; 36 | u16 psd_fc_channel; 37 | u32 psd_bw_rf_reg; 38 | u8 psd_result[128]; 39 | u8 noise_k_en; 40 | }; 41 | 42 | u32 43 | phydm_get_psd_data( 44 | void *p_dm_void, 45 | u32 psd_tone_idx, 46 | u32 igi 47 | ); 48 | 49 | void 50 | phydm_psd_debug( 51 | void *p_dm_void, 52 | char input[][16], 53 | u32 *_used, 54 | char *output, 55 | u32 *_out_len, 56 | u32 input_num 57 | ); 58 | 59 | void 60 | phydm_psd( 61 | void *p_dm_void, 62 | u32 igi, 63 | u16 start_point, 64 | u16 stop_point 65 | ); 66 | 67 | void 68 | phydm_psd_para_setting( 69 | void *p_dm_void, 70 | u8 sw_avg_time, 71 | u8 hw_avg_time, 72 | u8 i_q_setting, 73 | u16 fft_smp_point, 74 | u8 ant_sel, 75 | u8 psd_input, 76 | u8 channel, 77 | u8 noise_k_en 78 | ); 79 | 80 | void 81 | phydm_psd_init( 82 | void *p_dm_void 83 | ); 84 | 85 | u8 86 | phydm_get_psd_result_table( 87 | void *p_dm_void, 88 | int index 89 | ); 90 | 91 | #endif 92 | #endif 93 | 94 | -------------------------------------------------------------------------------- /hal/phydm/phydm_rssi_monitor.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | 16 | 17 | #ifndef __PHYDM_RSSI_MONITOR_H__ 18 | #define __PHYDM_RSSI_MONITOR_H__ 19 | 20 | #define RSSI_MONITOR_VERSION "1.0" /* 2017.05.011 Dino, Add phydm_rssi_monitor.h*/ 21 | 22 | 23 | /* 1 ============================================================ 24 | * 1 Definition 25 | * 1 ============================================================ */ 26 | 27 | #define H2C_0X42_LENGTH 5 28 | 29 | #define RAINFO_BE_RX_STATE BIT(0) /* 1:RX*/ /* ULDL */ 30 | #define RAINFO_STBC_STATE BIT(1) 31 | #define RAINFO_NOISY_STATE BIT(2) /* set by Noisy_Detection */ 32 | /*#define RAINFO_SHURTCUT_STATE BIT(3)*/ 33 | /*#define RAINFO_SHURTCUT_FLAG BIT(4)*/ 34 | #define RAINFO_INIT_RSSI_RATE_STATE BIT(5) 35 | #define RAINFO_BF_STATE BIT(6) 36 | #define RAINFO_BE_TX_STATE BIT(7) /* 1:TX */ 37 | 38 | /* 1 ============================================================ 39 | * 1 structure 40 | * 1 ============================================================ */ 41 | 42 | 43 | 44 | 45 | /* 1 ============================================================ 46 | * 1 enumeration 47 | * 1 ============================================================ */ 48 | 49 | 50 | 51 | /* 1 ============================================================ 52 | * 1 function prototype 53 | * 1 ============================================================ */ 54 | 55 | void 56 | phydm_rssi_monitor_check( 57 | void *p_dm_void 58 | ); 59 | 60 | void 61 | phydm_rssi_monitor_init( 62 | void *p_dm_void 63 | ); 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /include/rtl8822bu_hal.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2015 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef _RTL8822BU_HAL_H_ 16 | #define _RTL8822BU_HAL_H_ 17 | 18 | #ifdef CONFIG_USB_HCI 19 | #include /* PADAPTER */ 20 | 21 | #ifdef CONFIG_USB_HCI 22 | #ifdef USB_PACKET_OFFSET_SZ 23 | #define PACKET_OFFSET_SZ (USB_PACKET_OFFSET_SZ) 24 | #else 25 | #define PACKET_OFFSET_SZ (8) 26 | #endif 27 | #define TXDESC_OFFSET (TXDESC_SIZE + PACKET_OFFSET_SZ) 28 | #endif 29 | 30 | /* undefine MAX_RECVBUF_SZ from rtl8822b_hal.h */ 31 | #ifdef MAX_RECVBUF_SZ 32 | #undef MAX_RECVBUF_SZ 33 | #endif 34 | 35 | /* recv_buffer must be large than usb agg size */ 36 | #ifndef MAX_RECVBUF_SZ 37 | #ifdef PLATFORM_OS_CE 38 | #define MAX_RECVBUF_SZ (8192+1024) 39 | #else /* !PLATFORM_OS_CE */ 40 | #ifndef CONFIG_MINIMAL_MEMORY_USAGE 41 | #ifdef CONFIG_PLATFORM_NOVATEK_NT72668 42 | #define MAX_RECVBUF_SZ (15360) /* 15k */ 43 | #elif defined(CONFIG_PLATFORM_HISILICON) 44 | /* use 16k to workaround for HISILICON platform */ 45 | #define MAX_RECVBUF_SZ (16384) 46 | #else 47 | #define MAX_RECVBUF_SZ (32768) 48 | #endif 49 | #else 50 | #define MAX_RECVBUF_SZ (4000) 51 | #endif 52 | #endif /* PLATFORM_OS_CE */ 53 | #endif /* !MAX_RECVBUF_SZ */ 54 | 55 | /* rtl8822bu_ops.c */ 56 | void rtl8822bu_set_hal_ops(PADAPTER padapter); 57 | void rtl8822bu_set_hw_type(struct dvobj_priv *pdvobj); 58 | 59 | /* rtl8822bu_io.c */ 60 | void rtl8822bu_set_intf_ops(struct _io_ops *pops); 61 | 62 | #endif /* CONFIG_USB_HCI */ 63 | 64 | 65 | #endif /* _RTL8822BU_HAL_H_ */ 66 | -------------------------------------------------------------------------------- /include/usb_vendor_req.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef _USB_VENDOR_REQUEST_H_ 16 | #define _USB_VENDOR_REQUEST_H_ 17 | 18 | /* 4 Set/Get Register related wIndex/Data */ 19 | #define RT_USB_RESET_MASK_OFF 0 20 | #define RT_USB_RESET_MASK_ON 1 21 | #define RT_USB_SLEEP_MASK_OFF 0 22 | #define RT_USB_SLEEP_MASK_ON 1 23 | #define RT_USB_LDO_ON 1 24 | #define RT_USB_LDO_OFF 0 25 | 26 | /* 4 Set/Get SYSCLK related wValue or Data */ 27 | #define RT_USB_SYSCLK_32KHZ 0 28 | #define RT_USB_SYSCLK_40MHZ 1 29 | #define RT_USB_SYSCLK_60MHZ 2 30 | 31 | 32 | typedef enum _RT_USB_BREQUEST { 33 | RT_USB_SET_REGISTER = 1, 34 | RT_USB_SET_SYSCLK = 2, 35 | RT_USB_GET_SYSCLK = 3, 36 | RT_USB_GET_REGISTER = 4 37 | } RT_USB_BREQUEST; 38 | 39 | 40 | typedef enum _RT_USB_WVALUE { 41 | RT_USB_RESET_MASK = 1, 42 | RT_USB_SLEEP_MASK = 2, 43 | RT_USB_USB_HRCPWM = 3, 44 | RT_USB_LDO = 4, 45 | RT_USB_BOOT_TYPE = 5 46 | } RT_USB_WVALUE; 47 | 48 | 49 | #if 0 50 | BOOLEAN usbvendorrequest(PCE_USB_DEVICE CEdevice, RT_USB_BREQUEST bRequest, RT_USB_WVALUE wValue, UCHAR wIndex, PVOID Data, UCHAR DataLength, BOOLEAN isDirectionIn); 51 | BOOLEAN CEusbGetStatusRequest(PCE_USB_DEVICE CEdevice, IN USHORT Op, IN USHORT Index, PVOID Data); 52 | BOOLEAN CEusbFeatureRequest(PCE_USB_DEVICE CEdevice, IN USHORT Op, IN USHORT FeatureSelector, IN USHORT Index); 53 | BOOLEAN CEusbGetDescriptorRequest(PCE_USB_DEVICE CEdevice, IN short urbLength, IN UCHAR DescriptorType, IN UCHAR Index, IN USHORT LanguageId, IN PVOID TransferBuffer, IN ULONG TransferBufferLength); 54 | #endif 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /os_dep/linux/rtw_proc.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef __RTW_PROC_H__ 16 | #define __RTW_PROC_H__ 17 | 18 | #include 19 | #include 20 | 21 | #define RTW_PROC_HDL_TYPE_SEQ 0 22 | #define RTW_PROC_HDL_TYPE_SSEQ 1 23 | 24 | struct rtw_proc_hdl { 25 | char *name; 26 | u8 type; 27 | union { 28 | int (*show)(struct seq_file *, void *); 29 | struct seq_operations *seq_op; 30 | } u; 31 | ssize_t (*write)(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 32 | }; 33 | 34 | #define RTW_PROC_HDL_SEQ(_name, _seq_op, _write) \ 35 | { .name = _name, .type = RTW_PROC_HDL_TYPE_SEQ, .u.seq_op = _seq_op, .write = _write} 36 | 37 | #define RTW_PROC_HDL_SSEQ(_name, _show, _write) \ 38 | { .name = _name, .type = RTW_PROC_HDL_TYPE_SSEQ, .u.show = _show, .write = _write} 39 | 40 | #ifdef CONFIG_PROC_DEBUG 41 | 42 | struct proc_dir_entry *get_rtw_drv_proc(void); 43 | int rtw_drv_proc_init(void); 44 | void rtw_drv_proc_deinit(void); 45 | struct proc_dir_entry *rtw_adapter_proc_init(struct net_device *dev); 46 | void rtw_adapter_proc_deinit(struct net_device *dev); 47 | void rtw_adapter_proc_replace(struct net_device *dev); 48 | 49 | #else /* !CONFIG_PROC_DEBUG */ 50 | 51 | #define get_rtw_drv_proc() NULL 52 | #define rtw_drv_proc_init() 0 53 | #define rtw_drv_proc_deinit() do {} while (0) 54 | #define rtw_adapter_proc_init(dev) NULL 55 | #define rtw_adapter_proc_deinit(dev) do {} while (0) 56 | #define rtw_adapter_proc_replace(dev) do {} while (0) 57 | 58 | #endif /* !CONFIG_PROC_DEBUG */ 59 | 60 | #endif /* __RTW_PROC_H__ */ 61 | -------------------------------------------------------------------------------- /include/rtw_br_ext.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef _RTW_BR_EXT_H_ 16 | #define _RTW_BR_EXT_H_ 17 | 18 | #if 1 /* rtw_wifi_driver */ 19 | #define CL_IPV6_PASS 1 20 | #define MACADDRLEN 6 21 | #define _DEBUG_ERR RTW_INFO 22 | #define _DEBUG_INFO /* RTW_INFO */ 23 | #define DEBUG_WARN RTW_INFO 24 | #define DEBUG_INFO /* RTW_INFO */ 25 | #define DEBUG_ERR RTW_INFO 26 | /* #define GET_MY_HWADDR ((GET_MIB(priv))->dot11OperationEntry.hwaddr) */ 27 | #define GET_MY_HWADDR(padapter) (adapter_mac_addr(padapter)) 28 | #endif /* rtw_wifi_driver */ 29 | 30 | #define NAT25_HASH_BITS 4 31 | #define NAT25_HASH_SIZE (1 << NAT25_HASH_BITS) 32 | #define NAT25_AGEING_TIME 300 33 | 34 | #ifdef CL_IPV6_PASS 35 | #define MAX_NETWORK_ADDR_LEN 17 36 | #else 37 | #define MAX_NETWORK_ADDR_LEN 11 38 | #endif 39 | 40 | struct nat25_network_db_entry { 41 | struct nat25_network_db_entry *next_hash; 42 | struct nat25_network_db_entry **pprev_hash; 43 | atomic_t use_count; 44 | unsigned char macAddr[6]; 45 | unsigned long ageing_timer; 46 | unsigned char networkAddr[MAX_NETWORK_ADDR_LEN]; 47 | }; 48 | 49 | enum NAT25_METHOD { 50 | NAT25_MIN, 51 | NAT25_CHECK, 52 | NAT25_INSERT, 53 | NAT25_LOOKUP, 54 | NAT25_PARSE, 55 | NAT25_MAX 56 | }; 57 | 58 | struct br_ext_info { 59 | unsigned int nat25_disable; 60 | unsigned int macclone_enable; 61 | unsigned int dhcp_bcst_disable; 62 | int addPPPoETag; /* 1: Add PPPoE relay-SID, 0: disable */ 63 | unsigned char nat25_dmzMac[MACADDRLEN]; 64 | unsigned int nat25sc_disable; 65 | }; 66 | 67 | void nat25_db_cleanup(_adapter *priv); 68 | 69 | #endif /* _RTW_BR_EXT_H_ */ 70 | -------------------------------------------------------------------------------- /hal/phydm/phydm_pow_train.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | 16 | 17 | #ifndef __PHYDM_POW_TRAIN_H__ 18 | #define __PHYDM_POW_TRAIN_H__ 19 | 20 | #define POW_TRAIN_VERSION "1.0" /* 2017.07.0141 Dino, Add phydm_pow_train.h*/ 21 | 22 | 23 | /* 1 ============================================================ 24 | * 1 Definition 25 | * 1 ============================================================ */ 26 | 27 | 28 | #ifdef PHYDM_POWER_TRAINING_SUPPORT 29 | /* 1 ============================================================ 30 | * 1 structure 31 | * 1 ============================================================ */ 32 | 33 | 34 | struct phydm_pow_train_stuc { 35 | 36 | u8 force_power_training_state; 37 | u32 pow_train_score; 38 | }; 39 | 40 | /* 1 ============================================================ 41 | * 1 enumeration 42 | * 1 ============================================================ */ 43 | 44 | 45 | enum pow_train_state_e { 46 | DYNAMIC_POW_TRAIN = 0, 47 | ENABLE_POW_TRAIN = 1, 48 | DISABLE_POW_TRAIN = 2 49 | }; 50 | 51 | enum power_training_score { 52 | DISABLE_PT_SCORE = 0, 53 | KEEP_PRE_PT_SCORE = 1, 54 | ENABLE_PT_SCORE = 2 55 | }; 56 | 57 | /* 1 ============================================================ 58 | * 1 function prototype 59 | * 1 ============================================================ */ 60 | 61 | void 62 | phydm_update_power_training_state( 63 | void *p_dm_void 64 | ); 65 | 66 | void 67 | phydm_pow_train_debug( 68 | void *p_dm_void, 69 | char input[][16], 70 | u32 *_used, 71 | char *output, 72 | u32 *_out_len, 73 | u32 input_num 74 | ); 75 | 76 | #endif 77 | #endif 78 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | RTL8192EU 2 | ========= 3 | Linux driver for Realtek **RTL8192EU** based on official's **TP Link TL - WN823N V3 Beta** v5.2.19.1 from 2018-05-08
4 | Supports monitor mode and frame injection for penetration testing abilities. 5 | 6 | Trying to find a solution? See [troubleshooting](./docs/TROUBLESHOOTING.md). 7 | 8 | | Support | Tested | Status | Description | 9 | |-------------------|-----------|-----------|---------------------------------------------------| 10 | | Monitor Mode | ✅ | 🔵 | Tested and working. | 11 | | Frame injection | ✅ | 🔵 | Tested and working. | 12 | | Kernel 4.15+ | ✅ | 🟠 | Kernel 6.1.7+ tested. | 13 | 14 | | Devices | Tested | Status | Description | 15 | |-------------------|-----------|-----------|---------------------------------------------------| 16 | | DWA-131 | ❌ | 🟡 | Waiting confirmation. | 17 | | GW-300S Katana | ❌ | 🟡 | Waiting confirmation. | 18 | | IWA 3001 | ✅ | 🟢 | Device Starts | 19 | | U1 | ✅ | 🟢 | Device Starts | 20 | | TL-WN821N V6 | ✅ | 🟢 | Device starts. | 21 | | TL-WN822N V5 | ❌ | 🟡 | Waiting confirmation. | 22 | | TL-WN823N V3 | ❌ | 🟡 | Waiting confirmation. | 23 | 24 | Build 25 | ----- 26 | 27 | All the instructions are being moved to the [Documentation](./docs/BUILDING.md) or the [Wiki](https://gitlab.com/KanuX/rtl8192eu/-/wikis/home). 28 | 29 | Credits 30 | ------- 31 | 32 | Realtek - https://www.realtek.com
33 | Project contributors - https://gitlab.com/KanuX/rtl8188eus/-/graphs/master?ref_type=heads 34 | 35 | And all those who are using, requesting support, or teaching. Thanks! 36 | 37 | Original TP Link driver 38 | ----------------------- 39 | https://static.tp-link.com/2018/201805/20180514/TP-Link_Driver_Linux_series8_beta.zip 40 | -------------------------------------------------------------------------------- /hal/efuse/rtl8192e/HalEfuseMask8192E_PCIE.c: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | 16 | /* #include "Mp_Precomp.h" */ 17 | /* #include "../odm_precomp.h" */ 18 | 19 | #include 20 | 21 | #include "HalEfuseMask8192E_PCIE.h" 22 | 23 | /****************************************************************************** 24 | * MPCIE.TXT 25 | ******************************************************************************/ 26 | 27 | u1Byte Array_MP_8192E_MPCIE[] = { 28 | 0xFF, 29 | 0xF7, 30 | 0x00, 31 | 0x0E, 32 | 0xF0, 33 | 0x00, 34 | 0x00, 35 | 0x00, 36 | 0x00, 37 | 0x00, 38 | 0x00, 39 | 0x07, 40 | 0xF3, 41 | 0xF7, 42 | 0x10, 43 | 0x00, 44 | 0x00, 45 | 0x00, 46 | 0x00, 47 | 0x00, 48 | 0x00, 49 | 0x00, 50 | 0x00, 51 | 0x00, 52 | 0x00, 53 | 0x00, 54 | 0x00, 55 | 0x00, 56 | 0x00, 57 | 0x00, 58 | 0x00, 59 | 0x00, 60 | 61 | }; 62 | 63 | u2Byte 64 | EFUSE_GetArrayLen_MP_8192E_MPCIE(VOID) 65 | { 66 | return sizeof(Array_MP_8192E_MPCIE) / sizeof(u1Byte); 67 | } 68 | 69 | VOID 70 | EFUSE_GetMaskArray_MP_8192E_MPCIE( 71 | IN OUT pu1Byte Array 72 | ) 73 | { 74 | u2Byte len = EFUSE_GetArrayLen_MP_8192E_MPCIE(), i = 0; 75 | 76 | for (i = 0; i < len; ++i) 77 | Array[i] = Array_MP_8192E_MPCIE[i]; 78 | } 79 | BOOLEAN 80 | EFUSE_IsAddressMasked_MP_8192E_MPCIE( 81 | IN u2Byte Offset 82 | ) 83 | { 84 | int r = Offset / 16; 85 | int c = (Offset % 16) / 2; 86 | int result = 0; 87 | 88 | if (c < 4) /* Upper double word */ 89 | result = (Array_MP_8192E_MPCIE[r] & (0x10 << c)); 90 | else 91 | result = (Array_MP_8192E_MPCIE[r] & (0x01 << (c - 4))); 92 | 93 | return (result > 0) ? 0 : 1; 94 | } 95 | -------------------------------------------------------------------------------- /hal/btc/halbtc8822bwifionly.c: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2016 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #include "mp_precomp.h" 16 | 17 | 18 | VOID 19 | ex_hal8822b_wifi_only_hw_config( 20 | IN struct wifi_only_cfg *pwifionlycfg 21 | ) 22 | { 23 | /*BB control*/ 24 | halwifionly_phy_set_bb_reg(pwifionlycfg, 0x4c, 0x01800000, 0x2); 25 | /*SW control*/ 26 | halwifionly_phy_set_bb_reg(pwifionlycfg, 0xcb4, 0xff, 0x77); 27 | /*antenna mux switch */ 28 | halwifionly_phy_set_bb_reg(pwifionlycfg, 0x974, 0x300, 0x3); 29 | 30 | halwifionly_phy_set_bb_reg(pwifionlycfg, 0x1990, 0x300, 0x0); 31 | 32 | halwifionly_phy_set_bb_reg(pwifionlycfg, 0xcbc, 0x80000, 0x0); 33 | /*switch to WL side controller and gnt_wl gnt_bt debug signal */ 34 | halwifionly_phy_set_bb_reg(pwifionlycfg, 0x70, 0xff000000, 0x0e); 35 | /*gnt_wl=1 , gnt_bt=0*/ 36 | halwifionly_phy_set_bb_reg(pwifionlycfg, 0x1704, 0xffffffff, 0x7700); 37 | halwifionly_phy_set_bb_reg(pwifionlycfg, 0x1700, 0xffffffff, 0xc00f0038); 38 | } 39 | 40 | VOID 41 | ex_hal8822b_wifi_only_scannotify( 42 | IN struct wifi_only_cfg *pwifionlycfg, 43 | IN u1Byte is_5g 44 | ) 45 | { 46 | hal8822b_wifi_only_switch_antenna(pwifionlycfg, is_5g); 47 | } 48 | 49 | VOID 50 | ex_hal8822b_wifi_only_switchbandnotify( 51 | IN struct wifi_only_cfg *pwifionlycfg, 52 | IN u1Byte is_5g 53 | ) 54 | { 55 | hal8822b_wifi_only_switch_antenna(pwifionlycfg, is_5g); 56 | } 57 | 58 | VOID 59 | hal8822b_wifi_only_switch_antenna(IN struct wifi_only_cfg *pwifionlycfg, 60 | IN u1Byte is_5g 61 | ) 62 | { 63 | 64 | if (is_5g) 65 | halwifionly_phy_set_bb_reg(pwifionlycfg, 0xcbc, 0x300, 0x1); 66 | else 67 | halwifionly_phy_set_bb_reg(pwifionlycfg, 0xcbc, 0x300, 0x2); 68 | } 69 | -------------------------------------------------------------------------------- /hal/phydm/phydm_antdect.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | 16 | #ifndef __PHYDMANTDECT_H__ 17 | #define __PHYDMANTDECT_H__ 18 | 19 | #define ANTDECT_VERSION "2.1" /*2015.07.29 by YuChen*/ 20 | 21 | #if (defined(CONFIG_ANT_DETECTION)) 22 | /* #if( DM_ODM_SUPPORT_TYPE & (ODM_WIN |ODM_CE)) */ 23 | /* ANT Test */ 24 | #define ANTTESTALL 0x00 /*ant A or B will be Testing*/ 25 | #define ANTTESTA 0x01 /*ant A will be Testing*/ 26 | #define ANTTESTB 0x02 /*ant B will be testing*/ 27 | 28 | #define MAX_ANTENNA_DETECTION_CNT 10 29 | 30 | 31 | struct _ANT_DETECTED_INFO { 32 | boolean is_ant_detected; 33 | u32 db_for_ant_a; 34 | u32 db_for_ant_b; 35 | u32 db_for_ant_o; 36 | }; 37 | 38 | 39 | enum dm_swas_e { 40 | antenna_a = 1, 41 | antenna_b = 2, 42 | antenna_max = 3, 43 | }; 44 | 45 | 46 | 47 | /* 1 [1. Single Tone method] =================================================== */ 48 | 49 | 50 | 51 | void 52 | odm_single_dual_antenna_default_setting( 53 | void *p_dm_void 54 | ); 55 | 56 | boolean 57 | odm_single_dual_antenna_detection( 58 | void *p_dm_void, 59 | u8 mode 60 | ); 61 | 62 | /* 1 [2. Scan AP RSSI method] ================================================== */ 63 | 64 | #define sw_ant_div_check_before_link odm_sw_ant_div_check_before_link 65 | 66 | boolean 67 | odm_sw_ant_div_check_before_link( 68 | void *p_dm_void 69 | ); 70 | 71 | 72 | 73 | 74 | /* 1 [3. PSD method] ========================================================== */ 75 | 76 | 77 | void 78 | odm_single_dual_antenna_detection_psd( 79 | void *p_dm_void 80 | ); 81 | 82 | #endif 83 | 84 | void 85 | odm_sw_ant_detect_init( 86 | void *p_dm_void 87 | ); 88 | 89 | 90 | #endif 91 | -------------------------------------------------------------------------------- /include/rtw_qos.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | 16 | 17 | #ifndef _RTW_QOS_H_ 18 | #define _RTW_QOS_H_ 19 | 20 | #define DRV_CFG_UAPSD_VO BIT0 21 | #define DRV_CFG_UAPSD_VI BIT1 22 | #define DRV_CFG_UAPSD_BK BIT2 23 | #define DRV_CFG_UAPSD_BE BIT3 24 | 25 | #define WMM_IE_UAPSD_VO BIT0 26 | #define WMM_IE_UAPSD_VI BIT1 27 | #define WMM_IE_UAPSD_BK BIT2 28 | #define WMM_IE_UAPSD_BE BIT3 29 | 30 | #define WMM_TID0 BIT0 31 | #define WMM_TID1 BIT1 32 | #define WMM_TID2 BIT2 33 | #define WMM_TID3 BIT3 34 | #define WMM_TID4 BIT4 35 | #define WMM_TID5 BIT5 36 | #define WMM_TID6 BIT6 37 | #define WMM_TID7 BIT7 38 | 39 | #define AP_SUPPORTED_UAPSD BIT7 40 | /* TC = Traffic Category, TID0~7 represents TC */ 41 | #define BIT_MASK_TID_TC 0xff 42 | /* TS = Traffic Stream, TID8~15 represents TS */ 43 | #define BIT_MASK_TID_TS 0xff00 44 | #define ALL_TID_TC_SUPPORTED_UAPSD 0xff 45 | 46 | struct qos_priv { 47 | 48 | unsigned int qos_option; /* bit mask option: u-apsd, s-apsd, ts, block ack... */ 49 | 50 | #ifdef CONFIG_WMMPS_STA 51 | /* uapsd (unscheduled automatic power-save delivery) = a kind of wmmps */ 52 | u8 uapsd_max_sp_len; 53 | /* declare uapsd_tid as a bitmap for the uapsd setting of TID 0~15 */ 54 | u16 uapsd_tid; 55 | /* declare uapsd_tid_delivery_enabled as a bitmap for the delivery-enabled setting of TID 0~7 */ 56 | u8 uapsd_tid_delivery_enabled; 57 | /* declare uapsd_tid_trigger_enabled as a bitmap for the trigger-enabled setting of TID 0~7 */ 58 | u8 uapsd_tid_trigger_enabled; 59 | /* declare uapsd_ap_supported to record whether the connected ap supports uapsd or not */ 60 | u8 uapsd_ap_supported; 61 | #endif /* CONFIG_WMMPS_STA */ 62 | 63 | }; 64 | 65 | 66 | #endif /* _RTL871X_QOS_H_ */ -------------------------------------------------------------------------------- /hal/efuse/rtl8192e/HalEfuseMask8192E_SDIO.c: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | 16 | /* #include "Mp_Precomp.h" */ 17 | /* #include "../odm_precomp.h" */ 18 | 19 | #include 20 | 21 | #include "HalEfuseMask8192E_SDIO.h" 22 | 23 | 24 | 25 | /****************************************************************************** 26 | * MSDIO.TXT 27 | ******************************************************************************/ 28 | 29 | u1Byte Array_MP_8192E_MSDIO[] = { 30 | 0xFF, 31 | 0xF3, 32 | 0x00, 33 | 0x00, 34 | 0x00, 35 | 0x00, 36 | 0x00, 37 | 0x00, 38 | 0x00, 39 | 0x00, 40 | 0x00, 41 | 0x0F, 42 | 0xF1, 43 | 0xFF, 44 | 0xFF, 45 | 0xFF, 46 | 0xFF, 47 | 0xFF, 48 | 0x00, 49 | 0x00, 50 | 0x00, 51 | 0x00, 52 | 0x00, 53 | 0x00, 54 | 0x00, 55 | 0x00, 56 | 0x00, 57 | 0x00, 58 | 0x00, 59 | 0x00, 60 | 0x00, 61 | 0x00, 62 | 63 | }; 64 | 65 | u2Byte EFUSE_GetArrayLen_MP_8192E_MSDIO(VOID) 66 | { 67 | return sizeof(Array_MP_8192E_MSDIO) / sizeof(u1Byte); 68 | } 69 | 70 | VOID EFUSE_GetMaskArray_MP_8192E_MSDIO(pu1Byte Array) 71 | { 72 | u2Byte len = EFUSE_GetArrayLen_MP_8192E_MSDIO(), i = 0; 73 | 74 | for (i = 0; i < len; ++i) 75 | Array[i] = Array_MP_8192E_MSDIO[i]; 76 | } 77 | 78 | BOOLEAN EFUSE_IsAddressMasked_MP_8192E_MSDIO(u2Byte Offset) 79 | { 80 | int r = Offset / 16; 81 | int c = (Offset % 16) / 2; 82 | int result = 0; 83 | 84 | /* RTW_INFO(" %s ,Offset=%x r= %d , c=%d , Array_MP_8192E_MSDIO[r]= %x\n",__func__,Offset,r,c,Array_MP_8192E_MSDIO[r]); */ 85 | 86 | if (c < 4) /* Upper double word */ 87 | result = (Array_MP_8192E_MSDIO[r] & (0x10 << c)); 88 | else 89 | result = (Array_MP_8192E_MSDIO[r] & (0x01 << (c - 4))); 90 | 91 | return (result > 0) ? 0 : 1; 92 | } 93 | -------------------------------------------------------------------------------- /hal/phydm/txbf/haltxbfjaguar.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2016 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef __HAL_TXBF_JAGUAR_H__ 16 | #define __HAL_TXBF_JAGUAR_H__ 17 | #if ((RTL8812A_SUPPORT == 1) || (RTL8821A_SUPPORT == 1)) 18 | #if (BEAMFORMING_SUPPORT == 1) 19 | 20 | void 21 | hal_txbf_8812a_set_ndpa_rate( 22 | void *p_dm_void, 23 | u8 BW, 24 | u8 rate 25 | ); 26 | 27 | 28 | void 29 | hal_txbf_jaguar_enter( 30 | void *p_dm_void, 31 | u8 idx 32 | ); 33 | 34 | 35 | void 36 | hal_txbf_jaguar_leave( 37 | void *p_dm_void, 38 | u8 idx 39 | ); 40 | 41 | 42 | void 43 | hal_txbf_jaguar_status( 44 | void *p_dm_void, 45 | u8 idx 46 | ); 47 | 48 | 49 | void 50 | hal_txbf_jaguar_fw_txbf( 51 | void *p_dm_void, 52 | u8 idx 53 | ); 54 | 55 | 56 | void 57 | hal_txbf_jaguar_patch( 58 | void *p_dm_void, 59 | u8 operation 60 | ); 61 | 62 | 63 | void 64 | hal_txbf_jaguar_clk_8812a( 65 | void *p_dm_void 66 | ); 67 | #else 68 | 69 | #define hal_txbf_8812a_set_ndpa_rate(p_dm_void, BW, rate) 70 | #define hal_txbf_jaguar_enter(p_dm_void, idx) 71 | #define hal_txbf_jaguar_leave(p_dm_void, idx) 72 | #define hal_txbf_jaguar_status(p_dm_void, idx) 73 | #define hal_txbf_jaguar_fw_txbf(p_dm_void, idx) 74 | #define hal_txbf_jaguar_patch(p_dm_void, operation) 75 | #define hal_txbf_jaguar_clk_8812a(p_dm_void) 76 | #endif 77 | #else 78 | 79 | #define hal_txbf_8812a_set_ndpa_rate(p_dm_void, BW, rate) 80 | #define hal_txbf_jaguar_enter(p_dm_void, idx) 81 | #define hal_txbf_jaguar_leave(p_dm_void, idx) 82 | #define hal_txbf_jaguar_status(p_dm_void, idx) 83 | #define hal_txbf_jaguar_fw_txbf(p_dm_void, idx) 84 | #define hal_txbf_jaguar_patch(p_dm_void, operation) 85 | #define hal_txbf_jaguar_clk_8812a(p_dm_void) 86 | #endif 87 | 88 | #endif /* #ifndef __HAL_TXBF_JAGUAR_H__ */ 89 | -------------------------------------------------------------------------------- /platform/platform_sprd_sdio.c: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2013 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #include 16 | 17 | extern void sdhci_bus_scan(void); 18 | #ifndef ANDROID_2X 19 | extern int sdhci_device_attached(void); 20 | #endif 21 | 22 | /* 23 | * Return: 24 | * 0: power on successfully 25 | * others: power on failed 26 | */ 27 | int platform_wifi_power_on(void) 28 | { 29 | int ret = 0; 30 | 31 | 32 | #ifdef CONFIG_RTL8188E 33 | rtw_wifi_gpio_wlan_ctrl(WLAN_POWER_ON); 34 | #endif /* CONFIG_RTL8188E */ 35 | 36 | /* Pull up pwd pin, make wifi leave power down mode. */ 37 | rtw_wifi_gpio_init(); 38 | rtw_wifi_gpio_wlan_ctrl(WLAN_PWDN_ON); 39 | 40 | #if (MP_DRIVER == 1) && (defined(CONFIG_RTL8723A) || defined(CONFIG_RTL8723B)) 41 | /* Pull up BT reset pin. */ 42 | rtw_wifi_gpio_wlan_ctrl(WLAN_BT_PWDN_ON); 43 | #endif 44 | rtw_mdelay_os(5); 45 | 46 | sdhci_bus_scan(); 47 | #ifdef CONFIG_RTL8723B 48 | /* YJ,test,130305 */ 49 | rtw_mdelay_os(1000); 50 | #endif 51 | #ifdef ANDROID_2X 52 | rtw_mdelay_os(200); 53 | #else /* !ANDROID_2X */ 54 | if (1) { 55 | int i = 0; 56 | 57 | for (i = 0; i <= 50; i++) { 58 | msleep(10); 59 | if (sdhci_device_attached()) 60 | break; 61 | printk("%s delay times:%d\n", __func__, i); 62 | } 63 | } 64 | #endif /* !ANDROID_2X */ 65 | 66 | return ret; 67 | } 68 | 69 | void platform_wifi_power_off(void) 70 | { 71 | /* Pull down pwd pin, make wifi enter power down mode. */ 72 | rtw_wifi_gpio_wlan_ctrl(WLAN_PWDN_OFF); 73 | rtw_mdelay_os(5); 74 | rtw_wifi_gpio_deinit(); 75 | 76 | #ifdef CONFIG_RTL8188E 77 | rtw_wifi_gpio_wlan_ctrl(WLAN_POWER_OFF); 78 | #endif /* CONFIG_RTL8188E */ 79 | 80 | #ifdef CONFIG_WOWLAN 81 | if (mmc_host) 82 | mmc_host->pm_flags &= ~MMC_PM_KEEP_POWER; 83 | #endif /* CONFIG_WOWLAN */ 84 | } 85 | -------------------------------------------------------------------------------- /hal/efuse/rtl8192e/HalEfuseMask8192E_USB.c: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | 16 | /* #include "Mp_Precomp.h" */ 17 | /* #include "../odm_precomp.h" */ 18 | 19 | #include 20 | 21 | #include "HalEfuseMask8192E_USB.h" 22 | 23 | 24 | 25 | /****************************************************************************** 26 | * MUSB.TXT 27 | ******************************************************************************/ 28 | 29 | u1Byte Array_MP_8192E_MUSB[] = { 30 | 0xFF, 31 | 0xF7, 32 | 0x00, 33 | 0x0E, 34 | 0xF0, 35 | 0x00, 36 | 0x00, 37 | 0x00, 38 | 0x00, 39 | 0x00, 40 | 0x00, 41 | 0x07, 42 | 0xF3, 43 | 0xFF, 44 | 0xFF, 45 | 0xFF, 46 | 0xFF, 47 | 0xFF, 48 | 0xFF, 49 | 0x00, 50 | 0x00, 51 | 0x00, 52 | 0x00, 53 | 0x00, 54 | 0x00, 55 | 0x00, 56 | 0x00, 57 | 0x00, 58 | 0x00, 59 | 0x00, 60 | 0x00, 61 | 0x00, 62 | 63 | }; 64 | 65 | u2Byte 66 | EFUSE_GetArrayLen_MP_8192E_MUSB(VOID) 67 | { 68 | return sizeof(Array_MP_8192E_MUSB) / sizeof(u1Byte); 69 | } 70 | 71 | VOID 72 | EFUSE_GetMaskArray_MP_8192E_MUSB( 73 | IN OUT pu1Byte Array 74 | ) 75 | { 76 | u2Byte len = EFUSE_GetArrayLen_MP_8192E_MUSB(), i = 0; 77 | 78 | for (i = 0; i < len; ++i) 79 | Array[i] = Array_MP_8192E_MUSB[i]; 80 | } 81 | BOOLEAN 82 | EFUSE_IsAddressMasked_MP_8192E_MUSB( 83 | IN u2Byte Offset 84 | ) 85 | { 86 | int r = Offset / 16; 87 | int c = (Offset % 16) / 2; 88 | int result = 0; 89 | 90 | /* RTW_INFO(" %s ,Offset=%x r= %d , c=%d , Array_MP_8192E_MUSB[r]= %x\n",__func__,Offset,r,c,Array_MP_8192E_MUSB[r]); */ 91 | 92 | if (c < 4) /* Upper double word */ 93 | result = (Array_MP_8192E_MUSB[r] & (0x10 << c)); 94 | else 95 | result = (Array_MP_8192E_MUSB[r] & (0x01 << (c - 4))); 96 | 97 | return (result > 0) ? 0 : 1; 98 | } 99 | -------------------------------------------------------------------------------- /hal/phydm/txbf/haltxbf8822b.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2016 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef __HAL_TXBF_8822B_H__ 16 | #define __HAL_TXBF_8822B_H__ 17 | 18 | #if (RTL8822B_SUPPORT == 1) 19 | #if (BEAMFORMING_SUPPORT == 1) 20 | 21 | void 22 | hal_txbf_8822b_enter( 23 | void *p_dm_void, 24 | u8 idx 25 | ); 26 | 27 | 28 | void 29 | hal_txbf_8822b_leave( 30 | void *p_dm_void, 31 | u8 idx 32 | ); 33 | 34 | 35 | void 36 | hal_txbf_8822b_status( 37 | void *p_dm_void, 38 | u8 beamform_idx 39 | ); 40 | 41 | void 42 | hal_txbf_8822b_config_gtab( 43 | void *p_dm_void 44 | ); 45 | 46 | void 47 | hal_txbf_8822b_fw_txbf( 48 | void *p_dm_void, 49 | u8 idx 50 | ); 51 | #else 52 | #define hal_txbf_8822b_enter(p_dm_void, idx) 53 | #define hal_txbf_8822b_leave(p_dm_void, idx) 54 | #define hal_txbf_8822b_status(p_dm_void, idx) 55 | #define hal_txbf_8822b_fw_txbf(p_dm_void, idx) 56 | #define hal_txbf_8822b_config_gtab(p_dm_void) 57 | 58 | #endif 59 | 60 | #if (defined(CONFIG_BB_TXBF_API)) 61 | void 62 | phydm_8822btxbf_rfmode( 63 | void *p_dm_void, 64 | u8 su_bfee_cnt, 65 | u8 mu_bfee_cnt 66 | ); 67 | 68 | void 69 | phydm_8822b_sutxbfer_workaroud( 70 | void *p_dm_void, 71 | boolean enable_su_bfer, 72 | u8 nc, 73 | u8 nr, 74 | u8 ng, 75 | u8 CB, 76 | u8 BW, 77 | boolean is_vht 78 | ); 79 | 80 | #else 81 | #define phydm_8822btxbf_rfmode(p_dm_void, su_bfee_cnt, mu_bfee_cnt) 82 | #define phydm_8822b_sutxbfer_workaroud(p_dm_void, enable_su_bfer, nc, nr, ng, CB, BW, is_vht) 83 | #endif 84 | 85 | #else 86 | #define hal_txbf_8822b_enter(p_dm_void, idx) 87 | #define hal_txbf_8822b_leave(p_dm_void, idx) 88 | #define hal_txbf_8822b_status(p_dm_void, idx) 89 | #define hal_txbf_8822b_fw_txbf(p_dm_void, idx) 90 | #define hal_txbf_8822b_config_gtab(p_dm_void) 91 | 92 | #endif 93 | #endif 94 | -------------------------------------------------------------------------------- /hal/btc/mp_precomp.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2013 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef __MP_PRECOMP_H__ 16 | #define __MP_PRECOMP_H__ 17 | 18 | #include 19 | #include 20 | 21 | #define BT_TMP_BUF_SIZE 100 22 | 23 | #ifdef PLATFORM_LINUX 24 | #define rsprintf snprintf 25 | #elif defined(PLATFORM_WINDOWS) 26 | #define rsprintf sprintf_s 27 | #endif 28 | 29 | #define DCMD_Printf DBG_BT_INFO 30 | 31 | #define delay_ms(ms) rtw_mdelay_os(ms) 32 | 33 | #ifdef bEnable 34 | #undef bEnable 35 | #endif 36 | 37 | #define WPP_SOFTWARE_TRACE 0 38 | 39 | typedef enum _BTC_MSG_COMP_TYPE { 40 | COMP_COEX = 0, 41 | COMP_MAX 42 | } BTC_MSG_COMP_TYPE; 43 | extern u4Byte GLBtcDbgType[]; 44 | 45 | #define DBG_OFF 0 46 | #define DBG_SEC 1 47 | #define DBG_SERIOUS 2 48 | #define DBG_WARNING 3 49 | #define DBG_LOUD 4 50 | #define DBG_TRACE 5 51 | 52 | #ifdef CONFIG_BT_COEXIST 53 | #define BT_SUPPORT 1 54 | #define COEX_SUPPORT 1 55 | #define HS_SUPPORT 1 56 | #else 57 | #define BT_SUPPORT 0 58 | #define COEX_SUPPORT 0 59 | #define HS_SUPPORT 0 60 | #endif 61 | 62 | #include "halbtcoutsrc.h" 63 | #include "halbtc8192e1ant.h" 64 | #include "halbtc8192e2ant.h" 65 | #include "halbtc8723b1ant.h" 66 | #include "halbtc8723b2ant.h" 67 | #include "halbtc8812a1ant.h" 68 | #include "halbtc8812a2ant.h" 69 | #include "halbtc8821a1ant.h" 70 | #include "halbtc8821a2ant.h" 71 | #include "halbtc8703b1ant.h" 72 | #include "halbtc8723d1ant.h" 73 | #include "halbtc8723d2ant.h" 74 | #include "halbtc8822b1ant.h" 75 | #include "halbtc8822b2ant.h" 76 | #include "halbtc8821c1ant.h" 77 | #include "halbtc8821c2ant.h" 78 | 79 | /* for wifi only mode */ 80 | #include "hal_btcoex_wifionly.h" 81 | #include "halbtc8723bwifionly.h" 82 | #include "halbtc8822bwifionly.h" 83 | #include "halbtc8821cwifionly.h" 84 | 85 | #endif /* __MP_PRECOMP_H__ */ 86 | -------------------------------------------------------------------------------- /hal/phydm/phydm_cck_pd.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | 16 | 17 | #ifndef __PHYDM_CCK_PD_H__ 18 | #define __PHYDM_CCK_PD_H__ 19 | 20 | #define CCK_PD_VERSION "1.0" /* 2017.05.09 Dino, Add phydm_cck_pd.h*/ 21 | 22 | 23 | /* 1 ============================================================ 24 | * 1 Definition 25 | * 1 ============================================================ */ 26 | 27 | 28 | #define AAA_BASE 4 29 | #define AAA_STEP 2 30 | 31 | #define CCK_FA_MA_RESET 0xffffffff 32 | 33 | #define EXTEND_CCK_CCATH_AAA_IC (ODM_RTL8197F | ODM_RTL8821C | ODM_RTL8723D |ODM_RTL8710B) 34 | /* 1 ============================================================ 35 | * 1 structure 36 | * 1 ============================================================ */ 37 | 38 | #ifdef PHYDM_SUPPORT_CCKPD 39 | struct phydm_cckpd_struct { 40 | 41 | u8 cur_cck_cca_thres; /*0xA0A*/ 42 | u8 cck_cca_th_aaa; /*0xAAA*/ 43 | u32 cck_fa_ma; 44 | u8 cckpd_bkp; 45 | u32 rvrt_val[2]; 46 | u8 pause_bitmap;/*will be removed*/ 47 | u8 pause_lv; 48 | u8 pause_cckpd_value[PHYDM_PAUSE_MAX_NUM]; /*will be removed*/ 49 | }; 50 | #endif 51 | 52 | /* 1 ============================================================ 53 | * 1 enumeration 54 | * 1 ============================================================ */ 55 | 56 | /* 1 ============================================================ 57 | * 1 function prototype 58 | * 1 ============================================================ */ 59 | 60 | void 61 | phydm_set_cckpd_val( 62 | void *p_dm_void, 63 | u32 *val_buf, 64 | u8 val_len 65 | ); 66 | 67 | void 68 | phydm_cck_pd_th( 69 | void *p_dm_void 70 | ); 71 | 72 | void 73 | odm_pause_cck_packet_detection( 74 | void *p_dm_void, 75 | enum phydm_pause_type pause_type, 76 | enum phydm_pause_level pause_level, 77 | u8 cck_pd_threshold 78 | ); 79 | 80 | void 81 | phydm_cck_pd_init( 82 | void *p_dm_void 83 | ); 84 | 85 | #endif 86 | -------------------------------------------------------------------------------- /include/hal_btcoex_wifionly.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2016 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef __HALBTC_WIFIONLY_H__ 16 | #define __HALBTC_WIFIONLY_H__ 17 | 18 | #include 19 | #include 20 | 21 | typedef enum _WIFIONLY_CHIP_INTERFACE { 22 | WIFIONLY_INTF_UNKNOWN = 0, 23 | WIFIONLY_INTF_PCI = 1, 24 | WIFIONLY_INTF_USB = 2, 25 | WIFIONLY_INTF_SDIO = 3, 26 | WIFIONLY_INTF_MAX 27 | } WIFIONLY_CHIP_INTERFACE, *PWIFIONLY_CHIP_INTERFACE; 28 | 29 | typedef enum _WIFIONLY_CUSTOMER_ID { 30 | CUSTOMER_NORMAL = 0, 31 | CUSTOMER_HP_1 = 1 32 | } WIFIONLY_CUSTOMER_ID, *PWIFIONLY_CUSTOMER_ID; 33 | 34 | struct wifi_only_haldata { 35 | u16 customer_id; 36 | u8 efuse_pg_antnum; 37 | u8 efuse_pg_antpath; 38 | u8 rfe_type; 39 | u8 ant_div_cfg; 40 | }; 41 | 42 | struct wifi_only_cfg { 43 | PVOID Adapter; 44 | struct wifi_only_haldata haldata_info; 45 | WIFIONLY_CHIP_INTERFACE chip_interface; 46 | }; 47 | 48 | void halwifionly_write1byte(PVOID pwifionlyContext, u32 RegAddr, u8 Data); 49 | void halwifionly_write2byte(PVOID pwifionlyContext, u32 RegAddr, u16 Data); 50 | void halwifionly_write4byte(PVOID pwifionlyContext, u32 RegAddr, u32 Data); 51 | u8 halwifionly_read1byte(PVOID pwifionlyContext, u32 RegAddr); 52 | u16 halwifionly_read2byte(PVOID pwifionlyContext, u32 RegAddr); 53 | u32 halwifionly_read4byte(PVOID pwifionlyContext, u32 RegAddr); 54 | void halwifionly_bitmaskwrite1byte(PVOID pwifionlyContext, u32 regAddr, u8 bitMask, u8 data); 55 | void halwifionly_phy_set_rf_reg(PVOID pwifionlyContext, enum rf_path eRFPath, u32 RegAddr, u32 BitMask, u32 Data); 56 | void halwifionly_phy_set_bb_reg(PVOID pwifionlyContext, u32 RegAddr, u32 BitMask, u32 Data); 57 | void hal_btcoex_wifionly_switchband_notify(PADAPTER padapter); 58 | void hal_btcoex_wifionly_scan_notify(PADAPTER padapter); 59 | void hal_btcoex_wifionly_hw_config(PADAPTER padapter); 60 | void hal_btcoex_wifionly_initlizevariables(PADAPTER padapter); 61 | #endif 62 | -------------------------------------------------------------------------------- /platform/platform_ARM_SUN50IW1P1_sdio.c: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2013 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | /* 16 | * Description: 17 | * This file can be applied to following platforms: 18 | * CONFIG_PLATFORM_ARM_SUN50IW1P1 19 | */ 20 | #include 21 | #ifdef CONFIG_GPIO_WAKEUP 22 | #include 23 | #endif 24 | 25 | #ifdef CONFIG_MMC 26 | #if defined(CONFIG_PLATFORM_ARM_SUN50IW1P1) 27 | extern void sunxi_mmc_rescan_card(unsigned ids); 28 | extern void sunxi_wlan_set_power(int on); 29 | extern int sunxi_wlan_get_bus_index(void); 30 | extern int sunxi_wlan_get_oob_irq(void); 31 | extern int sunxi_wlan_get_oob_irq_flags(void); 32 | #endif 33 | #ifdef CONFIG_GPIO_WAKEUP 34 | extern unsigned int oob_irq; 35 | #endif 36 | #endif /* CONFIG_MMC */ 37 | 38 | /* 39 | * Return: 40 | * 0: power on successfully 41 | * others: power on failed 42 | */ 43 | int platform_wifi_power_on(void) 44 | { 45 | int ret = 0; 46 | 47 | #ifdef CONFIG_MMC 48 | { 49 | 50 | #if defined(CONFIG_PLATFORM_ARM_SUN50IW1P1) 51 | int wlan_bus_index = sunxi_wlan_get_bus_index(); 52 | if (wlan_bus_index < 0) 53 | return wlan_bus_index; 54 | 55 | sunxi_wlan_set_power(1); 56 | mdelay(100); 57 | sunxi_mmc_rescan_card(wlan_bus_index); 58 | #endif 59 | RTW_INFO("%s: power up, rescan card.\n", __FUNCTION__); 60 | 61 | #ifdef CONFIG_GPIO_WAKEUP 62 | #if defined(CONFIG_PLATFORM_ARM_SUN50IW1P1) 63 | oob_irq = sunxi_wlan_get_oob_irq(); 64 | #endif 65 | #endif /* CONFIG_GPIO_WAKEUP */ 66 | } 67 | #endif /* CONFIG_MMC */ 68 | 69 | return ret; 70 | } 71 | 72 | void platform_wifi_power_off(void) 73 | { 74 | #ifdef CONFIG_MMC 75 | #if defined(CONFIG_PLATFORM_ARM_SUN50IW1P1) 76 | int wlan_bus_index = sunxi_wlan_get_bus_index(); 77 | if (wlan_bus_index < 0) 78 | return; 79 | 80 | sunxi_mmc_rescan_card(wlan_bus_index); 81 | mdelay(100); 82 | sunxi_wlan_set_power(0); 83 | #endif 84 | RTW_INFO("%s: remove card, power off.\n", __FUNCTION__); 85 | #endif /* CONFIG_MMC */ 86 | } 87 | -------------------------------------------------------------------------------- /include/rtl8188f_recv.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef __RTL8188F_RECV_H__ 16 | #define __RTL8188F_RECV_H__ 17 | 18 | #if defined(CONFIG_USB_HCI) 19 | #ifndef MAX_RECVBUF_SZ 20 | #ifdef PLATFORM_OS_CE 21 | #define MAX_RECVBUF_SZ (8192+1024) /* 8K+1k */ 22 | #else 23 | #ifdef CONFIG_MINIMAL_MEMORY_USAGE 24 | #define MAX_RECVBUF_SZ (4000) /* about 4K */ 25 | #else 26 | #ifdef CONFIG_PLATFORM_MSTAR 27 | #define MAX_RECVBUF_SZ (8192) /* 8K */ 28 | #elif defined(CONFIG_PLATFORM_HISILICON) 29 | #define MAX_RECVBUF_SZ (16384) /* 16k */ 30 | #else 31 | #define MAX_RECVBUF_SZ (32768) /* 32k */ 32 | #endif 33 | /* #define MAX_RECVBUF_SZ (20480) */ /* 20K */ 34 | /* #define MAX_RECVBUF_SZ (10240) */ /* 10K */ 35 | /* #define MAX_RECVBUF_SZ (16384) */ /* 16k - 92E RX BUF :16K */ 36 | /* #define MAX_RECVBUF_SZ (8192+1024) */ /* 8K+1k */ 37 | #endif 38 | #endif 39 | #endif /* !MAX_RECVBUF_SZ */ 40 | #elif defined(CONFIG_PCI_HCI) 41 | #define MAX_RECVBUF_SZ (4000) /* about 4K */ 42 | #elif defined(CONFIG_SDIO_HCI) 43 | #define MAX_RECVBUF_SZ (RX_DMA_BOUNDARY_8188F + 1) 44 | #endif /* CONFIG_SDIO_HCI */ 45 | 46 | /* Rx smooth factor */ 47 | #define Rx_Smooth_Factor (20) 48 | 49 | #if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) 50 | s32 rtl8188fs_init_recv_priv(PADAPTER padapter); 51 | void rtl8188fs_free_recv_priv(PADAPTER padapter); 52 | s32 rtl8188fs_recv_hdl(_adapter *padapter); 53 | #endif 54 | 55 | #ifdef CONFIG_USB_HCI 56 | int rtl8188fu_init_recv_priv(_adapter *padapter); 57 | void rtl8188fu_free_recv_priv(_adapter *padapter); 58 | void rtl8188fu_init_recvbuf(_adapter *padapter, struct recv_buf *precvbuf); 59 | #endif 60 | 61 | #ifdef CONFIG_PCI_HCI 62 | s32 rtl8188fe_init_recv_priv(PADAPTER padapter); 63 | void rtl8188fe_free_recv_priv(PADAPTER padapter); 64 | #endif 65 | 66 | void rtl8188f_query_rx_desc_status(union recv_frame *precvframe, u8 *pdesc); 67 | 68 | #endif /* __RTL8188F_RECV_H__ */ 69 | -------------------------------------------------------------------------------- /hal/hal_dm.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef __HAL_DM_H__ 16 | #define __HAL_DM_H__ 17 | 18 | #define adapter_to_phydm(adapter) (&(GET_HAL_DATA(adapter)->odmpriv)) 19 | 20 | void Init_ODM_ComInfo(_adapter *adapter); 21 | void rtw_hal_turbo_edca(_adapter *adapter); 22 | u8 rtw_phydm_is_iqk_in_progress(_adapter *adapter); 23 | 24 | void GetHalODMVar( 25 | PADAPTER Adapter, 26 | HAL_ODM_VARIABLE eVariable, 27 | PVOID pValue1, 28 | PVOID pValue2); 29 | void SetHalODMVar( 30 | PADAPTER Adapter, 31 | HAL_ODM_VARIABLE eVariable, 32 | PVOID pValue1, 33 | BOOLEAN bSet); 34 | 35 | void rtw_phydm_ra_registed(_adapter *adapter, struct sta_info *psta); 36 | 37 | void rtw_phydm_watchdog(_adapter *adapter); 38 | 39 | void rtw_hal_update_iqk_fw_offload_cap(_adapter *adapter); 40 | void dump_sta_info(void *sel, struct sta_info *psta); 41 | void dump_sta_traffic(void *sel, _adapter *adapter, struct sta_info *psta); 42 | 43 | #ifdef CONFIG_DBG_RF_CAL 44 | void rtw_hal_iqk_test(_adapter *adapter, bool recovery, bool clear, bool segment); 45 | void rtw_hal_lck_test(_adapter *adapter); 46 | #endif 47 | 48 | s8 rtw_phydm_get_min_rssi(_adapter *adapter); 49 | u8 rtw_phydm_get_cur_igi(_adapter *adapter); 50 | 51 | 52 | #ifdef CONFIG_LPS_LCLK_WD_TIMER 53 | extern void phydm_rssi_monitor_check(void *p_dm_void); 54 | 55 | void rtw_phydm_wd_lps_lclk_hdl(_adapter *adapter); 56 | void rtw_phydm_watchdog_in_lps_lclk(_adapter *adapter); 57 | #endif 58 | 59 | enum phy_cnt { 60 | FA_OFDM, 61 | FA_CCK, 62 | FA_TOTAL, 63 | CCA_OFDM, 64 | CCA_CCK, 65 | CCA_ALL, 66 | CRC32_OK_VHT, 67 | CRC32_OK_HT, 68 | CRC32_OK_LEGACY, 69 | CRC32_OK_CCK, 70 | CRC32_ERROR_VHT, 71 | CRC32_ERROR_HT, 72 | CRC32_ERROR_LEGACY, 73 | CRC32_ERROR_CCK, 74 | }; 75 | u32 rtw_phydm_get_phy_cnt(_adapter *adapter, enum phy_cnt cnt); 76 | #if ((RTL8822B_SUPPORT == 1) || (RTL8821C_SUPPORT == 1) || (RTL8814B_SUPPORT == 1)) 77 | void rtw_phydm_iqk_trigger(_adapter *adapter); 78 | #endif 79 | 80 | #endif /* __HAL_DM_H__ */ 81 | -------------------------------------------------------------------------------- /scripts/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Environment variables 4 | CURRENT_SHELL=$(ps -hp $$ | awk '{printf $5}') 5 | CURRENT_USER=$(whoami) 6 | CURRENT_HOME="" 7 | CURRENT_PWD=$(pwd) 8 | CORE=$(nproc) 9 | IS_NOT_BLACKLISTED=$(cat /etc/modprobe.d/realtek.conf | grep "blacklist r8192eu") 10 | INSTALLATION_PATH_DOES_NOT_EXIST=$(printf $PATH | grep /usr/local/sbin) 11 | DO_DIRECTORY_EXISTS=0 12 | 13 | # Colours 14 | RED="\e[1;31m" 15 | GREEN="\e[1;32m" 16 | YELLOW="\e[1;33m" 17 | BLUE="\e[1;34m" 18 | PURPLE="\e[1;35m" 19 | CYAN="\e[1;36m" 20 | RESET_COLOUR="\e[0m" 21 | 22 | # Set home based on user or root 23 | if [ ${CURRENT_USER} == "root" ]; then 24 | CURRENT_HOME="/root" 25 | else 26 | CURRENT_HOME="/home/${CURRENT_USER}" 27 | fi 28 | 29 | # Check if the repository already exists 30 | if ! [ -d ../rtl8192eu ]; then 31 | if ! [ -d ${CURRENT_HOME}/rtl8192eu ]; then 32 | git clone --recursive https://gitlab.com/KanuX/rtl8192eu.git 33 | else 34 | printf "${YELLOW}""[!] Repository already exists.""${RESET_COLOUR}""\n" 35 | fi 36 | cd "${CURRENT_HOME}/rtl8192eu" 37 | fi 38 | 39 | # Check if the device is already blacklisted. 40 | if [ -z "${IS_NOT_BLACKLISTED}" ]; then 41 | sudo mkdir -pv /etc/modprobe.d 42 | printf "blacklist r8192eu\n" | sudo tee "/etc/modprobe.d/realtek.conf" 43 | fi 44 | 45 | # Check if /usr/local/sbin exists. 46 | if [ -z "${INSTALLATION_PATH_DOES_NOT_EXIST}" ]; then 47 | sudo mkdir -pv /usr/local/sbin 48 | printf "export PATH=/usr/local/sbin:$PATH\n" >> ."${CURRENT_SHELL}""rc" 49 | fi 50 | 51 | # Check the package manager. 52 | if type dpkg &>/dev/null; then 53 | sudo apt-get update && sudo apt-get install gawk tar git gcc bc make linux-headers-$(uname -r) zenity -y 54 | elif type pacman &>/dev/null; then 55 | sudo pacman -S --needed --noconfirm gawk tar git gcc bc make linux-headers zenity 56 | elif type dnf &>/dev/null; then 57 | sudo dnf install -y gawk tar git gcc bc make kernel-devel zenity 58 | else 59 | printf "${GREEN}""Consider installing the kernel headers by yourself.""${RESET_COLOUR}""\n" 60 | fi 61 | 62 | # Installation process. 63 | sudo rmmod r8192eu # This one can be anything. I am using this one because is the common TL-WN722N v2/v3 64 | sudo rmmod 8192eu 2&>/dev/null # Remove old/installed module. Visual purposes. 65 | make -j${CORE} && sudo make install 66 | sudo modprobe 8192eu # Load the new driver/module 67 | sudo cp -v scripts/toggle-monitor.sh /usr/local/bin/toggle-monitor 68 | sudo chown ${USER}:${USER} /usr/local/bin/toggle-monitor 69 | sudo chmod +x /usr/local/bin/toggle-monitor 70 | sudo cp -v rtl8192eu-toggle-monitor.desktop /usr/share/applications 71 | printf "${GREEN}""The driver/module has been installed!""${RESET_COLOUR}""\n" 72 | notify-send "The driver/module has been installed!" 73 | -------------------------------------------------------------------------------- /include/rtw_rson.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * 19 | ******************************************************************************/ 20 | #ifndef __RTW_RSON_H_ 21 | #define __RTW_RSON_H_ 22 | 23 | 24 | #define RTW_RSON_VER 1 25 | 26 | #define RTW_RSON_SCORE_NOTSUP 0x0 27 | #define RTW_RSON_SCORE_NOTCNNT 0x1 28 | #define RTW_RSON_SCORE_MAX 0xFF 29 | #define RTW_RSON_HC_NOTREADY 0xFF 30 | #define RTW_RSON_HC_ROOT 0x0 31 | #define RTW_RSON_ALLOWCONNECT 0x1 32 | #define RTW_RSON_DENYCONNECT 0x0 33 | 34 | 35 | 36 | /* for rtw self-origanization spec 1 */ 37 | struct rtw_rson_struct { 38 | u8 ver; 39 | u32 id; 40 | u8 hopcnt; 41 | u8 connectible; 42 | u8 loading; 43 | u8 res[16]; 44 | } __attribute__((__packed__)); 45 | 46 | void init_rtw_rson_data(struct dvobj_priv *dvobj); 47 | void rtw_rson_get_property_str(_adapter *padapter, char *rson_data_str); 48 | int rtw_rson_set_property(_adapter *padapter, char *field, char *value); 49 | int rtw_rson_choose(struct wlan_network **candidate, struct wlan_network *competitor); 50 | int rtw_get_rson_struct(WLAN_BSSID_EX *bssid, struct rtw_rson_struct *rson_data); 51 | u8 rtw_cal_rson_score(struct rtw_rson_struct *cand_rson_data, NDIS_802_11_RSSI Rssi); 52 | void rtw_rson_handle_ie(WLAN_BSSID_EX *bssid, u8 ie_offset); 53 | u32 rtw_rson_append_ie(_adapter *padapter, unsigned char *pframe, u32 *len); 54 | void rtw_rson_do_disconnect(_adapter *padapter); 55 | void rtw_rson_join_done(_adapter *padapter); 56 | int rtw_rson_isupdate_roamcan(struct mlme_priv *mlme, struct wlan_network **candidate, struct wlan_network *competitor); 57 | void rtw_rson_show_survey_info(struct seq_file *m, _list *plist, _list *phead); 58 | u8 rtw_rson_ap_check_sta(_adapter *padapter, u8 *pframe, uint pkt_len, unsigned short ie_offset); 59 | u8 rtw_rson_scan_wk_cmd(_adapter *padapter, int op); 60 | void rtw_rson_scan_cmd_hdl(_adapter *padapter, int op); 61 | #endif /* __RTW_RSON_H_ */ 62 | -------------------------------------------------------------------------------- /include/recv_osdep.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef __RECV_OSDEP_H_ 16 | #define __RECV_OSDEP_H_ 17 | 18 | 19 | extern sint _rtw_init_recv_priv(struct recv_priv *precvpriv, _adapter *padapter); 20 | extern void _rtw_free_recv_priv(struct recv_priv *precvpriv); 21 | 22 | 23 | extern s32 rtw_recv_entry(union recv_frame *precv_frame); 24 | extern int rtw_recv_indicatepkt(_adapter *adapter, union recv_frame *precv_frame); 25 | extern void rtw_recv_returnpacket(IN _nic_hdl cnxt, IN _pkt *preturnedpkt); 26 | 27 | extern int rtw_recv_monitor(_adapter *padapter, union recv_frame *precv_frame); 28 | 29 | #ifdef CONFIG_HOSTAPD_MLME 30 | extern void rtw_hostapd_mlme_rx(_adapter *padapter, union recv_frame *precv_frame); 31 | #endif 32 | 33 | struct sta_info; 34 | extern void rtw_handle_tkip_mic_err(_adapter *padapter, struct sta_info *sta, u8 bgroup); 35 | 36 | 37 | int rtw_os_recv_resource_init(struct recv_priv *precvpriv, _adapter *padapter); 38 | int rtw_os_recv_resource_alloc(_adapter *padapter, union recv_frame *precvframe); 39 | void rtw_os_recv_resource_free(struct recv_priv *precvpriv); 40 | 41 | 42 | int rtw_os_alloc_recvframe(_adapter *padapter, union recv_frame *precvframe, u8 *pdata, _pkt *pskb); 43 | int rtw_os_recvframe_duplicate_skb(_adapter *padapter, union recv_frame *pcloneframe, _pkt *pskb); 44 | void rtw_os_free_recvframe(union recv_frame *precvframe); 45 | 46 | 47 | int rtw_os_recvbuf_resource_alloc(_adapter *padapter, struct recv_buf *precvbuf); 48 | int rtw_os_recvbuf_resource_free(_adapter *padapter, struct recv_buf *precvbuf); 49 | 50 | _pkt *rtw_os_alloc_msdu_pkt(union recv_frame *prframe, u16 nSubframe_Length, u8 *pdata); 51 | void rtw_os_recv_indicate_pkt(_adapter *padapter, _pkt *pkt, struct rx_pkt_attrib *pattrib); 52 | 53 | void rtw_os_read_port(_adapter *padapter, struct recv_buf *precvbuf); 54 | 55 | #ifdef PLATFORM_LINUX 56 | #ifdef CONFIG_RTW_NAPI 57 | #include /* struct napi_struct */ 58 | 59 | int rtw_recv_napi_poll(struct napi_struct *, int budget); 60 | #endif /* CONFIG_RTW_NAPI */ 61 | #endif /* PLATFORM_LINUX */ 62 | 63 | #endif /* */ 64 | -------------------------------------------------------------------------------- /hal/phydm/phydm_hwconfig.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | 16 | 17 | #ifndef __HALHWOUTSRC_H__ 18 | #define __HALHWOUTSRC_H__ 19 | 20 | 21 | /*--------------------------Define -------------------------------------------*/ 22 | #define AGC_DIFF_CONFIG_MP(ic, band) (odm_read_and_config_mp_##ic##_agc_tab_diff(p_dm, array_mp_##ic##_agc_tab_diff_##band, \ 23 | sizeof(array_mp_##ic##_agc_tab_diff_##band)/sizeof(u32))) 24 | #define AGC_DIFF_CONFIG_TC(ic, band) (odm_read_and_config_tc_##ic##_agc_tab_diff(p_dm, array_tc_##ic##_agc_tab_diff_##band, \ 25 | sizeof(array_tc_##ic##_agc_tab_diff_##band)/sizeof(u32))) 26 | 27 | #define AGC_DIFF_CONFIG(ic, band) do {\ 28 | if (p_dm->is_mp_chip)\ 29 | AGC_DIFF_CONFIG_MP(ic, band);\ 30 | else\ 31 | AGC_DIFF_CONFIG_TC(ic, band);\ 32 | } while (0) 33 | 34 | 35 | /* ************************************************************ 36 | * structure and define 37 | * ************************************************************ */ 38 | 39 | enum hal_status 40 | odm_config_rf_with_tx_pwr_track_header_file( 41 | struct PHY_DM_STRUCT *p_dm 42 | ); 43 | 44 | enum hal_status 45 | odm_config_rf_with_header_file( 46 | struct PHY_DM_STRUCT *p_dm, 47 | enum odm_rf_config_type config_type, 48 | u8 e_rf_path 49 | ); 50 | 51 | enum hal_status 52 | odm_config_bb_with_header_file( 53 | struct PHY_DM_STRUCT *p_dm, 54 | enum odm_bb_config_type config_type 55 | ); 56 | 57 | enum hal_status 58 | odm_config_mac_with_header_file( 59 | struct PHY_DM_STRUCT *p_dm 60 | ); 61 | 62 | u32 63 | odm_get_hw_img_version( 64 | struct PHY_DM_STRUCT *p_dm 65 | ); 66 | 67 | 68 | u32 69 | query_phydm_trx_capability( 70 | struct PHY_DM_STRUCT *p_dm 71 | ); 72 | 73 | u32 74 | query_phydm_stbc_capability( 75 | struct PHY_DM_STRUCT *p_dm 76 | ); 77 | 78 | u32 79 | query_phydm_ldpc_capability( 80 | struct PHY_DM_STRUCT *p_dm 81 | ); 82 | 83 | u32 84 | query_phydm_txbf_parameters( 85 | struct PHY_DM_STRUCT *p_dm 86 | ); 87 | 88 | u32 89 | query_phydm_txbf_capability( 90 | struct PHY_DM_STRUCT *p_dm 91 | ); 92 | 93 | #endif /*#ifndef __HALHWOUTSRC_H__*/ 94 | -------------------------------------------------------------------------------- /hal/phydm/halrf/halrf_iqk.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | 16 | #ifndef __PHYDMIQK_H__ 17 | #define __PHYDMIQK_H__ 18 | 19 | /*--------------------------Define Parameters-------------------------------*/ 20 | #define LOK_delay 1 21 | #define WBIQK_delay 10 22 | #define TX_IQK 0 23 | #define RX_IQK 1 24 | #define TXIQK 0 25 | #define RXIQK1 1 26 | #define RXIQK2 2 27 | #define kcount_limit_80m 2 28 | #define kcount_limit_others 4 29 | #define rxiqk_gs_limit 4 30 | 31 | #define NUM 4 32 | /*---------------------------End Define Parameters-------------------------------*/ 33 | 34 | struct _IQK_INFORMATION { 35 | boolean LOK_fail[NUM]; 36 | boolean IQK_fail[2][NUM]; 37 | u32 iqc_matrix[2][NUM]; 38 | u8 iqk_times; 39 | u32 rf_reg18; 40 | u32 lna_idx; 41 | u8 rxiqk_step; 42 | u8 tmp1bcc; 43 | u8 kcount; 44 | u8 rfk_ing; /*bit0:IQKing, bit1:LCKing, bit2:DPKing*/ 45 | boolean rfk_forbidden; 46 | #if (RTL8814A_SUPPORT == 1 || RTL8822B_SUPPORT == 1 || RTL8821C_SUPPORT == 1) 47 | u32 iqk_channel[2]; 48 | boolean IQK_fail_report[2][4][2]; /*channel/path/TRX(TX:0, RX:1) */ 49 | u32 IQK_CFIR_real[3][4][2][8]; /*channel / path / TRX(TX:0, RX:1) / CFIR_real*/ /*channel index = 2 is just for debug*/ 50 | u32 IQK_CFIR_imag[3][4][2][8]; /*channel / path / TRX(TX:0, RX:1) / CFIR_imag*/ /*channel index = 2 is just for debug*/ 51 | u8 retry_count[2][4][3]; /* channel / path / (TXK:0, RXK1:1, RXK2:2) */ 52 | u8 gs_retry_count[2][4][2]; /* channel / path / (GSRXK1:0, GSRXK2:1) */ 53 | u8 RXIQK_fail_code[2][4]; /* channel / path 0:SRXK1 fail, 1:RXK1 fail 2:RXK2 fail */ 54 | u32 LOK_IDAC[2][4]; /*channel / path*/ 55 | u16 RXIQK_AGC[2][4]; /*channel / path*/ 56 | u32 bypass_iqk[2][4]; /*channel / 0xc94/0xe94*/ 57 | u32 txgap_result[8]; /*txagpK result */ 58 | u32 tmp_GNTWL; 59 | boolean is_BTG; 60 | boolean isbnd; 61 | boolean is_reload; 62 | boolean segment_iqk; 63 | boolean is_hwtx; 64 | 65 | boolean xym_read; 66 | boolean trximr_enable; 67 | u32 rx_xym[2][10]; 68 | u32 tx_xym[2][10]; 69 | u32 gs1_xym[2][6]; 70 | u32 gs2_xym[2][6]; 71 | u32 rxk1_xym[2][6]; 72 | #endif 73 | }; 74 | 75 | #endif 76 | -------------------------------------------------------------------------------- /hal/phydm/txbf/haltxbf8814a.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2016 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef __HAL_TXBF_8814A_H__ 16 | #define __HAL_TXBF_8814A_H__ 17 | 18 | #if (RTL8814A_SUPPORT == 1) 19 | #if (BEAMFORMING_SUPPORT == 1) 20 | 21 | boolean 22 | phydm_beamforming_set_iqgen_8814A( 23 | void *p_dm_void 24 | ); 25 | 26 | void 27 | hal_txbf_8814a_set_ndpa_rate( 28 | void *p_dm_void, 29 | u8 BW, 30 | u8 rate 31 | ); 32 | 33 | u8 34 | hal_txbf_8814a_get_ntx( 35 | void *p_dm_void 36 | ); 37 | 38 | void 39 | hal_txbf_8814a_enter( 40 | void *p_dm_void, 41 | u8 idx 42 | ); 43 | 44 | 45 | void 46 | hal_txbf_8814a_leave( 47 | void *p_dm_void, 48 | u8 idx 49 | ); 50 | 51 | 52 | void 53 | hal_txbf_8814a_status( 54 | void *p_dm_void, 55 | u8 idx 56 | ); 57 | 58 | void 59 | hal_txbf_8814a_reset_tx_path( 60 | void *p_dm_void, 61 | u8 idx 62 | ); 63 | 64 | 65 | void 66 | hal_txbf_8814a_get_tx_rate( 67 | void *p_dm_void 68 | ); 69 | 70 | void 71 | hal_txbf_8814a_fw_txbf( 72 | void *p_dm_void, 73 | u8 idx 74 | ); 75 | 76 | #else 77 | 78 | #define hal_txbf_8814a_set_ndpa_rate(p_dm_void, BW, rate) 79 | #define hal_txbf_8814a_get_ntx(p_dm_void) 0 80 | #define hal_txbf_8814a_enter(p_dm_void, idx) 81 | #define hal_txbf_8814a_leave(p_dm_void, idx) 82 | #define hal_txbf_8814a_status(p_dm_void, idx) 83 | #define hal_txbf_8814a_reset_tx_path(p_dm_void, idx) 84 | #define hal_txbf_8814a_get_tx_rate(p_dm_void) 85 | #define hal_txbf_8814a_fw_txbf(p_dm_void, idx) 86 | #define phydm_beamforming_set_iqgen_8814A(p_dm_void) 0 87 | 88 | #endif 89 | 90 | #else 91 | 92 | #define hal_txbf_8814a_set_ndpa_rate(p_dm_void, BW, rate) 93 | #define hal_txbf_8814a_get_ntx(p_dm_void) 0 94 | #define hal_txbf_8814a_enter(p_dm_void, idx) 95 | #define hal_txbf_8814a_leave(p_dm_void, idx) 96 | #define hal_txbf_8814a_status(p_dm_void, idx) 97 | #define hal_txbf_8814a_reset_tx_path(p_dm_void, idx) 98 | #define hal_txbf_8814a_get_tx_rate(p_dm_void) 99 | #define hal_txbf_8814a_fw_txbf(p_dm_void, idx) 100 | #define phydm_beamforming_set_iqgen_8814A(p_dm_void) 0 101 | #endif 102 | 103 | #endif 104 | -------------------------------------------------------------------------------- /include/sdio_ops_linux.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef __SDIO_OPS_LINUX_H__ 16 | #define __SDIO_OPS_LINUX_H__ 17 | 18 | #ifndef RTW_HALMAC 19 | u8 sd_f0_read8(struct intf_hdl *pintfhdl, u32 addr, s32 *err); 20 | void sd_f0_write8(struct intf_hdl *pintfhdl, u32 addr, u8 v, s32 *err); 21 | 22 | s32 _sd_cmd52_read(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *pdata); 23 | s32 _sd_cmd52_write(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *pdata); 24 | s32 sd_cmd52_read(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *pdata); 25 | s32 sd_cmd52_write(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *pdata); 26 | 27 | u8 _sd_read8(struct intf_hdl *pintfhdl, u32 addr, s32 *err); 28 | u8 sd_read8(struct intf_hdl *pintfhdl, u32 addr, s32 *err); 29 | u16 sd_read16(struct intf_hdl *pintfhdl, u32 addr, s32 *err); 30 | u32 _sd_read32(struct intf_hdl *pintfhdl, u32 addr, s32 *err); 31 | u32 sd_read32(struct intf_hdl *pintfhdl, u32 addr, s32 *err); 32 | void sd_write8(struct intf_hdl *pintfhdl, u32 addr, u8 v, s32 *err); 33 | void sd_write16(struct intf_hdl *pintfhdl, u32 addr, u16 v, s32 *err); 34 | void _sd_write32(struct intf_hdl *pintfhdl, u32 addr, u32 v, s32 *err); 35 | void sd_write32(struct intf_hdl *pintfhdl, u32 addr, u32 v, s32 *err); 36 | #endif /* RTW_HALMAC */ 37 | 38 | bool rtw_is_sdio30(_adapter *adapter); 39 | 40 | /* The unit of return value is Hz */ 41 | static inline u32 rtw_sdio_get_clock(struct dvobj_priv *d) 42 | { 43 | return d->intf_data.clock; 44 | } 45 | 46 | s32 _sd_read(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, void *pdata); 47 | s32 sd_read(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, void *pdata); 48 | s32 _sd_write(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, void *pdata); 49 | s32 sd_write(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, void *pdata); 50 | 51 | void rtw_sdio_set_irq_thd(struct dvobj_priv *dvobj, _thread_hdl_ thd_hdl); 52 | int __must_check rtw_sdio_raw_read(struct dvobj_priv *d, unsigned int addr, 53 | void *buf, size_t len, bool fixed); 54 | int __must_check rtw_sdio_raw_write(struct dvobj_priv *d, unsigned int addr, 55 | void *buf, size_t len, bool fixed); 56 | 57 | #endif /* __SDIO_OPS_LINUX_H__ */ 58 | 59 | -------------------------------------------------------------------------------- /include/drv_types_ce.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef __DRV_TYPES_CE_H__ 16 | #define __DRV_TYPES_CE_H__ 17 | 18 | #include 19 | #include 20 | 21 | #include 22 | 23 | #define MAX_ACTIVE_REG_PATH 256 24 | 25 | #define MAX_MCAST_LIST_NUM 32 26 | 27 | 28 | 29 | /* for ioctl */ 30 | #define MAKE_DRIVER_VERSION(_MainVer, _MinorVer) ((((u32)(_MainVer))<<16)+_MinorVer) 31 | 32 | #define NIC_HEADER_SIZE 14 /* !< can be moved to typedef.h */ 33 | #define NIC_MAX_PACKET_SIZE 1514 /* !< can be moved to typedef.h */ 34 | #define NIC_MAX_SEND_PACKETS 10 /* max number of send packets the MiniportSendPackets function can accept, can be moved to typedef.h */ 35 | #define NIC_VENDOR_DRIVER_VERSION MAKE_DRIVER_VERSION(0, 001) /* !< can be moved to typedef.h */ 36 | #define NIC_MAX_PACKET_SIZE 1514 /* !< can be moved to typedef.h */ 37 | 38 | typedef struct _MP_REG_ENTRY { 39 | 40 | NDIS_STRING RegName; /* variable name text */ 41 | BOOLEAN bRequired; /* 1->required, 0->optional */ 42 | 43 | u8 Type; /* NdisParameterInteger/NdisParameterHexInteger/NdisParameterStringle/NdisParameterMultiString */ 44 | uint FieldOffset; /* offset to MP_ADAPTER field */ 45 | uint FieldSize; /* size (in bytes) of the field */ 46 | 47 | #ifdef UNDER_AMD64 48 | u64 Default; 49 | #else 50 | u32 Default; /* default value to use */ 51 | #endif 52 | 53 | u32 Min; /* minimum value allowed */ 54 | u32 Max; /* maximum value allowed */ 55 | } MP_REG_ENTRY, *PMP_REG_ENTRY; 56 | 57 | #ifdef CONFIG_USB_HCI 58 | typedef struct _USB_EXTENSION { 59 | LPCUSB_FUNCS _lpUsbFuncs; 60 | USB_HANDLE _hDevice; 61 | PVOID pAdapter; 62 | 63 | #if 0 64 | USB_ENDPOINT_DESCRIPTOR _endpACLIn; 65 | USB_ENDPOINT_DESCRIPTOR _endpACLOutHigh; 66 | USB_ENDPOINT_DESCRIPTOR _endpACLOutNormal; 67 | 68 | USB_PIPE pPipeIn; 69 | USB_PIPE pPipeOutNormal; 70 | USB_PIPE pPipeOutHigh; 71 | #endif 72 | 73 | } USB_EXTENSION, *PUSB_EXTENSION; 74 | #endif 75 | 76 | 77 | typedef struct _OCTET_STRING { 78 | u8 *Octet; 79 | u16 Length; 80 | } OCTET_STRING, *POCTET_STRING; 81 | 82 | 83 | 84 | 85 | 86 | #endif 87 | -------------------------------------------------------------------------------- /include/drv_types_sdio.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2017 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef __DRV_TYPES_SDIO_H__ 16 | #define __DRV_TYPES_SDIO_H__ 17 | 18 | /* SDIO Header Files */ 19 | #ifdef PLATFORM_LINUX 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | #ifdef CONFIG_PLATFORM_SPRD 26 | #include 27 | #include 28 | #endif /* CONFIG_PLATFORM_SPRD */ 29 | #endif 30 | 31 | #ifdef PLATFORM_OS_XP 32 | #include 33 | #include 34 | #endif 35 | 36 | #ifdef PLATFORM_OS_CE 37 | #include 38 | #endif 39 | 40 | #define RTW_SDIO_CLK_33M 33000000 41 | #define RTW_SDIO_CLK_40M 40000000 42 | #define RTW_SDIO_CLK_80M 80000000 43 | #define RTW_SDIO_CLK_160M 160000000 44 | 45 | typedef struct sdio_data { 46 | u8 func_number; 47 | 48 | u8 tx_block_mode; 49 | u8 rx_block_mode; 50 | u32 block_transfer_len; 51 | 52 | #ifdef PLATFORM_LINUX 53 | struct sdio_func *func; 54 | _thread_hdl_ sys_sdio_irq_thd; 55 | unsigned int clock; 56 | unsigned int timing; 57 | u8 sd3_bus_mode; 58 | #endif 59 | 60 | #ifdef PLATFORM_OS_XP 61 | PDEVICE_OBJECT pphysdevobj; 62 | PDEVICE_OBJECT pfuncdevobj; 63 | PDEVICE_OBJECT pnextdevobj; 64 | SDBUS_INTERFACE_STANDARD sdbusinft; 65 | u8 nextdevstacksz; 66 | #endif 67 | 68 | #ifdef PLATFORM_OS_CE 69 | SD_DEVICE_HANDLE hDevice; 70 | SD_CARD_RCA sd_rca; 71 | SD_CARD_INTERFACE card_intf; 72 | BOOLEAN enableIsarWithStatus; 73 | WCHAR active_path[MAX_ACTIVE_REG_PATH]; 74 | SD_HOST_BLOCK_CAPABILITY sd_host_blk_cap; 75 | #endif 76 | } SDIO_DATA, *PSDIO_DATA; 77 | 78 | #define dvobj_to_sdio_func(d) ((d)->intf_data.func) 79 | 80 | #define RTW_SDIO_ADDR_CMD52_BIT (1<<17) 81 | #define RTW_SDIO_ADDR_CMD52_GEN(a) (a | RTW_SDIO_ADDR_CMD52_BIT) 82 | #define RTW_SDIO_ADDR_CMD52_CLR(a) (a&~RTW_SDIO_ADDR_CMD52_BIT) 83 | #define RTW_SDIO_ADDR_CMD52_CHK(a) (a&RTW_SDIO_ADDR_CMD52_BIT ? 1 : 0) 84 | 85 | #define RTW_SDIO_ADDR_F0_BIT (1<<18) 86 | #define RTW_SDIO_ADDR_F0_GEN(a) (a | RTW_SDIO_ADDR_F0_BIT) 87 | #define RTW_SDIO_ADDR_F0_CLR(a) (a&~RTW_SDIO_ADDR_F0_BIT) 88 | #define RTW_SDIO_ADDR_F0_CHK(a) (a&RTW_SDIO_ADDR_F0_BIT ? 1 : 0) 89 | 90 | #endif 91 | --------------------------------------------------------------------------------