Disable YT6801 private ioctl interface

This commit is contained in:
Afonso Oliveira committed 2026-09-01 22:23:00 +01:00
1 parent 6774df1001
commit c08171e544
3 files changed
+66 -68

No files matched your search

@@ -1,4 +1,5 @@
{ {
"source": "aur", "source": "aur",
"sync": false,
"upstream_commit": "020a0f11079cc974794e49856a1a98ab677570a9" "upstream_commit": "020a0f11079cc974794e49856a1a98ab677570a9"
} }
+11 -4
View File
@@ -2,8 +2,8 @@
_pkgbase=yt6801 _pkgbase=yt6801
pkgname=yt6801-dkms pkgname=yt6801-dkms
pkgver=1.0.31 pkgver=1.0.34
pkgrel=2 pkgrel=1
pkgdesc="Kernel module for Motorcomm YT6801 ethernet controller (DKMS)" pkgdesc="Kernel module for Motorcomm YT6801 ethernet controller (DKMS)"
arch=('x86_64') arch=('x86_64')
url="https://www.motor-comm.com/product/ethernet-control-chip" url="https://www.motor-comm.com/product/ethernet-control-chip"
@@ -11,8 +11,8 @@ license=('GPL-2.0-or-later')
depends=('dkms') depends=('dkms')
source=(${_pkgbase}-${pkgver}.zip::'https://www.motor-comm.com/Cn/Skippower/downloadFile.html?id=1817' source=(${_pkgbase}-${pkgver}.zip::'https://www.motor-comm.com/Cn/Skippower/downloadFile.html?id=1817'
'patch.diff') 'patch.diff')
sha256sums=('9ea62182bd520483df5fd3ec320262cbdddcc763f3128ae37abd26905a97e14c' sha256sums=('877e6953fc6eb47232a74e47b0daf33de0e7f9e9a395d3bc10d500d3c4150af8'
'6cdb77774c483b640c8f0499fd54a79e773cd3f96a426cd99eec385972d9d5bb') 'a48de70ede7d530383c26f17b2a292143ec3af5e6024c0f4403b954249f52058')
prepare() { prepare() {
cd ${srcdir} cd ${srcdir}
@@ -21,6 +21,13 @@ prepare() {
patch -p1 < patch.diff patch -p1 < patch.diff
} }
check() {
if grep -Eq '\.ndo_(do_ioctl|siocdevprivate)' ${srcdir}/src/fuxi-gmac-net.c ||
grep -q 'fuxi-gmac-ioctl\.o' ${srcdir}/src/Makefile; then
return 1
fi
}
package() { package() {
mkdir -p ${pkgdir}/usr/src/${_pkgbase}-${pkgver} mkdir -p ${pkgdir}/usr/src/${_pkgbase}-${pkgver}
+54 -64
View File
@@ -1,10 +1,9 @@
diff --git a/src/dkms.conf b/src/dkms.conf diff --git a/src/dkms.conf b/src/dkms.conf
index 78eaf8b..9d93675 100644
--- a/src/dkms.conf --- a/src/dkms.conf
+++ b/src/dkms.conf +++ b/src/dkms.conf
@@ -1,8 +1,5 @@ @@ -1,8 +1,5 @@
PACKAGE_NAME="yt6801" PACKAGE_NAME="yt6801"
PACKAGE_VERSION="1.0.31" PACKAGE_VERSION="1.0.34"
-CLEAN="make clean" -CLEAN="make clean"
-MAKE[0]="make" -MAKE[0]="make"
BUILT_MODULE_NAME[0]="yt6801" BUILT_MODULE_NAME[0]="yt6801"
@@ -12,67 +11,58 @@ index 78eaf8b..9d93675 100644
AUTOINSTALL="yes" AUTOINSTALL="yes"
-REMAKE_INITRD="yes" -REMAKE_INITRD="yes"
diff --git a/src/fuxi-gmac-net.c b/src/fuxi-gmac-net.c diff --git a/src/fuxi-gmac-net.c b/src/fuxi-gmac-net.c
index 3e643f9..fea4c97 100644
--- a/src/fuxi-gmac-net.c --- a/src/fuxi-gmac-net.c
+++ b/src/fuxi-gmac-net.c +++ b/src/fuxi-gmac-net.c
@@ -771,7 +771,9 @@ static void fxgmac_tx_hang_timer_handler(struct timer_list *t) @@ -2133,41 +2133,0 @@
static void fxgmac_tx_hang_timer_handler(unsigned long data) -/*
#endif - * cmd = [0x89F0, 0x89FF]
{ - * When using it, we must pay attention to the thread synchronization
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)) - * of this interface. Because it's an external call that isn't
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,16,0)) - * initiated by the OS.
+ struct fxgmac_channel *channel = timer_container_of(channel, t, expansion.tx_hang_timer); - */
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)) -static int fxgmac_ioctl(struct net_device *netdev,
struct fxgmac_channel *channel = from_timer(channel, t, expansion.tx_hang_timer); - struct ifreq *ifr, int cmd)
#else -{
struct fxgmac_channel *channel = (struct fxgmac_channel *)data; - struct file f;
diff --git a/src/fuxi-gmac-phy.c b/src/fuxi-gmac-phy.c - int ret = FXGMAC_SUCCESS;
index 36d4fb3..8bd9533 100644 - struct fxgmac_pdata *pdata = netdev_priv(netdev);
--- a/src/fuxi-gmac-phy.c -
+++ b/src/fuxi-gmac-phy.c - if (!netif_running(netdev) ||
@@ -324,7 +324,9 @@ static void fxgmac_phy_link_poll(struct timer_list *t) - pdata->expansion.dev_state != FXGMAC_DEV_START)
static void fxgmac_phy_link_poll(unsigned long data) - return -ENODEV;
#endif -
{ - f.private_data = pdata;
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)) -
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,16,0)) - switch (cmd) {
+ struct fxgmac_pdata *pdata = timer_container_of(pdata, t, expansion.phy_poll_tm); - case FXGMAC_DEV_CMD:
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)) - ret = fxgmac_netdev_ops_ioctl(&f, FXGMAC_IOCTL_DFS_COMMAND, (unsigned long)(ifr->ifr_data));
struct fxgmac_pdata *pdata = from_timer(pdata, t, expansion.phy_poll_tm); - break;
#else - default:
struct fxgmac_pdata *pdata = (struct fxgmac_pdata*)data; - ret = -EINVAL;
@@ -352,7 +354,9 @@ static void fxgmac_phy_link_poll(unsigned long data) - break;
- }
int fxgmac_phy_timer_init(struct fxgmac_pdata *pdata) -
{ - return ret;
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)) -}
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,16,0)) -
+ timer_init_key(&pdata->expansion.phy_poll_tm, NULL, 0, "fuxi_phy_link_update_timer", NULL); -#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(5,15,0) )
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)) -static int fxgmac_siocdevprivate(struct net_device *dev,
init_timer_key(&pdata->expansion.phy_poll_tm, NULL, 0, "fuxi_phy_link_update_timer", NULL); - struct ifreq *ifr,
#else - void __user *data,
init_timer_key(&pdata->expansion.phy_poll_tm, 0, "fuxi_phy_link_update_timer", NULL); - int cmd)
@@ -370,6 +374,10 @@ int fxgmac_phy_timer_init(struct fxgmac_pdata *pdata) -{
- return fxgmac_ioctl(dev, ifr, cmd);
void fxgmac_phy_timer_destroy(struct fxgmac_pdata *pdata) -}
{ -#endif
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,15,0)) -
+ timer_shutdown_sync(&pdata->expansion.phy_poll_tm); @@ -2369,4 +2328,0 @@
+#else - .ndo_do_ioctl = fxgmac_ioctl,
del_timer_sync(&pdata->expansion.phy_poll_tm); -#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(5,15,0) )
+#endif - .ndo_siocdevprivate = fxgmac_siocdevprivate,
DPRINTK("fxgmac_phy_timer removed\n"); -#endif
} diff --git a/src/Makefile b/src/Makefile
diff --git a/src/fuxi-gmac.h b/src/fuxi-gmac.h --- a/src/Makefile
index 539b507..2435f0c 100644 +++ b/src/Makefile
--- a/src/fuxi-gmac.h @@ -70 +70 @@
+++ b/src/fuxi-gmac.h -yt6801-objs := fuxi-gmac-common.o fuxi-gmac-desc.o fuxi-gmac-ethtool.o fuxi-gmac-hw.o fuxi-gmac-net.o fuxi-gmac-pci.o fuxi-gmac-phy.o fuxi-efuse.o fuxi-gmac-ioctl.o
@@ -50,6 +50,8 @@ +yt6801-objs := fuxi-gmac-common.o fuxi-gmac-desc.o fuxi-gmac-ethtool.o fuxi-gmac-hw.o fuxi-gmac-net.o fuxi-gmac-pci.o fuxi-gmac-phy.o fuxi-efuse.o
#define FXGMAC_NS_IFA_LOCAL_LINK 1
#define FXGMAC_NS_IFA_GLOBAL_UNICAST 2
+#define FXGMAC_INT_MODERATION_ENABLED 1
+
#define FXGMAX_ASPM_WAR_EN
/* Descriptor related parameters */
#if FXGMAC_TX_HANG_TIMER_ENABLED