diff --git a/package/kernel/rtl8188eu/Makefile b/package/kernel/rtl8188eu/Makefile index 76b40dfb87..d28f4f146a 100644 --- a/package/kernel/rtl8188eu/Makefile +++ b/package/kernel/rtl8188eu/Makefile @@ -5,13 +5,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=rtl8188eu -PKG_RELEASE:=2 +PKG_RELEASE:=1 PKG_SOURCE_URL:=https://github.com/aircrack-ng/rtl8188eus.git PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2023-01-01 -PKG_SOURCE_VERSION:=f8ead579311f7eb800e769a7fd216d0c5cb0c4a3 -PKG_MIRROR_HASH:=0066c17718a78f6abc26d2b9f98bf7a6d57baf9779863341da25f2ae6c4a5a57 +PKG_SOURCE_DATE:=2023-09-22 +PKG_SOURCE_VERSION:=3fae7237ba121f1169e9a2ea55040dc123697d3b +PKG_MIRROR_HASH:=6935ad2dc8fc57f96e685d3835d695e306d593cbb88173480631b9dc93dca9a7 PKG_BUILD_PARALLEL:=1 diff --git a/package/kernel/rtl8188eu/patches/030-wireless-5.8.patch b/package/kernel/rtl8188eu/patches/030-wireless-5.8.patch index 3b9bbda354..0e133822a7 100644 --- a/package/kernel/rtl8188eu/patches/030-wireless-5.8.patch +++ b/package/kernel/rtl8188eu/patches/030-wireless-5.8.patch @@ -1,3 +1,34 @@ +--- a/Makefile ++++ b/Makefile +@@ -9,6 +9,8 @@ EXTRA_CFLAGS += -Wno-unused-function + EXTRA_CFLAGS += -Wno-unused + EXTRA_CFLAGS += -Wno-address + EXTRA_CFLAGS += -Wno-cast-function-type ++EXTRA_CFLAGS += -Wno-missing-declarations ++EXTRA_CFLAGS += -Wno-missing-prototypes + #EXTRA_CFLAGS += -Wno-discarded-qualifiers + EXTRA_CFLAGS += -Wno-uninitialized + EXTRA_CFLAGS += -Wno-sometimes-uninitialized +--- a/hal/phydm/phydm_phystatus.c ++++ b/hal/phydm/phydm_phystatus.c +@@ -1710,7 +1710,7 @@ phydm_process_rssi_for_dm( + } + } + if (sta->rssi_stat.ofdm_pkt_cnt != 64) { +- i = 63; ++ i = 7; + sta->rssi_stat.ofdm_pkt_cnt -= (u8)(((sta->rssi_stat.packet_map >> i) & BIT(0)) - 1); + } + sta->rssi_stat.packet_map = (sta->rssi_stat.packet_map << 1) | BIT(0); +@@ -1747,7 +1747,7 @@ phydm_process_rssi_for_dm( + PHYDM_DBG(dm, DBG_RSSI_MNTR, "CCK_2: (( %d ))\n", undecorated_smoothed_cck); + } + } +- i = 63; ++ i = 7; + sta->rssi_stat.ofdm_pkt_cnt -= (u8)((sta->rssi_stat.packet_map >> i) & BIT(0)); + sta->rssi_stat.packet_map = sta->rssi_stat.packet_map << 1; + } --- a/include/ieee80211.h +++ b/include/ieee80211.h @@ -1529,7 +1529,7 @@ enum ieee80211_state { @@ -5,145 +36,158 @@ (((Addr[5]) & 0xff) == 0xff)) #else -#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 18, 00)) -+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 18, 00) && !defined(BUILD_OPENWRT)) ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 18, 00)) && !defined(BUILD_OPENWRT) extern __inline int is_multicast_mac_addr(const u8 *addr) { return (addr[0] != 0xff) && (0x01 & addr[0]); +--- a/include/wlan_bssdef.h ++++ b/include/wlan_bssdef.h +@@ -95,7 +95,7 @@ typedef struct _NDIS_802_11_FIXED_IEs { + typedef struct _NDIS_802_11_VARIABLE_IEs { + UCHAR ElementID; + UCHAR Length; +- UCHAR data[1]; ++ UCHAR data[]; + } NDIS_802_11_VARIABLE_IEs, *PNDIS_802_11_VARIABLE_IEs; + + +@@ -343,7 +343,7 @@ typedef struct _NDIS_802_11_FIXED_IEs { + typedef struct _NDIS_802_11_VARIABLE_IEs { + UCHAR ElementID; + UCHAR Length; +- UCHAR data[1]; ++ UCHAR data[]; + } NDIS_802_11_VARIABLE_IEs, *PNDIS_802_11_VARIABLE_IEs; + + --- a/os_dep/linux/ioctl_cfg80211.c +++ b/os_dep/linux/ioctl_cfg80211.c @@ -417,7 +417,9 @@ u8 rtw_cfg80211_ch_switch_notify(_adapte if (ret != _SUCCESS) goto exit; --#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)) -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0) || defined(BUILD_OPENWRT)) -+ cfg80211_ch_switch_notify(adapter->pnetdev, &chdef, 0, 0); -+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)) +-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0)) ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 9, 0)) || defined(BUILD_OPENWRT) ++ cfg80211_ch_switch_notify(adapter->pnetdev, &chdef, 0); ++#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0)) + cfg80211_ch_switch_notify(adapter->pnetdev, &chdef, 0, 0); + #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)) cfg80211_ch_switch_notify(adapter->pnetdev, &chdef, 0); - #else - cfg80211_ch_switch_notify(adapter->pnetdev, &chdef); -@@ -1103,7 +1105,7 @@ check_bss: +@@ -1105,7 +1107,7 @@ check_bss: #endif #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) || defined(RHEL79)) - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) -+ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0) || defined(BUILD_OPENWRT)) ++ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || defined(BUILD_OPENWRT) + roam_info.links[0].channel = notify_channel; roam_info.links[0].bssid = cur_network->network.MacAddress; #else - roam_info.bssid = cur_network->network.MacAddress; -@@ -1660,6 +1662,9 @@ exit: +@@ -1667,7 +1669,7 @@ exit: } static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) || defined(BUILD_OPENWRT)) -+ , int link_id -+#endif +-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)) ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)) || defined(BUILD_OPENWRT) + , int link_id + #endif , u8 key_index - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) || defined(COMPAT_KERNEL_RELEASE) - , bool pairwise -@@ -1804,6 +1809,9 @@ addkey_end: +@@ -1814,7 +1816,7 @@ addkey_end: } static int cfg80211_rtw_get_key(struct wiphy *wiphy, struct net_device *ndev -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) || defined(BUILD_OPENWRT)) -+ , int link_id -+#endif +-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)) ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)) || defined(BUILD_OPENWRT) + , int link_id + #endif , u8 keyid - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) || defined(COMPAT_KERNEL_RELEASE) - , bool pairwise -@@ -1969,6 +1977,9 @@ exit: +@@ -1982,7 +1984,7 @@ exit: } static int cfg80211_rtw_del_key(struct wiphy *wiphy, struct net_device *ndev, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) || defined(BUILD_OPENWRT)) -+ int link_id, -+#endif +-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)) ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)) || defined(BUILD_OPENWRT) + int link_id, + #endif #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) || defined(COMPAT_KERNEL_RELEASE) - u8 key_index, bool pairwise, const u8 *mac_addr) - #else /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) */ -@@ -1989,7 +2000,11 @@ static int cfg80211_rtw_del_key(struct w - } +@@ -2006,7 +2008,7 @@ static int cfg80211_rtw_del_key(struct w static int cfg80211_rtw_set_default_key(struct wiphy *wiphy, -- struct net_device *ndev, u8 key_index -+ struct net_device *ndev, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) || defined(BUILD_OPENWRT)) -+ int link_id, -+#endif -+ u8 key_index - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 38)) || defined(COMPAT_KERNEL_RELEASE) - , bool unicast, bool multicast - #endif -@@ -2037,7 +2052,11 @@ static int cfg80211_rtw_set_default_key( - + struct net_device *ndev, +-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)) ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)) || defined(BUILD_OPENWRT) + int link_id, + #endif + u8 key_index +@@ -2058,7 +2060,7 @@ static int cfg80211_rtw_set_default_key( #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 30)) int cfg80211_rtw_set_default_mgmt_key(struct wiphy *wiphy, -- struct net_device *ndev, u8 key_index) -+ struct net_device *ndev, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) || defined(BUILD_OPENWRT)) -+ int link_id, -+#endif -+ u8 key_index) - { - #define SET_DEF_KEY_PARAM_FMT " key_index=%d" - #define SET_DEF_KEY_PARAM_ARG , key_index -@@ -4884,7 +4903,7 @@ static int cfg80211_rtw_change_beacon(st + struct net_device *ndev, +-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)) ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)) || defined(BUILD_OPENWRT) + int link_id, + #endif + u8 key_index) +@@ -4895,6 +4897,19 @@ exit: return ret; } ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 7, 0)) || defined(BUILD_OPENWRT) ++static int cfg80211_rtw_change_beacon(struct wiphy *wiphy, struct net_device *ndev, ++ struct cfg80211_ap_update *info) ++{ ++ _adapter *adapter = (_adapter *)rtw_netdev_priv(ndev); ++ ++ RTW_INFO(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev)); ++ ++ return rtw_add_beacon(adapter, info->beacon.head, ++ info->beacon.head_len, info->beacon.tail, ++ info->beacon.tail_len); ++} ++#else + static int cfg80211_rtw_change_beacon(struct wiphy *wiphy, struct net_device *ndev, + struct cfg80211_beacon_data *info) + { +@@ -4907,8 +4922,9 @@ static int cfg80211_rtw_change_beacon(st + + return ret; + } ++#endif + -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)) -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0) || defined(BUILD_OPENWRT)) ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)) || defined(BUILD_OPENWRT) static int cfg80211_rtw_stop_ap(struct wiphy *wiphy, struct net_device *ndev, unsigned int link_id) #else static int cfg80211_rtw_stop_ap(struct wiphy *wiphy, struct net_device *ndev) -@@ -7106,7 +7125,7 @@ exit: - return ret; - } - --#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)) -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)) || defined(BUILD_OPENWRT) - static void cfg80211_rtw_update_mgmt_frame_register(struct wiphy *wiphy, - struct wireless_dev *wdev, - struct mgmt_frame_regs *upd) -@@ -9442,7 +9461,7 @@ static struct cfg80211_ops rtw_cfg80211_ - - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) || defined(COMPAT_KERNEL_RELEASE) - .mgmt_tx = cfg80211_rtw_mgmt_tx, --#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)) -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)) || defined(BUILD_OPENWRT) - .update_mgmt_frame_registrations = cfg80211_rtw_update_mgmt_frame_register, - #else - .mgmt_frame_register = cfg80211_rtw_mgmt_frame_register, -@@ -9646,7 +9665,7 @@ void rtw_wdev_unregister(struct wireless +@@ -9670,7 +9686,7 @@ void rtw_wdev_unregister(struct wireless rtw_cfg80211_indicate_scan_done(adapter, _TRUE); #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)) || defined(COMPAT_KERNEL_RELEASE) - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)) -+ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0) || defined(BUILD_OPENWRT)) ++ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)) || defined(BUILD_OPENWRT) if (wdev->connected) { #else if (wdev->current_bss) { --- a/os_dep/linux/os_intfs.c +++ b/os_dep/linux/os_intfs.c -@@ -1618,7 +1618,7 @@ int rtw_os_ndev_register(_adapter *adapt +@@ -1618,7 +1618,9 @@ int rtw_os_ndev_register(_adapter *adapt u8 rtnl_lock_needed = rtw_rtnl_lock_needed(dvobj); #ifdef CONFIG_RTW_NAPI -- netif_napi_add(ndev, &adapter->napi, rtw_recv_napi_poll, RTL_NAPI_WEIGHT); +-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)) ++#ifdef BUILD_OPENWRT + netif_napi_add(ndev, &adapter->napi, rtw_recv_napi_poll); - #endif /* CONFIG_RTW_NAPI */ ++#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)) + netif_napi_add_weight(ndev, &adapter->napi, rtw_recv_napi_poll, RTL_NAPI_WEIGHT); + #else + netif_napi_add(ndev, &adapter->napi, rtw_recv_napi_poll, RTL_NAPI_WEIGHT); +--- a/os_dep/linux/usb_intf.c ++++ b/os_dep/linux/usb_intf.c +@@ -306,7 +306,7 @@ struct rtw_usb_drv usb_drv = { + .usbdrv.supports_autosuspend = 1, + #endif - #if defined(CONFIG_IOCTL_CFG80211) ---- a/os_dep/osdep_service.c -+++ b/os_dep/osdep_service.c -@@ -2574,7 +2574,9 @@ u64 rtw_division64(u64 x, u64 y) - inline u32 rtw_random32(void) - { - #ifdef PLATFORM_LINUX --#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)) -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)) -+ return get_random_u32(); -+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)) - return prandom_u32(); - #elif (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 18)) - u32 random_int; +-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19)) ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19)) && (LINUX_VERSION_CODE < KERNEL_VERSION(6, 8, 0)) + .usbdrv.drvwrap.driver.shutdown = rtw_dev_shutdown, + #else + .usbdrv.driver.shutdown = rtw_dev_shutdown,