├── .gitignore ├── Makefile ├── README.md ├── 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 ├── halbtcoutsrc.c ├── halbtcoutsrc.h ├── rtl_btc.c └── rtl_btc.h ├── cam.c ├── cam.h ├── compat.h ├── core.c ├── core.h ├── debug.c ├── debug.h ├── efuse.c ├── efuse.h ├── firmware └── rtlwifi │ ├── Realtek-Firmware-License.txt │ ├── rtl8188efw.bin │ ├── rtl8192cfw.bin │ ├── rtl8192cfwU.bin │ ├── rtl8192cfwU_B.bin │ ├── rtl8192defw.bin │ ├── rtl8192defw_12.bin │ ├── rtl8192eefw.bin │ ├── rtl8192eefw_new.bin │ ├── rtl8192sefw.bin │ ├── rtl8192sefw.old.bin │ ├── rtl8723befw.bin │ ├── rtl8723fw.bin │ ├── rtl8723fw_B.bin │ ├── rtl8812aefw.bin │ ├── rtl8812aefw_wowlan.bin │ ├── rtl8821aefw.bin │ └── rtl8821aefw_wowlan.bin ├── pci.c ├── pci.h ├── ps.c ├── ps.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 ├── pwrseqcmd.c ├── pwrseqcmd.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 ├── 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 ├── 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 ├── pwrseqcmd.c ├── pwrseqcmd.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 ├── pwrseqcmd.c ├── pwrseqcmd.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 ├── pwrseqcmd.c ├── pwrseqcmd.h ├── reg.h ├── rf.c ├── rf.h ├── sw.c ├── sw.h ├── table.c ├── table.h ├── trx.c └── trx.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 ├── pwrseqcmd.c ├── pwrseqcmd.h ├── reg.h ├── rf.c ├── rf.h ├── sw.c ├── sw.h ├── table.c ├── table.h ├── trx.c └── trx.h ├── stats.c ├── stats.h ├── tools ├── Makefile ├── checkpatch.pl ├── delete_kernel_version.py ├── remove_staging_driver.sh ├── wlandown ├── wlanlog ├── wlanstart └── wlanup ├── 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 | *.gz 28 | *.bz2 29 | *.lzma 30 | *.xz 31 | *.lz4 32 | *.lzo 33 | *.patch 34 | *.gcno 35 | modules.builtin 36 | Module.symvers 37 | 38 | # 39 | # Top-level generic files 40 | # 41 | /tags 42 | /TAGS 43 | /linux 44 | /vmlinux 45 | /vmlinuz 46 | /System.map 47 | /Module.markers 48 | 49 | # 50 | # Debian directory (make deb-pkg) 51 | # 52 | /debian/ 53 | 54 | # 55 | # git files that we don't want to ignore even it they are dot-files 56 | # 57 | !.gitignore 58 | !.mailmap 59 | 60 | # 61 | # Generated include files 62 | # 63 | include/config 64 | include/generated 65 | arch/*/include/generated 66 | 67 | # stgit generated dirs 68 | patches-* 69 | 70 | # quilt's files 71 | patches 72 | series 73 | 74 | # cscope files 75 | cscope.* 76 | ncscope.* 77 | 78 | # gnu global files 79 | GPATH 80 | GRTAGS 81 | GSYMS 82 | GTAGS 83 | 84 | *.orig 85 | *~ 86 | \#*# 87 | 88 | # 89 | # Leavings from module signing 90 | # 91 | extra_certificates 92 | signing_key.priv 93 | signing_key.x509 94 | x509.genkey 95 | 96 | # Kconfig presets 97 | all.config 98 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | SHELL := /bin/sh 2 | CC = gcc 3 | KVER := $(shell uname -r) 4 | KSRC := /lib/modules/$(KVER)/build 5 | MODDESTDIR := /lib/modules/$(KVER)/kernel/drivers/net/wireless/rtlwifi 6 | FIRMWAREDIR := /lib/firmware/ 7 | PWD := $(shell pwd) 8 | CLR_MODULE_FILES := *.mod.c *.mod *.o .*.cmd *.ko *~ .tmp_versions* modules.order Module.symvers 9 | SYMBOL_FILE := Module.symvers 10 | 11 | #Handle the compression option for modules in 3.18+ 12 | ifneq ("","$(wildcard $(MODDESTDIR)/*.ko.gz)") 13 | COMPRESS_GZIP := y 14 | endif 15 | ifneq ("","$(wildcard $(MODDESTDIR)/*.ko.xz)") 16 | COMPRESS_XZ := y 17 | endif 18 | 19 | EXTRA_CFLAGS += -O2 20 | obj-m := rtlwifi.o 21 | rtlwifi-objs := \ 22 | base.o \ 23 | cam.o \ 24 | core.o \ 25 | debug.o \ 26 | efuse.o \ 27 | ps.o \ 28 | rc.o \ 29 | regd.o \ 30 | stats.o 31 | 32 | obj-m += rtl_pci.o 33 | rtl_pci-objs := pci.o 34 | 35 | obj-m += rtl_usb.o 36 | rtl_usb-objs := usb.o 37 | 38 | obj-m += btcoexist/ 39 | obj-m += rtl8188ee/ 40 | obj-m += rtl8192c/ 41 | obj-m += rtl8192ce/ 42 | obj-m += rtl8192cu/ 43 | obj-m += rtl8192de/ 44 | obj-m += rtl8192ee/ 45 | obj-m += rtl8192se/ 46 | obj-m += rtl8723ae/ 47 | obj-m += rtl8723be/ 48 | obj-m += rtl8821ae/ 49 | 50 | ccflags-y += -D__CHECK_ENDIAN__ 51 | 52 | all: 53 | $(MAKE) -C $(KSRC) M=$(PWD) modules 54 | install: all 55 | ifeq (,$(wildcard ./backup_drivers.tar)) 56 | @echo Making backups 57 | @tar cPf backup_drivers.tar $(MODDESTDIR) 58 | endif 59 | 60 | @mkdir -p $(MODDESTDIR)/btcoexist 61 | @mkdir -p $(MODDESTDIR)/rtl8188ee 62 | @mkdir -p $(MODDESTDIR)/rtl8192c 63 | @mkdir -p $(MODDESTDIR)/rtl8192ce 64 | @mkdir -p $(MODDESTDIR)/rtl8192cu 65 | @mkdir -p $(MODDESTDIR)/rtl8192de 66 | @mkdir -p $(MODDESTDIR)/rtl8192ee 67 | @mkdir -p $(MODDESTDIR)/rtl8192se 68 | @mkdir -p $(MODDESTDIR)/rtl8723ae 69 | @mkdir -p $(MODDESTDIR)/rtl8723be 70 | @mkdir -p $(MODDESTDIR)/rtl8821ae 71 | @install -p -D -m 644 rtl_pci.ko $(MODDESTDIR) 72 | @install -p -D -m 644 rtl_usb.ko $(MODDESTDIR) 73 | @install -p -D -m 644 rtlwifi.ko $(MODDESTDIR) 74 | @install -p -D -m 644 ./btcoexist/btcoexist.ko $(MODDESTDIR)/btcoexist 75 | @install -p -D -m 644 ./rtl8188ee/rtl8188ee.ko $(MODDESTDIR)/rtl8188ee 76 | @install -p -D -m 644 ./rtl8192c/rtl8192c-common.ko $(MODDESTDIR)/rtl8192c 77 | @install -p -D -m 644 ./rtl8192ce/rtl8192ce.ko $(MODDESTDIR)/rtl8192ce 78 | @install -p -D -m 644 ./rtl8192cu/rtl8192cu.ko $(MODDESTDIR)/rtl8192cu 79 | @install -p -D -m 644 ./rtl8192de/rtl8192de.ko $(MODDESTDIR)/rtl8192de 80 | @install -p -D -m 644 ./rtl8192ee/rtl8192ee.ko $(MODDESTDIR)/rtl8192ee 81 | @install -p -D -m 644 ./rtl8192se/rtl8192se.ko $(MODDESTDIR)/rtl8192se 82 | @install -p -D -m 644 ./rtl8723ae/rtl8723ae.ko $(MODDESTDIR)/rtl8723ae 83 | @install -p -D -m 644 ./rtl8723be/rtl8723be.ko $(MODDESTDIR)/rtl8723be 84 | @install -p -D -m 644 ./rtl8821ae/rtl8821ae.ko $(MODDESTDIR)/rtl8821ae 85 | ifeq ($(COMPRESS_GZIP), y) 86 | @gzip -f $(MODDESTDIR)/*.ko 87 | @gzip -f $(MODDESTDIR)/btcoexist/*.ko 88 | @gzip -f $(MODDESTDIR)/rtl8*/*.ko 89 | endif 90 | ifeq ($(COMPRESS_XZ), y) 91 | @xz -f $(MODDESTDIR)/*.ko 92 | @xz -f $(MODDESTDIR)/btcoexist/*.ko 93 | @xz -f $(MODDESTDIR)/rtl8*/*.ko 94 | endif 95 | 96 | @depmod -a 97 | 98 | @#copy firmware images to target folder 99 | @cp -fr firmware/rtlwifi/ $(FIRMWAREDIR)/ 100 | @echo "Install rtlwifi SUCCESS" 101 | 102 | uninstall: 103 | ifneq (,$(wildcard ./backup_drivers.tar)) 104 | @echo Restoring backups 105 | @tar xvPf backup_drivers.tar 106 | endif 107 | 108 | @depmod -a 109 | 110 | @echo "Uninstall rtlwifi SUCCESS" 111 | 112 | clean: 113 | @rm -fr *.mod.c *.mod *.o .*.cmd *.ko *~ 114 | @rm -fr rtl8*/*.mod.c rtl8*/*.mod rtl8*/*.o rtl8*/.*.cmd rtl8*/*.ko rtl8*/*~ 115 | @rm -fr bt*/*.mod.c bt*/*.mod bt*/*.o bt*/.*.cmd bt*/*.ko bt*/*~ 116 | @rm -fr .tmp_versions 117 | @rm -fr Modules.symvers 118 | @rm -fr Module.symvers 119 | @rm -fr Module.markers 120 | @rm -fr modules.order 121 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | rtlwifi_new 2 | =========== 3 | 4 | A repo for the newest Realtek rtlwifi codes. 5 | 6 | This code will build on any kernel 3.0 and newer. It includes the following drivers: 7 | 8 | rtl8192ce, rtl8192se, rtl8192de, rtl8188ee, rtl8192ee, rtl8723ae, rtl8723be, and rtl8821ae. 9 | 10 | -------------------------------------------------------------------------------- /btcoexist/Makefile: -------------------------------------------------------------------------------- 1 | btcoexist-objs := halbtc8723b2ant.o \ 2 | halbtcoutsrc.o \ 3 | halbtc8192e2ant.o \ 4 | halbtc8723b1ant.o \ 5 | halbtc8723b2ant.o \ 6 | halbtc8821a1ant.o \ 7 | halbtc8821a2ant.o \ 8 | halbtcoutsrc.o \ 9 | rtl_btc.o 10 | 11 | obj-m += btcoexist.o 12 | -------------------------------------------------------------------------------- /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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * 19 | ******************************************************************************/ 20 | #ifndef __HALBT_PRECOMP_H__ 21 | #define __HALBT_PRECOMP_H__ 22 | /************************************************************* 23 | * include files 24 | *************************************************************/ 25 | #include "../wifi.h" 26 | #include "../efuse.h" 27 | #include "../base.h" 28 | #include "../regd.h" 29 | #include "../cam.h" 30 | #include "../ps.h" 31 | #include "../pci.h" 32 | 33 | #include "halbtcoutsrc.h" 34 | 35 | 36 | #include "halbtc8192e2ant.h" 37 | #include "halbtc8723b1ant.h" 38 | #include "halbtc8723b2ant.h" 39 | #include "halbtc8821a2ant.h" 40 | #include "halbtc8821a1ant.h" 41 | 42 | #define GetDefaultAdapter(padapter) padapter 43 | 44 | 45 | #define BIT0 0x00000001 46 | #define BIT1 0x00000002 47 | #define BIT2 0x00000004 48 | #define BIT3 0x00000008 49 | #define BIT4 0x00000010 50 | #define BIT5 0x00000020 51 | #define BIT6 0x00000040 52 | #define BIT7 0x00000080 53 | #define BIT8 0x00000100 54 | #define BIT9 0x00000200 55 | #define BIT10 0x00000400 56 | #define BIT11 0x00000800 57 | #define BIT12 0x00001000 58 | #define BIT13 0x00002000 59 | #define BIT14 0x00004000 60 | #define BIT15 0x00008000 61 | #define BIT16 0x00010000 62 | #define BIT17 0x00020000 63 | #define BIT18 0x00040000 64 | #define BIT19 0x00080000 65 | #define BIT20 0x00100000 66 | #define BIT21 0x00200000 67 | #define BIT22 0x00400000 68 | #define BIT23 0x00800000 69 | #define BIT24 0x01000000 70 | #define BIT25 0x02000000 71 | #define BIT26 0x04000000 72 | #define BIT27 0x08000000 73 | #define BIT28 0x10000000 74 | #define BIT29 0x20000000 75 | #define BIT30 0x40000000 76 | #define BIT31 0x80000000 77 | 78 | #define MASKBYTE0 0xff 79 | #define MASKBYTE1 0xff00 80 | #define MASKBYTE2 0xff0000 81 | #define MASKBYTE3 0xff000000 82 | #define MASKHWORD 0xffff0000 83 | #define MASKLWORD 0x0000ffff 84 | #define MASKDWORD 0xffffffff 85 | #define MASK12BITS 0xfff 86 | #define MASKH4BITS 0xf0000000 87 | #define MASKOFDM_D 0xffc00000 88 | #define MASKCCK 0x3f3f3f3f 89 | 90 | #endif /* __HALBT_PRECOMP_H__ */ 91 | -------------------------------------------------------------------------------- /btcoexist/rtl_btc.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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * Larry Finger 26 | * 27 | *****************************************************************************/ 28 | 29 | #ifndef __RTL_BTC_H__ 30 | #define __RTL_BTC_H__ 31 | 32 | #include "halbt_precomp.h" 33 | 34 | 35 | 36 | void rtl_btc_init_variables(struct rtl_priv *rtlpriv); 37 | void rtl_btc_init_hal_vars(struct rtl_priv *rtlpriv); 38 | void rtl_btc_init_hw_config(struct rtl_priv *rtlpriv); 39 | void rtl_btc_ips_notify(struct rtl_priv *rtlpriv, u8 type); 40 | void rtl_btc_lps_notify(struct rtl_priv *rtlpriv, u8 type); 41 | void rtl_btc_scan_notify(struct rtl_priv *rtlpriv, u8 scantype); 42 | void rtl_btc_connect_notify(struct rtl_priv *rtlpriv, u8 action); 43 | void rtl_btc_mediastatus_notify(struct rtl_priv *rtlpriv, 44 | enum rt_media_status mstatus); 45 | void rtl_btc_periodical(struct rtl_priv *rtlpriv); 46 | void rtl_btc_halt_notify(void); 47 | void rtl_btc_btinfo_notify(struct rtl_priv *rtlpriv, u8 *tmpBuf, u8 length); 48 | bool rtl_btc_is_limited_dig(struct rtl_priv *rtlpriv); 49 | bool rtl_btc_is_disable_edca_turbo(struct rtl_priv *rtlpriv); 50 | bool rtl_btc_is_bt_disabled(struct rtl_priv *rtlpriv); 51 | void rtl_btc_special_packet_notify(struct rtl_priv *rtlpriv, u8 pkt_type); 52 | 53 | 54 | /*extern struct rtl_btc_ops rtl_btc_operation;*/ 55 | extern struct rtl_btc_ops *rtl_btc_get_ops_pointer(void); 56 | 57 | u8 rtl_get_hwpg_ant_num(struct rtl_priv *rtlpriv); 58 | u8 rtl_get_hwpg_bt_exist(struct rtl_priv *rtlpriv); 59 | u8 rtl_get_hwpg_bt_type(struct rtl_priv *rtlpriv); 60 | enum rt_media_status mgnt_link_status_query(struct ieee80211_hw *hw); 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | #endif 70 | -------------------------------------------------------------------------------- /cam.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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * 26 | * Larry Finger 27 | * 28 | *****************************************************************************/ 29 | 30 | #ifndef __RTL_CAM_H_ 31 | #define __RTL_CAM_H_ 32 | 33 | #define CAM_CONTENT_COUNT 8 34 | 35 | #define CFG_DEFAULT_KEY BIT(5) 36 | #define CFG_VALID BIT(15) 37 | 38 | 39 | #define CAM_PAIRWISE_KEY_OFFSET 4 40 | #define TOTAL_CAM_ENTRY 32 41 | 42 | #define CAM_CONFIG_USEDK 1 43 | #define CAM_CONFIG_NO_USEDK 0 44 | 45 | enum rtl_cam_key_type { 46 | wep_only = 0, 47 | group_key, 48 | pairwise_key, 49 | invalid_key 50 | }; 51 | extern void rtl_cam_reset_all_entry(struct ieee80211_hw *hw); 52 | u8 rtl_cam_add_one_entry(struct ieee80211_hw *hw, u8 *mac_addr, 53 | u32 ul_key_id, u32 ul_entry_idx, u32 ul_enc_alg, 54 | u8 *key_content); 55 | int rtl_cam_delete_one_entry(struct ieee80211_hw *hw, u8 *mac_addr, 56 | u32 ul_key_id); 57 | void rtl_cam_mark_invalid(struct ieee80211_hw *hw, u8 uc_index); 58 | void rtl_cam_empty_entry(struct ieee80211_hw *hw, u8 uc_index); 59 | void rtl_cam_reset_sec_info(struct ieee80211_hw *hw); 60 | u8 rtl_cam_get_free_entry(struct ieee80211_hw *hw, struct ieee80211_sta *sta, u8 key_index); 61 | void rtl_cam_del_entry(struct ieee80211_hw *hw, struct ieee80211_sta *sta, u8 key_index); 62 | s8 rtl_cam_set_key(struct ieee80211_hw *hw, struct ieee80211_sta *sta, struct ieee80211_key_conf *key, 63 | enum rtl_cam_key_type cam_key_type); 64 | void rtl_cam_clear_one_entry(struct ieee80211_hw *hw,u32 entry_idx); 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /compat.h: -------------------------------------------------------------------------------- 1 | #ifndef __RTL_COMPAT_H__ 2 | #define __RTL_COMPAT_H__ 3 | 4 | 5 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) 6 | #define RX_FLAG_MACTIME_MPDU RX_FLAG_MACTIME_START 7 | #endif 8 | 9 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)) 10 | #define IEEE80211_KEY_FLAG_SW_MGMT IEEE80211_KEY_FLAG_SW_MGMT_TX 11 | #endif 12 | 13 | struct ieee80211_mgmt_compat { 14 | __le16 frame_control; 15 | __le16 duration; 16 | u8 da[6]; 17 | u8 sa[6]; 18 | u8 bssid[6]; 19 | __le16 seq_ctrl; 20 | union { 21 | struct { 22 | u8 category; 23 | union { 24 | struct { 25 | u8 action_code; 26 | u8 dialog_token; 27 | u8 status_code; 28 | u8 variable[0]; 29 | } __attribute__ ((packed)) wme_action; 30 | struct{ 31 | u8 action_code; 32 | u8 dialog_token; 33 | __le16 capab; 34 | __le16 timeout; 35 | __le16 start_seq_num; 36 | } __attribute__((packed)) addba_req; 37 | struct{ 38 | u8 action_code; 39 | u8 dialog_token; 40 | __le16 status; 41 | __le16 capab; 42 | __le16 timeout; 43 | } __attribute__((packed)) addba_resp; 44 | struct{ 45 | u8 action_code; 46 | __le16 params; 47 | __le16 reason_code; 48 | } __attribute__((packed)) delba; 49 | struct{ 50 | u8 action_code; 51 | /* capab_info for open and confirm, 52 | * reason for close 53 | */ 54 | __le16 aux; 55 | /* Followed in plink_confirm by status 56 | * code, AID and supported rates, 57 | * and directly by supported rates in 58 | * plink_open and plink_close 59 | */ 60 | u8 variable[0]; 61 | } __attribute__((packed)) plink_action; 62 | struct{ 63 | u8 action_code; 64 | u8 variable[0]; 65 | } __attribute__((packed)) mesh_action; 66 | struct { 67 | u8 action; 68 | u8 smps_control; 69 | } __attribute__ ((packed)) ht_smps; 70 | } u; 71 | } __attribute__ ((packed)) action; 72 | } u; 73 | } __attribute__ ((packed)); 74 | #endif 75 | -------------------------------------------------------------------------------- /core.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2009-2010 Realtek Corporation. 4 | * 5 | * Tmis program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * Tmis program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | * You should have received a copy of the GNU General Public License along with 15 | * tmis program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * Tme full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * 26 | * Larry Finger 27 | * 28 | *****************************************************************************/ 29 | 30 | #ifndef __RTL_CORE_H__ 31 | #define __RTL_CORE_H__ 32 | 33 | #define RTL_SUPPORTED_FILTERS \ 34 | (FIF_PROMISC_IN_BSS | \ 35 | FIF_ALLMULTI | FIF_CONTROL | \ 36 | FIF_OTHER_BSS | \ 37 | FIF_FCSFAIL | \ 38 | FIF_BCN_PRBRESP_PROMISC) 39 | 40 | #define RTL_SUPPORTED_CTRL_FILTER 0xFF 41 | 42 | extern const struct ieee80211_ops rtl_ops; 43 | void rtl_fw_cb(const struct firmware *firmware, void *context); 44 | void rtl_addr_delay(u32 addr); 45 | void rtl_rfreg_delay(struct ieee80211_hw *hw, enum radio_path rfpath, u32 addr, 46 | u32 mask, u32 data); 47 | void rtl_bb_delay(struct ieee80211_hw *hw, u32 addr, u32 data); 48 | bool rtl_cmd_send_packet(struct ieee80211_hw *hw, struct sk_buff *skb); 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /efuse.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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * 26 | * Larry Finger 27 | * 28 | *****************************************************************************/ 29 | 30 | #ifndef __RTL_EFUSE_H_ 31 | #define __RTL_EFUSE_H_ 32 | 33 | #define EFUSE_IC_ID_OFFSET 506 34 | 35 | /* 36 | #define EFUSE_REAL_CONTENT_LEN 512 37 | #define EFUSE_MAP_LEN 128 38 | #define EFUSE_MAX_SECTION 16 39 | #define EFUSE_MAX_WORD_UNIT 4 40 | #define EFUSE_IC_ID_OFFSET 506 41 | */ 42 | 43 | #define EFUSE_MAX_WORD_UNIT 4 44 | 45 | #define EFUSE_INIT_MAP 0 46 | #define EFUSE_MODIFY_MAP 1 47 | 48 | #define PG_STATE_HEADER 0x01 49 | #define PG_STATE_WORD_0 0x02 50 | #define PG_STATE_WORD_1 0x04 51 | #define PG_STATE_WORD_2 0x08 52 | #define PG_STATE_WORD_3 0x10 53 | #define PG_STATE_DATA 0x20 54 | 55 | #define PG_SWBYTE_H 0x01 56 | #define PG_SWBYTE_L 0x02 57 | 58 | #define _POWERON_DELAY_ 59 | #define _PRE_EXECUTE_READ_CMD_ 60 | 61 | #define EFUSE_REPEAT_THRESHOLD_ 3 62 | #define EFUSE_ERROE_HANDLE 1 63 | 64 | struct efuse_map { 65 | u8 offset; 66 | u8 word_start; 67 | u8 byte_start; 68 | u8 byte_cnts; 69 | }; 70 | 71 | struct pgpkt_struct { 72 | u8 offset; 73 | u8 word_en; 74 | u8 data[8]; 75 | }; 76 | 77 | enum efuse_data_item { 78 | EFUSE_CHIP_ID = 0, 79 | EFUSE_LDO_SETTING, 80 | EFUSE_CLK_SETTING, 81 | EFUSE_SDIO_SETTING, 82 | EFUSE_CCCR, 83 | EFUSE_SDIO_MODE, 84 | EFUSE_OCR, 85 | EFUSE_F0CIS, 86 | EFUSE_F1CIS, 87 | EFUSE_MAC_ADDR, 88 | EFUSE_EEPROM_VER, 89 | EFUSE_CHAN_PLAN, 90 | EFUSE_TXPW_TAB 91 | }; 92 | 93 | enum { 94 | VOLTAGE_V25 = 0x03, 95 | LDOE25_SHIFT = 28, 96 | }; 97 | 98 | struct efuse_priv { 99 | u8 id[2]; 100 | u8 ldo_setting[2]; 101 | u8 clk_setting[2]; 102 | u8 cccr; 103 | u8 sdio_mode; 104 | u8 ocr[3]; 105 | u8 cis0[17]; 106 | u8 cis1[48]; 107 | u8 mac_addr[6]; 108 | u8 eeprom_verno; 109 | u8 channel_plan; 110 | u8 tx_power_b[14]; 111 | u8 tx_power_g[14]; 112 | }; 113 | 114 | extern void read_efuse_byte(struct ieee80211_hw *hw, u16 _offset, u8 *pbuf); 115 | extern void efuse_initialize(struct ieee80211_hw *hw); 116 | extern u8 efuse_read_1byte(struct ieee80211_hw *hw, u16 address); 117 | extern int efuse_one_byte_read(struct ieee80211_hw *hw, u16 addr, u8 *data); 118 | extern void efuse_write_1byte(struct ieee80211_hw *hw, u16 address, u8 value); 119 | extern void read_efuse(struct ieee80211_hw *hw, u16 _offset, 120 | u16 _size_byte, u8 *pbuf); 121 | extern void efuse_shadow_read(struct ieee80211_hw *hw, u8 type, 122 | u16 offset, u32 *value); 123 | extern void efuse_shadow_write(struct ieee80211_hw *hw, u8 type, 124 | u16 offset, u32 value); 125 | extern bool efuse_shadow_update(struct ieee80211_hw *hw); 126 | extern bool efuse_shadow_update_chk(struct ieee80211_hw *hw); 127 | extern void rtl_efuse_shadow_map_update(struct ieee80211_hw *hw); 128 | extern void efuse_force_write_vendor_Id(struct ieee80211_hw *hw); 129 | extern void efuse_re_pg_section(struct ieee80211_hw *hw, u8 section_idx); 130 | #endif 131 | -------------------------------------------------------------------------------- /firmware/rtlwifi/Realtek-Firmware-License.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009, Realtek Semiconductor Corporation 2 | All rights reserved. 3 | 4 | Redistribution. Redistribution and use in binary form, without 5 | modification, are permitted provided that the following conditions are 6 | met: 7 | 8 | * Redistributions must reproduce the above copyright notice and the 9 | following disclaimer in the documentation and/or other materials 10 | provided with the distribution. 11 | * Neither the name of Realtek Semiconductor Corporation nor the names of its 12 | suppliers may be used to endorse or promote products derived from this 13 | software without specific prior written permission. 14 | * No reverse engineering, decompilation, or disassembly of this software 15 | is permitted. 16 | 17 | Limited patent license. Realtek Semiconductor Corporation grants a world-wide, 18 | royalty-free, non-exclusive license under patents it now or hereafter 19 | owns or controls to make, have made, use, import, offer to sell and 20 | sell ("Utilize") this software, but solely to the extent that any 21 | such patent is necessary to Utilize the software alone, or in 22 | combination with an operating system licensed under an approved Open 23 | Source license as listed by the Open Source Initiative at 24 | http://opensource.org/licenses. The patent license shall not apply to 25 | any other combinations which include this software. No hardware per 26 | se is licensed hereunder. 27 | 28 | DISCLAIMER. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 29 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 30 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 31 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 32 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 33 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 34 | BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 35 | OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 36 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR 37 | TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE 38 | USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 39 | DAMAGE. 40 | -------------------------------------------------------------------------------- /firmware/rtlwifi/rtl8188efw.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtlwifi-linux/rtlwifi_new/15f04b7bf308e3aed2a5067e5ab8b16a72717b95/firmware/rtlwifi/rtl8188efw.bin -------------------------------------------------------------------------------- /firmware/rtlwifi/rtl8192cfw.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtlwifi-linux/rtlwifi_new/15f04b7bf308e3aed2a5067e5ab8b16a72717b95/firmware/rtlwifi/rtl8192cfw.bin -------------------------------------------------------------------------------- /firmware/rtlwifi/rtl8192cfwU.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtlwifi-linux/rtlwifi_new/15f04b7bf308e3aed2a5067e5ab8b16a72717b95/firmware/rtlwifi/rtl8192cfwU.bin -------------------------------------------------------------------------------- /firmware/rtlwifi/rtl8192cfwU_B.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtlwifi-linux/rtlwifi_new/15f04b7bf308e3aed2a5067e5ab8b16a72717b95/firmware/rtlwifi/rtl8192cfwU_B.bin -------------------------------------------------------------------------------- /firmware/rtlwifi/rtl8192defw.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtlwifi-linux/rtlwifi_new/15f04b7bf308e3aed2a5067e5ab8b16a72717b95/firmware/rtlwifi/rtl8192defw.bin -------------------------------------------------------------------------------- /firmware/rtlwifi/rtl8192defw_12.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtlwifi-linux/rtlwifi_new/15f04b7bf308e3aed2a5067e5ab8b16a72717b95/firmware/rtlwifi/rtl8192defw_12.bin -------------------------------------------------------------------------------- /firmware/rtlwifi/rtl8192eefw.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtlwifi-linux/rtlwifi_new/15f04b7bf308e3aed2a5067e5ab8b16a72717b95/firmware/rtlwifi/rtl8192eefw.bin -------------------------------------------------------------------------------- /firmware/rtlwifi/rtl8192eefw_new.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtlwifi-linux/rtlwifi_new/15f04b7bf308e3aed2a5067e5ab8b16a72717b95/firmware/rtlwifi/rtl8192eefw_new.bin -------------------------------------------------------------------------------- /firmware/rtlwifi/rtl8192sefw.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtlwifi-linux/rtlwifi_new/15f04b7bf308e3aed2a5067e5ab8b16a72717b95/firmware/rtlwifi/rtl8192sefw.bin -------------------------------------------------------------------------------- /firmware/rtlwifi/rtl8192sefw.old.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtlwifi-linux/rtlwifi_new/15f04b7bf308e3aed2a5067e5ab8b16a72717b95/firmware/rtlwifi/rtl8192sefw.old.bin -------------------------------------------------------------------------------- /firmware/rtlwifi/rtl8723befw.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtlwifi-linux/rtlwifi_new/15f04b7bf308e3aed2a5067e5ab8b16a72717b95/firmware/rtlwifi/rtl8723befw.bin -------------------------------------------------------------------------------- /firmware/rtlwifi/rtl8723fw.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtlwifi-linux/rtlwifi_new/15f04b7bf308e3aed2a5067e5ab8b16a72717b95/firmware/rtlwifi/rtl8723fw.bin -------------------------------------------------------------------------------- /firmware/rtlwifi/rtl8723fw_B.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtlwifi-linux/rtlwifi_new/15f04b7bf308e3aed2a5067e5ab8b16a72717b95/firmware/rtlwifi/rtl8723fw_B.bin -------------------------------------------------------------------------------- /firmware/rtlwifi/rtl8812aefw.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtlwifi-linux/rtlwifi_new/15f04b7bf308e3aed2a5067e5ab8b16a72717b95/firmware/rtlwifi/rtl8812aefw.bin -------------------------------------------------------------------------------- /firmware/rtlwifi/rtl8812aefw_wowlan.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtlwifi-linux/rtlwifi_new/15f04b7bf308e3aed2a5067e5ab8b16a72717b95/firmware/rtlwifi/rtl8812aefw_wowlan.bin -------------------------------------------------------------------------------- /firmware/rtlwifi/rtl8821aefw.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtlwifi-linux/rtlwifi_new/15f04b7bf308e3aed2a5067e5ab8b16a72717b95/firmware/rtlwifi/rtl8821aefw.bin -------------------------------------------------------------------------------- /firmware/rtlwifi/rtl8821aefw_wowlan.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtlwifi-linux/rtlwifi_new/15f04b7bf308e3aed2a5067e5ab8b16a72717b95/firmware/rtlwifi/rtl8821aefw_wowlan.bin -------------------------------------------------------------------------------- /ps.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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * 26 | * Larry Finger 27 | * 28 | *****************************************************************************/ 29 | 30 | #ifndef __REALTEK_RTL_PCI_PS_H__ 31 | #define __REALTEK_RTL_PCI_PS_H__ 32 | 33 | #define MAX_SW_LPS_SLEEP_INTV 5 34 | 35 | bool rtl_ps_set_rf_state(struct ieee80211_hw *hw, 36 | enum rf_pwrstate state_toset, u32 changesource, 37 | bool protect_or_not); 38 | bool rtl_ps_enable_nic(struct ieee80211_hw *hw); 39 | bool rtl_ps_disable_nic(struct ieee80211_hw *hw); 40 | void rtl_ips_nic_off(struct ieee80211_hw *hw); 41 | void rtl_ips_nic_on(struct ieee80211_hw *hw); 42 | void rtl_ips_nic_off_wq_callback(void *data); 43 | extern void rtl_lps_enter(struct ieee80211_hw *hw); 44 | extern void rtl_lps_leave(struct ieee80211_hw *hw); 45 | 46 | void rtl_lps_set_psmode(struct ieee80211_hw *hw, u8 rt_psmode); 47 | 48 | void rtl_swlps_beacon(struct ieee80211_hw *hw, void *data, unsigned int len); 49 | void rtl_swlps_wq_callback(void *data); 50 | void rtl_swlps_rfon_wq_callback(void *data); 51 | void rtl_swlps_rf_awake(struct ieee80211_hw *hw); 52 | void rtl_swlps_rf_sleep(struct ieee80211_hw *hw); 53 | void rtl_p2p_ps_cmd(struct ieee80211_hw *hw , u8 p2p_ps_state); 54 | void rtl_p2p_info(struct ieee80211_hw *hw, void *data, unsigned int len); 55 | void rtl_lps_change_work_callback(struct work_struct *work); 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /rc.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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * 26 | * Larry Finger 27 | * 28 | *****************************************************************************/ 29 | 30 | #ifndef __RTL_RC_H__ 31 | #define __RTL_RC_H__ 32 | 33 | #define B_MODE_MAX_RIX 3 34 | #define G_MODE_MAX_RIX 11 35 | #define A_MODE_MAX_RIX 7 36 | 37 | /* in mac80211 mcs0-mcs15 is idx0-idx15*/ 38 | #define N_MODE_MCS7_RIX 7 39 | #define N_MODE_MCS15_RIX 15 40 | 41 | #define AC_MODE_MCS7_RIX 7 42 | #define AC_MODE_MCS8_RIX 8 43 | #define AC_MODE_MCS9_RIX 9 44 | 45 | struct rtl_rate_priv { 46 | u8 ht_cap; 47 | }; 48 | 49 | int rtl_rate_control_register(void); 50 | void rtl_rate_control_unregister(void); 51 | #endif 52 | -------------------------------------------------------------------------------- /regd.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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * 26 | * Larry Finger 27 | * 28 | *****************************************************************************/ 29 | 30 | #ifndef __RTL_REGD_H__ 31 | #define __RTL_REGD_H__ 32 | 33 | 34 | 35 | /* for kernel 3.14 , both value are changed to IEEE80211_CHAN_NO_IR*/ 36 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)) 37 | #define IEEE80211_CHAN_NO_IBSS IEEE80211_CHAN_NO_IR 38 | #define IEEE80211_CHAN_PASSIVE_SCAN IEEE80211_CHAN_NO_IR 39 | #endif 40 | 41 | 42 | 43 | 44 | 45 | struct country_code_to_enum_rd { 46 | u16 countrycode; 47 | const char *iso_name; 48 | }; 49 | 50 | enum country_code_type_t { 51 | COUNTRY_CODE_FCC = 0, 52 | COUNTRY_CODE_IC = 1, 53 | COUNTRY_CODE_ETSI = 2, 54 | COUNTRY_CODE_SPAIN = 3, 55 | COUNTRY_CODE_FRANCE = 4, 56 | COUNTRY_CODE_MKK = 5, 57 | COUNTRY_CODE_MKK1 = 6, 58 | COUNTRY_CODE_ISRAEL = 7, 59 | COUNTRY_CODE_TELEC = 8, 60 | COUNTRY_CODE_MIC = 9, 61 | COUNTRY_CODE_GLOBAL_DOMAIN = 10, 62 | COUNTRY_CODE_WORLD_WIDE_13 = 11, 63 | COUNTRY_CODE_TELEC_NETGEAR = 12, 64 | 65 | /*add new channel plan above this line */ 66 | COUNTRY_CODE_MAX 67 | }; 68 | 69 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) 70 | int rtl_regd_init(struct ieee80211_hw *hw, 71 | void (*reg_notifier) (struct wiphy *wiphy, 72 | struct regulatory_request *request)); 73 | void rtl_reg_notifier(struct wiphy *wiphy, struct regulatory_request *request); 74 | #else 75 | int rtl_regd_init(struct ieee80211_hw *hw, 76 | int (*reg_notifier) (struct wiphy *wiphy, 77 | struct regulatory_request *request)); 78 | int rtl_reg_notifier(struct wiphy *wiphy, struct regulatory_request *request); 79 | #endif 80 | 81 | #endif 82 | -------------------------------------------------------------------------------- /rtl8188ee/Makefile: -------------------------------------------------------------------------------- 1 | rtl8188ee-objs := \ 2 | dm.o \ 3 | fw.o \ 4 | hw.o \ 5 | led.o \ 6 | phy.o \ 7 | pwrseq.o \ 8 | pwrseqcmd.o \ 9 | rf.o \ 10 | sw.o \ 11 | table.o \ 12 | trx.o 13 | 14 | obj-m += rtl8188ee.o 15 | 16 | ccflags-y += -Idrivers/net/wireless/rtlwifi -D__CHECK_ENDIAN__ 17 | 18 | -------------------------------------------------------------------------------- /rtl8188ee/hw.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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * 26 | * Larry Finger 27 | * 28 | *****************************************************************************/ 29 | 30 | #ifndef __RTL92CE_HW_H__ 31 | #define __RTL92CE_HW_H__ 32 | 33 | void rtl88ee_get_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val); 34 | void rtl88ee_read_eeprom_info(struct ieee80211_hw *hw); 35 | void rtl88ee_interrupt_recognized(struct ieee80211_hw *hw, 36 | u32 *p_inta, u32 *p_intb); 37 | int rtl88ee_hw_init(struct ieee80211_hw *hw); 38 | void rtl88ee_card_disable(struct ieee80211_hw *hw); 39 | void rtl88ee_enable_interrupt(struct ieee80211_hw *hw); 40 | void rtl88ee_disable_interrupt(struct ieee80211_hw *hw); 41 | int rtl88ee_set_network_type(struct ieee80211_hw *hw, enum nl80211_iftype type); 42 | void rtl88ee_set_check_bssid(struct ieee80211_hw *hw, bool check_bssid); 43 | void rtl88ee_set_qos(struct ieee80211_hw *hw, int aci); 44 | void rtl88ee_set_beacon_related_registers(struct ieee80211_hw *hw); 45 | void rtl88ee_set_beacon_interval(struct ieee80211_hw *hw); 46 | void rtl88ee_update_interrupt_mask(struct ieee80211_hw *hw, 47 | u32 add_msr, u32 rm_msr); 48 | void rtl88ee_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val); 49 | void rtl88ee_update_hal_rate_tbl(struct ieee80211_hw *hw, 50 | struct ieee80211_sta *sta, u8 rssi_level); 51 | void rtl88ee_update_channel_access_setting(struct ieee80211_hw *hw); 52 | bool rtl88ee_gpio_radio_on_off_checking(struct ieee80211_hw *hw, u8 *valid); 53 | void rtl88ee_enable_hw_security_config(struct ieee80211_hw *hw); 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_allow_all_destaddr(struct ieee80211_hw *hw, 62 | bool allow_all_da, bool write_into_reg); 63 | void rtl88ee_fw_clk_off_timer_callback(unsigned long data); 64 | #endif 65 | -------------------------------------------------------------------------------- /rtl8188ee/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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * 26 | * Larry Finger 27 | * 28 | *****************************************************************************/ 29 | 30 | #ifndef __RTL92CE_LED_H__ 31 | #define __RTL92CE_LED_H__ 32 | 33 | void rtl88ee_init_sw_leds(struct ieee80211_hw *hw); 34 | void rtl88ee_sw_led_on(struct ieee80211_hw *hw, struct rtl_led *pled); 35 | void rtl88ee_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled); 36 | void rtl88ee_led_control(struct ieee80211_hw *hw, enum led_ctl_mode ledaction); 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /rtl8188ee/pwrseq.c: -------------------------------------------------------------------------------- 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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * 26 | * Larry Finger 27 | * 28 | *****************************************************************************/ 29 | 30 | #include "pwrseqcmd.h" 31 | #include "pwrseq.h" 32 | 33 | 34 | /* 35 | drivers should parse below arrays and do the corresponding actions 36 | */ 37 | /*3 Power on Array*/ 38 | struct wlan_pwr_cfg rtl8188E_power_on_flow[RTL8188E_TRANS_CARDEMU_TO_ACT_STEPS 39 | + RTL8188E_TRANS_END_STEPS] = { 40 | RTL8188E_TRANS_CARDEMU_TO_ACT 41 | RTL8188E_TRANS_END 42 | }; 43 | 44 | /*3Radio off GPIO Array */ 45 | struct wlan_pwr_cfg rtl8188E_radio_off_flow[RTL8188E_TRANS_ACT_TO_CARDEMU_STEPS 46 | + RTL8188E_TRANS_END_STEPS] = { 47 | RTL8188E_TRANS_ACT_TO_CARDEMU 48 | RTL8188E_TRANS_END 49 | }; 50 | 51 | /*3Card Disable Array*/ 52 | struct wlan_pwr_cfg rtl8188E_card_disable_flow[RTL8188E_TRANS_ACT_TO_CARDEMU_STEPS 53 | + RTL8188E_TRANS_CARDEMU_TO_PDN_STEPS 54 | + RTL8188E_TRANS_END_STEPS] = { 55 | RTL8188E_TRANS_ACT_TO_CARDEMU 56 | RTL8188E_TRANS_CARDEMU_TO_CARDDIS 57 | RTL8188E_TRANS_END 58 | }; 59 | 60 | /*3 Card Enable Array*/ 61 | struct wlan_pwr_cfg rtl8188E_card_enable_flow[RTL8188E_TRANS_ACT_TO_CARDEMU_STEPS 62 | + RTL8188E_TRANS_CARDEMU_TO_PDN_STEPS 63 | + RTL8188E_TRANS_END_STEPS] = { 64 | RTL8188E_TRANS_CARDDIS_TO_CARDEMU 65 | RTL8188E_TRANS_CARDEMU_TO_ACT 66 | RTL8188E_TRANS_END 67 | }; 68 | 69 | /*3Suspend Array*/ 70 | struct wlan_pwr_cfg rtl8188E_suspend_flow[RTL8188E_TRANS_ACT_TO_CARDEMU_STEPS 71 | + RTL8188E_TRANS_CARDEMU_TO_SUS_STEPS 72 | + RTL8188E_TRANS_END_STEPS] = { 73 | RTL8188E_TRANS_ACT_TO_CARDEMU 74 | RTL8188E_TRANS_CARDEMU_TO_SUS 75 | RTL8188E_TRANS_END 76 | }; 77 | 78 | /*3 Resume Array*/ 79 | struct wlan_pwr_cfg rtl8188E_resume_flow[RTL8188E_TRANS_ACT_TO_CARDEMU_STEPS 80 | + RTL8188E_TRANS_CARDEMU_TO_SUS_STEPS 81 | + RTL8188E_TRANS_END_STEPS] = { 82 | RTL8188E_TRANS_SUS_TO_CARDEMU 83 | RTL8188E_TRANS_CARDEMU_TO_ACT 84 | RTL8188E_TRANS_END 85 | }; 86 | 87 | /*3HWPDN Array*/ 88 | struct wlan_pwr_cfg rtl8188E_hwpdn_flow[RTL8188E_TRANS_ACT_TO_CARDEMU_STEPS 89 | + RTL8188E_TRANS_CARDEMU_TO_PDN_STEPS 90 | + RTL8188E_TRANS_END_STEPS] = { 91 | RTL8188E_TRANS_ACT_TO_CARDEMU 92 | RTL8188E_TRANS_CARDEMU_TO_PDN 93 | RTL8188E_TRANS_END 94 | }; 95 | 96 | /*3 Enter LPS */ 97 | struct wlan_pwr_cfg rtl8188E_enter_lps_flow[RTL8188E_TRANS_ACT_TO_LPS_STEPS 98 | + RTL8188E_TRANS_END_STEPS] = { 99 | /*FW behavior*/ 100 | RTL8188E_TRANS_ACT_TO_LPS 101 | RTL8188E_TRANS_END 102 | }; 103 | 104 | /*3 Leave LPS */ 105 | struct wlan_pwr_cfg rtl8188E_leave_lps_flow[RTL8188E_TRANS_LPS_TO_ACT_STEPS 106 | + RTL8188E_TRANS_END_STEPS] = { 107 | /*FW behavior*/ 108 | RTL8188E_TRANS_LPS_TO_ACT 109 | RTL8188E_TRANS_END 110 | }; 111 | -------------------------------------------------------------------------------- /rtl8188ee/pwrseqcmd.h: -------------------------------------------------------------------------------- 1 | #ifndef __RTL8723E_PWRSEQCMD_H__ 2 | #define __RTL8723E_PWRSEQCMD_H__ 3 | 4 | #include "../wifi.h" 5 | /*---------------------------------------------*/ 6 | /* The value of cmd: 4 bits */ 7 | /*---------------------------------------------*/ 8 | #define PWR_CMD_READ 0x00 9 | #define PWR_CMD_WRITE 0x01 10 | #define PWR_CMD_POLLING 0x02 11 | #define PWR_CMD_DELAY 0x03 12 | #define PWR_CMD_END 0x04 13 | 14 | /* define the base address of each block */ 15 | #define PWR_BASEADDR_MAC 0x00 16 | #define PWR_BASEADDR_USB 0x01 17 | #define PWR_BASEADDR_PCIE 0x02 18 | #define PWR_BASEADDR_SDIO 0x03 19 | 20 | #define PWR_INTF_SDIO_MSK BIT(0) 21 | #define PWR_INTF_USB_MSK BIT(1) 22 | #define PWR_INTF_PCI_MSK BIT(2) 23 | #define PWR_INTF_ALL_MSK (BIT(0)|BIT(1)|BIT(2)|BIT(3)) 24 | 25 | #define PWR_FAB_TSMC_MSK BIT(0) 26 | #define PWR_FAB_UMC_MSK BIT(1) 27 | #define PWR_FAB_ALL_MSK (BIT(0)|BIT(1)|BIT(2)|BIT(3)) 28 | 29 | #define PWR_CUT_TESTCHIP_MSK BIT(0) 30 | #define PWR_CUT_A_MSK BIT(1) 31 | #define PWR_CUT_B_MSK BIT(2) 32 | #define PWR_CUT_C_MSK BIT(3) 33 | #define PWR_CUT_D_MSK BIT(4) 34 | #define PWR_CUT_E_MSK BIT(5) 35 | #define PWR_CUT_F_MSK BIT(6) 36 | #define PWR_CUT_G_MSK BIT(7) 37 | #define PWR_CUT_ALL_MSK 0xFF 38 | 39 | 40 | enum pwrseq_delay_unit { 41 | PWRSEQ_DELAY_US, 42 | PWRSEQ_DELAY_MS, 43 | }; 44 | 45 | struct wlan_pwr_cfg { 46 | u16 offset; 47 | u8 cut_msk; 48 | u8 fab_msk:4; 49 | u8 interface_msk:4; 50 | u8 base:4; 51 | u8 cmd:4; 52 | u8 msk; 53 | u8 value; 54 | 55 | }; 56 | 57 | #define GET_PWR_CFG_OFFSET(__PWR_CMD) __PWR_CMD.offset 58 | #define GET_PWR_CFG_CUT_MASK(__PWR_CMD) __PWR_CMD.cut_msk 59 | #define GET_PWR_CFG_FAB_MASK(__PWR_CMD) __PWR_CMD.fab_msk 60 | #define GET_PWR_CFG_INTF_MASK(__PWR_CMD) __PWR_CMD.interface_msk 61 | #define GET_PWR_CFG_BASE(__PWR_CMD) __PWR_CMD.base 62 | #define GET_PWR_CFG_CMD(__PWR_CMD) __PWR_CMD.cmd 63 | #define GET_PWR_CFG_MASK(__PWR_CMD) __PWR_CMD.msk 64 | #define GET_PWR_CFG_VALUE(__PWR_CMD) __PWR_CMD.value 65 | 66 | bool rtl_hal_pwrseqcmdparsing(struct rtl_priv *rtlpriv, u8 cut_version, 67 | u8 fab_version, u8 interface_type, 68 | struct wlan_pwr_cfg pwrcfgcmd[]); 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /rtl8188ee/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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * 26 | * Larry Finger 27 | * 28 | *****************************************************************************/ 29 | 30 | #ifndef __RTL92C_RF_H__ 31 | #define __RTL92C_RF_H__ 32 | 33 | #define RF6052_MAX_TX_PWR 0x3F 34 | #define RF6052_MAX_REG 0x3F 35 | 36 | extern void rtl88e_phy_rf6052_set_bandwidth(struct ieee80211_hw *hw, 37 | u8 bandwidth); 38 | extern void rtl88e_phy_rf6052_set_cck_txpower(struct ieee80211_hw *hw, 39 | u8 *ppowerlevel); 40 | extern void rtl88e_phy_rf6052_set_ofdm_txpower(struct ieee80211_hw *hw, 41 | u8 *ppowerlevel_ofdm, 42 | u8 *ppowerlevel_bw20, 43 | u8 *ppowerlevel_bw40, 44 | u8 channel); 45 | extern bool rtl88e_phy_rf6052_config(struct ieee80211_hw *hw); 46 | #endif 47 | -------------------------------------------------------------------------------- /rtl8188ee/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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * 26 | * Larry Finger 27 | * 28 | *****************************************************************************/ 29 | 30 | #ifndef __RTL92CE_SW_H__ 31 | #define __RTL92CE_SW_H__ 32 | 33 | int rtl88e_init_sw_vars(struct ieee80211_hw *hw); 34 | void rtl88e_deinit_sw_vars(struct ieee80211_hw *hw); 35 | bool rtl88e_get_btc_status(void); 36 | 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /rtl8188ee/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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * 26 | * Created on 2010/ 5/18, 1:41 27 | * 28 | * Larry Finger 29 | * 30 | *****************************************************************************/ 31 | 32 | #ifndef __RTL92CE_TABLE__H_ 33 | #define __RTL92CE_TABLE__H_ 34 | 35 | #include 36 | #define RTL8188EEPHY_REG_1TARRAYLEN 382 37 | extern u32 RTL8188EEPHY_REG_1TARRAY[]; 38 | #define RTL8188EEPHY_REG_ARRAY_PGLEN 264 39 | extern u32 RTL8188EEPHY_REG_ARRAY_PG[]; 40 | #define RTL8188EE_RADIOA_1TARRAYLEN 190 41 | extern u32 RTL8188EE_RADIOA_1TARRAY[]; 42 | #define RTL8188EEMAC_1T_ARRAYLEN 180 43 | extern u32 RTL8188EEMAC_1T_ARRAY[]; 44 | #define RTL8188EEAGCTAB_1TARRAYLEN 256 45 | extern u32 RTL8188EEAGCTAB_1TARRAY[]; 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /rtl8192c/Makefile: -------------------------------------------------------------------------------- 1 | rtl8192c-common-objs := \ 2 | main.o \ 3 | dm_common.o \ 4 | fw_common.o \ 5 | phy_common.o 6 | 7 | obj-m += rtl8192c-common.o 8 | 9 | ccflags-y += -D__CHECK_ENDIAN__ 10 | -------------------------------------------------------------------------------- /rtl8192c/fw_common.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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * 26 | * Larry Finger 27 | * 28 | *****************************************************************************/ 29 | 30 | #ifndef __RTL92C__FW__COMMON__H__ 31 | #define __RTL92C__FW__COMMON__H__ 32 | 33 | #define FW_8192C_SIZE 0x3000 34 | #define FW_8192C_START_ADDRESS 0x1000 35 | #define FW_8192C_END_ADDRESS 0x1FFF 36 | #define FW_8192C_PAGE_SIZE 4096 37 | #define FW_8192C_POLLING_DELAY 5 38 | #define FW_8192C_POLLING_TIMEOUT_COUNT 100 39 | 40 | #define IS_FW_HEADER_EXIST(_pfwhdr) \ 41 | ((le16_to_cpu(_pfwhdr->signature)&0xFFF0) == 0x92C0 ||\ 42 | (le16_to_cpu(_pfwhdr->signature)&0xFFF0) == 0x88C0) 43 | 44 | #define IS_81XXC_VENDOR_UMC_B_CUT(version) \ 45 | ((IS_CHIP_VENDOR_UMC(version)) ? \ 46 | ((GET_CVID_CUT_VERSION(version) == \ 47 | CHIP_VENDOR_UMC_B_CUT) ? true : false) : false) 48 | 49 | struct rtl92c_firmware_header { 50 | __le16 signature; 51 | u8 category; 52 | u8 function; 53 | __le16 version; 54 | u8 subversion; 55 | u8 rsvd1; 56 | u8 month; 57 | u8 date; 58 | u8 hour; 59 | u8 minute; 60 | __le16 ramcodeSize; 61 | __le16 rsvd2; 62 | __le32 svnindex; 63 | __le32 rsvd3; 64 | __le32 rsvd4; 65 | __le32 rsvd5; 66 | }; 67 | 68 | #define pagenum_128(_len) (u32)(((_len)>>7) + ((_len)&0x7F ? 1 : 0)) 69 | 70 | #define SET_H2CCMD_PWRMODE_PARM_MODE(__ph2ccmd, __val) \ 71 | SET_BITS_TO_LE_1BYTE(__ph2ccmd, 0, 8, __val) 72 | #define SET_H2CCMD_PWRMODE_PARM_SMART_PS(__ph2ccmd, __val) \ 73 | SET_BITS_TO_LE_1BYTE((__ph2ccmd)+1, 0, 8, __val) 74 | #define SET_H2CCMD_PWRMODE_PARM_BCN_PASS_TIME(__ph2ccmd, __val) \ 75 | SET_BITS_TO_LE_1BYTE((__ph2ccmd)+2, 0, 8, __val) 76 | #define SET_H2CCMD_JOINBSSRPT_PARM_OPMODE(__ph2ccmd, __val) \ 77 | SET_BITS_TO_LE_1BYTE(__ph2ccmd, 0, 8, __val) 78 | #define SET_H2CCMD_RSVDPAGE_LOC_PROBE_RSP(__ph2ccmd, __val) \ 79 | SET_BITS_TO_LE_1BYTE(__ph2ccmd, 0, 8, __val) 80 | #define SET_H2CCMD_RSVDPAGE_LOC_PSPOLL(__ph2ccmd, __val) \ 81 | SET_BITS_TO_LE_1BYTE((__ph2ccmd)+1, 0, 8, __val) 82 | #define SET_H2CCMD_RSVDPAGE_LOC_NULL_DATA(__ph2ccmd, __val) \ 83 | SET_BITS_TO_LE_1BYTE((__ph2ccmd)+2, 0, 8, __val) 84 | 85 | int rtl92c_download_fw(struct ieee80211_hw *hw); 86 | void rtl92c_fill_h2c_cmd(struct ieee80211_hw *hw, u8 element_id, 87 | u32 cmd_len, u8 *p_cmdbuffer); 88 | void rtl92c_firmware_selfreset(struct ieee80211_hw *hw); 89 | void rtl92c_set_fw_pwrmode_cmd(struct ieee80211_hw *hw, u8 mode); 90 | void rtl92c_set_fw_rsvdpagepkt(struct ieee80211_hw *hw, bool b_dl_finished); 91 | void rtl92c_set_fw_joinbss_report_cmd(struct ieee80211_hw *hw, u8 mstatus); 92 | void usb_writeN_async(struct rtl_priv *rtlpriv, u32 addr, void *data, u16 len); 93 | void rtl92c_set_p2p_ps_offload_cmd(struct ieee80211_hw *hw, u8 p2p_ps_state); 94 | 95 | #endif 96 | -------------------------------------------------------------------------------- /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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * 26 | * Larry Finger 27 | * 28 | *****************************************************************************/ 29 | 30 | #include "../wifi.h" 31 | #include 32 | 33 | 34 | MODULE_AUTHOR("lizhaoming "); 35 | MODULE_AUTHOR("Realtek WlanFAE "); 36 | MODULE_AUTHOR("Georgia "); 37 | MODULE_AUTHOR("Ziv Huang "); 38 | MODULE_AUTHOR("Larry Finger "); 39 | MODULE_LICENSE("GPL"); 40 | MODULE_DESCRIPTION("Realtek 8192C/8188C 802.11n PCI wireless"); 41 | -------------------------------------------------------------------------------- /rtl8192ce/Makefile: -------------------------------------------------------------------------------- 1 | rtl8192ce-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-m += rtl8192ce.o 13 | 14 | ccflags-y += -Idrivers/net/wireless/rtlwifi -D__CHECK_ENDIAN__ 15 | 16 | -------------------------------------------------------------------------------- /rtl8192ce/dm.c: -------------------------------------------------------------------------------- 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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * 26 | * Larry Finger 27 | * 28 | *****************************************************************************/ 29 | 30 | #include "../wifi.h" 31 | #include "../base.h" 32 | #include "../pci.h" 33 | #include "reg.h" 34 | #include "def.h" 35 | #include "phy.h" 36 | #include "dm.h" 37 | #include "fw.h" 38 | 39 | 40 | -------------------------------------------------------------------------------- /rtl8192ce/dm.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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * 26 | * Larry Finger 27 | * 28 | *****************************************************************************/ 29 | 30 | #ifndef __RTL92C_DM_H__ 31 | #define __RTL92C_DM_H__ 32 | 33 | #define HAL_DM_DIG_DISABLE BIT(0) 34 | #define HAL_DM_HIPWR_DISABLE BIT(1) 35 | 36 | #define OFDM_TABLE_LENGTH 37 37 | #define CCK_TABLE_LENGTH 33 38 | 39 | #define OFDM_TABLE_SIZE 37 40 | #define CCK_TABLE_SIZE 33 41 | 42 | #define BW_AUTO_SWITCH_HIGH_LOW 25 43 | #define BW_AUTO_SWITCH_LOW_HIGH 30 44 | 45 | #define DM_DIG_THRESH_HIGH 40 46 | #define DM_DIG_THRESH_LOW 35 47 | 48 | #define DM_FALSEALARM_THRESH_LOW 400 49 | #define DM_FALSEALARM_THRESH_HIGH 1000 50 | 51 | #define DM_DIG_MAX 0x3e 52 | #define DM_DIG_MIN 0x1e 53 | 54 | #define DM_DIG_FA_UPPER 0x32 55 | #define DM_DIG_FA_LOWER 0x20 56 | #define DM_DIG_FA_TH0 0x20 57 | #define DM_DIG_FA_TH1 0x100 58 | #define DM_DIG_FA_TH2 0x200 59 | 60 | #define DM_DIG_BACKOFF_MAX 12 61 | #define DM_DIG_BACKOFF_MIN -4 62 | #define DM_DIG_BACKOFF_DEFAULT 10 63 | 64 | #define RXPATHSELECTION_SS_TH_lOW 30 65 | #define RXPATHSELECTION_DIFF_TH 18 66 | 67 | #define DM_RATR_STA_INIT 0 68 | #define DM_RATR_STA_HIGH 1 69 | #define DM_RATR_STA_MIDDLE 2 70 | #define DM_RATR_STA_LOW 3 71 | 72 | #define CTS2SELF_THVAL 30 73 | #define REGC38_TH 20 74 | 75 | #define WAIOTTHVal 25 76 | 77 | #define TXHIGHPWRLEVEL_NORMAL 0 78 | #define TXHIGHPWRLEVEL_LEVEL1 1 79 | #define TXHIGHPWRLEVEL_LEVEL2 2 80 | #define TXHIGHPWRLEVEL_BT1 3 81 | #define TXHIGHPWRLEVEL_BT2 4 82 | 83 | #define DM_TYPE_BYFW 0 84 | #define DM_TYPE_BYDRIVER 1 85 | 86 | #define TX_POWER_NEAR_FIELD_THRESH_LVL2 74 87 | #define TX_POWER_NEAR_FIELD_THRESH_LVL1 67 88 | 89 | void rtl92c_dm_init(struct ieee80211_hw *hw); 90 | void rtl92c_dm_watchdog(struct ieee80211_hw *hw); 91 | void rtl92c_dm_write_dig(struct ieee80211_hw *hw); 92 | void rtl92c_dm_init_edca_turbo(struct ieee80211_hw *hw); 93 | void rtl92c_dm_check_txpower_tracking(struct ieee80211_hw *hw); 94 | void rtl92c_dm_init_rate_adaptive_mask(struct ieee80211_hw *hw); 95 | void rtl92c_dm_rf_saving(struct ieee80211_hw *hw, u8 bforce_in_normal); 96 | void rtl92c_dm_bt_coexist(struct ieee80211_hw *hw); 97 | 98 | #endif 99 | -------------------------------------------------------------------------------- /rtl8192ce/fw.c: -------------------------------------------------------------------------------- 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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * 26 | * Larry Finger 27 | * 28 | *****************************************************************************/ 29 | 30 | #include "../wifi.h" 31 | #include "../pci.h" 32 | #include "../base.h" 33 | #include "reg.h" 34 | #include "def.h" 35 | #include "fw.h" 36 | 37 | #define BEACON_PG 0 /* ->1 */ 38 | #define PSPOLL_PG 2 39 | #define NULL_PG 3 40 | #define PROBERSP_PG 4 /* ->5 */ 41 | 42 | #define TOTAL_RESERVED_PKT_LEN 768 43 | 44 | 45 | -------------------------------------------------------------------------------- /rtl8192ce/fw.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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * Larry Finger 26 | * 27 | *****************************************************************************/ 28 | 29 | #ifndef __RTL92C__FW__H__ 30 | #define __RTL92C__FW__H__ 31 | 32 | #define FW_8192C_SIZE 0x3000 33 | #define FW_8192C_START_ADDRESS 0x1000 34 | #define FW_8192C_END_ADDRESS 0x3FFF 35 | #define FW_8192C_PAGE_SIZE 4096 36 | #define FW_8192C_POLLING_DELAY 5 37 | #define FW_8192C_POLLING_TIMEOUT_COUNT 100 38 | 39 | #define IS_FW_HEADER_EXIST(_pfwhdr) \ 40 | ((_pfwhdr->signature&0xFFF0) == 0x92C0 ||\ 41 | (_pfwhdr->signature&0xFFF0) == 0x88C0) 42 | 43 | #define SET_H2CCMD_PWRMODE_PARM_MODE(__ph2ccmd, __val) \ 44 | SET_BITS_TO_LE_1BYTE(__ph2ccmd, 0, 8, __val) 45 | #define SET_H2CCMD_PWRMODE_PARM_SMART_PS(__ph2ccmd, __val) \ 46 | SET_BITS_TO_LE_1BYTE((__ph2ccmd)+1, 0, 8, __val) 47 | #define SET_H2CCMD_PWRMODE_PARM_BCN_PASS_TIME(__ph2ccmd, __val) \ 48 | SET_BITS_TO_LE_1BYTE((__ph2ccmd)+2, 0, 8, __val) 49 | #define SET_H2CCMD_JOINBSSRPT_PARM_OPMODE(__ph2ccmd, __val) \ 50 | SET_BITS_TO_LE_1BYTE(__ph2ccmd, 0, 8, __val) 51 | #define SET_H2CCMD_RSVDPAGE_LOC_PROBE_RSP(__ph2ccmd, __val) \ 52 | SET_BITS_TO_LE_1BYTE(__ph2ccmd, 0, 8, __val) 53 | #define SET_H2CCMD_RSVDPAGE_LOC_PSPOLL(__ph2ccmd, __val) \ 54 | SET_BITS_TO_LE_1BYTE((__ph2ccmd)+1, 0, 8, __val) 55 | #define SET_H2CCMD_RSVDPAGE_LOC_NULL_DATA(__ph2ccmd, __val) \ 56 | SET_BITS_TO_LE_1BYTE((__ph2ccmd)+2, 0, 8, __val) 57 | 58 | int rtl92c_download_fw(struct ieee80211_hw *hw); 59 | void rtl92c_fill_h2c_cmd(struct ieee80211_hw *hw, u8 element_id, 60 | u32 cmd_len, u8 *cmdbuffer); 61 | void rtl92c_firmware_selfreset(struct ieee80211_hw *hw); 62 | void rtl92c_set_fw_pwrmode_cmd(struct ieee80211_hw *hw, u8 mode); 63 | void rtl92c_set_fw_rsvdpagepkt(struct ieee80211_hw *hw, bool b_dl_finished); 64 | void rtl92c_set_fw_joinbss_report_cmd(struct ieee80211_hw *hw, u8 mstatus); 65 | void rtl92c_set_p2p_ps_offload_cmd(struct ieee80211_hw *hw, u8 p2p_ps_state); 66 | #endif 67 | -------------------------------------------------------------------------------- /rtl8192ce/hw.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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * 26 | * Larry Finger 27 | * 28 | *****************************************************************************/ 29 | 30 | #ifndef __RTL92CE_HW_H__ 31 | #define __RTL92CE_HW_H__ 32 | 33 | void rtl92ce_get_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val); 34 | void rtl92ce_read_eeprom_info(struct ieee80211_hw *hw); 35 | void rtl92ce_interrupt_recognized(struct ieee80211_hw *hw, 36 | u32 *p_inta, u32 *p_intb); 37 | int rtl92ce_hw_init(struct ieee80211_hw *hw); 38 | void rtl92ce_card_disable(struct ieee80211_hw *hw); 39 | void rtl92ce_enable_interrupt(struct ieee80211_hw *hw); 40 | void rtl92ce_disable_interrupt(struct ieee80211_hw *hw); 41 | int rtl92ce_set_network_type(struct ieee80211_hw *hw, enum nl80211_iftype type); 42 | void rtl92ce_set_check_bssid(struct ieee80211_hw *hw, bool check_bssid); 43 | void rtl92ce_set_qos(struct ieee80211_hw *hw, int aci); 44 | void rtl92ce_set_beacon_related_registers(struct ieee80211_hw *hw); 45 | void rtl92ce_set_beacon_interval(struct ieee80211_hw *hw); 46 | void rtl92ce_update_interrupt_mask(struct ieee80211_hw *hw, 47 | u32 add_msr, u32 rm_msr); 48 | void rtl92ce_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val); 49 | void rtl92ce_update_hal_rate_tbl(struct ieee80211_hw *hw, 50 | struct ieee80211_sta *sta, u8 rssi_level); 51 | void rtl92ce_update_channel_access_setting(struct ieee80211_hw *hw); 52 | bool rtl92ce_gpio_radio_on_off_checking(struct ieee80211_hw *hw, u8 *valid); 53 | void rtl92ce_enable_hw_security_config(struct ieee80211_hw *hw); 54 | 55 | void rtl8192ce_read_bt_coexist_info_from_hwpg(struct ieee80211_hw *hw, 56 | bool autoload_fail, u8 *hwinfo); 57 | void rtl8192ce_bt_reg_init(struct ieee80211_hw *hw); 58 | void rtl8192ce_bt_hw_init(struct ieee80211_hw *hw); 59 | void rtl92ce_suspend(struct ieee80211_hw *hw); 60 | void rtl92ce_resume(struct ieee80211_hw *hw); 61 | void rtl92ce_allow_all_destaddr(struct ieee80211_hw *hw, 62 | bool allow_all_da, bool write_into_reg); 63 | #endif 64 | -------------------------------------------------------------------------------- /rtl8192ce/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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * 26 | * Larry Finger 27 | * 28 | *****************************************************************************/ 29 | 30 | #ifndef __RTL92CE_LED_H__ 31 | #define __RTL92CE_LED_H__ 32 | 33 | void rtl92ce_init_sw_leds(struct ieee80211_hw *hw); 34 | void rtl92ce_sw_led_on(struct ieee80211_hw *hw, struct rtl_led *pled); 35 | void rtl92ce_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled); 36 | void rtl92ce_led_control(struct ieee80211_hw *hw, enum led_ctl_mode ledaction); 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /rtl8192ce/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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * 26 | * Larry Finger 27 | * 28 | *****************************************************************************/ 29 | 30 | #ifndef __RTL92C_RF_H__ 31 | #define __RTL92C_RF_H__ 32 | 33 | #define RF6052_MAX_TX_PWR 0x3F 34 | #define RF6052_MAX_REG 0x3F 35 | 36 | extern void rtl92c_phy_rf6052_set_bandwidth(struct ieee80211_hw *hw, 37 | u8 bandwidth); 38 | extern void rtl92c_phy_rf6052_set_cck_txpower(struct ieee80211_hw *hw, 39 | u8 *ppowerlevel); 40 | extern void rtl92c_phy_rf6052_set_ofdm_txpower(struct ieee80211_hw *hw, 41 | u8 *ppowerlevel, u8 channel); 42 | extern bool rtl92c_phy_rf6052_config(struct ieee80211_hw *hw); 43 | #endif 44 | -------------------------------------------------------------------------------- /rtl8192ce/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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * 26 | * Larry Finger 27 | * 28 | *****************************************************************************/ 29 | 30 | #ifndef __RTL92CE_SW_H__ 31 | #define __RTL92CE_SW_H__ 32 | 33 | int rtl92c_init_sw_vars(struct ieee80211_hw *hw); 34 | void rtl92c_deinit_sw_vars(struct ieee80211_hw *hw); 35 | void rtl92c_init_var_map(struct ieee80211_hw *hw); 36 | bool rtl92c_get_btc_status(void); 37 | 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /rtl8192ce/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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * 26 | * Created on 2010/ 5/18, 1:41 27 | * 28 | * Larry Finger 29 | * 30 | *****************************************************************************/ 31 | 32 | #ifndef __RTL92CE_TABLE__H_ 33 | #define __RTL92CE_TABLE__H_ 34 | 35 | #include 36 | 37 | #define PHY_REG_2TARRAY_LENGTH 374 38 | extern u32 RTL8192CEPHY_REG_2TARRAY[PHY_REG_2TARRAY_LENGTH]; 39 | #define PHY_REG_1TARRAY_LENGTH 374 40 | extern u32 RTL8192CEPHY_REG_1TARRAY[PHY_REG_1TARRAY_LENGTH]; 41 | #define PHY_REG_ARRAY_PGLENGTH 192 42 | extern u32 RTL8192CEPHY_REG_ARRAY_PG[PHY_REG_ARRAY_PGLENGTH]; 43 | #define RADIOA_2TARRAYLENGTH 282 44 | extern u32 RTL8192CERADIOA_2TARRAY[RADIOA_2TARRAYLENGTH]; 45 | #define RADIOB_2TARRAYLENGTH 78 46 | extern u32 RTL8192CE_RADIOB_2TARRAY[RADIOB_2TARRAYLENGTH]; 47 | #define RADIOA_1TARRAYLENGTH 282 48 | extern u32 RTL8192CE_RADIOA_1TARRAY[RADIOA_1TARRAYLENGTH]; 49 | #define RADIOB_1TARRAYLENGTH 1 50 | extern u32 RTL8192CE_RADIOB_1TARRAY[RADIOB_1TARRAYLENGTH]; 51 | #define MAC_2T_ARRAYLENGTH 162 52 | extern u32 RTL8192CEMAC_2T_ARRAY[MAC_2T_ARRAYLENGTH]; 53 | #define AGCTAB_2TARRAYLENGTH 320 54 | extern u32 RTL8192CEAGCTAB_2TARRAY[AGCTAB_2TARRAYLENGTH]; 55 | #define AGCTAB_1TARRAYLENGTH 320 56 | extern u32 RTL8192CEAGCTAB_1TARRAY[AGCTAB_1TARRAYLENGTH]; 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /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-m += rtl8192cu.o 13 | 14 | ccflags-y += -Idrivers/net/wireless/rtlwifi -D__CHECK_ENDIAN__ 15 | 16 | 17 | -------------------------------------------------------------------------------- /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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * 26 | * Larry Finger 27 | * 28 | *****************************************************************************/ 29 | 30 | #include "../rtl8192ce/def.h" 31 | 32 | /*------------------------------------------------------------------------- 33 | * Chip specific 34 | *-------------------------------------------------------------------------*/ 35 | #define CHIP_8723 BIT(2) /* RTL8723 With BT feature */ 36 | #define CHIP_8723_DRV_REV BIT(3) /* RTL8723 Driver Revised */ 37 | #define NORMAL_CHIP BIT(4) 38 | #define CHIP_VENDOR_UMC BIT(5) 39 | #define CHIP_VENDOR_UMC_B_CUT BIT(6) 40 | 41 | #define IS_8723_SERIES(version) \ 42 | (((version) & CHIP_8723) ? true : false) 43 | 44 | #define IS_92C_1T2R(version) \ 45 | (((version) & CHIP_92C) && ((version) & CHIP_92C_1T2R)) 46 | 47 | #define IS_VENDOR_UMC(version) \ 48 | (((version) & CHIP_VENDOR_UMC) ? true : false) 49 | 50 | #define IS_VENDOR_8723_A_CUT(version) \ 51 | (((version) & CHIP_VENDOR_UMC) ? (((version) & (BIT(6))) ? \ 52 | false : true) : false) 53 | 54 | #define CHIP_BONDING_92C_1T2R 0x1 55 | -------------------------------------------------------------------------------- /rtl8192cu/dm.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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * 26 | * Larry Finger 27 | * 28 | *****************************************************************************/ 29 | 30 | #include "../wifi.h" 31 | #include "../base.h" 32 | #include "reg.h" 33 | #include "def.h" 34 | #include "phy.h" 35 | #include "dm.h" 36 | 37 | void rtl92cu_dm_dynamic_txpower(struct ieee80211_hw *hw) 38 | { 39 | struct rtl_priv *rtlpriv = rtl_priv(hw); 40 | struct rtl_phy *rtlphy = &(rtlpriv->phy); 41 | struct rtl_mac *mac = rtl_mac(rtl_priv(hw)); 42 | long undec_sm_pwdb; 43 | 44 | if (!rtlpriv->dm.dynamic_txpower_enable) 45 | return; 46 | 47 | if (rtlpriv->dm.dm_flag & HAL_DM_HIPWR_DISABLE) { 48 | rtlpriv->dm.dynamic_txhighpower_lvl = TXHIGHPWRLEVEL_NORMAL; 49 | return; 50 | } 51 | 52 | if ((mac->link_state < MAC80211_LINKED) && 53 | (rtlpriv->dm.entry_min_undec_sm_pwdb == 0)) { 54 | RT_TRACE(rtlpriv, COMP_POWER, DBG_TRACE, 55 | "Not connected to any\n"); 56 | 57 | rtlpriv->dm.dynamic_txhighpower_lvl = TXHIGHPWRLEVEL_NORMAL; 58 | 59 | rtlpriv->dm.last_dtp_lvl = TXHIGHPWRLEVEL_NORMAL; 60 | return; 61 | } 62 | 63 | if (mac->link_state >= MAC80211_LINKED) { 64 | if (mac->opmode == NL80211_IFTYPE_ADHOC) { 65 | undec_sm_pwdb = rtlpriv->dm.entry_min_undec_sm_pwdb; 66 | RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 67 | "AP Client PWDB = 0x%lx\n", 68 | undec_sm_pwdb); 69 | } else { 70 | undec_sm_pwdb = rtlpriv->dm.undec_sm_pwdb; 71 | RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 72 | "STA Default Port PWDB = 0x%lx\n", 73 | undec_sm_pwdb); 74 | } 75 | } else { 76 | undec_sm_pwdb = rtlpriv->dm.entry_min_undec_sm_pwdb; 77 | 78 | RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 79 | "AP Ext Port PWDB = 0x%lx\n", 80 | undec_sm_pwdb); 81 | } 82 | 83 | if (undec_sm_pwdb >= TX_POWER_NEAR_FIELD_THRESH_LVL2) { 84 | rtlpriv->dm.dynamic_txhighpower_lvl = TXHIGHPWRLEVEL_LEVEL1; 85 | RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 86 | "TXHIGHPWRLEVEL_LEVEL1 (TxPwr=0x0)\n"); 87 | } else if ((undec_sm_pwdb < (TX_POWER_NEAR_FIELD_THRESH_LVL2 - 3)) && 88 | (undec_sm_pwdb >= TX_POWER_NEAR_FIELD_THRESH_LVL1)) { 89 | 90 | rtlpriv->dm.dynamic_txhighpower_lvl = TXHIGHPWRLEVEL_LEVEL1; 91 | RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 92 | "TXHIGHPWRLEVEL_LEVEL1 (TxPwr=0x10)\n"); 93 | } else if (undec_sm_pwdb < (TX_POWER_NEAR_FIELD_THRESH_LVL1 - 5)) { 94 | rtlpriv->dm.dynamic_txhighpower_lvl = TXHIGHPWRLEVEL_NORMAL; 95 | RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 96 | "TXHIGHPWRLEVEL_NORMAL\n"); 97 | } 98 | 99 | if ((rtlpriv->dm.dynamic_txhighpower_lvl != rtlpriv->dm.last_dtp_lvl)) { 100 | RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 101 | "PHY_SetTxPowerLevel8192S() Channel = %d\n", 102 | rtlphy->current_channel); 103 | rtl92c_phy_set_txpower_level(hw, rtlphy->current_channel); 104 | if (rtlpriv->dm.dynamic_txhighpower_lvl == 105 | TXHIGHPWRLEVEL_NORMAL) 106 | dm_restorepowerindex(hw); 107 | else if (rtlpriv->dm.dynamic_txhighpower_lvl == 108 | TXHIGHPWRLEVEL_LEVEL1) 109 | dm_writepowerindex(hw, 0x14); 110 | else if (rtlpriv->dm.dynamic_txhighpower_lvl == 111 | TXHIGHPWRLEVEL_LEVEL2) 112 | dm_writepowerindex(hw, 0x10); 113 | } 114 | 115 | rtlpriv->dm.last_dtp_lvl = rtlpriv->dm.dynamic_txhighpower_lvl; 116 | } 117 | -------------------------------------------------------------------------------- /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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * 26 | * Larry Finger 27 | * 28 | *****************************************************************************/ 29 | 30 | #include "../rtl8192ce/dm.h" 31 | 32 | void rtl92cu_dm_dynamic_txpower(struct ieee80211_hw *hw); 33 | void dm_savepowerindex(struct ieee80211_hw *hw); 34 | void dm_writepowerindex(struct ieee80211_hw *hw, u8 value); 35 | void dm_restorepowerindex(struct ieee80211_hw *hw); 36 | -------------------------------------------------------------------------------- /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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * 26 | *****************************************************************************/ 27 | 28 | #ifndef __RTL92CU_LED_H__ 29 | #define __RTL92CU_LED_H__ 30 | 31 | void rtl92cu_init_sw_leds(struct ieee80211_hw *hw); 32 | void rtl92cu_deinit_sw_leds(struct ieee80211_hw *hw); 33 | void rtl92cu_sw_led_on(struct ieee80211_hw *hw, struct rtl_led *pled); 34 | void rtl92cu_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled); 35 | void rtl92cu_led_control(struct ieee80211_hw *hw, enum led_ctl_mode ledaction); 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * 26 | * Larry Finger 27 | * 28 | *****************************************************************************/ 29 | 30 | #include "../rtl8192ce/phy.h" 31 | 32 | void rtl92cu_bb_block_on(struct ieee80211_hw *hw); 33 | bool rtl8192_phy_check_is_legal_rfpath(struct ieee80211_hw *hw, u32 rfpath); 34 | void rtl92c_phy_set_io(struct ieee80211_hw *hw); 35 | bool _rtl92cu_phy_config_mac_with_headerfile(struct ieee80211_hw *hw); 36 | bool rtl92cu_phy_bb_config(struct ieee80211_hw *hw); 37 | u32 rtl92cu_phy_query_rf_reg(struct ieee80211_hw *hw, 38 | enum radio_path rfpath, u32 regaddr, u32 bitmask); 39 | void rtl92cu_phy_set_rf_reg(struct ieee80211_hw *hw, 40 | enum radio_path rfpath, 41 | u32 regaddr, u32 bitmask, u32 data); 42 | bool rtl92cu_phy_mac_config(struct ieee80211_hw *hw); 43 | bool _rtl92cu_phy_config_bb_with_pgheaderfile(struct ieee80211_hw *hw, 44 | u8 configtype); 45 | void _rtl92cu_phy_lc_calibrate(struct ieee80211_hw *hw, bool is2t); 46 | bool _rtl92cu_phy_config_bb_with_headerfile(struct ieee80211_hw *hw, 47 | u8 configtype); 48 | void rtl92cu_phy_set_bw_mode_callback(struct ieee80211_hw *hw); 49 | bool rtl92cu_phy_set_rf_power_state(struct ieee80211_hw *hw, 50 | enum rf_pwrstate rfpwr_state); 51 | -------------------------------------------------------------------------------- /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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * 26 | * Larry Finger 27 | * 28 | *****************************************************************************/ 29 | 30 | #include "../rtl8192ce/reg.h" 31 | -------------------------------------------------------------------------------- /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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * 26 | * Larry Finger 27 | * 28 | *****************************************************************************/ 29 | 30 | #ifndef __RTL92CU_RF_H__ 31 | #define __RTL92CU_RF_H__ 32 | 33 | #define RF6052_MAX_TX_PWR 0x3F 34 | #define RF6052_MAX_REG 0x3F 35 | #define RF6052_MAX_PATH 2 36 | 37 | void rtl92cu_phy_rf6052_set_bandwidth(struct ieee80211_hw *hw, u8 bandwidth); 38 | void rtl92c_phy_rf6052_set_cck_txpower(struct ieee80211_hw *hw, 39 | u8 *ppowerlevel); 40 | void rtl92c_phy_rf6052_set_ofdm_txpower(struct ieee80211_hw *hw, 41 | u8 *ppowerlevel, u8 channel); 42 | bool rtl92cu_phy_rf6052_config(struct ieee80211_hw *hw); 43 | bool rtl92cu_phy_config_rf_with_headerfile(struct ieee80211_hw *hw, 44 | enum radio_path rfpath); 45 | void rtl92cu_phy_rf6052_set_cck_txpower(struct ieee80211_hw *hw, 46 | u8 *ppowerlevel); 47 | void rtl92cu_phy_rf6052_set_ofdm_txpower(struct ieee80211_hw *hw, 48 | u8 *ppowerlevel, u8 channel); 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * 26 | * Larry Finger 27 | * 28 | *****************************************************************************/ 29 | 30 | #ifndef __RTL92CU_SW_H__ 31 | #define __RTL92CU_SW_H__ 32 | 33 | #define EFUSE_MAX_SECTION 16 34 | 35 | void rtl92cu_phy_rf6052_set_cck_txpower(struct ieee80211_hw *hw, 36 | u8 *powerlevel); 37 | void rtl92cu_phy_rf6052_set_ofdm_txpower(struct ieee80211_hw *hw, 38 | u8 *ppowerlevel, u8 channel); 39 | bool _rtl92cu_phy_config_bb_with_headerfile(struct ieee80211_hw *hw, 40 | u8 configtype); 41 | bool _rtl92cu_phy_config_bb_with_pgheaderfile(struct ieee80211_hw *hw, 42 | u8 configtype); 43 | void _rtl92cu_phy_lc_calibrate(struct ieee80211_hw *hw, bool is2t); 44 | void rtl92cu_phy_set_rf_reg(struct ieee80211_hw *hw, 45 | enum radio_path rfpath, 46 | u32 regaddr, u32 bitmask, u32 data); 47 | bool rtl92cu_phy_set_rf_power_state(struct ieee80211_hw *hw, 48 | enum rf_pwrstate rfpwr_state); 49 | u32 rtl92cu_phy_query_rf_reg(struct ieee80211_hw *hw, 50 | enum radio_path rfpath, u32 regaddr, u32 bitmask); 51 | void rtl92cu_phy_set_bw_mode_callback(struct ieee80211_hw *hw); 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * 26 | * Larry Finger 27 | * 28 | *****************************************************************************/ 29 | 30 | #ifndef __RTL92CU_TABLE__H_ 31 | #define __RTL92CU_TABLE__H_ 32 | 33 | #include 34 | 35 | #define RTL8192CUPHY_REG_2TARRAY_LENGTH 374 36 | extern u32 RTL8192CUPHY_REG_2TARRAY[RTL8192CUPHY_REG_2TARRAY_LENGTH]; 37 | #define RTL8192CUPHY_REG_1TARRAY_LENGTH 374 38 | extern u32 RTL8192CUPHY_REG_1TARRAY[RTL8192CUPHY_REG_1TARRAY_LENGTH]; 39 | 40 | #define RTL8192CUPHY_REG_ARRAY_PGLENGTH 336 41 | extern u32 RTL8192CUPHY_REG_ARRAY_PG[RTL8192CUPHY_REG_ARRAY_PGLENGTH]; 42 | 43 | #define RTL8192CURADIOA_2TARRAYLENGTH 282 44 | extern u32 RTL8192CURADIOA_2TARRAY[RTL8192CURADIOA_2TARRAYLENGTH]; 45 | #define RTL8192CURADIOB_2TARRAYLENGTH 78 46 | extern u32 RTL8192CU_RADIOB_2TARRAY[RTL8192CURADIOB_2TARRAYLENGTH]; 47 | #define RTL8192CURADIOA_1TARRAYLENGTH 282 48 | extern u32 RTL8192CU_RADIOA_1TARRAY[RTL8192CURADIOA_1TARRAYLENGTH]; 49 | #define RTL8192CURADIOB_1TARRAYLENGTH 1 50 | extern u32 RTL8192CU_RADIOB_1TARRAY[RTL8192CURADIOB_1TARRAYLENGTH]; 51 | 52 | #define RTL8192CUMAC_2T_ARRAYLENGTH 172 53 | extern u32 RTL8192CUMAC_2T_ARRAY[RTL8192CUMAC_2T_ARRAYLENGTH]; 54 | 55 | #define RTL8192CUAGCTAB_2TARRAYLENGTH 320 56 | extern u32 RTL8192CUAGCTAB_2TARRAY[RTL8192CUAGCTAB_2TARRAYLENGTH]; 57 | #define RTL8192CUAGCTAB_1TARRAYLENGTH 320 58 | extern u32 RTL8192CUAGCTAB_1TARRAY[RTL8192CUAGCTAB_1TARRAYLENGTH]; 59 | 60 | #define RTL8192CUPHY_REG_1T_HPArrayLength 378 61 | extern u32 RTL8192CUPHY_REG_1T_HPArray[RTL8192CUPHY_REG_1T_HPArrayLength]; 62 | 63 | #define RTL8192CUPHY_REG_Array_PG_HPLength 336 64 | extern u32 RTL8192CUPHY_REG_Array_PG_HP[RTL8192CUPHY_REG_Array_PG_HPLength]; 65 | 66 | #define RTL8192CURadioA_1T_HPArrayLength 282 67 | extern u32 RTL8192CURadioA_1T_HPArray[RTL8192CURadioA_1T_HPArrayLength]; 68 | #define RTL8192CUAGCTAB_1T_HPArrayLength 320 69 | extern u32 Rtl8192CUAGCTAB_1T_HPArray[RTL8192CUAGCTAB_1T_HPArrayLength]; 70 | 71 | #endif 72 | -------------------------------------------------------------------------------- /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-m += rtl8192de.o 13 | 14 | ccflags-y += -Idrivers/net/wireless/rtlwifi -D__CHECK_ENDIAN__ 15 | 16 | 17 | -------------------------------------------------------------------------------- /rtl8192de/hw.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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * 26 | *****************************************************************************/ 27 | 28 | #ifndef __RTL92DE_HW_H__ 29 | #define __RTL92DE_HW_H__ 30 | 31 | void rtl92de_get_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val); 32 | void rtl92de_read_eeprom_info(struct ieee80211_hw *hw); 33 | void rtl92de_interrupt_recognized(struct ieee80211_hw *hw, 34 | u32 *p_inta, u32 *p_intb); 35 | int rtl92de_hw_init(struct ieee80211_hw *hw); 36 | void rtl92de_card_disable(struct ieee80211_hw *hw); 37 | void rtl92de_enable_interrupt(struct ieee80211_hw *hw); 38 | void rtl92de_disable_interrupt(struct ieee80211_hw *hw); 39 | int rtl92de_set_network_type(struct ieee80211_hw *hw, enum nl80211_iftype type); 40 | void rtl92de_set_check_bssid(struct ieee80211_hw *hw, bool check_bssid); 41 | void rtl92de_set_qos(struct ieee80211_hw *hw, int aci); 42 | void rtl92de_set_beacon_related_registers(struct ieee80211_hw *hw); 43 | void rtl92de_set_beacon_interval(struct ieee80211_hw *hw); 44 | void rtl92de_update_interrupt_mask(struct ieee80211_hw *hw, 45 | u32 add_msr, u32 rm_msr); 46 | void rtl92de_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val); 47 | void rtl92de_update_hal_rate_tbl(struct ieee80211_hw *hw, 48 | struct ieee80211_sta *sta, u8 rssi_level); 49 | void rtl92de_update_channel_access_setting(struct ieee80211_hw *hw); 50 | bool rtl92de_gpio_radio_on_off_checking(struct ieee80211_hw *hw, u8 *valid); 51 | void rtl92de_enable_hw_security_config(struct ieee80211_hw *hw); 52 | 53 | 54 | extern void rtl92de_write_dword_dbi(struct ieee80211_hw *hw, u16 offset, 55 | u32 value, u8 direct); 56 | extern u32 rtl92de_read_dword_dbi(struct ieee80211_hw *hw, u16 offset, 57 | 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 | void rtl92de_allow_all_destaddr(struct ieee80211_hw *hw, 62 | bool allow_all_da, bool write_into_reg); 63 | #endif 64 | -------------------------------------------------------------------------------- /rtl8192de/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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * 26 | *****************************************************************************/ 27 | 28 | #ifndef __RTL92CE_LED_H__ 29 | #define __RTL92CE_LED_H__ 30 | 31 | void rtl92de_init_sw_leds(struct ieee80211_hw *hw); 32 | void rtl92ce_sw_led_on(struct ieee80211_hw *hw, struct rtl_led *pled); 33 | void rtl92ce_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled); 34 | void rtl92de_led_control(struct ieee80211_hw *hw, enum led_ctl_mode ledaction); 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /rtl8192de/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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * 26 | *****************************************************************************/ 27 | 28 | #ifndef __RTL92D_RF_H__ 29 | #define __RTL92D_RF_H__ 30 | 31 | extern void rtl92d_phy_rf6052_set_bandwidth(struct ieee80211_hw *hw, 32 | u8 bandwidth); 33 | extern void rtl92d_phy_rf6052_set_cck_txpower(struct ieee80211_hw *hw, 34 | u8 *ppowerlevel); 35 | extern void rtl92d_phy_rf6052_set_ofdm_txpower(struct ieee80211_hw *hw, 36 | u8 *ppowerlevel, u8 channel); 37 | extern bool rtl92d_phy_rf6052_config(struct ieee80211_hw *hw); 38 | extern bool rtl92d_phy_enable_anotherphy(struct ieee80211_hw *hw, bool bmac0); 39 | extern void rtl92d_phy_powerdown_anotherphy(struct ieee80211_hw *hw, 40 | bool bmac0); 41 | #endif 42 | -------------------------------------------------------------------------------- /rtl8192de/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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * 26 | *****************************************************************************/ 27 | 28 | #ifndef __RTL92DE_SW_H__ 29 | #define __RTL92DE_SW_H__ 30 | 31 | extern spinlock_t globalmutex_for_poweron_and_poweroff; 32 | extern spinlock_t globalmutex_for_fwdownload; 33 | extern spinlock_t globalmutex_for_power_and_efuse; 34 | 35 | bool rtl92d_get_btc_status(void); 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /rtl8192de/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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * 26 | * Created on 2010/ 5/18, 1:41 27 | *****************************************************************************/ 28 | 29 | #ifndef __RTL92DE_TABLE__H_ 30 | #define __RTL92DE_TABLE__H_ 31 | 32 | #include 33 | 34 | /*Created on 2011/ 1/14, 1:35*/ 35 | 36 | #define PHY_REG_2T_ARRAYLENGTH 380 37 | extern u32 rtl8192de_phy_reg_2tarray[PHY_REG_2T_ARRAYLENGTH]; 38 | #define PHY_REG_ARRAY_PG_LENGTH 624 39 | extern u32 rtl8192de_phy_reg_array_pg[PHY_REG_ARRAY_PG_LENGTH]; 40 | #define RADIOA_2T_ARRAYLENGTH 378 41 | extern u32 rtl8192de_radioa_2tarray[RADIOA_2T_ARRAYLENGTH]; 42 | #define RADIOB_2T_ARRAYLENGTH 384 43 | extern u32 rtl8192de_radiob_2tarray[RADIOB_2T_ARRAYLENGTH]; 44 | #define RADIOA_2T_INT_PA_ARRAYLENGTH 378 45 | extern u32 rtl8192de_radioa_2t_int_paarray[RADIOA_2T_INT_PA_ARRAYLENGTH]; 46 | #define RADIOB_2T_INT_PA_ARRAYLENGTH 384 47 | extern u32 rtl8192de_radiob_2t_int_paarray[RADIOB_2T_INT_PA_ARRAYLENGTH]; 48 | #define MAC_2T_ARRAYLENGTH 160 49 | extern u32 rtl8192de_mac_2tarray[MAC_2T_ARRAYLENGTH]; 50 | #define AGCTAB_ARRAYLENGTH 386 51 | extern u32 rtl8192de_agctab_array[AGCTAB_ARRAYLENGTH]; 52 | #define AGCTAB_5G_ARRAYLENGTH 194 53 | extern u32 rtl8192de_agctab_5garray[AGCTAB_5G_ARRAYLENGTH]; 54 | #define AGCTAB_2G_ARRAYLENGTH 194 55 | extern u32 rtl8192de_agctab_2garray[AGCTAB_2G_ARRAYLENGTH]; 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /rtl8192ee/Makefile: -------------------------------------------------------------------------------- 1 | rtl8192ee-objs := \ 2 | dm.o \ 3 | fw.o \ 4 | hw.o \ 5 | led.o \ 6 | phy.o \ 7 | pwrseq.o \ 8 | pwrseqcmd.o \ 9 | rf.o \ 10 | sw.o \ 11 | table.o \ 12 | trx.o 13 | 14 | obj-m += rtl8192ee.o 15 | 16 | ccflags-y += -Idrivers/net/wireless/rtlwifi -D__CHECK_ENDIAN__ 17 | 18 | 19 | -------------------------------------------------------------------------------- /rtl8192ee/def.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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * 26 | * Larry Finger 27 | * 28 | *****************************************************************************/ 29 | 30 | #ifndef __RTL92E_DEF_H__ 31 | #define __RTL92E_DEF_H__ 32 | 33 | 34 | #define HAL_PRIME_CHNL_OFFSET_DONT_CARE 0 35 | #define HAL_PRIME_CHNL_OFFSET_LOWER 1 36 | #define HAL_PRIME_CHNL_OFFSET_UPPER 2 37 | 38 | #define RX_MPDU_QUEUE 0 39 | 40 | #define IS_HT_RATE(_rate) \ 41 | (_rate >= DESC_RATEMCS0) 42 | #define IS_CCK_RATE(_rate) \ 43 | (_rate >= DESC_RATE1M && _rate <= DESC_RATE11M) 44 | #define IS_OFDM_RATE(_rate) \ 45 | (_rate >= DESC_RATE6M && _rate <= DESC_RATE54M) 46 | 47 | 48 | enum version_8192e { 49 | VERSION_TEST_CHIP_2T2R_8192E = 0x0024, 50 | VERSION_NORMAL_CHIP_2T2R_8192E = 0x102C, 51 | VERSION_UNKNOWN = 0xFF, 52 | }; 53 | 54 | enum rx_packet_type { 55 | NORMAL_RX, 56 | TX_REPORT1, 57 | TX_REPORT2, 58 | HIS_REPORT, 59 | C2H_PACKET, 60 | }; 61 | 62 | enum rtl_desc_qsel { 63 | QSLT_BK = 0x2, 64 | QSLT_BE = 0x0, 65 | QSLT_VI = 0x5, 66 | QSLT_VO = 0x7, 67 | QSLT_BEACON = 0x10, 68 | QSLT_HIGH = 0x11, 69 | QSLT_MGNT = 0x12, 70 | QSLT_CMD = 0x13, 71 | }; 72 | 73 | #endif 74 | -------------------------------------------------------------------------------- /rtl8192ee/hw.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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * 26 | * Larry Finger 27 | * 28 | *****************************************************************************/ 29 | 30 | #ifndef __RTL92E_HW_H__ 31 | #define __RTL92E_HW_H__ 32 | 33 | 34 | void rtl92ee_get_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val); 35 | void rtl92ee_read_eeprom_info(struct ieee80211_hw *hw); 36 | void rtl92ee_interrupt_recognized(struct ieee80211_hw *hw, 37 | u32 *p_inta, u32 *p_intb); 38 | int rtl92ee_hw_init(struct ieee80211_hw *hw); 39 | void rtl92ee_card_disable(struct ieee80211_hw *hw); 40 | void rtl92ee_enable_interrupt(struct ieee80211_hw *hw); 41 | void rtl92ee_disable_interrupt(struct ieee80211_hw *hw); 42 | int rtl92ee_set_network_type(struct ieee80211_hw *hw, enum nl80211_iftype type); 43 | void rtl92ee_set_check_bssid(struct ieee80211_hw *hw, bool check_bssid); 44 | void rtl92ee_set_qos(struct ieee80211_hw *hw, int aci); 45 | void rtl92ee_set_beacon_related_registers(struct ieee80211_hw *hw); 46 | void rtl92ee_set_beacon_interval(struct ieee80211_hw *hw); 47 | void rtl92ee_update_interrupt_mask(struct ieee80211_hw *hw, 48 | u32 add_msr, u32 rm_msr); 49 | void rtl92ee_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val); 50 | void rtl92ee_update_hal_rate_tbl(struct ieee80211_hw *hw, 51 | struct ieee80211_sta *sta, u8 rssi_level); 52 | void rtl92ee_update_channel_access_setting(struct ieee80211_hw *hw); 53 | bool rtl92ee_gpio_radio_on_off_checking(struct ieee80211_hw *hw, u8 *valid); 54 | void rtl92ee_enable_hw_security_config(struct ieee80211_hw *hw); 55 | void rtl92ee_read_bt_coexist_info_from_hwpg(struct ieee80211_hw *hw, 56 | bool autoload_fail, u8 *hwinfo); 57 | void rtl92ee_bt_reg_init(struct ieee80211_hw *hw); 58 | void rtl92ee_bt_hw_init(struct ieee80211_hw *hw); 59 | void rtl92ee_suspend(struct ieee80211_hw *hw); 60 | void rtl92ee_resume(struct ieee80211_hw *hw); 61 | void rtl92ee_allow_all_destaddr(struct ieee80211_hw *hw, bool allow_all_da, 62 | bool write_into_reg); 63 | void rtl92ee_fw_clk_off_timer_callback(unsigned long data); 64 | #endif 65 | -------------------------------------------------------------------------------- /rtl8192ee/led.c: -------------------------------------------------------------------------------- 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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * 26 | * Larry Finger 27 | * 28 | *****************************************************************************/ 29 | 30 | #include "../wifi.h" 31 | #include "../pci.h" 32 | #include "reg.h" 33 | #include "led.h" 34 | 35 | static void _rtl92ee_init_led(struct ieee80211_hw *hw, 36 | struct rtl_led *pled, enum rtl_led_pin ledpin) 37 | { 38 | pled->hw = hw; 39 | pled->ledpin = ledpin; 40 | pled->ledon = false; 41 | } 42 | 43 | void rtl92ee_sw_led_on(struct ieee80211_hw *hw, struct rtl_led *pled) 44 | { 45 | u32 ledcfg; 46 | struct rtl_priv *rtlpriv = rtl_priv(hw); 47 | 48 | RT_TRACE(rtlpriv, COMP_LED, DBG_LOUD, 49 | "LedAddr:%X ledpin=%d\n", REG_LEDCFG2, pled->ledpin); 50 | 51 | 52 | 53 | switch (pled->ledpin) { 54 | case LED_PIN_GPIO0: 55 | break; 56 | case LED_PIN_LED0: 57 | ledcfg = rtl_read_dword(rtlpriv , REG_GPIO_PIN_CTRL); 58 | ledcfg &= ~BIT(13); 59 | ledcfg |= BIT(21); 60 | ledcfg &= ~BIT(29); 61 | 62 | rtl_write_dword(rtlpriv, REG_GPIO_PIN_CTRL, ledcfg); 63 | 64 | break; 65 | case LED_PIN_LED1: 66 | 67 | break; 68 | default: 69 | RT_TRACE(rtlpriv, COMP_ERR, DBG_LOUD, 70 | "switch case not process\n"); 71 | break; 72 | } 73 | pled->ledon = true; 74 | } 75 | 76 | void rtl92ee_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled) 77 | { 78 | struct rtl_priv *rtlpriv = rtl_priv(hw); 79 | u32 ledcfg; 80 | 81 | RT_TRACE(rtlpriv, COMP_LED, DBG_LOUD, 82 | "LedAddr:%X ledpin=%d\n", REG_LEDCFG2, pled->ledpin); 83 | 84 | switch (pled->ledpin) { 85 | case LED_PIN_GPIO0: 86 | break; 87 | case LED_PIN_LED0: 88 | 89 | ledcfg = rtl_read_dword(rtlpriv , REG_GPIO_PIN_CTRL); 90 | ledcfg |= ~BIT(21); 91 | ledcfg &= ~BIT(29); 92 | rtl_write_dword(rtlpriv, REG_GPIO_PIN_CTRL, ledcfg); 93 | 94 | break; 95 | case LED_PIN_LED1: 96 | 97 | break; 98 | default: 99 | RT_TRACE(rtlpriv, COMP_ERR, DBG_LOUD, 100 | "switch case not process\n"); 101 | break; 102 | } 103 | pled->ledon = false; 104 | } 105 | 106 | void rtl92ee_init_sw_leds(struct ieee80211_hw *hw) 107 | { 108 | struct rtl_pci_priv *pcipriv = rtl_pcipriv(hw); 109 | _rtl92ee_init_led(hw, &(pcipriv->ledctl.sw_led0), LED_PIN_LED0); 110 | _rtl92ee_init_led(hw, &(pcipriv->ledctl.sw_led1), LED_PIN_LED1); 111 | } 112 | 113 | static void _rtl92ee_sw_led_control(struct ieee80211_hw *hw, 114 | enum led_ctl_mode ledaction) 115 | { 116 | struct rtl_pci_priv *pcipriv = rtl_pcipriv(hw); 117 | struct rtl_led *pLed0 = &(pcipriv->ledctl.sw_led0); 118 | switch (ledaction) { 119 | case LED_CTL_POWER_ON: 120 | case LED_CTL_LINK: 121 | case LED_CTL_NO_LINK: 122 | rtl92ee_sw_led_on(hw, pLed0); 123 | break; 124 | case LED_CTL_POWER_OFF: 125 | rtl92ee_sw_led_off(hw, pLed0); 126 | break; 127 | default: 128 | break; 129 | } 130 | } 131 | 132 | void rtl92ee_led_control(struct ieee80211_hw *hw, enum led_ctl_mode ledaction) 133 | { 134 | struct rtl_priv *rtlpriv = rtl_priv(hw); 135 | struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw)); 136 | 137 | if ((ppsc->rfoff_reason > RF_CHANGE_BY_PS) && 138 | (ledaction == LED_CTL_TX || 139 | ledaction == LED_CTL_RX || 140 | ledaction == LED_CTL_SITE_SURVEY || 141 | ledaction == LED_CTL_LINK || 142 | ledaction == LED_CTL_NO_LINK || 143 | ledaction == LED_CTL_START_TO_LINK || 144 | ledaction == LED_CTL_POWER_ON)) { 145 | return; 146 | } 147 | RT_TRACE(rtlpriv, COMP_LED, DBG_TRACE, "ledaction %d,\n", ledaction); 148 | _rtl92ee_sw_led_control(hw, ledaction); 149 | } 150 | -------------------------------------------------------------------------------- /rtl8192ee/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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * 26 | * Larry Finger 27 | * 28 | *****************************************************************************/ 29 | 30 | #ifndef __RTL92E_LED_H__ 31 | #define __RTL92E_LED_H__ 32 | 33 | void rtl92ee_init_sw_leds(struct ieee80211_hw *hw); 34 | void rtl92ee_sw_led_on(struct ieee80211_hw *hw, struct rtl_led *pled); 35 | void rtl92ee_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled); 36 | void rtl92ee_led_control(struct ieee80211_hw *hw, enum led_ctl_mode ledaction); 37 | #endif 38 | -------------------------------------------------------------------------------- /rtl8192ee/pwrseq.c: -------------------------------------------------------------------------------- 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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * 26 | * Larry Finger 27 | * 28 | *****************************************************************************/ 29 | 30 | #include "pwrseqcmd.h" 31 | #include "pwrseq.h" 32 | 33 | 34 | /* 35 | drivers should parse below arrays and do the corresponding actions 36 | */ 37 | /*3 Power on Array*/ 38 | struct wlan_pwr_cfg rtl8192E_power_on_flow[RTL8192E_TRANS_CARDEMU_TO_ACT_STEPS + 39 | RTL8192E_TRANS_END_STEPS] = { 40 | RTL8192E_TRANS_CARDEMU_TO_ACT 41 | RTL8192E_TRANS_END 42 | }; 43 | 44 | /*3Radio off GPIO Array */ 45 | struct wlan_pwr_cfg rtl8192E_radio_off_flow[RTL8192E_TRANS_ACT_TO_CARDEMU_STEPS 46 | + RTL8192E_TRANS_END_STEPS] = { 47 | RTL8192E_TRANS_ACT_TO_CARDEMU 48 | RTL8192E_TRANS_END 49 | }; 50 | 51 | /*3Card Disable Array*/ 52 | struct wlan_pwr_cfg rtl8192E_card_disable_flow 53 | [RTL8192E_TRANS_ACT_TO_CARDEMU_STEPS + 54 | RTL8192E_TRANS_CARDEMU_TO_PDN_STEPS + 55 | RTL8192E_TRANS_END_STEPS] = { 56 | RTL8192E_TRANS_ACT_TO_CARDEMU 57 | RTL8192E_TRANS_CARDEMU_TO_CARDDIS 58 | RTL8192E_TRANS_END 59 | }; 60 | 61 | /*3 Card Enable Array*/ 62 | struct wlan_pwr_cfg rtl8192E_card_enable_flow 63 | [RTL8192E_TRANS_ACT_TO_CARDEMU_STEPS + 64 | RTL8192E_TRANS_CARDEMU_TO_PDN_STEPS + 65 | RTL8192E_TRANS_END_STEPS] = { 66 | RTL8192E_TRANS_CARDDIS_TO_CARDEMU 67 | RTL8192E_TRANS_CARDEMU_TO_ACT 68 | RTL8192E_TRANS_END 69 | }; 70 | 71 | /*3Suspend Array*/ 72 | struct wlan_pwr_cfg rtl8192E_suspend_flow[RTL8192E_TRANS_ACT_TO_CARDEMU_STEPS + 73 | RTL8192E_TRANS_CARDEMU_TO_SUS_STEPS + 74 | RTL8192E_TRANS_END_STEPS] = { 75 | RTL8192E_TRANS_ACT_TO_CARDEMU 76 | RTL8192E_TRANS_CARDEMU_TO_SUS 77 | RTL8192E_TRANS_END 78 | }; 79 | 80 | /*3 Resume Array*/ 81 | struct wlan_pwr_cfg rtl8192E_resume_flow[RTL8192E_TRANS_ACT_TO_CARDEMU_STEPS + 82 | RTL8192E_TRANS_CARDEMU_TO_SUS_STEPS + 83 | RTL8192E_TRANS_END_STEPS] = { 84 | RTL8192E_TRANS_SUS_TO_CARDEMU 85 | RTL8192E_TRANS_CARDEMU_TO_ACT 86 | RTL8192E_TRANS_END 87 | }; 88 | 89 | /*3HWPDN Array*/ 90 | struct wlan_pwr_cfg rtl8192E_hwpdn_flow[RTL8192E_TRANS_ACT_TO_CARDEMU_STEPS + 91 | RTL8192E_TRANS_CARDEMU_TO_PDN_STEPS + 92 | RTL8192E_TRANS_END_STEPS] = { 93 | RTL8192E_TRANS_ACT_TO_CARDEMU 94 | RTL8192E_TRANS_CARDEMU_TO_PDN 95 | RTL8192E_TRANS_END 96 | }; 97 | 98 | /*3 Enter LPS */ 99 | struct wlan_pwr_cfg rtl8192E_enter_lps_flow[RTL8192E_TRANS_ACT_TO_LPS_STEPS + 100 | RTL8192E_TRANS_END_STEPS] = { 101 | /*FW behavior*/ 102 | RTL8192E_TRANS_ACT_TO_LPS 103 | RTL8192E_TRANS_END 104 | }; 105 | 106 | /*3 Leave LPS */ 107 | struct wlan_pwr_cfg rtl8192E_leave_lps_flow[RTL8192E_TRANS_LPS_TO_ACT_STEPS + 108 | RTL8192E_TRANS_END_STEPS] = { 109 | /*FW behavior*/ 110 | RTL8192E_TRANS_LPS_TO_ACT 111 | RTL8192E_TRANS_END 112 | }; 113 | -------------------------------------------------------------------------------- /rtl8192ee/pwrseqcmd.h: -------------------------------------------------------------------------------- 1 | #ifndef __RTL92E_PWRSEQCMD_H__ 2 | #define __RTL92E_PWRSEQCMD_H__ 3 | 4 | #include "../wifi.h" 5 | /*---------------------------------------------*/ 6 | /* The value of cmd: 4 bits */ 7 | /*---------------------------------------------*/ 8 | #define PWR_CMD_READ 0x00 9 | #define PWR_CMD_WRITE 0x01 10 | #define PWR_CMD_POLLING 0x02 11 | #define PWR_CMD_DELAY 0x03 12 | #define PWR_CMD_END 0x04 13 | 14 | /* define the base address of each block */ 15 | #define PWR_BASEADDR_MAC 0x00 16 | #define PWR_BASEADDR_USB 0x01 17 | #define PWR_BASEADDR_PCIE 0x02 18 | #define PWR_BASEADDR_SDIO 0x03 19 | 20 | #define PWR_INTF_SDIO_MSK BIT(0) 21 | #define PWR_INTF_USB_MSK BIT(1) 22 | #define PWR_INTF_PCI_MSK BIT(2) 23 | #define PWR_INTF_ALL_MSK (BIT(0) | BIT(1) | BIT(2) | BIT(3)) 24 | 25 | #define PWR_FAB_TSMC_MSK BIT(0) 26 | #define PWR_FAB_UMC_MSK BIT(1) 27 | #define PWR_FAB_ALL_MSK (BIT(0) | BIT(1) | BIT(2) | BIT(3)) 28 | 29 | #define PWR_CUT_TESTCHIP_MSK BIT(0) 30 | #define PWR_CUT_A_MSK BIT(1) 31 | #define PWR_CUT_B_MSK BIT(2) 32 | #define PWR_CUT_C_MSK BIT(3) 33 | #define PWR_CUT_D_MSK BIT(4) 34 | #define PWR_CUT_E_MSK BIT(5) 35 | #define PWR_CUT_F_MSK BIT(6) 36 | #define PWR_CUT_G_MSK BIT(7) 37 | #define PWR_CUT_ALL_MSK 0xFF 38 | 39 | 40 | enum pwrseq_delay_unit { 41 | PWRSEQ_DELAY_US, 42 | PWRSEQ_DELAY_MS, 43 | }; 44 | 45 | struct wlan_pwr_cfg { 46 | u16 offset; 47 | u8 cut_msk; 48 | u8 fab_msk:4; 49 | u8 interface_msk:4; 50 | u8 base:4; 51 | u8 cmd:4; 52 | u8 msk; 53 | u8 value; 54 | }; 55 | 56 | #define GET_PWR_CFG_OFFSET(__PWR_CMD) __PWR_CMD.offset 57 | #define GET_PWR_CFG_CUT_MASK(__PWR_CMD) __PWR_CMD.cut_msk 58 | #define GET_PWR_CFG_FAB_MASK(__PWR_CMD) __PWR_CMD.fab_msk 59 | #define GET_PWR_CFG_INTF_MASK(__PWR_CMD) __PWR_CMD.interface_msk 60 | #define GET_PWR_CFG_BASE(__PWR_CMD) __PWR_CMD.base 61 | #define GET_PWR_CFG_CMD(__PWR_CMD) __PWR_CMD.cmd 62 | #define GET_PWR_CFG_MASK(__PWR_CMD) __PWR_CMD.msk 63 | #define GET_PWR_CFG_VALUE(__PWR_CMD) __PWR_CMD.value 64 | 65 | bool rtl_hal_pwrseqcmdparsing(struct rtl_priv *rtlpriv, u8 cut_version, 66 | u8 fab_version, u8 interface_type, 67 | struct wlan_pwr_cfg pwrcfgcmd[]); 68 | 69 | #endif 70 | -------------------------------------------------------------------------------- /rtl8192ee/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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * 26 | * Larry Finger 27 | * 28 | *****************************************************************************/ 29 | 30 | #ifndef __RTL92E_RF_H__ 31 | #define __RTL92E_RF_H__ 32 | 33 | #define RF6052_MAX_TX_PWR 0x3F 34 | #define RF6052_MAX_REG 0x3F 35 | 36 | extern void rtl92ee_phy_rf6052_set_bandwidth(struct ieee80211_hw *hw, 37 | u8 bandwidth); 38 | extern bool rtl92ee_phy_rf6052_config(struct ieee80211_hw *hw); 39 | #endif 40 | -------------------------------------------------------------------------------- /rtl8192ee/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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * 26 | * Larry Finger 27 | * 28 | *****************************************************************************/ 29 | 30 | #ifndef __RTL92E_SW_H__ 31 | #define __RTL92E_SW_H__ 32 | 33 | int rtl92ee_init_sw_vars(struct ieee80211_hw *hw); 34 | void rtl92ee_deinit_sw_vars(struct ieee80211_hw *hw); 35 | bool rtl92ee_get_btc_status(void); 36 | #endif 37 | -------------------------------------------------------------------------------- /rtl8192ee/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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * 26 | * Created on 2010/ 5/18, 1:41 27 | * 28 | * Larry Finger 29 | * 30 | *****************************************************************************/ 31 | 32 | #ifndef __RTL92E_TABLE__H_ 33 | #define __RTL92E_TABLE__H_ 34 | 35 | #include 36 | #define RTL8192EE_PHY_REG_ARRAY_LEN 448 37 | extern u32 RTL8192EE_PHY_REG_ARRAY[]; 38 | #define RTL8192EE_PHY_REG_ARRAY_PG_LEN 168 39 | extern u32 RTL8192EE_PHY_REG_ARRAY_PG[]; 40 | #define RTL8192EE_RADIOA_ARRAY_LEN 238 41 | extern u32 RTL8192EE_RADIOA_ARRAY[]; 42 | #define RTL8192EE_RADIOB_ARRAY_LEN 198 43 | extern u32 RTL8192EE_RADIOB_ARRAY[]; 44 | #define RTL8192EE_MAC_ARRAY_LEN 202 45 | extern u32 RTL8192EE_MAC_ARRAY[]; 46 | #define RTL8192EE_AGC_TAB_ARRAY_LEN 532 47 | extern u32 RTL8192EE_AGC_TAB_ARRAY[]; 48 | #endif 49 | -------------------------------------------------------------------------------- /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-m += rtl8192se.o 13 | 14 | ccflags-y += -Idrivers/net/wireless/rtlwifi -D__CHECK_ENDIAN__ 15 | 16 | 17 | -------------------------------------------------------------------------------- /rtl8192se/dm.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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * 26 | *****************************************************************************/ 27 | #ifndef __RTL_92S_DM_H__ 28 | #define __RTL_92S_DM_H__ 29 | 30 | enum dm_dig_alg { 31 | DIG_ALGO_BY_FALSE_ALARM = 0, 32 | DIG_ALGO_BY_RSSI = 1, 33 | DIG_ALGO_BEFORE_CONNECT_BY_RSSI_AND_ALARM = 2, 34 | DIG_ALGO_BY_TOW_PORT = 3, 35 | DIG_ALGO_MAX 36 | }; 37 | 38 | enum dm_dig_two_port_alg { 39 | DIG_TWO_PORT_ALGO_RSSI = 0, 40 | DIG_TWO_PORT_ALGO_FALSE_ALARM = 1, 41 | }; 42 | 43 | enum dm_dig_dbg { 44 | DM_DBG_OFF = 0, 45 | DM_DBG_ON = 1, 46 | DM_DBG_MAX 47 | }; 48 | 49 | enum dm_dig_sta { 50 | DM_STA_DIG_OFF = 0, 51 | DM_STA_DIG_ON, 52 | DM_STA_DIG_MAX 53 | }; 54 | 55 | enum dm_dig_connect { 56 | DIG_STA_DISCONNECT = 0, 57 | DIG_STA_CONNECT = 1, 58 | DIG_STA_BEFORE_CONNECT = 2, 59 | DIG_AP_DISCONNECT = 3, 60 | DIG_AP_CONNECT = 4, 61 | DIG_AP_ADD_STATION = 5, 62 | DIG_CONNECT_MAX 63 | }; 64 | 65 | enum dm_dig_ext_port_alg { 66 | DIG_EXT_PORT_STAGE_0 = 0, 67 | DIG_EXT_PORT_STAGE_1 = 1, 68 | DIG_EXT_PORT_STAGE_2 = 2, 69 | DIG_EXT_PORT_STAGE_3 = 3, 70 | DIG_EXT_PORT_STAGE_MAX = 4, 71 | }; 72 | 73 | enum dm_ratr_sta { 74 | DM_RATR_STA_HIGH = 0, 75 | DM_RATR_STA_MIDDLEHIGH = 1, 76 | DM_RATR_STA_MIDDLE = 2, 77 | DM_RATR_STA_MIDDLELOW = 3, 78 | DM_RATR_STA_LOW = 4, 79 | DM_RATR_STA_ULTRALOW = 5, 80 | DM_RATR_STA_MAX 81 | }; 82 | 83 | #define DM_TYPE_BYFW 0 84 | #define DM_TYPE_BYDRIVER 1 85 | 86 | #define TX_HIGH_PWR_LEVEL_NORMAL 0 87 | #define TX_HIGH_PWR_LEVEL_LEVEL1 1 88 | #define TX_HIGH_PWR_LEVEL_LEVEL2 2 89 | 90 | #define HAL_DM_DIG_DISABLE BIT(0) /* Disable Dig */ 91 | #define HAL_DM_HIPWR_DISABLE BIT(1) /* Disable High Power */ 92 | 93 | #define TX_HIGHPWR_LEVEL_NORMAL 0 94 | #define TX_HIGHPWR_LEVEL_NORMAL1 1 95 | #define TX_HIGHPWR_LEVEL_NORMAL2 2 96 | 97 | #define TX_POWER_NEAR_FIELD_THRESH_LVL2 74 98 | #define TX_POWER_NEAR_FIELD_THRESH_LVL1 67 99 | 100 | #define DM_DIG_THRESH_HIGH 40 101 | #define DM_DIG_THRESH_LOW 35 102 | #define DM_FALSEALARM_THRESH_LOW 40 103 | #define DM_FALSEALARM_THRESH_HIGH 1000 104 | #define DM_DIG_HIGH_PWR_THRESH_HIGH 75 105 | #define DM_DIG_HIGH_PWR_THRESH_LOW 70 106 | #define DM_DIG_BACKOFF 12 107 | #define DM_DIG_MAX 0x3e 108 | #define DM_DIG_MIN 0x1c 109 | #define DM_DIG_MIN_Netcore 0x12 110 | #define DM_DIG_BACKOFF_MAX 12 111 | #define DM_DIG_BACKOFF_MIN -4 112 | 113 | void rtl92s_dm_watchdog(struct ieee80211_hw *hw); 114 | void rtl92s_dm_init(struct ieee80211_hw *hw); 115 | void rtl92s_dm_init_edca_turbo(struct ieee80211_hw *hw); 116 | 117 | #endif 118 | -------------------------------------------------------------------------------- /rtl8192se/fw.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtlwifi-linux/rtlwifi_new/15f04b7bf308e3aed2a5067e5ab8b16a72717b95/rtl8192se/fw.h -------------------------------------------------------------------------------- /rtl8192se/hw.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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * 26 | *****************************************************************************/ 27 | #ifndef __REALTEK_PCI92SE_HW_H__ 28 | #define __REALTEK_PCI92SE_HW_H__ 29 | 30 | #define MSR_LINK_MASK ((1<<0)|(1<<1)) 31 | #define MSR_LINK_MANAGED 2 32 | #define MSR_LINK_NONE 0 33 | #define MSR_LINK_SHIFT 0 34 | #define MSR_LINK_ADHOC 1 35 | #define MSR_LINK_MASTER 3 36 | 37 | enum _NETWORK_TYPE { 38 | WIRELESS_11B = 1, 39 | WIRELESS_11G = 2, 40 | WIRELESS_11A = 4, 41 | WIRELESS_11N = 8 42 | }; 43 | 44 | void rtl92se_get_hw_reg(struct ieee80211_hw *hw, 45 | u8 variable, u8 *val); 46 | void rtl92se_read_eeprom_info(struct ieee80211_hw *hw); 47 | void rtl92se_interrupt_recognized(struct ieee80211_hw *hw, 48 | u32 *p_inta, u32 *p_intb); 49 | int rtl92se_hw_init(struct ieee80211_hw *hw); 50 | void rtl92se_card_disable(struct ieee80211_hw *hw); 51 | void rtl92se_enable_interrupt(struct ieee80211_hw *hw); 52 | void rtl92se_disable_interrupt(struct ieee80211_hw *hw); 53 | int rtl92se_set_network_type(struct ieee80211_hw *hw, 54 | enum nl80211_iftype type); 55 | void rtl92se_set_check_bssid(struct ieee80211_hw *hw, bool check_bssid); 56 | void rtl92se_set_mac_addr(struct rtl_io *io, const u8 *addr); 57 | void rtl92se_set_qos(struct ieee80211_hw *hw, int aci); 58 | void rtl92se_set_beacon_related_registers(struct ieee80211_hw *hw); 59 | void rtl92se_set_beacon_interval(struct ieee80211_hw *hw); 60 | void rtl92se_update_interrupt_mask(struct ieee80211_hw *hw, 61 | u32 add_msr, u32 rm_msr); 62 | void rtl92se_set_hw_reg(struct ieee80211_hw *hw, u8 variable, 63 | u8 *val); 64 | void rtl92se_update_hal_rate_tbl(struct ieee80211_hw *hw, 65 | struct ieee80211_sta *sta, u8 rssi_level); 66 | void rtl92se_update_channel_access_setting(struct ieee80211_hw *hw); 67 | bool rtl92se_gpio_radio_on_off_checking(struct ieee80211_hw *hw, 68 | u8 *valid); 69 | void rtl8192se_gpiobit3_cfg_inputmode(struct ieee80211_hw *hw); 70 | void rtl92se_enable_hw_security_config(struct ieee80211_hw *hw); 71 | 72 | void rtl92se_suspend(struct ieee80211_hw *hw); 73 | void rtl92se_resume(struct ieee80211_hw *hw); 74 | void rtl92se_allow_all_destaddr(struct ieee80211_hw *hw, 75 | bool allow_all_da, bool write_into_reg); 76 | #endif 77 | -------------------------------------------------------------------------------- /rtl8192se/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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * 26 | *****************************************************************************/ 27 | #ifndef __REALTEK_PCI92SE_LED_H__ 28 | #define __REALTEK_PCI92SE_LED_H__ 29 | 30 | void rtl92se_init_sw_leds(struct ieee80211_hw *hw); 31 | void rtl92se_sw_led_on(struct ieee80211_hw *hw, struct rtl_led *pled); 32 | void rtl92se_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled); 33 | void rtl92se_led_control(struct ieee80211_hw *hw, enum led_ctl_mode ledaction); 34 | 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /rtl8192se/phy.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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * 26 | *****************************************************************************/ 27 | #ifndef __RTL92S_PHY_H__ 28 | #define __RTL92S_PHY_H__ 29 | 30 | #define MAX_TXPWR_IDX_NMODE_92S 63 31 | #define MAX_DOZE_WAITING_TIMES_9x 64 32 | 33 | /* Channel switch:The size of 34 | * command tables for switch channel */ 35 | #define MAX_PRECMD_CNT 16 36 | #define MAX_RFDEPENDCMD_CNT 16 37 | #define MAX_POSTCMD_CNT 16 38 | 39 | #define RF6052_MAX_PATH 2 40 | 41 | enum version_8192s { 42 | VERSION_8192S_ACUT, 43 | VERSION_8192S_BCUT, 44 | VERSION_8192S_CCUT 45 | }; 46 | 47 | enum swchnlcmd_id { 48 | CMDID_END, 49 | CMDID_SET_TXPOWEROWER_LEVEL, 50 | CMDID_BBREGWRITE10, 51 | CMDID_WRITEPORT_ULONG, 52 | CMDID_WRITEPORT_USHORT, 53 | CMDID_WRITEPORT_UCHAR, 54 | CMDID_RF_WRITEREG, 55 | }; 56 | 57 | struct swchnlcmd { 58 | enum swchnlcmd_id cmdid; 59 | u32 para1; 60 | u32 para2; 61 | u32 msdelay; 62 | }; 63 | 64 | enum baseband_config_type { 65 | /* Radio Path A */ 66 | BASEBAND_CONFIG_PHY_REG = 0, 67 | /* Radio Path B */ 68 | BASEBAND_CONFIG_AGC_TAB = 1, 69 | }; 70 | 71 | #define hal_get_firmwareverison(rtlpriv) \ 72 | (((struct rt_firmware *)(rtlpriv->rtlhal.pfirmware))->firmwareversion) 73 | 74 | u32 rtl92s_phy_query_bb_reg(struct ieee80211_hw *hw, u32 regaddr, u32 bitmask); 75 | void rtl92s_phy_set_bb_reg(struct ieee80211_hw *hw, u32 regaddr, u32 bitmask, 76 | u32 data); 77 | void rtl92s_phy_scan_operation_backup(struct ieee80211_hw *hw, u8 operation); 78 | u32 rtl92s_phy_query_rf_reg(struct ieee80211_hw *hw, enum radio_path rfpath, 79 | u32 regaddr, u32 bitmask); 80 | void rtl92s_phy_set_rf_reg(struct ieee80211_hw *hw, enum radio_path rfpath, 81 | u32 regaddr, u32 bitmask, u32 data); 82 | void rtl92s_phy_set_bw_mode(struct ieee80211_hw *hw, 83 | enum nl80211_channel_type ch_type); 84 | u8 rtl92s_phy_sw_chnl(struct ieee80211_hw *hw); 85 | bool rtl92s_phy_set_rf_power_state(struct ieee80211_hw *hw, 86 | enum rf_pwrstate rfpower_state); 87 | bool rtl92s_phy_mac_config(struct ieee80211_hw *hw); 88 | void rtl92s_phy_switch_ephy_parameter(struct ieee80211_hw *hw); 89 | bool rtl92s_phy_bb_config(struct ieee80211_hw *hw); 90 | bool rtl92s_phy_rf_config(struct ieee80211_hw *hw); 91 | void rtl92s_phy_get_hw_reg_originalvalue(struct ieee80211_hw *hw); 92 | void rtl92s_phy_set_txpower(struct ieee80211_hw *hw, u8 channel); 93 | bool rtl92s_phy_set_fw_cmd(struct ieee80211_hw *hw, enum fwcmd_iotype fwcmd_io); 94 | void rtl92s_phy_chk_fwcmd_iodone(struct ieee80211_hw *hw); 95 | void rtl92s_phy_set_beacon_hwreg(struct ieee80211_hw *hw, u16 beaconinterval); 96 | u8 rtl92s_phy_config_rf(struct ieee80211_hw *hw, enum radio_path rfpath); 97 | #endif 98 | -------------------------------------------------------------------------------- /rtl8192se/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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * 26 | *****************************************************************************/ 27 | #ifndef __INC_RTL92S_RF_H 28 | #define __INC_RTL92S_RF_H 29 | 30 | #define RF6052_MAX_TX_PWR 0x3F 31 | 32 | void rtl92s_phy_rf6052_set_bandwidth(struct ieee80211_hw *hw, 33 | u8 bandwidth); 34 | bool rtl92s_phy_rf6052_config(struct ieee80211_hw *hw); 35 | void rtl92s_phy_rf6052_set_ccktxpower(struct ieee80211_hw *hw, 36 | u8 powerlevel); 37 | void rtl92s_phy_rf6052_set_ofdmtxpower(struct ieee80211_hw *hw, 38 | u8 *p_pwrlevel, u8 chnl); 39 | #endif 40 | -------------------------------------------------------------------------------- /rtl8192se/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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * 26 | *****************************************************************************/ 27 | #ifndef __REALTEK_PCI92SE_SW_H__ 28 | #define __REALTEK_PCI92SE_SW_H__ 29 | 30 | int rtl92se_init_sw(struct ieee80211_hw *hw); 31 | void rtl92se_deinit_sw(struct ieee80211_hw *hw); 32 | void rtl92se_init_var_map(struct ieee80211_hw *hw); 33 | bool rtl92s_get_btc_status(void); 34 | 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /rtl8192se/table.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Copyright(c) 2008 - 2010 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 | * You should have received a copy of the GNU General Public License along with 10 | * this program; if not, write to the Free Software Foundation, Inc., 11 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 12 | * 13 | * The full GNU General Public License is included in this distribution in the 14 | * file called LICENSE. 15 | * 16 | * Contact Information: 17 | * wlanfae 18 | ******************************************************************************/ 19 | #ifndef __INC_HAL8192SE_FW_IMG_H 20 | #define __INC_HAL8192SE_FW_IMG_H 21 | 22 | #include 23 | 24 | /*Created on 2010/ 4/12, 5:56*/ 25 | 26 | #define PHY_REG_2T2RARRAYLENGTH 372 27 | extern u32 rtl8192sephy_reg_2t2rarray[PHY_REG_2T2RARRAYLENGTH]; 28 | #define PHY_CHANGETO_1T1RARRAYLENGTH 48 29 | extern u32 rtl8192sephy_changeto_1t1rarray[PHY_CHANGETO_1T1RARRAYLENGTH]; 30 | #define PHY_CHANGETO_1T2RARRAYLENGTH 45 31 | extern u32 rtl8192sephy_changeto_1t2rarray[PHY_CHANGETO_1T2RARRAYLENGTH]; 32 | #define PHY_REG_ARRAY_PGLENGTH 84 33 | extern u32 rtl8192sephy_reg_array_pg[PHY_REG_ARRAY_PGLENGTH]; 34 | #define RADIOA_1T_ARRAYLENGTH 202 35 | extern u32 rtl8192seradioa_1t_array[RADIOA_1T_ARRAYLENGTH]; 36 | #define RADIOB_ARRAYLENGTH 22 37 | extern u32 rtl8192seradiob_array[RADIOB_ARRAYLENGTH]; 38 | #define RADIOB_GM_ARRAYLENGTH 10 39 | extern u32 rtl8192seradiob_gm_array[RADIOB_GM_ARRAYLENGTH]; 40 | #define MAC_2T_ARRAYLENGTH 106 41 | extern u32 rtl8192semac_2t_array[MAC_2T_ARRAYLENGTH]; 42 | #define AGCTAB_ARRAYLENGTH 320 43 | extern u32 rtl8192seagctab_array[AGCTAB_ARRAYLENGTH]; 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /rtl8192se/trx.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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * 26 | *****************************************************************************/ 27 | #ifndef __REALTEK_PCI92SE_TRX_H__ 28 | #define __REALTEK_PCI92SE_TRX_H__ 29 | 30 | void rtl92se_tx_fill_desc(struct ieee80211_hw *hw, struct ieee80211_hdr *hdr, 31 | u8 *pdesc, u8 *txbd, 32 | struct ieee80211_tx_info *info, 33 | struct ieee80211_sta *sta, 34 | struct sk_buff *skb, u8 hw_queue, 35 | struct rtl_tcb_desc *ptcb_desc); 36 | void rtl92se_tx_fill_cmddesc(struct ieee80211_hw *hw, 37 | u8 *pdesc, bool firstseg, 38 | bool lastseg, struct sk_buff *skb); 39 | bool rtl92se_rx_query_desc(struct ieee80211_hw *hw, struct rtl_stats *status, 40 | struct ieee80211_rx_status *rx_status, u8 *pdesc, struct sk_buff *skb); 41 | void rtl92se_set_desc(struct ieee80211_hw *hw, u8 *pdesc, 42 | bool istx, u8 desc_name, u8 *val); 43 | u32 rtl92se_get_desc(u8 *pdesc, bool istx, u8 desc_name); 44 | bool rtl92se_is_tx_desc_closed(struct ieee80211_hw *hw, u8 hw_queue, u16 index); 45 | void rtl92se_tx_polling(struct ieee80211_hw *hw, u8 hw_queue); 46 | u32 rtl92se_rx_command_packet(struct ieee80211_hw *hw, 47 | struct rtl_stats status, 48 | struct sk_buff *skb); 49 | #endif 50 | -------------------------------------------------------------------------------- /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 | pwrseqcmd.o \ 11 | rf.o \ 12 | sw.o \ 13 | table.o \ 14 | trx.o \ 15 | 16 | obj-m += rtl8723ae.o 17 | 18 | ccflags-y += -Idrivers/net/wireless/rtlwifi -D__CHECK_ENDIAN__ 19 | 20 | 21 | -------------------------------------------------------------------------------- /rtl8723ae/btc.h: -------------------------------------------------------------------------------- 1 | 2 | /****************************************************************************** 3 | ** 4 | ** Copyright(c) 2009-2010 Realtek Corporation. 5 | ** 6 | ** This program is free software; you can redistribute it and/or modify it 7 | ** under the terms of version 2 of the GNU General Public License as 8 | ** published by the Free Software Foundation. 9 | ** 10 | ** This program is distributed in the hope that it will be useful, but WITHOUT 11 | ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 12 | ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 13 | ** more details. 14 | ** 15 | ** You should have received a copy of the GNU General Public License along with 16 | ** this program; if not, write to the Free Software Foundation, Inc., 17 | ** 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 18 | ** 19 | ** The full GNU General Public License is included in this distribution in the 20 | ** file called LICENSE. 21 | ** 22 | ** Contact Information: 23 | ** wlanfae 24 | ** Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 25 | ** Hsinchu 300, Taiwan. 26 | ** Larry Finger 27 | ** 28 | ******************************************************************************/ 29 | 30 | #ifndef __RTL8723E_BTC_H__ 31 | #define __RTL8723E_BTC_H__ 32 | 33 | #include "../wifi.h" 34 | #include "hal_bt_coexist.h" 35 | 36 | struct bt_coexist_c2h_info { 37 | u8 no_parse_c2h; 38 | u8 has_c2h; 39 | }; 40 | 41 | struct btdm_8723 { 42 | bool b_all_off; 43 | bool b_agc_table_en; 44 | bool b_adc_back_off_on; 45 | bool b2_ant_hid_en; 46 | bool b_low_penalty_rate_adaptive; 47 | bool b_rf_rx_lpf_shrink; 48 | bool b_reject_aggre_pkt; 49 | bool b_tra_tdma_on; 50 | u8 tra_tdma_nav; 51 | u8 tra_tdma_ant; 52 | bool b_tdma_on; 53 | u8 tdma_ant; 54 | u8 tdma_nav; 55 | u8 tdma_dac_swing; 56 | u8 fw_dac_swing_lvl; 57 | bool b_ps_tdma_on; 58 | u8 ps_tdma_byte[5]; 59 | bool b_pta_on; 60 | u32 val_0x6c0; 61 | u32 val_0x6c8; 62 | u32 val_0x6cc; 63 | bool sw_dac_swing_on; 64 | u32 sw_dac_swing_lvl; 65 | u32 wlan_act_hi; 66 | u32 wlan_act_lo; 67 | u32 bt_retry_index; 68 | bool b_dec_bt_pwr; 69 | bool b_ignore_wlan_act; 70 | }; 71 | 72 | struct bt_coexist_8723 { 73 | u32 high_priority_tx; 74 | u32 high_priority_rx; 75 | u32 low_priority_tx; 76 | u32 low_priority_rx; 77 | u8 c2h_bt_info; 78 | bool b_c2h_bt_info_req_sent; 79 | bool b_c2h_bt_inquiry_page; 80 | u32 bt_inq_page_start_time; 81 | u8 bt_retry_cnt; 82 | u8 c2h_bt_info_original; 83 | u8 bt_inquiry_page_cnt; 84 | struct btdm_8723 btdm; 85 | }; 86 | 87 | #endif 88 | -------------------------------------------------------------------------------- /rtl8723ae/fw.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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * Larry Finger 26 | * 27 | *****************************************************************************/ 28 | 29 | #ifndef __RTL92C__FW__H__ 30 | #define __RTL92C__FW__H__ 31 | 32 | #define FW_8192C_SIZE 0x3000 33 | #define FW_8192C_START_ADDRESS 0x1000 34 | #define FW_8192C_END_ADDRESS 0x3FFF 35 | #define FW_8192C_PAGE_SIZE 4096 36 | #define FW_8192C_POLLING_DELAY 5 37 | #define FW_8192C_POLLING_TIMEOUT_COUNT 1000 38 | 39 | #define IS_FW_HEADER_EXIST(_pfwhdr) \ 40 | ((_pfwhdr->signature&0xFFFF) == 0x2300 ||\ 41 | (_pfwhdr->signature&0xFFFF) == 0x2301 ||\ 42 | (_pfwhdr->signature&0xFFFF) == 0x2302) 43 | 44 | struct rtl8723e_firmware_header { 45 | u16 signature; 46 | u8 category; 47 | u8 function; 48 | u16 version; 49 | u8 subversion; 50 | u8 rsvd1; 51 | u8 month; 52 | u8 date; 53 | u8 hour; 54 | u8 minute; 55 | u16 ramcodeSize; 56 | u16 rsvd2; 57 | u32 svnindex; 58 | u32 rsvd3; 59 | u32 rsvd4; 60 | u32 rsvd5; 61 | }; 62 | 63 | #define pagenum_128(_len) (u32)(((_len)>>7) + ((_len)&0x7F ? 1:0)) 64 | 65 | #define SET_H2CCMD_PWRMODE_PARM_MODE(__ph2ccmd, __val) \ 66 | SET_BITS_TO_LE_1BYTE(__ph2ccmd, 0, 8, __val) 67 | #define SET_H2CCMD_PWRMODE_PARM_SMART_PS(__ph2ccmd, __val) \ 68 | SET_BITS_TO_LE_1BYTE((__ph2ccmd)+1, 0, 8, __val) 69 | #define SET_H2CCMD_PWRMODE_PARM_BCN_PASS_TIME(__ph2ccmd, __val) \ 70 | SET_BITS_TO_LE_1BYTE((__ph2ccmd)+2, 0, 8, __val) 71 | #define SET_H2CCMD_JOINBSSRPT_PARM_OPMODE(__ph2ccmd, __val) \ 72 | SET_BITS_TO_LE_1BYTE(__ph2ccmd, 0, 8, __val) 73 | #define SET_H2CCMD_RSVDPAGE_LOC_PROBE_RSP(__ph2ccmd, __val) \ 74 | SET_BITS_TO_LE_1BYTE(__ph2ccmd, 0, 8, __val) 75 | #define SET_H2CCMD_RSVDPAGE_LOC_PSPOLL(__ph2ccmd, __val) \ 76 | SET_BITS_TO_LE_1BYTE((__ph2ccmd)+1, 0, 8, __val) 77 | #define SET_H2CCMD_RSVDPAGE_LOC_NULL_DATA(__ph2ccmd, __val) \ 78 | SET_BITS_TO_LE_1BYTE((__ph2ccmd)+2, 0, 8, __val) 79 | 80 | int rtl8723e_download_fw(struct ieee80211_hw *hw); 81 | void rtl8723e_fill_h2c_cmd(struct ieee80211_hw *hw, u8 element_id, 82 | u32 cmd_len, u8 *p_cmdbuffer); 83 | void rtl8723e_firmware_selfreset(struct ieee80211_hw *hw); 84 | void rtl8723e_set_fw_pwrmode_cmd(struct ieee80211_hw *hw, u8 mode); 85 | void rtl8723e_set_fw_rsvdpagepkt(struct ieee80211_hw *hw, bool b_dl_finished); 86 | void rtl8723e_set_fw_joinbss_report_cmd(struct ieee80211_hw *hw, u8 mstatus); 87 | void rtl8723e_set_p2p_ps_offload_cmd(struct ieee80211_hw *hw, u8 p2p_ps_state); 88 | #endif 89 | -------------------------------------------------------------------------------- /rtl8723ae/hw.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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * 26 | * Larry Finger 27 | * 28 | *****************************************************************************/ 29 | 30 | #ifndef __RTL8723E_HW_H__ 31 | #define __RTL8723E_HW_H__ 32 | 33 | void rtl8723e_get_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val); 34 | void rtl8723e_read_eeprom_info(struct ieee80211_hw *hw); 35 | 36 | void rtl8723e_interrupt_recognized(struct ieee80211_hw *hw, 37 | u32 *p_inta, u32 *p_intb); 38 | int rtl8723e_hw_init(struct ieee80211_hw *hw); 39 | void rtl8723e_card_disable(struct ieee80211_hw *hw); 40 | void rtl8723e_enable_interrupt(struct ieee80211_hw *hw); 41 | void rtl8723e_disable_interrupt(struct ieee80211_hw *hw); 42 | int rtl8723e_set_network_type(struct ieee80211_hw *hw, 43 | enum nl80211_iftype type); 44 | void rtl8723e_set_check_bssid(struct ieee80211_hw *hw, bool check_bssid); 45 | void rtl8723e_set_qos(struct ieee80211_hw *hw, int aci); 46 | void rtl8723e_set_beacon_related_registers(struct ieee80211_hw *hw); 47 | void rtl8723e_set_beacon_interval(struct ieee80211_hw *hw); 48 | void rtl8723e_update_interrupt_mask(struct ieee80211_hw *hw, 49 | u32 add_msr, u32 rm_msr); 50 | void rtl8723e_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val); 51 | void rtl8723e_update_hal_rate_tbl(struct ieee80211_hw *hw, 52 | struct ieee80211_sta *sta, u8 rssi_level); 53 | void rtl8723e_update_channel_access_setting(struct ieee80211_hw *hw); 54 | bool rtl8723e_gpio_radio_on_off_checking(struct ieee80211_hw *hw, u8 *valid); 55 | void rtl8723e_enable_hw_security_config(struct ieee80211_hw *hw); 56 | 57 | void rtl8723e_read_bt_coexist_info_from_hwpg(struct ieee80211_hw *hw, 58 | bool autoload_fail, u8 *hwinfo); 59 | void rtl8723e_bt_reg_init(struct ieee80211_hw *hw); 60 | void rtl8723e_bt_hw_init(struct ieee80211_hw *hw); 61 | void rtl8723e_suspend(struct ieee80211_hw *hw); 62 | void rtl8723e_resume(struct ieee80211_hw *hw); 63 | void rtl8723e_allow_all_destaddr(struct ieee80211_hw *hw, 64 | bool allow_all_da, bool write_into_reg); 65 | #endif 66 | -------------------------------------------------------------------------------- /rtl8723ae/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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * 26 | * Larry Finger 27 | * 28 | *****************************************************************************/ 29 | 30 | #ifndef __RTL92CE_LED_H__ 31 | #define __RTL92CE_LED_H__ 32 | 33 | void rtl8723e_init_sw_leds(struct ieee80211_hw *hw); 34 | void rtl8723e_sw_led_on(struct ieee80211_hw *hw, struct rtl_led *pled); 35 | void rtl8723e_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled); 36 | void rtl8723e_led_control(struct ieee80211_hw *hw, enum led_ctl_mode ledaction); 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /rtl8723ae/pwrseq.c: -------------------------------------------------------------------------------- 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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * 26 | * Larry Finger 27 | * 28 | *****************************************************************************/ 29 | 30 | #include "pwrseqcmd.h" 31 | #include "pwrseq.h" 32 | 33 | 34 | /* 35 | drivers should parse below arrays and do the corresponding actions 36 | */ 37 | /*3 Power on Array*/ 38 | struct wlan_pwr_cfg rtl8723A_power_on_flow[RTL8723A_TRANS_CARDEMU_TO_ACT_STEPS 39 | + RTL8723A_TRANS_END_STEPS] = { 40 | RTL8723A_TRANS_CARDEMU_TO_ACT 41 | RTL8723A_TRANS_END 42 | }; 43 | 44 | /*3Radio off GPIO Array */ 45 | struct wlan_pwr_cfg rtl8723A_radio_off_flow[RTL8723A_TRANS_ACT_TO_CARDEMU_STEPS 46 | + RTL8723A_TRANS_END_STEPS] = { 47 | RTL8723A_TRANS_ACT_TO_CARDEMU 48 | RTL8723A_TRANS_END 49 | }; 50 | 51 | /*3Card Disable Array*/ 52 | struct wlan_pwr_cfg rtl8723A_card_disable_flow[RTL8723A_TRANS_ACT_TO_CARDEMU_STEPS 53 | + RTL8723A_TRANS_CARDEMU_TO_PDN_STEPS 54 | + RTL8723A_TRANS_END_STEPS] = { 55 | RTL8723A_TRANS_ACT_TO_CARDEMU 56 | RTL8723A_TRANS_CARDEMU_TO_CARDDIS 57 | RTL8723A_TRANS_END 58 | }; 59 | 60 | /*3 Card Enable Array*/ 61 | struct wlan_pwr_cfg rtl8723A_card_enable_flow[RTL8723A_TRANS_ACT_TO_CARDEMU_STEPS 62 | + RTL8723A_TRANS_CARDEMU_TO_PDN_STEPS 63 | + RTL8723A_TRANS_END_STEPS] = { 64 | RTL8723A_TRANS_CARDDIS_TO_CARDEMU 65 | RTL8723A_TRANS_CARDEMU_TO_ACT 66 | RTL8723A_TRANS_END 67 | }; 68 | 69 | /*3Suspend Array*/ 70 | struct wlan_pwr_cfg rtl8723A_suspend_flow[RTL8723A_TRANS_ACT_TO_CARDEMU_STEPS 71 | + RTL8723A_TRANS_CARDEMU_TO_SUS_STEPS 72 | + RTL8723A_TRANS_END_STEPS] = { 73 | RTL8723A_TRANS_ACT_TO_CARDEMU 74 | RTL8723A_TRANS_CARDEMU_TO_SUS 75 | RTL8723A_TRANS_END 76 | }; 77 | 78 | /*3 Resume Array*/ 79 | struct wlan_pwr_cfg rtl8723A_resume_flow[RTL8723A_TRANS_ACT_TO_CARDEMU_STEPS 80 | + RTL8723A_TRANS_CARDEMU_TO_SUS_STEPS 81 | + RTL8723A_TRANS_END_STEPS] = { 82 | RTL8723A_TRANS_SUS_TO_CARDEMU 83 | RTL8723A_TRANS_CARDEMU_TO_ACT 84 | RTL8723A_TRANS_END 85 | }; 86 | 87 | /*3HWPDN Array*/ 88 | struct wlan_pwr_cfg rtl8723A_hwpdn_flow[RTL8723A_TRANS_ACT_TO_CARDEMU_STEPS 89 | + RTL8723A_TRANS_CARDEMU_TO_PDN_STEPS 90 | + RTL8723A_TRANS_END_STEPS] = { 91 | RTL8723A_TRANS_ACT_TO_CARDEMU 92 | RTL8723A_TRANS_CARDEMU_TO_PDN 93 | RTL8723A_TRANS_END 94 | }; 95 | 96 | /*3 Enter LPS */ 97 | struct wlan_pwr_cfg rtl8723A_enter_lps_flow[RTL8723A_TRANS_ACT_TO_LPS_STEPS 98 | + RTL8723A_TRANS_END_STEPS] = { 99 | /*FW behavior*/ 100 | RTL8723A_TRANS_ACT_TO_LPS 101 | RTL8723A_TRANS_END 102 | }; 103 | 104 | /*3 Leave LPS */ 105 | struct wlan_pwr_cfg rtl8723A_leave_lps_flow[RTL8723A_TRANS_LPS_TO_ACT_STEPS 106 | + RTL8723A_TRANS_END_STEPS] = { 107 | /*FW behavior*/ 108 | RTL8723A_TRANS_LPS_TO_ACT 109 | RTL8723A_TRANS_END 110 | }; 111 | -------------------------------------------------------------------------------- /rtl8723ae/pwrseqcmd.h: -------------------------------------------------------------------------------- 1 | #ifndef __RTL8723E_PWRSEQCMD_H__ 2 | #define __RTL8723E_PWRSEQCMD_H__ 3 | 4 | #include "../wifi.h" 5 | /*---------------------------------------------*/ 6 | /*The value of cmd: 4 bits */ 7 | /*---------------------------------------------*/ 8 | #define PWR_CMD_READ 0x00 9 | #define PWR_CMD_WRITE 0x01 10 | #define PWR_CMD_POLLING 0x02 11 | #define PWR_CMD_DELAY 0x03 12 | #define PWR_CMD_END 0x04 13 | 14 | /* define the base address of each block */ 15 | #define PWR_BASEADDR_MAC 0x00 16 | #define PWR_BASEADDR_USB 0x01 17 | #define PWR_BASEADDR_PCIE 0x02 18 | #define PWR_BASEADDR_SDIO 0x03 19 | 20 | #define PWR_INTF_SDIO_MSK BIT(0) 21 | #define PWR_INTF_USB_MSK BIT(1) 22 | #define PWR_INTF_PCI_MSK BIT(2) 23 | #define PWR_INTF_ALL_MSK (BIT(0)|BIT(1)|BIT(2)|BIT(3)) 24 | 25 | #define PWR_FAB_TSMC_MSK BIT(0) 26 | #define PWR_FAB_UMC_MSK BIT(1) 27 | #define PWR_FAB_ALL_MSK (BIT(0)|BIT(1)|BIT(2)|BIT(3)) 28 | 29 | #define PWR_CUT_TESTCHIP_MSK BIT(0) 30 | #define PWR_CUT_A_MSK BIT(1) 31 | #define PWR_CUT_B_MSK BIT(2) 32 | #define PWR_CUT_C_MSK BIT(3) 33 | #define PWR_CUT_D_MSK BIT(4) 34 | #define PWR_CUT_E_MSK BIT(5) 35 | #define PWR_CUT_F_MSK BIT(6) 36 | #define PWR_CUT_G_MSK BIT(7) 37 | #define PWR_CUT_ALL_MSK 0xFF 38 | 39 | 40 | enum pwrseq_delay_unit { 41 | PWRSEQ_DELAY_US, 42 | PWRSEQ_DELAY_MS, 43 | }; 44 | 45 | struct wlan_pwr_cfg { 46 | u16 offset; 47 | u8 cut_msk; 48 | u8 fab_msk:4; 49 | u8 interface_msk:4; 50 | u8 base:4; 51 | u8 cmd:4; 52 | u8 msk; 53 | u8 value; 54 | 55 | }; 56 | 57 | #define GET_PWR_CFG_OFFSET(__PWR_CMD) __PWR_CMD.offset 58 | #define GET_PWR_CFG_CUT_MASK(__PWR_CMD) __PWR_CMD.cut_msk 59 | #define GET_PWR_CFG_FAB_MASK(__PWR_CMD) __PWR_CMD.fab_msk 60 | #define GET_PWR_CFG_INTF_MASK(__PWR_CMD) __PWR_CMD.interface_msk 61 | #define GET_PWR_CFG_BASE(__PWR_CMD) __PWR_CMD.base 62 | #define GET_PWR_CFG_CMD(__PWR_CMD) __PWR_CMD.cmd 63 | #define GET_PWR_CFG_MASK(__PWR_CMD) __PWR_CMD.msk 64 | #define GET_PWR_CFG_VALUE(__PWR_CMD) __PWR_CMD.value 65 | 66 | bool rtl_hal_pwrseqcmdparsing(struct rtl_priv *rtlpriv, u8 cut_version, 67 | u8 fab_version, u8 interface_type, 68 | struct wlan_pwr_cfg pwrcfgcmd[]); 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /rtl8723ae/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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * 26 | * Larry Finger 27 | * 28 | *****************************************************************************/ 29 | 30 | #ifndef __RTL8723E_RF_H__ 31 | #define __RTL8723E_RF_H__ 32 | 33 | #define RF6052_MAX_TX_PWR 0x3F 34 | #define RF6052_MAX_REG 0x3F 35 | 36 | extern void rtl8723e_phy_rf6052_set_bandwidth(struct ieee80211_hw *hw, 37 | u8 bandwidth); 38 | extern void rtl8723e_phy_rf6052_set_cck_txpower(struct ieee80211_hw *hw, 39 | u8 *ppowerlevel); 40 | extern void rtl8723e_phy_rf6052_set_ofdm_txpower(struct ieee80211_hw *hw, 41 | u8 *ppowerlevel, u8 channel); 42 | extern bool rtl8723e_phy_rf6052_config(struct ieee80211_hw *hw); 43 | #endif 44 | -------------------------------------------------------------------------------- /rtl8723ae/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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * 26 | * Larry Finger 27 | * 28 | *****************************************************************************/ 29 | 30 | #ifndef __RTL8723E_SW_H__ 31 | #define __RTL8723E_SW_H__ 32 | 33 | int rtl8723e_init_sw_vars(struct ieee80211_hw *hw); 34 | void rtl8723e_deinit_sw_vars(struct ieee80211_hw *hw); 35 | void rtl8723e_init_var_map(struct ieee80211_hw *hw); 36 | bool rtl8723e_get_btc_status(void); 37 | 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /rtl8723ae/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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * 26 | * Created on 2010/ 5/18, 1:41 27 | * 28 | * Larry Finger 29 | * 30 | *****************************************************************************/ 31 | 32 | #ifndef __RTL8723E_TABLE__H_ 33 | #define __RTL8723E_TABLE__H_ 34 | 35 | #include 36 | 37 | #define RTL8723E_PHY_REG_1TARRAY_LENGTH 372 38 | extern u32 RTL8723EPHY_REG_1TARRAY[RTL8723E_PHY_REG_1TARRAY_LENGTH]; 39 | #define RTL8723E_PHY_REG_ARRAY_PGLENGTH 336 40 | extern u32 RTL8723EPHY_REG_ARRAY_PG[RTL8723E_PHY_REG_ARRAY_PGLENGTH]; 41 | #define Rtl8723ERADIOA_1TARRAYLENGTH 282 42 | extern u32 RTL8723E_RADIOA_1TARRAY[Rtl8723ERADIOA_1TARRAYLENGTH]; 43 | #define RTL8723E_RADIOB_1TARRAYLENGTH 1 44 | extern u32 RTL8723E_RADIOB_1TARRAY[RTL8723E_RADIOB_1TARRAYLENGTH]; 45 | #define RTL8723E_MACARRAYLENGTH 172 46 | extern u32 RTL8723EMAC_ARRAY[RTL8723E_MACARRAYLENGTH]; 47 | #define RTL8723E_AGCTAB_1TARRAYLENGTH 320 48 | extern u32 RTL8723EAGCTAB_1TARRAY[RTL8723E_AGCTAB_1TARRAYLENGTH]; 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /rtl8723be/Makefile: -------------------------------------------------------------------------------- 1 | rtl8723be-objs := \ 2 | dm.o \ 3 | fw.o \ 4 | hw.o \ 5 | led.o \ 6 | phy.o \ 7 | pwrseq.o \ 8 | pwrseqcmd.o \ 9 | rf.o \ 10 | sw.o \ 11 | table.o \ 12 | trx.o \ 13 | 14 | 15 | obj-m += rtl8723be.o 16 | 17 | ccflags-y += -D__CHECK_ENDIAN__ 18 | -------------------------------------------------------------------------------- /rtl8723be/def.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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * 26 | * Larry Finger 27 | * 28 | *****************************************************************************/ 29 | 30 | #ifndef __RTL8723BE_DEF_H__ 31 | #define __RTL8723BE_DEF_H__ 32 | 33 | #define HAL_PRIME_CHNL_OFFSET_DONT_CARE 0 34 | #define HAL_PRIME_CHNL_OFFSET_LOWER 1 35 | #define HAL_PRIME_CHNL_OFFSET_UPPER 2 36 | 37 | 38 | #define RX_MPDU_QUEUE 0 39 | #define CHIP_8723B (BIT(1) | BIT(2)) 40 | #define NORMAL_CHIP BIT(3) 41 | #define CHIP_VENDOR_SMIC BIT(8) 42 | /* Currently only for RTL8723B */ 43 | #define EXT_VENDOR_ID (BIT(18) | BIT(19)) 44 | 45 | 46 | enum version_8723be { 47 | VERSION_TEST_CHIP_1T1R_8723B = 0x0106, 48 | VERSION_NORMAL_SMIC_CHIP_1T1R_8723B = 0x010E, 49 | VERSION_NORMAL_SMIC_CHIP_1T1R_8723B_B_CUT = 0x110E, 50 | VERSION_NORMAL_SMIC_CHIP_1T1R_8723B_D_CUT = 0x310E, 51 | VERSION_UNKNOWN = 0xFF, 52 | }; 53 | 54 | enum rx_packet_type { 55 | NORMAL_RX, 56 | TX_REPORT1, 57 | TX_REPORT2, 58 | HIS_REPORT, 59 | C2H_PACKET, 60 | }; 61 | 62 | enum rtl_desc_qsel { 63 | QSLT_BK = 0x2, 64 | QSLT_BE = 0x0, 65 | QSLT_VI = 0x5, 66 | QSLT_VO = 0x7, 67 | QSLT_BEACON = 0x10, 68 | QSLT_HIGH = 0x11, 69 | QSLT_MGNT = 0x12, 70 | QSLT_CMD = 0x13, 71 | }; 72 | 73 | #endif 74 | -------------------------------------------------------------------------------- /rtl8723be/hw.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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * 26 | * Larry Finger 27 | * 28 | *****************************************************************************/ 29 | 30 | #ifndef __RTL8723BE_HW_H__ 31 | #define __RTL8723BE_HW_H__ 32 | 33 | void rtl8723be_get_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val); 34 | void rtl8723be_read_eeprom_info(struct ieee80211_hw *hw); 35 | 36 | void rtl8723be_interrupt_recognized(struct ieee80211_hw *hw, 37 | u32 *p_inta, u32 *p_intb); 38 | int rtl8723be_hw_init(struct ieee80211_hw *hw); 39 | void rtl8723be_card_disable(struct ieee80211_hw *hw); 40 | void rtl8723be_enable_interrupt(struct ieee80211_hw *hw); 41 | void rtl8723be_disable_interrupt(struct ieee80211_hw *hw); 42 | int rtl8723be_set_network_type(struct ieee80211_hw *hw, 43 | enum nl80211_iftype type); 44 | void rtl8723be_set_check_bssid(struct ieee80211_hw *hw, bool check_bssid); 45 | void rtl8723be_set_qos(struct ieee80211_hw *hw, int aci); 46 | void rtl8723be_set_beacon_related_registers(struct ieee80211_hw *hw); 47 | void rtl8723be_set_beacon_interval(struct ieee80211_hw *hw); 48 | void rtl8723be_update_interrupt_mask(struct ieee80211_hw *hw, 49 | u32 add_msr, u32 rm_msr); 50 | void rtl8723be_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val); 51 | void rtl8723be_update_hal_rate_tbl(struct ieee80211_hw *hw, 52 | struct ieee80211_sta *sta, 53 | u8 rssi_level); 54 | void rtl8723be_update_channel_access_setting(struct ieee80211_hw *hw); 55 | bool rtl8723be_gpio_radio_on_off_checking(struct ieee80211_hw *hw, u8 *valid); 56 | void rtl8723be_enable_hw_security_config(struct ieee80211_hw *hw); 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 | void rtl8723be_allow_all_destaddr(struct ieee80211_hw *hw, bool allow_all_da, 64 | bool write_into_reg); 65 | #endif 66 | -------------------------------------------------------------------------------- /rtl8723be/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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * 26 | * Larry Finger 27 | * 28 | *****************************************************************************/ 29 | 30 | #ifndef __RTL8723BE_LED_H__ 31 | #define __RTL8723BE_LED_H__ 32 | 33 | void rtl8723be_init_sw_leds(struct ieee80211_hw *hw); 34 | void rtl8723be_sw_led_on(struct ieee80211_hw *hw, struct rtl_led *pled); 35 | void rtl8723be_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled); 36 | void rtl8723be_led_control(struct ieee80211_hw *hw, 37 | enum led_ctl_mode ledaction); 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /rtl8723be/pwrseq.c: -------------------------------------------------------------------------------- 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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * 26 | * Larry Finger 27 | * 28 | *****************************************************************************/ 29 | 30 | #include "pwrseqcmd.h" 31 | #include "pwrseq.h" 32 | 33 | 34 | /* 35 | drivers should parse below arrays and do the corresponding actions 36 | */ 37 | /*3 Power on Array*/ 38 | struct wlan_pwr_cfg rtl8723B_power_on_flow[RTL8723B_TRANS_CARDEMU_TO_ACT_STEPS + 39 | RTL8723B_TRANS_END_STEPS] = { 40 | RTL8723B_TRANS_CARDEMU_TO_ACT 41 | RTL8723B_TRANS_END 42 | }; 43 | 44 | /*3Radio off GPIO Array */ 45 | struct wlan_pwr_cfg rtl8723B_radio_off_flow[RTL8723B_TRANS_ACT_TO_CARDEMU_STEPS 46 | + RTL8723B_TRANS_END_STEPS] = { 47 | RTL8723B_TRANS_ACT_TO_CARDEMU 48 | RTL8723B_TRANS_END 49 | }; 50 | 51 | /*3Card Disable Array*/ 52 | struct wlan_pwr_cfg rtl8723B_card_disable_flow 53 | [RTL8723B_TRANS_ACT_TO_CARDEMU_STEPS + 54 | RTL8723B_TRANS_CARDEMU_TO_PDN_STEPS + 55 | RTL8723B_TRANS_END_STEPS] = { 56 | RTL8723B_TRANS_ACT_TO_CARDEMU 57 | RTL8723B_TRANS_CARDEMU_TO_CARDDIS 58 | RTL8723B_TRANS_END 59 | }; 60 | 61 | /*3 Card Enable Array*/ 62 | struct wlan_pwr_cfg rtl8723B_card_enable_flow 63 | [RTL8723B_TRANS_ACT_TO_CARDEMU_STEPS + 64 | RTL8723B_TRANS_CARDEMU_TO_PDN_STEPS + 65 | RTL8723B_TRANS_END_STEPS] = { 66 | RTL8723B_TRANS_CARDDIS_TO_CARDEMU 67 | RTL8723B_TRANS_CARDEMU_TO_ACT 68 | RTL8723B_TRANS_END 69 | }; 70 | 71 | /*3Suspend Array*/ 72 | struct wlan_pwr_cfg rtl8723B_suspend_flow[RTL8723B_TRANS_ACT_TO_CARDEMU_STEPS + 73 | RTL8723B_TRANS_CARDEMU_TO_SUS_STEPS + 74 | RTL8723B_TRANS_END_STEPS] = { 75 | RTL8723B_TRANS_ACT_TO_CARDEMU 76 | RTL8723B_TRANS_CARDEMU_TO_SUS 77 | RTL8723B_TRANS_END 78 | }; 79 | 80 | /*3 Resume Array*/ 81 | struct wlan_pwr_cfg rtl8723B_resume_flow[RTL8723B_TRANS_ACT_TO_CARDEMU_STEPS + 82 | RTL8723B_TRANS_CARDEMU_TO_SUS_STEPS + 83 | RTL8723B_TRANS_END_STEPS] = { 84 | RTL8723B_TRANS_SUS_TO_CARDEMU 85 | RTL8723B_TRANS_CARDEMU_TO_ACT 86 | RTL8723B_TRANS_END 87 | }; 88 | 89 | /*3HWPDN Array*/ 90 | struct wlan_pwr_cfg rtl8723B_hwpdn_flow[RTL8723B_TRANS_ACT_TO_CARDEMU_STEPS + 91 | RTL8723B_TRANS_CARDEMU_TO_PDN_STEPS + 92 | RTL8723B_TRANS_END_STEPS] = { 93 | RTL8723B_TRANS_ACT_TO_CARDEMU 94 | RTL8723B_TRANS_CARDEMU_TO_PDN 95 | RTL8723B_TRANS_END 96 | }; 97 | 98 | /*3 Enter LPS */ 99 | struct wlan_pwr_cfg rtl8723B_enter_lps_flow[RTL8723B_TRANS_ACT_TO_LPS_STEPS + 100 | RTL8723B_TRANS_END_STEPS] = { 101 | /*FW behavior*/ 102 | RTL8723B_TRANS_ACT_TO_LPS 103 | RTL8723B_TRANS_END 104 | }; 105 | 106 | /*3 Leave LPS */ 107 | struct wlan_pwr_cfg rtl8723B_leave_lps_flow[RTL8723B_TRANS_LPS_TO_ACT_STEPS + 108 | RTL8723B_TRANS_END_STEPS] = { 109 | /*FW behavior*/ 110 | RTL8723B_TRANS_LPS_TO_ACT 111 | RTL8723B_TRANS_END 112 | }; 113 | -------------------------------------------------------------------------------- /rtl8723be/pwrseqcmd.h: -------------------------------------------------------------------------------- 1 | #ifndef __RTL8723BE_PWRSEQCMD_H__ 2 | #define __RTL8723BE_PWRSEQCMD_H__ 3 | 4 | #include "../wifi.h" 5 | /*---------------------------------------------*/ 6 | /*The value of cmd: 4 bits */ 7 | /*---------------------------------------------*/ 8 | #define PWR_CMD_READ 0x00 9 | #define PWR_CMD_WRITE 0x01 10 | #define PWR_CMD_POLLING 0x02 11 | #define PWR_CMD_DELAY 0x03 12 | #define PWR_CMD_END 0x04 13 | 14 | /* define the base address of each block */ 15 | #define PWR_BASEADDR_MAC 0x00 16 | #define PWR_BASEADDR_USB 0x01 17 | #define PWR_BASEADDR_PCIE 0x02 18 | #define PWR_BASEADDR_SDIO 0x03 19 | 20 | #define PWR_INTF_SDIO_MSK BIT(0) 21 | #define PWR_INTF_USB_MSK BIT(1) 22 | #define PWR_INTF_PCI_MSK BIT(2) 23 | #define PWR_INTF_ALL_MSK (BIT(0) | BIT(1) | BIT(2) | BIT(3)) 24 | 25 | #define PWR_FAB_TSMC_MSK BIT(0) 26 | #define PWR_FAB_UMC_MSK BIT(1) 27 | #define PWR_FAB_ALL_MSK (BIT(0) | BIT(1) | BIT(2) | BIT(3)) 28 | 29 | #define PWR_CUT_TESTCHIP_MSK BIT(0) 30 | #define PWR_CUT_A_MSK BIT(1) 31 | #define PWR_CUT_B_MSK BIT(2) 32 | #define PWR_CUT_C_MSK BIT(3) 33 | #define PWR_CUT_D_MSK BIT(4) 34 | #define PWR_CUT_E_MSK BIT(5) 35 | #define PWR_CUT_F_MSK BIT(6) 36 | #define PWR_CUT_G_MSK BIT(7) 37 | #define PWR_CUT_ALL_MSK 0xFF 38 | 39 | 40 | enum pwrseq_delay_unit { 41 | PWRSEQ_DELAY_US, 42 | PWRSEQ_DELAY_MS, 43 | }; 44 | 45 | struct wlan_pwr_cfg { 46 | u16 offset; 47 | u8 cut_msk; 48 | u8 fab_msk:4; 49 | u8 interface_msk:4; 50 | u8 base:4; 51 | u8 cmd:4; 52 | u8 msk; 53 | u8 value; 54 | 55 | }; 56 | 57 | #define GET_PWR_CFG_OFFSET(__PWR_CMD) __PWR_CMD.offset 58 | #define GET_PWR_CFG_CUT_MASK(__PWR_CMD) __PWR_CMD.cut_msk 59 | #define GET_PWR_CFG_FAB_MASK(__PWR_CMD) __PWR_CMD.fab_msk 60 | #define GET_PWR_CFG_INTF_MASK(__PWR_CMD) __PWR_CMD.interface_msk 61 | #define GET_PWR_CFG_BASE(__PWR_CMD) __PWR_CMD.base 62 | #define GET_PWR_CFG_CMD(__PWR_CMD) __PWR_CMD.cmd 63 | #define GET_PWR_CFG_MASK(__PWR_CMD) __PWR_CMD.msk 64 | #define GET_PWR_CFG_VALUE(__PWR_CMD) __PWR_CMD.value 65 | 66 | bool rtl_hal_pwrseqcmdparsing(struct rtl_priv *rtlpriv, u8 cut_version, 67 | u8 fab_version, u8 interface_type, 68 | struct wlan_pwr_cfg pwrcfgcmd[]); 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /rtl8723be/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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * 26 | * Larry Finger 27 | * 28 | *****************************************************************************/ 29 | 30 | #ifndef __RTL8723BE_RF_H__ 31 | #define __RTL8723BE_RF_H__ 32 | 33 | #define RF6052_MAX_TX_PWR 0x3F 34 | #define RF6052_MAX_REG 0x3F 35 | 36 | extern void rtl8723be_phy_rf6052_set_bandwidth(struct ieee80211_hw *hw, 37 | u8 bandwidth); 38 | extern void rtl8723be_phy_rf6052_set_cck_txpower(struct ieee80211_hw *hw, 39 | u8 *ppowerlevel); 40 | extern void rtl8723be_phy_rf6052_set_ofdm_txpower(struct ieee80211_hw *hw, 41 | u8 *ppowerlevel_ofdm, 42 | u8 *ppowerlevel_bw20, 43 | u8 *ppowerlevel_bw40, 44 | u8 channel); 45 | extern bool rtl8723be_phy_rf6052_config(struct ieee80211_hw *hw); 46 | #endif 47 | -------------------------------------------------------------------------------- /rtl8723be/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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * 26 | * Larry Finger 27 | * 28 | *****************************************************************************/ 29 | 30 | #ifndef __RTL8723BE_SW_H__ 31 | #define __RTL8723BE_SW_H__ 32 | 33 | int rtl8723be_init_sw_vars(struct ieee80211_hw *hw); 34 | void rtl8723be_deinit_sw_vars(struct ieee80211_hw *hw); 35 | void rtl8723be_init_var_map(struct ieee80211_hw *hw); 36 | bool rtl8723be_get_btc_status(void); 37 | 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /rtl8723be/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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * 26 | * Created on 2010/ 5/18, 1:41 27 | * 28 | * Larry Finger 29 | * 30 | *****************************************************************************/ 31 | 32 | #ifndef __RTL8723BE_TABLE__H_ 33 | #define __RTL8723BE_TABLE__H_ 34 | 35 | #include 36 | #define RTL8723BEPHY_REG_1TARRAYLEN 388 37 | extern u32 RTL8723BEPHY_REG_1TARRAY[]; 38 | #define RTL8723BEPHY_REG_ARRAY_PGLEN 36 39 | extern u32 RTL8723BEPHY_REG_ARRAY_PG[]; 40 | #define RTL8723BE_RADIOA_1TARRAYLEN 206 41 | extern u32 RTL8723BE_RADIOA_1TARRAY[]; 42 | #define RTL8723BEMAC_1T_ARRAYLEN 196 43 | extern u32 RTL8723BEMAC_1T_ARRAY[]; 44 | #define RTL8723BEAGCTAB_1TARRAYLEN 260 45 | extern u32 RTL8723BEAGCTAB_1TARRAY[]; 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /rtl8821ae/Makefile: -------------------------------------------------------------------------------- 1 | rtl8821ae-objs := \ 2 | dm.o \ 3 | fw.o \ 4 | hw.o \ 5 | led.o \ 6 | phy.o \ 7 | pwrseq.o \ 8 | pwrseqcmd.o \ 9 | rf.o \ 10 | sw.o \ 11 | table.o \ 12 | trx.o \ 13 | 14 | 15 | obj-m += rtl8821ae.o 16 | 17 | ccflags-y += -D__CHECK_ENDIAN__ 18 | -------------------------------------------------------------------------------- /rtl8821ae/hw.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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * 26 | * Larry Finger 27 | * 28 | *****************************************************************************/ 29 | 30 | #ifndef __RTL8821AE_HW_H__ 31 | #define __RTL8821AE_HW_H__ 32 | 33 | void rtl8821ae_get_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val); 34 | void rtl8821ae_read_eeprom_info(struct ieee80211_hw *hw); 35 | 36 | void rtl8821ae_interrupt_recognized(struct ieee80211_hw *hw, 37 | u32 *p_inta, u32 *p_intb); 38 | int rtl8821ae_hw_init(struct ieee80211_hw *hw); 39 | void rtl8821ae_card_disable(struct ieee80211_hw *hw); 40 | void rtl8821ae_enable_interrupt(struct ieee80211_hw *hw); 41 | void rtl8821ae_disable_interrupt(struct ieee80211_hw *hw); 42 | int rtl8821ae_set_network_type(struct ieee80211_hw *hw, 43 | enum nl80211_iftype type); 44 | void rtl8821ae_set_check_bssid(struct ieee80211_hw *hw, bool check_bssid); 45 | void rtl8821ae_set_qos(struct ieee80211_hw *hw, int aci); 46 | void rtl8821ae_set_beacon_related_registers(struct ieee80211_hw *hw); 47 | void rtl8821ae_set_beacon_interval(struct ieee80211_hw *hw); 48 | void rtl8821ae_update_interrupt_mask(struct ieee80211_hw *hw, 49 | u32 add_msr, u32 rm_msr); 50 | void rtl8821ae_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val); 51 | void rtl8821ae_update_hal_rate_tbl(struct ieee80211_hw *hw, 52 | struct ieee80211_sta *sta, 53 | u8 rssi_level); 54 | void rtl8821ae_update_channel_access_setting(struct ieee80211_hw *hw); 55 | bool rtl8821ae_gpio_radio_on_off_checking(struct ieee80211_hw *hw, u8 *valid); 56 | void rtl8821ae_enable_hw_security_config(struct ieee80211_hw *hw); 57 | 58 | void rtl8821ae_bt_reg_init(struct ieee80211_hw *hw); 59 | void rtl8821ae_bt_hw_init(struct ieee80211_hw *hw); 60 | void rtl8821ae_suspend(struct ieee80211_hw *hw); 61 | void rtl8821ae_resume(struct ieee80211_hw *hw); 62 | void rtl8821ae_allow_all_destaddr(struct ieee80211_hw *hw, 63 | bool allow_all_da, 64 | bool write_into_reg); 65 | void _rtl8821ae_stop_tx_beacon(struct ieee80211_hw *hw); 66 | void _rtl8821ae_resume_tx_beacon(struct ieee80211_hw *hw); 67 | void rtl8821ae_add_wowlan_pattern(struct ieee80211_hw *hw, 68 | struct rtl_wow_pattern *rtl_pattern, 69 | u8 index); 70 | #endif 71 | -------------------------------------------------------------------------------- /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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * 26 | * Larry Finger 27 | * 28 | *****************************************************************************/ 29 | 30 | #ifndef __RTL8821AE_LED_H__ 31 | #define __RTL8821AE_LED_H__ 32 | 33 | void rtl8821ae_init_sw_leds(struct ieee80211_hw *hw); 34 | void rtl8821ae_sw_led_on(struct ieee80211_hw *hw, struct rtl_led *pled); 35 | void rtl8812ae_sw_led_on(struct ieee80211_hw *hw, struct rtl_led *pled); 36 | void rtl8821ae_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled); 37 | void rtl8812ae_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled); 38 | void rtl8821ae_led_control(struct ieee80211_hw *hw, 39 | enum led_ctl_mode ledaction); 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /rtl8821ae/pwrseq.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtlwifi-linux/rtlwifi_new/15f04b7bf308e3aed2a5067e5ab8b16a72717b95/rtl8821ae/pwrseq.h -------------------------------------------------------------------------------- /rtl8821ae/pwrseqcmd.h: -------------------------------------------------------------------------------- 1 | #ifndef __RTL8821AE_PWRSEQCMD_H__ 2 | #define __RTL8821AE_PWRSEQCMD_H__ 3 | 4 | #include "../wifi.h" 5 | /*---------------------------------------------*/ 6 | /*The value of cmd: 4 bits */ 7 | /*---------------------------------------------*/ 8 | #define PWR_CMD_READ 0x00 9 | #define PWR_CMD_WRITE 0x01 10 | #define PWR_CMD_POLLING 0x02 11 | #define PWR_CMD_DELAY 0x03 12 | #define PWR_CMD_END 0x04 13 | 14 | /* define the base address of each block */ 15 | #define PWR_BASEADDR_MAC 0x00 16 | #define PWR_BASEADDR_USB 0x01 17 | #define PWR_BASEADDR_PCIE 0x02 18 | #define PWR_BASEADDR_SDIO 0x03 19 | 20 | #define PWR_INTF_SDIO_MSK BIT(0) 21 | #define PWR_INTF_USB_MSK BIT(1) 22 | #define PWR_INTF_PCI_MSK BIT(2) 23 | #define PWR_INTF_ALL_MSK (BIT(0)|BIT(1)|BIT(2)|BIT(3)) 24 | 25 | #define PWR_FAB_TSMC_MSK BIT(0) 26 | #define PWR_FAB_UMC_MSK BIT(1) 27 | #define PWR_FAB_ALL_MSK (BIT(0)|BIT(1)|BIT(2)|BIT(3)) 28 | 29 | #define PWR_CUT_TESTCHIP_MSK BIT(0) 30 | #define PWR_CUT_A_MSK BIT(1) 31 | #define PWR_CUT_B_MSK BIT(2) 32 | #define PWR_CUT_C_MSK BIT(3) 33 | #define PWR_CUT_D_MSK BIT(4) 34 | #define PWR_CUT_E_MSK BIT(5) 35 | #define PWR_CUT_F_MSK BIT(6) 36 | #define PWR_CUT_G_MSK BIT(7) 37 | #define PWR_CUT_ALL_MSK 0xFF 38 | 39 | 40 | enum pwrseq_delay_unit { 41 | PWRSEQ_DELAY_US, 42 | PWRSEQ_DELAY_MS, 43 | }; 44 | 45 | struct wlan_pwr_cfg { 46 | u16 offset; 47 | u8 cut_msk; 48 | u8 fab_msk:4; 49 | u8 interface_msk:4; 50 | u8 base:4; 51 | u8 cmd:4; 52 | u8 msk; 53 | u8 value; 54 | 55 | }; 56 | 57 | #define GET_PWR_CFG_OFFSET(__PWR_CMD) __PWR_CMD.offset 58 | #define GET_PWR_CFG_CUT_MASK(__PWR_CMD) __PWR_CMD.cut_msk 59 | #define GET_PWR_CFG_FAB_MASK(__PWR_CMD) __PWR_CMD.fab_msk 60 | #define GET_PWR_CFG_INTF_MASK(__PWR_CMD) __PWR_CMD.interface_msk 61 | #define GET_PWR_CFG_BASE(__PWR_CMD) __PWR_CMD.base 62 | #define GET_PWR_CFG_CMD(__PWR_CMD) __PWR_CMD.cmd 63 | #define GET_PWR_CFG_MASK(__PWR_CMD) __PWR_CMD.msk 64 | #define GET_PWR_CFG_VALUE(__PWR_CMD) __PWR_CMD.value 65 | 66 | bool rtl_hal_pwrseqcmdparsing(struct rtl_priv *rtlpriv, u8 cut_version, 67 | u8 fab_version, u8 interface_type, 68 | struct wlan_pwr_cfg pwrcfgcmd[]); 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * 26 | * Larry Finger 27 | * 28 | *****************************************************************************/ 29 | 30 | #ifndef __RTL8821AE_RF_H__ 31 | #define __RTL8821AE_RF_H__ 32 | 33 | #define RF6052_MAX_TX_PWR 0x3F 34 | #define RF6052_MAX_REG 0x3F 35 | 36 | extern void rtl8821ae_phy_rf6052_set_bandwidth(struct ieee80211_hw *hw, 37 | u8 bandwidth); 38 | extern void rtl8821ae_phy_rf6052_set_cck_txpower(struct ieee80211_hw *hw, 39 | u8 *ppowerlevel); 40 | extern void rtl8821ae_phy_rf6052_set_ofdm_txpower(struct ieee80211_hw *hw, 41 | u8 *ppowerlevel_ofdm, 42 | u8 *ppowerlevel_bw20, 43 | u8 *ppowerlevel_bw40, 44 | u8 channel); 45 | extern bool rtl8821ae_phy_rf6052_config(struct ieee80211_hw *hw); 46 | #endif 47 | -------------------------------------------------------------------------------- /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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * 26 | * Larry Finger 27 | * 28 | *****************************************************************************/ 29 | 30 | #ifndef __RTL8821AE_SW_H__ 31 | #define __RTL8821AE_SW_H__ 32 | 33 | int rtl8821ae_init_sw_vars(struct ieee80211_hw *hw); 34 | void rtl8821ae_deinit_sw_vars(struct ieee80211_hw *hw); 35 | void rtl8821ae_init_var_map(struct ieee80211_hw *hw); 36 | bool rtl8821ae_get_btc_status(void); 37 | 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * 26 | * Created on 2010/ 5/18, 1:41 27 | * 28 | * Larry Finger 29 | * 30 | *****************************************************************************/ 31 | 32 | #ifndef __RTL8821AE_TABLE__H_ 33 | #define __RTL8821AE_TABLE__H_ 34 | 35 | #include 36 | #define RTL8821AEPHY_REG_1TARRAYLEN 344 37 | extern u32 RTL8821AE_PHY_REG_ARRAY[]; 38 | #define RTL8812AEPHY_REG_1TARRAYLEN 490 39 | extern u32 RTL8812AE_PHY_REG_ARRAY[]; 40 | #define RTL8821AEPHY_REG_ARRAY_PGLEN 90 41 | extern u32 RTL8821AE_PHY_REG_ARRAY_PG[]; 42 | #define RTL8812AEPHY_REG_ARRAY_PGLEN 276 43 | extern u32 RTL8812AE_PHY_REG_ARRAY_PG[]; 44 | /* #define RTL8723BE_RADIOA_1TARRAYLEN 206 */ 45 | /* extern u8 *RTL8821AE_TXPWR_LMT_ARRAY[]; */ 46 | #define RTL8812AE_RADIOA_1TARRAYLEN 1264 47 | extern u32 RTL8812AE_RADIOA_ARRAY[]; 48 | #define RTL8812AE_RADIOB_1TARRAYLEN 1240 49 | extern u32 RTL8812AE_RADIOB_ARRAY[]; 50 | #define RTL8821AE_RADIOA_1TARRAYLEN 1176 51 | extern u32 RTL8821AE_RADIOA_ARRAY[]; 52 | #define RTL8821AEMAC_1T_ARRAYLEN 194 53 | extern u32 RTL8821AE_MAC_REG_ARRAY[]; 54 | #define RTL8812AEMAC_1T_ARRAYLEN 214 55 | extern u32 RTL8812AE_MAC_REG_ARRAY[]; 56 | #define RTL8821AEAGCTAB_1TARRAYLEN 382 57 | extern u32 RTL8821AE_AGC_TAB_ARRAY[]; 58 | #define RTL8812AEAGCTAB_1TARRAYLEN 1312 59 | extern u32 RTL8812AE_AGC_TAB_ARRAY[]; 60 | #define RTL8812AE_TXPWR_LMT_ARRAY_LEN 3948 61 | extern u8 *RTL8812AE_TXPWR_LMT[]; 62 | #define RTL8821AE_TXPWR_LMT_ARRAY_LEN 3948 63 | extern u8 *RTL8821AE_TXPWR_LMT[]; 64 | #endif 65 | -------------------------------------------------------------------------------- /stats.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 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 17 | * 18 | * The full GNU General Public License is included in this distribution in the 19 | * file called LICENSE. 20 | * 21 | * Contact Information: 22 | * wlanfae 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, 24 | * Hsinchu 300, Taiwan. 25 | * 26 | * Larry Finger 27 | * 28 | *****************************************************************************/ 29 | 30 | #ifndef __RTL_STATS_H__ 31 | #define __RTL_STATS_H__ 32 | 33 | #define PHY_RSSI_SLID_WIN_MAX 100 34 | #define PHY_LINKQUALITY_SLID_WIN_MAX 20 35 | #define PHY_BEACON_RSSI_SLID_WIN_MAX 10 36 | 37 | /* Rx smooth factor */ 38 | #define RX_SMOOTH_FACTOR 20 39 | 40 | u8 rtl_query_rxpwrpercentage(char antpower); 41 | u8 rtl_evm_db_to_percentage(char value); 42 | u8 rtl_evm_dbm_jaguar(char value); 43 | long rtl_signal_scale_mapping(struct ieee80211_hw *hw, long currsig); 44 | void rtl_process_phyinfo(struct ieee80211_hw *hw, u8 *buffer, 45 | struct rtl_stats *pstatus); 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /tools/delete_kernel_version.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | import os 3 | 4 | #please download and make unifdef-2.10 first 5 | #config 6 | root_dir = "./mac80211V643" 7 | current_linux_ver = '-DLINUX_VERSION_CODE=0x031400' 8 | unifdef_path = '/home/troy/check/unifdef/unifdef' 9 | 10 | 11 | 12 | def compute_kernel_version(a,b,c): 13 | res = '0x' 14 | if len(a) == 1: 15 | res = res + '0' 16 | res = res + a 17 | if len(b) == 1: 18 | res = res + '0' 19 | res = res + b 20 | if len(c) == 1: 21 | res = res + '0' 22 | res = res + c 23 | return res 24 | 25 | 26 | 27 | 28 | 29 | 30 | def start_process(pathin): 31 | 32 | 33 | 34 | filehandler = open(pathin,'r')#open old 35 | filewhandler = open(pathin+"_new",'w')#generate new 36 | filehandler.seek(0) 37 | textlist = filehandler.readlines() 38 | for line in textlist: 39 | if 'KERNEL_VERSION' in line: 40 | 41 | line = line.replace(' ','') 42 | #print line 43 | v_index = line.index('KERNEL_VERSION') 44 | if(v_index <= 0): 45 | print 'error occured!' 46 | return; 47 | v_index1 = v_index+len('KERNEL_VERSION(') 48 | digit_index_1 = line.index(',');#search the first , 49 | digit1 = line[v_index1:digit_index_1]#get the first digit 50 | #print digit1 51 | digit_index_2 = line.index(',',digit_index_1+1);#search the second , 52 | digit2 = line[digit_index_1+1:digit_index_2]#get the second digit 53 | #print digit2 54 | digit_index_3 = line.index(')',digit_index_2+1);#search the ) 55 | digit3 = line[digit_index_2+1:digit_index_3]#get the third digit 56 | #print digit3 57 | version_res = compute_kernel_version(digit1,digit2,digit3) 58 | 59 | line = line.replace(line[v_index:digit_index_3+1],version_res) 60 | filewhandler.write(line) 61 | 62 | filehandler.close() 63 | filewhandler.close() 64 | 65 | 66 | 67 | 68 | 69 | def Mystart(root_dir): 70 | 71 | for lists in os.listdir(root_dir): 72 | path = os.path.join(root_dir, lists) 73 | if(".c" in lists or ".h" in lists): 74 | start_process(path);#generate new 75 | unidef_command = unifdef_path+' '+current_linux_ver+' '+path+"_new"+" > "+path 76 | os.system(unidef_command) 77 | os.remove(path+"_new");#delete new 78 | if os.path.isdir(path): 79 | Mystart(path) 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | #start 90 | 91 | Mystart(root_dir) 92 | 93 | 94 | -------------------------------------------------------------------------------- /tools/remove_staging_driver.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | 4 | echo 'starting...' 5 | STAGING_DRIVER="/lib/modules/`uname -r`/kernel/drivers/staging/" 6 | 7 | #remove staging driver 8 | test -d $STAGING_DRIVER"rtl8821ae" && echo "will remove old rtl8821ae";rm -rf $STAGING_DRIVER"rtl8821ae" 9 | test -d $STAGING_DRIVER"rtl8188ee" && echo "will remove old rtl8188ee";rm -rf $STAGING_DRIVER"rtl8188ee" 10 | test -d $STAGING_DRIVER"rtl8192ce" && echo "will remove old rtl8192ce";rm -rf $STAGING_DRIVER"rtl8192ce" 11 | test -d $STAGING_DRIVER"rtl8192de" && echo "will remove old rtl8192de";rm -rf $STAGING_DRIVER"rtl8192de" 12 | test -d $STAGING_DRIVER"rtl8192ee" && echo "will remove old rtl8192ee";rm -rf $STAGING_DRIVER"rtl8192ee" 13 | test -d $STAGING_DRIVER"rtl8192e" && echo "will remove old rtl8192e";rm -rf $STAGING_DRIVER"rtl8192e" 14 | test -d $STAGING_DRIVER"rtl8192se" && echo "will remove old rtl8192se";rm -rf $STAGING_DRIVER"rtl8192se" 15 | test -d $STAGING_DRIVER"rtl8723ae" && echo "will remove old rtl8723ae";rm -rf $STAGING_DRIVER"rtl8723ae" 16 | test -d $STAGING_DRIVER"rtl8723be" && echo "will remove old rtl8723be";rm -rf $STAGING_DRIVER"rtl8723be" 17 | echo 'end' 18 | -------------------------------------------------------------------------------- /tools/wlandown: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | rmmod rtl8821ae 4 | rmmod rtl8192ee 5 | rmmod rtl8192de 6 | rmmod rtl8192se 7 | rmmod rtl8192ce 8 | rmmod rtl8192c-common.ko 9 | rmmod rtl8723ae 10 | rmmod rtl8723be 11 | rmmod rtl8188ee 12 | rmmod btcoexist 13 | rmmod rtl_pci 14 | rmmod rtl_usb 15 | rmmod rtlwifi 16 | 17 | modprobe -r mac80211 18 | -------------------------------------------------------------------------------- /tools/wlanlog: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | sudo tail -f /var/log/kern.log 4 | -------------------------------------------------------------------------------- /tools/wlanstart: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | 4 | chmod +x wlan* 5 | ./wlandown 6 | make 7 | sleep 1 8 | ./wlanup 9 | ./wlanlog 10 | -------------------------------------------------------------------------------- /tools/wlanup: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | modprobe mac80211 4 | 5 | insmod rtlwifi.ko 6 | insmod rtl_pci.ko 7 | insmod rtl_usb.ko 8 | insmod btcoexist/btcoexist.ko 9 | insmod rtl8192c/rtl8192c-common.ko 10 | insmod rtl8192ce/rtl8192ce.ko 11 | insmod rtl8192se/rtl8192se.ko 12 | insmod rtl8192de/rtl8192de.ko 13 | insmod rtl8723ae/rtl8723ae.ko 14 | insmod rtl8188ee/rtl8188ee.ko 15 | insmod rtl8723be/rtl8723be.ko 16 | insmod rtl8192ee/rtl8192ee.ko 17 | insmod rtl8821ae/rtl8821ae.ko 18 | 19 | --------------------------------------------------------------------------------