From b3da33576da5359d85c7cfe82716c9a08a592aff Mon Sep 17 00:00:00 2001 From: Carlos Garces Date: Tue, 16 Nov 2021 20:49:51 +0100 Subject: [PATCH] Use kernel endian config Remove custom vendor files. Reviewed-by: Giulio Benetti giulio.benetti@benettiengineering.com --- Makefile | 83 +--- hal/phydm/phydm_phystatus.h | 162 ++++---- hal/phydm/phydm_precomp.h | 8 - hal/phydm/phydm_types.h | 19 - include/byteorder/big_endian.h | 82 ---- include/byteorder/generic.h | 207 ---------- include/byteorder/little_endian.h | 84 ---- include/byteorder/swab.h | 136 ------- include/byteorder/swabb.h | 151 -------- include/drv_types.h | 1 - include/ieee80211_ext.h | 622 +++++++++++++++--------------- include/osdep_service.h | 2 - include/rtw_byteorder.h | 33 -- include/rtw_io.h | 4 +- include/rtw_mlme_ext.h | 12 +- include/rtw_security.h | 6 +- os_dep/linux/ioctl_linux.c | 6 +- 17 files changed, 423 insertions(+), 1195 deletions(-) delete mode 100644 include/byteorder/big_endian.h delete mode 100644 include/byteorder/generic.h delete mode 100644 include/byteorder/little_endian.h delete mode 100644 include/byteorder/swab.h delete mode 100644 include/byteorder/swabb.h delete mode 100644 include/rtw_byteorder.h diff --git a/Makefile b/Makefile index e4664e9..d575727 100644 --- a/Makefile +++ b/Makefile @@ -1284,7 +1284,6 @@ endif EXTRA_CFLAGS += -DDM_ODM_SUPPORT_TYPE=0x04 -EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN # default setting for Android 4.1, 4.2 EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT @@ -1292,7 +1291,6 @@ EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT EXTRA_CFLAGS += -DCONFIG_RADIO_WORK ifeq ($(CONFIG_PLATFORM_I386_PC), y) -EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT SUBARCH := $(shell uname -m | sed -e s/i.86/i386/) ARCH ?= $(SUBARCH) @@ -1306,7 +1304,6 @@ endif ifeq ($(CONFIG_PLATFORM_NV_TK1), y) EXTRA_CFLAGS += -DCONFIG_PLATFORM_NV_TK1 -EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN # default setting for Android 4.1, 4.2 EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE @@ -1324,7 +1321,6 @@ endif ifeq ($(CONFIG_PLATFORM_NV_TK1_UBUNTU), y) EXTRA_CFLAGS += -DCONFIG_PLATFORM_NV_TK1 -EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT ARCH ?= arm @@ -1337,7 +1333,7 @@ INSTALL_PREFIX := endif ifeq ($(CONFIG_PLATFORM_ACTIONS_ATM702X), y) -EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_ANDROID -DCONFIG_PLATFORM_ACTIONS_ATM702X +EXTRA_CFLAGS += -DCONFIG_PLATFORM_ANDROID -DCONFIG_PLATFORM_ACTIONS_ATM702X #ARCH := arm ARCH := $(R_ARCH) #CROSS_COMPILE := arm-none-linux-gnueabi- @@ -1350,7 +1346,6 @@ endif ifeq ($(CONFIG_PLATFORM_ACTIONS_ATM705X), y) -EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN #EXTRA_CFLAGS += -DRTW_ENABLE_WIFI_CONTROL_FUNC # default setting for Android 4.1, 4.2, 4.3, 4.4 EXTRA_CFLAGS += -DCONFIG_PLATFORM_ACTIONS_ATM705X @@ -1371,7 +1366,6 @@ KSRC := /home/android_sdk/Action-semi/705a_android_L/android/kernel endif ifeq ($(CONFIG_PLATFORM_ARM_SUN50IW1P1), y) -EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN EXTRA_CFLAGS += -DCONFIG_PLATFORM_ARM_SUN50IW1P1 EXTRA_CFLAGS += -DCONFIG_TRAFFIC_PROTECT # default setting for Android 4.1, 4.2 @@ -1398,14 +1392,14 @@ KSRC :=/home/android_sdk/Allwinner/a64/android-51/lichee/linux-3.10/ endif ifeq ($(CONFIG_PLATFORM_TI_AM3517), y) -EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_ANDROID -DCONFIG_PLATFORM_SHUTTLE +EXTRA_CFLAGS += -DCONFIG_PLATFORM_ANDROID -DCONFIG_PLATFORM_SHUTTLE CROSS_COMPILE := arm-eabi- KSRC := $(shell pwd)/../../../Android/kernel ARCH := arm endif ifeq ($(CONFIG_PLATFORM_MSTAR_TITANIA12), y) -EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_MSTAR -DCONFIG_PLATFORM_MSTAR_TITANIA12 +EXTRA_CFLAGS += -DCONFIG_PLATFORM_MSTAR -DCONFIG_PLATFORM_MSTAR_TITANIA12 ARCH:=mips CROSS_COMPILE:= /usr/src/Mstar_kernel/mips-4.3/bin/mips-linux-gnu- KVER:= 2.6.28.9 @@ -1415,7 +1409,6 @@ endif ifeq ($(CONFIG_PLATFORM_MSTAR), y) EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT -EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN EXTRA_CFLAGS += -DCONFIG_PLATFORM_MSTAR EXTRA_CFLAGS += -DCONFIG_PLATFORM_MSTAR_HIGH ifeq ($(CONFIG_USB_HCI), y) @@ -1428,7 +1421,6 @@ KSRC:= /usr/src/Mstar_kernel/3.1.10/ endif ifeq ($(CONFIG_PLATFORM_ANDROID_X86), y) -EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN SUBARCH := $(shell uname -m | sed -e s/i.86/i386/) ARCH := $(SUBARCH) CROSS_COMPILE := /media/DATA-2/android-x86/ics-x86_20120130/prebuilt/linux-x86/toolchain/i686-unknown-linux-gnu-4.2.1/bin/i686-unknown-linux-gnu- @@ -1439,7 +1431,7 @@ endif ifeq ($(CONFIG_PLATFORM_ANDROID_INTEL_X86), y) EXTRA_CFLAGS += -DCONFIG_PLATFORM_ANDROID_INTEL_X86 EXTRA_CFLAGS += -DCONFIG_PLATFORM_INTEL_BYT -EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_ANDROID +EXTRA_CFLAGS += -DCONFIG_PLATFORM_ANDROID EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT EXTRA_CFLAGS += -DCONFIG_SKIP_SIGNAL_SCALE_MAPPING @@ -1449,7 +1441,6 @@ endif endif ifeq ($(CONFIG_PLATFORM_JB_X86), y) -EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT SUBARCH := $(shell uname -m | sed -e s/i.86/i386/) @@ -1460,7 +1451,6 @@ MODULE_NAME :=wlan endif ifeq ($(CONFIG_PLATFORM_ARM_PXA2XX), y) -EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN ARCH := arm CROSS_COMPILE := arm-none-linux-gnueabi- KVER := 2.6.34.1 @@ -1468,7 +1458,6 @@ KSRC ?= /usr/src/linux-2.6.34.1 endif ifeq ($(CONFIG_PLATFORM_ARM_S3C2K4), y) -EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN ARCH := arm CROSS_COMPILE := arm-linux- KVER := 2.6.24.7_$(ARCH) @@ -1476,7 +1465,6 @@ KSRC := /usr/src/kernels/linux-$(KVER) endif ifeq ($(CONFIG_PLATFORM_ARM_S3C6K4), y) -EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN ARCH := arm CROSS_COMPILE := arm-none-linux-gnueabi- KVER := 2.6.34.1 @@ -1484,7 +1472,7 @@ KSRC ?= /usr/src/linux-2.6.34.1 endif ifeq ($(CONFIG_PLATFORM_RTD2880B), y) -EXTRA_CFLAGS += -DCONFIG_BIG_ENDIAN -DCONFIG_PLATFORM_RTD2880B +EXTRA_CFLAGS += -DCONFIG_PLATFORM_RTD2880B ARCH:= CROSS_COMPILE:= KVER:= @@ -1492,7 +1480,6 @@ KSRC:= endif ifeq ($(CONFIG_PLATFORM_MIPS_RMI), y) -EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN ARCH:=mips CROSS_COMPILE:=mipsisa32r2-uclibc- KVER:= @@ -1500,7 +1487,6 @@ KSRC:= /root/work/kernel_realtek endif ifeq ($(CONFIG_PLATFORM_MIPS_PLM), y) -EXTRA_CFLAGS += -DCONFIG_BIG_ENDIAN ARCH:=mips CROSS_COMPILE:=mipsisa32r2-uclibc- KVER:= @@ -1508,7 +1494,7 @@ KSRC:= /root/work/kernel_realtek endif ifeq ($(CONFIG_PLATFORM_MSTAR389), y) -EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_MSTAR389 +EXTRA_CFLAGS += -DCONFIG_PLATFORM_MSTAR389 ARCH:=mips CROSS_COMPILE:= mips-linux-gnu- KVER:= 2.6.28.10 @@ -1516,14 +1502,13 @@ KSRC:= /home/mstar/mstar_linux/2.6.28.9/ endif ifeq ($(CONFIG_PLATFORM_MIPS_AR9132), y) -EXTRA_CFLAGS += -DCONFIG_BIG_ENDIAN ARCH := mips CROSS_COMPILE := mips-openwrt-linux- KSRC := /home/alex/test_openwrt/tmp/linux-2.6.30.9 endif ifeq ($(CONFIG_PLATFORM_DMP_PHILIPS), y) -EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DRTK_DMP_PLATFORM +EXTRA_CFLAGS += -DRTK_DMP_PLATFORM ARCH := mips #CROSS_COMPILE:=/usr/local/msdk-4.3.6-mips-EL-2.6.12.6-0.9.30.3/bin/mipsel-linux- CROSS_COMPILE:=/usr/local/toolchain_mipsel/bin/mipsel-linux- @@ -1531,7 +1516,7 @@ KSRC ?=/usr/local/Jupiter/linux-2.6.12 endif ifeq ($(CONFIG_PLATFORM_RTK_DMP), y) -EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DRTK_DMP_PLATFORM -DCONFIG_WIRELESS_EXT +EXTRA_CFLAGS += -DRTK_DMP_PLATFORM -DCONFIG_WIRELESS_EXT EXTRA_CFLAGS += -DCONFIG_PLATFORM_OPS ifeq ($(CONFIG_USB_HCI), y) _PLATFORM_FILES += platform/platform_RTK_DMP_usb.o @@ -1543,7 +1528,7 @@ KSRC ?= /usr/src/DMP_Kernel/jupiter/linux-2.6.12 endif ifeq ($(CONFIG_PLATFORM_MT53XX), y) -EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_MT53XX +EXTRA_CFLAGS += -DCONFIG_PLATFORM_MT53XX ARCH:= arm CROSS_COMPILE:= arm11_mtk_le- KVER:= 2.6.27 @@ -1551,7 +1536,7 @@ KSRC?= /proj/mtk00802/BD_Compare/BDP/Dev/BDP_V301/BDP_Linux/linux-2.6.27 endif ifeq ($(CONFIG_PLATFORM_ARM_MX51_241H), y) -EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_WISTRON_PLATFORM +EXTRA_CFLAGS += -DCONFIG_WISTRON_PLATFORM ARCH := arm CROSS_COMPILE := /opt/freescale/usr/local/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnueabi/bin/arm-none-linux-gnueabi- KVER := 2.6.31 @@ -1559,7 +1544,6 @@ KSRC ?= /lib/modules/2.6.31-770-g0e46b52/source endif ifeq ($(CONFIG_PLATFORM_FS_MX61), y) -EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN ARCH := arm CROSS_COMPILE := /home/share/CusEnv/FreeScale/arm-eabi-4.4.3/bin/arm-eabi- KSRC ?= /home/share/CusEnv/FreeScale/FS_kernel_env @@ -1568,7 +1552,7 @@ endif ifeq ($(CONFIG_PLATFORM_ACTIONS_ATJ227X), y) -EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_ACTIONS_ATJ227X +EXTRA_CFLAGS += -DCONFIG_PLATFORM_ACTIONS_ATJ227X ARCH := mips CROSS_COMPILE := /home/cnsd4/project/actions/tools-2.6.27/bin/mipsel-linux-gnu- KVER := 2.6.27 @@ -1576,7 +1560,7 @@ KSRC := /home/cnsd4/project/actions/linux-2.6.27.28 endif ifeq ($(CONFIG_PLATFORM_TI_DM365), y) -EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_TI_DM365 +EXTRA_CFLAGS += -DCONFIG_PLATFORM_TI_DM365 EXTRA_CFLAGS += -DCONFIG_USE_USB_BUFFER_ALLOC_RX EXTRA_CFLAGS += -DCONFIG_SINGLE_XMIT_BUF -DCONFIG_SINGLE_RECV_BUF ARCH := arm @@ -1589,7 +1573,7 @@ KVER := 2.6.18 endif ifeq ($(CONFIG_PLATFORM_MOZART), y) -EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_MOZART +EXTRA_CFLAGS += -DCONFIG_PLATFORM_MOZART ARCH := arm CROSS_COMPILE := /home/vivotek/lsp/mozart3v2/Mozart3e_Toolchain/build_arm_nofpu/usr/bin/arm-linux- KVER := $(shell uname -r) @@ -1598,7 +1582,6 @@ KERNELOUTPUT := /home/pink/sample/ODM/IP8136W-VINT/tmp/kernel endif ifeq ($(CONFIG_PLATFORM_TEGRA3_CARDHU), y) -EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN # default setting for Android 4.1, 4.2 EXTRA_CFLAGS += -DRTW_ENABLE_WIFI_CONTROL_FUNC EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE @@ -1610,7 +1593,6 @@ MODULE_NAME := wlan endif ifeq ($(CONFIG_PLATFORM_TEGRA4_DALMORE), y) -EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN # default setting for Android 4.1, 4.2 EXTRA_CFLAGS += -DRTW_ENABLE_WIFI_CONTROL_FUNC EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE @@ -1622,7 +1604,6 @@ MODULE_NAME := wlan endif ifeq ($(CONFIG_PLATFORM_ARM_TCC8900), y) -EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN ARCH := arm CROSS_COMPILE := /home/android_sdk/Telechips/SDK_2304_20110613/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi- KSRC := /home/android_sdk/Telechips/SDK_2304_20110613/kernel @@ -1630,7 +1611,6 @@ MODULE_NAME := wlan endif ifeq ($(CONFIG_PLATFORM_ARM_TCC8920), y) -EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN ARCH := arm CROSS_COMPILE := /home/android_sdk/Telechips/v12.06_r1-tcc-android-4.0.4/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi- KSRC := /home/android_sdk/Telechips/v12.06_r1-tcc-android-4.0.4/kernel @@ -1638,7 +1618,6 @@ MODULE_NAME := wlan endif ifeq ($(CONFIG_PLATFORM_ARM_TCC8920_JB42), y) -EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN # default setting for Android 4.1, 4.2 EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT @@ -1649,7 +1628,7 @@ MODULE_NAME := wlan endif ifeq ($(CONFIG_PLATFORM_ARM_RK2818), y) -EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_ANDROID -DCONFIG_PLATFORM_ROCKCHIPS +EXTRA_CFLAGS += -DCONFIG_PLATFORM_ANDROID -DCONFIG_PLATFORM_ROCKCHIPS ARCH := arm CROSS_COMPILE := /usr/src/release_fae_version/toolchain/arm-eabi-4.4.0/bin/arm-eabi- KSRC := /usr/src/release_fae_version/kernel25_A7_281x @@ -1657,7 +1636,7 @@ MODULE_NAME := wlan endif ifeq ($(CONFIG_PLATFORM_ARM_RK3188), y) -EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_ANDROID -DCONFIG_PLATFORM_ROCKCHIPS +EXTRA_CFLAGS += -DCONFIG_PLATFORM_ANDROID -DCONFIG_PLATFORM_ROCKCHIPS # default setting for Android 4.1, 4.2, 4.3, 4.4 EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE @@ -1674,7 +1653,6 @@ endif ifeq ($(CONFIG_PLATFORM_ARM_RK3066), y) EXTRA_CFLAGS += -DCONFIG_PLATFORM_ARM_RK3066 EXTRA_CFLAGS += -DRTW_ENABLE_WIFI_CONTROL_FUNC -EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 ifeq ($(CONFIG_SDIO_HCI), y) @@ -1689,7 +1667,6 @@ MODULE_NAME :=wlan endif ifeq ($(CONFIG_PLATFORM_ARM_URBETTER), y) -EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN #-DCONFIG_MINIMAL_MEMORY_USAGE ARCH := arm CROSS_COMPILE := /media/DATA-1/urbetter/arm-2009q3/bin/arm-none-linux-gnueabi- KSRC := /media/DATA-1/urbetter/ics-urbetter/kernel @@ -1697,7 +1674,6 @@ MODULE_NAME := wlan endif ifeq ($(CONFIG_PLATFORM_ARM_TI_PANDA), y) -EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN #-DCONFIG_MINIMAL_MEMORY_USAGE ARCH := arm #CROSS_COMPILE := /media/DATA-1/aosp/ics-aosp_20111227/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi- #KSRC := /media/DATA-1/aosp/android-omap-panda-3.0_20120104 @@ -1707,14 +1683,13 @@ MODULE_NAME := wlan endif ifeq ($(CONFIG_PLATFORM_MIPS_JZ4760), y) -EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_MINIMAL_MEMORY_USAGE +EXTRA_CFLAGS += -DCONFIG_MINIMAL_MEMORY_USAGE ARCH ?= mips CROSS_COMPILE ?= /mnt/sdb5/Ingenic/Umido/mips-4.3/bin/mips-linux-gnu- KSRC ?= /mnt/sdb5/Ingenic/Umido/kernel endif ifeq ($(CONFIG_PLATFORM_SZEBOOK), y) -EXTRA_CFLAGS += -DCONFIG_BIG_ENDIAN ARCH:=arm CROSS_COMPILE:=/opt/crosstool2/bin/armeb-unknown-linux-gnueabi- KVER:= 2.6.31.6 @@ -1722,7 +1697,6 @@ KSRC:= ../code/linux-2.6.31.6-2020/ endif ifeq ($(CONFIG_PLATFORM_ARM_SUNxI), y) -EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN EXTRA_CFLAGS += -DCONFIG_PLATFORM_ARM_SUNxI # default setting for Android 4.1, 4.2 EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE @@ -1748,7 +1722,6 @@ KSRC=/home/android_sdk/Allwinner/a10/android-jb42/lichee-jb42/linux-3.0 endif ifeq ($(CONFIG_PLATFORM_ARM_SUN6I), y) -EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN EXTRA_CFLAGS += -DCONFIG_PLATFORM_ARM_SUN6I EXTRA_CFLAGS += -DCONFIG_TRAFFIC_PROTECT # default setting for Android 4.1, 4.2, 4.3, 4.4 @@ -1780,7 +1753,6 @@ KSRC :=/home/android_sdk/Allwinner/a31/kitkat-a3x_v4.5/lichee/linux-3.3 endif ifeq ($(CONFIG_PLATFORM_ARM_SUN7I), y) -EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN EXTRA_CFLAGS += -DCONFIG_PLATFORM_ARM_SUN7I EXTRA_CFLAGS += -DCONFIG_TRAFFIC_PROTECT # default setting for Android 4.1, 4.2, 4.3, 4.4 @@ -1810,7 +1782,6 @@ KSRC := /home/android_sdk/Allwinner/a20/kitkat-a20_v4.4/lichee/linux-3.4 endif ifeq ($(CONFIG_PLATFORM_ARM_SUN8I_W3P1), y) -EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN EXTRA_CFLAGS += -DCONFIG_PLATFORM_ARM_SUN8I EXTRA_CFLAGS += -DCONFIG_PLATFORM_ARM_SUN8I_W3P1 EXTRA_CFLAGS += -DCONFIG_TRAFFIC_PROTECT @@ -1837,7 +1808,6 @@ KSRC :=/home/android_sdk/Allwinner/a23/android-kk44/lichee/linux-3.4 endif ifeq ($(CONFIG_PLATFORM_ARM_SUN8I_W5P1), y) -EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN EXTRA_CFLAGS += -DCONFIG_PLATFORM_ARM_SUN8I EXTRA_CFLAGS += -DCONFIG_PLATFORM_ARM_SUN8I_W5P1 EXTRA_CFLAGS += -DCONFIG_TRAFFIC_PROTECT @@ -1864,7 +1834,7 @@ KSRC :=/home/android_sdk/Allwinner/a33/android-L/lichee/linux-3.4 endif ifeq ($(CONFIG_PLATFORM_ACTIONS_ATV5201), y) -EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_ACTIONS_ATV5201 +EXTRA_CFLAGS += -DCONFIG_PLATFORM_ACTIONS_ATV5201 EXTRA_CFLAGS += -DCONFIG_SDIO_DISABLE_RXFIFO_POLLING_LOOP ARCH := mips CROSS_COMPILE := mipsel-linux-gnu- @@ -1873,7 +1843,6 @@ KSRC:= $(CFGDIR)/../../kernel/linux-$(KERNEL_VER) endif ifeq ($(CONFIG_PLATFORM_ARM_RTD299X), y) -EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT ifeq ($(CONFIG_ANDROID), y) @@ -1885,7 +1854,6 @@ INSTALL_PREFIX := endif ifeq ($(CONFIG_PLATFORM_ARM_RTD299X_LG), y) -EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE EXTRA_CFLAGS += -DRTW_P2P_GROUP_INTERFACE=1 @@ -1911,7 +1879,7 @@ INSTALL_PREFIX ?= endif ifeq ($(CONFIG_PLATFORM_HISILICON), y) -EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_HISILICON +EXTRA_CFLAGS += -DCONFIG_PLATFORM_HISILICON ifeq ($(SUPPORT_CONCURRENT),y) EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE endif @@ -1930,7 +1898,6 @@ ifeq ($(CONFIG_PLATFORM_HISILICON_HI3798), y) EXTRA_CFLAGS += -DCONFIG_PLATFORM_HISILICON EXTRA_CFLAGS += -DCONFIG_PLATFORM_HISILICON_HI3798 #EXTRA_CFLAGS += -DCONFIG_PLATFORM_HISILICON_HI3798_MV200_HDMI_DONGLE -EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN # default setting for Android EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 @@ -1969,7 +1936,6 @@ EXTRA_CFLAGS += -DANDROID_2X endif EXTRA_CFLAGS += -DCONFIG_PLATFORM_SPRD EXTRA_CFLAGS += -DPLATFORM_SPREADTRUM_6820 -EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN ifeq ($(RTL871X), rtl8188e) EXTRA_CFLAGS += -DSOFTAP_PS_DURATION=50 endif @@ -1985,7 +1951,6 @@ EXTRA_CFLAGS += -DANDROID_2X endif EXTRA_CFLAGS += -DCONFIG_PLATFORM_SPRD EXTRA_CFLAGS += -DPLATFORM_SPREADTRUM_8810 -EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN ifeq ($(RTL871X), rtl8188e) EXTRA_CFLAGS += -DSOFTAP_PS_DURATION=50 endif @@ -1996,7 +1961,6 @@ endif endif ifeq ($(CONFIG_PLATFORM_ARM_WMT), y) -EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT EXTRA_CFLAGS += -DCONFIG_PLATFORM_OPS @@ -2010,7 +1974,6 @@ MODULE_NAME :=8189es_kk endif ifeq ($(CONFIG_PLATFORM_RTK119X), y) -EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN #EXTRA_CFLAGS += -DCONFIG_PLATFORM_ARM_SUN7I EXTRA_CFLAGS += -DCONFIG_TRAFFIC_PROTECT # default setting for Android 4.1, 4.2 @@ -2042,7 +2005,6 @@ endif ifeq ($(CONFIG_PLATFORM_RTK119X_AM), y) EXTRA_CFLAGS += -DCONFIG_PLATFORM_RTK119X_AM -EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN EXTRA_CFLAGS += -DCONFIG_TRAFFIC_PROTECT EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE -DCONFIG_FULL_CH_IN_P2P_HANDSHAKE EXTRA_CFLAGS += -DCONFIG_IFACE_NUMBER=3 @@ -2061,7 +2023,6 @@ CROSS_COMPILE := endif ifeq ($(CONFIG_PLATFORM_RTK129X), y) -EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN EXTRA_CFLAGS += -DRTK_129X_PLATFORM EXTRA_CFLAGS += -DCONFIG_TRAFFIC_PROTECT # default setting for Android 4.1, 4.2 @@ -2097,7 +2058,6 @@ KSRC := /home/android_sdk/DHC/trunk-6.0.0_r1-QA160627/linux-kernel endif ifeq ($(CONFIG_PLATFORM_RTK390X), y) -EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN EXTRA_CFLAGS += -DCONFIG_PLATFORM_RTK390X EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT EXTRA_CFLAGS += -DCONFIG_RTW_NETIF_SG @@ -2114,7 +2074,6 @@ endif ifeq ($(CONFIG_PLATFORM_NOVATEK_NT72668), y) EXTRA_CFLAGS += -DCONFIG_PLATFORM_NOVATEK_NT72668 -EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT EXTRA_CFLAGS += -DCONFIG_USE_USB_BUFFER_ALLOC_RX @@ -2127,7 +2086,6 @@ KSRC := /Custom/Novatek/TCL/linux-3.8_header endif ifeq ($(CONFIG_PLATFORM_ARM_TCC8930_JB42), y) -EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN # default setting for Android 4.1, 4.2 EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT @@ -2138,7 +2096,7 @@ MODULE_NAME := wlan endif ifeq ($(CONFIG_PLATFORM_RTL8197D), y) -EXTRA_CFLAGS += -DCONFIG_BIG_ENDIAN -DCONFIG_PLATFORM_RTL8197D +EXTRA_CFLAGS += -DCONFIG_PLATFORM_RTL8197D export DIR_LINUX=$(shell pwd)/../SDK/rlxlinux-sdk321-v50/linux-2.6.30 ARCH ?= rlx CROSS_COMPILE:= $(DIR_LINUX)/../toolchain/rsdk-1.5.5-5281-EB-2.6.30-0.9.30.3-110714/bin/rsdk-linux- @@ -2147,7 +2105,7 @@ endif ifeq ($(CONFIG_PLATFORM_AML_S905), y) EXTRA_CFLAGS += -DCONFIG_PLATFORM_AML_S905 -EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -fno-pic +EXTRA_CFLAGS += -fno-pic # default setting for Android EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 @@ -2180,7 +2138,6 @@ endif ifeq ($(CONFIG_PLATFORM_ZTE_ZX296716), y) EXTRA_CFLAGS += -Wno-error=date-time EXTRA_CFLAGS += -DCONFIG_PLATFORM_ZTE_ZX296716 -EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN # default setting for Android EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 diff --git a/hal/phydm/phydm_phystatus.h b/hal/phydm/phydm_phystatus.h index 578530f..43edd34 100644 --- a/hal/phydm/phydm_phystatus.h +++ b/hal/phydm/phydm_phystatus.h @@ -58,7 +58,7 @@ ************************************************************/ __PACK struct phy_rx_agc_info { -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 gain : 7, trsw : 1; #else u8 trsw : 1, gain : 7; @@ -84,7 +84,7 @@ __PACK struct phy_status_rpt_8192cd { s8 sig_evm; u8 rsvd_3; -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 antsel_rx_keep_2: 1; /*@ex_intf_flg:1;*/ u8 sgi_en: 1; u8 rxsc: 2; @@ -107,7 +107,7 @@ struct phy_status_rpt_8812 { /* @DWORD 0*/ u8 gain_trsw[2]; /*path-A and path-B {TRSW, gain[6:0] }*/ u8 chl_num_LSB; /*@channel number[7:0]*/ -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 chl_num_MSB : 2; /*@channel number[9:8]*/ u8 sub_chnl : 4; /*sub-channel location[3:0]*/ u8 r_RFMOD : 2; /*RF mode[1:0]*/ @@ -121,7 +121,7 @@ struct phy_status_rpt_8812 { u8 pwdb_all; /*@CCK signal quality / OFDM pwdb all*/ s8 cfosho[2]; /*@CCK AGC report and CCK_BB_Power*/ /*OFDM path-A and path-B short CFO*/ -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 resvd_0 : 6; u8 bt_RF_ch_MSB : 2; /*@8812A:2'b0 8814A: bt rf channel keep[7:6]*/ #else /*@_BIG_ENDIAN_*/ @@ -130,7 +130,7 @@ struct phy_status_rpt_8812 { #endif /* @DWORD 2*/ -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 ant_div_sw_a : 1; /*@8812A: ant_div_sw_a 8814A: 1'b0*/ u8 ant_div_sw_b : 1; /*@8812A: ant_div_sw_b 8814A: 1'b0*/ u8 bt_RF_ch_LSB : 6; /*@8812A: 6'b0 8814A: bt rf channel keep[5:0]*/ @@ -149,7 +149,7 @@ struct phy_status_rpt_8812 { /* @DWORD 4*/ u8 PCTS_MSK_RPT_2; /*PCTS mask report[23:16]*/ -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 PCTS_MSK_RPT_3 : 6; /*PCTS mask report[29:24]*/ u8 pcts_rpt_valid : 1; /*pcts_rpt_valid*/ u8 resvd_1 : 1; /*@1'b0*/ @@ -167,7 +167,7 @@ struct phy_status_rpt_8812 { /* @DWORD 6*/ s8 sigevm; /*signal field EVM*/ -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 antidx_antc : 3; /*@8812A: 3'b0 8814A: antidx_antc[2:0]*/ u8 antidx_antd : 3; /*@8812A: 3'b0 8814A: antidx_antd[2:0]*/ u8 dpdt_ctrl_keep : 1; /*@8812A: 1'b0 8814A: dpdt_ctrl_keep*/ @@ -178,7 +178,7 @@ struct phy_status_rpt_8812 { u8 antidx_antd : 3; u8 antidx_antc : 3; #endif -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 antidx_anta : 3; /*@antidx_anta[2:0]*/ u8 antidx_antb : 3; /*@antidx_antb[2:0]*/ u8 hw_antsw_occur : 2; /*@1'b0*/ @@ -195,7 +195,7 @@ __PACK struct phy_sts_rpt_jgr2_type0 { /* @DW0 */ u8 page_num; u8 pwdb; -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 gain : 6; u8 rsvd_0 : 1; u8 trsw : 1; @@ -208,7 +208,7 @@ __PACK struct phy_sts_rpt_jgr2_type0 { /* @DW1 */ u8 rsvd_2; -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 rxsc : 4; u8 agc_table : 4; #else @@ -220,7 +220,7 @@ __PACK struct phy_sts_rpt_jgr2_type0 { /* @DW2 */ u16 length; -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 antidx_a : 3; u8 antidx_b : 3; u8 rsvd_3 : 2; @@ -238,7 +238,7 @@ __PACK struct phy_sts_rpt_jgr2_type0 { /* @DW3 */ u8 signal_quality; -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 vga : 5; u8 lna_l : 3; u8 bb_power : 6; @@ -267,7 +267,7 @@ __PACK struct phy_sts_rpt_jgr2_type1 { /* @DW0 and DW1 */ u8 page_num; u8 pwdb[4]; -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 l_rxsc : 4; u8 ht_rxsc : 4; #else @@ -275,7 +275,7 @@ __PACK struct phy_sts_rpt_jgr2_type1 { u8 l_rxsc : 4; #endif u8 channel; -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 band : 2; u8 rsvd_0 : 1; u8 hw_antsw_occu : 1; @@ -295,7 +295,7 @@ __PACK struct phy_sts_rpt_jgr2_type1 { /* @DW2 */ u16 lsig_length; -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 antidx_a : 3; u8 antidx_b : 3; u8 rsvd_1 : 2; @@ -313,7 +313,7 @@ __PACK struct phy_sts_rpt_jgr2_type1 { /* @DW3 */ u8 paid; -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 paid_msb : 1; u8 gid : 6; u8 rsvd_3 : 1; @@ -323,7 +323,7 @@ __PACK struct phy_sts_rpt_jgr2_type1 { u8 paid_msb : 1; #endif u8 intf_pos; -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 intf_pos_msb : 1; u8 rsvd_4 : 2; u8 nb_intf_flag : 1; @@ -351,7 +351,7 @@ __PACK struct phy_sts_rpt_jgr2_type2 { /* @DW0 ane DW1 */ u8 page_num; u8 pwdb[4]; -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 l_rxsc : 4; u8 ht_rxsc : 4; #else @@ -359,7 +359,7 @@ __PACK struct phy_sts_rpt_jgr2_type2 { u8 l_rxsc : 4; #endif u8 channel; -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 band : 2; u8 rsvd_0 : 1; u8 hw_antsw_occu : 1; @@ -378,7 +378,7 @@ __PACK struct phy_sts_rpt_jgr2_type2 { #endif /* @DW2 */ -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 shift_l_map : 6; u8 rsvd_1 : 2; #else @@ -386,7 +386,7 @@ __PACK struct phy_sts_rpt_jgr2_type2 { u8 shift_l_map : 6; #endif u8 cnt_pw2cca; -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 agc_table_a : 4; u8 agc_table_b : 4; u8 agc_table_c : 4; @@ -400,7 +400,7 @@ __PACK struct phy_sts_rpt_jgr2_type2 { /* @DW3 ~ DW6*/ u8 cnt_cca2agc_rdy; -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 gain_a : 6; u8 rsvd_2 : 1; u8 trsw_a : 1; @@ -437,7 +437,7 @@ __PACK struct phy_sts_rpt_jgr2_type2 { #endif u8 ht_aagc_gain[4]; u8 dagc_gain[4]; -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 counter : 6; u8 rsvd_6 : 2; u8 syn_count : 5; @@ -455,7 +455,7 @@ __PACK struct phy_sts_rpt_jgr2_type2 { #ifdef PHYSTS_3RD_TYPE_SUPPORT __PACK struct phy_sts_rpt_jgr3_type0 { /* @DW0 : Offset 0 */ -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 page_num : 4; u8 pkt_cnt : 2; u8 channel_msb : 2; @@ -465,7 +465,7 @@ __PACK struct phy_sts_rpt_jgr3_type0 { u8 page_num : 4; #endif u8 pwdb_a; -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 gain_a : 6; u8 rsvd_0 : 1; u8 trsw : 1; @@ -475,7 +475,7 @@ __PACK struct phy_sts_rpt_jgr3_type0 { u8 gain_a : 6; #endif -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 agc_table_b : 4; u8 agc_table_c : 4; #else @@ -484,14 +484,14 @@ __PACK struct phy_sts_rpt_jgr3_type0 { #endif /* @DW1 : Offset 4 */ -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 rsvd_1 : 4; u8 agc_table_d : 4; #else u8 agc_table_d : 4; u8 rsvd_1 : 4; #endif -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 l_rxsc : 4; u8 agc_table_a : 4; #else @@ -499,7 +499,7 @@ __PACK struct phy_sts_rpt_jgr3_type0 { u8 l_rxsc : 4; #endif u8 channel; -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 band : 2; u8 rsvd_2_1 : 1; u8 hw_antsw_occur_keep_cck : 1; @@ -517,14 +517,14 @@ __PACK struct phy_sts_rpt_jgr3_type0 { /* @DW2 : Offset 8 */ u16 length; -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 antidx_a : 4; u8 antidx_b : 4; #else u8 antidx_b : 4; u8 antidx_a : 4; #endif -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 antidx_c : 4; u8 antidx_d : 4; #else @@ -534,14 +534,14 @@ __PACK struct phy_sts_rpt_jgr3_type0 { /* @DW3 : Offset 12 */ u8 signal_quality; -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 vga_a : 5; u8 lna_l_a : 3; #else u8 lna_l_a : 3; u8 vga_a : 5; #endif -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 bb_power_a : 6; u8 rsvd_3_1 : 1; u8 lna_h_a : 1; @@ -551,7 +551,7 @@ __PACK struct phy_sts_rpt_jgr3_type0 { u8 rsvd_3_1 : 1; u8 bb_power_a : 6; #endif -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 rxrate : 2; u8 raterr : 1; u8 lockbit : 1; @@ -569,14 +569,14 @@ __PACK struct phy_sts_rpt_jgr3_type0 { /* @DW4 : Offset 16 */ u8 pwdb_b; -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 vga_b : 5; u8 lna_l_b : 3; #else u8 lna_l_b : 3; u8 vga_b : 5; #endif -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 bb_power_b : 6; u8 rsvd_4_1 : 1; u8 lna_h_b : 1; @@ -585,7 +585,7 @@ __PACK struct phy_sts_rpt_jgr3_type0 { u8 rsvd_4_1 : 1; u8 bb_power_b : 6; #endif -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 gain_b : 6; u8 rsvd_4_2 : 2; #else @@ -595,14 +595,14 @@ __PACK struct phy_sts_rpt_jgr3_type0 { /* @DW5 : Offset 20 */ u8 pwdb_c; -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 vga_c : 5; u8 lna_l_c : 3; #else u8 lna_l_c : 3; u8 vga_c : 5; #endif -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 bb_power_c : 6; u8 rsvd_5_1 : 1; u8 lna_h_c : 1; @@ -611,7 +611,7 @@ __PACK struct phy_sts_rpt_jgr3_type0 { u8 rsvd_5_1 : 1; u8 bb_power_c : 6; #endif -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 gain_c : 6; u8 rsvd_5_2 : 2; #else @@ -621,14 +621,14 @@ __PACK struct phy_sts_rpt_jgr3_type0 { /* @DW6 : Offset 24 */ u8 pwdb_d; -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 vga_d : 5; u8 lna_l_d : 3; #else u8 lna_l_d : 3; u8 vga_d : 5; #endif -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 bb_power_d : 6; u8 rsvd_6_1 : 1; u8 lna_h_d : 1; @@ -637,7 +637,7 @@ __PACK struct phy_sts_rpt_jgr3_type0 { u8 rsvd_6_1 : 1; u8 bb_power_d : 6; #endif -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 gain_d : 6; u8 rsvd_6_2 : 2; #else @@ -648,7 +648,7 @@ __PACK struct phy_sts_rpt_jgr3_type0 { __PACK struct phy_sts_rpt_jgr3_type1 { /* @DW0 : Offset 0 */ -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 page_num : 4; u8 pkt_cnt : 2; u8 channel_pri_msb : 2; @@ -663,7 +663,7 @@ __PACK struct phy_sts_rpt_jgr3_type1 { /* @DW1 : Offset 4 */ u8 pwdb_d; -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 l_rxsc : 4; u8 ht_rxsc : 4; #else @@ -671,7 +671,7 @@ __PACK struct phy_sts_rpt_jgr3_type1 { u8 l_rxsc : 4; #endif u8 channel_pri_lsb; -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 band : 2; u8 rsvd_0 : 2; u8 gnt_bt : 1; @@ -689,7 +689,7 @@ __PACK struct phy_sts_rpt_jgr3_type1 { /* @DW2 : Offset 8 */ u8 channel_sec_lsb; -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 channel_sec_msb : 2; u8 rsvd_1 : 2; u8 hw_antsw_occur_a : 1; @@ -705,14 +705,14 @@ __PACK struct phy_sts_rpt_jgr3_type1 { u8 channel_sec_msb : 2; #endif -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 antidx_a : 4; u8 antidx_b : 4; #else u8 antidx_b : 4; u8 antidx_a : 4; #endif -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 antidx_c : 4; u8 antidx_d : 4; #else @@ -722,7 +722,7 @@ __PACK struct phy_sts_rpt_jgr3_type1 { /* @DW3 : Offset 12 */ u8 paid; -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 paid_msb : 1; u8 gid : 6; u8 rsvd_3 : 1; @@ -735,7 +735,7 @@ __PACK struct phy_sts_rpt_jgr3_type1 { #if 0 /*@ u8 rsvd_4; -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 rsvd_5: 6; u8 rf_mode: 2; #else @@ -757,7 +757,7 @@ __PACK struct phy_sts_rpt_jgr3_type1 { __PACK struct phy_sts_rpt_jgr3_type2_3 { /* Type2 is primary channel & type3 is secondary channel */ /* @DW0 and DW1: Offest 0 and Offset 4 */ -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 page_num : 4; u8 pkt_cnt : 2; u8 channel_msb : 2; @@ -767,7 +767,7 @@ __PACK struct phy_sts_rpt_jgr3_type2_3 { u8 page_num : 4; #endif u8 pwdb[4]; -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 l_rxsc : 4; u8 ht_rxsc : 4; #else @@ -775,7 +775,7 @@ __PACK struct phy_sts_rpt_jgr3_type2_3 { u8 l_rxsc : 4; #endif u8 channel_lsb; -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 band : 2; u8 rsvd_0 : 2; u8 gnt_bt : 1; @@ -792,7 +792,7 @@ __PACK struct phy_sts_rpt_jgr3_type2_3 { #endif /* @DW2 : Offset 8 */ -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 shift_l_map : 6; u8 rsvd_1 : 2; #else @@ -800,14 +800,14 @@ __PACK struct phy_sts_rpt_jgr3_type2_3 { u8 shift_l_map : 6; #endif s8 pwed_th; /* @dynamic energy threshold S(8,2) */ -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 agc_table_a : 4; u8 agc_table_b : 4; #else u8 agc_table_b : 4; u8 agc_table_a : 4; #endif -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 agc_table_c : 4; u8 agc_table_d : 4; #else @@ -817,21 +817,21 @@ __PACK struct phy_sts_rpt_jgr3_type2_3 { /* @DW3 : Offset 12 */ u8 cnt_cca2agc_rdy; /* Time(ns) = cnt_cca2agc_ready*25 */ -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 mp_gain_a : 6; u8 mp_gain_b_lsb : 2; #else u8 mp_gain_b_lsb : 2; u8 mp_gain_a : 6; #endif -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 mp_gain_b_msb : 4; u8 mp_gain_c_lsb : 4; #else u8 mp_gain_c_lsb : 4; u8 mp_gain_b_msb : 4; #endif -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 mp_gain_c_msb : 2; u8 avg_noise_pwr_lsb : 4; u8 rsvd_3 : 2; @@ -843,7 +843,7 @@ __PACK struct phy_sts_rpt_jgr3_type2_3 { u8 mp_gain_c_msb : 2; #endif /* @DW4 ~ 5: offset 16 ~20 */ -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 mp_gain_d : 6; u8 is_freq_select_fading : 1; u8 rsvd_2 : 1; @@ -852,7 +852,7 @@ __PACK struct phy_sts_rpt_jgr3_type2_3 { u8 is_freq_select_fading : 1; u8 mp_gain_d : 6; #endif -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 aagc_step_a : 2; u8 aagc_step_b : 2; u8 aagc_step_c : 2; @@ -865,14 +865,14 @@ __PACK struct phy_sts_rpt_jgr3_type2_3 { #endif u8 ht_aagc_gain[4]; u8 dagc_gain[4]; -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 counter : 6; u8 syn_count_lsb : 2; #else u8 syn_count_lsb : 2; u8 counter : 6; #endif -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 syn_count_msb : 3; u8 avg_noise_pwr_msb : 5; #else @@ -884,7 +884,7 @@ __PACK struct phy_sts_rpt_jgr3_type2_3 { __PACK struct phy_sts_rpt_jgr3_type4 { /* smart antenna */ /* @DW0 and DW1 : offset 0 and 4 */ -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 page_num : 4; u8 pkt_cnt : 2; u8 channel_msb : 2; @@ -894,7 +894,7 @@ __PACK struct phy_sts_rpt_jgr3_type4 { u8 page_num : 4; #endif u8 pwdb[4]; -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 l_rxsc : 4; u8 ht_rxsc : 4; #else @@ -902,7 +902,7 @@ __PACK struct phy_sts_rpt_jgr3_type4 { u8 l_rxsc : 4; #endif u8 channel_lsb; -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 band : 2; u8 rsvd_0 : 2; u8 gnt_bt : 1; @@ -919,14 +919,14 @@ __PACK struct phy_sts_rpt_jgr3_type4 { #endif /* @DW2 : offset 8 */ -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 bad_tone_cnt_min_eign_0 : 4; u8 bad_tone_cnt_cn_excess_0 : 4; #else u8 bad_tone_cnt_cn_excess_0 : 4; u8 bad_tone_cnt_min_eign_0 : 4; #endif -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 training_done_a : 1; u8 training_done_b : 1; u8 training_done_c : 1; @@ -945,14 +945,14 @@ __PACK struct phy_sts_rpt_jgr3_type4 { u8 training_done_b : 1; u8 training_done_a : 1; #endif -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 antidx_a : 4; u8 antidx_b : 4; #else u8 antidx_b : 4; u8 antidx_a : 4; #endif -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 antidx_c : 4; u8 antidx_d : 4; #else @@ -961,21 +961,21 @@ __PACK struct phy_sts_rpt_jgr3_type4 { #endif /* @DW3 : offset 12 */ u8 tx_pkt_cnt; -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 bad_tone_cnt_min_eign_1 : 4; u8 bad_tone_cnt_cn_excess_1 : 4; #else u8 bad_tone_cnt_cn_excess_1 : 4; u8 bad_tone_cnt_min_eign_1 : 4; #endif -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 avg_cond_num_0 : 7; u8 avg_cond_num_1_lsb : 1; #else u8 avg_cond_num_1_lsb : 1; u8 avg_cond_num_0 : 7; #endif -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 avg_cond_num_1_msb : 6; u8 rsvd_1 : 2; #else @@ -996,7 +996,7 @@ __PACK struct phy_sts_rpt_jgr3_type4 { __PACK struct phy_sts_rpt_jgr3_type5 { /* @Debug */ /* @DW0 ane DW1 : offset 0 and 4 */ -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 page_num : 4; u8 pkt_cnt : 2; u8 channel_msb : 2; @@ -1006,7 +1006,7 @@ __PACK struct phy_sts_rpt_jgr3_type5 { u8 page_num : 4; #endif u8 pwdb[4]; -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 l_rxsc : 4; u8 ht_rxsc : 4; #else @@ -1014,7 +1014,7 @@ __PACK struct phy_sts_rpt_jgr3_type5 { u8 l_rxsc : 4; #endif u8 channel_lsb; -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 band : 2; u8 rsvd_0 : 2; u8 gnt_bt : 1; @@ -1031,7 +1031,7 @@ __PACK struct phy_sts_rpt_jgr3_type5 { #endif /* @DW2 : offset 8 */ u8 rsvd_1; -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 rsvd_2 : 4; u8 hw_antsw_occur_a : 1; u8 hw_antsw_occur_b : 1; @@ -1044,14 +1044,14 @@ __PACK struct phy_sts_rpt_jgr3_type5 { u8 hw_antsw_occur_a : 1; u8 rsvd_2 : 4; #endif -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 antidx_a : 4; u8 antidx_b : 4; #else u8 antidx_b : 4; u8 antidx_a : 4; #endif -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 antidx_c : 4; u8 antidx_d : 4; #else @@ -1060,7 +1060,7 @@ __PACK struct phy_sts_rpt_jgr3_type5 { #endif /* @DW3 : offset 12 */ u8 tx_pkt_cnt; -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) +#ifdef __LITTLE_ENDIAN u8 inf_pos_0_A_flg : 1; u8 inf_pos_1_A_flg : 1; u8 inf_pos_0_B_flg : 1; diff --git a/hal/phydm/phydm_precomp.h b/hal/phydm/phydm_precomp.h index 545bee4..d581e74 100644 --- a/hal/phydm/phydm_precomp.h +++ b/hal/phydm/phydm_precomp.h @@ -44,12 +44,6 @@ #include "../8192cd.h" #include "../8192cd_util.h" #include "../8192cd_hw.h" - #ifdef _BIG_ENDIAN_ - #define ODM_ENDIAN_TYPE ODM_ENDIAN_BIG - #else - #define ODM_ENDIAN_TYPE ODM_ENDIAN_LITTLE - #endif - #include "../8192cd_headers.h" #include "../8192cd_debug.h" @@ -75,13 +69,11 @@ #define __WLAN_ATTRIB_PACK__ #elif (DM_ODM_SUPPORT_TYPE == ODM_WIN) #include "mp_precomp.h" - #define ODM_ENDIAN_TYPE ODM_ENDIAN_LITTLE #define __PACK #define __WLAN_ATTRIB_PACK__ #elif (DM_ODM_SUPPORT_TYPE == ODM_IOT) #include #include - #define ODM_ENDIAN_TYPE ODM_ENDIAN_LITTLE #define __PACK #endif diff --git a/hal/phydm/phydm_types.h b/hal/phydm/phydm_types.h index a13f506..43f0099 100644 --- a/hal/phydm/phydm_types.h +++ b/hal/phydm/phydm_types.h @@ -38,10 +38,6 @@ #define __odm_func__ #define __odm_func_aon__ -/*Deifne HW endian support*/ -#define ODM_ENDIAN_BIG 0 -#define ODM_ENDIAN_LITTLE 1 - #if (DM_ODM_SUPPORT_TYPE == ODM_WIN) #define GET_PDM_ODM(__padapter) ((struct dm_struct*)(&(GET_HAL_DATA(__padapter))->DM_OutSrc)) #elif (DM_ODM_SUPPORT_TYPE == ODM_CE) @@ -187,14 +183,6 @@ enum rt_spinlock_type { #define DEV_BUS_TYPE RT_PCI_INTERFACE - #if defined(__LITTLE_ENDIAN) - #define ODM_ENDIAN_TYPE ODM_ENDIAN_LITTLE - #elif defined(__BIG_ENDIAN) - #define ODM_ENDIAN_TYPE ODM_ENDIAN_BIG - #else - #error - #endif - /* define useless flag to avoid compile warning */ #define USE_WORKITEM 0 #define FOR_BRAZIL_PRETEST 0 @@ -224,13 +212,6 @@ enum rt_spinlock_type { #define DEV_BUS_TYPE RT_SDIO_INTERFACE #endif - - #if defined(CONFIG_LITTLE_ENDIAN) - #define ODM_ENDIAN_TYPE ODM_ENDIAN_LITTLE - #elif defined(CONFIG_BIG_ENDIAN) - #define ODM_ENDIAN_TYPE ODM_ENDIAN_BIG - #endif - #define boolean bool #define SET_TX_DESC_ANTSEL_A_88E(__ptx_desc, __value) SET_BITS_TO_LE_4BYTE(__ptx_desc + 8, 24, 1, __value) diff --git a/include/byteorder/big_endian.h b/include/byteorder/big_endian.h deleted file mode 100644 index 6b1dc44..0000000 --- a/include/byteorder/big_endian.h +++ /dev/null @@ -1,82 +0,0 @@ -/****************************************************************************** - * - * Copyright(c) 2007 - 2017 Realtek Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - *****************************************************************************/ -#ifndef _LINUX_BYTEORDER_BIG_ENDIAN_H -#define _LINUX_BYTEORDER_BIG_ENDIAN_H - -#ifndef __BIG_ENDIAN - #define __BIG_ENDIAN 4321 -#endif -#ifndef __BIG_ENDIAN_BITFIELD - #define __BIG_ENDIAN_BITFIELD -#endif - -#include - -#define __constant_htonl(x) ((__u32)(x)) -#define __constant_ntohl(x) ((__u32)(x)) -#define __constant_htons(x) ((__u16)(x)) -#define __constant_ntohs(x) ((__u16)(x)) -#define __constant_cpu_to_le64(x) ___constant_swab64((x)) -#define __constant_le64_to_cpu(x) ___constant_swab64((x)) -#define __constant_cpu_to_le32(x) ___constant_swab32((x)) -#define __constant_le32_to_cpu(x) ___constant_swab32((x)) -#define __constant_cpu_to_le16(x) ___constant_swab16((x)) -#define __constant_le16_to_cpu(x) ___constant_swab16((x)) -#define __constant_cpu_to_be64(x) ((__u64)(x)) -#define __constant_be64_to_cpu(x) ((__u64)(x)) -#define __constant_cpu_to_be32(x) ((__u32)(x)) -#define __constant_be32_to_cpu(x) ((__u32)(x)) -#define __constant_cpu_to_be16(x) ((__u16)(x)) -#define __constant_be16_to_cpu(x) ((__u16)(x)) -#define __cpu_to_le64(x) __swab64((x)) -#define __le64_to_cpu(x) __swab64((x)) -#define __cpu_to_le32(x) __swab32((x)) -#define __le32_to_cpu(x) __swab32((x)) -#define __cpu_to_le16(x) __swab16((x)) -#define __le16_to_cpu(x) __swab16((x)) -#define __cpu_to_be64(x) ((__u64)(x)) -#define __be64_to_cpu(x) ((__u64)(x)) -#define __cpu_to_be32(x) ((__u32)(x)) -#define __be32_to_cpu(x) ((__u32)(x)) -#define __cpu_to_be16(x) ((__u16)(x)) -#define __be16_to_cpu(x) ((__u16)(x)) -#define __cpu_to_le64p(x) __swab64p((x)) -#define __le64_to_cpup(x) __swab64p((x)) -#define __cpu_to_le32p(x) __swab32p((x)) -#define __le32_to_cpup(x) __swab32p((x)) -#define __cpu_to_le16p(x) __swab16p((x)) -#define __le16_to_cpup(x) __swab16p((x)) -#define __cpu_to_be64p(x) (*(__u64 *)(x)) -#define __be64_to_cpup(x) (*(__u64 *)(x)) -#define __cpu_to_be32p(x) (*(__u32 *)(x)) -#define __be32_to_cpup(x) (*(__u32 *)(x)) -#define __cpu_to_be16p(x) (*(__u16 *)(x)) -#define __be16_to_cpup(x) (*(__u16 *)(x)) -#define __cpu_to_le64s(x) __swab64s((x)) -#define __le64_to_cpus(x) __swab64s((x)) -#define __cpu_to_le32s(x) __swab32s((x)) -#define __le32_to_cpus(x) __swab32s((x)) -#define __cpu_to_le16s(x) __swab16s((x)) -#define __le16_to_cpus(x) __swab16s((x)) -#define __cpu_to_be64s(x) do {} while (0) -#define __be64_to_cpus(x) do {} while (0) -#define __cpu_to_be32s(x) do {} while (0) -#define __be32_to_cpus(x) do {} while (0) -#define __cpu_to_be16s(x) do {} while (0) -#define __be16_to_cpus(x) do {} while (0) - -#include - -#endif /* _LINUX_BYTEORDER_BIG_ENDIAN_H */ diff --git a/include/byteorder/generic.h b/include/byteorder/generic.h deleted file mode 100644 index f85114b..0000000 --- a/include/byteorder/generic.h +++ /dev/null @@ -1,207 +0,0 @@ -/****************************************************************************** - * - * Copyright(c) 2007 - 2017 Realtek Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - *****************************************************************************/ -#ifndef _LINUX_BYTEORDER_GENERIC_H -#define _LINUX_BYTEORDER_GENERIC_H - -/* - * linux/byteorder_generic.h - * Generic Byte-reordering support - * - * Francois-Rene Rideau 19970707 - * gathered all the good ideas from all asm-foo/byteorder.h into one file, - * cleaned them up. - * I hope it is compliant with non-GCC compilers. - * I decided to put __BYTEORDER_HAS_U64__ in byteorder.h, - * because I wasn't sure it would be ok to put it in types.h - * Upgraded it to 2.1.43 - * Francois-Rene Rideau 19971012 - * Upgraded it to 2.1.57 - * to please Linus T., replaced huge #ifdef's between little/big endian - * by nestedly #include'd files. - * Francois-Rene Rideau 19971205 - * Made it to 2.1.71; now a facelift: - * Put files under include/linux/byteorder/ - * Split swab from generic support. - * - * TODO: - * = Regular kernel maintainers could also replace all these manual - * byteswap macros that remain, disseminated among drivers, - * after some grep or the sources... - * = Linus might want to rename all these macros and files to fit his taste, - * to fit his personal naming scheme. - * = it seems that a few drivers would also appreciate - * nybble swapping support... - * = every architecture could add their byteswap macro in asm/byteorder.h - * see how some architectures already do (i386, alpha, ppc, etc) - * = cpu_to_beXX and beXX_to_cpu might some day need to be well - * distinguished throughout the kernel. This is not the case currently, - * since little endian, big endian, and pdp endian machines needn't it. - * But this might be the case for, say, a port of Linux to 20/21 bit - * architectures (and F21 Linux addict around?). - */ - -/* - * The following macros are to be defined by : - * - * Conversion of long and short int between network and host format - * ntohl(__u32 x) - * ntohs(__u16 x) - * htonl(__u32 x) - * htons(__u16 x) - * It seems that some programs (which? where? or perhaps a standard? POSIX?) - * might like the above to be functions, not macros (why?). - * if that's true, then detect them, and take measures. - * Anyway, the measure is: define only ___ntohl as a macro instead, - * and in a separate file, have - * unsigned long inline ntohl(x){return ___ntohl(x);} - * - * The same for constant arguments - * __constant_ntohl(__u32 x) - * __constant_ntohs(__u16 x) - * __constant_htonl(__u32 x) - * __constant_htons(__u16 x) - * - * Conversion of XX-bit integers (16- 32- or 64-) - * between native CPU format and little/big endian format - * 64-bit stuff only defined for proper architectures - * cpu_to_[bl]eXX(__uXX x) - * [bl]eXX_to_cpu(__uXX x) - * - * The same, but takes a pointer to the value to convert - * cpu_to_[bl]eXXp(__uXX x) - * [bl]eXX_to_cpup(__uXX x) - * - * The same, but change in situ - * cpu_to_[bl]eXXs(__uXX x) - * [bl]eXX_to_cpus(__uXX x) - * - * See asm-foo/byteorder.h for examples of how to provide - * architecture-optimized versions - * - */ - - -#if defined(PLATFORM_LINUX) || defined(PLATFORM_WINDOWS) || defined(PLATFORM_MPIXEL) || defined(PLATFORM_FREEBSD) - /* - * inside the kernel, we can use nicknames; - * outside of it, we must avoid POSIX namespace pollution... - */ - #define cpu_to_le64 __cpu_to_le64 - #define le64_to_cpu __le64_to_cpu - #define cpu_to_le32 __cpu_to_le32 - #define le32_to_cpu __le32_to_cpu - #define cpu_to_le16 __cpu_to_le16 - #define le16_to_cpu __le16_to_cpu - #define cpu_to_be64 __cpu_to_be64 - #define be64_to_cpu __be64_to_cpu - #define cpu_to_be32 __cpu_to_be32 - #define be32_to_cpu __be32_to_cpu - #define cpu_to_be16 __cpu_to_be16 - #define be16_to_cpu __be16_to_cpu - #define cpu_to_le64p __cpu_to_le64p - #define le64_to_cpup __le64_to_cpup - #define cpu_to_le32p __cpu_to_le32p - #define le32_to_cpup __le32_to_cpup - #define cpu_to_le16p __cpu_to_le16p - #define le16_to_cpup __le16_to_cpup - #define cpu_to_be64p __cpu_to_be64p - #define be64_to_cpup __be64_to_cpup - #define cpu_to_be32p __cpu_to_be32p - #define be32_to_cpup __be32_to_cpup - #define cpu_to_be16p __cpu_to_be16p - #define be16_to_cpup __be16_to_cpup - #define cpu_to_le64s __cpu_to_le64s - #define le64_to_cpus __le64_to_cpus - #define cpu_to_le32s __cpu_to_le32s - #define le32_to_cpus __le32_to_cpus - #define cpu_to_le16s __cpu_to_le16s - #define le16_to_cpus __le16_to_cpus - #define cpu_to_be64s __cpu_to_be64s - #define be64_to_cpus __be64_to_cpus - #define cpu_to_be32s __cpu_to_be32s - #define be32_to_cpus __be32_to_cpus - #define cpu_to_be16s __cpu_to_be16s - #define be16_to_cpus __be16_to_cpus -#endif - - -/* - * Handle ntohl and suches. These have various compatibility - * issues - like we want to give the prototype even though we - * also have a macro for them in case some strange program - * wants to take the address of the thing or something.. - * - * Note that these used to return a "long" in libc5, even though - * long is often 64-bit these days.. Thus the casts. - * - * They have to be macros in order to do the constant folding - * correctly - if the argument passed into a inline function - * it is no longer constant according to gcc.. - */ - -#undef ntohl -#undef ntohs -#undef htonl -#undef htons - -/* - * Do the prototypes. Somebody might want to take the - * address or some such sick thing.. - */ -#if defined(PLATFORM_LINUX) || (defined(__GLIBC__) && __GLIBC__ >= 2) - extern __u32 ntohl(__u32); - extern __u32 htonl(__u32); -#else /* defined(PLATFORM_LINUX) || (defined (__GLIBC__) && __GLIBC__ >= 2) */ - #ifndef PLATFORM_FREEBSD - extern unsigned long int ntohl(unsigned long int); - extern unsigned long int htonl(unsigned long int); - #endif -#endif -#ifndef PLATFORM_FREEBSD - extern unsigned short int ntohs(unsigned short int); - extern unsigned short int htons(unsigned short int); -#endif - -#if defined(__GNUC__) && (__GNUC__ >= 2) && defined(__OPTIMIZE__) || defined(PLATFORM_MPIXEL) - - #define ___htonl(x) __cpu_to_be32(x) - #define ___htons(x) __cpu_to_be16(x) - #define ___ntohl(x) __be32_to_cpu(x) - #define ___ntohs(x) __be16_to_cpu(x) - - #if defined(PLATFORM_LINUX) || (defined(__GLIBC__) && __GLIBC__ >= 2) - #define htonl(x) ___htonl(x) - #define ntohl(x) ___ntohl(x) - #else - #define htonl(x) ((unsigned long)___htonl(x)) - #define ntohl(x) ((unsigned long)___ntohl(x)) - #endif - #define htons(x) ___htons(x) - #define ntohs(x) ___ntohs(x) - -#endif /* OPTIMIZE */ - - -#if defined(PLATFORM_WINDOWS) - - #define htonl(x) __cpu_to_be32(x) - #define ntohl(x) __be32_to_cpu(x) - #define htons(x) __cpu_to_be16(x) - #define ntohs(x) __be16_to_cpu(x) - - -#endif - -#endif /* _LINUX_BYTEORDER_GENERIC_H */ diff --git a/include/byteorder/little_endian.h b/include/byteorder/little_endian.h deleted file mode 100644 index c4b6451..0000000 --- a/include/byteorder/little_endian.h +++ /dev/null @@ -1,84 +0,0 @@ -/****************************************************************************** - * - * Copyright(c) 2007 - 2017 Realtek Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - *****************************************************************************/ -#ifndef _LINUX_BYTEORDER_LITTLE_ENDIAN_H -#define _LINUX_BYTEORDER_LITTLE_ENDIAN_H - -#ifndef __LITTLE_ENDIAN - #define __LITTLE_ENDIAN 1234 -#endif -#ifndef __LITTLE_ENDIAN_BITFIELD - #define __LITTLE_ENDIAN_BITFIELD -#endif - -#include - -#ifndef __constant_htonl - #define __constant_htonl(x) ___constant_swab32((x)) - #define __constant_ntohl(x) ___constant_swab32((x)) - #define __constant_htons(x) ___constant_swab16((x)) - #define __constant_ntohs(x) ___constant_swab16((x)) - #define __constant_cpu_to_le64(x) ((__u64)(x)) - #define __constant_le64_to_cpu(x) ((__u64)(x)) - #define __constant_cpu_to_le32(x) ((__u32)(x)) - #define __constant_le32_to_cpu(x) ((__u32)(x)) - #define __constant_cpu_to_le16(x) ((__u16)(x)) - #define __constant_le16_to_cpu(x) ((__u16)(x)) - #define __constant_cpu_to_be64(x) ___constant_swab64((x)) - #define __constant_be64_to_cpu(x) ___constant_swab64((x)) - #define __constant_cpu_to_be32(x) ___constant_swab32((x)) - #define __constant_be32_to_cpu(x) ___constant_swab32((x)) - #define __constant_cpu_to_be16(x) ___constant_swab16((x)) - #define __constant_be16_to_cpu(x) ___constant_swab16((x)) - #define __cpu_to_le64(x) ((__u64)(x)) - #define __le64_to_cpu(x) ((__u64)(x)) - #define __cpu_to_le32(x) ((__u32)(x)) - #define __le32_to_cpu(x) ((__u32)(x)) - #define __cpu_to_le16(x) ((__u16)(x)) - #define __le16_to_cpu(x) ((__u16)(x)) - #define __cpu_to_be64(x) __swab64((x)) - #define __be64_to_cpu(x) __swab64((x)) - #define __cpu_to_be32(x) __swab32((x)) - #define __be32_to_cpu(x) __swab32((x)) - #define __cpu_to_be16(x) __swab16((x)) - #define __be16_to_cpu(x) __swab16((x)) - #define __cpu_to_le64p(x) (*(__u64 *)(x)) - #define __le64_to_cpup(x) (*(__u64 *)(x)) - #define __cpu_to_le32p(x) (*(__u32 *)(x)) - #define __le32_to_cpup(x) (*(__u32 *)(x)) - #define __cpu_to_le16p(x) (*(__u16 *)(x)) - #define __le16_to_cpup(x) (*(__u16 *)(x)) - #define __cpu_to_be64p(x) __swab64p((x)) - #define __be64_to_cpup(x) __swab64p((x)) - #define __cpu_to_be32p(x) __swab32p((x)) - #define __be32_to_cpup(x) __swab32p((x)) - #define __cpu_to_be16p(x) __swab16p((x)) - #define __be16_to_cpup(x) __swab16p((x)) - #define __cpu_to_le64s(x) do {} while (0) - #define __le64_to_cpus(x) do {} while (0) - #define __cpu_to_le32s(x) do {} while (0) - #define __le32_to_cpus(x) do {} while (0) - #define __cpu_to_le16s(x) do {} while (0) - #define __le16_to_cpus(x) do {} while (0) - #define __cpu_to_be64s(x) __swab64s((x)) - #define __be64_to_cpus(x) __swab64s((x)) - #define __cpu_to_be32s(x) __swab32s((x)) - #define __be32_to_cpus(x) __swab32s((x)) - #define __cpu_to_be16s(x) __swab16s((x)) - #define __be16_to_cpus(x) __swab16s((x)) -#endif /* __constant_htonl */ - -#include - -#endif /* _LINUX_BYTEORDER_LITTLE_ENDIAN_H */ diff --git a/include/byteorder/swab.h b/include/byteorder/swab.h deleted file mode 100644 index a8dd46b..0000000 --- a/include/byteorder/swab.h +++ /dev/null @@ -1,136 +0,0 @@ -/****************************************************************************** - * - * Copyright(c) 2007 - 2017 Realtek Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - *****************************************************************************/ -#ifndef _LINUX_BYTEORDER_SWAB_H -#define _LINUX_BYTEORDER_SWAB_H - -#if !defined(CONFIG_PLATFORM_MSTAR) -#ifndef __u16 - typedef unsigned short __u16; -#endif - -#ifndef __u32 - typedef unsigned int __u32; -#endif - -#ifndef __u8 - typedef unsigned char __u8; -#endif - -#ifndef __u64 - typedef unsigned long long __u64; -#endif - - -__inline static __u16 ___swab16(__u16 x) -{ - __u16 __x = x; - return - (__u16)( - (((__u16)(__x)&(__u16)0x00ffU) << 8) | - (((__u16)(__x)&(__u16)0xff00U) >> 8)); - -} - -__inline static __u32 ___swab32(__u32 x) -{ - __u32 __x = (x); - return (__u32)( - (((__u32)(__x)&(__u32)0x000000ffUL) << 24) | - (((__u32)(__x)&(__u32)0x0000ff00UL) << 8) | - (((__u32)(__x)&(__u32)0x00ff0000UL) >> 8) | - (((__u32)(__x)&(__u32)0xff000000UL) >> 24)); -} - -__inline static __u64 ___swab64(__u64 x) -{ - __u64 __x = (x); - - return - (__u64)(\ - (__u64)(((__u64)(__x)&(__u64)0x00000000000000ffULL) << 56) | \ - (__u64)(((__u64)(__x)&(__u64)0x000000000000ff00ULL) << 40) | \ - (__u64)(((__u64)(__x)&(__u64)0x0000000000ff0000ULL) << 24) | \ - (__u64)(((__u64)(__x)&(__u64)0x00000000ff000000ULL) << 8) | \ - (__u64)(((__u64)(__x)&(__u64)0x000000ff00000000ULL) >> 8) | \ - (__u64)(((__u64)(__x)&(__u64)0x0000ff0000000000ULL) >> 24) | \ - (__u64)(((__u64)(__x)&(__u64)0x00ff000000000000ULL) >> 40) | \ - (__u64)(((__u64)(__x)&(__u64)0xff00000000000000ULL) >> 56)); - \ -} -#endif /* CONFIG_PLATFORM_MSTAR */ - -#ifndef __arch__swab16 -__inline static __u16 __arch__swab16(__u16 x) -{ - return ___swab16(x); -} - -#endif - -#ifndef __arch__swab32 -__inline static __u32 __arch__swab32(__u32 x) -{ - __u32 __tmp = (x) ; - return ___swab32(__tmp); -} -#endif - -#ifndef __arch__swab64 - -__inline static __u64 __arch__swab64(__u64 x) -{ - __u64 __tmp = (x) ; - return ___swab64(__tmp); -} - - -#endif - -#ifndef __swab16 - #define __swab16(x) __fswab16(x) - #define __swab32(x) __fswab32(x) - #define __swab64(x) __fswab64(x) -#endif /* __swab16 */ - -#ifdef PLATFORM_FREEBSD - __inline static __u16 __fswab16(__u16 x) -#else - __inline static const __u16 __fswab16(__u16 x) -#endif /* PLATFORM_FREEBSD */ -{ - return __arch__swab16(x); -} -#ifdef PLATFORM_FREEBSD - __inline static __u32 __fswab32(__u32 x) -#else - __inline static const __u32 __fswab32(__u32 x) -#endif /* PLATFORM_FREEBSD */ -{ - return __arch__swab32(x); -} - -#if defined(PLATFORM_LINUX) || defined(PLATFORM_WINDOWS) - #define swab16 __swab16 - #define swab32 __swab32 - #define swab64 __swab64 - #define swab16p __swab16p - #define swab32p __swab32p - #define swab64p __swab64p - #define swab16s __swab16s - #define swab32s __swab32s - #define swab64s __swab64s -#endif - -#endif /* _LINUX_BYTEORDER_SWAB_H */ diff --git a/include/byteorder/swabb.h b/include/byteorder/swabb.h deleted file mode 100644 index 634519a..0000000 --- a/include/byteorder/swabb.h +++ /dev/null @@ -1,151 +0,0 @@ -/****************************************************************************** - * - * Copyright(c) 2007 - 2017 Realtek Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - *****************************************************************************/ -#ifndef _LINUX_BYTEORDER_SWABB_H -#define _LINUX_BYTEORDER_SWABB_H - -/* - * linux/byteorder/swabb.h - * SWAp Bytes Bizarrely - * swaHHXX[ps]?(foo) - * - * Support for obNUXIous pdp-endian and other bizarre architectures. - * Will Linux ever run on such ancient beasts? if not, this file - * will be but a programming pearl. Still, it's a reminder that we - * shouldn't be making too many assumptions when trying to be portable. - * - */ - -/* - * Meaning of the names I chose (vaxlinux people feel free to correct them): - * swahw32 swap 16-bit half-words in a 32-bit word - * swahb32 swap 8-bit halves of each 16-bit half-word in a 32-bit word - * - * No 64-bit support yet. I don't know NUXI conventions for long longs. - * I guarantee it will be a mess when it's there, though :-> - * It will be even worse if there are conflicting 64-bit conventions. - * Hopefully, no one ever used 64-bit objects on NUXI machines. - * - */ - -#define ___swahw32(x) \ - ({ \ - __u32 __x = (x); \ - ((__u32)(\ - (((__u32)(__x) & (__u32)0x0000ffffUL) << 16) | \ - (((__u32)(__x) & (__u32)0xffff0000UL) >> 16))); \ - }) -#define ___swahb32(x) \ - ({ \ - __u32 __x = (x); \ - ((__u32)(\ - (((__u32)(__x) & (__u32)0x00ff00ffUL) << 8) | \ - (((__u32)(__x) & (__u32)0xff00ff00UL) >> 8))); \ - }) - -#define ___constant_swahw32(x) \ - ((__u32)(\ - (((__u32)(x) & (__u32)0x0000ffffUL) << 16) | \ - (((__u32)(x) & (__u32)0xffff0000UL) >> 16))) -#define ___constant_swahb32(x) \ - ((__u32)(\ - (((__u32)(x) & (__u32)0x00ff00ffUL) << 8) | \ - (((__u32)(x) & (__u32)0xff00ff00UL) >> 8))) - -/* - * provide defaults when no architecture-specific optimization is detected - */ -#ifndef __arch__swahw32 - #define __arch__swahw32(x) ___swahw32(x) -#endif -#ifndef __arch__swahb32 - #define __arch__swahb32(x) ___swahb32(x) -#endif - -#ifndef __arch__swahw32p - #define __arch__swahw32p(x) __swahw32(*(x)) -#endif -#ifndef __arch__swahb32p - #define __arch__swahb32p(x) __swahb32(*(x)) -#endif - -#ifndef __arch__swahw32s - #define __arch__swahw32s(x) do { *(x) = __swahw32p((x)); } while (0) -#endif -#ifndef __arch__swahb32s - #define __arch__swahb32s(x) do { *(x) = __swahb32p((x)); } while (0) -#endif - - -/* - * Allow constant folding - */ -#if defined(__GNUC__) && (__GNUC__ >= 2) && defined(__OPTIMIZE__) -# define __swahw32(x) \ - (__builtin_constant_p((__u32)(x)) ? \ - ___swahw32((x)) : \ - __fswahw32((x))) -# define __swahb32(x) \ - (__builtin_constant_p((__u32)(x)) ? \ - ___swahb32((x)) : \ - __fswahb32((x))) -#else -# define __swahw32(x) __fswahw32(x) -# define __swahb32(x) __fswahb32(x) -#endif /* OPTIMIZE */ - - -__inline static__ __const__ __u32 __fswahw32(__u32 x) -{ - return __arch__swahw32(x); -} -__inline static__ __u32 __swahw32p(__u32 *x) -{ - return __arch__swahw32p(x); -} -__inline static__ void __swahw32s(__u32 *addr) -{ - __arch__swahw32s(addr); -} - - -__inline static__ __const__ __u32 __fswahb32(__u32 x) -{ - return __arch__swahb32(x); -} -__inline static__ __u32 __swahb32p(__u32 *x) -{ - return __arch__swahb32p(x); -} -__inline static__ void __swahb32s(__u32 *addr) -{ - __arch__swahb32s(addr); -} - -#ifdef __BYTEORDER_HAS_U64__ - /* - * Not supported yet - */ -#endif /* __BYTEORDER_HAS_U64__ */ - -#if defined(PLATFORM_LINUX) - #define swahw32 __swahw32 - #define swahb32 __swahb32 - #define swahw32p __swahw32p - #define swahb32p __swahb32p - #define swahw32s __swahw32s - #define swahb32s __swahb32s -#endif - -#endif /* _LINUX_BYTEORDER_SWABB_H */ diff --git a/include/drv_types.h b/include/drv_types.h index 13a4ac4..3ee4d25 100644 --- a/include/drv_types.h +++ b/include/drv_types.h @@ -25,7 +25,6 @@ #include #include #include -#include #include #include #include diff --git a/include/ieee80211_ext.h b/include/ieee80211_ext.h index 4965863..ff5cf56 100644 --- a/include/ieee80211_ext.h +++ b/include/ieee80211_ext.h @@ -1,312 +1,310 @@ -/****************************************************************************** - * - * Copyright(c) 2007 - 2017 Realtek Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - *****************************************************************************/ -#ifndef __IEEE80211_EXT_H -#define __IEEE80211_EXT_H - -#include -#include -#include - -#define WMM_OUI_TYPE 2 -#define WMM_OUI_SUBTYPE_INFORMATION_ELEMENT 0 -#define WMM_OUI_SUBTYPE_PARAMETER_ELEMENT 1 -#define WMM_OUI_SUBTYPE_TSPEC_ELEMENT 2 -#define WMM_VERSION 1 - -#define WPA_PROTO_WPA BIT(0) -#define WPA_PROTO_RSN BIT(1) - -#define WPA_KEY_MGMT_IEEE8021X BIT(0) -#define WPA_KEY_MGMT_PSK BIT(1) -#define WPA_KEY_MGMT_NONE BIT(2) -#define WPA_KEY_MGMT_IEEE8021X_NO_WPA BIT(3) -#define WPA_KEY_MGMT_WPA_NONE BIT(4) - - -#define WPA_CAPABILITY_PREAUTH BIT(0) -#define WPA_CAPABILITY_MGMT_FRAME_PROTECTION BIT(6) -#define WPA_CAPABILITY_PEERKEY_ENABLED BIT(9) - - -#define PMKID_LEN 16 - - -#ifdef PLATFORM_LINUX -struct wpa_ie_hdr { - u8 elem_id; - u8 len; - u8 oui[4]; /* 24-bit OUI followed by 8-bit OUI type */ - u8 version[2]; /* little endian */ -} __attribute__((packed)); - -struct rsn_ie_hdr { - u8 elem_id; /* WLAN_EID_RSN */ - u8 len; - u8 version[2]; /* little endian */ -} __attribute__((packed)); - -struct wme_ac_parameter { -#if defined(CONFIG_LITTLE_ENDIAN) - /* byte 1 */ - u8 aifsn:4, - acm:1, - aci:2, - reserved:1; - - /* byte 2 */ - u8 eCWmin:4, - eCWmax:4; -#elif defined(CONFIG_BIG_ENDIAN) - /* byte 1 */ - u8 reserved:1, - aci:2, - acm:1, - aifsn:4; - - /* byte 2 */ - u8 eCWmax:4, - eCWmin:4; -#else -#error "Please fix " -#endif - - /* bytes 3 & 4 */ - u16 txopLimit; -} __attribute__((packed)); - -struct wme_parameter_element { - /* required fields for WME version 1 */ - u8 oui[3]; - u8 oui_type; - u8 oui_subtype; - u8 version; - u8 acInfo; - u8 reserved; - struct wme_ac_parameter ac[4]; - -} __attribute__((packed)); - -#endif - -#define WPA_PUT_LE16(a, val) \ - do { \ - (a)[1] = ((u16) (val)) >> 8; \ - (a)[0] = ((u16) (val)) & 0xff; \ - } while (0) - -#define WPA_PUT_BE32(a, val) \ - do { \ - (a)[0] = (u8) ((((u32) (val)) >> 24) & 0xff); \ - (a)[1] = (u8) ((((u32) (val)) >> 16) & 0xff); \ - (a)[2] = (u8) ((((u32) (val)) >> 8) & 0xff); \ - (a)[3] = (u8) (((u32) (val)) & 0xff); \ - } while (0) - -#define WPA_PUT_LE32(a, val) \ - do { \ - (a)[3] = (u8) ((((u32) (val)) >> 24) & 0xff); \ - (a)[2] = (u8) ((((u32) (val)) >> 16) & 0xff); \ - (a)[1] = (u8) ((((u32) (val)) >> 8) & 0xff); \ - (a)[0] = (u8) (((u32) (val)) & 0xff); \ - } while (0) - -#define RSN_SELECTOR_PUT(a, val) WPA_PUT_BE32((u8 *) (a), (val)) -/* #define RSN_SELECTOR_PUT(a, val) WPA_PUT_LE32((u8 *) (a), (val)) */ - - - -/* Action category code */ -enum ieee80211_category { - WLAN_CATEGORY_SPECTRUM_MGMT = 0, - WLAN_CATEGORY_QOS = 1, - WLAN_CATEGORY_DLS = 2, - WLAN_CATEGORY_BACK = 3, - WLAN_CATEGORY_HT = 7, - WLAN_CATEGORY_WMM = 17, -}; - -/* SPECTRUM_MGMT action code */ -enum ieee80211_spectrum_mgmt_actioncode { - WLAN_ACTION_SPCT_MSR_REQ = 0, - WLAN_ACTION_SPCT_MSR_RPRT = 1, - WLAN_ACTION_SPCT_TPC_REQ = 2, - WLAN_ACTION_SPCT_TPC_RPRT = 3, - WLAN_ACTION_SPCT_CHL_SWITCH = 4, - WLAN_ACTION_SPCT_EXT_CHL_SWITCH = 5, -}; - -/* BACK action code */ -enum ieee80211_back_actioncode { - WLAN_ACTION_ADDBA_REQ = 0, - WLAN_ACTION_ADDBA_RESP = 1, - WLAN_ACTION_DELBA = 2, -}; - -/* HT features action code */ -enum ieee80211_ht_actioncode { - WLAN_ACTION_NOTIFY_CH_WIDTH = 0, - WLAN_ACTION_SM_PS = 1, - WLAN_ACTION_PSPM = 2, - WLAN_ACTION_PCO_PHASE = 3, - WLAN_ACTION_MIMO_CSI_MX = 4, - WLAN_ACTION_MIMO_NONCP_BF = 5, - WLAN_ACTION_MIMP_CP_BF = 6, - WLAN_ACTION_ASEL_INDICATES_FB = 7, - WLAN_ACTION_HI_INFO_EXCHG = 8, -}; - -/* BACK (block-ack) parties */ -enum ieee80211_back_parties { - WLAN_BACK_RECIPIENT = 0, - WLAN_BACK_INITIATOR = 1, - WLAN_BACK_TIMER = 2, -}; - -#ifdef PLATFORM_LINUX - -struct ieee80211_mgmt { - u16 frame_control; - u16 duration; - u8 da[6]; - u8 sa[6]; - u8 bssid[6]; - u16 seq_ctrl; - union { - struct { - u16 auth_alg; - u16 auth_transaction; - u16 status_code; - /* possibly followed by Challenge text */ - u8 variable[0]; - } __attribute__((packed)) auth; - struct { - u16 reason_code; - } __attribute__((packed)) deauth; - struct { - u16 capab_info; - u16 listen_interval; - /* followed by SSID and Supported rates */ - u8 variable[0]; - } __attribute__((packed)) assoc_req; - struct { - u16 capab_info; - u16 status_code; - u16 aid; - /* followed by Supported rates */ - u8 variable[0]; - } __attribute__((packed)) assoc_resp, reassoc_resp; - struct { - u16 capab_info; - u16 listen_interval; - u8 current_ap[6]; - /* followed by SSID and Supported rates */ - u8 variable[0]; - } __attribute__((packed)) reassoc_req; - struct { - u16 reason_code; - } __attribute__((packed)) disassoc; - struct { - __le64 timestamp; - u16 beacon_int; - u16 capab_info; - /* followed by some of SSID, Supported rates, - * FH Params, DS Params, CF Params, IBSS Params, TIM */ - u8 variable[0]; - } __attribute__((packed)) beacon; - struct { - /* only variable items: SSID, Supported rates */ - u8 variable[0]; - } __attribute__((packed)) probe_req; - struct { - __le64 timestamp; - u16 beacon_int; - u16 capab_info; - /* followed by some of SSID, Supported rates, - * FH Params, DS Params, CF Params, IBSS Params */ - u8 variable[0]; - } __attribute__((packed)) probe_resp; - struct { - u8 category; - union { - struct { - u8 action_code; - u8 dialog_token; - u8 status_code; - u8 variable[0]; - } __attribute__((packed)) wme_action; -#if 0 - struct { - u8 action_code; - u8 element_id; - u8 length; - struct ieee80211_channel_sw_ie sw_elem; - } __attribute__((packed)) chan_switch; - struct { - u8 action_code; - u8 dialog_token; - u8 element_id; - u8 length; - struct ieee80211_msrment_ie msr_elem; - } __attribute__((packed)) measurement; -#endif - struct { - u8 action_code; - u8 dialog_token; - u16 capab; - u16 timeout; - u16 start_seq_num; - } __attribute__((packed)) addba_req; - struct { - u8 action_code; - u8 dialog_token; - u16 status; - u16 capab; - u16 timeout; - } __attribute__((packed)) addba_resp; - struct { - u8 action_code; - u16 params; - u16 reason_code; - } __attribute__((packed)) delba; - struct { - u8 action_code; - /* capab_info for open and confirm, - * reason for close - */ - u16 aux; - /* Followed in plink_confirm by status - * code, AID and supported rates, - * and directly by supported rates in - * plink_open and plink_close - */ - u8 variable[0]; - } __attribute__((packed)) plink_action; - struct { - u8 action_code; - u8 variable[0]; - } __attribute__((packed)) mesh_action; - } __attribute__((packed)) u; - } __attribute__((packed)) action; - } __attribute__((packed)) u; -} __attribute__((packed)); - -#endif - -/* mgmt header + 1 byte category code */ -#define IEEE80211_MIN_ACTION_SIZE FIELD_OFFSET(struct ieee80211_mgmt, u.action.u) - - - -#endif +/****************************************************************************** + * + * Copyright(c) 2007 - 2017 Realtek Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + *****************************************************************************/ +#ifndef __IEEE80211_EXT_H +#define __IEEE80211_EXT_H + +#include +#include +#include + +#define WMM_OUI_TYPE 2 +#define WMM_OUI_SUBTYPE_INFORMATION_ELEMENT 0 +#define WMM_OUI_SUBTYPE_PARAMETER_ELEMENT 1 +#define WMM_OUI_SUBTYPE_TSPEC_ELEMENT 2 +#define WMM_VERSION 1 + +#define WPA_PROTO_WPA BIT(0) +#define WPA_PROTO_RSN BIT(1) + +#define WPA_KEY_MGMT_IEEE8021X BIT(0) +#define WPA_KEY_MGMT_PSK BIT(1) +#define WPA_KEY_MGMT_NONE BIT(2) +#define WPA_KEY_MGMT_IEEE8021X_NO_WPA BIT(3) +#define WPA_KEY_MGMT_WPA_NONE BIT(4) + + +#define WPA_CAPABILITY_PREAUTH BIT(0) +#define WPA_CAPABILITY_MGMT_FRAME_PROTECTION BIT(6) +#define WPA_CAPABILITY_PEERKEY_ENABLED BIT(9) + + +#define PMKID_LEN 16 + + +#ifdef PLATFORM_LINUX +struct wpa_ie_hdr { + u8 elem_id; + u8 len; + u8 oui[4]; /* 24-bit OUI followed by 8-bit OUI type */ + u8 version[2]; /* little endian */ +} __attribute__((packed)); + +struct rsn_ie_hdr { + u8 elem_id; /* WLAN_EID_RSN */ + u8 len; + u8 version[2]; /* little endian */ +} __attribute__((packed)); + +struct wme_ac_parameter { +#ifdef __LITTLE_ENDIAN + /* byte 1 */ + u8 aifsn:4, + acm:1, + aci:2, + reserved:1; + + /* byte 2 */ + u8 eCWmin:4, + eCWmax:4; +#else + /* byte 1 */ + u8 reserved:1, + aci:2, + acm:1, + aifsn:4; + + /* byte 2 */ + u8 eCWmax:4, + eCWmin:4; +#endif + + /* bytes 3 & 4 */ + u16 txopLimit; +} __attribute__((packed)); + +struct wme_parameter_element { + /* required fields for WME version 1 */ + u8 oui[3]; + u8 oui_type; + u8 oui_subtype; + u8 version; + u8 acInfo; + u8 reserved; + struct wme_ac_parameter ac[4]; + +} __attribute__((packed)); + +#endif + +#define WPA_PUT_LE16(a, val) \ + do { \ + (a)[1] = ((u16) (val)) >> 8; \ + (a)[0] = ((u16) (val)) & 0xff; \ + } while (0) + +#define WPA_PUT_BE32(a, val) \ + do { \ + (a)[0] = (u8) ((((u32) (val)) >> 24) & 0xff); \ + (a)[1] = (u8) ((((u32) (val)) >> 16) & 0xff); \ + (a)[2] = (u8) ((((u32) (val)) >> 8) & 0xff); \ + (a)[3] = (u8) (((u32) (val)) & 0xff); \ + } while (0) + +#define WPA_PUT_LE32(a, val) \ + do { \ + (a)[3] = (u8) ((((u32) (val)) >> 24) & 0xff); \ + (a)[2] = (u8) ((((u32) (val)) >> 16) & 0xff); \ + (a)[1] = (u8) ((((u32) (val)) >> 8) & 0xff); \ + (a)[0] = (u8) (((u32) (val)) & 0xff); \ + } while (0) + +#define RSN_SELECTOR_PUT(a, val) WPA_PUT_BE32((u8 *) (a), (val)) +/* #define RSN_SELECTOR_PUT(a, val) WPA_PUT_LE32((u8 *) (a), (val)) */ + + + +/* Action category code */ +enum ieee80211_category { + WLAN_CATEGORY_SPECTRUM_MGMT = 0, + WLAN_CATEGORY_QOS = 1, + WLAN_CATEGORY_DLS = 2, + WLAN_CATEGORY_BACK = 3, + WLAN_CATEGORY_HT = 7, + WLAN_CATEGORY_WMM = 17, +}; + +/* SPECTRUM_MGMT action code */ +enum ieee80211_spectrum_mgmt_actioncode { + WLAN_ACTION_SPCT_MSR_REQ = 0, + WLAN_ACTION_SPCT_MSR_RPRT = 1, + WLAN_ACTION_SPCT_TPC_REQ = 2, + WLAN_ACTION_SPCT_TPC_RPRT = 3, + WLAN_ACTION_SPCT_CHL_SWITCH = 4, + WLAN_ACTION_SPCT_EXT_CHL_SWITCH = 5, +}; + +/* BACK action code */ +enum ieee80211_back_actioncode { + WLAN_ACTION_ADDBA_REQ = 0, + WLAN_ACTION_ADDBA_RESP = 1, + WLAN_ACTION_DELBA = 2, +}; + +/* HT features action code */ +enum ieee80211_ht_actioncode { + WLAN_ACTION_NOTIFY_CH_WIDTH = 0, + WLAN_ACTION_SM_PS = 1, + WLAN_ACTION_PSPM = 2, + WLAN_ACTION_PCO_PHASE = 3, + WLAN_ACTION_MIMO_CSI_MX = 4, + WLAN_ACTION_MIMO_NONCP_BF = 5, + WLAN_ACTION_MIMP_CP_BF = 6, + WLAN_ACTION_ASEL_INDICATES_FB = 7, + WLAN_ACTION_HI_INFO_EXCHG = 8, +}; + +/* BACK (block-ack) parties */ +enum ieee80211_back_parties { + WLAN_BACK_RECIPIENT = 0, + WLAN_BACK_INITIATOR = 1, + WLAN_BACK_TIMER = 2, +}; + +#ifdef PLATFORM_LINUX + +struct ieee80211_mgmt { + u16 frame_control; + u16 duration; + u8 da[6]; + u8 sa[6]; + u8 bssid[6]; + u16 seq_ctrl; + union { + struct { + u16 auth_alg; + u16 auth_transaction; + u16 status_code; + /* possibly followed by Challenge text */ + u8 variable[0]; + } __attribute__((packed)) auth; + struct { + u16 reason_code; + } __attribute__((packed)) deauth; + struct { + u16 capab_info; + u16 listen_interval; + /* followed by SSID and Supported rates */ + u8 variable[0]; + } __attribute__((packed)) assoc_req; + struct { + u16 capab_info; + u16 status_code; + u16 aid; + /* followed by Supported rates */ + u8 variable[0]; + } __attribute__((packed)) assoc_resp, reassoc_resp; + struct { + u16 capab_info; + u16 listen_interval; + u8 current_ap[6]; + /* followed by SSID and Supported rates */ + u8 variable[0]; + } __attribute__((packed)) reassoc_req; + struct { + u16 reason_code; + } __attribute__((packed)) disassoc; + struct { + __le64 timestamp; + u16 beacon_int; + u16 capab_info; + /* followed by some of SSID, Supported rates, + * FH Params, DS Params, CF Params, IBSS Params, TIM */ + u8 variable[0]; + } __attribute__((packed)) beacon; + struct { + /* only variable items: SSID, Supported rates */ + u8 variable[0]; + } __attribute__((packed)) probe_req; + struct { + __le64 timestamp; + u16 beacon_int; + u16 capab_info; + /* followed by some of SSID, Supported rates, + * FH Params, DS Params, CF Params, IBSS Params */ + u8 variable[0]; + } __attribute__((packed)) probe_resp; + struct { + u8 category; + union { + struct { + u8 action_code; + u8 dialog_token; + u8 status_code; + u8 variable[0]; + } __attribute__((packed)) wme_action; +#if 0 + struct { + u8 action_code; + u8 element_id; + u8 length; + struct ieee80211_channel_sw_ie sw_elem; + } __attribute__((packed)) chan_switch; + struct { + u8 action_code; + u8 dialog_token; + u8 element_id; + u8 length; + struct ieee80211_msrment_ie msr_elem; + } __attribute__((packed)) measurement; +#endif + struct { + u8 action_code; + u8 dialog_token; + u16 capab; + u16 timeout; + u16 start_seq_num; + } __attribute__((packed)) addba_req; + struct { + u8 action_code; + u8 dialog_token; + u16 status; + u16 capab; + u16 timeout; + } __attribute__((packed)) addba_resp; + struct { + u8 action_code; + u16 params; + u16 reason_code; + } __attribute__((packed)) delba; + struct { + u8 action_code; + /* capab_info for open and confirm, + * reason for close + */ + u16 aux; + /* Followed in plink_confirm by status + * code, AID and supported rates, + * and directly by supported rates in + * plink_open and plink_close + */ + u8 variable[0]; + } __attribute__((packed)) plink_action; + struct { + u8 action_code; + u8 variable[0]; + } __attribute__((packed)) mesh_action; + } __attribute__((packed)) u; + } __attribute__((packed)) action; + } __attribute__((packed)) u; +} __attribute__((packed)); + +#endif + +/* mgmt header + 1 byte category code */ +#define IEEE80211_MIN_ACTION_SIZE FIELD_OFFSET(struct ieee80211_mgmt, u.action.u) + + + +#endif diff --git a/include/osdep_service.h b/include/osdep_service.h index 13929b0..d031222 100644 --- a/include/osdep_service.h +++ b/include/osdep_service.h @@ -64,8 +64,6 @@ #include #endif -/* #include */ - #ifndef BIT #define BIT(x) (1 << (x)) #endif diff --git a/include/rtw_byteorder.h b/include/rtw_byteorder.h deleted file mode 100644 index 8e6bb7a..0000000 --- a/include/rtw_byteorder.h +++ /dev/null @@ -1,33 +0,0 @@ -/****************************************************************************** - * - * Copyright(c) 2007 - 2017 Realtek Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - *****************************************************************************/ -#ifndef _RTL871X_BYTEORDER_H_ -#define _RTL871X_BYTEORDER_H_ - - -#if defined(CONFIG_LITTLE_ENDIAN) && defined (CONFIG_BIG_ENDIAN) - #error "Shall be CONFIG_LITTLE_ENDIAN or CONFIG_BIG_ENDIAN, but not both!\n" -#endif - -#if defined(CONFIG_LITTLE_ENDIAN) - #ifndef CONFIG_PLATFORM_MSTAR389 - #include - #endif -#elif defined (CONFIG_BIG_ENDIAN) - #include -#else - # error "Must be LITTLE/BIG Endian Host" -#endif - -#endif /* _RTL871X_BYTEORDER_H_ */ diff --git a/include/rtw_io.h b/include/rtw_io.h index 50291e1..a168151 100644 --- a/include/rtw_io.h +++ b/include/rtw_io.h @@ -149,7 +149,7 @@ struct intf_hdl { struct reg_protocol_rd { -#ifdef CONFIG_LITTLE_ENDIAN +#ifdef __LITTLE_ENDIAN /* DW1 */ u32 NumOfTrans:4; @@ -207,7 +207,7 @@ struct reg_protocol_rd { struct reg_protocol_wt { -#ifdef CONFIG_LITTLE_ENDIAN +#ifdef __LITTLE_ENDIAN /* DW1 */ u32 NumOfTrans:4; diff --git a/include/rtw_mlme_ext.h b/include/rtw_mlme_ext.h index f1d0860..cca83e3 100644 --- a/include/rtw_mlme_ext.h +++ b/include/rtw_mlme_ext.h @@ -1215,21 +1215,17 @@ struct cmd_hdl wlancmds[] = { struct C2HEvent_Header { -#ifdef CONFIG_LITTLE_ENDIAN +#ifdef __LITTLE_ENDIAN unsigned int len:16; unsigned int ID:8; unsigned int seq:8; -#elif defined(CONFIG_BIG_ENDIAN) - - unsigned int seq:8; - unsigned int ID:8; - unsigned int len:16; - #else -# error "Must be LITTLE or BIG Endian" + unsigned int seq:8; + unsigned int ID:8; + unsigned int len:16; #endif diff --git a/include/rtw_security.h b/include/rtw_security.h index 6072d7a..0aac993 100644 --- a/include/rtw_security.h +++ b/include/rtw_security.h @@ -73,8 +73,8 @@ typedef enum { union pn48 { u64 val; - -#ifdef CONFIG_LITTLE_ENDIAN + +#ifdef __LITTLE_ENDIAN struct { u8 TSC0; @@ -87,7 +87,7 @@ struct { u8 TSC7; } _byte_; -#elif defined(CONFIG_BIG_ENDIAN) +#else struct { u8 TSC7; diff --git a/os_dep/linux/ioctl_linux.c b/os_dep/linux/ioctl_linux.c index 66f30b3..9c85b23 100644 --- a/os_dep/linux/ioctl_linux.c +++ b/os_dep/linux/ioctl_linux.c @@ -11670,10 +11670,10 @@ static void printdata(u8 *pbuf, u32 len) } if (i < len) { -#ifdef CONFIG_BIG_ENDIAN +#ifdef __BIG_ENDIAN for (; i < len, i++) printk("%02X", pbuf + i); -#else /* CONFIG_LITTLE_ENDIAN */ +#else /* __LITTLE_ENDIAN */ #if 0 val = 0; _rtw_memcpy(&val, pbuf + i, len - i); @@ -11688,7 +11688,7 @@ static void printdata(u8 *pbuf, u32 len) n = (4 - n) * 2; printk("%8s", str + n); #endif -#endif /* CONFIG_LITTLE_ENDIAN */ +#endif /* __BIG_ENDIAN */ } printk("\n"); }