mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-29 05:36:47 +00:00
Merge pull request #6642 from mglae/le11_wl_netw_fix
[network] bcm_sta: improve kernel 5.17 patch / connman: 4388028 (1.41+/2022-05-25)
This commit is contained in:
commit
4ad4063a31
@ -1,26 +1,80 @@
|
||||
--- a/x86-64/src/wl/sys/wl_linux.c 2022-02-19 15:22:05.006428601 +0000
|
||||
+++ b/x86-64/src/wl/sys/wl_linux.c 2022-02-19 21:55:03.290519415 +0000
|
||||
@@ -3287,7 +3287,11 @@
|
||||
static ssize_t
|
||||
wl_proc_read(struct file *filp, char __user *buffer, size_t length, loff_t *offp)
|
||||
{
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0)
|
||||
wl_info_t * wl = PDE_DATA(file_inode(filp));
|
||||
+#else
|
||||
+ wl_info_t * wl = file_inode(filp)->i_private;
|
||||
From 31b7849092c43805c7fbaf7518b99874aa1b310c Mon Sep 17 00:00:00 2001
|
||||
From: Joan Bruguera <joanbrugueram@gmail.com>
|
||||
Date: Wed, 12 Jan 2022 20:49:20 +0100
|
||||
Subject: [PATCH] Tentative fix for broadcom-wl 6.30.223.271 driver for Linux 5.17-rc1
|
||||
|
||||
Set netdev->dev_addr through dev_addr_mod + PDE_DATA fix
|
||||
|
||||
Since Linux 5.17 netdev->dev_addr is const and must be changed through
|
||||
dev_addr_mod, otherwise a warning is logged in dmesg and bad things may happen.
|
||||
|
||||
NB: The #if is not wrong, dev_addr_mod is defined since Linux 5.15-rc1
|
||||
|
||||
Plus a trivial fix for PDE_DATA.
|
||||
|
||||
Applies on top of all the patches applied to broadcom-wl-dkms 6.30.223.271-28 on Arch Linux.
|
||||
|
||||
See also: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=adeef3e32146a8d2a73c399dc6f5d76a449131b1
|
||||
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=359745d78351c6f5442435f81549f0207ece28aa
|
||||
---
|
||||
src/wl/sys/wl_linux.c | 16 +++++++++++++---
|
||||
1 file changed, 13 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/wl/sys/wl_linux.c b/src/wl/sys/wl_linux.c
|
||||
index e491df7..e4614fb 100644
|
||||
--- a/x86-64/src/wl/sys/wl_linux.c
|
||||
+++ b/x86-64/src/wl/sys/wl_linux.c
|
||||
@@ -93,6 +93,10 @@ struct iw_statistics *wl_get_wireless_stats(struct net_device *dev);
|
||||
|
||||
#include <wlc_wowl.h>
|
||||
|
||||
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0))
|
||||
+#define PDE_DATA pde_data
|
||||
+#endif
|
||||
+
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
|
||||
static void wl_timer(struct timer_list *tl);
|
||||
#else
|
||||
@@ -490,6 +494,12 @@ wl_if_setup(struct net_device *dev)
|
||||
#endif
|
||||
int bcmerror, len;
|
||||
int to_user = 0;
|
||||
@@ -3344,7 +3348,11 @@
|
||||
static ssize_t
|
||||
wl_proc_write(struct file *filp, const char __user *buff, size_t length, loff_t *offp)
|
||||
{
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0)
|
||||
wl_info_t * wl = PDE_DATA(file_inode(filp));
|
||||
+#else
|
||||
+ wl_info_t * wl = file_inode(filp)->i_private;
|
||||
}
|
||||
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0)
|
||||
+static inline void eth_hw_addr_set(struct net_device *dev, const void *addr) {
|
||||
+ memcpy(dev->dev_addr, addr, ETHER_ADDR_LEN);
|
||||
+}
|
||||
+#endif
|
||||
#endif
|
||||
int from_user = 0;
|
||||
int bcmerror;
|
||||
+
|
||||
static wl_info_t *
|
||||
wl_attach(uint16 vendor, uint16 device, ulong regs,
|
||||
uint bustype, void *btparam, uint irq, uchar* bar1_addr, uint32 bar1_size)
|
||||
@@ -634,7 +644,7 @@ wl_attach(uint16 vendor, uint16 device, ulong regs,
|
||||
WL_ERROR(("wl%d: Error setting MAC ADDRESS\n", unit));
|
||||
}
|
||||
#endif
|
||||
- bcopy(&wl->pub->cur_etheraddr, dev->dev_addr, ETHER_ADDR_LEN);
|
||||
+ eth_hw_addr_set(dev, wl->pub->cur_etheraddr.octet);
|
||||
|
||||
online_cpus = 1;
|
||||
|
||||
@@ -1835,7 +1845,7 @@ wl_set_mac_address(struct net_device *dev, void *addr)
|
||||
|
||||
WL_LOCK(wl);
|
||||
|
||||
- bcopy(sa->sa_data, dev->dev_addr, ETHER_ADDR_LEN);
|
||||
+ eth_hw_addr_set(dev, sa->sa_data);
|
||||
err = wlc_iovar_op(wl->wlc, "cur_etheraddr", NULL, 0, sa->sa_data, ETHER_ADDR_LEN,
|
||||
IOV_SET, (WL_DEV_IF(dev))->wlcif);
|
||||
WL_UNLOCK(wl);
|
||||
@@ -3010,7 +3020,7 @@ _wl_add_monitor_if(wl_task_t *task)
|
||||
else
|
||||
dev->type = ARPHRD_IEEE80211_RADIOTAP;
|
||||
|
||||
- bcopy(wl->dev->dev_addr, dev->dev_addr, ETHER_ADDR_LEN);
|
||||
+ eth_hw_addr_set(dev, wl->dev->dev_addr);
|
||||
|
||||
#if defined(WL_USE_NETDEV_OPS)
|
||||
dev->netdev_ops = &wl_netdev_monitor_ops;
|
||||
--
|
||||
2.35.1
|
||||
|
||||
|
@ -3,8 +3,8 @@
|
||||
# Copyright (C) 2019-present Team LibreELEC (https://libreelec.tv)
|
||||
|
||||
PKG_NAME="connman"
|
||||
PKG_VERSION="1.41"
|
||||
PKG_SHA256="29e7062735382f8112ccf0cf6aaa8ee4a2633ce9522d1a0b1032daa65fc47563"
|
||||
PKG_VERSION="1e1d2af009efc8a8b65eccc06188bd6b28271af7" # 1.41+ / 2022-05-25
|
||||
PKG_SHA256="bfdc7a8261c476c003df59a2952090dacf67c78b97027f06db3280edce0d4ee5"
|
||||
PKG_LICENSE="GPL"
|
||||
PKG_SITE="http://www.connman.net"
|
||||
PKG_URL="https://git.kernel.org/pub/scm/network/connman/connman.git/snapshot/connman-${PKG_VERSION}.tar.gz"
|
||||
|
Loading…
x
Reference in New Issue
Block a user