├── cs-hud ├── cs-hud.md5 ├── cs-hud.version ├── cs-hud └── cs-hud.service ├── settings ├── splashscreen.list ├── kr_logo.png ├── miniwi-8.psf.gz ├── asound.conf ├── reboot_to_hdmi.png ├── deb │ ├── rfkill_0.5-1_armhf.deb │ ├── wiringpi_2.46_armhf.deb │ ├── libapr1_1.6.5-1_armhf.deb │ ├── libftdi1_0.20-4_armhf.deb │ ├── libaprutil1_1.6.1-4_armhf.deb │ ├── libserf-1-1_1.3.9-7_armhf.deb │ ├── libutf8proc2_2.3.0-1_armhf.deb │ ├── python-serial_2.6-1.1_all.deb │ ├── avrdude_6.3+r1425-1+rpt1_armhf.deb │ ├── libsvn1_1.10.4-1+deb10u3_armhf.deb │ ├── subversion_1.10.4-1+deb10u3_armhf.deb │ ├── avrdude_6.3-20171130+svn1429-2+rpt1_armhf.deb │ └── libhidapi-libusb0_0.8.0~rc1+git20140818.d17db57+dfsg-2_armhf.deb ├── alsa-base.conf ├── WIFI.txt ├── cs_shutdown.sh ├── boot │ ├── config-cs.txt │ └── config.txt ├── bluetooth-audio.sh ├── es_settings.cfg ├── reboot_to_hdmi.sh └── autostart.sh ├── wifi-firmware ├── NOTES.txt ├── rtl8723bs_bt.bin ├── rtl8723bs_nic.bin ├── rtl8723bs_wowlan.bin └── rtl8723bs_ap_wowlan.bin ├── bt-driver ├── rtlbt_fw ├── rtk_hciattach ├── rtlbt_config ├── rtlbt_fw_new ├── rtl-bluetooth.service └── README.md ├── cs-tester ├── BLUE.png ├── GREEN.png ├── RED.png ├── RGB.png ├── pngview ├── COLOUR.png ├── audiocheck_c.wav ├── audiocheck_l.wav ├── audiocheck_r.wav └── cs-tester.py ├── dpi-cloner ├── dpi-cloner └── dpi-cloner.service ├── wifi-module ├── rtl8723bs-dkms_4.14_all.deb ├── rtl8723bs-4.14 │ ├── 4.14 │ │ ├── include │ │ │ ├── rtw_version.h │ │ │ ├── rtw_wifi_regd.h │ │ │ ├── rtw_qos.h │ │ │ ├── sdio_osintf.h │ │ │ ├── ethernet.h │ │ │ ├── rtw_byteorder.h │ │ │ ├── rtl8723b_rf.h │ │ │ ├── hal_phy_reg.h │ │ │ ├── sdio_hal.h │ │ │ ├── cmd_osdep.h │ │ │ ├── mlme_osdep.h │ │ │ ├── drv_types_sdio.h │ │ │ ├── hal_sdio.h │ │ │ ├── rtl8723b_dm.h │ │ │ ├── rtl8192c_rf.h │ │ │ ├── rtl8192c_recv.h │ │ │ ├── drv_conf.h │ │ │ ├── rtw_odm.h │ │ │ ├── rtw_ioctl_set.h │ │ │ ├── autoconf.h │ │ │ ├── sdio_ops_linux.h │ │ │ ├── recv_osdep.h │ │ │ ├── rtw_br_ext.h │ │ │ ├── xmit_osdep.h │ │ │ ├── sdio_ops.h │ │ │ ├── Hal8723BPhyReg.h │ │ │ ├── rtw_ap.h │ │ │ ├── rtw_event.h │ │ │ ├── hal_pg.h │ │ │ ├── osdep_intf.h │ │ │ ├── rtw_btcoex.h │ │ │ ├── hal_btcoex.h │ │ │ ├── Hal8723BPhyCfg.h │ │ │ ├── rtl8723b_recv.h │ │ │ ├── rtw_ioctl.h │ │ │ ├── rtw_eeprom.h │ │ │ ├── HalPwrSeqCmd.h │ │ │ ├── HalVerDef.h │ │ │ └── rtw_beamforming.h │ │ ├── Kconfig │ │ ├── TODO │ │ ├── hal │ │ │ ├── odm_RTL8723B.h │ │ │ ├── odm_PathDiv.h │ │ │ ├── Mp_Precomp.h │ │ │ ├── odm_EdcaTurboCheck.h │ │ │ ├── HalHWImg8723B_MAC.h │ │ │ ├── odm_DynamicTxPower.c │ │ │ ├── odm_AntDiv.h │ │ │ ├── odm_DynamicBBPowerSaving.h │ │ │ ├── odm_PathDiv.c │ │ │ ├── odm_RTL8723B.c │ │ │ ├── odm_DynamicTxPower.h │ │ │ ├── odm_CfoTracking.h │ │ │ ├── odm_NoiseMonitor.h │ │ │ ├── odm_RegConfig8723B.h │ │ │ ├── odm_debug.c │ │ │ ├── HalHWImg8723B_BB.h │ │ │ ├── HalHWImg8723B_RF.h │ │ │ ├── HalPhyRf.h │ │ │ ├── odm_precomp.h │ │ │ ├── odm_interface.h │ │ │ ├── HalPhyRf_8723B.h │ │ │ ├── odm_AntDiv.c │ │ │ ├── rtl8723b_rxdesc.c │ │ │ ├── odm_reg.h │ │ │ ├── odm_types.h │ │ │ ├── odm_DynamicBBPowerSaving.c │ │ │ ├── hal_sdio.c │ │ │ ├── Hal8723BPwrSeq.c │ │ │ └── odm_HWConfig.h │ │ ├── os_dep │ │ │ ├── rtw_proc.h │ │ │ └── wifi_regd.c │ │ ├── Makefile │ │ └── core │ │ │ └── rtw_rf.c │ ├── dkms.conf │ ├── patches │ │ └── makefile.patch │ ├── fix-for-installed-kernel.sh │ └── Makefile └── README ├── sound-module ├── snd-usb-audio-dkms_0.1_armhf.deb ├── snd-usb-audio-0.1 │ ├── dkms.conf │ ├── patches │ │ └── fix-volume.patch │ ├── fix-for-installed-kernel.sh │ ├── Makefile │ └── dkms-patchmodule.sh └── README.md ├── README.md ├── .gitignore ├── cross-build ├── README.md ├── install-kernel.sh ├── Makefile ├── compile-kernel.sh └── build-kernel.sh ├── Dockerfile ├── update.sh └── kite-arduino └── CS_FIRMWARE └── defs.h /cs-hud/cs-hud.md5: -------------------------------------------------------------------------------- 1 | d02d20a18c1b615be7fc944fedad8c7c cs-hud 2 | -------------------------------------------------------------------------------- /cs-hud/cs-hud.version: -------------------------------------------------------------------------------- 1 | CSO=5d6c870fffa3e39fdd0ce7810204df6016626b45 2 | -------------------------------------------------------------------------------- /settings/splashscreen.list: -------------------------------------------------------------------------------- 1 | /home/pi/Circuit-Sword/settings/kr_logo.png 2 | -------------------------------------------------------------------------------- /cs-hud/cs-hud: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weese/Circuit-Sword/HEAD/cs-hud/cs-hud -------------------------------------------------------------------------------- /wifi-firmware/NOTES.txt: -------------------------------------------------------------------------------- 1 | https://github.com/wkennington/linux-firmware/tree/master/rtlwifi -------------------------------------------------------------------------------- /bt-driver/rtlbt_fw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weese/Circuit-Sword/HEAD/bt-driver/rtlbt_fw -------------------------------------------------------------------------------- /cs-tester/BLUE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weese/Circuit-Sword/HEAD/cs-tester/BLUE.png -------------------------------------------------------------------------------- /cs-tester/GREEN.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weese/Circuit-Sword/HEAD/cs-tester/GREEN.png -------------------------------------------------------------------------------- /cs-tester/RED.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weese/Circuit-Sword/HEAD/cs-tester/RED.png -------------------------------------------------------------------------------- /cs-tester/RGB.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weese/Circuit-Sword/HEAD/cs-tester/RGB.png -------------------------------------------------------------------------------- /cs-tester/pngview: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weese/Circuit-Sword/HEAD/cs-tester/pngview -------------------------------------------------------------------------------- /cs-tester/COLOUR.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weese/Circuit-Sword/HEAD/cs-tester/COLOUR.png -------------------------------------------------------------------------------- /dpi-cloner/dpi-cloner: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weese/Circuit-Sword/HEAD/dpi-cloner/dpi-cloner -------------------------------------------------------------------------------- /settings/kr_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weese/Circuit-Sword/HEAD/settings/kr_logo.png -------------------------------------------------------------------------------- /bt-driver/rtk_hciattach: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weese/Circuit-Sword/HEAD/bt-driver/rtk_hciattach -------------------------------------------------------------------------------- /bt-driver/rtlbt_config: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weese/Circuit-Sword/HEAD/bt-driver/rtlbt_config -------------------------------------------------------------------------------- /bt-driver/rtlbt_fw_new: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weese/Circuit-Sword/HEAD/bt-driver/rtlbt_fw_new -------------------------------------------------------------------------------- /settings/miniwi-8.psf.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weese/Circuit-Sword/HEAD/settings/miniwi-8.psf.gz -------------------------------------------------------------------------------- /cs-tester/audiocheck_c.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weese/Circuit-Sword/HEAD/cs-tester/audiocheck_c.wav -------------------------------------------------------------------------------- /cs-tester/audiocheck_l.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weese/Circuit-Sword/HEAD/cs-tester/audiocheck_l.wav -------------------------------------------------------------------------------- /cs-tester/audiocheck_r.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weese/Circuit-Sword/HEAD/cs-tester/audiocheck_r.wav -------------------------------------------------------------------------------- /settings/asound.conf: -------------------------------------------------------------------------------- 1 | pcm.!default { 2 | type hw card 0 3 | } 4 | ctl.!default { 5 | type hw card 0 6 | } -------------------------------------------------------------------------------- /settings/reboot_to_hdmi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weese/Circuit-Sword/HEAD/settings/reboot_to_hdmi.png -------------------------------------------------------------------------------- /wifi-firmware/rtl8723bs_bt.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weese/Circuit-Sword/HEAD/wifi-firmware/rtl8723bs_bt.bin -------------------------------------------------------------------------------- /wifi-firmware/rtl8723bs_nic.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weese/Circuit-Sword/HEAD/wifi-firmware/rtl8723bs_nic.bin -------------------------------------------------------------------------------- /wifi-firmware/rtl8723bs_wowlan.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weese/Circuit-Sword/HEAD/wifi-firmware/rtl8723bs_wowlan.bin -------------------------------------------------------------------------------- /settings/deb/rfkill_0.5-1_armhf.deb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weese/Circuit-Sword/HEAD/settings/deb/rfkill_0.5-1_armhf.deb -------------------------------------------------------------------------------- /settings/deb/wiringpi_2.46_armhf.deb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weese/Circuit-Sword/HEAD/settings/deb/wiringpi_2.46_armhf.deb -------------------------------------------------------------------------------- /settings/deb/libapr1_1.6.5-1_armhf.deb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weese/Circuit-Sword/HEAD/settings/deb/libapr1_1.6.5-1_armhf.deb -------------------------------------------------------------------------------- /settings/deb/libftdi1_0.20-4_armhf.deb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weese/Circuit-Sword/HEAD/settings/deb/libftdi1_0.20-4_armhf.deb -------------------------------------------------------------------------------- /wifi-firmware/rtl8723bs_ap_wowlan.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weese/Circuit-Sword/HEAD/wifi-firmware/rtl8723bs_ap_wowlan.bin -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-dkms_4.14_all.deb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weese/Circuit-Sword/HEAD/wifi-module/rtl8723bs-dkms_4.14_all.deb -------------------------------------------------------------------------------- /settings/deb/libaprutil1_1.6.1-4_armhf.deb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weese/Circuit-Sword/HEAD/settings/deb/libaprutil1_1.6.1-4_armhf.deb -------------------------------------------------------------------------------- /settings/deb/libserf-1-1_1.3.9-7_armhf.deb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weese/Circuit-Sword/HEAD/settings/deb/libserf-1-1_1.3.9-7_armhf.deb -------------------------------------------------------------------------------- /settings/deb/libutf8proc2_2.3.0-1_armhf.deb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weese/Circuit-Sword/HEAD/settings/deb/libutf8proc2_2.3.0-1_armhf.deb -------------------------------------------------------------------------------- /settings/deb/python-serial_2.6-1.1_all.deb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weese/Circuit-Sword/HEAD/settings/deb/python-serial_2.6-1.1_all.deb -------------------------------------------------------------------------------- /sound-module/snd-usb-audio-dkms_0.1_armhf.deb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weese/Circuit-Sword/HEAD/sound-module/snd-usb-audio-dkms_0.1_armhf.deb -------------------------------------------------------------------------------- /settings/deb/avrdude_6.3+r1425-1+rpt1_armhf.deb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weese/Circuit-Sword/HEAD/settings/deb/avrdude_6.3+r1425-1+rpt1_armhf.deb -------------------------------------------------------------------------------- /settings/deb/libsvn1_1.10.4-1+deb10u3_armhf.deb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weese/Circuit-Sword/HEAD/settings/deb/libsvn1_1.10.4-1+deb10u3_armhf.deb -------------------------------------------------------------------------------- /settings/deb/subversion_1.10.4-1+deb10u3_armhf.deb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weese/Circuit-Sword/HEAD/settings/deb/subversion_1.10.4-1+deb10u3_armhf.deb -------------------------------------------------------------------------------- /settings/deb/avrdude_6.3-20171130+svn1429-2+rpt1_armhf.deb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weese/Circuit-Sword/HEAD/settings/deb/avrdude_6.3-20171130+svn1429-2+rpt1_armhf.deb -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/include/rtw_version.h: -------------------------------------------------------------------------------- 1 | #define DRIVERVERSION "v4.3.5.5_12290.20140916_BTCOEX20140507-4E40" 2 | #define BTCOEXVERSION "BTCOEX20140507-4E40" 3 | -------------------------------------------------------------------------------- /settings/alsa-base.conf: -------------------------------------------------------------------------------- 1 | # Set both USB and HDMI to the same index so 2 | # that when HDMI is enabled, it takes over 3 | 4 | options snd-usb-audio index=0 5 | options snd_bcm2835 index=0 6 | -------------------------------------------------------------------------------- /settings/deb/libhidapi-libusb0_0.8.0~rc1+git20140818.d17db57+dfsg-2_armhf.deb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weese/Circuit-Sword/HEAD/settings/deb/libhidapi-libusb0_0.8.0~rc1+git20140818.d17db57+dfsg-2_armhf.deb -------------------------------------------------------------------------------- /cs-hud/cs-hud.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Circuit Sword HUD/OSD Service 3 | 4 | [Service] 5 | ExecStart=/home/pi/Circuit-Sword/cs-hud/cs-hud 6 | 7 | [Install] 8 | WantedBy=multi-user.target 9 | Alias=cs-hud.service 10 | -------------------------------------------------------------------------------- /settings/WIFI.txt: -------------------------------------------------------------------------------- 1 | sudo apt-get install raspberrypi-kernel-headers build-essential 2 | git clone https://github.com/hadess/rtl8723bs 3 | cd rtl8723bs/ 4 | git checkout db2c4f61d48fe3b47c167c8bcd722ce83c24aca5 5 | make 6 | sudo make install -------------------------------------------------------------------------------- /dpi-cloner/dpi-cloner.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Circuit Sword DPI Cloner Service 3 | 4 | [Service] 5 | ExecStart=/home/pi/Circuit-Sword/dpi-cloner/dpi-cloner 6 | 7 | [Install] 8 | WantedBy=multi-user.target 9 | Alias=dpi-cloner.service 10 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/dkms.conf: -------------------------------------------------------------------------------- 1 | PACKAGE_NAME="rtl8723bs" 2 | PACKAGE_VERSION="4.14" 3 | MAKE="make" 4 | CLEAN="make clean" 5 | BUILT_MODULE_NAME="r8723bs" 6 | DEST_MODULE_LOCATION="/kernel/drivers/rtl8723bs" 7 | REMAKE_INITRD="no" 8 | AUTOINSTALL="yes" 9 | -------------------------------------------------------------------------------- /sound-module/snd-usb-audio-0.1/dkms.conf: -------------------------------------------------------------------------------- 1 | PACKAGE_NAME="snd-usb-audio" 2 | PACKAGE_VERSION="0.1" 3 | MAKE="make" 4 | CLEAN="make clean" 5 | BUILT_MODULE_NAME="snd-usb-audio" 6 | DEST_MODULE_LOCATION="/kernel/sound/usb" 7 | REMAKE_INITRD="no" 8 | AUTOINSTALL="yes" 9 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Circuit Sword Software 2 | Power management and safe shutdown software for the Circuit Sword. 3 | 4 | ## Downloads 5 | - [Latest 1.4.x releases](https://github.com/weese/Circuit-Sword/releases) 6 | - [Kite's 1.3.x releases](https://github.com/kiteretro/Circuit-Sword/releases) 7 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/patches/makefile.patch: -------------------------------------------------------------------------------- 1 | --- Makefile 2019-08-18 09:41:34.849812100 +0100 2 | +++ Makefilev1 2019-08-18 09:41:57.259794579 +0100 3 | @@ -68,4 +68,4 @@ 4 | 5 | obj-$(CONFIG_RTL8723BS) := r8723bs.o 6 | 7 | -ccflags-y += -I$(srctree)/$(src)/include -I$(srctree)/$(src)/hal 8 | +ccflags-y += -I$(src)/include -I$(src)/hal 9 | -------------------------------------------------------------------------------- /bt-driver/rtl-bluetooth.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=RTL8723 Bluetooth Service 3 | 4 | [Service] 5 | StandardOutput=syslog 6 | StandardError=syslog 7 | SyslogIdentifier=RTL_BT 8 | 9 | ExecStart=/usr/bin/sudo /usr/bin/rtk_hciattach -n -s 115200 "/dev/ttyAMA0" rtk_h5 10 | 11 | [Install] 12 | WantedBy=multi-user.target 13 | Alias=rtl-bluetooth.service 14 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Windows thumbnail cache files 2 | Thumbs.db 3 | ehthumbs.db 4 | ehthumbs_vista.db 5 | 6 | # Dump file 7 | *.stackdump 8 | 9 | # Folder config file 10 | [Dd]esktop.ini 11 | 12 | # Recycle Bin used on file shares 13 | $RECYCLE.BIN/ 14 | 15 | # Windows Installer files 16 | *.cab 17 | *.msi 18 | *.msm 19 | *.msp 20 | 21 | # Windows shortcuts 22 | *.lnk -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/Kconfig: -------------------------------------------------------------------------------- 1 | config RTL8723BS 2 | tristate "Realtek RTL8723BS SDIO Wireless LAN NIC driver" 3 | depends on WLAN && MMC && CFG80211 4 | depends on m 5 | select WIRELESS_EXT 6 | select WEXT_PRIV 7 | ---help--- 8 | This option enables support for RTL8723BS SDIO drivers, such as 9 | the wifi found on the 1st gen Intel Compute Stick, the CHIP 10 | and many other Intel Atom and ARM based devices. 11 | If built as a module, it will be called r8723bs. 12 | -------------------------------------------------------------------------------- /settings/cs_shutdown.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Get ES pid 4 | ES_PID=`pidof emulationstation` 5 | 6 | if [[ $ES_PID != "" ]] ; then 7 | 8 | echo "ES_PID: $ES_PID" 9 | 10 | # Touch the shutdown file 11 | touch /tmp/es-shutdown 12 | chown pi:pi /tmp/es-shutdown 13 | 14 | # Tell ES to terminate 15 | kill -s SIGTERM $ES_PID 16 | 17 | echo "ES has been asked to shutdown" 18 | 19 | else 20 | 21 | echo "Could not find ES PID ($ES_PID)" 22 | sudo shutdown -h now & 23 | 24 | fi 25 | 26 | -------------------------------------------------------------------------------- /bt-driver/README.md: -------------------------------------------------------------------------------- 1 | ## Important: 2 | 3 | For the bluetooth driver to work, remove `console=serial0,115200` in the file `/boot/cmdline.txt`, e.g.: 4 | 5 | ORIGINAL: 6 | ``` 7 | console=serial0,115200 console=tty1 root=PARTUUID=0c6a7995-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait loglevel=3 consoleblank=0 plymouth.enable=0 8 | ``` 9 | 10 | PATCHED: 11 | ``` 12 | console=tty1 root=PARTUUID=0c6a7995-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait loglevel=3 consoleblank=0 plymouth.enable=0 13 | ``` -------------------------------------------------------------------------------- /settings/boot/config-cs.txt: -------------------------------------------------------------------------------- 1 | # 2 | # This script gets sourced on boot 3 | # It should exist as /boot/config-cs.txt 4 | # 5 | 6 | # Mode to boot in, TESTER will run a debug app 7 | MODE=NORMAL 8 | #MODE=TESTER 9 | #MODE=SHELL 10 | 11 | # Cloner settings 12 | CLONER=OFF 13 | 14 | # Location of tester script (gets called with ) 15 | TESTER=/home/pi/Circuit-Sword/cs-tester/cs-tester.py 16 | 17 | # Startup Exec (make font smaller) 18 | STARTUPEXEC="sudo setfont /home/pi/Circuit-Sword/settings/miniwi-8.psf.gz" 19 | -------------------------------------------------------------------------------- /sound-module/snd-usb-audio-0.1/patches/fix-volume.patch: -------------------------------------------------------------------------------- 1 | diff --git a/mixer.c b/mixer.c 2 | index b598f8f0d..499cfa990 100644 3 | --- a/mixer.c 4 | +++ b/mixer.c 5 | @@ -1128,14 +1128,6 @@ static void volume_control_quirks(struct usb_mixer_elem_info *cval, 6 | } 7 | break; 8 | 9 | - case USB_ID(0x0d8c, 0x0103): 10 | - if (!strcmp(kctl->id.name, "PCM Playback Volume")) { 11 | - usb_audio_info(chip, 12 | - "set volume quirk for CM102-A+/102S+\n"); 13 | - cval->min = -256; 14 | - } 15 | - break; 16 | - 17 | case USB_ID(0x0471, 0x0101): 18 | case USB_ID(0x0471, 0x0104): 19 | case USB_ID(0x0471, 0x0105): 20 | -------------------------------------------------------------------------------- /wifi-module/README: -------------------------------------------------------------------------------- 1 | Do you want to update the kernel without issues 2 | # Run first 3 | sudo apt-get update 4 | sudo apt install raspberrypi-kernel-headers 5 | sudo apt-get install subversion 6 | 7 | After that you are able to install (the preffered mehod) .deb file 8 | 9 | 10 | # DEB package install (the preffered method) 11 | dpkg -i rtl8723bs-dkms_4.14_all.deb 12 | 13 | # DKMS manual Install 14 | copy rtl8723bs-4.14 to /usr/src/ 15 | dkms add -m rtl8723bs -v 4.14 16 | dkms build -m rtl8723bs -v 4.14 17 | dkms install -m rtl8723bs -v 4.14 18 | 19 | # Last resort help, if dkms doesn't work 20 | run fix-for-installed-kernel.sh 21 | it will try to install the correct module before reboot 22 | 23 | -------------------------------------------------------------------------------- /settings/bluetooth-audio.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | # Install and Configure Bluetooth Audio Support for Pulse Audio 5 | sudo apt-get install -y pulseaudio-module-bluetooth 6 | sudo adduser pi bluetooth 7 | if ! grep "load-module module-switch-on-connect" /etc/pulse/default.pa; then 8 | echo "load-module module-switch-on-connect" >> /etc/pulse/default.pa 9 | fi 10 | 11 | cat << EOF 12 | BT Audio Support is ready to use. 13 | 14 | Connect to the speaker through the GUI 15 | Menu -> BLUETOOTH -> Register and Connect to Bluetooth Device 16 | Select DisplayYesNo as agent 17 | 18 | Have Pi automatically connect to the speaker 19 | Menu -> BLUETOOTH -> Configure bluetooth connect mode 20 | Set connect mode to "background" 21 | 22 | Do a reboot 23 | EOF 24 | -------------------------------------------------------------------------------- /settings/es_settings.cfg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/TODO: -------------------------------------------------------------------------------- 1 | TODO: 2 | - find and remove code blocks guarded by never set CONFIG_FOO defines 3 | - find and remove remaining code valid only for 5 HGz. Most of the obvious 4 | ones have been removed, but things like channel > 14 still exist. 5 | - find and remove any code for other chips that is left over 6 | - convert any remaining unusual variable types 7 | - find codes that can use %pM and %Nph formatting 8 | - checkpatch.pl fixes - most of the remaining ones are lines too long. Many 9 | of them will require refactoring 10 | - merge Realtek's bugfixes and new features into the driver 11 | - switch to use LIB80211 12 | - switch to use MAC80211 13 | 14 | Please send any patches to Greg Kroah-Hartman , 15 | Bastien Nocera , Hans de Goede 16 | and Larry Finger . 17 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/include/rtw_wifi_regd.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0 */ 2 | /****************************************************************************** 3 | * 4 | * Copyright(c) 2009-2010 Realtek Corporation. 5 | * 6 | *****************************************************************************/ 7 | 8 | #ifndef __RTW_WIFI_REGD_H__ 9 | #define __RTW_WIFI_REGD_H__ 10 | 11 | struct country_code_to_enum_rd { 12 | u16 countrycode; 13 | const char *iso_name; 14 | }; 15 | 16 | enum country_code_type_t { 17 | COUNTRY_CODE_USER = 0, 18 | 19 | /*add new channel plan above this line */ 20 | COUNTRY_CODE_MAX 21 | }; 22 | 23 | int rtw_regd_init(struct adapter *padapter, 24 | void (*reg_notifier)(struct wiphy *wiphy, 25 | struct regulatory_request *request)); 26 | void rtw_reg_notifier(struct wiphy *wiphy, struct regulatory_request *request); 27 | 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/hal/odm_RTL8723B.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 | ******************************************************************************/ 15 | #ifndef __ODM_RTL8723B_H__ 16 | #define __ODM_RTL8723B_H__ 17 | 18 | #define DM_DIG_MIN_NIC_8723 0x1C 19 | 20 | s8 odm_CCKRSSI_8723B(u8 LNA_idx, u8 VGA_idx); 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /cross-build/README.md: -------------------------------------------------------------------------------- 1 | # Cross-build a new SD image in 6min 2 | 3 | You can build your own SD image of Retropie for the Circuit Sword on your local machine (tested on Mac OS) using [Docker Desktop](https://www.docker.com/get-started/). 4 | After installing Docker, you should tune it a bit to speed up the build process: 5 | 6 | - increase resources to e.g. 8 CPUs 7 | - enable Experimental Features -> Enable VirtuoFS accelerated directory sharing 8 | 9 | Then create the requried docker images with: 10 | 11 | ``` 12 | cd cross-build 13 | make docker-build 14 | ``` 15 | 16 | and after that build the images with 17 | 18 | ``` 19 | make all 20 | ``` 21 | 22 | The final image will be written into the folder `cross-build/images` and is has a filename that includes a recent UTC date 23 | `retropie-buster-4.8-rpi2_3_zero2w_stable_CSO_CM3_2022xxxx-xxxxxx.img`. Simply burn that image to a microSD card using [balenaEtcher](https://www.balena.io/etcher/) and boot. 24 | -------------------------------------------------------------------------------- /sound-module/README.md: -------------------------------------------------------------------------------- 1 | # Fix the too-loud-volume issue on Raspbian Buster and later 2 | 3 | ## Option 1 (preferred): DEB package install 4 | ``` 5 | sudo apt-get update 6 | sudo apt-get install raspberrypi-kernel-headers subversion wget unzip 7 | wget https://github.com/weese/Circuit-Sword/raw/master/sound-module/snd-usb-audio-dkms_0.1_armhf.deb 8 | sudo dpkg -i snd-usb-audio-dkms_0.1_armhf.deb 9 | ``` 10 | 11 | ## Option 2: DKMS manual install 12 | ``` 13 | wget https://github.com/weese/Circuit-Sword/archive/refs/heads/master.zip 14 | unzip master.zip 15 | sudo cp -r Circuit-Sword-master/snd-usb-audio-0.1 /usr/src/ 16 | sudo dkms add -m snd-usb-audio/0.1 17 | sudo dkms build -m snd-usb-audio/0.1 18 | sudo dkms install -m snd-usb-audio/0.1 19 | ``` 20 | 21 | ## Option 3: Last resort, if nothing else works 22 | ``` 23 | wget https://github.com/weese/Circuit-Sword/archive/refs/heads/master.zip 24 | unzip master.zip 25 | cd Circuit-Sword-master/sound-module 26 | ./fix-for-installed-kernel.sh 27 | ``` 28 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/include/rtw_qos.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | ******************************************************************************/ 15 | 16 | 17 | #ifndef _RTW_QOS_H_ 18 | #define _RTW_QOS_H_ 19 | 20 | 21 | 22 | struct qos_priv { 23 | unsigned int qos_option; /* bit mask option: u-apsd, s-apsd, ts, block ack... */ 24 | }; 25 | 26 | 27 | #endif /* _RTL871X_QOS_H_ */ 28 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/include/sdio_osintf.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | ******************************************************************************/ 15 | #ifndef __SDIO_OSINTF_H__ 16 | #define __SDIO_OSINTF_H__ 17 | 18 | 19 | 20 | u8 sd_hal_bus_init(struct adapter *padapter); 21 | u8 sd_hal_bus_deinit(struct adapter *padapter); 22 | void sd_c2h_hdl(struct adapter *padapter); 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/hal/odm_PathDiv.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 | ******************************************************************************/ 15 | 16 | #ifndef __ODMPATHDIV_H__ 17 | #define __ODMPATHDIV_H__ 18 | 19 | void 20 | odm_PathDiversityInit( 21 | void *pDM_VOID 22 | ); 23 | 24 | void 25 | odm_PathDiversity( 26 | void *pDM_VOID 27 | ); 28 | 29 | #endif /* ifndef __ODMPATHDIV_H__ */ 30 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/include/ethernet.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | ******************************************************************************/ 15 | /*! \file */ 16 | #ifndef __INC_ETHERNET_H 17 | #define __INC_ETHERNET_H 18 | 19 | #define ETHERNET_HEADER_SIZE 14 /* Ethernet Header Length */ 20 | #define LLC_HEADER_SIZE 6 /* LLC Header Length */ 21 | 22 | #endif /* #ifndef __INC_ETHERNET_H */ 23 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/include/rtw_byteorder.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | ******************************************************************************/ 15 | #ifndef _RTL871X_BYTEORDER_H_ 16 | #define _RTL871X_BYTEORDER_H_ 17 | 18 | #if defined (__LITTLE_ENDIAN) 19 | #include 20 | #else 21 | # include 22 | #endif 23 | 24 | #endif /* _RTL871X_BYTEORDER_H_ */ 25 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/fix-for-installed-kernel.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | #This script tries to fix the wifi module 5 | 6 | # extract kernel version from zimage file - currently installed kernel 7 | 8 | # kernel name 9 | if [ "$(uname -m)" == "armv6l" ]; then file=/boot/kernel.img; else file=/boot/kernel7.img; fi 10 | echo "kernel = $file" 11 | 12 | # get offset of start of gzip file, marked by 0x1f 0x8b 13 | skip=$(hexdump -ve '"%_ad " 1/1 "%02x\n"' $file |grep -B1 '8b' |grep -m1 '1f' |awk '{print $1;}') 14 | echo "offset = $skip bytes" 15 | 16 | # unzip and scan for strings 17 | line=$(dd if=$file bs=1 skip=$skip |gunzip |strings |grep -iPm1 'Linux version \d\.\d+\.\d+') 18 | version=$(perl -ne 'print "$1\n" if /\s(\d+\.\d+\.\d+\S+)\s/' <<<$line) 19 | echo "headers = $version" 20 | 21 | if [ ! -d "/lib/modules/$version/build" ]; then 22 | echo "Headers not found!" 23 | echo "Please install kernel headers $version" 24 | exit 1 25 | fi 26 | 27 | KERNELRELEASE=$version make 28 | KERNELRELEASE=$version make modules_install 29 | depmod -a 30 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/include/rtl8723b_rf.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | ******************************************************************************/ 15 | #ifndef __RTL8723B_RF_H__ 16 | #define __RTL8723B_RF_H__ 17 | 18 | #include "rtl8192c_rf.h" 19 | 20 | int PHY_RF6052_Config8723B(struct adapter *Adapter ); 21 | 22 | void 23 | PHY_RF6052SetBandwidth8723B(struct adapter *Adapter, 24 | enum CHANNEL_WIDTH Bandwidth); 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /sound-module/snd-usb-audio-0.1/fix-for-installed-kernel.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | #This script tries to fix the sound-usb-audio module 5 | 6 | # extract kernel version from zimage file - currently installed kernel 7 | 8 | # kernel name 9 | if [ "$(uname -m)" == "armv6l" ]; then file=/boot/kernel.img; else file=/boot/kernel7.img; fi 10 | echo "kernel = $file" 11 | 12 | # get offset of start of gzip file, marked by 0x1f 0x8b 13 | skip=$(hexdump -ve '"%_ad " 1/1 "%02x\n"' $file |grep -B1 '8b' |grep -m1 '1f' |awk '{print $1;}') 14 | echo "offset = $skip bytes" 15 | 16 | # unzip and scan for strings 17 | line=$(dd if=$file bs=1 skip=$skip |gunzip |strings |grep -iPm1 'Linux version \d\.\d+\.\d+') 18 | version=$(perl -ne 'print "$1\n" if /\s(\d+\.\d+\.\d+\S+)\s/' <<<$line) 19 | echo "headers = $version" 20 | 21 | if [ ! -d "/lib/modules/$version/build" ]; then 22 | echo "Headers not found!" 23 | echo "Please install kernel headers $version" 24 | exit 1 25 | fi 26 | 27 | KERNELRELEASE=$version make 28 | KERNELRELEASE=$version make modules_install 29 | depmod -a 30 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/include/hal_phy_reg.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | ******************************************************************************/ 15 | #ifndef __HAL_PHY_REG_H__ 16 | #define __HAL_PHY_REG_H__ 17 | 18 | /* for PutRFRegsetting & GetRFRegSetting BitMask */ 19 | /* if (RTL92SE_FPGA_VERIFY == 1) */ 20 | /* define bRFRegOffsetMask 0xfff */ 21 | /* else */ 22 | #define bRFRegOffsetMask 0xfffff 23 | /* endif */ 24 | 25 | #endif /* __HAL_PHY_REG_H__ */ 26 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/hal/Mp_Precomp.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2013 Realtek Corporation. All rights reserved. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | ******************************************************************************/ 15 | #ifndef __MP_PRECOMP_H__ 16 | #define __MP_PRECOMP_H__ 17 | 18 | #include 19 | #include 20 | 21 | #define BT_TMP_BUF_SIZE 100 22 | 23 | #define DCMD_Printf DBG_BT_INFO 24 | 25 | #ifdef bEnable 26 | #undef bEnable 27 | #endif 28 | 29 | #include "HalBtcOutSrc.h" 30 | #include "HalBtc8723b1Ant.h" 31 | #include "HalBtc8723b2Ant.h" 32 | 33 | #endif /* __MP_PRECOMP_H__ */ 34 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/hal/odm_EdcaTurboCheck.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | ******************************************************************************/ 15 | 16 | #ifndef __ODMEDCATURBOCHECK_H__ 17 | #define __ODMEDCATURBOCHECK_H__ 18 | 19 | typedef struct _EDCA_TURBO_ { 20 | bool bCurrentTurboEDCA; 21 | bool bIsCurRDLState; 22 | 23 | u32 prv_traffic_idx; /* edca turbo */ 24 | } EDCA_T, *pEDCA_T; 25 | 26 | void odm_EdcaTurboCheck(void *pDM_VOID); 27 | void ODM_EdcaTurboInit(void *pDM_VOID); 28 | 29 | void odm_EdcaTurboCheckCE(void *pDM_VOID); 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/hal/HalHWImg8723B_MAC.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | ******************************************************************************/ 15 | 16 | #ifndef __INC_MP_MAC_HW_IMG_8723B_H 17 | #define __INC_MP_MAC_HW_IMG_8723B_H 18 | 19 | 20 | /****************************************************************************** 21 | * MAC_REG.TXT 22 | ******************************************************************************/ 23 | 24 | void 25 | ODM_ReadAndConfig_MP_8723B_MAC_REG(/* TC: Test Chip, MP: MP Chip */ 26 | PDM_ODM_T pDM_Odm 27 | ); 28 | #endif 29 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/include/sdio_hal.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | ******************************************************************************/ 15 | #ifndef __SDIO_HAL_H__ 16 | #define __SDIO_HAL_H__ 17 | 18 | 19 | extern u8 sd_hal_bus_init(struct adapter *padapter); 20 | extern u8 sd_hal_bus_deinit(struct adapter *padapter); 21 | 22 | u8 sd_int_isr(struct adapter *padapter); 23 | void sd_int_dpc(struct adapter *padapter); 24 | void rtw_set_hal_ops(struct adapter *padapter); 25 | 26 | void rtl8723bs_set_hal_ops(struct adapter *padapter); 27 | 28 | #endif /* __SDIO_HAL_H__ */ 29 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/Makefile: -------------------------------------------------------------------------------- 1 | KVER=$(shell echo $(KERNELRELEASE) | cut -d '.' -f1,2) 2 | KERNEL_HEADERS=/lib/modules/$(KERNELRELEASE)/build 3 | 4 | define download_sources = 5 | echo "Need a subversion for this!" 6 | svn export https://github.com/raspberrypi/linux/branches/rpi-$(KVER).y/drivers/staging/rtl8723bs $(KVER) 7 | endef 8 | 9 | define patch_makefile = 10 | patch $(KVER)/Makefile patches/makefile.patch 11 | endef 12 | 13 | define upgrade_sources = 14 | cp -r 4.14 $(KVER) 15 | patch --strip 1 -d $(KVER) < patches/4.14-to-4.19.patch 16 | endef 17 | 18 | all: | $(KVER) 19 | CONFIG_RTL8723BS=m $(MAKE) -C $(KERNEL_HEADERS) M=$(PWD)/$(KVER) 20 | cp $(PWD)/$(KVER)/r8723bs.ko $(PWD) 21 | 22 | clean: 23 | $(MAKE) -C $(KERNEL_HEADERS) M=$(PWD)/$(KVER) clean 24 | 25 | install: 26 | $(MAKE) -C $(KERNEL_HEADERS) M=$(PWD)/$(KVER) modules_install 27 | $(KVER): 28 | @echo "Source code for $(KVER) does not exists" 29 | @echo "Checking for upgrade patch" 30 | 31 | ifeq ($(wildcard patches/4.14-to-$(KVER).patch),) 32 | @echo "Patch not found" 33 | @echo "Trying to download a new sources.." 34 | $(download_sources) 35 | $(patch_makefile) 36 | else 37 | @echo "Patch found" 38 | $(upgrade_sources) 39 | endif 40 | 41 | 42 | .PHONY: all 43 | -------------------------------------------------------------------------------- /sound-module/snd-usb-audio-0.1/Makefile: -------------------------------------------------------------------------------- 1 | KVER=$(shell echo $(KERNELRELEASE) | cut -d '.' -f1,2) 2 | KERNEL_HEADERS=/lib/modules/$(KERNELRELEASE)/build 3 | 4 | define download_sources = 5 | echo "Need a subversion for this!" 6 | svn export https://github.com/raspberrypi/linux/branches/rpi-$(KVER).y/sound/usb $(KVER) 7 | endef 8 | 9 | define patch_sources = 10 | patch --strip 1 -d $(KVER) < patches/fix-volume.patch 11 | endef 12 | 13 | define upgrade_sources = 14 | cp -r 5.10 $(KVER) 15 | patch --strip 1 -d $(KVER) < patches/5.10-to-$(KVER).patch 16 | endef 17 | 18 | all: | $(KVER) 19 | CONFIG_SND_USB_AUDIO=m $(MAKE) -C $(KERNEL_HEADERS) M=$(PWD)/$(KVER) 20 | cp $(PWD)/$(KVER)/snd-usb-audio.ko $(PWD) 21 | 22 | clean: 23 | $(MAKE) -C $(KERNEL_HEADERS) M=$(PWD)/$(KVER) clean 24 | 25 | install: 26 | $(MAKE) -C $(KERNEL_HEADERS) M=$(PWD)/$(KVER) modules_install 27 | $(KVER): 28 | @echo "Source code for $(KVER) does not exists" 29 | @echo "Checking for upgrade patch" 30 | 31 | ifeq ($(wildcard patches/5.10-to-$(KVER).patch),) 32 | @echo "Patch not found" 33 | @echo "Trying to download new sources.." 34 | $(download_sources) 35 | $(patch_sources) 36 | else 37 | @echo "Patch found" 38 | $(upgrade_sources) 39 | endif 40 | 41 | 42 | .PHONY: all 43 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/include/cmd_osdep.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | ******************************************************************************/ 15 | #ifndef __CMD_OSDEP_H_ 16 | #define __CMD_OSDEP_H_ 17 | 18 | 19 | extern sint _rtw_init_cmd_priv (struct cmd_priv *pcmdpriv); 20 | extern sint _rtw_init_evt_priv(struct evt_priv *pevtpriv); 21 | extern void _rtw_free_evt_priv (struct evt_priv *pevtpriv); 22 | extern void _rtw_free_cmd_priv (struct cmd_priv *pcmdpriv); 23 | extern sint _rtw_enqueue_cmd(struct __queue *queue, struct cmd_obj *obj); 24 | extern struct cmd_obj *_rtw_dequeue_cmd(struct __queue *queue); 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/hal/odm_DynamicTxPower.c: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | ******************************************************************************/ 15 | 16 | #include "odm_precomp.h" 17 | 18 | void odm_DynamicTxPowerInit(void *pDM_VOID) 19 | { 20 | PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; 21 | 22 | struct adapter *Adapter = pDM_Odm->Adapter; 23 | struct hal_com_data *pHalData = GET_HAL_DATA(Adapter); 24 | struct dm_priv *pdmpriv = &pHalData->dmpriv; 25 | 26 | pdmpriv->bDynamicTxPowerEnable = false; 27 | 28 | pdmpriv->LastDTPLvl = TxHighPwrLevel_Normal; 29 | pdmpriv->DynamicTxHighPowerLvl = TxHighPwrLevel_Normal; 30 | } 31 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/include/mlme_osdep.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | ******************************************************************************/ 15 | #ifndef __MLME_OSDEP_H_ 16 | #define __MLME_OSDEP_H_ 17 | 18 | 19 | extern void rtw_init_mlme_timer(struct adapter *padapter); 20 | extern void rtw_os_indicate_disconnect(struct adapter *adapter); 21 | extern void rtw_os_indicate_connect(struct adapter *adapter); 22 | void rtw_os_indicate_scan_done(struct adapter *padapter, bool aborted); 23 | extern void rtw_report_sec_ie(struct adapter *adapter, u8 authmode, u8 *sec_ie); 24 | 25 | void rtw_reset_securitypriv(struct adapter *adapter); 26 | 27 | #endif /* _MLME_OSDEP_H_ */ 28 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/hal/odm_AntDiv.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 | ******************************************************************************/ 15 | 16 | #ifndef __ODMANTDIV_H__ 17 | #define __ODMANTDIV_H__ 18 | 19 | 20 | 21 | #define ANT1_2G 0 /* = ANT2_5G */ 22 | #define ANT2_2G 1 /* = ANT1_5G */ 23 | 24 | /* Antenna Diversty Control Type */ 25 | #define ODM_AUTO_ANT 0 26 | #define ODM_FIX_MAIN_ANT 1 27 | #define ODM_FIX_AUX_ANT 2 28 | 29 | #define TX_BY_REG 0 30 | 31 | #define ANTDIV_ON 1 32 | #define ANTDIV_OFF 0 33 | 34 | #define INIT_ANTDIV_TIMMER 0 35 | #define CANCEL_ANTDIV_TIMMER 1 36 | #define RELEASE_ANTDIV_TIMMER 2 37 | 38 | #endif /* ifndef __ODMANTDIV_H__ */ 39 | -------------------------------------------------------------------------------- /sound-module/snd-usb-audio-0.1/dkms-patchmodule.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # kernelver is not set on kernel upgrade from apt, but DPKG_MAINTSCRIPT_PACKAGE 3 | # contains the kernel image or header package upgraded 4 | if [ -z "$kernelver" ] ; then 5 | echo "using DPKG_MAINTSCRIPT_PACKAGE instead of unset kernelver" 6 | kernelver=$( echo $DPKG_MAINTSCRIPT_PACKAGE | sed -r 's/linux-(headers|image)-//') 7 | fi 8 | 9 | vers=(${kernelver//./ }) # split kernel version into individual elements 10 | major="${vers[0]}" 11 | minor="${vers[1]}" 12 | version="$major.$minor" # recombine as needed 13 | subver=$(grep "SUBLEVEL =" /usr/src/linux-headers-${kernelver}/Makefile | tr -d " " | cut -d "=" -f 2) 14 | 15 | echo "Downloading kernel source $version.$subver for $kernelver" 16 | wget https://mirrors.edge.kernel.org/pub/linux/kernel/v$major.x/linux-$version.$subver.tar.xz 17 | 18 | echo "Extracting original source" 19 | tar -xf linux-$version.$subver.tar.* linux-$version.$subver/$1 --xform=s,linux-$version.$subver/$1,., 20 | 21 | # The new module version should be increased to allow the new module to be 22 | # installed during kernel upgrade 23 | #echo "Increase module version" 24 | #sed -i 's/\(#define VERSION "0\.8\)/\1\.1/' btusb.c 25 | 26 | for i in `ls *.patch` 27 | do 28 | echo "Applying $i" 29 | patch < $i 30 | done 31 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/hal/odm_DynamicBBPowerSaving.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | ******************************************************************************/ 15 | 16 | #ifndef __ODMDYNAMICBBPOWERSAVING_H__ 17 | #define __ODMDYNAMICBBPOWERSAVING_H__ 18 | 19 | typedef struct _Dynamic_Power_Saving_ { 20 | u8 PreCCAState; 21 | u8 CurCCAState; 22 | 23 | u8 PreRFState; 24 | u8 CurRFState; 25 | 26 | int Rssi_val_min; 27 | 28 | u8 initialize; 29 | u32 Reg874, RegC70, Reg85C, RegA74; 30 | 31 | } PS_T, *pPS_T; 32 | 33 | #define dm_RF_Saving ODM_RF_Saving 34 | 35 | void ODM_RF_Saving(void *pDM_VOID, u8 bForceInNormal); 36 | 37 | void odm_DynamicBBPowerSavingInit(void *pDM_VOID); 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/include/drv_types_sdio.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | ******************************************************************************/ 15 | #ifndef __DRV_TYPES_SDIO_H__ 16 | #define __DRV_TYPES_SDIO_H__ 17 | 18 | /* SDIO Header Files */ 19 | #include 20 | #include 21 | 22 | #if defined(CONFIG_WOWLAN) || defined(CONFIG_AP_WOWLAN) 23 | #include 24 | #include 25 | #endif 26 | 27 | typedef struct sdio_data 28 | { 29 | u8 func_number; 30 | 31 | u8 tx_block_mode; 32 | u8 rx_block_mode; 33 | u32 block_transfer_len; 34 | 35 | struct sdio_func *func; 36 | void *sys_sdio_irq_thd; 37 | } SDIO_DATA, *PSDIO_DATA; 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/include/hal_sdio.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | ******************************************************************************/ 15 | #ifndef __HAL_SDIO_H_ 16 | #define __HAL_SDIO_H_ 17 | 18 | #define ffaddr2deviceId(pdvobj, addr) (pdvobj->Queue2Pipe[addr]) 19 | 20 | u8 rtw_hal_sdio_max_txoqt_free_space(struct adapter *padapter); 21 | u8 rtw_hal_sdio_query_tx_freepage(struct adapter *padapter, u8 PageIdx, u8 RequiredPageNum); 22 | void rtw_hal_sdio_update_tx_freepage(struct adapter *padapter, u8 PageIdx, u8 RequiredPageNum); 23 | void rtw_hal_set_sdio_tx_max_length(struct adapter *padapter, u8 numHQ, u8 numNQ, u8 numLQ, u8 numPubQ); 24 | u32 rtw_hal_get_sdio_tx_max_length(struct adapter *padapter, u8 queue_idx); 25 | 26 | #endif /* __RTW_LED_H_ */ 27 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/hal/odm_PathDiv.c: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | ******************************************************************************/ 15 | 16 | #include "odm_precomp.h" 17 | 18 | void odm_PathDiversityInit(void *pDM_VOID) 19 | { 20 | PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; 21 | 22 | if (!(pDM_Odm->SupportAbility & ODM_BB_PATH_DIV)) 23 | ODM_RT_TRACE( 24 | pDM_Odm, 25 | ODM_COMP_PATH_DIV, 26 | ODM_DBG_LOUD, 27 | ("Return: Not Support PathDiv\n") 28 | ); 29 | } 30 | 31 | void odm_PathDiversity(void *pDM_VOID) 32 | { 33 | PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; 34 | 35 | if (!(pDM_Odm->SupportAbility & ODM_BB_PATH_DIV)) 36 | ODM_RT_TRACE( 37 | pDM_Odm, 38 | ODM_COMP_PATH_DIV, 39 | ODM_DBG_LOUD, 40 | ("Return: Not Support PathDiv\n") 41 | ); 42 | } 43 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/include/rtl8723b_dm.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | ******************************************************************************/ 15 | #ifndef __RTL8723B_DM_H__ 16 | #define __RTL8723B_DM_H__ 17 | /* */ 18 | /* Description: */ 19 | /* */ 20 | /* This file is for 8723B dynamic mechanism only */ 21 | /* */ 22 | /* */ 23 | /* */ 24 | 25 | /* */ 26 | /* structure and define */ 27 | /* */ 28 | 29 | /* */ 30 | /* function prototype */ 31 | /* */ 32 | 33 | void rtl8723b_init_dm_priv(struct adapter *padapter); 34 | 35 | void rtl8723b_InitHalDm(struct adapter *padapter); 36 | void rtl8723b_HalDmWatchDog(struct adapter *padapter); 37 | void rtl8723b_HalDmWatchDog_in_LPS(struct adapter *padapter); 38 | void rtl8723b_hal_dm_in_lps(struct adapter *padapter); 39 | 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/hal/odm_RTL8723B.c: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | ******************************************************************************/ 15 | 16 | #include "odm_precomp.h" 17 | 18 | s8 odm_CCKRSSI_8723B(u8 LNA_idx, u8 VGA_idx) 19 | { 20 | s8 rx_pwr_all = 0x00; 21 | 22 | switch (LNA_idx) { 23 | /* 46 53 73 95 201301231630 */ 24 | /* 46 53 77 99 201301241630 */ 25 | 26 | case 6: 27 | rx_pwr_all = -34 - (2 * VGA_idx); 28 | break; 29 | case 4: 30 | rx_pwr_all = -14 - (2 * VGA_idx); 31 | break; 32 | case 1: 33 | rx_pwr_all = 6 - (2 * VGA_idx); 34 | break; 35 | case 0: 36 | rx_pwr_all = 16 - (2 * VGA_idx); 37 | break; 38 | default: 39 | /* rx_pwr_all = -53+(2*(31-VGA_idx)); */ 40 | /* DbgPrint("wrong LNA index\n"); */ 41 | break; 42 | 43 | } 44 | return rx_pwr_all; 45 | } 46 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:buster AS base 2 | 3 | ENV DEBIAN_FRONTEND=noninteractive 4 | 5 | RUN apt-get clean && apt-get update && \ 6 | apt-get install -y \ 7 | git bc bison flex libssl-dev python3 make kmod libc6-dev libncurses5-dev \ 8 | crossbuild-essential-armhf \ 9 | crossbuild-essential-arm64 \ 10 | vim wget kpartx rsync sudo util-linux cloud-guest-utils 11 | 12 | RUN mkdir /build 13 | RUN mkdir -p /mnt/fat32 14 | RUN mkdir -p /mnt/ext4 15 | 16 | WORKDIR /build 17 | 18 | CMD ["bash"] 19 | 20 | 21 | # Cross compile kernel 22 | FROM base AS build-kernel 23 | ARG BRANCH 24 | VOLUME /build/images 25 | 26 | WORKDIR /usr/src 27 | 28 | COPY sound-module/snd-usb-audio-0.1/patches/fix-volume.patch . 29 | RUN --mount=type=cache,target=/usr/src/linux/ \ 30 | rm -rf linux/* linux/.[!.]*; \ 31 | git clone --depth=1 https://github.com/raspberrypi/linux --branch ${BRANCH} 32 | RUN --mount=type=cache,target=/usr/src/linux/ \ 33 | patch -p1 -d linux/sound/usb < fix-volume.patch 34 | COPY cross-build/build-kernel.sh . 35 | COPY cross-build/compile-kernel.sh . 36 | COPY cross-build/install-kernel.sh . 37 | RUN --mount=type=cache,target=/usr/src/linux/ \ 38 | ./compile-kernel.sh -j8 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- 39 | 40 | CMD ["bash"] 41 | 42 | 43 | # Extend image for CSO CM3 44 | FROM base AS build-image 45 | VOLUME /build/images 46 | 47 | COPY build/build-image.sh . 48 | COPY install.sh / 49 | 50 | CMD ["bash"] 51 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/hal/odm_DynamicTxPower.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | ******************************************************************************/ 15 | 16 | #ifndef __ODMDYNAMICTXPOWER_H__ 17 | #define __ODMDYNAMICTXPOWER_H__ 18 | 19 | #define TX_POWER_NEAR_FIELD_THRESH_LVL2 74 20 | #define TX_POWER_NEAR_FIELD_THRESH_LVL1 67 21 | #define TX_POWER_NEAR_FIELD_THRESH_AP 0x3F 22 | #define TX_POWER_NEAR_FIELD_THRESH_8812 60 23 | 24 | #define TxHighPwrLevel_Normal 0 25 | #define TxHighPwrLevel_Level1 1 26 | #define TxHighPwrLevel_Level2 2 27 | #define TxHighPwrLevel_BT1 3 28 | #define TxHighPwrLevel_BT2 4 29 | #define TxHighPwrLevel_15 5 30 | #define TxHighPwrLevel_35 6 31 | #define TxHighPwrLevel_50 7 32 | #define TxHighPwrLevel_70 8 33 | #define TxHighPwrLevel_100 9 34 | 35 | void odm_DynamicTxPowerInit(void *pDM_VOID); 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/include/rtl8192c_rf.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | ******************************************************************************/ 15 | #ifndef _RTL8192C_RF_H_ 16 | #define _RTL8192C_RF_H_ 17 | 18 | 19 | /* */ 20 | /* RF RL6052 Series API */ 21 | /* */ 22 | void rtl8192c_RF_ChangeTxPath(struct adapter *Adapter, 23 | u16 DataRate); 24 | void rtl8192c_PHY_RF6052SetBandwidth(struct adapter *Adapter, 25 | enum CHANNEL_WIDTH Bandwidth); 26 | void rtl8192c_PHY_RF6052SetCckTxPower(struct adapter *Adapter, 27 | u8 *pPowerlevel); 28 | void rtl8192c_PHY_RF6052SetOFDMTxPower(struct adapter *Adapter, 29 | u8 *pPowerLevel, 30 | u8 Channel); 31 | int PHY_RF6052_Config8192C(struct adapter *Adapter); 32 | 33 | /*--------------------------Exported Function prototype---------------------*/ 34 | 35 | 36 | #endif/* End of HalRf.h */ 37 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/hal/odm_CfoTracking.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | ******************************************************************************/ 15 | 16 | #ifndef __ODMCFOTRACK_H__ 17 | #define __ODMCFOTRACK_H__ 18 | 19 | #define CFO_TH_XTAL_HIGH 20 /* kHz */ 20 | #define CFO_TH_XTAL_LOW 10 /* kHz */ 21 | #define CFO_TH_ATC 80 /* kHz */ 22 | 23 | typedef struct _CFO_TRACKING_ { 24 | bool bATCStatus; 25 | bool largeCFOHit; 26 | bool bAdjust; 27 | u8 CrystalCap; 28 | u8 DefXCap; 29 | int CFO_tail[2]; 30 | int CFO_ave_pre; 31 | u32 packetCount; 32 | u32 packetCount_pre; 33 | 34 | bool bForceXtalCap; 35 | bool bReset; 36 | } CFO_TRACKING, *PCFO_TRACKING; 37 | 38 | void ODM_CfoTrackingReset(void *pDM_VOID 39 | ); 40 | 41 | void ODM_CfoTrackingInit(void *pDM_VOID); 42 | 43 | void ODM_CfoTracking(void *pDM_VOID); 44 | 45 | void ODM_ParsingCFO(void *pDM_VOID, void *pPktinfo_VOID, s8 *pcfotail); 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/include/rtl8192c_recv.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | ******************************************************************************/ 15 | #ifndef _RTL8192C_RECV_H_ 16 | #define _RTL8192C_RECV_H_ 17 | 18 | #define RECV_BLK_SZ 512 19 | #define RECV_BLK_CNT 16 20 | #define RECV_BLK_TH RECV_BLK_CNT 21 | 22 | #define MAX_RECVBUF_SZ (10240) 23 | 24 | struct phy_stat 25 | { 26 | unsigned int phydw0; 27 | 28 | unsigned int phydw1; 29 | 30 | unsigned int phydw2; 31 | 32 | unsigned int phydw3; 33 | 34 | unsigned int phydw4; 35 | 36 | unsigned int phydw5; 37 | 38 | unsigned int phydw6; 39 | 40 | unsigned int phydw7; 41 | }; 42 | 43 | /* Rx smooth factor */ 44 | #define Rx_Smooth_Factor (20) 45 | 46 | 47 | void rtl8192c_translate_rx_signal_stuff(union recv_frame *precvframe, struct phy_stat *pphy_status); 48 | void rtl8192c_query_rx_desc_status(union recv_frame *precvframe, struct recv_stat *pdesc); 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/hal/odm_NoiseMonitor.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | *****************************************************************************/ 15 | #ifndef __ODMNOISEMONITOR_H__ 16 | #define __ODMNOISEMONITOR_H__ 17 | 18 | #define ODM_MAX_CHANNEL_NUM 38/* 14+24 */ 19 | struct noise_level { 20 | /* u8 value_a, value_b; */ 21 | u8 value[MAX_RF_PATH]; 22 | /* s8 sval_a, sval_b; */ 23 | s8 sval[MAX_RF_PATH]; 24 | 25 | /* s32 noise_a = 0, noise_b = 0, sum_a = 0, sum_b = 0; */ 26 | /* s32 noise[ODM_RF_PATH_MAX]; */ 27 | s32 sum[MAX_RF_PATH]; 28 | /* u8 valid_cnt_a = 0, valid_cnt_b = 0, */ 29 | u8 valid[MAX_RF_PATH]; 30 | u8 valid_cnt[MAX_RF_PATH]; 31 | 32 | }; 33 | 34 | 35 | typedef struct _ODM_NOISE_MONITOR_ { 36 | s8 noise[MAX_RF_PATH]; 37 | s16 noise_all; 38 | } ODM_NOISE_MONITOR; 39 | 40 | s16 ODM_InbandNoise_Monitor( 41 | void *pDM_VOID, 42 | u8 bPauseDIG, 43 | u8 IGIValue, 44 | u32 max_time 45 | ); 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/include/drv_conf.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 | ******************************************************************************/ 15 | #ifndef __DRV_CONF_H__ 16 | #define __DRV_CONF_H__ 17 | #include "autoconf.h" 18 | 19 | //About USB VENDOR REQ 20 | #if defined(CONFIG_USB_VENDOR_REQ_BUFFER_PREALLOC) && !defined(CONFIG_USB_VENDOR_REQ_MUTEX) 21 | #warning "define CONFIG_USB_VENDOR_REQ_MUTEX for CONFIG_USB_VENDOR_REQ_BUFFER_PREALLOC automatically" 22 | #define CONFIG_USB_VENDOR_REQ_MUTEX 23 | #endif 24 | #if defined(CONFIG_VENDOR_REQ_RETRY) && !defined(CONFIG_USB_VENDOR_REQ_MUTEX) 25 | #warning "define CONFIG_USB_VENDOR_REQ_MUTEX for CONFIG_VENDOR_REQ_RETRY automatically" 26 | #define CONFIG_USB_VENDOR_REQ_MUTEX 27 | #endif 28 | 29 | #define DYNAMIC_CAMID_ALLOC 30 | 31 | #ifndef CONFIG_RTW_HIQ_FILTER 32 | #define CONFIG_RTW_HIQ_FILTER 1 33 | #endif 34 | 35 | //#include 36 | 37 | #endif // __DRV_CONF_H__ 38 | -------------------------------------------------------------------------------- /cross-build/install-kernel.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ "$EUID" -ne 0 ] 4 | then echo "Please run as root (sudo)" 5 | exit 1 6 | fi 7 | 8 | if [ $# != 3 ] ; then 9 | echo "Usage: ./ YES [fat32 root] [ext4 root]" 10 | exit 1 11 | fi 12 | 13 | ##################################################################### 14 | # Vars 15 | 16 | if [[ $2 != "" ]] ; then 17 | DESTBOOT=$2 18 | else 19 | DESTBOOT="/boot" 20 | fi 21 | 22 | if [[ $3 != "" ]] ; then 23 | DEST=$3 24 | else 25 | DEST="" 26 | fi 27 | KERNEL=kernel7 28 | 29 | ##################################################################### 30 | # Functions 31 | execute() { #STRING 32 | if [ $# != 1 ] ; then 33 | echo "ERROR: No args passed" 34 | exit 1 35 | fi 36 | cmd=$1 37 | 38 | echo "[*] EXECUTE: [$cmd]" 39 | eval "$cmd" 40 | ret=$? 41 | 42 | if [ $ret != 0 ] ; then 43 | echo "ERROR: Command exited with [$ret]" 44 | exit 1 45 | fi 46 | 47 | return 0 48 | } 49 | 50 | ##################################################################### 51 | # LOGIC! 52 | echo "INSTALL KERNEL.." 53 | 54 | execute "cd linux" 55 | execute "cp ../config /build/images/" 56 | 57 | execute "cp $DESTBOOT/$KERNEL.img $DESTBOOT/$KERNEL-backup.img" 58 | execute "cp ../pi/zImage $DESTBOOT/$KERNEL.img" 59 | execute "cp ../pi/*.dtb $DESTBOOT/" 60 | # execute "rm $DESTBOOT/overlays/*" 61 | execute "cp ../pi/overlays/*.dtb* $DESTBOOT/overlays/" 62 | execute "cp ../pi/overlays/README $DESTBOOT/overlays/" 63 | 64 | execute "rsync -avh --delete ../modules/lib/modules/* $DEST/lib/modules/" 65 | 66 | ##################################################################### 67 | # DONE 68 | echo "DONE!" 69 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/include/rtw_odm.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2013 Realtek Corporation. All rights reserved. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | ******************************************************************************/ 15 | #ifndef __RTW_ODM_H__ 16 | #define __RTW_ODM_H__ 17 | 18 | #include 19 | 20 | /* 21 | * This file provides utilities/wrappers for rtw driver to use ODM 22 | */ 23 | 24 | void rtw_odm_dbg_comp_msg(void *sel, struct adapter *adapter); 25 | void rtw_odm_dbg_comp_set(struct adapter *adapter, u64 comps); 26 | void rtw_odm_dbg_level_msg(void *sel, struct adapter *adapter); 27 | void rtw_odm_dbg_level_set(struct adapter *adapter, u32 level); 28 | 29 | void rtw_odm_ability_msg(void *sel, struct adapter *adapter); 30 | void rtw_odm_ability_set(struct adapter *adapter, u32 ability); 31 | 32 | void rtw_odm_adaptivity_parm_msg(void *sel, struct adapter *adapter); 33 | void rtw_odm_adaptivity_parm_set(struct adapter *adapter, s8 TH_L2H_ini, s8 TH_EDCCA_HL_diff, 34 | s8 IGI_Base, bool ForceEDCCA, u8 AdapEn_RSSI, u8 IGI_LowerBound); 35 | void rtw_odm_get_perpkt_rssi(void *sel, struct adapter *adapter); 36 | #endif /* __RTW_ODM_H__ */ 37 | -------------------------------------------------------------------------------- /settings/reboot_to_hdmi.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # This file originates from Kite's Circuit Sword control board project. 5 | # Author: Kite (Giles Burgess) 6 | # 7 | # THIS HEADER MUST REMAIN WITH THIS FILE AT ALL TIMES 8 | # 9 | # This firmware is free software: you can redistribute it and/or modify 10 | # it under the terms of the GNU General Public License as published by 11 | # the Free Software Foundation, either version 3 of the License, or 12 | # (at your option) any later version. 13 | # 14 | # This firmware is distributed in the hope that it will be useful, 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | # GNU General Public License for more details. 18 | # 19 | # You should have received a copy of the GNU General Public License 20 | # along with this repo. If not, see . 21 | # 22 | 23 | HDMI_SWITCHER_PATH="/home/pi/Circuit-Sword/settings/reboot_to_hdmi.py" 24 | CMD="sudo /usr/bin/python $HDMI_SWITCHER_PATH --hdmi --reboot" 25 | 26 | # Check script exists first 27 | if [ -f $HDMI_SWITCHER_PATH ]; then 28 | echo "[i] Main switcher script exists" 29 | else 30 | echo 31 | echo "=====================================" 32 | echo "[!] ERROR: The switcher file '$HDMI_SWITCHER_PATH' is missing!!" 33 | echo "=====================================" 34 | sleep 3 35 | exit 1 36 | fi 37 | 38 | # Execute it! 39 | eval "$CMD" 40 | ret=$? 41 | 42 | if [ $ret != 0 ] ; then 43 | echo 44 | echo "=====================================" 45 | echo "[!] ERROR: Command exited with '$ret'" 46 | echo "=====================================" 47 | sleep 3 48 | exit 1 49 | fi 50 | -------------------------------------------------------------------------------- /cross-build/Makefile: -------------------------------------------------------------------------------- 1 | # Latest 2 | IMG=retropie-buster-4.8-rpi2_3_zero2w 3 | IMG_URL=https://github.com/RetroPie/RetroPie-Setup/releases/download/4.8/${IMG}.img.gz 4 | KERNEL=rpi-5.15.y 5 | 6 | # Anthology's distro 7 | # IMG=retropie-buster-4.7.1-rpi2_3 8 | # IMG_URL=https://github.com/RetroPie/RetroPie-Setup/releases/download/4.7.1/${IMG}.img.gz 9 | # KERNEL=stable 10 | 11 | all: build-image 12 | 13 | clean: 14 | rm images/${IMG}_*.img 15 | 16 | docker-build db: docker-build-kernel docker-build-image 17 | 18 | .PHONY: docker-build-kernel 19 | docker-build-kernel: 20 | DOCKER_BUILDKIT=1 \ 21 | docker build --progress=plain \ 22 | --build-arg BRANCH=${KERNEL} \ 23 | --target build-kernel \ 24 | -t build-kernel-${KERNEL} \ 25 | .. 26 | 27 | .PHONY: docker-build-image 28 | docker-build-image: 29 | DOCKER_BUILDKIT=1 \ 30 | docker build --progress=plain \ 31 | --target build-image \ 32 | -t build-image \ 33 | .. 34 | 35 | images/${IMG}.img: 36 | mkdir -p images 37 | cd images; \ 38 | wget ${IMG_URL}; \ 39 | gunzip ${IMG}.img.gz 40 | 41 | .PHONY: build-kernel bk 42 | build-kernel bk images/${IMG}_${KERNEL}.img: images/${IMG}.img 43 | docker run --rm \ 44 | --name build-kernel \ 45 | --volume ${PWD}/images:/build/images \ 46 | --privileged \ 47 | build-kernel-${KERNEL} \ 48 | /bin/bash -c "./build-kernel.sh YES /build/images/${IMG}.img && mv ${IMG}_kernel.img /build/images/${IMG}_${KERNEL}.img" 49 | 50 | .PHONY: build-image bi 51 | build-image bi: images/${IMG}_${KERNEL}.img 52 | docker run --rm \ 53 | --name build-image \ 54 | --volume ${PWD}/images:/build/images \ 55 | --privileged \ 56 | build-image \ 57 | /bin/bash -c "./build-image.sh YES /build/images/${IMG}_${KERNEL}.img && mv ${IMG}_* /build/images/" 58 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/hal/odm_RegConfig8723B.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 | ******************************************************************************/ 15 | #ifndef __INC_ODM_REGCONFIG_H_8723B 16 | #define __INC_ODM_REGCONFIG_H_8723B 17 | 18 | void odm_ConfigRFReg_8723B( 19 | PDM_ODM_T pDM_Odm, 20 | u32 Addr, 21 | u32 Data, 22 | ODM_RF_RADIO_PATH_E RF_PATH, 23 | u32 RegAddr 24 | ); 25 | 26 | void odm_ConfigRF_RadioA_8723B(PDM_ODM_T pDM_Odm, u32 Addr, u32 Data); 27 | 28 | void odm_ConfigMAC_8723B(PDM_ODM_T pDM_Odm, u32 Addr, u8 Data); 29 | 30 | void odm_ConfigBB_AGC_8723B( 31 | PDM_ODM_T pDM_Odm, 32 | u32 Addr, 33 | u32 Bitmask, 34 | u32 Data 35 | ); 36 | 37 | void odm_ConfigBB_PHY_REG_PG_8723B( 38 | PDM_ODM_T pDM_Odm, 39 | u32 Band, 40 | u32 RfPath, 41 | u32 TxNum, 42 | u32 Addr, 43 | u32 Bitmask, 44 | u32 Data 45 | ); 46 | 47 | void odm_ConfigBB_PHY_8723B( 48 | PDM_ODM_T pDM_Odm, 49 | u32 Addr, 50 | u32 Bitmask, 51 | u32 Data 52 | ); 53 | 54 | void odm_ConfigBB_TXPWR_LMT_8723B( 55 | PDM_ODM_T pDM_Odm, 56 | u8 *Regulation, 57 | u8 *Band, 58 | u8 *Bandwidth, 59 | u8 *RateSection, 60 | u8 *RfPath, 61 | u8 *Channel, 62 | u8 *PowerLimit 63 | ); 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /update.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # This file originates from Kite's Circuit Sword control board project. 5 | # Author: Kite (Giles Burgess) 6 | # 7 | # THIS HEADER MUST REMAIN WITH THIS FILE AT ALL TIMES 8 | # 9 | # This firmware is free software: you can redistribute it and/or modify 10 | # it under the terms of the GNU General Public License as published by 11 | # the Free Software Foundation, either version 3 of the License, or 12 | # (at your option) any later version. 13 | # 14 | # This firmware is distributed in the hope that it will be useful, 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | # GNU General Public License for more details. 18 | # 19 | # You should have received a copy of the GNU General Public License 20 | # along with this repo. If not, see . 21 | # 22 | 23 | # THIS MUST BE RUN FROM THE GIT CURRENT DIRECTORY (cd your way there) 24 | 25 | if [ "$EUID" -ne 0 ] 26 | then echo "Please run as root (sudo)" 27 | exit 1 28 | fi 29 | 30 | if [[ $1 != "" ]] ; then 31 | BRANCH=$1 32 | else 33 | BRANCH="master" 34 | fi 35 | 36 | # Stop HUD 37 | echo "Stopping HUD.." 38 | systemctl stop cs-osd.service > /dev/null # Silience this as it may not exist 39 | systemctl stop cs-hud.service 40 | 41 | echo "Stopping CLONER.." 42 | systemctl stop dpi-cloner.service 43 | 44 | # Update git 45 | echo "Updating HUD from git.." 46 | git reset --hard HEAD 47 | git pull 48 | git checkout $BRANCH 49 | 50 | # Set permissions on the initial required 51 | chmod +x install.sh update.sh 52 | 53 | # Perform re-install 54 | echo "Performing script setup.." 55 | ./install.sh YES 56 | 57 | # Start HUD 58 | echo "Starting HUD.." 59 | systemctl start cs-hud.service 60 | 61 | # DONE 62 | echo "DONE!" 63 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/os_dep/rtw_proc.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2013 Realtek Corporation. All rights reserved. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | ******************************************************************************/ 15 | #ifndef __RTW_PROC_H__ 16 | #define __RTW_PROC_H__ 17 | 18 | #include 19 | #include 20 | 21 | struct rtw_proc_hdl { 22 | char *name; 23 | int (*show)(struct seq_file *, void *); 24 | ssize_t (*write)(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); 25 | }; 26 | 27 | #ifdef PROC_DEBUG 28 | 29 | int rtw_drv_proc_init(void); 30 | void rtw_drv_proc_deinit(void); 31 | struct proc_dir_entry *rtw_adapter_proc_init(struct net_device *dev); 32 | void rtw_adapter_proc_deinit(struct net_device *dev); 33 | void rtw_adapter_proc_replace(struct net_device *dev); 34 | 35 | #else //!PROC_DEBUG 36 | 37 | static inline int rtw_drv_proc_init(void) {return 0;} 38 | static inline void rtw_drv_proc_deinit(void) {} 39 | static inline struct proc_dir_entry *rtw_adapter_proc_init(struct net_device *dev){return NULL;} 40 | static inline void rtw_adapter_proc_deinit(struct net_device *dev){} 41 | static inline void rtw_adapter_proc_replace(struct net_device *dev){} 42 | 43 | #endif //!PROC_DEBUG 44 | 45 | #endif //__RTW_PROC_H__ 46 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/hal/odm_debug.c: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | ******************************************************************************/ 15 | 16 | #include "odm_precomp.h" 17 | 18 | void ODM_InitDebugSetting(PDM_ODM_T pDM_Odm) 19 | { 20 | pDM_Odm->DebugLevel = ODM_DBG_LOUD; 21 | 22 | pDM_Odm->DebugComponents = 23 | /* BB Functions */ 24 | /* ODM_COMP_DIG | */ 25 | /* ODM_COMP_RA_MASK | */ 26 | /* ODM_COMP_DYNAMIC_TXPWR | */ 27 | /* ODM_COMP_FA_CNT | */ 28 | /* ODM_COMP_RSSI_MONITOR | */ 29 | /* ODM_COMP_CCK_PD | */ 30 | /* ODM_COMP_ANT_DIV | */ 31 | /* ODM_COMP_PWR_SAVE | */ 32 | /* ODM_COMP_PWR_TRAIN | */ 33 | /* ODM_COMP_RATE_ADAPTIVE | */ 34 | /* ODM_COMP_PATH_DIV | */ 35 | /* ODM_COMP_DYNAMIC_PRICCA | */ 36 | /* ODM_COMP_RXHP | */ 37 | /* ODM_COMP_MP | */ 38 | /* ODM_COMP_CFO_TRACKING | */ 39 | 40 | /* MAC Functions */ 41 | /* ODM_COMP_EDCA_TURBO | */ 42 | /* ODM_COMP_EARLY_MODE | */ 43 | /* RF Functions */ 44 | /* ODM_COMP_TX_PWR_TRACK | */ 45 | /* ODM_COMP_RX_GAIN_TRACK | */ 46 | /* ODM_COMP_CALIBRATION | */ 47 | /* Common */ 48 | /* ODM_COMP_COMMON | */ 49 | /* ODM_COMP_INIT | */ 50 | /* ODM_COMP_PSD | */ 51 | 0; 52 | } 53 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/hal/HalHWImg8723B_BB.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | ******************************************************************************/ 15 | 16 | #ifndef __INC_MP_BB_HW_IMG_8723B_H 17 | #define __INC_MP_BB_HW_IMG_8723B_H 18 | 19 | 20 | /****************************************************************************** 21 | * AGC_TAB.TXT 22 | ******************************************************************************/ 23 | 24 | void 25 | ODM_ReadAndConfig_MP_8723B_AGC_TAB(/* TC: Test Chip, MP: MP Chip */ 26 | PDM_ODM_T pDM_Odm 27 | ); 28 | 29 | /****************************************************************************** 30 | * PHY_REG.TXT 31 | ******************************************************************************/ 32 | 33 | void 34 | ODM_ReadAndConfig_MP_8723B_PHY_REG(/* TC: Test Chip, MP: MP Chip */ 35 | PDM_ODM_T pDM_Odm 36 | ); 37 | 38 | /****************************************************************************** 39 | * PHY_REG_PG.TXT 40 | ******************************************************************************/ 41 | 42 | void 43 | ODM_ReadAndConfig_MP_8723B_PHY_REG_PG(/* TC: Test Chip, MP: MP Chip */ 44 | PDM_ODM_T pDM_Odm 45 | ); 46 | u32 ODM_GetVersion_MP_8723B_PHY_REG_PG(void); 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/include/rtw_ioctl_set.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | ******************************************************************************/ 15 | #ifndef __RTW_IOCTL_SET_H_ 16 | #define __RTW_IOCTL_SET_H_ 17 | 18 | 19 | typedef u8 NDIS_802_11_PMKID_VALUE[16]; 20 | 21 | typedef struct _BSSIDInfo { 22 | NDIS_802_11_MAC_ADDRESS BSSID; 23 | NDIS_802_11_PMKID_VALUE PMKID; 24 | } BSSIDInfo, *PBSSIDInfo; 25 | 26 | 27 | u8 rtw_set_802_11_authentication_mode(struct adapter *pdapter, enum NDIS_802_11_AUTHENTICATION_MODE authmode); 28 | u8 rtw_set_802_11_bssid(struct adapter *padapter, u8 *bssid); 29 | u8 rtw_set_802_11_add_wep(struct adapter *padapter, struct ndis_802_11_wep * wep); 30 | u8 rtw_set_802_11_disassociate(struct adapter *padapter); 31 | u8 rtw_set_802_11_bssid_list_scan(struct adapter *padapter, struct ndis_802_11_ssid *pssid, int ssid_max_num); 32 | u8 rtw_set_802_11_infrastructure_mode(struct adapter *padapter, enum NDIS_802_11_NETWORK_INFRASTRUCTURE networktype); 33 | u8 rtw_set_802_11_ssid(struct adapter *padapter, struct ndis_802_11_ssid * ssid); 34 | u8 rtw_set_802_11_connect(struct adapter *padapter, u8 *bssid, struct ndis_802_11_ssid *ssid); 35 | 36 | u8 rtw_validate_bssid(u8 *bssid); 37 | u8 rtw_validate_ssid(struct ndis_802_11_ssid *ssid); 38 | 39 | u16 rtw_get_cur_max_rate(struct adapter *adapter); 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/Makefile: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: GPL-2.0 2 | r8723bs-y = \ 3 | core/rtw_ap.o \ 4 | core/rtw_btcoex.o \ 5 | core/rtw_cmd.o \ 6 | core/rtw_debug.o \ 7 | core/rtw_efuse.o \ 8 | core/rtw_io.o \ 9 | core/rtw_ioctl_set.o \ 10 | core/rtw_ieee80211.o \ 11 | core/rtw_mlme.o \ 12 | core/rtw_mlme_ext.o \ 13 | core/rtw_odm.o \ 14 | core/rtw_pwrctrl.o \ 15 | core/rtw_recv.o \ 16 | core/rtw_rf.o \ 17 | core/rtw_security.o \ 18 | core/rtw_sta_mgt.o \ 19 | core/rtw_wlan_util.o \ 20 | core/rtw_xmit.o \ 21 | hal/hal_intf.o \ 22 | hal/hal_com.o \ 23 | hal/hal_com_phycfg.o \ 24 | hal/hal_btcoex.o \ 25 | hal/hal_sdio.o \ 26 | hal/Hal8723BPwrSeq.o \ 27 | hal/HalPhyRf.o \ 28 | hal/HalPwrSeqCmd.o \ 29 | hal/odm.o \ 30 | hal/odm_CfoTracking.o \ 31 | hal/odm_debug.o \ 32 | hal/odm_DIG.o \ 33 | hal/odm_DynamicBBPowerSaving.o \ 34 | hal/odm_DynamicTxPower.o \ 35 | hal/odm_EdcaTurboCheck.o \ 36 | hal/odm_HWConfig.o \ 37 | hal/odm_NoiseMonitor.o \ 38 | hal/odm_PathDiv.o \ 39 | hal/odm_RegConfig8723B.o \ 40 | hal/odm_RTL8723B.o \ 41 | hal/rtl8723b_cmd.o \ 42 | hal/rtl8723b_dm.o \ 43 | hal/rtl8723b_hal_init.o \ 44 | hal/rtl8723b_phycfg.o \ 45 | hal/rtl8723b_rf6052.o \ 46 | hal/rtl8723b_rxdesc.o \ 47 | hal/rtl8723bs_recv.o \ 48 | hal/rtl8723bs_xmit.o \ 49 | hal/sdio_halinit.o \ 50 | hal/sdio_ops.o \ 51 | hal/HalBtc8723b1Ant.o \ 52 | hal/HalBtc8723b2Ant.o \ 53 | hal/HalHWImg8723B_BB.o \ 54 | hal/HalHWImg8723B_MAC.o \ 55 | hal/HalHWImg8723B_RF.o \ 56 | hal/HalPhyRf_8723B.o \ 57 | os_dep/ioctl_cfg80211.o \ 58 | os_dep/ioctl_linux.o \ 59 | os_dep/mlme_linux.o \ 60 | os_dep/osdep_service.o \ 61 | os_dep/os_intfs.o \ 62 | os_dep/recv_linux.o \ 63 | os_dep/rtw_proc.o \ 64 | os_dep/sdio_intf.o \ 65 | os_dep/sdio_ops_linux.o \ 66 | os_dep/wifi_regd.o \ 67 | os_dep/xmit_linux.o 68 | 69 | obj-$(CONFIG_RTL8723BS) := r8723bs.o 70 | 71 | ccflags-y += -I$(src)/include -I$(src)/hal 72 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/hal/HalHWImg8723B_RF.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | ******************************************************************************/ 15 | 16 | #ifndef __INC_MP_RF_HW_IMG_8723B_H 17 | #define __INC_MP_RF_HW_IMG_8723B_H 18 | 19 | 20 | /****************************************************************************** 21 | * RadioA.TXT 22 | ******************************************************************************/ 23 | 24 | void 25 | ODM_ReadAndConfig_MP_8723B_RadioA(/* TC: Test Chip, MP: MP Chip */ 26 | PDM_ODM_T pDM_Odm 27 | ); 28 | 29 | /****************************************************************************** 30 | * TxPowerTrack_SDIO.TXT 31 | ******************************************************************************/ 32 | 33 | void 34 | ODM_ReadAndConfig_MP_8723B_TxPowerTrack_SDIO(/* TC: Test Chip, MP: MP Chip */ 35 | PDM_ODM_T pDM_Odm 36 | ); 37 | u32 ODM_GetVersion_MP_8723B_TxPowerTrack_SDIO(void); 38 | 39 | /****************************************************************************** 40 | * TXPWR_LMT.TXT 41 | ******************************************************************************/ 42 | 43 | void 44 | ODM_ReadAndConfig_MP_8723B_TXPWR_LMT(/* TC: Test Chip, MP: MP Chip */ 45 | PDM_ODM_T pDM_Odm 46 | ); 47 | u32 ODM_GetVersion_MP_8723B_TXPWR_LMT(void); 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/include/autoconf.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2012 Realtek Corporation. All rights reserved. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | ******************************************************************************/ 15 | 16 | 17 | /* 18 | * Automatically generated C config: don't edit 19 | */ 20 | 21 | /* 22 | * Functions Config 23 | */ 24 | /* define DEBUG_CFG80211 */ 25 | 26 | #ifndef CONFIG_WIRELESS_EXT 27 | #error CONFIG_WIRELESS_EXT needs to be enabled for this driver to work 28 | #endif 29 | 30 | /* 31 | * Auto Config Section 32 | */ 33 | #define LPS_RPWM_WAIT_MS 300 34 | #ifndef DISABLE_BB_RF 35 | #define DISABLE_BB_RF 0 36 | #endif 37 | 38 | #if DISABLE_BB_RF 39 | #define HAL_MAC_ENABLE 0 40 | #define HAL_BB_ENABLE 0 41 | #define HAL_RF_ENABLE 0 42 | #else 43 | #define HAL_MAC_ENABLE 1 44 | #define HAL_BB_ENABLE 1 45 | #define HAL_RF_ENABLE 1 46 | #endif 47 | 48 | /* 49 | * Platform dependent 50 | */ 51 | #define WAKEUP_GPIO_IDX 12 /* WIFI Chip Side */ 52 | #ifdef CONFIG_WOWLAN 53 | #define CONFIG_GTK_OL 54 | #endif /* CONFIG_WOWLAN */ 55 | 56 | /* 57 | * Debug Related Config 58 | */ 59 | #undef DEBUG 60 | 61 | #ifdef DEBUG 62 | #define DBG 1 /* for ODM & BTCOEX debug */ 63 | /*#define DEBUG_RTL871X */ 64 | #else /* !DEBUG */ 65 | #define DBG 0 /* for ODM & BTCOEX debug */ 66 | #endif /* !DEBUG */ 67 | 68 | #ifdef CONFIG_PROC_FS 69 | #define PROC_DEBUG 70 | #endif 71 | 72 | /* define DBG_XMIT_BUF */ 73 | /* define DBG_XMIT_BUF_EXT */ 74 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/include/sdio_ops_linux.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | ******************************************************************************/ 15 | #ifndef __SDIO_OPS_LINUX_H__ 16 | #define __SDIO_OPS_LINUX_H__ 17 | 18 | #define SDIO_ERR_VAL8 0xEA 19 | #define SDIO_ERR_VAL16 0xEAEA 20 | #define SDIO_ERR_VAL32 0xEAEAEAEA 21 | 22 | u8 sd_f0_read8(struct intf_hdl *pintfhdl, u32 addr, s32 *err); 23 | 24 | s32 _sd_cmd52_read(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *pdata); 25 | s32 _sd_cmd52_write(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *pdata); 26 | s32 sd_cmd52_read(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *pdata); 27 | s32 sd_cmd52_write(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *pdata); 28 | 29 | u8 sd_read8(struct intf_hdl *pintfhdl, u32 addr, s32 *err); 30 | u32 sd_read32(struct intf_hdl *pintfhdl, u32 addr, s32 *err); 31 | s32 _sd_read(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, void *pdata); 32 | s32 sd_read(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, void *pdata); 33 | void sd_write8(struct intf_hdl *pintfhdl, u32 addr, u8 v, s32 *err); 34 | void sd_write32(struct intf_hdl *pintfhdl, u32 addr, u32 v, s32 *err); 35 | s32 _sd_write(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, void *pdata); 36 | s32 sd_write(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, void *pdata); 37 | 38 | 39 | void rtw_sdio_set_irq_thd(struct dvobj_priv *dvobj, void *thd_hdl); 40 | #endif 41 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/hal/HalPhyRf.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 | ******************************************************************************/ 15 | 16 | #ifndef __HAL_PHY_RF_H__ 17 | #define __HAL_PHY_RF_H__ 18 | 19 | typedef enum _SPUR_CAL_METHOD { 20 | PLL_RESET, 21 | AFE_PHASE_SEL 22 | } SPUR_CAL_METHOD; 23 | 24 | typedef enum _PWRTRACK_CONTROL_METHOD { 25 | BBSWING, 26 | TXAGC, 27 | MIX_MODE 28 | } PWRTRACK_METHOD; 29 | 30 | typedef void (*FuncSetPwr)(PDM_ODM_T, PWRTRACK_METHOD, u8, u8); 31 | typedef void (*FuncIQK)(PDM_ODM_T, u8, u8, u8); 32 | typedef void (*FuncLCK)(PDM_ODM_T); 33 | typedef void (*FuncSwing)(PDM_ODM_T, u8 **, u8 **, u8 **, u8 **); 34 | 35 | typedef struct _TXPWRTRACK_CFG { 36 | u8 SwingTableSize_CCK; 37 | u8 SwingTableSize_OFDM; 38 | u8 Threshold_IQK; 39 | u8 AverageThermalNum; 40 | u8 RfPathCount; 41 | u32 ThermalRegAddr; 42 | FuncSetPwr ODM_TxPwrTrackSetPwr; 43 | FuncIQK DoIQK; 44 | FuncLCK PHY_LCCalibrate; 45 | FuncSwing GetDeltaSwingTable; 46 | } TXPWRTRACK_CFG, *PTXPWRTRACK_CFG; 47 | 48 | void ConfigureTxpowerTrack(PDM_ODM_T pDM_Odm, PTXPWRTRACK_CFG pConfig); 49 | 50 | 51 | void ODM_ClearTxPowerTrackingState(PDM_ODM_T pDM_Odm); 52 | 53 | void ODM_TXPowerTrackingCallback_ThermalMeter(struct adapter *Adapter); 54 | 55 | 56 | 57 | #define ODM_TARGET_CHNL_NUM_2G_5G 59 58 | 59 | 60 | u8 ODM_GetRightChnlPlaceforIQK(u8 chnl); 61 | 62 | 63 | #endif /* #ifndef __HAL_PHY_RF_H__ */ 64 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/hal/odm_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 | ******************************************************************************/ 15 | 16 | #ifndef __ODM_PRECOMP_H__ 17 | #define __ODM_PRECOMP_H__ 18 | 19 | #include "odm_types.h" 20 | 21 | #define TEST_FALG___ 1 22 | 23 | /* 2 Config Flags and Structs - defined by each ODM Type */ 24 | 25 | /* include */ 26 | /* include */ 27 | /* include */ 28 | /* include */ 29 | /* include */ 30 | #define BEAMFORMING_SUPPORT 0 31 | 32 | /* 2 Hardware Parameter Files */ 33 | 34 | /* 2 OutSrc Header Files */ 35 | 36 | #include "odm.h" 37 | #include "odm_HWConfig.h" 38 | #include "odm_debug.h" 39 | #include "odm_RegDefine11N.h" 40 | #include "odm_AntDiv.h" 41 | #include "odm_EdcaTurboCheck.h" 42 | #include "odm_DIG.h" 43 | #include "odm_PathDiv.h" 44 | #include "odm_DynamicBBPowerSaving.h" 45 | #include "odm_DynamicTxPower.h" 46 | #include "odm_CfoTracking.h" 47 | #include "odm_NoiseMonitor.h" 48 | #include "HalPhyRf.h" 49 | #include "HalPhyRf_8723B.h"/* for IQK, LCK, Power-tracking */ 50 | #include "rtl8723b_hal.h" 51 | #include "odm_interface.h" 52 | #include "odm_reg.h" 53 | #include "HalHWImg8723B_MAC.h" 54 | #include "HalHWImg8723B_RF.h" 55 | #include "HalHWImg8723B_BB.h" 56 | #include "Hal8723BReg.h" 57 | #include "odm_RTL8723B.h" 58 | #include "odm_RegConfig8723B.h" 59 | 60 | #endif /* __ODM_PRECOMP_H__ */ 61 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/include/recv_osdep.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | ******************************************************************************/ 15 | #ifndef __RECV_OSDEP_H_ 16 | #define __RECV_OSDEP_H_ 17 | 18 | 19 | extern sint _rtw_init_recv_priv(struct recv_priv *precvpriv, struct adapter *padapter); 20 | extern void _rtw_free_recv_priv (struct recv_priv *precvpriv); 21 | 22 | 23 | extern s32 rtw_recv_entry(union recv_frame *precv_frame); 24 | extern int rtw_recv_indicatepkt(struct adapter *adapter, union recv_frame *precv_frame); 25 | extern void rtw_recv_returnpacket(_nic_hdl cnxt, _pkt *preturnedpkt); 26 | 27 | extern void rtw_handle_tkip_mic_err(struct adapter *padapter, u8 bgroup); 28 | 29 | int rtw_init_recv_priv(struct recv_priv *precvpriv, struct adapter *padapter); 30 | void rtw_free_recv_priv (struct recv_priv *precvpriv); 31 | 32 | 33 | int rtw_os_recv_resource_alloc(struct adapter *padapter, union recv_frame *precvframe); 34 | void rtw_os_recv_resource_free(struct recv_priv *precvpriv); 35 | 36 | 37 | void rtw_os_free_recvframe(union recv_frame *precvframe); 38 | 39 | 40 | int rtw_os_recvbuf_resource_free(struct adapter *padapter, struct recv_buf *precvbuf); 41 | 42 | _pkt *rtw_os_alloc_msdu_pkt(union recv_frame *prframe, u16 nSubframe_Length, u8 *pdata); 43 | void rtw_os_recv_indicate_pkt(struct adapter *padapter, _pkt *pkt, struct rx_pkt_attrib *pattrib); 44 | 45 | void rtw_init_recv_timer(struct recv_reorder_ctrl *preorder_ctrl); 46 | 47 | 48 | #endif /* */ 49 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/hal/odm_interface.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 | ******************************************************************************/ 15 | 16 | 17 | #ifndef __ODM_INTERFACE_H__ 18 | #define __ODM_INTERFACE_H__ 19 | 20 | 21 | 22 | /* =========== Constant/Structure/Enum/... Define */ 23 | 24 | /* =========== Macro Define */ 25 | 26 | #define _reg_all(_name) ODM_##_name 27 | #define _reg_ic(_name, _ic) ODM_##_name##_ic 28 | #define _bit_all(_name) BIT_##_name 29 | #define _bit_ic(_name, _ic) BIT_##_name##_ic 30 | 31 | /*=================================== 32 | 33 | #define ODM_REG_DIG_11N 0xC50 34 | #define ODM_REG_DIG_11AC 0xDDD 35 | 36 | ODM_REG(DIG, _pDM_Odm) 37 | =====================================*/ 38 | 39 | #define _reg_11N(_name) ODM_REG_##_name##_11N 40 | #define _bit_11N(_name) ODM_BIT_##_name##_11N 41 | 42 | #define _cat(_name, _ic_type, _func) _func##_11N(_name) 43 | 44 | /* _name: name of register or bit. */ 45 | /* Example: "ODM_REG(R_A_AGC_CORE1, pDM_Odm)" */ 46 | /* gets "ODM_R_A_AGC_CORE1" or "ODM_R_A_AGC_CORE1_8192C", depends on SupportICType. */ 47 | #define ODM_REG(_name, _pDM_Odm) _cat(_name, _pDM_Odm->SupportICType, _reg) 48 | #define ODM_BIT(_name, _pDM_Odm) _cat(_name, _pDM_Odm->SupportICType, _bit) 49 | 50 | typedef enum _ODM_H2C_CMD { 51 | ODM_H2C_RSSI_REPORT = 0, 52 | ODM_H2C_PSD_RESULT = 1, 53 | ODM_H2C_PathDiv = 2, 54 | ODM_H2C_WIFI_CALIBRATION = 3, 55 | ODM_MAX_H2CCMD 56 | } ODM_H2C_CMD; 57 | 58 | 59 | #endif /* __ODM_INTERFACE_H__ */ 60 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/include/rtw_br_ext.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | ******************************************************************************/ 15 | #ifndef _RTW_BR_EXT_H_ 16 | #define _RTW_BR_EXT_H_ 17 | 18 | #define MACADDRLEN 6 19 | #define _DEBUG_ERR DBG_8192C 20 | #define _DEBUG_INFO /* DBG_8192C */ 21 | #define DEBUG_WARN DBG_8192C 22 | #define DEBUG_INFO /* DBG_8192C */ 23 | #define DEBUG_ERR DBG_8192C 24 | /* define GET_MY_HWADDR ((GET_MIB(priv))->dot11OperationEntry.hwaddr) */ 25 | #define GET_MY_HWADDR(padapter) ((padapter)->eeprompriv.mac_addr) 26 | 27 | #define NAT25_HASH_BITS 4 28 | #define NAT25_HASH_SIZE (1 << NAT25_HASH_BITS) 29 | #define NAT25_AGEING_TIME 300 30 | 31 | #define MAX_NETWORK_ADDR_LEN 17 32 | 33 | struct nat25_network_db_entry 34 | { 35 | struct nat25_network_db_entry *next_hash; 36 | struct nat25_network_db_entry **pprev_hash; 37 | atomic_t use_count; 38 | unsigned char macAddr[6]; 39 | unsigned long ageing_timer; 40 | unsigned char networkAddr[MAX_NETWORK_ADDR_LEN]; 41 | }; 42 | 43 | enum NAT25_METHOD { 44 | NAT25_MIN, 45 | NAT25_CHECK, 46 | NAT25_INSERT, 47 | NAT25_LOOKUP, 48 | NAT25_PARSE, 49 | NAT25_MAX 50 | }; 51 | 52 | struct br_ext_info { 53 | unsigned int nat25_disable; 54 | unsigned int macclone_enable; 55 | unsigned int dhcp_bcst_disable; 56 | int addPPPoETag; /* 1: Add PPPoE relay-SID, 0: disable */ 57 | unsigned char nat25_dmzMac[MACADDRLEN]; 58 | unsigned int nat25sc_disable; 59 | }; 60 | 61 | void nat25_db_cleanup(struct adapter *priv); 62 | 63 | #endif /* _RTW_BR_EXT_H_ */ 64 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/include/xmit_osdep.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | ******************************************************************************/ 15 | #ifndef __XMIT_OSDEP_H_ 16 | #define __XMIT_OSDEP_H_ 17 | 18 | 19 | struct pkt_file { 20 | _pkt *pkt; 21 | __kernel_size_t pkt_len; /* the remainder length of the open_file */ 22 | _buffer *cur_buffer; 23 | u8 *buf_start; 24 | u8 *cur_addr; 25 | __kernel_size_t buf_len; 26 | }; 27 | 28 | #define NR_XMITFRAME 256 29 | 30 | struct xmit_priv; 31 | struct pkt_attrib; 32 | struct sta_xmit_priv; 33 | struct xmit_frame; 34 | struct xmit_buf; 35 | 36 | extern int _rtw_xmit_entry(_pkt *pkt, _nic_hdl pnetdev); 37 | extern int rtw_xmit_entry(_pkt *pkt, _nic_hdl pnetdev); 38 | 39 | void rtw_os_xmit_schedule(struct adapter *padapter); 40 | 41 | int rtw_os_xmit_resource_alloc(struct adapter *padapter, struct xmit_buf *pxmitbuf, u32 alloc_sz, u8 flag); 42 | void rtw_os_xmit_resource_free(struct adapter *padapter, struct xmit_buf *pxmitbuf, u32 free_sz, u8 flag); 43 | 44 | extern void rtw_set_tx_chksum_offload(_pkt *pkt, struct pkt_attrib *pattrib); 45 | 46 | extern uint rtw_remainder_len(struct pkt_file *pfile); 47 | extern void _rtw_open_pktfile(_pkt *pkt, struct pkt_file *pfile); 48 | extern uint _rtw_pktfile_read (struct pkt_file *pfile, u8 *rmem, uint rlen); 49 | extern sint rtw_endofpktfile (struct pkt_file *pfile); 50 | 51 | extern void rtw_os_pkt_complete(struct adapter *padapter, _pkt *pkt); 52 | extern void rtw_os_xmit_complete(struct adapter *padapter, struct xmit_frame *pxframe); 53 | 54 | #endif /* __XMIT_OSDEP_H_ */ 55 | -------------------------------------------------------------------------------- /settings/autostart.sh: -------------------------------------------------------------------------------- 1 | # 2 | # This file originates from Kite's Circuit Sword control board project. 3 | # Author: Kite (Giles Burgess) 4 | # 5 | # THIS HEADER MUST REMAIN WITH THIS FILE AT ALL TIMES 6 | # 7 | # This firmware is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation, either version 3 of the License, or 10 | # (at your option) any later version. 11 | # 12 | # This firmware is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU General Public License 18 | # along with this repo. If not, see . 19 | # 20 | 21 | # This file exists in '/opt/retropie/configs/all/autostart.sh' 22 | 23 | # Restart to hdmi on boot to fix any changes to file 24 | sudo /usr/bin/python /home/pi/Circuit-Sword/settings/reboot_to_hdmi.py --check 25 | 26 | # Post-install script 27 | POSTINSTALL="/usr/local/sbin/post-install.sh" 28 | if [ -x $POSTINSTALL ]; then 29 | echo "Starting POSTINSTALL.." 30 | sudo $POSTINSTALL 31 | if [ $? -eq 0 ] ; then 32 | sudo rm $POSTINSTALL 33 | fi 34 | fi 35 | 36 | # Load config file and action 37 | CONFIGFILE="/boot/config-cs.txt" 38 | if [ -f $CONFIGFILE ]; then 39 | 40 | source $CONFIGFILE 41 | 42 | if [[ -n "$STARTUPEXEC" ]] ; then 43 | echo "Starting STARTUPEXEC.." 44 | $STARTUPEXEC & 45 | fi 46 | 47 | if [[ "$CLONER" == "ON" ]] ; then 48 | if [[ $(tvservice -s | grep LCD) ]] ; then 49 | echo "Starting CLONER.." 50 | sudo systemctl start dpi-cloner.service 51 | fi 52 | fi 53 | 54 | if [[ "$MODE" == "TESTER" && -n "$TESTER" ]] ; then 55 | echo "Starting TESTER.." 56 | python $TESTER 57 | elif [ "$MODE" == "SHELL" ] ; then 58 | echo "Starting SHELL.." 59 | exit 0 60 | else 61 | echo "Starting EMULATIONSTATION.." 62 | emulationstation #auto 63 | fi 64 | 65 | else 66 | 67 | echo "Starting EMULATIONSTATION.." 68 | emulationstation #auto 69 | 70 | fi 71 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/core/rtw_rf.c: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | ******************************************************************************/ 15 | #define _RTW_RF_C_ 16 | 17 | #include 18 | 19 | 20 | struct ch_freq { 21 | u32 channel; 22 | u32 frequency; 23 | }; 24 | 25 | static struct ch_freq ch_freq_map[] = { 26 | {1, 2412}, {2, 2417}, {3, 2422}, {4, 2427}, {5, 2432}, 27 | {6, 2437}, {7, 2442}, {8, 2447}, {9, 2452}, {10, 2457}, 28 | {11, 2462}, {12, 2467}, {13, 2472}, {14, 2484}, 29 | /* UNII */ 30 | {36, 5180}, {40, 5200}, {44, 5220}, {48, 5240}, {52, 5260}, 31 | {56, 5280}, {60, 5300}, {64, 5320}, {149, 5745}, {153, 5765}, 32 | {157, 5785}, {161, 5805}, {165, 5825}, {167, 5835}, {169, 5845}, 33 | {171, 5855}, {173, 5865}, 34 | /* HiperLAN2 */ 35 | {100, 5500}, {104, 5520}, {108, 5540}, {112, 5560}, {116, 5580}, 36 | {120, 5600}, {124, 5620}, {128, 5640}, {132, 5660}, {136, 5680}, 37 | {140, 5700}, 38 | /* Japan MMAC */ 39 | {34, 5170}, {38, 5190}, {42, 5210}, {46, 5230}, 40 | /* Japan */ 41 | {184, 4920}, {188, 4940}, {192, 4960}, {196, 4980}, 42 | {208, 5040},/* Japan, means J08 */ 43 | {212, 5060},/* Japan, means J12 */ 44 | {216, 5080},/* Japan, means J16 */ 45 | }; 46 | 47 | static int ch_freq_map_num = (sizeof(ch_freq_map) / sizeof(struct ch_freq)); 48 | 49 | u32 rtw_ch2freq(u32 channel) 50 | { 51 | u8 i; 52 | u32 freq = 0; 53 | 54 | for (i = 0; i < ch_freq_map_num; i++) { 55 | if (channel == ch_freq_map[i].channel) { 56 | freq = ch_freq_map[i].frequency; 57 | break; 58 | } 59 | } 60 | if (i == ch_freq_map_num) 61 | freq = 2412; 62 | 63 | return freq; 64 | } 65 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/hal/HalPhyRf_8723B.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 | ******************************************************************************/ 15 | 16 | #ifndef __HAL_PHY_RF_8723B_H__ 17 | #define __HAL_PHY_RF_8723B_H__ 18 | 19 | /*--------------------------Define Parameters-------------------------------*/ 20 | #define IQK_DELAY_TIME_8723B 20 /* ms */ 21 | #define IQK_DEFERRED_TIME_8723B 4 22 | #define index_mapping_NUM_8723B 15 23 | #define AVG_THERMAL_NUM_8723B 4 24 | #define RF_T_METER_8723B 0x42 /* */ 25 | 26 | 27 | void ConfigureTxpowerTrack_8723B(PTXPWRTRACK_CFG pConfig); 28 | 29 | void DoIQK_8723B( 30 | PDM_ODM_T pDM_Odm, 31 | u8 DeltaThermalIndex, 32 | u8 ThermalValue, 33 | u8 Threshold 34 | ); 35 | 36 | void ODM_TxPwrTrackSetPwr_8723B( 37 | PDM_ODM_T pDM_Odm, 38 | PWRTRACK_METHOD Method, 39 | u8 RFPath, 40 | u8 ChannelMappedIndex 41 | ); 42 | 43 | /* 1 7. IQK */ 44 | void PHY_IQCalibrate_8723B( 45 | struct adapter *Adapter, 46 | bool bReCovery, 47 | bool bRestore, 48 | bool Is2ant, 49 | u8 RF_Path 50 | ); 51 | 52 | void ODM_SetIQCbyRFpath(PDM_ODM_T pDM_Odm, u32 RFpath); 53 | 54 | /* */ 55 | /* LC calibrate */ 56 | /* */ 57 | void PHY_LCCalibrate_8723B(PDM_ODM_T pDM_Odm); 58 | 59 | /* */ 60 | /* AP calibrate */ 61 | /* */ 62 | void PHY_DigitalPredistortion_8723B(struct adapter *padapter); 63 | 64 | 65 | void _PHY_SaveADDARegisters_8723B( 66 | struct adapter *padapter, 67 | u32 *ADDAReg, 68 | u32 *ADDABackup, 69 | u32 RegisterNum 70 | ); 71 | 72 | void _PHY_PathADDAOn_8723B( 73 | struct adapter *padapter, 74 | u32 *ADDAReg, 75 | bool isPathAOn, 76 | bool is2T 77 | ); 78 | 79 | void _PHY_MACSettingCalibration_8723B( 80 | struct adapter *padapter, u32 *MACReg, u32 *MACBackup 81 | ); 82 | 83 | #endif /* #ifndef __HAL_PHY_RF_8188E_H__ */ 84 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/include/sdio_ops.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | ******************************************************************************/ 15 | #ifndef __SDIO_OPS_H__ 16 | #define __SDIO_OPS_H__ 17 | 18 | 19 | #include 20 | 21 | extern void sdio_set_intf_ops(struct adapter *padapter, struct _io_ops *pops); 22 | 23 | /* extern void sdio_func1cmd52_read(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *rmem); */ 24 | /* extern void sdio_func1cmd52_write(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *wmem); */ 25 | extern u8 SdioLocalCmd52Read1Byte(struct adapter *padapter, u32 addr); 26 | extern void SdioLocalCmd52Write1Byte(struct adapter *padapter, u32 addr, u8 v); 27 | extern s32 sdio_local_read(struct adapter *padapter, u32 addr, u32 cnt, u8 *pbuf); 28 | extern s32 sdio_local_write(struct adapter *padapter, u32 addr, u32 cnt, u8 *pbuf); 29 | 30 | u32 _sdio_read32(struct adapter *padapter, u32 addr); 31 | s32 _sdio_write32(struct adapter *padapter, u32 addr, u32 val); 32 | 33 | extern void sd_int_hdl(struct adapter *padapter); 34 | extern u8 CheckIPSStatus(struct adapter *padapter); 35 | 36 | #if defined(CONFIG_WOWLAN) || defined(CONFIG_AP_WOWLAN) 37 | extern u8 RecvOnePkt(struct adapter *padapter, u32 size); 38 | #endif /* CONFIG_WOWLAN */ 39 | extern void InitInterrupt8723BSdio(struct adapter *padapter); 40 | extern void InitSysInterrupt8723BSdio(struct adapter *padapter); 41 | extern void EnableInterrupt8723BSdio(struct adapter *padapter); 42 | extern void DisableInterrupt8723BSdio(struct adapter *padapter); 43 | extern u8 HalQueryTxBufferStatus8723BSdio(struct adapter *padapter); 44 | extern u8 HalQueryTxOQTBufferStatus8723BSdio(struct adapter *padapter); 45 | #if defined(CONFIG_WOWLAN) || defined(CONFIG_AP_WOWLAN) 46 | extern void ClearInterrupt8723BSdio(struct adapter *padapter); 47 | #endif /* CONFIG_WOWLAN */ 48 | 49 | #endif /* !__SDIO_OPS_H__ */ 50 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/include/Hal8723BPhyReg.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 | ******************************************************************************/ 15 | #ifndef __INC_HAL8723BPHYREG_H__ 16 | #define __INC_HAL8723BPHYREG_H__ 17 | 18 | #include 19 | 20 | /* BB Register Definition */ 21 | /* */ 22 | /* 4. Page9(0x900) */ 23 | /* */ 24 | #define rDPDT_control 0x92c 25 | #define rfe_ctrl_anta_src 0x930 26 | #define rS0S1_PathSwitch 0x948 27 | #define AGC_table_select 0xb2c 28 | 29 | /* */ 30 | /* PageB(0xB00) */ 31 | /* */ 32 | #define rPdp_AntA 0xb00 33 | #define rPdp_AntA_4 0xb04 34 | #define rPdp_AntA_8 0xb08 35 | #define rPdp_AntA_C 0xb0c 36 | #define rPdp_AntA_10 0xb10 37 | #define rPdp_AntA_14 0xb14 38 | #define rPdp_AntA_18 0xb18 39 | #define rPdp_AntA_1C 0xb1c 40 | #define rPdp_AntA_20 0xb20 41 | #define rPdp_AntA_24 0xb24 42 | 43 | #define rConfig_Pmpd_AntA 0xb28 44 | #define rConfig_ram64x16 0xb2c 45 | 46 | #define rBndA 0xb30 47 | #define rHssiPar 0xb34 48 | 49 | #define rConfig_AntA 0xb68 50 | #define rConfig_AntB 0xb6c 51 | 52 | #define rPdp_AntB 0xb70 53 | #define rPdp_AntB_4 0xb74 54 | #define rPdp_AntB_8 0xb78 55 | #define rPdp_AntB_C 0xb7c 56 | #define rPdp_AntB_10 0xb80 57 | #define rPdp_AntB_14 0xb84 58 | #define rPdp_AntB_18 0xb88 59 | #define rPdp_AntB_1C 0xb8c 60 | #define rPdp_AntB_20 0xb90 61 | #define rPdp_AntB_24 0xb94 62 | 63 | #define rConfig_Pmpd_AntB 0xb98 64 | 65 | #define rBndB 0xba0 66 | 67 | #define rAPK 0xbd8 68 | #define rPm_Rx0_AntA 0xbdc 69 | #define rPm_Rx1_AntA 0xbe0 70 | #define rPm_Rx2_AntA 0xbe4 71 | #define rPm_Rx3_AntA 0xbe8 72 | #define rPm_Rx0_AntB 0xbec 73 | #define rPm_Rx1_AntB 0xbf0 74 | #define rPm_Rx2_AntB 0xbf4 75 | #define rPm_Rx3_AntB 0xbf8 76 | 77 | #endif 78 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/hal/odm_AntDiv.c: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | ******************************************************************************/ 15 | 16 | //============================================================ 17 | // include files 18 | //============================================================ 19 | 20 | #include "odm_precomp.h" 21 | 22 | //====================================================== 23 | // when antenna test utility is on or some testing 24 | // need to disable antenna diversity 25 | // call this function to disable all ODM related mechanisms 26 | // which will switch antenna. 27 | //====================================================== 28 | void ODM_StopAntennaSwitchDm(PDM_ODM_T pDM_Odm) 29 | { 30 | // disable ODM antenna diversity 31 | pDM_Odm->SupportAbility &= ~ODM_BB_ANT_DIV; 32 | ODM_RT_TRACE( 33 | pDM_Odm, 34 | ODM_COMP_ANT_DIV, 35 | ODM_DBG_LOUD, 36 | ("STOP Antenna Diversity\n") 37 | ); 38 | } 39 | 40 | void ODM_SetAntConfig(PDM_ODM_T pDM_Odm, u8 antSetting)// 0=A, 1=B, 2=C, .... 41 | { 42 | if (antSetting == 0) // ant A 43 | PHY_SetBBReg(pDM_Odm->Adapter, 0x948, bMaskDWord, 0x00000000); 44 | else if (antSetting == 1) 45 | PHY_SetBBReg(pDM_Odm->Adapter, 0x948, bMaskDWord, 0x00000280); 46 | } 47 | 48 | //====================================================== 49 | 50 | 51 | void ODM_SwAntDivRestAfterLink(PDM_ODM_T pDM_Odm) 52 | { 53 | pSWAT_T pDM_SWAT_Table = &pDM_Odm->DM_SWAT_Table; 54 | pFAT_T pDM_FatTable = &pDM_Odm->DM_FatTable; 55 | u32 i; 56 | 57 | pDM_Odm->RSSI_test = false; 58 | pDM_SWAT_Table->try_flag = 0xff; 59 | pDM_SWAT_Table->RSSI_Trying = 0; 60 | pDM_SWAT_Table->Double_chk_flag = 0; 61 | 62 | pDM_FatTable->RxIdleAnt = MAIN_ANT; 63 | 64 | for (i = 0; i < ODM_ASSOCIATE_ENTRY_NUM; i++) { 65 | pDM_FatTable->MainAnt_Sum[i] = 0; 66 | pDM_FatTable->AuxAnt_Sum[i] = 0; 67 | pDM_FatTable->MainAnt_Cnt[i] = 0; 68 | pDM_FatTable->AuxAnt_Cnt[i] = 0; 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/include/rtw_ap.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2012 Realtek Corporation. All rights reserved. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | ******************************************************************************/ 15 | #ifndef __RTW_AP_H_ 16 | #define __RTW_AP_H_ 17 | 18 | void init_mlme_ap_info(struct adapter *padapter); 19 | void free_mlme_ap_info(struct adapter *padapter); 20 | /* void update_BCNTIM(struct adapter *padapter); */ 21 | void update_beacon(struct adapter *padapter, u8 ie_id, u8 *oui, u8 tx); 22 | void add_RATid(struct adapter *padapter, struct sta_info *psta, u8 rssi_level); 23 | void expire_timeout_chk(struct adapter *padapter); 24 | void update_sta_info_apmode(struct adapter *padapter, struct sta_info *psta); 25 | void start_bss_network(struct adapter *padapter, u8 *pbuf); 26 | int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf, int len); 27 | void rtw_ap_restore_network(struct adapter *padapter); 28 | void rtw_set_macaddr_acl(struct adapter *padapter, int mode); 29 | int rtw_acl_add_sta(struct adapter *padapter, u8 *addr); 30 | int rtw_acl_remove_sta(struct adapter *padapter, u8 *addr); 31 | 32 | u8 rtw_ap_set_pairwise_key(struct adapter *padapter, struct sta_info *psta); 33 | int rtw_ap_set_group_key(struct adapter *padapter, u8 *key, u8 alg, int keyid); 34 | int rtw_ap_set_wep_key(struct adapter *padapter, u8 *key, u8 keylen, int keyid, u8 set_tx); 35 | 36 | void associated_clients_update(struct adapter *padapter, u8 updated); 37 | void bss_cap_update_on_sta_join(struct adapter *padapter, struct sta_info *psta); 38 | u8 bss_cap_update_on_sta_leave(struct adapter *padapter, struct sta_info *psta); 39 | void sta_info_update(struct adapter *padapter, struct sta_info *psta); 40 | void ap_sta_info_defer_update(struct adapter *padapter, struct sta_info *psta); 41 | u8 ap_free_sta(struct adapter *padapter, struct sta_info *psta, bool active, u16 reason); 42 | int rtw_sta_flush(struct adapter *padapter); 43 | void start_ap_mode(struct adapter *padapter); 44 | void stop_ap_mode(struct adapter *padapter); 45 | 46 | #endif 47 | void update_bmc_sta(struct adapter *padapter); 48 | -------------------------------------------------------------------------------- /cross-build/compile-kernel.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | if [[ $1 != "" ]] ; then 6 | MAKE_FLAGS="$@" 7 | else 8 | MAKE_FLAGS?="-j4" 9 | fi 10 | 11 | ##################################################################### 12 | # Functions 13 | execute() { #STRING 14 | if [ $# != 1 ] ; then 15 | echo "ERROR: No args passed" 16 | exit 1 17 | fi 18 | cmd=$1 19 | 20 | echo "[*] EXECUTE: [$cmd]" 21 | eval "$cmd" 22 | ret=$? 23 | 24 | if [ $ret != 0 ] ; then 25 | echo "ERROR: Command exited with [$ret]" 26 | exit 1 27 | fi 28 | 29 | return 0 30 | } 31 | 32 | ##################################################################### 33 | # LOGIC! 34 | echo "COMPILING.." 35 | 36 | # Install Docker for Mac 37 | # - increase resources to e.g. 8 CPUs 38 | # - enable Experimental Features -> Enable VirtuoFS accelerated directory sharing 39 | # Download folder https://github.com/geerlingguy/raspberry-pi-pcie-devices/tree/master/extras/cross-compile 40 | 41 | # docker-compose up -d 42 | # docker attach cross-compile 43 | 44 | # Inside the container run: 45 | 46 | #git clone --depth=1 https://github.com/raspberrypi/linux --branch rpi-5.10.y 47 | #patch -p1 -d linux/sound/usb < ../sound-module/snd-usb-audio-0.1/patches/fix-volume.patch 48 | 49 | execute "cd linux" 50 | 51 | # Use default conf with RTL8723BS enabled 52 | execute "make $MAKE_FLAGS bcm2709_defconfig" 53 | execute "sed -i 's/# CONFIG_RTL8723BS is not set/CONFIG_RTL8723BS=m/' .config" 54 | # We rename the kernel, as it otherwise collides with kernel updates installed by the user 55 | execute "sed -i 's/CONFIG_LOCALVERSION=\"-v7\"/CONFIG_LOCALVERSION=\"-v7-volume-fix\"/' .config" 56 | # execute "sed -i 's/# CONFIG_RFKILL_GPIO is not set/CONFIG_RFKILL_GPIO=m/' .config" 57 | #execute "sed -i 's/# CONFIG_BT_HCIUART_RTL is not set/CONFIG_BT_HCIUART_RTL=y/' .config" 58 | 59 | # Use previous .config file 60 | # execute "cp ../config.template .config" 61 | # execute "make $MAKE_FLAGS oldconfig" 62 | 63 | # (Optionally) Either edit the .config IMG by hand or use menuconfig: 64 | # make $MAKE_FLAGS menuconfig 65 | 66 | # (Cross-)compile kernel 67 | execute "make $MAKE_FLAGS zImage modules dtbs" 68 | 69 | execute "mkdir ../modules" 70 | execute "sudo make INSTALL_MOD_PATH=../modules/ modules_install" 71 | 72 | execute "rm -f ../modules/lib/modules/*/build" 73 | execute "rm -f ../modules/lib/modules/*/source" 74 | 75 | execute "mkdir -p ../pi/overlays" 76 | 77 | execute "cp .config ../config" 78 | execute "cp arch/arm/boot/dts/*.dtb ../pi/" 79 | execute "cp arch/arm/boot/dts/overlays/*.dtb* ../pi/overlays/" 80 | execute "cp arch/arm/boot/dts/overlays/README ../pi/overlays/" 81 | execute "cp arch/arm/boot/zImage ../pi/" 82 | 83 | ##################################################################### 84 | # DONE 85 | echo "COMPILATION DONE!" 86 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/include/rtw_event.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | ******************************************************************************/ 15 | #ifndef _RTW_EVENT_H_ 16 | #define _RTW_EVENT_H_ 17 | 18 | /* 19 | Used to report a bss has been scanned 20 | 21 | */ 22 | struct survey_event { 23 | struct wlan_bssid_ex bss; 24 | }; 25 | 26 | /* 27 | Used to report that the requested site survey has been done. 28 | 29 | bss_cnt indicates the number of bss that has been reported. 30 | 31 | 32 | */ 33 | struct surveydone_event { 34 | unsigned int bss_cnt; 35 | 36 | }; 37 | 38 | /* 39 | Used to report the link result of joinning the given bss 40 | 41 | 42 | join_res: 43 | -1: authentication fail 44 | -2: association fail 45 | > 0: TID 46 | 47 | */ 48 | struct joinbss_event { 49 | struct wlan_network network; 50 | }; 51 | 52 | /* 53 | Used to report a given STA has joinned the created BSS. 54 | It is used in AP/Ad-HoC(M) mode. 55 | 56 | 57 | */ 58 | struct stassoc_event { 59 | unsigned char macaddr[6]; 60 | unsigned char rsvd[2]; 61 | int cam_id; 62 | 63 | }; 64 | 65 | struct stadel_event { 66 | unsigned char macaddr[6]; 67 | unsigned char rsvd[2]; /* for reason */ 68 | int mac_id; 69 | }; 70 | 71 | struct addba_event 72 | { 73 | unsigned int tid; 74 | }; 75 | 76 | struct wmm_event 77 | { 78 | unsigned char wmm; 79 | }; 80 | 81 | #define GEN_EVT_CODE(event) event ## _EVT_ 82 | 83 | 84 | 85 | struct fwevent { 86 | u32 parmsize; 87 | void (*event_callback)(struct adapter *dev, u8 *pbuf); 88 | }; 89 | 90 | 91 | #define C2HEVENT_SZ 32 92 | 93 | struct event_node{ 94 | unsigned char *node; 95 | unsigned char evt_code; 96 | unsigned short evt_sz; 97 | volatile int *caller_ff_tail; 98 | int caller_ff_sz; 99 | }; 100 | 101 | struct c2hevent_queue { 102 | volatile int head; 103 | volatile int tail; 104 | struct event_node nodes[C2HEVENT_SZ]; 105 | unsigned char seq; 106 | }; 107 | 108 | #define NETWORK_QUEUE_SZ 4 109 | 110 | struct network_queue { 111 | volatile int head; 112 | volatile int tail; 113 | struct wlan_bssid_ex networks[NETWORK_QUEUE_SZ]; 114 | }; 115 | 116 | 117 | #endif /* _WLANEVENT_H_ */ 118 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/include/hal_pg.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 | ******************************************************************************/ 15 | 16 | #ifndef __HAL_PG_H__ 17 | #define __HAL_PG_H__ 18 | 19 | #define MAX_RF_PATH 4 20 | /* MAX_TX_COUNT must always be set to 4, otherwise the read efuse table 21 | * sequence will be wrong. 22 | */ 23 | #define MAX_TX_COUNT 4 24 | 25 | /* For VHT series TX power by rate table. */ 26 | /* VHT TX power by rate off setArray = */ 27 | /* Band:-2G&5G = 0 / 1 */ 28 | /* RF: at most 4*4 = ABCD = 0/1/2/3 */ 29 | /* CCK = 0 OFDM = 1/2 HT-MCS 0-15 =3/4/56 VHT =7/8/9/10/11 */ 30 | #define TX_PWR_BY_RATE_NUM_BAND 2 31 | #define TX_PWR_BY_RATE_NUM_RF 4 32 | #define TX_PWR_BY_RATE_NUM_RATE 84 33 | #define MAX_RF_PATH_NUM 2 34 | #define MAX_CHNL_GROUP_24G 6 35 | #define EEPROM_DEFAULT_BOARD_OPTION 0x00 36 | 37 | /* EEPROM/Efuse PG Offset for 8723BE/8723BU/8723BS */ 38 | /* 0x10 ~ 0x63 = TX power area. */ 39 | #define EEPROM_TX_PWR_INX_8723B 0x10 40 | /* New EFUSE default value */ 41 | #define EEPROM_DEFAULT_24G_INDEX 0x2D 42 | #define EEPROM_DEFAULT_24G_HT20_DIFF 0X02 43 | #define EEPROM_DEFAULT_24G_OFDM_DIFF 0X04 44 | #define EEPROM_Default_ThermalMeter_8723B 0x18 45 | #define EEPROM_Default_CrystalCap_8723B 0x20 46 | 47 | #define EEPROM_ChannelPlan_8723B 0xB8 48 | #define EEPROM_XTAL_8723B 0xB9 49 | #define EEPROM_THERMAL_METER_8723B 0xBA 50 | 51 | #define EEPROM_RF_BOARD_OPTION_8723B 0xC1 52 | #define EEPROM_RF_BT_SETTING_8723B 0xC3 53 | #define EEPROM_VERSION_8723B 0xC4 54 | #define EEPROM_CustomID_8723B 0xC5 55 | #define EEPROM_DEFAULT_DIFF 0XFE 56 | 57 | /* RTL8723BS */ 58 | #define EEPROM_MAC_ADDR_8723BS 0x11A 59 | #define EEPROM_Voltage_ADDR_8723B 0x8 60 | #define RTL_EEPROM_ID 0x8129 61 | 62 | struct TxPowerInfo24G { 63 | u8 IndexCCK_Base[MAX_RF_PATH][MAX_CHNL_GROUP_24G]; 64 | u8 IndexBW40_Base[MAX_RF_PATH][MAX_CHNL_GROUP_24G]; 65 | /* If only one tx, only BW20 and OFDM are used. */ 66 | s8 CCK_Diff[MAX_RF_PATH][MAX_TX_COUNT]; 67 | s8 OFDM_Diff[MAX_RF_PATH][MAX_TX_COUNT]; 68 | s8 BW20_Diff[MAX_RF_PATH][MAX_TX_COUNT]; 69 | s8 BW40_Diff[MAX_RF_PATH][MAX_TX_COUNT]; 70 | }; 71 | 72 | enum { 73 | Ant_x2 = 0, 74 | Ant_x1 = 1 75 | }; 76 | 77 | enum { 78 | BT_RTL8723B = 8, 79 | }; 80 | 81 | #endif 82 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/include/osdep_intf.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 | ******************************************************************************/ 15 | 16 | #ifndef __OSDEP_INTF_H_ 17 | #define __OSDEP_INTF_H_ 18 | 19 | 20 | struct intf_priv { 21 | 22 | u8 *intf_dev; 23 | u32 max_iosz; /* USB2.0: 128, USB1.1: 64, SDIO:64 */ 24 | u32 max_xmitsz; /* USB2.0: unlimited, SDIO:512 */ 25 | u32 max_recvsz; /* USB2.0: unlimited, SDIO:512 */ 26 | 27 | volatile u8 *io_rwmem; 28 | volatile u8 *allocated_io_rwmem; 29 | u32 io_wsz; /* unit: 4bytes */ 30 | u32 io_rsz;/* unit: 4bytes */ 31 | u8 intf_status; 32 | 33 | void (*_bus_io)(u8 *priv); 34 | 35 | /* 36 | Under Sync. IRP (SDIO/USB) 37 | A protection mechanism is necessary for the io_rwmem(read/write protocol) 38 | 39 | Under Async. IRP (SDIO/USB) 40 | The protection mechanism is through the pending queue. 41 | */ 42 | 43 | _mutex ioctl_mutex; 44 | }; 45 | 46 | 47 | #ifdef CONFIG_R871X_TEST 48 | int rtw_start_pseudo_adhoc(struct adapter *padapter); 49 | int rtw_stop_pseudo_adhoc(struct adapter *padapter); 50 | #endif 51 | 52 | struct dvobj_priv *devobj_init(void); 53 | void devobj_deinit(struct dvobj_priv *pdvobj); 54 | 55 | u8 rtw_init_drv_sw(struct adapter *padapter); 56 | u8 rtw_free_drv_sw(struct adapter *padapter); 57 | u8 rtw_reset_drv_sw(struct adapter *padapter); 58 | void rtw_dev_unload(struct adapter *padapter); 59 | 60 | u32 rtw_start_drv_threads(struct adapter *padapter); 61 | void rtw_stop_drv_threads (struct adapter *padapter); 62 | void rtw_cancel_all_timer(struct adapter *padapter); 63 | 64 | int rtw_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); 65 | 66 | int rtw_init_netdev_name(struct net_device *pnetdev, const char *ifname); 67 | struct net_device *rtw_init_netdev(struct adapter *padapter); 68 | void rtw_unregister_netdevs(struct dvobj_priv *dvobj); 69 | 70 | u16 rtw_recv_select_queue(struct sk_buff *skb); 71 | 72 | int rtw_ndev_notifier_register(void); 73 | void rtw_ndev_notifier_unregister(void); 74 | 75 | #include "../os_dep/rtw_proc.h" 76 | 77 | void rtw_ips_dev_unload(struct adapter *padapter); 78 | 79 | int rtw_ips_pwr_up(struct adapter *padapter); 80 | void rtw_ips_pwr_down(struct adapter *padapter); 81 | 82 | int rtw_drv_register_netdev(struct adapter *padapter); 83 | void rtw_ndev_destructor(_nic_hdl ndev); 84 | 85 | int rtw_suspend_common(struct adapter *padapter); 86 | int rtw_resume_common(struct adapter *padapter); 87 | 88 | #endif /* _OSDEP_INTF_H_ */ 89 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/hal/rtl8723b_rxdesc.c: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | ******************************************************************************/ 15 | #define _RTL8723B_REDESC_C_ 16 | 17 | #include 18 | 19 | static void process_rssi(struct adapter *padapter, union recv_frame *prframe) 20 | { 21 | struct rx_pkt_attrib *pattrib = &prframe->u.hdr.attrib; 22 | struct signal_stat *signal_stat = &padapter->recvpriv.signal_strength_data; 23 | 24 | /* DBG_8192C("process_rssi => pattrib->rssil(%d) signal_strength(%d)\n ", pattrib->RecvSignalPower, pattrib->signal_strength); */ 25 | /* if (pRfd->Status.bPacketToSelf || pRfd->Status.bPacketBeacon) */ 26 | { 27 | if (signal_stat->update_req) { 28 | signal_stat->total_num = 0; 29 | signal_stat->total_val = 0; 30 | signal_stat->update_req = 0; 31 | } 32 | 33 | signal_stat->total_num++; 34 | signal_stat->total_val += pattrib->phy_info.SignalStrength; 35 | signal_stat->avg_val = signal_stat->total_val / signal_stat->total_num; 36 | } 37 | 38 | } /* Process_UI_RSSI_8192C */ 39 | 40 | static void process_link_qual(struct adapter *padapter, union recv_frame *prframe) 41 | { 42 | struct rx_pkt_attrib *pattrib; 43 | struct signal_stat *signal_stat; 44 | 45 | if (prframe == NULL || padapter == NULL) 46 | return; 47 | 48 | pattrib = &prframe->u.hdr.attrib; 49 | signal_stat = &padapter->recvpriv.signal_qual_data; 50 | 51 | /* DBG_8192C("process_link_qual => pattrib->signal_qual(%d)\n ", pattrib->signal_qual); */ 52 | 53 | if (signal_stat->update_req) { 54 | signal_stat->total_num = 0; 55 | signal_stat->total_val = 0; 56 | signal_stat->update_req = 0; 57 | } 58 | 59 | signal_stat->total_num++; 60 | signal_stat->total_val += pattrib->phy_info.SignalQuality; 61 | signal_stat->avg_val = signal_stat->total_val / signal_stat->total_num; 62 | } /* Process_UiLinkQuality8192S */ 63 | 64 | 65 | void rtl8723b_process_phy_info(struct adapter *padapter, void *prframe) 66 | { 67 | union recv_frame *precvframe = prframe; 68 | /* */ 69 | /* Check RSSI */ 70 | /* */ 71 | process_rssi(padapter, precvframe); 72 | /* */ 73 | /* Check PWDB. */ 74 | /* */ 75 | /* process_PWDB(padapter, precvframe); */ 76 | 77 | /* UpdateRxSignalStatistics8192C(Adapter, pRfd); */ 78 | /* */ 79 | /* Check EVM */ 80 | /* */ 81 | process_link_qual(padapter, precvframe); 82 | #ifdef DBG_RX_SIGNAL_DISPLAY_RAW_DATA 83 | rtw_store_phy_info(padapter, prframe); 84 | #endif 85 | 86 | } 87 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/include/rtw_btcoex.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2013 Realtek Corporation. All rights reserved. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | ******************************************************************************/ 15 | #ifndef __RTW_BTCOEX_H__ 16 | #define __RTW_BTCOEX_H__ 17 | 18 | #include 19 | 20 | 21 | #define PACKET_NORMAL 0 22 | #define PACKET_DHCP 1 23 | #define PACKET_ARP 2 24 | #define PACKET_EAPOL 3 25 | 26 | void rtw_btcoex_Initialize(struct adapter *); 27 | void rtw_btcoex_PowerOnSetting(struct adapter *padapter); 28 | void rtw_btcoex_HAL_Initialize(struct adapter *padapter, u8 bWifiOnly); 29 | void rtw_btcoex_IpsNotify(struct adapter *, u8 type); 30 | void rtw_btcoex_LpsNotify(struct adapter *, u8 type); 31 | void rtw_btcoex_ScanNotify(struct adapter *, u8 type); 32 | void rtw_btcoex_ConnectNotify(struct adapter *, u8 action); 33 | void rtw_btcoex_MediaStatusNotify(struct adapter *, u8 mediaStatus); 34 | void rtw_btcoex_SpecialPacketNotify(struct adapter *, u8 pktType); 35 | void rtw_btcoex_IQKNotify(struct adapter *padapter, u8 state); 36 | void rtw_btcoex_BtInfoNotify(struct adapter *, u8 length, u8 *tmpBuf); 37 | void rtw_btcoex_SuspendNotify(struct adapter *, u8 state); 38 | void rtw_btcoex_HaltNotify(struct adapter *); 39 | u8 rtw_btcoex_IsBtDisabled(struct adapter *); 40 | void rtw_btcoex_Handler(struct adapter *); 41 | s32 rtw_btcoex_IsBTCoexCtrlAMPDUSize(struct adapter *); 42 | void rtw_btcoex_SetManualControl(struct adapter *, u8 bmanual); 43 | u8 rtw_btcoex_IsBtControlLps(struct adapter *); 44 | u8 rtw_btcoex_IsLpsOn(struct adapter *); 45 | u8 rtw_btcoex_RpwmVal(struct adapter *); 46 | u8 rtw_btcoex_LpsVal(struct adapter *); 47 | void rtw_btcoex_SetBTCoexist(struct adapter *, u8 bBtExist); 48 | void rtw_btcoex_SetChipType(struct adapter *, u8 chipType); 49 | void rtw_btcoex_SetPGAntNum(struct adapter *, u8 antNum); 50 | void rtw_btcoex_SetSingleAntPath(struct adapter *padapter, u8 singleAntPath); 51 | u32 rtw_btcoex_GetRaMask(struct adapter *); 52 | void rtw_btcoex_RecordPwrMode(struct adapter *, u8 *pCmdBuf, u8 cmdLen); 53 | void rtw_btcoex_DisplayBtCoexInfo(struct adapter *, u8 *pbuf, u32 bufsize); 54 | void rtw_btcoex_SetDBG(struct adapter *, u32 *pDbgModule); 55 | u32 rtw_btcoex_GetDBG(struct adapter *, u8 *pStrBuf, u32 bufSize); 56 | 57 | /* ================================================== */ 58 | /* Below Functions are called by BT-Coex */ 59 | /* ================================================== */ 60 | void rtw_btcoex_RejectApAggregatedPacket(struct adapter *, u8 enable); 61 | void rtw_btcoex_LPS_Enter(struct adapter *); 62 | void rtw_btcoex_LPS_Leave(struct adapter *); 63 | 64 | #endif /* __RTW_BTCOEX_H__ */ 65 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/include/hal_btcoex.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2013 Realtek Corporation. All rights reserved. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | ******************************************************************************/ 15 | #ifndef __HAL_BTCOEX_H__ 16 | #define __HAL_BTCOEX_H__ 17 | 18 | #include 19 | 20 | /* Some variables can't get from outsrc BT-Coex, */ 21 | /* so we need to save here */ 22 | typedef struct _BT_COEXIST 23 | { 24 | u8 bBtExist; 25 | u8 btTotalAntNum; 26 | u8 btChipType; 27 | u8 bInitlized; 28 | } BT_COEXIST, *PBT_COEXIST; 29 | 30 | void DBG_BT_INFO(u8 *dbgmsg); 31 | 32 | void hal_btcoex_SetBTCoexist(struct adapter *padapter, u8 bBtExist); 33 | u8 hal_btcoex_IsBtExist(struct adapter *padapter); 34 | u8 hal_btcoex_IsBtDisabled(struct adapter *); 35 | void hal_btcoex_SetChipType(struct adapter *padapter, u8 chipType); 36 | void hal_btcoex_SetPgAntNum(struct adapter *padapter, u8 antNum); 37 | void hal_btcoex_SetSingleAntPath(struct adapter *padapter, u8 singleAntPath); 38 | 39 | u8 hal_btcoex_Initialize(struct adapter *padapter); 40 | void hal_btcoex_PowerOnSetting(struct adapter *padapter); 41 | void hal_btcoex_InitHwConfig(struct adapter *padapter, u8 bWifiOnly); 42 | 43 | void hal_btcoex_IpsNotify(struct adapter *padapter, u8 type); 44 | void hal_btcoex_LpsNotify(struct adapter *padapter, u8 type); 45 | void hal_btcoex_ScanNotify(struct adapter *padapter, u8 type); 46 | void hal_btcoex_ConnectNotify(struct adapter *padapter, u8 action); 47 | void hal_btcoex_MediaStatusNotify(struct adapter *padapter, u8 mediaStatus); 48 | void hal_btcoex_SpecialPacketNotify(struct adapter *padapter, u8 pktType); 49 | void hal_btcoex_IQKNotify(struct adapter *padapter, u8 state); 50 | void hal_btcoex_BtInfoNotify(struct adapter *padapter, u8 length, u8 *tmpBuf); 51 | void hal_btcoex_SuspendNotify(struct adapter *padapter, u8 state); 52 | void hal_btcoex_HaltNotify(struct adapter *padapter); 53 | 54 | void hal_btcoex_Hanlder(struct adapter *padapter); 55 | 56 | s32 hal_btcoex_IsBTCoexCtrlAMPDUSize(struct adapter *padapter); 57 | void hal_btcoex_SetManualControl(struct adapter *padapter, u8 bmanual); 58 | u8 hal_btcoex_IsBtControlLps(struct adapter *); 59 | u8 hal_btcoex_IsLpsOn(struct adapter *); 60 | u8 hal_btcoex_RpwmVal(struct adapter *); 61 | u8 hal_btcoex_LpsVal(struct adapter *); 62 | u32 hal_btcoex_GetRaMask(struct adapter *); 63 | void hal_btcoex_RecordPwrMode(struct adapter *padapter, u8 *pCmdBuf, u8 cmdLen); 64 | void hal_btcoex_DisplayBtCoexInfo(struct adapter *, u8 *pbuf, u32 bufsize); 65 | void hal_btcoex_SetDBG(struct adapter *, u32 *pDbgModule); 66 | u32 hal_btcoex_GetDBG(struct adapter *, u8 *pStrBuf, u32 bufSize); 67 | 68 | #endif /* !__HAL_BTCOEX_H__ */ 69 | -------------------------------------------------------------------------------- /cross-build/build-kernel.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ "$EUID" -ne 0 ] 4 | then echo "Please run as root (sudo)" 5 | exit 1 6 | fi 7 | 8 | if [ $# != 2 ] ; then 9 | echo "Usage: ./ YES " 10 | exit 1 11 | fi 12 | 13 | ##################################################################### 14 | # Vars 15 | 16 | if [[ $2 != "" ]] ; then 17 | IMG=$2 18 | fi 19 | 20 | MOUNTFAT32="/mnt/fat32" 21 | MOUNTEXT4="/mnt/ext4" 22 | 23 | ##################################################################### 24 | # Functions 25 | execute() { #STRING 26 | if [ $# != 1 ] ; then 27 | echo "ERROR: No args passed" 28 | exit 1 29 | fi 30 | cmd=$1 31 | 32 | echo "[*] EXECUTE: [$cmd]" 33 | eval "$cmd" 34 | ret=$? 35 | 36 | if [ $ret != 0 ] ; then 37 | echo "ERROR: Command exited with [$ret]" 38 | exit 1 39 | fi 40 | 41 | return 0 42 | } 43 | 44 | exists() { #FILE 45 | if [ $# != 1 ] ; then 46 | echo "ERROR: No args passed" 47 | exit 1 48 | fi 49 | 50 | file=$1 51 | 52 | if [ -f $file ]; then 53 | echo "[i] FILE: [$file] exists." 54 | return 0 55 | else 56 | echo "[i] FILE: [$file] does not exist." 57 | return 1 58 | fi 59 | } 60 | 61 | ##################################################################### 62 | # LOGIC! 63 | echo "BUILDING.." 64 | 65 | # Sanity check IMG 66 | if ! exists $IMG ; then 67 | echo "ERROR: IMG [$IMG] doesn't exist" 68 | exit 1 69 | fi 70 | 71 | OUTFILE=$(basename $IMG .img)"_kernel.img" 72 | 73 | # Sanity check OUTFILE 74 | if exists $OUTFILE ; then 75 | echo "ERROR: OUTFILE [$OUTFILE] exists! Can't create new image" 76 | exit 1 77 | fi 78 | 79 | # Check the mounted dir is clean 80 | MNTDIRCLEANCOUNT=$(ls $MOUNTFAT32 | wc -l) 81 | if [ $MNTDIRCLEANCOUNT != 0 ] ; then 82 | echo "ERROR: Mount dir [$MOUNTFAT32] is not empty [$MNTDIRCLEANCOUNT], perhaps something is mounted on it?" 83 | exit 1 84 | fi 85 | 86 | # Check the mounted dir is clean 87 | MNTDIRCLEANCOUNT=$(ls $MOUNTEXT4 | wc -l) 88 | if [ $MNTDIRCLEANCOUNT != 0 ] ; then 89 | echo "ERROR: Mount dir [$MOUNTEXT4] is not empty [$MNTDIRCLEANCOUNT], perhaps something is mounted on it?" 90 | exit 1 91 | fi 92 | 93 | # Copy img to new + name 94 | execute "cp $IMG $OUTFILE" 95 | 96 | # Increase image to hold our extras 97 | execute "truncate --size=+256M $OUTFILE" 98 | 99 | # Find partions using kpartx 100 | execute "kpartx -d /dev/loop0 || true" 101 | execute "losetup -d /dev/loop0 || true" 102 | execute "kpartx -a -v -s $OUTFILE" 103 | 104 | # Resize fs 105 | execute "growpart /dev/loop0 2" 106 | execute "kpartx -d /dev/loop0 || true" 107 | execute "losetup -d /dev/loop0 || true" 108 | execute "kpartx -a -v -s $OUTFILE" 109 | execute "e2fsck -y -f /dev/mapper/loop0p2" 110 | execute "resize2fs /dev/mapper/loop0p2" 111 | 112 | # Mount partitions 113 | execute "sudo mount /dev/mapper/loop0p1 $MOUNTFAT32" 114 | execute "sudo mount /dev/mapper/loop0p2 $MOUNTEXT4" 115 | 116 | # Install built kernel (assumes compile-kernel.sh ran before) 117 | execute "./install-kernel.sh YES $BRANCH $MOUNTFAT32 $MOUNTEXT4" 118 | 119 | # Unmount partitions 120 | execute "umount $MOUNTFAT32" 121 | execute "umount $MOUNTEXT4" 122 | 123 | # Remove mapped partitions 124 | execute "kpartx -d -v $OUTFILE" 125 | 126 | # DONE 127 | echo "SUCCESS: Image [$OUTFILE] has been built!" 128 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/include/Hal8723BPhyCfg.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 | ******************************************************************************/ 15 | #ifndef __INC_HAL8723BPHYCFG_H__ 16 | #define __INC_HAL8723BPHYCFG_H__ 17 | 18 | /*--------------------------Define Parameters-------------------------------*/ 19 | #define LOOP_LIMIT 5 20 | #define MAX_STALL_TIME 50 /* us */ 21 | #define AntennaDiversityValue 0x80 /* Adapter->bSoftwareAntennaDiversity ? 0x00:0x80) */ 22 | #define MAX_TXPWR_IDX_NMODE_92S 63 23 | #define Reset_Cnt_Limit 3 24 | 25 | #define MAX_AGGR_NUM 0x07 26 | 27 | 28 | /*--------------------------Define Parameters End-------------------------------*/ 29 | 30 | 31 | /*------------------------------Define structure----------------------------*/ 32 | 33 | /*------------------------------Define structure End----------------------------*/ 34 | 35 | /*--------------------------Exported Function prototype---------------------*/ 36 | u32 37 | PHY_QueryBBReg_8723B( 38 | struct adapter *Adapter, 39 | u32 RegAddr, 40 | u32 BitMask 41 | ); 42 | 43 | void 44 | PHY_SetBBReg_8723B( 45 | struct adapter *Adapter, 46 | u32 RegAddr, 47 | u32 BitMask, 48 | u32 Data 49 | ); 50 | 51 | u32 52 | PHY_QueryRFReg_8723B( 53 | struct adapter * Adapter, 54 | u8 eRFPath, 55 | u32 RegAddr, 56 | u32 BitMask 57 | ); 58 | 59 | void 60 | PHY_SetRFReg_8723B( 61 | struct adapter * Adapter, 62 | u8 eRFPath, 63 | u32 RegAddr, 64 | u32 BitMask, 65 | u32 Data 66 | ); 67 | 68 | /* MAC/BB/RF HAL config */ 69 | int PHY_BBConfig8723B(struct adapter *Adapter ); 70 | 71 | int PHY_RFConfig8723B(struct adapter *Adapter ); 72 | 73 | s32 PHY_MACConfig8723B(struct adapter *padapter); 74 | 75 | void 76 | PHY_SetTxPowerIndex_8723B( 77 | struct adapter * Adapter, 78 | u32 PowerIndex, 79 | u8 RFPath, 80 | u8 Rate 81 | ); 82 | 83 | u8 84 | PHY_GetTxPowerIndex_8723B( 85 | struct adapter * padapter, 86 | u8 RFPath, 87 | u8 Rate, 88 | enum CHANNEL_WIDTH BandWidth, 89 | u8 Channel 90 | ); 91 | 92 | void 93 | PHY_GetTxPowerLevel8723B( 94 | struct adapter * Adapter, 95 | s32* powerlevel 96 | ); 97 | 98 | void 99 | PHY_SetTxPowerLevel8723B( 100 | struct adapter * Adapter, 101 | u8 channel 102 | ); 103 | 104 | void 105 | PHY_SetBWMode8723B( 106 | struct adapter * Adapter, 107 | enum CHANNEL_WIDTH Bandwidth, /* 20M or 40M */ 108 | unsigned char Offset /* Upper, Lower, or Don't care */ 109 | ); 110 | 111 | void 112 | PHY_SwChnl8723B(/* Call after initialization */ 113 | struct adapter *Adapter, 114 | u8 channel 115 | ); 116 | 117 | void 118 | PHY_SetSwChnlBWMode8723B( 119 | struct adapter * Adapter, 120 | u8 channel, 121 | enum CHANNEL_WIDTH Bandwidth, 122 | u8 Offset40, 123 | u8 Offset80 124 | ); 125 | 126 | /*--------------------------Exported Function prototype End---------------------*/ 127 | 128 | #endif 129 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/include/rtl8723b_recv.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | ******************************************************************************/ 15 | #ifndef __RTL8723B_RECV_H__ 16 | #define __RTL8723B_RECV_H__ 17 | 18 | #include 19 | 20 | typedef struct rxreport_8723b 21 | { 22 | /* DWORD 0 */ 23 | u32 pktlen:14; 24 | u32 crc32:1; 25 | u32 icverr:1; 26 | u32 drvinfosize:4; 27 | u32 security:3; 28 | u32 qos:1; 29 | u32 shift:2; 30 | u32 physt:1; 31 | u32 swdec:1; 32 | u32 rsvd0028:2; 33 | u32 eor:1; 34 | u32 rsvd0031:1; 35 | 36 | /* DWORD 1 */ 37 | u32 macid:7; 38 | u32 rsvd0407:1; 39 | u32 tid:4; 40 | u32 macid_vld:1; 41 | u32 amsdu:1; 42 | u32 rxid_match:1; 43 | u32 paggr:1; 44 | u32 a1fit:4; 45 | u32 chkerr:1; /* 20 */ 46 | u32 rx_ipv:1; 47 | u32 rx_is_tcp_udp:1; 48 | u32 chk_vld:1; /* 23 */ 49 | u32 pam:1; 50 | u32 pwr:1; 51 | u32 md:1; 52 | u32 mf:1; 53 | u32 type:2; 54 | u32 mc:1; 55 | u32 bc:1; 56 | 57 | /* DWORD 2 */ 58 | u32 seq:12; 59 | u32 frag:4; 60 | u32 rx_is_qos:1; 61 | u32 rsvd0817:1; 62 | u32 wlanhd_iv_len:6; 63 | u32 hwrsvd0824:4; 64 | u32 c2h_ind:1; 65 | u32 rsvd0829:2; 66 | u32 fcs_ok:1; 67 | 68 | /* DWORD 3 */ 69 | u32 rx_rate:7; 70 | u32 rsvd1207:3; 71 | u32 htc:1; 72 | u32 esop:1; 73 | u32 bssid_fit:2; 74 | u32 rsvd1214:2; 75 | u32 dma_agg_num:8; 76 | u32 rsvd1224:5; 77 | u32 patternmatch:1; 78 | u32 unicastwake:1; 79 | u32 magicwake:1; 80 | 81 | /* DWORD 4 */ 82 | u32 splcp:1; /* Ofdm sgi or cck_splcp */ 83 | u32 ldpc:1; 84 | u32 stbc:1; 85 | u32 not_sounding:1; 86 | u32 bw:2; 87 | u32 rsvd1606:26; 88 | 89 | /* DWORD 5 */ 90 | u32 tsfl; 91 | } RXREPORT, *PRXREPORT; 92 | 93 | typedef struct phystatus_8723b 94 | { 95 | u32 rxgain_a:7; 96 | u32 trsw_a:1; 97 | u32 rxgain_b:7; 98 | u32 trsw_b:1; 99 | u32 chcorr_l:16; 100 | 101 | u32 sigqualcck:8; 102 | u32 cfo_a:8; 103 | u32 cfo_b:8; 104 | u32 chcorr_h:8; 105 | 106 | u32 noisepwrdb_h:8; 107 | u32 cfo_tail_a:8; 108 | u32 cfo_tail_b:8; 109 | u32 rsvd0824:8; 110 | 111 | u32 rsvd1200:8; 112 | u32 rxevm_a:8; 113 | u32 rxevm_b:8; 114 | u32 rxsnr_a:8; 115 | 116 | u32 rxsnr_b:8; 117 | u32 noisepwrdb_l:8; 118 | u32 rsvd1616:8; 119 | u32 postsnr_a:8; 120 | 121 | u32 postsnr_b:8; 122 | u32 csi_a:8; 123 | u32 csi_b:8; 124 | u32 targetcsi_a:8; 125 | 126 | u32 targetcsi_b:8; 127 | u32 sigevm:8; 128 | u32 maxexpwr:8; 129 | u32 exintflag:1; 130 | u32 sgien:1; 131 | u32 rxsc:2; 132 | u32 idlelong:1; 133 | u32 anttrainen:1; 134 | u32 antselb:1; 135 | u32 antsel:1; 136 | } PHYSTATUS, *PPHYSTATUS; 137 | 138 | s32 rtl8723bs_init_recv_priv(struct adapter *padapter); 139 | void rtl8723bs_free_recv_priv(struct adapter *padapter); 140 | 141 | void rtl8723b_query_rx_phy_status(union recv_frame *prframe, struct phy_stat *pphy_stat); 142 | void rtl8723b_process_phy_info(struct adapter *padapter, void *prframe); 143 | 144 | #endif 145 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/hal/odm_reg.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | ******************************************************************************/ 15 | /* File Name: odm_reg.h */ 16 | /* Description: */ 17 | /* This file is for general register definition. */ 18 | #ifndef __HAL_ODM_REG_H__ 19 | #define __HAL_ODM_REG_H__ 20 | 21 | /* Register Definition */ 22 | 23 | /* MAC REG */ 24 | #define ODM_BB_RESET 0x002 25 | #define ODM_DUMMY 0x4fe 26 | #define RF_T_METER_OLD 0x24 27 | #define RF_T_METER_NEW 0x42 28 | 29 | #define ODM_EDCA_VO_PARAM 0x500 30 | #define ODM_EDCA_VI_PARAM 0x504 31 | #define ODM_EDCA_BE_PARAM 0x508 32 | #define ODM_EDCA_BK_PARAM 0x50C 33 | #define ODM_TXPAUSE 0x522 34 | 35 | /* BB REG */ 36 | #define ODM_FPGA_PHY0_PAGE8 0x800 37 | #define ODM_PSD_SETTING 0x808 38 | #define ODM_AFE_SETTING 0x818 39 | #define ODM_TXAGC_B_24_54 0x834 40 | #define ODM_TXAGC_B_MCS32_5 0x838 41 | #define ODM_TXAGC_B_MCS0_MCS3 0x83c 42 | #define ODM_TXAGC_B_MCS4_MCS7 0x848 43 | #define ODM_TXAGC_B_MCS8_MCS11 0x84c 44 | #define ODM_ANALOG_REGISTER 0x85c 45 | #define ODM_RF_INTERFACE_OUTPUT 0x860 46 | #define ODM_TXAGC_B_MCS12_MCS15 0x868 47 | #define ODM_TXAGC_B_11_A_2_11 0x86c 48 | #define ODM_AD_DA_LSB_MASK 0x874 49 | #define ODM_ENABLE_3_WIRE 0x88c 50 | #define ODM_PSD_REPORT 0x8b4 51 | #define ODM_R_ANT_SELECT 0x90c 52 | #define ODM_CCK_ANT_SELECT 0xa07 53 | #define ODM_CCK_PD_THRESH 0xa0a 54 | #define ODM_CCK_RF_REG1 0xa11 55 | #define ODM_CCK_MATCH_FILTER 0xa20 56 | #define ODM_CCK_RAKE_MAC 0xa2e 57 | #define ODM_CCK_CNT_RESET 0xa2d 58 | #define ODM_CCK_TX_DIVERSITY 0xa2f 59 | #define ODM_CCK_FA_CNT_MSB 0xa5b 60 | #define ODM_CCK_FA_CNT_LSB 0xa5c 61 | #define ODM_CCK_NEW_FUNCTION 0xa75 62 | #define ODM_OFDM_PHY0_PAGE_C 0xc00 63 | #define ODM_OFDM_RX_ANT 0xc04 64 | #define ODM_R_A_RXIQI 0xc14 65 | #define ODM_R_A_AGC_CORE1 0xc50 66 | #define ODM_R_A_AGC_CORE2 0xc54 67 | #define ODM_R_B_AGC_CORE1 0xc58 68 | #define ODM_R_AGC_PAR 0xc70 69 | #define ODM_R_HTSTF_AGC_PAR 0xc7c 70 | #define ODM_TX_PWR_TRAINING_A 0xc90 71 | #define ODM_TX_PWR_TRAINING_B 0xc98 72 | #define ODM_OFDM_FA_CNT1 0xcf0 73 | #define ODM_OFDM_PHY0_PAGE_D 0xd00 74 | #define ODM_OFDM_FA_CNT2 0xda0 75 | #define ODM_OFDM_FA_CNT3 0xda4 76 | #define ODM_OFDM_FA_CNT4 0xda8 77 | #define ODM_TXAGC_A_6_18 0xe00 78 | #define ODM_TXAGC_A_24_54 0xe04 79 | #define ODM_TXAGC_A_1_MCS32 0xe08 80 | #define ODM_TXAGC_A_MCS0_MCS3 0xe10 81 | #define ODM_TXAGC_A_MCS4_MCS7 0xe14 82 | #define ODM_TXAGC_A_MCS8_MCS11 0xe18 83 | #define ODM_TXAGC_A_MCS12_MCS15 0xe1c 84 | 85 | /* RF REG */ 86 | #define ODM_GAIN_SETTING 0x00 87 | #define ODM_CHANNEL 0x18 88 | 89 | /* Ant Detect Reg */ 90 | #define ODM_DPDT 0x300 91 | 92 | /* PSD Init */ 93 | #define ODM_PSDREG 0x808 94 | 95 | /* 92D Path Div */ 96 | #define PATHDIV_REG 0xB30 97 | #define PATHDIV_TRI 0xBA0 98 | 99 | /* Bitmap Definition */ 100 | 101 | #define BIT_FA_RESET BIT0 102 | 103 | #endif 104 | -------------------------------------------------------------------------------- /settings/boot/config.txt: -------------------------------------------------------------------------------- 1 | # NOTICE: This file is managed by the Circuit Sword software and is used to 2 | # facilitate HDMI/DPI switching. Do not edit any lines that start with "# CS .." 3 | 4 | # The following settings are used by the software to determine the state 5 | # For instance, the STATE of 'IDLE' means that this file is complete and won't 6 | # change. The state of 'REBOOTING_TO_HDMI' means this file is in transition to 7 | # becoming HDMI enabled and so you should NOT edit the file at all in this case. 8 | # This works by removing 1x '#' symbol from each line within the HDMI block. This 9 | # means anything with one '#' will end up being enabled. Anything with 2x '#'s 10 | # will remain disabled (e.g. comments, or alternative modes) 11 | # If all goes wrong, restore the config.txt file from the backup: 12 | # sudo cp ~/Circuit-Sword/settings/config.txt /boot/config.txt 13 | 14 | # CS CONFIG VERSION: 1.1 15 | # CS CONFIG STATE: IDLE 16 | 17 | # For more options and information see 18 | # http://www.raspberrypi.org/documentation/configuration/config-txt.md 19 | # Some settings may impact device functionality. See link above for details 20 | # Additional overlays and parameters are documented /boot/overlays/README 21 | 22 | # Some settings from the orignal config.txt 23 | gpu_mem_256=128 24 | gpu_mem_512=256 25 | gpu_mem_1024=256 26 | overscan_scale=1 27 | 28 | ########################## 29 | #### GENERIC SETTINGS #### 30 | ########################## 31 | 32 | # Disable low voltage warning when on 3.3v 33 | avoid_warnings=2 34 | 35 | # Enable safe shutdown 36 | dtoverlay=gpio-poweroff,gpiopin=39,active_low="y" 37 | 38 | # Disable onboard audio 39 | dtparam=audio=off 40 | 41 | # Enable SDIO wifi 42 | dtoverlay=sdio,poll_once=false 43 | 44 | # Enable RTL Bluetooth 45 | enable_uart=1 46 | dtoverlay=uart0,txd0_pin=32,rxd0_pin=33,pin_func=7 47 | 48 | # SD overclock (ONLY IF SD SUPPORTS IT) 49 | #dtoverlay=sdtweak,overclock_50=100 50 | 51 | # Always enable the HDMI interface 52 | hdmi_force_hotplug=1 53 | 54 | ####################### 55 | #### HDMI SETTINGS #### 56 | ####################### 57 | # CS START HDMI SETTINGS 58 | 59 | ## Enable HDMI audio 60 | #dtparam=audio=on 61 | #hdmi_drive=2 62 | 63 | ## Disable overscan 64 | #disable_overscan=1 65 | 66 | ## Set HDMI output to 1280x720 (720p) - Default 67 | #hdmi_group=1 68 | #hdmi_mode=4 69 | 70 | ### Set HDMI output to 1920x1080 (1080p) 71 | ##hdmi_group=1 72 | ##hdmi_mode=16 73 | 74 | ### Set HDMI output to 800x480 75 | ##hdmi_group=2 76 | ##hdmi_mode=87 77 | ##hdmi_cvt=800 480 60 6 0 0 0 78 | 79 | # CS END HDMI SETTINGS 80 | 81 | ####################### 82 | #### DPI SETTINGS ##### 83 | ####################### 84 | # CS START DPI SETTINGS 85 | 86 | # Enable DPI 87 | dtoverlay=dpi18 88 | overscan_left=0 89 | overscan_right=0 90 | overscan_top=0 91 | overscan_bottom=0 92 | enable_dpi_lcd=1 93 | display_default_lcd=1 94 | dpi_group=2 95 | dpi_mode=87 96 | 97 | # Enable 320x240 custom display mode 98 | framebuffer_width=320 99 | framebuffer_height=240 100 | display_rotate=2 101 | dpi_output_format=24597 102 | hdmi_timings=320 1 20 30 38 240 1 4 3 10 0 0 0 60 0 9600000 1 103 | 104 | # Enable NEW 640x480 custom display mode (LCD without adapter required) 105 | #framebuffer_width=640 106 | #framebuffer_height=480 107 | #display_rotate=2 108 | #dpi_output_format=516117 109 | #hdmi_timings=640 1 32 48 88 480 1 13 3 32 0 0 0 60 0 32000000 1 110 | 111 | # Enable OLD 640x480 custom display mode (LCD that REQUIRES an adapter) 112 | #framebuffer_width=640 113 | #framebuffer_height=480 114 | #display_rotate=3 115 | #dpi_output_format=287269 116 | #hdmi_timings=480 1 5 5 14 640 1 3 3 3 0 0 0 60 0 32000000 1 117 | 118 | # CS END DPI SETTINGS 119 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/hal/odm_types.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 | ******************************************************************************/ 15 | #ifndef __ODM_TYPES_H__ 16 | #define __ODM_TYPES_H__ 17 | 18 | #include 19 | 20 | /* Deifne HW endian support */ 21 | #define ODM_ENDIAN_BIG 0 22 | #define ODM_ENDIAN_LITTLE 1 23 | 24 | #define GET_ODM(__padapter) ((PDM_ODM_T)(&((GET_HAL_DATA(__padapter))->odmpriv))) 25 | 26 | typedef enum _HAL_STATUS { 27 | HAL_STATUS_SUCCESS, 28 | HAL_STATUS_FAILURE, 29 | /*RT_STATUS_PENDING, 30 | RT_STATUS_RESOURCE, 31 | RT_STATUS_INVALID_CONTEXT, 32 | RT_STATUS_INVALID_PARAMETER, 33 | RT_STATUS_NOT_SUPPORT, 34 | RT_STATUS_OS_API_FAILED,*/ 35 | } HAL_STATUS, *PHAL_STATUS; 36 | 37 | 38 | /* */ 39 | /* Declare for ODM spin lock defintion temporarily fro compile pass. */ 40 | /* */ 41 | typedef enum _RT_SPINLOCK_TYPE { 42 | RT_TX_SPINLOCK = 1, 43 | RT_RX_SPINLOCK = 2, 44 | RT_RM_SPINLOCK = 3, 45 | RT_CAM_SPINLOCK = 4, 46 | RT_SCAN_SPINLOCK = 5, 47 | RT_LOG_SPINLOCK = 7, 48 | RT_BW_SPINLOCK = 8, 49 | RT_CHNLOP_SPINLOCK = 9, 50 | RT_RF_OPERATE_SPINLOCK = 10, 51 | RT_INITIAL_SPINLOCK = 11, 52 | RT_RF_STATE_SPINLOCK = 12, /* For RF state. Added by Bruce, 2007-10-30. */ 53 | /* Shall we define Ndis 6.2 SpinLock Here ? */ 54 | RT_PORT_SPINLOCK = 16, 55 | RT_H2C_SPINLOCK = 20, /* For H2C cmd. Added by tynli. 2009.11.09. */ 56 | 57 | RT_BTData_SPINLOCK = 25, 58 | 59 | RT_WAPI_OPTION_SPINLOCK = 26, 60 | RT_WAPI_RX_SPINLOCK = 27, 61 | 62 | /* add for 92D CCK control issue */ 63 | RT_CCK_PAGEA_SPINLOCK = 28, 64 | RT_BUFFER_SPINLOCK = 29, 65 | RT_CHANNEL_AND_BANDWIDTH_SPINLOCK = 30, 66 | RT_GEN_TEMP_BUF_SPINLOCK = 31, 67 | RT_AWB_SPINLOCK = 32, 68 | RT_FW_PS_SPINLOCK = 33, 69 | RT_HW_TIMER_SPIN_LOCK = 34, 70 | RT_MPT_WI_SPINLOCK = 35, 71 | RT_P2P_SPIN_LOCK = 36, /* Protect P2P context */ 72 | RT_DBG_SPIN_LOCK = 37, 73 | RT_IQK_SPINLOCK = 38, 74 | RT_PENDED_OID_SPINLOCK = 39, 75 | RT_CHNLLIST_SPINLOCK = 40, 76 | RT_INDIC_SPINLOCK = 41, /* protect indication */ 77 | } RT_SPINLOCK_TYPE; 78 | 79 | #if defined(__LITTLE_ENDIAN) 80 | #define ODM_ENDIAN_TYPE ODM_ENDIAN_LITTLE 81 | #else 82 | #define ODM_ENDIAN_TYPE ODM_ENDIAN_BIG 83 | #endif 84 | 85 | typedef struct timer_list RT_TIMER, *PRT_TIMER; 86 | typedef void *RT_TIMER_CALL_BACK; 87 | #define STA_INFO_T struct sta_info 88 | #define PSTA_INFO_T struct sta_info * 89 | 90 | #define SET_TX_DESC_ANTSEL_A_88E(__pTxDesc, __Value) SET_BITS_TO_LE_4BYTE(__pTxDesc+8, 24, 1, __Value) 91 | #define SET_TX_DESC_ANTSEL_B_88E(__pTxDesc, __Value) SET_BITS_TO_LE_4BYTE(__pTxDesc+8, 25, 1, __Value) 92 | #define SET_TX_DESC_ANTSEL_C_88E(__pTxDesc, __Value) SET_BITS_TO_LE_4BYTE(__pTxDesc+28, 29, 1, __Value) 93 | 94 | /* define useless flag to avoid compile warning */ 95 | #define USE_WORKITEM 0 96 | #define FPGA_TWO_MAC_VERIFICATION 0 97 | 98 | #define READ_NEXT_PAIR(v1, v2, i) do { if (i+2 >= ArrayLen) break; i += 2; v1 = Array[i]; v2 = Array[i+1]; } while (0) 99 | #define COND_ELSE 2 100 | #define COND_ENDIF 3 101 | 102 | #endif /* __ODM_TYPES_H__ */ 103 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/hal/odm_DynamicBBPowerSaving.c: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | ******************************************************************************/ 15 | 16 | #include "odm_precomp.h" 17 | 18 | void odm_DynamicBBPowerSavingInit(void *pDM_VOID) 19 | { 20 | PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; 21 | pPS_T pDM_PSTable = &pDM_Odm->DM_PSTable; 22 | 23 | pDM_PSTable->PreCCAState = CCA_MAX; 24 | pDM_PSTable->CurCCAState = CCA_MAX; 25 | pDM_PSTable->PreRFState = RF_MAX; 26 | pDM_PSTable->CurRFState = RF_MAX; 27 | pDM_PSTable->Rssi_val_min = 0; 28 | pDM_PSTable->initialize = 0; 29 | } 30 | 31 | void ODM_RF_Saving(void *pDM_VOID, u8 bForceInNormal) 32 | { 33 | PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; 34 | pPS_T pDM_PSTable = &pDM_Odm->DM_PSTable; 35 | u8 Rssi_Up_bound = 30; 36 | u8 Rssi_Low_bound = 25; 37 | 38 | if (pDM_Odm->PatchID == 40) { /* RT_CID_819x_FUNAI_TV */ 39 | Rssi_Up_bound = 50; 40 | Rssi_Low_bound = 45; 41 | } 42 | 43 | if (pDM_PSTable->initialize == 0) { 44 | 45 | pDM_PSTable->Reg874 = (PHY_QueryBBReg(pDM_Odm->Adapter, 0x874, bMaskDWord)&0x1CC000)>>14; 46 | pDM_PSTable->RegC70 = (PHY_QueryBBReg(pDM_Odm->Adapter, 0xc70, bMaskDWord)&BIT3)>>3; 47 | pDM_PSTable->Reg85C = (PHY_QueryBBReg(pDM_Odm->Adapter, 0x85c, bMaskDWord)&0xFF000000)>>24; 48 | pDM_PSTable->RegA74 = (PHY_QueryBBReg(pDM_Odm->Adapter, 0xa74, bMaskDWord)&0xF000)>>12; 49 | /* Reg818 = PHY_QueryBBReg(padapter, 0x818, bMaskDWord); */ 50 | pDM_PSTable->initialize = 1; 51 | } 52 | 53 | if (!bForceInNormal) { 54 | if (pDM_Odm->RSSI_Min != 0xFF) { 55 | if (pDM_PSTable->PreRFState == RF_Normal) { 56 | if (pDM_Odm->RSSI_Min >= Rssi_Up_bound) 57 | pDM_PSTable->CurRFState = RF_Save; 58 | else 59 | pDM_PSTable->CurRFState = RF_Normal; 60 | } else { 61 | if (pDM_Odm->RSSI_Min <= Rssi_Low_bound) 62 | pDM_PSTable->CurRFState = RF_Normal; 63 | else 64 | pDM_PSTable->CurRFState = RF_Save; 65 | } 66 | } else 67 | pDM_PSTable->CurRFState = RF_MAX; 68 | } else 69 | pDM_PSTable->CurRFState = RF_Normal; 70 | 71 | if (pDM_PSTable->PreRFState != pDM_PSTable->CurRFState) { 72 | if (pDM_PSTable->CurRFState == RF_Save) { 73 | PHY_SetBBReg(pDM_Odm->Adapter, 0x874, 0x1C0000, 0x2); /* Reg874[20:18]=3'b010 */ 74 | PHY_SetBBReg(pDM_Odm->Adapter, 0xc70, BIT3, 0); /* RegC70[3]= 1'b0 */ 75 | PHY_SetBBReg(pDM_Odm->Adapter, 0x85c, 0xFF000000, 0x63); /* Reg85C[31:24]= 0x63 */ 76 | PHY_SetBBReg(pDM_Odm->Adapter, 0x874, 0xC000, 0x2); /* Reg874[15:14]=2'b10 */ 77 | PHY_SetBBReg(pDM_Odm->Adapter, 0xa74, 0xF000, 0x3); /* RegA75[7:4]= 0x3 */ 78 | PHY_SetBBReg(pDM_Odm->Adapter, 0x818, BIT28, 0x0); /* Reg818[28]= 1'b0 */ 79 | PHY_SetBBReg(pDM_Odm->Adapter, 0x818, BIT28, 0x1); /* Reg818[28]= 1'b1 */ 80 | } else { 81 | PHY_SetBBReg(pDM_Odm->Adapter, 0x874, 0x1CC000, pDM_PSTable->Reg874); 82 | PHY_SetBBReg(pDM_Odm->Adapter, 0xc70, BIT3, pDM_PSTable->RegC70); 83 | PHY_SetBBReg(pDM_Odm->Adapter, 0x85c, 0xFF000000, pDM_PSTable->Reg85C); 84 | PHY_SetBBReg(pDM_Odm->Adapter, 0xa74, 0xF000, pDM_PSTable->RegA74); 85 | PHY_SetBBReg(pDM_Odm->Adapter, 0x818, BIT28, 0x0); 86 | } 87 | pDM_PSTable->PreRFState = pDM_PSTable->CurRFState; 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/hal/hal_sdio.c: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | ******************************************************************************/ 15 | #define _HAL_SDIO_C_ 16 | 17 | #include 18 | #include 19 | #include 20 | 21 | u8 rtw_hal_sdio_max_txoqt_free_space(struct adapter *padapter) 22 | { 23 | struct hal_com_data *pHalData = GET_HAL_DATA(padapter); 24 | 25 | if (pHalData->SdioTxOQTMaxFreeSpace < 8) 26 | pHalData->SdioTxOQTMaxFreeSpace = 8; 27 | 28 | return pHalData->SdioTxOQTMaxFreeSpace; 29 | } 30 | 31 | u8 rtw_hal_sdio_query_tx_freepage( 32 | struct adapter *padapter, u8 PageIdx, u8 RequiredPageNum 33 | ) 34 | { 35 | struct hal_com_data *pHalData = GET_HAL_DATA(padapter); 36 | 37 | if ((pHalData->SdioTxFIFOFreePage[PageIdx]+pHalData->SdioTxFIFOFreePage[PUBLIC_QUEUE_IDX]) >= (RequiredPageNum)) 38 | return true; 39 | else 40 | return false; 41 | } 42 | 43 | void rtw_hal_sdio_update_tx_freepage( 44 | struct adapter *padapter, u8 PageIdx, u8 RequiredPageNum 45 | ) 46 | { 47 | struct hal_com_data *pHalData = GET_HAL_DATA(padapter); 48 | u8 DedicatedPgNum = 0; 49 | u8 RequiredPublicFreePgNum = 0; 50 | /* _irqL irql; */ 51 | 52 | /* spin_lock_bh(&pHalData->SdioTxFIFOFreePageLock); */ 53 | 54 | DedicatedPgNum = pHalData->SdioTxFIFOFreePage[PageIdx]; 55 | if (RequiredPageNum <= DedicatedPgNum) { 56 | pHalData->SdioTxFIFOFreePage[PageIdx] -= RequiredPageNum; 57 | } else { 58 | pHalData->SdioTxFIFOFreePage[PageIdx] = 0; 59 | RequiredPublicFreePgNum = RequiredPageNum - DedicatedPgNum; 60 | pHalData->SdioTxFIFOFreePage[PUBLIC_QUEUE_IDX] -= RequiredPublicFreePgNum; 61 | } 62 | 63 | /* spin_unlock_bh(&pHalData->SdioTxFIFOFreePageLock); */ 64 | } 65 | 66 | void rtw_hal_set_sdio_tx_max_length( 67 | struct adapter *padapter, u8 numHQ, u8 numNQ, u8 numLQ, u8 numPubQ 68 | ) 69 | { 70 | struct hal_com_data *pHalData = GET_HAL_DATA(padapter); 71 | u32 page_size; 72 | u32 lenHQ, lenNQ, lenLQ; 73 | 74 | rtw_hal_get_def_var(padapter, HAL_DEF_TX_PAGE_SIZE, &page_size); 75 | 76 | lenHQ = ((numHQ + numPubQ) >> 1) * page_size; 77 | lenNQ = ((numNQ + numPubQ) >> 1) * page_size; 78 | lenLQ = ((numLQ + numPubQ) >> 1) * page_size; 79 | 80 | pHalData->sdio_tx_max_len[HI_QUEUE_IDX] = 81 | (lenHQ > MAX_XMITBUF_SZ) ? MAX_XMITBUF_SZ : lenHQ; 82 | pHalData->sdio_tx_max_len[MID_QUEUE_IDX] = 83 | (lenNQ > MAX_XMITBUF_SZ) ? MAX_XMITBUF_SZ : lenNQ; 84 | pHalData->sdio_tx_max_len[LOW_QUEUE_IDX] = 85 | (lenLQ > MAX_XMITBUF_SZ) ? MAX_XMITBUF_SZ : lenLQ; 86 | } 87 | 88 | u32 rtw_hal_get_sdio_tx_max_length(struct adapter *padapter, u8 queue_idx) 89 | { 90 | struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(padapter); 91 | struct hal_com_data *pHalData = GET_HAL_DATA(padapter); 92 | u32 deviceId, max_len; 93 | 94 | 95 | deviceId = ffaddr2deviceId(pdvobjpriv, queue_idx); 96 | switch (deviceId) { 97 | case WLAN_TX_HIQ_DEVICE_ID: 98 | max_len = pHalData->sdio_tx_max_len[HI_QUEUE_IDX]; 99 | break; 100 | 101 | case WLAN_TX_MIQ_DEVICE_ID: 102 | max_len = pHalData->sdio_tx_max_len[MID_QUEUE_IDX]; 103 | break; 104 | 105 | case WLAN_TX_LOQ_DEVICE_ID: 106 | max_len = pHalData->sdio_tx_max_len[LOW_QUEUE_IDX]; 107 | break; 108 | 109 | default: 110 | max_len = pHalData->sdio_tx_max_len[MID_QUEUE_IDX]; 111 | break; 112 | } 113 | 114 | return max_len; 115 | } 116 | -------------------------------------------------------------------------------- /kite-arduino/CS_FIRMWARE/defs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file originates from Kite's Circuit Sword control board project. 3 | * Author: Kite/Geebles/kiteretro (Giles Burgess) 4 | * 5 | * THIS HEADER MUST REMAIN WITH THIS FILE AT ALL TIMES 6 | * 7 | * This firmware is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This firmware is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this repo. If not, see . 19 | */ 20 | 21 | // I2C Bits 22 | #define TCAADDR 0x24 23 | 24 | #define PORT_0 0 25 | #define PORT_1 1 26 | 27 | #define DIR_OUTPUT 0 28 | #define DIR_INPUT 1 29 | 30 | #define POLARITY_NORMAL 0 31 | #define POLARITY_INV 1 32 | 33 | #define CR_IN0 0x0 34 | #define CR_IN1 0x1 35 | #define CR_OUT0 0x2 36 | #define CR_OUT1 0x3 37 | #define CR_INV0 0x4 38 | #define CR_INV1 0x5 39 | #define CR_CFG0 0x6 40 | #define CR_CFG1 0x7 41 | 42 | // Button order 43 | #define B_UP 0 44 | #define B_DOWN 1 45 | #define B_LEFT 2 46 | #define B_RIGHT 3 47 | #define B_A 4 48 | #define B_B 5 49 | #define B_X 6 50 | #define B_Y 7 51 | #define B_START 8 52 | #define B_SELECT 9 53 | #define B_L1 10 54 | #define B_L2 11 55 | #define B_R1 12 56 | #define B_R2 13 57 | #define B_C1 14 58 | #define B_C2 15 59 | 60 | // Gamepad buttons assignment 61 | #define GP_A 1 62 | #define GP_B 2 63 | #define GP_X 3 64 | #define GP_Y 4 65 | #define GP_START 5 66 | #define GP_SELECT 6 67 | #define GP_L1 7 68 | #define GP_L2 8 69 | #define GP_R1 9 70 | #define GP_R2 10 71 | #define GP_C1 11 72 | #define GP_C2 12 73 | #define GP_VOLUP 13 74 | #define GP_VOLDOWN 14 75 | #define GP_DPAD_JOY_UP 15 76 | #define GP_DPAD_JOY_DOWN 16 77 | #define GP_DPAD_JOY_LEFT 17 78 | #define GP_DPAD_JOY_RIGHT 18 79 | 80 | // VOLUME 81 | #define VOL_UP 1 82 | #define VOL_DOWN 0 83 | 84 | #define VOL_MIN 0 85 | #define VOL_MAX 100 86 | #define VOL_INC 5 87 | #define VOL_DEFAULT 50 88 | 89 | #define VOL_A_MIN 20 90 | #define VOL_A_MAX 1000 91 | 92 | // BACKLIGHT 93 | #define BL_UP 1 94 | #define BL_DOWN 0 95 | 96 | #define BL_MIN 0 97 | #define BL_MAX 100 98 | #define BL_INC 10 99 | #define BL_PWM_MIN 235 // High val = LOW 100 | #define BL_PWM_MAX 0 // 0 = FULL ON 101 | 102 | // Button freeze settings 103 | #define FREEZE_DURATION 1000 104 | 105 | // EEPROM 106 | #define EEPROM_VERSION 5 107 | #define EEPROM_START 0 108 | 109 | // MISC 110 | #define LED_OFF 0 111 | #define LED_ON 1 112 | 113 | //List of models, MAX is 15 (4bits) 114 | #define MODEL_SAIO 1 115 | #define MODEL_CSORIGINAL 2 116 | #define MODEL_CSADVANCE 3 117 | #define MODEL_CSPOCKET 4 118 | 119 | //List of versions, MAX is 15 (4bits) 120 | #define HARDWARE_CSO_V1_1E 1 121 | #define HARDWARE_CSO_V1_2A 2 122 | 123 | #define MODECHECK_A0 1 //Read voltage on A0 to determine board power check 124 | #define MODECHECK_VBATHIGH 2 //Read the VBAT voltage to determine board power check, HIGH = OFF 125 | #define MODECHECK_VBATLOW 3 //Read the VBAT voltage to determine board power check, LOW = OFF 126 | #define MODECHECK_BOOTPIN 4 //Read a pin to check if booted or not 127 | 128 | #define LCD_26_320 1 129 | #define LCD_35_640 2 130 | #define LCD_32_800 3 131 | #define LCD_35_640_54P 4 132 | 133 | #define LCD_SUCCESS "OK" 134 | #define FAILED_TIMEOUT_NO_END "F1" 135 | #define FAILED_NOT_EVEN_ARGS "F2" 136 | 137 | #define STATUS_MODE 0 138 | #define STATUS_WIFI 1 139 | #define STATUS_AUD 2 140 | #define STATUS_INFO 3 141 | #define STATUS_AVOL 4 142 | #define STATUS_DPAD_JOY 5 143 | #define STATUS_DVOL 6 144 | 145 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/include/rtw_ioctl.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 | ******************************************************************************/ 15 | #ifndef _RTW_IOCTL_H_ 16 | #define _RTW_IOCTL_H_ 17 | 18 | /* 00 - Success */ 19 | /* 11 - Error */ 20 | #define STATUS_SUCCESS (0x00000000L) 21 | #define STATUS_PENDING (0x00000103L) 22 | 23 | #define STATUS_UNSUCCESSFUL (0xC0000001L) 24 | #define STATUS_INSUFFICIENT_RESOURCES (0xC000009AL) 25 | #define STATUS_NOT_SUPPORTED (0xC00000BBL) 26 | 27 | #define NDIS_STATUS_SUCCESS ((uint)STATUS_SUCCESS) 28 | #define NDIS_STATUS_PENDING ((uint)STATUS_PENDING) 29 | #define NDIS_STATUS_NOT_RECOGNIZED ((uint)0x00010001L) 30 | #define NDIS_STATUS_NOT_COPIED ((uint)0x00010002L) 31 | #define NDIS_STATUS_NOT_ACCEPTED ((uint)0x00010003L) 32 | #define NDIS_STATUS_CALL_ACTIVE ((uint)0x00010007L) 33 | 34 | #define NDIS_STATUS_FAILURE ((uint)STATUS_UNSUCCESSFUL) 35 | #define NDIS_STATUS_RESOURCES ((uint)STATUS_INSUFFICIENT_RESOURCES) 36 | #define NDIS_STATUS_CLOSING ((uint)0xC0010002L) 37 | #define NDIS_STATUS_BAD_VERSION ((uint)0xC0010004L) 38 | #define NDIS_STATUS_BAD_CHARACTERISTICS ((uint)0xC0010005L) 39 | #define NDIS_STATUS_ADAPTER_NOT_FOUND ((uint)0xC0010006L) 40 | #define NDIS_STATUS_OPEN_FAILED ((uint)0xC0010007L) 41 | #define NDIS_STATUS_DEVICE_FAILED ((uint)0xC0010008L) 42 | #define NDIS_STATUS_MULTICAST_FULL ((uint)0xC0010009L) 43 | #define NDIS_STATUS_MULTICAST_EXISTS ((uint)0xC001000AL) 44 | #define NDIS_STATUS_MULTICAST_NOT_FOUND ((uint)0xC001000BL) 45 | #define NDIS_STATUS_REQUEST_ABORTED ((uint)0xC001000CL) 46 | #define NDIS_STATUS_RESET_IN_PROGRESS ((uint)0xC001000DL) 47 | #define NDIS_STATUS_CLOSING_INDICATING ((uint)0xC001000EL) 48 | #define NDIS_STATUS_NOT_SUPPORTED ((uint)STATUS_NOT_SUPPORTED) 49 | #define NDIS_STATUS_INVALID_PACKET ((uint)0xC001000FL) 50 | #define NDIS_STATUS_OPEN_LIST_FULL ((uint)0xC0010010L) 51 | #define NDIS_STATUS_ADAPTER_NOT_READY ((uint)0xC0010011L) 52 | #define NDIS_STATUS_ADAPTER_NOT_OPEN ((uint)0xC0010012L) 53 | #define NDIS_STATUS_NOT_INDICATING ((uint)0xC0010013L) 54 | #define NDIS_STATUS_INVALID_LENGTH ((uint)0xC0010014L) 55 | #define NDIS_STATUS_INVALID_DATA ((uint)0xC0010015L) 56 | #define NDIS_STATUS_BUFFER_TOO_SHORT ((uint)0xC0010016L) 57 | #define NDIS_STATUS_INVALID_OID ((uint)0xC0010017L) 58 | #define NDIS_STATUS_ADAPTER_REMOVED ((uint)0xC0010018L) 59 | #define NDIS_STATUS_UNSUPPORTED_MEDIA ((uint)0xC0010019L) 60 | #define NDIS_STATUS_GROUP_ADDRESS_IN_USE ((uint)0xC001001AL) 61 | #define NDIS_STATUS_FILE_NOT_FOUND ((uint)0xC001001BL) 62 | #define NDIS_STATUS_ERROR_READING_FILE ((uint)0xC001001CL) 63 | #define NDIS_STATUS_ALREADY_MAPPED ((uint)0xC001001DL) 64 | #define NDIS_STATUS_RESOURCE_CONFLICT ((uint)0xC001001EL) 65 | #define NDIS_STATUS_NO_CABLE ((uint)0xC001001FL) 66 | 67 | #define NDIS_STATUS_INVALID_SAP ((uint)0xC0010020L) 68 | #define NDIS_STATUS_SAP_IN_USE ((uint)0xC0010021L) 69 | #define NDIS_STATUS_INVALID_ADDRESS ((uint)0xC0010022L) 70 | #define NDIS_STATUS_VC_NOT_ACTIVATED ((uint)0xC0010023L) 71 | #define NDIS_STATUS_DEST_OUT_OF_ORDER ((uint)0xC0010024L) /* cause 27 */ 72 | #define NDIS_STATUS_VC_NOT_AVAILABLE ((uint)0xC0010025L) /* cause 35, 45 */ 73 | #define NDIS_STATUS_CELLRATE_NOT_AVAILABLE ((uint)0xC0010026L) /* cause 37 */ 74 | #define NDIS_STATUS_INCOMPATABLE_QOS ((uint)0xC0010027L) /* cause 49 */ 75 | #define NDIS_STATUS_AAL_PARAMS_UNSUPPORTED ((uint)0xC0010028L) /* cause 93 */ 76 | #define NDIS_STATUS_NO_ROUTE_TO_DESTINATION ((uint)0xC0010029L) /* cause 3 */ 77 | 78 | extern struct iw_handler_def rtw_handlers_def; 79 | 80 | #endif /* #ifndef __INC_CEINFO_ */ 81 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/hal/Hal8723BPwrSeq.c: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright(c) 2007 - 2012 Realtek Corporation. All rights reserved. 4 | * 5 | * This program is free software; you can redistribute it and/or modify it 6 | * under the terms of version 2 of the GNU General Public License as 7 | * published by the Free Software Foundation. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | * more details. 13 | * 14 | ******************************************************************************/ 15 | 16 | /* 17 | * 18 | This file includes all kinds of Power Action event for RTL8723B 19 | and corresponding hardware configurtions which are released from HW SD. 20 | 21 | Major Change History: 22 | When Who What 23 | ---------- --------------- ------------------------------- 24 | 2011-08-08 Roger Create. 25 | 26 | */ 27 | 28 | #include "Hal8723BPwrSeq.h" 29 | 30 | /* drivers should parse below arrays and do the corresponding actions */ 31 | /* 3 Power on Array */ 32 | WLAN_PWR_CFG rtl8723B_power_on_flow[ 33 | RTL8723B_TRANS_CARDEMU_TO_ACT_STEPS+ 34 | RTL8723B_TRANS_END_STEPS 35 | ] = { 36 | RTL8723B_TRANS_CARDEMU_TO_ACT 37 | RTL8723B_TRANS_END 38 | }; 39 | 40 | /* 3Radio off GPIO Array */ 41 | WLAN_PWR_CFG rtl8723B_radio_off_flow[ 42 | RTL8723B_TRANS_ACT_TO_CARDEMU_STEPS+ 43 | RTL8723B_TRANS_END_STEPS 44 | ] = { 45 | RTL8723B_TRANS_ACT_TO_CARDEMU 46 | RTL8723B_TRANS_END 47 | }; 48 | 49 | /* 3Card Disable Array */ 50 | WLAN_PWR_CFG rtl8723B_card_disable_flow[ 51 | RTL8723B_TRANS_ACT_TO_CARDEMU_STEPS+ 52 | RTL8723B_TRANS_CARDEMU_TO_PDN_STEPS+ 53 | RTL8723B_TRANS_END_STEPS 54 | ] = { 55 | RTL8723B_TRANS_ACT_TO_CARDEMU 56 | RTL8723B_TRANS_CARDEMU_TO_CARDDIS 57 | RTL8723B_TRANS_END 58 | }; 59 | 60 | /* 3 Card Enable Array */ 61 | WLAN_PWR_CFG rtl8723B_card_enable_flow[ 62 | RTL8723B_TRANS_ACT_TO_CARDEMU_STEPS+ 63 | RTL8723B_TRANS_CARDEMU_TO_PDN_STEPS+ 64 | RTL8723B_TRANS_END_STEPS 65 | ] = { 66 | RTL8723B_TRANS_CARDDIS_TO_CARDEMU 67 | RTL8723B_TRANS_CARDEMU_TO_ACT 68 | RTL8723B_TRANS_END 69 | }; 70 | 71 | /* 3Suspend Array */ 72 | WLAN_PWR_CFG rtl8723B_suspend_flow[ 73 | RTL8723B_TRANS_ACT_TO_CARDEMU_STEPS+ 74 | RTL8723B_TRANS_CARDEMU_TO_SUS_STEPS+ 75 | RTL8723B_TRANS_END_STEPS 76 | ] = { 77 | RTL8723B_TRANS_ACT_TO_CARDEMU 78 | RTL8723B_TRANS_CARDEMU_TO_SUS 79 | RTL8723B_TRANS_END 80 | }; 81 | 82 | /* 3 Resume Array */ 83 | WLAN_PWR_CFG rtl8723B_resume_flow[ 84 | RTL8723B_TRANS_ACT_TO_CARDEMU_STEPS+ 85 | RTL8723B_TRANS_CARDEMU_TO_SUS_STEPS+ 86 | RTL8723B_TRANS_END_STEPS 87 | ] = { 88 | RTL8723B_TRANS_SUS_TO_CARDEMU 89 | RTL8723B_TRANS_CARDEMU_TO_ACT 90 | RTL8723B_TRANS_END 91 | }; 92 | 93 | /* 3HWPDN Array */ 94 | WLAN_PWR_CFG rtl8723B_hwpdn_flow[ 95 | RTL8723B_TRANS_ACT_TO_CARDEMU_STEPS+ 96 | RTL8723B_TRANS_CARDEMU_TO_PDN_STEPS+ 97 | RTL8723B_TRANS_END_STEPS 98 | ] = { 99 | RTL8723B_TRANS_ACT_TO_CARDEMU 100 | RTL8723B_TRANS_CARDEMU_TO_PDN 101 | RTL8723B_TRANS_END 102 | }; 103 | 104 | /* 3 Enter LPS */ 105 | WLAN_PWR_CFG rtl8723B_enter_lps_flow[ 106 | RTL8723B_TRANS_ACT_TO_LPS_STEPS+RTL8723B_TRANS_END_STEPS 107 | ] = { 108 | /* FW behavior */ 109 | RTL8723B_TRANS_ACT_TO_LPS 110 | RTL8723B_TRANS_END 111 | }; 112 | 113 | /* 3 Leave LPS */ 114 | WLAN_PWR_CFG rtl8723B_leave_lps_flow[ 115 | RTL8723B_TRANS_LPS_TO_ACT_STEPS+RTL8723B_TRANS_END_STEPS 116 | ] = { 117 | /* FW behavior */ 118 | RTL8723B_TRANS_LPS_TO_ACT 119 | RTL8723B_TRANS_END 120 | }; 121 | 122 | /* 3 Enter SW LPS */ 123 | WLAN_PWR_CFG rtl8723B_enter_swlps_flow[ 124 | RTL8723B_TRANS_ACT_TO_SWLPS_STEPS+RTL8723B_TRANS_END_STEPS 125 | ] = { 126 | /* SW behavior */ 127 | RTL8723B_TRANS_ACT_TO_SWLPS 128 | RTL8723B_TRANS_END 129 | }; 130 | 131 | /* 3 Leave SW LPS */ 132 | WLAN_PWR_CFG rtl8723B_leave_swlps_flow[ 133 | RTL8723B_TRANS_SWLPS_TO_ACT_STEPS+RTL8723B_TRANS_END_STEPS 134 | ] = { 135 | /* SW behavior */ 136 | RTL8723B_TRANS_SWLPS_TO_ACT 137 | RTL8723B_TRANS_END 138 | }; 139 | -------------------------------------------------------------------------------- /cs-tester/cs-tester.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # 4 | # This file originates from Kite's Circuit Sword control board project. 5 | # Author: Kite (Giles Burgess) 6 | # 7 | # THIS HEADER MUST REMAIN WITH THIS FILE AT ALL TIMES 8 | # 9 | # This firmware is free software: you can redistribute it and/or modify 10 | # it under the terms of the GNU General Public License as published by 11 | # the Free Software Foundation, either version 3 of the License, or 12 | # (at your option) any later version. 13 | # 14 | # This firmware is distributed in the hope that it will be useful, 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | # GNU General Public License for more details. 18 | # 19 | # You should have received a copy of the GNU General Public License 20 | # along with this repo. If not, see . 21 | # 22 | 23 | # Setup 24 | ############################# 25 | 26 | import RPi.GPIO as GPIO 27 | import subprocess 28 | import time 29 | import datetime 30 | import os.path 31 | 32 | bindir = "/home/pi/Circuit-Sword/cs-tester/" 33 | 34 | # Hardware variables 35 | pi_shdn = 37 36 | 37 | # Init GPIO pins 38 | GPIO.setwarnings(False) 39 | GPIO.setmode(GPIO.BCM) 40 | GPIO.setup(pi_shdn, GPIO.IN) 41 | 42 | class bcolors: 43 | HEADER = '\033[95m' 44 | OKBLUE = '\033[94m' 45 | OKGREEN = '\033[92m' 46 | WARNING = '\033[93m' 47 | FAIL = '\033[91m' 48 | ENDC = '\033[0m' 49 | BOLD = '\033[1m' 50 | UNDERLINE = '\033[4m' 51 | 52 | print "INFO: Started.\n" 53 | 54 | # Test for USB devices 55 | ############################# 56 | def testUSB(): 57 | lsusb = subprocess.Popen(["/usr/bin/lsusb"], stdout=subprocess.PIPE).communicate()[0] 58 | print "LSUSB OUTPUT: \n" + str(lsusb) + "\n\n" 59 | 60 | if "Atmel Corp." in lsusb: 61 | print bcolors.OKGREEN + "USB ARDUINO = [ OK ]" + bcolors.ENDC 62 | else: 63 | if "Leonardo" in lsusb: 64 | print bcolors.OKGREEN + "USB ARDUINO = [ OK ]" + bcolors.ENDC 65 | else: 66 | print bcolors.FAIL + "USB ARDUINO = [FAIL]" + bcolors.ENDC 67 | 68 | if "C-Media Electronics" in lsusb: 69 | print bcolors.OKGREEN + "USB AUDIO = [ OK ]" + bcolors.ENDC 70 | else: 71 | print bcolors.FAIL + "USB AUDIO = [FAIL]" + bcolors.ENDC 72 | 73 | if "erminus Technology Inc" in lsusb: 74 | print bcolors.OKGREEN + "USB HUB = [ OK ]" + bcolors.ENDC 75 | else: 76 | print bcolors.FAIL + "USB HUB = [FAIL]" + bcolors.ENDC 77 | 78 | if os.path.exists("/dev/input/js0"): 79 | print bcolors.OKGREEN + "JOYSTICK = [ OK ]" + bcolors.ENDC 80 | else: 81 | print bcolors.FAIL + "JOYSTICK = [FAIL]" + bcolors.ENDC 82 | 83 | # Test GPIO 84 | ############################# 85 | def testGPIO(): 86 | shdnstate = not GPIO.input(pi_shdn) 87 | if (shdnstate): 88 | print bcolors.FAIL + "GPIO SHDN = [ OFF]" + bcolors.ENDC 89 | else: 90 | print bcolors.OKGREEN + "GPIO SHDN = [ ON ]" + bcolors.ENDC 91 | 92 | # Test LCD 93 | ############################# 94 | def testLCD(): 95 | print bcolors.OKBLUE + "TEST LCD.." + bcolors.ENDC 96 | pngview_proc = subprocess.Popen([bindir + "pngview", "-l", "99999", bindir + "COLOUR.png", "-x", "0", "-y", "0"]) 97 | time.sleep(1) 98 | pngview_poll = pngview_proc.poll() 99 | if (pngview_poll): 100 | print "ERROR: Failed to start PNGVIEW, got return code [" + str(pngview_poll) + "]\n" 101 | else: 102 | time.sleep(3) 103 | pngview_proc.terminate() 104 | 105 | # Test AUDIO 106 | ############################# 107 | def testAUDIO(): 108 | print bcolors.OKBLUE + "TEST AUDIO L.." + bcolors.ENDC 109 | aplay_proc = subprocess.Popen(["aplay", bindir + "audiocheck_l.wav"]) 110 | time.sleep(2) 111 | print bcolors.OKBLUE + "TEST AUDIO R.." + bcolors.ENDC 112 | aplay_proc = subprocess.Popen(["aplay", bindir + "audiocheck_r.wav"]) 113 | time.sleep(2) 114 | 115 | # LOGIC 116 | ############################# 117 | # Main loop 118 | try: 119 | while 1: 120 | print "\n\n\n------------------------------" 121 | print datetime.datetime.now().time() 122 | print "------------------------------" 123 | 124 | testUSB() 125 | testGPIO() 126 | time.sleep(3) 127 | 128 | testLCD() 129 | #testAUDIO() 130 | 131 | time.sleep(1); 132 | 133 | except KeyboardInterrupt: 134 | print "Quitting.." -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/include/rtw_eeprom.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 | ******************************************************************************/ 15 | #ifndef __RTW_EEPROM_H__ 16 | #define __RTW_EEPROM_H__ 17 | 18 | 19 | #define RTL8712_EEPROM_ID 0x8712 20 | /* define EEPROM_MAX_SIZE 256 */ 21 | 22 | #define HWSET_MAX_SIZE_128 128 23 | #define HWSET_MAX_SIZE_256 256 24 | #define HWSET_MAX_SIZE_512 512 25 | 26 | #define EEPROM_MAX_SIZE HWSET_MAX_SIZE_512 27 | 28 | #define CLOCK_RATE 50 /* 100us */ 29 | 30 | /* EEPROM opcodes */ 31 | #define EEPROM_READ_OPCODE 06 32 | #define EEPROM_WRITE_OPCODE 05 33 | #define EEPROM_ERASE_OPCODE 07 34 | #define EEPROM_EWEN_OPCODE 19 /* Erase/write enable */ 35 | #define EEPROM_EWDS_OPCODE 16 /* Erase/write disable */ 36 | 37 | /* Country codes */ 38 | #define USA 0x555320 39 | #define EUROPE 0x1 /* temp, should be provided later */ 40 | #define JAPAN 0x2 /* temp, should be provided later */ 41 | 42 | #define eeprom_cis0_sz 17 43 | #define eeprom_cis1_sz 50 44 | 45 | /* */ 46 | /* Customer ID, note that: */ 47 | /* This variable is initiailzed through EEPROM or registry, */ 48 | /* however, its definition may be different with that in EEPROM for */ 49 | /* EEPROM size consideration. So, we have to perform proper translation between them. */ 50 | /* Besides, CustomerID of registry has precedence of that of EEPROM. */ 51 | /* defined below. 060703, by rcnjko. */ 52 | /* */ 53 | typedef enum _RT_CUSTOMER_ID 54 | { 55 | RT_CID_DEFAULT = 0, 56 | RT_CID_8187_ALPHA0 = 1, 57 | RT_CID_8187_SERCOMM_PS = 2, 58 | RT_CID_8187_HW_LED = 3, 59 | RT_CID_8187_NETGEAR = 4, 60 | RT_CID_WHQL = 5, 61 | RT_CID_819x_CAMEO = 6, 62 | RT_CID_819x_RUNTOP = 7, 63 | RT_CID_819x_Senao = 8, 64 | RT_CID_TOSHIBA = 9, /* Merge by Jacken, 2008/01/31. */ 65 | RT_CID_819x_Netcore = 10, 66 | RT_CID_Nettronix = 11, 67 | RT_CID_DLINK = 12, 68 | RT_CID_PRONET = 13, 69 | RT_CID_COREGA = 14, 70 | RT_CID_CHINA_MOBILE = 15, 71 | RT_CID_819x_ALPHA = 16, 72 | RT_CID_819x_Sitecom = 17, 73 | RT_CID_CCX = 18, /* It's set under CCX logo test and isn't demanded for CCX functions, but for test behavior like retry limit and tx report. By Bruce, 2009-02-17. */ 74 | RT_CID_819x_Lenovo = 19, 75 | RT_CID_819x_QMI = 20, 76 | RT_CID_819x_Edimax_Belkin = 21, 77 | RT_CID_819x_Sercomm_Belkin = 22, 78 | RT_CID_819x_CAMEO1 = 23, 79 | RT_CID_819x_MSI = 24, 80 | RT_CID_819x_Acer = 25, 81 | RT_CID_819x_AzWave_ASUS = 26, 82 | RT_CID_819x_AzWave = 27, /* For AzWave in PCIe, The ID is AzWave use and not only Asus */ 83 | RT_CID_819x_HP = 28, 84 | RT_CID_819x_WNC_COREGA = 29, 85 | RT_CID_819x_Arcadyan_Belkin = 30, 86 | RT_CID_819x_SAMSUNG = 31, 87 | RT_CID_819x_CLEVO = 32, 88 | RT_CID_819x_DELL = 33, 89 | RT_CID_819x_PRONETS = 34, 90 | RT_CID_819x_Edimax_ASUS = 35, 91 | RT_CID_NETGEAR = 36, 92 | RT_CID_PLANEX = 37, 93 | RT_CID_CC_C = 38, 94 | RT_CID_819x_Xavi = 39, 95 | RT_CID_LENOVO_CHINA = 40, 96 | RT_CID_INTEL_CHINA = 41, 97 | RT_CID_TPLINK_HPWR = 42, 98 | RT_CID_819x_Sercomm_Netgear = 43, 99 | RT_CID_819x_ALPHA_Dlink = 44,/* add by ylb 20121012 for customer led for alpha */ 100 | RT_CID_WNC_NEC = 45,/* add by page for NEC */ 101 | RT_CID_DNI_BUFFALO = 46,/* add by page for NEC */ 102 | }RT_CUSTOMER_ID, *PRT_CUSTOMER_ID; 103 | 104 | struct eeprom_priv 105 | { 106 | u8 bautoload_fail_flag; 107 | u8 bloadfile_fail_flag; 108 | u8 bloadmac_fail_flag; 109 | u8 EepromOrEfuse; 110 | 111 | u8 mac_addr[6]; /* PermanentAddress */ 112 | 113 | u16 channel_plan; 114 | u16 CustomerID; 115 | 116 | u8 efuse_eeprom_data[EEPROM_MAX_SIZE]; /* 92C:256bytes, 88E:512bytes, we use union set (512bytes) */ 117 | u8 adjuseVoltageVal; 118 | 119 | u8 EEPROMRFGainOffset; 120 | u8 EEPROMRFGainVal; 121 | 122 | u8 sdio_setting; 123 | u32 ocr; 124 | u8 cis0[eeprom_cis0_sz]; 125 | u8 cis1[eeprom_cis1_sz]; 126 | }; 127 | 128 | #endif /* __RTL871X_EEPROM_H__ */ 129 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/os_dep/wifi_regd.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0 2 | /****************************************************************************** 3 | * 4 | * Copyright(c) 2009-2010 Realtek Corporation. 5 | * 6 | *****************************************************************************/ 7 | 8 | #include 9 | #include 10 | 11 | #include 12 | 13 | /* 14 | * REG_RULE(freq start, freq end, bandwidth, max gain, eirp, reg_flags) 15 | */ 16 | 17 | /* 18 | * Only these channels all allow active 19 | * scan on all world regulatory domains 20 | */ 21 | 22 | /* 2G chan 01 - chan 11 */ 23 | #define RTW_2GHZ_CH01_11 \ 24 | REG_RULE(2412 - 10, 2462 + 10, 40, 0, 20, 0) 25 | 26 | /* 27 | * We enable active scan on these a case 28 | * by case basis by regulatory domain 29 | */ 30 | 31 | /* 2G chan 12 - chan 13, PASSIV SCAN */ 32 | #define RTW_2GHZ_CH12_13 \ 33 | REG_RULE(2467 - 10, 2472 + 10, 40, 0, 20, \ 34 | NL80211_RRF_PASSIVE_SCAN) 35 | 36 | /* 2G chan 14, PASSIVS SCAN, NO OFDM (B only) */ 37 | #define RTW_2GHZ_CH14 \ 38 | REG_RULE(2484 - 10, 2484 + 10, 40, 0, 20, \ 39 | NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_OFDM) 40 | 41 | static const struct ieee80211_regdomain rtw_regdom_rd = { 42 | .n_reg_rules = 3, 43 | .alpha2 = "99", 44 | .reg_rules = { 45 | RTW_2GHZ_CH01_11, 46 | RTW_2GHZ_CH12_13, 47 | } 48 | }; 49 | 50 | static int rtw_ieee80211_channel_to_frequency(int chan, int band) 51 | { 52 | /* see 802.11 17.3.8.3.2 and Annex J 53 | * there are overlapping channel numbers in 5GHz and 2GHz bands 54 | */ 55 | 56 | /* NL80211_BAND_2GHZ */ 57 | if (chan == 14) 58 | return 2484; 59 | else if (chan < 14) 60 | return 2407 + chan * 5; 61 | else 62 | return 0; /* not supported */ 63 | } 64 | 65 | static void _rtw_reg_apply_flags(struct wiphy *wiphy) 66 | { 67 | struct adapter *padapter = wiphy_to_adapter(wiphy); 68 | struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; 69 | RT_CHANNEL_INFO *channel_set = pmlmeext->channel_set; 70 | u8 max_chan_nums = pmlmeext->max_chan_nums; 71 | 72 | struct ieee80211_supported_band *sband; 73 | struct ieee80211_channel *ch; 74 | unsigned int i, j; 75 | u16 channel; 76 | u32 freq; 77 | 78 | /* all channels disable */ 79 | for (i = 0; i < NUM_NL80211_BANDS; i++) { 80 | sband = wiphy->bands[i]; 81 | 82 | if (sband) { 83 | for (j = 0; j < sband->n_channels; j++) { 84 | ch = &sband->channels[j]; 85 | 86 | if (ch) 87 | ch->flags = IEEE80211_CHAN_DISABLED; 88 | } 89 | } 90 | } 91 | 92 | /* channels apply by channel plans. */ 93 | for (i = 0; i < max_chan_nums; i++) { 94 | channel = channel_set[i].ChannelNum; 95 | freq = 96 | rtw_ieee80211_channel_to_frequency(channel, 97 | NL80211_BAND_2GHZ); 98 | 99 | ch = ieee80211_get_channel(wiphy, freq); 100 | if (ch) { 101 | if (channel_set[i].ScanType == SCAN_PASSIVE) 102 | ch->flags = IEEE80211_CHAN_NO_IR; 103 | else 104 | ch->flags = 0; 105 | } 106 | } 107 | } 108 | 109 | static int _rtw_reg_notifier_apply(struct wiphy *wiphy, 110 | struct regulatory_request *request, 111 | struct rtw_regulatory *reg) 112 | { 113 | /* Hard code flags */ 114 | _rtw_reg_apply_flags(wiphy); 115 | return 0; 116 | } 117 | 118 | static const struct ieee80211_regdomain *_rtw_regdomain_select(struct 119 | rtw_regulatory 120 | *reg) 121 | { 122 | return &rtw_regdom_rd; 123 | } 124 | 125 | static void _rtw_regd_init_wiphy(struct rtw_regulatory *reg, 126 | struct wiphy *wiphy, 127 | void (*reg_notifier)(struct wiphy *wiphy, 128 | struct 129 | regulatory_request * 130 | request)) 131 | { 132 | const struct ieee80211_regdomain *regd; 133 | 134 | wiphy->reg_notifier = reg_notifier; 135 | 136 | wiphy->regulatory_flags |= REGULATORY_CUSTOM_REG; 137 | wiphy->regulatory_flags &= ~REGULATORY_STRICT_REG; 138 | wiphy->regulatory_flags &= ~REGULATORY_DISABLE_BEACON_HINTS; 139 | 140 | regd = _rtw_regdomain_select(reg); 141 | wiphy_apply_custom_regulatory(wiphy, regd); 142 | 143 | /* Hard code flags */ 144 | _rtw_reg_apply_flags(wiphy); 145 | } 146 | 147 | int rtw_regd_init(struct adapter *padapter, 148 | void (*reg_notifier)(struct wiphy *wiphy, 149 | struct regulatory_request *request)) 150 | { 151 | struct wiphy *wiphy = padapter->rtw_wdev->wiphy; 152 | 153 | _rtw_regd_init_wiphy(NULL, wiphy, reg_notifier); 154 | 155 | return 0; 156 | } 157 | 158 | void rtw_reg_notifier(struct wiphy *wiphy, struct regulatory_request *request) 159 | { 160 | struct rtw_regulatory *reg = NULL; 161 | 162 | DBG_8192C("%s\n", __func__); 163 | 164 | _rtw_reg_notifier_apply(wiphy, request, reg); 165 | } 166 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/include/HalPwrSeqCmd.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 | ******************************************************************************/ 15 | #ifndef __HALPWRSEQCMD_H__ 16 | #define __HALPWRSEQCMD_H__ 17 | 18 | #include 19 | 20 | /*---------------------------------------------*/ 21 | /* 3 The value of cmd: 4 bits */ 22 | /*---------------------------------------------*/ 23 | #define PWR_CMD_READ 0x00 24 | /* offset: the read register offset */ 25 | /* msk: the mask of the read value */ 26 | /* value: N/A, left by 0 */ 27 | /* note: dirver shall implement this function by read & msk */ 28 | 29 | #define PWR_CMD_WRITE 0x01 30 | /* offset: the read register offset */ 31 | /* msk: the mask of the write bits */ 32 | /* value: write value */ 33 | /* note: driver shall implement this cmd by read & msk after write */ 34 | 35 | #define PWR_CMD_POLLING 0x02 36 | /* offset: the read register offset */ 37 | /* msk: the mask of the polled value */ 38 | /* value: the value to be polled, masked by the msd field. */ 39 | /* note: driver shall implement this cmd by */ 40 | /* do{ */ 41 | /* if ((Read(offset) & msk) == (value & msk)) */ 42 | /* break; */ 43 | /* } while (not timeout); */ 44 | 45 | #define PWR_CMD_DELAY 0x03 46 | /* offset: the value to delay */ 47 | /* msk: N/A */ 48 | /* value: the unit of delay, 0: us, 1: ms */ 49 | 50 | #define PWR_CMD_END 0x04 51 | /* offset: N/A */ 52 | /* msk: N/A */ 53 | /* value: N/A */ 54 | 55 | /*---------------------------------------------*/ 56 | /* 3 The value of base: 4 bits */ 57 | /*---------------------------------------------*/ 58 | /* define the base address of each block */ 59 | #define PWR_BASEADDR_MAC 0x00 60 | #define PWR_BASEADDR_USB 0x01 61 | #define PWR_BASEADDR_PCIE 0x02 62 | #define PWR_BASEADDR_SDIO 0x03 63 | 64 | /*---------------------------------------------*/ 65 | /* 3 The value of interface_msk: 4 bits */ 66 | /*---------------------------------------------*/ 67 | #define PWR_INTF_SDIO_MSK BIT(0) 68 | #define PWR_INTF_USB_MSK BIT(1) 69 | #define PWR_INTF_PCI_MSK BIT(2) 70 | #define PWR_INTF_ALL_MSK (BIT(0)|BIT(1)|BIT(2)|BIT(3)) 71 | 72 | /*---------------------------------------------*/ 73 | /* 3 The value of fab_msk: 4 bits */ 74 | /*---------------------------------------------*/ 75 | #define PWR_FAB_TSMC_MSK BIT(0) 76 | #define PWR_FAB_UMC_MSK BIT(1) 77 | #define PWR_FAB_ALL_MSK (BIT(0)|BIT(1)|BIT(2)|BIT(3)) 78 | 79 | /*---------------------------------------------*/ 80 | /* 3 The value of cut_msk: 8 bits */ 81 | /*---------------------------------------------*/ 82 | #define PWR_CUT_TESTCHIP_MSK BIT(0) 83 | #define PWR_CUT_A_MSK BIT(1) 84 | #define PWR_CUT_B_MSK BIT(2) 85 | #define PWR_CUT_C_MSK BIT(3) 86 | #define PWR_CUT_D_MSK BIT(4) 87 | #define PWR_CUT_E_MSK BIT(5) 88 | #define PWR_CUT_F_MSK BIT(6) 89 | #define PWR_CUT_G_MSK BIT(7) 90 | #define PWR_CUT_ALL_MSK 0xFF 91 | 92 | 93 | typedef enum _PWRSEQ_CMD_DELAY_UNIT_ 94 | { 95 | PWRSEQ_DELAY_US, 96 | PWRSEQ_DELAY_MS, 97 | } PWRSEQ_DELAY_UNIT; 98 | 99 | typedef struct _WL_PWR_CFG_ 100 | { 101 | u16 offset; 102 | u8 cut_msk; 103 | u8 fab_msk:4; 104 | u8 interface_msk:4; 105 | u8 base:4; 106 | u8 cmd:4; 107 | u8 msk; 108 | u8 value; 109 | } WLAN_PWR_CFG, *PWLAN_PWR_CFG; 110 | 111 | 112 | #define GET_PWR_CFG_OFFSET(__PWR_CMD) __PWR_CMD.offset 113 | #define GET_PWR_CFG_CUT_MASK(__PWR_CMD) __PWR_CMD.cut_msk 114 | #define GET_PWR_CFG_FAB_MASK(__PWR_CMD) __PWR_CMD.fab_msk 115 | #define GET_PWR_CFG_INTF_MASK(__PWR_CMD) __PWR_CMD.interface_msk 116 | #define GET_PWR_CFG_BASE(__PWR_CMD) __PWR_CMD.base 117 | #define GET_PWR_CFG_CMD(__PWR_CMD) __PWR_CMD.cmd 118 | #define GET_PWR_CFG_MASK(__PWR_CMD) __PWR_CMD.msk 119 | #define GET_PWR_CFG_VALUE(__PWR_CMD) __PWR_CMD.value 120 | 121 | 122 | /* */ 123 | /* Prototype of protected function. */ 124 | /* */ 125 | u8 HalPwrSeqCmdParsing( 126 | struct adapter * padapter, 127 | u8 CutVersion, 128 | u8 FabVersion, 129 | u8 InterfaceType, 130 | WLAN_PWR_CFG PwrCfgCmd[]); 131 | 132 | #endif 133 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/hal/odm_HWConfig.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 | ******************************************************************************/ 15 | 16 | 17 | #ifndef __HALHWOUTSRC_H__ 18 | #define __HALHWOUTSRC_H__ 19 | 20 | 21 | /*--------------------------Define -------------------------------------------*/ 22 | /* define READ_NEXT_PAIR(v1, v2, i) do { i += 2; v1 = Array[i]; v2 = Array[i+1]; } while (0) */ 23 | #define AGC_DIFF_CONFIG_MP(ic, band) (ODM_ReadAndConfig_MP_##ic##_AGC_TAB_DIFF(pDM_Odm, Array_MP_##ic##_AGC_TAB_DIFF_##band, \ 24 | sizeof(Array_MP_##ic##_AGC_TAB_DIFF_##band)/sizeof(u32))) 25 | #define AGC_DIFF_CONFIG_TC(ic, band) (ODM_ReadAndConfig_TC_##ic##_AGC_TAB_DIFF(pDM_Odm, Array_TC_##ic##_AGC_TAB_DIFF_##band, \ 26 | sizeof(Array_TC_##ic##_AGC_TAB_DIFF_##band)/sizeof(u32))) 27 | 28 | #define AGC_DIFF_CONFIG(ic, band)\ 29 | do {\ 30 | if (pDM_Odm->bIsMPChip)\ 31 | AGC_DIFF_CONFIG_MP(ic, band);\ 32 | else\ 33 | AGC_DIFF_CONFIG_TC(ic, band);\ 34 | } while (0) 35 | 36 | 37 | /* */ 38 | /* structure and define */ 39 | /* */ 40 | 41 | typedef struct _Phy_Rx_AGC_Info { 42 | #if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) 43 | u8 gain:7, trsw:1; 44 | #else 45 | u8 trsw:1, gain:7; 46 | #endif 47 | } PHY_RX_AGC_INFO_T, *pPHY_RX_AGC_INFO_T; 48 | 49 | typedef struct _Phy_Status_Rpt_8192cd { 50 | PHY_RX_AGC_INFO_T path_agc[2]; 51 | u8 ch_corr[2]; 52 | u8 cck_sig_qual_ofdm_pwdb_all; 53 | u8 cck_agc_rpt_ofdm_cfosho_a; 54 | u8 cck_rpt_b_ofdm_cfosho_b; 55 | u8 rsvd_1;/* ch_corr_msb; */ 56 | u8 noise_power_db_msb; 57 | s8 path_cfotail[2]; 58 | u8 pcts_mask[2]; 59 | s8 stream_rxevm[2]; 60 | u8 path_rxsnr[2]; 61 | u8 noise_power_db_lsb; 62 | u8 rsvd_2[3]; 63 | u8 stream_csi[2]; 64 | u8 stream_target_csi[2]; 65 | s8 sig_evm; 66 | u8 rsvd_3; 67 | 68 | #if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) 69 | u8 antsel_rx_keep_2:1; /* ex_intf_flg:1; */ 70 | u8 sgi_en:1; 71 | u8 rxsc:2; 72 | u8 idle_long:1; 73 | u8 r_ant_train_en:1; 74 | u8 ant_sel_b:1; 75 | u8 ant_sel:1; 76 | #else /* _BIG_ENDIAN_ */ 77 | u8 ant_sel:1; 78 | u8 ant_sel_b:1; 79 | u8 r_ant_train_en:1; 80 | u8 idle_long:1; 81 | u8 rxsc:2; 82 | u8 sgi_en:1; 83 | u8 antsel_rx_keep_2:1; /* ex_intf_flg:1; */ 84 | #endif 85 | } PHY_STATUS_RPT_8192CD_T, *PPHY_STATUS_RPT_8192CD_T; 86 | 87 | 88 | typedef struct _Phy_Status_Rpt_8812 { 89 | /* 2012.05.24 LukeLee: This structure should take big/little endian in consideration later..... */ 90 | 91 | /* DWORD 0 */ 92 | u8 gain_trsw[2]; 93 | #if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) 94 | u16 chl_num:10; 95 | u16 sub_chnl:4; 96 | u16 r_RFMOD:2; 97 | #else /* _BIG_ENDIAN_ */ 98 | u16 r_RFMOD:2; 99 | u16 sub_chnl:4; 100 | u16 chl_num:10; 101 | #endif 102 | 103 | /* DWORD 1 */ 104 | u8 pwdb_all; 105 | u8 cfosho[4]; /* DW 1 byte 1 DW 2 byte 0 */ 106 | 107 | /* DWORD 2 */ 108 | s8 cfotail[4]; /* DW 2 byte 1 DW 3 byte 0 */ 109 | 110 | /* DWORD 3 */ 111 | s8 rxevm[2]; /* DW 3 byte 1 DW 3 byte 2 */ 112 | s8 rxsnr[2]; /* DW 3 byte 3 DW 4 byte 0 */ 113 | 114 | /* DWORD 4 */ 115 | u8 PCTS_MSK_RPT[2]; 116 | u8 pdsnr[2]; /* DW 4 byte 3 DW 5 Byte 0 */ 117 | 118 | /* DWORD 5 */ 119 | u8 csi_current[2]; 120 | u8 rx_gain_c; 121 | 122 | /* DWORD 6 */ 123 | u8 rx_gain_d; 124 | s8 sigevm; 125 | u8 resvd_0; 126 | u8 antidx_anta:3; 127 | u8 antidx_antb:3; 128 | u8 resvd_1:2; 129 | } PHY_STATUS_RPT_8812_T, *PPHY_STATUS_RPT_8812_T; 130 | 131 | 132 | void ODM_PhyStatusQuery( 133 | PDM_ODM_T pDM_Odm, 134 | PODM_PHY_INFO_T pPhyInfo, 135 | u8 *pPhyStatus, 136 | PODM_PACKET_INFO_T pPktinfo 137 | ); 138 | 139 | HAL_STATUS ODM_ConfigRFWithTxPwrTrackHeaderFile(PDM_ODM_T pDM_Odm); 140 | 141 | HAL_STATUS ODM_ConfigRFWithHeaderFile( 142 | PDM_ODM_T pDM_Odm, 143 | ODM_RF_Config_Type ConfigType, 144 | ODM_RF_RADIO_PATH_E eRFPath 145 | ); 146 | 147 | HAL_STATUS ODM_ConfigBBWithHeaderFile( 148 | PDM_ODM_T pDM_Odm, ODM_BB_Config_Type ConfigType 149 | ); 150 | 151 | HAL_STATUS ODM_ConfigMACWithHeaderFile(PDM_ODM_T pDM_Odm); 152 | 153 | HAL_STATUS ODM_ConfigFWWithHeaderFile( 154 | PDM_ODM_T pDM_Odm, 155 | ODM_FW_Config_Type ConfigType, 156 | u8 *pFirmware, 157 | u32 *pSize 158 | ); 159 | 160 | s32 odm_SignalScaleMapping(PDM_ODM_T pDM_Odm, s32 CurrSig); 161 | 162 | #endif 163 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/include/HalVerDef.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 | ******************************************************************************/ 15 | #ifndef __HAL_VERSION_DEF_H__ 16 | #define __HAL_VERSION_DEF_H__ 17 | 18 | /* HAL_IC_TYPE_E */ 19 | typedef enum tag_HAL_IC_Type_Definition 20 | { 21 | CHIP_8192S = 0, 22 | CHIP_8188C = 1, 23 | CHIP_8192C = 2, 24 | CHIP_8192D = 3, 25 | CHIP_8723A = 4, 26 | CHIP_8188E = 5, 27 | CHIP_8812 = 6, 28 | CHIP_8821 = 7, 29 | CHIP_8723B = 8, 30 | CHIP_8192E = 9, 31 | }HAL_IC_TYPE_E; 32 | 33 | /* HAL_CHIP_TYPE_E */ 34 | typedef enum tag_HAL_CHIP_Type_Definition 35 | { 36 | TEST_CHIP = 0, 37 | NORMAL_CHIP = 1, 38 | FPGA = 2, 39 | }HAL_CHIP_TYPE_E; 40 | 41 | /* HAL_CUT_VERSION_E */ 42 | typedef enum tag_HAL_Cut_Version_Definition 43 | { 44 | A_CUT_VERSION = 0, 45 | B_CUT_VERSION = 1, 46 | C_CUT_VERSION = 2, 47 | D_CUT_VERSION = 3, 48 | E_CUT_VERSION = 4, 49 | F_CUT_VERSION = 5, 50 | G_CUT_VERSION = 6, 51 | H_CUT_VERSION = 7, 52 | I_CUT_VERSION = 8, 53 | J_CUT_VERSION = 9, 54 | K_CUT_VERSION = 10, 55 | }HAL_CUT_VERSION_E; 56 | 57 | /* HAL_Manufacturer */ 58 | typedef enum tag_HAL_Manufacturer_Version_Definition 59 | { 60 | CHIP_VENDOR_TSMC = 0, 61 | CHIP_VENDOR_UMC = 1, 62 | CHIP_VENDOR_SMIC = 2, 63 | }HAL_VENDOR_E; 64 | 65 | typedef enum tag_HAL_RF_Type_Definition 66 | { 67 | RF_TYPE_1T1R = 0, 68 | RF_TYPE_1T2R = 1, 69 | RF_TYPE_2T2R = 2, 70 | RF_TYPE_2T3R = 3, 71 | RF_TYPE_2T4R = 4, 72 | RF_TYPE_3T3R = 5, 73 | RF_TYPE_3T4R = 6, 74 | RF_TYPE_4T4R = 7, 75 | }HAL_RF_TYPE_E; 76 | 77 | typedef struct tag_HAL_VERSION 78 | { 79 | HAL_IC_TYPE_E ICType; 80 | HAL_CHIP_TYPE_E ChipType; 81 | HAL_CUT_VERSION_E CUTVersion; 82 | HAL_VENDOR_E VendorType; 83 | HAL_RF_TYPE_E RFType; 84 | u8 ROMVer; 85 | }HAL_VERSION,*PHAL_VERSION; 86 | 87 | /* VERSION_8192C VersionID; */ 88 | /* HAL_VERSION VersionID; */ 89 | 90 | /* Get element */ 91 | #define GET_CVID_IC_TYPE(version) ((HAL_IC_TYPE_E)((version).ICType) ) 92 | #define GET_CVID_CHIP_TYPE(version) ((HAL_CHIP_TYPE_E)((version).ChipType) ) 93 | #define GET_CVID_RF_TYPE(version) ((HAL_RF_TYPE_E)((version).RFType)) 94 | #define GET_CVID_MANUFACTUER(version) ((HAL_VENDOR_E)((version).VendorType)) 95 | #define GET_CVID_CUT_VERSION(version) ((HAL_CUT_VERSION_E)((version).CUTVersion)) 96 | #define GET_CVID_ROM_VERSION(version) (((version).ROMVer) & ROM_VERSION_MASK) 97 | 98 | /* */ 99 | /* Common Macro. -- */ 100 | /* */ 101 | /* HAL_VERSION VersionID */ 102 | 103 | /* HAL_CHIP_TYPE_E */ 104 | #define IS_TEST_CHIP(version) ((GET_CVID_CHIP_TYPE(version) ==TEST_CHIP)? true: false) 105 | #define IS_NORMAL_CHIP(version) ((GET_CVID_CHIP_TYPE(version) ==NORMAL_CHIP)? true: false) 106 | 107 | /* HAL_CUT_VERSION_E */ 108 | #define IS_A_CUT(version) ((GET_CVID_CUT_VERSION(version) == A_CUT_VERSION) ? true : false) 109 | #define IS_B_CUT(version) ((GET_CVID_CUT_VERSION(version) == B_CUT_VERSION) ? true : false) 110 | #define IS_C_CUT(version) ((GET_CVID_CUT_VERSION(version) == C_CUT_VERSION) ? true : false) 111 | #define IS_D_CUT(version) ((GET_CVID_CUT_VERSION(version) == D_CUT_VERSION) ? true : false) 112 | #define IS_E_CUT(version) ((GET_CVID_CUT_VERSION(version) == E_CUT_VERSION) ? true : false) 113 | #define IS_I_CUT(version) ((GET_CVID_CUT_VERSION(version) == I_CUT_VERSION) ? true : false) 114 | #define IS_J_CUT(version) ((GET_CVID_CUT_VERSION(version) == J_CUT_VERSION) ? true : false) 115 | #define IS_K_CUT(version) ((GET_CVID_CUT_VERSION(version) == K_CUT_VERSION) ? true : false) 116 | 117 | /* HAL_VENDOR_E */ 118 | #define IS_CHIP_VENDOR_TSMC(version) ((GET_CVID_MANUFACTUER(version) == CHIP_VENDOR_TSMC)? true: false) 119 | #define IS_CHIP_VENDOR_UMC(version) ((GET_CVID_MANUFACTUER(version) == CHIP_VENDOR_UMC)? true: false) 120 | #define IS_CHIP_VENDOR_SMIC(version) ((GET_CVID_MANUFACTUER(version) == CHIP_VENDOR_SMIC)? true: false) 121 | 122 | /* HAL_RF_TYPE_E */ 123 | #define IS_1T1R(version) ((GET_CVID_RF_TYPE(version) == RF_TYPE_1T1R)? true : false) 124 | #define IS_1T2R(version) ((GET_CVID_RF_TYPE(version) == RF_TYPE_1T2R)? true : false) 125 | #define IS_2T2R(version) ((GET_CVID_RF_TYPE(version) == RF_TYPE_2T2R)? true : false) 126 | 127 | #endif 128 | -------------------------------------------------------------------------------- /wifi-module/rtl8723bs-4.14/4.14/include/rtw_beamforming.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 | ******************************************************************************/ 15 | #ifndef __RTW_BEAMFORMING_H_ 16 | #define __RTW_BEAMFORMING_H_ 17 | 18 | #define BEAMFORMING_ENTRY_NUM 2 19 | #define GET_BEAMFORM_INFO(_pmlmepriv) ((struct beamforming_info *)(&(_pmlmepriv)->beamforming_info)) 20 | 21 | typedef enum _BEAMFORMING_ENTRY_STATE 22 | { 23 | BEAMFORMING_ENTRY_STATE_UNINITIALIZE, 24 | BEAMFORMING_ENTRY_STATE_INITIALIZEING, 25 | BEAMFORMING_ENTRY_STATE_INITIALIZED, 26 | BEAMFORMING_ENTRY_STATE_PROGRESSING, 27 | BEAMFORMING_ENTRY_STATE_PROGRESSED, 28 | }BEAMFORMING_ENTRY_STATE, *PBEAMFORMING_ENTRY_STATE; 29 | 30 | 31 | typedef enum _BEAMFORMING_STATE 32 | { 33 | BEAMFORMING_STATE_IDLE, 34 | BEAMFORMING_STATE_START, 35 | BEAMFORMING_STATE_END, 36 | }BEAMFORMING_STATE, *PBEAMFORMING_STATE; 37 | 38 | 39 | typedef enum _BEAMFORMING_CAP 40 | { 41 | BEAMFORMING_CAP_NONE = 0x0, 42 | BEAMFORMER_CAP_HT_EXPLICIT = 0x1, 43 | BEAMFORMEE_CAP_HT_EXPLICIT = 0x2, 44 | BEAMFORMER_CAP_VHT_SU = 0x4, /* Self has er Cap, because Reg er & peer ee */ 45 | BEAMFORMEE_CAP_VHT_SU = 0x8, /* Self has ee Cap, because Reg ee & peer er */ 46 | BEAMFORMER_CAP = 0x10, 47 | BEAMFORMEE_CAP = 0x20, 48 | }BEAMFORMING_CAP, *PBEAMFORMING_CAP; 49 | 50 | 51 | typedef enum _SOUNDING_MODE 52 | { 53 | SOUNDING_SW_VHT_TIMER = 0x0, 54 | SOUNDING_SW_HT_TIMER = 0x1, 55 | SOUNDING_STOP_All_TIMER = 0x2, 56 | SOUNDING_HW_VHT_TIMER = 0x3, 57 | SOUNDING_HW_HT_TIMER = 0x4, 58 | SOUNDING_STOP_OID_TIMER = 0x5, 59 | SOUNDING_AUTO_VHT_TIMER = 0x6, 60 | SOUNDING_AUTO_HT_TIMER = 0x7, 61 | SOUNDING_FW_VHT_TIMER = 0x8, 62 | SOUNDING_FW_HT_TIMER = 0x9, 63 | }SOUNDING_MODE, *PSOUNDING_MODE; 64 | 65 | 66 | enum BEAMFORMING_CTRL_TYPE 67 | { 68 | BEAMFORMING_CTRL_ENTER = 0, 69 | BEAMFORMING_CTRL_LEAVE = 1, 70 | BEAMFORMING_CTRL_START_PERIOD = 2, 71 | BEAMFORMING_CTRL_END_PERIOD = 3, 72 | BEAMFORMING_CTRL_SOUNDING_FAIL =4, 73 | BEAMFORMING_CTRL_SOUNDING_CLK =5, 74 | }; 75 | 76 | struct beamforming_entry { 77 | bool bUsed; 78 | bool bSound; 79 | u16 aid; /* Used to construct AID field of NDPA packet. */ 80 | u16 mac_id; /* Used to Set Reg42C in IBSS mode. */ 81 | u16 p_aid; /* Used to fill Reg42C & Reg714 to compare with P_AID of Tx DESC. */ 82 | u8 mac_addr[6];/* Used to fill Reg6E4 to fill Mac address of CSI report frame. */ 83 | enum CHANNEL_WIDTH sound_bw; /* Sounding BandWidth */ 84 | u16 sound_period; 85 | BEAMFORMING_CAP beamforming_entry_cap; 86 | BEAMFORMING_ENTRY_STATE beamforming_entry_state; 87 | u8 LogSeq; 88 | u8 LogRetryCnt; 89 | u8 LogSuccessCnt; 90 | u8 LogStatusFailCnt; 91 | u8 PreCsiReport[327]; 92 | u8 DefaultCsiCnt; 93 | bool bDefaultCSI; 94 | }; 95 | 96 | struct sounding_info { 97 | u8 sound_idx; 98 | enum CHANNEL_WIDTH sound_bw; 99 | SOUNDING_MODE sound_mode; 100 | u16 sound_period; 101 | }; 102 | 103 | struct beamforming_info { 104 | BEAMFORMING_CAP beamforming_cap; 105 | BEAMFORMING_STATE beamforming_state; 106 | struct beamforming_entry beamforming_entry[BEAMFORMING_ENTRY_NUM]; 107 | u8 beamforming_cur_idx; 108 | u8 beamforming_in_progress; 109 | u8 sounding_sequence; 110 | struct sounding_info sounding_info; 111 | }; 112 | 113 | struct rtw_ndpa_sta_info { 114 | u16 aid:12; 115 | u16 feedback_type:1; 116 | u16 nc_index:3; 117 | }; 118 | 119 | BEAMFORMING_CAP beamforming_get_entry_beam_cap_by_mac_id(void *pmlmepriv , u8 mac_id); 120 | void beamforming_notify(struct adapter * adapter); 121 | BEAMFORMING_CAP beamforming_get_beamform_cap(struct beamforming_info *pBeamInfo); 122 | 123 | u32 beamforming_get_report_frame(struct adapter * Adapter, union recv_frame *precv_frame); 124 | 125 | bool beamforming_send_ht_ndpa_packet(struct adapter * Adapter, u8 *ra, enum CHANNEL_WIDTH bw, u8 qidx); 126 | bool beamforming_send_vht_ndpa_packet(struct adapter * Adapter, u8 *ra, u16 aid, enum CHANNEL_WIDTH bw, u8 qidx); 127 | 128 | void beamforming_check_sounding_success(struct adapter * Adapter, bool status); 129 | 130 | void beamforming_watchdog(struct adapter * Adapter); 131 | 132 | void beamforming_wk_hdl(struct adapter *padapter, u8 type, u8 *pbuf); 133 | u8 beamforming_wk_cmd(struct adapter *padapter, s32 type, u8 *pbuf, s32 size, u8 enqueue); 134 | 135 | #endif 136 | --------------------------------------------------------------------------------