diff --git a/aic.rules b/aic.rules index a811a40..5c81448 100644 --- a/aic.rules +++ b/aic.rules @@ -2,4 +2,7 @@ KERNEL=="sd*", ATTRS{idVendor}=="a69c", ATTRS{idProduct}=="5721", SYMLINK+="aic KERNEL=="sd*", ATTRS{idVendor}=="a69c", ATTRS{idProduct}=="5723", SYMLINK+="tendaudisk", RUN+="/usr/bin/eject /dev/%k" KERNEL=="sd*", ATTRS{idVendor}=="a69c", ATTRS{idProduct}=="5724", SYMLINK+="ugreenax900", RUN+="/usr/bin/eject /dev/%k" KERNEL=="sd*", ATTRS{idVendor}=="a69c", ATTRS{idProduct}=="5725", SYMLINK+="tendaudiskv2", RUN+="/usr/bin/eject /dev/%k" +KERNEL=="sd*", ATTRS{idVendor}=="a69c", ATTRS{idProduct}=="5726", SYMLINK+="tendaudiskv3", RUN+="/usr/bin/eject /dev/%k" +KERNEL=="sd*", ATTRS{idVendor}=="a69c", ATTRS{idProduct}=="5727", SYMLINK+="tendaudiskv4", RUN+="/usr/bin/eject /dev/%k" +KERNEL=="sd*", ATTRS{idVendor}=="a69c", ATTRS{idProduct}=="572a", SYMLINK+="tendaudiskv5", RUN+="/usr/bin/eject /dev/%k" KERNEL=="sd*", ATTRS{idVendor}=="a69c", ATTRS{idProduct}=="572c", SYMLINK+="cudydiskv2", RUN+="/usr/bin/eject /dev/%k" diff --git a/drivers/aic8800/aic8800_fdrv/Makefile b/drivers/aic8800/aic8800_fdrv/Makefile index edce2c6..53fa11e 100644 --- a/drivers/aic8800/aic8800_fdrv/Makefile +++ b/drivers/aic8800/aic8800_fdrv/Makefile @@ -341,7 +341,6 @@ ccflags-$(CONFIG_TEMP_COMP) += -DCONFIG_TEMP_COMP ccflags-$(CONFIG_POWER_LIMIT) += -DCONFIG_POWER_LIMIT ccflags-$(CONFIG_EXT_FEM_8800DCDW) += -DCONFIG_EXT_FEM_8800DCDW ccflags-$(CONFIG_WOWLAN) += -DCONFIG_WOWLAN -MAKEFLAGS +=-j$(shell nproc) # Platform support list CONFIG_PLATFORM_ROCKCHIP ?= n @@ -381,13 +380,11 @@ KDIR ?= /home/yaya/D/Workspace/CyberQuantum/JinHaoYue/amls905x3/SDK/20191101-0tt endif ifeq ($(CONFIG_PLATFORM_UBUNTU), y) -KDIR ?= /lib/modules/$(shell uname -r)/build -#KDIR ?= ~/D/Workspace/CyberQuantum/Linux/linux-4.15/ +KVER := $(or $(KVER), $(kernelver), $(KERNELRELEASE), $(shell uname -r)) +KDIR ?= /lib/modules/$(KVER)/build PWD ?= $(shell pwd) -KVER ?= $(shell uname -r) MODDESTDIR ?= /lib/modules/$(KVER)/kernel/drivers/net/wireless/aic8800 -SUBARCH = $(shell uname -m | sed -e s/i.86/i386/ -e s/armv.l/arm/ -e s/aarch64/arm64/) -ARCH ?= $(SUBARCH) +ARCH ?= $(shell uname -m | sed -e s/i.86/i386/ -e s/armv.l/arm/ -e s/aarch64/arm64/) CROSS_COMPILE ?= endif diff --git a/drivers/aic8800/aic8800_fdrv/aicwf_compat_8800d80.c b/drivers/aic8800/aic8800_fdrv/aicwf_compat_8800d80.c index 9e98284..81eaabd 100644 --- a/drivers/aic8800/aic8800_fdrv/aicwf_compat_8800d80.c +++ b/drivers/aic8800/aic8800_fdrv/aicwf_compat_8800d80.c @@ -42,12 +42,14 @@ int rwnx_plat_userconfig_load_8800d80(struct rwnx_hw *rwnx_hw){ char *filename = FW_USERCONFIG_NAME_8800D80; if (rwnx_hw->usbdev->pid == USB_PRODUCT_ID_TENDA_U11 || rwnx_hw->usbdev->pid == USB_PRODUCT_ID_AIC8800M80_CUS1 - || rwnx_hw->usbdev->pid == USB_PRODUCT_ID_AIC8800M80_CUS4) { + || rwnx_hw->usbdev->pid == USB_PRODUCT_ID_AIC8800M80_CUS4 + || rwnx_hw->usbdev->pid == USB_PRODUCT_ID_AIC8800M80_CUS7) { filename = FW_USERCONFIG_NAME_8800D80_U11; } else if (rwnx_hw->usbdev->pid == USB_PRODUCT_ID_TENDA_U11_PRO || rwnx_hw->usbdev->pid == USB_PRODUCT_ID_AIC8800M80_CUS3 || rwnx_hw->usbdev->pid == USB_PRODUCT_ID_AIC8800M80_CUS5 - || rwnx_hw->usbdev->pid == USB_PRODUCT_ID_AIC8800M80_CUS6) { + || rwnx_hw->usbdev->pid == USB_PRODUCT_ID_AIC8800M80_CUS6 + || rwnx_hw->usbdev->pid == USB_PRODUCT_ID_AIC8800M80_CUS8) { filename = FW_USERCONFIG_NAME_8800D80_U11_PRO; } else if (rwnx_hw->usbdev->pid == USB_PRODUCT_ID_AIC8800M80_CUS2) { filename = FW_USERCONFIG_NAME_8800D80_U11_CUS; diff --git a/drivers/aic8800/aic8800_fdrv/aicwf_compat_8800dc.c b/drivers/aic8800/aic8800_fdrv/aicwf_compat_8800dc.c index 53dbfcb..3a23045 100644 --- a/drivers/aic8800/aic8800_fdrv/aicwf_compat_8800dc.c +++ b/drivers/aic8800/aic8800_fdrv/aicwf_compat_8800dc.c @@ -3511,12 +3511,15 @@ int rwnx_plat_userconfig_load_8800dw(struct rwnx_hw *rwnx_hw){ int size; u32 *dst=NULL; char *filename = FW_USERCONFIG_NAME_8800DW; - if (rwnx_hw->usbdev->pid == USB_PRODUCT_ID_TENDA) { + if (rwnx_hw->usbdev->pid == USB_PRODUCT_ID_TENDA + || rwnx_hw->usbdev->pid == USB_PRODUCT_ID_AIC8800FC_CUS3 + || rwnx_hw->usbdev->pid == USB_PRODUCT_ID_AIC8800FC_CUS5 + || rwnx_hw->usbdev->pid == USB_PRODUCT_ID_AIC8800FC_CUS6) { filename = FW_USERCONFIG_NAME_8800DW_W311; } else if (rwnx_hw->usbdev->pid == USB_PRODUCT_ID_TENDA_U2 || rwnx_hw->usbdev->pid == USB_PRODUCT_ID_AIC8800FC_CUS1 || rwnx_hw->usbdev->pid == USB_PRODUCT_ID_AIC8800FC_CUS2 - || rwnx_hw->usbdev->pid == USB_PRODUCT_ID_AIC8800FC_CUS3) { + || rwnx_hw->usbdev->pid == USB_PRODUCT_ID_AIC8800FC_CUS4) { filename = FW_USERCONFIG_NAME_8800DW_U2; } diff --git a/drivers/aic8800/aic8800_fdrv/aicwf_sdio.c b/drivers/aic8800/aic8800_fdrv/aicwf_sdio.c index 399a847..100ad6f 100644 --- a/drivers/aic8800/aic8800_fdrv/aicwf_sdio.c +++ b/drivers/aic8800/aic8800_fdrv/aicwf_sdio.c @@ -1001,8 +1001,7 @@ static void aicwf_sdio_bus_pwrctl(struct timer_list *t) #if LINUX_VERSION_CODE < KERNEL_VERSION(4,14,0) struct aic_sdio_dev *sdiodev = (struct aic_sdio_dev *) data; #elif LINUX_VERSION_CODE >= KERNEL_VERSION(6, 16, 0) - struct aic_sdio_dev *sdiodev = timer_container_of(sdiodev, t, timer); -#else + struct aic_sdio_dev *sdiodev = timer_container_of(sdiodev, t, timer);#else struct aic_sdio_dev *sdiodev = from_timer(sdiodev, t, timer); #endif diff --git a/drivers/aic8800/aic8800_fdrv/aicwf_tcp_ack.c b/drivers/aic8800/aic8800_fdrv/aicwf_tcp_ack.c index 3bcfd6e..ba4576b 100644 --- a/drivers/aic8800/aic8800_fdrv/aicwf_tcp_ack.c +++ b/drivers/aic8800/aic8800_fdrv/aicwf_tcp_ack.c @@ -106,8 +106,8 @@ void tcp_ack_deinit(struct rwnx_hw *priv) drop_msg = NULL; write_seqlock_bh(&ack_m->ack_info[i].seqlock); -#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0) - timer_delete(&ack_m->ack_info[i].timer); +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)) + timer_delete(&ack_m->ack_info[i].timer); #else del_timer(&ack_m->ack_info[i].timer); #endif @@ -379,7 +379,7 @@ int tcp_ack_handle(struct msg_buf *new_msgbuf, //printk("%lx \n",ack_info->msgbuf); drop_msg = ack_info->msgbuf; ack_info->msgbuf = NULL; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)) timer_delete(&ack_info->timer); #else del_timer(&ack_info->timer); @@ -417,8 +417,8 @@ int tcp_ack_handle(struct msg_buf *new_msgbuf, atomic_read(&ack_m->max_drop_cnt)))) { ack_info->drop_cnt = 0; ack_info->in_send_msg = new_msgbuf; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0) - timer_delete(&ack_info->timer); +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)) + timer_delete(&ack_info->timer); #else del_timer(&ack_info->timer); #endif @@ -484,8 +484,8 @@ int tcp_ack_handle_new(struct msg_buf *new_msgbuf, ack_info->drop_cnt = 0; //send_msg = new_msgbuf; ack_info->in_send_msg = new_msgbuf; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0) - timer_delete(&ack_info->timer); +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)) + timer_delete(&ack_info->timer); #else del_timer(&ack_info->timer); #endif diff --git a/drivers/aic8800/aic8800_fdrv/aicwf_usb.c b/drivers/aic8800/aic8800_fdrv/aicwf_usb.c index 456a382..838c820 100644 --- a/drivers/aic8800/aic8800_fdrv/aicwf_usb.c +++ b/drivers/aic8800/aic8800_fdrv/aicwf_usb.c @@ -1214,6 +1214,9 @@ fail: usb_buf->skb = NULL; aicwf_usb_tx_queue(usb_dev, &usb_dev->tx_free_list, usb_buf, &usb_dev->tx_free_count, &usb_dev->tx_free_lock); + if (ret == -ENODEV) { + break; + } #endif } } @@ -2150,7 +2153,8 @@ static int aicwf_parse_usb(struct aic_usb_dev *usb_dev, struct usb_interface *in if(usb_dev->chipid == PRODUCT_ID_AIC8800DC){ AICWFDBG(LOGERROR, "AIC8800DC change to AIC8800DW\n"); usb_dev->chipid = PRODUCT_ID_AIC8800DW; - } else if (usb_dev->chipid == PRODUCT_ID_AIC8800D81) { + } + else if (usb_dev->chipid == PRODUCT_ID_AIC8800D81) { AICWFDBG(LOGINFO, "AIC8800D80\n"); } else if(usb_dev->chipid == PRODUCT_ID_AIC8800D81X2 || usb_dev->chipid == PRODUCT_ID_AIC8800D89X2 || @@ -2339,11 +2343,13 @@ static int aicwf_usb_chipmatch(struct aic_usb_dev *usb_dev, u16_l vid, u16_l pid return 0; }else if(pid == USB_PRODUCT_ID_AIC8800DC || pid == USB_PRODUCT_ID_TENDA || pid == USB_PRODUCT_ID_TENDA_U2 || pid == USB_PRODUCT_ID_AIC8800FC_CUS1 - || pid == USB_PRODUCT_ID_AIC8800FC_CUS2 || pid == USB_PRODUCT_ID_AIC8800FC_CUS3){ + || pid == USB_PRODUCT_ID_AIC8800FC_CUS2 || pid == USB_PRODUCT_ID_AIC8800FC_CUS3 + || pid == USB_PRODUCT_ID_AIC8800FC_CUS4 || pid == USB_PRODUCT_ID_AIC8800FC_CUS5 + || pid == USB_PRODUCT_ID_AIC8800FC_CUS6){ usb_dev->chipid = PRODUCT_ID_AIC8800DC; AICWFDBG(LOGINFO, "%s USE AIC8800DC\r\n", __func__); return 0; - }else if(pid == USB_PRODUCT_ID_AIC8800DW){ + }else if(pid == USB_PRODUCT_ID_AIC8800DW || pid == USB_PRODUCT_ID_TENDA_TX1U_NANO){ usb_dev->chipid = PRODUCT_ID_AIC8800DW; AICWFDBG(LOGINFO, "%s USE AIC8800DW\r\n", __func__); return 0; @@ -2352,6 +2358,7 @@ static int aicwf_usb_chipmatch(struct aic_usb_dev *usb_dev, u16_l vid, u16_l pid || pid == USB_PRODUCT_ID_AIC8800M80_CUS1 || pid == USB_PRODUCT_ID_AIC8800M80_CUS2 || pid == USB_PRODUCT_ID_AIC8800M80_CUS3 || pid == USB_PRODUCT_ID_AIC8800M80_CUS4 || pid == USB_PRODUCT_ID_AIC8800M80_CUS5 || pid == USB_PRODUCT_ID_AIC8800M80_CUS6 + || pid == USB_PRODUCT_ID_AIC8800M80_CUS7 || pid == USB_PRODUCT_ID_AIC8800M80_CUS8 || pid == USB_PRODUCT_ID_AIC8800D80_UGREEN){ usb_dev->chipid = PRODUCT_ID_AIC8800D81; aicwf_usb_rx_aggr = true; @@ -2652,6 +2659,7 @@ static struct usb_device_id aicwf_usb_id_table[] = { {USB_DEVICE_AND_INTERFACE_INFO(USB_VENDOR_ID_AIC, USB_PRODUCT_ID_AIC8800D81, 0xff, 0xff, 0xff)}, {USB_DEVICE_AND_INTERFACE_INFO(USB_VENDOR_ID_AIC, USB_PRODUCT_ID_AIC8800D41, 0xff, 0xff, 0xff)}, {USB_DEVICE_AND_INTERFACE_INFO(USB_VENDOR_ID_AIC, USB_PRODUCT_ID_AIC8800DC, 0xff, 0xff, 0xff)}, + {USB_DEVICE_AND_INTERFACE_INFO(USB_VENDOR_ID_TENDA_V2, USB_PRODUCT_ID_TENDA_TX1U_NANO, 0xff, 0xff, 0xff)}, {USB_DEVICE(USB_VENDOR_ID_AIC, USB_PRODUCT_ID_AIC8800DW)}, {USB_DEVICE(USB_VENDOR_ID_AIC, USB_PRODUCT_ID_AIC8800M80_CUS1)}, {USB_DEVICE_AND_INTERFACE_INFO(USB_VENDOR_ID_AIC_V2, USB_PRODUCT_ID_AIC8800D81X2, 0xff, 0xff, 0xff)}, @@ -2664,12 +2672,17 @@ static struct usb_device_id aicwf_usb_id_table[] = { {USB_DEVICE(USB_VENDOR_ID_AIC_V2, USB_PRODUCT_ID_AIC8800FC_CUS1)}, {USB_DEVICE(USB_VENDOR_ID_AIC_V2, USB_PRODUCT_ID_AIC8800FC_CUS2)}, {USB_DEVICE(USB_VENDOR_ID_AIC_V2, USB_PRODUCT_ID_AIC8800FC_CUS3)}, + {USB_DEVICE(USB_VENDOR_ID_AIC_V2, USB_PRODUCT_ID_AIC8800FC_CUS4)}, + {USB_DEVICE(USB_VENDOR_ID_AIC_V2, USB_PRODUCT_ID_AIC8800FC_CUS5)}, + {USB_DEVICE(USB_VENDOR_ID_AIC_V2, USB_PRODUCT_ID_AIC8800FC_CUS6)}, {USB_DEVICE(USB_VENDOR_ID_AIC_V2, USB_PRODUCT_ID_AIC8800M80_CUS1)}, {USB_DEVICE(USB_VENDOR_ID_AIC_V2, USB_PRODUCT_ID_AIC8800M80_CUS2)}, {USB_DEVICE(USB_VENDOR_ID_AIC_V2, USB_PRODUCT_ID_AIC8800M80_CUS3)}, {USB_DEVICE(USB_VENDOR_ID_AIC_V2, USB_PRODUCT_ID_AIC8800M80_CUS4)}, {USB_DEVICE(USB_VENDOR_ID_AIC_V2, USB_PRODUCT_ID_AIC8800M80_CUS5)}, {USB_DEVICE(USB_VENDOR_ID_AIC_V2, USB_PRODUCT_ID_AIC8800M80_CUS6)}, + {USB_DEVICE(USB_VENDOR_ID_AIC_V2, USB_PRODUCT_ID_AIC8800M80_CUS7)}, + {USB_DEVICE(USB_VENDOR_ID_AIC_V2, USB_PRODUCT_ID_AIC8800M80_CUS8)}, {USB_DEVICE(USB_VENDOR_ID_AIC_V2, USB_PRODUCT_ID_AIC8800D80_UGREEN)}, #endif {} diff --git a/drivers/aic8800/aic8800_fdrv/aicwf_usb.h b/drivers/aic8800/aic8800_fdrv/aicwf_usb.h index fa1974a..84403bc 100644 --- a/drivers/aic8800/aic8800_fdrv/aicwf_usb.h +++ b/drivers/aic8800/aic8800_fdrv/aicwf_usb.h @@ -18,6 +18,8 @@ #define USB_VENDOR_ID_AIC 0xA69C #define USB_VENDOR_ID_AIC_V2 0x368B #define USB_VENDOR_ID_TENDA 0x2604 +#define USB_VENDOR_ID_TENDA_V2 0x3625 + #ifndef CONFIG_USB_BT #define USB_PRODUCT_ID_AIC8800 0x8800 @@ -39,16 +41,23 @@ #define USB_PRODUCT_ID_TENDA_U2 0x0014 #define USB_PRODUCT_ID_TENDA_U11 0x001f #define USB_PRODUCT_ID_TENDA_U11_PRO 0x0020 +#define USB_PRODUCT_ID_TENDA_TX1U_NANO 0x0110 #define USB_PRODUCT_ID_AIC8800FC_CUS1 0x88df #define USB_PRODUCT_ID_AIC8800FC_CUS2 0x88E0 #define USB_PRODUCT_ID_AIC8800FC_CUS3 0x88E1 +#define USB_PRODUCT_ID_AIC8800FC_CUS4 0x88E2 +#define USB_PRODUCT_ID_AIC8800FC_CUS5 0x88E3 +#define USB_PRODUCT_ID_AIC8800FC_CUS6 0x88E5 + #define USB_PRODUCT_ID_AIC8800M80_CUS1 0x8D83 #define USB_PRODUCT_ID_AIC8800M80_CUS2 0x8D85 #define USB_PRODUCT_ID_AIC8800M80_CUS3 0x8D86 +#define USB_PRODUCT_ID_AIC8800D80_UGREEN 0x8D88 #define USB_PRODUCT_ID_AIC8800M80_CUS4 0x8D89 #define USB_PRODUCT_ID_AIC8800M80_CUS5 0x8D8A #define USB_PRODUCT_ID_AIC8800M80_CUS6 0x8D8C -#define USB_PRODUCT_ID_AIC8800D80_UGREEN 0x8D88 +#define USB_PRODUCT_ID_AIC8800M80_CUS7 0x8D8B +#define USB_PRODUCT_ID_AIC8800M80_CUS8 0x8D8D #endif enum AICWF_IC{ diff --git a/drivers/aic8800/aic8800_fdrv/rwnx_compat.h b/drivers/aic8800/aic8800_fdrv/rwnx_compat.h index 204561b..7c26d0f 100644 --- a/drivers/aic8800/aic8800_fdrv/rwnx_compat.h +++ b/drivers/aic8800/aic8800_fdrv/rwnx_compat.h @@ -41,7 +41,7 @@ #define IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_MASK IEEE80211_HE_MAC_CAP3_MAX_A_AMPDU_LEN_EXP_MASK #endif -#if LINUX_VERSION_CODE > KERNEL_VERSION(5, 15, 60) +#if LINUX_VERSION_CODE > KERNEL_VERSION(5, 18, 0) #define IEEE80211_MAX_AMPDU_BUF IEEE80211_MAX_AMPDU_BUF_HE #endif diff --git a/drivers/aic8800/aic8800_fdrv/rwnx_main.c b/drivers/aic8800/aic8800_fdrv/rwnx_main.c index c68f6cb..2b1d07a 100644 --- a/drivers/aic8800/aic8800_fdrv/rwnx_main.c +++ b/drivers/aic8800/aic8800_fdrv/rwnx_main.c @@ -2036,11 +2036,11 @@ void aicwf_p2p_alive_timeout(struct timer_list *t) #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0) rwnx_vif = (struct rwnx_vif *)data; rwnx_hw = rwnx_vif->rwnx_hw; - #elif LINUX_VERSION_CODE >= KERNEL_VERSION(6, 16, 0) - rwnx_hw = timer_container_of(rwnx_hw, t, p2p_alive_timer); + #elif LINUX_VERSION_CODE < KERNEL_VERSION(6, 16, 0) + rwnx_hw = from_timer(rwnx_hw, t, p2p_alive_timer); rwnx_vif = rwnx_hw->p2p_dev_vif; #else - rwnx_hw = from_timer(rwnx_hw, t, p2p_alive_timer); + rwnx_hw = timer_container_of(rwnx_hw, t, p2p_alive_timer); rwnx_vif = rwnx_hw->p2p_dev_vif; #endif @@ -2233,10 +2233,10 @@ static void aicwf_pwrloss_timer(struct timer_list *t) #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0) rwnx_vif = (struct rwnx_vif *)data; rwnx_hw = rwnx_vif->rwnx_hw; -#elif LINUX_VERSION_CODE >= KERNEL_VERSION(6, 16, 0) - rwnx_hw = timer_container_of(rwnx_hw, t, pwrloss_timer); -#else +#elif LINUX_VERSION_CODE < KERNEL_VERSION(6, 16, 0) rwnx_hw = from_timer(rwnx_hw, t, pwrloss_timer); +#else + rwnx_hw = timer_container_of(rwnx_hw, t, pwrloss_timer); #endif if (!work_pending(&rwnx_hw->pwrloss_work)) schedule_work(&rwnx_hw->pwrloss_work); @@ -2682,8 +2682,8 @@ static void rwnx_cfgp2p_stop_p2p_device(struct wiphy *wiphy, struct wireless_dev if (rwnx_vif == rwnx_hw->p2p_dev_vif) { rwnx_hw->is_p2p_alive = 0; if (timer_pending(&rwnx_hw->p2p_alive_timer)) { -#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0) - timer_delete_sync(&rwnx_hw->p2p_alive_timer); +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)) + timer_delete_sync(&rwnx_hw->p2p_alive_timer); #else del_timer_sync(&rwnx_hw->p2p_alive_timer); #endif @@ -4092,12 +4092,13 @@ static int rwnx_cfg80211_stop_ap(struct wiphy *wiphy, struct net_device *dev) #ifdef CONFIG_BAND_STEERING rwnx_vif->ap.start = false; aicwf_nl_hook_deinit(rwnx_vif->ap.band, rwnx_vif->rwnx_hw->iface_idx); - if (timer_pending(&rwnx_vif->steer_timer)) -#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0) - timer_delete_sync(&rwnx_vif->steer_timer); + if (timer_pending(&rwnx_vif->steer_timer)) { +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)) + timer_delete_sync(&rwnx_vif->steer_timer); #else - del_timer_sync(&rwnx_vif->steer_timer); + del_timer_sync(&rwnx_vif->steer_timer); #endif + } cancel_work_sync(&rwnx_vif->steer_work); flush_workqueue(rwnx_vif->rsp_wq); destroy_workqueue(rwnx_vif->rsp_wq); @@ -4278,11 +4279,11 @@ void rwnx_cfg80211_mgmt_frame_register(struct wiphy *wiphy, * have changed. The actual parameter values are available in * struct wiphy. If returning an error, no value should be changed. */ -static int rwnx_cfg80211_set_wiphy_params(struct wiphy *wiphy, - #if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 17, 0) - int radio_idx, - #endif - u32 changed) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 17, 0) +static int rwnx_cfg80211_set_wiphy_params(struct wiphy *wiphy, int radio_idx, u32 changed) +#else +static int rwnx_cfg80211_set_wiphy_params(struct wiphy *wiphy, u32 changed) +#endif { return 0; } @@ -4300,7 +4301,7 @@ static int rwnx_cfg80211_set_tx_power(struct wiphy *wiphy, struct wireless_dev *wdev, #endif #if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 17, 0) - int radio_idx, +int radio_idx, #endif enum nl80211_tx_power_setting type, int mbm) { @@ -9037,11 +9038,13 @@ void rwnx_cfg80211_deinit(struct rwnx_hw *rwnx_hw) #ifdef CONFIG_DYNAMIC_PWR if(timer_pending(&rwnx_hw->pwrloss_timer)){ -#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0) - timer_delete_sync(&rwnx_hw->pwrloss_timer); +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)) + timer_delete_sync(&rwnx_hw->pwrloss_timer); #else del_timer_sync(&rwnx_hw->pwrloss_timer); #endif + } + cancel_work_sync(&rwnx_hw->pwrloss_work); #endif @@ -9054,12 +9057,13 @@ void rwnx_cfg80211_deinit(struct rwnx_hw *rwnx_hw) if (!list_empty(&rwnx_hw->defrag_list)) { list_for_each_entry(defrag_ctrl, &rwnx_hw->defrag_list, list) { list_del_init(&defrag_ctrl->list); - if (timer_pending(&defrag_ctrl->defrag_timer)) -#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0) + if (timer_pending(&defrag_ctrl->defrag_timer)) { +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)) timer_delete_sync(&defrag_ctrl->defrag_timer); #else del_timer_sync(&defrag_ctrl->defrag_timer); #endif + } dev_kfree_skb(defrag_ctrl->skb); kfree(defrag_ctrl); } diff --git a/drivers/aic8800/aic8800_fdrv/rwnx_rx.c b/drivers/aic8800/aic8800_fdrv/rwnx_rx.c index 9a2a8a2..be6055e 100644 --- a/drivers/aic8800/aic8800_fdrv/rwnx_rx.c +++ b/drivers/aic8800/aic8800_fdrv/rwnx_rx.c @@ -481,7 +481,9 @@ static bool rwnx_rx_data_skb(struct rwnx_hw *rwnx_hw, struct rwnx_vif *rwnx_vif, rwnx_rxdata_process_amsdu(rwnx_hw, skb, flags_vif_idx, &list); #else int count; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0) +// Debian 6.1.0-26 backported the new function call, but not Ubuntu 6.2. +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0) || \ + (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 109) && LINUX_VERSION_CODE < KERNEL_VERSION(6, 2, 0)) ieee80211_amsdu_to_8023s(skb, &list, rwnx_vif->ndev->dev_addr, RWNX_VIF_TYPE(rwnx_vif), 0, NULL, NULL, false); #else @@ -1584,12 +1586,13 @@ int reord_flush_tid(struct aicwf_rx_priv *rx_priv, struct sk_buff *skb, u8 tid) AICWFDBG(LOGINFO, "flush:tid=%d", tid); preorder_ctrl->enable = false; spin_unlock_irqrestore(&preorder_ctrl->reord_list_lock, flags); - if (timer_pending(&preorder_ctrl->reord_timer)) -#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0) - ret = timer_delete_sync(&preorder_ctrl->reord_timer); + if (timer_pending(&preorder_ctrl->reord_timer)) { +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)) + ret = timer_delete_sync(&preorder_ctrl->reord_timer); #else ret = del_timer_sync(&preorder_ctrl->reord_timer); #endif + } cancel_work_sync(&preorder_ctrl->reord_timer_work); return 0; @@ -1615,8 +1618,8 @@ void reord_deinit_sta(struct aicwf_rx_priv* rx_priv, struct reord_ctrl_info *reo if(preorder_ctrl->enable){ preorder_ctrl->enable = false; if (timer_pending(&preorder_ctrl->reord_timer)) { -#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0) - ret = timer_delete_sync(&preorder_ctrl->reord_timer); +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)) + ret = timer_delete_sync(&preorder_ctrl->reord_timer); #else ret = del_timer_sync(&preorder_ctrl->reord_timer); #endif @@ -1868,10 +1871,10 @@ void reord_timeout_handler (struct timer_list *t) { #if LINUX_VERSION_CODE < KERNEL_VERSION(4,14,0) struct reord_ctrl *preorder_ctrl = (struct reord_ctrl *)data; -#elif LINUX_VERSION_CODE >= KERNEL_VERSION(6, 16, 0) - struct reord_ctrl *preorder_ctrl = timer_container_of(preorder_ctrl, t, reord_timer); -#else +#elif LINUX_VERSION_CODE < KERNEL_VERSION(6,16,0) struct reord_ctrl *preorder_ctrl = from_timer(preorder_ctrl, t, reord_timer); +#else + struct reord_ctrl *preorder_ctrl = timer_container_of(preorder_ctrl, t, reord_timer); #endif AICWFDBG(LOGTRACE, "%s Enter \r\n", __func__); @@ -2031,8 +2034,8 @@ int reord_process_unit(struct recv_msdu *pframe, struct aicwf_rx_priv *rx_priv, } } else { if(timer_pending(&preorder_ctrl->reord_timer)) { -#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0) - ret = timer_delete(&preorder_ctrl->reord_timer); +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)) + ret = timer_delete(&preorder_ctrl->reord_timer); #else ret = del_timer(&preorder_ctrl->reord_timer); #endif @@ -2199,10 +2202,10 @@ void defrag_timeout_cb(struct timer_list *t) struct defrag_ctrl_info *defrag_ctrl = NULL; #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0) defrag_ctrl = (struct defrag_ctrl_info *)data; -#elif LINUX_VERSION_CODE >= KERNEL_VERSION(6, 16, 0) - defrag_ctrl = timer_container_of(defrag_ctrl, t, defrag_timer); -#else +#elif LINUX_VERSION_CODE < KERNEL_VERSION(6,16,0) defrag_ctrl = from_timer(defrag_ctrl, t, defrag_timer); +#else + defrag_ctrl = timer_container_of(defrag_ctrl, t, defrag_timer); #endif printk("%s:%p\r\n", __func__, defrag_ctrl); @@ -2368,11 +2371,11 @@ check_len_update: hdr = (struct ieee80211_hdr *)(skb->data + msdu_offset); rwnx_vif = rwnx_rx_get_vif(rwnx_hw, hw_rxhdr->flags_vif_idx); if (rwnx_vif) { - #if LINUX_VERSION_CODE < KERNEL_VERSION(6, 17, 0) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 17, 0) + cfg80211_rx_spurious_frame(rwnx_vif->ndev, hdr->addr2, -1, GFP_ATOMIC); +#else cfg80211_rx_spurious_frame(rwnx_vif->ndev, hdr->addr2, GFP_ATOMIC); - #else - cfg80211_rx_spurious_frame(rwnx_vif->ndev, hdr->addr2, UNKNOWN_LINK_ID, GFP_ATOMIC); - #endif +#endif } goto end; } @@ -2567,8 +2570,8 @@ check_len_update: skb_tmp = defrag_info->skb; list_del_init(&defrag_info->list); if (timer_pending(&defrag_info->defrag_timer)) { -#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0) - ret = timer_delete(&defrag_info->defrag_timer); +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)) + ret = timer_delete(&defrag_info->defrag_timer); #else ret = del_timer(&defrag_info->defrag_timer); #endif @@ -2622,15 +2625,13 @@ check_len_update: } if (hw_rxhdr->flags_is_4addr && !rwnx_vif->use_4addr) { - #if LINUX_VERSION_CODE < KERNEL_VERSION(6, 17, 0) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 17, 0) + cfg80211_rx_unexpected_4addr_frame(rwnx_vif->ndev, + sta->mac_addr, -1, GFP_ATOMIC); +#else cfg80211_rx_unexpected_4addr_frame(rwnx_vif->ndev, sta->mac_addr, GFP_ATOMIC); - #else - cfg80211_rx_unexpected_4addr_frame(rwnx_vif->ndev, - sta->mac_addr, - UNKNOWN_LINK_ID, - GFP_ATOMIC); - #endif +#endif } } diff --git a/drivers/aic8800/aic8800_fdrv/rwnx_rx.h b/drivers/aic8800/aic8800_fdrv/rwnx_rx.h index 46527e2..e7e71f6 100644 --- a/drivers/aic8800/aic8800_fdrv/rwnx_rx.h +++ b/drivers/aic8800/aic8800_fdrv/rwnx_rx.h @@ -405,8 +405,4 @@ struct element { #endif #endif -#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 17, 0) -#define UNKNOWN_LINK_ID -1 -#endif - #endif /* _RWNX_RX_H_ */ diff --git a/drivers/aic8800/aic8800_fdrv/rwnx_version_gen.h b/drivers/aic8800/aic8800_fdrv/rwnx_version_gen.h index 705c56e..b58a50b 100644 --- a/drivers/aic8800/aic8800_fdrv/rwnx_version_gen.h +++ b/drivers/aic8800/aic8800_fdrv/rwnx_version_gen.h @@ -1,5 +1,5 @@ #define RWNX_VERS_REV "1a4b0054d2M (master)" #define RWNX_VERS_MOD "6.4.3.0" #define RWNX_VERS_BANNER "rwnx v6.4.3.0 - 1a4b0054d2M (master)" -#define RELEASE_DATE "2025_0423_71b66e7b" +#define RELEASE_DATE "2025_1018_71b66e7b" diff --git a/drivers/aic8800/aic8800_fdrv/rwnx_wakelock.c b/drivers/aic8800/aic8800_fdrv/rwnx_wakelock.c index 970262b..f6dc413 100644 --- a/drivers/aic8800/aic8800_fdrv/rwnx_wakelock.c +++ b/drivers/aic8800/aic8800_fdrv/rwnx_wakelock.c @@ -9,15 +9,12 @@ #include "rwnx_defs.h" #include "rwnx_wakelock.h" +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 16, 0) struct wakeup_source *rwnx_wakeup_init(const char *name) { struct wakeup_source *ws; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 16, 0) - ws = wakeup_source_register(NULL, name); -#else ws = wakeup_source_create(name); wakeup_source_add(ws); -#endif return ws; } @@ -25,15 +22,10 @@ void rwnx_wakeup_deinit(struct wakeup_source *ws) { if (ws && ws->active) __pm_relax(ws); - -#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 16, 0) - wakeup_source_unregister(ws); -#else wakeup_source_remove(ws); wakeup_source_destroy(ws); -#endif } - +#endif struct wakeup_source *rwnx_wakeup_register(struct device *dev, const char *name) { @@ -81,18 +73,33 @@ void rwnx_wakeup_lock_timeout(struct wakeup_source *ws, unsigned int msec) void aicwf_wakeup_lock_init(struct rwnx_hw *rwnx_hw) { + #if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 16, 0) + struct aic_usb_dev *usbdev = rwnx_hw->usbdev; + rwnx_hw->ws_tx = rwnx_wakeup_register(usbdev->dev, "rwnx_tx_wakelock"); + rwnx_hw->ws_rx = rwnx_wakeup_register(usbdev->dev,"rwnx_rx_wakelock"); + rwnx_hw->ws_irqrx = rwnx_wakeup_register(usbdev->dev, "rwnx_irqrx_wakelock"); + rwnx_hw->ws_pwrctrl = rwnx_wakeup_register(usbdev->dev, "rwnx_pwrcrl_wakelock"); + #else rwnx_hw->ws_tx = rwnx_wakeup_init("rwnx_tx_wakelock"); rwnx_hw->ws_rx = rwnx_wakeup_init("rwnx_rx_wakelock"); rwnx_hw->ws_irqrx = rwnx_wakeup_init("rwnx_irqrx_wakelock"); rwnx_hw->ws_pwrctrl = rwnx_wakeup_init("rwnx_pwrcrl_wakelock"); + #endif } void aicwf_wakeup_lock_deinit(struct rwnx_hw *rwnx_hw) { + #if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 16, 0) + rwnx_wakeup_unregister(rwnx_hw->ws_tx); + rwnx_wakeup_unregister(rwnx_hw->ws_rx); + rwnx_wakeup_unregister(rwnx_hw->ws_irqrx); + rwnx_wakeup_unregister(rwnx_hw->ws_pwrctrl); + #else rwnx_wakeup_deinit(rwnx_hw->ws_tx); rwnx_wakeup_deinit(rwnx_hw->ws_rx); rwnx_wakeup_deinit(rwnx_hw->ws_irqrx); rwnx_wakeup_deinit(rwnx_hw->ws_pwrctrl); + #endif rwnx_hw->ws_tx = NULL; rwnx_hw->ws_rx = NULL; rwnx_hw->ws_irqrx = NULL; diff --git a/drivers/aic8800/aic_load_fw/Makefile b/drivers/aic8800/aic_load_fw/Makefile index 3479e82..3cdb65b 100644 --- a/drivers/aic8800/aic_load_fw/Makefile +++ b/drivers/aic8800/aic_load_fw/Makefile @@ -67,7 +67,7 @@ ccflags-$(CONFIG_PLATFORM_ROCKCHIP) += -DCONFIG_PLATFORM_ROCKCHIP #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 +ARCH ?=$(shell uname -m | sed -e s/i.86/i386/ -e s/armv.l/arm/ -e s/aarch64/arm64/) 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/3399/rk3399-android-10/kernel #ARCH ?= arm64 @@ -91,13 +91,12 @@ endif ifeq ($(CONFIG_PLATFORM_UBUNTU), y) ccflags-$(CONFIG_PLATFORM_UBUNTU) += -DCONFIG_PLATFORM_UBUNTU -KDIR := /lib/modules/$(shell uname -r)/build -PWD := $(shell pwd) -KVER := $(shell uname -r) -MODDESTDIR := /lib/modules/$(KVER)/kernel/drivers/net/wireless/aic8800 -SUBARCH = $(shell uname -m | sed -e s/i.86/i386/ -e s/armv.l/arm/ -e s/aarch64/arm64/) -ARCH ?= $(SUBARCH) -CROSS_COMPILE := +KVER := $(or $(KVER), $(kernelver), $(KERNELRELEASE), $(shell uname -r)) +KDIR ?= /lib/modules/$(KVER)/build +PWD ?= $(shell pwd) +MODDESTDIR ?= /lib/modules/$(KVER)/kernel/drivers/net/wireless/aic8800 +ARCH ?= $(shell uname -m | sed -e s/i.86/i386/ -e s/armv.l/arm/ -e s/aarch64/arm64/) +CROSS_COMPILE ?= endif diff --git a/drivers/aic8800/aic_load_fw/aicbluetooth_cmds.c b/drivers/aic8800/aic_load_fw/aicbluetooth_cmds.c index fe1f82e..4040e00 100644 --- a/drivers/aic8800/aic_load_fw/aicbluetooth_cmds.c +++ b/drivers/aic8800/aic_load_fw/aicbluetooth_cmds.c @@ -408,7 +408,7 @@ int rwnx_send_dbg_mem_write_req(struct aic_usb_dev *usbdev, u32 mem_addr, u32 me { struct dbg_mem_write_req *mem_write_req; - //printk("%s mem_addr:%x mem_data:%x\r\n", __func__, mem_addr, mem_data); +// printk("%s mem_addr:%x mem_data:%x\r\n", __func__, mem_addr, mem_data); /* Build the DBG_MEM_WRITE_REQ message */ mem_write_req = rwnx_msg_zalloc(DBG_MEM_WRITE_REQ, TASK_DBG, DRV_TASK_ID,