As explained in my previous posts on this thread, you have the driver. As far as I know, there is nothing for us to do to help you further.
What kernel version are you using now?
EDIT 3: If I understand correctly, you think you need the latest version of the driver that include this commit from July 25th and that has been back-ported to kernel 6.10.6:
Code:
doug@s19:~/kernel/linux$ git show 08f3a5c38087
commit 08f3a5c38087d1569e982a121aad1e6acbf145ce
Author: Ma Ke <make24@iscas.ac.cn>
Date: Thu Jul 25 10:29:42 2024 +0800
net: usb: sr9700: fix uninitialized variable use in sr_mdio_read
It could lead to error happen because the variable res is not updated if
the call to sr_share_read_word returns an error. In this particular case
error code was returned and res stayed uninitialized. Same issue also
applies to sr_read_reg.
This can be avoided by checking the return value of sr_share_read_word
and sr_read_reg, and propagating the error if the read operation failed.
Found by code review.
Cc: stable@vger.kernel.org
Fixes: c9b37458e956 ("USB2NET : SR9700 : One chip USB 1.1 USB2NET SR9700Device Driver Support")
Signed-off-by: Ma Ke <make24@iscas.ac.cn>
Reviewed-by: Shigeru Yoshida <syoshida@redhat.com>
Reviewed-by: Hariprasad Kelam <hkelam@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
diff --git a/drivers/net/usb/sr9700.c b/drivers/net/usb/sr9700.c
index 0a662e42ed96..cb7d2f798fb4 100644
--- a/drivers/net/usb/sr9700.c
+++ b/drivers/net/usb/sr9700.c
@@ -179,6 +179,7 @@ static int sr_mdio_read(struct net_device *netdev, int phy_id, int loc)
struct usbnet *dev = netdev_priv(netdev);
__le16 res;
int rc = 0;
+ int err;
if (phy_id) {
netdev_dbg(netdev, "Only internal phy supported\n");
@@ -189,11 +190,17 @@ static int sr_mdio_read(struct net_device *netdev, int phy_id, int loc)
if (loc == MII_BMSR) {
u8 value;
- sr_read_reg(dev, SR_NSR, &value);
+ err = sr_read_reg(dev, SR_NSR, &value);
+ if (err < 0)
+ return err;
+
if (value & NSR_LINKST)
rc = 1;
}
- sr_share_read_word(dev, 1, loc, &res);
+ err = sr_share_read_word(dev, 1, loc, &res);
+ if (err < 0)
+ return err;
+
if (rc == 1)
res = le16_to_cpu(res) | BMSR_LSTATUS;
else
doug@s19:~/kernel/linux$
EDIT: If you need some of the most recent driver edits, you will have to use a mainline kernel.
Code:
doug@s19:~/kernel/linux$ git log --oneline drivers/net/usb/sr9700.c
08f3a5c38087 net: usb: sr9700: fix uninitialized variable use in sr_mdio_read
05417aa9c0c0 net: usb: sr9700: stop lying about skb->truesize
ecf7cf8efb59 net: usb: sr9700: Handle negative len
e9da0b56fe27 sr9700: sanity check for packet length
2674e7ea22ba net: usb: don't write directly to netdev->dev_addr
766607570bec ethernet: constify references to netdev->dev_addr in drivers
49ed8dde3715 net: usb: use eth_hw_addr_set() for dev->addr_len cases
a76053707dbf dev_ioctl: split out ndo_eth_ioctl
77651900cede usbnet: add _mii suffix to usbnet_set/get_link_ksettings
323955a0498c net: usb: switch to dev_get_tstats64 and remove usbnet_get_stats64 alias
f819cd926ca7 drivers: net: Remove unnecessary semicolon
ba23dc642dff net: usb: sr9700: Replace mdelay() with msleep() in sr9700_bind()
fb796707d7a6 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
d532c1082f68 sr9700: use skb_cow_head() to deal with cloned skbs
c8b5d129ee29 net: usbnet: support 64bit stats
39f49eadc3e5 net: usb: sr9700: use new api ethtool_{get|set}_link_ksettings
06b19b1b1785 net: usb: sr9700: Use 'SR_' prefix for the common register macros
a81ab36bf52d drivers/net: delete non-required instances of include <linux/init.h>
c9b37458e956 USB2NET : SR9700 : One chip USB 1.1 USB2NET SR9700Device Driver Support
doug@s19:~/kernel/linux$ git tag --contains 08f3a5c38087
v6.11-rc2
doug@s19:~/kernel/linux$ git tag --contains 05417aa9c0c0
v6.10
v6.10-rc1
v6.10-rc2
v6.10-rc3
v6.10-rc4
v6.10-rc5
v6.10-rc6
v6.10-rc7
v6.11-rc1
v6.11-rc2
Note that at this time of writing mainline is up to 6.11-rc5, I am just behind a few weeks.
EDIT 2: after catching up:
Code:
doug@s19:~/kernel/linux$ git tag --contains 08f3a5c38087
v6.11-rc2
v6.11-rc3
v6.11-rc4
v6.11-rc5
doug@s19:~/kernel/linux$
Bookmarks