project:build.sh:optimize the method of determining whether the Ubuntu image is local
sysdrv:Makefile:modify the method of compiling WiFi/BT drivers
sysdrv:drv_ko:wifi:aic8800dc:optimize Bluetooth transmission
sysdrv:tools:board:buildroot:resolve the issue where the USB cannot automatically obtain an IP address
sysdrv:tools:board:luckfox_config:add an optional setting for UART3M1 on the Luckfox Pico Mini
sysdrv:source:kernel:arch:arm👢dts:eliminate display noise on the LF40-72720-ARK
sysdrv:source:uboot:rkbin:bin:rv11:resolve the issue of certain SD card models not being recognized
Refactor:sysdrv:Makefile:obtain WiFi/BT drivers from source compilation on the Ubuntu system
Perf:sysdrv:drv_ko:wifi:aic8800dc:expand WiFi/Bluetooth rfkill management methods, increase Bluetooth communication baud rate, and reduce communication lag
Fix:sysdrv:tools:board:buildroot:resolve the issue where the `rkipc` program overwrites the IP address of USB0 when the camera is activated on the Luckfox Pico Ultra
Fix:source:uboot:rkbin:bin:rv11:resolve the issue where, in the presence of an image on SPI NAND, romboot prioritizes using `.bin` from SPI NAND, causing the SD card to be unrecognized
Signed-off-by: luckfox-eng29 <eng29@luckfox.com>
This commit is contained in:
parent
6a7f87806f
commit
c27bded97e
Binary file not shown.
|
|
@ -2280,7 +2280,7 @@ if [[ "$LF_TARGET_ROOTFS" = "ubuntu" ]]; then
|
|||
fi
|
||||
fi
|
||||
|
||||
if [ -d "$UBUNTU_DIR" ] && [ -f ${UBUNTU_DIR}/luckfox-ubuntu-22.04.3.tar.gz ]; then
|
||||
if [ -d "$UBUNTU_DIR" ] && [ -f ${UBUNTU_DIR}/luckfox-ubuntu-22.04.3.tar.gz.md5 ]; then
|
||||
msg_info "${UBUNTU_DIR} is not empty, skipping submodule update!"
|
||||
else
|
||||
msg_info "${UBUNTU_DIR} is empty or does not exist, updateing submodule!"
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ ifneq ($(findstring $(TARGET_ROOTFS),custom),)
|
|||
else ifneq ($(findstring $(TARGET_ROOTFS),alpine),)
|
||||
ROOTFS_BUILD_ENV := alpine
|
||||
else ifneq ($(findstring $(TARGET_ROOTFS),ubuntu),)
|
||||
ROOTFS_BUILD_ENV := ubuntu
|
||||
ROOTFS_BUILD_ENV := ubuntu drv
|
||||
else ifneq ($(findstring $(TARGET_ROOTFS),buildroot),)
|
||||
ROOTFS_BUILD_ENV := rootfs_prepare pctools buildroot boardtools drv
|
||||
else
|
||||
|
|
@ -527,7 +527,7 @@ else
|
|||
|
||||
cp -af $(BUSYBOX_DIR)/$(BUSYBOX_VER)/_install/* $(SYSDRV_DIR_OUT_ROOTFS)
|
||||
# luckfox
|
||||
cp $(SYSDRV_DIR)/tools/board/android-tools/S90usb0config $(SYSDRV_DIR_OUT_ROOTFS)/etc/init.d
|
||||
cp $(SYSDRV_DIR)/tools/board/android-tools/S99usb0config $(SYSDRV_DIR_OUT_ROOTFS)/etc/init.d
|
||||
touch $(SYSDRV_DIR_OUT_ROOTFS)/userdata/.busybox
|
||||
|
||||
endif
|
||||
|
|
@ -609,7 +609,7 @@ else
|
|||
cp $(SYSDRV_DIR)/tools/board/luckfox_config/S99luckfoxconfigload $(SYSDRV_DIR_OUT_ROOTFS)/etc/init.d/
|
||||
cp $(SYSDRV_DIR)/tools/board/luckfox_config/luckfox-config $(SYSDRV_DIR_OUT_ROOTFS)/usr/bin/
|
||||
cp $(SYSDRV_DIR)/tools/board/luckfox_config/luckfox_switch_rgb_resolution $(SYSDRV_DIR_OUT_ROOTFS)/usr/bin/
|
||||
cp $(SYSDRV_DIR)/tools/board/android-tools/S90usb0config $(SYSDRV_DIR_OUT_ROOTFS)/etc/init.d/
|
||||
cp $(SYSDRV_DIR)/tools/board/android-tools/S99usb0config $(SYSDRV_DIR_OUT_ROOTFS)/etc/init.d/
|
||||
endif
|
||||
|
||||
buildroot_clean:
|
||||
|
|
@ -642,7 +642,6 @@ ifeq ($(ENABLE_EMMC),YES)
|
|||
cp $(SYSDRV_DIR)/tools/board/emmc/emmc_filesystem_resize.sh $(SYSDRV_DIR_OUT_ROOTFS)/usr/bin/filesystem_resize.sh
|
||||
cp $(SYSDRV_DIR)/tools/board/emmc/emmc_rc.local $(SYSDRV_DIR_OUT_ROOTFS)/etc/rc.local
|
||||
cp $(SYSDRV_DIR)/tools/board/emmc/emmc_wifi_bt_init.sh $(SYSDRV_DIR_OUT_ROOTFS)/usr/bin/wifi_bt_init.sh
|
||||
cp $(SYSDRV_DIR)/tools/board/emmc/emmc_wifi_ko $(SYSDRV_DIR_OUT_ROOTFS)/usr/ko -r
|
||||
cp $(SYSDRV_DIR)/tools/board/emmc/udhcp/usr/bin/udhcpc $(SYSDRV_DIR_OUT_ROOTFS)/usr/bin/udhcpc
|
||||
cp $(SYSDRV_DIR)/tools/board/emmc/udhcp/usr/bin/udhcpd $(SYSDRV_DIR_OUT_ROOTFS)/usr/bin/udhcpd
|
||||
mkdir -p $(SYSDRV_DIR_OUT_ROOTFS)/usr/share/udhcpc
|
||||
|
|
|
|||
|
|
@ -8,7 +8,8 @@ config AIC_FW_PATH
|
|||
depends on AIC_WLAN_SUPPORT
|
||||
string "Firmware & config file path"
|
||||
#default "/vendor/etc/firmware"
|
||||
default "/lib/firmware/aic8800_sdio"
|
||||
#default "/lib/firmware/aic8800_sdio"
|
||||
default "/oem/usr/ko/aic8800dc_fw"
|
||||
help
|
||||
Path to the firmware & config file.
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,7 @@
|
|||
EXTRA_CFLAGS += -Wno-unused-function
|
||||
|
||||
CONFIG_SDIO_SUPPORT := y
|
||||
CONFIG_SDIO_PWRCTRL := y
|
||||
# CONFIG_AIC_FW_PATH = "/vendor/etc/firmware"
|
||||
# CONFIG_AIC_FW_PATH = "/lib/firmware/aic8800dc_fw"
|
||||
CONFIG_AIC_FW_PATH = "/oem/usr/ko/aic8800dc_fw"
|
||||
#CONFIG_AIC_FW_PATH = "/lib/firmware/aic8800"
|
||||
export CONFIG_AIC_FW_PATH
|
||||
ccflags-y += -DCONFIG_AIC_FW_PATH=\"$(CONFIG_AIC_FW_PATH)\"
|
||||
|
||||
|
|
@ -14,23 +11,32 @@ ccflags-y += -DAICWF_SDIO_SUPPORT
|
|||
ccflags-$(CONFIG_SDIO_PWRCTRL) += -DCONFIG_SDIO_PWRCTRL
|
||||
endif
|
||||
|
||||
CONFIG_GPIO_WAKEUP = n
|
||||
CONFIG_GPIO_WAKEUP ?= n
|
||||
CONFIG_M2D_OTA_AUTO_SUPPORT = n
|
||||
CONFIG_M2D_OTA_LZMA_SUPPORT = n
|
||||
CONFIG_LINK_DET_5G = y
|
||||
CONFIG_MCU_MESSAGE = n
|
||||
CONFIG_FIRMWARE_ARRAY = n
|
||||
# Need to set fw path in BOARD_KERNEL_CMDLINE
|
||||
CONFIG_USE_FW_REQUEST = n
|
||||
CONFIG_USE_FW_REQUEST ?= n
|
||||
CONFIG_FDRV_NO_REG_SDIO = n
|
||||
CONFIG_VRF_DCDC_MODE = y
|
||||
CONFIG_OOB = n
|
||||
CONFIG_OOB ?= n
|
||||
CONFIG_PREALLOC_TXQ = y
|
||||
CONFIG_ONE_TXQ = n
|
||||
CONFIG_DPD = y
|
||||
CONFIG_FORCE_DPD_CALIB = y
|
||||
CONFIG_RESV_MEM_SUPPORT = y
|
||||
CONFIG_AMSDU_RX ?=n
|
||||
CONFIG_LOFT_CALIB = n
|
||||
CONFIG_EXT_FEM_8800DCDW = n
|
||||
CONFIG_RESV_MEM_SUPPORT ?= y
|
||||
CONFIG_AMSDU_RX = n
|
||||
CONFIG_IRQ_FALL ?= n
|
||||
CONFIG_SDIO_BT = n
|
||||
|
||||
ifeq ($(CONFIG_EXT_FEM_8800DCDW), y)
|
||||
CONFIG_DPD = n
|
||||
CONFIG_FORCE_DPD_CALIB = n
|
||||
CONFIG_LOFT_CALIB = y
|
||||
endif
|
||||
|
||||
ccflags-$(CONFIG_GPIO_WAKEUP) += -DCONFIG_GPIO_WAKEUP
|
||||
ccflags-$(CONFIG_M2D_OTA_AUTO_SUPPORT) += -DCONFIG_M2D_OTA_AUTO_SUPPORT
|
||||
|
|
@ -43,11 +49,14 @@ ccflags-$(CONFIG_FDRV_NO_REG_SDIO) += -DCONFIG_FDRV_NO_REG_SDIO
|
|||
ccflags-$(CONFIG_VRF_DCDC_MODE) += -DCONFIG_VRF_DCDC_MODE
|
||||
ccflags-$(CONFIG_OOB) += -DCONFIG_OOB
|
||||
ccflags-$(CONFIG_PREALLOC_TXQ) += -DCONFIG_PREALLOC_TXQ
|
||||
ccflags-$(CONFIG_ONE_TXQ) += -DCONFIG_ONE_TXQ
|
||||
ccflags-$(CONFIG_DPD) += -DCONFIG_DPD
|
||||
ccflags-$(CONFIG_FORCE_DPD_CALIB) += -DCONFIG_FORCE_DPD_CALIB -DCONFIG_DPD
|
||||
ccflags-$(CONFIG_LOFT_CALIB) += -DCONFIG_LOFT_CALIB
|
||||
ccflags-$(CONFIG_EXT_FEM_8800DCDW) += -DCONFIG_EXT_FEM_8800DCDW
|
||||
ccflags-$(CONFIG_RESV_MEM_SUPPORT) += -DCONFIG_RESV_MEM_SUPPORT
|
||||
ccflags-$(CONFIG_AMSDU_RX) += -DCONFIG_AMSDU_RX
|
||||
ccflags-$(CONFIG_IRQ_FALL) += -DCONFIG_IRQ_FALL
|
||||
ccflags-$(CONFIG_SDIO_BT) += -DCONFIG_SDIO_BT
|
||||
|
||||
obj-m := $(MODULE_NAME).o
|
||||
$(MODULE_NAME)-y := \
|
||||
|
|
@ -65,7 +74,7 @@ ifeq ($(CONFIG_FIRMWARE_ARRAY),y)
|
|||
$(MODULE_NAME)-y += aicwf_firmware_array.o
|
||||
endif
|
||||
|
||||
# Platform support list
|
||||
########## Platform support list ##########
|
||||
CONFIG_PLATFORM_ROCKCHIP ?= n
|
||||
CONFIG_PLATFORM_ROCKCHIP2 ?= n
|
||||
CONFIG_PLATFORM_ALLWINNER ?=n
|
||||
|
|
@ -75,26 +84,6 @@ CONFIG_PLATFORM_UBUNTU ?= y
|
|||
|
||||
ifeq ($(CONFIG_PLATFORM_ROCKCHIP), y)
|
||||
ccflags-$(CONFIG_PLATFORM_ROCKCHIP) += -DCONFIG_PLATFORM_ROCKCHIP
|
||||
#KDIR ?= /home/yaya/E/Rockchip/3399/rk3399-android-10/kernel
|
||||
#ARCH ?= arm64
|
||||
#CROSS_COMPILE ?= /home/yaya/E/Rockchip/3399/rk3399-android-10/prebuilts/gcc/linux-x86/aarch64/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
|
||||
#KDIR ?= /home/yaya/E/Rockchip/3288/Android10/kernel/kernel/
|
||||
#ARCH ?= arm
|
||||
#CROSS_COMPILE ?= /home/yaya/E/Rockchip/3288/Android10/tool/gcc-linaro-6.3.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-
|
||||
#KDIR ?= /home/yaya/E/Rockchip/3229/Android7/RK3229_ANDROID7.1_v1.01_20170914/rk3229_Android7.1_v1.01_xml0914/kernel
|
||||
#ARCH ?= arm
|
||||
#CROSS_COMPILE ?= /home/yaya/E/Rockchip/3229/Android7/RK3229_ANDROID7.1_v1.01_20170914/rk3229_Android7.1_v1.01_xml0914/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi-
|
||||
#KDIR ?= /home/yaya/E/Rockchip/3229/Android9/rk3229_android9.0_box/kernel
|
||||
#ARCH ?= arm
|
||||
#CROSS_COMPILE ?= /home/yaya/E/Rockchip/3229/Android9/rk3229_android9.0_box/prebuilts/gcc/linux-x86/arm/gcc-linaro-6.3.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-
|
||||
#KDIR ?= /home/yaya/E/Rockchip/3566/firefly/Android11.0/Firefly-RK356X_Android11.0_git_20210824/RK356X_Android11.0/kernel
|
||||
#KDIR ?= /home/yaya/E/Rockchip/3566/oudu/kernel
|
||||
#KDIR ?= /home/yaya/E/Rockchip/3566/shengteng/kernel
|
||||
#ARCH ?= arm64
|
||||
#CROSS_COMPILE ?= ~/E/Rockchip/3566/Android11/rk3566_rk3568_android11_oranth/prebuilts/gcc/linux-x86/aarch64/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
|
||||
#KDIR ?= /home/yaya/E/Rockchip/3328/Android9/SDK/kernel/
|
||||
#ARCH ?= arm64
|
||||
#CROSS_COMPILE ?= /home/yaya/E/Rockchip/3328/Android9/SDK/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
|
||||
KDIR ?= /home/yaya/E/Rockchip/3566/firefly/Android11.0/Firefly-RK356X_Android11.0_git_20210824/RK356X_Android11.0/kernel
|
||||
ARCH ?= arm64
|
||||
CROSS_COMPILE ?= /home/yaya/E/Rockchip/3566/Android11/rk3566_rk3568_android11_oranth/prebuilts/gcc/linux-x86/aarch64/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
|
||||
|
|
@ -109,9 +98,6 @@ endif
|
|||
|
||||
ifeq ($(CONFIG_PLATFORM_ALLWINNER), y)
|
||||
ccflags-$(CONFIG_PLATFORM_ALLWINNER) += -DCONFIG_PLATFORM_ALLWINNER
|
||||
#KDIR ?= /home/yaya/E/Allwinner/A133/a133-sdk/android/longan/out/kernel/build/
|
||||
#ARCH ?= arm64
|
||||
#CROSS_COMPILE ?= /home/yaya/E/Allwinner/A133/a133-sdk/android/longan/out/gcc-linaro-5.3.1-2016.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
|
||||
KDIR ?= /home/yaya/E/Allwinner/r818/Android10/lichee/kernel/linux-4.9/
|
||||
ARCH ?= arm64
|
||||
CROSS_COMPILE ?= /home/yaya/E/Allwinner/r818/Android10/android/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin/aarch64-linux-android-
|
||||
|
|
@ -140,7 +126,7 @@ MODDESTDIR ?= /lib/modules/$(KVER)/kernel/drivers/net/wireless/
|
|||
ARCH ?= x86_64
|
||||
CROSS_COMPILE ?=
|
||||
endif
|
||||
|
||||
###########################################
|
||||
|
||||
all: modules
|
||||
modules:
|
||||
|
|
|
|||
|
|
@ -47,6 +47,14 @@ u32 adaptivity_patch_tbl_8800d80[][2] = {
|
|||
{0x0168, 0x00010000}, //tx_adaptivity_en
|
||||
};
|
||||
|
||||
#define USER_CHAN_MAX_TXPWR_EN_FLAG (0x01U << 1)
|
||||
#define USER_TX_USE_ANA_F_FLAG (0x01U << 2)
|
||||
|
||||
#define CFG_USER_CHAN_MAX_TXPWR_EN 0
|
||||
#define CFG_USER_TX_USE_ANA_F 0
|
||||
|
||||
#define CFG_USER_EXT_FLAGS_EN (CFG_USER_CHAN_MAX_TXPWR_EN || CFG_USER_TX_USE_ANA_F)
|
||||
|
||||
u32 patch_tbl_8800d80[][2] = {
|
||||
#ifdef USE_5G
|
||||
{0x00b4, 0xf3010001},
|
||||
|
|
@ -56,9 +64,20 @@ u32 patch_tbl_8800d80[][2] = {
|
|||
#if defined(CONFIG_AMSDU_RX)
|
||||
{0x170, 0x0100000a}
|
||||
#endif
|
||||
#if AIC_IRQ_WAKE_FLAG
|
||||
#ifdef CONFIG_IRQ_FALL
|
||||
{0x00000170, 0x0000010a}, //irqf
|
||||
#endif
|
||||
|
||||
#if CFG_USER_EXT_FLAGS_EN
|
||||
{0x0188, 0x00000001
|
||||
#if CFG_USER_CHAN_MAX_TXPWR_EN
|
||||
| USER_CHAN_MAX_TXPWR_EN_FLAG
|
||||
#endif
|
||||
#if CFG_USER_TX_USE_ANA_F
|
||||
| USER_TX_USE_ANA_F_FLAG
|
||||
#endif
|
||||
}, // user_ext_flags
|
||||
#endif
|
||||
};
|
||||
|
||||
#ifdef CONFIG_OOB
|
||||
|
|
@ -90,11 +109,16 @@ int aicwifi_sys_config_8800d80(struct aic_sdio_dev *sdiodev)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#define NEW_PATCH_BUFFER_MAP 1
|
||||
|
||||
int aicwifi_patch_config_8800d80(struct aic_sdio_dev *sdiodev)
|
||||
{
|
||||
const u32 rd_patch_addr = RAM_FMAC_FW_ADDR + 0x0198;
|
||||
u32 aic_patch_addr;
|
||||
u32 config_base, aic_patch_str_base;
|
||||
#if (NEW_PATCH_BUFFER_MAP)
|
||||
u32 patch_buff_addr, patch_buff_base, rd_version_addr, rd_version_val;
|
||||
#endif
|
||||
uint32_t start_addr = 0x0016F800;
|
||||
u32 patch_addr = start_addr;
|
||||
u32 patch_cnt = sizeof(patch_tbl_8800d80)/sizeof(u32)/2;
|
||||
|
|
@ -126,6 +150,27 @@ int aicwifi_patch_config_8800d80(struct aic_sdio_dev *sdiodev)
|
|||
}
|
||||
aic_patch_str_base = rd_patch_addr_cfm.memdata;
|
||||
|
||||
#if (NEW_PATCH_BUFFER_MAP)
|
||||
rd_version_addr = RAM_FMAC_FW_ADDR + 0x01C;
|
||||
if ((ret = rwnx_send_dbg_mem_read_req(sdiodev, rd_version_addr, &rd_patch_addr_cfm))) {
|
||||
printk("version val[0x%x] rd fail: %d\n", rd_version_addr, ret);
|
||||
return ret;
|
||||
}
|
||||
rd_version_val = rd_patch_addr_cfm.memdata;
|
||||
printk("rd_version_val=%08X\n", rd_version_val);
|
||||
sdiodev->fw_version_uint = rd_version_val;
|
||||
if (rd_version_val > 0x06090100) {
|
||||
patch_buff_addr = rd_patch_addr + 12;
|
||||
ret = rwnx_send_dbg_mem_read_req(sdiodev, patch_buff_addr, &rd_patch_addr_cfm);
|
||||
if (ret) {
|
||||
printk("patch buf rd fail\n");
|
||||
return ret;
|
||||
}
|
||||
patch_buff_base = rd_patch_addr_cfm.memdata;
|
||||
patch_addr = start_addr = patch_buff_base;
|
||||
}
|
||||
#endif
|
||||
|
||||
ret = rwnx_send_dbg_mem_write_req(sdiodev, AIC_PATCH_ADDR(magic_num), AIC_PATCH_MAGIG_NUM);
|
||||
if (ret) {
|
||||
printk("0x%x write fail\n", AIC_PATCH_ADDR(magic_num));
|
||||
|
|
|
|||
|
|
@ -25,16 +25,18 @@ u32 syscfg_tbl_8800dc_sdio_u02[][2] = {
|
|||
{0x40030084, 0x0011E800},
|
||||
{0x40030080, 0x00000001},
|
||||
{0x4010001C, 0x00000000},
|
||||
};
|
||||
#ifdef CONFIG_OOB
|
||||
{0x40504044, 0x2},//oob_enable
|
||||
{0x40500060, 0x03020700},
|
||||
{0x40500040, 0},
|
||||
{0x40100030, 1},
|
||||
{0x40241020, 1},
|
||||
{0x402400f0, 0x340022},
|
||||
u32 oobcfg_tbl_8800dc_sdio_u02[][2] = {
|
||||
{0x40504044, 0x2},//oob_enable
|
||||
{0x40500060, 0x03020700},
|
||||
{0x40500040, 0},
|
||||
{0x40100030, 1},
|
||||
{0x40241020, 1},
|
||||
{0x402400f0, 0x340022},
|
||||
};
|
||||
#endif //CONFIG_OOB
|
||||
|
||||
};
|
||||
|
||||
u32 syscfg_tbl_masked_8800dc[][3] = {
|
||||
//#ifdef CONFIG_PMIC_SETTING
|
||||
|
|
@ -1321,7 +1323,7 @@ uint32_t agc_cfg_ram[] = {
|
|||
0x00000000
|
||||
};
|
||||
|
||||
|
||||
#if !defined(CONFIG_EXT_FEM_8800DCDW)
|
||||
uint32_t txgain_map[96] = {
|
||||
#ifdef CONFIG_FPGA_VERIFICATION
|
||||
0x20c0c971,
|
||||
|
|
@ -1459,8 +1461,8 @@ uint32_t txgain_map[96] = {
|
|||
0x00ffc88b,
|
||||
0x00ffc979,
|
||||
0x00ffc989,
|
||||
0x00ffca7d,
|
||||
0x00ffca88,
|
||||
0x00ffcc4b,
|
||||
0x00ffcc54,
|
||||
0x00ffcc5e,
|
||||
0x00ffcc69,
|
||||
0x00ffcc78,
|
||||
|
|
@ -1492,8 +1494,8 @@ uint32_t txgain_map[96] = {
|
|||
0x00ffc88b,
|
||||
0x00ffc979,
|
||||
0x00ffc989,
|
||||
0x00ffca7d,
|
||||
0x00ffca88,
|
||||
0x00ffcc4b,
|
||||
0x00ffcc54,
|
||||
0x00ffcc5e,
|
||||
0x00ffcc69,
|
||||
0x00ffcc78,
|
||||
|
|
@ -1501,9 +1503,9 @@ uint32_t txgain_map[96] = {
|
|||
0x00ffcd70,
|
||||
0x00ffcd80,
|
||||
0x00ffcd90,
|
||||
0x00ffce80,
|
||||
0x00ffce93,
|
||||
0x00ffcf90,
|
||||
0x00ffcf68,
|
||||
0x00ffcf75,
|
||||
0x00ffcf83,
|
||||
0x00ffc080,
|
||||
0x00ffc090,
|
||||
0x00ffc180,
|
||||
|
|
@ -1562,8 +1564,8 @@ const uint32_t txgain_map_h[96] =
|
|||
0xffc879, //8
|
||||
0xffc96b, //9
|
||||
0xffc979, //10
|
||||
0xffca6b, //11
|
||||
0xffca79, //12
|
||||
0xffcc45, //11
|
||||
0xffcc4d, //12
|
||||
0xffcc56, //13
|
||||
0xffcc60, //14
|
||||
0xffcc6b, //15
|
||||
|
|
@ -1595,15 +1597,15 @@ const uint32_t txgain_map_h[96] =
|
|||
0xffc879, //8
|
||||
0xffc96b, //9
|
||||
0xffc979, //10
|
||||
0xffca6b, //11
|
||||
0xffca79, //12
|
||||
0xffcc45, //11
|
||||
0xffcc4d, //12
|
||||
0xffcc56, //13
|
||||
0xffcc60, //14
|
||||
0xffcc6b, //15
|
||||
0xffcc79, //16
|
||||
0xffcd72, //17
|
||||
0xffce60, //18
|
||||
0xffce72, //19
|
||||
0xffcf5b, //18
|
||||
0xffcf66, //19
|
||||
0xffcf72, //20
|
||||
0xffcf80, //21
|
||||
0xffcf90, //22
|
||||
|
|
@ -1626,6 +1628,213 @@ const uint32_t txgain_map_h[96] =
|
|||
0xffc86b, //7
|
||||
};
|
||||
|
||||
#else /* #ifdef CONFIG_EXT_FEM_8800DCDW */
|
||||
const uint32_t txgain_map_femkct[96] =
|
||||
{
|
||||
//11b
|
||||
0x00ffd780,//15
|
||||
0x00ffd872,//16
|
||||
0x00ffd880,//17
|
||||
0x00ffd972,//18
|
||||
0x00ffd980,//19
|
||||
0x00ffda72,//20
|
||||
0x00ffda80,//21
|
||||
0x00ffdb72,//22
|
||||
0x00ffdb80,//23
|
||||
0x00ffdc72,//24
|
||||
0x00ffdc80,//25
|
||||
0x00ffdd72,//26
|
||||
0x00ffdd80,//27
|
||||
0x00ffde72,//28
|
||||
0x00ffde80,//29
|
||||
0x00ffdf72,//30
|
||||
0x00ffd072,//-1
|
||||
0x00ffd072,//0
|
||||
0x00ffd080,//1
|
||||
0x00ffd172,//2
|
||||
0x00ffd180,//3
|
||||
0x00ffd272,//4
|
||||
0x00ffd280,//5
|
||||
0x00ffd36d,//6
|
||||
0x00ffd379,//7
|
||||
0x00ffd46d,//8
|
||||
0x00ffd479,//9
|
||||
0x00ffd572,//10
|
||||
0x00ffd580,//11
|
||||
0x00ffd672,//12
|
||||
0x00ffd680,//13
|
||||
0x00ffd772,//14
|
||||
//high
|
||||
0x00ffc872,//11
|
||||
0x00ffc880,//12
|
||||
0x00ffc972,//13
|
||||
0x00ffc980,//14
|
||||
0x00ffca72,//15
|
||||
0x00ffca80,//16
|
||||
0x00ffcb72,//17
|
||||
0x00ffcb80,//18
|
||||
0x00ffcc72,//19
|
||||
0x00ffcc80,//20
|
||||
0x00ffcd72,//21
|
||||
0x00ffcd80,//22
|
||||
0x00ffce72,//23
|
||||
0x00ffce80,//24
|
||||
0x00ffcf72,//25
|
||||
0x00ffcf80,//26
|
||||
0x00ffc072,//-5
|
||||
0x00ffc080,//-4
|
||||
0x00ffc172,//-3
|
||||
0x00ffc180,//-2
|
||||
0x00ffc272,//-1
|
||||
0x00ffc280,//0
|
||||
0x00ffc372,//1
|
||||
0x00ffc380,//2
|
||||
0x00ffc472,//3
|
||||
0x00ffc480,//4
|
||||
0x00ffc572,//5
|
||||
0x00ffc580,//6
|
||||
0x00ffc672,//7
|
||||
0x00ffc680,//8
|
||||
0x00ffc772,//9
|
||||
0x00ffc780,//10
|
||||
//low
|
||||
0x00ffc872,//11
|
||||
0x00ffc880,//12
|
||||
0x00ffc972,//13
|
||||
0x00ffc980,//14
|
||||
0x00ffca72,//15
|
||||
0x00ffca80,//16
|
||||
0x00ffcb72,//17
|
||||
0x00ffcb80,//18
|
||||
0x00ffcc72,//19
|
||||
0x00ffcc80,//20
|
||||
0x00ffcd72,//21
|
||||
0x00ffcd80,//22
|
||||
0x00ffce72,//23
|
||||
0x00ffce80,//24
|
||||
0x00ffcf72,//26
|
||||
0x00ffcf80,//27
|
||||
0x00ffc072,//-5
|
||||
0x00ffc080,//-4
|
||||
0x00ffc172,//-3
|
||||
0x00ffc180,//-2
|
||||
0x00ffc272,//-1
|
||||
0x00ffc280,//0
|
||||
0x00ffc372,//1
|
||||
0x00ffc380,//2
|
||||
0x00ffc472,//3
|
||||
0x00ffc480,//4
|
||||
0x00ffc572,//5
|
||||
0x00ffc580,//6
|
||||
0x00ffc672,//7
|
||||
0x00ffc680,//8
|
||||
0x00ffc772,//9
|
||||
0x00ffc780,//10
|
||||
};
|
||||
|
||||
const uint32_t txgain_map_femkct_h[96] =
|
||||
{
|
||||
//11b
|
||||
0x00ffd872,//15
|
||||
0x00ffd880,//16
|
||||
0x00ffd972,//17
|
||||
0x00ffd980,//18
|
||||
0x00ffd990,//19
|
||||
0x00ffda72,//20
|
||||
0x00ffda80,//21
|
||||
0x00ffdb72,//22
|
||||
0x00ffdb80,//23
|
||||
0x00ffdc72,//24
|
||||
0x00ffdc80,//25
|
||||
0x00ffdd72,//26
|
||||
0x00ffdd80,//27
|
||||
0x00ffde72,//28
|
||||
0x00ffde80,//29
|
||||
0x00ffdf72,//30
|
||||
0x00ffd072,//-1
|
||||
0x00ffd072,//0
|
||||
0x00ffd080,//1
|
||||
0x00ffd172,//2
|
||||
0x00ffd180,//3
|
||||
0x00ffd272,//4
|
||||
0x00ffd280,//5
|
||||
0x00ffd379,//6
|
||||
0x00ffd46d,//7
|
||||
0x00ffd479,//8
|
||||
0x00ffd572,//9
|
||||
0x00ffd580,//10
|
||||
0x00ffd672,//11
|
||||
0x00ffd680,//12
|
||||
0x00ffd772,//13
|
||||
0x00ffd780,//14
|
||||
//high
|
||||
0x00ffc880,//11
|
||||
0x00ffc972,//12
|
||||
0x00ffc980,//13
|
||||
0x00ffca72,//14
|
||||
0x00ffca80,//15
|
||||
0x00ffcb72,//16
|
||||
0x00ffcb80,//17
|
||||
0x00ffcc72,//18
|
||||
0x00ffcc80,//19
|
||||
0x00ffcc90,//20
|
||||
0x00ffcd72,//21
|
||||
0x00ffcd80,//22
|
||||
0x00ffce72,//23
|
||||
0x00ffce80,//24
|
||||
0x00ffcf72,//25
|
||||
0x00ffcf80,//26
|
||||
0x00ffc080,//-5
|
||||
0x00ffc172,//-4
|
||||
0x00ffc180,//-3
|
||||
0x00ffc272,//-2
|
||||
0x00ffc280,//-1
|
||||
0x00ffc372,//0
|
||||
0x00ffc380,//1
|
||||
0x00ffc472,//2
|
||||
0x00ffc480,//3
|
||||
0x00ffc572,//4
|
||||
0x00ffc580,//5
|
||||
0x00ffc672,//6
|
||||
0x00ffc680,//7
|
||||
0x00ffc772,//8
|
||||
0x00ffc780,//9
|
||||
0x00ffc872,//10
|
||||
//low
|
||||
0x00ffc880,//11
|
||||
0x00ffc972,//12
|
||||
0x00ffc980,//13
|
||||
0x00ffca72,//14
|
||||
0x00ffca80,//15
|
||||
0x00ffcb72,//16
|
||||
0x00ffcb80,//17
|
||||
0x00ffcc72,//18
|
||||
0x00ffcc80,//19
|
||||
0x00ffcc90,//20
|
||||
0x00ffcd72,//21
|
||||
0x00ffcd80,//22
|
||||
0x00ffce72,//23
|
||||
0x00ffce80,//24
|
||||
0x00ffcf72,//25
|
||||
0x00ffcf80,//26
|
||||
0x00ffc080,//-5
|
||||
0x00ffc172,//-4
|
||||
0x00ffc180,//-3
|
||||
0x00ffc272,//-2
|
||||
0x00ffc280,//-1
|
||||
0x00ffc372,//0
|
||||
0x00ffc380,//1
|
||||
0x00ffc472,//2
|
||||
0x00ffc480,//3
|
||||
0x00ffc572,//4
|
||||
0x00ffc580,//5
|
||||
0x00ffc672,//6
|
||||
0x00ffc680,//7
|
||||
0x00ffc772,//8
|
||||
0x00ffc780,//9
|
||||
0x00ffc872,//10
|
||||
};
|
||||
#endif
|
||||
|
||||
u32 jump_tbl[][2] =
|
||||
{
|
||||
|
|
@ -1687,10 +1896,61 @@ u32 patch_tbl_rf_func[][2] =
|
|||
{0x00110bf0, 0x00180001},
|
||||
};
|
||||
|
||||
|
||||
//adap test
|
||||
u32 adaptivity_patch_tbl_8800dc[][2] = {
|
||||
{0x000C, 0x0000320A}, //linkloss_thd
|
||||
{0x009C, 0x00000000}, //ac_param_conf
|
||||
{0x0128, 0xF6140001}, //tx_adaptivity_en
|
||||
};
|
||||
//adap test
|
||||
|
||||
|
||||
static u8 chip_id = 0;
|
||||
#define CHIP_ID_H_MASK 0xC0
|
||||
#define IS_CHIP_ID_H() ((chip_id & CHIP_ID_H_MASK) == CHIP_ID_H_MASK)
|
||||
|
||||
//Crystal provided by CPU (start)
|
||||
int set_bbpll_config(struct aic_sdio_dev *rwnx_hw){
|
||||
// {0x40505010, 0x7C301010},//bbpll
|
||||
int ret = 0;
|
||||
struct dbg_mem_read_cfm rd_mem_addr_cfm;
|
||||
|
||||
//Read crystal provided by CPU or not.
|
||||
ret = rwnx_send_dbg_mem_read_req(rwnx_hw, 0x40500148, &rd_mem_addr_cfm);
|
||||
if (ret) {
|
||||
AICWFDBG(LOGERROR, "%x rd fail: %d\n", 0x40500148, ret);
|
||||
return -1;
|
||||
}
|
||||
|
||||
AICWFDBG(LOGDEBUG, "%s rd_mem_addr_cfm.memdata:%x \r\n", __func__, rd_mem_addr_cfm.memdata);
|
||||
|
||||
if(!(rd_mem_addr_cfm.memdata & 0x01)){
|
||||
AICWFDBG(LOGINFO, "%s Crystal not provided by CPU \r\n", __func__);
|
||||
return 0;
|
||||
}else{
|
||||
AICWFDBG(LOGINFO, "%s Crystal provided by CPU \r\n", __func__);
|
||||
//Read 0x40505010 value to check bbpll set or not.
|
||||
ret = rwnx_send_dbg_mem_read_req(rwnx_hw, 0x40505010, &rd_mem_addr_cfm);
|
||||
if(ret < 0){
|
||||
AICWFDBG(LOGERROR, "%s error ret_val:%d\r\n", __func__, ret);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if((rd_mem_addr_cfm.memdata >> 29) == 3){
|
||||
AICWFDBG(LOGERROR, "%s Not need to set \r\n", __func__);
|
||||
return 0;
|
||||
}else{
|
||||
rd_mem_addr_cfm.memdata |= ((0x1 << 29) | (0x1 << 30));
|
||||
rd_mem_addr_cfm.memdata &= (~(0x1 << 31));
|
||||
rwnx_send_dbg_mem_write_req(rwnx_hw, 0x40505010, rd_mem_addr_cfm.memdata);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
//Crystal provided by CPU (end)
|
||||
|
||||
|
||||
void system_config_8800dc(struct aic_sdio_dev *rwnx_hw)
|
||||
{
|
||||
int syscfg_num;
|
||||
|
|
@ -1698,6 +1958,9 @@ void system_config_8800dc(struct aic_sdio_dev *rwnx_hw)
|
|||
int ret, cnt;
|
||||
const u32 mem_addr = 0x40500000;
|
||||
struct dbg_mem_read_cfm rd_mem_addr_cfm;
|
||||
#ifdef CONFIG_OOB
|
||||
int oobcfg_num;
|
||||
#endif
|
||||
|
||||
ret = rwnx_send_dbg_mem_read_req(rwnx_hw, mem_addr, &rd_mem_addr_cfm);
|
||||
if (ret) {
|
||||
|
|
@ -1719,6 +1982,14 @@ void system_config_8800dc(struct aic_sdio_dev *rwnx_hw)
|
|||
//printk("%x=%x\n", rd_mem_addr_cfm.memaddr, rd_mem_addr_cfm.memdata);
|
||||
AICWFDBG(LOGINFO, "chip_id=%x, chip_sub_id=%x!!\n", chip_id, chip_sub_id);
|
||||
|
||||
//Crystal provided by CPU (start)
|
||||
ret = set_bbpll_config(rwnx_hw);
|
||||
if (ret) {
|
||||
AICWFDBG(LOGERROR, "set_bbpll_config fail: %d\n", ret);
|
||||
return;
|
||||
}
|
||||
//Crystal provided by CPU (end)
|
||||
|
||||
|
||||
ret = rwnx_send_dbg_mem_read_req(rwnx_hw, 0x40500010, &rd_mem_addr_cfm);
|
||||
AICWFDBG(LOGDEBUG, "[0x40500010]=%x\n", rd_mem_addr_cfm.memdata);
|
||||
|
|
@ -1747,7 +2018,7 @@ void system_config_8800dc(struct aic_sdio_dev *rwnx_hw)
|
|||
return;
|
||||
}
|
||||
}
|
||||
} else if (chip_sub_id == 1) {
|
||||
} else if ((chip_sub_id == 1) || (chip_sub_id == 2)) {
|
||||
syscfg_num = sizeof(syscfg_tbl_8800dc_sdio_u02) / sizeof(u32) / 2;
|
||||
for (cnt = 0; cnt < syscfg_num; cnt++) {
|
||||
ret = rwnx_send_dbg_mem_write_req(rwnx_hw, syscfg_tbl_8800dc_sdio_u02[cnt][0], syscfg_tbl_8800dc_sdio_u02[cnt][1]);
|
||||
|
|
@ -1758,7 +2029,18 @@ void system_config_8800dc(struct aic_sdio_dev *rwnx_hw)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef CONFIG_OOB
|
||||
if ((chip_sub_id == 1) || (chip_sub_id == 2)) {
|
||||
oobcfg_num = sizeof(oobcfg_tbl_8800dc_sdio_u02) / sizeof(u32) / 2;
|
||||
for (cnt = 0; cnt < oobcfg_num; cnt++) {
|
||||
ret = rwnx_send_dbg_mem_write_req(rwnx_hw, oobcfg_tbl_8800dc_sdio_u02[cnt][0], oobcfg_tbl_8800dc_sdio_u02[cnt][1]);
|
||||
if (ret) {
|
||||
AICWFDBG(LOGERROR, "%x write fail: %d\n", oobcfg_tbl_8800dc_sdio_u02[cnt][0], ret);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (IS_CHIP_ID_H()) {
|
||||
syscfg_num = sizeof(syscfg_tbl_masked_8800dc_h) / sizeof(u32) / 3;
|
||||
p_syscfg_msk_tbl = syscfg_tbl_masked_8800dc_h;
|
||||
|
|
@ -1800,6 +2082,7 @@ void system_config_8800dc(struct aic_sdio_dev *rwnx_hw)
|
|||
|
||||
}
|
||||
|
||||
extern int adap_test;
|
||||
|
||||
void aicwf_patch_config_8800dc(struct aic_sdio_dev *rwnx_hw)
|
||||
{
|
||||
|
|
@ -1822,6 +2105,11 @@ void aicwf_patch_config_8800dc(struct aic_sdio_dev *rwnx_hw)
|
|||
u32 jump_tbl_size = 0;
|
||||
u32 patch_tbl_func_num = 0;
|
||||
|
||||
//adap test
|
||||
int adap_patch_num = 0;
|
||||
//adap test
|
||||
|
||||
|
||||
array2_tbl_t jump_tbl_base = NULL;
|
||||
array2_tbl_t patch_tbl_func_base = NULL;
|
||||
array2_tbl_t patch_tbl_wifisetting_8800dc_base = NULL;
|
||||
|
|
@ -1879,6 +2167,19 @@ void aicwf_patch_config_8800dc(struct aic_sdio_dev *rwnx_hw)
|
|||
}
|
||||
}
|
||||
|
||||
//adap test
|
||||
if(adap_test){
|
||||
AICWFDBG(LOGINFO, "%s for adaptivity test \r\n", __func__);
|
||||
adap_patch_num = sizeof(adaptivity_patch_tbl_8800dc)/sizeof(u32)/2;
|
||||
for(cnt = 0; cnt < adap_patch_num; cnt++)
|
||||
{
|
||||
if((ret = rwnx_send_dbg_mem_write_req(rwnx_hw, wifisetting_cfg_addr + adaptivity_patch_tbl_8800dc[cnt][0], adaptivity_patch_tbl_8800dc[cnt][1]))) {
|
||||
AICWFDBG(LOGERROR, "%x write fail\n", wifisetting_cfg_addr + adaptivity_patch_tbl_8800dc[cnt][0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
//adap test
|
||||
|
||||
if (ldpc_cfg_size > 512) {// > 0.5KB data
|
||||
for (i = 0; i < (ldpc_cfg_size - 512); i += 512) {//each time write 0.5KB
|
||||
ret = rwnx_send_dbg_mem_block_write_req(rwnx_hw, ldpc_cfg_addr + i, 512, ldpc_cfg_ram + i / 4);
|
||||
|
|
@ -1915,11 +2216,21 @@ void aicwf_patch_config_8800dc(struct aic_sdio_dev *rwnx_hw)
|
|||
|
||||
#if !defined(CONFIG_FPGA_VERIFICATION)
|
||||
if ((IS_CHIP_ID_H())) {
|
||||
#if defined(CONFIG_EXT_FEM_8800DCDW)
|
||||
txgain_cfg_size = sizeof(txgain_map_femkct_h);
|
||||
txgain_cfg_array = (u32 *)txgain_map_femkct_h;
|
||||
#else
|
||||
txgain_cfg_size = sizeof(txgain_map_h);
|
||||
txgain_cfg_array = (u32 *)txgain_map_h;
|
||||
#endif
|
||||
} else {
|
||||
#if defined(CONFIG_EXT_FEM_8800DCDW)
|
||||
txgain_cfg_size = sizeof(txgain_map_femkct);
|
||||
txgain_cfg_array = (u32 *)txgain_map_femkct;
|
||||
#else
|
||||
txgain_cfg_size = sizeof(txgain_map);
|
||||
txgain_cfg_array = (u32 *)txgain_map;
|
||||
#endif
|
||||
}
|
||||
ret = rwnx_send_dbg_mem_block_write_req(rwnx_hw, txgain_cfg_addr, txgain_cfg_size, txgain_cfg_array);
|
||||
if (ret) {
|
||||
|
|
@ -2207,4 +2518,25 @@ int aicwf_dpd_result_write_8800dc(void *buf, int buf_len)
|
|||
#endif /* !CONFIG_FORCE_DPD_CALIB */
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef CONFIG_LOFT_CALIB
|
||||
int aicwf_loft_calib_8800dc(struct aic_sdio_dev *sdiodev)
|
||||
{
|
||||
int ret = 0;
|
||||
uint32_t fw_addr, boot_type;
|
||||
ret = aicwf_plat_calib_load_8800dc(sdiodev);
|
||||
if (ret) {
|
||||
AICWFDBG(LOGINFO, "load calib bin fail: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
/* fw start */
|
||||
fw_addr = 0x00130009;
|
||||
boot_type = HOST_START_APP_FNCALL;
|
||||
AICWFDBG(LOGINFO, "Start app: %08x, %d\n", fw_addr, boot_type);
|
||||
ret = rwnx_send_dbg_start_app_req(sdiodev, fw_addr, boot_type, NULL);
|
||||
if (ret) {
|
||||
AICWFDBG(LOGINFO, "start app fail: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -30,6 +30,9 @@ int aicwf_dpd_result_load_8800dc(struct aic_sdio_dev *sdiodev, rf_misc_ram_lite_
|
|||
int aicwf_dpd_result_write_8800dc(void *buf, int buf_len);
|
||||
#endif/* !CONFIG_FORCE_DPD_CALIB */
|
||||
#endif
|
||||
#ifdef CONFIG_LOFT_CALIB
|
||||
int aicwf_loft_calib_8800dc(struct aic_sdio_dev *sdiodev);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -998,7 +998,7 @@ int aicwf_misc_ram_valid_check_8800dc(struct aic_sdio_dev *sdiodev, int *valid_o
|
|||
*valid_out = 0;
|
||||
}
|
||||
if (testmode == FW_RFTEST_MODE) {
|
||||
|
||||
|
||||
uint32_t vect1 = 0;
|
||||
uint32_t vect2 = 0;
|
||||
cfg_base = RAM_LMAC_FW_ADDR + 0x0004;
|
||||
|
|
@ -1054,26 +1054,30 @@ int aicwf_misc_ram_valid_check_8800dc(struct aic_sdio_dev *sdiodev, int *valid_o
|
|||
}
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_DPD) || defined(CONFIG_LOFT_CALIB)
|
||||
int aicwf_plat_calib_load_8800dc(struct aic_sdio_dev *sdiodev)
|
||||
{
|
||||
int ret = 0;
|
||||
if (chip_sub_id == 1) {
|
||||
ret = rwnx_plat_bin_fw_upload_android(sdiodev, ROM_FMAC_CALIB_ADDR, RWNX_MAC_CALIB_NAME_8800DC_U02);
|
||||
if (ret) {
|
||||
AICWFDBG(LOGINFO, "load rftest bin fail: %d\n", ret);
|
||||
AICWFDBG(LOGINFO, "load calib bin fail: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
} else if (chip_sub_id == 2) {
|
||||
ret = rwnx_plat_bin_fw_upload_android(sdiodev, ROM_FMAC_CALIB_ADDR, RWNX_MAC_CALIB_NAME_8800DC_H_U02);
|
||||
if (ret) {
|
||||
AICWFDBG(LOGINFO, "load rftest bin fail: %d\n", ret);
|
||||
AICWFDBG(LOGINFO, "load calib bin fail: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DPD
|
||||
#ifndef CONFIG_FORCE_DPD_CALIB
|
||||
int is_file_exist(char* name)
|
||||
{
|
||||
|
|
@ -1168,6 +1172,15 @@ static int rwnx_plat_patch_load(struct aic_sdio_dev *sdiodev)
|
|||
}
|
||||
#endif
|
||||
else
|
||||
#elif defined(CONFIG_LOFT_CALIB)
|
||||
if (1) {
|
||||
AICWFDBG(LOGINFO, "loft calib\n");
|
||||
ret = aicwf_loft_calib_8800dc(sdiodev);
|
||||
if (ret) {
|
||||
AICWFDBG(LOGINFO, "loft calib fail: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
ret = aicwf_misc_ram_init_8800dc(sdiodev);
|
||||
|
|
@ -1920,13 +1933,18 @@ int aicbsp_driver_fw_init(struct aic_sdio_dev *sdiodev)
|
|||
if (rwnx_send_dbg_mem_read_req(sdiodev, mem_addr, &rd_mem_addr_cfm))
|
||||
return -1;
|
||||
|
||||
aicbsp_info.chip_rev = (u8)(rd_mem_addr_cfm.memdata >> 16);
|
||||
aicbsp_info.chip_rev = (u8)((rd_mem_addr_cfm.memdata >> 16) & 0x3F);
|
||||
is_chip_id_h = (u8)(((rd_mem_addr_cfm.memdata >> 16) & 0xC0) == 0xC0);
|
||||
btenable = 1;
|
||||
|
||||
if (aicbsp_info.chip_rev == CHIP_REV_U01)
|
||||
aicbsp_firmware_list = fw_8800d80_u01;
|
||||
if (aicbsp_info.chip_rev == CHIP_REV_U02 || aicbsp_info.chip_rev == CHIP_REV_U03)
|
||||
aicbsp_firmware_list = fw_8800d80_u02;
|
||||
if (is_chip_id_h) {
|
||||
AICWFDBG(LOGINFO, "IS_CHIP_ID_H \n");
|
||||
aicbsp_firmware_list = fw_8800d80_h_u02;
|
||||
} else {
|
||||
if (aicbsp_info.chip_rev == CHIP_REV_U01)
|
||||
aicbsp_firmware_list = fw_8800d80_u01;
|
||||
if (aicbsp_info.chip_rev == CHIP_REV_U02 || aicbsp_info.chip_rev == CHIP_REV_U03)
|
||||
aicbsp_firmware_list = fw_8800d80_u02;
|
||||
}
|
||||
if (aicbsp_system_config_8800d80(sdiodev))
|
||||
return -1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@ extern int aicwf_dbg_level_bsp;
|
|||
|
||||
#define AICWF_LOG "AICWFDBG("
|
||||
|
||||
#ifdef DEBUG
|
||||
#define AICWFDBG(level, args, arg...) \
|
||||
do { \
|
||||
if (aicwf_dbg_level_bsp & level) { \
|
||||
|
|
@ -60,6 +61,12 @@ do { \
|
|||
} \
|
||||
} while (0)
|
||||
|
||||
#else
|
||||
|
||||
#define AICWFDBG(level, args, arg...)
|
||||
#define RWNX_DBG(fmt, ...)
|
||||
|
||||
#endif
|
||||
/// Message structure for MSGs from Emb to App
|
||||
struct ipc_e2a_msg {
|
||||
u16 id; ///< Message id.
|
||||
|
|
@ -312,6 +319,8 @@ int aicwf_plat_patch_load_8800dc(struct aic_sdio_dev *sdiodev);
|
|||
int aicwf_plat_rftest_load_8800dc(struct aic_sdio_dev *sdiodev);
|
||||
#ifdef CONFIG_DPD
|
||||
int aicwf_misc_ram_valid_check_8800dc(struct aic_sdio_dev *sdiodev, int *valid_out);
|
||||
#endif
|
||||
#if defined(CONFIG_DPD) || defined(CONFIG_LOFT_CALIB)
|
||||
int aicwf_plat_calib_load_8800dc(struct aic_sdio_dev *sdiodev);
|
||||
#endif
|
||||
|
||||
|
|
@ -371,10 +380,16 @@ int aicbsp_resv_mem_deinit(void);
|
|||
|
||||
#define RWNX_MAC_CALIB_BASE_NAME_8800DC "fmacfw_calib_8800dc"
|
||||
#define RWNX_MAC_CALIB_NAME_8800DC_U02 RWNX_MAC_CALIB_BASE_NAME_8800DC"_u02.bin"
|
||||
#ifdef CONFIG_SDIO_BT
|
||||
#define RWNX_MAC_CALIB_NAME_8800DC_H_U02 RWNX_MAC_CALIB_BASE_NAME_8800DC"_hbt_u02.bin"
|
||||
#else
|
||||
#define RWNX_MAC_CALIB_NAME_8800DC_H_U02 RWNX_MAC_CALIB_BASE_NAME_8800DC"_h_u02.bin"
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DPD
|
||||
#if defined(CONFIG_DPD) || defined(CONFIG_LOFT_CALIB)
|
||||
#define ROM_FMAC_CALIB_ADDR 0x00130000
|
||||
#endif
|
||||
#ifdef CONFIG_DPD
|
||||
#ifndef CONFIG_FORCE_DPD_CALIB
|
||||
#define FW_DPDRESULT_NAME_8800DC "aic_dpdresult_lite_8800dc.bin"
|
||||
#endif
|
||||
|
|
@ -389,13 +404,21 @@ int aicbsp_resv_mem_deinit(void);
|
|||
#define RWNX_MAC_PATCH_BASE_NAME_8800DC "fmacfw_patch_8800dc"
|
||||
#define RWNX_MAC_PATCH_NAME2_8800DC RWNX_MAC_PATCH_BASE_NAME_8800DC".bin"
|
||||
#define RWNX_MAC_PATCH_NAME2_8800DC_U02 RWNX_MAC_PATCH_BASE_NAME_8800DC"_u02.bin"
|
||||
#ifdef CONFIG_SDIO_BT
|
||||
#define RWNX_MAC_PATCH_NAME2_8800DC_H_U02 RWNX_MAC_PATCH_BASE_NAME_8800DC"_hbt_u02.bin"
|
||||
#else
|
||||
#define RWNX_MAC_PATCH_NAME2_8800DC_H_U02 RWNX_MAC_PATCH_BASE_NAME_8800DC"_h_u02.bin"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define RWNX_MAC_PATCH_TABLE_NAME_8800DC "fmacfw_patch_tbl_8800dc"
|
||||
#define RWNX_MAC_PATCH_TABLE_8800DC RWNX_MAC_PATCH_TABLE_NAME_8800DC ".bin"
|
||||
#define RWNX_MAC_PATCH_TABLE_8800DC_U02 RWNX_MAC_PATCH_TABLE_NAME_8800DC "_u02.bin"
|
||||
#ifdef CONFIG_SDIO_BT
|
||||
#define RWNX_MAC_PATCH_TABLE_8800DC_H_U02 RWNX_MAC_PATCH_TABLE_NAME_8800DC "_hbt_u02.bin"
|
||||
#else
|
||||
#define RWNX_MAC_PATCH_TABLE_8800DC_H_U02 RWNX_MAC_PATCH_TABLE_NAME_8800DC "_h_u02.bin"
|
||||
#endif
|
||||
|
||||
#define RWNX_MAC_RF_PATCH_BASE_NAME_8800DC "fmacfw_rf_patch_8800dc"
|
||||
#define RWNX_MAC_RF_PATCH_NAME_8800DC RWNX_MAC_RF_PATCH_BASE_NAME_8800DC".bin"
|
||||
|
|
@ -492,8 +515,12 @@ enum chip_rev {
|
|||
|
||||
#define AICBT_BTMODE_DEFAULT_8800d80 AICBT_BTMODE_BT_ONLY_COANT
|
||||
#define AICBT_BTMODE_DEFAULT AICBT_BTMODE_BT_ONLY_SW
|
||||
#ifdef CONFIG_SDIO_BT
|
||||
#define AICBT_BTPORT_DEFAULT AICBT_BTPORT_MB
|
||||
#else
|
||||
#define AICBT_BTPORT_DEFAULT AICBT_BTPORT_UART
|
||||
#define AICBT_UART_BAUD_DEFAULT AICBT_UART_BAUD_115200
|
||||
#endif
|
||||
#define AICBT_UART_BAUD_DEFAULT AICBT_UART_BAUD_1_5M
|
||||
#define AICBT_UART_FC_DEFAULT AICBT_UART_FLOWCTRL_ENABLE
|
||||
#define AICBT_LPM_ENABLE_DEFAULT 0
|
||||
#define AICBT_TXPWR_LVL_DEFAULT AICBT_TXPWR_LVL
|
||||
|
|
@ -501,9 +528,8 @@ enum chip_rev {
|
|||
#define AICBT_TXPWR_LVL_DEFAULT_8800d80 AICBT_TXPWR_LVL_8800d80
|
||||
|
||||
|
||||
#define AIC_IRQ_WAKE_FLAG 0 // 0: rising edge, 1: falling edge
|
||||
#define FEATURE_SDIO_CLOCK 10000000 // 0: default, other: target clock rate
|
||||
#define FEATURE_SDIO_CLOCK_V3 50000000 // 0: default, other: target clock rate
|
||||
#define FEATURE_SDIO_CLOCK 50000000 // 0: default, other: target clock rate
|
||||
#define FEATURE_SDIO_CLOCK_V3 150000000 // 0: default, other: target clock rate
|
||||
#define FEATURE_SDIO_PHASE 2 // 0: default, 2: 180°
|
||||
|
||||
struct aicbt_patch_table {
|
||||
|
|
@ -562,5 +588,6 @@ extern const struct aicbsp_firmware fw_8800dc_u02[];
|
|||
extern const struct aicbsp_firmware fw_8800dc_h_u02[];
|
||||
extern const struct aicbsp_firmware fw_8800d80_u01[];
|
||||
extern const struct aicbsp_firmware fw_8800d80_u02[];
|
||||
extern const struct aicbsp_firmware fw_8800d80_h_u02[];
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -27,7 +27,11 @@ const struct aicbsp_firmware fw_u02[] = {
|
|||
.bt_adid = "fw_adid.bin",
|
||||
.bt_patch = "fw_patch.bin",
|
||||
.bt_table = "fw_patch_table.bin",
|
||||
#ifdef CONFIG_SDIO_BT
|
||||
.wl_fw = "fmacfwbt.bin"
|
||||
#else
|
||||
.wl_fw = "fmacfw.bin"
|
||||
#endif
|
||||
},
|
||||
[AICBSP_CPMODE_TEST] = {
|
||||
.desc = "rf test mode(sdio u02)",
|
||||
|
|
@ -46,6 +50,8 @@ const struct aicbsp_firmware fw_u03[] = {
|
|||
.bt_table = "fw_patch_table_u03.bin",
|
||||
#ifdef CONFIG_MCU_MESSAGE
|
||||
.wl_fw = "fmacfw_8800m_custmsg.bin"
|
||||
#elif defined(CONFIG_SDIO_BT)
|
||||
.wl_fw = "fmacfwbt.bin"
|
||||
#else
|
||||
.wl_fw = "fmacfw.bin"
|
||||
#endif
|
||||
|
|
@ -140,7 +146,33 @@ const struct aicbsp_firmware fw_8800d80_u02[] = {
|
|||
.bt_adid = "fw_adid_8800d80_u02.bin",
|
||||
.bt_patch = "fw_patch_8800d80_u02.bin",
|
||||
.bt_table = "fw_patch_table_8800d80_u02.bin",
|
||||
#ifdef CONFIG_SDIO_BT
|
||||
.wl_fw = "fmacfwbt_8800d80_u02.bin"
|
||||
#else
|
||||
.wl_fw = "fmacfw_8800d80_u02.bin"
|
||||
#endif
|
||||
},
|
||||
|
||||
[AICBSP_CPMODE_TEST] = {
|
||||
.desc = "rf test mode(8800d80 sdio u02)",
|
||||
.bt_adid = "fw_adid_8800d80_u02.bin",
|
||||
.bt_patch = "fw_patch_8800d80_u02.bin",
|
||||
.bt_table = "fw_patch_table_8800d80_u02.bin",
|
||||
.wl_fw = "lmacfw_rf_8800d80_u02.bin"
|
||||
},
|
||||
};
|
||||
|
||||
const struct aicbsp_firmware fw_8800d80_h_u02[] = {
|
||||
[AICBSP_CPMODE_WORK] = {
|
||||
.desc = "normal work mode(8800d80 sdio h_u02)",
|
||||
.bt_adid = "fw_adid_8800d80_u02.bin",
|
||||
.bt_patch = "fw_patch_8800d80_u02.bin",
|
||||
.bt_table = "fw_patch_table_8800d80_u02.bin",
|
||||
#ifdef CONFIG_SDIO_BT
|
||||
.wl_fw = "fmacfwbt_8800d80_h_u02.bin"
|
||||
#else
|
||||
.wl_fw = "fmacfw_8800d80_h_u02.bin"
|
||||
#endif
|
||||
},
|
||||
|
||||
[AICBSP_CPMODE_TEST] = {
|
||||
|
|
@ -157,7 +189,11 @@ struct aicbsp_info_t aicbsp_info = {
|
|||
.hwinfo = AICBSP_HWINFO_DEFAULT,
|
||||
.cpmode = AICBSP_CPMODE_DEFAULT,
|
||||
.fwlog_en = AICBSP_FWLOG_EN_DEFAULT,
|
||||
.irqf = AIC_IRQ_WAKE_FLAG,
|
||||
#ifdef CONFIG_IRQ_FALL
|
||||
.irqf = 1,
|
||||
#else
|
||||
.irqf = 0,
|
||||
#endif
|
||||
};
|
||||
|
||||
struct mutex aicbsp_power_lock;
|
||||
|
|
@ -343,7 +379,7 @@ static int __init aicbsp_init(void)
|
|||
}
|
||||
|
||||
mutex_init(&aicbsp_power_lock);
|
||||
#ifdef CONFIG_PLATFORM_ROCKCHIP
|
||||
#if defined CONFIG_PLATFORM_ROCKCHIP || defined CONFIG_PLATFORM_ROCKCHIP2
|
||||
aicbsp_set_subsys(AIC_BLUETOOTH, AIC_PWR_ON);
|
||||
#endif
|
||||
return 0;
|
||||
|
|
@ -354,7 +390,7 @@ extern struct aic_sdio_dev *aicbsp_sdiodev;
|
|||
|
||||
static void __exit aicbsp_exit(void)
|
||||
{
|
||||
#ifdef CONFIG_PLATFORM_ROCKCHIP
|
||||
#if defined CONFIG_PLATFORM_ROCKCHIP || defined CONFIG_PLATFORM_ROCKCHIP2
|
||||
if(aicbsp_sdiodev){
|
||||
aicbsp_sdio_exit();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,6 +48,8 @@ static void aicbsp_platform_power_off(void);
|
|||
|
||||
struct aic_sdio_dev *aicbsp_sdiodev = NULL;
|
||||
static struct semaphore *aicbsp_notify_semaphore;
|
||||
static struct semaphore *aicbsp_probe_semaphore = NULL;
|
||||
|
||||
static const struct sdio_device_id aicbsp_sdmmc_ids[];
|
||||
static bool aicbsp_load_fw_in_fdrv = false;
|
||||
|
||||
|
|
@ -84,10 +86,7 @@ extern int testmode;
|
|||
static int aicbsp_dummy_probe(struct sdio_func *func, const struct sdio_device_id *id)
|
||||
{
|
||||
if (func && (func->num != 2))
|
||||
{
|
||||
printk("func_num = %d \r\n",func->num);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(func->vendor != SDIO_VENDOR_ID_AIC8801 &&
|
||||
func->device != SDIO_DEVICE_ID_AIC8801 &&
|
||||
|
|
@ -100,10 +99,6 @@ static int aicbsp_dummy_probe(struct sdio_func *func, const struct sdio_device_i
|
|||
printk("VID:%x DID:%X \r\n", func->vendor, func->device);
|
||||
aicbsp_load_fw_in_fdrv = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
printk("VID:%x DID:%X \r\n", func->vendor, func->device);
|
||||
}
|
||||
|
||||
if (aicbsp_notify_semaphore)
|
||||
up(aicbsp_notify_semaphore);
|
||||
|
|
@ -190,15 +185,7 @@ int aicbsp_set_subsys(int subsys, int state)
|
|||
aicbsp_sdio_release(aicbsp_sdiodev);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PLATFORM_ROCKCHIP
|
||||
#ifdef CONFIG_GPIO_WAKEUP
|
||||
//BT_SLEEP:true,BT_WAKEUP:false
|
||||
rfkill_rk_sleep_bt(true);
|
||||
printk("%s BT wake default to SLEEP\r\n", __func__);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PLATFORM_ROCKCHIP2
|
||||
#if defined CONFIG_PLATFORM_ROCKCHIP || defined CONFIG_PLATFORM_ROCKCHIP2
|
||||
#ifdef CONFIG_GPIO_WAKEUP
|
||||
//BT_SLEEP:true,BT_WAKEUP:false
|
||||
rfkill_rk_sleep_bt(true);
|
||||
|
|
@ -279,6 +266,16 @@ static int aicbsp_sdio_probe(struct sdio_func *func,
|
|||
struct aicwf_bus *bus_if;
|
||||
int err = -ENODEV;
|
||||
|
||||
if (func == NULL) {
|
||||
sdio_err("%s func is null\n", __func__);
|
||||
return err;
|
||||
}
|
||||
|
||||
if (aicbsp_probe_semaphore == NULL) {
|
||||
sdio_err("%s bsp_probe_semaphore is null\n", __func__);
|
||||
return err;
|
||||
}
|
||||
|
||||
sdio_dbg("%s:%d vid:0x%04X did:0x%04X\n", __func__, func->num,
|
||||
func->vendor, func->device);
|
||||
|
||||
|
|
@ -298,8 +295,11 @@ static int aicbsp_sdio_probe(struct sdio_func *func,
|
|||
return err;
|
||||
}
|
||||
|
||||
func = func->card->sdio_func[1 - 1]; //replace 2 with 1
|
||||
host = func->card->host;
|
||||
host->caps |= MMC_CAP_NONREMOVABLE;
|
||||
|
||||
func = func->card->sdio_func[1 - 1]; //replace 2 with 1
|
||||
|
||||
sdio_dbg("%s after replace:%d\n", __func__, func->num);
|
||||
|
||||
bus_if = kzalloc(sizeof(struct aicwf_bus), GFP_KERNEL);
|
||||
|
|
@ -346,9 +346,11 @@ static int aicbsp_sdio_probe(struct sdio_func *func,
|
|||
sdio_err("sdio bus init err\r\n");
|
||||
goto fail;
|
||||
}
|
||||
host->caps |= MMC_CAP_NONREMOVABLE;
|
||||
|
||||
aicbsp_platform_init(sdiodev);
|
||||
|
||||
up(aicbsp_probe_semaphore);
|
||||
|
||||
return 0;
|
||||
fail:
|
||||
aicwf_sdio_func_deinit(sdiodev);
|
||||
|
|
@ -358,33 +360,37 @@ fail:
|
|||
return err;
|
||||
}
|
||||
|
||||
|
||||
static void aicbsp_sdio_remove(struct sdio_func *func)
|
||||
{
|
||||
struct mmc_host *host;
|
||||
struct aicwf_bus *bus_if = NULL;
|
||||
struct aic_sdio_dev *sdiodev = NULL;
|
||||
|
||||
sdio_dbg("%s\n", __func__);
|
||||
AICWFDBG(LOGINFO, "%s\n", __func__);
|
||||
if (aicbsp_sdiodev == NULL) {
|
||||
sdio_dbg("%s: allready unregister\n", __func__);
|
||||
return;
|
||||
AICWFDBG(LOGERROR, "%s: allready unregister\n", __func__);
|
||||
goto done;
|
||||
}
|
||||
if ((func == NULL) || (&func->dev == NULL)) {
|
||||
AICWFDBG(LOGERROR, "%s, sdio func is null\n", __func__);
|
||||
goto done;
|
||||
}
|
||||
|
||||
bus_if = aicbsp_get_drvdata(&func->dev);
|
||||
|
||||
if (!bus_if) {
|
||||
AICWFDBG(LOGERROR, "%s bus_if is NULL \r\n", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
func = aicbsp_sdiodev->func;
|
||||
host = func->card->host;
|
||||
host->caps &= ~MMC_CAP_NONREMOVABLE;
|
||||
|
||||
bus_if = aicbsp_get_drvdata(&func->dev);
|
||||
|
||||
if (!bus_if) {
|
||||
AICWFDBG(LOGERROR, "%s bus_if is NULL \r\n", __func__);
|
||||
goto done;
|
||||
}
|
||||
|
||||
sdiodev = bus_if->bus_priv.sdio;
|
||||
if (!sdiodev) {
|
||||
AICWFDBG(LOGERROR, "%s sdiodev is NULL \r\n", __func__);
|
||||
return;
|
||||
AICWFDBG(LOGERROR, "%s sdiodev is NULL \r\n", __func__);
|
||||
goto done;
|
||||
}
|
||||
|
||||
aicwf_sdio_release(sdiodev);
|
||||
|
|
@ -392,29 +398,27 @@ static void aicbsp_sdio_remove(struct sdio_func *func)
|
|||
|
||||
dev_set_drvdata(&sdiodev->func->dev, NULL);
|
||||
kfree(sdiodev);
|
||||
kfree(bus_if);
|
||||
|
||||
done:
|
||||
if (bus_if)
|
||||
kfree(bus_if);
|
||||
aicbsp_sdiodev = NULL;
|
||||
aicbsp_probe_semaphore = NULL;
|
||||
sdio_dbg("%s done\n", __func__);
|
||||
}
|
||||
|
||||
#ifdef SDIO_REMOVEABLE
|
||||
static int aicbsp_sdio_suspend(struct device *dev)
|
||||
{
|
||||
struct sdio_func *func = dev_to_sdio_func(dev);
|
||||
int err;
|
||||
mmc_pm_flag_t sdio_flags;
|
||||
|
||||
#ifdef CONFIG_PLATFORM_ROCKCHIP
|
||||
#if defined(CONFIG_PLATFORM_ROCKCHIP) || defined(CONFIG_PLATFORM_ROCKCHIP2)
|
||||
#ifdef CONFIG_GPIO_WAKEUP
|
||||
//BT_SLEEP:true,BT_WAKEUP:false
|
||||
rfkill_rk_sleep_bt(false);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PLATFORM_ROCKCHIP2
|
||||
#ifdef CONFIG_GPIO_WAKEUP
|
||||
//BT_SLEEP:true,BT_WAKEUP:false
|
||||
rfkill_rk_sleep_bt(false);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
sdio_dbg("%s, func->num = %d\n", __func__, func->num);
|
||||
|
|
@ -434,7 +438,7 @@ static int aicbsp_sdio_suspend(struct device *dev)
|
|||
return err;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PLATFORM_ROCKCHIP
|
||||
#if defined(CONFIG_PLATFORM_ROCKCHIP) || defined(CONFIG_PLATFORM_ROCKCHIP2)
|
||||
#ifdef CONFIG_GPIO_WAKEUP
|
||||
//BT_SLEEP:true,BT_WAKEUP:false
|
||||
rfkill_rk_sleep_bt(true);
|
||||
|
|
@ -442,15 +446,6 @@ static int aicbsp_sdio_suspend(struct device *dev)
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PLATFORM_ROCKCHIP2
|
||||
#ifdef CONFIG_GPIO_WAKEUP
|
||||
//BT_SLEEP:true,BT_WAKEUP:false
|
||||
rfkill_rk_sleep_bt(true);
|
||||
printk("%s BT wake to SLEEP\r\n", __func__);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -458,8 +453,16 @@ static int aicbsp_sdio_resume(struct device *dev)
|
|||
{
|
||||
sdio_dbg("%s\n", __func__);
|
||||
|
||||
#if defined(CONFIG_PLATFORM_ROCKCHIP) || defined(CONFIG_PLATFORM_ROCKCHIP2)
|
||||
#ifdef CONFIG_GPIO_WAKEUP
|
||||
//BT_SLEEP:true,BT_WAKEUP:false
|
||||
rfkill_rk_sleep_bt(false);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
static const struct sdio_device_id aicbsp_sdmmc_ids[] = {
|
||||
{SDIO_DEVICE_CLASS(SDIO_CLASS_WLAN)},
|
||||
|
|
@ -512,7 +515,6 @@ static int aicbsp_platform_power_on(void)
|
|||
rockchip_wifi_set_carddetect(1);
|
||||
#endif /*CONFIG_PLATFORM_ROCKCHIP2*/
|
||||
|
||||
|
||||
sema_init(&aic_chipup_sem, 0);
|
||||
ret = aicbsp_reg_sdio_notify(&aic_chipup_sem);
|
||||
if (ret) {
|
||||
|
|
@ -528,9 +530,7 @@ static int aicbsp_platform_power_on(void)
|
|||
sunxi_mmc_rescan_card(aicbsp_bus_index);
|
||||
#endif //CONFIG_PLATFORM_ALLWINNER
|
||||
|
||||
sdio_dbg("%s Get semaphore ... \n", __func__);
|
||||
if (down_timeout(&aic_chipup_sem, msecs_to_jiffies(4000)) == 0) {
|
||||
sdio_dbg("%s Get semaphore success \n", __func__);
|
||||
if (down_timeout(&aic_chipup_sem, msecs_to_jiffies(2000)) == 0) {
|
||||
aicbsp_unreg_sdio_notify();
|
||||
if(aicbsp_load_fw_in_fdrv){
|
||||
printk("%s load fw in fdrv\r\n", __func__);
|
||||
|
|
@ -588,11 +588,22 @@ static void aicbsp_platform_power_off(void)
|
|||
|
||||
int aicbsp_sdio_init(void)
|
||||
{
|
||||
struct semaphore aic_chipup_sem;
|
||||
|
||||
sema_init(&aic_chipup_sem, 0);
|
||||
aicbsp_probe_semaphore = &aic_chipup_sem;
|
||||
|
||||
if (sdio_register_driver(&aicbsp_sdio_driver)) {
|
||||
return -1;
|
||||
} else {
|
||||
//may add mmc_rescan here
|
||||
}
|
||||
if (down_timeout(aicbsp_probe_semaphore, msecs_to_jiffies(2000)) != 0){
|
||||
printk("%s aicbsp_sdio_probe fail\r\n", __func__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -1618,22 +1629,33 @@ void aicwf_sdio_release_func2(struct aic_sdio_dev *sdiodev)
|
|||
|
||||
void aicwf_sdio_release(struct aic_sdio_dev *sdiodev)
|
||||
{
|
||||
struct aicwf_bus *bus_if;
|
||||
struct aicwf_bus *bus_if = NULL;
|
||||
struct aicwf_bus *bus_if_t = NULL;
|
||||
int ret = 0;
|
||||
|
||||
sdio_dbg("%s\n", __func__);
|
||||
if (sdiodev->func == NULL) {
|
||||
printk("%s, NULL sdio func\n", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
bus_if = aicbsp_get_drvdata(sdiodev->dev);
|
||||
bus_if->state = BUS_DOWN_ST;
|
||||
if (bus_if)
|
||||
bus_if->state = BUS_DOWN_ST;
|
||||
|
||||
sdio_claim_host(sdiodev->func);
|
||||
//disable sdio interrupt
|
||||
ret = aicwf_sdio_writeb(sdiodev, sdiodev->sdio_reg.intr_config_reg, 0x0);
|
||||
if (ret < 0) {
|
||||
sdio_err("reg:%d write failed!, ret=%d\n", sdiodev->sdio_reg.intr_config_reg, ret);
|
||||
bus_if_t = dev_get_drvdata(sdiodev->dev);
|
||||
|
||||
if ((bus_if_t != NULL) && (sdiodev->bus_if == bus_if_t)) {
|
||||
sdio_dbg("%s bsp release\n", __func__);
|
||||
sdio_claim_host(sdiodev->func);
|
||||
//disable sdio interrupt
|
||||
ret = aicwf_sdio_writeb(sdiodev, sdiodev->sdio_reg.intr_config_reg, 0x0);
|
||||
if (ret < 0) {
|
||||
sdio_err("reg:%d write failed!, ret=%d\n", sdiodev->sdio_reg.intr_config_reg, ret);
|
||||
}
|
||||
sdio_release_irq(sdiodev->func);
|
||||
sdio_release_host(sdiodev->func);
|
||||
}
|
||||
sdio_release_irq(sdiodev->func);
|
||||
sdio_release_host(sdiodev->func);
|
||||
|
||||
if(sdiodev->chipid == PRODUCT_ID_AIC8800DC || sdiodev->chipid == PRODUCT_ID_AIC8800DW){
|
||||
aicwf_sdio_release_func2(sdiodev);
|
||||
|
|
@ -1651,6 +1673,8 @@ void aicwf_sdio_release(struct aic_sdio_dev *sdiodev)
|
|||
rwnx_cmd_mgr_deinit(&sdiodev->cmd_mgr);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void aicwf_sdio_reg_init(struct aic_sdio_dev *sdiodev)
|
||||
{
|
||||
sdio_dbg("%s\n", __func__);
|
||||
|
|
@ -1720,7 +1744,6 @@ int aicwf_sdio_func_init(struct aic_sdio_dev *sdiodev)
|
|||
#if 1//SDIO CLOCK SETTING
|
||||
if (feature.sdio_clock > 0) {
|
||||
host->ios.clock = feature.sdio_clock;
|
||||
// for test
|
||||
host->ops->set_ios(host, &host->ios);
|
||||
sdio_dbg("Set SDIO Clock %d MHz\n", host->ios.clock/1000000);
|
||||
}
|
||||
|
|
@ -1860,16 +1883,35 @@ int aicwf_sdiov3_func_init(struct aic_sdio_dev *sdiodev)
|
|||
|
||||
void aicwf_sdio_func_deinit(struct aic_sdio_dev *sdiodev)
|
||||
{
|
||||
sdio_claim_host(sdiodev->func);
|
||||
sdio_disable_func(sdiodev->func);
|
||||
sdio_release_host(sdiodev->func);
|
||||
struct aicwf_bus *bus_if = NULL;
|
||||
|
||||
if (sdiodev->func == NULL) {
|
||||
sdio_err("%s, NULL sdio func\n", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
bus_if = dev_get_drvdata(sdiodev->dev);
|
||||
if (bus_if == NULL) {
|
||||
sdio_err("%s, bus_if is null\n", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
if (sdiodev->bus_if == bus_if) {
|
||||
sdio_dbg("%s bsp disable\n", __func__);
|
||||
sdio_claim_host(sdiodev->func);
|
||||
sdio_disable_func(sdiodev->func);
|
||||
sdio_release_host(sdiodev->func);
|
||||
}
|
||||
|
||||
if(sdiodev->chipid == PRODUCT_ID_AIC8800DC || sdiodev->chipid == PRODUCT_ID_AIC8800DW){
|
||||
sdio_claim_host(sdiodev->func_msg);
|
||||
sdio_disable_func(sdiodev->func_msg);
|
||||
sdio_release_host(sdiodev->func_msg);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
void *aicwf_sdio_bus_init(struct aic_sdio_dev *sdiodev)
|
||||
{
|
||||
int ret;
|
||||
|
|
|
|||
|
|
@ -108,6 +108,7 @@ struct aic_sdio_dev {
|
|||
struct semaphore pwrctl_wakeup_sema;
|
||||
#endif
|
||||
u16 chipid;
|
||||
u32 fw_version_uint;
|
||||
struct aic_sdio_reg sdio_reg;
|
||||
void (*sdio_hal_irqhandler) (struct sdio_func *func);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -47,12 +47,14 @@ int aicwf_bus_init(uint bus_hdrlen, struct device *dev)
|
|||
if (IS_ERR(bus_if->bustx_thread)) {
|
||||
bus_if->bustx_thread = NULL;
|
||||
txrx_err("aicwf_bustx_thread run fail\n");
|
||||
ret = -1;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (IS_ERR(bus_if->busrx_thread)) {
|
||||
bus_if->busrx_thread = NULL;
|
||||
txrx_err("aicwf_bustx_thread run fail\n");
|
||||
ret = -1;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#define RWNX_VERS_REV "241c091M (master)"
|
||||
#define RWNX_VERS_MOD "6.4.3.0"
|
||||
#define RWNX_VERS_BANNER "rwnx v6.4.3.0 - - 241c091M (master)"
|
||||
#define RELEASE_DATE "2023_1219_3cf85031"
|
||||
#define RELEASE_DATE "2024_0615_c3cb37b3"
|
||||
|
|
|
|||
|
|
@ -12,38 +12,23 @@ CONFIG_PLATFORM_AMLOGIC ?= n
|
|||
CONFIG_PLATFORM_UBUNTU ?= y
|
||||
|
||||
|
||||
CONFIG_SUPPORT_LPM = y
|
||||
CONFIG_SUPPORT_LPM ?= n
|
||||
CONFIG_AUTO_PM ?= n
|
||||
|
||||
aic8800_btlpm-y := \
|
||||
aic_bluetooth_main.o \
|
||||
rfkill.o \
|
||||
|
||||
ifeq ($(CONFIG_PLATFORM_UBUNTU), n)
|
||||
aic8800_btlpm-$(CONFIG_SUPPORT_LPM) += lpm.o
|
||||
endif
|
||||
aic8800_btlpm-$(CONFIG_SUPPORT_LPM) += lpm.o
|
||||
|
||||
ccflags-y += -DAIC_TRACE_INCLUDE_PATH=$(src)
|
||||
|
||||
ccflags-$(CONFIG_AUTO_PM) += -DCONFIG_AUTO_PM
|
||||
|
||||
ifeq ($(CONFIG_PLATFORM_ROCKCHIP), y)
|
||||
KDIR ?= /home/yaya/E/Rockchip/3229/Android9/rk3229_android9.0_box/kernel
|
||||
ARCH ?= arm
|
||||
CROSS_COMPILE ?= /home/yaya/E/Rockchip/3229/Android9/rk3229_android9.0_box/prebuilts/gcc/linux-x86/arm/gcc-linaro-6.3.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-
|
||||
#KDIR ?= /home/yaya/E/Rockchip/3229/Android10/SDK/kernel/
|
||||
#ARCH ?= arm
|
||||
#CROSS_COMPILE ?= /home/yaya/E/Rockchip/3229/Android10/SDK/prebuilts/gcc/linux-x86/arm/gcc-linaro-6.3.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-
|
||||
#KDIR ?= /home/yaya/E/Rockchip/3288/Android10/kernel/kernel/
|
||||
#ARCH ?= arm
|
||||
#CROSS_COMPILE ?= /home/yaya/E/Rockchip/3288/Android10/tool/gcc-linaro-6.3.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux#-gnueabihf-
|
||||
#KDIR ?= /home/yaya/E/Rockchip/3229/Android7/RK3229_ANDROID7.1_v1.01_20170914/rk3229_Android7.1_v1.01_xml0914/kernel
|
||||
#ARCH ?= arm
|
||||
#CROSS_COMPILE ?= /home/yaya/E/Rockchip/3229/Android7/RK3229_ANDROID7.1_v1.01_20170914/rk3229_Android7.1_v1.01_xml0914/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi-
|
||||
#KDIR ?= /home/yaya/E/Rockchip/3328/Android9/SDK/SDK/kernel
|
||||
#ARCH ?= arm64
|
||||
#CROSS_COMPILE ?= /home/yaya/E/Rockchip/3328/Android9/SDK/SDK/prebuilts/gcc/linux-x86/aarch64/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
|
||||
|
||||
ARCH = arm64
|
||||
KDIR = /home/yaya/E/Rockchip/3566/firefly/Android11.0/Firefly-RK356X_Android11.0_git_20210824/RK356X_Android11.0/kernel
|
||||
CROSS_COMPILE = /home/yaya/E/Rockchip/3566/firefly/Android11.0/Firefly-RK356X_Android11.0_git_20210824/RK356X_Android11.0/prebuilts/gcc/linux-x86/aarch64/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
|
||||
ccflags-$(CONFIG_PLATFORM_ROCKCHIP) += -DCONFIG_PLATFORM_ROCKCHIP
|
||||
ccflags-y += -DANDROID_PLATFORM
|
||||
endif
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
EXTRA_CFLAGS += $(USER_EXTRA_CFLAGS)
|
||||
EXTRA_CFLAGS += -Wno-implicit-fallthrough
|
||||
EXTRA_CFLAGS += -Wno-unused-function
|
||||
#EXTRA_CFLAGS += -Wno-unused-function
|
||||
#EXTRA_CFLAGS += -Wno-maybe-uninitialized
|
||||
# EXTRA_CFLAGS += -Wno-unused-variable
|
||||
#EXTRA_CFLAGS += -Wno-unused-variable
|
||||
|
||||
RWNX_VERS_NUM := 6.4.3.0
|
||||
|
||||
|
|
@ -73,6 +73,7 @@ CONFIG_RADAR_OR_IR_DETECT =n
|
|||
CONFIG_DOWNLOAD_FW =n
|
||||
CONFIG_RFTEST=y
|
||||
CONFIG_USB_BT =y
|
||||
CONFIG_SDIO_BT=n
|
||||
CONFIG_USE_5G ?= y
|
||||
CONFIG_SDIO_PWRCTRL ?= y
|
||||
CONFIG_CREATE_TRACE_POINTS = n
|
||||
|
|
@ -80,7 +81,7 @@ CONFIG_TXRX_THREAD_PRIO = y
|
|||
# CONFIG_COEX = n for BT_ONLY, CONFIG_COEX =y for combo and sw
|
||||
CONFIG_COEX = y
|
||||
CONFIG_RX_NETIF_RECV_SKB = y
|
||||
CONFIG_GPIO_WAKEUP = n
|
||||
CONFIG_GPIO_WAKEUP ?= n
|
||||
CONFIG_SET_VENDOR_EXTENSION_IE = n
|
||||
CONFIG_SUPPORT_REALTIME_CHANGE_MAC = y
|
||||
CONFIG_WPA3_FOR_OLD_KERNEL ?= n
|
||||
|
|
@ -91,19 +92,35 @@ CONFIG_WIFI_SUSPEND_FOR_LINUX = n
|
|||
# Need to set fw path in BOARD_KERNEL_CMDLINE
|
||||
CONFIG_USE_FW_REQUEST = n
|
||||
CONFIG_USE_P2P0=n
|
||||
CONFIG_TX_NETIF_FLOWCTRL = n
|
||||
CONFIG_ONE_TXQ = n
|
||||
CONFIG_BR_SUPPORT =n
|
||||
BR_NAME = br0
|
||||
CONFIG_FDRV_NO_REG_SDIO=n
|
||||
CONFIG_SCHED_SCAN = n
|
||||
CONFIG_OOB = n
|
||||
CONFIG_OOB ?= n
|
||||
CONFIG_USE_CUSTOMER_MAC = n
|
||||
CONFIG_PREALLOC_TXQ = y
|
||||
CONFIG_PREALLOC_TXQ ?= y
|
||||
CONFIG_DPD = y
|
||||
CONFIG_FORCE_DPD_CALIB = y
|
||||
CONFIG_FILTER_TCP_ACK =n
|
||||
CONFIG_RESV_MEM_SUPPORT = y
|
||||
CONFIG_LOFT_CALIB = n
|
||||
CONFIG_FILTER_TCP_ACK =y
|
||||
CONFIG_RESV_MEM_SUPPORT ?= y
|
||||
CONFIG_GKI = n
|
||||
CONFIG_TEMP_COMP = n
|
||||
CONFIG_EXT_FEM_8800DCDW = n
|
||||
# CONFIG_MCC = n for sta and p2p concurrent in same channel.
|
||||
CONFIG_MCC = y
|
||||
|
||||
ifneq ($(CONFIG_WIRELESS_EXT), y)
|
||||
CONFIG_USE_WIRELESS_EXT = n
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_EXT_FEM_8800DCDW), y)
|
||||
CONFIG_DPD = n
|
||||
CONFIG_FORCE_DPD_CALIB = n
|
||||
CONFIG_LOFT_CALIB = y
|
||||
endif
|
||||
|
||||
# Support of MU-MIMO transmission (need FW support)
|
||||
ifeq ($(CONFIG_RWNX_BFMER), y)
|
||||
|
|
@ -153,6 +170,7 @@ $(MODULE_NAME)-y := \
|
|||
aicwf_compat_8800d80.o \
|
||||
rwnx_wakelock.o \
|
||||
regdb.o \
|
||||
aic_priv_cmd.o \
|
||||
aicwf_rx_prealloc.o
|
||||
|
||||
$(MODULE_NAME)-$(CONFIG_BR_SUPPORT) += aic_br_ext.o
|
||||
|
|
@ -166,6 +184,7 @@ $(MODULE_NAME)-$(CONFIG_SDIO_SUPPORT) += sdio_host.o
|
|||
$(MODULE_NAME)-$(CONFIG_SDIO_SUPPORT) += aicwf_txrxif.o
|
||||
$(MODULE_NAME)-$(CONFIG_SDIO_SUPPORT) += aicwf_sdio.o
|
||||
$(MODULE_NAME)-$(CONFIG_FILTER_TCP_ACK) += aicwf_tcp_ack.o
|
||||
$(MODULE_NAME)-$(CONFIG_SDIO_BT) += aic_btsdio.o
|
||||
|
||||
$(MODULE_NAME)-$(CONFIG_USB_SUPPORT) += usb_host.o
|
||||
$(MODULE_NAME)-$(CONFIG_USB_SUPPORT) += aicwf_txrxif.o
|
||||
|
|
@ -245,10 +264,14 @@ ccflags-$(CONFIG_USE_CUSTOMER_MAC) += -DCONFIG_USE_CUSTOMER_MAC
|
|||
ccflags-$(CONFIG_PREALLOC_TXQ) += -DCONFIG_PREALLOC_TXQ
|
||||
ccflags-$(CONFIG_DPD) += -DCONFIG_DPD
|
||||
ccflags-$(CONFIG_FORCE_DPD_CALIB) += -DCONFIG_FORCE_DPD_CALIB -DCONFIG_DPD
|
||||
ccflags-$(CONFIG_LOFT_CALIB) += -DCONFIG_LOFT_CALIB
|
||||
ccflags-$(CONFIG_FILTER_TCP_ACK) += -DCONFIG_FILTER_TCP_ACK
|
||||
ccflags-$(CONFIG_SDIO_BT) += -DCONFIG_SDIO_BT
|
||||
ccflags-$(CONFIG_RESV_MEM_SUPPORT) += -DCONFIG_RESV_MEM_SUPPORT
|
||||
ccflags-$(CONFIG_GKI) += -DCONFIG_GKI
|
||||
ccflags-$(CONFIG_TEMP_COMP) += -DCONFIG_TEMP_COMP
|
||||
ccflags-$(CONFIG_EXT_FEM_8800DCDW) += -DCONFIG_EXT_FEM_8800DCDW
|
||||
ccflags-$(CONFIG_MCC) += -DCONFIG_MCC
|
||||
|
||||
|
||||
ifeq ($(CONFIG_SDIO_SUPPORT), y)
|
||||
|
|
@ -287,8 +310,13 @@ ccflags-$(CONFIG_ARP_OFFLOAD) += -DAICWF_ARP_OFFLOAD
|
|||
ccflags-$(CONFIG_RADAR_DETECT) += -DRADAR_OR_IR_DETECT
|
||||
ccflags-$(CONFIG_DOWNLOAD_FW) += -DCONFIG_DOWNLOAD_FW
|
||||
ccflags-$(CONFIG_RX_NETIF_RECV_SKB) += -DCONFIG_RX_NETIF_RECV_SKB
|
||||
ccflags-$(CONFIG_ONE_TXQ) += -DCONFIG_ONE_TXQ
|
||||
ccflags-$(CONFIG_TX_NETIF_FLOWCTRL) += -DCONFIG_TX_NETIF_FLOWCTRL
|
||||
|
||||
# Platform support list
|
||||
ccflags-y += -DAIC_TRACE_INCLUDE_PATH=$(src)
|
||||
MAKEFLAGS +=-j$(shell nproc)
|
||||
|
||||
########## Platform support list ##########
|
||||
CONFIG_PLATFORM_ROCKCHIP ?= n
|
||||
CONFIG_PLATFORM_ROCKCHIP2 ?= n
|
||||
CONFIG_PLATFORM_ALLWINNER ?= n
|
||||
|
|
@ -296,32 +324,10 @@ CONFIG_PLATFORM_INGENIC_T20 ?= n
|
|||
CONFIG_PLATFORM_AMLOGIC ?= n
|
||||
CONFIG_PLATFORM_UBUNTU ?= y
|
||||
|
||||
ccflags-y += -DAIC_TRACE_INCLUDE_PATH=$(src)
|
||||
|
||||
ifeq ($(CONFIG_PLATFORM_ROCKCHIP), y)
|
||||
#KDIR ?= /home/yaya/E/Rockchip/3229/Android7/RK3229_ANDROID7.1_v1.01_20170914/rk3229_Android7.1_v1.01_xml0914/kernel
|
||||
#ARCH ?= arm
|
||||
#CROSS_COMPILE ?= /home/yaya/E/Rockchip/3229/Android7/RK3229_ANDROID7.1_v1.01_20170914/rk3229_Android7.1_v1.01_xml0914/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi-
|
||||
#KDIR ?= /home/yaya/E/Rockchip/3399/rk3399-android-10/kernel
|
||||
#ARCH ?= arm64
|
||||
#CROSS_COMPILE ?= /home/yaya/E/Rockchip/3399/rk3399-android-10/prebuilts/gcc/linux-x86/aarch64/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
|
||||
#KDIR ?= /home/yaya/E/Rockchip/3288/Android10/kernel/kernel/
|
||||
#ARCH ?= arm
|
||||
#CROSS_COMPILE ?= /home/yaya/E/Rockchip/3288/Android10/tool/gcc-linaro-6.3.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-
|
||||
#KDIR ?= /home/yaya/E/Rockchip/3229/Android9/rk3229_android9.0_box/kernel
|
||||
#ARCH ?= arm
|
||||
#CROSS_COMPILE ?= /home/yaya/E/Rockchip/3229/Android9/rk3229_android9.0_box/prebuilts/gcc/linux-x86/arm/gcc-linaro-6.3.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-
|
||||
#KDIR ?= /home/yaya/E/Rockchip/3566/Android/kernel
|
||||
#ARCH ?= arm64
|
||||
#CROSS_COMPILE ?= /home/yaya/E/Rockchip/3566/Android/prebuilts/gcc/linux-x86/aarch64/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
|
||||
#KDIR ?= /home/yaya/E/Rockchip/3328/Android9/SDK/kernel/
|
||||
#ARCH ?= arm64
|
||||
#CROSS_COMPILE ?= /home/yaya/E/Rockchip/3328/Android9/SDK/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
|
||||
#KDIR ?= /home/yaya/E/Rockchip/3566/oudu/kernel
|
||||
KDIR ?= ~/E/Rockchip/3566/Android11/rk3566_rk3568_android11_oranth/kernel
|
||||
#KDIR ?= /home/yaya/E/Rockchip/3566/shengteng/kernel
|
||||
ARCH ?= arm64
|
||||
CROSS_COMPILE ?= ~/E/Rockchip/3566/Android11/rk3566_rk3568_android11_oranth/prebuilts/gcc/linux-x86/aarch64/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
|
||||
ARCH := arm64
|
||||
KDIR ?= /home/yaya/E/Rockchip/3566/firefly/Android11.0/Firefly-RK356X_Android11.0_git_20210824/RK356X_Android11.0/kernel
|
||||
CROSS_COMPILE := /home/yaya/E/Rockchip/3566/firefly/Android11.0/Firefly-RK356X_Android11.0_git_20210824/RK356X_Android11.0/prebuilts/gcc/linux-x86/aarch64/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
|
||||
ccflags-$(CONFIG_PLATFORM_ROCKCHIP) += -DCONFIG_PLATFORM_ROCKCHIP
|
||||
ccflags-y += -DANDROID_PLATFORM
|
||||
endif
|
||||
|
|
@ -363,6 +369,7 @@ MODDESTDIR ?= /lib/modules/$(KVER)/kernel/drivers/net/wireless/
|
|||
ARCH ?= x86_64
|
||||
CROSS_COMPILE ?=
|
||||
endif
|
||||
###########################################
|
||||
|
||||
|
||||
all: modules
|
||||
|
|
|
|||
1310
sysdrv/drv_ko/wifi/aic8800dc/aic8800_fdrv/aic_btsdio.c
Executable file
1310
sysdrv/drv_ko/wifi/aic8800dc/aic8800_fdrv/aic_btsdio.c
Executable file
File diff suppressed because it is too large
Load Diff
549
sysdrv/drv_ko/wifi/aic8800dc/aic8800_fdrv/aic_btsdio.h
Executable file
549
sysdrv/drv_ko/wifi/aic8800dc/aic8800_fdrv/aic_btsdio.h
Executable file
|
|
@ -0,0 +1,549 @@
|
|||
#ifndef _AICWF_SDIO_BT_H_
|
||||
#define _AICWF_SDIO_BT_H_
|
||||
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/skbuff.h>
|
||||
#include <linux/errno.h>
|
||||
#include <linux/cdev.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/poll.h>
|
||||
|
||||
#include <linux/version.h>
|
||||
#include <linux/pm_runtime.h>
|
||||
#include <linux/firmware.h>
|
||||
#include <linux/suspend.h>
|
||||
|
||||
|
||||
#ifdef CONFIG_PLATFORM_UBUNTU
|
||||
#define CONFIG_BLUEDROID 1 /* bleuz 0, bluedroid 1 */
|
||||
#else
|
||||
#define CONFIG_BLUEDROID 1 /* bleuz 0, bluedroid 1 */
|
||||
#endif
|
||||
/* #define HCI_VERSION_CODE KERNEL_VERSION(3, 14, 41) */
|
||||
#define HCI_VERSION_CODE LINUX_VERSION_CODE
|
||||
|
||||
|
||||
#define PRINT_CMD_EVENT 1
|
||||
#define PRINT_ACL_DATA 1
|
||||
#define PRINT_SCO_DATA 1
|
||||
|
||||
#define AICBT_DBG_FLAG 1
|
||||
|
||||
#if AICBT_DBG_FLAG
|
||||
#define AICBT_DBG(fmt, arg...) printk( "aic_btsdio: " fmt "\n" , ## arg)
|
||||
#else
|
||||
#define AICBT_DBG(fmt, arg...)
|
||||
#endif
|
||||
|
||||
#define AICBT_INFO(fmt, arg...) printk("aic_btsdio: " fmt "\n" , ## arg)
|
||||
#define AICBT_WARN(fmt, arg...) printk("aic_btsdio: " fmt "\n" , ## arg)
|
||||
#define AICBT_ERR(fmt, arg...) printk("aic_btsdio: " fmt "\n" , ## arg)
|
||||
|
||||
#if LINUX_VERSION_CODE > KERNEL_VERSION(3, 4, 0)
|
||||
#define GET_DRV_DATA(x) hci_get_drvdata(x)
|
||||
#else
|
||||
#define GET_DRV_DATA(x) x->driver_data
|
||||
#endif
|
||||
|
||||
struct btusb_data {
|
||||
struct hci_dev *hdev;
|
||||
//struct usb_device *udev;
|
||||
//struct usb_interface *intf;
|
||||
//struct usb_interface *isoc;
|
||||
|
||||
spinlock_t lock;
|
||||
|
||||
unsigned long flags;
|
||||
|
||||
struct work_struct work;
|
||||
struct work_struct waker;
|
||||
|
||||
/*struct usb_anchor tx_anchor;
|
||||
struct usb_anchor intr_anchor;
|
||||
struct usb_anchor bulk_anchor;
|
||||
struct usb_anchor isoc_anchor;
|
||||
struct usb_anchor deferred;*/
|
||||
int tx_in_flight;
|
||||
spinlock_t txlock;
|
||||
|
||||
#if (CONFIG_BLUEDROID == 0)
|
||||
#if HCI_VERSION_CODE >= KERNEL_VERSION(3, 18, 0)
|
||||
spinlock_t rxlock;
|
||||
struct sk_buff *evt_skb;
|
||||
struct sk_buff *acl_skb;
|
||||
struct sk_buff *sco_skb;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*struct usb_endpoint_descriptor *intr_ep;
|
||||
struct usb_endpoint_descriptor *bulk_tx_ep;
|
||||
struct usb_endpoint_descriptor *bulk_rx_ep;
|
||||
struct usb_endpoint_descriptor *isoc_tx_ep;
|
||||
struct usb_endpoint_descriptor *isoc_rx_ep;*/
|
||||
|
||||
__u8 cmdreq_type;
|
||||
|
||||
unsigned int sco_num;
|
||||
int isoc_altsetting;
|
||||
int suspend_count;
|
||||
uint16_t sco_handle;
|
||||
|
||||
#if (CONFIG_BLUEDROID == 0)
|
||||
#if HCI_VERSION_CODE >= KERNEL_VERSION(3, 18, 0)
|
||||
int (*recv_bulk) (struct btusb_data * data, void *buffer, int count);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//#ifdef CONFIG_HAS_EARLYSUSPEND
|
||||
#if 0
|
||||
struct early_suspend early_suspend;
|
||||
#else
|
||||
struct notifier_block pm_notifier;
|
||||
struct notifier_block reboot_notifier;
|
||||
#endif
|
||||
//firmware_info *fw_info;
|
||||
|
||||
#ifdef CONFIG_SCO_OVER_HCI
|
||||
AIC_sco_card_t *pSCOSnd;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
|
||||
#define QUEUE_SIZE 500
|
||||
|
||||
/***************************************
|
||||
** AicSemi - Integrate from bluetooth.h **
|
||||
*****************************************/
|
||||
/* Reserv for core and drivers use */
|
||||
#define BT_SKB_RESERVE 8
|
||||
|
||||
/* BD Address */
|
||||
typedef struct {
|
||||
__u8 b[6];
|
||||
} __packed bdaddr_t;
|
||||
|
||||
/* Skb helpers */
|
||||
struct bt_skb_cb {
|
||||
__u8 pkt_type;
|
||||
__u8 incoming;
|
||||
__u16 expect;
|
||||
__u16 tx_seq;
|
||||
__u8 retries;
|
||||
__u8 sar;
|
||||
__u8 force_active;
|
||||
};
|
||||
|
||||
#define bt_cb(skb) ((struct bt_skb_cb *)((skb)->cb))
|
||||
|
||||
|
||||
/***********************************
|
||||
** AicSemi - Integrate from hci.h **
|
||||
***********************************/
|
||||
#define HCI_MAX_ACL_SIZE 1024
|
||||
#define HCI_MAX_SCO_SIZE 255
|
||||
#define HCI_MAX_EVENT_SIZE 260
|
||||
#define HCI_MAX_FRAME_SIZE (HCI_MAX_ACL_SIZE + 4)
|
||||
|
||||
/* HCI bus types */
|
||||
#define HCI_VIRTUAL 0
|
||||
#define HCI_USB 1
|
||||
#define HCI_PCCARD 2
|
||||
#define HCI_UART 3
|
||||
#define HCI_RS232 4
|
||||
#define HCI_PCI 5
|
||||
#define HCI_SDIO 6
|
||||
|
||||
/* HCI controller types */
|
||||
#define HCI_BREDR 0x00
|
||||
#define HCI_AMP 0x01
|
||||
|
||||
/* HCI device flags */
|
||||
enum {
|
||||
HCI_UP,
|
||||
HCI_INIT,
|
||||
HCI_RUNNING,
|
||||
|
||||
HCI_PSCAN,
|
||||
HCI_ISCAN,
|
||||
HCI_AUTH,
|
||||
HCI_ENCRYPT,
|
||||
HCI_INQUIRY,
|
||||
|
||||
HCI_RAW,
|
||||
|
||||
HCI_RESET,
|
||||
};
|
||||
|
||||
/*
|
||||
* BR/EDR and/or LE controller flags: the flags defined here should represent
|
||||
* states from the controller.
|
||||
*/
|
||||
enum {
|
||||
HCI_SETUP,
|
||||
HCI_AUTO_OFF,
|
||||
HCI_MGMT,
|
||||
HCI_PAIRABLE,
|
||||
HCI_SERVICE_CACHE,
|
||||
HCI_LINK_KEYS,
|
||||
HCI_DEBUG_KEYS,
|
||||
HCI_UNREGISTER,
|
||||
|
||||
HCI_LE_SCAN,
|
||||
HCI_SSP_ENABLED,
|
||||
HCI_HS_ENABLED,
|
||||
HCI_LE_ENABLED,
|
||||
HCI_CONNECTABLE,
|
||||
HCI_DISCOVERABLE,
|
||||
HCI_LINK_SECURITY,
|
||||
HCI_PENDING_CLASS,
|
||||
};
|
||||
|
||||
/* HCI data types */
|
||||
#define HCI_COMMAND_PKT 0x01
|
||||
#define HCI_ACLDATA_PKT 0x02
|
||||
#define HCI_SCODATA_PKT 0x03
|
||||
#define HCI_EVENT_PKT 0x04
|
||||
#define HCI_VENDOR_PKT 0xff
|
||||
|
||||
#define HCI_MAX_NAME_LENGTH 248
|
||||
#define HCI_MAX_EIR_LENGTH 240
|
||||
|
||||
#define HCI_OP_READ_LOCAL_VERSION 0x1001
|
||||
struct hci_rp_read_local_version {
|
||||
__u8 status;
|
||||
__u8 hci_ver;
|
||||
__le16 hci_rev;
|
||||
__u8 lmp_ver;
|
||||
__le16 manufacturer;
|
||||
__le16 lmp_subver;
|
||||
} __packed;
|
||||
|
||||
#define HCI_EV_CMD_COMPLETE 0x0e
|
||||
struct hci_ev_cmd_complete {
|
||||
__u8 ncmd;
|
||||
__le16 opcode;
|
||||
} __packed;
|
||||
|
||||
/* ---- HCI Packet structures ---- */
|
||||
#define HCI_COMMAND_HDR_SIZE 3
|
||||
#define HCI_EVENT_HDR_SIZE 2
|
||||
#define HCI_ACL_HDR_SIZE 4
|
||||
#define HCI_SCO_HDR_SIZE 3
|
||||
|
||||
struct hci_command_hdr {
|
||||
__le16 opcode; /* OCF & OGF */
|
||||
__u8 plen;
|
||||
} __packed;
|
||||
|
||||
struct hci_event_hdr {
|
||||
__u8 evt;
|
||||
__u8 plen;
|
||||
} __packed;
|
||||
|
||||
struct hci_acl_hdr {
|
||||
__le16 handle; /* Handle & Flags(PB, BC) */
|
||||
__le16 dlen;
|
||||
} __packed;
|
||||
|
||||
struct hci_sco_hdr {
|
||||
__le16 handle;
|
||||
__u8 dlen;
|
||||
} __packed;
|
||||
|
||||
static inline struct hci_event_hdr *hci_event_hdr(const struct sk_buff *skb)
|
||||
{
|
||||
return (struct hci_event_hdr *) skb->data;
|
||||
}
|
||||
|
||||
static inline struct hci_acl_hdr *hci_acl_hdr(const struct sk_buff *skb)
|
||||
{
|
||||
return (struct hci_acl_hdr *) skb->data;
|
||||
}
|
||||
|
||||
static inline struct hci_sco_hdr *hci_sco_hdr(const struct sk_buff *skb)
|
||||
{
|
||||
return (struct hci_sco_hdr *) skb->data;
|
||||
}
|
||||
|
||||
/* ---- HCI Ioctl requests structures ---- */
|
||||
struct hci_dev_stats {
|
||||
__u32 err_rx;
|
||||
__u32 err_tx;
|
||||
__u32 cmd_tx;
|
||||
__u32 evt_rx;
|
||||
__u32 acl_tx;
|
||||
__u32 acl_rx;
|
||||
__u32 sco_tx;
|
||||
__u32 sco_rx;
|
||||
__u32 byte_rx;
|
||||
__u32 byte_tx;
|
||||
};
|
||||
/* AicSemi - Integrate from hci.h end */
|
||||
|
||||
/*****************************************
|
||||
** AicSemi - Integrate from hci_core.h **
|
||||
*****************************************/
|
||||
struct hci_conn_hash {
|
||||
struct list_head list;
|
||||
unsigned int acl_num;
|
||||
unsigned int sco_num;
|
||||
unsigned int le_num;
|
||||
};
|
||||
|
||||
#define HCI_MAX_SHORT_NAME_LENGTH 10
|
||||
|
||||
#define NUM_REASSEMBLY 4
|
||||
struct hci_dev {
|
||||
struct mutex lock;
|
||||
|
||||
char name[8];
|
||||
unsigned long flags;
|
||||
__u16 id;
|
||||
__u8 bus;
|
||||
__u8 dev_type;
|
||||
|
||||
struct sk_buff *reassembly[NUM_REASSEMBLY];
|
||||
|
||||
struct hci_conn_hash conn_hash;
|
||||
|
||||
struct hci_dev_stats stat;
|
||||
|
||||
#if LINUX_VERSION_CODE <= KERNEL_VERSION(3, 4, 0)
|
||||
atomic_t refcnt;
|
||||
struct module *owner;
|
||||
void *driver_data;
|
||||
#endif
|
||||
|
||||
atomic_t promisc;
|
||||
|
||||
struct device *parent;
|
||||
struct device dev;
|
||||
|
||||
unsigned long dev_flags;
|
||||
|
||||
int (*open)(struct hci_dev *hdev);
|
||||
int (*close)(struct hci_dev *hdev);
|
||||
int (*flush)(struct hci_dev *hdev);
|
||||
int (*send)(struct sk_buff *skb);
|
||||
#if LINUX_VERSION_CODE <= KERNEL_VERSION(3, 4, 0)
|
||||
void (*destruct)(struct hci_dev *hdev);
|
||||
#endif
|
||||
#if LINUX_VERSION_CODE > KERNEL_VERSION(3, 7, 1)
|
||||
__u16 voice_setting;
|
||||
#endif
|
||||
void (*notify)(struct hci_dev *hdev, unsigned int evt);
|
||||
int (*ioctl)(struct hci_dev *hdev, unsigned int cmd, unsigned long arg);
|
||||
u8 *align_data;
|
||||
};
|
||||
|
||||
#if LINUX_VERSION_CODE <= KERNEL_VERSION(3, 4, 0)
|
||||
static inline struct hci_dev *__hci_dev_hold(struct hci_dev *d)
|
||||
{
|
||||
atomic_inc(&d->refcnt);
|
||||
return d;
|
||||
}
|
||||
|
||||
static inline void __hci_dev_put(struct hci_dev *d)
|
||||
{
|
||||
if (atomic_dec_and_test(&d->refcnt))
|
||||
d->destruct(d);
|
||||
}
|
||||
#endif
|
||||
|
||||
static inline void *hci_get_drvdata(struct hci_dev *hdev)
|
||||
{
|
||||
return dev_get_drvdata(&hdev->dev);
|
||||
}
|
||||
|
||||
static inline void hci_set_drvdata(struct hci_dev *hdev, void *data)
|
||||
{
|
||||
dev_set_drvdata(&hdev->dev, data);
|
||||
}
|
||||
|
||||
#define SET_HCIDEV_DEV(hdev, pdev) ((hdev)->parent = (pdev))
|
||||
|
||||
|
||||
/* ---- HCI Packet structures ---- */
|
||||
#define HCI_COMMAND_HDR_SIZE 3
|
||||
#define HCI_EVENT_HDR_SIZE 2
|
||||
#define HCI_ACL_HDR_SIZE 4
|
||||
#define HCI_SCO_HDR_SIZE 3
|
||||
|
||||
/* ----- HCI Commands ---- */
|
||||
#define HCI_OP_INQUIRY 0x0401
|
||||
#define HCI_OP_INQUIRY_CANCEL 0x0402
|
||||
#define HCI_OP_EXIT_PERIODIC_INQ 0x0404
|
||||
#define HCI_OP_CREATE_CONN 0x0405
|
||||
#define HCI_OP_DISCONNECT 0x0406
|
||||
#define HCI_OP_ADD_SCO 0x0407
|
||||
#define HCI_OP_CREATE_CONN_CANCEL 0x0408
|
||||
#define HCI_OP_ACCEPT_CONN_REQ 0x0409
|
||||
#define HCI_OP_REJECT_CONN_REQ 0x040a
|
||||
#define HCI_OP_LINK_KEY_REPLY 0x040b
|
||||
#define HCI_OP_LINK_KEY_NEG_REPLY 0x040c
|
||||
#define HCI_OP_PIN_CODE_REPLY 0x040d
|
||||
#define HCI_OP_PIN_CODE_NEG_REPLY 0x040e
|
||||
#define HCI_OP_CHANGE_CONN_PTYPE 0x040f
|
||||
#define HCI_OP_AUTH_REQUESTED 0x0411
|
||||
#define HCI_OP_SET_CONN_ENCRYPT 0x0413
|
||||
#define HCI_OP_CHANGE_CONN_LINK_KEY 0x0415
|
||||
#define HCI_OP_REMOTE_NAME_REQ 0x0419
|
||||
#define HCI_OP_REMOTE_NAME_REQ_CANCEL 0x041a
|
||||
#define HCI_OP_READ_REMOTE_FEATURES 0x041b
|
||||
#define HCI_OP_READ_REMOTE_EXT_FEATURES 0x041c
|
||||
#define HCI_OP_READ_REMOTE_VERSION 0x041d
|
||||
#define HCI_OP_SETUP_SYNC_CONN 0x0428
|
||||
#define HCI_OP_ACCEPT_SYNC_CONN_REQ 0x0429
|
||||
#define HCI_OP_REJECT_SYNC_CONN_REQ 0x042a
|
||||
#define HCI_OP_SNIFF_MODE 0x0803
|
||||
#define HCI_OP_EXIT_SNIFF_MODE 0x0804
|
||||
#define HCI_OP_ROLE_DISCOVERY 0x0809
|
||||
#define HCI_OP_SWITCH_ROLE 0x080b
|
||||
#define HCI_OP_READ_LINK_POLICY 0x080c
|
||||
#define HCI_OP_WRITE_LINK_POLICY 0x080d
|
||||
#define HCI_OP_READ_DEF_LINK_POLICY 0x080e
|
||||
#define HCI_OP_WRITE_DEF_LINK_POLICY 0x080f
|
||||
#define HCI_OP_SNIFF_SUBRATE 0x0811
|
||||
#define HCI_OP_Write_Link_Policy_Settings 0x080d
|
||||
#define HCI_OP_SET_EVENT_MASK 0x0c01
|
||||
#define HCI_OP_RESET 0x0c03
|
||||
#define HCI_OP_SET_EVENT_FLT 0x0c05
|
||||
#define HCI_OP_Write_Extended_Inquiry_Response 0x0c52
|
||||
#define HCI_OP_Write_Simple_Pairing_Mode 0x0c56
|
||||
#define HCI_OP_Read_Buffer_Size 0x1005
|
||||
#define HCI_OP_Host_Buffer_Size 0x0c33
|
||||
#define HCI_OP_Read_Local_Version_Information 0x1001
|
||||
#define HCI_OP_Read_BD_ADDR 0x1009
|
||||
#define HCI_OP_Read_Local_Supported_Commands 0x1002
|
||||
#define HCI_OP_Write_Scan_Enable 0x0c1a
|
||||
#define HCI_OP_Write_Current_IAC_LAP 0x0c3a
|
||||
#define HCI_OP_Write_Inquiry_Scan_Activity 0x0c1e
|
||||
#define HCI_OP_Write_Class_of_Device 0x0c24
|
||||
#define HCI_OP_LE_Rand 0x2018
|
||||
#define HCI_OP_LE_Set_Random_Address 0x2005
|
||||
#define HCI_OP_LE_Set_Extended_Scan_Enable 0x2042
|
||||
#define HCI_OP_LE_Set_Extended_Scan_Parameters 0x2041
|
||||
#define HCI_OP_Set_Event_Filter 0x0c05
|
||||
#define HCI_OP_Write_Voice_Setting 0x0c26
|
||||
#define HCI_OP_Change_Local_Name 0x0c13
|
||||
#define HCI_OP_Read_Local_Name 0x0c14
|
||||
#define HCI_OP_Wirte_Page_Timeout 0x0c18
|
||||
#define HCI_OP_LE_Clear_Resolving_List 0x0c29
|
||||
#define HCI_OP_LE_Set_Addres_Resolution_Enable_Command 0x0c2e
|
||||
#define HCI_OP_Write_Inquiry_mode 0x0c45
|
||||
#define HCI_OP_Write_Page_Scan_Type 0x0c47
|
||||
#define HCI_OP_Write_Inquiry_Scan_Type 0x0c43
|
||||
|
||||
#define HCI_OP_Delete_Stored_Link_Key 0x0c12
|
||||
#define HCI_OP_LE_Read_Local_Resolvable_Address 0x202d
|
||||
#define HCI_OP_LE_Extended_Create_Connection 0x2043
|
||||
#define HCI_OP_Read_Remote_Version_Information 0x041d
|
||||
#define HCI_OP_LE_Start_Encryption 0x2019
|
||||
#define HCI_OP_LE_Add_Device_to_Resolving_List 0x2027
|
||||
#define HCI_OP_LE_Set_Privacy_Mode 0x204e
|
||||
#define HCI_OP_LE_Connection_Update 0x2013
|
||||
|
||||
/* ----- HCI events---- */
|
||||
#define HCI_OP_DISCONNECT 0x0406
|
||||
#define HCI_EV_INQUIRY_COMPLETE 0x01
|
||||
#define HCI_EV_INQUIRY_RESULT 0x02
|
||||
#define HCI_EV_CONN_COMPLETE 0x03
|
||||
#define HCI_EV_CONN_REQUEST 0x04
|
||||
#define HCI_EV_DISCONN_COMPLETE 0x05
|
||||
#define HCI_EV_AUTH_COMPLETE 0x06
|
||||
#define HCI_EV_REMOTE_NAME 0x07
|
||||
#define HCI_EV_ENCRYPT_CHANGE 0x08
|
||||
#define HCI_EV_CHANGE_LINK_KEY_COMPLETE 0x09
|
||||
|
||||
#define HCI_EV_REMOTE_FEATURES 0x0b
|
||||
#define HCI_EV_REMOTE_VERSION 0x0c
|
||||
#define HCI_EV_QOS_SETUP_COMPLETE 0x0d
|
||||
#define HCI_EV_CMD_COMPLETE 0x0e
|
||||
#define HCI_EV_CMD_STATUS 0x0f
|
||||
|
||||
#define HCI_EV_ROLE_CHANGE 0x12
|
||||
#define HCI_EV_NUM_COMP_PKTS 0x13
|
||||
#define HCI_EV_MODE_CHANGE 0x14
|
||||
#define HCI_EV_PIN_CODE_REQ 0x16
|
||||
#define HCI_EV_LINK_KEY_REQ 0x17
|
||||
#define HCI_EV_LINK_KEY_NOTIFY 0x18
|
||||
#define HCI_EV_CLOCK_OFFSET 0x1c
|
||||
#define HCI_EV_PKT_TYPE_CHANGE 0x1d
|
||||
#define HCI_EV_PSCAN_REP_MODE 0x20
|
||||
|
||||
#define HCI_EV_INQUIRY_RESULT_WITH_RSSI 0x22
|
||||
#define HCI_EV_REMOTE_EXT_FEATURES 0x23
|
||||
#define HCI_EV_SYNC_CONN_COMPLETE 0x2c
|
||||
#define HCI_EV_SYNC_CONN_CHANGED 0x2d
|
||||
#define HCI_EV_SNIFF_SUBRATE 0x2e
|
||||
#define HCI_EV_EXTENDED_INQUIRY_RESULT 0x2f
|
||||
#define HCI_EV_IO_CAPA_REQUEST 0x31
|
||||
#define HCI_EV_SIMPLE_PAIR_COMPLETE 0x36
|
||||
#define HCI_EV_REMOTE_HOST_FEATURES 0x3d
|
||||
#define HCI_EV_LE_Meta 0x3e
|
||||
|
||||
/* ULP Event sub code */
|
||||
#define HCI_BLE_CONN_COMPLETE_EVT 0x01
|
||||
#define HCI_BLE_ADV_PKT_RPT_EVT 0x02
|
||||
#define HCI_BLE_LL_CONN_PARAM_UPD_EVT 0x03
|
||||
#define HCI_BLE_READ_REMOTE_FEAT_CMPL_EVT 0x04
|
||||
#define HCI_BLE_LTK_REQ_EVT 0x05
|
||||
#define HCI_BLE_RC_PARAM_REQ_EVT 0x06
|
||||
#define HCI_BLE_DATA_LENGTH_CHANGE_EVT 0x07
|
||||
#define HCI_BLE_ENHANCED_CONN_COMPLETE_EVT 0x0a
|
||||
#define HCI_BLE_DIRECT_ADV_EVT 0x0b
|
||||
#define HCI_BLE_PHY_UPDATE_COMPLETE_EVT 0x0c
|
||||
#define HCI_LE_EXTENDED_ADVERTISING_REPORT_EVT 0x0D
|
||||
#define HCI_BLE_PERIODIC_ADV_SYNC_EST_EVT 0x0E
|
||||
#define HCI_BLE_PERIODIC_ADV_REPORT_EVT 0x0F
|
||||
#define HCI_BLE_PERIODIC_ADV_SYNC_LOST_EVT 0x10
|
||||
#define HCI_BLE_SCAN_TIMEOUT_EVT 0x11
|
||||
#define HCI_LE_ADVERTISING_SET_TERMINATED_EVT 0x12
|
||||
#define HCI_BLE_SCAN_REQ_RX_EVT 0x13
|
||||
#define HCI_BLE_CIS_EST_EVT 0x19
|
||||
#define HCI_BLE_CIS_REQ_EVT 0x1a
|
||||
#define HCI_BLE_CREATE_BIG_CPL_EVT 0x1b
|
||||
#define HCI_BLE_TERM_BIG_CPL_EVT 0x1c
|
||||
#define HCI_BLE_BIG_SYNC_EST_EVT 0x1d
|
||||
#define HCI_BLE_BIG_SYNC_LOST_EVT 0x1e
|
||||
#define HCI_BLE_REQ_PEER_SCA_CPL_EVT 0x1f
|
||||
|
||||
#define HCI_VENDOR_SPECIFIC_EVT 0xFF /* Vendor specific events */
|
||||
|
||||
#define CONFIG_MAC_OFFSET_GEN_1_2 (0x3C) //MAC's OFFSET in config/efuse for aic generation 1~2 bluetooth chip
|
||||
#define CONFIG_MAC_OFFSET_GEN_3PLUS (0x44) //MAC's OFFSET in config/efuse for aic generation 3+ bluetooth chip
|
||||
|
||||
//Define ioctl cmd the same as HCIDEVUP in the kernel
|
||||
#define DOWN_FW_CFG _IOW('E', 176, int)
|
||||
//#ifdef CONFIG_SCO_OVER_HCI
|
||||
//#define SET_ISO_CFG _IOW('H', 202, int)
|
||||
//#else
|
||||
#define SET_ISO_CFG _IOW('E', 177, int)
|
||||
//#endif
|
||||
#define RESET_CONTROLLER _IOW('E', 178, int)
|
||||
#define DWFW_CMPLT _IOW('E', 179, int)
|
||||
|
||||
#define GET_USB_INFO _IOR('E', 180, int)
|
||||
|
||||
void bt_data_dump(char* tag, void* data, unsigned long len);
|
||||
int aic_enqueue(struct sk_buff *skb);
|
||||
int aic_queue_cnt(void);
|
||||
int bt_sdio_recv(u8 *data,u32 data_len);
|
||||
|
||||
|
||||
int btchr_init(void);
|
||||
void btchr_exit(void);
|
||||
int hdev_init(void);
|
||||
void hdev_exit(void);
|
||||
|
||||
|
||||
struct hci_dev *hci_dev_get(int index);
|
||||
int hci_recv_fragment(struct hci_dev *hdev, int type, void *data, int count);
|
||||
|
||||
#endif//_AICWF_SDIO_BT_H_
|
||||
|
||||
1776
sysdrv/drv_ko/wifi/aic8800dc/aic8800_fdrv/aic_priv_cmd.c
Executable file
1776
sysdrv/drv_ko/wifi/aic8800dc/aic8800_fdrv/aic_priv_cmd.c
Executable file
File diff suppressed because it is too large
Load Diff
33
sysdrv/drv_ko/wifi/aic8800dc/aic8800_fdrv/aic_priv_cmd.h
Executable file
33
sysdrv/drv_ko/wifi/aic8800dc/aic8800_fdrv/aic_priv_cmd.h
Executable file
|
|
@ -0,0 +1,33 @@
|
|||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file private_cmd.h
|
||||
*
|
||||
* Copyright (C) Aicsemi 2018-2024
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef _AIC_PRIV_CMD_H_
|
||||
#define _AIC_PRIV_CMD_H_
|
||||
|
||||
#include "rwnx_defs.h"
|
||||
|
||||
typedef struct _android_wifi_priv_cmd {
|
||||
char *buf;
|
||||
int used_len;
|
||||
int total_len;
|
||||
} android_wifi_priv_cmd;
|
||||
|
||||
#ifdef CONFIG_COMPAT
|
||||
typedef struct _compat_android_wifi_priv_cmd {
|
||||
compat_caddr_t buf;
|
||||
int used_len;
|
||||
int total_len;
|
||||
} compat_android_wifi_priv_cmd;
|
||||
#endif /* CONFIG_COMPAT */
|
||||
|
||||
int android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd);
|
||||
|
||||
#endif /* _AIC_PRIV_CMD_H_ */
|
||||
|
||||
|
|
@ -27,6 +27,15 @@ static struct wifi_ring_buffer_status ring_buffer[] = {
|
|||
static struct wlan_driver_wake_reason_cnt_t wake_reason_cnt = {
|
||||
.total_cmd_event_wake = 10,
|
||||
};
|
||||
|
||||
enum apf_attributes {
|
||||
APF_ATTRIBUTE_VERSION,
|
||||
APF_ATTRIBUTE_MAX_LEN,
|
||||
APF_ATTRIBUTE_PROGRAM,
|
||||
APF_ATTRIBUTE_PROGRAM_LEN,
|
||||
APF_ATTRIBUTE_MAX
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
int aic_dev_start_mkeep_alive(struct rwnx_hw *rwnx_hw, struct rwnx_vif *rwnx_vif,
|
||||
|
|
@ -578,7 +587,69 @@ out_put_fail:
|
|||
return -EMSGSIZE;
|
||||
}
|
||||
|
||||
static int aicwf_vendor_apf_subcmd_get_capabilities(struct wiphy *wiphy, struct wireless_dev *wdev,
|
||||
static int aicwf_vendor_logger_get_tx_pkt_fates(struct wiphy *wiphy, struct wireless_dev *wdev,
|
||||
const void *data, int len)
|
||||
{
|
||||
#if 0
|
||||
int ret = 0, rem, type;
|
||||
const struct nlattr *iter;
|
||||
int fate_num;
|
||||
int fate_data;
|
||||
|
||||
AICWFDBG(LOGDEBUG, "%s Enter\r\n", __func__);
|
||||
nla_for_each_attr(iter, data, len, rem) {
|
||||
type = nla_type(iter);
|
||||
switch (type) {
|
||||
case LOGGER_ATTRIBUTE_PKT_FATE_NUM:
|
||||
fate_num = nla_get_u32(iter);
|
||||
break;
|
||||
case LOGGER_ATTRIBUTE_PKT_FATE_DATA:
|
||||
fate_data = nla_get_u64(iter);
|
||||
break;
|
||||
default:
|
||||
AICWFDBG(LOGERROR, "%s(%d), Unknown type: %d\n", __func__, __LINE__, type);
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
/* TODO
|
||||
* Add handle in the future
|
||||
*/
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int aicwf_vendor_logger_get_rx_pkt_fates(struct wiphy *wiphy, struct wireless_dev *wdev,
|
||||
const void *data, int len)
|
||||
{
|
||||
#if 0
|
||||
int ret = 0, rem, type;
|
||||
const struct nlattr *iter;
|
||||
int fate_num;
|
||||
int fate_data;
|
||||
|
||||
AICWFDBG(LOGDEBUG, "%s Enter\r\n", __func__);
|
||||
nla_for_each_attr(iter, data, len, rem) {
|
||||
type = nla_type(iter);
|
||||
switch (type) {
|
||||
case LOGGER_ATTRIBUTE_PKT_FATE_NUM:
|
||||
fate_num = nla_get_u32(iter);
|
||||
break;
|
||||
case LOGGER_ATTRIBUTE_PKT_FATE_DATA:
|
||||
fate_data = nla_get_u64(iter);
|
||||
break;
|
||||
default:
|
||||
AICWFDBG(LOGERROR, "%s(%d), Unknown type: %d\n", __func__, __LINE__, type);
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
/* TODO
|
||||
* Add handle in the future
|
||||
*/
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int aicwf_vendor_logger_start_pkt_fate_monitoring(struct wiphy *wiphy, struct wireless_dev *wdev,
|
||||
const void *data, int len)
|
||||
{
|
||||
/* TODO
|
||||
|
|
@ -587,6 +658,44 @@ static int aicwf_vendor_apf_subcmd_get_capabilities(struct wiphy *wiphy, struct
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int aicwf_vendor_apf_subcmd_get_capabilities(struct wiphy *wiphy, struct wireless_dev *wdev,
|
||||
const void *data, int len)
|
||||
{
|
||||
int ver, max_len;
|
||||
int ret = 0;
|
||||
struct sk_buff *skb = NULL;
|
||||
|
||||
/* APF version */
|
||||
ver = 4;
|
||||
/* APF memory size limit */
|
||||
max_len = 2048;
|
||||
|
||||
|
||||
skb = cfg80211_vendor_cmd_alloc_reply_skb(wiphy, max_len);
|
||||
|
||||
ret = nla_put_u32(skb, APF_ATTRIBUTE_VERSION, ver);
|
||||
if (ret < 0) {
|
||||
AICWFDBG(LOGERROR, "Failed to put APF_ATTRIBUTE_VERSION, ret:%d\n", ret);
|
||||
goto fail;
|
||||
}
|
||||
ret = nla_put_u32(skb, APF_ATTRIBUTE_MAX_LEN, max_len);
|
||||
if (ret < 0) {
|
||||
AICWFDBG(LOGERROR, "Failed to put APF_ATTRIBUTE_MAX_LEN, ret:%d\n", ret);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
ret = cfg80211_vendor_cmd_reply(skb);
|
||||
if (unlikely(ret)) {
|
||||
AICWFDBG(LOGERROR, "vendor command reply failed, ret=%d\n", ret);
|
||||
}
|
||||
|
||||
fail:
|
||||
/* TODO
|
||||
* Add handle in the future
|
||||
*/
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int aicwf_vendor_sub_cmd_set_mac(struct wiphy *wiphy, struct wireless_dev *wdev,
|
||||
const void *data, int len)
|
||||
{
|
||||
|
|
@ -855,6 +964,48 @@ const struct wiphy_vendor_command aicwf_vendor_cmd[] = {
|
|||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0)
|
||||
.dumpit = aicwf_dump_interface,
|
||||
#endif
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 3, 0)
|
||||
.policy = VENDOR_CMD_RAW_DATA,
|
||||
#endif
|
||||
},
|
||||
{
|
||||
{
|
||||
.vendor_id = GOOGLE_OUI,
|
||||
.subcmd = LOGGER_START_PKT_FATE_MONITORING
|
||||
},
|
||||
.flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
|
||||
.doit = aicwf_vendor_logger_start_pkt_fate_monitoring,
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0)
|
||||
.dumpit = aicwf_dump_interface,
|
||||
#endif
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 3, 0)
|
||||
.policy = VENDOR_CMD_RAW_DATA,
|
||||
#endif
|
||||
},
|
||||
{
|
||||
{
|
||||
.vendor_id = GOOGLE_OUI,
|
||||
.subcmd = LOGGER_GET_TX_PKT_FATES
|
||||
},
|
||||
.flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
|
||||
.doit = aicwf_vendor_logger_get_tx_pkt_fates,
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0)
|
||||
.dumpit = aicwf_dump_interface,
|
||||
#endif
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 3, 0)
|
||||
.policy = VENDOR_CMD_RAW_DATA,
|
||||
#endif
|
||||
},
|
||||
{
|
||||
{
|
||||
.vendor_id = GOOGLE_OUI,
|
||||
.subcmd = LOGGER_GET_RX_PKT_FATES
|
||||
},
|
||||
.flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
|
||||
.doit = aicwf_vendor_logger_get_rx_pkt_fates,
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0)
|
||||
.dumpit = aicwf_dump_interface,
|
||||
#endif
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 3, 0)
|
||||
.policy = VENDOR_CMD_RAW_DATA,
|
||||
#endif
|
||||
|
|
@ -889,6 +1040,7 @@ const struct wiphy_vendor_command aicwf_vendor_cmd[] = {
|
|||
.maxattr = WIFI_VENDOR_ATTR_DRIVER_MAX,
|
||||
#endif
|
||||
},
|
||||
|
||||
};
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -20,15 +20,17 @@ int aicwf_set_rf_config_8800d80(struct rwnx_hw *rwnx_hw, struct mm_set_rf_calib_
|
|||
return -1;
|
||||
}
|
||||
|
||||
if ((ret = rwnx_send_txpwr_lvl_adj_req(rwnx_hw))) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ((ret = rwnx_send_txpwr_ofst2x_req(rwnx_hw))) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (testmode == 0) {
|
||||
if ((ret = rwnx_send_rf_calib_req(rwnx_hw, cfm))) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0 ;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ void rwnx_plat_userconfig_parsing2(char *buffer, int size);
|
|||
|
||||
void rwnx_release_firmware_common(u32** buffer);
|
||||
|
||||
#if !defined(CONFIG_EXT_FEM_8800DCDW)
|
||||
u32 wifi_txgain_table_24g_8800dcdw[32] =
|
||||
{
|
||||
0xA4B22189, //index 0
|
||||
|
|
@ -160,6 +161,80 @@ u32 wifi_txgain_table_24g_1_8800dcdw_h[32] =
|
|||
0x00001825,
|
||||
};
|
||||
|
||||
#else /* #ifdef CONFIG_EXT_FEM_8800DCDW */
|
||||
// ofdm
|
||||
uint32_t wifi_txgain_table_24g_8800dcdw_femkct[32] = {
|
||||
0x919221C2, //index 0
|
||||
0x00007825,
|
||||
0x899221C3, //index 1
|
||||
0x00007825,
|
||||
0x8B9221C3, //index 2
|
||||
0x00007825,
|
||||
0x929221C3, //index 3
|
||||
0x00007825,
|
||||
0x949221C4, //index 4
|
||||
0x00007825,
|
||||
0x969221C4, //index 5
|
||||
0x00007825,
|
||||
0x949221C6, //index 6
|
||||
0x00007825,
|
||||
0x949221C8, //index 7
|
||||
0x00007825,
|
||||
0x9C9221C8, //index 8
|
||||
0x00007825,
|
||||
0x9C9221CA, //index 9
|
||||
0x00007825,
|
||||
0x9C9221CB, //index 10
|
||||
0x00007825,
|
||||
0x939221D5, //index 11
|
||||
0x00007825,
|
||||
0x9B9221D7, //index 12
|
||||
0x00007825,
|
||||
0xA49221D7, //index 13
|
||||
0x00007825,
|
||||
0xA79221D7, //index 14
|
||||
0x00007825,
|
||||
0xBD9221D7, //index 15
|
||||
0x00007825,
|
||||
};
|
||||
|
||||
// 11b
|
||||
uint32_t wifi_txgain_table_24g_1_8800dcdw_femkct[32] = {
|
||||
0x836E20C2, //index 0
|
||||
0x00003024,
|
||||
0x856E20C2, //index 1
|
||||
0x00003024,
|
||||
0x826E20C3, //index 2
|
||||
0x00003024,
|
||||
0x836E20C3, //index 3
|
||||
0x00003024,
|
||||
0x856E20C3, //index 4
|
||||
0x00003024,
|
||||
0x876E20C3, //index 5
|
||||
0x00003024,
|
||||
0x8B6E20C3, //index 6
|
||||
0x00003024,
|
||||
0x926E20C4, //index 7
|
||||
0x00003024,
|
||||
0x9A6E20C4, //index 8
|
||||
0x00003024,
|
||||
0x936E20C5, //index 9
|
||||
0x00003024,
|
||||
0x936E20C7, //index 10
|
||||
0x00003024,
|
||||
0xA16E20C8, //index 11
|
||||
0x00003024,
|
||||
0xA16E20CA, //index 12
|
||||
0x00003024,
|
||||
0xA26E20CB, //index 13
|
||||
0x00003024,
|
||||
0xAA6E20CD, //index 14
|
||||
0x00003024,
|
||||
0xAC7220CF, //index 15
|
||||
0x00003024,
|
||||
};
|
||||
#endif
|
||||
|
||||
u32 wifi_rxgain_table_24g_20m_8800dcdw[64] = {
|
||||
0x82f282d1,//index 0
|
||||
0x9591a324,
|
||||
|
|
@ -423,6 +498,7 @@ int aicwf_set_rf_config_8800dc(struct rwnx_hw *rwnx_hw, struct mm_set_rf_calib_c
|
|||
|
||||
|
||||
if (testmode == 0) {
|
||||
#if !defined(CONFIG_EXT_FEM_8800DCDW)
|
||||
if (IS_CHIP_ID_H()) {
|
||||
if ((ret = rwnx_send_rf_config_req(rwnx_hw, 0, 1, (u8_l *)wifi_txgain_table_24g_8800dcdw_h, 128)))
|
||||
return -1;
|
||||
|
|
@ -436,6 +512,18 @@ int aicwf_set_rf_config_8800dc(struct rwnx_hw *rwnx_hw, struct mm_set_rf_calib_c
|
|||
if ((ret = rwnx_send_rf_config_req(rwnx_hw, 16, 1, (u8_l *)wifi_txgain_table_24g_1_8800dcdw, 128)))
|
||||
return -1;
|
||||
}
|
||||
#else /* #ifdef CONFIG_EXT_FEM_8800DCDW */
|
||||
{
|
||||
ret = rwnx_send_rf_config_req(rwnx_hw, 0, 1, (u8_l *)wifi_txgain_table_24g_8800dcdw_femkct, 128);
|
||||
if (ret) {
|
||||
return -1;
|
||||
}
|
||||
ret = rwnx_send_rf_config_req(rwnx_hw, 16, 1, (u8_l *)wifi_txgain_table_24g_1_8800dcdw_femkct, 128);
|
||||
if (ret) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if ((ret = rwnx_send_rf_config_req(rwnx_hw, 0, 0, (u8_l *)wifi_rxgain_table_24g_20m_8800dcdw, 256)))
|
||||
return -1;
|
||||
|
|
|
|||
|
|
@ -20,6 +20,8 @@ void rwnx_data_dump(char* tag, void* data, unsigned long len);
|
|||
|
||||
#define AICWF_LOG "AICWFDBG("
|
||||
|
||||
|
||||
#ifdef DEBUG
|
||||
#define AICWFDBG(level, args, arg...) \
|
||||
do { \
|
||||
if (aicwf_dbg_level & level) { \
|
||||
|
|
@ -33,8 +35,12 @@ do { \
|
|||
printk(AICWF_LOG"LOGTRACE)\t"fmt , ##__VA_ARGS__); \
|
||||
} \
|
||||
} while (0)
|
||||
#else
|
||||
|
||||
#define AICWFDBG(level, args, arg...)
|
||||
#define RWNX_DBG(fmt, ...)
|
||||
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
#define RWNX_DBG(fmt, ...) \
|
||||
|
|
|
|||
|
|
@ -57,6 +57,13 @@ struct proc_dir_entry *wifi_suspend_node;
|
|||
int tx_aggr_counter = 32;
|
||||
module_param_named(tx_aggr_counter, tx_aggr_counter, int, 0644);
|
||||
|
||||
#ifdef CONFIG_TX_NETIF_FLOWCTRL
|
||||
int tx_fc_low_water = AICWF_SDIO_TX_LOW_WATER;
|
||||
module_param_named(tx_fc_low_water, tx_fc_low_water, int, 0644);
|
||||
|
||||
int tx_fc_high_water = AICWF_SDIO_TX_HIGH_WATER;
|
||||
module_param_named(tx_fc_high_water, tx_fc_high_water, int, 0644);
|
||||
#endif
|
||||
|
||||
int aicwf_sdio_readb(struct aic_sdio_dev *sdiodev, uint regaddr, u8 *val)
|
||||
{
|
||||
|
|
@ -76,6 +83,21 @@ int aicwf_sdio_writeb(struct aic_sdio_dev *sdiodev, uint regaddr, u8 val)
|
|||
return ret;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_TX_NETIF_FLOWCTRL
|
||||
void aicwf_sdio_tx_netif_flowctrl(struct rwnx_hw *rwnx_hw, bool state)
|
||||
{
|
||||
struct rwnx_vif *rwnx_vif;
|
||||
list_for_each_entry(rwnx_vif, &rwnx_hw->vifs, list) {
|
||||
if (! rwnx_vif->up)
|
||||
continue;
|
||||
if (state)
|
||||
netif_tx_stop_all_queues(rwnx_vif->ndev);//netif_stop_queue(rwnx_vif->ndev);
|
||||
else
|
||||
netif_tx_wake_all_queues(rwnx_vif->ndev);//netif_wake_queue(rwnx_vif->ndev);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
int aicwf_sdio_flow_ctrl_msg(struct aic_sdio_dev *sdiodev)
|
||||
{
|
||||
int ret = -1;
|
||||
|
|
@ -398,7 +420,9 @@ static int rwnx_register_hostwake_irq(struct device *dev)
|
|||
//ws_rx_sdio = wakeup_source_register(dev, "wifi_rx_sleep");
|
||||
//ws_sdio_pwrctrl = wakeup_source_register(dev, "sdio_pwrctrl_sleep");
|
||||
#else
|
||||
#ifdef ANDROID_PLATFORM
|
||||
wake_lock_init(&irq_wakelock, WAKE_LOCK_SUSPEND, "wifisleep");
|
||||
#endif
|
||||
#endif
|
||||
ret = device_init_wakeup(dev, true);
|
||||
if (ret < 0) {
|
||||
|
|
@ -442,8 +466,10 @@ fail1:
|
|||
//wakeup_source_unregister(ws_rx_sdio);
|
||||
//wakeup_source_unregister(ws_sdio_pwrctrl);
|
||||
#else
|
||||
#ifdef ANDROID_PLATFORM
|
||||
wake_lock_destroy(&irq_wakelock);
|
||||
#endif
|
||||
#endif
|
||||
#endif//CONFIG_GPIO_WAKEUP
|
||||
return ret;
|
||||
}
|
||||
|
|
@ -681,6 +707,7 @@ void aicwf_sdio_remove_(struct sdio_func *func){
|
|||
aicwf_sdio_remove(func);
|
||||
}
|
||||
|
||||
#ifdef SDIO_REMOVEABLE
|
||||
static int aicwf_sdio_suspend(struct device *dev)
|
||||
{
|
||||
int ret = 0;
|
||||
|
|
@ -764,11 +791,6 @@ static int aicwf_sdio_resume(struct device *dev)
|
|||
aicwf_sdio_pwr_stctl(sdiodev, SDIO_ACTIVE_ST);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_WIFI_SUSPEND_FOR_LINUX
|
||||
rwnx_set_wifi_suspend('0');
|
||||
#endif//CONFIG_WIFI_SUSPEND_FOR_LINUX
|
||||
|
||||
|
||||
// aicwf_sdio_hal_irqhandler(sdiodev->func);
|
||||
|
||||
#if defined(CONFIG_PLATFORM_ROCKCHIP) || defined(CONFIG_PLATFORM_ROCKCHIP2)
|
||||
|
|
@ -786,10 +808,15 @@ static int aicwf_sdio_resume(struct device *dev)
|
|||
#endif
|
||||
atomic_set(&sdiodev->is_bus_suspend, 0);
|
||||
// smp_mb();
|
||||
#ifdef CONFIG_WIFI_SUSPEND_FOR_LINUX
|
||||
rwnx_set_wifi_suspend('0');
|
||||
#endif//CONFIG_WIFI_SUSPEND_FOR_LINUX
|
||||
|
||||
|
||||
sdio_dbg("%s exit\n", __func__);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
static const struct sdio_device_id aicwf_sdmmc_ids[] = {
|
||||
{SDIO_DEVICE(SDIO_VENDOR_ID_AIC8801, SDIO_DEVICE_ID_AIC8801)},
|
||||
|
|
@ -1259,6 +1286,9 @@ static int aicwf_sdio_tx_msg(struct aic_sdio_dev *sdiodev)
|
|||
static void aicwf_sdio_tx_process(struct aic_sdio_dev *sdiodev)
|
||||
{
|
||||
int err = 0;
|
||||
#ifdef CONFIG_TX_NETIF_FLOWCTRL
|
||||
unsigned long flags;
|
||||
#endif
|
||||
|
||||
if (sdiodev->bus_if->state == BUS_DOWN_ST) {
|
||||
sdio_err("Bus is down\n");
|
||||
|
|
@ -1323,6 +1353,19 @@ static void aicwf_sdio_tx_process(struct aic_sdio_dev *sdiodev)
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef CONFIG_TX_NETIF_FLOWCTRL
|
||||
spin_lock_irqsave(&sdiodev->tx_flow_lock, flags);
|
||||
if (atomic_read(&sdiodev->tx_priv->tx_pktcnt) < tx_fc_low_water) {
|
||||
//printk("sdiodev->tx_priv->tx_pktcnt < tx_fc_low_water:%d %d\r\n",
|
||||
// atomic_read(&sdiodev->tx_priv->tx_pktcnt), tx_fc_low_water);
|
||||
if (sdiodev->flowctrl) {
|
||||
sdiodev->flowctrl = 0;
|
||||
aicwf_sdio_tx_netif_flowctrl(sdiodev->rwnx_hw, false);
|
||||
}
|
||||
}
|
||||
spin_unlock_irqrestore(&sdiodev->tx_flow_lock, flags);
|
||||
#endif
|
||||
|
||||
up(&sdiodev->tx_priv->txctl_sema);
|
||||
}
|
||||
|
||||
|
|
@ -1334,6 +1377,9 @@ static int aicwf_sdio_bus_txdata(struct device *dev, struct sk_buff *pkt)
|
|||
int headroom = 0;
|
||||
struct aicwf_bus *bus_if = dev_get_drvdata(dev);
|
||||
struct aic_sdio_dev *sdiodev = bus_if->bus_priv.sdio;
|
||||
#ifdef CONFIG_TX_NETIF_FLOWCTRL
|
||||
unsigned long flags;
|
||||
#endif
|
||||
|
||||
if (bus_if->state == BUS_DOWN_ST) {
|
||||
sdio_err("bus_if stopped\n");
|
||||
|
|
@ -1355,6 +1401,7 @@ static int aicwf_sdio_bus_txdata(struct device *dev, struct sk_buff *pkt)
|
|||
consume_skb(pkt);
|
||||
spin_unlock_bh(&sdiodev->tx_priv->txqlock);
|
||||
return -ENOSR;
|
||||
goto flowctrl;
|
||||
} else {
|
||||
ret = 0;
|
||||
}
|
||||
|
|
@ -1363,6 +1410,20 @@ static int aicwf_sdio_bus_txdata(struct device *dev, struct sk_buff *pkt)
|
|||
spin_unlock_bh(&sdiodev->tx_priv->txqlock);
|
||||
complete(&bus_if->bustx_trgg);
|
||||
|
||||
flowctrl:
|
||||
#ifdef CONFIG_TX_NETIF_FLOWCTRL
|
||||
spin_lock_irqsave(&sdiodev->tx_flow_lock, flags);
|
||||
if (atomic_read(&sdiodev->tx_priv->tx_pktcnt) >= tx_fc_high_water) {
|
||||
//printk("sdiodev->tx_priv->tx_pktcnt >= tx_fc_high_water:%d %d\r\n",
|
||||
// atomic_read(&sdiodev->tx_priv->tx_pktcnt), tx_fc_high_water);
|
||||
if (!sdiodev->flowctrl) {
|
||||
sdiodev->flowctrl = 1;
|
||||
aicwf_sdio_tx_netif_flowctrl(sdiodev->rwnx_hw, true);
|
||||
}
|
||||
}
|
||||
spin_unlock_irqrestore(&sdiodev->tx_flow_lock, flags);
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -1407,6 +1468,9 @@ int aicwf_sdio_send(struct aicwf_tx_priv *tx_priv, u8 txnow)
|
|||
struct sk_buff *pkt;
|
||||
struct aic_sdio_dev *sdiodev = tx_priv->sdiodev;
|
||||
u32 aggr_len = 0;
|
||||
#ifdef CONFIG_TX_NETIF_FLOWCTRL
|
||||
unsigned long flags;
|
||||
#endif
|
||||
|
||||
aggr_len = (tx_priv->tail - tx_priv->head);
|
||||
if (((atomic_read(&tx_priv->aggr_count) == 0) && (aggr_len != 0))
|
||||
|
|
@ -1432,6 +1496,19 @@ int aicwf_sdio_send(struct aicwf_tx_priv *tx_priv, u8 txnow)
|
|||
atomic_dec(&sdiodev->tx_priv->tx_pktcnt);
|
||||
spin_unlock_bh(&sdiodev->tx_priv->txqlock);
|
||||
|
||||
#ifdef CONFIG_TX_NETIF_FLOWCTRL
|
||||
spin_lock_irqsave(&sdiodev->tx_flow_lock, flags);
|
||||
if (atomic_read(&sdiodev->tx_priv->tx_pktcnt) < tx_fc_low_water) {
|
||||
//printk("sdiodev->tx_priv->tx_pktcnt < tx_fc_low_water:%d %d\r\n",
|
||||
// atomic_read(&sdiodev->tx_priv->tx_pktcnt), tx_fc_low_water);
|
||||
if (sdiodev->flowctrl) {
|
||||
sdiodev->flowctrl = 0;
|
||||
aicwf_sdio_tx_netif_flowctrl(sdiodev->rwnx_hw, false);
|
||||
}
|
||||
}
|
||||
spin_unlock_irqrestore(&sdiodev->tx_flow_lock, flags);
|
||||
#endif
|
||||
|
||||
if (tx_priv == NULL || tx_priv->tail == NULL || pkt == NULL)
|
||||
txrx_err("null error\n");
|
||||
if (aicwf_sdio_aggr(tx_priv, pkt)) {
|
||||
|
|
@ -1575,7 +1652,7 @@ static int aicwf_sdio_bus_start(struct device *dev)
|
|||
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0))
|
||||
#include "uapi/linux/sched/types.h"
|
||||
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0))
|
||||
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0))
|
||||
#include "linux/sched/types.h"
|
||||
#else
|
||||
#include "linux/sched/rt.h"
|
||||
|
|
@ -1947,15 +2024,16 @@ void aicwf_sdio_hal_irqhandler(struct sdio_func *func)
|
|||
return;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PREALLOC_RX_SKB
|
||||
if (list_empty(&aic_rx_buff_list.rxbuff_list)) {
|
||||
printk("%s %d, rxbuff list is empty\n", __func__, __LINE__);
|
||||
rwnx_wakeup_unlock(sdiodev->rwnx_hw->ws_irqrx);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (sdiodev->chipid == PRODUCT_ID_AIC8801 || sdiodev->chipid == PRODUCT_ID_AIC8800DC ||
|
||||
sdiodev->chipid == PRODUCT_ID_AIC8800DW) {
|
||||
#ifdef CONFIG_PREALLOC_RX_SKB
|
||||
if (list_empty(&aic_rx_buff_list.rxbuff_list)) {
|
||||
printk("%s %d, rxbuff list is empty\n", __func__, __LINE__);
|
||||
rwnx_wakeup_unlock(sdiodev->rwnx_hw->ws_irqrx);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
ret = aicwf_sdio_readb(sdiodev, sdiodev->sdio_reg.block_cnt_reg, &intstatus);
|
||||
while (ret || (intstatus & SDIO_OTHER_INTERRUPT)) {
|
||||
sdio_err("ret=%d, intstatus=%x\r\n", ret, intstatus);
|
||||
|
|
@ -2081,24 +2159,32 @@ static struct aicwf_bus_ops aicwf_sdio_bus_ops = {
|
|||
void aicwf_sdio_release(struct aic_sdio_dev *sdiodev)
|
||||
{
|
||||
struct aicwf_bus *bus_if;
|
||||
#ifdef CONFIG_OOB
|
||||
int ret;
|
||||
#endif
|
||||
int ret;
|
||||
|
||||
AICWFDBG(LOGINFO, "%s Enter\n", __func__);
|
||||
|
||||
bus_if = dev_get_drvdata(sdiodev->dev);
|
||||
bus_if->state = BUS_DOWN_ST;
|
||||
#ifdef CONFIG_OOB
|
||||
if(sdiodev->oob_enable){
|
||||
sdio_claim_host(sdiodev->func);
|
||||
//disable sdio interrupt
|
||||
ret = aicwf_sdio_writeb(sdiodev, sdiodev->sdio_reg.intr_config_reg, 0x0);
|
||||
if (ret < 0) {
|
||||
AICWFDBG(LOGERROR, "reg:%d write failed!\n", sdiodev->sdio_reg.intr_config_reg);
|
||||
}
|
||||
sdio_release_irq(sdiodev->func);
|
||||
sdio_release_host(sdiodev->func);
|
||||
}
|
||||
if(sdiodev->oob_enable){
|
||||
sdio_claim_host(sdiodev->func);
|
||||
//disable sdio interrupt
|
||||
ret = aicwf_sdio_writeb(sdiodev, sdiodev->sdio_reg.intr_config_reg, 0x0);
|
||||
if (ret < 0) {
|
||||
AICWFDBG(LOGERROR, "reg:%d write failed!\n", sdiodev->sdio_reg.intr_config_reg);
|
||||
}
|
||||
sdio_release_irq(sdiodev->func);
|
||||
sdio_release_host(sdiodev->func);
|
||||
}
|
||||
#else
|
||||
sdio_claim_host(sdiodev->func);
|
||||
//disable sdio interrupt
|
||||
ret = aicwf_sdio_writeb(sdiodev, sdiodev->sdio_reg.intr_config_reg, 0x0);
|
||||
if (ret < 0) {
|
||||
sdio_err("reg:%d write failed!\n", sdiodev->sdio_reg.intr_config_reg);
|
||||
}
|
||||
sdio_release_irq(sdiodev->func);
|
||||
sdio_release_host(sdiodev->func);
|
||||
#endif
|
||||
if (sdiodev->dev)
|
||||
aicwf_bus_deinit(sdiodev->dev);
|
||||
|
|
@ -2404,6 +2490,10 @@ void *aicwf_sdio_bus_init(struct aic_sdio_dev *sdiodev)
|
|||
sdiodev->pwrctl_tsk = NULL;
|
||||
}
|
||||
#endif
|
||||
#ifdef CONFIG_TX_NETIF_FLOWCTRL
|
||||
sdiodev->flowctrl = 0;
|
||||
spin_lock_init(&sdiodev->tx_flow_lock);
|
||||
#endif
|
||||
|
||||
ret = aicwf_bus_init(0, sdiodev->dev);
|
||||
if (ret < 0) {
|
||||
|
|
@ -2457,11 +2547,13 @@ void rwnx_set_wifi_suspend(char onoff){
|
|||
rwnx_send_me_set_lp_level(g_rwnx_plat->sdiodev->rwnx_hw, 0);
|
||||
}else{
|
||||
printk("%s suspend \r\n", __func__);
|
||||
rwnx_send_me_set_lp_level(g_rwnx_plat->sdiodev->rwnx_hw, 1);
|
||||
aicwf_sdio_pwr_stctl(g_rwnx_plat->sdiodev, SDIO_SLEEP_ST);
|
||||
ret = aicwf_sdio_writeb(g_rwnx_plat->sdiodev, SDIOWIFI_WAKEUP_REG, 2);
|
||||
if (ret < 0) {
|
||||
sdio_err("reg:%d write failed!\n", SDIOWIFI_WAKEUP_REG);
|
||||
ret = rwnx_send_me_set_lp_level(g_rwnx_plat->sdiodev->rwnx_hw, 1);
|
||||
if (!ret) {
|
||||
aicwf_sdio_pwr_stctl(g_rwnx_plat->sdiodev, SDIO_SLEEP_ST);
|
||||
ret = aicwf_sdio_writeb(g_rwnx_plat->sdiodev, SDIOWIFI_WAKEUP_REG, 2);
|
||||
if (ret < 0) {
|
||||
sdio_err("reg:%d write failed!\n", SDIOWIFI_WAKEUP_REG);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,6 +57,10 @@
|
|||
#define SDIO_ACTIVE_ST 1
|
||||
|
||||
#define DATA_FLOW_CTRL_THRESH 2
|
||||
#ifdef CONFIG_TX_NETIF_FLOWCTRL
|
||||
#define AICWF_SDIO_TX_LOW_WATER 100
|
||||
#define AICWF_SDIO_TX_HIGH_WATER 500
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
SDIO_TYPE_DATA = 0X00,
|
||||
|
|
@ -110,6 +114,10 @@ struct aic_sdio_dev {
|
|||
struct aicwf_rx_priv *rx_priv;
|
||||
struct aicwf_tx_priv *tx_priv;
|
||||
u32 state;
|
||||
#ifdef CONFIG_TX_NETIF_FLOWCTRL
|
||||
u8 flowctrl;
|
||||
spinlock_t tx_flow_lock;
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_SDIO_PWRCTRL)
|
||||
//for sdio pwr ctrl
|
||||
|
|
@ -139,6 +147,9 @@ void aicwf_sdio_reg_init(struct aic_sdio_dev *sdiodev);
|
|||
int aicwf_sdio_func_init(struct aic_sdio_dev *sdiodev);
|
||||
int aicwf_sdiov3_func_init(struct aic_sdio_dev *sdiodev);
|
||||
void aicwf_sdio_func_deinit(struct aic_sdio_dev *sdiodev);
|
||||
#ifdef CONFIG_TX_NETIF_FLOWCTRL
|
||||
void aicwf_sdio_tx_netif_flowctrl(struct rwnx_hw *rwnx_hw, bool state);
|
||||
#endif
|
||||
int aicwf_sdio_flow_ctrl(struct aic_sdio_dev *sdiodev);
|
||||
int aicwf_sdio_flow_ctrl_msg(struct aic_sdio_dev *sdiodev);
|
||||
#ifdef CONFIG_PREALLOC_RX_SKB
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ struct msg_buf *intf_tcp_alloc_msg(struct msg_buf *msg)
|
|||
{
|
||||
//printk("%s \n",__func__);
|
||||
int len=sizeof(struct msg_buf) ;
|
||||
msg = kzalloc(len , GFP_KERNEL);
|
||||
msg = kzalloc(len , /*GFP_KERNEL*/GFP_ATOMIC);
|
||||
if(!msg)
|
||||
printk("%s: alloc failed \n", __func__);
|
||||
memset(msg,0,len);
|
||||
|
|
|
|||
|
|
@ -36,10 +36,10 @@ struct msg_buf {
|
|||
u8 mode;
|
||||
u16 len;
|
||||
unsigned long timeout;*/
|
||||
/* marlin 2 */
|
||||
|
||||
/*unsigned int fifo_id;
|
||||
struct sprdwl_msg_list *msglist;*/
|
||||
/* marlin 3 */
|
||||
|
||||
/*unsigned char buffer_type;
|
||||
struct sprdwl_xmit_msg_list *xmit_msg_list;
|
||||
unsigned char msg_type;
|
||||
|
|
|
|||
|
|
@ -394,6 +394,9 @@ enum mm_msg_tag {
|
|||
MM_SET_VENDOR_SWCONFIG_REQ,
|
||||
MM_SET_VENDOR_SWCONFIG_CFM,
|
||||
|
||||
MM_SET_TXPWR_LVL_ADJ_REQ,
|
||||
MM_SET_TXPWR_LVL_ADJ_CFM,
|
||||
|
||||
/// MAX number of messages
|
||||
MM_MAX,
|
||||
};
|
||||
|
|
@ -1160,6 +1163,7 @@ struct mm_set_arpoffload_en_cfm {
|
|||
struct mm_set_agg_disable_req {
|
||||
u8_l disable;
|
||||
u8_l staidx;
|
||||
u8_l disable_rx;
|
||||
};
|
||||
|
||||
struct mm_set_coex_req {
|
||||
|
|
@ -1259,6 +1263,13 @@ typedef struct
|
|||
s8_l pwrlvl_11ax_5g[12];
|
||||
} txpwr_lvl_conf_v3_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
u8_l enable;
|
||||
s8_l pwrlvl_adj_tbl_2g4[3];
|
||||
s8_l pwrlvl_adj_tbl_5g[6];
|
||||
} txpwr_lvl_adj_conf_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
u8_l loss_enable;
|
||||
|
|
@ -1274,6 +1285,10 @@ struct mm_set_txpwr_lvl_req
|
|||
};
|
||||
};
|
||||
|
||||
struct mm_set_txpwr_lvl_adj_req
|
||||
{
|
||||
txpwr_lvl_adj_conf_t txpwr_lvl_adj;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
u8_l enable;
|
||||
|
|
@ -1834,11 +1849,19 @@ struct me_traffic_ind_req {
|
|||
|
||||
struct mm_apm_staloss_ind
|
||||
{
|
||||
u8_l sta_idx;
|
||||
u8_l vif_idx;
|
||||
u8_l mac_addr[6];
|
||||
u8_l sta_idx;
|
||||
u8_l vif_idx;
|
||||
u8_l mac_addr[6];
|
||||
};
|
||||
|
||||
#ifdef CONFIG_SDIO_BT
|
||||
struct mm_bt_recv_ind
|
||||
{
|
||||
u32_l data_len;
|
||||
u8_l bt_data[1024];
|
||||
};
|
||||
#endif
|
||||
|
||||
enum vendor_hwconfig_tag{
|
||||
ACS_TXOP_REQ = 0,
|
||||
CHANNEL_ACCESS_REQ,
|
||||
|
|
@ -1846,6 +1869,10 @@ enum vendor_hwconfig_tag{
|
|||
CCA_THRESHOLD_REQ,
|
||||
BWMODE_REQ,
|
||||
CHIP_TEMP_GET_REQ,
|
||||
AP_PS_LEVEL_SET_REQ,
|
||||
CUSTOMIZED_FREQ_REQ,
|
||||
WAKEUP_INFO_REQ,
|
||||
KEEPALIVE_PKT_REQ,
|
||||
};
|
||||
|
||||
enum {
|
||||
|
|
@ -1915,6 +1942,12 @@ struct mm_get_chip_temp_cfm
|
|||
s8_l degree;
|
||||
};
|
||||
|
||||
struct mm_set_ap_ps_level_req
|
||||
{
|
||||
u32_l hwconfig_id;
|
||||
u8 ap_ps_level;
|
||||
};
|
||||
|
||||
struct mm_set_vendor_hwconfig_cfm
|
||||
{
|
||||
u32_l hwconfig_id;
|
||||
|
|
@ -1923,6 +1956,31 @@ struct mm_set_vendor_hwconfig_cfm
|
|||
};
|
||||
};
|
||||
|
||||
struct mm_set_customized_freq_req
|
||||
{
|
||||
u32_l hwconfig_id;
|
||||
u16_l raw_freq[4];
|
||||
u16_l map_freq[4];
|
||||
};
|
||||
|
||||
struct mm_set_wakeup_info_req
|
||||
{
|
||||
u32_l hwconfig_id;
|
||||
u16_l offset;
|
||||
u8_l length;
|
||||
u8_l mask_and_patten[];
|
||||
|
||||
};
|
||||
|
||||
struct mm_set_keepalive_req
|
||||
{
|
||||
u32_l hwconfig_id;
|
||||
u16_l code;
|
||||
u16_l length;
|
||||
u32_l intv;
|
||||
u8_l payload[];
|
||||
};
|
||||
|
||||
struct mm_set_txop_req
|
||||
{
|
||||
u16_l txop_bk;
|
||||
|
|
@ -1949,6 +2007,9 @@ enum vendor_swconfig_tag
|
|||
BCN_CFG_REQ = 0,
|
||||
TEMP_COMP_SET_REQ,
|
||||
TEMP_COMP_GET_REQ,
|
||||
EXT_FLAGS_SET_REQ,
|
||||
EXT_FLAGS_GET_REQ,
|
||||
EXT_FLAGS_MASK_SET_REQ,
|
||||
};
|
||||
|
||||
struct mm_set_bcn_cfg_req
|
||||
|
|
@ -1985,12 +2046,40 @@ struct mm_get_temp_comp_cfm
|
|||
s8_l degree;
|
||||
};
|
||||
|
||||
struct mm_set_ext_flags_req
|
||||
{
|
||||
u32_l user_flags;
|
||||
};
|
||||
|
||||
struct mm_set_ext_flags_cfm
|
||||
{
|
||||
u32_l user_flags;
|
||||
};
|
||||
|
||||
struct mm_get_ext_flags_cfm
|
||||
{
|
||||
u32_l user_flags;
|
||||
};
|
||||
|
||||
struct mm_mask_set_ext_flags_req
|
||||
{
|
||||
u32_l user_flags_mask;
|
||||
u32_l user_flags_val;
|
||||
};
|
||||
|
||||
struct mm_mask_set_ext_flags_cfm
|
||||
{
|
||||
u32_l user_flags;
|
||||
};
|
||||
|
||||
struct mm_set_vendor_swconfig_req
|
||||
{
|
||||
u32_l swconfig_id;
|
||||
union {
|
||||
struct mm_set_bcn_cfg_req bcn_cfg_req;
|
||||
struct mm_set_temp_comp_req temp_comp_set_req;
|
||||
struct mm_set_ext_flags_req ext_flags_set_req;
|
||||
struct mm_mask_set_ext_flags_req ext_flags_mask_set_req;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
@ -2001,9 +2090,25 @@ struct mm_set_vendor_swconfig_cfm
|
|||
struct mm_set_bcn_cfg_cfm bcn_cfg_cfm;
|
||||
struct mm_set_temp_comp_cfm temp_comp_set_cfm;
|
||||
struct mm_get_temp_comp_cfm temp_comp_get_cfm;
|
||||
struct mm_set_ext_flags_cfm ext_flags_set_cfm;
|
||||
struct mm_get_ext_flags_cfm ext_flags_get_cfm;
|
||||
struct mm_mask_set_ext_flags_cfm ext_flags_mask_set_cfm;
|
||||
};
|
||||
};
|
||||
|
||||
#ifdef CONFIG_SDIO_BT
|
||||
struct mm_bt_send_req
|
||||
{
|
||||
u32_l data_len;
|
||||
u8_l bt_data[1024];
|
||||
};
|
||||
|
||||
struct mm_bt_send_cfm
|
||||
{
|
||||
u8_l status;
|
||||
};
|
||||
#endif
|
||||
|
||||
/// Structure containing the parameters of the @ref ME_RC_STATS_REQ message.
|
||||
struct me_rc_stats_req {
|
||||
/// Index of the station for which the RC statistics are requested
|
||||
|
|
@ -2697,22 +2802,36 @@ enum dbg_msg_tag {
|
|||
/// Memory mask write confirm
|
||||
DBG_MEM_MASK_WRITE_CFM,
|
||||
|
||||
DBG_RFTEST_CMD_REQ,
|
||||
DBG_RFTEST_CMD_CFM,
|
||||
DBG_BINDING_REQ,
|
||||
DBG_BINDING_CFM,
|
||||
DBG_BINDING_IND,
|
||||
DBG_RFTEST_CMD_REQ,
|
||||
DBG_RFTEST_CMD_CFM,
|
||||
DBG_BINDING_REQ,
|
||||
DBG_BINDING_CFM,
|
||||
DBG_BINDING_IND,
|
||||
|
||||
DBG_CUSTOM_MSG_REQ,
|
||||
DBG_CUSTOM_MSG_CFM,
|
||||
DBG_CUSTOM_MSG_IND,
|
||||
DBG_CUSTOM_MSG_REQ,
|
||||
DBG_CUSTOM_MSG_CFM,
|
||||
DBG_CUSTOM_MSG_IND,
|
||||
|
||||
DBG_GPIO_WRITE_REQ,
|
||||
DBG_GPIO_WRITE_CFM,
|
||||
DBG_GPIO_READ_REQ,
|
||||
DBG_GPIO_READ_CFM,
|
||||
DBG_GPIO_INIT_REQ,
|
||||
DBG_GPIO_INIT_CFM,
|
||||
DBG_GPIO_WRITE_REQ,
|
||||
DBG_GPIO_WRITE_CFM,
|
||||
DBG_GPIO_READ_REQ,
|
||||
DBG_GPIO_READ_CFM,
|
||||
DBG_GPIO_INIT_REQ,
|
||||
DBG_GPIO_INIT_CFM,
|
||||
|
||||
/// EF usrdata read request
|
||||
DBG_EF_USRDATA_READ_REQ,
|
||||
/// EF usrdata read confirm
|
||||
DBG_EF_USRDATA_READ_CFM,
|
||||
/// Memory block read request
|
||||
DBG_MEM_BLOCK_READ_REQ,
|
||||
/// Memory block read confirm
|
||||
DBG_MEM_BLOCK_READ_CFM,
|
||||
|
||||
DBG_PWM_INIT_REQ,
|
||||
DBG_PWM_INIT_CFM,
|
||||
DBG_PWM_DEINIT_REQ,
|
||||
DBG_PWM_DEINIT_CFM,
|
||||
|
||||
/// Max number of Debug messages
|
||||
DBG_MAX,
|
||||
|
|
@ -2883,6 +3002,12 @@ enum tdls_msg_tag {
|
|||
TDLS_PEER_TRAFFIC_IND_REQ,
|
||||
/// TDLS peer traffic indication confirmation.
|
||||
TDLS_PEER_TRAFFIC_IND_CFM,
|
||||
|
||||
#ifdef CONFIG_SDIO_BT
|
||||
TDLS_SDIO_BT_SEND_REQ = LMAC_FIRST_MSG(TASK_TDLS)+16,
|
||||
TDLS_SDIO_BT_SEND_CFM,
|
||||
TDLS_SDIO_BT_RECV_IND,
|
||||
#endif
|
||||
/// MAX number of messages
|
||||
TDLS_MAX
|
||||
};
|
||||
|
|
|
|||
|
|
@ -2891,6 +2891,7 @@ const struct ieee80211_regdomain *reg_regdb[] = {
|
|||
®dom_YT,
|
||||
®dom_ZA,
|
||||
®dom_ZW,
|
||||
NULL,
|
||||
};
|
||||
|
||||
int reg_regdb_size = ARRAY_SIZE(reg_regdb);
|
||||
|
|
|
|||
|
|
@ -1334,6 +1334,14 @@ static ssize_t rwnx_dbgfs_vendor_hwconfig_write(struct file *file,
|
|||
printk("CHIP_TEMP_GET_REQ degree=%d\n", addr_out[0]);
|
||||
}
|
||||
break;
|
||||
case 6://AP_PS_LEVEL_SET_REQ
|
||||
if (ret != 2) {
|
||||
printk("param error != 2\n");
|
||||
} else {
|
||||
ret = rwnx_send_vendor_hwconfig_req(priv, hwconfig_id, addr, NULL);
|
||||
printk("AP_PS_LEVEL_SET_REQ lvl=%d\n", addr[0]);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
printk("param error\n");
|
||||
break;
|
||||
|
|
@ -1346,7 +1354,7 @@ static ssize_t rwnx_dbgfs_vendor_hwconfig_write(struct file *file,
|
|||
return count;
|
||||
}
|
||||
|
||||
DEBUGFS_WRITE_FILE_OPS(vendor_hwconfig)
|
||||
DEBUGFS_WRITE_FILE_OPS(vendor_hwconfig);
|
||||
|
||||
static ssize_t rwnx_dbgfs_vendor_swconfig_write(struct file *file,
|
||||
const char __user *user_buf,
|
||||
|
|
@ -1400,6 +1408,35 @@ static ssize_t rwnx_dbgfs_vendor_swconfig_write(struct file *file,
|
|||
}
|
||||
break;
|
||||
|
||||
case 3: // EXT_FLAGS_SET_REQ
|
||||
if (ret != 2) {
|
||||
printk("param error != 2\n");
|
||||
} else {
|
||||
ret = rwnx_send_vendor_swconfig_req(priv, swconfig_id, addr, addr_out);
|
||||
printk("EXT_FLAGS_SET_REQ set ext_flags=0x%x, get ext_flags=0x%x\n",
|
||||
addr[0], addr_out[0]);
|
||||
}
|
||||
break;
|
||||
|
||||
case 4: // EXT_FLAGS_GET_REQ
|
||||
if (ret != 1) {
|
||||
printk("param error != 1\n");
|
||||
} else {
|
||||
ret = rwnx_send_vendor_swconfig_req(priv, swconfig_id, addr, addr_out);
|
||||
printk("EXT_FLAGS_GET_REQ get ext_flags=0x%x\n", addr_out[0]);
|
||||
}
|
||||
break;
|
||||
|
||||
case 5: // EXT_FLAGS_MASK_SET_REQ
|
||||
if (ret != 3) {
|
||||
printk("param error != 3\n");
|
||||
} else {
|
||||
ret = rwnx_send_vendor_swconfig_req(priv, swconfig_id, addr, addr_out);
|
||||
printk("EXT_FLAGS_MASK_SET_REQ set ext_flags mask=0x%x, val=0x%x, get ext_flags=0x%x\n",
|
||||
addr[0], addr[1], addr_out[0]);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
printk("param error\n");
|
||||
break;
|
||||
|
|
@ -1413,8 +1450,107 @@ static ssize_t rwnx_dbgfs_vendor_swconfig_write(struct file *file,
|
|||
return count;
|
||||
}
|
||||
|
||||
DEBUGFS_WRITE_FILE_OPS(vendor_swconfig)
|
||||
DEBUGFS_WRITE_FILE_OPS(vendor_swconfig);
|
||||
|
||||
static ssize_t rwnx_dbgfs_agg_disable_write(struct file *file,
|
||||
const char __user *user_buf,
|
||||
size_t count, loff_t *ppos)
|
||||
{
|
||||
struct rwnx_hw *priv = file->private_data;
|
||||
char buf[64];
|
||||
int agg_disable, agg_disable_rx, sta_idx;
|
||||
size_t len = min_t(size_t, count, sizeof(buf) - 1);
|
||||
int ret;
|
||||
printk("%s\n", __func__);
|
||||
|
||||
if (copy_from_user(buf, user_buf, len)) {
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
buf[len] = '\0';
|
||||
ret = sscanf(buf, "%d %d %d", &agg_disable, &agg_disable_rx, &sta_idx);
|
||||
if ((ret > 3) || (ret < 2)) {
|
||||
printk("param error: cnt=%d\n", ret);
|
||||
} else {
|
||||
if (ret < 3) {
|
||||
sta_idx = RWNX_INVALID_STA;
|
||||
}
|
||||
printk("disable_agg: T=%d, R=%d, staidx=%d\n", agg_disable, agg_disable_rx, sta_idx);
|
||||
ret = rwnx_send_disable_agg_req(priv, (u8_l)agg_disable, (u8_l)agg_disable_rx, (u8_l)sta_idx);
|
||||
if (ret) {
|
||||
printk("rwnx_send_disable_agg_req fail: %d\n", ret);
|
||||
}
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
DEBUGFS_WRITE_FILE_OPS(agg_disable);
|
||||
|
||||
static ssize_t rwnx_dbgfs_set_roc_write(struct file *file,
|
||||
const char __user *user_buf,
|
||||
size_t count, loff_t *ppos)
|
||||
{
|
||||
struct rwnx_hw *priv = file->private_data;
|
||||
struct rwnx_vif *vif = NULL;
|
||||
char buf[64];
|
||||
int roc_start, chan_freq, duration;
|
||||
size_t len = min_t(size_t, count, sizeof(buf) - 1);
|
||||
int ret;
|
||||
int if_type = NL80211_IFTYPE_STATION;
|
||||
printk("%s\n", __func__);
|
||||
|
||||
if (copy_from_user(buf, user_buf, len)) {
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
buf[len] = '\0';
|
||||
ret = sscanf(buf, "%d %d %d", &roc_start, &chan_freq, &duration);
|
||||
|
||||
list_for_each_entry(vif, &priv->vifs, list) {
|
||||
if (RWNX_VIF_TYPE(vif) == if_type) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ((ret > 3) || (ret < 1)) {
|
||||
printk("param error: cnt=%d\n", ret);
|
||||
} else if (vif) {
|
||||
struct ieee80211_channel chan_entry = {0,};
|
||||
struct ieee80211_channel *chan = &chan_entry;
|
||||
struct mm_remain_on_channel_cfm roc_cfm;
|
||||
if (ret < 3) {
|
||||
duration = 2000;
|
||||
if (ret < 2) {
|
||||
chan_freq = 2412;
|
||||
}
|
||||
}
|
||||
printk("set_roc: start=%d, freq=%d\n", roc_start, chan_freq);
|
||||
if (roc_start) {
|
||||
if (chan_freq <= 2484) {
|
||||
chan->band = NL80211_BAND_2GHZ;
|
||||
} else {
|
||||
chan->band = NL80211_BAND_5GHZ;
|
||||
}
|
||||
chan->center_freq = chan_freq;
|
||||
chan->max_power = 18;
|
||||
ret = rwnx_send_roc(priv, vif, chan, duration, &roc_cfm);
|
||||
if (ret) {
|
||||
printk("rwnx_send_roc fail: %d\n", ret);
|
||||
} else {
|
||||
printk("roc_cfm: opcode=%x, st=%d, idx=%d\n", roc_cfm.op_code, roc_cfm.status, roc_cfm.chan_ctxt_index);
|
||||
}
|
||||
} else {
|
||||
ret = rwnx_send_cancel_roc(priv);
|
||||
if (ret) {
|
||||
printk("rwnx_send_cancel_roc fail: %d\n", ret);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
DEBUGFS_WRITE_FILE_OPS(set_roc);
|
||||
|
||||
#ifdef CONFIG_RWNX_FULLMAC
|
||||
|
||||
|
|
@ -2239,6 +2375,8 @@ int rwnx_dbgfs_register(struct rwnx_hw *rwnx_hw, const char *name)
|
|||
DEBUGFS_ADD_FILE(regdbg, dir_drv, S_IWUSR);
|
||||
DEBUGFS_ADD_FILE(vendor_hwconfig, dir_drv,S_IWUSR);
|
||||
DEBUGFS_ADD_FILE(vendor_swconfig, dir_drv,S_IWUSR);
|
||||
DEBUGFS_ADD_FILE(agg_disable, dir_drv,S_IWUSR);
|
||||
DEBUGFS_ADD_FILE(set_roc, dir_drv,S_IWUSR);
|
||||
|
||||
#ifdef CONFIG_RWNX_P2P_DEBUGFS
|
||||
{
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -13,20 +13,6 @@
|
|||
|
||||
#include "rwnx_defs.h"
|
||||
|
||||
typedef struct _android_wifi_priv_cmd {
|
||||
char *buf;
|
||||
int used_len;
|
||||
int total_len;
|
||||
} android_wifi_priv_cmd;
|
||||
|
||||
#ifdef CONFIG_COMPAT
|
||||
typedef struct _compat_android_wifi_priv_cmd {
|
||||
compat_caddr_t buf;
|
||||
int used_len;
|
||||
int total_len;
|
||||
} compat_android_wifi_priv_cmd;
|
||||
#endif /* CONFIG_COMPAT */
|
||||
|
||||
int rwnx_cfg80211_init(struct rwnx_plat *rwnx_plat, void **platform_data);
|
||||
void rwnx_cfg80211_deinit(struct rwnx_hw *rwnx_hw);
|
||||
extern int testmode;
|
||||
|
|
|
|||
|
|
@ -269,6 +269,7 @@ static const int mcs_map_to_rate[4][3] = {
|
|||
#define MAX_VHT_RATE(map, nss, bw) (mcs_map_to_rate[bw][map] * (nss))
|
||||
|
||||
extern struct ieee80211_regdomain *reg_regdb[];
|
||||
extern int reg_regdb_size;
|
||||
|
||||
char ccode_channels[200];
|
||||
int index_for_channel_list = 0;
|
||||
|
|
@ -891,6 +892,7 @@ static void rwnx_set_vht_capa(struct rwnx_hw *rwnx_hw, struct wiphy *wiphy)
|
|||
rwnx_hw->vht_cap_5G.cap &= ~IEEE80211_VHT_CAP_SHORT_GI_80;
|
||||
}
|
||||
|
||||
rwnx_hw->vht_cap_5G.cap |= IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK;
|
||||
}
|
||||
#endif//USE_5G
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -25,6 +25,9 @@
|
|||
#include "rwnx_compat.h"
|
||||
#include "aicwf_txrxif.h"
|
||||
#include "rwnx_msg_rx.h"
|
||||
#ifdef CONFIG_SDIO_BT
|
||||
#include "aic_btsdio.h"
|
||||
#endif
|
||||
void rwnx_cfg80211_unlink_bss(struct rwnx_hw *rwnx_hw, struct rwnx_vif *rwnx_vif);
|
||||
|
||||
static int rwnx_freq_to_idx(struct rwnx_hw *rwnx_hw, int freq)
|
||||
|
|
@ -275,6 +278,7 @@ found_vif:
|
|||
if (ps_state == MM_PS_MODE_OFF) {
|
||||
// Start TX queues for provided VIF
|
||||
rwnx_txq_vif_start(vif_entry, RWNX_TXQ_STOP_VIF_PS, rwnx_hw);
|
||||
tasklet_schedule(&rwnx_hw->task);
|
||||
} else {
|
||||
// Stop TX queues for provided VIF
|
||||
rwnx_txq_vif_stop(vif_entry, RWNX_TXQ_STOP_VIF_PS, rwnx_hw);
|
||||
|
|
@ -383,6 +387,18 @@ static inline int rwnx_apm_staloss_ind(struct rwnx_hw *rwnx_hw,
|
|||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SDIO_BT
|
||||
static inline int rwnx_bt_recv_ind(struct rwnx_hw *rwnx_hw,
|
||||
struct rwnx_cmd *cmd,
|
||||
struct ipc_e2a_msg *msg)
|
||||
{
|
||||
struct mm_bt_recv_ind *ind = (struct mm_bt_recv_ind *)msg->param;
|
||||
|
||||
bt_sdio_recv(ind->bt_data,ind->data_len);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
static inline int rwnx_rx_csa_counter_ind(struct rwnx_hw *rwnx_hw,
|
||||
struct rwnx_cmd *cmd,
|
||||
struct ipc_e2a_msg *msg)
|
||||
|
|
@ -1481,6 +1497,9 @@ static msg_cb_fct tdls_hdlrs[MSG_I(TDLS_MAX)] = {
|
|||
[MSG_I(TDLS_CHAN_SWITCH_IND)] = rwnx_rx_tdls_chan_switch_ind,
|
||||
[MSG_I(TDLS_CHAN_SWITCH_BASE_IND)] = rwnx_rx_tdls_chan_switch_base_ind,
|
||||
[MSG_I(TDLS_PEER_PS_IND)] = rwnx_rx_tdls_peer_ps_ind,
|
||||
#ifdef CONFIG_SDIO_BT
|
||||
[MSG_I(TDLS_SDIO_BT_RECV_IND)] = rwnx_bt_recv_ind,
|
||||
#endif
|
||||
};
|
||||
|
||||
static msg_cb_fct *msg_hdlrs[] = {
|
||||
|
|
@ -1501,7 +1520,7 @@ static msg_cb_fct *msg_hdlrs[] = {
|
|||
*/
|
||||
void rwnx_rx_handle_msg(struct rwnx_hw *rwnx_hw, struct ipc_e2a_msg *msg)
|
||||
{
|
||||
//printk("%s msg->id:0x%x \r\n", __func__, msg->id);
|
||||
AICWFDBG(LOGDEBUG, "%s msg->id:0x%x \r\n", __func__, msg->id);
|
||||
|
||||
rwnx_hw->cmd_mgr->msgind(rwnx_hw->cmd_mgr, msg,
|
||||
msg_hdlrs[MSG_T(msg->id)][MSG_I(msg->id)]);
|
||||
|
|
|
|||
|
|
@ -942,6 +942,31 @@ int rwnx_send_arpoffload_en_req(struct rwnx_hw *rwnx_hw, struct rwnx_vif *rwnx_v
|
|||
}
|
||||
#endif
|
||||
|
||||
int rwnx_send_disable_agg_req(struct rwnx_hw *rwnx_hw, u8_l agg_disable, u8_l agg_disable_rx, u8_l sta_idx)
|
||||
{
|
||||
struct mm_set_agg_disable_req *req;
|
||||
int error;
|
||||
|
||||
RWNX_DBG(RWNX_FN_ENTRY_STR);
|
||||
|
||||
/* Build the MM_SET_AGG_DISABLE_REQ message */
|
||||
req = rwnx_msg_zalloc(MM_SET_AGG_DISABLE_REQ, TASK_MM, DRV_TASK_ID,
|
||||
sizeof(struct mm_set_agg_disable_req));
|
||||
|
||||
if (!req) {
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
req->disable = agg_disable;
|
||||
req->staidx = sta_idx;
|
||||
req->disable_rx = agg_disable_rx;
|
||||
|
||||
/* Send the MM_SET_AGG_DISABLE_REQ message to UMAC FW */
|
||||
error = rwnx_send_msg(rwnx_hw, req, 1, MM_SET_AGG_DISABLE_CFM, NULL);
|
||||
|
||||
return (error);
|
||||
};
|
||||
|
||||
int rwnx_send_coex_req(struct rwnx_hw *rwnx_hw, u8_l disable_coexnull, u8_l enable_nullcts)
|
||||
{
|
||||
struct mm_set_coex_req *coex_req;
|
||||
|
|
@ -1149,8 +1174,11 @@ int rwnx_send_vendor_hwconfig_req(struct rwnx_hw *rwnx_hw, uint32_t hwconfig_id,
|
|||
struct mm_set_mac_timescale_req *req2;
|
||||
struct mm_set_cca_threshold_req *req3;
|
||||
struct mm_set_bwmode_req *req4;
|
||||
struct mm_set_ap_ps_level_req *req5 = NULL;
|
||||
struct mm_set_customized_freq_req *req6;
|
||||
|
||||
int error = 0;
|
||||
int i;
|
||||
|
||||
switch (hwconfig_id)
|
||||
{
|
||||
|
|
@ -1240,29 +1268,68 @@ int rwnx_send_vendor_hwconfig_req(struct rwnx_hw *rwnx_hw, uint32_t hwconfig_id,
|
|||
/* Send the MM_SET_VENDOR_HWCONFIG_CFM message to UMAC FW */
|
||||
error = rwnx_send_msg(rwnx_hw, req4, 1, MM_SET_VENDOR_HWCONFIG_CFM, NULL);
|
||||
break;
|
||||
case CHIP_TEMP_GET_REQ:
|
||||
if ((rwnx_hw->sdiodev->chipid == PRODUCT_ID_AIC8800DC) ||
|
||||
(rwnx_hw->sdiodev->chipid == PRODUCT_ID_AIC8800DW))
|
||||
{
|
||||
struct mm_get_chip_temp_req *req;
|
||||
struct mm_set_vendor_hwconfig_cfm cfm = {0,};
|
||||
/* Build the CHIP_TEMP_GET_REQ message */
|
||||
req = rwnx_msg_zalloc(MM_SET_VENDOR_HWCONFIG_REQ, TASK_MM, DRV_TASK_ID, sizeof(struct mm_get_chip_temp_req));
|
||||
if (!req)
|
||||
return -ENOMEM;
|
||||
req->hwconfig_id = hwconfig_id;
|
||||
/* Send the MM_SET_VENDOR_HWCONFIG_REQ message to UMAC FW */
|
||||
error = rwnx_send_msg(rwnx_hw, req, 1, MM_SET_VENDOR_HWCONFIG_CFM, &cfm);
|
||||
if (!error) {
|
||||
if (param_out) {
|
||||
param_out[0] = (int32_t)cfm.chip_temp_cfm.degree;
|
||||
case CHIP_TEMP_GET_REQ:
|
||||
if ((rwnx_hw->sdiodev->chipid == PRODUCT_ID_AIC8800DC) ||
|
||||
(rwnx_hw->sdiodev->chipid == PRODUCT_ID_AIC8800DW))
|
||||
{
|
||||
struct mm_get_chip_temp_req *req;
|
||||
struct mm_set_vendor_hwconfig_cfm cfm = {0,};
|
||||
/* Build the CHIP_TEMP_GET_REQ message */
|
||||
req = rwnx_msg_zalloc(MM_SET_VENDOR_HWCONFIG_REQ, TASK_MM, DRV_TASK_ID, sizeof(struct mm_get_chip_temp_req));
|
||||
if (!req)
|
||||
return -ENOMEM;
|
||||
req->hwconfig_id = hwconfig_id;
|
||||
/* Send the MM_SET_VENDOR_HWCONFIG_REQ message to UMAC FW */
|
||||
error = rwnx_send_msg(rwnx_hw, req, 1, MM_SET_VENDOR_HWCONFIG_CFM, &cfm);
|
||||
if (!error) {
|
||||
if (param_out) {
|
||||
param_out[0] = (int32_t)cfm.chip_temp_cfm.degree;
|
||||
}
|
||||
printk("get_chip_temp degree=%d\n", cfm.chip_temp_cfm.degree);
|
||||
} else {
|
||||
printk("get_chip_temp err=%d\n", error);
|
||||
}
|
||||
}
|
||||
printk("get_chip_temp degree=%d\n", cfm.chip_temp_cfm.degree);
|
||||
} else {
|
||||
printk("get_chip_temp err=%d\n", error);
|
||||
}
|
||||
}
|
||||
break;
|
||||
break;
|
||||
case AP_PS_LEVEL_SET_REQ:
|
||||
/*
|
||||
AP_PS_CLK_1 = 1, // 3:7 -> active 3, doze 7
|
||||
AP_PS_CLK_2, // 5:5 -> active 5, doze 5
|
||||
AP_PS_CLK_3, // 7:3 -> active 7, doze 3
|
||||
AP_PS_CLK_4, // 8:2 -> active 8, doze 2
|
||||
AP_PS_CLK_5, // 9:1 -> active 9, doze 1
|
||||
*/
|
||||
/* Build the MM_SET_VENDOR_HWCONFIG_REQ message */
|
||||
req5 = rwnx_msg_zalloc(MM_SET_VENDOR_HWCONFIG_REQ, TASK_MM, DRV_TASK_ID,
|
||||
sizeof(struct mm_set_ap_ps_level_req));
|
||||
if (!req5) {
|
||||
return -ENOMEM;
|
||||
}
|
||||
req5->hwconfig_id = hwconfig_id;
|
||||
req5->ap_ps_level = param[0];
|
||||
|
||||
/* Send the MM_GET_MAC_ADDR_REQ message to UMAC FW */
|
||||
error = rwnx_send_msg(rwnx_hw, req5, 1, MM_SET_VENDOR_HWCONFIG_CFM, NULL);
|
||||
if(!error)
|
||||
printk("set ap_ps_level=%d \n",param[0]);
|
||||
break;
|
||||
|
||||
case CUSTOMIZED_FREQ_REQ:
|
||||
/* Build the CUSTOMIZED_FREQ_REQ message */
|
||||
req6 = rwnx_msg_zalloc(MM_SET_VENDOR_HWCONFIG_REQ, TASK_MM, DRV_TASK_ID, sizeof(struct mm_set_customized_freq_req));
|
||||
if (!req6)
|
||||
return -ENOMEM;
|
||||
req5->hwconfig_id = hwconfig_id;
|
||||
for (i = 0; i < 4; i++) {
|
||||
req6->raw_freq[i] = param [i];
|
||||
req6->map_freq[i] = param [i + 4];
|
||||
}
|
||||
printk("customized_freq_req: raw_freq[ %d %d %d %d ], map_freq[ %d %d %d %d]\n",
|
||||
param[0], param[1], param[2], param[3], param[4], param[5], param[6], param[7]);
|
||||
/* Send the MM_SET_VENDOR_HWCONFIG_CFM message to UMAC FW */
|
||||
error = rwnx_send_msg(rwnx_hw, req5, 1, MM_SET_VENDOR_HWCONFIG_CFM, NULL);
|
||||
|
||||
break;
|
||||
default:
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
|
@ -1321,6 +1388,44 @@ int rwnx_send_vendor_swconfig_req(struct rwnx_hw *rwnx_hw, uint32_t swconfig_id,
|
|||
}
|
||||
break;
|
||||
|
||||
case EXT_FLAGS_SET_REQ:
|
||||
/* Build the EXT_FLAGS_SET_REQ message */
|
||||
req->ext_flags_set_req.user_flags = (u32_l)param_in[0];
|
||||
printk("ext_flags_set_req: flags=%x\n",
|
||||
req->ext_flags_set_req.user_flags);
|
||||
/* Send the MM_SET_VENDOR_SWCONFIG_REQ message to UMAC FW */
|
||||
error = rwnx_send_msg(rwnx_hw, req, 1, MM_SET_VENDOR_SWCONFIG_CFM, &cfm);
|
||||
if (!error) {
|
||||
param_out[0] = (uint32_t)cfm.ext_flags_set_cfm.user_flags;
|
||||
printk("cfm flags=%x\n", cfm.ext_flags_set_cfm.user_flags);
|
||||
}
|
||||
break;
|
||||
|
||||
case EXT_FLAGS_GET_REQ:
|
||||
/* Build the EXT_FLAGS_GET_REQ message */
|
||||
printk("ext_flags_get_req\n");
|
||||
/* Send the MM_SET_VENDOR_SWCONFIG_REQ message to UMAC FW */
|
||||
error = rwnx_send_msg(rwnx_hw, req, 1, MM_SET_VENDOR_SWCONFIG_CFM, &cfm);
|
||||
if (!error) {
|
||||
param_out[0] = (uint32_t)cfm.ext_flags_get_cfm.user_flags;
|
||||
printk("cfm flags=%x\n", cfm.ext_flags_get_cfm.user_flags);
|
||||
}
|
||||
break;
|
||||
|
||||
case EXT_FLAGS_MASK_SET_REQ:
|
||||
/* Build the EXT_FLAGS_MASK_SET_REQ message */
|
||||
req->ext_flags_mask_set_req.user_flags_mask = (u32_l)param_in[0];
|
||||
req->ext_flags_mask_set_req.user_flags_val = (u32_l)param_in[1];
|
||||
printk("ext_flags_mask_set_req: flags mask=0x%x, val=0x%x\n",
|
||||
req->ext_flags_mask_set_req.user_flags_mask, req->ext_flags_mask_set_req.user_flags_val);
|
||||
/* Send the MM_SET_VENDOR_SWCONFIG_REQ message to UMAC FW */
|
||||
error = rwnx_send_msg(rwnx_hw, req, 1, MM_SET_VENDOR_SWCONFIG_CFM, &cfm);
|
||||
if (!error) {
|
||||
param_out[0] = (uint32_t)cfm.ext_flags_mask_set_cfm.user_flags;
|
||||
printk("cfm flags=%x\n", cfm.ext_flags_mask_set_cfm.user_flags);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
error = -ENOMEM;
|
||||
break;
|
||||
|
|
@ -1329,6 +1434,57 @@ int rwnx_send_vendor_swconfig_req(struct rwnx_hw *rwnx_hw, uint32_t swconfig_id,
|
|||
return error;
|
||||
}
|
||||
|
||||
int rwnx_send_mask_set_ext_flags_req(struct rwnx_hw *rwnx_hw, uint32_t flags_mask, uint32_t flags_val, struct mm_set_vendor_swconfig_cfm *cfm)
|
||||
{
|
||||
struct mm_set_vendor_swconfig_req *req;
|
||||
int ret;
|
||||
|
||||
RWNX_DBG(RWNX_FN_ENTRY_STR);
|
||||
/* Build the REQ message */
|
||||
req = rwnx_msg_zalloc(MM_SET_VENDOR_SWCONFIG_REQ, TASK_MM, DRV_TASK_ID, sizeof(struct mm_set_vendor_swconfig_req));
|
||||
if (!req) {
|
||||
AICWFDBG(LOGERROR, "%s msg_alloc fail\n", __func__);
|
||||
return -ENOMEM;
|
||||
}
|
||||
req->swconfig_id = EXT_FLAGS_MASK_SET_REQ;
|
||||
req->ext_flags_mask_set_req.user_flags_mask = (u32_l)flags_mask;
|
||||
req->ext_flags_mask_set_req.user_flags_val = (u32_l)flags_val;
|
||||
|
||||
ret = rwnx_send_msg(rwnx_hw, req, 1, MM_SET_VENDOR_SWCONFIG_CFM, cfm);
|
||||
if (!ret) {
|
||||
AICWFDBG(LOGINFO, "curr ext_flags=%x\n", cfm->ext_flags_mask_set_cfm.user_flags);
|
||||
} else {
|
||||
AICWFDBG(LOGERROR, "%s send_msg_fail\n", __func__);
|
||||
return ret;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SDIO_BT
|
||||
int rwnx_sdio_bt_send_req(struct rwnx_hw *rwnx_hw,uint32_t len, struct sk_buff *skb)
|
||||
{
|
||||
struct mm_bt_send_req *req;
|
||||
struct mm_bt_send_cfm cfm;
|
||||
int error;
|
||||
|
||||
cfm.status = 0;
|
||||
req = rwnx_msg_zalloc(TDLS_SDIO_BT_SEND_REQ, TASK_TDLS, DRV_TASK_ID, sizeof(struct mm_bt_send_req));
|
||||
|
||||
if (!req) {
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
req->data_len = len;
|
||||
memcpy(req->bt_data,skb->data,len);
|
||||
|
||||
error = rwnx_send_msg(rwnx_hw, req, 1, TDLS_SDIO_BT_SEND_CFM, &cfm);
|
||||
if(!cfm.status){
|
||||
printk("bt send no cfm");
|
||||
}
|
||||
|
||||
return error;
|
||||
}
|
||||
#endif
|
||||
|
||||
int rwnx_send_get_fw_version_req(struct rwnx_hw *rwnx_hw, struct mm_get_fw_version_cfm *cfm)
|
||||
{
|
||||
|
|
@ -1560,6 +1716,52 @@ int rwnx_send_txpwr_lvl_v3_req(struct rwnx_hw *rwnx_hw)
|
|||
}
|
||||
}
|
||||
|
||||
int rwnx_send_txpwr_lvl_adj_req(struct rwnx_hw *rwnx_hw)
|
||||
{
|
||||
struct mm_set_txpwr_lvl_adj_req *txpwr_lvl_adj_req;
|
||||
txpwr_lvl_adj_conf_t txpwr_lvl_adj_tmp;
|
||||
txpwr_lvl_adj_conf_t *txpwr_lvl_adj;
|
||||
int error;
|
||||
|
||||
RWNX_DBG(RWNX_FN_ENTRY_STR);
|
||||
|
||||
/* Build the MM_SET_TXPWR_LVL_REQ message */
|
||||
txpwr_lvl_adj_req = rwnx_msg_zalloc(MM_SET_TXPWR_LVL_ADJ_REQ, TASK_MM, DRV_TASK_ID,
|
||||
sizeof(struct mm_set_txpwr_lvl_adj_req));
|
||||
|
||||
if (!txpwr_lvl_adj_req) {
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
txpwr_lvl_adj = &txpwr_lvl_adj_tmp;
|
||||
|
||||
get_userconfig_txpwr_lvl_adj_in_fdrv(txpwr_lvl_adj);
|
||||
|
||||
if (txpwr_lvl_adj->enable == 0) {
|
||||
rwnx_msg_free(rwnx_hw, txpwr_lvl_adj_req);
|
||||
return 0;
|
||||
} else {
|
||||
AICWFDBG(LOGINFO, "%s:enable:%d\r\n", __func__, txpwr_lvl_adj->enable);
|
||||
AICWFDBG(LOGINFO, "%s:lvl_adj_2g4_chan_1_4:%d\r\n", __func__, txpwr_lvl_adj->pwrlvl_adj_tbl_2g4[0]);
|
||||
AICWFDBG(LOGINFO, "%s:lvl_adj_2g4_chan_5_9:%d\r\n", __func__, txpwr_lvl_adj->pwrlvl_adj_tbl_2g4[1]);
|
||||
AICWFDBG(LOGINFO, "%s:lvl_adj_2g4_chan_10_13:%d\r\n", __func__, txpwr_lvl_adj->pwrlvl_adj_tbl_2g4[2]);
|
||||
|
||||
AICWFDBG(LOGINFO, "%s:lvl_adj_5g_chan_42:%d\r\n", __func__, txpwr_lvl_adj->pwrlvl_adj_tbl_5g[0]);
|
||||
AICWFDBG(LOGINFO, "%s:lvl_adj_5g_chan_58:%d\r\n", __func__, txpwr_lvl_adj->pwrlvl_adj_tbl_5g[1]);
|
||||
AICWFDBG(LOGINFO, "%s:lvl_adj_5g_chan_106:%d\r\n", __func__, txpwr_lvl_adj->pwrlvl_adj_tbl_5g[2]);
|
||||
AICWFDBG(LOGINFO, "%s:lvl_adj_5g_chan_122:%d\r\n", __func__, txpwr_lvl_adj->pwrlvl_adj_tbl_5g[3]);
|
||||
AICWFDBG(LOGINFO, "%s:lvl_adj_5g_chan_138:%d\r\n", __func__, txpwr_lvl_adj->pwrlvl_adj_tbl_5g[4]);
|
||||
AICWFDBG(LOGINFO, "%s:lvl_adj_5g_chan_155:%d\r\n", __func__, txpwr_lvl_adj->pwrlvl_adj_tbl_5g[5]);
|
||||
|
||||
txpwr_lvl_adj_req->txpwr_lvl_adj = *txpwr_lvl_adj;
|
||||
|
||||
/* Send the MM_SET_TXPWR_LVL_REQ message to UMAC FW */
|
||||
error = rwnx_send_msg(rwnx_hw, txpwr_lvl_adj_req, 1, MM_SET_TXPWR_LVL_ADJ_CFM, NULL);
|
||||
|
||||
return (error);
|
||||
}
|
||||
}
|
||||
|
||||
int rwnx_send_txpwr_idx_req(struct rwnx_hw *rwnx_hw)
|
||||
{
|
||||
struct mm_set_txpwr_idx_req *txpwr_idx_req;
|
||||
|
|
@ -1911,6 +2113,13 @@ int rwnx_send_me_set_control_port_req(struct rwnx_hw *rwnx_hw, bool opened, u8 s
|
|||
return rwnx_send_msg(rwnx_hw, req, 1, ME_SET_CONTROL_PORT_CFM, NULL);
|
||||
}
|
||||
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0) && LINUX_VERSION_CODE < KERNEL_VERSION(4, 20, 0))
|
||||
struct ieee80211_he_cap_elem_4_19 {
|
||||
u8 mac_cap_info[6];
|
||||
u8 phy_cap_info[11];
|
||||
} __packed;
|
||||
#endif
|
||||
|
||||
int rwnx_send_me_sta_add(struct rwnx_hw *rwnx_hw, struct station_parameters *params,
|
||||
const u8 *mac, u8 inst_nbr, struct me_sta_add_cfm *cfm)
|
||||
{
|
||||
|
|
@ -1977,20 +2186,24 @@ int rwnx_send_me_sta_add(struct rwnx_hw *rwnx_hw, struct station_parameters *par
|
|||
}
|
||||
#elif defined(CONFIG_VHT_FOR_OLD_KERNEL)
|
||||
if (sta->vht) {
|
||||
const struct ieee80211_vht_cap *vht_capa = rwnx_vht_capa;
|
||||
//const struct ieee80211_vht_cap *vht_capa = rwnx_vht_capa;
|
||||
|
||||
req->flags |= STA_VHT_CAPA;
|
||||
req->vht_cap.vht_capa_info = cpu_to_le32(vht_capa->vht_cap_info);
|
||||
req->vht_cap.rx_highest = cpu_to_le16(vht_capa->supp_mcs.rx_highest);
|
||||
req->vht_cap.rx_mcs_map = cpu_to_le16(vht_capa->supp_mcs.rx_mcs_map);
|
||||
req->vht_cap.tx_highest = cpu_to_le16(vht_capa->supp_mcs.tx_highest);
|
||||
req->vht_cap.tx_mcs_map = cpu_to_le16(vht_capa->supp_mcs.tx_mcs_map);
|
||||
req->vht_cap.vht_capa_info = cpu_to_le32(rwnx_vht_capa->cap);
|
||||
req->vht_cap.rx_highest = cpu_to_le16(rwnx_vht_capa->vht_mcs.rx_highest);
|
||||
req->vht_cap.rx_mcs_map = cpu_to_le16(rwnx_vht_capa->vht_mcs.rx_mcs_map);
|
||||
req->vht_cap.tx_highest = cpu_to_le16(rwnx_vht_capa->vht_mcs.tx_highest);
|
||||
req->vht_cap.tx_mcs_map = cpu_to_le16(rwnx_vht_capa->vht_mcs.tx_mcs_map);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0)
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0)
|
||||
if (link_sta_params->he_capa) {
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 20, 0)
|
||||
const struct ieee80211_he_cap_elem_4_19 *he_capa = (const struct ieee80211_he_cap_elem_4_19 *) link_sta_params->he_capa;
|
||||
#else
|
||||
const struct ieee80211_he_cap_elem *he_capa = link_sta_params->he_capa;
|
||||
#endif
|
||||
struct ieee80211_he_mcs_nss_supp *mcs_nss_supp =
|
||||
(struct ieee80211_he_mcs_nss_supp *)(he_capa + 1);
|
||||
|
||||
|
|
@ -2292,7 +2505,8 @@ int rwnx_send_sm_connect_req(struct rwnx_hw *rwnx_hw,
|
|||
rwnx_vif->sta.ssid_len = (int)sme->ssid_len;
|
||||
memset(rwnx_vif->sta.ssid, 0, rwnx_vif->sta.ssid_len + 1);
|
||||
memcpy(rwnx_vif->sta.ssid, sme->ssid, rwnx_vif->sta.ssid_len);
|
||||
memcpy(rwnx_vif->sta.bssid, sme->bssid, ETH_ALEN);
|
||||
if (sme->bssid)
|
||||
memcpy(rwnx_vif->sta.bssid, sme->bssid, ETH_ALEN);
|
||||
|
||||
printk("%s drv_vif_index:%d connect to %s(%d) channel:%d auth_type:%d\r\n",
|
||||
__func__,
|
||||
|
|
|
|||
|
|
@ -161,6 +161,7 @@ int rwnx_send_dbg_mem_block_write_req(struct rwnx_hw *rwnx_hw, u32 mem_addr,
|
|||
int rwnx_send_dbg_start_app_req(struct rwnx_hw *rwnx_hw, u32 boot_addr,
|
||||
u32 boot_type);
|
||||
int rwnx_send_cfg_rssi_req(struct rwnx_hw *rwnx_hw, u8 vif_index, int rssi_thold, u32 rssi_hyst);
|
||||
int rwnx_send_disable_agg_req(struct rwnx_hw *rwnx_hw, u8_l agg_disable, u8_l agg_disable_rx, u8_l sta_idx);
|
||||
int rwnx_send_coex_req(struct rwnx_hw *rwnx_hw, u8_l disable_coexnull, u8_l enable_nullcts);
|
||||
int rwnx_send_get_sta_info_req(struct rwnx_hw *rwnx_hw, u8_l sta_idx, struct mm_get_sta_info_cfm *cfm);
|
||||
int rwnx_send_set_stack_start_req(struct rwnx_hw *rwnx_hw, u8_l on, u8_l efuse_valid, u8_l set_vendor_info,
|
||||
|
|
@ -169,12 +170,17 @@ int rwnx_send_txop_req(struct rwnx_hw *rwnx_hw, uint16_t *txop, u8_l long_nav_en
|
|||
int rwnx_send_set_temp_comp_req(struct rwnx_hw *rwnx_hw, struct mm_set_vendor_swconfig_cfm *cfm);
|
||||
int rwnx_send_vendor_hwconfig_req(struct rwnx_hw *rwnx_hw, uint32_t hwconfig_id, int32_t *param, int32_t *param_out);
|
||||
int rwnx_send_vendor_swconfig_req(struct rwnx_hw *rwnx_hw, uint32_t swconfig_id, int32_t *param_in, int32_t *param_out);
|
||||
int rwnx_send_mask_set_ext_flags_req(struct rwnx_hw *rwnx_hw, uint32_t flags_mask, uint32_t flags_val, struct mm_set_vendor_swconfig_cfm *cfm);
|
||||
int rwnx_send_get_fw_version_req(struct rwnx_hw *rwnx_hw, struct mm_get_fw_version_cfm *cfm);
|
||||
int rwnx_send_txpwr_idx_req(struct rwnx_hw *rwnx_hw);
|
||||
int rwnx_send_txpwr_ofst_req(struct rwnx_hw *rwnx_hw);
|
||||
int rwnx_send_txpwr_ofst2x_req(struct rwnx_hw *rwnx_hw);
|
||||
int rwnx_send_txpwr_lvl_req(struct rwnx_hw *rwnx_hw);
|
||||
int rwnx_send_txpwr_lvl_v3_req(struct rwnx_hw *rwnx_hw);
|
||||
int rwnx_send_txpwr_lvl_adj_req(struct rwnx_hw *rwnx_hw);
|
||||
|
||||
#ifdef CONFIG_SDIO_BT
|
||||
int rwnx_sdio_bt_send_req(struct rwnx_hw *rwnx_hw,uint32_t len, struct sk_buff *skb);
|
||||
#endif
|
||||
|
||||
#endif /* _RWNX_MSG_TX_H_ */
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@ typedef struct
|
|||
txpwr_lvl_conf_t txpwr_lvl;
|
||||
txpwr_lvl_conf_v2_t txpwr_lvl_v2;
|
||||
txpwr_lvl_conf_v3_t txpwr_lvl_v3;
|
||||
txpwr_lvl_adj_conf_t txpwr_lvl_adj;
|
||||
txpwr_loss_conf_t txpwr_loss;
|
||||
txpwr_ofst_conf_t txpwr_ofst;
|
||||
txpwr_ofst2x_conf_t txpwr_ofst2x;
|
||||
|
|
@ -629,6 +630,67 @@ void get_userconfig_xtal_cap(xtal_cap_conf_t *xtal_cap)
|
|||
AICWFDBG(LOGINFO, "%s:xtal_cap_fine:%d\r\n", __func__, xtal_cap->xtal_cap_fine);
|
||||
}
|
||||
|
||||
s8_l get_txpwr_max(s8_l power)
|
||||
{
|
||||
int i=0;
|
||||
|
||||
for (i = 0; i <= 11; i++){
|
||||
if(power < userconfig_info.txpwr_lvl_v3.pwrlvl_11b_11ag_2g4[i])
|
||||
power = userconfig_info.txpwr_lvl_v3.pwrlvl_11b_11ag_2g4[i];
|
||||
}
|
||||
for (i = 0; i <= 9; i++){
|
||||
if(power < userconfig_info.txpwr_lvl_v3.pwrlvl_11n_11ac_2g4[i])
|
||||
power = userconfig_info.txpwr_lvl_v3.pwrlvl_11n_11ac_2g4[i];
|
||||
}
|
||||
for (i = 0; i <= 11; i++){
|
||||
if(power < userconfig_info.txpwr_lvl_v3.pwrlvl_11ax_2g4[i])
|
||||
power = userconfig_info.txpwr_lvl_v3.pwrlvl_11ax_2g4[i];
|
||||
}
|
||||
for (i = 4; i <= 11; i++){
|
||||
if(power < userconfig_info.txpwr_lvl_v3.pwrlvl_11a_5g[i])
|
||||
power = userconfig_info.txpwr_lvl_v3.pwrlvl_11a_5g[i];
|
||||
}
|
||||
for (i = 0; i <= 9; i++){
|
||||
if(power < userconfig_info.txpwr_lvl_v3.pwrlvl_11n_11ac_5g[i])
|
||||
power = userconfig_info.txpwr_lvl_v3.pwrlvl_11n_11ac_5g[i];
|
||||
}
|
||||
for (i = 0; i <= 11; i++){
|
||||
if(power < userconfig_info.txpwr_lvl_v3.pwrlvl_11ax_5g[i])
|
||||
power = userconfig_info.txpwr_lvl_v3.pwrlvl_11ax_5g[i];
|
||||
}
|
||||
|
||||
if(userconfig_info.txpwr_loss.loss_enable == 1)
|
||||
power += userconfig_info.txpwr_loss.loss_value;
|
||||
|
||||
printk("%s:txpwr_max:%d \r\n",__func__,power);
|
||||
return power;
|
||||
}
|
||||
|
||||
void set_txpwr_loss_ofst(s8_l value)
|
||||
{
|
||||
int i=0;
|
||||
|
||||
for (i = 0; i <= 11; i++){
|
||||
userconfig_info.txpwr_lvl_v3.pwrlvl_11b_11ag_2g4[i] += value;
|
||||
}
|
||||
for (i = 0; i <= 9; i++){
|
||||
userconfig_info.txpwr_lvl_v3.pwrlvl_11n_11ac_2g4[i] += value;
|
||||
}
|
||||
for (i = 0; i <= 11; i++){
|
||||
userconfig_info.txpwr_lvl_v3.pwrlvl_11ax_2g4[i] += value;
|
||||
}
|
||||
for (i = 4; i <= 11; i++){
|
||||
userconfig_info.txpwr_lvl_v3.pwrlvl_11a_5g[i] += value;
|
||||
}
|
||||
for (i = 0; i <= 9; i++){
|
||||
userconfig_info.txpwr_lvl_v3.pwrlvl_11n_11ac_5g[i] += value;
|
||||
}
|
||||
for (i = 0; i <= 11; i++){
|
||||
userconfig_info.txpwr_lvl_v3.pwrlvl_11ax_5g[i] += value;
|
||||
}
|
||||
|
||||
printk("%s:value:%d\r\n", __func__, value);
|
||||
}
|
||||
|
||||
#define MATCH_NODE(type, node, cfg_key) {cfg_key, offsetof(type, node)}
|
||||
|
||||
|
|
@ -1040,6 +1102,26 @@ void rwnx_plat_nvram_set_value_v3(char *command, char *value)
|
|||
userconfig_info.txpwr_lvl_v3.pwrlvl_11ax_5g[10] = rwnx_atoi(value);
|
||||
} else if (!strcmp(command, "lvl_11ax_mcs11_5g")) {
|
||||
userconfig_info.txpwr_lvl_v3.pwrlvl_11ax_5g[11] = rwnx_atoi(value);
|
||||
} else if (!strcmp(command, "lvl_adj_enable")) {
|
||||
userconfig_info.txpwr_lvl_adj.enable = rwnx_atoi(value);
|
||||
} else if (!strcmp(command, "lvl_adj_2g4_chan_1_4")) {
|
||||
userconfig_info.txpwr_lvl_adj.pwrlvl_adj_tbl_2g4[0] = rwnx_atoi(value);
|
||||
} else if (!strcmp(command, "lvl_adj_2g4_chan_5_9")) {
|
||||
userconfig_info.txpwr_lvl_adj.pwrlvl_adj_tbl_2g4[1] = rwnx_atoi(value);
|
||||
} else if (!strcmp(command, "lvl_adj_2g4_chan_10_13")) {
|
||||
userconfig_info.txpwr_lvl_adj.pwrlvl_adj_tbl_2g4[2] = rwnx_atoi(value);
|
||||
} else if (!strcmp(command, "lvl_adj_5g_chan_42")) {
|
||||
userconfig_info.txpwr_lvl_adj.pwrlvl_adj_tbl_5g[0] = rwnx_atoi(value);
|
||||
} else if (!strcmp(command, "lvl_adj_5g_chan_58")) {
|
||||
userconfig_info.txpwr_lvl_adj.pwrlvl_adj_tbl_5g[1] = rwnx_atoi(value);
|
||||
} else if (!strcmp(command, "lvl_adj_5g_chan_106")) {
|
||||
userconfig_info.txpwr_lvl_adj.pwrlvl_adj_tbl_5g[2] = rwnx_atoi(value);
|
||||
} else if (!strcmp(command, "lvl_adj_5g_chan_122")) {
|
||||
userconfig_info.txpwr_lvl_adj.pwrlvl_adj_tbl_5g[3] = rwnx_atoi(value);
|
||||
} else if (!strcmp(command, "lvl_adj_5g_chan_138")) {
|
||||
userconfig_info.txpwr_lvl_adj.pwrlvl_adj_tbl_5g[4] = rwnx_atoi(value);
|
||||
} else if (!strcmp(command, "lvl_adj_5g_chan_155")) {
|
||||
userconfig_info.txpwr_lvl_adj.pwrlvl_adj_tbl_5g[5] = rwnx_atoi(value);
|
||||
} else if (!strcmp(command, "loss_enable")) {
|
||||
userconfig_info.txpwr_loss.loss_enable = rwnx_atoi(value);
|
||||
} else if (!strcmp(command, "loss_value")) {
|
||||
|
|
@ -1875,6 +1957,23 @@ void get_userconfig_txpwr_lvl_v3_in_fdrv(txpwr_lvl_conf_v3_t *txpwr_lvl_v3)
|
|||
AICWFDBG(LOGINFO, "%s:lvl_11ax_mcs11_5g:%d\r\n", __func__, txpwr_lvl_v3->pwrlvl_11ax_5g[11]);
|
||||
}
|
||||
|
||||
void get_userconfig_txpwr_lvl_adj_in_fdrv(txpwr_lvl_adj_conf_t *txpwr_lvl_adj)
|
||||
{
|
||||
*txpwr_lvl_adj = userconfig_info.txpwr_lvl_adj;
|
||||
|
||||
AICWFDBG(LOGINFO, "%s:enable:%d\r\n", __func__, txpwr_lvl_adj->enable);
|
||||
AICWFDBG(LOGINFO, "%s:lvl_adj_2g4_chan_1_4:%d\r\n", __func__, txpwr_lvl_adj->pwrlvl_adj_tbl_2g4[0]);
|
||||
AICWFDBG(LOGINFO, "%s:lvl_adj_2g4_chan_5_9:%d\r\n", __func__, txpwr_lvl_adj->pwrlvl_adj_tbl_2g4[1]);
|
||||
AICWFDBG(LOGINFO, "%s:lvl_adj_2g4_chan_10_13:%d\r\n", __func__, txpwr_lvl_adj->pwrlvl_adj_tbl_2g4[2]);
|
||||
|
||||
AICWFDBG(LOGINFO, "%s:lvl_adj_5g_chan_42:%d\r\n", __func__, txpwr_lvl_adj->pwrlvl_adj_tbl_5g[0]);
|
||||
AICWFDBG(LOGINFO, "%s:lvl_adj_5g_chan_58:%d\r\n", __func__, txpwr_lvl_adj->pwrlvl_adj_tbl_5g[1]);
|
||||
AICWFDBG(LOGINFO, "%s:lvl_adj_5g_chan_106:%d\r\n", __func__, txpwr_lvl_adj->pwrlvl_adj_tbl_5g[2]);
|
||||
AICWFDBG(LOGINFO, "%s:lvl_adj_5g_chan_122:%d\r\n", __func__, txpwr_lvl_adj->pwrlvl_adj_tbl_5g[3]);
|
||||
AICWFDBG(LOGINFO, "%s:lvl_adj_5g_chan_138:%d\r\n", __func__, txpwr_lvl_adj->pwrlvl_adj_tbl_5g[4]);
|
||||
AICWFDBG(LOGINFO, "%s:lvl_adj_5g_chan_155:%d\r\n", __func__, txpwr_lvl_adj->pwrlvl_adj_tbl_5g[5]);
|
||||
}
|
||||
|
||||
/**
|
||||
* rwnx_plat_userconfig_load ---Load aic_userconfig.txt
|
||||
*@filename name of config
|
||||
|
|
|
|||
|
|
@ -117,10 +117,13 @@ void rwnx_platform_unregister_drv(void);
|
|||
void get_userconfig_txpwr_idx(txpwr_idx_conf_t *txpwr_idx);
|
||||
void get_userconfig_txpwr_ofst(txpwr_ofst_conf_t *txpwr_ofst);
|
||||
void get_userconfig_xtal_cap(xtal_cap_conf_t *xtal_cap);
|
||||
s8_l get_txpwr_max(s8_l power);
|
||||
void set_txpwr_loss_ofst(s8_l value);
|
||||
|
||||
void get_userconfig_txpwr_lvl_in_fdrv(txpwr_lvl_conf_t *txpwr_lvl);
|
||||
void get_userconfig_txpwr_lvl_v2_in_fdrv(txpwr_lvl_conf_v2_t *txpwr_lvl_v2);
|
||||
void get_userconfig_txpwr_lvl_v3_in_fdrv(txpwr_lvl_conf_v3_t *txpwr_lvl_v3);
|
||||
void get_userconfig_txpwr_lvl_adj_in_fdrv(txpwr_lvl_adj_conf_t *txpwr_lvl_adj);
|
||||
|
||||
void get_userconfig_txpwr_ofst_in_fdrv(txpwr_ofst_conf_t *txpwr_ofst);
|
||||
void get_userconfig_txpwr_ofst2x_in_fdrv(txpwr_ofst2x_conf_t *txpwr_ofst2x);
|
||||
|
|
|
|||
|
|
@ -681,6 +681,9 @@ static void rwnx_rx_mgmt(struct rwnx_hw *rwnx_hw, struct rwnx_vif *rwnx_vif,
|
|||
const u8* ie;
|
||||
u32 len;
|
||||
|
||||
if(skb->data[0]!=0x80)
|
||||
AICWFDBG(LOGDEBUG,"rxmgmt:%x,%x\n", skb->data[0], skb->data[1]);
|
||||
|
||||
if (ieee80211_is_assoc_req(mgmt->frame_control) && rwnx_vif->wdev.iftype == NL80211_IFTYPE_AP) {
|
||||
printk("ASSOC_REQ: sta_idx %d MAC %pM\n", rwnx_vif->ap.aic_index, mgmt->sa);
|
||||
sta->sta_idx = rwnx_vif->ap.aic_index;
|
||||
|
|
@ -1771,7 +1774,7 @@ int reord_process_unit(struct aicwf_rx_priv *rx_priv, struct sk_buff *skb, u16 s
|
|||
|
||||
spin_lock_bh(&preorder_ctrl->reord_list_lock);
|
||||
if (reord_need_check(preorder_ctrl, pframe->seq_num)) {
|
||||
#if 0
|
||||
#if 1
|
||||
if(pframe->rx_data[42] == 0x80){//this is rtp package
|
||||
if(pframe->seq_num == preorder_ctrl->ind_sn){
|
||||
printk("%s pframe->seq_num1:%d \r\n", __func__, pframe->seq_num);
|
||||
|
|
@ -1943,7 +1946,7 @@ void rwnx_rxdata_process_amsdu(struct rwnx_hw *rwnx_hw, struct sk_buff *skb, u8
|
|||
}
|
||||
//printk("sublen = %d, %x, %x, %x, %x\r\n", sublen,skb->data[0], skb->data[1], skb->data[12], skb->data[13]);
|
||||
#if 1
|
||||
sub_skb = __dev_alloc_skb(sublen - 6 + 12, GFP_KERNEL);
|
||||
sub_skb = __dev_alloc_skb(sublen - 6 + 12, GFP_ATOMIC);
|
||||
if(!sub_skb){
|
||||
printk("sub_skb alloc fail:%d\n", sublen);
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -169,7 +169,7 @@ void rwnx_ps_bh_traffic_req(struct rwnx_hw *rwnx_hw, struct rwnx_sta *sta,
|
|||
// sta->mac_addr))
|
||||
// return;
|
||||
if (!sta->ps.active) {
|
||||
printk("sta %pM is not in Power Save mode", sta->mac_addr);
|
||||
AICWFDBG(LOGTRACE,"sta %pM is not in Power Save mode", sta->mac_addr);
|
||||
return;
|
||||
}
|
||||
#ifdef CREATE_TRACE_POINTS
|
||||
|
|
@ -641,7 +641,10 @@ void rwnx_tx_push(struct rwnx_hw *rwnx_hw, struct rwnx_txhdr *txhdr, int flags)
|
|||
sw_txhdr->need_cfm = 1;
|
||||
sw_txhdr->desc.host.hostid = ((1<<31) | rwnx_hw->sdio_env.txdesc_free_idx[0]);
|
||||
aicwf_sdio_host_txdesc_push(&(rwnx_hw->sdio_env), 0, (long)skb);
|
||||
AICWFDBG(LOGINFO, "need cfm ethertype:%8x,user_idx=%d, skb=%p\n", sw_txhdr->desc.host.ethertype, rwnx_hw->sdio_env.txdesc_free_idx[0], skb);
|
||||
if((sw_txhdr->desc.host.flags & TXU_CNTRL_MGMT))
|
||||
AICWFDBG(LOGINFO, "need cfm mgmt:%x,user_idx=%d, skb=%p\n", *(skb->data+sw_txhdr->headroom), rwnx_hw->sdio_env.txdesc_free_idx[0], skb);
|
||||
else
|
||||
AICWFDBG(LOGINFO, "need cfm ethertype:%8x,user_idx=%d, skb=%p\n", sw_txhdr->desc.host.ethertype, rwnx_hw->sdio_env.txdesc_free_idx[0], skb);
|
||||
} else {
|
||||
sw_txhdr->need_cfm = 0;
|
||||
sw_txhdr->desc.host.hostid = 0;
|
||||
|
|
@ -1418,6 +1421,9 @@ netdev_tx_t rwnx_start_xmit(struct sk_buff *skb, struct net_device *dev)
|
|||
skb = newskb;
|
||||
}
|
||||
|
||||
if(skb->priority < 3)
|
||||
skb->priority = 0;
|
||||
|
||||
#ifdef CONFIG_FILTER_TCP_ACK
|
||||
msgbuf=intf_tcp_alloc_msg(msgbuf);
|
||||
msgbuf->rwnx_vif=rwnx_vif;
|
||||
|
|
@ -1615,6 +1621,8 @@ int rwnx_start_mgmt_xmit(struct rwnx_vif *vif, struct rwnx_sta *sta,
|
|||
bool no_cck = params->no_cck;
|
||||
#endif
|
||||
|
||||
AICWFDBG(LOGDEBUG,"mgmt xmit %x %x ",buf[0],buf[1]);
|
||||
|
||||
if((g_rwnx_plat->sdiodev->chipid == PRODUCT_ID_AIC8801) ||
|
||||
((g_rwnx_plat->sdiodev->chipid == PRODUCT_ID_AIC8800DC ||
|
||||
g_rwnx_plat->sdiodev->chipid == PRODUCT_ID_AIC8800DW) && chip_id < 3)){
|
||||
|
|
|
|||
|
|
@ -19,6 +19,11 @@
|
|||
#ifdef CONFIG_RWNX_FULLMAC
|
||||
const int nx_tid_prio[NX_NB_TID_PER_STA] = {7, 6, 5, 4, 3, 0, 2, 1};
|
||||
|
||||
#ifdef CONFIG_TX_NETIF_FLOWCTRL
|
||||
extern int tx_fc_low_water;
|
||||
extern int tx_fc_high_water;
|
||||
#endif
|
||||
|
||||
static inline int rwnx_txq_sta_idx(struct rwnx_sta *sta, u8 tid)
|
||||
{
|
||||
if (is_multicast_sta(sta->sta_idx)){
|
||||
|
|
@ -853,9 +858,17 @@ int rwnx_txq_queue_skb(struct sk_buff *skb, struct rwnx_txq *txq,
|
|||
/* Flowctrl corresponding netdev queue if needed */
|
||||
#ifdef CONFIG_RWNX_FULLMAC
|
||||
#ifndef CONFIG_ONE_TXQ
|
||||
|
||||
#ifdef CONFIG_TX_NETIF_FLOWCTRL
|
||||
if ((txq->ndev_idx != NDEV_NO_TXQ) && ((skb_queue_len(&txq->sk_list) > RWNX_NDEV_FLOW_CTRL_STOP) &&
|
||||
!rwnx_hw->sdiodev->flowctrl)) {
|
||||
// (atomic_read(&rwnx_hw->sdiodev->tx_priv->tx_pktcnt) >= tx_fc_high_water))) {
|
||||
#else
|
||||
/* If too many buffer are queued for this TXQ stop netdev queue */
|
||||
if ((txq->ndev_idx != NDEV_NO_TXQ) &&
|
||||
(skb_queue_len(&txq->sk_list) > RWNX_NDEV_FLOW_CTRL_STOP)) {
|
||||
#endif
|
||||
|
||||
txq->status |= RWNX_TXQ_NDEV_FLOW_CTRL;
|
||||
netif_stop_subqueue(txq->ndev, txq->ndev_idx);
|
||||
#ifdef CREATE_TRACE_POINT
|
||||
|
|
@ -1292,8 +1305,14 @@ void rwnx_hwq_process(struct rwnx_hw *rwnx_hw, struct rwnx_hwq *hwq)
|
|||
}
|
||||
#ifndef CONFIG_ONE_TXQ
|
||||
/* restart netdev queue if number of queued buffer is below threshold */
|
||||
#ifdef CONFIG_TX_NETIF_FLOWCTRL
|
||||
if (unlikely(txq->status & RWNX_TXQ_NDEV_FLOW_CTRL) &&
|
||||
(skb_queue_len(&txq->sk_list) < RWNX_NDEV_FLOW_CTRL_RESTART)) {
|
||||
#else
|
||||
if (unlikely(txq->status & RWNX_TXQ_NDEV_FLOW_CTRL) &&
|
||||
skb_queue_len(&txq->sk_list) < RWNX_NDEV_FLOW_CTRL_RESTART) {
|
||||
#endif
|
||||
|
||||
txq->status &= ~RWNX_TXQ_NDEV_FLOW_CTRL;
|
||||
netif_wake_subqueue(txq->ndev, txq->ndev_idx);
|
||||
#ifdef CREATE_TRACE_POINTS
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#define RWNX_VERS_REV "241c091M (master)"
|
||||
#define RWNX_VERS_MOD "6.4.3.0"
|
||||
#define RWNX_VERS_BANNER "rwnx v6.4.3.0 - - 241c091M (master)"
|
||||
#define RELEASE_DATE "2023_1219_3cf85031"
|
||||
#define RELEASE_DATE "2024_0615_c3cb37b3"
|
||||
|
|
|
|||
|
|
@ -82,5 +82,9 @@ void aicwf_wakeup_lock_deinit(struct rwnx_hw *rwnx_hw)
|
|||
rwnx_wakeup_deinit(rwnx_hw->ws_rx);
|
||||
rwnx_wakeup_deinit(rwnx_hw->ws_irqrx);
|
||||
rwnx_wakeup_deinit(rwnx_hw->ws_pwrctrl);
|
||||
rwnx_hw->ws_tx = NULL;
|
||||
rwnx_hw->ws_rx = NULL;
|
||||
rwnx_hw->ws_irqrx = NULL;
|
||||
rwnx_hw->ws_pwrctrl = NULL;
|
||||
}
|
||||
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
sysdrv/drv_ko/wifi/aic8800dc/aic8800dc_fw/fmacfw_patch_8800dc_hbt_u02.bin
Executable file
BIN
sysdrv/drv_ko/wifi/aic8800dc/aic8800dc_fw/fmacfw_patch_8800dc_hbt_u02.bin
Executable file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
sysdrv/drv_ko/wifi/aic8800dc/aic8800dc_fw/fmacfw_patch_tbl_8800dc_hbt_u02.bin
Executable file
BIN
sysdrv/drv_ko/wifi/aic8800dc/aic8800dc_fw/fmacfw_patch_tbl_8800dc_hbt_u02.bin
Executable file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -81,7 +81,7 @@
|
|||
hsync-active = <0>;
|
||||
vsync-active = <0>;
|
||||
de-active = <0>;
|
||||
pixelclk-active = <1>;
|
||||
pixelclk-active = <0>;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -24,6 +24,17 @@
|
|||
reset-gpios = <&gpio1 RK_PA2 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
wireless_bluetooth: wireless-bluetooth {
|
||||
compatible = "bluetooth-platdata";
|
||||
uart_rts_gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_LOW>;
|
||||
pinctrl-names = "default", "rts_gpio";
|
||||
pinctrl-0 = <&uart1m0_rtsn>;
|
||||
pinctrl-1 = <&uart1_gpios>;
|
||||
BT,wake_gpio = <&gpio0 RK_PA2 GPIO_ACTIVE_HIGH>;
|
||||
BT,wake_host_irq = <&gpio1 RK_PA2 GPIO_ACTIVE_HIGH>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
/**********EMMC**********/
|
||||
|
|
@ -95,16 +106,13 @@
|
|||
&uart1 {
|
||||
status = "okay";
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&uart1m0_xfer &uart1m0_ctsn &uart1m0_rtsn>;
|
||||
pinctrl-0 = <&uart1m0_xfer &uart1m0_ctsn>;
|
||||
};
|
||||
|
||||
&pinctrl {
|
||||
uart1 {
|
||||
uart1m0_ctsn: uart1m0-ctsn{
|
||||
rockchip,pins = <0 RK_PA6 2 &pcfg_pull_down>;
|
||||
};
|
||||
uart1m0_rtsn: uart1m0-rtsn{
|
||||
rockchip,pins = <0 RK_PA5 2 &pcfg_pull_down>;
|
||||
wireless-bluetooth {
|
||||
uart1_gpios: uart1-gpios {
|
||||
rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_none>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
|
@ -2275,6 +2275,11 @@ int mmc_start_init(struct mmc *mmc)
|
|||
|
||||
/* Test for SD version 2 */
|
||||
err = mmc_send_if_cond(mmc);
|
||||
if(err){
|
||||
mmc_go_idle(mmc);
|
||||
mmc_get_blk_desc(mmc)->hwpart = 0;
|
||||
mmc_send_if_cond(mmc);
|
||||
}
|
||||
|
||||
/* Now try to get the SD card's operating condition */
|
||||
err = sd_send_op_cond(mmc);
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ USB_CONFIGS_DIR=${USB_CONFIGFS_DIR}/configs/${USB_SKELETON}
|
|||
# For VBUS_ALWAYS_ON usb otg is not support ums
|
||||
# Since the block to ums is always occupated by USB due to no disconneted state
|
||||
UMS_BLOCK=/userdata/ums_shared.img
|
||||
UMS_BLOCK_SIZE=0 #unit M
|
||||
UMS_BLOCK_SIZE=0 #unit M
|
||||
UMS_BLOCK_TYPE=fat
|
||||
UMS_BLOCK_AUTO_MOUNT=off
|
||||
UMS_RO=0
|
||||
|
|
@ -42,13 +42,11 @@ UVC_U_DIR=${UVC_STREAMING_DIR}/uncompressed/u/
|
|||
UVC_M_DIR=${UVC_STREAMING_DIR}/mjpeg/m/
|
||||
UVC_F_DIR=${UVC_STREAMING_DIR}/framebased/f/
|
||||
|
||||
test_write()
|
||||
{
|
||||
test -e $2 && echo $1 > $2
|
||||
test_write() {
|
||||
test -e $2 && echo $1 >$2
|
||||
}
|
||||
|
||||
function_init()
|
||||
{
|
||||
function_init() {
|
||||
mkdir ${USB_FUNCTIONS_DIR}/uac1.gs0
|
||||
test_write 1 ${USB_FUNCTIONS_DIR}/uac1.gs0/c_feature_unit
|
||||
test_write 1 ${USB_FUNCTIONS_DIR}/uac1.gs0/p_feature_unit
|
||||
|
|
@ -66,38 +64,36 @@ function_init()
|
|||
mkdir ${USB_FUNCTIONS_DIR}/hid.usb0
|
||||
}
|
||||
|
||||
configfs_init()
|
||||
{
|
||||
configfs_init() {
|
||||
echo "Debug: configfs_init"
|
||||
mkdir /dev/usb-ffs
|
||||
|
||||
mount -t configfs none ${CONFIGFS_DIR}
|
||||
mkdir ${USB_CONFIGFS_DIR} -m 0770
|
||||
echo 0x2207 > ${USB_CONFIGFS_DIR}/idVendor
|
||||
echo 0x0310 > ${USB_CONFIGFS_DIR}/bcdDevice
|
||||
echo 0x0200 > ${USB_CONFIGFS_DIR}/bcdUSB
|
||||
mkdir ${USB_STRINGS_DIR} -m 0770
|
||||
SERIAL=`cat /proc/cpuinfo | grep Serial | awk '{print $3}'`
|
||||
if [ -z $SERIAL ];then
|
||||
echo 0x2207 >${USB_CONFIGFS_DIR}/idVendor
|
||||
echo 0x0310 >${USB_CONFIGFS_DIR}/bcdDevice
|
||||
echo 0x0200 >${USB_CONFIGFS_DIR}/bcdUSB
|
||||
mkdir ${USB_STRINGS_DIR} -m 0770
|
||||
SERIAL=$(cat /proc/cpuinfo | grep Serial | awk '{print $3}')
|
||||
if [ -z $SERIAL ]; then
|
||||
SERIAL=0123456789ABCDEF
|
||||
fi
|
||||
echo $SERIAL > ${USB_STRINGS_DIR}/serialnumber
|
||||
echo "rockchip" > ${USB_STRINGS_DIR}/manufacturer
|
||||
echo "rk3xxx" > ${USB_STRINGS_DIR}/product
|
||||
echo $SERIAL >${USB_STRINGS_DIR}/serialnumber
|
||||
echo "rockchip" >${USB_STRINGS_DIR}/manufacturer
|
||||
echo "rk3xxx" >${USB_STRINGS_DIR}/product
|
||||
|
||||
function_init
|
||||
|
||||
mkdir ${USB_CONFIGS_DIR} -m 0770
|
||||
mkdir ${USB_CONFIGS_DIR}/strings/${USB_ATTRIBUTE} -m 0770
|
||||
mkdir ${USB_CONFIGS_DIR} -m 0770
|
||||
mkdir ${USB_CONFIGS_DIR}/strings/${USB_ATTRIBUTE} -m 0770
|
||||
|
||||
echo 0x1 > ${USB_CONFIGFS_DIR}/os_desc/b_vendor_code
|
||||
echo "MSFT100" > ${USB_CONFIGFS_DIR}/os_desc/qw_sign
|
||||
echo 500 > ${USB_CONFIGS_DIR}/MaxPower
|
||||
echo 0x1 >${USB_CONFIGFS_DIR}/os_desc/b_vendor_code
|
||||
echo "MSFT100" >${USB_CONFIGFS_DIR}/os_desc/qw_sign
|
||||
echo 500 >${USB_CONFIGS_DIR}/MaxPower
|
||||
ln -s ${USB_CONFIGS_DIR} ${USB_CONFIGFS_DIR}/os_desc/b.1
|
||||
}
|
||||
|
||||
make_config_string()
|
||||
{
|
||||
make_config_string() {
|
||||
tmp=$CONFIG_STRING
|
||||
if [ -n "$CONFIG_STRING" ]; then
|
||||
CONFIG_STRING=${tmp}_${1}
|
||||
|
|
@ -106,131 +102,127 @@ make_config_string()
|
|||
fi
|
||||
}
|
||||
|
||||
parse_parameter()
|
||||
{
|
||||
parse_parameter() {
|
||||
# find name and var
|
||||
NAME=`echo $1 | awk -F "=" '{print $1}'`
|
||||
VAR=`echo $1 | awk -F "=" '{print $2}'`
|
||||
NAME=$(echo $1 | awk -F "=" '{print $1}')
|
||||
VAR=$(echo $1 | awk -F "=" '{print $2}')
|
||||
|
||||
case "$NAME" in
|
||||
ums_block)
|
||||
UMS_BLOCK=${VAR}
|
||||
;;
|
||||
ums_block_size)
|
||||
if [ ! "$VAR" -gt 0 ] 2>/dev/null ;then
|
||||
echo "$VAR is not a number"
|
||||
exit 1
|
||||
fi
|
||||
UMS_BLOCK_SIZE=${VAR}
|
||||
;;
|
||||
ums_block_type)
|
||||
UMS_BLOCK_TYPE=${VAR}
|
||||
;;
|
||||
ums_block_auto_mount)
|
||||
UMS_BLOCK_AUTO_MOUNT=${VAR}
|
||||
;;
|
||||
ums_ro)
|
||||
if [ "$VAR" != "off" ]; then
|
||||
echo "Set UMS read-only"
|
||||
UMS_RO=1
|
||||
fi
|
||||
UMS_RO=0
|
||||
;;
|
||||
ums_block)
|
||||
UMS_BLOCK=${VAR}
|
||||
;;
|
||||
ums_block_size)
|
||||
if [ ! "$VAR" -gt 0 ] 2>/dev/null; then
|
||||
echo "$VAR is not a number"
|
||||
exit 1
|
||||
fi
|
||||
UMS_BLOCK_SIZE=${VAR}
|
||||
;;
|
||||
ums_block_type)
|
||||
UMS_BLOCK_TYPE=${VAR}
|
||||
;;
|
||||
ums_block_auto_mount)
|
||||
UMS_BLOCK_AUTO_MOUNT=${VAR}
|
||||
;;
|
||||
ums_ro)
|
||||
if [ "$VAR" != "off" ]; then
|
||||
echo "Set UMS read-only"
|
||||
UMS_RO=1
|
||||
fi
|
||||
UMS_RO=0
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
parameter_init()
|
||||
{
|
||||
while read line
|
||||
do
|
||||
parameter_init() {
|
||||
while read line; do
|
||||
case "$line" in
|
||||
usb_mtp_en)
|
||||
MTP_EN=on
|
||||
make_config_string mtp
|
||||
;;
|
||||
usb_adb_en)
|
||||
ADB_EN=on
|
||||
make_config_string adb
|
||||
;;
|
||||
usb_ums_en)
|
||||
UMS_EN=on
|
||||
make_config_string ums
|
||||
;;
|
||||
usb_ntb_en)
|
||||
NTB_EN=on
|
||||
make_config_string ntb
|
||||
;;
|
||||
usb_acm_en)
|
||||
ACM_EN=on
|
||||
make_config_string acm
|
||||
;;
|
||||
usb_uac1_en)
|
||||
UAC1_EN=on
|
||||
make_config_string uac1
|
||||
;;
|
||||
usb_uac2_en)
|
||||
UAC2_EN=on
|
||||
make_config_string uac2
|
||||
;;
|
||||
usb_uvc_en)
|
||||
UVC_EN=on
|
||||
make_config_string uvc
|
||||
;;
|
||||
usb_rndis_en)
|
||||
RNDIS_EN=on
|
||||
make_config_string rndis
|
||||
;;
|
||||
usb_hid_en)
|
||||
HID_EN=on
|
||||
make_config_string hid
|
||||
;;
|
||||
*)
|
||||
parse_parameter ${line}
|
||||
;;
|
||||
esac
|
||||
done < $USB_CONFIG_FILE
|
||||
|
||||
case "$CONFIG_STRING" in
|
||||
ums)
|
||||
PID=0x0000
|
||||
usb_mtp_en)
|
||||
MTP_EN=on
|
||||
make_config_string mtp
|
||||
;;
|
||||
mtp)
|
||||
PID=0x0001
|
||||
usb_adb_en)
|
||||
ADB_EN=on
|
||||
make_config_string adb
|
||||
;;
|
||||
adb)
|
||||
PID=0x0006
|
||||
usb_ums_en)
|
||||
UMS_EN=on
|
||||
make_config_string ums
|
||||
;;
|
||||
mtp_adb | adb_mtp)
|
||||
PID=0x0011
|
||||
usb_ntb_en)
|
||||
NTB_EN=on
|
||||
make_config_string ntb
|
||||
;;
|
||||
ums_adb | adb_ums)
|
||||
PID=0x0018
|
||||
usb_acm_en)
|
||||
ACM_EN=on
|
||||
make_config_string acm
|
||||
;;
|
||||
acm)
|
||||
PID=0x1005
|
||||
usb_uac1_en)
|
||||
UAC1_EN=on
|
||||
make_config_string uac1
|
||||
;;
|
||||
usb_uac2_en)
|
||||
UAC2_EN=on
|
||||
make_config_string uac2
|
||||
;;
|
||||
usb_uvc_en)
|
||||
UVC_EN=on
|
||||
make_config_string uvc
|
||||
;;
|
||||
usb_rndis_en)
|
||||
RNDIS_EN=on
|
||||
make_config_string rndis
|
||||
;;
|
||||
usb_hid_en)
|
||||
HID_EN=on
|
||||
make_config_string hid
|
||||
;;
|
||||
*)
|
||||
PID=0x0019
|
||||
parse_parameter ${line}
|
||||
;;
|
||||
esac
|
||||
done <$USB_CONFIG_FILE
|
||||
|
||||
case "$CONFIG_STRING" in
|
||||
ums)
|
||||
PID=0x0000
|
||||
;;
|
||||
mtp)
|
||||
PID=0x0001
|
||||
;;
|
||||
adb)
|
||||
PID=0x0006
|
||||
;;
|
||||
mtp_adb | adb_mtp)
|
||||
PID=0x0011
|
||||
;;
|
||||
ums_adb | adb_ums)
|
||||
PID=0x0018
|
||||
;;
|
||||
acm)
|
||||
PID=0x1005
|
||||
;;
|
||||
*)
|
||||
PID=0x0019
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
use_os_desc()
|
||||
{
|
||||
if [ $MTP_EN = on ];then
|
||||
echo "MTP" > ${USB_FUNCTIONS_DIR}/mtp.gs0/os_desc/interface.MTP/compatible_id
|
||||
echo 1 > ${USB_CONFIGFS_DIR}/os_desc/use
|
||||
use_os_desc() {
|
||||
if [ $MTP_EN = on ]; then
|
||||
echo "MTP" >${USB_FUNCTIONS_DIR}/mtp.gs0/os_desc/interface.MTP/compatible_id
|
||||
echo 1 >${USB_CONFIGFS_DIR}/os_desc/use
|
||||
fi
|
||||
}
|
||||
|
||||
pre_run_binary()
|
||||
{
|
||||
if [ $ADB_EN = on ];then
|
||||
pre_run_binary() {
|
||||
if [ $ADB_EN = on ]; then
|
||||
mkdir /dev/usb-ffs/adb -m 0770
|
||||
mount -o uid=2000,gid=2000 -t functionfs adb /dev/usb-ffs/adb
|
||||
start-stop-daemon --start --quiet --background --exec /usr/bin/adbd
|
||||
fi
|
||||
|
||||
if [ $NTB_EN = on ];then
|
||||
if [ $NTB_EN = on ]; then
|
||||
mkdir /dev/usb-ffs/ntb -m 0770
|
||||
mount -o uid=2000,gid=2000 -t functionfs ntb /dev/usb-ffs/ntb
|
||||
# Not start app here
|
||||
|
|
@ -239,65 +231,60 @@ pre_run_binary()
|
|||
# Add uvc app here with start-stop-daemon
|
||||
}
|
||||
|
||||
configure_uvc_resolution_yuyv()
|
||||
{
|
||||
configure_uvc_resolution_yuyv() {
|
||||
W=$1
|
||||
H=$2
|
||||
DIR=${UVC_U_DIR}/${H}p/
|
||||
mkdir ${DIR}
|
||||
echo $W > ${DIR}/wWidth
|
||||
echo $H > ${DIR}/wHeight
|
||||
echo 333333 > ${DIR}/dwDefaultFrameInterval
|
||||
echo $((W*H*20)) > ${DIR}/dwMinBitRate
|
||||
echo $((W*H*20)) > ${DIR}/dwMaxBitRate
|
||||
echo $((W*H*2)) > ${DIR}/dwMaxVideoFrameBufferSize
|
||||
echo -e "333333\n666666\n1000000\n2000000" > ${DIR}/dwFrameInterval
|
||||
echo $W >${DIR}/wWidth
|
||||
echo $H >${DIR}/wHeight
|
||||
echo 333333 >${DIR}/dwDefaultFrameInterval
|
||||
echo $((W * H * 20)) >${DIR}/dwMinBitRate
|
||||
echo $((W * H * 20)) >${DIR}/dwMaxBitRate
|
||||
echo $((W * H * 2)) >${DIR}/dwMaxVideoFrameBufferSize
|
||||
echo -e "333333\n666666\n1000000\n2000000" >${DIR}/dwFrameInterval
|
||||
}
|
||||
|
||||
configure_uvc_resolution_mjpeg()
|
||||
{
|
||||
configure_uvc_resolution_mjpeg() {
|
||||
W=$1
|
||||
H=$2
|
||||
DIR=${UVC_M_DIR}/${H}p/
|
||||
mkdir ${DIR}
|
||||
echo $W > ${DIR}/wWidth
|
||||
echo $H > ${DIR}/wHeight
|
||||
echo 333333 > ${DIR}/dwDefaultFrameInterval
|
||||
echo $((W*H*20)) > ${DIR}/dwMinBitRate
|
||||
echo $((W*H*20)) > ${DIR}/dwMaxBitRate
|
||||
echo $((W*H*2)) > ${DIR}/dwMaxVideoFrameBufferSize
|
||||
echo -e "333333\n666666\n1000000\n2000000" > ${DIR}/dwFrameInterval
|
||||
echo $W >${DIR}/wWidth
|
||||
echo $H >${DIR}/wHeight
|
||||
echo 333333 >${DIR}/dwDefaultFrameInterval
|
||||
echo $((W * H * 20)) >${DIR}/dwMinBitRate
|
||||
echo $((W * H * 20)) >${DIR}/dwMaxBitRate
|
||||
echo $((W * H * 2)) >${DIR}/dwMaxVideoFrameBufferSize
|
||||
echo -e "333333\n666666\n1000000\n2000000" >${DIR}/dwFrameInterval
|
||||
}
|
||||
|
||||
configure_uvc_resolution_h264()
|
||||
{
|
||||
configure_uvc_resolution_h264() {
|
||||
W=$1
|
||||
H=$2
|
||||
DIR=${UVC_F_DIR}/${H}p/
|
||||
mkdir ${DIR}
|
||||
echo $W > ${DIR}/wWidth
|
||||
echo $H > ${DIR}/wHeight
|
||||
echo 333333 > ${DIR}/dwDefaultFrameInterval
|
||||
echo $((W*H*10)) > ${DIR}/dwMinBitRate
|
||||
echo $((W*H*10)) > ${DIR}/dwMaxBitRate
|
||||
echo $W >${DIR}/wWidth
|
||||
echo $H >${DIR}/wHeight
|
||||
echo 333333 >${DIR}/dwDefaultFrameInterval
|
||||
echo $((W * H * 10)) >${DIR}/dwMinBitRate
|
||||
echo $((W * H * 10)) >${DIR}/dwMaxBitRate
|
||||
#echo $((W*H*2)) > ${DIR}/dwMaxVideoFrameBufferSize
|
||||
echo -e "333333\n666666\n1000000\n2000000" > ${DIR}/dwFrameInterval
|
||||
echo -e "333333\n666666\n1000000\n2000000" >${DIR}/dwFrameInterval
|
||||
}
|
||||
|
||||
syslink_function()
|
||||
{
|
||||
syslink_function() {
|
||||
ln -s ${USB_FUNCTIONS_DIR}/$1 ${USB_CONFIGS_DIR}/f${USB_FUNCTIONS_CNT}
|
||||
let USB_FUNCTIONS_CNT=USB_FUNCTIONS_CNT+1
|
||||
}
|
||||
|
||||
bind_functions()
|
||||
{
|
||||
bind_functions() {
|
||||
USB_FUNCTIONS_CNT=1
|
||||
|
||||
test $UAC1_EN = on && syslink_function uac1.gs0
|
||||
test $UAC2_EN = on && syslink_function uac2.gs0
|
||||
|
||||
if [ $UVC_EN = on ];then
|
||||
if [ $UVC_EN = on ]; then
|
||||
#echo 3072 > ${UVC_DIR}/streaming_maxpacket
|
||||
#echo 1 > ${UVC_DIR}/streaming_bulk
|
||||
|
||||
|
|
@ -342,55 +329,52 @@ bind_functions()
|
|||
test $ACM_EN = on && syslink_function acm.gs6
|
||||
|
||||
if [ $HID_EN = on ]; then
|
||||
echo 1 > /sys/kernel/config/usb_gadget/rockchip/functions/hid.usb0/protocol
|
||||
echo 1 > /sys/kernel/config/usb_gadget/rockchip/functions/hid.usb0/subclass
|
||||
echo 8 > /sys/kernel/config/usb_gadget/rockchip/functions/hid.usb0/report_length
|
||||
echo -ne \\x05\\x01\\x09\\x06\\xa1\\x01\\x05\\x07\\x19\\xe0\\x29\\xe7\\x15\\x00\\x25\\x01\\x75\\x01\\x95\\x08\\x81\\x02\\x95\\x01\\x75\\x08\\x81\\x03\\x95\\x05\\x75\\x01\\x05\\x08\\x19\\x01\\x29\\x05\\x91\\x02\\x95\\x01\\x75\\x03\\x91\\x03\\x95\\x06\\x75\\x08\\x15\\x00\\x25\\x65\\x05\\x07\\x19\\x00\\x29\\x65\\x81\\x00\\xc0 > /sys/kernel/config/usb_gadget/rockchip/functions/hid.usb0/report_desc
|
||||
echo 1 >/sys/kernel/config/usb_gadget/rockchip/functions/hid.usb0/protocol
|
||||
echo 1 >/sys/kernel/config/usb_gadget/rockchip/functions/hid.usb0/subclass
|
||||
echo 8 >/sys/kernel/config/usb_gadget/rockchip/functions/hid.usb0/report_length
|
||||
echo -ne \\x05\\x01\\x09\\x06\\xa1\\x01\\x05\\x07\\x19\\xe0\\x29\\xe7\\x15\\x00\\x25\\x01\\x75\\x01\\x95\\x08\\x81\\x02\\x95\\x01\\x75\\x08\\x81\\x03\\x95\\x05\\x75\\x01\\x05\\x08\\x19\\x01\\x29\\x05\\x91\\x02\\x95\\x01\\x75\\x03\\x91\\x03\\x95\\x06\\x75\\x08\\x15\\x00\\x25\\x65\\x05\\x07\\x19\\x00\\x29\\x65\\x81\\x00\\xc0 >/sys/kernel/config/usb_gadget/rockchip/functions/hid.usb0/report_desc
|
||||
syslink_function hid.usb0
|
||||
fi
|
||||
|
||||
if [ $UMS_EN = on ];then
|
||||
echo ${UMS_RO} > ${USB_FUNCTIONS_DIR}/mass_storage.0/lun.0/ro
|
||||
if [ $UMS_EN = on ]; then
|
||||
echo ${UMS_RO} >${USB_FUNCTIONS_DIR}/mass_storage.0/lun.0/ro
|
||||
if [ "$UMS_BLOCK_SIZE" != "0" -a ! -e ${UMS_BLOCK} ]; then
|
||||
dd if=/dev/zero of=${UMS_BLOCK} bs=1M count=${UMS_BLOCK_SIZE}
|
||||
mkfs.${UMS_BLOCK_TYPE} ${UMS_BLOCK}
|
||||
test $? && echo "Warning: failed to mkfs.${UMS_BLOCK_TYPE} ${UMS_BLOCK}"
|
||||
fi
|
||||
mkdir /mnt/ums -p
|
||||
if [ $UMS_BLOCK_AUTO_MOUNT = on ];then
|
||||
if [ $UMS_BLOCK_AUTO_MOUNT = on ]; then
|
||||
mount ${UMS_BLOCK} /mnt/ums
|
||||
else
|
||||
echo ${UMS_BLOCK} > ${USB_FUNCTIONS_DIR}/mass_storage.0/lun.0/file
|
||||
echo ${UMS_BLOCK} >${USB_FUNCTIONS_DIR}/mass_storage.0/lun.0/file
|
||||
fi
|
||||
syslink_function mass_storage.0
|
||||
fi
|
||||
|
||||
echo ${CONFIG_STRING} > ${USB_CONFIGS_DIR}/strings/${USB_ATTRIBUTE}/configuration
|
||||
echo ${CONFIG_STRING} >${USB_CONFIGS_DIR}/strings/${USB_ATTRIBUTE}/configuration
|
||||
}
|
||||
|
||||
run_binary()
|
||||
{
|
||||
if [ $MTP_EN = on ];then
|
||||
run_binary() {
|
||||
if [ $MTP_EN = on ]; then
|
||||
start-stop-daemon --start --quiet --background --exec /usr/bin/mtp-server
|
||||
fi
|
||||
if [ $RNDIS_EN = on ];then
|
||||
if [ $RNDIS_EN = on ]; then
|
||||
|
||||
sleep .5
|
||||
ifconfig usb0 172.32.0.70
|
||||
ifconfig usb0 up
|
||||
sleep .5
|
||||
ifconfig usb0 172.32.0.70
|
||||
ifconfig usb0 up
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
program_kill()
|
||||
{
|
||||
P_PID=`ps | grep $1 | grep -v grep | awk '{print $1}'`
|
||||
program_kill() {
|
||||
P_PID=$(ps | grep $1 | grep -v grep | awk '{print $1}')
|
||||
test -z ${P_PID} || kill -9 ${P_PID}
|
||||
}
|
||||
|
||||
usb_device_stop()
|
||||
{
|
||||
echo "none" > ${USB_CONFIGFS_DIR}/UDC
|
||||
usb_device_stop() {
|
||||
echo "none" >${USB_CONFIGFS_DIR}/UDC
|
||||
program_kill adbd
|
||||
program_kill mtp-server
|
||||
ls ${USB_CONFIGS_DIR} | grep f[0-9] | xargs -I {} rm ${USB_CONFIGS_DIR}/{}
|
||||
|
|
@ -399,38 +383,38 @@ usb_device_stop()
|
|||
case "$1" in
|
||||
start)
|
||||
ifconfig lo up
|
||||
# if [ ! -e "/tmp/.usb_config" ]; then
|
||||
# echo "$0: Cannot find .usb_config"
|
||||
# # exit 0
|
||||
# USB_CONFIG_FILE=/tmp/.usb_config
|
||||
# echo "usb_adb_en" >> $USB_CONFIG_FILE
|
||||
# fi
|
||||
# if [ ! -e "/tmp/.usb_config" ]; then
|
||||
# echo "$0: Cannot find .usb_config"
|
||||
# # exit 0
|
||||
# USB_CONFIG_FILE=/tmp/.usb_config
|
||||
# echo "usb_adb_en" >> $USB_CONFIG_FILE
|
||||
# fi
|
||||
|
||||
# if [ -e /tmp/.usb_config ]; then
|
||||
# USB_CONFIG_FILE=/tmp/.usb_config
|
||||
# fi
|
||||
# if [ -e /tmp/.usb_config ]; then
|
||||
# USB_CONFIG_FILE=/tmp/.usb_config
|
||||
# fi
|
||||
|
||||
parameter_init
|
||||
# if [ -z $CONFIG_STRING ]; then
|
||||
# echo "$0: no function be selected"
|
||||
# exit 0
|
||||
# fi
|
||||
# if [ -z $CONFIG_STRING ]; then
|
||||
# echo "$0: no function be selected"
|
||||
# exit 0
|
||||
# fi
|
||||
test -d ${USB_CONFIGFS_DIR} || configfs_init
|
||||
use_os_desc
|
||||
echo $PID > ${USB_CONFIGFS_DIR}/idProduct
|
||||
echo $PID >${USB_CONFIGFS_DIR}/idProduct
|
||||
bind_functions
|
||||
pre_run_binary
|
||||
sleep 1
|
||||
UDC=`ls /sys/class/udc/| awk '{print $1}'`
|
||||
echo $UDC > ${USB_CONFIGFS_DIR}/UDC
|
||||
UDC=$(ls /sys/class/udc/ | awk '{print $1}')
|
||||
echo $UDC >${USB_CONFIGFS_DIR}/UDC
|
||||
run_binary
|
||||
;;
|
||||
stop)
|
||||
usb_device_stop
|
||||
;;
|
||||
restart|reload)
|
||||
restart | reload)
|
||||
# Do restart usb by udev
|
||||
echo "USB_FORCE_CHANGED" >> /tmp/.usb_config
|
||||
echo "USB_FORCE_CHANGED" >>/tmp/.usb_config
|
||||
usb_device_stop
|
||||
sleep 1
|
||||
$0 start
|
||||
|
|
@ -440,6 +424,7 @@ restart|reload)
|
|||
*)
|
||||
echo "Usage: $0 {start|stop|restart}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
check_hciconfig() {
|
||||
if command -v hciattach &> /dev/null; then
|
||||
if lsmod | grep -q "aic8800_fdrv"; then
|
||||
hciattach -s 115200 /dev/ttyS1 any 115200 flow nosleep&
|
||||
hciattach -s 1500000 /dev/ttyS1 any 1500000 flow nosleep&
|
||||
sleep 2
|
||||
if hciconfig -a | grep -q "hci0"; then
|
||||
hciconfig hci0 up&
|
||||
|
|
|
|||
|
|
@ -835,7 +835,7 @@ CONFIG_MT=y
|
|||
CONFIG_PARTPROBE=y
|
||||
# CONFIG_RAIDAUTORUN is not set
|
||||
# CONFIG_READAHEAD is not set
|
||||
# CONFIG_RFKILL is not set
|
||||
CONFIG_RFKILL=y
|
||||
CONFIG_RUNLEVEL=y
|
||||
# CONFIG_RX is not set
|
||||
CONFIG_SEEDRNG=y
|
||||
|
|
|
|||
|
|
@ -2,10 +2,19 @@
|
|||
|
||||
if [ "$(cat /proc/device-tree/model)" == "Luckfox Pico Ultra W" ]; then
|
||||
systemctl stop wpa_supplicant
|
||||
if [ -d /usr/ko ]; then
|
||||
cd /usr/ko
|
||||
if [ -d /oem/usr/ko ]; then
|
||||
cd /oem/usr/ko
|
||||
if [ -z "$(ifconfig | grep "wlan0")" ]; then
|
||||
./insmod_wifi.sh
|
||||
insmod cfg80211.ko
|
||||
insmod libarc4.ko
|
||||
insmod ctr.ko
|
||||
insmod ccm.ko
|
||||
insmod aes_generic.ko
|
||||
insmod aic8800_bsp.ko
|
||||
sleep 0.2
|
||||
insmod aic8800_fdrv.ko
|
||||
sleep 2
|
||||
insmod aic8800_btplm.ko
|
||||
else
|
||||
# wait systemctl
|
||||
sleep 0.5
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -1,56 +0,0 @@
|
|||
# AIC USERCONFIG 2022/0803/1707
|
||||
|
||||
# txpwr_lvl
|
||||
enable=1
|
||||
lvl_11b_11ag_1m_2g4=20
|
||||
lvl_11b_11ag_2m_2g4=20
|
||||
lvl_11b_11ag_5m5_2g4=20
|
||||
lvl_11b_11ag_11m_2g4=20
|
||||
lvl_11b_11ag_6m_2g4=20
|
||||
lvl_11b_11ag_9m_2g4=20
|
||||
lvl_11b_11ag_12m_2g4=20
|
||||
lvl_11b_11ag_18m_2g4=20
|
||||
lvl_11b_11ag_24m_2g4=18
|
||||
lvl_11b_11ag_36m_2g4=18
|
||||
lvl_11b_11ag_48m_2g4=16
|
||||
lvl_11b_11ag_54m_2g4=16
|
||||
lvl_11n_11ac_mcs0_2g4=20
|
||||
lvl_11n_11ac_mcs1_2g4=20
|
||||
lvl_11n_11ac_mcs2_2g4=20
|
||||
lvl_11n_11ac_mcs3_2g4=20
|
||||
lvl_11n_11ac_mcs4_2g4=18
|
||||
lvl_11n_11ac_mcs5_2g4=18
|
||||
lvl_11n_11ac_mcs6_2g4=16
|
||||
lvl_11n_11ac_mcs7_2g4=16
|
||||
lvl_11n_11ac_mcs8_2g4=16
|
||||
lvl_11n_11ac_mcs9_2g4=16
|
||||
lvl_11ax_mcs0_2g4=20
|
||||
lvl_11ax_mcs1_2g4=20
|
||||
lvl_11ax_mcs2_2g4=20
|
||||
lvl_11ax_mcs3_2g4=20
|
||||
lvl_11ax_mcs4_2g4=18
|
||||
lvl_11ax_mcs5_2g4=18
|
||||
lvl_11ax_mcs6_2g4=16
|
||||
lvl_11ax_mcs7_2g4=16
|
||||
lvl_11ax_mcs8_2g4=16
|
||||
lvl_11ax_mcs9_2g4=16
|
||||
lvl_11ax_mcs10_2g4=15
|
||||
lvl_11ax_mcs11_2g4=15
|
||||
|
||||
# txpwr_ofst
|
||||
ofst_enable=0
|
||||
ofst_chan_1_4=0
|
||||
ofst_chan_5_9=0
|
||||
ofst_chan_10_13=0
|
||||
ofst_chan_36_64=0
|
||||
ofst_chan_100_120=0
|
||||
ofst_chan_122_140=0
|
||||
ofst_chan_142_165=0
|
||||
|
||||
# xtal cap
|
||||
xtal_enable=0
|
||||
xtal_cap=24
|
||||
xtal_cap_fine=31
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,56 +0,0 @@
|
|||
# AIC USERCONFIG 2022/0803/1707
|
||||
|
||||
# txpwr_lvl
|
||||
enable=1
|
||||
lvl_11b_11ag_1m_2g4=20
|
||||
lvl_11b_11ag_2m_2g4=20
|
||||
lvl_11b_11ag_5m5_2g4=20
|
||||
lvl_11b_11ag_11m_2g4=20
|
||||
lvl_11b_11ag_6m_2g4=20
|
||||
lvl_11b_11ag_9m_2g4=20
|
||||
lvl_11b_11ag_12m_2g4=20
|
||||
lvl_11b_11ag_18m_2g4=20
|
||||
lvl_11b_11ag_24m_2g4=18
|
||||
lvl_11b_11ag_36m_2g4=18
|
||||
lvl_11b_11ag_48m_2g4=16
|
||||
lvl_11b_11ag_54m_2g4=16
|
||||
lvl_11n_11ac_mcs0_2g4=20
|
||||
lvl_11n_11ac_mcs1_2g4=20
|
||||
lvl_11n_11ac_mcs2_2g4=20
|
||||
lvl_11n_11ac_mcs3_2g4=20
|
||||
lvl_11n_11ac_mcs4_2g4=18
|
||||
lvl_11n_11ac_mcs5_2g4=18
|
||||
lvl_11n_11ac_mcs6_2g4=16
|
||||
lvl_11n_11ac_mcs7_2g4=16
|
||||
lvl_11n_11ac_mcs8_2g4=16
|
||||
lvl_11n_11ac_mcs9_2g4=16
|
||||
lvl_11ax_mcs0_2g4=20
|
||||
lvl_11ax_mcs1_2g4=20
|
||||
lvl_11ax_mcs2_2g4=20
|
||||
lvl_11ax_mcs3_2g4=20
|
||||
lvl_11ax_mcs4_2g4=18
|
||||
lvl_11ax_mcs5_2g4=18
|
||||
lvl_11ax_mcs6_2g4=16
|
||||
lvl_11ax_mcs7_2g4=16
|
||||
lvl_11ax_mcs8_2g4=16
|
||||
lvl_11ax_mcs9_2g4=16
|
||||
lvl_11ax_mcs10_2g4=15
|
||||
lvl_11ax_mcs11_2g4=15
|
||||
|
||||
# txpwr_ofst
|
||||
ofst_enable=0
|
||||
ofst_chan_1_4=0
|
||||
ofst_chan_5_9=0
|
||||
ofst_chan_10_13=0
|
||||
ofst_chan_36_64=0
|
||||
ofst_chan_100_120=0
|
||||
ofst_chan_122_140=0
|
||||
ofst_chan_142_165=0
|
||||
|
||||
# xtal cap
|
||||
xtal_enable=0
|
||||
xtal_cap=24
|
||||
xtal_cap_fine=31
|
||||
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -1,24 +0,0 @@
|
|||
#!/bin/sh
|
||||
cmd=$(realpath $0)
|
||||
_DIR=$(dirname $cmd)
|
||||
cd $_DIR
|
||||
|
||||
export PATH=$PATH:/ko
|
||||
|
||||
#aic8800
|
||||
if [ -f /usr/ko/aic8800_fdrv.ko ]; then
|
||||
mkdir -p /oem/usr/ko
|
||||
cp /usr/ko/aic8800dc_fw /oem/usr/ko -r
|
||||
insmod cfg80211.ko
|
||||
insmod libarc4.ko
|
||||
insmod ctr.ko
|
||||
insmod ccm.ko
|
||||
#insmod libaes.ko
|
||||
#insmod aes_generic.ko
|
||||
insmod aic8800_bsp.ko
|
||||
sleep 0.2
|
||||
insmod aic8800_fdrv.ko
|
||||
sleep 2
|
||||
insmod aic8800_btlpm.ko
|
||||
sleep 0.1
|
||||
fi
|
||||
Binary file not shown.
|
|
@ -3,6 +3,9 @@
|
|||
load_luckfoxconfig() {
|
||||
if [ -f /usr/bin/luckfox-config ]; then
|
||||
luckfox-config load
|
||||
fi
|
||||
if [ "$(cat /proc/device-tree/model)" == "Luckfox Pico Ultra" ] ||
|
||||
[ "$(cat /proc/device-tree/model)" == "Luckfox Pico Ultra W" ]; then
|
||||
luckfox_switch_rgb_resolution &
|
||||
fi
|
||||
}
|
||||
|
|
|
|||
|
|
@ -407,8 +407,8 @@ function luckfox_pico_mini_pin_diagram_file() {
|
|||
PWM4_M2 - SPI0_M0_CLK - GPIO1_C1 | | GPIO1_C6 - - PWM10_M1
|
||||
PWM5_M2 - SPI0_M0_MOSI - GPIO1_C2 | | GPIO1_D3 - - PWM11_M2
|
||||
PWM6_M2 - SPI0_M0_MISO - GPIO1_C3 | | GPIO1_D2 - - PWM0_M1
|
||||
PWM8_M1 - UART4_M1_RX - GPIO1_C4 | | GPIO1_D1 - - PWM10_M2
|
||||
PWM9_M1 - UART4_M1_TX - GPIO1_C5 | | GPIO1_D0 - SARADC_M1 - PWM3_M2
|
||||
PWM8_M1 - UART4_M1_RX - GPIO1_C4 | | GPIO1_D1 - UART3_M1_RX - PWM10_M2
|
||||
PWM9_M1 - UART4_M1_TX - GPIO1_C5 | | GPIO1_D0 - UART3_M1_TX - PWM3_M2
|
||||
+ - + - +
|
||||
EOF
|
||||
}
|
||||
|
|
@ -2710,7 +2710,7 @@ elif [ "$1" == "rgb_switch" ]; then
|
|||
"18" "16" \
|
||||
"2" "2" \
|
||||
"0" "0" \
|
||||
"0" "1"
|
||||
"0" "0"
|
||||
elif [ "$(luckfox_get_pin_cfg "RGB_HACTIVE")" == "720" ]; then
|
||||
# 720 -> 480
|
||||
echo "****************************************************"
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user