Skip to content

Commit

Permalink
fix 8723
Browse files Browse the repository at this point in the history
  • Loading branch information
devbis committed Nov 19, 2024
1 parent 2c8f16b commit f257bad
Show file tree
Hide file tree
Showing 4 changed files with 139 additions and 11 deletions.
8 changes: 4 additions & 4 deletions package/kernel/rtl8723bs-ol/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ PKG_RELEASE=1
PKG_LICENSE:=GPLv2
PKG_LICENSE_FILES:=

PKG_SOURCE_URL:=https://github.com/openlumi/rtl8822bs-aml.git
PKG_MIRROR_HASH:=skip
PKG_SOURCE_URL:=https://github.com/openlumi/rtl8723bs.git
PKG_MIRROR_HASH:=ea8c042faf5488f1b1cd0df774a44f62cad5e677d573f464596bf2a9d1fc2567
PKG_SOURCE_PROTO:=git
PKG_SOURCE_DATE:=2023-05-08
PKG_SOURCE_VERSION:=4754406f9304959fc0dd1602be1c74eb940bd3c0
PKG_SOURCE_DATE:=2023-06-13
PKG_SOURCE_VERSION:=04a0bd2edd1ca95b30f8ff47f59624e1277fadf1

PKG_MAINTAINER:=Ivan Belokobylskiy <[email protected]>
PKG_BUILD_PARALLEL:=1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ of the byteorder headers.
--- a/include/drv_types.h
+++ b/include/drv_types.h
@@ -25,7 +25,7 @@
#include "drv_conf.h"
#include "basic_types.h"
#include "osdep_service.h"
-#include "rtw_byteorder.h"
#include <drv_conf.h>
#include <basic_types.h>
#include <osdep_service.h>
-#include <rtw_byteorder.h>
+#include <asm/byteorder.h>
#include "wlan_bssdef.h"
#include "wifi.h"
#include "ieee80211.h"
#include <wlan_bssdef.h>
#include <wifi.h>
#include <ieee80211.h>
99 changes: 99 additions & 0 deletions package/kernel/rtl8723bs-ol/patches/002-kernel-6.1.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
--- a/Makefile
+++ b/Makefile
@@ -14,6 +14,7 @@ EXTRA_CFLAGS += -Wno-unused-label
EXTRA_CFLAGS += -Wno-unused-parameter
EXTRA_CFLAGS += -Wno-unused-function
EXTRA_CFLAGS += -Wno-unused
+EXTRA_CFLAGS += -Wno-address
#EXTRA_CFLAGS += -Wno-uninitialized

GCC_VER_49 := $(shell echo `$(CC) -dumpversion | cut -f1-2 -d.` \>= 4.9 | bc )
--- a/os_dep/linux/ioctl_cfg80211.c
+++ b/os_dep/linux/ioctl_cfg80211.c
@@ -331,9 +331,7 @@ static const struct ieee80211_txrx_stype
static u64 rtw_get_systime_us(void)
{
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0))
- ktime_t ts;
- ts = ktime_get_boottime();
- return do_div(ts, 1000);
+ return (u64)ktime_to_us(ktime_get_boottime());
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39))
struct timespec ts;
get_monotonic_boottime(&ts);
@@ -744,7 +742,7 @@ check_bss:
#endif

#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
- #if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0))
+ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0) || defined(BUILD_OPENWRT))
roam_info.links[0].bssid = cur_network->network.MacAddress;
#else
roam_info.bssid = cur_network->network.MacAddress;
@@ -1390,7 +1388,7 @@ exit:
}

static int cfg80211_rtw_add_key(struct wiphy *wiphy, 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
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) || defined(COMPAT_KERNEL_RELEASE)
@@ -1530,7 +1528,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))
+#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)
@@ -1565,7 +1563,7 @@ static int cfg80211_rtw_get_key(struct w
}

static int cfg80211_rtw_del_key(struct wiphy *wiphy, 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
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) || defined(COMPAT_KERNEL_RELEASE)
@@ -1589,7 +1587,7 @@ static int cfg80211_rtw_del_key(struct w

static int cfg80211_rtw_set_default_key(struct wiphy *wiphy,
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
@@ -4243,7 +4241,7 @@ static int cfg80211_rtw_change_beacon(st
return ret;
}

-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 2))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 2) || 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)
@@ -7356,7 +7354,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, 2))
+ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 2) || defined(BUILD_OPENWRT))
if (wdev->links[0].client.current_bss) {
#else
if (wdev->current_bss) {
--- a/os_dep/linux/os_intfs.c
+++ b/os_dep/linux/os_intfs.c
@@ -1584,8 +1584,8 @@ int rtw_os_ndev_register(_adapter *adapt
u8 rtnl_lock_needed = rtw_rtnl_lock_needed(dvobj);

#ifdef CONFIG_RTW_NAPI
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0))
- netif_napi_add_weight(ndev, &adapter->napi, rtw_recv_napi_poll, RTL_NAPI_WEIGHT);
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) || defined(BUILD_OPENWRT))
+ netif_napi_add(ndev, &adapter->napi, rtw_recv_napi_poll);
#else
netif_napi_add(ndev, &adapter->napi, rtw_recv_napi_poll, RTL_NAPI_WEIGHT);
#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
--- a/os_dep/linux/ioctl_cfg80211.c
+++ b/os_dep/linux/ioctl_cfg80211.c
@@ -4020,6 +4020,18 @@ static int cfg80211_rtw_start_ap(struct
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)
+{
+ int ret = 0;
+ _adapter *adapter = (_adapter *)rtw_netdev_priv(ndev);
+
+ RTW_INFO(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev));
+
+ ret = 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)
{
@@ -4029,6 +4041,7 @@ static int cfg80211_rtw_change_beacon(st
RTW_INFO(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev));

ret = rtw_add_beacon(adapter, info->head, info->head_len, info->tail, info->tail_len);
+#endif

return ret;
}

0 comments on commit f257bad

Please sign in to comment.