From 8ba55345f7a9ad76367cc6af5dbfc603cb59fdba Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Wed, 20 Jan 2021 01:33:33 +0000 Subject: sys-kernel/broadcom-sta-dkms : EAPI bump, add linux 5.10 compatibility --- .../files/broadcom-sta-6.30.223.141-makefile.patch | 14 - .../broadcom-sta-6.30.223.271-r1-linux-3.18.patch | 12 - ...broadcom-sta-6.30.223.271-r2-linux-4.3-v2.patch | 16 - .../broadcom-sta-6.30.223.271-r4-linux-4.11.patch | 52 --- .../broadcom-sta-6.30.223.271-r4-linux-4.12.patch | 64 --- .../broadcom-sta-6.30.223.271-r4-linux-4.15.patch | 63 --- .../broadcom-sta-6.30.223.271-r4-linux-4.7.patch | 109 ----- .../broadcom-sta-6.30.223.271-r4-linux-4.8.patch | 64 --- .../broadcom-sta-6.30.223.271-r4-linux-5.1.patch | 15 - .../broadcom-sta-6.30.223.271-r4-linux-5.6.patch | 90 ---- .../files/kernel-4.7-to-kernel-5.10.patch | 490 +++++++++++++++++++++ 11 files changed, 490 insertions(+), 499 deletions(-) delete mode 100644 sys-kernel/broadcom-sta-dkms/files/broadcom-sta-6.30.223.141-makefile.patch delete mode 100644 sys-kernel/broadcom-sta-dkms/files/broadcom-sta-6.30.223.271-r1-linux-3.18.patch delete mode 100644 sys-kernel/broadcom-sta-dkms/files/broadcom-sta-6.30.223.271-r2-linux-4.3-v2.patch delete mode 100644 sys-kernel/broadcom-sta-dkms/files/broadcom-sta-6.30.223.271-r4-linux-4.11.patch delete mode 100644 sys-kernel/broadcom-sta-dkms/files/broadcom-sta-6.30.223.271-r4-linux-4.12.patch delete mode 100644 sys-kernel/broadcom-sta-dkms/files/broadcom-sta-6.30.223.271-r4-linux-4.15.patch delete mode 100644 sys-kernel/broadcom-sta-dkms/files/broadcom-sta-6.30.223.271-r4-linux-4.7.patch delete mode 100644 sys-kernel/broadcom-sta-dkms/files/broadcom-sta-6.30.223.271-r4-linux-4.8.patch delete mode 100644 sys-kernel/broadcom-sta-dkms/files/broadcom-sta-6.30.223.271-r4-linux-5.1.patch delete mode 100644 sys-kernel/broadcom-sta-dkms/files/broadcom-sta-6.30.223.271-r4-linux-5.6.patch create mode 100644 sys-kernel/broadcom-sta-dkms/files/kernel-4.7-to-kernel-5.10.patch (limited to 'sys-kernel/broadcom-sta-dkms/files') diff --git a/sys-kernel/broadcom-sta-dkms/files/broadcom-sta-6.30.223.141-makefile.patch b/sys-kernel/broadcom-sta-dkms/files/broadcom-sta-6.30.223.141-makefile.patch deleted file mode 100644 index 09c495d2..00000000 --- a/sys-kernel/broadcom-sta-dkms/files/broadcom-sta-6.30.223.141-makefile.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- Makefile.old 2013-04-28 22:42:59.000000000 +0200 -+++ Makefile 2013-04-28 22:45:53.000000000 +0200 -@@ -128,9 +128,9 @@ - - EXTRA_LDFLAGS := $(src)/lib/wlc_hybrid.o_shipped - --KBASE ?= /lib/modules/`uname -r` -+KBASE ?= /lib/modules/${KV_FULL} - KBUILD_DIR ?= $(KBASE)/build --MDEST_DIR ?= $(KBASE)/kernel/drivers/net/wireless -+MDEST_DIR ?= ${D}$(KBASE)/kernel/drivers/net/wireless - - all: - KBUILD_NOPEDANTIC=1 make -C $(KBUILD_DIR) M=`pwd` diff --git a/sys-kernel/broadcom-sta-dkms/files/broadcom-sta-6.30.223.271-r1-linux-3.18.patch b/sys-kernel/broadcom-sta-dkms/files/broadcom-sta-6.30.223.271-r1-linux-3.18.patch deleted file mode 100644 index 9a0e7136..00000000 --- a/sys-kernel/broadcom-sta-dkms/files/broadcom-sta-6.30.223.271-r1-linux-3.18.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- a/src/wl/sys/wl_linux.c 2014-06-26 12:42:08.000000000 +0200 -+++ b/src/wl/sys/wl_linux.c 2015-01-22 01:44:58.580453805 +0100 -@@ -2157,8 +2159,8 @@ - wlif = WL_DEV_IF(dev); - wl = WL_INFO(dev); - -+ skb->prev = NULL; - if (WL_ALL_PASSIVE_ENAB(wl) || (WL_RTR() && WL_CONFIG_SMP())) { -- skb->prev = NULL; - - TXQ_LOCK(wl); - diff --git a/sys-kernel/broadcom-sta-dkms/files/broadcom-sta-6.30.223.271-r2-linux-4.3-v2.patch b/sys-kernel/broadcom-sta-dkms/files/broadcom-sta-6.30.223.271-r2-linux-4.3-v2.patch deleted file mode 100644 index 588f77ad..00000000 --- a/sys-kernel/broadcom-sta-dkms/files/broadcom-sta-6.30.223.271-r2-linux-4.3-v2.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff -ruN a/src/shared/linux_osl.c b/src/shared/linux_osl.c ---- a/src/shared/linux_osl.c 2015-11-26 12:16:23.343091098 -0800 -+++ b/src/shared/linux_osl.c 2015-11-26 12:17:08.657092739 -0800 -@@ -932,7 +932,11 @@ - uint cycles; - - #if defined(__i386__) -- rdtscl(cycles); -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0) -+ cycles = (u32)rdtsc(); -+#else -+ rdtscl(cycles); -+#endif - #else - cycles = 0; - #endif diff --git a/sys-kernel/broadcom-sta-dkms/files/broadcom-sta-6.30.223.271-r4-linux-4.11.patch b/sys-kernel/broadcom-sta-dkms/files/broadcom-sta-6.30.223.271-r4-linux-4.11.patch deleted file mode 100644 index a779f8c8..00000000 --- a/sys-kernel/broadcom-sta-dkms/files/broadcom-sta-6.30.223.271-r4-linux-4.11.patch +++ /dev/null @@ -1,52 +0,0 @@ -diff --git a/src/wl/sys/wl_cfg80211_hybrid.c b/src/wl/sys/wl_cfg80211_hybrid.c -index a9671e2..da36405 100644 ---- a/src/wl/sys/wl_cfg80211_hybrid.c -+++ b/src/wl/sys/wl_cfg80211_hybrid.c -@@ -30,6 +30,9 @@ - #include - #include - #include -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) -+#include -+#endif - #include - #include - #include -diff --git a/src/wl/sys/wl_linux.c b/src/wl/sys/wl_linux.c -index 489c9f5..f8278ad 100644 ---- a/src/wl/sys/wl_linux.c -+++ b/src/wl/sys/wl_linux.c -@@ -117,6 +117,9 @@ int wl_found = 0; - - typedef struct priv_link { - wl_if_t *wlif; -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) -+ unsigned long last_rx; -+#endif - } priv_link_t; - - #define WL_DEV_IF(dev) ((wl_if_t*)((priv_link_t*)DEV_PRIV(dev))->wlif) -@@ -2450,6 +2453,9 @@ wl_monitor(wl_info_t *wl, wl_rxsts_t *rxsts, void *p) - { - struct sk_buff *oskb = (struct sk_buff *)p; - struct sk_buff *skb; -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) -+ priv_link_t *priv_link; -+#endif - uchar *pdata; - uint len; - -@@ -2916,7 +2922,13 @@ wl_monitor(wl_info_t *wl, wl_rxsts_t *rxsts, void *p) - if (skb == NULL) return; - - skb->dev = wl->monitor_dev; -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) -+ priv_link = MALLOC(wl->osh, sizeof(priv_link_t)); -+ priv_link = netdev_priv(skb->dev); -+ priv_link->last_rx = jiffies; -+#else - skb->dev->last_rx = jiffies; -+#endif - #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 22) - skb_reset_mac_header(skb); - #else diff --git a/sys-kernel/broadcom-sta-dkms/files/broadcom-sta-6.30.223.271-r4-linux-4.12.patch b/sys-kernel/broadcom-sta-dkms/files/broadcom-sta-6.30.223.271-r4-linux-4.12.patch deleted file mode 100644 index 94c6253f..00000000 --- a/sys-kernel/broadcom-sta-dkms/files/broadcom-sta-6.30.223.271-r4-linux-4.12.patch +++ /dev/null @@ -1,64 +0,0 @@ -diff -ru work.orig/src/wl/sys/wl_cfg80211_hybrid.c work.patched/src/wl/sys/wl_cfg80211_hybrid.c ---- work.orig/src/wl/sys/wl_cfg80211_hybrid.c 2017-06-10 15:50:27.328823384 -0700 -+++ work.patched/src/wl/sys/wl_cfg80211_hybrid.c 2017-06-10 15:52:40.540809187 -0700 -@@ -52,8 +52,13 @@ - u32 wl_dbg_level = WL_DBG_ERR; - #endif - -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) -+static s32 wl_cfg80211_change_iface(struct wiphy *wiphy, struct net_device *ndev, -+ enum nl80211_iftype type, struct vif_params *params); -+#else - static s32 wl_cfg80211_change_iface(struct wiphy *wiphy, struct net_device *ndev, - enum nl80211_iftype type, u32 *flags, struct vif_params *params); -+#endif - #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0) - static s32 - wl_cfg80211_scan(struct wiphy *wiphy, -@@ -466,7 +471,11 @@ - - static s32 - wl_cfg80211_change_iface(struct wiphy *wiphy, struct net_device *ndev, -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) -+ enum nl80211_iftype type, -+#else - enum nl80211_iftype type, u32 *flags, -+#endif - struct vif_params *params) - { - struct wl_cfg80211_priv *wl = wiphy_to_wl(wiphy); -@@ -2361,12 +2370,26 @@ - const wl_event_msg_t *e, void *data) - { - struct wl_cfg80211_connect_info *conn_info = wl_to_conn(wl); -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) -+ struct cfg80211_roam_info roam_info = {}; -+#endif - s32 err = 0; - - wl_get_assoc_ies(wl); - memcpy(wl->profile->bssid, &e->addr, ETHER_ADDR_LEN); - memcpy(&wl->bssid, &e->addr, ETHER_ADDR_LEN); - wl_update_bss_info(wl); -+ -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) -+ roam_info.channel = &wl->conf->channel, -+ roam_info.bssid = (u8 *)&wl->bssid, -+ roam_info.req_ie = conn_info->req_ie, -+ roam_info.req_ie_len = conn_info->req_ie_len, -+ roam_info.resp_ie = conn_info->resp_ie, -+ roam_info.resp_ie_len = conn_info->resp_ie_len, -+ -+ cfg80211_roamed(ndev, &roam_info, GFP_KERNEL); -+#else - cfg80211_roamed(ndev, - #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 39) - &wl->conf->channel, -@@ -2374,6 +2397,7 @@ - (u8 *)&wl->bssid, - conn_info->req_ie, conn_info->req_ie_len, - conn_info->resp_ie, conn_info->resp_ie_len, GFP_KERNEL); -+#endif - WL_DBG(("Report roaming result\n")); - - set_bit(WL_STATUS_CONNECTED, &wl->status); diff --git a/sys-kernel/broadcom-sta-dkms/files/broadcom-sta-6.30.223.271-r4-linux-4.15.patch b/sys-kernel/broadcom-sta-dkms/files/broadcom-sta-6.30.223.271-r4-linux-4.15.patch deleted file mode 100644 index 91c4d895..00000000 --- a/sys-kernel/broadcom-sta-dkms/files/broadcom-sta-6.30.223.271-r4-linux-4.15.patch +++ /dev/null @@ -1,63 +0,0 @@ -diff --git a/src/wl/sys/wl_linux.c b/src/wl/sys/wl_linux.c -index 489c9f5..f8278ad 100644 ---- a/src/wl/sys/wl_linux.c -+++ b/src/wl/sys/wl_linux.c -@@ -93,7 +93,11 @@ - - #include - -+#ifdef HAVE_TIMER_SETUP -+static void wl_timer(struct timer_list *list); -+#else - static void wl_timer(ulong data); -+#endif - static void _wl_timer(wl_timer_t *t); - static struct net_device *wl_alloc_linux_if(wl_if_t *wlif); - -@@ -2296,12 +2300,17 @@ - - atomic_dec(&t->wl->callbacks); - } -- -+#ifdef HAVE_TIMER_SETUP -+static void -+wl_timer(struct timer_list *list) -+{ -+ wl_timer_t *t = from_timer(t,list,timer); -+#else - static void - wl_timer(ulong data) - { - wl_timer_t *t = (wl_timer_t *)data; -- -+#endif - if (!WL_ALL_PASSIVE_ENAB(t->wl)) - _wl_timer(t); - else -@@ -2351,10 +2360,13 @@ - } - - bzero(t, sizeof(wl_timer_t)); -- -+#ifdef HAVE_TIMER_SETUP -+ timer_setup(&t->timer, wl_timer,0); -+#else - init_timer(&t->timer); - t->timer.data = (ulong) t; - t->timer.function = wl_timer; -+#endif - t->wl = wl; - t->fn = fn; - t->arg = arg; -diff --git a/src/wl/sys/wl_linux.h b/src/wl/sys/wl_linux.h -index 489c9f5..f8278ad 100644 ---- a/src/wl/sys/wl_linux.h -+++ b/src/wl/sys/wl_linux.h -@@ -190,3 +190,7 @@ - extern struct net_device * wl_netdev_get(wl_info_t *wl); - - #endif -+ -+#if defined(timer_setup) && defined(from_timer) -+#define HAVE_TIMER_SETUP -+#endif diff --git a/sys-kernel/broadcom-sta-dkms/files/broadcom-sta-6.30.223.271-r4-linux-4.7.patch b/sys-kernel/broadcom-sta-dkms/files/broadcom-sta-6.30.223.271-r4-linux-4.7.patch deleted file mode 100644 index 566680a0..00000000 --- a/sys-kernel/broadcom-sta-dkms/files/broadcom-sta-6.30.223.271-r4-linux-4.7.patch +++ /dev/null @@ -1,109 +0,0 @@ -Since Linux 4.7, the enum ieee80211_band is no longer used - -This shall cause no problem's since both enums ieee80211_band -and nl80211_band were added in the same commit: -https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit?id=13ae75b103e07304a34ab40c9136e9f53e06475c - -This patch refactors the references of IEEE80211_BAND_* to NL80211_BAND_* - -Reference: -https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit?id=57fbcce37be7c1d2622b56587c10ade00e96afa3 - ---- a/src/wl/sys/wl_cfg80211_hybrid.c 2016-06-13 11:57:36.159340297 -0500 -+++ b/src/wl/sys/wl_cfg80211_hybrid.c 2016-06-13 11:58:18.442323435 -0500 -@@ -236,7 +236,7 @@ - #endif - - #define CHAN2G(_channel, _freq, _flags) { \ -- .band = IEEE80211_BAND_2GHZ, \ -+ .band = NL80211_BAND_2GHZ, \ - .center_freq = (_freq), \ - .hw_value = (_channel), \ - .flags = (_flags), \ -@@ -245,7 +245,7 @@ - } - - #define CHAN5G(_channel, _flags) { \ -- .band = IEEE80211_BAND_5GHZ, \ -+ .band = NL80211_BAND_5GHZ, \ - .center_freq = 5000 + (5 * (_channel)), \ - .hw_value = (_channel), \ - .flags = (_flags), \ -@@ -379,7 +379,7 @@ - }; - - static struct ieee80211_supported_band __wl_band_2ghz = { -- .band = IEEE80211_BAND_2GHZ, -+ .band = NL80211_BAND_2GHZ, - .channels = __wl_2ghz_channels, - .n_channels = ARRAY_SIZE(__wl_2ghz_channels), - .bitrates = wl_g_rates, -@@ -387,7 +387,7 @@ - }; - - static struct ieee80211_supported_band __wl_band_5ghz_a = { -- .band = IEEE80211_BAND_5GHZ, -+ .band = NL80211_BAND_5GHZ, - .channels = __wl_5ghz_a_channels, - .n_channels = ARRAY_SIZE(__wl_5ghz_a_channels), - .bitrates = wl_a_rates, -@@ -395,7 +395,7 @@ - }; - - static struct ieee80211_supported_band __wl_band_5ghz_n = { -- .band = IEEE80211_BAND_5GHZ, -+ .band = NL80211_BAND_5GHZ, - .channels = __wl_5ghz_n_channels, - .n_channels = ARRAY_SIZE(__wl_5ghz_n_channels), - .bitrates = wl_a_rates, -@@ -1876,8 +1876,8 @@ - wdev->wiphy->max_num_pmkids = WL_NUM_PMKIDS_MAX; - #endif - wdev->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | BIT(NL80211_IFTYPE_ADHOC); -- wdev->wiphy->bands[IEEE80211_BAND_2GHZ] = &__wl_band_2ghz; -- wdev->wiphy->bands[IEEE80211_BAND_5GHZ] = &__wl_band_5ghz_a; -+ wdev->wiphy->bands[NL80211_BAND_2GHZ] = &__wl_band_2ghz; -+ wdev->wiphy->bands[NL80211_BAND_5GHZ] = &__wl_band_5ghz_a; - wdev->wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM; - wdev->wiphy->cipher_suites = __wl_cipher_suites; - wdev->wiphy->n_cipher_suites = ARRAY_SIZE(__wl_cipher_suites); -@@ -2000,7 +2000,7 @@ - #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39) - freq = ieee80211_channel_to_frequency(notif_bss_info->channel, - (notif_bss_info->channel <= CH_MAX_2G_CHANNEL) ? -- IEEE80211_BAND_2GHZ : IEEE80211_BAND_5GHZ); -+ NL80211_BAND_2GHZ : NL80211_BAND_5GHZ); - #else - freq = ieee80211_channel_to_frequency(notif_bss_info->channel); - #endif -@@ -2116,7 +2116,7 @@ - return err; - } - chan = wf_chspec_ctlchan(chanspec); -- band = (chan <= CH_MAX_2G_CHANNEL) ? IEEE80211_BAND_2GHZ : IEEE80211_BAND_5GHZ; -+ band = (chan <= CH_MAX_2G_CHANNEL) ? NL80211_BAND_2GHZ : NL80211_BAND_5GHZ; - freq = ieee80211_channel_to_frequency(chan, band); - channel = ieee80211_get_channel(wiphy, freq); - cfg80211_ibss_joined(ndev, (u8 *)&wl->bssid, channel, GFP_KERNEL); -@@ -2250,10 +2250,10 @@ - join_params->params.chanspec_list[0] = - ieee80211_frequency_to_channel(chan->center_freq); - -- if (chan->band == IEEE80211_BAND_2GHZ) { -+ if (chan->band == NL80211_BAND_2GHZ) { - chanspec |= WL_CHANSPEC_BAND_2G; - } -- else if (chan->band == IEEE80211_BAND_5GHZ) { -+ else if (chan->band == NL80211_BAND_5GHZ) { - chanspec |= WL_CHANSPEC_BAND_5G; - } - else { -@@ -2885,7 +2885,7 @@ - - if (phy == 'n' || phy == 'a' || phy == 'v') { - wiphy = wl_to_wiphy(wl); -- wiphy->bands[IEEE80211_BAND_5GHZ] = &__wl_band_5ghz_n; -+ wiphy->bands[NL80211_BAND_5GHZ] = &__wl_band_5ghz_n; - } - - return err; diff --git a/sys-kernel/broadcom-sta-dkms/files/broadcom-sta-6.30.223.271-r4-linux-4.8.patch b/sys-kernel/broadcom-sta-dkms/files/broadcom-sta-6.30.223.271-r4-linux-4.8.patch deleted file mode 100644 index 20e8a9ae..00000000 --- a/sys-kernel/broadcom-sta-dkms/files/broadcom-sta-6.30.223.271-r4-linux-4.8.patch +++ /dev/null @@ -1,64 +0,0 @@ -From d3f93542326a06d920c6eb89b703384290d37b8b Mon Sep 17 00:00:00 2001 -From: Alberto Milone -Date: Fri, 2 Sep 2016 17:35:34 +0200 -Subject: [PATCH 1/1] Add support for Linux 4.8 - -Orginal author: Krzysztof Kolasa ---- - src/wl/sys/wl_cfg80211_hybrid.c | 22 ++++++++++++++++++++++ - 1 file changed, 22 insertions(+) - -diff --git a/src/wl/sys/wl_cfg80211_hybrid.c b/src/wl/sys/wl_cfg80211_hybrid.c -index 2fc71fe..ec5e472 100644 ---- a/src/wl/sys/wl_cfg80211_hybrid.c -+++ b/src/wl/sys/wl_cfg80211_hybrid.c -@@ -2388,8 +2388,16 @@ wl_bss_connect_done(struct wl_cfg80211_priv *wl, struct net_device *ndev, - s32 err = 0; - - if (wl->scan_request) { -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0) -+ struct cfg80211_scan_info info = { -+ .aborted = true, -+ }; -+ WL_DBG(("%s: Aborting scan\n", __FUNCTION__)); -+ cfg80211_scan_done(wl->scan_request, &info); -+#else - WL_DBG(("%s: Aborting scan\n", __FUNCTION__)); - cfg80211_scan_done(wl->scan_request, true); -+#endif - wl->scan_request = NULL; - } - -@@ -2490,7 +2498,14 @@ wl_notify_scan_status(struct wl_cfg80211_priv *wl, struct net_device *ndev, - - scan_done_out: - if (wl->scan_request) { -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0) -+ struct cfg80211_scan_info info = { -+ .aborted = false, -+ }; -+ cfg80211_scan_done(wl->scan_request, &info); -+#else - cfg80211_scan_done(wl->scan_request, false); -+#endif - wl->scan_request = NULL; - } - rtnl_unlock(); -@@ -2909,7 +2924,14 @@ s32 wl_cfg80211_down(struct net_device *ndev) - s32 err = 0; - - if (wl->scan_request) { -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0) -+ struct cfg80211_scan_info info = { -+ .aborted = true, -+ }; -+ cfg80211_scan_done(wl->scan_request, &info); -+#else - cfg80211_scan_done(wl->scan_request, true); -+#endif - wl->scan_request = NULL; - } - --- -2.7.4 - diff --git a/sys-kernel/broadcom-sta-dkms/files/broadcom-sta-6.30.223.271-r4-linux-5.1.patch b/sys-kernel/broadcom-sta-dkms/files/broadcom-sta-6.30.223.271-r4-linux-5.1.patch deleted file mode 100644 index 6be2c4f5..00000000 --- a/sys-kernel/broadcom-sta-dkms/files/broadcom-sta-6.30.223.271-r4-linux-5.1.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/src/wl/sys/wl_cfg80211_hybrid.c b/src/wl/sys/wl_cfg80211_hybrid.c -index cdf8c01..63b5650 100644 ---- a/src/wl/sys/wl_cfg80211_hybrid.c -+++ b/src/wl/sys/wl_cfg80211_hybrid.c -@@ -52,6 +52,10 @@ u32 wl_dbg_level = WL_DBG_ERR | WL_DBG_INFO; - u32 wl_dbg_level = WL_DBG_ERR; - #endif - -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0) -+#define get_ds() ((mm_segment_t) { (-1UL) }) -+#endif -+ - #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) - static s32 wl_cfg80211_change_iface(struct wiphy *wiphy, struct net_device *ndev, - enum nl80211_iftype type, struct vif_params *params); diff --git a/sys-kernel/broadcom-sta-dkms/files/broadcom-sta-6.30.223.271-r4-linux-5.6.patch b/sys-kernel/broadcom-sta-dkms/files/broadcom-sta-6.30.223.271-r4-linux-5.6.patch deleted file mode 100644 index 2a2bcad8..00000000 --- a/sys-kernel/broadcom-sta-dkms/files/broadcom-sta-6.30.223.271-r4-linux-5.6.patch +++ /dev/null @@ -1,90 +0,0 @@ -From dd057e40a167f4febb1a7c77dd32b7d36056952c Mon Sep 17 00:00:00 2001 -From: Herman van Hazendonk -Date: Tue, 31 Mar 2020 17:09:55 +0200 -Subject: [PATCH] Add fixes for 5.6 kernel - -Use ioremap instead of ioremap_nocache and proc_ops instead of file_operations on Linux kernel 5.6 and above. - -Signed-off-by: Herman van Hazendonk ---- - amd64/src/shared/linux_osl.c | 6 +++++- - amd64/src/wl/sys/wl_linux.c | 21 ++++++++++++++++++++- - 2 files changed, 25 insertions(+), 2 deletions(-) - -diff --git a/amd64/src/shared/linux_osl.c b/amd64/src/shared/linux_osl.c -index 6157d18..dcfc075 100644 ---- a/amd64/src/shared/linux_osl.c -+++ b/amd64/src/shared/linux_osl.c -@@ -942,7 +942,11 @@ osl_getcycles(void) - void * - osl_reg_map(uint32 pa, uint size) - { -- return (ioremap_nocache((unsigned long)pa, (unsigned long)size)); -+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) -+ return (ioremap((unsigned long)pa, (unsigned long)size)); -+ #else -+ return (ioremap_nocache((unsigned long)pa, (unsigned long)size)); -+ #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) */ - } - - void -diff --git a/amd64/src/wl/sys/wl_linux.c b/amd64/src/wl/sys/wl_linux.c -index 0d05100..6d9dd0d 100644 ---- a/amd64/src/wl/sys/wl_linux.c -+++ b/amd64/src/wl/sys/wl_linux.c -@@ -582,10 +582,17 @@ wl_attach(uint16 vendor, uint16 device, ulong regs, - } - wl->bcm_bustype = bustype; - -+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) -+ if ((wl->regsva = ioremap(dev->base_addr, PCI_BAR0_WINSZ)) == NULL) { -+ WL_ERROR(("wl%d: ioremap() failed\n", unit)); -+ goto fail; -+ } -+ #else - if ((wl->regsva = ioremap_nocache(dev->base_addr, PCI_BAR0_WINSZ)) == NULL) { - WL_ERROR(("wl%d: ioremap() failed\n", unit)); - goto fail; - } -+ #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) */ - - wl->bar1_addr = bar1_addr; - wl->bar1_size = bar1_size; -@@ -772,8 +779,13 @@ wl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) - if ((val & 0x0000ff00) != 0) - pci_write_config_dword(pdev, 0x40, val & 0xffff00ff); - bar1_size = pci_resource_len(pdev, 2); -+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) -+ bar1_addr = (uchar *)ioremap(pci_resource_start(pdev, 2), -+ bar1_size); -+ #else - bar1_addr = (uchar *)ioremap_nocache(pci_resource_start(pdev, 2), - bar1_size); -+ #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) */ - wl = wl_attach(pdev->vendor, pdev->device, pci_resource_start(pdev, 0), PCI_BUS, pdev, - pdev->irq, bar1_addr, bar1_size); - -@@ -3335,12 +3347,19 @@ wl_proc_write(struct file *filp, const char __user *buff, size_t length, loff_t - } - - #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0) -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) -+static const struct proc_ops wl_fops = { -+ .proc_read = wl_proc_read, -+ .proc_write = wl_proc_write, -+}; -+#else - static const struct file_operations wl_fops = { - .owner = THIS_MODULE, - .read = wl_proc_read, - .write = wl_proc_write, - }; --#endif -+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) */ -+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0) */ - - static int - wl_reg_proc_entry(wl_info_t *wl) --- -2.17.1.windows.1 - diff --git a/sys-kernel/broadcom-sta-dkms/files/kernel-4.7-to-kernel-5.10.patch b/sys-kernel/broadcom-sta-dkms/files/kernel-4.7-to-kernel-5.10.patch new file mode 100644 index 00000000..41cdf230 --- /dev/null +++ b/sys-kernel/broadcom-sta-dkms/files/kernel-4.7-to-kernel-5.10.patch @@ -0,0 +1,490 @@ +diff -Naur a/src/shared/linux_osl.c b/src/shared/linux_osl.c +--- a/src/shared/linux_osl.c 2015-09-19 00:47:30.000000000 +0200 ++++ b/src/shared/linux_osl.c 2020-12-14 13:34:41.810370857 +0100 +@@ -30,6 +30,7 @@ + #include + + #include ++#include + + #define PCI_CFG_RETRY 10 + +@@ -942,7 +943,7 @@ + void * + osl_reg_map(uint32 pa, uint size) + { +- return (ioremap_nocache((unsigned long)pa, (unsigned long)size)); ++ return (ioremap((unsigned long)pa, (unsigned long)size)); + } + + void +@@ -1072,11 +1073,21 @@ + { + struct file *fp = (struct file *)image; + int rdlen; ++ loff_t pos; + + if (!image) + return 0; + +- rdlen = kernel_read(fp, fp->f_pos, buf, len); ++ pos = fp->f_pos; ++ rdlen = kernel_read(fp, ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0) ++ pos, ++#endif ++ buf, len ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0) ++ ,&pos ++#endif ++ ); + if (rdlen > 0) + fp->f_pos += rdlen; + +diff -Naur a/src/wl/sys/wl_cfg80211_hybrid.c b/src/wl/sys/wl_cfg80211_hybrid.c +--- a/src/wl/sys/wl_cfg80211_hybrid.c 2015-09-19 00:47:30.000000000 +0200 ++++ b/src/wl/sys/wl_cfg80211_hybrid.c 2020-12-14 13:37:21.520354758 +0100 +@@ -30,6 +30,9 @@ + #include + #include + #include ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) ++#include ++#endif + #include + #include + #include +@@ -38,11 +41,17 @@ + #include + #include + #include ++#include + + #define EVENT_TYPE(e) dtoh32((e)->event_type) + #define EVENT_FLAGS(e) dtoh16((e)->flags) + #define EVENT_STATUS(e) dtoh32((e)->status) + ++#ifndef IEEE80211_BAND_2GHZ ++#define IEEE80211_BAND_2GHZ NL80211_BAND_2GHZ ++#define IEEE80211_BAND_5GHZ NL80211_BAND_5GHZ ++#endif ++ + #ifdef BCMDBG + u32 wl_dbg_level = WL_DBG_ERR | WL_DBG_INFO; + #else +@@ -50,7 +59,11 @@ + #endif + + static s32 wl_cfg80211_change_iface(struct wiphy *wiphy, struct net_device *ndev, ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) ++ enum nl80211_iftype type, struct vif_params *params); ++#else + enum nl80211_iftype type, u32 *flags, struct vif_params *params); ++#endif + #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0) + static s32 + wl_cfg80211_scan(struct wiphy *wiphy, +@@ -435,35 +448,17 @@ + static s32 + wl_dev_ioctl(struct net_device *dev, u32 cmd, void *arg, u32 len) + { +- struct ifreq ifr; +- struct wl_ioctl ioc; +- mm_segment_t fs; +- s32 err = 0; +- + BUG_ON(len < sizeof(int)); +- +- memset(&ioc, 0, sizeof(ioc)); +- ioc.cmd = cmd; +- ioc.buf = arg; +- ioc.len = len; +- strcpy(ifr.ifr_name, dev->name); +- ifr.ifr_data = (caddr_t)&ioc; +- +- fs = get_fs(); +- set_fs(get_ds()); +-#if defined(WL_USE_NETDEV_OPS) +- err = dev->netdev_ops->ndo_do_ioctl(dev, &ifr, SIOCDEVPRIVATE); +-#else +- err = dev->do_ioctl(dev, &ifr, SIOCDEVPRIVATE); +-#endif +- set_fs(fs); +- +- return err; ++ return wlc_ioctl_internal(dev, cmd, arg, len); + } + + static s32 + wl_cfg80211_change_iface(struct wiphy *wiphy, struct net_device *ndev, ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) ++ enum nl80211_iftype type, ++#else + enum nl80211_iftype type, u32 *flags, ++#endif + struct vif_params *params) + { + struct wl_cfg80211_priv *wl = wiphy_to_wl(wiphy); +@@ -2358,6 +2353,20 @@ + const wl_event_msg_t *e, void *data) + { + struct wl_cfg80211_connect_info *conn_info = wl_to_conn(wl); ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) ++ struct cfg80211_bss *bss; ++ struct wlc_ssid *ssid; ++ ssid = &wl->profile->ssid; ++ bss = cfg80211_get_bss(wl_to_wiphy(wl), NULL, (s8 *)&wl->bssid, ++ ssid->SSID, ssid->SSID_len, WLAN_CAPABILITY_ESS, WLAN_CAPABILITY_ESS); ++ struct cfg80211_roam_info roam_info = { ++ .bss = bss, ++ .req_ie = conn_info->req_ie, ++ .req_ie_len = conn_info->req_ie_len, ++ .resp_ie = conn_info->resp_ie, ++ .resp_ie_len = conn_info->resp_ie_len, ++ }; ++#endif + s32 err = 0; + + wl_get_assoc_ies(wl); +@@ -2365,12 +2374,17 @@ + memcpy(&wl->bssid, &e->addr, ETHER_ADDR_LEN); + wl_update_bss_info(wl); + cfg80211_roamed(ndev, ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) ++ &roam_info, ++#else + #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 39) + &wl->conf->channel, + #endif + (u8 *)&wl->bssid, + conn_info->req_ie, conn_info->req_ie_len, +- conn_info->resp_ie, conn_info->resp_ie_len, GFP_KERNEL); ++ conn_info->resp_ie, conn_info->resp_ie_len, ++#endif ++ GFP_KERNEL); + WL_DBG(("Report roaming result\n")); + + set_bit(WL_STATUS_CONNECTED, &wl->status); +@@ -2386,8 +2400,15 @@ + s32 err = 0; + + if (wl->scan_request) { ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0) ++ struct cfg80211_scan_info info = { ++ .aborted = true ++ }; + WL_DBG(("%s: Aborting scan\n", __FUNCTION__)); +- cfg80211_scan_done(wl->scan_request, true); ++ cfg80211_scan_done(wl->scan_request, &info); ++#else ++ cfg80211_scan_done(wl->scan_request, true); ++#endif + wl->scan_request = NULL; + } + +@@ -2488,7 +2509,14 @@ + + scan_done_out: + if (wl->scan_request) { ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0) ++ struct cfg80211_scan_info info = { ++ .aborted = false ++ }; ++ cfg80211_scan_done(wl->scan_request, &info); ++#else + cfg80211_scan_done(wl->scan_request, false); ++#endif + wl->scan_request = NULL; + } + rtnl_unlock(); +@@ -2913,7 +2941,14 @@ + s32 err = 0; + + if (wl->scan_request) { +- cfg80211_scan_done(wl->scan_request, true); ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0) ++ struct cfg80211_scan_info info = { ++ .aborted = true ++ }; ++ cfg80211_scan_done(wl->scan_request, &info); ++#else ++ cfg80211_scan_done(wl->scan_request, true); ++#endif + wl->scan_request = NULL; + } + +diff -Naur a/src/wl/sys/wlc_pub.h b/src/wl/sys/wlc_pub.h +--- a/src/wl/sys/wlc_pub.h 2015-09-19 00:47:30.000000000 +0200 ++++ b/src/wl/sys/wlc_pub.h 2020-12-14 13:37:21.522354770 +0100 +@@ -24,6 +24,7 @@ + + #include + #include ++#include + #include "proto/802.11.h" + #include "proto/bcmevent.h" + +diff -Naur a/src/wl/sys/wl_iw.c b/src/wl/sys/wl_iw.c +--- a/src/wl/sys/wl_iw.c 2015-09-19 00:47:30.000000000 +0200 ++++ b/src/wl/sys/wl_iw.c 2020-12-14 13:37:21.521354764 +0100 +@@ -37,6 +37,7 @@ + + #include + #include ++#include + + extern bool wl_iw_conn_status_str(uint32 event_type, uint32 status, + uint32 reason, char* stringBuf, uint buflen); +@@ -103,29 +104,7 @@ + int len + ) + { +- struct ifreq ifr; +- wl_ioctl_t ioc; +- mm_segment_t fs; +- int ret; +- +- memset(&ioc, 0, sizeof(ioc)); +- ioc.cmd = cmd; +- ioc.buf = arg; +- ioc.len = len; +- +- strcpy(ifr.ifr_name, dev->name); +- ifr.ifr_data = (caddr_t) &ioc; +- +- fs = get_fs(); +- set_fs(get_ds()); +-#if defined(WL_USE_NETDEV_OPS) +- ret = dev->netdev_ops->ndo_do_ioctl(dev, &ifr, SIOCDEVPRIVATE); +-#else +- ret = dev->do_ioctl(dev, &ifr, SIOCDEVPRIVATE); +-#endif +- set_fs(fs); +- +- return ret; ++ return wlc_ioctl_internal(dev, cmd, arg, len); + } + + static int +diff -Naur a/src/wl/sys/wl_linux.c b/src/wl/sys/wl_linux.c +--- a/src/wl/sys/wl_linux.c 2015-09-19 00:47:30.000000000 +0200 ++++ b/src/wl/sys/wl_linux.c 2020-12-14 13:37:21.522354770 +0100 +@@ -45,6 +45,7 @@ + #include + #include + #include ++#include + #define WLC_MAXBSSCFG 1 + + #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 0) +@@ -93,7 +94,13 @@ + + #include + +-static void wl_timer(ulong data); ++static void wl_timer( ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) ++ struct timer_list *tl ++#else ++ ulong data ++#endif ++ ); + static void _wl_timer(wl_timer_t *t); + static struct net_device *wl_alloc_linux_if(wl_if_t *wlif); + +@@ -117,6 +124,9 @@ + + typedef struct priv_link { + wl_if_t *wlif; ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) ++ unsigned long last_rx; ++#endif + } priv_link_t; + + #define WL_DEV_IF(dev) ((wl_if_t*)((priv_link_t*)DEV_PRIV(dev))->wlif) +@@ -582,7 +592,7 @@ + } + wl->bcm_bustype = bustype; + +- if ((wl->regsva = ioremap_nocache(dev->base_addr, PCI_BAR0_WINSZ)) == NULL) { ++ if ((wl->regsva = ioremap(dev->base_addr, PCI_BAR0_WINSZ)) == NULL) { + WL_ERROR(("wl%d: ioremap() failed\n", unit)); + goto fail; + } +@@ -772,7 +782,7 @@ + if ((val & 0x0000ff00) != 0) + pci_write_config_dword(pdev, 0x40, val & 0xffff00ff); + bar1_size = pci_resource_len(pdev, 2); +- bar1_addr = (uchar *)ioremap_nocache(pci_resource_start(pdev, 2), ++ bar1_addr = (uchar *)ioremap(pci_resource_start(pdev, 2), + bar1_size); + wl = wl_attach(pdev->vendor, pdev->device, pci_resource_start(pdev, 0), PCI_BUS, pdev, + pdev->irq, bar1_addr, bar1_size); +@@ -1643,10 +1653,7 @@ + goto done2; + } + +- if (segment_eq(get_fs(), KERNEL_DS)) +- buf = ioc.buf; +- +- else if (ioc.buf) { ++ if (ioc.buf) { + if (!(buf = (void *) MALLOC(wl->osh, MAX(ioc.len, WLC_IOCTL_MAXLEN)))) { + bcmerror = BCME_NORESOURCE; + goto done2; +@@ -1667,7 +1674,7 @@ + WL_UNLOCK(wl); + + done1: +- if (ioc.buf && (ioc.buf != buf)) { ++ if (ioc.buf) { + if (copy_to_user(ioc.buf, buf, ioc.len)) + bcmerror = BCME_BADADDR; + MFREE(wl->osh, buf, MAX(ioc.len, WLC_IOCTL_MAXLEN)); +@@ -1680,6 +1687,39 @@ + return (OSL_ERROR(bcmerror)); + } + ++int ++wlc_ioctl_internal(struct net_device *dev, int cmd, void *buf, int len) ++{ ++ wl_info_t *wl; ++ wl_if_t *wlif; ++ int bcmerror; ++ ++ if (!dev) ++ return -ENETDOWN; ++ ++ wl = WL_INFO(dev); ++ wlif = WL_DEV_IF(dev); ++ if (wlif == NULL || wl == NULL || wl->dev == NULL) ++ return -ENETDOWN; ++ ++ bcmerror = 0; ++ ++ WL_TRACE(("wl%d: wlc_ioctl_internal: cmd 0x%x\n", wl->pub->unit, cmd)); ++ ++ WL_LOCK(wl); ++ if (!capable(CAP_NET_ADMIN)) { ++ bcmerror = BCME_EPERM; ++ } else { ++ bcmerror = wlc_ioctl(wl->wlc, cmd, buf, len, wlif->wlcif); ++ } ++ WL_UNLOCK(wl); ++ ++ ASSERT(VALID_BCMERROR(bcmerror)); ++ if (bcmerror != 0) ++ wl->pub->bcmerror = bcmerror; ++ return (OSL_ERROR(bcmerror)); ++} ++ + static struct net_device_stats* + wl_get_stats(struct net_device *dev) + { +@@ -2165,8 +2205,8 @@ + wlif = WL_DEV_IF(dev); + wl = WL_INFO(dev); + ++ skb->prev = NULL; + if (WL_ALL_PASSIVE_ENAB(wl) || (WL_RTR() && WL_CONFIG_SMP())) { +- skb->prev = NULL; + + TXQ_LOCK(wl); + +@@ -2298,9 +2338,19 @@ + } + + static void +-wl_timer(ulong data) +-{ +- wl_timer_t *t = (wl_timer_t *)data; ++wl_timer( ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) ++ struct timer_list *tl ++#else ++ ulong data ++#endif ++) { ++ wl_timer_t *t = ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) ++ from_timer(t, tl, timer); ++#else ++ (wl_timer_t *)data; ++#endif + + if (!WL_ALL_PASSIVE_ENAB(t->wl)) + _wl_timer(t); +@@ -2352,9 +2402,13 @@ + + bzero(t, sizeof(wl_timer_t)); + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) ++ timer_setup(&t->timer, wl_timer, 0); ++#else + init_timer(&t->timer); + t->timer.data = (ulong) t; + t->timer.function = wl_timer; ++#endif + t->wl = wl; + t->fn = fn; + t->arg = arg; +@@ -2449,6 +2503,9 @@ + { + struct sk_buff *oskb = (struct sk_buff *)p; + struct sk_buff *skb; ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) ++ priv_link_t *priv_link; ++#endif + uchar *pdata; + uint len; + +@@ -2915,7 +2972,13 @@ + if (skb == NULL) return; + + skb->dev = wl->monitor_dev; ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) ++ priv_link = MALLOC(wl->osh, sizeof(priv_link_t)); ++ priv_link = netdev_priv(skb->dev); ++ priv_link->last_rx = jiffies; ++#else + skb->dev->last_rx = jiffies; ++#endif + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 22) + skb_reset_mac_header(skb); + #else +@@ -3335,10 +3398,16 @@ + } + + #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0) ++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,6,0) + static const struct file_operations wl_fops = { + .owner = THIS_MODULE, + .read = wl_proc_read, + .write = wl_proc_write, ++#else ++static const struct proc_ops wl_fops = { ++ .proc_read = wl_proc_read, ++ .proc_write = wl_proc_write, ++#endif + }; + #endif + +diff -Naur a/src/wl/sys/wl_linux.h b/src/wl/sys/wl_linux.h +--- a/src/wl/sys/wl_linux.h 2015-09-19 00:47:30.000000000 +0200 ++++ b/src/wl/sys/wl_linux.h 2020-12-14 13:37:21.522354770 +0100 +@@ -22,6 +22,7 @@ + #define _wl_linux_h_ + + #include ++#include + + typedef struct wl_timer { + struct timer_list timer; +@@ -187,6 +188,7 @@ + extern int __devinit wl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent); + extern void wl_free(wl_info_t *wl); + extern int wl_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd); ++extern int wlc_ioctl_internal(struct net_device *dev, int cmd, void *buf, int len); + extern struct net_device * wl_netdev_get(wl_info_t *wl); + + #endif -- cgit v1.2.3