├── .gitignore ├── Kconfig ├── LICENSE ├── Makefile ├── base.c ├── base.h ├── btcoexist ├── Makefile ├── halbt_precomp.h ├── halbtc8192e2ant.c ├── halbtc8192e2ant.h ├── halbtc8723b1ant.c ├── halbtc8723b1ant.h ├── halbtc8723b2ant.c ├── halbtc8723b2ant.h ├── halbtc8821a1ant.c ├── halbtc8821a1ant.h ├── halbtc8821a2ant.c ├── halbtc8821a2ant.h ├── halbtc8822bwifionly.c ├── halbtc8822bwifionly.h ├── halbtcoutsrc.c ├── halbtcoutsrc.h ├── rtl_btc.c └── rtl_btc.h ├── cam.c ├── cam.h ├── core.c ├── core.h ├── debug.c ├── debug.h ├── efuse.c ├── efuse.h ├── firmware └── rtlwifi │ └── rtl8822befw.bin ├── halmac ├── Makefile ├── halmac_2_platform.h ├── halmac_88xx │ ├── halmac_8822b │ │ ├── halmac_8822b_cfg.h │ │ ├── halmac_8822b_phy.c │ │ ├── halmac_8822b_pwr_seq.c │ │ ├── halmac_8822b_pwr_seq.h │ │ ├── halmac_api_8822b.c │ │ ├── halmac_api_8822b.h │ │ ├── halmac_api_8822b_pcie.c │ │ ├── halmac_api_8822b_pcie.h │ │ ├── halmac_api_8822b_sdio.c │ │ ├── halmac_api_8822b_sdio.h │ │ ├── halmac_api_8822b_usb.c │ │ ├── halmac_api_8822b_usb.h │ │ ├── halmac_func_8822b.c │ │ └── halmac_func_8822b.h │ ├── halmac_88xx_cfg.h │ ├── halmac_api_88xx.c │ ├── halmac_api_88xx.h │ ├── halmac_api_88xx_pcie.c │ ├── halmac_api_88xx_pcie.h │ ├── halmac_api_88xx_sdio.c │ ├── halmac_api_88xx_sdio.h │ ├── halmac_api_88xx_usb.c │ ├── halmac_api_88xx_usb.h │ ├── halmac_func_88xx.c │ └── halmac_func_88xx.h ├── halmac_api.c ├── halmac_api.h ├── halmac_bit2.h ├── halmac_bit_8822b.h ├── halmac_fw_info.h ├── halmac_fw_offload_c2h_nic.h ├── halmac_fw_offload_h2c_nic.h ├── halmac_h2c_extra_info_nic.h ├── halmac_intf_phy_cmd.h ├── halmac_original_c2h_nic.h ├── halmac_original_h2c_nic.h ├── halmac_pcie_reg.h ├── halmac_pwr_seq_cmd.h ├── halmac_reg2.h ├── halmac_reg_8822b.h ├── halmac_rx_bd_chip.h ├── halmac_rx_bd_nic.h ├── halmac_rx_desc_chip.h ├── halmac_rx_desc_nic.h ├── halmac_sdio_reg.h ├── halmac_tx_bd_chip.h ├── halmac_tx_bd_nic.h ├── halmac_tx_desc_chip.h ├── halmac_tx_desc_nic.h ├── halmac_type.h ├── halmac_usb_reg.h ├── rtl_halmac.c └── rtl_halmac.h ├── pci.c ├── pci.h ├── phydm ├── Makefile ├── halphyrf_ce.c ├── halphyrf_ce.h ├── mp_precomp.h ├── phydm.c ├── phydm.h ├── phydm_acs.c ├── phydm_acs.h ├── phydm_adaptivity.c ├── phydm_adaptivity.h ├── phydm_adc_sampling.c ├── phydm_adc_sampling.h ├── phydm_antdiv.c ├── phydm_antdiv.h ├── phydm_beamforming.h ├── phydm_ccx.c ├── phydm_ccx.h ├── phydm_cfotracking.c ├── phydm_cfotracking.h ├── phydm_debug.c ├── phydm_debug.h ├── phydm_dfs.h ├── phydm_dig.c ├── phydm_dig.h ├── phydm_dynamic_rx_path.h ├── phydm_dynamicbbpowersaving.c ├── phydm_dynamicbbpowersaving.h ├── phydm_dynamictxpower.c ├── phydm_dynamictxpower.h ├── phydm_edcaturbocheck.c ├── phydm_edcaturbocheck.h ├── phydm_features.h ├── phydm_hwconfig.c ├── phydm_hwconfig.h ├── phydm_interface.c ├── phydm_interface.h ├── phydm_iqk.h ├── phydm_kfree.c ├── phydm_kfree.h ├── phydm_noisemonitor.c ├── phydm_noisemonitor.h ├── phydm_powertracking_ce.c ├── phydm_powertracking_ce.h ├── phydm_pre_define.h ├── phydm_precomp.h ├── phydm_psd.c ├── phydm_psd.h ├── phydm_rainfo.c ├── phydm_rainfo.h ├── phydm_reg.h ├── phydm_regdefine11ac.h ├── phydm_regdefine11n.h ├── phydm_types.h ├── rtl8822b │ ├── halhwimg8822b_bb.c │ ├── halhwimg8822b_bb.h │ ├── halhwimg8822b_mac.c │ ├── halhwimg8822b_mac.h │ ├── halhwimg8822b_rf.c │ ├── halhwimg8822b_rf.h │ ├── halphyrf_8822b.c │ ├── halphyrf_8822b.h │ ├── phydm_hal_api8822b.c │ ├── phydm_hal_api8822b.h │ ├── phydm_iqk_8822b.c │ ├── phydm_iqk_8822b.h │ ├── phydm_regconfig8822b.c │ ├── phydm_regconfig8822b.h │ ├── phydm_rtl8822b.c │ ├── phydm_rtl8822b.h │ └── version_rtl8822b.h ├── rtl_phydm.c ├── rtl_phydm.h └── txbf │ ├── halcomtxbf.h │ ├── haltxbf8822b.h │ ├── haltxbfinterface.h │ ├── haltxbfjaguar.h │ └── phydm_hal_txbf_api.h ├── ps.c ├── ps.h ├── pwrseqcmd.h ├── rc.c ├── rc.h ├── regd.c ├── regd.h ├── rtl8188ee ├── Makefile ├── def.h ├── dm.c ├── dm.h ├── fw.c ├── fw.h ├── hw.c ├── hw.h ├── led.c ├── led.h ├── phy.c ├── phy.h ├── pwrseq.c ├── pwrseq.h ├── reg.h ├── rf.c ├── rf.h ├── sw.c ├── sw.h ├── table.c ├── table.h ├── trx.c └── trx.h ├── rtl8192c ├── Makefile ├── dm_common.c ├── dm_common.h ├── fw_common.c ├── fw_common.h ├── main.c ├── phy_common.c └── phy_common.h ├── rtl8192ce ├── Makefile ├── def.h ├── dm.c ├── dm.h ├── hw.c ├── hw.h ├── led.c ├── led.h ├── phy.c ├── phy.h ├── reg.h ├── rf.c ├── rf.h ├── sw.c ├── sw.h ├── table.c ├── table.h ├── trx.c └── trx.h ├── rtl8192cu ├── Makefile ├── def.h ├── dm.c ├── dm.h ├── hw.c ├── hw.h ├── led.c ├── led.h ├── mac.c ├── mac.h ├── phy.c ├── phy.h ├── reg.h ├── rf.c ├── rf.h ├── sw.c ├── sw.h ├── table.c ├── table.h ├── trx.c └── trx.h ├── rtl8192de ├── Makefile ├── def.h ├── dm.c ├── dm.h ├── fw.c ├── fw.h ├── hw.c ├── hw.h ├── led.c ├── led.h ├── phy.c ├── phy.h ├── reg.h ├── rf.c ├── rf.h ├── sw.c ├── sw.h ├── table.c ├── table.h ├── trx.c └── trx.h ├── rtl8192ee ├── Makefile ├── def.h ├── dm.c ├── dm.h ├── fw.c ├── fw.h ├── hw.c ├── hw.h ├── led.c ├── led.h ├── phy.c ├── phy.h ├── pwrseq.c ├── pwrseq.h ├── reg.h ├── rf.c ├── rf.h ├── sw.c ├── sw.h ├── table.c ├── table.h ├── trx.c └── trx.h ├── rtl8192se ├── Makefile ├── def.h ├── dm.c ├── dm.h ├── fw.c ├── fw.h ├── hw.c ├── hw.h ├── led.c ├── led.h ├── phy.c ├── phy.h ├── reg.h ├── rf.c ├── rf.h ├── sw.c ├── sw.h ├── table.c ├── table.h ├── trx.c └── trx.h ├── rtl8723ae ├── Makefile ├── btc.h ├── def.h ├── dm.c ├── dm.h ├── fw.c ├── fw.h ├── hal_bt_coexist.c ├── hal_bt_coexist.h ├── hal_btc.c ├── hal_btc.h ├── hw.c ├── hw.h ├── led.c ├── led.h ├── phy.c ├── phy.h ├── pwrseq.c ├── pwrseq.h ├── reg.h ├── rf.c ├── rf.h ├── sw.c ├── sw.h ├── table.c ├── table.h ├── trx.c └── trx.h ├── rtl8723be ├── Makefile ├── def.h ├── dm.c ├── dm.h ├── fw.c ├── fw.h ├── hw.c ├── hw.h ├── led.c ├── led.h ├── phy.c ├── phy.h ├── pwrseq.c ├── pwrseq.h ├── reg.h ├── rf.c ├── rf.h ├── sw.c ├── sw.h ├── table.c ├── table.h ├── trx.c └── trx.h ├── rtl8723com ├── Makefile ├── dm_common.c ├── dm_common.h ├── fw_common.c ├── fw_common.h ├── main.c ├── phy_common.c └── phy_common.h ├── rtl8821ae ├── Makefile ├── def.h ├── dm.c ├── dm.h ├── fw.c ├── fw.h ├── hw.c ├── hw.h ├── led.c ├── led.h ├── phy.c ├── phy.h ├── pwrseq.c ├── pwrseq.h ├── reg.h ├── rf.c ├── rf.h ├── sw.c ├── sw.h ├── table.c ├── table.h ├── trx.c └── trx.h ├── rtl8822be ├── Makefile ├── def.h ├── fw.c ├── fw.h ├── hw.c ├── hw.h ├── led.c ├── led.h ├── phy.c ├── phy.h ├── reg.h ├── sw.c ├── sw.h ├── trx.c └── trx.h ├── stats.c ├── stats.h ├── usb.c ├── usb.h └── wifi.h /.gitignore: -------------------------------------------------------------------------------- 1 | # 2 | # NOTE! Don't add files that are generated in specific 3 | # subdirectories here. Add them in the ".gitignore" file 4 | # in that subdirectory instead. 5 | # 6 | # NOTE! Please use 'git ls-files -i --exclude-standard' 7 | # command after changing this file, to see if there are 8 | # any tracked files which get ignored after the change. 9 | # 10 | # Normal rules 11 | # 12 | .* 13 | *.o 14 | *.o.* 15 | *.a 16 | *.s 17 | *.ko 18 | *.so 19 | *.so.dbg 20 | *.mod.c 21 | *.i 22 | *.lst 23 | *.symtypes 24 | *.order 25 | *.elf 26 | *.bin 27 | *.tar 28 | *.gz 29 | *.bz2 30 | *.lzma 31 | *.xz 32 | *.lz4 33 | *.lzo 34 | *.patch 35 | *.gcno 36 | modules.builtin 37 | Module.symvers 38 | *.dwo 39 | *.su 40 | *.c.[012]*.* 41 | 42 | # 43 | # Top-level generic files 44 | # 45 | /tags 46 | /TAGS 47 | /linux 48 | /vmlinux 49 | /vmlinux.32 50 | /vmlinux-gdb.py 51 | /vmlinuz 52 | /System.map 53 | /Module.markers 54 | 55 | # 56 | # Debian directory (make deb-pkg) 57 | # 58 | /debian/ 59 | 60 | # 61 | # tar directory (make tar*-pkg) 62 | # 63 | /tar-install/ 64 | 65 | # 66 | # git files that we don't want to ignore even if they are dot-files 67 | # 68 | !.gitignore 69 | !.mailmap 70 | !.cocciconfig 71 | 72 | # 73 | # Generated include files 74 | # 75 | include/config 76 | include/generated 77 | arch/*/include/generated 78 | 79 | # stgit generated dirs 80 | patches-* 81 | 82 | # quilt's files 83 | patches 84 | series 85 | 86 | # cscope files 87 | cscope.* 88 | ncscope.* 89 | 90 | # gnu global files 91 | GPATH 92 | GRTAGS 93 | GSYMS 94 | GTAGS 95 | 96 | # id-utils files 97 | ID 98 | 99 | *.orig 100 | *~ 101 | \#*# 102 | 103 | # 104 | # Leavings from module signing 105 | # 106 | extra_certificates 107 | signing_key.pem 108 | signing_key.priv 109 | signing_key.x509 110 | x509.genkey 111 | 112 | # Kconfig presets 113 | all.config 114 | 115 | # Kdevelop4 116 | *.kdev4 117 | -------------------------------------------------------------------------------- /btcoexist/Makefile: -------------------------------------------------------------------------------- 1 | btcoexist-objs := halbtc8192e2ant.o \ 2 | halbtc8723b1ant.o \ 3 | halbtc8723b2ant.o \ 4 | halbtc8821a1ant.o \ 5 | halbtc8821a2ant.o \ 6 | halbtc8822bwifionly.o \ 7 | halbtcoutsrc.o \ 8 | rtl_btc.o 9 | 10 | obj-$(CONFIG_RTLBTCOEXIST) += btcoexist.o 11 | -------------------------------------------------------------------------------- /btcoexist/halbt_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 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * Larry Finger 22 | * 23 | ******************************************************************************/ 24 | 25 | #ifndef __HALBT_PRECOMP_H__ 26 | #define __HALBT_PRECOMP_H__ 27 | /************************************************************* 28 | * include files 29 | *************************************************************/ 30 | #include "../wifi.h" 31 | #include "../efuse.h" 32 | #include "../base.h" 33 | #include "../regd.h" 34 | #include "../cam.h" 35 | #include "../ps.h" 36 | #include "../pci.h" 37 | 38 | #include "halbtcoutsrc.h" 39 | 40 | #include "halbtc8192e2ant.h" 41 | #include "halbtc8723b1ant.h" 42 | #include "halbtc8723b2ant.h" 43 | #include "halbtc8821a2ant.h" 44 | #include "halbtc8821a1ant.h" 45 | #include "halbtc8822bwifionly.h" 46 | 47 | #define GetDefaultAdapter(padapter) padapter 48 | 49 | #define BIT0 0x00000001 50 | #define BIT1 0x00000002 51 | #define BIT2 0x00000004 52 | #define BIT3 0x00000008 53 | #define BIT4 0x00000010 54 | #define BIT5 0x00000020 55 | #define BIT6 0x00000040 56 | #define BIT7 0x00000080 57 | #define BIT8 0x00000100 58 | #define BIT9 0x00000200 59 | #define BIT10 0x00000400 60 | #define BIT11 0x00000800 61 | #define BIT12 0x00001000 62 | #define BIT13 0x00002000 63 | #define BIT14 0x00004000 64 | #define BIT15 0x00008000 65 | #define BIT16 0x00010000 66 | #define BIT17 0x00020000 67 | #define BIT18 0x00040000 68 | #define BIT19 0x00080000 69 | #define BIT20 0x00100000 70 | #define BIT21 0x00200000 71 | #define BIT22 0x00400000 72 | #define BIT23 0x00800000 73 | #define BIT24 0x01000000 74 | #define BIT25 0x02000000 75 | #define BIT26 0x04000000 76 | #define BIT27 0x08000000 77 | #define BIT28 0x10000000 78 | #define BIT29 0x20000000 79 | #define BIT30 0x40000000 80 | #define BIT31 0x80000000 81 | 82 | #endif /* __HALBT_PRECOMP_H__ */ 83 | -------------------------------------------------------------------------------- /btcoexist/halbtc8822bwifionly.c: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2016 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | #include "halbt_precomp.h" 26 | 27 | void ex_hal8822b_wifi_only_hw_config(struct wifi_only_cfg *wifionlycfg) 28 | { 29 | /*BB control*/ 30 | halwifionly_phy_set_bb_reg(wifionlycfg, 0x4c, 0x01800000, 0x2); 31 | /*SW control*/ 32 | halwifionly_phy_set_bb_reg(wifionlycfg, 0xcb4, 0xff, 0x77); 33 | /*antenna mux switch */ 34 | halwifionly_phy_set_bb_reg(wifionlycfg, 0x974, 0x300, 0x3); 35 | 36 | halwifionly_phy_set_bb_reg(wifionlycfg, 0x1990, 0x300, 0x0); 37 | 38 | halwifionly_phy_set_bb_reg(wifionlycfg, 0xcbc, 0x80000, 0x0); 39 | /*switch to WL side controller and gnt_wl gnt_bt debug signal */ 40 | halwifionly_phy_set_bb_reg(wifionlycfg, 0x70, 0xff000000, 0x0e); 41 | /*gnt_wl=1 , gnt_bt=0*/ 42 | halwifionly_phy_set_bb_reg(wifionlycfg, 0x1704, 0xffffffff, 0x7700); 43 | halwifionly_phy_set_bb_reg(wifionlycfg, 0x1700, 0xffffffff, 0xc00f0038); 44 | } 45 | 46 | void ex_hal8822b_wifi_only_scannotify(struct wifi_only_cfg *wifionlycfg, 47 | u8 is_5g) 48 | { 49 | hal8822b_wifi_only_switch_antenna(wifionlycfg, is_5g); 50 | } 51 | 52 | void ex_hal8822b_wifi_only_switchbandnotify(struct wifi_only_cfg *wifionlycfg, 53 | u8 is_5g) 54 | { 55 | hal8822b_wifi_only_switch_antenna(wifionlycfg, is_5g); 56 | } 57 | 58 | void hal8822b_wifi_only_switch_antenna(struct wifi_only_cfg *wifionlycfg, 59 | u8 is_5g) 60 | { 61 | if (is_5g) 62 | halwifionly_phy_set_bb_reg(wifionlycfg, 0xcbc, 0x300, 0x1); 63 | else 64 | halwifionly_phy_set_bb_reg(wifionlycfg, 0xcbc, 0x300, 0x2); 65 | } 66 | -------------------------------------------------------------------------------- /btcoexist/halbtc8822bwifionly.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2016 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | #ifndef __INC_HAL8822BWIFIONLYHWCFG_H 26 | #define __INC_HAL8822BWIFIONLYHWCFG_H 27 | 28 | void ex_hal8822b_wifi_only_hw_config(struct wifi_only_cfg *wifionlycfg); 29 | void ex_hal8822b_wifi_only_scannotify(struct wifi_only_cfg *wifionlycfg, 30 | u8 is_5g); 31 | void ex_hal8822b_wifi_only_switchbandnotify(struct wifi_only_cfg *wifionlycfg, 32 | u8 is_5g); 33 | void hal8822b_wifi_only_switch_antenna(struct wifi_only_cfg *wifionlycfg, 34 | u8 is_5g); 35 | #endif 36 | -------------------------------------------------------------------------------- /cam.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2009-2012 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | 26 | #ifndef __RTL_CAM_H_ 27 | #define __RTL_CAM_H_ 28 | 29 | #define CAM_CONTENT_COUNT 8 30 | 31 | #define CFG_VALID BIT(15) 32 | 33 | #define PAIRWISE_KEYIDX 0 34 | #define CAM_PAIRWISE_KEY_POSITION 4 35 | 36 | #define CAM_CONFIG_NO_USEDK 0 37 | 38 | void rtl_cam_reset_all_entry(struct ieee80211_hw *hw); 39 | u8 rtl_cam_add_one_entry(struct ieee80211_hw *hw, u8 *mac_addr, 40 | u32 ul_key_id, u32 ul_entry_idx, u32 ul_enc_alg, 41 | u32 ul_default_key, u8 *key_content); 42 | int rtl_cam_delete_one_entry(struct ieee80211_hw *hw, u8 *mac_addr, 43 | u32 ul_key_id); 44 | void rtl_cam_mark_invalid(struct ieee80211_hw *hw, u8 uc_index); 45 | void rtl_cam_empty_entry(struct ieee80211_hw *hw, u8 uc_index); 46 | void rtl_cam_reset_sec_info(struct ieee80211_hw *hw); 47 | u8 rtl_cam_get_free_entry(struct ieee80211_hw *hw, u8 *sta_addr); 48 | void rtl_cam_del_entry(struct ieee80211_hw *hw, u8 *sta_addr); 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /core.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2009-2012 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | 26 | #ifndef __RTL_CORE_H__ 27 | #define __RTL_CORE_H__ 28 | 29 | #define RTL_SUPPORTED_FILTERS \ 30 | (FIF_ALLMULTI | FIF_CONTROL | \ 31 | FIF_OTHER_BSS | \ 32 | FIF_FCSFAIL | \ 33 | FIF_BCN_PRBRESP_PROMISC) 34 | 35 | #define DM_DIG_THRESH_HIGH 40 36 | #define DM_DIG_THRESH_LOW 35 37 | #define DM_FALSEALARM_THRESH_LOW 400 38 | #define DM_FALSEALARM_THRESH_HIGH 1000 39 | 40 | #define DM_DIG_MAX 0x3e 41 | #define DM_DIG_MIN 0x1e 42 | #define DM_DIG_MAX_AP 0x32 43 | #define DM_DIG_BACKOFF_MAX 12 44 | #define DM_DIG_BACKOFF_MIN -4 45 | #define DM_DIG_BACKOFF_DEFAULT 10 46 | 47 | enum cck_packet_detection_threshold { 48 | CCK_PD_STAGE_LOWRSSI = 0, 49 | CCK_PD_STAGE_HIGHRSSI = 1, 50 | CCK_FA_STAGE_LOW = 2, 51 | CCK_FA_STAGE_HIGH = 3, 52 | CCK_PD_STAGE_MAX = 4, 53 | }; 54 | 55 | enum dm_dig_ext_port_alg_e { 56 | DIG_EXT_PORT_STAGE_0 = 0, 57 | DIG_EXT_PORT_STAGE_1 = 1, 58 | DIG_EXT_PORT_STAGE_2 = 2, 59 | DIG_EXT_PORT_STAGE_3 = 3, 60 | DIG_EXT_PORT_STAGE_MAX = 4, 61 | }; 62 | 63 | enum dm_dig_connect_e { 64 | DIG_STA_DISCONNECT, 65 | DIG_STA_CONNECT, 66 | DIG_STA_BEFORE_CONNECT, 67 | DIG_MULTISTA_DISCONNECT, 68 | DIG_MULTISTA_CONNECT, 69 | DIG_AP_DISCONNECT, 70 | DIG_AP_CONNECT, 71 | DIG_AP_ADD_STATION, 72 | DIG_CONNECT_MAX 73 | }; 74 | 75 | extern const struct ieee80211_ops rtl_ops; 76 | void rtl_fw_cb(const struct firmware *firmware, void *context); 77 | void rtl_wowlan_fw_cb(const struct firmware *firmware, void *context); 78 | void rtl_addr_delay(u32 addr); 79 | void rtl_rfreg_delay(struct ieee80211_hw *hw, enum radio_path rfpath, u32 addr, 80 | u32 mask, u32 data); 81 | void rtl_bb_delay(struct ieee80211_hw *hw, u32 addr, u32 data); 82 | bool rtl_cmd_send_packet(struct ieee80211_hw *hw, struct sk_buff *skb); 83 | bool rtl_btc_status_false(void); 84 | void rtl_dm_diginit(struct ieee80211_hw *hw, u32 cur_igval); 85 | 86 | #endif 87 | -------------------------------------------------------------------------------- /firmware/rtlwifi/rtl8822befw.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtlwifi-linux/rtlwifi-next/6ac0a77b8c9dac45a1d0b865954973a943068780/firmware/rtlwifi/rtl8822befw.bin -------------------------------------------------------------------------------- /halmac/Makefile: -------------------------------------------------------------------------------- 1 | 2 | 3 | halmac-objs := \ 4 | halmac_api.o \ 5 | halmac_88xx/halmac_api_88xx_usb.o \ 6 | halmac_88xx/halmac_api_88xx_sdio.o \ 7 | halmac_88xx/halmac_api_88xx.o \ 8 | halmac_88xx/halmac_api_88xx_pcie.o \ 9 | halmac_88xx/halmac_func_88xx.o \ 10 | halmac_88xx/halmac_8822b/halmac_api_8822b_pcie.o \ 11 | halmac_88xx/halmac_8822b/halmac_func_8822b.o \ 12 | halmac_88xx/halmac_8822b/halmac_api_8822b_sdio.o \ 13 | halmac_88xx/halmac_8822b/halmac_api_8822b.o \ 14 | halmac_88xx/halmac_8822b/halmac_8822b_phy.o \ 15 | halmac_88xx/halmac_8822b/halmac_8822b_pwr_seq.o \ 16 | halmac_88xx/halmac_8822b/halmac_api_8822b_usb.o \ 17 | rtl_halmac.o 18 | 19 | 20 | obj-m = halmac.o 21 | -------------------------------------------------------------------------------- /halmac/halmac_2_platform.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2016 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | #ifndef _HALMAC_2_PLATFORM_H_ 26 | #define _HALMAC_2_PLATFORM_H_ 27 | 28 | #include "../wifi.h" 29 | #include 30 | 31 | /* define the Platform SDIO Bus CLK */ 32 | #define PLATFORM_SD_CLK 50000000 /*50MHz*/ 33 | 34 | /* define the Rx FIFO expanding mode packet size unit for 8821C and 8822B */ 35 | /* Should be 8 Byte alignment */ 36 | #define HALMAC_RX_FIFO_EXPANDING_MODE_PKT_SIZE 16 /*Bytes*/ 37 | 38 | #endif /* _HALMAC_2_PLATFORM_H_ */ 39 | -------------------------------------------------------------------------------- /halmac/halmac_88xx/halmac_8822b/halmac_8822b_pwr_seq.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2016 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | #ifndef HALMAC_POWER_SEQUENCE_8822B 26 | #define HALMAC_POWER_SEQUENCE_8822B 27 | 28 | #include "../../halmac_pwr_seq_cmd.h" 29 | 30 | #define HALMAC_8822B_PWR_SEQ_VER "V17" 31 | extern struct halmac_wl_pwr_cfg_ *halmac_8822b_card_disable_flow[]; 32 | extern struct halmac_wl_pwr_cfg_ *halmac_8822b_card_enable_flow[]; 33 | extern struct halmac_wl_pwr_cfg_ *halmac_8822b_suspend_flow[]; 34 | extern struct halmac_wl_pwr_cfg_ *halmac_8822b_resume_flow[]; 35 | extern struct halmac_wl_pwr_cfg_ *halmac_8822b_hwpdn_flow[]; 36 | extern struct halmac_wl_pwr_cfg_ *halmac_8822b_enter_lps_flow[]; 37 | extern struct halmac_wl_pwr_cfg_ *halmac_8822b_enter_deep_lps_flow[]; 38 | extern struct halmac_wl_pwr_cfg_ *halmac_8822b_leave_lps_flow[]; 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /halmac/halmac_88xx/halmac_8822b/halmac_api_8822b.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2016 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | #ifndef _HALMAC_API_8822B_H_ 26 | #define _HALMAC_API_8822B_H_ 27 | 28 | #include "../../halmac_2_platform.h" 29 | #include "../../halmac_type.h" 30 | 31 | enum halmac_ret_status 32 | halmac_mount_api_8822b(struct halmac_adapter *halmac_adapter); 33 | 34 | enum halmac_ret_status 35 | halmac_init_trx_cfg_8822b(struct halmac_adapter *halmac_adapter, 36 | enum halmac_trx_mode halmac_trx_mode); 37 | 38 | enum halmac_ret_status 39 | halmac_init_protocol_cfg_8822b(struct halmac_adapter *halmac_adapter); 40 | 41 | enum halmac_ret_status 42 | halmac_init_h2c_8822b(struct halmac_adapter *halmac_adapter); 43 | 44 | #endif /* _HALMAC_API_8822B_H_ */ 45 | -------------------------------------------------------------------------------- /halmac/halmac_88xx/halmac_8822b/halmac_api_8822b_pcie.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2016 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | #ifndef _HALMAC_API_8822B_PCIE_H_ 26 | #define _HALMAC_API_8822B_PCIE_H_ 27 | 28 | #include "../../halmac_2_platform.h" 29 | #include "../../halmac_type.h" 30 | 31 | extern struct halmac_intf_phy_para_ HALMAC_RTL8822B_PCIE_PHY_GEN1[]; 32 | extern struct halmac_intf_phy_para_ HALMAC_RTL8822B_PCIE_PHY_GEN2[]; 33 | 34 | enum halmac_ret_status 35 | halmac_mac_power_switch_8822b_pcie(struct halmac_adapter *halmac_adapter, 36 | enum halmac_mac_power halmac_power); 37 | 38 | enum halmac_ret_status 39 | halmac_pcie_switch_8822b(struct halmac_adapter *halmac_adapter, 40 | enum halmac_pcie_cfg pcie_cfg); 41 | 42 | enum halmac_ret_status 43 | halmac_pcie_switch_8822b_nc(struct halmac_adapter *halmac_adapter, 44 | enum halmac_pcie_cfg pcie_cfg); 45 | 46 | enum halmac_ret_status 47 | halmac_phy_cfg_8822b_pcie(struct halmac_adapter *halmac_adapter, 48 | enum halmac_intf_phy_platform platform); 49 | 50 | enum halmac_ret_status halmac_interface_integration_tuning_8822b_pcie( 51 | struct halmac_adapter *halmac_adapter); 52 | 53 | #endif /* _HALMAC_API_8822B_PCIE_H_ */ 54 | -------------------------------------------------------------------------------- /halmac/halmac_88xx/halmac_8822b/halmac_api_8822b_sdio.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2016 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | #ifndef _HALMAC_API_8822B_SDIO_H_ 26 | #define _HALMAC_API_8822B_SDIO_H_ 27 | 28 | #include "../../halmac_2_platform.h" 29 | #include "../../halmac_type.h" 30 | 31 | enum halmac_ret_status 32 | halmac_mac_power_switch_8822b_sdio(struct halmac_adapter *halmac_adapter, 33 | enum halmac_mac_power halmac_power); 34 | 35 | enum halmac_ret_status 36 | halmac_phy_cfg_8822b_sdio(struct halmac_adapter *halmac_adapter, 37 | enum halmac_intf_phy_platform platform); 38 | 39 | enum halmac_ret_status halmac_interface_integration_tuning_8822b_sdio( 40 | struct halmac_adapter *halmac_adapter); 41 | 42 | #endif /* _HALMAC_API_8822B_SDIO_H_ */ 43 | -------------------------------------------------------------------------------- /halmac/halmac_88xx/halmac_8822b/halmac_api_8822b_usb.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2016 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | #ifndef _HALMAC_API_8822B_USB_H_ 26 | #define _HALMAC_API_8822B_USB_H_ 27 | 28 | extern struct halmac_intf_phy_para_ HALMAC_RTL8822B_USB2_PHY[]; 29 | extern struct halmac_intf_phy_para_ HALMAC_RTL8822B_USB3_PHY[]; 30 | 31 | #include "../../halmac_2_platform.h" 32 | #include "../../halmac_type.h" 33 | 34 | enum halmac_ret_status 35 | halmac_mac_power_switch_8822b_usb(struct halmac_adapter *halmac_adapter, 36 | enum halmac_mac_power halmac_power); 37 | 38 | enum halmac_ret_status 39 | halmac_phy_cfg_8822b_usb(struct halmac_adapter *halmac_adapter, 40 | enum halmac_intf_phy_platform platform); 41 | 42 | enum halmac_ret_status halmac_interface_integration_tuning_8822b_usb( 43 | struct halmac_adapter *halmac_adapter); 44 | 45 | #endif /* _HALMAC_API_8822B_USB_H_ */ 46 | -------------------------------------------------------------------------------- /halmac/halmac_88xx/halmac_8822b/halmac_func_8822b.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2016 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | #ifndef _HALMAC_FUNC_8822B_H_ 26 | #define _HALMAC_FUNC_8822B_H_ 27 | 28 | #include "../../halmac_type.h" 29 | 30 | enum halmac_ret_status 31 | halmac_txdma_queue_mapping_8822b(struct halmac_adapter *halmac_adapter, 32 | enum halmac_trx_mode halmac_trx_mode); 33 | 34 | enum halmac_ret_status 35 | halmac_priority_queue_config_8822b(struct halmac_adapter *halmac_adapter, 36 | enum halmac_trx_mode halmac_trx_mode); 37 | 38 | #endif /* _HALMAC_FUNC_8822B_H_ */ 39 | -------------------------------------------------------------------------------- /halmac/halmac_88xx/halmac_api_88xx_pcie.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2016 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | #ifndef _HALMAC_API_88XX_PCIE_H_ 26 | #define _HALMAC_API_88XX_PCIE_H_ 27 | 28 | #include "../halmac_2_platform.h" 29 | #include "../halmac_type.h" 30 | 31 | #define LINK_CTRL2_REG_OFFSET 0xA0 32 | #define GEN2_CTRL_OFFSET 0x80C 33 | #define LINK_STATUS_REG_OFFSET 0x82 34 | #define GEN1_SPEED 0x01 35 | #define GEN2_SPEED 0x02 36 | 37 | enum halmac_ret_status 38 | halmac_init_pcie_cfg_88xx(struct halmac_adapter *halmac_adapter); 39 | 40 | enum halmac_ret_status 41 | halmac_deinit_pcie_cfg_88xx(struct halmac_adapter *halmac_adapter); 42 | 43 | enum halmac_ret_status 44 | halmac_cfg_rx_aggregation_88xx_pcie(struct halmac_adapter *halmac_adapter, 45 | struct halmac_rxagg_cfg *phalmac_rxagg_cfg); 46 | 47 | u8 halmac_reg_read_8_pcie_88xx(struct halmac_adapter *halmac_adapter, 48 | u32 halmac_offset); 49 | 50 | enum halmac_ret_status 51 | halmac_reg_write_8_pcie_88xx(struct halmac_adapter *halmac_adapter, 52 | u32 halmac_offset, u8 halmac_data); 53 | 54 | u16 halmac_reg_read_16_pcie_88xx(struct halmac_adapter *halmac_adapter, 55 | u32 halmac_offset); 56 | 57 | enum halmac_ret_status 58 | halmac_reg_write_16_pcie_88xx(struct halmac_adapter *halmac_adapter, 59 | u32 halmac_offset, u16 halmac_data); 60 | 61 | u32 halmac_reg_read_32_pcie_88xx(struct halmac_adapter *halmac_adapter, 62 | u32 halmac_offset); 63 | 64 | enum halmac_ret_status 65 | halmac_reg_write_32_pcie_88xx(struct halmac_adapter *halmac_adapter, 66 | u32 halmac_offset, u32 halmac_data); 67 | 68 | enum halmac_ret_status halmac_cfg_tx_agg_align_pcie_not_support_88xx( 69 | struct halmac_adapter *halmac_adapter, u8 enable, u16 align_size); 70 | 71 | #endif /* _HALMAC_API_88XX_PCIE_H_ */ 72 | -------------------------------------------------------------------------------- /halmac/halmac_88xx/halmac_api_88xx_usb.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2016 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | #ifndef _HALMAC_API_88XX_USB_H_ 26 | #define _HALMAC_API_88XX_USB_H_ 27 | 28 | #include "../halmac_2_platform.h" 29 | #include "../halmac_type.h" 30 | 31 | enum halmac_ret_status 32 | halmac_init_usb_cfg_88xx(struct halmac_adapter *halmac_adapter); 33 | 34 | enum halmac_ret_status 35 | halmac_deinit_usb_cfg_88xx(struct halmac_adapter *halmac_adapter); 36 | 37 | enum halmac_ret_status 38 | halmac_cfg_rx_aggregation_88xx_usb(struct halmac_adapter *halmac_adapter, 39 | struct halmac_rxagg_cfg *phalmac_rxagg_cfg); 40 | 41 | u8 halmac_reg_read_8_usb_88xx(struct halmac_adapter *halmac_adapter, 42 | u32 halmac_offset); 43 | 44 | enum halmac_ret_status 45 | halmac_reg_write_8_usb_88xx(struct halmac_adapter *halmac_adapter, 46 | u32 halmac_offset, u8 halmac_data); 47 | 48 | u16 halmac_reg_read_16_usb_88xx(struct halmac_adapter *halmac_adapter, 49 | u32 halmac_offset); 50 | 51 | enum halmac_ret_status 52 | halmac_reg_write_16_usb_88xx(struct halmac_adapter *halmac_adapter, 53 | u32 halmac_offset, u16 halmac_data); 54 | 55 | u32 halmac_reg_read_32_usb_88xx(struct halmac_adapter *halmac_adapter, 56 | u32 halmac_offset); 57 | 58 | enum halmac_ret_status 59 | halmac_reg_write_32_usb_88xx(struct halmac_adapter *halmac_adapter, 60 | u32 halmac_offset, u32 halmac_data); 61 | 62 | enum halmac_ret_status 63 | halmac_set_bulkout_num_88xx(struct halmac_adapter *halmac_adapter, 64 | u8 bulkout_num); 65 | 66 | enum halmac_ret_status 67 | halmac_get_usb_bulkout_id_88xx(struct halmac_adapter *halmac_adapter, 68 | u8 *halmac_buf, u32 halmac_size, u8 *bulkout_id); 69 | 70 | enum halmac_ret_status halmac_cfg_tx_agg_align_usb_not_support_88xx( 71 | struct halmac_adapter *halmac_adapter, u8 enable, u16 align_size); 72 | 73 | #endif /* _HALMAC_API_88XX_USB_H_ */ 74 | -------------------------------------------------------------------------------- /halmac/halmac_api.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2016 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | #ifndef _HALMAC_API_H_ 26 | #define _HALMAC_API_H_ 27 | 28 | #define HALMAC_SVN_VER "13348M" 29 | 30 | #define HALMAC_MAJOR_VER 0x0001 /* major version, ver_1 for async_api */ 31 | /* For halmac_api num change or prototype change, increment prototype version. 32 | * Otherwise, increase minor version 33 | */ 34 | #define HALMAC_PROTOTYPE_VER 0x0003 /* prototype version */ 35 | #define HALMAC_MINOR_VER 0x0005 /* minor version */ 36 | #define HALMAC_PATCH_VER 0x0000 /* patch version */ 37 | 38 | #include "halmac_2_platform.h" 39 | #include "halmac_type.h" 40 | 41 | #include "halmac_usb_reg.h" 42 | #include "halmac_sdio_reg.h" 43 | #include "halmac_pcie_reg.h" 44 | 45 | #include "halmac_bit2.h" 46 | #include "halmac_reg2.h" 47 | 48 | #include "halmac_tx_desc_nic.h" 49 | #include "halmac_rx_desc_nic.h" 50 | #include "halmac_tx_bd_nic.h" 51 | #include "halmac_rx_bd_nic.h" 52 | #include "halmac_fw_offload_c2h_nic.h" 53 | #include "halmac_fw_offload_h2c_nic.h" 54 | #include "halmac_h2c_extra_info_nic.h" 55 | #include "halmac_original_c2h_nic.h" 56 | #include "halmac_original_h2c_nic.h" 57 | 58 | #include "halmac_tx_desc_chip.h" 59 | #include "halmac_rx_desc_chip.h" 60 | #include "halmac_tx_bd_chip.h" 61 | #include "halmac_rx_bd_chip.h" 62 | #include "halmac_88xx/halmac_88xx_cfg.h" 63 | 64 | #include "halmac_88xx/halmac_8822b/halmac_8822b_cfg.h" 65 | #include "halmac_reg_8822b.h" 66 | #include "halmac_bit_8822b.h" 67 | 68 | enum halmac_ret_status 69 | halmac_init_adapter(void *driver_adapter, 70 | struct halmac_platform_api *halmac_platform_api, 71 | enum halmac_interface halmac_interface, 72 | struct halmac_adapter **pp_halmac_adapter, 73 | struct halmac_api **pp_halmac_api); 74 | 75 | enum halmac_ret_status 76 | halmac_deinit_adapter(struct halmac_adapter *halmac_adapter); 77 | 78 | enum halmac_ret_status halmac_halt_api(struct halmac_adapter *halmac_adapter); 79 | 80 | enum halmac_ret_status halmac_get_version(struct halmac_ver *version); 81 | 82 | #endif 83 | -------------------------------------------------------------------------------- /halmac/halmac_intf_phy_cmd.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2016 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | #ifndef HALMAC_INTF_PHY_CMD 26 | #define HALMAC_INTF_PHY_CMD 27 | 28 | /* Cut mask */ 29 | enum halmac_intf_phy_cut { 30 | HALMAC_INTF_PHY_CUT_TESTCHIP = BIT(0), 31 | HALMAC_INTF_PHY_CUT_A = BIT(1), 32 | HALMAC_INTF_PHY_CUT_B = BIT(2), 33 | HALMAC_INTF_PHY_CUT_C = BIT(3), 34 | HALMAC_INTF_PHY_CUT_D = BIT(4), 35 | HALMAC_INTF_PHY_CUT_E = BIT(5), 36 | HALMAC_INTF_PHY_CUT_F = BIT(6), 37 | HALMAC_INTF_PHY_CUT_G = BIT(7), 38 | HALMAC_INTF_PHY_CUT_ALL = 0x7FFF, 39 | }; 40 | 41 | /* IP selection */ 42 | enum halmac_ip_sel { 43 | HALMAC_IP_SEL_INTF_PHY = 0, 44 | HALMAC_IP_SEL_MAC = 1, 45 | HALMAC_IP_SEL_PCIE_DBI = 2, 46 | HALMAC_IP_SEL_UNDEFINE = 0x7FFF, 47 | }; 48 | 49 | /* Platform mask */ 50 | enum halmac_intf_phy_platform { 51 | HALMAC_INTF_PHY_PLATFORM_ALL = 0x7FFF, 52 | }; 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /halmac/halmac_pcie_reg.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2016 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | #ifndef __HALMAC_PCIE_REG_H__ 26 | #define __HALMAC_PCIE_REG_H__ 27 | 28 | #endif /* __HALMAC_PCIE_REG_H__ */ 29 | -------------------------------------------------------------------------------- /halmac/halmac_rx_bd_chip.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2016 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | #ifndef _HALMAC_RX_BD_CHIP_H_ 26 | #define _HALMAC_RX_BD_CHIP_H_ 27 | 28 | /*TXBD_DW0*/ 29 | 30 | #define GET_RX_BD_RXFAIL_8822B(__rx_bd) GET_RX_BD_RXFAIL(__rx_bd) 31 | #define GET_RX_BD_TOTALRXPKTSIZE_8822B(__rx_bd) \ 32 | GET_RX_BD_TOTALRXPKTSIZE(__rx_bd) 33 | #define GET_RX_BD_RXTAG_8822B(__rx_bd) GET_RX_BD_RXTAG(__rx_bd) 34 | #define GET_RX_BD_FS_8822B(__rx_bd) GET_RX_BD_FS(__rx_bd) 35 | #define GET_RX_BD_LS_8822B(__rx_bd) GET_RX_BD_LS(__rx_bd) 36 | #define GET_RX_BD_RXBUFFSIZE_8822B(__rx_bd) GET_RX_BD_RXBUFFSIZE(__rx_bd) 37 | 38 | /*TXBD_DW1*/ 39 | 40 | #define GET_RX_BD_PHYSICAL_ADDR_LOW_8822B(__rx_bd) \ 41 | GET_RX_BD_PHYSICAL_ADDR_LOW(__rx_bd) 42 | 43 | /*TXBD_DW2*/ 44 | 45 | #define GET_RX_BD_PHYSICAL_ADDR_HIGH_8822B(__rx_bd) \ 46 | GET_RX_BD_PHYSICAL_ADDR_HIGH(__rx_bd) 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /halmac/halmac_rx_bd_nic.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2016 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | #ifndef _HALMAC_RX_BD_NIC_H_ 26 | #define _HALMAC_RX_BD_NIC_H_ 27 | 28 | /*TXBD_DW0*/ 29 | 30 | #define GET_RX_BD_RXFAIL(__rx_bd) LE_BITS_TO_4BYTE(__rx_bd + 0x00, 31, 1) 31 | #define GET_RX_BD_TOTALRXPKTSIZE(__rx_bd) \ 32 | LE_BITS_TO_4BYTE(__rx_bd + 0x00, 16, 13) 33 | #define GET_RX_BD_RXTAG(__rx_bd) LE_BITS_TO_4BYTE(__rx_bd + 0x00, 16, 13) 34 | #define GET_RX_BD_FS(__rx_bd) LE_BITS_TO_4BYTE(__rx_bd + 0x00, 15, 1) 35 | #define GET_RX_BD_LS(__rx_bd) LE_BITS_TO_4BYTE(__rx_bd + 0x00, 14, 1) 36 | #define GET_RX_BD_RXBUFFSIZE(__rx_bd) LE_BITS_TO_4BYTE(__rx_bd + 0x00, 0, 14) 37 | 38 | /*TXBD_DW1*/ 39 | 40 | #define GET_RX_BD_PHYSICAL_ADDR_LOW(__rx_bd) \ 41 | LE_BITS_TO_4BYTE(__rx_bd + 0x04, 0, 32) 42 | 43 | /*TXBD_DW2*/ 44 | 45 | #define GET_RX_BD_PHYSICAL_ADDR_HIGH(__rx_bd) \ 46 | LE_BITS_TO_4BYTE(__rx_bd + 0x08, 0, 32) 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /halmac/halmac_sdio_reg.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2016 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | #ifndef __HALMAC_SDIO_REG_H__ 26 | #define __HALMAC_SDIO_REG_H__ 27 | 28 | /* SDIO CMD address mapping */ 29 | 30 | #define HALMAC_SDIO_4BYTE_LEN_MASK 0x1FFF 31 | #define HALMAC_SDIO_LOCAL_MSK 0x0FFF 32 | #define HALMAC_WLAN_MAC_REG_MSK 0xFFFF 33 | #define HALMAC_WLAN_IOREG_MSK 0xFFFF 34 | 35 | /* Sdio address for SDIO Local Reg, TRX FIFO, MAC Reg */ 36 | enum halmac_sdio_cmd_addr { 37 | HALMAC_SDIO_CMD_ADDR_SDIO_REG = 0, 38 | HALMAC_SDIO_CMD_ADDR_MAC_REG = 8, 39 | HALMAC_SDIO_CMD_ADDR_TXFF_HIGH = 4, 40 | HALMAC_SDIO_CMD_ADDR_TXFF_LOW = 6, 41 | HALMAC_SDIO_CMD_ADDR_TXFF_NORMAL = 5, 42 | HALMAC_SDIO_CMD_ADDR_TXFF_EXTRA = 7, 43 | HALMAC_SDIO_CMD_ADDR_RXFF = 7, 44 | }; 45 | 46 | /* IO Bus domain address mapping */ 47 | #define SDIO_LOCAL_OFFSET 0x10250000 48 | #define WLAN_IOREG_OFFSET 0x10260000 49 | #define FW_FIFO_OFFSET 0x10270000 50 | #define TX_HIQ_OFFSET 0x10310000 51 | #define TX_MIQ_OFFSET 0x10320000 52 | #define TX_LOQ_OFFSET 0x10330000 53 | #define TX_EXQ_OFFSET 0x10350000 54 | #define RX_RXOFF_OFFSET 0x10340000 55 | 56 | /* Get TX WLAN FIFO information in CMD53 addr */ 57 | #define GET_WLAN_TXFF_DEVICE_ID(__cmd53_addr) \ 58 | LE_BITS_TO_4BYTE((u32 *)__cmd53_addr, 13, 4) 59 | #define GET_WLAN_TXFF_PKT_SIZE(__cmd53_addr) \ 60 | (LE_BITS_TO_4BYTE((u32 *)__cmd53_addr, 0, 13) << 2) 61 | 62 | #endif /* __HALMAC_SDIO_REG_H__ */ 63 | -------------------------------------------------------------------------------- /halmac/halmac_usb_reg.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2016 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | #ifndef __HALMAC_USB_REG_H__ 26 | #define __HALMAC_USB_REG_H__ 27 | 28 | #endif /* __HALMAC_USB_REG_H__ */ 29 | -------------------------------------------------------------------------------- /phydm/Makefile: -------------------------------------------------------------------------------- 1 | ccflags-y += -I$(src)/ 2 | 3 | phydm_mod-objs := \ 4 | phydm_debug.o \ 5 | phydm_antdiv.o\ 6 | phydm_interface.o\ 7 | phydm_hwconfig.o\ 8 | phydm.o\ 9 | halphyrf_ce.o\ 10 | phydm_edcaturbocheck.o\ 11 | phydm_dig.o\ 12 | phydm_rainfo.o\ 13 | phydm_dynamicbbpowersaving.o\ 14 | phydm_powertracking_ce.o\ 15 | phydm_dynamictxpower.o\ 16 | phydm_adaptivity.o\ 17 | phydm_cfotracking.o\ 18 | phydm_noisemonitor.o\ 19 | phydm_acs.o\ 20 | phydm_psd.o\ 21 | phydm_adc_sampling.o\ 22 | phydm_kfree.o\ 23 | phydm_ccx.o 24 | 25 | phydm_mod-objs += \ 26 | rtl8822b/halhwimg8822b_bb.o\ 27 | rtl8822b/halhwimg8822b_mac.o\ 28 | rtl8822b/halhwimg8822b_rf.o\ 29 | rtl8822b/halphyrf_8822b.o\ 30 | rtl8822b/phydm_hal_api8822b.o\ 31 | rtl8822b/phydm_iqk_8822b.o\ 32 | rtl8822b/phydm_regconfig8822b.o\ 33 | rtl8822b/phydm_rtl8822b.o 34 | 35 | phydm_mod-objs += \ 36 | rtl_phydm.o 37 | 38 | obj-m = phydm_mod.o 39 | -------------------------------------------------------------------------------- /phydm/halphyrf_ce.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2016 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | 26 | #ifndef __HAL_PHY_RF_H__ 27 | #define __HAL_PHY_RF_H__ 28 | 29 | #include "phydm_kfree.h" 30 | 31 | #include "rtl8822b/phydm_iqk_8822b.h" 32 | 33 | #include "phydm_powertracking_ce.h" 34 | 35 | enum spur_cal_method { PLL_RESET, AFE_PHASE_SEL }; 36 | 37 | enum pwrtrack_method { 38 | BBSWING, 39 | TXAGC, 40 | MIX_MODE, 41 | TSSI_MODE, 42 | MIX_2G_TSSI_5G_MODE, 43 | MIX_5G_TSSI_2G_MODE 44 | }; 45 | 46 | typedef void (*func_set_pwr)(void *, enum pwrtrack_method, u8, u8); 47 | typedef void (*func_iqk)(void *, u8, u8, u8); 48 | typedef void (*func_lck)(void *); 49 | typedef void (*func_swing)(void *, u8 **, u8 **, u8 **, u8 **); 50 | typedef void (*func_swing8814only)(void *, u8 **, u8 **, u8 **, u8 **); 51 | typedef void (*func_swing_xtal)(void *, s8 **, s8 **); 52 | typedef void (*func_set_xtal)(void *); 53 | 54 | struct txpwrtrack_cfg { 55 | u8 swing_table_size_cck; 56 | u8 swing_table_size_ofdm; 57 | u8 threshold_iqk; 58 | u8 threshold_dpk; 59 | u8 average_thermal_num; 60 | u8 rf_path_count; 61 | u32 thermal_reg_addr; 62 | func_set_pwr odm_tx_pwr_track_set_pwr; 63 | func_iqk do_iqk; 64 | func_lck phy_lc_calibrate; 65 | func_swing get_delta_swing_table; 66 | func_swing8814only get_delta_swing_table8814only; 67 | func_swing_xtal get_delta_swing_xtal_table; 68 | func_set_xtal odm_txxtaltrack_set_xtal; 69 | }; 70 | 71 | void configure_txpower_track(void *dm_void, struct txpwrtrack_cfg *config); 72 | 73 | void odm_clear_txpowertracking_state(void *dm_void); 74 | 75 | void odm_txpowertracking_callback_thermal_meter(void *dm); 76 | 77 | #define ODM_TARGET_CHNL_NUM_2G_5G 59 78 | 79 | void odm_reset_iqk_result(void *dm_void); 80 | u8 odm_get_right_chnl_place_for_iqk(u8 chnl); 81 | 82 | void phydm_rf_init(void *dm_void); 83 | void phydm_rf_watchdog(void *dm_void); 84 | 85 | #endif /* #ifndef __HAL_PHY_RF_H__ */ 86 | -------------------------------------------------------------------------------- /phydm/mp_precomp.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2016 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | -------------------------------------------------------------------------------- /phydm/phydm_acs.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2016 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | 26 | #ifndef __PHYDMACS_H__ 27 | #define __PHYDMACS_H__ 28 | 29 | #define ACS_VERSION "1.1" /*20150729 by YuChen*/ 30 | #define CLM_VERSION "1.0" 31 | 32 | #define ODM_MAX_CHANNEL_2G 14 33 | #define ODM_MAX_CHANNEL_5G 24 34 | 35 | /* For phydm_auto_channel_select_setting_ap() */ 36 | #define STORE_DEFAULT_NHM_SETTING 0 37 | #define RESTORE_DEFAULT_NHM_SETTING 1 38 | #define ACS_NHM_SETTING 2 39 | 40 | struct acs_info { 41 | bool is_force_acs_result; 42 | u8 clean_channel_2g; 43 | u8 clean_channel_5g; 44 | /* channel_info[1]: channel score, channel_info[2]:channel_scan_times */ 45 | u16 channel_info_2g[2][ODM_MAX_CHANNEL_2G]; 46 | u16 channel_info_5g[2][ODM_MAX_CHANNEL_5G]; 47 | }; 48 | 49 | void odm_auto_channel_select_init(void *dm_void); 50 | 51 | void odm_auto_channel_select_reset(void *dm_void); 52 | 53 | void odm_auto_channel_select(void *dm_void, u8 channel); 54 | 55 | u8 odm_get_auto_channel_select_result(void *dm_void, u8 band); 56 | 57 | #endif /* #ifndef __PHYDMACS_H__ */ 58 | -------------------------------------------------------------------------------- /phydm/phydm_adc_sampling.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2016 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | #ifndef __INC_ADCSMP_H 26 | #define __INC_ADCSMP_H 27 | 28 | #define DYNAMIC_LA_MODE "1.0" /*2016.07.15 Dino */ 29 | 30 | struct rt_adcsmp_string { 31 | u32 *octet; 32 | u32 length; 33 | u32 buffer_size; 34 | u32 start_pos; 35 | }; 36 | 37 | enum rt_adcsmp_trig_sel { 38 | PHYDM_ADC_BB_TRIG = 0, 39 | PHYDM_ADC_MAC_TRIG = 1, 40 | PHYDM_ADC_RF0_TRIG = 2, 41 | PHYDM_ADC_RF1_TRIG = 3, 42 | PHYDM_MAC_TRIG = 4 43 | }; 44 | 45 | enum rt_adcsmp_trig_sig_sel { 46 | ADCSMP_TRIG_CRCOK = 0, 47 | ADCSMP_TRIG_CRCFAIL = 1, 48 | ADCSMP_TRIG_CCA = 2, 49 | ADCSMP_TRIG_REG = 3 50 | }; 51 | 52 | enum rt_adcsmp_state { 53 | ADCSMP_STATE_IDLE = 0, 54 | ADCSMP_STATE_SET = 1, 55 | ADCSMP_STATE_QUERY = 2 56 | }; 57 | 58 | struct rt_adcsmp { 59 | struct rt_adcsmp_string adc_smp_buf; 60 | enum rt_adcsmp_state adc_smp_state; 61 | u8 la_trig_mode; 62 | u32 la_trig_sig_sel; 63 | u8 la_dma_type; 64 | u32 la_trigger_time; 65 | u32 la_mac_ref_mask; 66 | u32 la_dbg_port; 67 | u8 la_trigger_edge; 68 | u8 la_smp_rate; 69 | u32 la_count; 70 | u8 is_bb_trigger; 71 | u8 la_work_item_index; 72 | }; 73 | 74 | void adc_smp_set(void *dm_void, u8 trig_mode, u32 trig_sig_sel, 75 | u8 dma_data_sig_sel, u32 trigger_time, u16 polling_time); 76 | 77 | void adc_smp_query(void *dm_void, void *output, u32 out_len, u32 *pused); 78 | 79 | s32 adc_smp_get_sample_counts(void *dm_void); 80 | 81 | s32 adc_smp_query_single_data(void *dm_void, void *output, u32 out_len, 82 | u32 index); 83 | 84 | void adc_smp_stop(void *dm_void); 85 | 86 | void adc_smp_init(void *dm_void); 87 | 88 | void adc_smp_de_init(void *dm_void); 89 | 90 | void phydm_la_mode_bb_setting(void *dm_void); 91 | 92 | void phydm_la_mode_set_trigger_time(void *dm_void, u32 trigger_time_mu_sec); 93 | 94 | void phydm_lamode_trigger_setting(void *dm_void, char input[][16], u32 *_used, 95 | char *output, u32 *_out_len, u32 input_num); 96 | #endif 97 | -------------------------------------------------------------------------------- /phydm/phydm_beamforming.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2016 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | #ifndef __INC_PHYDM_BEAMFORMING_H 26 | #define __INC_PHYDM_BEAMFORMING_H 27 | 28 | /*Beamforming Related*/ 29 | #include "txbf/halcomtxbf.h" 30 | #include "txbf/haltxbfjaguar.h" 31 | #include "txbf/haltxbf8822b.h" 32 | #include "txbf/haltxbfinterface.h" 33 | 34 | #define beamforming_gid_paid(adapter, tcb) 35 | #define phydm_acting_determine(dm, type) false 36 | #define beamforming_enter(dm, sta_idx) 37 | #define beamforming_leave(dm, RA) 38 | #define beamforming_end_fw(dm) 39 | #define beamforming_control_v1(dm, RA, AID, mode, BW, rate) true 40 | #define beamforming_control_v2(dm, idx, mode, BW, period) true 41 | #define phydm_beamforming_end_sw(dm, _status) 42 | #define beamforming_timer_callback(dm) 43 | #define phydm_beamforming_init(dm) 44 | #define phydm_beamforming_control_v2(dm, _idx, _mode, _BW, _period) false 45 | #define beamforming_watchdog(dm) 46 | #define phydm_beamforming_watchdog(dm) 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /phydm/phydm_ccx.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2016 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | #ifndef __PHYDMCCX_H__ 26 | #define __PHYDMCCX_H__ 27 | 28 | #define CCX_EN 1 29 | 30 | #define SET_NHM_SETTING 0 31 | #define STORE_NHM_SETTING 1 32 | #define RESTORE_NHM_SETTING 2 33 | 34 | enum nhm_inexclude_cca { NHM_EXCLUDE_CCA, NHM_INCLUDE_CCA }; 35 | 36 | enum nhm_inexclude_txon { NHM_EXCLUDE_TXON, NHM_INCLUDE_TXON }; 37 | 38 | struct ccx_info { 39 | /*Settings*/ 40 | u8 NHM_th[11]; 41 | u16 NHM_period; /* 4us per unit */ 42 | u16 CLM_period; /* 4us per unit */ 43 | enum nhm_inexclude_txon nhm_inexclude_txon; 44 | enum nhm_inexclude_cca nhm_inexclude_cca; 45 | 46 | /*Previous Settings*/ 47 | u8 NHM_th_restore[11]; 48 | u16 NHM_period_restore; /* 4us per unit */ 49 | u16 CLM_period_restore; /* 4us per unit */ 50 | enum nhm_inexclude_txon NHM_inexclude_txon_restore; 51 | enum nhm_inexclude_cca NHM_inexclude_cca_restore; 52 | 53 | /*Report*/ 54 | u8 NHM_result[12]; 55 | u16 NHM_duration; 56 | u16 CLM_result; 57 | 58 | bool echo_NHM_en; 59 | bool echo_CLM_en; 60 | u8 echo_IGI; 61 | }; 62 | 63 | /*NHM*/ 64 | 65 | void phydm_nhm_setting(void *dm_void, u8 nhm_setting); 66 | 67 | void phydm_nhm_trigger(void *dm_void); 68 | 69 | void phydm_get_nhm_result(void *dm_void); 70 | 71 | bool phydm_check_nhm_ready(void *dm_void); 72 | 73 | /*CLM*/ 74 | 75 | void phydm_clm_setting(void *dm_void); 76 | 77 | void phydm_clm_trigger(void *dm_void); 78 | 79 | bool phydm_check_cl_mready(void *dm_void); 80 | 81 | void phydm_get_cl_mresult(void *dm_void); 82 | 83 | #endif 84 | -------------------------------------------------------------------------------- /phydm/phydm_cfotracking.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2016 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | 26 | #ifndef __PHYDMCFOTRACK_H__ 27 | #define __PHYDMCFOTRACK_H__ 28 | 29 | #define CFO_TRACKING_VERSION "1.4" /*2015.10.01 Stanley, Modify for 8822B*/ 30 | 31 | #define CFO_TH_XTAL_HIGH 20 /* kHz */ 32 | #define CFO_TH_XTAL_LOW 10 /* kHz */ 33 | #define CFO_TH_ATC 80 /* kHz */ 34 | 35 | struct cfo_tracking { 36 | bool is_atc_status; 37 | bool large_cfo_hit; 38 | bool is_adjust; 39 | u8 crystal_cap; 40 | u8 def_x_cap; 41 | s32 CFO_tail[4]; 42 | u32 CFO_cnt[4]; 43 | s32 CFO_ave_pre; 44 | u32 packet_count; 45 | u32 packet_count_pre; 46 | 47 | bool is_force_xtal_cap; 48 | bool is_reset; 49 | }; 50 | 51 | void odm_cfo_tracking_reset(void *dm_void); 52 | 53 | void odm_cfo_tracking_init(void *dm_void); 54 | 55 | void odm_cfo_tracking(void *dm_void); 56 | 57 | void odm_parsing_cfo(void *dm_void, void *pktinfo_void, s8 *pcfotail, 58 | u8 num_ss); 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /phydm/phydm_dfs.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2016 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | 26 | #ifndef __PHYDM_DFS_H__ 27 | #define __PHYDM_DFS_H__ 28 | 29 | #define DFS_VERSION "0.0" 30 | 31 | /* ============================================================ 32 | * Definition 33 | * ============================================================ 34 | */ 35 | 36 | /* ============================================================ 37 | * 1 structure 38 | * ============================================================ 39 | */ 40 | 41 | /* ============================================================ 42 | * enumeration 43 | * ============================================================ 44 | */ 45 | 46 | enum phydm_dfs_region_domain { 47 | PHYDM_DFS_DOMAIN_UNKNOWN = 0, 48 | PHYDM_DFS_DOMAIN_FCC = 1, 49 | PHYDM_DFS_DOMAIN_MKK = 2, 50 | PHYDM_DFS_DOMAIN_ETSI = 3, 51 | }; 52 | 53 | /* ============================================================ 54 | * function prototype 55 | * ============================================================ 56 | */ 57 | #define phydm_dfs_master_enabled(dm) false 58 | 59 | #endif /*#ifndef __PHYDM_DFS_H__ */ 60 | -------------------------------------------------------------------------------- /phydm/phydm_dynamic_rx_path.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2016 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | 26 | #ifndef __PHYDMDYMICRXPATH_H__ 27 | #define __PHYDMDYMICRXPATH_H__ 28 | 29 | #define DYNAMIC_RX_PATH_VERSION "1.0" /*2016.07.15 Dino */ 30 | 31 | #define DRP_RSSI_TH 35 32 | 33 | #define INIT_DRP_TIMMER 0 34 | #define CANCEL_DRP_TIMMER 1 35 | #define RELEASE_DRP_TIMMER 2 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /phydm/phydm_dynamicbbpowersaving.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2016 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | 26 | #ifndef __PHYDMDYNAMICBBPOWERSAVING_H__ 27 | #define __PHYDMDYNAMICBBPOWERSAVING_H__ 28 | 29 | #define DYNAMIC_BBPWRSAV_VERSION "1.1" 30 | 31 | struct dyn_pwr_saving { 32 | u8 pre_cca_state; 33 | u8 cur_cca_state; 34 | 35 | u8 pre_rf_state; 36 | u8 cur_rf_state; 37 | 38 | int rssi_val_min; 39 | 40 | u8 initialize; 41 | u32 reg874, regc70, reg85c, rega74; 42 | }; 43 | 44 | #define dm_rf_saving odm_rf_saving 45 | 46 | void odm_rf_saving(void *dm_void, u8 is_force_in_normal); 47 | 48 | void odm_dynamic_bb_power_saving_init(void *dm_void); 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /phydm/phydm_dynamictxpower.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2016 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | 26 | #ifndef __PHYDMDYNAMICTXPOWER_H__ 27 | #define __PHYDMDYNAMICTXPOWER_H__ 28 | 29 | /*#define DYNAMIC_TXPWR_VERSION "1.0"*/ 30 | /*#define DYNAMIC_TXPWR_VERSION "1.3" */ /*2015.08.26, Add 8814 Dynamic TX pwr*/ 31 | #define DYNAMIC_TXPWR_VERSION "1.4" /*2015.11.06,Add CE 8821A Dynamic TX pwr*/ 32 | 33 | #define TX_POWER_NEAR_FIELD_THRESH_LVL2 74 34 | #define TX_POWER_NEAR_FIELD_THRESH_LVL1 60 35 | 36 | #define tx_high_pwr_level_normal 0 37 | #define tx_high_pwr_level_level1 1 38 | #define tx_high_pwr_level_level2 2 39 | 40 | #define tx_high_pwr_level_bt1 3 41 | #define tx_high_pwr_level_bt2 4 42 | #define tx_high_pwr_level_15 5 43 | #define tx_high_pwr_level_35 6 44 | #define tx_high_pwr_level_50 7 45 | #define tx_high_pwr_level_70 8 46 | #define tx_high_pwr_level_100 9 47 | 48 | void odm_dynamic_tx_power_init(void *dm_void); 49 | 50 | void odm_dynamic_tx_power_restore_power_index(void *dm_void); 51 | 52 | void odm_dynamic_tx_power_nic(void *dm_void); 53 | 54 | void odm_dynamic_tx_power_save_power_index(void *dm_void); 55 | 56 | void odm_dynamic_tx_power_write_power_index(void *dm_void, u8 value); 57 | 58 | void odm_dynamic_tx_power_8821(void *dm_void, u8 *desc, u8 mac_id); 59 | 60 | void odm_dynamic_tx_power(void *dm_void); 61 | 62 | void odm_dynamic_tx_power_ap(void *dm_void); 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /phydm/phydm_edcaturbocheck.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2016 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | 26 | #ifndef __PHYDMEDCATURBOCHECK_H__ 27 | #define __PHYDMEDCATURBOCHECK_H__ 28 | 29 | /*#define EDCATURBO_VERSION "2.1"*/ 30 | #define EDCATURBO_VERSION "2.3" /*2015.07.29 by YuChen*/ 31 | 32 | struct edca_turbo { 33 | bool is_current_turbo_edca; 34 | bool is_cur_rdl_state; 35 | 36 | u32 prv_traffic_idx; /* edca turbo */ 37 | }; 38 | 39 | void odm_edca_turbo_check(void *dm_void); 40 | void odm_edca_turbo_init(void *dm_void); 41 | 42 | void odm_edca_turbo_check_ce(void *dm_void); 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /phydm/phydm_features.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2016 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | 26 | #ifndef __PHYDM_FEATURES_H__ 27 | #define __PHYDM_FEATURES 28 | 29 | /*phydm debyg report & tools*/ 30 | 31 | /*Antenna Diversity*/ 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /phydm/phydm_iqk.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2016 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | 26 | #ifndef __PHYDMIQK_H__ 27 | #define __PHYDMIQK_H__ 28 | 29 | /*--------------------------Define Parameters-------------------------------*/ 30 | #define LOK_delay 1 31 | #define WBIQK_delay 10 32 | #define TX_IQK 0 33 | #define RX_IQK 1 34 | #define TXIQK 0 35 | #define RXIQK1 1 36 | #define RXIQK2 2 37 | #define GSRXK1 0 38 | #define GSRXK2 1 39 | #define kcount_limit_80m 2 40 | #define kcount_limit_others 4 41 | #define rxiqk_gs_limit 4 42 | 43 | #define NUM 4 44 | /*----------------------End Define Parameters-------------------------------*/ 45 | 46 | struct dm_iqk_info { 47 | bool lok_fail[NUM]; 48 | bool iqk_fail[2][NUM]; 49 | u32 iqc_matrix[2][NUM]; 50 | u8 iqk_times; 51 | u32 rf_reg18; 52 | u32 lna_idx; 53 | u8 rxiqk_step; 54 | u8 tmp1bcc; 55 | u8 kcount; 56 | 57 | u32 iqk_channel[2]; 58 | bool iqk_fail_report[2][4][2]; /*channel/path/TRX(TX:0, RX:1) */ 59 | u32 iqk_cfir_real[2][4][2] 60 | [8]; /*channel / path / TRX(TX:0, RX:1) / CFIR_real*/ 61 | u32 iqk_cfir_imag[2][4][2] 62 | [8]; /*channel / path / TRX(TX:0, RX:1) / CFIR_imag*/ 63 | u8 retry_count[2][4][3]; /* channel / path / (TXK:0, RXK1:1, RXK2:2) */ 64 | u8 gs_retry_count[2][4][2]; /* channel / path / (GSRXK1:0, GSRXK2:1) */ 65 | u8 rxiqk_fail_code[2][4]; /* channel / path 66 | * 0:SRXK1 fail, 1:RXK1 fail 2:RXK2 fail 67 | */ 68 | u32 lok_idac[2][4]; /*channel / path*/ 69 | u16 rxiqk_agc[2][4]; /*channel / path*/ 70 | u32 bypass_iqk[2][4]; /*channel / 0xc94/0xe94*/ 71 | u32 tmp_gntwl; 72 | bool is_btg; 73 | bool isbnd; 74 | }; 75 | 76 | #endif 77 | -------------------------------------------------------------------------------- /phydm/phydm_kfree.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2016 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | 26 | #ifndef __PHYDMKFREE_H__ 27 | #define __PHYDKFREE_H__ 28 | 29 | #define KFREE_VERSION "1.0" 30 | 31 | enum phydm_kfree_channeltosw { 32 | PHYDM_2G = 0, 33 | PHYDM_5GLB1 = 1, 34 | PHYDM_5GLB2 = 2, 35 | PHYDM_5GMB1 = 3, 36 | PHYDM_5GMB2 = 4, 37 | PHYDM_5GHB = 5, 38 | }; 39 | 40 | void phydm_config_kfree(void *dm_void, u8 channel_to_sw, u8 *kfree_table); 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /phydm/phydm_noisemonitor.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2016 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | #ifndef __ODMNOISEMONITOR_H__ 26 | #define __ODMNOISEMONITOR_H__ 27 | 28 | #define ODM_MAX_CHANNEL_NUM 38 /* 14+24 */ 29 | struct noise_level { 30 | u8 value[MAX_RF_PATH]; 31 | s8 sval[MAX_RF_PATH]; 32 | 33 | s32 sum[MAX_RF_PATH]; 34 | u8 valid[MAX_RF_PATH]; 35 | u8 valid_cnt[MAX_RF_PATH]; 36 | }; 37 | 38 | struct odm_noise_monitor { 39 | s8 noise[MAX_RF_PATH]; 40 | s16 noise_all; 41 | }; 42 | 43 | s16 odm_inband_noise_monitor(void *dm_void, u8 is_pause_dig, u8 igi_value, 44 | u32 max_time); 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /phydm/phydm_precomp.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2016 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | 26 | #ifndef __ODM_PRECOMP_H__ 27 | #define __ODM_PRECOMP_H__ 28 | 29 | #include "phydm_types.h" 30 | 31 | /* 2 Config Flags and Structs - defined by each ODM type */ 32 | 33 | #include "../wifi.h" 34 | #include "rtl_phydm.h" 35 | 36 | /* 2 OutSrc Header Files */ 37 | 38 | #include "phydm.h" 39 | #include "phydm_hwconfig.h" 40 | #include "phydm_debug.h" 41 | #include "phydm_regdefine11ac.h" 42 | #include "phydm_regdefine11n.h" 43 | #include "phydm_interface.h" 44 | #include "phydm_reg.h" 45 | 46 | #include "phydm_adc_sampling.h" 47 | 48 | /* JJ ADD 20161014 */ 49 | 50 | #include "../halmac/halmac_reg2.h" 51 | 52 | #define LDPC_HT_ENABLE_RX BIT(0) 53 | #define LDPC_HT_ENABLE_TX BIT(1) 54 | #define LDPC_HT_TEST_TX_ENABLE BIT(2) 55 | #define LDPC_HT_CAP_TX BIT(3) 56 | 57 | #define STBC_HT_ENABLE_RX BIT(0) 58 | #define STBC_HT_ENABLE_TX BIT(1) 59 | #define STBC_HT_TEST_TX_ENABLE BIT(2) 60 | #define STBC_HT_CAP_TX BIT(3) 61 | 62 | #define LDPC_VHT_ENABLE_RX BIT(0) 63 | #define LDPC_VHT_ENABLE_TX BIT(1) 64 | #define LDPC_VHT_TEST_TX_ENABLE BIT(2) 65 | #define LDPC_VHT_CAP_TX BIT(3) 66 | 67 | #define STBC_VHT_ENABLE_RX BIT(0) 68 | #define STBC_VHT_ENABLE_TX BIT(1) 69 | #define STBC_VHT_TEST_TX_ENABLE BIT(2) 70 | #define STBC_VHT_CAP_TX BIT(3) 71 | 72 | #include "rtl8822b/halhwimg8822b_mac.h" 73 | #include "rtl8822b/halhwimg8822b_rf.h" 74 | #include "rtl8822b/halhwimg8822b_bb.h" 75 | #include "rtl8822b/phydm_regconfig8822b.h" 76 | #include "rtl8822b/halphyrf_8822b.h" 77 | #include "rtl8822b/phydm_rtl8822b.h" 78 | #include "rtl8822b/phydm_hal_api8822b.h" 79 | #include "rtl8822b/version_rtl8822b.h" 80 | 81 | #include "../halmac/halmac_reg_8822b.h" 82 | 83 | /* JJ ADD 20161014 */ 84 | 85 | #endif /* __ODM_PRECOMP_H__ */ 86 | -------------------------------------------------------------------------------- /phydm/phydm_psd.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2016 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | 26 | #ifndef __PHYDMPSD_H__ 27 | #define __PHYDMPSD_H__ 28 | 29 | /*#define PSD_VERSION "1.0"*/ /*2016.09.22 Dino*/ 30 | #define PSD_VERSION "1.1" /*2016.10.07 Dino, Add Option for PSD Tone index 31 | *Selection 32 | */ 33 | 34 | #define STOP_TRX_SUCCESS 1 35 | #define STOP_TRX_FAIL 0 36 | 37 | struct psd_info { 38 | u8 psd_in_progress; 39 | u32 psd_reg; 40 | u32 psd_report_reg; 41 | u8 psd_pwr_common_offset; 42 | u16 sw_avg_time; 43 | u16 fft_smp_point; 44 | u32 initial_gain_backup; 45 | u32 rf_0x18_bkp; 46 | u16 psd_fc_channel; 47 | u32 psd_bw_rf_reg; 48 | u8 psd_result[128]; 49 | u8 noise_k_en; 50 | }; 51 | 52 | u32 phydm_get_psd_data(void *dm_void, u32 psd_tone_idx, u32 igi); 53 | 54 | void phydm_psd_debug(void *dm_void, char input[][16], u32 *_used, char *output, 55 | u32 *_out_len, u32 input_num); 56 | 57 | void phydm_psd(void *dm_void, u32 igi, u16 start_point, u16 stop_point); 58 | 59 | void phydm_psd_para_setting(void *dm_void, u8 sw_avg_time, u8 hw_avg_time, 60 | u8 i_q_setting, u16 fft_smp_point, u8 ant_sel, 61 | u8 psd_input, u8 channel, u8 noise_k_en); 62 | 63 | void phydm_psd_init(void *dm_void); 64 | 65 | u8 phydm_get_psd_result_table(void *dm_void, int index); 66 | 67 | #endif 68 | -------------------------------------------------------------------------------- /phydm/rtl8822b/halhwimg8822b_bb.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2016 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | 26 | /*Image2HeaderVersion: 3.2*/ 27 | #ifndef __INC_MP_BB_HW_IMG_8822B_H 28 | #define __INC_MP_BB_HW_IMG_8822B_H 29 | 30 | /****************************************************************************** 31 | * agc_tab.TXT 32 | ******************************************************************************/ 33 | 34 | void odm_read_and_config_mp_8822b_agc_tab(/* tc: Test Chip, mp: mp Chip*/ 35 | struct phy_dm_struct *dm); 36 | u32 odm_get_version_mp_8822b_agc_tab(void); 37 | 38 | /****************************************************************************** 39 | * phy_reg.TXT 40 | ******************************************************************************/ 41 | 42 | void odm_read_and_config_mp_8822b_phy_reg(/* tc: Test Chip, mp: mp Chip*/ 43 | struct phy_dm_struct *dm); 44 | u32 odm_get_version_mp_8822b_phy_reg(void); 45 | 46 | /****************************************************************************** 47 | * phy_reg_pg.TXT 48 | ******************************************************************************/ 49 | 50 | void odm_read_and_config_mp_8822b_phy_reg_pg(/* tc: Test Chip, mp: mp Chip*/ 51 | struct phy_dm_struct *dm); 52 | u32 odm_get_version_mp_8822b_phy_reg_pg(void); 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /phydm/rtl8822b/halhwimg8822b_mac.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2016 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | 26 | /*Image2HeaderVersion: 3.2*/ 27 | #ifndef __INC_MP_MAC_HW_IMG_8822B_H 28 | #define __INC_MP_MAC_HW_IMG_8822B_H 29 | 30 | /****************************************************************************** 31 | * mac_reg.TXT 32 | ******************************************************************************/ 33 | 34 | void odm_read_and_config_mp_8822b_mac_reg(/* tc: Test Chip, mp: mp Chip*/ 35 | struct phy_dm_struct *dm); 36 | u32 odm_get_version_mp_8822b_mac_reg(void); 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /phydm/rtl8822b/halphyrf_8822b.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2016 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | 26 | #ifndef __HAL_PHY_RF_8822B_H__ 27 | #define __HAL_PHY_RF_8822B_H__ 28 | 29 | #define AVG_THERMAL_NUM_8822B 4 30 | #define RF_T_METER_8822B 0x42 31 | 32 | void configure_txpower_track_8822b(struct txpwrtrack_cfg *config); 33 | 34 | void odm_tx_pwr_track_set_pwr8822b(void *dm_void, enum pwrtrack_method method, 35 | u8 rf_path, u8 channel_mapped_index); 36 | 37 | void get_delta_swing_table_8822b(void *dm_void, u8 **temperature_up_a, 38 | u8 **temperature_down_a, u8 **temperature_up_b, 39 | u8 **temperature_down_b); 40 | 41 | void phy_lc_calibrate_8822b(void *dm_void); 42 | 43 | void phy_set_rf_path_switch_8822b(struct phy_dm_struct *dm, bool is_main); 44 | 45 | #endif /* #ifndef __HAL_PHY_RF_8822B_H__ */ 46 | -------------------------------------------------------------------------------- /phydm/rtl8822b/phydm_iqk_8822b.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2016 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | #ifndef __PHYDM_IQK_8822B_H__ 26 | #define __PHYDM_IQK_8822B_H__ 27 | 28 | /*--------------------------Define Parameters-------------------------------*/ 29 | #define MAC_REG_NUM_8822B 2 30 | #define BB_REG_NUM_8822B 13 31 | #define RF_REG_NUM_8822B 5 32 | 33 | #define LOK_delay_8822B 2 34 | #define GS_delay_8822B 2 35 | #define WBIQK_delay_8822B 2 36 | 37 | #define TXIQK 0 38 | #define RXIQK 1 39 | #define SS_8822B 2 40 | 41 | /*------------------------End Define Parameters-------------------------------*/ 42 | 43 | void do_iqk_8822b(void *dm_void, u8 delta_thermal_index, u8 thermal_value, 44 | u8 threshold); 45 | 46 | void phy_iq_calibrate_8822b(void *dm_void, bool clear); 47 | 48 | #endif /* #ifndef __PHYDM_IQK_8822B_H__*/ 49 | -------------------------------------------------------------------------------- /phydm/rtl8822b/phydm_regconfig8822b.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2016 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | #ifndef __INC_ODM_REGCONFIG_H_8822B 26 | #define __INC_ODM_REGCONFIG_H_8822B 27 | 28 | void odm_config_rf_reg_8822b(struct phy_dm_struct *dm, u32 addr, u32 data, 29 | enum odm_rf_radio_path RF_PATH, u32 reg_addr); 30 | 31 | void odm_config_rf_radio_a_8822b(struct phy_dm_struct *dm, u32 addr, u32 data); 32 | 33 | void odm_config_rf_radio_b_8822b(struct phy_dm_struct *dm, u32 addr, u32 data); 34 | 35 | void odm_config_mac_8822b(struct phy_dm_struct *dm, u32 addr, u8 data); 36 | 37 | void odm_update_agc_big_jump_lmt_8822b(struct phy_dm_struct *dm, u32 addr, 38 | u32 data); 39 | 40 | void odm_config_bb_agc_8822b(struct phy_dm_struct *dm, u32 addr, u32 bitmask, 41 | u32 data); 42 | 43 | void odm_config_bb_phy_reg_pg_8822b(struct phy_dm_struct *dm, u32 band, 44 | u32 rf_path, u32 tx_num, u32 addr, 45 | u32 bitmask, u32 data); 46 | 47 | void odm_config_bb_phy_8822b(struct phy_dm_struct *dm, u32 addr, u32 bitmask, 48 | u32 data); 49 | 50 | void odm_config_bb_txpwr_lmt_8822b(struct phy_dm_struct *dm, u8 *regulation, 51 | u8 *band, u8 *bandwidth, u8 *rate_section, 52 | u8 *rf_path, u8 *channel, u8 *power_limit); 53 | 54 | #endif /* RTL8822B_SUPPORT == 1*/ 55 | -------------------------------------------------------------------------------- /phydm/rtl8822b/phydm_rtl8822b.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2016 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | #ifndef __ODM_RTL8822B_H__ 26 | #define __ODM_RTL8822B_H__ 27 | 28 | void phydm_hwsetting_8822b(struct phy_dm_struct *dm); 29 | 30 | #endif /* #define __ODM_RTL8822B_H__ */ 31 | -------------------------------------------------------------------------------- /phydm/rtl8822b/version_rtl8822b.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2016 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | /*RTL8822B PHY Parameters*/ 26 | /* 27 | * [Caution] 28 | * Since 01/Aug/2015, the commit rules will be simplified. 29 | * You do not need to fill up the version.h anymore, 30 | * only the maintenance supervisor fills it before formal release. 31 | */ 32 | #define RELEASE_DATE_8822B 20161103 33 | #define COMMIT_BY_8822B "BB_JOE" 34 | #define RELEASE_VERSION_8822B 67 35 | -------------------------------------------------------------------------------- /phydm/rtl_phydm.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2016 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | #ifndef __RTL_PHYDM_H__ 26 | #define __RTL_PHYDM_H__ 27 | 28 | struct rtl_phydm_ops *rtl_phydm_get_ops_pointer(void); 29 | 30 | #define rtlpriv_to_phydm(priv) \ 31 | ((struct phy_dm_struct *)((priv)->phydm.internal)) 32 | 33 | u8 phy_get_tx_power_index(void *adapter, u8 rf_path, u8 rate, 34 | enum ht_channel_width bandwidth, u8 channel); 35 | void phy_set_tx_power_index_by_rs(void *adapter, u8 ch, u8 path, u8 rs); 36 | void phy_store_tx_power_by_rate(void *adapter, u32 band, u32 rfpath, u32 txnum, 37 | u32 regaddr, u32 bitmask, u32 data); 38 | void phy_set_tx_power_limit(void *dm, u8 *regulation, u8 *band, u8 *bandwidth, 39 | u8 *rate_section, u8 *rf_path, u8 *channel, 40 | u8 *power_limit); 41 | 42 | void rtl_hal_update_ra_mask(void *adapter, struct rtl_sta_info *psta, 43 | u8 rssi_level); 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /phydm/txbf/halcomtxbf.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2016 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | #ifndef __HAL_COM_TXBF_H__ 26 | #define __HAL_COM_TXBF_H__ 27 | 28 | enum txbf_set_type { 29 | TXBF_SET_SOUNDING_ENTER, 30 | TXBF_SET_SOUNDING_LEAVE, 31 | TXBF_SET_SOUNDING_RATE, 32 | TXBF_SET_SOUNDING_STATUS, 33 | TXBF_SET_SOUNDING_FW_NDPA, 34 | TXBF_SET_SOUNDING_CLK, 35 | TXBF_SET_TX_PATH_RESET, 36 | TXBF_SET_GET_TX_RATE 37 | }; 38 | 39 | enum txbf_get_type { 40 | TXBF_GET_EXPLICIT_BEAMFORMEE, 41 | TXBF_GET_EXPLICIT_BEAMFORMER, 42 | TXBF_GET_MU_MIMO_STA, 43 | TXBF_GET_MU_MIMO_AP 44 | }; 45 | 46 | /* 2 HAL TXBF related */ 47 | struct _HAL_TXBF_INFO { 48 | u8 txbf_idx; 49 | u8 ndpa_idx; 50 | u8 BW; 51 | u8 rate; 52 | 53 | struct timer_list txbf_fw_ndpa_timer; 54 | }; 55 | 56 | #define hal_com_txbf_beamform_init(dm_void) NULL 57 | #define hal_com_txbf_config_gtab(dm_void) NULL 58 | #define hal_com_txbf_enter_work_item_callback(_adapter) NULL 59 | #define hal_com_txbf_leave_work_item_callback(_adapter) NULL 60 | #define hal_com_txbf_fw_ndpa_work_item_callback(_adapter) NULL 61 | #define hal_com_txbf_clk_work_item_callback(_adapter) NULL 62 | #define hal_com_txbf_rate_work_item_callback(_adapter) NULL 63 | #define hal_com_txbf_fw_ndpa_timer_callback(_adapter) NULL 64 | #define hal_com_txbf_status_work_item_callback(_adapter) NULL 65 | #define hal_com_txbf_get(_adapter, _get_type, _pout_buf) 66 | 67 | #endif /* #ifndef __HAL_COM_TXBF_H__ */ 68 | -------------------------------------------------------------------------------- /phydm/txbf/haltxbf8822b.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2016 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | #ifndef __HAL_TXBF_8822B_H__ 26 | #define __HAL_TXBF_8822B_H__ 27 | 28 | #define hal_txbf_8822b_enter(dm_void, idx) 29 | #define hal_txbf_8822b_leave(dm_void, idx) 30 | #define hal_txbf_8822b_status(dm_void, idx) 31 | #define hal_txbf_8822b_fw_txbf(dm_void, idx) 32 | #define hal_txbf_8822b_config_gtab(dm_void) 33 | 34 | void phydm_8822btxbf_rfmode(void *dm_void, u8 su_bfee_cnt, u8 mu_bfee_cnt); 35 | 36 | void phydm_8822b_sutxbfer_workaroud(void *dm_void, bool enable_su_bfer, u8 nc, 37 | u8 nr, u8 ng, u8 CB, u8 BW, bool is_vht); 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /phydm/txbf/haltxbfinterface.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2016 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | #ifndef __HAL_TXBF_INTERFACE_H__ 26 | #define __HAL_TXBF_INTERFACE_H__ 27 | 28 | #define beamforming_get_ndpa_frame(dm, _pdu_os) 29 | #define beamforming_get_report_frame(adapter, precv_frame) RT_STATUS_FAILURE 30 | #define send_fw_ht_ndpa_packet(dm_void, RA, BW) 31 | #define send_sw_ht_ndpa_packet(dm_void, RA, BW) 32 | #define send_fw_vht_ndpa_packet(dm_void, RA, AID, BW) 33 | #define send_sw_vht_ndpa_packet(dm_void, RA, AID, BW) 34 | #define send_sw_vht_gid_mgnt_frame(dm_void, RA, idx) 35 | #define send_sw_vht_bf_report_poll(dm_void, RA, is_final_poll) 36 | #define send_sw_vht_mu_ndpa_packet(dm_void, BW) 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /phydm/txbf/haltxbfjaguar.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2016 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | #ifndef __HAL_TXBF_JAGUAR_H__ 26 | #define __HAL_TXBF_JAGUAR_H__ 27 | 28 | #define hal_txbf_8812a_set_ndpa_rate(dm_void, BW, rate) 29 | #define hal_txbf_jaguar_enter(dm_void, idx) 30 | #define hal_txbf_jaguar_leave(dm_void, idx) 31 | #define hal_txbf_jaguar_status(dm_void, idx) 32 | #define hal_txbf_jaguar_fw_txbf(dm_void, idx) 33 | #define hal_txbf_jaguar_patch(dm_void, operation) 34 | #define hal_txbf_jaguar_clk_8812a(dm_void) 35 | 36 | #endif /* #ifndef __HAL_TXBF_JAGUAR_H__ */ 37 | -------------------------------------------------------------------------------- /phydm/txbf/phydm_hal_txbf_api.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2016 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | #ifndef __PHYDM_HAL_TXBF_API_H__ 26 | #define __PHYDM_HAL_TXBF_API_H__ 27 | 28 | #define tx_bf_nr(a, b) ((a > b) ? (b) : (a)) 29 | 30 | u8 beamforming_get_htndp_tx_rate(void *dm_void, u8 comp_steering_num_of_bfer); 31 | 32 | u8 beamforming_get_vht_ndp_tx_rate(void *dm_void, u8 comp_steering_num_of_bfer); 33 | 34 | u8 phydm_get_beamforming_sounding_info(void *dm_void, u16 *troughput, 35 | u8 total_bfee_num, u8 *tx_rate); 36 | 37 | u8 phydm_get_ndpa_rate(void *dm_void); 38 | 39 | u8 phydm_get_mu_bfee_snding_decision(void *dm_void, u16 throughput); 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /ps.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2009-2012 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | 26 | #ifndef __REALTEK_RTL_PCI_PS_H__ 27 | #define __REALTEK_RTL_PCI_PS_H__ 28 | 29 | #define MAX_SW_LPS_SLEEP_INTV 5 30 | 31 | bool rtl_ps_enable_nic(struct ieee80211_hw *hw); 32 | bool rtl_ps_disable_nic(struct ieee80211_hw *hw); 33 | void rtl_ips_nic_off(struct ieee80211_hw *hw); 34 | void rtl_ips_nic_on(struct ieee80211_hw *hw); 35 | void rtl_ips_nic_off_wq_callback(void *data); 36 | void rtl_lps_enter(struct ieee80211_hw *hw); 37 | void rtl_lps_leave(struct ieee80211_hw *hw); 38 | 39 | void rtl_lps_set_psmode(struct ieee80211_hw *hw, u8 rt_psmode); 40 | 41 | void rtl_swlps_beacon(struct ieee80211_hw *hw, void *data, unsigned int len); 42 | void rtl_swlps_wq_callback(void *data); 43 | void rtl_swlps_rfon_wq_callback(void *data); 44 | void rtl_swlps_rf_awake(struct ieee80211_hw *hw); 45 | void rtl_swlps_rf_sleep(struct ieee80211_hw *hw); 46 | void rtl_p2p_ps_cmd(struct ieee80211_hw *hw , u8 p2p_ps_state); 47 | void rtl_p2p_info(struct ieee80211_hw *hw, void *data, unsigned int len); 48 | void rtl_lps_change_work_callback(struct work_struct *work); 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /rc.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2009-2012 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | 26 | #ifndef __RTL_RC_H__ 27 | #define __RTL_RC_H__ 28 | 29 | #define B_MODE_MAX_RIX 3 30 | #define G_MODE_MAX_RIX 11 31 | #define A_MODE_MAX_RIX 7 32 | 33 | /* in mac80211 mcs0-mcs15 is idx0-idx15*/ 34 | #define N_MODE_MCS7_RIX 7 35 | #define N_MODE_MCS15_RIX 15 36 | 37 | /* in mac80211 vht mcs0-9 is in [3:0], nss is in [:4] */ 38 | #define AC_MODE_MCS7_RIX 7 39 | #define AC_MODE_MCS8_RIX 8 40 | #define AC_MODE_MCS9_RIX 9 41 | 42 | struct rtl_rate_priv { 43 | u8 ht_cap; 44 | }; 45 | 46 | int rtl_rate_control_register(void); 47 | void rtl_rate_control_unregister(void); 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /regd.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2009-2012 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | 26 | #ifndef __RTL_REGD_H__ 27 | #define __RTL_REGD_H__ 28 | 29 | /* for kernel 3.14 , both value are changed to IEEE80211_CHAN_NO_IR*/ 30 | #define IEEE80211_CHAN_NO_IBSS IEEE80211_CHAN_NO_IR 31 | #define IEEE80211_CHAN_PASSIVE_SCAN IEEE80211_CHAN_NO_IR 32 | 33 | struct country_code_to_enum_rd { 34 | u16 countrycode; 35 | const char *iso_name; 36 | }; 37 | 38 | enum country_code_type_t { 39 | COUNTRY_CODE_FCC = 0, 40 | COUNTRY_CODE_IC = 1, 41 | COUNTRY_CODE_ETSI = 2, 42 | COUNTRY_CODE_SPAIN = 3, 43 | COUNTRY_CODE_FRANCE = 4, 44 | COUNTRY_CODE_MKK = 5, 45 | COUNTRY_CODE_MKK1 = 6, 46 | COUNTRY_CODE_ISRAEL = 7, 47 | COUNTRY_CODE_TELEC = 8, 48 | COUNTRY_CODE_MIC = 9, 49 | COUNTRY_CODE_GLOBAL_DOMAIN = 10, 50 | COUNTRY_CODE_WORLD_WIDE_13 = 11, 51 | COUNTRY_CODE_TELEC_NETGEAR = 12, 52 | COUNTRY_CODE_WORLD_WIDE_13_5G_ALL = 13, 53 | 54 | /*add new channel plan above this line */ 55 | COUNTRY_CODE_MAX 56 | }; 57 | 58 | int rtl_regd_init(struct ieee80211_hw *hw, 59 | void (*reg_notifier) (struct wiphy *wiphy, 60 | struct regulatory_request *request)); 61 | void rtl_reg_notifier(struct wiphy *wiphy, struct regulatory_request *request); 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /rtl8188ee/Makefile: -------------------------------------------------------------------------------- 1 | rtl8188ee-objs := \ 2 | dm.o \ 3 | fw.o \ 4 | hw.o \ 5 | led.o \ 6 | phy.o \ 7 | pwrseq.o \ 8 | rf.o \ 9 | sw.o \ 10 | table.o \ 11 | trx.o 12 | 13 | obj-$(CONFIG_RTL8188EE) += rtl8188ee.o 14 | -------------------------------------------------------------------------------- /rtl8188ee/hw.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2009-2013 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | 26 | #ifndef __RTL92CE_HW_H__ 27 | #define __RTL92CE_HW_H__ 28 | 29 | void rtl88ee_get_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val); 30 | void rtl88ee_read_eeprom_info(struct ieee80211_hw *hw); 31 | void rtl88ee_interrupt_recognized(struct ieee80211_hw *hw, 32 | u32 *p_inta, u32 *p_intb, 33 | u32 *p_intc, u32 *p_intd); 34 | int rtl88ee_hw_init(struct ieee80211_hw *hw); 35 | void rtl88ee_card_disable(struct ieee80211_hw *hw); 36 | void rtl88ee_enable_interrupt(struct ieee80211_hw *hw); 37 | void rtl88ee_disable_interrupt(struct ieee80211_hw *hw); 38 | int rtl88ee_set_network_type(struct ieee80211_hw *hw, enum nl80211_iftype type); 39 | void rtl88ee_set_check_bssid(struct ieee80211_hw *hw, bool check_bssid); 40 | void rtl88ee_set_qos(struct ieee80211_hw *hw, int aci); 41 | void rtl88ee_set_beacon_related_registers(struct ieee80211_hw *hw); 42 | void rtl88ee_set_beacon_interval(struct ieee80211_hw *hw); 43 | void rtl88ee_update_interrupt_mask(struct ieee80211_hw *hw, 44 | u32 add_msr, u32 rm_msr); 45 | void rtl88ee_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val); 46 | void rtl88ee_update_hal_rate_tbl(struct ieee80211_hw *hw, 47 | struct ieee80211_sta *sta, u8 rssi_level); 48 | void rtl88ee_update_channel_access_setting(struct ieee80211_hw *hw); 49 | bool rtl88ee_gpio_radio_on_off_checking(struct ieee80211_hw *hw, u8 *valid); 50 | void rtl88ee_enable_hw_security_config(struct ieee80211_hw *hw); 51 | void rtl88ee_set_key(struct ieee80211_hw *hw, u32 key_index, 52 | u8 *p_macaddr, bool is_group, u8 enc_algo, 53 | bool is_wepkey, bool clear_all); 54 | 55 | void rtl8188ee_read_bt_coexist_info_from_hwpg(struct ieee80211_hw *hw, 56 | bool autoload_fail, u8 *hwinfo); 57 | void rtl8188ee_bt_reg_init(struct ieee80211_hw *hw); 58 | void rtl8188ee_bt_hw_init(struct ieee80211_hw *hw); 59 | void rtl88ee_suspend(struct ieee80211_hw *hw); 60 | void rtl88ee_resume(struct ieee80211_hw *hw); 61 | void rtl88ee_fw_clk_off_timer_callback(unsigned long data); 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /rtl8188ee/led.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2009-2013 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | 26 | #ifndef __RTL92CE_LED_H__ 27 | #define __RTL92CE_LED_H__ 28 | 29 | void rtl88ee_init_sw_leds(struct ieee80211_hw *hw); 30 | void rtl88ee_sw_led_on(struct ieee80211_hw *hw, struct rtl_led *pled); 31 | void rtl88ee_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled); 32 | void rtl88ee_led_control(struct ieee80211_hw *hw, enum led_ctl_mode ledaction); 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /rtl8188ee/rf.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2009-2013 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | 26 | #ifndef __RTL92C_RF_H__ 27 | #define __RTL92C_RF_H__ 28 | 29 | #define RF6052_MAX_TX_PWR 0x3F 30 | 31 | void rtl88e_phy_rf6052_set_bandwidth(struct ieee80211_hw *hw, 32 | u8 bandwidth); 33 | void rtl88e_phy_rf6052_set_cck_txpower(struct ieee80211_hw *hw, 34 | u8 *ppowerlevel); 35 | void rtl88e_phy_rf6052_set_ofdm_txpower(struct ieee80211_hw *hw, 36 | u8 *ppowerlevel_ofdm, 37 | u8 *ppowerlevel_bw20, 38 | u8 *ppowerlevel_bw40, 39 | u8 channel); 40 | bool rtl88e_phy_rf6052_config(struct ieee80211_hw *hw); 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /rtl8188ee/sw.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2009-2013 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | 26 | #ifndef __RTL92CE_SW_H__ 27 | #define __RTL92CE_SW_H__ 28 | 29 | int rtl88e_init_sw_vars(struct ieee80211_hw *hw); 30 | void rtl88e_deinit_sw_vars(struct ieee80211_hw *hw); 31 | bool rtl88e_get_btc_status(void); 32 | 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /rtl8188ee/table.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2009-2013 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Created on 2010/ 5/18, 1:41 23 | * 24 | * Larry Finger 25 | * 26 | *****************************************************************************/ 27 | 28 | #ifndef __RTL92CE_TABLE__H_ 29 | #define __RTL92CE_TABLE__H_ 30 | 31 | #include 32 | #define RTL8188EEPHY_REG_1TARRAYLEN 382 33 | extern u32 RTL8188EEPHY_REG_1TARRAY[]; 34 | #define RTL8188EEPHY_REG_ARRAY_PGLEN 264 35 | extern u32 RTL8188EEPHY_REG_ARRAY_PG[]; 36 | #define RTL8188EE_RADIOA_1TARRAYLEN 190 37 | extern u32 RTL8188EE_RADIOA_1TARRAY[]; 38 | #define RTL8188EEMAC_1T_ARRAYLEN 180 39 | extern u32 RTL8188EEMAC_1T_ARRAY[]; 40 | #define RTL8188EEAGCTAB_1TARRAYLEN 256 41 | extern u32 RTL8188EEAGCTAB_1TARRAY[]; 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /rtl8192c/Makefile: -------------------------------------------------------------------------------- 1 | rtl8192c-common-objs := \ 2 | main.o \ 3 | dm_common.o \ 4 | fw_common.o \ 5 | phy_common.o 6 | 7 | obj-$(CONFIG_RTL8192C_COMMON) += rtl8192c-common.o 8 | -------------------------------------------------------------------------------- /rtl8192c/main.c: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2009-2012 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | 26 | #include "../wifi.h" 27 | #include 28 | 29 | 30 | MODULE_AUTHOR("lizhaoming "); 31 | MODULE_AUTHOR("Realtek WlanFAE "); 32 | MODULE_AUTHOR("Georgia "); 33 | MODULE_AUTHOR("Ziv Huang "); 34 | MODULE_AUTHOR("Larry Finger "); 35 | MODULE_LICENSE("GPL"); 36 | MODULE_DESCRIPTION("Realtek 8192C/8188C 802.11n PCI wireless"); 37 | -------------------------------------------------------------------------------- /rtl8192ce/Makefile: -------------------------------------------------------------------------------- 1 | rtl8192ce-objs := \ 2 | dm.o \ 3 | hw.o \ 4 | led.o \ 5 | phy.o \ 6 | rf.o \ 7 | sw.o \ 8 | table.o \ 9 | trx.o 10 | 11 | obj-$(CONFIG_RTL8192CE) += rtl8192ce.o 12 | -------------------------------------------------------------------------------- /rtl8192ce/dm.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2009-2012 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | 26 | #ifndef __RTL92C_DM_H__ 27 | #define __RTL92C_DM_H__ 28 | 29 | #define HAL_DM_DIG_DISABLE BIT(0) 30 | #define HAL_DM_HIPWR_DISABLE BIT(1) 31 | 32 | #define OFDM_TABLE_LENGTH 37 33 | #define CCK_TABLE_LENGTH 33 34 | 35 | #define OFDM_TABLE_SIZE 37 36 | #define CCK_TABLE_SIZE 33 37 | 38 | #define BW_AUTO_SWITCH_HIGH_LOW 25 39 | #define BW_AUTO_SWITCH_LOW_HIGH 30 40 | 41 | #define DM_DIG_FA_UPPER 0x32 42 | #define DM_DIG_FA_LOWER 0x20 43 | #define DM_DIG_FA_TH0 0x20 44 | #define DM_DIG_FA_TH1 0x100 45 | #define DM_DIG_FA_TH2 0x200 46 | 47 | #define RXPATHSELECTION_SS_TH_lOW 30 48 | #define RXPATHSELECTION_DIFF_TH 18 49 | 50 | #define DM_RATR_STA_INIT 0 51 | #define DM_RATR_STA_HIGH 1 52 | #define DM_RATR_STA_MIDDLE 2 53 | #define DM_RATR_STA_LOW 3 54 | 55 | #define CTS2SELF_THVAL 30 56 | #define REGC38_TH 20 57 | 58 | #define WAIOTTHVal 25 59 | 60 | #define TXHIGHPWRLEVEL_NORMAL 0 61 | #define TXHIGHPWRLEVEL_LEVEL1 1 62 | #define TXHIGHPWRLEVEL_LEVEL2 2 63 | #define TXHIGHPWRLEVEL_BT1 3 64 | #define TXHIGHPWRLEVEL_BT2 4 65 | 66 | #define DM_TYPE_BYFW 0 67 | #define DM_TYPE_BYDRIVER 1 68 | 69 | #define TX_POWER_NEAR_FIELD_THRESH_LVL2 74 70 | #define TX_POWER_NEAR_FIELD_THRESH_LVL1 67 71 | 72 | void rtl92c_dm_init(struct ieee80211_hw *hw); 73 | void rtl92c_dm_watchdog(struct ieee80211_hw *hw); 74 | void rtl92c_dm_write_dig(struct ieee80211_hw *hw); 75 | void rtl92c_dm_init_edca_turbo(struct ieee80211_hw *hw); 76 | void rtl92c_dm_check_txpower_tracking(struct ieee80211_hw *hw); 77 | void rtl92c_dm_init_rate_adaptive_mask(struct ieee80211_hw *hw); 78 | void rtl92c_dm_rf_saving(struct ieee80211_hw *hw, u8 bforce_in_normal); 79 | void rtl92c_dm_bt_coexist(struct ieee80211_hw *hw); 80 | void rtl92ce_dm_dynamic_txpower(struct ieee80211_hw *hw); 81 | 82 | #endif 83 | -------------------------------------------------------------------------------- /rtl8192ce/led.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2009-2012 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | 26 | #ifndef __RTL92CE_LED_H__ 27 | #define __RTL92CE_LED_H__ 28 | 29 | void rtl92ce_init_sw_leds(struct ieee80211_hw *hw); 30 | void rtl92ce_sw_led_on(struct ieee80211_hw *hw, struct rtl_led *pled); 31 | void rtl92ce_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled); 32 | void rtl92ce_led_control(struct ieee80211_hw *hw, enum led_ctl_mode ledaction); 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /rtl8192ce/rf.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2009-2012 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | 26 | #ifndef __RTL92C_RF_H__ 27 | #define __RTL92C_RF_H__ 28 | 29 | #define RF6052_MAX_TX_PWR 0x3F 30 | #define RF6052_MAX_PATH 2 31 | 32 | void rtl92ce_phy_rf6052_set_bandwidth(struct ieee80211_hw *hw, u8 bandwidth); 33 | void rtl92ce_phy_rf6052_set_cck_txpower(struct ieee80211_hw *hw, 34 | u8 *ppowerlevel); 35 | void rtl92ce_phy_rf6052_set_ofdm_txpower(struct ieee80211_hw *hw, 36 | u8 *ppowerlevel, u8 channel); 37 | bool rtl92ce_phy_rf6052_config(struct ieee80211_hw *hw); 38 | #endif 39 | -------------------------------------------------------------------------------- /rtl8192ce/sw.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2009-2012 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | 26 | #ifndef __RTL92CE_SW_H__ 27 | #define __RTL92CE_SW_H__ 28 | 29 | int rtl92c_init_sw_vars(struct ieee80211_hw *hw); 30 | void rtl92c_deinit_sw_vars(struct ieee80211_hw *hw); 31 | void rtl92c_init_var_map(struct ieee80211_hw *hw); 32 | bool _rtl92ce_phy_config_bb_with_headerfile(struct ieee80211_hw *hw, 33 | u8 configtype); 34 | bool _rtl92ce_phy_config_bb_with_pgheaderfile(struct ieee80211_hw *hw, 35 | u8 configtype); 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /rtl8192ce/table.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2009-2012 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Created on 2010/ 5/18, 1:41 23 | * 24 | * Larry Finger 25 | * 26 | *****************************************************************************/ 27 | 28 | #ifndef __RTL92CE_TABLE__H_ 29 | #define __RTL92CE_TABLE__H_ 30 | 31 | #include 32 | 33 | #define PHY_REG_2TARRAY_LENGTH 374 34 | extern u32 RTL8192CEPHY_REG_2TARRAY[PHY_REG_2TARRAY_LENGTH]; 35 | #define PHY_REG_1TARRAY_LENGTH 374 36 | extern u32 RTL8192CEPHY_REG_1TARRAY[PHY_REG_1TARRAY_LENGTH]; 37 | #define PHY_REG_ARRAY_PGLENGTH 192 38 | extern u32 RTL8192CEPHY_REG_ARRAY_PG[PHY_REG_ARRAY_PGLENGTH]; 39 | #define RADIOA_2TARRAYLENGTH 282 40 | extern u32 RTL8192CERADIOA_2TARRAY[RADIOA_2TARRAYLENGTH]; 41 | #define RADIOB_2TARRAYLENGTH 78 42 | extern u32 RTL8192CE_RADIOB_2TARRAY[RADIOB_2TARRAYLENGTH]; 43 | #define RADIOA_1TARRAYLENGTH 282 44 | extern u32 RTL8192CE_RADIOA_1TARRAY[RADIOA_1TARRAYLENGTH]; 45 | #define RADIOB_1TARRAYLENGTH 1 46 | extern u32 RTL8192CE_RADIOB_1TARRAY[RADIOB_1TARRAYLENGTH]; 47 | #define MAC_2T_ARRAYLENGTH 162 48 | extern u32 RTL8192CEMAC_2T_ARRAY[MAC_2T_ARRAYLENGTH]; 49 | #define AGCTAB_2TARRAYLENGTH 320 50 | extern u32 RTL8192CEAGCTAB_2TARRAY[AGCTAB_2TARRAYLENGTH]; 51 | #define AGCTAB_1TARRAYLENGTH 320 52 | extern u32 RTL8192CEAGCTAB_1TARRAY[AGCTAB_1TARRAYLENGTH]; 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /rtl8192cu/Makefile: -------------------------------------------------------------------------------- 1 | rtl8192cu-objs := \ 2 | dm.o \ 3 | hw.o \ 4 | led.o \ 5 | mac.o \ 6 | phy.o \ 7 | rf.o \ 8 | sw.o \ 9 | table.o \ 10 | trx.o 11 | 12 | obj-$(CONFIG_RTL8192CU) += rtl8192cu.o 13 | -------------------------------------------------------------------------------- /rtl8192cu/def.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2009-2012 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | 26 | #include "../rtl8192ce/def.h" 27 | 28 | /*------------------------------------------------------------------------- 29 | * Chip specific 30 | *-------------------------------------------------------------------------*/ 31 | #define NORMAL_CHIP BIT(4) 32 | #define CHIP_VENDOR_UMC BIT(5) 33 | #define CHIP_VENDOR_UMC_B_CUT BIT(6) 34 | 35 | #define IS_92C_1T2R(version) \ 36 | (((version) & CHIP_92C) && ((version) & CHIP_92C_1T2R)) 37 | 38 | #define IS_VENDOR_UMC(version) \ 39 | (((version) & CHIP_VENDOR_UMC) ? true : false) 40 | 41 | #define CHIP_BONDING_92C_1T2R 0x1 42 | #define CHIP_BONDING_IDENTIFIER(_value) (((_value) >> 22) & 0x3) 43 | -------------------------------------------------------------------------------- /rtl8192cu/dm.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2009-2012 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | 26 | #include "../rtl8192ce/dm.h" 27 | 28 | void rtl92cu_dm_dynamic_txpower(struct ieee80211_hw *hw); 29 | void dm_savepowerindex(struct ieee80211_hw *hw); 30 | void dm_writepowerindex(struct ieee80211_hw *hw, u8 value); 31 | void dm_restorepowerindex(struct ieee80211_hw *hw); 32 | -------------------------------------------------------------------------------- /rtl8192cu/led.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2009-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 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | *****************************************************************************/ 23 | 24 | #ifndef __RTL92CU_LED_H__ 25 | #define __RTL92CU_LED_H__ 26 | 27 | void rtl92cu_init_sw_leds(struct ieee80211_hw *hw); 28 | void rtl92cu_deinit_sw_leds(struct ieee80211_hw *hw); 29 | void rtl92cu_sw_led_on(struct ieee80211_hw *hw, struct rtl_led *pled); 30 | void rtl92cu_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled); 31 | void rtl92cu_led_control(struct ieee80211_hw *hw, enum led_ctl_mode ledaction); 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /rtl8192cu/phy.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2009-2012 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | 26 | #include "../rtl8192ce/phy.h" 27 | 28 | void rtl92cu_bb_block_on(struct ieee80211_hw *hw); 29 | bool rtl8192_phy_check_is_legal_rfpath(struct ieee80211_hw *hw, u32 rfpath); 30 | void rtl92c_phy_set_io(struct ieee80211_hw *hw); 31 | bool _rtl92cu_phy_config_mac_with_headerfile(struct ieee80211_hw *hw); 32 | bool rtl92cu_phy_bb_config(struct ieee80211_hw *hw); 33 | u32 rtl92cu_phy_query_rf_reg(struct ieee80211_hw *hw, 34 | enum radio_path rfpath, u32 regaddr, u32 bitmask); 35 | void rtl92cu_phy_set_rf_reg(struct ieee80211_hw *hw, 36 | enum radio_path rfpath, 37 | u32 regaddr, u32 bitmask, u32 data); 38 | bool rtl92cu_phy_mac_config(struct ieee80211_hw *hw); 39 | bool _rtl92cu_phy_config_bb_with_pgheaderfile(struct ieee80211_hw *hw, 40 | u8 configtype); 41 | void _rtl92cu_phy_lc_calibrate(struct ieee80211_hw *hw, bool is2t); 42 | bool _rtl92cu_phy_config_bb_with_headerfile(struct ieee80211_hw *hw, 43 | u8 configtype); 44 | void rtl92cu_phy_set_bw_mode_callback(struct ieee80211_hw *hw); 45 | bool rtl92cu_phy_set_rf_power_state(struct ieee80211_hw *hw, 46 | enum rf_pwrstate rfpwr_state); 47 | -------------------------------------------------------------------------------- /rtl8192cu/reg.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2009-2012 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | 26 | #include "../rtl8192ce/reg.h" 27 | -------------------------------------------------------------------------------- /rtl8192cu/rf.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2009-2012 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | 26 | #ifndef __RTL92CU_RF_H__ 27 | #define __RTL92CU_RF_H__ 28 | 29 | #define RF6052_MAX_TX_PWR 0x3F 30 | #define RF6052_MAX_PATH 2 31 | 32 | void rtl92cu_phy_rf6052_set_bandwidth(struct ieee80211_hw *hw, u8 bandwidth); 33 | void rtl92c_phy_rf6052_set_cck_txpower(struct ieee80211_hw *hw, 34 | u8 *ppowerlevel); 35 | void rtl92c_phy_rf6052_set_ofdm_txpower(struct ieee80211_hw *hw, 36 | u8 *ppowerlevel, u8 channel); 37 | bool rtl92cu_phy_rf6052_config(struct ieee80211_hw *hw); 38 | bool rtl92cu_phy_config_rf_with_headerfile(struct ieee80211_hw *hw, 39 | enum radio_path rfpath); 40 | void rtl92cu_phy_rf6052_set_cck_txpower(struct ieee80211_hw *hw, 41 | u8 *ppowerlevel); 42 | void rtl92cu_phy_rf6052_set_ofdm_txpower(struct ieee80211_hw *hw, 43 | u8 *ppowerlevel, u8 channel); 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /rtl8192cu/sw.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2009-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 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | 26 | #ifndef __RTL92CU_SW_H__ 27 | #define __RTL92CU_SW_H__ 28 | 29 | #define EFUSE_MAX_SECTION 16 30 | 31 | void rtl92cu_phy_rf6052_set_cck_txpower(struct ieee80211_hw *hw, 32 | u8 *powerlevel); 33 | void rtl92cu_phy_rf6052_set_ofdm_txpower(struct ieee80211_hw *hw, 34 | u8 *ppowerlevel, u8 channel); 35 | bool _rtl92cu_phy_config_bb_with_headerfile(struct ieee80211_hw *hw, 36 | u8 configtype); 37 | bool _rtl92cu_phy_config_bb_with_pgheaderfile(struct ieee80211_hw *hw, 38 | u8 configtype); 39 | void _rtl92cu_phy_lc_calibrate(struct ieee80211_hw *hw, bool is2t); 40 | void rtl92cu_phy_set_rf_reg(struct ieee80211_hw *hw, 41 | enum radio_path rfpath, 42 | u32 regaddr, u32 bitmask, u32 data); 43 | bool rtl92cu_phy_set_rf_power_state(struct ieee80211_hw *hw, 44 | enum rf_pwrstate rfpwr_state); 45 | u32 rtl92cu_phy_query_rf_reg(struct ieee80211_hw *hw, 46 | enum radio_path rfpath, u32 regaddr, u32 bitmask); 47 | void rtl92cu_phy_set_bw_mode_callback(struct ieee80211_hw *hw); 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /rtl8192cu/table.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2009-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 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | 26 | #ifndef __RTL92CU_TABLE__H_ 27 | #define __RTL92CU_TABLE__H_ 28 | 29 | #include 30 | 31 | #define RTL8192CUPHY_REG_2TARRAY_LENGTH 374 32 | extern u32 RTL8192CUPHY_REG_2TARRAY[RTL8192CUPHY_REG_2TARRAY_LENGTH]; 33 | #define RTL8192CUPHY_REG_1TARRAY_LENGTH 374 34 | extern u32 RTL8192CUPHY_REG_1TARRAY[RTL8192CUPHY_REG_1TARRAY_LENGTH]; 35 | 36 | #define RTL8192CUPHY_REG_ARRAY_PGLENGTH 336 37 | extern u32 RTL8192CUPHY_REG_ARRAY_PG[RTL8192CUPHY_REG_ARRAY_PGLENGTH]; 38 | 39 | #define RTL8192CURADIOA_2TARRAYLENGTH 282 40 | extern u32 RTL8192CURADIOA_2TARRAY[RTL8192CURADIOA_2TARRAYLENGTH]; 41 | #define RTL8192CURADIOB_2TARRAYLENGTH 78 42 | extern u32 RTL8192CU_RADIOB_2TARRAY[RTL8192CURADIOB_2TARRAYLENGTH]; 43 | #define RTL8192CURADIOA_1TARRAYLENGTH 282 44 | extern u32 RTL8192CU_RADIOA_1TARRAY[RTL8192CURADIOA_1TARRAYLENGTH]; 45 | #define RTL8192CURADIOB_1TARRAYLENGTH 1 46 | extern u32 RTL8192CU_RADIOB_1TARRAY[RTL8192CURADIOB_1TARRAYLENGTH]; 47 | 48 | #define RTL8192CUMAC_2T_ARRAYLENGTH 172 49 | extern u32 RTL8192CUMAC_2T_ARRAY[RTL8192CUMAC_2T_ARRAYLENGTH]; 50 | 51 | #define RTL8192CUAGCTAB_2TARRAYLENGTH 320 52 | extern u32 RTL8192CUAGCTAB_2TARRAY[RTL8192CUAGCTAB_2TARRAYLENGTH]; 53 | #define RTL8192CUAGCTAB_1TARRAYLENGTH 320 54 | extern u32 RTL8192CUAGCTAB_1TARRAY[RTL8192CUAGCTAB_1TARRAYLENGTH]; 55 | 56 | #define RTL8192CUPHY_REG_1T_HPArrayLength 378 57 | extern u32 RTL8192CUPHY_REG_1T_HPArray[RTL8192CUPHY_REG_1T_HPArrayLength]; 58 | 59 | #define RTL8192CUPHY_REG_Array_PG_HPLength 336 60 | extern u32 RTL8192CUPHY_REG_Array_PG_HP[RTL8192CUPHY_REG_Array_PG_HPLength]; 61 | 62 | #define RTL8192CURadioA_1T_HPArrayLength 282 63 | extern u32 RTL8192CURadioA_1T_HPArray[RTL8192CURadioA_1T_HPArrayLength]; 64 | #define RTL8192CUAGCTAB_1T_HPArrayLength 320 65 | extern u32 Rtl8192CUAGCTAB_1T_HPArray[RTL8192CUAGCTAB_1T_HPArrayLength]; 66 | 67 | #endif 68 | -------------------------------------------------------------------------------- /rtl8192de/Makefile: -------------------------------------------------------------------------------- 1 | rtl8192de-objs := \ 2 | dm.o \ 3 | fw.o \ 4 | hw.o \ 5 | led.o \ 6 | phy.o \ 7 | rf.o \ 8 | sw.o \ 9 | table.o \ 10 | trx.o 11 | 12 | obj-$(CONFIG_RTL8192DE) += rtl8192de.o 13 | -------------------------------------------------------------------------------- /rtl8192de/hw.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2009-2012 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | 26 | #ifndef __RTL92DE_HW_H__ 27 | #define __RTL92DE_HW_H__ 28 | 29 | void rtl92de_get_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val); 30 | void rtl92de_read_eeprom_info(struct ieee80211_hw *hw); 31 | void rtl92de_interrupt_recognized(struct ieee80211_hw *hw, 32 | u32 *p_inta, u32 *p_intb, 33 | u32 *p_intc, u32 *p_intd); 34 | int rtl92de_hw_init(struct ieee80211_hw *hw); 35 | void rtl92de_card_disable(struct ieee80211_hw *hw); 36 | void rtl92de_enable_interrupt(struct ieee80211_hw *hw); 37 | void rtl92de_disable_interrupt(struct ieee80211_hw *hw); 38 | int rtl92de_set_network_type(struct ieee80211_hw *hw, enum nl80211_iftype type); 39 | void rtl92de_set_check_bssid(struct ieee80211_hw *hw, bool check_bssid); 40 | void rtl92de_set_qos(struct ieee80211_hw *hw, int aci); 41 | void rtl92de_set_beacon_related_registers(struct ieee80211_hw *hw); 42 | void rtl92de_set_beacon_interval(struct ieee80211_hw *hw); 43 | void rtl92de_update_interrupt_mask(struct ieee80211_hw *hw, 44 | u32 add_msr, u32 rm_msr); 45 | void rtl92de_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val); 46 | void rtl92de_update_hal_rate_tbl(struct ieee80211_hw *hw, 47 | struct ieee80211_sta *sta, u8 rssi_level); 48 | void rtl92de_update_channel_access_setting(struct ieee80211_hw *hw); 49 | bool rtl92de_gpio_radio_on_off_checking(struct ieee80211_hw *hw, u8 *valid); 50 | void rtl92de_enable_hw_security_config(struct ieee80211_hw *hw); 51 | void rtl92de_set_key(struct ieee80211_hw *hw, u32 key_index, 52 | u8 *p_macaddr, bool is_group, u8 enc_algo, 53 | bool is_wepkey, bool clear_all); 54 | 55 | void rtl92de_write_dword_dbi(struct ieee80211_hw *hw, u16 offset, u32 value, 56 | u8 direct); 57 | u32 rtl92de_read_dword_dbi(struct ieee80211_hw *hw, u16 offset, u8 direct); 58 | void rtl92de_suspend(struct ieee80211_hw *hw); 59 | void rtl92de_resume(struct ieee80211_hw *hw); 60 | void rtl92d_linked_set_reg(struct ieee80211_hw *hw); 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /rtl8192de/led.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2009-2012 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | 26 | #ifndef __RTL92CE_LED_H__ 27 | #define __RTL92CE_LED_H__ 28 | 29 | void rtl92de_init_sw_leds(struct ieee80211_hw *hw); 30 | void rtl92de_sw_led_on(struct ieee80211_hw *hw, struct rtl_led *pled); 31 | void rtl92de_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled); 32 | void rtl92de_led_control(struct ieee80211_hw *hw, enum led_ctl_mode ledaction); 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /rtl8192de/rf.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2009-2012 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | 26 | #ifndef __RTL92D_RF_H__ 27 | #define __RTL92D_RF_H__ 28 | 29 | void rtl92d_phy_rf6052_set_bandwidth(struct ieee80211_hw *hw, u8 bandwidth); 30 | void rtl92d_phy_rf6052_set_cck_txpower(struct ieee80211_hw *hw, 31 | u8 *ppowerlevel); 32 | void rtl92d_phy_rf6052_set_ofdm_txpower(struct ieee80211_hw *hw, 33 | u8 *ppowerlevel, u8 channel); 34 | bool rtl92d_phy_rf6052_config(struct ieee80211_hw *hw); 35 | bool rtl92d_phy_enable_anotherphy(struct ieee80211_hw *hw, bool bmac0); 36 | void rtl92d_phy_powerdown_anotherphy(struct ieee80211_hw *hw, bool bmac0); 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /rtl8192de/sw.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2009-2012 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | 26 | #ifndef __RTL92DE_SW_H__ 27 | #define __RTL92DE_SW_H__ 28 | 29 | extern spinlock_t globalmutex_power; 30 | extern spinlock_t globalmutex_for_fwdownload; 31 | extern spinlock_t globalmutex_for_power_and_efuse; 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /rtl8192de/table.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2009-2012 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | * Created on 2010/ 5/18, 1:41 25 | *****************************************************************************/ 26 | 27 | #ifndef __RTL92DE_TABLE__H_ 28 | #define __RTL92DE_TABLE__H_ 29 | 30 | /*Created on 2011/ 1/14, 1:35*/ 31 | 32 | #define PHY_REG_2T_ARRAYLENGTH 380 33 | extern u32 rtl8192de_phy_reg_2tarray[PHY_REG_2T_ARRAYLENGTH]; 34 | #define PHY_REG_ARRAY_PG_LENGTH 624 35 | extern u32 rtl8192de_phy_reg_array_pg[PHY_REG_ARRAY_PG_LENGTH]; 36 | #define RADIOA_2T_ARRAYLENGTH 378 37 | extern u32 rtl8192de_radioa_2tarray[RADIOA_2T_ARRAYLENGTH]; 38 | #define RADIOB_2T_ARRAYLENGTH 384 39 | extern u32 rtl8192de_radiob_2tarray[RADIOB_2T_ARRAYLENGTH]; 40 | #define RADIOA_2T_INT_PA_ARRAYLENGTH 378 41 | extern u32 rtl8192de_radioa_2t_int_paarray[RADIOA_2T_INT_PA_ARRAYLENGTH]; 42 | #define RADIOB_2T_INT_PA_ARRAYLENGTH 384 43 | extern u32 rtl8192de_radiob_2t_int_paarray[RADIOB_2T_INT_PA_ARRAYLENGTH]; 44 | #define MAC_2T_ARRAYLENGTH 160 45 | extern u32 rtl8192de_mac_2tarray[MAC_2T_ARRAYLENGTH]; 46 | #define AGCTAB_ARRAYLENGTH 386 47 | extern u32 rtl8192de_agctab_array[AGCTAB_ARRAYLENGTH]; 48 | #define AGCTAB_5G_ARRAYLENGTH 194 49 | extern u32 rtl8192de_agctab_5garray[AGCTAB_5G_ARRAYLENGTH]; 50 | #define AGCTAB_2G_ARRAYLENGTH 194 51 | extern u32 rtl8192de_agctab_2garray[AGCTAB_2G_ARRAYLENGTH]; 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /rtl8192ee/Makefile: -------------------------------------------------------------------------------- 1 | rtl8192ee-objs := \ 2 | dm.o \ 3 | fw.o \ 4 | hw.o \ 5 | led.o \ 6 | phy.o \ 7 | pwrseq.o \ 8 | rf.o \ 9 | sw.o \ 10 | table.o \ 11 | trx.o \ 12 | 13 | 14 | obj-$(CONFIG_RTL8192EE) += rtl8192ee.o 15 | -------------------------------------------------------------------------------- /rtl8192ee/def.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2009-2014 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | 26 | #ifndef __RTL92E_DEF_H__ 27 | #define __RTL92E_DEF_H__ 28 | 29 | #define RX_DESC_NUM_92E 512 30 | 31 | #define HAL_PRIME_CHNL_OFFSET_DONT_CARE 0 32 | #define HAL_PRIME_CHNL_OFFSET_LOWER 1 33 | #define HAL_PRIME_CHNL_OFFSET_UPPER 2 34 | 35 | #define RX_MPDU_QUEUE 0 36 | 37 | #define IS_HT_RATE(_rate) \ 38 | (_rate >= DESC92C_RATEMCS0) 39 | #define IS_CCK_RATE(_rate) \ 40 | (_rate >= DESC92C_RATE1M && _rate <= DESC92C_RATE11M) 41 | #define IS_OFDM_RATE(_rate) \ 42 | (_rate >= DESC92C_RATE6M && _rate <= DESC92C_RATE54M) 43 | 44 | enum version_8192e { 45 | VERSION_TEST_CHIP_2T2R_8192E = 0x0024, 46 | VERSION_NORMAL_CHIP_2T2R_8192E = 0x102C, 47 | VERSION_UNKNOWN = 0xFF, 48 | }; 49 | 50 | enum rx_packet_type { 51 | NORMAL_RX, 52 | TX_REPORT1, 53 | TX_REPORT2, 54 | HIS_REPORT, 55 | C2H_PACKET, 56 | }; 57 | 58 | enum rtl_desc_qsel { 59 | QSLT_BK = 0x2, 60 | QSLT_BE = 0x0, 61 | QSLT_VI = 0x5, 62 | QSLT_VO = 0x7, 63 | QSLT_BEACON = 0x10, 64 | QSLT_HIGH = 0x11, 65 | QSLT_MGNT = 0x12, 66 | QSLT_CMD = 0x13, 67 | }; 68 | 69 | enum rtl_desc92c_rate { 70 | DESC92C_RATE1M = 0x00, 71 | DESC92C_RATE2M = 0x01, 72 | DESC92C_RATE5_5M = 0x02, 73 | DESC92C_RATE11M = 0x03, 74 | 75 | DESC92C_RATE6M = 0x04, 76 | DESC92C_RATE9M = 0x05, 77 | DESC92C_RATE12M = 0x06, 78 | DESC92C_RATE18M = 0x07, 79 | DESC92C_RATE24M = 0x08, 80 | DESC92C_RATE36M = 0x09, 81 | DESC92C_RATE48M = 0x0a, 82 | DESC92C_RATE54M = 0x0b, 83 | 84 | DESC92C_RATEMCS0 = 0x0c, 85 | DESC92C_RATEMCS1 = 0x0d, 86 | DESC92C_RATEMCS2 = 0x0e, 87 | DESC92C_RATEMCS3 = 0x0f, 88 | DESC92C_RATEMCS4 = 0x10, 89 | DESC92C_RATEMCS5 = 0x11, 90 | DESC92C_RATEMCS6 = 0x12, 91 | DESC92C_RATEMCS7 = 0x13, 92 | DESC92C_RATEMCS8 = 0x14, 93 | DESC92C_RATEMCS9 = 0x15, 94 | DESC92C_RATEMCS10 = 0x16, 95 | DESC92C_RATEMCS11 = 0x17, 96 | DESC92C_RATEMCS12 = 0x18, 97 | DESC92C_RATEMCS13 = 0x19, 98 | DESC92C_RATEMCS14 = 0x1a, 99 | DESC92C_RATEMCS15 = 0x1b, 100 | }; 101 | #endif 102 | -------------------------------------------------------------------------------- /rtl8192ee/led.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2009-2014 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | 26 | #ifndef __RTL92E_LED_H__ 27 | #define __RTL92E_LED_H__ 28 | 29 | void rtl92ee_init_sw_leds(struct ieee80211_hw *hw); 30 | void rtl92ee_sw_led_on(struct ieee80211_hw *hw, struct rtl_led *pled); 31 | void rtl92ee_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled); 32 | void rtl92ee_led_control(struct ieee80211_hw *hw, enum led_ctl_mode ledaction); 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /rtl8192ee/rf.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2009-2014 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | 26 | #ifndef __RTL92E_RF_H__ 27 | #define __RTL92E_RF_H__ 28 | 29 | #define RF6052_MAX_TX_PWR 0x3F 30 | 31 | void rtl92ee_phy_rf6052_set_bandwidth(struct ieee80211_hw *hw, 32 | u8 bandwidth); 33 | bool rtl92ee_phy_rf6052_config(struct ieee80211_hw *hw); 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /rtl8192ee/sw.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2009-2014 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | 26 | #ifndef __RTL92E_SW_H__ 27 | #define __RTL92E_SW_H__ 28 | 29 | int rtl92ee_init_sw_vars(struct ieee80211_hw *hw); 30 | void rtl92ee_deinit_sw_vars(struct ieee80211_hw *hw); 31 | bool rtl92ee_get_btc_status(void); 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /rtl8192ee/table.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2009-2014 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Created on 2010/ 5/18, 1:41 23 | * 24 | * Larry Finger 25 | * 26 | *****************************************************************************/ 27 | 28 | #ifndef __RTL92E_TABLE__H_ 29 | #define __RTL92E_TABLE__H_ 30 | 31 | #include 32 | #define RTL8192EE_PHY_REG_ARRAY_LEN 448 33 | extern u32 RTL8192EE_PHY_REG_ARRAY[]; 34 | #define RTL8192EE_PHY_REG_ARRAY_PG_LEN 168 35 | extern u32 RTL8192EE_PHY_REG_ARRAY_PG[]; 36 | #define RTL8192EE_RADIOA_ARRAY_LEN 238 37 | extern u32 RTL8192EE_RADIOA_ARRAY[]; 38 | #define RTL8192EE_RADIOB_ARRAY_LEN 198 39 | extern u32 RTL8192EE_RADIOB_ARRAY[]; 40 | #define RTL8192EE_MAC_ARRAY_LEN 202 41 | extern u32 RTL8192EE_MAC_ARRAY[]; 42 | #define RTL8192EE_AGC_TAB_ARRAY_LEN 532 43 | extern u32 RTL8192EE_AGC_TAB_ARRAY[]; 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /rtl8192se/Makefile: -------------------------------------------------------------------------------- 1 | rtl8192se-objs := \ 2 | dm.o \ 3 | fw.o \ 4 | hw.o \ 5 | led.o \ 6 | phy.o \ 7 | rf.o \ 8 | sw.o \ 9 | table.o \ 10 | trx.o 11 | 12 | obj-$(CONFIG_RTL8192SE) += rtl8192se.o 13 | 14 | -------------------------------------------------------------------------------- /rtl8192se/dm.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2009-2012 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | #ifndef __RTL_92S_DM_H__ 26 | #define __RTL_92S_DM_H__ 27 | 28 | enum dm_dig_alg { 29 | DIG_ALGO_BY_FALSE_ALARM = 0, 30 | DIG_ALGO_BY_RSSI = 1, 31 | DIG_ALGO_BEFORE_CONNECT_BY_RSSI_AND_ALARM = 2, 32 | DIG_ALGO_BY_TOW_PORT = 3, 33 | DIG_ALGO_MAX 34 | }; 35 | 36 | enum dm_dig_two_port_alg { 37 | DIG_TWO_PORT_ALGO_RSSI = 0, 38 | DIG_TWO_PORT_ALGO_FALSE_ALARM = 1, 39 | }; 40 | 41 | enum dm_dig_dbg { 42 | DM_DBG_OFF = 0, 43 | DM_DBG_ON = 1, 44 | DM_DBG_MAX 45 | }; 46 | 47 | enum dm_dig_sta { 48 | DM_STA_DIG_OFF = 0, 49 | DM_STA_DIG_ON, 50 | DM_STA_DIG_MAX 51 | }; 52 | 53 | enum dm_ratr_sta { 54 | DM_RATR_STA_HIGH = 0, 55 | DM_RATR_STA_MIDDLEHIGH = 1, 56 | DM_RATR_STA_MIDDLE = 2, 57 | DM_RATR_STA_MIDDLELOW = 3, 58 | DM_RATR_STA_LOW = 4, 59 | DM_RATR_STA_ULTRALOW = 5, 60 | DM_RATR_STA_MAX 61 | }; 62 | 63 | #define DM_TYPE_BYFW 0 64 | #define DM_TYPE_BYDRIVER 1 65 | 66 | #define TX_HIGH_PWR_LEVEL_NORMAL 0 67 | #define TX_HIGH_PWR_LEVEL_LEVEL1 1 68 | #define TX_HIGH_PWR_LEVEL_LEVEL2 2 69 | 70 | #define HAL_DM_DIG_DISABLE BIT(0) /* Disable Dig */ 71 | #define HAL_DM_HIPWR_DISABLE BIT(1) /* Disable High Power */ 72 | 73 | #define TX_HIGHPWR_LEVEL_NORMAL 0 74 | #define TX_HIGHPWR_LEVEL_NORMAL1 1 75 | #define TX_HIGHPWR_LEVEL_NORMAL2 2 76 | 77 | #define TX_POWER_NEAR_FIELD_THRESH_LVL2 74 78 | #define TX_POWER_NEAR_FIELD_THRESH_LVL1 67 79 | 80 | #define DM_DIG_HIGH_PWR_THRESH_HIGH 75 81 | #define DM_DIG_HIGH_PWR_THRESH_LOW 70 82 | #define DM_DIG_MIN_Netcore 0x12 83 | 84 | void rtl92s_dm_watchdog(struct ieee80211_hw *hw); 85 | void rtl92s_dm_init(struct ieee80211_hw *hw); 86 | void rtl92s_dm_init_edca_turbo(struct ieee80211_hw *hw); 87 | 88 | #endif 89 | -------------------------------------------------------------------------------- /rtl8192se/led.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2009-2012 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | #ifndef __REALTEK_PCI92SE_LED_H__ 26 | #define __REALTEK_PCI92SE_LED_H__ 27 | 28 | void rtl92se_init_sw_leds(struct ieee80211_hw *hw); 29 | void rtl92se_sw_led_on(struct ieee80211_hw *hw, struct rtl_led *pled); 30 | void rtl92se_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled); 31 | void rtl92se_led_control(struct ieee80211_hw *hw, enum led_ctl_mode ledaction); 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /rtl8192se/rf.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2009-2012 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | #ifndef __INC_RTL92S_RF_H 26 | #define __INC_RTL92S_RF_H 27 | 28 | #define RF6052_MAX_TX_PWR 0x3F 29 | 30 | void rtl92s_phy_rf6052_set_bandwidth(struct ieee80211_hw *hw, 31 | u8 bandwidth); 32 | bool rtl92s_phy_rf6052_config(struct ieee80211_hw *hw) ; 33 | void rtl92s_phy_rf6052_set_ccktxpower(struct ieee80211_hw *hw, 34 | u8 powerlevel); 35 | void rtl92s_phy_rf6052_set_ofdmtxpower(struct ieee80211_hw *hw, 36 | u8 *p_pwrlevel, u8 chnl); 37 | 38 | #endif 39 | 40 | -------------------------------------------------------------------------------- /rtl8192se/sw.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2009-2012 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | *****************************************************************************/ 23 | #ifndef __REALTEK_PCI92SE_SW_H__ 24 | #define __REALTEK_PCI92SE_SW_H__ 25 | 26 | #define EFUSE_MAX_SECTION 16 27 | 28 | int rtl92se_init_sw(struct ieee80211_hw *hw); 29 | void rtl92se_deinit_sw(struct ieee80211_hw *hw); 30 | void rtl92se_init_var_map(struct ieee80211_hw *hw); 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /rtl8192se/table.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Copyright(c) 2008 - 2012 Realtek Corporation. All rights reserved. 3 | * 4 | * This program is distributed in the hope that it will be useful, but WITHOUT 5 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 6 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 7 | * more details. 8 | * 9 | * The full GNU General Public License is included in this distribution in the 10 | * file called LICENSE. 11 | * 12 | * Contact Information: 13 | * wlanfae 14 | * 15 | * Larry Finger 16 | * 17 | ******************************************************************************/ 18 | #ifndef __INC_HAL8192SE_FW_IMG_H 19 | #define __INC_HAL8192SE_FW_IMG_H 20 | 21 | #include 22 | 23 | /*Created on 2010/ 4/12, 5:56*/ 24 | 25 | #define PHY_REG_2T2RARRAYLENGTH 372 26 | extern u32 rtl8192sephy_reg_2t2rarray[PHY_REG_2T2RARRAYLENGTH]; 27 | #define PHY_CHANGETO_1T1RARRAYLENGTH 48 28 | extern u32 rtl8192sephy_changeto_1t1rarray[PHY_CHANGETO_1T1RARRAYLENGTH]; 29 | #define PHY_CHANGETO_1T2RARRAYLENGTH 45 30 | extern u32 rtl8192sephy_changeto_1t2rarray[PHY_CHANGETO_1T2RARRAYLENGTH]; 31 | #define PHY_REG_ARRAY_PGLENGTH 84 32 | extern u32 rtl8192sephy_reg_array_pg[PHY_REG_ARRAY_PGLENGTH]; 33 | #define RADIOA_1T_ARRAYLENGTH 202 34 | extern u32 rtl8192seradioa_1t_array[RADIOA_1T_ARRAYLENGTH]; 35 | #define RADIOB_ARRAYLENGTH 22 36 | extern u32 rtl8192seradiob_array[RADIOB_ARRAYLENGTH]; 37 | #define RADIOB_GM_ARRAYLENGTH 10 38 | extern u32 rtl8192seradiob_gm_array[RADIOB_GM_ARRAYLENGTH]; 39 | #define MAC_2T_ARRAYLENGTH 106 40 | extern u32 rtl8192semac_2t_array[MAC_2T_ARRAYLENGTH]; 41 | #define AGCTAB_ARRAYLENGTH 320 42 | extern u32 rtl8192seagctab_array[AGCTAB_ARRAYLENGTH]; 43 | 44 | #endif 45 | 46 | -------------------------------------------------------------------------------- /rtl8192se/trx.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2009-2012 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | #ifndef __REALTEK_PCI92SE_TRX_H__ 26 | #define __REALTEK_PCI92SE_TRX_H__ 27 | 28 | void rtl92se_tx_fill_desc(struct ieee80211_hw *hw, 29 | struct ieee80211_hdr *hdr, u8 *pdesc, 30 | u8 *pbd_desc_tx, struct ieee80211_tx_info *info, 31 | struct ieee80211_sta *sta, 32 | struct sk_buff *skb, u8 hw_queue, 33 | struct rtl_tcb_desc *ptcb_desc); 34 | void rtl92se_tx_fill_cmddesc(struct ieee80211_hw *hw, u8 *pdesc, bool firstseg, 35 | bool lastseg, struct sk_buff *skb); 36 | bool rtl92se_rx_query_desc(struct ieee80211_hw *hw, struct rtl_stats *stats, 37 | struct ieee80211_rx_status *rx_status, u8 *pdesc, 38 | struct sk_buff *skb); 39 | void rtl92se_set_desc(struct ieee80211_hw *hw, u8 *pdesc, bool istx, 40 | u8 desc_name, u8 *val); 41 | u32 rtl92se_get_desc(u8 *pdesc, bool istx, u8 desc_name); 42 | void rtl92se_tx_polling(struct ieee80211_hw *hw, u8 hw_queue); 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /rtl8723ae/Makefile: -------------------------------------------------------------------------------- 1 | rtl8723ae-objs := \ 2 | dm.o \ 3 | fw.o \ 4 | hal_btc.o \ 5 | hal_bt_coexist.o\ 6 | hw.o \ 7 | led.o \ 8 | phy.o \ 9 | pwrseq.o \ 10 | rf.o \ 11 | sw.o \ 12 | table.o \ 13 | trx.o \ 14 | 15 | 16 | obj-$(CONFIG_RTL8723AE) += rtl8723ae.o 17 | -------------------------------------------------------------------------------- /rtl8723ae/btc.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | ** 3 | ** Copyright(c) 2009-2012 Realtek Corporation. 4 | ** 5 | ** This program is free software; you can redistribute it and/or modify it 6 | ** under the terms of version 2 of the GNU General Public License as 7 | ** published by the Free Software Foundation. 8 | ** 9 | ** This program is distributed in the hope that it will be useful, but WITHOUT 10 | ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | ** more details. 13 | ** 14 | ** The full GNU General Public License is included in this distribution in the 15 | ** file called LICENSE. 16 | ** 17 | ** Contact Information: 18 | ** wlanfae 19 | ** Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | ** Hsinchu 300, Taiwan. 21 | ** Larry Finger 22 | ** 23 | ******************************************************************************/ 24 | 25 | #ifndef __RTL8723E_BTC_H__ 26 | #define __RTL8723E_BTC_H__ 27 | 28 | #include "../wifi.h" 29 | #include "hal_bt_coexist.h" 30 | 31 | struct bt_coexist_c2h_info { 32 | u8 no_parse_c2h; 33 | u8 has_c2h; 34 | }; 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /rtl8723ae/fw.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2009-2012 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * Larry Finger 22 | * 23 | *****************************************************************************/ 24 | 25 | #ifndef __RTL92C__FW__H__ 26 | #define __RTL92C__FW__H__ 27 | 28 | #define FW_8192C_SIZE 0x3000 29 | #define FW_8192C_START_ADDRESS 0x1000 30 | #define FW_8192C_END_ADDRESS 0x3FFF 31 | #define FW_8192C_PAGE_SIZE 4096 32 | #define FW_8192C_POLLING_DELAY 5 33 | 34 | #define IS_FW_HEADER_EXIST(_pfwhdr) \ 35 | ((_pfwhdr->signature&0xFFFF) == 0x2300 ||\ 36 | (_pfwhdr->signature&0xFFFF) == 0x2301 ||\ 37 | (_pfwhdr->signature&0xFFFF) == 0x2302) 38 | 39 | #define pagenum_128(_len) (u32)(((_len)>>7) + ((_len)&0x7F ? 1 : 0)) 40 | 41 | #define SET_H2CCMD_PWRMODE_PARM_MODE(__ph2ccmd, __val) \ 42 | SET_BITS_TO_LE_1BYTE(__ph2ccmd, 0, 8, __val) 43 | #define SET_H2CCMD_PWRMODE_PARM_SMART_PS(__ph2ccmd, __val) \ 44 | SET_BITS_TO_LE_1BYTE((__ph2ccmd)+1, 0, 8, __val) 45 | #define SET_H2CCMD_PWRMODE_PARM_BCN_PASS_TIME(__ph2ccmd, __val) \ 46 | SET_BITS_TO_LE_1BYTE((__ph2ccmd)+2, 0, 8, __val) 47 | #define SET_H2CCMD_JOINBSSRPT_PARM_OPMODE(__ph2ccmd, __val) \ 48 | SET_BITS_TO_LE_1BYTE(__ph2ccmd, 0, 8, __val) 49 | #define SET_H2CCMD_RSVDPAGE_LOC_PROBE_RSP(__ph2ccmd, __val) \ 50 | SET_BITS_TO_LE_1BYTE(__ph2ccmd, 0, 8, __val) 51 | #define SET_H2CCMD_RSVDPAGE_LOC_PSPOLL(__ph2ccmd, __val) \ 52 | SET_BITS_TO_LE_1BYTE((__ph2ccmd)+1, 0, 8, __val) 53 | #define SET_H2CCMD_RSVDPAGE_LOC_NULL_DATA(__ph2ccmd, __val) \ 54 | SET_BITS_TO_LE_1BYTE((__ph2ccmd)+2, 0, 8, __val) 55 | 56 | void rtl8723e_fill_h2c_cmd(struct ieee80211_hw *hw, u8 element_id, 57 | u32 cmd_len, u8 *p_cmdbuffer); 58 | void rtl8723e_set_fw_pwrmode_cmd(struct ieee80211_hw *hw, u8 mode); 59 | void rtl8723e_set_fw_rsvdpagepkt(struct ieee80211_hw *hw, bool b_dl_finished); 60 | void rtl8723e_set_fw_joinbss_report_cmd(struct ieee80211_hw *hw, u8 mstatus); 61 | void rtl8723e_set_p2p_ps_offload_cmd(struct ieee80211_hw *hw, u8 p2p_ps_state); 62 | #endif 63 | -------------------------------------------------------------------------------- /rtl8723ae/led.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2009-2012 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | 26 | #ifndef __RTL92CE_LED_H__ 27 | #define __RTL92CE_LED_H__ 28 | 29 | void rtl8723e_init_sw_leds(struct ieee80211_hw *hw); 30 | void rtl8723e_sw_led_on(struct ieee80211_hw *hw, struct rtl_led *pled); 31 | void rtl8723e_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled); 32 | void rtl8723e_led_control(struct ieee80211_hw *hw, enum led_ctl_mode ledaction); 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /rtl8723ae/rf.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2009-2012 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | 26 | #ifndef __RTL8723E_RF_H__ 27 | #define __RTL8723E_RF_H__ 28 | 29 | #define RF6052_MAX_TX_PWR 0x3F 30 | 31 | void rtl8723e_phy_rf6052_set_bandwidth(struct ieee80211_hw *hw, 32 | u8 bandwidth); 33 | void rtl8723e_phy_rf6052_set_cck_txpower(struct ieee80211_hw *hw, 34 | u8 *ppowerlevel); 35 | void rtl8723e_phy_rf6052_set_ofdm_txpower(struct ieee80211_hw *hw, 36 | u8 *ppowerlevel, u8 channel); 37 | bool rtl8723e_phy_rf6052_config(struct ieee80211_hw *hw); 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /rtl8723ae/sw.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2009-2012 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | 26 | #ifndef __RTL8723E_SW_H__ 27 | #define __RTL8723E_SW_H__ 28 | 29 | int rtl8723e_init_sw_vars(struct ieee80211_hw *hw); 30 | void rtl8723e_deinit_sw_vars(struct ieee80211_hw *hw); 31 | void rtl8723e_init_var_map(struct ieee80211_hw *hw); 32 | bool rtl8723e_get_btc_status(void); 33 | 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /rtl8723ae/table.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2009-2012 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Created on 2010/ 5/18, 1:41 23 | * 24 | * Larry Finger 25 | * 26 | *****************************************************************************/ 27 | 28 | #ifndef __RTL8723E_TABLE__H_ 29 | #define __RTL8723E_TABLE__H_ 30 | 31 | #include 32 | 33 | #define RTL8723E_PHY_REG_1TARRAY_LENGTH 372 34 | extern u32 RTL8723EPHY_REG_1TARRAY[RTL8723E_PHY_REG_1TARRAY_LENGTH]; 35 | #define RTL8723E_PHY_REG_ARRAY_PGLENGTH 336 36 | extern u32 RTL8723EPHY_REG_ARRAY_PG[RTL8723E_PHY_REG_ARRAY_PGLENGTH]; 37 | #define RTL8723ERADIOA_1TARRAYLENGTH 282 38 | extern u32 RTL8723E_RADIOA_1TARRAY[RTL8723ERADIOA_1TARRAYLENGTH]; 39 | #define RTL8723E_RADIOB_1TARRAYLENGTH 1 40 | extern u32 RTL8723E_RADIOB_1TARRAY[RTL8723E_RADIOB_1TARRAYLENGTH]; 41 | #define RTL8723E_MACARRAYLENGTH 172 42 | extern u32 RTL8723EMAC_ARRAY[RTL8723E_MACARRAYLENGTH]; 43 | #define RTL8723E_AGCTAB_1TARRAYLENGTH 320 44 | extern u32 RTL8723EAGCTAB_1TARRAY[RTL8723E_AGCTAB_1TARRAYLENGTH]; 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /rtl8723be/Makefile: -------------------------------------------------------------------------------- 1 | rtl8723be-objs := \ 2 | dm.o \ 3 | fw.o \ 4 | hw.o \ 5 | led.o \ 6 | phy.o \ 7 | pwrseq.o \ 8 | rf.o \ 9 | sw.o \ 10 | table.o \ 11 | trx.o \ 12 | 13 | 14 | obj-$(CONFIG_RTL8723BE) += rtl8723be.o 15 | -------------------------------------------------------------------------------- /rtl8723be/def.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2009-2014 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | 26 | #ifndef __RTL8723BE_DEF_H__ 27 | #define __RTL8723BE_DEF_H__ 28 | 29 | #define HAL_PRIME_CHNL_OFFSET_DONT_CARE 0 30 | #define HAL_PRIME_CHNL_OFFSET_LOWER 1 31 | #define HAL_PRIME_CHNL_OFFSET_UPPER 2 32 | 33 | 34 | #define RX_MPDU_QUEUE 0 35 | #define CHIP_8723B (BIT(1) | BIT(2)) 36 | #define NORMAL_CHIP BIT(3) 37 | #define CHIP_VENDOR_SMIC BIT(8) 38 | /* Currently only for RTL8723B */ 39 | #define EXT_VENDOR_ID (BIT(18) | BIT(19)) 40 | 41 | enum rx_packet_type { 42 | NORMAL_RX, 43 | TX_REPORT1, 44 | TX_REPORT2, 45 | HIS_REPORT, 46 | C2H_PACKET, 47 | }; 48 | 49 | enum rtl_desc_qsel { 50 | QSLT_BK = 0x2, 51 | QSLT_BE = 0x0, 52 | QSLT_VI = 0x5, 53 | QSLT_VO = 0x7, 54 | QSLT_BEACON = 0x10, 55 | QSLT_HIGH = 0x11, 56 | QSLT_MGNT = 0x12, 57 | QSLT_CMD = 0x13, 58 | }; 59 | 60 | enum rtl_desc8723e_rate { 61 | DESC92C_RATE1M = 0x00, 62 | DESC92C_RATE2M = 0x01, 63 | DESC92C_RATE5_5M = 0x02, 64 | DESC92C_RATE11M = 0x03, 65 | 66 | DESC92C_RATE6M = 0x04, 67 | DESC92C_RATE9M = 0x05, 68 | DESC92C_RATE12M = 0x06, 69 | DESC92C_RATE18M = 0x07, 70 | DESC92C_RATE24M = 0x08, 71 | DESC92C_RATE36M = 0x09, 72 | DESC92C_RATE48M = 0x0a, 73 | DESC92C_RATE54M = 0x0b, 74 | 75 | DESC92C_RATEMCS0 = 0x0c, 76 | DESC92C_RATEMCS1 = 0x0d, 77 | DESC92C_RATEMCS2 = 0x0e, 78 | DESC92C_RATEMCS3 = 0x0f, 79 | DESC92C_RATEMCS4 = 0x10, 80 | DESC92C_RATEMCS5 = 0x11, 81 | DESC92C_RATEMCS6 = 0x12, 82 | DESC92C_RATEMCS7 = 0x13, 83 | DESC92C_RATEMCS8 = 0x14, 84 | DESC92C_RATEMCS9 = 0x15, 85 | DESC92C_RATEMCS10 = 0x16, 86 | DESC92C_RATEMCS11 = 0x17, 87 | DESC92C_RATEMCS12 = 0x18, 88 | DESC92C_RATEMCS13 = 0x19, 89 | DESC92C_RATEMCS14 = 0x1a, 90 | DESC92C_RATEMCS15 = 0x1b, 91 | }; 92 | #endif 93 | -------------------------------------------------------------------------------- /rtl8723be/hw.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2009-2014 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | 26 | #ifndef __RTL8723BE_HW_H__ 27 | #define __RTL8723BE_HW_H__ 28 | 29 | void rtl8723be_get_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val); 30 | void rtl8723be_read_eeprom_info(struct ieee80211_hw *hw); 31 | 32 | void rtl8723be_interrupt_recognized(struct ieee80211_hw *hw, 33 | u32 *p_inta, u32 *p_intb, 34 | u32 *p_intc, u32 *p_intd); 35 | int rtl8723be_hw_init(struct ieee80211_hw *hw); 36 | void rtl8723be_card_disable(struct ieee80211_hw *hw); 37 | void rtl8723be_enable_interrupt(struct ieee80211_hw *hw); 38 | void rtl8723be_disable_interrupt(struct ieee80211_hw *hw); 39 | int rtl8723be_set_network_type(struct ieee80211_hw *hw, 40 | enum nl80211_iftype type); 41 | void rtl8723be_set_check_bssid(struct ieee80211_hw *hw, bool check_bssid); 42 | void rtl8723be_set_qos(struct ieee80211_hw *hw, int aci); 43 | void rtl8723be_set_beacon_related_registers(struct ieee80211_hw *hw); 44 | void rtl8723be_set_beacon_interval(struct ieee80211_hw *hw); 45 | void rtl8723be_update_interrupt_mask(struct ieee80211_hw *hw, 46 | u32 add_msr, u32 rm_msr); 47 | void rtl8723be_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val); 48 | void rtl8723be_update_hal_rate_tbl(struct ieee80211_hw *hw, 49 | struct ieee80211_sta *sta, 50 | u8 rssi_level); 51 | void rtl8723be_update_channel_access_setting(struct ieee80211_hw *hw); 52 | bool rtl8723be_gpio_radio_on_off_checking(struct ieee80211_hw *hw, u8 *valid); 53 | void rtl8723be_enable_hw_security_config(struct ieee80211_hw *hw); 54 | void rtl8723be_set_key(struct ieee80211_hw *hw, u32 key_index, 55 | u8 *p_macaddr, bool is_group, u8 enc_algo, 56 | bool is_wepkey, bool clear_all); 57 | void rtl8723be_read_bt_coexist_info_from_hwpg(struct ieee80211_hw *hw, 58 | bool autoload_fail, u8 *hwinfo); 59 | void rtl8723be_bt_reg_init(struct ieee80211_hw *hw); 60 | void rtl8723be_bt_hw_init(struct ieee80211_hw *hw); 61 | void rtl8723be_suspend(struct ieee80211_hw *hw); 62 | void rtl8723be_resume(struct ieee80211_hw *hw); 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /rtl8723be/led.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2009-2014 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | 26 | #ifndef __RTL8723BE_LED_H__ 27 | #define __RTL8723BE_LED_H__ 28 | 29 | void rtl8723be_init_sw_leds(struct ieee80211_hw *hw); 30 | void rtl8723be_sw_led_on(struct ieee80211_hw *hw, struct rtl_led *pled); 31 | void rtl8723be_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled); 32 | void rtl8723be_led_control(struct ieee80211_hw *hw, 33 | enum led_ctl_mode ledaction); 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /rtl8723be/rf.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2009-2014 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | 26 | #ifndef __RTL8723BE_RF_H__ 27 | #define __RTL8723BE_RF_H__ 28 | 29 | #define RF6052_MAX_TX_PWR 0x3F 30 | 31 | void rtl8723be_phy_rf6052_set_bandwidth(struct ieee80211_hw *hw, 32 | u8 bandwidth); 33 | void rtl8723be_phy_rf6052_set_cck_txpower(struct ieee80211_hw *hw, 34 | u8 *ppowerlevel); 35 | void rtl8723be_phy_rf6052_set_ofdm_txpower(struct ieee80211_hw *hw, 36 | u8 *ppowerlevel_ofdm, 37 | u8 *ppowerlevel_bw20, 38 | u8 *ppowerlevel_bw40, 39 | u8 channel); 40 | bool rtl8723be_phy_rf6052_config(struct ieee80211_hw *hw); 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /rtl8723be/sw.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2009-2014 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | 26 | #ifndef __RTL8723BE_SW_H__ 27 | #define __RTL8723BE_SW_H__ 28 | 29 | int rtl8723be_init_sw_vars(struct ieee80211_hw *hw); 30 | void rtl8723be_deinit_sw_vars(struct ieee80211_hw *hw); 31 | void rtl8723be_init_var_map(struct ieee80211_hw *hw); 32 | bool rtl8723be_get_btc_status(void); 33 | 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /rtl8723be/table.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2009-2014 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Created on 2010/ 5/18, 1:41 23 | * 24 | * Larry Finger 25 | * 26 | *****************************************************************************/ 27 | 28 | #ifndef __RTL8723BE_TABLE__H_ 29 | #define __RTL8723BE_TABLE__H_ 30 | 31 | #include 32 | #define RTL8723BEPHY_REG_1TARRAYLEN 388 33 | extern u32 RTL8723BEPHY_REG_1TARRAY[]; 34 | #define RTL8723BEPHY_REG_ARRAY_PGLEN 36 35 | extern u32 RTL8723BEPHY_REG_ARRAY_PG[]; 36 | #define RTL8723BE_RADIOA_1TARRAYLEN 206 37 | extern u32 RTL8723BE_RADIOA_1TARRAY[]; 38 | #define RTL8723BEMAC_1T_ARRAYLEN 196 39 | extern u32 RTL8723BEMAC_1T_ARRAY[]; 40 | #define RTL8723BEAGCTAB_1TARRAYLEN 260 41 | extern u32 RTL8723BEAGCTAB_1TARRAY[]; 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /rtl8723com/Makefile: -------------------------------------------------------------------------------- 1 | rtl8723-common-objs := \ 2 | main.o \ 3 | dm_common.o \ 4 | fw_common.o \ 5 | phy_common.o 6 | 7 | obj-$(CONFIG_RTL8723_COMMON) += rtl8723-common.o 8 | -------------------------------------------------------------------------------- /rtl8723com/dm_common.c: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2009-2014 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | 26 | #include "../wifi.h" 27 | #include "dm_common.h" 28 | #include "../rtl8723ae/dm.h" 29 | #include 30 | 31 | /* These routines are common to RTL8723AE and RTL8723bE */ 32 | 33 | void rtl8723_dm_init_dynamic_txpower(struct ieee80211_hw *hw) 34 | { 35 | struct rtl_priv *rtlpriv = rtl_priv(hw); 36 | 37 | rtlpriv->dm.dynamic_txpower_enable = false; 38 | 39 | rtlpriv->dm.last_dtp_lvl = TXHIGHPWRLEVEL_NORMAL; 40 | rtlpriv->dm.dynamic_txhighpower_lvl = TXHIGHPWRLEVEL_NORMAL; 41 | } 42 | EXPORT_SYMBOL_GPL(rtl8723_dm_init_dynamic_txpower); 43 | 44 | void rtl8723_dm_init_edca_turbo(struct ieee80211_hw *hw) 45 | { 46 | struct rtl_priv *rtlpriv = rtl_priv(hw); 47 | rtlpriv->dm.current_turbo_edca = false; 48 | rtlpriv->dm.is_any_nonbepkts = false; 49 | rtlpriv->dm.is_cur_rdlstate = false; 50 | } 51 | EXPORT_SYMBOL_GPL(rtl8723_dm_init_edca_turbo); 52 | 53 | void rtl8723_dm_init_dynamic_bb_powersaving(struct ieee80211_hw *hw) 54 | { 55 | struct rtl_priv *rtlpriv = rtl_priv(hw); 56 | struct ps_t *dm_pstable = &rtlpriv->dm_pstable; 57 | 58 | dm_pstable->pre_ccastate = CCA_MAX; 59 | dm_pstable->cur_ccasate = CCA_MAX; 60 | dm_pstable->pre_rfstate = RF_MAX; 61 | dm_pstable->cur_rfstate = RF_MAX; 62 | dm_pstable->rssi_val_min = 0; 63 | dm_pstable->initialize = 0; 64 | } 65 | EXPORT_SYMBOL_GPL(rtl8723_dm_init_dynamic_bb_powersaving); 66 | -------------------------------------------------------------------------------- /rtl8723com/dm_common.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2009-2014 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | 26 | #ifndef __DM_COMMON_H__ 27 | #define __DM_COMMON_H__ 28 | 29 | void rtl8723_dm_init_dynamic_txpower(struct ieee80211_hw *hw); 30 | void rtl8723_dm_init_edca_turbo(struct ieee80211_hw *hw); 31 | void rtl8723_dm_init_dynamic_bb_powersaving(struct ieee80211_hw *hw); 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /rtl8723com/main.c: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2009-2014 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | 26 | #include "../wifi.h" 27 | #include 28 | 29 | 30 | MODULE_AUTHOR("Realtek WlanFAE "); 31 | MODULE_AUTHOR("Larry Finger "); 32 | MODULE_LICENSE("GPL"); 33 | MODULE_DESCRIPTION("Realtek RTL8723AE/RTL8723BE 802.11n PCI wireless common routines"); 34 | -------------------------------------------------------------------------------- /rtl8821ae/Makefile: -------------------------------------------------------------------------------- 1 | rtl8821ae-objs := \ 2 | dm.o \ 3 | fw.o \ 4 | hw.o \ 5 | led.o \ 6 | phy.o \ 7 | pwrseq.o \ 8 | rf.o \ 9 | sw.o \ 10 | table.o \ 11 | trx.o \ 12 | 13 | 14 | obj-$(CONFIG_RTL8821AE) += rtl8821ae.o 15 | -------------------------------------------------------------------------------- /rtl8821ae/led.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2009-2010 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | 26 | #ifndef __RTL8821AE_LED_H__ 27 | #define __RTL8821AE_LED_H__ 28 | 29 | void rtl8821ae_init_sw_leds(struct ieee80211_hw *hw); 30 | void rtl8821ae_sw_led_on(struct ieee80211_hw *hw, struct rtl_led *pled); 31 | void rtl8812ae_sw_led_on(struct ieee80211_hw *hw, struct rtl_led *pled); 32 | void rtl8821ae_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled); 33 | void rtl8812ae_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled); 34 | void rtl8821ae_led_control(struct ieee80211_hw *hw, 35 | enum led_ctl_mode ledaction); 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /rtl8821ae/rf.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2009-2010 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | 26 | #ifndef __RTL8821AE_RF_H__ 27 | #define __RTL8821AE_RF_H__ 28 | 29 | #define RF6052_MAX_TX_PWR 0x3F 30 | 31 | void rtl8821ae_phy_rf6052_set_bandwidth(struct ieee80211_hw *hw, 32 | u8 bandwidth); 33 | void rtl8821ae_phy_rf6052_set_cck_txpower(struct ieee80211_hw *hw, 34 | u8 *ppowerlevel); 35 | void rtl8821ae_phy_rf6052_set_ofdm_txpower(struct ieee80211_hw *hw, 36 | u8 *ppowerlevel_ofdm, 37 | u8 *ppowerlevel_bw20, 38 | u8 *ppowerlevel_bw40, 39 | u8 channel); 40 | bool rtl8821ae_phy_rf6052_config(struct ieee80211_hw *hw); 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /rtl8821ae/sw.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2009-2010 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | 26 | #ifndef __RTL8821AE_SW_H__ 27 | #define __RTL8821AE_SW_H__ 28 | 29 | int rtl8821ae_init_sw_vars(struct ieee80211_hw *hw); 30 | void rtl8821ae_deinit_sw_vars(struct ieee80211_hw *hw); 31 | void rtl8821ae_init_var_map(struct ieee80211_hw *hw); 32 | bool rtl8821ae_get_btc_status(void); 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /rtl8821ae/table.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2009-2010 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Created on 2010/ 5/18, 1:41 23 | * 24 | * Larry Finger 25 | * 26 | *****************************************************************************/ 27 | 28 | #ifndef __RTL8821AE_TABLE__H_ 29 | #define __RTL8821AE_TABLE__H_ 30 | 31 | #include 32 | #define RTL8821AEPHY_REG_1TARRAYLEN 344 33 | extern u32 RTL8821AE_PHY_REG_ARRAY[]; 34 | #define RTL8812AEPHY_REG_1TARRAYLEN 490 35 | extern u32 RTL8812AE_PHY_REG_ARRAY[]; 36 | #define RTL8821AEPHY_REG_ARRAY_PGLEN 90 37 | extern u32 RTL8821AE_PHY_REG_ARRAY_PG[]; 38 | #define RTL8812AEPHY_REG_ARRAY_PGLEN 276 39 | extern u32 RTL8812AE_PHY_REG_ARRAY_PG[]; 40 | /* #define RTL8723BE_RADIOA_1TARRAYLEN 206 */ 41 | /* extern u8 *RTL8821AE_TXPWR_LMT_ARRAY[]; */ 42 | #define RTL8812AE_RADIOA_1TARRAYLEN 1264 43 | extern u32 RTL8812AE_RADIOA_ARRAY[]; 44 | #define RTL8812AE_RADIOB_1TARRAYLEN 1240 45 | extern u32 RTL8812AE_RADIOB_ARRAY[]; 46 | #define RTL8821AE_RADIOA_1TARRAYLEN 1176 47 | extern u32 RTL8821AE_RADIOA_ARRAY[]; 48 | #define RTL8821AEMAC_1T_ARRAYLEN 194 49 | extern u32 RTL8821AE_MAC_REG_ARRAY[]; 50 | #define RTL8812AEMAC_1T_ARRAYLEN 214 51 | extern u32 RTL8812AE_MAC_REG_ARRAY[]; 52 | #define RTL8821AEAGCTAB_1TARRAYLEN 382 53 | extern u32 RTL8821AE_AGC_TAB_ARRAY[]; 54 | #define RTL8812AEAGCTAB_1TARRAYLEN 1312 55 | extern u32 RTL8812AE_AGC_TAB_ARRAY[]; 56 | #define RTL8812AE_TXPWR_LMT_ARRAY_LEN 3948 57 | extern u8 *RTL8812AE_TXPWR_LMT[]; 58 | #define RTL8821AE_TXPWR_LMT_ARRAY_LEN 3948 59 | extern u8 *RTL8821AE_TXPWR_LMT[]; 60 | #endif 61 | -------------------------------------------------------------------------------- /rtl8822be/Makefile: -------------------------------------------------------------------------------- 1 | rtl8822be-objs := \ 2 | fw.o \ 3 | hw.o \ 4 | led.o \ 5 | phy.o \ 6 | sw.o \ 7 | trx.o 8 | 9 | obj-m += rtl8822be.o 10 | 11 | ccflags-y += -D__CHECK_ENDIAN__ 12 | -------------------------------------------------------------------------------- /rtl8822be/led.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2016 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | 26 | #ifndef __RTL8822B_LED_H__ 27 | #define __RTL8822B_LED_H__ 28 | 29 | void rtl8822be_init_sw_leds(struct ieee80211_hw *hw); 30 | void rtl8822be_sw_led_on(struct ieee80211_hw *hw, struct rtl_led *pled); 31 | void rtl8822be_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled); 32 | void rtl8822be_led_control(struct ieee80211_hw *hw, 33 | enum led_ctl_mode ledaction); 34 | #endif 35 | -------------------------------------------------------------------------------- /rtl8822be/sw.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2016 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | 26 | #ifndef __RTL8822B_SW_H__ 27 | #define __RTL8822B_SW_H__ 28 | 29 | int rtl8822be_init_sw_vars(struct ieee80211_hw *hw); 30 | void rtl8822be_deinit_sw_vars(struct ieee80211_hw *hw); 31 | bool rtl8822be_get_btc_status(void); 32 | #endif 33 | -------------------------------------------------------------------------------- /stats.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2009-2012 Realtek Corporation. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * The full GNU General Public License is included in this distribution in the 15 | * file called LICENSE. 16 | * 17 | * Contact Information: 18 | * wlanfae 19 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 20 | * Hsinchu 300, Taiwan. 21 | * 22 | * Larry Finger 23 | * 24 | *****************************************************************************/ 25 | 26 | #ifndef __RTL_STATS_H__ 27 | #define __RTL_STATS_H__ 28 | 29 | #define PHY_RSSI_SLID_WIN_MAX 100 30 | #define PHY_LINKQUALITY_SLID_WIN_MAX 20 31 | #define PHY_BEACON_RSSI_SLID_WIN_MAX 10 32 | 33 | /* Rx smooth factor */ 34 | #define RX_SMOOTH_FACTOR 20 35 | 36 | u8 rtl_query_rxpwrpercentage(s8 antpower); 37 | u8 rtl_evm_db_to_percentage(s8 value); 38 | long rtl_signal_scale_mapping(struct ieee80211_hw *hw, long currsig); 39 | void rtl_process_phyinfo(struct ieee80211_hw *hw, u8 *buffer, 40 | struct rtl_stats *pstatus); 41 | 42 | #endif 43 | --------------------------------------------------------------------------------