├── .gitignore ├── hal ├── phydm │ ├── phydm.h │ ├── rtchnlplan.c │ ├── rtchnlplan.h │ ├── phydm_beamforming.c │ ├── rtl8188f │ │ ├── version_rtl8188f.h │ │ ├── phydm_rtl8188f.h │ │ ├── halhwimg8188f_fw.h │ │ ├── halhwimg8188f_mac.h │ │ ├── phydm_rtl8188f.c │ │ ├── halhwimg8188f_bb.h │ │ ├── phydm_regconfig8188f.h │ │ ├── halhwimg8188f_rf.h │ │ └── halphyrf_8188f.h │ ├── txbf │ │ ├── haltxbf8821b.h │ │ ├── haltxbf8192e.h │ │ ├── haltxbf8822b.h │ │ ├── haltxbfjaguar.h │ │ ├── haltxbf8814a.h │ │ ├── haltxbfinterface.h │ │ └── halcomtxbf.h │ ├── mp_precomp.h │ ├── phydm_noisemonitor.h │ ├── phydm_dynamicbbpowersaving.h │ ├── phydm_cfotracking.h │ ├── phydm_antdect.h │ ├── phydm_dynamictxpower.h │ ├── phydm_rxhp.h │ ├── halphyrf_ce.h │ ├── phydm_regdefine11ac.h │ ├── halphyrf_win.h │ ├── phydm_edcaturbocheck.h │ ├── phydm_acs.h │ ├── halhwimg.h │ └── phydm_adaptivity.h ├── btc │ ├── HalBtc8192e1Ant.c │ ├── HalBtc8192e2Ant.c │ ├── HalBtc8703b1Ant.c │ ├── HalBtc8703b2Ant.c │ ├── HalBtc8723a1Ant.c │ ├── HalBtc8723a2Ant.c │ ├── HalBtc8723b1Ant.c │ ├── HalBtc8723b2Ant.c │ ├── HalBtc8812a1Ant.c │ ├── HalBtc8812a2Ant.c │ ├── HalBtc8821a1Ant.c │ ├── HalBtc8821a2Ant.c │ ├── HalBtc8821aCsr2Ant.c │ └── Mp_Precomp.h ├── hal_dm.h ├── rtl8188f │ ├── usb │ │ ├── rtl8188fu_recv.c │ │ └── rtl8188fu_led.c │ ├── rtl8188f_rxdesc.c │ ├── Hal8188FPwrSeq.c │ └── rtl8188f_sreset.c ├── efuse │ ├── rtl8188f │ │ ├── HalEfuseMask8188F_SDIO.h │ │ ├── HalEfuseMask8188F_USB.h │ │ ├── HalEfuseMask8188F_SDIO.c │ │ └── HalEfuseMask8188F_USB.c │ └── efuse_mask.h └── hal_com_c2h.h ├── firmware └── rtl8188fufw.bin ├── include ├── rtw_version.h ├── custom_gpio.h ├── rtw_wifi_regd.h ├── gspi_ops_linux.h ├── drv_types_linux.h ├── rtl8188f_rf.h ├── circ_buf.h ├── h2clbk.h ├── rtw_qos.h ├── rtl8188f_sreset.h ├── gspi_osintf.h ├── hal_phy_reg.h ├── pci_osintf.h ├── gspi_hal.h ├── rtw_ioctl_query.h ├── usb_osintf.h ├── cmd_osdep.h ├── hal_gspi.h ├── rtw_byteorder.h ├── mlme_osdep.h ├── pci_hal.h ├── rtw_mem.h ├── nic_spec.h ├── drv_types_gspi.h ├── rtl8188f_led.h ├── rtl8188f_dm.h ├── ethernet.h ├── usb_hal.h ├── rtw_sreset.h ├── rtw_odm.h ├── usb_vendor_req.h ├── rtw_br_ext.h ├── hal_ic_cfg.h ├── rtl8188f_recv.h ├── recv_osdep.h ├── drv_types_ce.h ├── drv_types_xp.h ├── pci_ops.h ├── rtw_ioctl_set.h ├── xmit_osdep.h ├── rtw_event.h ├── linux │ └── wireless.h ├── byteorder │ ├── big_endian.h │ ├── little_endian.h │ └── swab.h ├── rtw_ap.h ├── Hal8188FPhyCfg.h └── usb_ops_linux.h ├── Kconfig ├── dkms.conf ├── os_dep └── linux │ └── rtw_proc.h ├── README.md └── core └── rtw_mem.c /.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | .*cmd 3 | *.order 4 | *.symvers 5 | .tmp_versions 6 | *.swp 7 | *.ko 8 | *.mod.c 9 | -------------------------------------------------------------------------------- /hal/phydm/phydm.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianwhiteco/rtl8188ftv_Allwinner/HEAD/hal/phydm/phydm.h -------------------------------------------------------------------------------- /firmware/rtl8188fufw.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianwhiteco/rtl8188ftv_Allwinner/HEAD/firmware/rtl8188fufw.bin -------------------------------------------------------------------------------- /hal/phydm/rtchnlplan.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianwhiteco/rtl8188ftv_Allwinner/HEAD/hal/phydm/rtchnlplan.c -------------------------------------------------------------------------------- /hal/phydm/rtchnlplan.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianwhiteco/rtl8188ftv_Allwinner/HEAD/hal/phydm/rtchnlplan.h -------------------------------------------------------------------------------- /include/rtw_version.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0 */ 2 | #define DRIVERVERSION "v4.3.23.6_20964.20170110" 3 | -------------------------------------------------------------------------------- /hal/btc/HalBtc8192e1Ant.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianwhiteco/rtl8188ftv_Allwinner/HEAD/hal/btc/HalBtc8192e1Ant.c -------------------------------------------------------------------------------- /hal/btc/HalBtc8192e2Ant.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianwhiteco/rtl8188ftv_Allwinner/HEAD/hal/btc/HalBtc8192e2Ant.c -------------------------------------------------------------------------------- /hal/btc/HalBtc8703b1Ant.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianwhiteco/rtl8188ftv_Allwinner/HEAD/hal/btc/HalBtc8703b1Ant.c -------------------------------------------------------------------------------- /hal/btc/HalBtc8703b2Ant.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianwhiteco/rtl8188ftv_Allwinner/HEAD/hal/btc/HalBtc8703b2Ant.c -------------------------------------------------------------------------------- /hal/btc/HalBtc8723a1Ant.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianwhiteco/rtl8188ftv_Allwinner/HEAD/hal/btc/HalBtc8723a1Ant.c -------------------------------------------------------------------------------- /hal/btc/HalBtc8723a2Ant.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianwhiteco/rtl8188ftv_Allwinner/HEAD/hal/btc/HalBtc8723a2Ant.c -------------------------------------------------------------------------------- /hal/btc/HalBtc8723b1Ant.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianwhiteco/rtl8188ftv_Allwinner/HEAD/hal/btc/HalBtc8723b1Ant.c -------------------------------------------------------------------------------- /hal/btc/HalBtc8723b2Ant.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianwhiteco/rtl8188ftv_Allwinner/HEAD/hal/btc/HalBtc8723b2Ant.c -------------------------------------------------------------------------------- /hal/btc/HalBtc8812a1Ant.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianwhiteco/rtl8188ftv_Allwinner/HEAD/hal/btc/HalBtc8812a1Ant.c -------------------------------------------------------------------------------- /hal/btc/HalBtc8812a2Ant.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianwhiteco/rtl8188ftv_Allwinner/HEAD/hal/btc/HalBtc8812a2Ant.c -------------------------------------------------------------------------------- /hal/btc/HalBtc8821a1Ant.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianwhiteco/rtl8188ftv_Allwinner/HEAD/hal/btc/HalBtc8821a1Ant.c -------------------------------------------------------------------------------- /hal/btc/HalBtc8821a2Ant.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianwhiteco/rtl8188ftv_Allwinner/HEAD/hal/btc/HalBtc8821a2Ant.c -------------------------------------------------------------------------------- /hal/btc/HalBtc8821aCsr2Ant.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianwhiteco/rtl8188ftv_Allwinner/HEAD/hal/btc/HalBtc8821aCsr2Ant.c -------------------------------------------------------------------------------- /hal/phydm/phydm_beamforming.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julianwhiteco/rtl8188ftv_Allwinner/HEAD/hal/phydm/phydm_beamforming.c -------------------------------------------------------------------------------- /Kconfig: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: GPL-2.0 2 | config RTL8188FU 3 | tristate "Realtek 8188F USB WiFi" 4 | depends on USB 5 | ---help--- 6 | Help message of RTL8818FU 7 | 8 | -------------------------------------------------------------------------------- /dkms.conf: -------------------------------------------------------------------------------- 1 | PACKAGE_NAME="rtl8188fu" 2 | PACKAGE_VERSION="1.0" 3 | BUILT_MODULE_NAME="rtl8188fu" 4 | DEST_MODULE_LOCATION="/kernel/drivers/net/wireless/" 5 | REMAKE_INITRD="yes" 6 | AUTOINSTALL="yes" 7 | MAKE="'make' all KVER=${kernelver}" 8 | CLEAN="make clean" 9 | -------------------------------------------------------------------------------- /hal/phydm/rtl8188f/version_rtl8188f.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0 */ 2 | /*RTL8188F PHY Parameters*/ 3 | /* 4 | [Caution] 5 | Since 01/Aug/2015, the commit rules will be simplified. 6 | You do not need to fill up the version.h anymore, 7 | only the maintenance supervisor fills it before formal release. 8 | */ 9 | #define RELEASE_DATE_8188F 20160624 10 | #define COMMIT_BY_8188F "BB_David" 11 | #define RELEASE_VERSION_8188F 31 12 | -------------------------------------------------------------------------------- /include/custom_gpio.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0 */ 2 | #ifndef __CUSTOM_GPIO_H__ 3 | #define __CUSTOM_GPIO_H___ 4 | 5 | #include 6 | #include 7 | 8 | #ifdef PLATFORM_OS_XP 9 | #include 10 | #endif 11 | 12 | #ifdef PLATFORM_OS_CE 13 | #include 14 | #endif 15 | 16 | #ifdef PLATFORM_LINUX 17 | #include 18 | #endif 19 | 20 | typedef enum cust_gpio_modes { 21 | WLAN_PWDN_ON, 22 | WLAN_PWDN_OFF, 23 | WLAN_POWER_ON, 24 | WLAN_POWER_OFF, 25 | WLAN_BT_PWDN_ON, 26 | WLAN_BT_PWDN_OFF 27 | } cust_gpio_modes_t; 28 | 29 | extern int rtw_wifi_gpio_init(void); 30 | extern int rtw_wifi_gpio_deinit(void); 31 | extern void rtw_wifi_gpio_wlan_ctrl(int onoff); 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /include/rtw_wifi_regd.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0 */ 2 | /****************************************************************************** 3 | * 4 | * Copyright(c) 2009-2010 Realtek Corporation. 5 | * 6 | *****************************************************************************/ 7 | 8 | #ifndef __RTW_WIFI_REGD_H__ 9 | #define __RTW_WIFI_REGD_H__ 10 | 11 | struct country_code_to_enum_rd { 12 | u16 countrycode; 13 | const char *iso_name; 14 | }; 15 | 16 | enum country_code_type_t { 17 | COUNTRY_CODE_USER = 0, 18 | 19 | /*add new channel plan above this line */ 20 | COUNTRY_CODE_MAX 21 | }; 22 | 23 | void rtw_regd_init(struct wiphy *wiphy); 24 | void rtw_reg_notify_by_driver(struct wiphy *wiphy); 25 | 26 | #endif /* __RTW_WIFI_REGD_H__ */ 27 | 28 | -------------------------------------------------------------------------------- /hal/phydm/txbf/haltxbf8821b.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0 */ 2 | #ifndef __HAL_TXBF_8821B_H__ 3 | #define __HAL_TXBF_8821B_H__ 4 | #if (BEAMFORMING_SUPPORT == 1) 5 | #if (RTL8821B_SUPPORT == 1) 6 | VOID 7 | HalTxbf8821B_Enter( 8 | IN PVOID pDM_VOID, 9 | IN u1Byte Idx 10 | ); 11 | 12 | 13 | VOID 14 | HalTxbf8821B_Leave( 15 | IN PVOID pDM_VOID, 16 | IN u1Byte Idx 17 | ); 18 | 19 | 20 | VOID 21 | HalTxbf8821B_Status( 22 | IN PVOID pDM_VOID, 23 | IN u1Byte Idx 24 | ); 25 | 26 | 27 | VOID 28 | HalTxbf8821B_FwTxBF( 29 | IN PVOID pDM_VOID, 30 | IN u1Byte Idx 31 | ); 32 | 33 | #else 34 | #define HalTxbf8821B_Enter(pDM_VOID, Idx) 35 | #define HalTxbf8821B_Leave(pDM_VOID, Idx) 36 | #define HalTxbf8821B_Status(pDM_VOID, Idx) 37 | #define HalTxbf8821B_FwTxBF(pDM_VOID, Idx) 38 | #endif 39 | 40 | 41 | #endif 42 | 43 | #endif // #ifndef __HAL_TXBF_8821B_H__ 44 | 45 | -------------------------------------------------------------------------------- /hal/phydm/mp_precomp.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 | 21 | -------------------------------------------------------------------------------- /hal/phydm/txbf/haltxbf8192e.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0 */ 2 | #ifndef __HAL_TXBF_8192E_H__ 3 | #define __HAL_TXBF_8192E_H__ 4 | 5 | #if (BEAMFORMING_SUPPORT == 1) 6 | #if (RTL8192E_SUPPORT == 1) 7 | VOID 8 | HalTxbf8192E_setNDPArate( 9 | IN PVOID pDM_VOID, 10 | IN u1Byte BW, 11 | IN u1Byte Rate 12 | ); 13 | 14 | VOID 15 | HalTxbf8192E_Enter( 16 | IN PVOID pDM_VOID, 17 | IN u1Byte Idx 18 | ); 19 | 20 | 21 | VOID 22 | HalTxbf8192E_Leave( 23 | IN PVOID pDM_VOID, 24 | IN u1Byte Idx 25 | ); 26 | 27 | 28 | VOID 29 | HalTxbf8192E_Status( 30 | IN PVOID pDM_VOID, 31 | IN u1Byte Idx 32 | ); 33 | 34 | 35 | VOID 36 | HalTxbf8192E_FwTxBF( 37 | IN PVOID pDM_VOID, 38 | IN u1Byte Idx 39 | ); 40 | #else 41 | 42 | #define HalTxbf8192E_setNDPArate(pDM_VOID, BW, Rate) 43 | #define HalTxbf8192E_Enter(pDM_VOID, Idx) 44 | #define HalTxbf8192E_Leave(pDM_VOID, Idx) 45 | #define HalTxbf8192E_Status(pDM_VOID, Idx) 46 | #define HalTxbf8192E_FwTxBF(pDM_VOID, Idx) 47 | 48 | #endif 49 | 50 | #endif 51 | 52 | #endif 53 | 54 | -------------------------------------------------------------------------------- /include/gspi_ops_linux.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 __SDIO_OPS_LINUX_H__ 21 | #define __SDIO_OPS_LINUX_H__ 22 | 23 | #endif 24 | 25 | -------------------------------------------------------------------------------- /hal/phydm/txbf/haltxbf8822b.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0 */ 2 | #ifndef __HAL_TXBF_8822B_H__ 3 | #define __HAL_TXBF_8822B_H__ 4 | #if (BEAMFORMING_SUPPORT == 1) 5 | #if (RTL8822B_SUPPORT == 1) 6 | 7 | VOID 8 | HalTxbf8822B_Init( 9 | IN PVOID pDM_VOID 10 | ); 11 | 12 | VOID 13 | HalTxbf8822B_Enter( 14 | IN PVOID pDM_VOID, 15 | IN u1Byte Idx 16 | ); 17 | 18 | 19 | VOID 20 | HalTxbf8822B_Leave( 21 | IN PVOID pDM_VOID, 22 | IN u1Byte Idx 23 | ); 24 | 25 | 26 | VOID 27 | HalTxbf8822B_Status( 28 | IN PVOID pDM_VOID, 29 | IN u1Byte Idx 30 | ); 31 | 32 | VOID 33 | HalTxbf8822B_ConfigGtab( 34 | IN PVOID pDM_VOID 35 | ); 36 | 37 | VOID 38 | HalTxbf8822B_FwTxBF( 39 | IN PVOID pDM_VOID, 40 | IN u1Byte Idx 41 | ); 42 | #else 43 | #define HalTxbf8822B_Init(pDM_VOID) 44 | #define HalTxbf8822B_Enter(pDM_VOID, Idx) 45 | #define HalTxbf8822B_Leave(pDM_VOID, Idx) 46 | #define HalTxbf8822B_Status(pDM_VOID, Idx) 47 | #define HalTxbf8822B_FwTxBF(pDM_VOID, Idx) 48 | #define HalTxbf8822B_ConfigGtab(pDM_VOID) 49 | #endif 50 | 51 | 52 | #endif 53 | #endif 54 | 55 | -------------------------------------------------------------------------------- /include/drv_types_linux.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 __DRV_TYPES_LINUX_H__ 21 | #define __DRV_TYPES_LINUX_H__ 22 | 23 | 24 | #endif 25 | 26 | -------------------------------------------------------------------------------- /hal/hal_dm.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 __HAL_DM_H__ 21 | #define __HAL_DM_H__ 22 | 23 | void Init_ODM_ComInfo(_adapter *adapter); 24 | 25 | #endif /* __HAL_DM_H__ */ 26 | 27 | -------------------------------------------------------------------------------- /hal/phydm/rtl8188f/phydm_rtl8188f.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 __ODM_RTL8188F_H__ 21 | #define __ODM_RTL8188F_H__ 22 | 23 | s1Byte 24 | odm_CCKRSSI_8188F( 25 | IN u1Byte LNA_idx, 26 | IN u1Byte VGA_idx 27 | ); 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /include/rtl8188f_rf.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 __RTL8188F_RF_H__ 21 | #define __RTL8188F_RF_H__ 22 | 23 | int PHY_RF6052_Config8188F( IN PADAPTER Adapter ); 24 | 25 | VOID 26 | PHY_RF6052SetBandwidth8188F( 27 | IN PADAPTER Adapter, 28 | IN CHANNEL_WIDTH Bandwidth); 29 | 30 | #endif 31 | 32 | -------------------------------------------------------------------------------- /include/circ_buf.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 __CIRC_BUF_H_ 21 | #define __CIRC_BUF_H_ 1 22 | 23 | #define CIRC_CNT(head,tail,size) (((head) - (tail)) & ((size)-1)) 24 | 25 | #define CIRC_SPACE(head,tail,size) CIRC_CNT((tail),((head)+1),(size)) 26 | 27 | #endif //_CIRC_BUF_H_ 28 | 29 | -------------------------------------------------------------------------------- /include/h2clbk.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 | 21 | 22 | #define _H2CLBK_H_ 23 | 24 | 25 | void _lbk_cmd(PADAPTER Adapter); 26 | 27 | void _lbk_rsp(PADAPTER Adapter); 28 | 29 | void _lbk_evt(IN PADAPTER Adapter); 30 | 31 | void h2c_event_callback(unsigned char *dev, unsigned char *pbuf); 32 | 33 | -------------------------------------------------------------------------------- /include/rtw_qos.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 | 21 | 22 | #ifndef _RTW_QOS_H_ 23 | #define _RTW_QOS_H_ 24 | 25 | 26 | 27 | struct qos_priv { 28 | 29 | unsigned int qos_option; //bit mask option: u-apsd, s-apsd, ts, block ack... 30 | 31 | }; 32 | 33 | 34 | #endif //_RTL871X_QOS_H_ 35 | 36 | -------------------------------------------------------------------------------- /include/rtl8188f_sreset.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 _RTL8188F_SRESET_H_ 21 | #define _RTL8188F_SRESET_H_ 22 | 23 | #include 24 | 25 | #ifdef DBG_CONFIG_ERROR_DETECT 26 | extern void rtl8188f_sreset_xmit_status_check(_adapter *padapter); 27 | extern void rtl8188f_sreset_linked_status_check(_adapter *padapter); 28 | #endif 29 | #endif 30 | 31 | -------------------------------------------------------------------------------- /include/gspi_osintf.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 __SDIO_OSINTF_H__ 21 | #define __SDIO_OSINTF_H__ 22 | 23 | 24 | #ifdef PLATFORM_OS_CE 25 | extern NDIS_STATUS ce_sd_get_dev_hdl(PADAPTER padapter); 26 | SD_API_STATUS ce_sd_int_callback(SD_DEVICE_HANDLE hDevice, PADAPTER padapter); 27 | extern void sd_setup_irs(PADAPTER padapter); 28 | #endif 29 | 30 | #endif 31 | 32 | -------------------------------------------------------------------------------- /include/hal_phy_reg.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 __HAL_PHY_REG_H__ 21 | #define __HAL_PHY_REG_H__ 22 | 23 | //for PutRFRegsetting & GetRFRegSetting BitMask 24 | //#if (RTL92SE_FPGA_VERIFY == 1) 25 | //#define bRFRegOffsetMask 0xfff 26 | //#else 27 | #define bRFRegOffsetMask 0xfffff 28 | //#endif 29 | 30 | #endif //__HAL_PHY_REG_H__ 31 | 32 | -------------------------------------------------------------------------------- /hal/rtl8188f/usb/rtl8188fu_recv.c: -------------------------------------------------------------------------------- 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 | #define _RTL8188FU_RECV_C_ 21 | 22 | #include 23 | 24 | int rtl8188fu_init_recv_priv(_adapter *padapter) 25 | { 26 | return usb_init_recv_priv(padapter, USB_INTR_CONTENT_LENGTH); 27 | } 28 | 29 | void rtl8188fu_free_recv_priv(_adapter *padapter) 30 | { 31 | usb_free_recv_priv(padapter, USB_INTR_CONTENT_LENGTH); 32 | } 33 | 34 | -------------------------------------------------------------------------------- /include/pci_osintf.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 __PCI_OSINTF_H 21 | #define __PCI_OSINTF_H 22 | 23 | 24 | void rtw_pci_disable_aspm(_adapter *padapter); 25 | void rtw_pci_enable_aspm(_adapter *padapter); 26 | void PlatformClearPciPMEStatus(PADAPTER Adapter); 27 | #ifdef CONFIG_64BIT_DMA 28 | u8 PlatformEnableDMA64(PADAPTER Adapter); 29 | #endif 30 | 31 | #endif 32 | 33 | -------------------------------------------------------------------------------- /include/gspi_hal.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2012 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 __GSPI_HAL_H__ 21 | #define __GSPI_HAL_H__ 22 | 23 | 24 | void spi_int_dpc(PADAPTER padapter, u32 sdio_hisr); 25 | u8 rtw_set_hal_ops(_adapter *padapter); 26 | 27 | #ifdef CONFIG_RTL8188E 28 | void rtl8188es_set_hal_ops(PADAPTER padapter); 29 | #endif 30 | 31 | #ifdef CONFIG_RTL8723B 32 | void rtl8723bs_set_hal_ops(PADAPTER padapter); 33 | #endif 34 | 35 | #endif //__GSPI_HAL_H__ 36 | 37 | -------------------------------------------------------------------------------- /include/rtw_ioctl_query.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_IOCTL_QUERY_H_ 21 | #define _RTW_IOCTL_QUERY_H_ 22 | 23 | 24 | #ifdef PLATFORM_WINDOWS 25 | 26 | u8 query_802_11_capability(_adapter* padapter,u8* pucBuf,u32 * pulOutLen); 27 | u8 query_802_11_association_information (_adapter * padapter, PNDIS_802_11_ASSOCIATION_INFORMATION pAssocInfo); 28 | 29 | #endif 30 | 31 | 32 | #endif 33 | 34 | -------------------------------------------------------------------------------- /include/usb_osintf.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 __USB_OSINTF_H 21 | #define __USB_OSINTF_H 22 | 23 | #include 24 | 25 | #define USBD_HALTED(Status) ((ULONG)(Status) >> 30 == 3) 26 | 27 | 28 | u8 usbvendorrequest(struct dvobj_priv *pdvobjpriv, RT_USB_BREQUEST brequest, RT_USB_WVALUE wvalue, u8 windex, void* data, u8 datalen, u8 isdirectionin); 29 | 30 | 31 | #endif 32 | 33 | -------------------------------------------------------------------------------- /hal/phydm/txbf/haltxbfjaguar.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0 */ 2 | #ifndef __HAL_TXBF_JAGUAR_H__ 3 | #define __HAL_TXBF_JAGUAR_H__ 4 | 5 | #if (BEAMFORMING_SUPPORT == 1) 6 | #if ((RTL8812A_SUPPORT == 1) || (RTL8821A_SUPPORT == 1)) 7 | VOID 8 | HalTxbf8812A_setNDPArate( 9 | IN PVOID pDM_VOID, 10 | IN u1Byte BW, 11 | IN u1Byte Rate 12 | ); 13 | 14 | 15 | VOID 16 | HalTxbfJaguar_Enter( 17 | IN PVOID pDM_VOID, 18 | IN u1Byte Idx 19 | ); 20 | 21 | 22 | VOID 23 | HalTxbfJaguar_Leave( 24 | IN PVOID pDM_VOID, 25 | IN u1Byte Idx 26 | ); 27 | 28 | 29 | VOID 30 | HalTxbfJaguar_Status( 31 | IN PVOID pDM_VOID, 32 | IN u1Byte Idx 33 | ); 34 | 35 | 36 | VOID 37 | HalTxbfJaguar_FwTxBF( 38 | IN PVOID pDM_VOID, 39 | IN u1Byte Idx 40 | ); 41 | 42 | 43 | VOID 44 | HalTxbfJaguar_Patch( 45 | IN PVOID pDM_VOID, 46 | IN u1Byte Operation 47 | ); 48 | 49 | 50 | VOID 51 | HalTxbfJaguar_Clk_8812A( 52 | IN PVOID pDM_VOID 53 | ); 54 | 55 | #else 56 | 57 | #define HalTxbf8812A_setNDPArate(pDM_VOID, BW, Rate) 58 | #define HalTxbfJaguar_Enter(pDM_VOID, Idx) 59 | #define HalTxbfJaguar_Leave(pDM_VOID, Idx) 60 | #define HalTxbfJaguar_Status(pDM_VOID, Idx) 61 | #define HalTxbfJaguar_FwTxBF(pDM_VOID, Idx) 62 | #define HalTxbfJaguar_Patch(pDM_VOID, Operation) 63 | #define HalTxbfJaguar_Clk_8812A(pDM_VOID) 64 | #endif 65 | 66 | #endif 67 | #endif // #ifndef __HAL_TXBF_JAGUAR_H__ 68 | 69 | -------------------------------------------------------------------------------- /hal/phydm/txbf/haltxbf8814a.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0 */ 2 | #ifndef __HAL_TXBF_8814A_H__ 3 | #define __HAL_TXBF_8814A_H__ 4 | 5 | #if (BEAMFORMING_SUPPORT == 1) 6 | #if (RTL8814A_SUPPORT == 1) 7 | VOID 8 | HalTxbf8814A_setNDPArate( 9 | IN PVOID pDM_VOID, 10 | IN u1Byte BW, 11 | IN u1Byte Rate 12 | ); 13 | 14 | u1Byte 15 | halTxbf8814A_GetNtx( 16 | IN PVOID pDM_VOID 17 | ); 18 | 19 | VOID 20 | HalTxbf8814A_Enter( 21 | IN PVOID pDM_VOID, 22 | IN u1Byte Idx 23 | ); 24 | 25 | 26 | VOID 27 | HalTxbf8814A_Leave( 28 | IN PVOID pDM_VOID, 29 | IN u1Byte Idx 30 | ); 31 | 32 | 33 | VOID 34 | HalTxbf8814A_Status( 35 | IN PVOID pDM_VOID, 36 | IN u1Byte Idx 37 | ); 38 | 39 | VOID 40 | HalTxbf8814A_ResetTxPath( 41 | IN PVOID pDM_VOID, 42 | IN u1Byte Idx 43 | ); 44 | 45 | 46 | VOID 47 | HalTxbf8814A_GetTxRate( 48 | IN PVOID pDM_VOID 49 | ); 50 | 51 | VOID 52 | HalTxbf8814A_FwTxBF( 53 | IN PVOID pDM_VOID, 54 | IN u1Byte Idx 55 | ); 56 | #else 57 | 58 | #define HalTxbf8814A_setNDPArate(pDM_VOID, BW, Rate) 59 | #define halTxbf8814A_GetNtx(pDM_VOID) 0 60 | #define HalTxbf8814A_Enter(pDM_VOID, Idx) 61 | #define HalTxbf8814A_Leave(pDM_VOID, Idx) 62 | #define HalTxbf8814A_Status(pDM_VOID, Idx) 63 | #define HalTxbf8814A_ResetTxPath(pDM_VOID, Idx) 64 | #define HalTxbf8814A_GetTxRate(pDM_VOID) 65 | #define HalTxbf8814A_FwTxBF(pDM_VOID, Idx) 66 | #endif 67 | 68 | #endif 69 | 70 | #endif 71 | 72 | -------------------------------------------------------------------------------- /include/cmd_osdep.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 __CMD_OSDEP_H_ 21 | #define __CMD_OSDEP_H_ 22 | 23 | 24 | extern sint _rtw_init_cmd_priv (struct cmd_priv *pcmdpriv); 25 | extern sint _rtw_init_evt_priv(struct evt_priv *pevtpriv); 26 | extern void _rtw_free_evt_priv (struct evt_priv *pevtpriv); 27 | extern void _rtw_free_cmd_priv (struct cmd_priv *pcmdpriv); 28 | extern sint _rtw_enqueue_cmd(_queue *queue, struct cmd_obj *obj, bool to_head); 29 | extern struct cmd_obj *_rtw_dequeue_cmd(_queue *queue); 30 | 31 | #endif 32 | 33 | -------------------------------------------------------------------------------- /hal/efuse/rtl8188f/HalEfuseMask8188F_SDIO.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 | 21 | 22 | 23 | /****************************************************************************** 24 | * MSDIO.TXT 25 | ******************************************************************************/ 26 | 27 | 28 | u2Byte 29 | EFUSE_GetArrayLen_MP_8188F_MSDIO(VOID); 30 | 31 | VOID 32 | EFUSE_GetMaskArray_MP_8188F_MSDIO( 33 | IN OUT pu1Byte Array 34 | ); 35 | 36 | BOOLEAN 37 | EFUSE_IsAddressMasked_MP_8188F_MSDIO( // TC: Test Chip, MP: MP Chip 38 | IN u2Byte Offset 39 | ); 40 | 41 | 42 | -------------------------------------------------------------------------------- /hal/efuse/rtl8188f/HalEfuseMask8188F_USB.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 | 21 | 22 | 23 | /****************************************************************************** 24 | * MUSB.TXT 25 | ******************************************************************************/ 26 | 27 | 28 | u2Byte 29 | EFUSE_GetArrayLen_MP_8188F_MUSB(VOID); 30 | 31 | VOID 32 | EFUSE_GetMaskArray_MP_8188F_MUSB( 33 | IN OUT pu1Byte Array 34 | ); 35 | 36 | BOOLEAN 37 | EFUSE_IsAddressMasked_MP_8188F_MUSB( // TC: Test Chip, MP: MP Chip 38 | IN u2Byte Offset 39 | ); 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /hal/phydm/rtl8188f/halhwimg8188f_fw.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 | 21 | /*Image2HeaderVersion: 2.16*/ 22 | #if (RTL8188F_SUPPORT == 1) 23 | #ifndef __INC_MP_FW_HW_IMG_8188F_H 24 | #define __INC_MP_FW_HW_IMG_8188F_H 25 | 26 | /****************************************************************************** 27 | * FW_NIC.TXT 28 | ******************************************************************************/ 29 | 30 | void 31 | ODM_ReadFirmware_MP_8188F_FW_NIC( 32 | IN PDM_ODM_T pDM_Odm, 33 | OUT u1Byte *pFirmware, 34 | OUT u4Byte *pFirmwareSize 35 | ); 36 | 37 | #endif 38 | #endif /* end of HWIMG_SUPPORT*/ 39 | 40 | -------------------------------------------------------------------------------- /include/hal_gspi.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 __HAL_GSPI_H_ 21 | #define __HAL_GSPI_H_ 22 | 23 | #define ffaddr2deviceId(pdvobj, addr) (pdvobj->Queue2Pipe[addr]) 24 | 25 | u8 rtw_hal_gspi_max_txoqt_free_space(_adapter *padapter); 26 | u8 rtw_hal_gspi_query_tx_freepage(_adapter *padapter, u8 PageIdx, u8 RequiredPageNum); 27 | void rtw_hal_gspi_update_tx_freepage(_adapter *padapter, u8 PageIdx, u8 RequiredPageNum); 28 | void rtw_hal_set_gspi_tx_max_length(PADAPTER padapter, u8 numHQ, u8 numNQ, u8 numLQ, u8 numPubQ); 29 | u32 rtw_hal_get_gspi_tx_max_length(PADAPTER padapter, u8 queue_idx); 30 | 31 | #endif 32 | 33 | -------------------------------------------------------------------------------- /include/rtw_byteorder.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 _RTL871X_BYTEORDER_H_ 21 | #define _RTL871X_BYTEORDER_H_ 22 | 23 | 24 | #if defined (CONFIG_LITTLE_ENDIAN) && defined (CONFIG_BIG_ENDIAN) 25 | #error "Shall be CONFIG_LITTLE_ENDIAN or CONFIG_BIG_ENDIAN, but not both!\n" 26 | #endif 27 | 28 | #if defined (CONFIG_LITTLE_ENDIAN) 29 | #ifndef CONFIG_PLATFORM_MSTAR389 30 | # include 31 | #endif 32 | #elif defined (CONFIG_BIG_ENDIAN) 33 | # include 34 | #else 35 | # error "Must be LITTLE/BIG Endian Host" 36 | #endif 37 | 38 | #endif /* _RTL871X_BYTEORDER_H_ */ 39 | 40 | -------------------------------------------------------------------------------- /hal/phydm/rtl8188f/halhwimg8188f_mac.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 | 21 | /*Image2HeaderVersion: 2.18*/ 22 | #if (RTL8188F_SUPPORT == 1) 23 | #ifndef __INC_MP_MAC_HW_IMG_8188F_H 24 | #define __INC_MP_MAC_HW_IMG_8188F_H 25 | 26 | 27 | /****************************************************************************** 28 | * MAC_REG.TXT 29 | ******************************************************************************/ 30 | 31 | void 32 | ODM_ReadAndConfig_MP_8188F_MAC_REG(/* TC: Test Chip, MP: MP Chip*/ 33 | IN PDM_ODM_T pDM_Odm 34 | ); 35 | u4Byte ODM_GetVersion_MP_8188F_MAC_REG(void); 36 | 37 | #endif 38 | #endif /* end of HWIMG_SUPPORT*/ 39 | 40 | -------------------------------------------------------------------------------- /include/mlme_osdep.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 __MLME_OSDEP_H_ 21 | #define __MLME_OSDEP_H_ 22 | 23 | 24 | #if defined(PLATFORM_WINDOWS) || defined(PLATFORM_MPIXEL) 25 | extern int time_after(u32 now, u32 old); 26 | #endif 27 | 28 | extern void rtw_init_mlme_timer(_adapter *padapter); 29 | extern void rtw_os_indicate_disconnect(_adapter *adapter, u16 reason, u8 locally_generated); 30 | extern void rtw_os_indicate_connect( _adapter *adapter ); 31 | void rtw_os_indicate_scan_done( _adapter *padapter, bool aborted); 32 | extern void rtw_report_sec_ie(_adapter *adapter,u8 authmode,u8 *sec_ie); 33 | 34 | void rtw_reset_securitypriv( _adapter *adapter ); 35 | 36 | #endif //_MLME_OSDEP_H_ 37 | 38 | -------------------------------------------------------------------------------- /include/pci_hal.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 __PCI_HAL_H__ 21 | #define __PCI_HAL_H__ 22 | 23 | #ifdef CONFIG_RTL8188E 24 | void rtl8188ee_set_hal_ops(_adapter *padapter); 25 | #endif 26 | 27 | #if defined(CONFIG_RTL8812A) || defined(CONFIG_RTL8821A) 28 | void rtl8812ae_set_hal_ops(_adapter *padapter); 29 | #endif 30 | 31 | #if defined(CONFIG_RTL8192E) 32 | void rtl8192ee_set_hal_ops(_adapter *padapter); 33 | #endif 34 | 35 | #ifdef CONFIG_RTL8723B 36 | void rtl8723be_set_hal_ops(_adapter *padapter); 37 | #endif 38 | 39 | #ifdef CONFIG_RTL8814A 40 | void rtl8814ae_set_hal_ops(_adapter *padapter); 41 | #endif 42 | 43 | u8 rtw_set_hal_ops(_adapter *padapter); 44 | 45 | #endif //__PCIE_HAL_H__ 46 | 47 | -------------------------------------------------------------------------------- /include/rtw_mem.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_MEM_H__ 21 | #define __RTW_MEM_H__ 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | #ifdef CONFIG_PLATFORM_MSTAR_HIGH 28 | #define MAX_RTKM_RECVBUF_SZ (31744) /* 31k */ 29 | #else 30 | #define MAX_RTKM_RECVBUF_SZ (15360) /* 15k */ 31 | #endif /* CONFIG_PLATFORM_MSTAR_HIGH */ 32 | #define MAX_RTKM_NR_PREALLOC_RECV_SKB 16 33 | 34 | u16 rtw_rtkm_get_buff_size(void); 35 | u8 rtw_rtkm_get_nr_recv_skb(void); 36 | struct u8* rtw_alloc_revcbuf_premem(void); 37 | struct sk_buff *rtw_alloc_skb_premem(u16 in_size); 38 | int rtw_free_skb_premem(struct sk_buff *pskb); 39 | 40 | 41 | #endif //__RTW_MEM_H__ 42 | 43 | -------------------------------------------------------------------------------- /include/nic_spec.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 | 21 | 22 | #ifndef __NIC_SPEC_H__ 23 | #define __NIC_SPEC_H__ 24 | 25 | #include 26 | 27 | #define RTL8711_MCTRL_ (0x20000) 28 | #define RTL8711_UART_ (0x30000) 29 | #define RTL8711_TIMER_ (0x40000) 30 | #define RTL8711_FINT_ (0x50000) 31 | #define RTL8711_HINT_ (0x50000) 32 | #define RTL8711_GPIO_ (0x60000) 33 | #define RTL8711_WLANCTRL_ (0x200000) 34 | #define RTL8711_WLANFF_ (0xe00000) 35 | #define RTL8711_HCICTRL_ (0x600000) 36 | #define RTL8711_SYSCFG_ (0x620000) 37 | #define RTL8711_SYSCTRL_ (0x620000) 38 | #define RTL8711_MCCTRL_ (0x020000) 39 | 40 | 41 | #include 42 | 43 | #include 44 | 45 | 46 | #endif // __RTL8711_SPEC_H__ 47 | 48 | -------------------------------------------------------------------------------- /hal/phydm/phydm_noisemonitor.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 __ODMNOISEMONITOR_H__ 21 | #define __ODMNOISEMONITOR_H__ 22 | 23 | #define ODM_MAX_CHANNEL_NUM 38//14+24 24 | struct noise_level 25 | { 26 | //u1Byte value_a, value_b; 27 | u1Byte value[MAX_RF_PATH]; 28 | //s1Byte sval_a, sval_b; 29 | s1Byte sval[MAX_RF_PATH]; 30 | 31 | //s4Byte noise_a=0, noise_b=0,sum_a=0, sum_b=0; 32 | //s4Byte noise[ODM_RF_PATH_MAX]; 33 | s4Byte sum[MAX_RF_PATH]; 34 | //u1Byte valid_cnt_a=0, valid_cnt_b=0, 35 | u1Byte valid[MAX_RF_PATH]; 36 | u1Byte valid_cnt[MAX_RF_PATH]; 37 | 38 | }; 39 | 40 | 41 | typedef struct _ODM_NOISE_MONITOR_ 42 | { 43 | s1Byte noise[MAX_RF_PATH]; 44 | s2Byte noise_all; 45 | }ODM_NOISE_MONITOR; 46 | 47 | s2Byte ODM_InbandNoise_Monitor(PVOID pDM_VOID,u8 bPauseDIG,u8 IGIValue,u32 max_time); 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /include/drv_types_gspi.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2012 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 __DRV_TYPES_GSPI_H__ 21 | #define __DRV_TYPES_GSPI_H__ 22 | 23 | // SPI Header Files 24 | #ifdef PLATFORM_LINUX 25 | #include 26 | #include 27 | #include 28 | //#include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #endif 37 | 38 | 39 | typedef struct gspi_data 40 | { 41 | u8 func_number; 42 | 43 | u8 tx_block_mode; 44 | u8 rx_block_mode; 45 | u32 block_transfer_len; 46 | 47 | #ifdef PLATFORM_LINUX 48 | struct spi_device *func; 49 | 50 | struct workqueue_struct *priv_wq; 51 | struct delayed_work irq_work; 52 | #endif 53 | } GSPI_DATA, *PGSPI_DATA; 54 | 55 | #endif // #ifndef __DRV_TYPES_GSPI_H__ 56 | 57 | -------------------------------------------------------------------------------- /hal/phydm/phydm_dynamicbbpowersaving.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 | 21 | #ifndef __PHYDMDYNAMICBBPOWERSAVING_H__ 22 | #define __PHYDMDYNAMICBBPOWERSAVING_H__ 23 | 24 | #define DYNAMIC_BBPWRSAV_VERSION "1.0" 25 | 26 | typedef struct _Dynamic_Power_Saving_ 27 | { 28 | u1Byte PreCCAState; 29 | u1Byte CurCCAState; 30 | 31 | u1Byte PreRFState; 32 | u1Byte CurRFState; 33 | 34 | int Rssi_val_min; 35 | 36 | u1Byte initialize; 37 | u4Byte Reg874,RegC70,Reg85C,RegA74; 38 | 39 | }PS_T,*pPS_T; 40 | 41 | #define dm_RF_Saving ODM_RF_Saving 42 | 43 | void ODM_RF_Saving( 44 | IN PVOID pDM_VOID, 45 | IN u1Byte bForceInNormal 46 | ); 47 | 48 | VOID 49 | odm_DynamicBBPowerSavingInit( 50 | IN PVOID pDM_VOID 51 | ); 52 | 53 | VOID 54 | odm_DynamicBBPowerSaving( 55 | IN PVOID pDM_VOID 56 | ); 57 | 58 | VOID 59 | odm_1R_CCA( 60 | IN PVOID pDM_VOID 61 | ); 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /include/rtl8188f_led.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 __RTL8188F_LED_H__ 21 | #define __RTL8188F_LED_H__ 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | 28 | //================================================================================ 29 | // Interface to manipulate LED objects. 30 | //================================================================================ 31 | #ifdef CONFIG_USB_HCI 32 | void rtl8188fu_InitSwLeds(PADAPTER padapter); 33 | void rtl8188fu_DeInitSwLeds(PADAPTER padapter); 34 | #endif 35 | #ifdef CONFIG_SDIO_HCI 36 | void rtl8188fs_InitSwLeds(PADAPTER padapter); 37 | void rtl8188fs_DeInitSwLeds(PADAPTER padapter); 38 | #endif 39 | #ifdef CONFIG_GSPI_HCI 40 | void rtl8188fs_InitSwLeds(PADAPTER padapter); 41 | void rtl8188fs_DeInitSwLeds(PADAPTER padapter); 42 | #endif 43 | #ifdef CONFIG_PCI_HCI 44 | void rtl8188fe_InitSwLeds(PADAPTER padapter); 45 | void rtl8188fe_DeInitSwLeds(PADAPTER padapter); 46 | #endif 47 | 48 | #endif 49 | 50 | -------------------------------------------------------------------------------- /include/rtl8188f_dm.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 __RTL8188F_DM_H__ 21 | #define __RTL8188F_DM_H__ 22 | //============================================================ 23 | // Description: 24 | // 25 | // This file is for 8188F dynamic mechanism only 26 | // 27 | // 28 | //============================================================ 29 | 30 | //============================================================ 31 | // structure and define 32 | //============================================================ 33 | 34 | //============================================================ 35 | // function prototype 36 | //============================================================ 37 | 38 | void rtl8188f_init_dm_priv(PADAPTER padapter); 39 | void rtl8188f_deinit_dm_priv(PADAPTER padapter); 40 | 41 | void rtl8188f_InitHalDm(PADAPTER padapter); 42 | void rtl8188f_HalDmWatchDog(PADAPTER padapter); 43 | void rtl8188f_HalDmWatchDog_in_LPS(PADAPTER padapter); 44 | void rtl8188f_hal_dm_in_lps(PADAPTER padapter); 45 | 46 | 47 | #endif 48 | 49 | -------------------------------------------------------------------------------- /hal/phydm/rtl8188f/phydm_rtl8188f.c: -------------------------------------------------------------------------------- 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 | 21 | //============================================================ 22 | // include files 23 | //============================================================ 24 | 25 | #include "mp_precomp.h" 26 | #include "../phydm_precomp.h" 27 | 28 | #if (RTL8188F_SUPPORT == 1) 29 | 30 | s1Byte 31 | odm_CCKRSSI_8188F( 32 | IN u1Byte LNA_idx, 33 | IN u1Byte VGA_idx 34 | ) 35 | { 36 | s1Byte rx_pwr_all=0x00; 37 | switch(LNA_idx) 38 | { 39 | case 7: 40 | if (VGA_idx <= 27) 41 | rx_pwr_all = -100 + 2 * (27 - VGA_idx); 42 | else 43 | rx_pwr_all = -100; 44 | break; 45 | 46 | case 5: 47 | rx_pwr_all = -74 + 2 * (21 - VGA_idx); 48 | break; 49 | 50 | case 3: 51 | rx_pwr_all = -60 + 2 * (20 - VGA_idx); 52 | break; 53 | 54 | case 1: 55 | rx_pwr_all = -44 + 2 * (19 - VGA_idx); 56 | break; 57 | 58 | default: 59 | break; 60 | } 61 | return rx_pwr_all; 62 | } 63 | 64 | #endif // end if RTL8188F 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /hal/efuse/efuse_mask.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0 */ 2 | 3 | #if DEV_BUS_TYPE == RT_USB_INTERFACE 4 | 5 | #if defined(CONFIG_RTL8188E) 6 | #include "rtl8188e/HalEfuseMask8188E_USB.h" 7 | #endif 8 | 9 | #if defined(CONFIG_RTL8812A) 10 | #include "rtl8812a/HalEfuseMask8812A_USB.h" 11 | #endif 12 | 13 | #if defined(CONFIG_RTL8821A) 14 | #include "rtl8812a/HalEfuseMask8821A_USB.h" 15 | #endif 16 | 17 | #if defined(CONFIG_RTL8192E) 18 | #include "rtl8192e/HalEfuseMask8192E_USB.h" 19 | #endif 20 | 21 | #if defined(CONFIG_RTL8723B) 22 | #include "rtl8723b/HalEfuseMask8723B_USB.h" 23 | #endif 24 | 25 | #if defined(CONFIG_RTL8814A) 26 | #include "rtl8814a/HalEfuseMask8814A_USB.h" 27 | #endif 28 | 29 | #if defined(CONFIG_RTL8703B) 30 | #include "rtl8703b/HalEfuseMask8703B_USB.h" 31 | #endif 32 | 33 | #if defined(CONFIG_RTL8188F) 34 | #include "rtl8188f/HalEfuseMask8188F_USB.h" 35 | #endif 36 | 37 | #elif DEV_BUS_TYPE == RT_PCI_INTERFACE 38 | 39 | #if defined(CONFIG_RTL8188E) 40 | #include "rtl8188e/HalEfuseMask8188E_PCIE.h" 41 | #endif 42 | 43 | #if defined(CONFIG_RTL8812A) 44 | #include "rtl8812a/HalEfuseMask8812A_PCIE.h" 45 | #endif 46 | 47 | #if defined(CONFIG_RTL8821A) 48 | #include "rtl8812a/HalEfuseMask8821A_PCIE.h" 49 | #endif 50 | 51 | #if defined(CONFIG_RTL8192E) 52 | #include "rtl8192e/HalEfuseMask8192E_PCIE.h" 53 | #endif 54 | 55 | #if defined(CONFIG_RTL8723B) 56 | #include "rtl8723b/HalEfuseMask8723B_PCIE.h" 57 | #endif 58 | 59 | #if defined(CONFIG_RTL8814A) 60 | #include "rtl8814a/HalEfuseMask8814A_PCIE.h" 61 | #endif 62 | 63 | #if defined(CONFIG_RTL8703B) 64 | #include "rtl8703b/HalEfuseMask8703B_PCIE.h" 65 | #endif 66 | 67 | #elif DEV_BUS_TYPE == RT_SDIO_INTERFACE 68 | 69 | #if defined(CONFIG_RTL8188E) 70 | #include "rtl8188e/HalEfuseMask8188E_SDIO.h" 71 | #endif 72 | 73 | #if defined(CONFIG_RTL8703B) 74 | #include "rtl8703b/HalEfuseMask8703B_SDIO.h" 75 | #endif 76 | 77 | #if defined(CONFIG_RTL8188F) 78 | #include "rtl8188f/HalEfuseMask8188F_SDIO.h" 79 | #endif 80 | 81 | #endif -------------------------------------------------------------------------------- /hal/phydm/phydm_cfotracking.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 | 21 | #ifndef __PHYDMCFOTRACK_H__ 22 | #define __PHYDMCFOTRACK_H__ 23 | 24 | #define CFO_TRACKING_VERSION "1.2" /*2015.06.17*/ 25 | 26 | #define CFO_TH_XTAL_HIGH 20 // kHz 27 | #define CFO_TH_XTAL_LOW 10 // kHz 28 | #define CFO_TH_ATC 80 // kHz 29 | 30 | typedef struct _CFO_TRACKING_ 31 | { 32 | BOOLEAN bATCStatus; 33 | BOOLEAN largeCFOHit; 34 | BOOLEAN bAdjust; 35 | u1Byte CrystalCap; 36 | u1Byte DefXCap; 37 | int CFO_tail[2]; 38 | int CFO_ave_pre; 39 | u4Byte packetCount; 40 | u4Byte packetCount_pre; 41 | 42 | BOOLEAN bForceXtalCap; 43 | BOOLEAN bReset; 44 | }CFO_TRACKING, *PCFO_TRACKING; 45 | 46 | VOID 47 | ODM_CfoTrackingReset( 48 | IN PVOID pDM_VOID 49 | ); 50 | 51 | VOID 52 | ODM_CfoTrackingInit( 53 | IN PVOID pDM_VOID 54 | ); 55 | 56 | VOID 57 | ODM_CfoTracking( 58 | IN PVOID pDM_VOID 59 | ); 60 | 61 | VOID 62 | ODM_ParsingCFO( 63 | IN PVOID pDM_VOID, 64 | IN PVOID pPktinfo_VOID, 65 | IN s1Byte* pcfotail 66 | ); 67 | 68 | #endif -------------------------------------------------------------------------------- /include/ethernet.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 | /*! \file */ 21 | #ifndef __INC_ETHERNET_H 22 | #define __INC_ETHERNET_H 23 | 24 | #define ETHERNET_ADDRESS_LENGTH 6 //!< Ethernet Address Length 25 | #define ETHERNET_HEADER_SIZE 14 //!< Ethernet Header Length 26 | #define LLC_HEADER_SIZE 6 //!< LLC Header Length 27 | #define TYPE_LENGTH_FIELD_SIZE 2 //!< Type/Length Size 28 | #define MINIMUM_ETHERNET_PACKET_SIZE 60 //!< Minimum Ethernet Packet Size 29 | #define MAXIMUM_ETHERNET_PACKET_SIZE 1514 //!< Maximum Ethernet Packet Size 30 | 31 | #define RT_ETH_IS_MULTICAST(_pAddr) ((((UCHAR *)(_pAddr))[0]&0x01)!=0) //!< Is Multicast Address? 32 | #define RT_ETH_IS_BROADCAST(_pAddr) ( \ 33 | ((UCHAR *)(_pAddr))[0]==0xff && \ 34 | ((UCHAR *)(_pAddr))[1]==0xff && \ 35 | ((UCHAR *)(_pAddr))[2]==0xff && \ 36 | ((UCHAR *)(_pAddr))[3]==0xff && \ 37 | ((UCHAR *)(_pAddr))[4]==0xff && \ 38 | ((UCHAR *)(_pAddr))[5]==0xff ) //!< Is Broadcast Address? 39 | 40 | 41 | #endif // #ifndef __INC_ETHERNET_H 42 | 43 | -------------------------------------------------------------------------------- /os_dep/linux/rtw_proc.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2013 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_PROC_H__ 21 | #define __RTW_PROC_H__ 22 | 23 | #include 24 | #include 25 | 26 | struct rtw_proc_hdl { 27 | char *name; 28 | int (*show)(struct seq_file *, void *); 29 | ssize_t (*write)(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 30 | }; 31 | 32 | #ifdef CONFIG_PROC_DEBUG 33 | 34 | struct proc_dir_entry *get_rtw_drv_proc(void); 35 | int rtw_drv_proc_init(void); 36 | void rtw_drv_proc_deinit(void); 37 | struct proc_dir_entry *rtw_adapter_proc_init(struct net_device *dev); 38 | void rtw_adapter_proc_deinit(struct net_device *dev); 39 | void rtw_adapter_proc_replace(struct net_device *dev); 40 | 41 | #else //!CONFIG_PROC_DEBUG 42 | 43 | #define get_rtw_drv_proc() NULL 44 | #define rtw_drv_proc_init() 0 45 | #define rtw_drv_proc_deinit() do {} while (0) 46 | #define rtw_adapter_proc_init(dev) NULL 47 | #define rtw_adapter_proc_deinit(dev) do {} while (0) 48 | #define rtw_adapter_proc_replace(dev) do {} while (0) 49 | 50 | #endif //!CONFIG_PROC_DEBUG 51 | 52 | #endif //__RTW_PROC_H__ 53 | -------------------------------------------------------------------------------- /include/usb_hal.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 __USB_HAL_H__ 21 | #define __USB_HAL_H__ 22 | 23 | int usb_init_recv_priv(_adapter *padapter, u16 ini_in_buf_sz); 24 | void usb_free_recv_priv (_adapter *padapter, u16 ini_in_buf_sz); 25 | 26 | u8 rtw_set_hal_ops(_adapter *padapter); 27 | 28 | #ifdef CONFIG_RTL8188E 29 | void rtl8188eu_set_hal_ops(_adapter * padapter); 30 | #endif 31 | 32 | #if defined(CONFIG_RTL8812A) || defined(CONFIG_RTL8821A) 33 | void rtl8812au_set_hal_ops(_adapter * padapter); 34 | #endif 35 | 36 | #ifdef CONFIG_RTL8192E 37 | void rtl8192eu_set_hal_ops(_adapter * padapter); 38 | #endif 39 | 40 | 41 | #ifdef CONFIG_RTL8723B 42 | void rtl8723bu_set_hal_ops(_adapter * padapter); 43 | #endif 44 | 45 | #ifdef CONFIG_RTL8814A 46 | void rtl8814au_set_hal_ops(_adapter * padapter); 47 | #endif /* CONFIG_RTL8814A */ 48 | 49 | #ifdef CONFIG_RTL8188F 50 | void rtl8188fu_set_hal_ops(_adapter *padapter); 51 | #endif 52 | 53 | #ifdef CONFIG_RTL8703B 54 | void rtl8703bu_set_hal_ops(_adapter *padapter); 55 | #endif 56 | 57 | #ifdef CONFIG_INTEL_PROXIM 58 | extern _adapter *rtw_usb_get_sw_pointer(void); 59 | #endif //CONFIG_INTEL_PROXIM 60 | #endif //__USB_HAL_H__ 61 | 62 | -------------------------------------------------------------------------------- /include/rtw_sreset.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2012 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_SRESET_H_ 21 | #define _RTW_SRESET_H_ 22 | 23 | //#include 24 | 25 | enum { 26 | SRESET_TGP_NULL = 0, 27 | SRESET_TGP_XMIT_STATUS = 1, 28 | SRESET_TGP_LINK_STATUS = 2, 29 | }; 30 | 31 | struct sreset_priv { 32 | _mutex silentreset_mutex; 33 | u8 silent_reset_inprogress; 34 | u8 Wifi_Error_Status; 35 | unsigned long last_tx_time; 36 | unsigned long last_tx_complete_time; 37 | 38 | s32 dbg_trigger_point; 39 | }; 40 | 41 | 42 | 43 | #define WIFI_STATUS_SUCCESS 0 44 | #define USB_VEN_REQ_CMD_FAIL BIT0 45 | #define USB_READ_PORT_FAIL BIT1 46 | #define USB_WRITE_PORT_FAIL BIT2 47 | #define WIFI_MAC_TXDMA_ERROR BIT3 48 | #define WIFI_TX_HANG BIT4 49 | #define WIFI_RX_HANG BIT5 50 | #define WIFI_IF_NOT_EXIST BIT6 51 | 52 | void sreset_init_value(_adapter *padapter); 53 | void sreset_reset_value(_adapter *padapter); 54 | u8 sreset_get_wifi_status(_adapter *padapter); 55 | void sreset_set_wifi_error_status(_adapter *padapter, u32 status); 56 | void sreset_set_trigger_point(_adapter *padapter, s32 tgp); 57 | bool sreset_inprogress(_adapter *padapter); 58 | void sreset_reset(_adapter *padapter); 59 | 60 | #endif 61 | 62 | -------------------------------------------------------------------------------- /hal/phydm/rtl8188f/halhwimg8188f_bb.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 | 21 | /*Image2HeaderVersion: 2.18*/ 22 | #if (RTL8188F_SUPPORT == 1) 23 | #ifndef __INC_MP_BB_HW_IMG_8188F_H 24 | #define __INC_MP_BB_HW_IMG_8188F_H 25 | 26 | 27 | /****************************************************************************** 28 | * AGC_TAB.TXT 29 | ******************************************************************************/ 30 | 31 | void 32 | ODM_ReadAndConfig_MP_8188F_AGC_TAB(/* TC: Test Chip, MP: MP Chip*/ 33 | IN PDM_ODM_T pDM_Odm 34 | ); 35 | u4Byte ODM_GetVersion_MP_8188F_AGC_TAB(void); 36 | 37 | /****************************************************************************** 38 | * PHY_REG.TXT 39 | ******************************************************************************/ 40 | 41 | void 42 | ODM_ReadAndConfig_MP_8188F_PHY_REG(/* TC: Test Chip, MP: MP Chip*/ 43 | IN PDM_ODM_T pDM_Odm 44 | ); 45 | u4Byte ODM_GetVersion_MP_8188F_PHY_REG(void); 46 | 47 | /****************************************************************************** 48 | * PHY_REG_PG.TXT 49 | ******************************************************************************/ 50 | 51 | void 52 | ODM_ReadAndConfig_MP_8188F_PHY_REG_PG(/* TC: Test Chip, MP: MP Chip*/ 53 | IN PDM_ODM_T pDM_Odm 54 | ); 55 | u4Byte ODM_GetVersion_MP_8188F_PHY_REG_PG(void); 56 | 57 | #endif 58 | #endif /* end of HWIMG_SUPPORT*/ 59 | 60 | -------------------------------------------------------------------------------- /include/rtw_odm.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2013 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_ODM_H__ 21 | #define __RTW_ODM_H__ 22 | 23 | #include 24 | #include "../hal/phydm/phydm_types.h" 25 | /* 26 | * This file provides utilities/wrappers for rtw driver to use ODM 27 | */ 28 | 29 | void rtw_odm_dbg_comp_msg(void *sel,_adapter *adapter); 30 | void rtw_odm_dbg_comp_set(_adapter *adapter, u64 comps); 31 | void rtw_odm_dbg_level_msg(void *sel,_adapter *adapter); 32 | void rtw_odm_dbg_level_set(_adapter *adapter, u32 level); 33 | 34 | void rtw_odm_ability_msg(void *sel, _adapter *adapter); 35 | void rtw_odm_ability_set(_adapter *adapter, u32 ability); 36 | 37 | void rtw_odm_init_ic_type(_adapter *adapter); 38 | 39 | void rtw_odm_adaptivity_config_msg(void *sel, _adapter *adapter); 40 | 41 | bool rtw_odm_adaptivity_needed(_adapter *adapter); 42 | void rtw_odm_adaptivity_parm_msg(void *sel,_adapter *adapter); 43 | void rtw_odm_adaptivity_parm_set(_adapter *adapter, s8 TH_L2H_ini, s8 TH_EDCCA_HL_diff, s8 TH_L2H_ini_mode2, s8 TH_EDCCA_HL_diff_mode2, u8 EDCCA_enable); 44 | void rtw_odm_get_perpkt_rssi(void *sel, _adapter *adapter); 45 | void rtw_odm_acquirespinlock(_adapter *adapter, RT_SPINLOCK_TYPE type); 46 | void rtw_odm_releasespinlock(_adapter *adapter, RT_SPINLOCK_TYPE type); 47 | 48 | #ifdef CONFIG_DFS_MASTER 49 | VOID rtw_odm_radar_detect_reset(_adapter *adapter); 50 | VOID rtw_odm_radar_detect_disable(_adapter *adapter); 51 | VOID rtw_odm_radar_detect_enable(_adapter *adapter); 52 | BOOLEAN rtw_odm_radar_detect(_adapter *adapter); 53 | #endif /* CONFIG_DFS_MASTER */ 54 | #endif // __RTW_ODM_H__ 55 | 56 | -------------------------------------------------------------------------------- /include/usb_vendor_req.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 _USB_VENDOR_REQUEST_H_ 21 | #define _USB_VENDOR_REQUEST_H_ 22 | 23 | //4 Set/Get Register related wIndex/Data 24 | #define RT_USB_RESET_MASK_OFF 0 25 | #define RT_USB_RESET_MASK_ON 1 26 | #define RT_USB_SLEEP_MASK_OFF 0 27 | #define RT_USB_SLEEP_MASK_ON 1 28 | #define RT_USB_LDO_ON 1 29 | #define RT_USB_LDO_OFF 0 30 | 31 | //4 Set/Get SYSCLK related wValue or Data 32 | #define RT_USB_SYSCLK_32KHZ 0 33 | #define RT_USB_SYSCLK_40MHZ 1 34 | #define RT_USB_SYSCLK_60MHZ 2 35 | 36 | 37 | typedef enum _RT_USB_BREQUEST { 38 | RT_USB_SET_REGISTER = 1, 39 | RT_USB_SET_SYSCLK = 2, 40 | RT_USB_GET_SYSCLK = 3, 41 | RT_USB_GET_REGISTER = 4 42 | } RT_USB_BREQUEST; 43 | 44 | 45 | typedef enum _RT_USB_WVALUE { 46 | RT_USB_RESET_MASK = 1, 47 | RT_USB_SLEEP_MASK = 2, 48 | RT_USB_USB_HRCPWM = 3, 49 | RT_USB_LDO = 4, 50 | RT_USB_BOOT_TYPE = 5 51 | } RT_USB_WVALUE; 52 | 53 | 54 | //BOOLEAN usbvendorrequest(PCE_USB_DEVICE CEdevice, RT_USB_BREQUEST bRequest, RT_USB_WVALUE wValue, UCHAR wIndex, PVOID Data, UCHAR DataLength, BOOLEAN isDirectionIn); 55 | //BOOLEAN CEusbGetStatusRequest(PCE_USB_DEVICE CEdevice, IN USHORT Op, IN USHORT Index, PVOID Data); 56 | //BOOLEAN CEusbFeatureRequest(PCE_USB_DEVICE CEdevice, IN USHORT Op, IN USHORT FeatureSelector, IN USHORT Index); 57 | //BOOLEAN CEusbGetDescriptorRequest(PCE_USB_DEVICE CEdevice, IN short urbLength, IN UCHAR DescriptorType, IN UCHAR Index, IN USHORT LanguageId, IN PVOID TransferBuffer, IN ULONG TransferBufferLength); 58 | 59 | #endif 60 | 61 | -------------------------------------------------------------------------------- /include/rtw_br_ext.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_BR_EXT_H_ 21 | #define _RTW_BR_EXT_H_ 22 | 23 | #if 1 // rtw_wifi_driver 24 | #define CL_IPV6_PASS 1 25 | #define MACADDRLEN 6 26 | #define _DEBUG_ERR DBG_8192C 27 | #define _DEBUG_INFO //DBG_8192C 28 | #define DEBUG_WARN DBG_8192C 29 | #define DEBUG_INFO //DBG_8192C 30 | #define DEBUG_ERR DBG_8192C 31 | //#define GET_MY_HWADDR ((GET_MIB(priv))->dot11OperationEntry.hwaddr) 32 | #define GET_MY_HWADDR(padapter) (adapter_mac_addr(padapter)) 33 | #endif // rtw_wifi_driver 34 | 35 | #define NAT25_HASH_BITS 4 36 | #define NAT25_HASH_SIZE (1 << NAT25_HASH_BITS) 37 | #define NAT25_AGEING_TIME 300 38 | 39 | #ifdef CL_IPV6_PASS 40 | #define MAX_NETWORK_ADDR_LEN 17 41 | #else 42 | #define MAX_NETWORK_ADDR_LEN 11 43 | #endif 44 | 45 | struct nat25_network_db_entry 46 | { 47 | struct nat25_network_db_entry *next_hash; 48 | struct nat25_network_db_entry **pprev_hash; 49 | atomic_t use_count; 50 | unsigned char macAddr[6]; 51 | unsigned long ageing_timer; 52 | unsigned char networkAddr[MAX_NETWORK_ADDR_LEN]; 53 | }; 54 | 55 | enum NAT25_METHOD { 56 | NAT25_MIN, 57 | NAT25_CHECK, 58 | NAT25_INSERT, 59 | NAT25_LOOKUP, 60 | NAT25_PARSE, 61 | NAT25_MAX 62 | }; 63 | 64 | struct br_ext_info { 65 | unsigned int nat25_disable; 66 | unsigned int macclone_enable; 67 | unsigned int dhcp_bcst_disable; 68 | int addPPPoETag; // 1: Add PPPoE relay-SID, 0: disable 69 | unsigned char nat25_dmzMac[MACADDRLEN]; 70 | unsigned int nat25sc_disable; 71 | }; 72 | 73 | void nat25_db_cleanup(_adapter *priv); 74 | 75 | #endif // _RTW_BR_EXT_H_ 76 | 77 | -------------------------------------------------------------------------------- /hal/btc/Mp_Precomp.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2013 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 __MP_PRECOMP_H__ 21 | #define __MP_PRECOMP_H__ 22 | 23 | #include 24 | #include 25 | 26 | #define BT_TMP_BUF_SIZE 100 27 | 28 | #ifdef PLATFORM_LINUX 29 | #define rsprintf snprintf 30 | #elif defined(PLATFORM_WINDOWS) 31 | #define rsprintf sprintf_s 32 | #endif 33 | 34 | #define DCMD_Printf DBG_BT_INFO 35 | 36 | #define delay_ms(ms) rtw_mdelay_os(ms) 37 | 38 | #ifdef bEnable 39 | #undef bEnable 40 | #endif 41 | 42 | #define WPP_SOFTWARE_TRACE 0 43 | 44 | typedef enum _BTC_MSG_COMP_TYPE{ 45 | COMP_COEX = 0, 46 | COMP_MAX 47 | }BTC_MSG_COMP_TYPE; 48 | extern u4Byte GLBtcDbgType[]; 49 | 50 | #define DBG_OFF 0 51 | #define DBG_SEC 1 52 | #define DBG_SERIOUS 2 53 | #define DBG_WARNING 3 54 | #define DBG_LOUD 4 55 | #define DBG_TRACE 5 56 | 57 | #if DBG 58 | #ifdef RT_TRACE 59 | #undef RT_TRACE 60 | #define RT_TRACE(dbgtype, dbgflag, printstr)\ 61 | do {\ 62 | if (GLBtcDbgType[dbgtype] & BIT(dbgflag))\ 63 | {\ 64 | DbgPrint printstr;\ 65 | }\ 66 | } while (0) 67 | #endif 68 | #else 69 | #define RT_TRACE(dbgtype, dbgflag, printstr) 70 | #endif 71 | 72 | #include "HalBtcOutSrc.h" 73 | #include "HalBtc8188c2Ant.h" 74 | #include "HalBtc8192d2Ant.h" 75 | #include "HalBtc8192e1Ant.h" 76 | #include "HalBtc8192e2Ant.h" 77 | #include "HalBtc8723a1Ant.h" 78 | #include "HalBtc8723a2Ant.h" 79 | #include "HalBtc8723b1Ant.h" 80 | #include "HalBtc8723b2Ant.h" 81 | #include "HalBtc8812a1Ant.h" 82 | #include "HalBtc8812a2Ant.h" 83 | #include "HalBtc8821a1Ant.h" 84 | #include "HalBtc8821a2Ant.h" 85 | #include "HalBtc8821aCsr2Ant.h" 86 | #include "HalBtc8703b1Ant.h" 87 | #include "HalBtc8703b2Ant.h" 88 | 89 | #endif // __MP_PRECOMP_H__ 90 | -------------------------------------------------------------------------------- /hal/efuse/rtl8188f/HalEfuseMask8188F_SDIO.c: -------------------------------------------------------------------------------- 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 | 21 | //#include "Mp_Precomp.h" 22 | //#include "../odm_precomp.h" 23 | 24 | #include 25 | 26 | #include "HalEfuseMask8188F_SDIO.h" 27 | 28 | 29 | 30 | /****************************************************************************** 31 | * MSDIO.TXT 32 | ******************************************************************************/ 33 | 34 | u1Byte Array_MP_8188F_MSDIO[] = { 35 | 0xFF, 36 | 0xF3, 37 | 0x00, 38 | 0x00, 39 | 0x00, 40 | 0x00, 41 | 0x00, 42 | 0x00, 43 | 0x00, 44 | 0x00, 45 | 0x00, 46 | 0x0F, 47 | 0xF1, 48 | 0xFF, 49 | 0xFF, 50 | 0xFF, 51 | 0xFF, 52 | 0xFF, 53 | 0x00, 54 | 0x00, 55 | 0x00, 56 | 0x00, 57 | 0x00, 58 | 0x00, 59 | 0x00, 60 | 0x00, 61 | 0x00, 62 | 0x00, 63 | 0x00, 64 | 0x00, 65 | 0x00, 66 | 0x00, 67 | 68 | }; 69 | 70 | u2Byte 71 | EFUSE_GetArrayLen_MP_8188F_MSDIO(VOID) 72 | { 73 | return sizeof(Array_MP_8188F_MSDIO)/sizeof(u1Byte); 74 | } 75 | 76 | VOID 77 | EFUSE_GetMaskArray_MP_8188F_MSDIO( 78 | IN OUT pu1Byte Array 79 | ) 80 | { 81 | u2Byte len = EFUSE_GetArrayLen_MP_8188F_MSDIO(), i = 0; 82 | 83 | for (i = 0; i < len; ++i) 84 | Array[i] = Array_MP_8188F_MSDIO[i]; 85 | } 86 | BOOLEAN 87 | EFUSE_IsAddressMasked_MP_8188F_MSDIO( 88 | IN u2Byte Offset 89 | ) 90 | { 91 | int r = Offset/16; 92 | int c = (Offset%16) / 2; 93 | int result = 0; 94 | 95 | if (c < 4) // Upper double word 96 | result = (Array_MP_8188F_MSDIO[r] & (0x10 << c)); 97 | else 98 | result = (Array_MP_8188F_MSDIO[r] & (0x01 << (c-4))); 99 | 100 | return (result > 0) ? 0 : 1; 101 | } 102 | 103 | 104 | -------------------------------------------------------------------------------- /hal/efuse/rtl8188f/HalEfuseMask8188F_USB.c: -------------------------------------------------------------------------------- 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 | 21 | //#include "Mp_Precomp.h" 22 | //#include "../odm_precomp.h" 23 | 24 | #include 25 | 26 | #include "HalEfuseMask8188F_USB.h" 27 | 28 | 29 | /****************************************************************************** 30 | * MUSB.TXT 31 | ******************************************************************************/ 32 | 33 | u1Byte Array_MP_8188F_MUSB[] = { 34 | 0xFF, 35 | 0xF3, 36 | 0x00, 37 | 0x00, 38 | 0x00, 39 | 0x00, 40 | 0x00, 41 | 0x00, 42 | 0x00, 43 | 0x00, 44 | 0x00, 45 | 0x0F, 46 | 0xF1, 47 | 0xFF, 48 | 0xFF, 49 | 0xFF, 50 | 0xFF, 51 | 0x70, 52 | 0x00, 53 | 0x12, 54 | 0x00, 55 | 0x00, 56 | 0x00, 57 | 0x00, 58 | 0x00, 59 | 0x00, 60 | 0x00, 61 | 0x00, 62 | 0x00, 63 | 0x00, 64 | 0x00, 65 | 0x00, 66 | }; 67 | 68 | u2Byte 69 | EFUSE_GetArrayLen_MP_8188F_MUSB(VOID) 70 | { 71 | return sizeof(Array_MP_8188F_MUSB)/sizeof(u1Byte); 72 | } 73 | 74 | VOID 75 | EFUSE_GetMaskArray_MP_8188F_MUSB( 76 | IN OUT pu1Byte Array 77 | ) 78 | { 79 | u2Byte len = EFUSE_GetArrayLen_MP_8188F_MUSB(), i = 0; 80 | 81 | for (i = 0; i < len; ++i) 82 | Array[i] = Array_MP_8188F_MUSB[i]; 83 | } 84 | BOOLEAN 85 | EFUSE_IsAddressMasked_MP_8188F_MUSB( 86 | IN u2Byte Offset 87 | ) 88 | { 89 | int r = Offset/16; 90 | int c = (Offset%16) / 2; 91 | int result = 0; 92 | 93 | if (c < 4) // Upper double word 94 | result = (Array_MP_8188F_MUSB[r] & (0x10 << c)); 95 | else 96 | result = (Array_MP_8188F_MUSB[r] & (0x01 << (c-4))); 97 | 98 | return (result > 0) ? 0 : 1; 99 | } 100 | 101 | 102 | -------------------------------------------------------------------------------- /hal/phydm/rtl8188f/phydm_regconfig8188f.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 __INC_ODM_REGCONFIG_H_8188F 21 | #define __INC_ODM_REGCONFIG_H_8188F 22 | 23 | #if (RTL8188F_SUPPORT == 1) 24 | 25 | void 26 | odm_ConfigRFReg_8188F( 27 | IN PDM_ODM_T pDM_Odm, 28 | IN u4Byte Addr, 29 | IN u4Byte Data, 30 | IN ODM_RF_RADIO_PATH_E RF_PATH, 31 | IN u4Byte RegAddr 32 | ); 33 | 34 | void 35 | odm_ConfigRF_RadioA_8188F( 36 | IN PDM_ODM_T pDM_Odm, 37 | IN u4Byte Addr, 38 | IN u4Byte Data 39 | ); 40 | 41 | void 42 | odm_ConfigRF_RadioB_8188F( 43 | IN PDM_ODM_T pDM_Odm, 44 | IN u4Byte Addr, 45 | IN u4Byte Data 46 | ); 47 | 48 | void 49 | odm_ConfigMAC_8188F( 50 | IN PDM_ODM_T pDM_Odm, 51 | IN u4Byte Addr, 52 | IN u1Byte Data 53 | ); 54 | 55 | void 56 | odm_ConfigBB_AGC_8188F( 57 | IN PDM_ODM_T pDM_Odm, 58 | IN u4Byte Addr, 59 | IN u4Byte Bitmask, 60 | IN u4Byte Data 61 | ); 62 | 63 | void 64 | odm_ConfigBB_PHY_REG_PG_8188F( 65 | IN PDM_ODM_T pDM_Odm, 66 | IN u4Byte Band, 67 | IN u4Byte RfPath, 68 | IN u4Byte TxNum, 69 | IN u4Byte Addr, 70 | IN u4Byte Bitmask, 71 | IN u4Byte Data 72 | ); 73 | 74 | void 75 | odm_ConfigBB_PHY_8188F( 76 | IN PDM_ODM_T pDM_Odm, 77 | IN u4Byte Addr, 78 | IN u4Byte Bitmask, 79 | IN u4Byte Data 80 | ); 81 | 82 | void 83 | odm_ConfigBB_TXPWR_LMT_8188F( 84 | IN PDM_ODM_T pDM_Odm, 85 | IN pu1Byte Regulation, 86 | IN pu1Byte Band, 87 | IN pu1Byte Bandwidth, 88 | IN pu1Byte RateSection, 89 | IN pu1Byte RfPath, 90 | IN pu1Byte Channel, 91 | IN pu1Byte PowerLimit 92 | ); 93 | 94 | #endif 95 | #endif // end of SUPPORT 96 | 97 | -------------------------------------------------------------------------------- /hal/hal_com_c2h.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2012 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 __COMMON_C2H_H__ 21 | #define __COMMON_C2H_H__ 22 | 23 | typedef enum _C2H_EVT { 24 | C2H_DBG = 0x00, 25 | C2H_LB = 0x01, 26 | C2H_TXBF = 0x02, 27 | C2H_CCX_TX_RPT = 0x03, 28 | C2H_BT_INFO = 0x09, 29 | C2H_BT_MP_INFO = 0x0B, 30 | C2H_RA_RPT = 0x0C, 31 | C2H_RA_PARA_RPT = 0x0E, 32 | C2H_FW_CHNL_SWITCH_COMPLETE = 0x10, 33 | C2H_IQK_FINISH = 0x11, 34 | C2H_MAILBOX_STATUS = 0x15, 35 | C2H_P2P_RPORT = 0x16, 36 | C2H_MAC_HIDDEN_RPT = 0x19, 37 | C2H_MAC_HIDDEN_RPT_2 = 0x1A, 38 | C2H_BCN_EARLY_RPT = 0x1E, 39 | C2H_BT_SCOREBOARD_STATUS = 0x20, 40 | C2H_DEFEATURE_DBG = 0x22, 41 | C2H_CUSTOMER_STR_RPT = 0x24, 42 | C2H_CUSTOMER_STR_RPT_2 = 0x25, 43 | C2H_DEFEATURE_RSVD = 0xFD, 44 | C2H_EXTEND = 0xff, 45 | } C2H_EVT; 46 | 47 | typedef enum _EXTEND_C2H_EVT { 48 | EXTEND_C2H_DBG_PRINT = 0 49 | } EXTEND_C2H_EVT; 50 | 51 | /* C2H_MAC_HIDDEN_RPT, 0x19 */ 52 | #define MAC_HIDDEN_RPT_LEN 8 53 | int c2h_mac_hidden_rpt_hdl(_adapter *adapter, u8 *data, u8 len); 54 | 55 | /* C2H_MAC_HIDDEN_RPT_2, 0x1A */ 56 | #define MAC_HIDDEN_RPT_2_LEN 5 57 | int c2h_mac_hidden_rpt_2_hdl(_adapter *adapter, u8 *data, u8 len); 58 | 59 | int hal_read_mac_hidden_rpt(_adapter *adapter); 60 | 61 | /* C2H_DEFEATURE_DBG, 0x22 */ 62 | #define DEFEATURE_DBG_LEN 1 63 | int c2h_defeature_dbg_hdl(_adapter *adapter, u8 *data, u8 len); 64 | 65 | #ifdef CONFIG_RTW_CUSTOMER_STR 66 | /* C2H_CUSTOMER_STR_RPT, 0x24 */ 67 | #define CUSTOMER_STR_RPT_LEN 8 68 | int c2h_customer_str_rpt_hdl(_adapter *adapter, u8 *data, u8 len); 69 | 70 | /* C2H_CUSTOMER_STR_RPT_2, 0x25 */ 71 | #define CUSTOMER_STR_RPT_2_LEN 8 72 | int c2h_customer_str_rpt_2_hdl(_adapter *adapter, u8 *data, u8 len); 73 | #endif /* CONFIG_RTW_CUSTOMER_STR */ 74 | 75 | #endif /* __COMMON_C2H_H__ */ 76 | 77 | -------------------------------------------------------------------------------- /hal/phydm/phydm_antdect.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 | 21 | #ifndef __PHYDMANTDECT_H__ 22 | #define __PHYDMANTDECT_H__ 23 | 24 | #define ANTDECT_VERSION "2.1" /*2015.07.29 by YuChen*/ 25 | 26 | #if(defined(CONFIG_ANT_DETECTION)) 27 | //#if( DM_ODM_SUPPORT_TYPE & (ODM_WIN |ODM_CE)) 28 | //ANT Test 29 | #define ANTTESTALL 0x00 /*Ant A or B will be Testing*/ 30 | #define ANTTESTA 0x01 /*Ant A will be Testing*/ 31 | #define ANTTESTB 0x02 /*Ant B will be testing*/ 32 | 33 | #define MAX_ANTENNA_DETECTION_CNT 10 34 | 35 | 36 | typedef struct _ANT_DETECTED_INFO{ 37 | BOOLEAN bAntDetected; 38 | u4Byte dBForAntA; 39 | u4Byte dBForAntB; 40 | u4Byte dBForAntO; 41 | }ANT_DETECTED_INFO, *PANT_DETECTED_INFO; 42 | 43 | 44 | typedef enum tag_SW_Antenna_Switch_Definition 45 | { 46 | Antenna_A = 1, 47 | Antenna_B = 2, 48 | Antenna_MAX = 3, 49 | }DM_SWAS_E; 50 | 51 | 52 | 53 | //1 [1. Single Tone Method] =================================================== 54 | 55 | 56 | 57 | VOID 58 | ODM_SingleDualAntennaDefaultSetting( 59 | IN PVOID pDM_VOID 60 | ); 61 | 62 | BOOLEAN 63 | ODM_SingleDualAntennaDetection( 64 | IN PVOID pDM_VOID, 65 | IN u1Byte mode 66 | ); 67 | 68 | //1 [2. Scan AP RSSI Method] ================================================== 69 | 70 | #define SwAntDivCheckBeforeLink ODM_SwAntDivCheckBeforeLink 71 | 72 | BOOLEAN 73 | ODM_SwAntDivCheckBeforeLink( 74 | IN PVOID pDM_VOID 75 | ); 76 | 77 | 78 | 79 | 80 | //1 [3. PSD Method] ========================================================== 81 | 82 | 83 | VOID 84 | ODM_SingleDualAntennaDetection_PSD( 85 | IN PVOID pDM_VOID 86 | ); 87 | 88 | #endif 89 | 90 | VOID 91 | odm_SwAntDetectInit( 92 | IN PVOID pDM_VOID 93 | ); 94 | 95 | 96 | #endif 97 | 98 | 99 | -------------------------------------------------------------------------------- /include/hal_ic_cfg.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 __HAL_IC_CFG_H__ 21 | #define __HAL_IC_CFG_H__ 22 | 23 | #define RTL8188E_SUPPORT 0 24 | #define RTL8812A_SUPPORT 0 25 | #define RTL8821A_SUPPORT 0 26 | #define RTL8723B_SUPPORT 0 27 | #define RTL8192E_SUPPORT 0 28 | #define RTL8814A_SUPPORT 0 29 | #define RTL8195A_SUPPORT 0 30 | #define RTL8703B_SUPPORT 0 31 | #define RTL8188F_SUPPORT 0 32 | #define RTL8822B_SUPPORT 0 33 | #define RTL8821B_SUPPORT 0 34 | 35 | /*#if (RTL8188E_SUPPORT==1)*/ 36 | #define RATE_ADAPTIVE_SUPPORT 0 37 | #define POWER_TRAINING_ACTIVE 0 38 | 39 | #ifdef CONFIG_MULTIDRV 40 | #endif 41 | 42 | #ifdef CONFIG_RTL8188E 43 | #undef RTL8188E_SUPPORT 44 | #undef RATE_ADAPTIVE_SUPPORT 45 | #undef POWER_TRAINING_ACTIVE 46 | 47 | #define RTL8188E_SUPPORT 1 48 | #define RATE_ADAPTIVE_SUPPORT 1 49 | #define POWER_TRAINING_ACTIVE 1 50 | #endif 51 | 52 | #ifdef CONFIG_RTL8812A 53 | #undef RTL8812A_SUPPORT 54 | #define RTL8812A_SUPPORT 1 55 | #endif 56 | 57 | #ifdef CONFIG_RTL8821A 58 | #undef RTL8821A_SUPPORT 59 | #define RTL8821A_SUPPORT 1 60 | #endif 61 | 62 | #ifdef CONFIG_RTL8192E 63 | #undef RTL8192E_SUPPORT 64 | #define RTL8192E_SUPPORT 1 65 | #endif 66 | 67 | #ifdef CONFIG_RTL8723B 68 | #undef RTL8723B_SUPPORT 69 | #define RTL8723B_SUPPORT 1 70 | #endif 71 | 72 | #ifdef CONFIG_RTL8814A 73 | #undef RTL8814A_SUPPORT 74 | #define RTL8814A_SUPPORT 1 75 | #endif 76 | 77 | #ifdef CONFIG_RTL8703B 78 | #undef RTL8703B_SUPPORT 79 | #define RTL8703B_SUPPORT 1 80 | #endif 81 | 82 | #ifdef CONFIG_RTL8188F 83 | #undef RTL8188F_SUPPORT 84 | #define RTL8188F_SUPPORT 1 85 | #endif 86 | 87 | #ifdef CONFIG_RTL8822B 88 | #undef RTL8822B_SUPPORT 89 | #define RTL8822B_SUPPORT 1 90 | #endif 91 | 92 | #endif /*__HAL_IC_CFG_H__*/ 93 | 94 | -------------------------------------------------------------------------------- /hal/phydm/phydm_dynamictxpower.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 | 21 | #ifndef __PHYDMDYNAMICTXPOWER_H__ 22 | #define __PHYDMDYNAMICTXPOWER_H__ 23 | 24 | /*#define DYNAMIC_TXPWR_VERSION "1.0"*/ 25 | #define DYNAMIC_TXPWR_VERSION "1.1" /*2015.01.13*/ 26 | 27 | #define TX_POWER_NEAR_FIELD_THRESH_LVL2 74 28 | #define TX_POWER_NEAR_FIELD_THRESH_LVL1 67 29 | #define TX_POWER_NEAR_FIELD_THRESH_AP 0x3F 30 | #define TX_POWER_NEAR_FIELD_THRESH_8812 60 31 | 32 | #define TxHighPwrLevel_Normal 0 33 | #define TxHighPwrLevel_Level1 1 34 | #define TxHighPwrLevel_Level2 2 35 | #define TxHighPwrLevel_BT1 3 36 | #define TxHighPwrLevel_BT2 4 37 | #define TxHighPwrLevel_15 5 38 | #define TxHighPwrLevel_35 6 39 | #define TxHighPwrLevel_50 7 40 | #define TxHighPwrLevel_70 8 41 | #define TxHighPwrLevel_100 9 42 | 43 | VOID 44 | odm_DynamicTxPowerInit( 45 | IN PVOID pDM_VOID 46 | ); 47 | 48 | VOID 49 | odm_DynamicTxPowerRestorePowerIndex( 50 | IN PVOID pDM_VOID 51 | ); 52 | 53 | VOID 54 | odm_DynamicTxPowerNIC( 55 | IN PVOID pDM_VOID 56 | ); 57 | 58 | #if(DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE)) 59 | VOID 60 | odm_DynamicTxPowerSavePowerIndex( 61 | IN PVOID pDM_VOID 62 | ); 63 | 64 | VOID 65 | odm_DynamicTxPowerWritePowerIndex( 66 | IN PVOID pDM_VOID, 67 | IN u1Byte Value); 68 | 69 | VOID 70 | odm_DynamicTxPower_92C( 71 | IN PVOID pDM_VOID 72 | ); 73 | 74 | VOID 75 | odm_DynamicTxPower_92D( 76 | IN PVOID pDM_VOID 77 | ); 78 | 79 | VOID 80 | odm_DynamicTxPower_8821( 81 | IN PVOID pDM_VOID, 82 | IN pu1Byte pDesc, 83 | IN u1Byte macId 84 | ); 85 | 86 | #endif 87 | 88 | VOID 89 | odm_DynamicTxPower( 90 | IN PVOID pDM_VOID 91 | ); 92 | 93 | VOID 94 | odm_DynamicTxPowerAP( 95 | IN PVOID pDM_VOID 96 | ); 97 | 98 | #endif 99 | -------------------------------------------------------------------------------- /include/rtl8188f_recv.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 __RTL8188F_RECV_H__ 21 | #define __RTL8188F_RECV_H__ 22 | 23 | #if defined(CONFIG_USB_HCI) 24 | #ifndef MAX_RECVBUF_SZ 25 | #ifdef PLATFORM_OS_CE 26 | #define MAX_RECVBUF_SZ (8192+1024) // 8K+1k 27 | #else 28 | #ifdef CONFIG_MINIMAL_MEMORY_USAGE 29 | #define MAX_RECVBUF_SZ (4000) // about 4K 30 | #else 31 | #ifdef CONFIG_PLATFORM_MSTAR 32 | #define MAX_RECVBUF_SZ (8192) // 8K 33 | #elif defined(CONFIG_PLATFORM_HISILICON) 34 | #define MAX_RECVBUF_SZ (16384) /* 16k */ 35 | #else 36 | #define MAX_RECVBUF_SZ (32768) /* 32k */ 37 | #endif 38 | //#define MAX_RECVBUF_SZ (20480) //20K 39 | //#define MAX_RECVBUF_SZ (10240) //10K 40 | //#define MAX_RECVBUF_SZ (16384) // 16k - 92E RX BUF :16K 41 | //#define MAX_RECVBUF_SZ (8192+1024) // 8K+1k 42 | #endif 43 | #endif 44 | #endif //!MAX_RECVBUF_SZ 45 | #elif defined(CONFIG_PCI_HCI) 46 | #define MAX_RECVBUF_SZ (4000) // about 4K 47 | #elif defined(CONFIG_SDIO_HCI) 48 | #define MAX_RECVBUF_SZ (RX_DMA_BOUNDARY_8188F + 1) 49 | #endif /* CONFIG_SDIO_HCI */ 50 | 51 | // Rx smooth factor 52 | #define Rx_Smooth_Factor (20) 53 | 54 | #if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) 55 | s32 rtl8188fs_init_recv_priv(PADAPTER padapter); 56 | void rtl8188fs_free_recv_priv(PADAPTER padapter); 57 | #endif 58 | 59 | #ifdef CONFIG_USB_HCI 60 | int rtl8188fu_init_recv_priv(_adapter *padapter); 61 | void rtl8188fu_free_recv_priv (_adapter *padapter); 62 | void rtl8188fu_init_recvbuf(_adapter *padapter, struct recv_buf *precvbuf); 63 | #endif 64 | 65 | #ifdef CONFIG_PCI_HCI 66 | s32 rtl8188fe_init_recv_priv(PADAPTER padapter); 67 | void rtl8188fe_free_recv_priv(PADAPTER padapter); 68 | #endif 69 | 70 | void rtl8188f_query_rx_desc_status(union recv_frame *precvframe, u8 *pdesc); 71 | 72 | #endif /* __RTL8188F_RECV_H__ */ 73 | 74 | -------------------------------------------------------------------------------- /include/recv_osdep.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 __RECV_OSDEP_H_ 21 | #define __RECV_OSDEP_H_ 22 | 23 | 24 | extern sint _rtw_init_recv_priv(struct recv_priv *precvpriv, _adapter *padapter); 25 | extern void _rtw_free_recv_priv (struct recv_priv *precvpriv); 26 | 27 | 28 | extern s32 rtw_recv_entry(union recv_frame *precv_frame); 29 | extern int rtw_recv_indicatepkt(_adapter *adapter, union recv_frame *precv_frame); 30 | extern void rtw_recv_returnpacket(IN _nic_hdl cnxt, IN _pkt *preturnedpkt); 31 | 32 | extern int rtw_recv_monitor(_adapter *padapter, union recv_frame *precv_frame); 33 | 34 | extern void rtw_hostapd_mlme_rx(_adapter *padapter, union recv_frame *precv_frame); 35 | 36 | struct sta_info; 37 | extern void rtw_handle_tkip_mic_err(_adapter *padapter, struct sta_info *sta, u8 bgroup); 38 | 39 | 40 | int rtw_init_recv_priv(struct recv_priv *precvpriv, _adapter *padapter); 41 | void rtw_free_recv_priv (struct recv_priv *precvpriv); 42 | 43 | 44 | int rtw_os_recv_resource_init(struct recv_priv *precvpriv, _adapter *padapter); 45 | int rtw_os_recv_resource_alloc(_adapter *padapter, union recv_frame *precvframe); 46 | void rtw_os_recv_resource_free(struct recv_priv *precvpriv); 47 | 48 | 49 | int rtw_os_alloc_recvframe(_adapter *padapter, union recv_frame *precvframe, u8 *pdata, _pkt *pskb); 50 | void rtw_os_free_recvframe(union recv_frame *precvframe); 51 | 52 | 53 | int rtw_os_recvbuf_resource_alloc(_adapter *padapter, struct recv_buf *precvbuf); 54 | int rtw_os_recvbuf_resource_free(_adapter *padapter, struct recv_buf *precvbuf); 55 | 56 | _pkt *rtw_os_alloc_msdu_pkt(union recv_frame *prframe, u16 nSubframe_Length, u8 *pdata); 57 | void rtw_os_recv_indicate_pkt(_adapter *padapter, _pkt *pkt, struct rx_pkt_attrib *pattrib); 58 | 59 | void rtw_os_read_port(_adapter *padapter, struct recv_buf *precvbuf); 60 | 61 | void rtw_init_recv_timer(struct recv_reorder_ctrl *preorder_ctrl); 62 | 63 | 64 | #endif // 65 | 66 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | RTL8188FTV Driver for Allwinner Sunxi ARM SoCs. 2 | For Kernel 4.15.x ~ 5.15.x on Linux Debian & Armbian (including derivatives). 3 | 4 | Compatible with both USB Type-A dongles/adapters, and embedded 2.4ghz wireless radio modules, using the Realtek RTL8188FTV chip. Modified from Kelebek333's rtl8188fu driver. 5 | 6 | ------------------ 7 | 8 | ## Installation 9 | 10 | Begin by installing kernel headers for your operating system. For example, in Armbian, we'll run armbian-config and go to Software > Headers_install. Once that is complete, reboot your system. 11 | 12 | Now, run `uname -a`, note your version number (not kernel version), and add it to the first command: 13 | 1) `apt install -y dkms make git linux-headers-current-sunxi=xx.yy.z` (replace xx.yy.z with your version number) 14 | 15 | 2) `cd /usr/src/linux-headers-$(uname -r) && make scripts` 16 | 17 | 3) `cd /tmp && git clone https://github.com/julianwhitehm/rtl8188ftv_Allwinner` 18 | 19 | 4) `ln -s /lib/modules/$(uname -r)/build/arch/arm /lib/modules/$(uname -r)/build/arch/armv7l` 20 | 21 | 5) `dkms add ./rtl8188ftv_Allwinner` 22 | 23 | 6) `dkms build rtl8188fu/1.0` 24 | 25 | 7) `dkms install rtl8188fu/1.0` 26 | 27 | 8) `cp -r ./rtl8188ftv_Allwinner/firmware/rtl8188fufw.bin /lib/firmware/rtlwifi/ && modprobe rtl8188fu` 28 | 29 | 9) `rm -rf /tmp/rtl8188ftv_Allwinner` 30 | 31 | ------------------ 32 | 33 | ## Configuration 34 | 35 | #### Disable Power Management 36 | 37 | Run following commands for disable power management and plugging/replugging issues. 38 | 39 | `sudo mkdir -p /etc/modprobe.d/` 40 | 41 | `sudo touch /etc/modprobe.d/rtl8188fu.conf` 42 | 43 | `echo "options rtl8188fu rtw_power_mgnt=0 rtw_enusbss=0" | sudo tee /etc/modprobe.d/rtl8188fu.conf` 44 | 45 | #### Disable MAC Address Spoofing 46 | 47 | Run following commands for disabling MAC Address Spoofing (Note: This is not needed on Ubuntu based distributions. MAC Address Spoofing is already disabled on Ubuntu base). 48 | 49 | `sudo mkdir -p /etc/NetworkManager/conf.d/` 50 | 51 | `sudo touch /etc/NetworkManager/conf.d/disable-random-mac.conf` 52 | 53 | `echo -e "[device]\nwifi.scan-rand-mac-address=no" | sudo tee /etc/NetworkManager/conf.d/disable-random-mac.conf` 54 | 55 | #### Blacklist for kernel 5.15 and newer 56 | 57 | If you are using kernel 5.15 and newer, you must create a configuration file with following commands for preventing to conflict rtl8188fu module with built-in r8188eu module. 58 | 59 | `echo 'alias usb:v0BDApF179d*dc*dsc*dp*icFFiscFFipFFin* rtl8188fu' | sudo tee /etc/modprobe.d/r8188eu-blacklist.conf` 60 | 61 | ------------------ 62 | 63 | ## Uninstalling 64 | 65 | `sudo dkms remove rtl8188fu/1.0 --all` 66 | 67 | `sudo rm -f /lib/firmware/rtlwifi/rtl8188fufw.bin` 68 | 69 | `sudo rm -f /etc/modprobe.d/rtl8188fu.conf` 70 | 71 | ------------------ 72 | 73 | ## Platform Testing 74 | 75 | Currently known working with Orange Pi Zero Plus 2 (Allwinner H3). 76 | I will expand this section as more platforms are tested. 77 | -------------------------------------------------------------------------------- /hal/phydm/phydm_rxhp.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 __PHYDMRXHP_H__ 21 | #define __PHYDMRXHP_H__ 22 | 23 | #define RXHP_VERSION "1.0" 24 | 25 | #if (DM_ODM_SUPPORT_TYPE == ODM_WIN) 26 | 27 | #define AFH_PSD 1 //0:normal PSD scan, 1: only do 20 pts PSD 28 | #define MODE_40M 0 //0:20M, 1:40M 29 | #define PSD_TH2 3 30 | #define PSD_CHMIN 20 // Minimum channel number for BT AFH 31 | #define SIR_STEP_SIZE 3 32 | #define Smooth_Size_1 5 33 | #define Smooth_TH_1 3 34 | #define Smooth_Size_2 10 35 | #define Smooth_TH_2 4 36 | #define Smooth_Size_3 20 37 | #define Smooth_TH_3 4 38 | #define Smooth_Step_Size 5 39 | #define Adaptive_SIR 1 40 | #define PSD_RESCAN 4 41 | #define PSD_SCAN_INTERVAL 700 //ms 42 | 43 | typedef struct _RX_High_Power_ 44 | { 45 | u1Byte RXHP_flag; 46 | u1Byte PSD_func_trigger; 47 | u1Byte PSD_bitmap_RXHP[80]; 48 | u1Byte Pre_IGI; 49 | u1Byte Cur_IGI; 50 | u1Byte Pre_pw_th; 51 | u1Byte Cur_pw_th; 52 | BOOLEAN First_time_enter; 53 | BOOLEAN RXHP_enable; 54 | u1Byte TP_Mode; 55 | RT_TIMER PSDTimer; 56 | #if USE_WORKITEM 57 | RT_WORK_ITEM PSDTimeWorkitem; 58 | #endif 59 | }RXHP_T, *pRXHP_T; 60 | 61 | #define dm_PSDMonitorCallback odm_PSDMonitorCallback 62 | VOID odm_PSDMonitorCallback(PRT_TIMER pTimer); 63 | 64 | VOID 65 | odm_PSDMonitorInit( 66 | IN PVOID pDM_VOID 67 | ); 68 | 69 | void odm_RXHPInit( 70 | IN PVOID pDM_VOID); 71 | 72 | void odm_RXHP( 73 | IN PVOID pDM_VOID); 74 | 75 | VOID 76 | odm_PSD_RXHPCallback( 77 | PRT_TIMER pTimer 78 | ); 79 | 80 | VOID 81 | ODM_PSDDbgControl( 82 | IN PADAPTER Adapter, 83 | IN u4Byte mode, 84 | IN u4Byte btRssi 85 | ); 86 | 87 | VOID 88 | odm_PSD_RXHPCallback( 89 | PRT_TIMER pTimer 90 | ); 91 | 92 | VOID 93 | odm_PSD_RXHPWorkitemCallback( 94 | IN PVOID pContext 95 | ); 96 | 97 | VOID 98 | odm_PSDMonitorWorkItemCallback( 99 | IN PVOID pContext 100 | ); 101 | 102 | #endif 103 | 104 | #endif 105 | -------------------------------------------------------------------------------- /hal/rtl8188f/rtl8188f_rxdesc.c: -------------------------------------------------------------------------------- 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 | #define _RTL8188F_REDESC_C_ 21 | 22 | #include 23 | 24 | void rtl8188f_query_rx_desc_status(union recv_frame *precvframe, u8 *pdesc) 25 | { 26 | struct rx_pkt_attrib *pattrib; 27 | 28 | 29 | pattrib = &precvframe->u.hdr.attrib; 30 | _rtw_memset(pattrib, 0, sizeof(struct rx_pkt_attrib)); 31 | 32 | pattrib->pkt_len = (u16)GET_RX_STATUS_DESC_PKT_LEN_8188F(pdesc); 33 | pattrib->pkt_rpt_type = GET_RX_STATUS_DESC_RPT_SEL_8188F(pdesc) ? C2H_PACKET : NORMAL_RX; 34 | 35 | if (pattrib->pkt_rpt_type == NORMAL_RX) { 36 | /* Offset 0 */ 37 | pattrib->crc_err = (u8)GET_RX_STATUS_DESC_CRC32_8188F(pdesc); 38 | pattrib->icv_err = (u8)GET_RX_STATUS_DESC_ICV_8188F(pdesc); 39 | pattrib->drvinfo_sz = (u8)GET_RX_STATUS_DESC_DRVINFO_SIZE_8188F(pdesc) << 3; 40 | pattrib->encrypt = (u8)GET_RX_STATUS_DESC_SECURITY_8188F(pdesc); 41 | pattrib->qos = (u8)GET_RX_STATUS_DESC_QOS_8188F(pdesc); 42 | pattrib->shift_sz = (u8)GET_RX_STATUS_DESC_SHIFT_8188F(pdesc); 43 | pattrib->physt = (u8)GET_RX_STATUS_DESC_PHY_STATUS_8188F(pdesc); 44 | pattrib->bdecrypted = (u8)GET_RX_STATUS_DESC_SWDEC_8188F(pdesc) ? 0 : 1; 45 | 46 | /* Offset 4 */ 47 | pattrib->priority = (u8)GET_RX_STATUS_DESC_TID_8188F(pdesc); 48 | pattrib->amsdu = (u8)GET_RX_STATUS_DESC_AMSDU_8188F(pdesc); 49 | pattrib->mdata = (u8)GET_RX_STATUS_DESC_MORE_DATA_8188F(pdesc); 50 | pattrib->mfrag = (u8)GET_RX_STATUS_DESC_MORE_FRAG_8188F(pdesc); 51 | 52 | /* Offset 8 */ 53 | pattrib->seq_num = (u16)GET_RX_STATUS_DESC_SEQ_8188F(pdesc); 54 | pattrib->frag_num = (u8)GET_RX_STATUS_DESC_FRAG_8188F(pdesc); 55 | 56 | /* Offset 12 */ 57 | pattrib->data_rate = (u8)GET_RX_STATUS_DESC_RX_RATE_8188F(pdesc); 58 | 59 | /* Offset 16 */ 60 | pattrib->sgi = (u8)GET_RX_STATUS_DESC_SPLCP_8188F(pdesc); 61 | pattrib->ldpc = (u8)GET_RX_STATUS_DESC_LDPC_8188F(pdesc); 62 | pattrib->stbc = (u8)GET_RX_STATUS_DESC_STBC_8188F(pdesc); 63 | pattrib->bw = (u8)GET_RX_STATUS_DESC_BW_8188F(pdesc); 64 | 65 | /* Offset 20 */ 66 | /* pattrib->tsfl=(u8)GET_RX_STATUS_DESC_TSFL_8188F(pdesc); */ 67 | } 68 | } 69 | 70 | -------------------------------------------------------------------------------- /include/drv_types_ce.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 __DRV_TYPES_CE_H__ 21 | #define __DRV_TYPES_CE_H__ 22 | 23 | #include 24 | #include 25 | 26 | #include 27 | 28 | #define MAX_ACTIVE_REG_PATH 256 29 | 30 | #define MAX_MCAST_LIST_NUM 32 31 | 32 | 33 | 34 | //for ioctl 35 | #define MAKE_DRIVER_VERSION(_MainVer,_MinorVer) ((((u32)(_MainVer))<<16)+_MinorVer) 36 | 37 | #define NIC_HEADER_SIZE 14 //!< can be moved to typedef.h 38 | #define NIC_MAX_PACKET_SIZE 1514 //!< can be moved to typedef.h 39 | #define NIC_MAX_SEND_PACKETS 10 // max number of send packets the MiniportSendPackets function can accept, can be moved to typedef.h 40 | #define NIC_VENDOR_DRIVER_VERSION MAKE_DRIVER_VERSION(0,001) //!< can be moved to typedef.h 41 | #define NIC_MAX_PACKET_SIZE 1514 //!< can be moved to typedef.h 42 | 43 | typedef struct _MP_REG_ENTRY 44 | { 45 | 46 | NDIS_STRING RegName; // variable name text 47 | BOOLEAN bRequired; // 1 -> required, 0 -> optional 48 | 49 | u8 Type; // NdisParameterInteger/NdisParameterHexInteger/NdisParameterStringle/NdisParameterMultiString 50 | uint FieldOffset; // offset to MP_ADAPTER field 51 | uint FieldSize; // size (in bytes) of the field 52 | 53 | #ifdef UNDER_AMD64 54 | u64 Default; 55 | #else 56 | u32 Default; // default value to use 57 | #endif 58 | 59 | u32 Min; // minimum value allowed 60 | u32 Max; // maximum value allowed 61 | } MP_REG_ENTRY, *PMP_REG_ENTRY; 62 | 63 | #ifdef CONFIG_USB_HCI 64 | typedef struct _USB_EXTENSION { 65 | LPCUSB_FUNCS _lpUsbFuncs; 66 | USB_HANDLE _hDevice; 67 | PVOID pAdapter; 68 | 69 | #if 0 70 | USB_ENDPOINT_DESCRIPTOR _endpACLIn; 71 | USB_ENDPOINT_DESCRIPTOR _endpACLOutHigh; 72 | USB_ENDPOINT_DESCRIPTOR _endpACLOutNormal; 73 | 74 | USB_PIPE pPipeIn; 75 | USB_PIPE pPipeOutNormal; 76 | USB_PIPE pPipeOutHigh; 77 | #endif 78 | 79 | } USB_EXTENSION, *PUSB_EXTENSION; 80 | #endif 81 | 82 | 83 | typedef struct _OCTET_STRING{ 84 | u8 *Octet; 85 | u16 Length; 86 | } OCTET_STRING, *POCTET_STRING; 87 | 88 | 89 | 90 | 91 | 92 | #endif 93 | 94 | -------------------------------------------------------------------------------- /include/drv_types_xp.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 __DRV_TYPES_XP_H__ 21 | #define __DRV_TYPES_XP_H__ 22 | 23 | #include 24 | #include 25 | 26 | 27 | 28 | #define MAX_MCAST_LIST_NUM 32 29 | 30 | 31 | 32 | //for ioctl 33 | #define MAKE_DRIVER_VERSION(_MainVer,_MinorVer) ((((u32)(_MainVer))<<16)+_MinorVer) 34 | 35 | #define NIC_HEADER_SIZE 14 //!< can be moved to typedef.h 36 | #define NIC_MAX_PACKET_SIZE 1514 //!< can be moved to typedef.h 37 | #define NIC_MAX_SEND_PACKETS 10 // max number of send packets the MiniportSendPackets function can accept, can be moved to typedef.h 38 | #define NIC_VENDOR_DRIVER_VERSION MAKE_DRIVER_VERSION(0,001) //!< can be moved to typedef.h 39 | #define NIC_MAX_PACKET_SIZE 1514 //!< can be moved to typedef.h 40 | 41 | 42 | #undef ON_VISTA 43 | //added by Jackson 44 | #ifndef ON_VISTA 45 | // 46 | // Bus driver versions 47 | // 48 | 49 | #define SDBUS_DRIVER_VERSION_1 0x100 50 | #define SDBUS_DRIVER_VERSION_2 0x200 51 | 52 | #define SDP_FUNCTION_TYPE 4 53 | #define SDP_BUS_DRIVER_VERSION 5 54 | #define SDP_BUS_WIDTH 6 55 | #define SDP_BUS_CLOCK 7 56 | #define SDP_BUS_INTERFACE_CONTROL 8 57 | #define SDP_HOST_BLOCK_LENGTH 9 58 | #define SDP_FUNCTION_BLOCK_LENGTH 10 59 | #define SDP_FN0_BLOCK_LENGTH 11 60 | #define SDP_FUNCTION_INT_ENABLE 12 61 | #endif 62 | 63 | 64 | typedef struct _MP_REG_ENTRY 65 | { 66 | 67 | NDIS_STRING RegName; // variable name text 68 | BOOLEAN bRequired; // 1 -> required, 0 -> optional 69 | 70 | u8 Type; // NdisParameterInteger/NdisParameterHexInteger/NdisParameterStringle/NdisParameterMultiString 71 | uint FieldOffset; // offset to MP_ADAPTER field 72 | uint FieldSize; // size (in bytes) of the field 73 | 74 | #ifdef UNDER_AMD64 75 | u64 Default; 76 | #else 77 | u32 Default; // default value to use 78 | #endif 79 | 80 | u32 Min; // minimum value allowed 81 | u32 Max; // maximum value allowed 82 | } MP_REG_ENTRY, *PMP_REG_ENTRY; 83 | 84 | 85 | typedef struct _OCTET_STRING{ 86 | u8 *Octet; 87 | u16 Length; 88 | } OCTET_STRING, *POCTET_STRING; 89 | 90 | 91 | 92 | 93 | 94 | #endif 95 | 96 | -------------------------------------------------------------------------------- /hal/phydm/rtl8188f/halhwimg8188f_rf.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 | 21 | /*Image2HeaderVersion: 2.18*/ 22 | #if (RTL8188F_SUPPORT == 1) 23 | #ifndef __INC_MP_RF_HW_IMG_8188F_H 24 | #define __INC_MP_RF_HW_IMG_8188F_H 25 | 26 | 27 | /****************************************************************************** 28 | * RadioA.TXT 29 | ******************************************************************************/ 30 | 31 | void 32 | ODM_ReadAndConfig_MP_8188F_RadioA(/* TC: Test Chip, MP: MP Chip*/ 33 | IN PDM_ODM_T pDM_Odm 34 | ); 35 | u4Byte ODM_GetVersion_MP_8188F_RadioA(void); 36 | 37 | /****************************************************************************** 38 | * TxPowerTrack_AP.TXT 39 | ******************************************************************************/ 40 | 41 | void 42 | ODM_ReadAndConfig_MP_8188F_TxPowerTrack_AP(/* TC: Test Chip, MP: MP Chip*/ 43 | IN PDM_ODM_T pDM_Odm 44 | ); 45 | u4Byte ODM_GetVersion_MP_8188F_TxPowerTrack_AP(void); 46 | 47 | /****************************************************************************** 48 | * TxPowerTrack_SDIO.TXT 49 | ******************************************************************************/ 50 | 51 | void 52 | ODM_ReadAndConfig_MP_8188F_TxPowerTrack_SDIO(/* TC: Test Chip, MP: MP Chip*/ 53 | IN PDM_ODM_T pDM_Odm 54 | ); 55 | u4Byte ODM_GetVersion_MP_8188F_TxPowerTrack_SDIO(void); 56 | 57 | /****************************************************************************** 58 | * TxPowerTrack_USB.TXT 59 | ******************************************************************************/ 60 | 61 | void 62 | ODM_ReadAndConfig_MP_8188F_TxPowerTrack_USB(/* TC: Test Chip, MP: MP Chip*/ 63 | IN PDM_ODM_T pDM_Odm 64 | ); 65 | u4Byte ODM_GetVersion_MP_8188F_TxPowerTrack_USB(void); 66 | 67 | /****************************************************************************** 68 | * TXPWR_LMT.TXT 69 | ******************************************************************************/ 70 | 71 | void 72 | ODM_ReadAndConfig_MP_8188F_TXPWR_LMT(/* TC: Test Chip, MP: MP Chip*/ 73 | IN PDM_ODM_T pDM_Odm 74 | ); 75 | u4Byte ODM_GetVersion_MP_8188F_TXPWR_LMT(void); 76 | 77 | #endif 78 | #endif /* end of HWIMG_SUPPORT*/ 79 | 80 | -------------------------------------------------------------------------------- /hal/phydm/halphyrf_ce.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 | 21 | #ifndef __HAL_PHY_RF_H__ 22 | #define __HAL_PHY_RF_H__ 23 | 24 | /*#include "phydm_kfree.h"*/ 25 | #if (RTL8814A_SUPPORT == 1) 26 | #include "rtl8814a/phydm_iqk_8814a.h" 27 | #endif 28 | 29 | #if (RTL8822B_SUPPORT == 1) 30 | #include "rtl8822b/phydm_iqk_8822b.h" 31 | #endif 32 | #include "phydm_powertracking_ce.h" 33 | 34 | 35 | typedef enum _SPUR_CAL_METHOD { 36 | PLL_RESET, 37 | AFE_PHASE_SEL 38 | } SPUR_CAL_METHOD; 39 | 40 | typedef enum _PWRTRACK_CONTROL_METHOD { 41 | BBSWING, 42 | TXAGC, 43 | MIX_MODE, 44 | TSSI_MODE 45 | } PWRTRACK_METHOD; 46 | 47 | typedef VOID (*FuncSetPwr)(PVOID, PWRTRACK_METHOD, u1Byte, u1Byte); 48 | typedef VOID(*FuncIQK)(PVOID, u1Byte, u1Byte, u1Byte); 49 | typedef VOID (*FuncLCK)(PVOID); 50 | typedef VOID (*FuncSwing)(PVOID, pu1Byte*, pu1Byte*, pu1Byte*, pu1Byte*); 51 | typedef VOID (*FuncSwing8814only)(PVOID, pu1Byte*, pu1Byte*, pu1Byte*, pu1Byte*); 52 | 53 | typedef struct _TXPWRTRACK_CFG { 54 | u1Byte SwingTableSize_CCK; 55 | u1Byte SwingTableSize_OFDM; 56 | u1Byte Threshold_IQK; 57 | u1Byte Threshold_DPK; 58 | u1Byte AverageThermalNum; 59 | u1Byte RfPathCount; 60 | u4Byte ThermalRegAddr; 61 | FuncSetPwr ODM_TxPwrTrackSetPwr; 62 | FuncIQK DoIQK; 63 | FuncLCK PHY_LCCalibrate; 64 | FuncSwing GetDeltaSwingTable; 65 | FuncSwing8814only GetDeltaSwingTable8814only; 66 | } TXPWRTRACK_CFG, *PTXPWRTRACK_CFG; 67 | 68 | void ConfigureTxpowerTrack( 69 | IN PVOID pDM_VOID, 70 | OUT PTXPWRTRACK_CFG pConfig 71 | ); 72 | 73 | 74 | VOID 75 | ODM_ClearTxPowerTrackingState( 76 | IN PVOID pDM_VOID 77 | ); 78 | 79 | VOID 80 | ODM_TXPowerTrackingCallback_ThermalMeter( 81 | #if (DM_ODM_SUPPORT_TYPE & ODM_AP) 82 | IN PVOID pDM_VOID 83 | #else 84 | IN PADAPTER Adapter 85 | #endif 86 | ); 87 | 88 | 89 | 90 | #define ODM_TARGET_CHNL_NUM_2G_5G 59 91 | 92 | 93 | VOID 94 | ODM_ResetIQKResult( 95 | IN PVOID pDM_VOID 96 | ); 97 | u1Byte 98 | ODM_GetRightChnlPlaceforIQK( 99 | IN u1Byte chnl 100 | ); 101 | 102 | void phydm_rf_init( IN PVOID pDM_VOID); 103 | void phydm_rf_watchdog( IN PVOID pDM_VOID); 104 | 105 | #endif // #ifndef __HAL_PHY_RF_H__ 106 | 107 | -------------------------------------------------------------------------------- /hal/phydm/phydm_regdefine11ac.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 | 21 | #ifndef __ODM_REGDEFINE11AC_H__ 22 | #define __ODM_REGDEFINE11AC_H__ 23 | 24 | //2 RF REG LIST 25 | 26 | 27 | 28 | //2 BB REG LIST 29 | //PAGE 8 30 | #define ODM_REG_CCK_RPT_FORMAT_11AC 0x804 31 | #define ODM_REG_BB_RX_PATH_11AC 0x808 32 | #define ODM_REG_BB_TX_PATH_11AC 0x80c 33 | #define ODM_REG_BB_ATC_11AC 0x860 34 | #define ODM_REG_EDCCA_POWER_CAL 0x8dc 35 | #define ODM_REG_DBG_RPT_11AC 0x8fc 36 | //PAGE 9 37 | #define ODM_REG_EDCCA_DOWN_OPT 0x900 38 | #define ODM_REG_ACBB_EDCCA_ENHANCE 0x944 39 | #define ODM_REG_OFDM_FA_RST_11AC 0x9A4 40 | #define ODM_REG_NHM_TIMER_11AC 0x990 41 | #define ODM_REG_CLM_TIME_PERIOD_11AC 0x990 42 | #define ODM_REG_NHM_TH9_TH10_11AC 0x994 43 | #define ODM_REG_CLM_11AC 0x994 44 | #define ODM_REG_NHM_TH3_TO_TH0_11AC 0x998 45 | #define ODM_REG_NHM_TH7_TO_TH4_11AC 0x99c 46 | #define ODM_REG_NHM_TH8_11AC 0x9a0 47 | #define ODM_REG_NHM_9E8_11AC 0x9e8 48 | #define ODM_REG_CSI_CONTENT_VALUE 0x9b4 49 | //PAGE A 50 | #define ODM_REG_CCK_CCA_11AC 0xA0A 51 | #define ODM_REG_CCK_FA_RST_11AC 0xA2C 52 | #define ODM_REG_CCK_FA_11AC 0xA5C 53 | //PAGE B 54 | #define ODM_REG_RST_RPT_11AC 0xB58 55 | //PAGE C 56 | #define ODM_REG_TRMUX_11AC 0xC08 57 | #define ODM_REG_IGI_A_11AC 0xC50 58 | //PAGE E 59 | #define ODM_REG_IGI_B_11AC 0xE50 60 | #define ODM_REG_TRMUX_11AC_B 0xE08 61 | //PAGE F 62 | #define ODM_REG_CCK_CCA_CNT_11AC 0xF08 63 | #define ODM_REG_OFDM_FA_11AC 0xF48 64 | #define ODM_REG_RPT_11AC 0xfa0 65 | #define ODM_REG_CLM_RESULT_11AC 0xfa4 66 | #define ODM_REG_NHM_CNT_11AC 0xfa8 67 | #define ODM_REG_NHM_DUR_READY_11AC 0xfb4 68 | 69 | #define ODM_REG_NHM_CNT7_TO_CNT4_11AC 0xfac 70 | #define ODM_REG_NHM_CNT11_TO_CNT8_11AC 0xfb0 71 | #define ODM_REG_OFDM_FA_TYPE2_11AC 0xFD0 72 | //PAGE 18 73 | #define ODM_REG_IGI_C_11AC 0x1850 74 | //PAGE 1A 75 | #define ODM_REG_IGI_D_11AC 0x1A50 76 | 77 | //2 MAC REG LIST 78 | #define ODM_REG_RESP_TX_11AC 0x6D8 79 | 80 | 81 | 82 | //DIG Related 83 | #define ODM_BIT_IGI_11AC 0xFFFFFFFF 84 | #define ODM_BIT_CCK_RPT_FORMAT_11AC BIT16 85 | #define ODM_BIT_BB_RX_PATH_11AC 0xF 86 | #define ODM_BIT_BB_TX_PATH_11AC 0xF 87 | #define ODM_BIT_BB_ATC_11AC BIT14 88 | 89 | #endif 90 | 91 | -------------------------------------------------------------------------------- /include/pci_ops.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 __PCI_OPS_H_ 21 | #define __PCI_OPS_H_ 22 | 23 | 24 | #ifdef CONFIG_RTL8188E 25 | u32 rtl8188ee_init_desc_ring(_adapter *padapter); 26 | u32 rtl8188ee_free_desc_ring(_adapter *padapter); 27 | void rtl8188ee_reset_desc_ring(_adapter *padapter); 28 | int rtl8188ee_interrupt(PADAPTER Adapter); 29 | void rtl8188ee_xmit_tasklet(void *priv); 30 | void rtl8188ee_recv_tasklet(void *priv); 31 | void rtl8188ee_prepare_bcn_tasklet(void *priv); 32 | void rtl8188ee_set_intf_ops(struct _io_ops *pops); 33 | #endif 34 | 35 | #if defined(CONFIG_RTL8812A) || defined(CONFIG_RTL8821A) 36 | u32 rtl8812ae_init_desc_ring(_adapter *padapter); 37 | u32 rtl8812ae_free_desc_ring(_adapter *padapter); 38 | void rtl8812ae_reset_desc_ring(_adapter *padapter); 39 | int rtl8812ae_interrupt(PADAPTER Adapter); 40 | void rtl8812ae_xmit_tasklet(void *priv); 41 | void rtl8812ae_recv_tasklet(void *priv); 42 | void rtl8812ae_prepare_bcn_tasklet(void *priv); 43 | void rtl8812ae_set_intf_ops(struct _io_ops *pops); 44 | #endif 45 | 46 | #ifdef CONFIG_RTL8192E 47 | u32 rtl8192ee_init_desc_ring(_adapter *padapter); 48 | u32 rtl8192ee_free_desc_ring(_adapter *padapter); 49 | void rtl8192ee_reset_desc_ring(_adapter *padapter); 50 | void rtl8192ee_recv_tasklet(void *priv); 51 | void rtl8192ee_prepare_bcn_tasklet(void *priv); 52 | int rtl8192ee_interrupt(PADAPTER Adapter); 53 | void rtl8192ee_set_intf_ops(struct _io_ops *pops); 54 | #endif 55 | 56 | #ifdef CONFIG_RTL8723B 57 | u32 rtl8723be_init_desc_ring(_adapter *padapter); 58 | u32 rtl8723be_free_desc_ring(_adapter *padapter); 59 | void rtl8723be_reset_desc_ring(_adapter *padapter); 60 | int rtl8723be_interrupt(PADAPTER Adapter); 61 | void rtl8723be_recv_tasklet(void *priv); 62 | void rtl8723be_prepare_bcn_tasklet(void *priv); 63 | void rtl8723be_set_intf_ops(struct _io_ops *pops); 64 | #endif 65 | 66 | #ifdef CONFIG_RTL8814A 67 | u32 rtl8814ae_init_desc_ring(_adapter *padapter); 68 | u32 rtl8814ae_free_desc_ring(_adapter *padapter); 69 | void rtl8814ae_reset_desc_ring(_adapter *padapter); 70 | int rtl8814ae_interrupt(PADAPTER Adapter); 71 | void rtl8814ae_xmit_tasklet(void *priv); 72 | void rtl8814ae_recv_tasklet(void *priv); 73 | void rtl8814ae_prepare_bcn_tasklet(void *priv); 74 | void rtl8814ae_set_intf_ops(struct _io_ops *pops); 75 | #endif 76 | 77 | #endif 78 | 79 | -------------------------------------------------------------------------------- /include/rtw_ioctl_set.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_IOCTL_SET_H_ 21 | #define __RTW_IOCTL_SET_H_ 22 | 23 | 24 | typedef u8 NDIS_802_11_PMKID_VALUE[16]; 25 | 26 | typedef struct _BSSIDInfo { 27 | NDIS_802_11_MAC_ADDRESS BSSID; 28 | NDIS_802_11_PMKID_VALUE PMKID; 29 | } BSSIDInfo, *PBSSIDInfo; 30 | 31 | 32 | #ifdef PLATFORM_OS_XP 33 | typedef struct _NDIS_802_11_PMKID { 34 | u32 Length; 35 | u32 BSSIDInfoCount; 36 | BSSIDInfo BSSIDInfo[1]; 37 | } NDIS_802_11_PMKID, *PNDIS_802_11_PMKID; 38 | #endif 39 | 40 | 41 | #ifdef PLATFORM_WINDOWS 42 | u8 rtw_set_802_11_reload_defaults(_adapter * padapter, NDIS_802_11_RELOAD_DEFAULTS reloadDefaults); 43 | u8 rtw_set_802_11_test(_adapter * padapter, NDIS_802_11_TEST * test); 44 | u8 rtw_set_802_11_pmkid(_adapter *pdapter, NDIS_802_11_PMKID *pmkid); 45 | 46 | u8 rtw_pnp_set_power_sleep(_adapter* padapter); 47 | u8 rtw_pnp_set_power_wakeup(_adapter* padapter); 48 | 49 | void rtw_pnp_resume_wk(void *context); 50 | void rtw_pnp_sleep_wk(void * context); 51 | 52 | #endif 53 | 54 | u8 rtw_set_802_11_add_key(_adapter * padapter, NDIS_802_11_KEY * key); 55 | u8 rtw_set_802_11_authentication_mode(_adapter *pdapter, NDIS_802_11_AUTHENTICATION_MODE authmode); 56 | u8 rtw_set_802_11_bssid(_adapter* padapter, u8 *bssid); 57 | u8 rtw_set_802_11_add_wep(_adapter * padapter, NDIS_802_11_WEP * wep); 58 | u8 rtw_set_802_11_disassociate(_adapter * padapter); 59 | u8 rtw_set_802_11_bssid_list_scan(_adapter* padapter, NDIS_802_11_SSID *pssid, int ssid_max_num); 60 | u8 rtw_set_802_11_infrastructure_mode(_adapter * padapter, NDIS_802_11_NETWORK_INFRASTRUCTURE networktype); 61 | u8 rtw_set_802_11_remove_wep(_adapter * padapter, u32 keyindex); 62 | u8 rtw_set_802_11_ssid(_adapter * padapter, NDIS_802_11_SSID * ssid); 63 | u8 rtw_set_802_11_connect(_adapter* padapter, u8 *bssid, NDIS_802_11_SSID *ssid); 64 | u8 rtw_set_802_11_remove_key(_adapter * padapter, NDIS_802_11_REMOVE_KEY * key); 65 | 66 | u8 rtw_validate_bssid(u8 *bssid); 67 | u8 rtw_validate_ssid(NDIS_802_11_SSID *ssid); 68 | 69 | u16 rtw_get_cur_max_rate(_adapter *adapter); 70 | int rtw_set_scan_mode(_adapter *adapter, RT_SCAN_TYPE scan_mode); 71 | int rtw_set_channel_plan(_adapter *adapter, u8 channel_plan); 72 | int rtw_set_country(_adapter *adapter, const char *country_code); 73 | int rtw_set_band(_adapter *adapter, u8 band); 74 | 75 | #endif 76 | 77 | -------------------------------------------------------------------------------- /hal/phydm/halphyrf_win.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 | 21 | #ifndef __HAL_PHY_RF_H__ 22 | #define __HAL_PHY_RF_H__ 23 | 24 | #include "phydm_kfree.h" 25 | #if (RTL8814A_SUPPORT == 1) 26 | #include "rtl8814a/phydm_iqk_8814a.h" 27 | #endif 28 | 29 | #if (RTL8822B_SUPPORT == 1) 30 | #include "rtl8822b/phydm_iqk_8822b.h" 31 | #endif 32 | #include "phydm_powertracking_win.h" 33 | 34 | typedef enum _SPUR_CAL_METHOD { 35 | PLL_RESET, 36 | AFE_PHASE_SEL 37 | } SPUR_CAL_METHOD; 38 | 39 | typedef enum _PWRTRACK_CONTROL_METHOD { 40 | BBSWING, 41 | TXAGC, 42 | MIX_MODE, 43 | TSSI_MODE 44 | } PWRTRACK_METHOD; 45 | 46 | typedef VOID (*FuncSetPwr)(PDM_ODM_T, PWRTRACK_METHOD, u1Byte, u1Byte); 47 | typedef VOID(*FuncIQK)(PVOID, u1Byte, u1Byte, u1Byte); 48 | typedef VOID (*FuncLCK)(PDM_ODM_T); 49 | //refine by YuChen for 8814A 50 | typedef VOID (*FuncSwing)(PDM_ODM_T, pu1Byte*, pu1Byte*, pu1Byte*, pu1Byte*); 51 | typedef VOID (*FuncSwing8814only)(PDM_ODM_T, pu1Byte*, pu1Byte*, pu1Byte*, pu1Byte*); 52 | 53 | typedef struct _TXPWRTRACK_CFG { 54 | u1Byte SwingTableSize_CCK; 55 | u1Byte SwingTableSize_OFDM; 56 | u1Byte Threshold_IQK; 57 | u1Byte Threshold_DPK; 58 | u1Byte AverageThermalNum; 59 | u1Byte RfPathCount; 60 | u4Byte ThermalRegAddr; 61 | FuncSetPwr ODM_TxPwrTrackSetPwr; 62 | FuncIQK DoIQK; 63 | FuncLCK PHY_LCCalibrate; 64 | FuncSwing GetDeltaSwingTable; 65 | FuncSwing8814only GetDeltaSwingTable8814only; 66 | } TXPWRTRACK_CFG, *PTXPWRTRACK_CFG; 67 | 68 | VOID 69 | ConfigureTxpowerTrack( 70 | IN PDM_ODM_T pDM_Odm, 71 | OUT PTXPWRTRACK_CFG pConfig 72 | ); 73 | 74 | 75 | VOID 76 | ODM_ClearTxPowerTrackingState( 77 | IN PDM_ODM_T pDM_Odm 78 | ); 79 | 80 | VOID 81 | ODM_TXPowerTrackingCallback_ThermalMeter( 82 | #if (DM_ODM_SUPPORT_TYPE & ODM_AP) 83 | IN PDM_ODM_T pDM_Odm 84 | #else 85 | IN PADAPTER Adapter 86 | #endif 87 | ); 88 | 89 | 90 | 91 | #define ODM_TARGET_CHNL_NUM_2G_5G 59 92 | 93 | 94 | VOID 95 | ODM_ResetIQKResult( 96 | IN PDM_ODM_T pDM_Odm 97 | ); 98 | u1Byte 99 | ODM_GetRightChnlPlaceforIQK( 100 | IN u1Byte chnl 101 | ); 102 | 103 | VOID odm_IQCalibrate(IN PDM_ODM_T pDM_Odm); 104 | VOID phydm_rf_init( IN PDM_ODM_T pDM_Odm); 105 | VOID phydm_rf_watchdog( IN PDM_ODM_T pDM_Odm); 106 | 107 | #endif // #ifndef __HAL_PHY_RF_H__ 108 | 109 | -------------------------------------------------------------------------------- /include/xmit_osdep.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 __XMIT_OSDEP_H_ 21 | #define __XMIT_OSDEP_H_ 22 | 23 | 24 | struct pkt_file { 25 | _pkt *pkt; 26 | SIZE_T pkt_len; //the remainder length of the open_file 27 | _buffer *cur_buffer; 28 | u8 *buf_start; 29 | u8 *cur_addr; 30 | SIZE_T buf_len; 31 | }; 32 | 33 | #ifdef PLATFORM_WINDOWS 34 | 35 | #ifdef PLATFORM_OS_XP 36 | #ifdef CONFIG_USB_HCI 37 | #include 38 | #include 39 | #include 40 | #endif 41 | #endif 42 | 43 | #ifdef CONFIG_GSPI_HCI 44 | #define NR_XMITFRAME 64 45 | #else 46 | #define NR_XMITFRAME 128 47 | #endif 48 | 49 | #define ETH_ALEN 6 50 | 51 | extern NDIS_STATUS rtw_xmit_entry( 52 | IN _nic_hdl cnxt, 53 | IN NDIS_PACKET *pkt, 54 | IN UINT flags 55 | ); 56 | 57 | #endif 58 | 59 | #ifdef PLATFORM_FREEBSD 60 | #define NR_XMITFRAME 256 61 | extern int rtw_xmit_entry(_pkt *pkt, _nic_hdl pnetdev); 62 | extern void rtw_xmit_entry_wrap (struct ifnet * pifp); 63 | #endif //PLATFORM_FREEBSD 64 | 65 | #ifdef PLATFORM_LINUX 66 | 67 | #define NR_XMITFRAME 256 68 | 69 | struct xmit_priv; 70 | struct pkt_attrib; 71 | struct sta_xmit_priv; 72 | struct xmit_frame; 73 | struct xmit_buf; 74 | 75 | extern int _rtw_xmit_entry(_pkt *pkt, _nic_hdl pnetdev); 76 | extern int rtw_xmit_entry(_pkt *pkt, _nic_hdl pnetdev); 77 | 78 | #endif 79 | 80 | void rtw_os_xmit_schedule(_adapter *padapter); 81 | 82 | int rtw_os_xmit_resource_alloc(_adapter *padapter, struct xmit_buf *pxmitbuf, u32 alloc_sz, u8 flag); 83 | void rtw_os_xmit_resource_free(_adapter *padapter, struct xmit_buf *pxmitbuf, u32 free_sz, u8 flag); 84 | 85 | extern void rtw_set_tx_chksum_offload(_pkt *pkt, struct pkt_attrib *pattrib); 86 | 87 | extern uint rtw_remainder_len(struct pkt_file *pfile); 88 | extern void _rtw_open_pktfile(_pkt *pkt, struct pkt_file *pfile); 89 | extern uint _rtw_pktfile_read (struct pkt_file *pfile, u8 *rmem, uint rlen); 90 | extern sint rtw_endofpktfile (struct pkt_file *pfile); 91 | 92 | extern void rtw_os_pkt_complete(_adapter *padapter, _pkt *pkt); 93 | extern void rtw_os_xmit_complete(_adapter *padapter, struct xmit_frame *pxframe); 94 | 95 | void rtw_os_wake_queue_at_free_stainfo(_adapter *padapter, int *qcnt_freed); 96 | 97 | void dump_os_queue(void *sel, _adapter *padapter); 98 | 99 | #endif //__XMIT_OSDEP_H_ 100 | 101 | -------------------------------------------------------------------------------- /core/rtw_mem.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | 5 | MODULE_LICENSE("GPL"); 6 | MODULE_DESCRIPTION("Realtek Wireless Lan Driver"); 7 | MODULE_AUTHOR("Realtek Semiconductor Corp."); 8 | MODULE_VERSION("DRIVERVERSION"); 9 | 10 | struct sk_buff_head rtk_skb_mem_q; 11 | struct u8* rtk_buf_mem[NR_RECVBUFF]; 12 | 13 | struct u8 * rtw_get_buf_premem(int index) 14 | { 15 | printk("%s, rtk_buf_mem index : %d\n", __func__, index); 16 | return rtk_buf_mem[index]; 17 | } 18 | 19 | u16 rtw_rtkm_get_buff_size(void) 20 | { 21 | return MAX_RTKM_RECVBUF_SZ; 22 | } 23 | EXPORT_SYMBOL(rtw_rtkm_get_buff_size); 24 | 25 | u8 rtw_rtkm_get_nr_recv_skb(void) 26 | { 27 | return MAX_RTKM_NR_PREALLOC_RECV_SKB; 28 | } 29 | EXPORT_SYMBOL(rtw_rtkm_get_nr_recv_skb); 30 | 31 | struct sk_buff *rtw_alloc_skb_premem(u16 in_size) 32 | { 33 | struct sk_buff *skb = NULL; 34 | 35 | if (in_size > MAX_RTKM_RECVBUF_SZ) { 36 | pr_info("warning %s: driver buffer size(%d) > rtkm buffer size(%d)\n", __func__, in_size, MAX_RTKM_RECVBUF_SZ); 37 | WARN_ON(1); 38 | return skb; 39 | } 40 | 41 | skb = skb_dequeue(&rtk_skb_mem_q); 42 | 43 | printk("%s, rtk_skb_mem_q len : %d\n", __func__, skb_queue_len(&rtk_skb_mem_q)); 44 | 45 | return skb; 46 | } 47 | EXPORT_SYMBOL(rtw_alloc_skb_premem); 48 | 49 | int rtw_free_skb_premem(struct sk_buff *pskb) 50 | { 51 | if(!pskb) 52 | return -1; 53 | 54 | if (skb_queue_len(&rtk_skb_mem_q) >= MAX_RTKM_NR_PREALLOC_RECV_SKB) 55 | return -1; 56 | 57 | skb_queue_tail(&rtk_skb_mem_q, pskb); 58 | 59 | printk("%s, rtk_skb_mem_q len : %d\n", __func__, skb_queue_len(&rtk_skb_mem_q)); 60 | 61 | return 0; 62 | } 63 | EXPORT_SYMBOL(rtw_free_skb_premem); 64 | 65 | static int __init rtw_mem_init(void) 66 | { 67 | int i; 68 | SIZE_PTR tmpaddr=0; 69 | SIZE_PTR alignment=0; 70 | struct sk_buff *pskb=NULL; 71 | 72 | printk("%s\n", __func__); 73 | pr_info("MAX_RTKM_NR_PREALLOC_RECV_SKB: %d\n", MAX_RTKM_NR_PREALLOC_RECV_SKB); 74 | pr_info("MAX_RTKM_RECVBUF_SZ: %d\n", MAX_RTKM_RECVBUF_SZ); 75 | 76 | #ifdef CONFIG_USE_USB_BUFFER_ALLOC_RX 77 | for(i=0; idata; 91 | alignment = tmpaddr & (RECVBUFF_ALIGN_SZ-1); 92 | skb_reserve(pskb, (RECVBUFF_ALIGN_SZ - alignment)); 93 | 94 | skb_queue_tail(&rtk_skb_mem_q, pskb); 95 | } 96 | else 97 | { 98 | printk("%s, alloc skb memory fail!\n", __func__); 99 | } 100 | 101 | pskb=NULL; 102 | } 103 | 104 | printk("%s, rtk_skb_mem_q len : %d\n", __func__, skb_queue_len(&rtk_skb_mem_q)); 105 | 106 | return 0; 107 | 108 | } 109 | 110 | static void __exit rtw_mem_exit(void) 111 | { 112 | if (skb_queue_len(&rtk_skb_mem_q)) { 113 | printk("%s, rtk_skb_mem_q len : %d\n", __func__, skb_queue_len(&rtk_skb_mem_q)); 114 | } 115 | 116 | skb_queue_purge(&rtk_skb_mem_q); 117 | 118 | printk("%s\n", __func__); 119 | } 120 | 121 | module_init(rtw_mem_init); 122 | module_exit(rtw_mem_exit); 123 | -------------------------------------------------------------------------------- /include/rtw_event.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_EVENT_H_ 21 | #define _RTW_EVENT_H_ 22 | 23 | #ifdef CONFIG_H2CLBK 24 | #include 25 | #endif 26 | 27 | /* 28 | Used to report a bss has been scanned 29 | 30 | */ 31 | struct survey_event { 32 | WLAN_BSSID_EX bss; 33 | }; 34 | 35 | /* 36 | Used to report that the requested site survey has been done. 37 | 38 | bss_cnt indicates the number of bss that has been reported. 39 | 40 | 41 | */ 42 | struct surveydone_event { 43 | unsigned int bss_cnt; 44 | 45 | }; 46 | 47 | /* 48 | Used to report the link result of joinning the given bss 49 | 50 | 51 | join_res: 52 | -1: authentication fail 53 | -2: association fail 54 | > 0: TID 55 | 56 | */ 57 | struct joinbss_event { 58 | struct wlan_network network; 59 | }; 60 | 61 | /* 62 | Used to report a given STA has joinned the created BSS. 63 | It is used in AP/Ad-HoC(M) mode. 64 | 65 | 66 | */ 67 | struct stassoc_event { 68 | unsigned char macaddr[6]; 69 | }; 70 | 71 | struct stadel_event { 72 | unsigned char macaddr[6]; 73 | unsigned char rsvd[2]; //for reason 74 | unsigned char locally_generated; 75 | int mac_id; 76 | }; 77 | 78 | struct addba_event 79 | { 80 | unsigned int tid; 81 | }; 82 | 83 | struct wmm_event 84 | { 85 | unsigned char wmm; 86 | }; 87 | 88 | #ifdef CONFIG_H2CLBK 89 | struct c2hlbk_event{ 90 | unsigned char mac[6]; 91 | unsigned short s0; 92 | unsigned short s1; 93 | unsigned int w0; 94 | unsigned char b0; 95 | unsigned short s2; 96 | unsigned char b1; 97 | unsigned int w1; 98 | }; 99 | #endif//CONFIG_H2CLBK 100 | 101 | #define GEN_EVT_CODE(event) event ## _EVT_ 102 | 103 | 104 | 105 | struct fwevent { 106 | u32 parmsize; 107 | void (*event_callback)(_adapter *dev, u8 *pbuf); 108 | }; 109 | 110 | 111 | #define C2HEVENT_SZ 32 112 | 113 | struct event_node{ 114 | unsigned char *node; 115 | unsigned char evt_code; 116 | unsigned short evt_sz; 117 | volatile int *caller_ff_tail; 118 | int caller_ff_sz; 119 | }; 120 | 121 | struct c2hevent_queue { 122 | volatile int head; 123 | volatile int tail; 124 | struct event_node nodes[C2HEVENT_SZ]; 125 | unsigned char seq; 126 | }; 127 | 128 | #define NETWORK_QUEUE_SZ 4 129 | 130 | struct network_queue { 131 | volatile int head; 132 | volatile int tail; 133 | WLAN_BSSID_EX networks[NETWORK_QUEUE_SZ]; 134 | }; 135 | 136 | 137 | #endif // _WLANEVENT_H_ 138 | 139 | -------------------------------------------------------------------------------- /include/linux/wireless.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 | 21 | #ifndef _LINUX_WIRELESS_H 22 | #define _LINUX_WIRELESS_H 23 | 24 | /***************************** INCLUDES *****************************/ 25 | 26 | #if 0 27 | #include /* for __u* and __s* typedefs */ 28 | #include /* for "struct sockaddr" et al */ 29 | #include /* for IFNAMSIZ and co... */ 30 | #else 31 | #define __user 32 | //typedef uint16_t __u16; 33 | #include /* for "struct sockaddr" et al */ 34 | #include /* for IFNAMSIZ and co... */ 35 | #endif 36 | 37 | /****************************** TYPES ******************************/ 38 | #ifdef CONFIG_COMPAT 39 | struct compat_iw_point { 40 | compat_caddr_t pointer; 41 | __u16 length; 42 | __u16 flags; 43 | }; 44 | #endif 45 | /* --------------------------- SUBTYPES --------------------------- */ 46 | /* 47 | * For all data larger than 16 octets, we need to use a 48 | * pointer to memory allocated in user space. 49 | */ 50 | struct iw_point 51 | { 52 | void __user *pointer; /* Pointer to the data (in user space) */ 53 | __u16 length; /* number of fields or size in bytes */ 54 | __u16 flags; /* Optional params */ 55 | }; 56 | 57 | 58 | /* ------------------------ IOCTL REQUEST ------------------------ */ 59 | /* 60 | * This structure defines the payload of an ioctl, and is used 61 | * below. 62 | * 63 | * Note that this structure should fit on the memory footprint 64 | * of iwreq (which is the same as ifreq), which mean a max size of 65 | * 16 octets = 128 bits. Warning, pointers might be 64 bits wide... 66 | * You should check this when increasing the structures defined 67 | * above in this file... 68 | */ 69 | union iwreq_data 70 | { 71 | /* Config - generic */ 72 | char name[IFNAMSIZ]; 73 | /* Name : used to verify the presence of wireless extensions. 74 | * Name of the protocol/provider... */ 75 | 76 | struct iw_point data; /* Other large parameters */ 77 | }; 78 | 79 | /* 80 | * The structure to exchange data for ioctl. 81 | * This structure is the same as 'struct ifreq', but (re)defined for 82 | * convenience... 83 | * Do I need to remind you about structure size (32 octets) ? 84 | */ 85 | struct iwreq 86 | { 87 | union 88 | { 89 | char ifrn_name[IFNAMSIZ]; /* if name, e.g. "eth0" */ 90 | } ifr_ifrn; 91 | 92 | /* Data part (defined just above) */ 93 | union iwreq_data u; 94 | }; 95 | 96 | #endif /* _LINUX_WIRELESS_H */ 97 | 98 | -------------------------------------------------------------------------------- /hal/rtl8188f/Hal8188FPwrSeq.c: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0 */ 2 | 3 | /*++ 4 | Copyright (c) Realtek Semiconductor Corp. All rights reserved. 5 | 6 | Module Name: 7 | Hal8188FPwrSeq.c 8 | 9 | Abstract: 10 | This file includes all kinds of Power Action event for RTL8188F and corresponding hardware configurtions which are released from HW SD. 11 | 12 | Major Change History: 13 | When What 14 | ------------------- --------------- 15 | 2014-08-18 Create. 16 | 17 | --*/ 18 | 19 | #include "Hal8188FPwrSeq.h" 20 | 21 | 22 | /* 23 | drivers should parse below arrays and do the corresponding actions 24 | */ 25 | /*3 Power on Array */ 26 | WLAN_PWR_CFG rtl8188F_power_on_flow[RTL8188F_TRANS_CARDEMU_TO_ACT_STEPS + RTL8188F_TRANS_END_STEPS] = { 27 | RTL8188F_TRANS_CARDEMU_TO_ACT 28 | RTL8188F_TRANS_END 29 | }; 30 | 31 | /*3Radio off GPIO Array */ 32 | WLAN_PWR_CFG rtl8188F_radio_off_flow[RTL8188F_TRANS_ACT_TO_CARDEMU_STEPS + RTL8188F_TRANS_END_STEPS] = { 33 | RTL8188F_TRANS_ACT_TO_CARDEMU 34 | RTL8188F_TRANS_END 35 | }; 36 | 37 | /*3Card Disable Array */ 38 | WLAN_PWR_CFG rtl8188F_card_disable_flow[RTL8188F_TRANS_ACT_TO_CARDEMU_STEPS + RTL8188F_TRANS_CARDEMU_TO_PDN_STEPS + RTL8188F_TRANS_END_STEPS] = { 39 | RTL8188F_TRANS_ACT_TO_CARDEMU 40 | RTL8188F_TRANS_CARDEMU_TO_CARDDIS 41 | RTL8188F_TRANS_END 42 | }; 43 | 44 | /*3 Card Enable Array */ 45 | WLAN_PWR_CFG rtl8188F_card_enable_flow[RTL8188F_TRANS_ACT_TO_CARDEMU_STEPS + RTL8188F_TRANS_CARDEMU_TO_PDN_STEPS + RTL8188F_TRANS_END_STEPS] = { 46 | RTL8188F_TRANS_CARDDIS_TO_CARDEMU 47 | RTL8188F_TRANS_CARDEMU_TO_ACT 48 | RTL8188F_TRANS_END 49 | }; 50 | 51 | /*3Suspend Array */ 52 | WLAN_PWR_CFG rtl8188F_suspend_flow[RTL8188F_TRANS_ACT_TO_CARDEMU_STEPS + RTL8188F_TRANS_CARDEMU_TO_SUS_STEPS + RTL8188F_TRANS_END_STEPS] = { 53 | RTL8188F_TRANS_ACT_TO_CARDEMU 54 | RTL8188F_TRANS_CARDEMU_TO_SUS 55 | RTL8188F_TRANS_END 56 | }; 57 | 58 | /*3 Resume Array */ 59 | WLAN_PWR_CFG rtl8188F_resume_flow[RTL8188F_TRANS_ACT_TO_CARDEMU_STEPS + RTL8188F_TRANS_CARDEMU_TO_SUS_STEPS + RTL8188F_TRANS_END_STEPS] = { 60 | RTL8188F_TRANS_SUS_TO_CARDEMU 61 | RTL8188F_TRANS_CARDEMU_TO_ACT 62 | RTL8188F_TRANS_END 63 | }; 64 | 65 | 66 | 67 | /*3HWPDN Array */ 68 | WLAN_PWR_CFG rtl8188F_hwpdn_flow[RTL8188F_TRANS_ACT_TO_CARDEMU_STEPS + RTL8188F_TRANS_CARDEMU_TO_PDN_STEPS + RTL8188F_TRANS_END_STEPS] = { 69 | RTL8188F_TRANS_ACT_TO_CARDEMU 70 | RTL8188F_TRANS_CARDEMU_TO_PDN 71 | RTL8188F_TRANS_END 72 | }; 73 | 74 | /*3 Enter LPS */ 75 | WLAN_PWR_CFG rtl8188F_enter_lps_flow[RTL8188F_TRANS_ACT_TO_LPS_STEPS + RTL8188F_TRANS_END_STEPS] = { 76 | /*FW behavior */ 77 | RTL8188F_TRANS_ACT_TO_LPS 78 | RTL8188F_TRANS_END 79 | }; 80 | 81 | /*3 Leave LPS */ 82 | WLAN_PWR_CFG rtl8188F_leave_lps_flow[RTL8188F_TRANS_LPS_TO_ACT_STEPS + RTL8188F_TRANS_END_STEPS] = { 83 | /*FW behavior */ 84 | RTL8188F_TRANS_LPS_TO_ACT 85 | RTL8188F_TRANS_END 86 | }; 87 | 88 | /*3 Enter SW LPS */ 89 | WLAN_PWR_CFG rtl8188F_enter_swlps_flow[RTL8188F_TRANS_ACT_TO_SWLPS_STEPS + RTL8188F_TRANS_END_STEPS] = { 90 | /*SW behavior */ 91 | RTL8188F_TRANS_ACT_TO_SWLPS 92 | RTL8188F_TRANS_END 93 | }; 94 | 95 | /*3 Leave SW LPS */ 96 | WLAN_PWR_CFG rtl8188F_leave_swlps_flow[RTL8188F_TRANS_SWLPS_TO_ACT_STEPS + RTL8188F_TRANS_END_STEPS] = { 97 | /*SW behavior */ 98 | RTL8188F_TRANS_SWLPS_TO_ACT 99 | RTL8188F_TRANS_END 100 | }; 101 | -------------------------------------------------------------------------------- /hal/phydm/phydm_edcaturbocheck.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 | 21 | #ifndef __PHYDMEDCATURBOCHECK_H__ 22 | #define __PHYDMEDCATURBOCHECK_H__ 23 | 24 | /*#define EDCATURBO_VERSION "2.1"*/ 25 | #define EDCATURBO_VERSION "2.2" /*2015.01.13*/ 26 | 27 | typedef struct _EDCA_TURBO_ 28 | { 29 | BOOLEAN bCurrentTurboEDCA; 30 | BOOLEAN bIsCurRDLState; 31 | 32 | #if(DM_ODM_SUPPORT_TYPE == ODM_CE ) 33 | u4Byte prv_traffic_idx; // edca turbo 34 | #endif 35 | 36 | }EDCA_T,*pEDCA_T; 37 | 38 | #if (DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE)) 39 | static u4Byte edca_setting_UL[HT_IOT_PEER_MAX] = 40 | // UNKNOWN REALTEK_90 REALTEK_92SE BROADCOM RALINK ATHEROS CISCO MERU MARVELL 92U_AP SELF_AP(DownLink/Tx) 41 | { 0x5e4322, 0xa44f, 0x5e4322, 0x5ea32b, 0x5ea422, 0x5ea322, 0x3ea430, 0x5ea42b, 0x5ea44f, 0x5e4322, 0x5e4322}; 42 | 43 | 44 | static u4Byte edca_setting_DL[HT_IOT_PEER_MAX] = 45 | // UNKNOWN REALTEK_90 REALTEK_92SE BROADCOM RALINK ATHEROS CISCO MERU, MARVELL 92U_AP SELF_AP(UpLink/Rx) 46 | { 0xa44f, 0x5ea44f, 0x5e4322, 0x5ea42b, 0xa44f, 0xa630, 0x5ea630, 0x5ea42b, 0xa44f, 0xa42b, 0xa42b}; 47 | 48 | static u4Byte edca_setting_DL_GMode[HT_IOT_PEER_MAX] = 49 | // UNKNOWN REALTEK_90 REALTEK_92SE BROADCOM RALINK ATHEROS CISCO MERU, MARVELL 92U_AP SELF_AP 50 | { 0x4322, 0xa44f, 0x5e4322, 0xa42b, 0x5e4322, 0x4322, 0xa42b, 0x5ea42b, 0xa44f, 0x5e4322, 0x5ea42b}; 51 | 52 | #endif 53 | 54 | 55 | 56 | VOID 57 | odm_EdcaTurboCheck( 58 | IN PVOID pDM_VOID 59 | ); 60 | VOID 61 | ODM_EdcaTurboInit( 62 | IN PVOID pDM_VOID 63 | ); 64 | 65 | #if(DM_ODM_SUPPORT_TYPE==ODM_WIN) 66 | VOID 67 | odm_EdcaTurboCheckMP( 68 | IN PVOID pDM_VOID 69 | ); 70 | 71 | //check if edca turbo is disabled 72 | BOOLEAN 73 | odm_IsEdcaTurboDisable( 74 | IN PVOID pDM_VOID 75 | ); 76 | //choose edca paramter for special IOT case 77 | VOID 78 | ODM_EdcaParaSelByIot( 79 | IN PVOID pDM_VOID, 80 | OUT u4Byte *EDCA_BE_UL, 81 | OUT u4Byte *EDCA_BE_DL 82 | ); 83 | //check if it is UL or DL 84 | VOID 85 | odm_EdcaChooseTrafficIdx( 86 | IN PVOID pDM_VOID, 87 | IN u8Byte cur_tx_bytes, 88 | IN u8Byte cur_rx_bytes, 89 | IN BOOLEAN bBiasOnRx, 90 | OUT BOOLEAN *pbIsCurRDLState 91 | ); 92 | 93 | #elif (DM_ODM_SUPPORT_TYPE==ODM_CE) 94 | VOID 95 | odm_EdcaTurboCheckCE( 96 | IN PVOID pDM_VOID 97 | ); 98 | #endif 99 | 100 | #endif 101 | -------------------------------------------------------------------------------- /hal/phydm/rtl8188f/halphyrf_8188f.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 | 21 | #ifndef __HAL_PHY_RF_8188F_H__ 22 | #define __HAL_PHY_RF_8188F_H__ 23 | 24 | 25 | /*--------------------------Define Parameters-------------------------------*/ 26 | #define IQK_DELAY_TIME_8188F 25 /* ms */ 27 | #define IQK_DEFERRED_TIME_8188F 4 28 | #define index_mapping_NUM_8188F 15 29 | #define AVG_THERMAL_NUM_8188F 4 30 | #define RF_T_METER_8188F 0x42 31 | 32 | 33 | void ConfigureTxpowerTrack_8188F( 34 | PTXPWRTRACK_CFG pConfig 35 | ); 36 | 37 | void DoIQK_8188F( 38 | PVOID pDM_VOID, 39 | u1Byte DeltaThermalIndex, 40 | u1Byte ThermalValue, 41 | u1Byte Threshold 42 | ); 43 | 44 | VOID 45 | ODM_TxPwrTrackSetPwr_8188F( 46 | IN PVOID pDM_VOID, 47 | PWRTRACK_METHOD Method, 48 | u1Byte RFPath, 49 | u1Byte ChannelMappedIndex 50 | ); 51 | 52 | //1 7. IQK 53 | 54 | void 55 | PHY_IQCalibrate_8188F( 56 | #if (DM_ODM_SUPPORT_TYPE & ODM_AP) 57 | IN PDM_ODM_T pDM_Odm, 58 | #else 59 | IN PADAPTER Adapter, 60 | #endif 61 | IN BOOLEAN bReCovery, 62 | IN BOOLEAN bRestore); 63 | 64 | 65 | // 66 | // LC calibrate 67 | // 68 | void 69 | PHY_LCCalibrate_8188F( 70 | IN PVOID pDM_VOID 71 | ); 72 | 73 | // 74 | // AP calibrate 75 | // 76 | void 77 | PHY_APCalibrate_8188F( 78 | #if (DM_ODM_SUPPORT_TYPE & ODM_AP) 79 | IN PDM_ODM_T pDM_Odm, 80 | #else 81 | IN PADAPTER pAdapter, 82 | #endif 83 | IN s1Byte delta); 84 | void 85 | PHY_DigitalPredistortion_8188F( IN PADAPTER pAdapter); 86 | 87 | 88 | VOID 89 | _PHY_SaveADDARegisters_8188F( 90 | #if (DM_ODM_SUPPORT_TYPE & ODM_AP) 91 | IN PDM_ODM_T pDM_Odm, 92 | #else 93 | IN PADAPTER pAdapter, 94 | #endif 95 | IN pu4Byte ADDAReg, 96 | IN pu4Byte ADDABackup, 97 | IN u4Byte RegisterNum 98 | ); 99 | 100 | VOID 101 | _PHY_PathADDAOn_8188F( 102 | #if (DM_ODM_SUPPORT_TYPE & ODM_AP) 103 | IN PDM_ODM_T pDM_Odm, 104 | #else 105 | IN PADAPTER pAdapter, 106 | #endif 107 | IN pu4Byte ADDAReg, 108 | IN BOOLEAN isPathAOn, 109 | IN BOOLEAN is2T 110 | ); 111 | 112 | VOID 113 | _PHY_MACSettingCalibration_8188F( 114 | #if (DM_ODM_SUPPORT_TYPE & ODM_AP) 115 | IN PDM_ODM_T pDM_Odm, 116 | #else 117 | IN PADAPTER pAdapter, 118 | #endif 119 | IN pu4Byte MACReg, 120 | IN pu4Byte MACBackup 121 | ); 122 | 123 | 124 | VOID 125 | _PHY_PathAStandBy( 126 | #if (DM_ODM_SUPPORT_TYPE & ODM_AP) 127 | IN PDM_ODM_T pDM_Odm 128 | #else 129 | IN PADAPTER pAdapter 130 | #endif 131 | ); 132 | 133 | 134 | #endif // #ifndef __HAL_PHY_RF_8188E_H__ 135 | 136 | -------------------------------------------------------------------------------- /hal/rtl8188f/usb/rtl8188fu_led.c: -------------------------------------------------------------------------------- 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 | #include "rtl8188f_hal.h" 21 | 22 | /* 23 | * ================================================================================ 24 | * LED object. 25 | * ================================================================================ 26 | */ 27 | 28 | 29 | /* 30 | * ================================================================================ 31 | * Prototype of protected function. 32 | * ================================================================================ 33 | */ 34 | 35 | /* 36 | * ================================================================================ 37 | * LED_819xUsb routines. 38 | * ================================================================================ 39 | */ 40 | 41 | /* 42 | * Description: 43 | * Turn on LED according to LedPin specified. 44 | */ 45 | void 46 | SwLedOn_8188FU( 47 | PADAPTER padapter, 48 | PLED_USB pLed 49 | ) 50 | { 51 | u8 LedCfg; 52 | 53 | if (RTW_CANNOT_RUN(padapter)) 54 | return; 55 | 56 | pLed->bLedOn = _TRUE; 57 | 58 | } 59 | 60 | 61 | /* 62 | * Description: 63 | * Turn off LED according to LedPin specified. 64 | */ 65 | void 66 | SwLedOff_8188FU( 67 | PADAPTER padapter, 68 | PLED_USB pLed 69 | ) 70 | { 71 | u8 LedCfg; 72 | 73 | if (RTW_CANNOT_RUN(padapter)) 74 | goto exit; 75 | 76 | exit: 77 | pLed->bLedOn = _FALSE; 78 | 79 | } 80 | 81 | /* 82 | * ================================================================================ 83 | * Interface to manipulate LED objects. 84 | * ================================================================================ 85 | */ 86 | 87 | /* 88 | * ================================================================================ 89 | * Default LED behavior. 90 | * ================================================================================ 91 | */ 92 | 93 | /* 94 | * Description: 95 | * Initialize all LED_871x objects. 96 | */ 97 | void 98 | rtl8188fu_InitSwLeds( 99 | PADAPTER padapter 100 | ) 101 | { 102 | struct led_priv *pledpriv = &(padapter->ledpriv); 103 | 104 | pledpriv->LedControlHandler = LedControlUSB; 105 | 106 | pledpriv->SwLedOn = SwLedOn_8188FU; 107 | pledpriv->SwLedOff = SwLedOff_8188FU; 108 | 109 | InitLed(padapter, &(pledpriv->SwLed0), LED_PIN_LED0); 110 | 111 | InitLed(padapter, &(pledpriv->SwLed1), LED_PIN_LED1); 112 | } 113 | 114 | 115 | /* 116 | * Description: 117 | * DeInitialize all LED_819xUsb objects. 118 | */ 119 | 120 | void 121 | rtl8188fu_DeInitSwLeds( 122 | PADAPTER padapter 123 | ) 124 | { 125 | struct led_priv *ledpriv = &(padapter->ledpriv); 126 | 127 | DeInitLed(&(ledpriv->SwLed0)); 128 | DeInitLed(&(ledpriv->SwLed1)); 129 | } 130 | 131 | -------------------------------------------------------------------------------- /include/byteorder/big_endian.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 _LINUX_BYTEORDER_BIG_ENDIAN_H 21 | #define _LINUX_BYTEORDER_BIG_ENDIAN_H 22 | 23 | #ifndef __BIG_ENDIAN 24 | #define __BIG_ENDIAN 4321 25 | #endif 26 | #ifndef __BIG_ENDIAN_BITFIELD 27 | #define __BIG_ENDIAN_BITFIELD 28 | #endif 29 | 30 | #include 31 | 32 | #define __constant_htonl(x) ((__u32)(x)) 33 | #define __constant_ntohl(x) ((__u32)(x)) 34 | #define __constant_htons(x) ((__u16)(x)) 35 | #define __constant_ntohs(x) ((__u16)(x)) 36 | #define __constant_cpu_to_le64(x) ___constant_swab64((x)) 37 | #define __constant_le64_to_cpu(x) ___constant_swab64((x)) 38 | #define __constant_cpu_to_le32(x) ___constant_swab32((x)) 39 | #define __constant_le32_to_cpu(x) ___constant_swab32((x)) 40 | #define __constant_cpu_to_le16(x) ___constant_swab16((x)) 41 | #define __constant_le16_to_cpu(x) ___constant_swab16((x)) 42 | #define __constant_cpu_to_be64(x) ((__u64)(x)) 43 | #define __constant_be64_to_cpu(x) ((__u64)(x)) 44 | #define __constant_cpu_to_be32(x) ((__u32)(x)) 45 | #define __constant_be32_to_cpu(x) ((__u32)(x)) 46 | #define __constant_cpu_to_be16(x) ((__u16)(x)) 47 | #define __constant_be16_to_cpu(x) ((__u16)(x)) 48 | #define __cpu_to_le64(x) __swab64((x)) 49 | #define __le64_to_cpu(x) __swab64((x)) 50 | #define __cpu_to_le32(x) __swab32((x)) 51 | #define __le32_to_cpu(x) __swab32((x)) 52 | #define __cpu_to_le16(x) __swab16((x)) 53 | #define __le16_to_cpu(x) __swab16((x)) 54 | #define __cpu_to_be64(x) ((__u64)(x)) 55 | #define __be64_to_cpu(x) ((__u64)(x)) 56 | #define __cpu_to_be32(x) ((__u32)(x)) 57 | #define __be32_to_cpu(x) ((__u32)(x)) 58 | #define __cpu_to_be16(x) ((__u16)(x)) 59 | #define __be16_to_cpu(x) ((__u16)(x)) 60 | #define __cpu_to_le64p(x) __swab64p((x)) 61 | #define __le64_to_cpup(x) __swab64p((x)) 62 | #define __cpu_to_le32p(x) __swab32p((x)) 63 | #define __le32_to_cpup(x) __swab32p((x)) 64 | #define __cpu_to_le16p(x) __swab16p((x)) 65 | #define __le16_to_cpup(x) __swab16p((x)) 66 | #define __cpu_to_be64p(x) (*(__u64*)(x)) 67 | #define __be64_to_cpup(x) (*(__u64*)(x)) 68 | #define __cpu_to_be32p(x) (*(__u32*)(x)) 69 | #define __be32_to_cpup(x) (*(__u32*)(x)) 70 | #define __cpu_to_be16p(x) (*(__u16*)(x)) 71 | #define __be16_to_cpup(x) (*(__u16*)(x)) 72 | #define __cpu_to_le64s(x) __swab64s((x)) 73 | #define __le64_to_cpus(x) __swab64s((x)) 74 | #define __cpu_to_le32s(x) __swab32s((x)) 75 | #define __le32_to_cpus(x) __swab32s((x)) 76 | #define __cpu_to_le16s(x) __swab16s((x)) 77 | #define __le16_to_cpus(x) __swab16s((x)) 78 | #define __cpu_to_be64s(x) do {} while (0) 79 | #define __be64_to_cpus(x) do {} while (0) 80 | #define __cpu_to_be32s(x) do {} while (0) 81 | #define __be32_to_cpus(x) do {} while (0) 82 | #define __cpu_to_be16s(x) do {} while (0) 83 | #define __be16_to_cpus(x) do {} while (0) 84 | 85 | #include 86 | 87 | #endif /* _LINUX_BYTEORDER_BIG_ENDIAN_H */ 88 | 89 | -------------------------------------------------------------------------------- /hal/phydm/txbf/haltxbfinterface.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0 */ 2 | #ifndef __HAL_TXBF_INTERFACE_H__ 3 | #define __HAL_TXBF_INTERFACE_H__ 4 | 5 | #if (BEAMFORMING_SUPPORT == 1) 6 | #if (DM_ODM_SUPPORT_TYPE == ODM_WIN) 7 | VOID 8 | Beamforming_GidPAid( 9 | PADAPTER Adapter, 10 | PRT_TCB pTcb 11 | ); 12 | 13 | RT_STATUS 14 | Beamforming_GetReportFrame( 15 | IN PADAPTER Adapter, 16 | IN PRT_RFD pRfd, 17 | IN POCTET_STRING pPduOS 18 | ); 19 | 20 | VOID 21 | Beamforming_GetNDPAFrame( 22 | IN PVOID pDM_VOID, 23 | IN OCTET_STRING pduOS 24 | ); 25 | 26 | BOOLEAN 27 | SendFWHTNDPAPacket( 28 | IN PVOID pDM_VOID, 29 | IN pu1Byte RA, 30 | IN CHANNEL_WIDTH BW 31 | ); 32 | 33 | BOOLEAN 34 | SendFWVHTNDPAPacket( 35 | IN PVOID pDM_VOID, 36 | IN pu1Byte RA, 37 | IN u2Byte AID, 38 | IN CHANNEL_WIDTH BW 39 | ); 40 | 41 | BOOLEAN 42 | SendSWVHTNDPAPacket( 43 | IN PVOID pDM_VOID, 44 | IN pu1Byte RA, 45 | IN u2Byte AID, 46 | IN CHANNEL_WIDTH BW 47 | ); 48 | 49 | BOOLEAN 50 | SendSWHTNDPAPacket( 51 | IN PVOID pDM_VOID, 52 | IN pu1Byte RA, 53 | IN CHANNEL_WIDTH BW 54 | ); 55 | 56 | #ifdef SUPPORT_MU_BF 57 | #if (SUPPORT_MU_BF == 1) 58 | RT_STATUS 59 | Beamforming_GetVHTGIDMgntFrame( 60 | IN PADAPTER Adapter, 61 | IN PRT_RFD pRfd, 62 | IN POCTET_STRING pPduOS 63 | ); 64 | 65 | BOOLEAN 66 | SendSWVHTGIDMgntFrame( 67 | IN PVOID pDM_VOID, 68 | IN pu1Byte RA, 69 | IN u1Byte Idx 70 | ); 71 | 72 | BOOLEAN 73 | SendSWVHTBFReportPoll( 74 | IN PVOID pDM_VOID, 75 | IN pu1Byte RA, 76 | IN BOOLEAN bFinalPoll 77 | ); 78 | 79 | BOOLEAN 80 | SendSWVHTMUNDPAPacket( 81 | IN PVOID pDM_VOID, 82 | IN CHANNEL_WIDTH BW 83 | ); 84 | #else 85 | #define Beamforming_GetVHTGIDMgntFrame(Adapter, pRfd, pPduOS) RT_STATUS_FAILURE 86 | #define SendSWVHTGIDMgntFrame(pDM_VOID, RA) 87 | #define SendSWVHTBFReportPoll(pDM_VOID, RA, bFinalPoll) 88 | #define SendSWVHTMUNDPAPacket(pDM_VOID, BW) 89 | #endif 90 | #endif 91 | 92 | 93 | #elif (DM_ODM_SUPPORT_TYPE == ODM_CE) 94 | 95 | u4Byte 96 | Beamforming_GetReportFrame( 97 | IN PVOID pDM_VOID, 98 | union recv_frame *precv_frame 99 | ); 100 | 101 | BOOLEAN 102 | SendFWHTNDPAPacket( 103 | IN PVOID pDM_VOID, 104 | IN pu1Byte RA, 105 | IN CHANNEL_WIDTH BW 106 | ); 107 | 108 | BOOLEAN 109 | SendSWHTNDPAPacket( 110 | IN PVOID pDM_VOID, 111 | IN pu1Byte RA, 112 | IN CHANNEL_WIDTH BW 113 | ); 114 | 115 | BOOLEAN 116 | SendFWVHTNDPAPacket( 117 | IN PVOID pDM_VOID, 118 | IN pu1Byte RA, 119 | IN u2Byte AID, 120 | IN CHANNEL_WIDTH BW 121 | ); 122 | 123 | BOOLEAN 124 | SendSWVHTNDPAPacket( 125 | IN PVOID pDM_VOID, 126 | IN pu1Byte RA, 127 | IN u2Byte AID, 128 | IN CHANNEL_WIDTH BW 129 | ); 130 | #endif 131 | 132 | VOID 133 | Beamforming_GetNDPAFrame( 134 | IN PVOID pDM_VOID, 135 | #if (DM_ODM_SUPPORT_TYPE == ODM_WIN) 136 | IN OCTET_STRING pduOS 137 | #elif (DM_ODM_SUPPORT_TYPE == ODM_CE) 138 | union recv_frame *precv_frame 139 | #endif 140 | ); 141 | 142 | #else 143 | #define Beamforming_GetNDPAFrame(pDM_Odm, _PduOS) 144 | #if (DM_ODM_SUPPORT_TYPE == ODM_CE) 145 | #define Beamforming_GetReportFrame(Adapter, precv_frame) RT_STATUS_FAILURE 146 | #elif (DM_ODM_SUPPORT_TYPE == ODM_WIN) 147 | #define Beamforming_GetReportFrame(Adapter, pRfd, pPduOS) RT_STATUS_FAILURE 148 | #define Beamforming_GetVHTGIDMgntFrame(Adapter, pRfd, pPduOS) RT_STATUS_FAILURE 149 | #endif 150 | #define SendFWHTNDPAPacket(pDM_VOID, RA, BW) 151 | #define SendSWHTNDPAPacket(pDM_VOID, RA, BW) 152 | #define SendFWVHTNDPAPacket(pDM_VOID, RA, AID, BW) 153 | #define SendSWVHTNDPAPacket(pDM_VOID, RA, AID, BW) 154 | #define SendSWVHTGIDMgntFrame(pDM_VOID, RA, idx) 155 | #define SendSWVHTBFReportPoll(pDM_VOID, RA, bFinalPoll) 156 | #define SendSWVHTMUNDPAPacket(pDM_VOID, BW) 157 | #endif 158 | 159 | #endif 160 | -------------------------------------------------------------------------------- /hal/phydm/phydm_acs.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 | 21 | #ifndef __PHYDMACS_H__ 22 | #define __PHYDMACS_H__ 23 | 24 | #define ACS_VERSION "1.0" 25 | #define CLM_VERSION "1.0" 26 | 27 | #define ODM_MAX_CHANNEL_2G 14 28 | #define ODM_MAX_CHANNEL_5G 24 29 | 30 | // For phydm_AutoChannelSelectSettingAP() 31 | #define STORE_DEFAULT_NHM_SETTING 0 32 | #define RESTORE_DEFAULT_NHM_SETTING 1 33 | #define ACS_NHM_SETTING 2 34 | 35 | typedef struct _ACS_ 36 | { 37 | BOOLEAN bForceACSResult; 38 | u1Byte CleanChannel_2G; 39 | u1Byte CleanChannel_5G; 40 | u2Byte Channel_Info_2G[2][ODM_MAX_CHANNEL_2G]; //Channel_Info[1]: Channel Score, Channel_Info[2]:Channel_Scan_Times 41 | u2Byte Channel_Info_5G[2][ODM_MAX_CHANNEL_5G]; 42 | 43 | #if ( DM_ODM_SUPPORT_TYPE & ODM_AP ) 44 | u1Byte ACS_Step; 45 | // NHM Count 0-11 46 | u1Byte NHM_Cnt[14][11]; 47 | 48 | // AC-Series, for storing previous setting 49 | u4Byte Reg0x990; 50 | u4Byte Reg0x994; 51 | u4Byte Reg0x998; 52 | u4Byte Reg0x99C; 53 | u1Byte Reg0x9A0; // u1Byte 54 | 55 | // N-Series, for storing previous setting 56 | u4Byte Reg0x890; 57 | u4Byte Reg0x894; 58 | u4Byte Reg0x898; 59 | u4Byte Reg0x89C; 60 | u1Byte Reg0xE28; // u1Byte 61 | #endif 62 | 63 | }ACS, *PACS; 64 | 65 | 66 | VOID 67 | odm_AutoChannelSelectInit( 68 | IN PVOID pDM_VOID 69 | ); 70 | 71 | VOID 72 | odm_AutoChannelSelectReset( 73 | IN PVOID pDM_VOID 74 | ); 75 | 76 | VOID 77 | odm_AutoChannelSelect( 78 | IN PVOID pDM_VOID, 79 | IN u1Byte Channel 80 | ); 81 | 82 | u1Byte 83 | ODM_GetAutoChannelSelectResult( 84 | IN PVOID pDM_VOID, 85 | IN u1Byte Band 86 | ); 87 | 88 | #if ( DM_ODM_SUPPORT_TYPE & ODM_AP ) 89 | 90 | VOID 91 | phydm_AutoChannelSelectSettingAP( 92 | IN PVOID pDM_VOID, 93 | IN u4Byte Setting, // 0: STORE_DEFAULT_NHM_SETTING; 1: RESTORE_DEFAULT_NHM_SETTING, 2: ACS_NHM_SETTING 94 | IN u4Byte acs_step 95 | ); 96 | 97 | VOID 98 | phydm_GetNHMStatisticsAP( 99 | IN PVOID pDM_VOID, 100 | IN u4Byte idx, // @ 2G, Real channel number = idx+1 101 | IN u4Byte acs_step 102 | ); 103 | 104 | #endif //#if ( DM_ODM_SUPPORT_TYPE & ODM_AP ) 105 | 106 | 107 | VOID 108 | phydm_CLMInit( 109 | IN PVOID pDM_VOID, 110 | IN u2Byte sampleNum 111 | ); 112 | 113 | VOID 114 | phydm_CLMtrigger( 115 | IN PVOID pDM_VOID 116 | ); 117 | 118 | BOOLEAN 119 | phydm_checkCLMready( 120 | IN PVOID pDM_VOID 121 | ); 122 | 123 | u2Byte 124 | phydm_getCLMresult( 125 | IN PVOID pDM_VOID 126 | ); 127 | 128 | 129 | #endif //#ifndef __PHYDMACS_H__ -------------------------------------------------------------------------------- /include/byteorder/little_endian.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 _LINUX_BYTEORDER_LITTLE_ENDIAN_H 21 | #define _LINUX_BYTEORDER_LITTLE_ENDIAN_H 22 | 23 | #ifndef __LITTLE_ENDIAN 24 | #define __LITTLE_ENDIAN 1234 25 | #endif 26 | #ifndef __LITTLE_ENDIAN_BITFIELD 27 | #define __LITTLE_ENDIAN_BITFIELD 28 | #endif 29 | 30 | #include 31 | 32 | #ifndef __constant_htonl 33 | #define __constant_htonl(x) ___constant_swab32((x)) 34 | #define __constant_ntohl(x) ___constant_swab32((x)) 35 | #define __constant_htons(x) ___constant_swab16((x)) 36 | #define __constant_ntohs(x) ___constant_swab16((x)) 37 | #define __constant_cpu_to_le64(x) ((__u64)(x)) 38 | #define __constant_le64_to_cpu(x) ((__u64)(x)) 39 | #define __constant_cpu_to_le32(x) ((__u32)(x)) 40 | #define __constant_le32_to_cpu(x) ((__u32)(x)) 41 | #define __constant_cpu_to_le16(x) ((__u16)(x)) 42 | #define __constant_le16_to_cpu(x) ((__u16)(x)) 43 | #define __constant_cpu_to_be64(x) ___constant_swab64((x)) 44 | #define __constant_be64_to_cpu(x) ___constant_swab64((x)) 45 | #define __constant_cpu_to_be32(x) ___constant_swab32((x)) 46 | #define __constant_be32_to_cpu(x) ___constant_swab32((x)) 47 | #define __constant_cpu_to_be16(x) ___constant_swab16((x)) 48 | #define __constant_be16_to_cpu(x) ___constant_swab16((x)) 49 | #define __cpu_to_le64(x) ((__u64)(x)) 50 | #define __le64_to_cpu(x) ((__u64)(x)) 51 | #define __cpu_to_le32(x) ((__u32)(x)) 52 | #define __le32_to_cpu(x) ((__u32)(x)) 53 | #define __cpu_to_le16(x) ((__u16)(x)) 54 | #define __le16_to_cpu(x) ((__u16)(x)) 55 | #define __cpu_to_be64(x) __swab64((x)) 56 | #define __be64_to_cpu(x) __swab64((x)) 57 | #define __cpu_to_be32(x) __swab32((x)) 58 | #define __be32_to_cpu(x) __swab32((x)) 59 | #define __cpu_to_be16(x) __swab16((x)) 60 | #define __be16_to_cpu(x) __swab16((x)) 61 | #define __cpu_to_le64p(x) (*(__u64*)(x)) 62 | #define __le64_to_cpup(x) (*(__u64*)(x)) 63 | #define __cpu_to_le32p(x) (*(__u32*)(x)) 64 | #define __le32_to_cpup(x) (*(__u32*)(x)) 65 | #define __cpu_to_le16p(x) (*(__u16*)(x)) 66 | #define __le16_to_cpup(x) (*(__u16*)(x)) 67 | #define __cpu_to_be64p(x) __swab64p((x)) 68 | #define __be64_to_cpup(x) __swab64p((x)) 69 | #define __cpu_to_be32p(x) __swab32p((x)) 70 | #define __be32_to_cpup(x) __swab32p((x)) 71 | #define __cpu_to_be16p(x) __swab16p((x)) 72 | #define __be16_to_cpup(x) __swab16p((x)) 73 | #define __cpu_to_le64s(x) do {} while (0) 74 | #define __le64_to_cpus(x) do {} while (0) 75 | #define __cpu_to_le32s(x) do {} while (0) 76 | #define __le32_to_cpus(x) do {} while (0) 77 | #define __cpu_to_le16s(x) do {} while (0) 78 | #define __le16_to_cpus(x) do {} while (0) 79 | #define __cpu_to_be64s(x) __swab64s((x)) 80 | #define __be64_to_cpus(x) __swab64s((x)) 81 | #define __cpu_to_be32s(x) __swab32s((x)) 82 | #define __be32_to_cpus(x) __swab32s((x)) 83 | #define __cpu_to_be16s(x) __swab16s((x)) 84 | #define __be16_to_cpus(x) __swab16s((x)) 85 | #endif // __constant_htonl 86 | 87 | #include 88 | 89 | #endif /* _LINUX_BYTEORDER_LITTLE_ENDIAN_H */ 90 | 91 | -------------------------------------------------------------------------------- /hal/phydm/halhwimg.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0 */ 2 | #pragma once 3 | #ifndef __INC_HW_IMG_H 4 | #define __INC_HW_IMG_H 5 | 6 | // 7 | // 2011/03/15 MH Add for different IC HW image file selection. code size consideration. 8 | // 9 | #if RT_PLATFORM == PLATFORM_LINUX 10 | 11 | #if (DEV_BUS_TYPE == RT_PCI_INTERFACE) 12 | // For 92C 13 | #define RTL8192CE_HWIMG_SUPPORT 1 14 | #define RTL8192CE_TEST_HWIMG_SUPPORT 0 15 | #define RTL8192CU_HWIMG_SUPPORT 0 16 | #define RTL8192CU_TEST_HWIMG_SUPPORT 0 17 | 18 | // For 92D 19 | #define RTL8192DE_HWIMG_SUPPORT 1 20 | #define RTL8192DE_TEST_HWIMG_SUPPORT 0 21 | #define RTL8192DU_HWIMG_SUPPORT 0 22 | #define RTL8192DU_TEST_HWIMG_SUPPORT 0 23 | 24 | // For 8723 25 | #define RTL8723E_HWIMG_SUPPORT 1 26 | #define RTL8723U_HWIMG_SUPPORT 0 27 | #define RTL8723S_HWIMG_SUPPORT 0 28 | 29 | //For 88E 30 | #define RTL8188EE_HWIMG_SUPPORT 0 31 | #define RTL8188EU_HWIMG_SUPPORT 0 32 | #define RTL8188ES_HWIMG_SUPPORT 0 33 | 34 | #elif (DEV_BUS_TYPE == RT_USB_INTERFACE) 35 | // For 92C 36 | #define RTL8192CE_HWIMG_SUPPORT 0 37 | #define RTL8192CE_TEST_HWIMG_SUPPORT 0 38 | #define RTL8192CU_HWIMG_SUPPORT 1 39 | #define RTL8192CU_TEST_HWIMG_SUPPORT 0 40 | 41 | //For 92D 42 | #define RTL8192DE_HWIMG_SUPPORT 0 43 | #define RTL8192DE_TEST_HWIMG_SUPPORT 0 44 | #define RTL8192DU_HWIMG_SUPPORT 1 45 | #define RTL8192DU_TEST_HWIMG_SUPPORT 0 46 | 47 | // For 8723 48 | #define RTL8723E_HWIMG_SUPPORT 0 49 | #define RTL8723U_HWIMG_SUPPORT 1 50 | #define RTL8723S_HWIMG_SUPPORT 0 51 | 52 | //For 88E 53 | #define RTL8188EE_HWIMG_SUPPORT 0 54 | #define RTL8188EU_HWIMG_SUPPORT 0 55 | #define RTL8188ES_HWIMG_SUPPORT 0 56 | 57 | #elif (DEV_BUS_TYPE == RT_SDIO_INTERFACE) 58 | // For 92C 59 | #define RTL8192CE_HWIMG_SUPPORT 0 60 | #define RTL8192CE_TEST_HWIMG_SUPPORT 0 61 | #define RTL8192CU_HWIMG_SUPPORT 1 62 | #define RTL8192CU_TEST_HWIMG_SUPPORT 0 63 | 64 | //For 92D 65 | #define RTL8192DE_HWIMG_SUPPORT 0 66 | #define RTL8192DE_TEST_HWIMG_SUPPORT 0 67 | #define RTL8192DU_HWIMG_SUPPORT 1 68 | #define RTL8192DU_TEST_HWIMG_SUPPORT 0 69 | 70 | // For 8723 71 | #define RTL8723E_HWIMG_SUPPORT 0 72 | #define RTL8723U_HWIMG_SUPPORT 0 73 | #define RTL8723S_HWIMG_SUPPORT 1 74 | 75 | //For 88E 76 | #define RTL8188EE_HWIMG_SUPPORT 0 77 | #define RTL8188EU_HWIMG_SUPPORT 0 78 | #define RTL8188ES_HWIMG_SUPPORT 0 79 | #endif 80 | 81 | #else // PLATFORM_WINDOWS & MacOSX 82 | 83 | //For 92C 84 | #define RTL8192CE_HWIMG_SUPPORT 1 85 | #define RTL8192CE_TEST_HWIMG_SUPPORT 1 86 | #define RTL8192CU_HWIMG_SUPPORT 1 87 | #define RTL8192CU_TEST_HWIMG_SUPPORT 1 88 | 89 | // For 92D 90 | #define RTL8192DE_HWIMG_SUPPORT 1 91 | #define RTL8192DE_TEST_HWIMG_SUPPORT 1 92 | #define RTL8192DU_HWIMG_SUPPORT 1 93 | #define RTL8192DU_TEST_HWIMG_SUPPORT 1 94 | 95 | #if defined(UNDER_CE) 96 | // For 8723 97 | #define RTL8723E_HWIMG_SUPPORT 0 98 | #define RTL8723U_HWIMG_SUPPORT 0 99 | #define RTL8723S_HWIMG_SUPPORT 1 100 | 101 | // For 88E 102 | #define RTL8188EE_HWIMG_SUPPORT 0 103 | #define RTL8188EU_HWIMG_SUPPORT 0 104 | #define RTL8188ES_HWIMG_SUPPORT 0 105 | 106 | #else 107 | 108 | // For 8723 109 | #define RTL8723E_HWIMG_SUPPORT 1 110 | //#define RTL_8723E_TEST_HWIMG_SUPPORT 1 111 | #define RTL8723U_HWIMG_SUPPORT 1 112 | //#define RTL_8723U_TEST_HWIMG_SUPPORT 1 113 | #define RTL8723S_HWIMG_SUPPORT 1 114 | //#define RTL_8723S_TEST_HWIMG_SUPPORT 1 115 | 116 | //For 88E 117 | #define RTL8188EE_HWIMG_SUPPORT 1 118 | #define RTL8188EU_HWIMG_SUPPORT 1 119 | #define RTL8188ES_HWIMG_SUPPORT 1 120 | #endif 121 | 122 | #endif 123 | 124 | #endif //__INC_HW_IMG_H 125 | -------------------------------------------------------------------------------- /include/rtw_ap.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2012 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_AP_H_ 21 | #define __RTW_AP_H_ 22 | 23 | 24 | #ifdef CONFIG_AP_MODE 25 | 26 | //external function 27 | extern void rtw_indicate_sta_assoc_event(_adapter *padapter, struct sta_info *psta); 28 | extern void rtw_indicate_sta_disassoc_event(_adapter *padapter, struct sta_info *psta); 29 | 30 | 31 | void init_mlme_ap_info(_adapter *padapter); 32 | void free_mlme_ap_info(_adapter *padapter); 33 | //void update_BCNTIM(_adapter *padapter); 34 | void rtw_add_bcn_ie(_adapter *padapter, WLAN_BSSID_EX *pnetwork, u8 index, u8 *data, u8 len); 35 | void rtw_remove_bcn_ie(_adapter *padapter, WLAN_BSSID_EX *pnetwork, u8 index); 36 | void _update_beacon(_adapter *padapter, u8 ie_id, u8 *oui, u8 tx, const char *tag); 37 | #define update_beacon(adapter, ie_id, oui, tx) _update_beacon((adapter), (ie_id), (oui), (tx), __func__) 38 | void add_RATid(_adapter *padapter, struct sta_info *psta, u8 rssi_level); 39 | void expire_timeout_chk(_adapter *padapter); 40 | void update_sta_info_apmode(_adapter *padapter, struct sta_info *psta); 41 | void rtw_start_bss_hdl_after_chbw_decided(_adapter *adapter); 42 | void start_bss_network(_adapter *padapter, struct createbss_parm *parm); 43 | int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len); 44 | void rtw_ap_restore_network(_adapter *padapter); 45 | void rtw_set_macaddr_acl(_adapter *padapter, int mode); 46 | int rtw_acl_add_sta(_adapter *padapter, u8 *addr); 47 | int rtw_acl_remove_sta(_adapter *padapter, u8 *addr); 48 | 49 | u8 rtw_ap_set_pairwise_key(_adapter *padapter, struct sta_info *psta); 50 | int rtw_ap_set_group_key(_adapter *padapter, u8 *key, u8 alg, int keyid); 51 | int rtw_ap_set_wep_key(_adapter *padapter, u8 *key, u8 keylen, int keyid, u8 set_tx); 52 | 53 | #ifdef CONFIG_NATIVEAP_MLME 54 | void associated_clients_update(_adapter *padapter, u8 updated, u32 sta_info_type); 55 | void bss_cap_update_on_sta_join(_adapter *padapter, struct sta_info *psta); 56 | u8 bss_cap_update_on_sta_leave(_adapter *padapter, struct sta_info *psta); 57 | void sta_info_update(_adapter *padapter, struct sta_info *psta); 58 | void ap_sta_info_defer_update(_adapter *padapter, struct sta_info *psta); 59 | u8 ap_free_sta(_adapter *padapter, struct sta_info *psta, bool active, u16 reason, bool enqueue); 60 | int rtw_sta_flush(_adapter *padapter, bool enqueue); 61 | int rtw_ap_inform_ch_switch(_adapter *padapter, u8 new_ch, u8 ch_offset); 62 | void start_ap_mode(_adapter *padapter); 63 | void stop_ap_mode(_adapter *padapter); 64 | #endif 65 | 66 | void rtw_ap_update_bss_chbw(_adapter *adapter, WLAN_BSSID_EX *bss, u8 ch, u8 bw, u8 offset); 67 | bool rtw_ap_chbw_decision(_adapter *adapter, u8 req_ch, u8 req_bw, u8 req_offset, u8 *ch, u8 *bw, u8 *offset); 68 | 69 | #ifdef CONFIG_AUTO_AP_MODE 70 | extern void rtw_start_auto_ap(_adapter *adapter); 71 | #endif //CONFIG_AUTO_AP_MODE 72 | 73 | #endif //end of CONFIG_AP_MODE 74 | 75 | #endif 76 | void update_bmc_sta(_adapter *padapter); 77 | 78 | void rtw_process_ht_action_smps(_adapter *padapter, u8 *ta, u8 ctrl_field); 79 | void rtw_process_public_act_bsscoex(_adapter *padapter, u8 *pframe, uint frame_len); 80 | 81 | -------------------------------------------------------------------------------- /hal/phydm/phydm_adaptivity.h: -------------------------------------------------------------------------------- 1 | 2 | /****************************************************************************** 3 | * 4 | * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. 5 | * 6 | * This program is free software; you can redistribute it and/or modify it 7 | * under the terms of version 2 of the GNU General Public License as 8 | * published by the Free Software Foundation. 9 | * 10 | * This program is distributed in the hope that it will be useful, but WITHOUT 11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 13 | * more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along with 16 | * this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 18 | * 19 | * 20 | ******************************************************************************/ 21 | 22 | #ifndef __PHYDMADAPTIVITY_H__ 23 | #define __PHYDMADAPTIVITY_H__ 24 | 25 | #define ADAPTIVITY_VERSION "9.0" 26 | 27 | #define PwdBUpperBound 7 28 | #define DFIRloss 5 29 | 30 | #if (DM_ODM_SUPPORT_TYPE & (ODM_WIN)) 31 | typedef enum _tag_PhyDM_REGULATION_Type { 32 | REGULATION_FCC = 0, 33 | REGULATION_MKK = 1, 34 | REGULATION_ETSI = 2, 35 | REGULATION_WW = 3, 36 | 37 | MAX_REGULATION_NUM = 4 38 | } PhyDM_REGULATION_TYPE; 39 | #endif 40 | 41 | typedef enum tag_PhyDM_set_LNA { 42 | PhyDM_disable_LNA = 0, 43 | PhyDM_enable_LNA = 1, 44 | } PhyDM_set_LNA; 45 | 46 | 47 | typedef enum tag_PhyDM_TRx_MUX_Type 48 | { 49 | PhyDM_SHUTDOWN = 0, 50 | PhyDM_STANDBY_MODE = 1, 51 | PhyDM_TX_MODE = 2, 52 | PhyDM_RX_MODE = 3 53 | }PhyDM_Trx_MUX_Type; 54 | 55 | typedef enum tag_PhyDM_MACEDCCA_Type 56 | { 57 | PhyDM_IGNORE_EDCCA = 0, 58 | PhyDM_DONT_IGNORE_EDCCA = 1 59 | }PhyDM_MACEDCCA_Type; 60 | 61 | typedef struct _ADAPTIVITY_STATISTICS { 62 | s1Byte TH_L2H_ini_backup; 63 | s1Byte TH_EDCCA_HL_diff_backup; 64 | s1Byte IGI_Base; 65 | u1Byte IGI_target; 66 | u1Byte NHMWait; 67 | s1Byte H2L_lb; 68 | s1Byte L2H_lb; 69 | BOOLEAN bFirstLink; 70 | BOOLEAN bCheck; 71 | BOOLEAN DynamicLinkAdaptivity; 72 | u1Byte APNumTH; 73 | u1Byte AdajustIGILevel; 74 | } ADAPTIVITY_STATISTICS, *PADAPTIVITY_STATISTICS; 75 | 76 | VOID 77 | Phydm_CheckAdaptivity( 78 | IN PVOID pDM_VOID 79 | ); 80 | 81 | VOID 82 | Phydm_CheckEnvironment( 83 | IN PVOID pDM_VOID 84 | ); 85 | 86 | VOID 87 | Phydm_NHMCounterStatisticsInit( 88 | IN PVOID pDM_VOID 89 | ); 90 | 91 | VOID 92 | Phydm_NHMCounterStatistics( 93 | IN PVOID pDM_VOID 94 | ); 95 | 96 | VOID 97 | Phydm_NHMCounterStatisticsReset( 98 | IN PVOID pDM_VOID 99 | ); 100 | 101 | VOID 102 | Phydm_GetNHMCounterStatistics( 103 | IN PVOID pDM_VOID 104 | ); 105 | 106 | VOID 107 | Phydm_MACEDCCAState( 108 | IN PVOID pDM_VOID, 109 | IN PhyDM_MACEDCCA_Type State 110 | ); 111 | 112 | VOID 113 | Phydm_SetEDCCAThreshold( 114 | IN PVOID pDM_VOID, 115 | IN s1Byte H2L, 116 | IN s1Byte L2H 117 | ); 118 | 119 | VOID 120 | Phydm_SetTRxMux( 121 | IN PVOID pDM_VOID, 122 | IN PhyDM_Trx_MUX_Type txMode, 123 | IN PhyDM_Trx_MUX_Type rxMode 124 | ); 125 | 126 | BOOLEAN 127 | Phydm_CalNHMcnt( 128 | IN PVOID pDM_VOID 129 | ); 130 | 131 | VOID 132 | Phydm_SearchPwdBLowerBound( 133 | IN PVOID pDM_VOID 134 | ); 135 | 136 | VOID 137 | Phydm_AdaptivityInit( 138 | IN PVOID pDM_VOID 139 | ); 140 | 141 | VOID 142 | Phydm_Adaptivity( 143 | IN PVOID pDM_VOID, 144 | IN u1Byte IGI 145 | ); 146 | 147 | VOID 148 | phydm_setEDCCAThresholdAPI( 149 | IN PVOID pDM_VOID, 150 | IN u1Byte IGI 151 | ); 152 | 153 | #if (DM_ODM_SUPPORT_TYPE == ODM_WIN) 154 | VOID 155 | Phydm_DisableEDCCA( 156 | IN PVOID pDM_VOID 157 | ); 158 | 159 | VOID 160 | Phydm_DynamicEDCCA( 161 | IN PVOID pDM_VOID 162 | ); 163 | 164 | VOID 165 | Phydm_AdaptivityBSOD( 166 | IN PVOID pDM_VOID 167 | ); 168 | 169 | #endif 170 | 171 | 172 | #endif 173 | -------------------------------------------------------------------------------- /include/Hal8188FPhyCfg.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 __INC_HAL8188FPHYCFG_H__ 21 | #define __INC_HAL8188FPHYCFG_H__ 22 | 23 | /*--------------------------Define Parameters-------------------------------*/ 24 | #define LOOP_LIMIT 5 25 | #define MAX_STALL_TIME 50 //us 26 | #define AntennaDiversityValue 0x80 //(Adapter->bSoftwareAntennaDiversity ? 0x00:0x80) 27 | #define MAX_TXPWR_IDX_NMODE_92S 63 28 | #define Reset_Cnt_Limit 3 29 | 30 | #ifdef CONFIG_PCI_HCI 31 | #define MAX_AGGR_NUM 0x0B 32 | #else 33 | #define MAX_AGGR_NUM 0x07 34 | #endif // CONFIG_PCI_HCI 35 | 36 | 37 | /*--------------------------Define Parameters End-------------------------------*/ 38 | 39 | 40 | /*------------------------------Define structure----------------------------*/ 41 | 42 | /*------------------------------Define structure End----------------------------*/ 43 | 44 | /*--------------------------Exported Function prototype---------------------*/ 45 | u32 46 | PHY_QueryBBReg_8188F( 47 | IN PADAPTER Adapter, 48 | IN u32 RegAddr, 49 | IN u32 BitMask 50 | ); 51 | 52 | VOID 53 | PHY_SetBBReg_8188F( 54 | IN PADAPTER Adapter, 55 | IN u32 RegAddr, 56 | IN u32 BitMask, 57 | IN u32 Data 58 | ); 59 | 60 | u32 61 | PHY_QueryRFReg_8188F( 62 | IN PADAPTER Adapter, 63 | IN u8 eRFPath, 64 | IN u32 RegAddr, 65 | IN u32 BitMask 66 | ); 67 | 68 | VOID 69 | PHY_SetRFReg_8188F( 70 | IN PADAPTER Adapter, 71 | IN u8 eRFPath, 72 | IN u32 RegAddr, 73 | IN u32 BitMask, 74 | IN u32 Data 75 | ); 76 | 77 | /* MAC/BB/RF HAL config */ 78 | int PHY_BBConfig8188F(PADAPTER Adapter ); 79 | 80 | int PHY_RFConfig8188F(PADAPTER Adapter ); 81 | 82 | s32 PHY_MACConfig8188F(PADAPTER padapter); 83 | 84 | int 85 | PHY_ConfigRFWithParaFile_8188F( 86 | IN PADAPTER Adapter, 87 | IN u8* pFileName, 88 | RF_PATH eRFPath 89 | ); 90 | 91 | VOID 92 | PHY_SetTxPowerIndex_8188F( 93 | IN PADAPTER Adapter, 94 | IN u32 PowerIndex, 95 | IN u8 RFPath, 96 | IN u8 Rate 97 | ); 98 | 99 | u8 100 | PHY_GetTxPowerIndex_8188F( 101 | IN PADAPTER pAdapter, 102 | IN u8 RFPath, 103 | IN u8 Rate, 104 | IN CHANNEL_WIDTH BandWidth, 105 | IN u8 Channel 106 | ); 107 | 108 | VOID 109 | PHY_GetTxPowerLevel8188F( 110 | IN PADAPTER Adapter, 111 | OUT s32* powerlevel 112 | ); 113 | 114 | VOID 115 | PHY_SetTxPowerLevel8188F( 116 | IN PADAPTER Adapter, 117 | IN u8 channel 118 | ); 119 | 120 | VOID 121 | PHY_SetBWMode8188F( 122 | IN PADAPTER Adapter, 123 | IN CHANNEL_WIDTH Bandwidth, // 20M or 40M 124 | IN unsigned char Offset // Upper, Lower, or Don't care 125 | ); 126 | 127 | VOID 128 | PHY_SwChnl8188F( // Call after initialization 129 | IN PADAPTER Adapter, 130 | IN u8 channel 131 | ); 132 | 133 | VOID 134 | PHY_SetSwChnlBWMode8188F( 135 | IN PADAPTER Adapter, 136 | IN u8 channel, 137 | IN CHANNEL_WIDTH Bandwidth, 138 | IN u8 Offset40, 139 | IN u8 Offset80 140 | ); 141 | 142 | VOID PHY_SetRFPathSwitch_8188F( 143 | IN PADAPTER pAdapter, 144 | IN BOOLEAN bMain 145 | ); 146 | /*--------------------------Exported Function prototype End---------------------*/ 147 | 148 | #endif 149 | 150 | -------------------------------------------------------------------------------- /hal/rtl8188f/rtl8188f_sreset.c: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2012 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 | #define _RTL8188F_SRESET_C_ 21 | 22 | #include 23 | 24 | 25 | #ifdef DBG_CONFIG_ERROR_DETECT 26 | void rtl8188f_sreset_xmit_status_check(_adapter *padapter) 27 | { 28 | HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter); 29 | struct sreset_priv *psrtpriv = &pHalData->srestpriv; 30 | 31 | unsigned long current_time; 32 | struct xmit_priv *pxmitpriv = &padapter->xmitpriv; 33 | unsigned int diff_time; 34 | u32 txdma_status; 35 | 36 | txdma_status = rtw_read32(padapter, REG_TXDMA_STATUS); 37 | if (txdma_status != 0x00 && txdma_status != 0xeaeaeaea) { 38 | DBG_871X("%s REG_TXDMA_STATUS:0x%08x\n", __func__, txdma_status); 39 | rtw_hal_sreset_reset(padapter); 40 | } 41 | 42 | #ifdef CONFIG_USB_HCI 43 | /*total xmit irp = 4 */ 44 | /*DBG_8192C("==>%s free_xmitbuf_cnt(%d),txirp_cnt(%d)\n",__func__,pxmitpriv->free_xmitbuf_cnt,pxmitpriv->txirp_cnt); */ 45 | /*if(pxmitpriv->txirp_cnt == NR_XMITBUFF+1) */ 46 | current_time = rtw_get_current_time(); 47 | 48 | if (0 == pxmitpriv->free_xmitbuf_cnt || 0 == pxmitpriv->free_xmit_extbuf_cnt) { 49 | 50 | diff_time = rtw_get_passing_time_ms(psrtpriv->last_tx_time); 51 | 52 | if (diff_time > 2000) { 53 | if (psrtpriv->last_tx_complete_time == 0) 54 | psrtpriv->last_tx_complete_time = current_time; 55 | else { 56 | diff_time = rtw_get_passing_time_ms(psrtpriv->last_tx_complete_time); 57 | if (diff_time > 4000) { 58 | u32 ability = 0; 59 | 60 | /*padapter->Wifi_Error_Status = WIFI_TX_HANG; */ 61 | ability = rtw_phydm_ability_get(padapter); 62 | DBG_871X("%s tx hang %s\n", __func__, 63 | (ability & ODM_BB_ADAPTIVITY) ? "ODM_BB_ADAPTIVITY" : ""); 64 | 65 | if (!(ability & ODM_BB_ADAPTIVITY)) 66 | rtw_hal_sreset_reset(padapter); 67 | } 68 | } 69 | } 70 | } 71 | #endif /* #ifdef CONFIG_USB_HCI */ 72 | 73 | if (psrtpriv->dbg_trigger_point == SRESET_TGP_XMIT_STATUS) { 74 | psrtpriv->dbg_trigger_point = SRESET_TGP_NULL; 75 | rtw_hal_sreset_reset(padapter); 76 | return; 77 | } 78 | } 79 | 80 | void rtl8188f_sreset_linked_status_check(_adapter *padapter) 81 | { 82 | HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter); 83 | struct sreset_priv *psrtpriv = &pHalData->srestpriv; 84 | #if 0 85 | u32 regc50, regc58, reg824, reg800; 86 | 87 | regc50 = rtw_read32(padapter, 0xc50); 88 | regc58 = rtw_read32(padapter, 0xc58); 89 | reg824 = rtw_read32(padapter, 0x824); 90 | reg800 = rtw_read32(padapter, 0x800); 91 | if (((regc50 & 0xFFFFFF00) != 0x69543400) || 92 | ((regc58 & 0xFFFFFF00) != 0x69543400) || 93 | (((reg824 & 0xFFFFFF00) != 0x00390000) && (((reg824 & 0xFFFFFF00) != 0x80390000))) || 94 | (((reg800 & 0xFFFFFF00) != 0x03040000) && ((reg800 & 0xFFFFFF00) != 0x83040000))) { 95 | DBG_8192C("%s regc50:0x%08x, regc58:0x%08x, reg824:0x%08x, reg800:0x%08x,\n", __func__, 96 | regc50, regc58, reg824, reg800); 97 | rtw_hal_sreset_reset(padapter); 98 | } 99 | #endif 100 | 101 | if (psrtpriv->dbg_trigger_point == SRESET_TGP_LINK_STATUS) { 102 | psrtpriv->dbg_trigger_point = SRESET_TGP_NULL; 103 | rtw_hal_sreset_reset(padapter); 104 | return; 105 | } 106 | } 107 | 108 | #endif 109 | 110 | -------------------------------------------------------------------------------- /include/byteorder/swab.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 _LINUX_BYTEORDER_SWAB_H 21 | #define _LINUX_BYTEORDER_SWAB_H 22 | 23 | #if !defined(CONFIG_PLATFORM_MSTAR) 24 | #ifndef __u16 25 | typedef unsigned short __u16; 26 | #endif 27 | 28 | #ifndef __u32 29 | typedef unsigned int __u32; 30 | #endif 31 | 32 | #ifndef __u8 33 | typedef unsigned char __u8; 34 | #endif 35 | 36 | #ifndef __u64 37 | typedef unsigned long long __u64; 38 | #endif 39 | 40 | 41 | __inline static __u16 ___swab16(__u16 x) 42 | { 43 | __u16 __x = x; 44 | return 45 | ((__u16)( 46 | (((__u16)(__x) & (__u16)0x00ffU) << 8) | 47 | (((__u16)(__x) & (__u16)0xff00U) >> 8) )); 48 | 49 | } 50 | 51 | __inline static __u32 ___swab32(__u32 x) 52 | { 53 | __u32 __x = (x); 54 | return ((__u32)( 55 | (((__u32)(__x) & (__u32)0x000000ffUL) << 24) | 56 | (((__u32)(__x) & (__u32)0x0000ff00UL) << 8) | 57 | (((__u32)(__x) & (__u32)0x00ff0000UL) >> 8) | 58 | (((__u32)(__x) & (__u32)0xff000000UL) >> 24) )); 59 | } 60 | 61 | __inline static __u64 ___swab64(__u64 x) 62 | { 63 | __u64 __x = (x); 64 | 65 | return 66 | ((__u64)( \ 67 | (__u64)(((__u64)(__x) & (__u64)0x00000000000000ffULL) << 56) | \ 68 | (__u64)(((__u64)(__x) & (__u64)0x000000000000ff00ULL) << 40) | \ 69 | (__u64)(((__u64)(__x) & (__u64)0x0000000000ff0000ULL) << 24) | \ 70 | (__u64)(((__u64)(__x) & (__u64)0x00000000ff000000ULL) << 8) | \ 71 | (__u64)(((__u64)(__x) & (__u64)0x000000ff00000000ULL) >> 8) | \ 72 | (__u64)(((__u64)(__x) & (__u64)0x0000ff0000000000ULL) >> 24) | \ 73 | (__u64)(((__u64)(__x) & (__u64)0x00ff000000000000ULL) >> 40) | \ 74 | (__u64)(((__u64)(__x) & (__u64)0xff00000000000000ULL) >> 56) )); \ 75 | } 76 | #endif // CONFIG_PLATFORM_MSTAR 77 | 78 | #ifndef __arch__swab16 79 | __inline static __u16 __arch__swab16(__u16 x) 80 | { 81 | return ___swab16(x); 82 | } 83 | 84 | #endif 85 | 86 | #ifndef __arch__swab32 87 | __inline static __u32 __arch__swab32(__u32 x) 88 | { 89 | __u32 __tmp = (x) ; 90 | return ___swab32(__tmp); 91 | } 92 | #endif 93 | 94 | #ifndef __arch__swab64 95 | 96 | __inline static __u64 __arch__swab64(__u64 x) 97 | { 98 | __u64 __tmp = (x) ; 99 | return ___swab64(__tmp); 100 | } 101 | 102 | 103 | #endif 104 | 105 | #ifndef __swab16 106 | #define __swab16(x) __fswab16(x) 107 | #define __swab32(x) __fswab32(x) 108 | #define __swab64(x) __fswab64(x) 109 | #endif // __swab16 110 | 111 | #ifdef PLATFORM_FREEBSD 112 | __inline static __u16 __fswab16(__u16 x) 113 | #else 114 | __inline static const __u16 __fswab16(__u16 x) 115 | #endif //PLATFORM_FREEBSD 116 | { 117 | return __arch__swab16(x); 118 | } 119 | #ifdef PLATFORM_FREEBSD 120 | __inline static __u32 __fswab32(__u32 x) 121 | #else 122 | __inline static const __u32 __fswab32(__u32 x) 123 | #endif //PLATFORM_FREEBSD 124 | { 125 | return __arch__swab32(x); 126 | } 127 | 128 | #if defined(PLATFORM_LINUX) || defined(PLATFORM_WINDOWS) 129 | #define swab16 __swab16 130 | #define swab32 __swab32 131 | #define swab64 __swab64 132 | #define swab16p __swab16p 133 | #define swab32p __swab32p 134 | #define swab64p __swab64p 135 | #define swab16s __swab16s 136 | #define swab32s __swab32s 137 | #define swab64s __swab64s 138 | #endif 139 | 140 | #endif /* _LINUX_BYTEORDER_SWAB_H */ 141 | 142 | -------------------------------------------------------------------------------- /include/usb_ops_linux.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 __USB_OPS_LINUX_H__ 21 | #define __USB_OPS_LINUX_H__ 22 | 23 | #define VENDOR_CMD_MAX_DATA_LEN 254 24 | #define FW_START_ADDRESS 0x1000 25 | 26 | #define RTW_USB_CONTROL_MSG_TIMEOUT_TEST 10//ms 27 | #define RTW_USB_CONTROL_MSG_TIMEOUT 500//ms 28 | 29 | #define RECV_BULK_IN_ADDR 0x80//assign by drv,not real address 30 | #define RECV_INT_IN_ADDR 0x81//assign by drv,not real address 31 | 32 | #define INTERRUPT_MSG_FORMAT_LEN 60 33 | 34 | #if defined(CONFIG_VENDOR_REQ_RETRY) && defined(CONFIG_USB_VENDOR_REQ_MUTEX) 35 | /* vendor req retry should be in the situation when each vendor req is atomically submitted from others */ 36 | #define MAX_USBCTRL_VENDORREQ_TIMES 10 37 | #else 38 | #define MAX_USBCTRL_VENDORREQ_TIMES 1 39 | #endif 40 | 41 | #define RTW_USB_BULKOUT_TIMEOUT 5000//ms 42 | 43 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) || (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,18)) 44 | #define _usbctrl_vendorreq_async_callback(urb, regs) _usbctrl_vendorreq_async_callback(urb) 45 | #define usb_bulkout_zero_complete(purb, regs) usb_bulkout_zero_complete(purb) 46 | #define usb_write_mem_complete(purb, regs) usb_write_mem_complete(purb) 47 | #define usb_write_port_complete(purb, regs) usb_write_port_complete(purb) 48 | #define usb_read_port_complete(purb, regs) usb_read_port_complete(purb) 49 | #define usb_read_interrupt_complete(purb, regs) usb_read_interrupt_complete(purb) 50 | #endif 51 | 52 | #ifdef CONFIG_USB_SUPPORT_ASYNC_VDN_REQ 53 | int usb_async_write8(struct intf_hdl *pintfhdl, u32 addr, u8 val); 54 | int usb_async_write16(struct intf_hdl *pintfhdl, u32 addr, u16 val); 55 | int usb_async_write32(struct intf_hdl *pintfhdl, u32 addr, u32 val); 56 | #endif /* CONFIG_USB_SUPPORT_ASYNC_VDN_REQ */ 57 | 58 | unsigned int ffaddr2pipehdl(struct dvobj_priv *pdvobj, u32 addr); 59 | 60 | void usb_read_mem(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *rmem); 61 | void usb_write_mem(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *wmem); 62 | 63 | void usb_read_port_cancel(struct intf_hdl *pintfhdl); 64 | 65 | u32 usb_write_port(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *wmem); 66 | void usb_write_port_cancel(struct intf_hdl *pintfhdl); 67 | 68 | int usbctrl_vendorreq(struct intf_hdl *pintfhdl, u8 request, u16 value, u16 index, void *pdata, u16 len, u8 requesttype); 69 | #ifdef CONFIG_USB_SUPPORT_ASYNC_VDN_REQ 70 | int _usbctrl_vendorreq_async_write(struct usb_device *udev, u8 request, 71 | u16 value, u16 index, void *pdata, u16 len, u8 requesttype); 72 | #endif /* CONFIG_USB_SUPPORT_ASYNC_VDN_REQ */ 73 | 74 | u8 usb_read8(struct intf_hdl *pintfhdl, u32 addr); 75 | u16 usb_read16(struct intf_hdl *pintfhdl, u32 addr); 76 | u32 usb_read32(struct intf_hdl *pintfhdl, u32 addr); 77 | int usb_write8(struct intf_hdl *pintfhdl, u32 addr, u8 val); 78 | int usb_write16(struct intf_hdl *pintfhdl, u32 addr, u16 val); 79 | int usb_write32(struct intf_hdl *pintfhdl, u32 addr, u32 val); 80 | int usb_writeN(struct intf_hdl *pintfhdl, u32 addr, u32 length, u8 *pdata); 81 | u32 usb_read_port(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *rmem); 82 | void usb_recv_tasklet(void *priv); 83 | 84 | #ifdef CONFIG_USB_INTERRUPT_IN_PIPE 85 | void usb_read_interrupt_complete(struct urb *purb, struct pt_regs *regs); 86 | u32 usb_read_interrupt(struct intf_hdl *pintfhdl, u32 addr); 87 | #endif 88 | #endif 89 | 90 | -------------------------------------------------------------------------------- /hal/phydm/txbf/halcomtxbf.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0 */ 2 | #ifndef __HAL_COM_TXBF_H__ 3 | #define __HAL_COM_TXBF_H__ 4 | 5 | /* 6 | typedef BOOLEAN 7 | (*TXBF_GET)( 8 | IN PVOID pAdapter, 9 | IN u1Byte getType, 10 | OUT PVOID pOutBuf 11 | ); 12 | 13 | typedef BOOLEAN 14 | (*TXBF_SET)( 15 | IN PVOID pAdapter, 16 | IN u1Byte setType, 17 | OUT PVOID pInBuf 18 | ); 19 | */ 20 | #define TxBF_Nr(a, b) ((a > b) ? (b) : (a)) 21 | 22 | typedef enum _TXBF_SET_TYPE{ 23 | TXBF_SET_SOUNDING_ENTER, 24 | TXBF_SET_SOUNDING_LEAVE, 25 | TXBF_SET_SOUNDING_RATE, 26 | TXBF_SET_SOUNDING_STATUS, 27 | TXBF_SET_SOUNDING_FW_NDPA, 28 | TXBF_SET_SOUNDING_CLK, 29 | TXBF_SET_TX_PATH_RESET, 30 | TXBF_SET_GET_TX_RATE 31 | }TXBF_SET_TYPE,*PTXBF_SET_TYPE; 32 | 33 | 34 | typedef enum _TXBF_GET_TYPE{ 35 | TXBF_GET_EXPLICIT_BEAMFORMEE, 36 | TXBF_GET_EXPLICIT_BEAMFORMER, 37 | TXBF_GET_MU_MIMO_STA, 38 | TXBF_GET_MU_MIMO_AP 39 | }TXBF_GET_TYPE,*PTXBF_GET_TYPE; 40 | 41 | 42 | 43 | //2 HAL TXBF related 44 | typedef struct _HAL_TXBF_INFO { 45 | u1Byte TXBFIdx; 46 | u1Byte NdpaIdx; 47 | u1Byte BW; 48 | u1Byte Rate; 49 | 50 | RT_TIMER Txbf_FwNdpaTimer; 51 | #if (DM_ODM_SUPPORT_TYPE == ODM_WIN) 52 | RT_WORK_ITEM Txbf_EnterWorkItem; 53 | RT_WORK_ITEM Txbf_LeaveWorkItem; 54 | RT_WORK_ITEM Txbf_FwNdpaWorkItem; 55 | RT_WORK_ITEM Txbf_ClkWorkItem; 56 | RT_WORK_ITEM Txbf_StatusWorkItem; 57 | RT_WORK_ITEM Txbf_RateWorkItem; 58 | RT_WORK_ITEM Txbf_ResetTxPathWorkItem; 59 | RT_WORK_ITEM Txbf_GetTxRateWorkItem; 60 | #endif 61 | 62 | } HAL_TXBF_INFO, *PHAL_TXBF_INFO; 63 | 64 | #if (BEAMFORMING_SUPPORT == 1) 65 | 66 | VOID 67 | halComTxbf_beamformInit( 68 | IN PVOID pDM_VOID 69 | ); 70 | 71 | VOID 72 | halComTxbf_ConfigGtab( 73 | IN PVOID pDM_VOID 74 | ); 75 | 76 | VOID 77 | halComTxbf_EnterWorkItemCallback( 78 | #if (DM_ODM_SUPPORT_TYPE == ODM_WIN) 79 | IN PADAPTER Adapter 80 | #else 81 | IN PVOID pDM_VOID 82 | #endif 83 | ); 84 | 85 | VOID 86 | halComTxbf_LeaveWorkItemCallback( 87 | #if (DM_ODM_SUPPORT_TYPE == ODM_WIN) 88 | IN PADAPTER Adapter 89 | #else 90 | IN PVOID pDM_VOID 91 | #endif 92 | ); 93 | 94 | VOID 95 | halComTxbf_FwNdpaWorkItemCallback( 96 | #if (DM_ODM_SUPPORT_TYPE == ODM_WIN) 97 | IN PADAPTER Adapter 98 | #else 99 | IN PVOID pDM_VOID 100 | #endif 101 | ); 102 | 103 | VOID 104 | halComTxbf_ClkWorkItemCallback( 105 | #if (DM_ODM_SUPPORT_TYPE == ODM_WIN) 106 | IN PADAPTER Adapter 107 | #else 108 | IN PVOID pDM_VOID 109 | #endif 110 | ); 111 | 112 | VOID 113 | halComTxbf_ResetTxPathWorkItemCallback( 114 | #if (DM_ODM_SUPPORT_TYPE == ODM_WIN) 115 | IN PADAPTER Adapter 116 | #else 117 | IN PVOID pDM_VOID 118 | #endif 119 | ); 120 | 121 | VOID 122 | halComTxbf_GetTxRateWorkItemCallback( 123 | #if (DM_ODM_SUPPORT_TYPE == ODM_WIN) 124 | IN PADAPTER Adapter 125 | #else 126 | IN PVOID pDM_VOID 127 | #endif 128 | ); 129 | 130 | VOID 131 | halComTxbf_RateWorkItemCallback( 132 | #if (DM_ODM_SUPPORT_TYPE == ODM_WIN) 133 | IN PADAPTER Adapter 134 | #else 135 | IN PVOID pDM_VOID 136 | #endif 137 | ); 138 | 139 | VOID 140 | halComTxbf_FwNdpaTimerCallback( 141 | IN PRT_TIMER pTimer 142 | ); 143 | 144 | VOID 145 | halComTxbf_StatusWorkItemCallback( 146 | #if (DM_ODM_SUPPORT_TYPE == ODM_WIN) 147 | IN PADAPTER Adapter 148 | #else 149 | IN PVOID pDM_VOID 150 | #endif 151 | ); 152 | 153 | BOOLEAN 154 | HalComTxbf_Set( 155 | IN PVOID pDM_VOID, 156 | IN u1Byte setType, 157 | IN PVOID pInBuf 158 | ); 159 | 160 | BOOLEAN 161 | HalComTxbf_Get( 162 | IN PADAPTER Adapter, 163 | IN u1Byte getType, 164 | OUT PVOID pOutBuf 165 | ); 166 | 167 | #else 168 | #define halComTxbf_beamformInit(pDM_VOID) NULL 169 | #define halComTxbf_ConfigGtab(pDM_VOID) NULL 170 | #define halComTxbf_EnterWorkItemCallback(_Adapter) NULL 171 | #define halComTxbf_LeaveWorkItemCallback(_Adapter) NULL 172 | #define halComTxbf_FwNdpaWorkItemCallback(_Adapter) NULL 173 | #define halComTxbf_ClkWorkItemCallback(_Adapter) NULL 174 | #define halComTxbf_RateWorkItemCallback(_Adapter) NULL 175 | #define halComTxbf_FwNdpaTimerCallback(_Adapter) NULL 176 | #define halComTxbf_StatusWorkItemCallback(_Adapter) NULL 177 | #define HalComTxbf_Get(_Adapter, _getType, _pOutBuf) 178 | 179 | #endif 180 | 181 | #endif // #ifndef __HAL_COM_TXBF_H__ 182 | 183 | --------------------------------------------------------------------------------