I got it working, and confirmed the bug, only problem is it will get
overwritten with the next patch, and others cant use the fix.

Hopefully this is a quick fix for a proc dev.

This is how i did it


 When you try to compile the drivers you get

./r8152-2.15.0/r8152.c:18530:25: error: initialization of ‘int (*)(struct 
net_device *, struct ethtool_coalesce *, struct kernel_ethtool_coalesce *, 
struct netlink_ext_ack *)’ from incompatible pointer type ‘int (*)(struct 
net_device *, struct ethtool_coalesce *)’ [-Werror=incompatible-pointer-types]
18530 |         .get_coalesce = rtl8152_get_coalesce,
      |                         ^~~~~~~~~~~~~~~~~~~~
./r8152-2.15.0/r8152.c:18530:25: note: (near initialization for 
‘ops.get_coalesce’)
./r8152-2.15.0/r8152.c:18531:25: error: initialization of ‘int (*)(struct 
net_device *, struct ethtool_coalesce *, struct kernel_ethtool_coalesce *, 
struct netlink_ext_ack *)’ from incompatible pointer type ‘int (*)(struct 
net_device *, struct ethtool_coalesce *)’ [-Werror=incompatible-pointer-types]
18531 |         .set_coalesce = rtl8152_set_coalesce,

I had a look at the code and googled  (i cant code in C or C++ btw)
This site had similar code
https://sbexr.rabexc.org/latest/sources/26/53bfa290b96570.html#0000e00100031001

so i made the following changes to the realtek code. not sure if it
right or performant, but it now compiles


# diff ./r8152.c ../r8152-2.15.0/r8152.c
18339,18341c18339
<                               struct ethtool_coalesce *coalesce,
<                               struct kernel_ethtool_coalesce *,
<                               struct netlink_ext_ack *)
---
>                               struct ethtool_coalesce *coalesce)
18360,18363c18358
<                               struct ethtool_coalesce *coalesce,
<                                 struct kernel_ethtool_coalesce *,
<                                 struct netlink_ext_ack *)
<
---
>                               struct ethtool_coalesce *coalesce)

make install copied the code , but throws the following error, looks to
do with code signing ??? Any way i ignored it

At main.c:160:
- SSL error:02001002:system library:fopen:No such file or directory: 
../crypto/bio/bss_file.c:69
- SSL error:2006D080:BIO routines:BIO_new_file:no such file: 
../crypto/bio/bss_file.c:76
sign-file: certs/signing_key.pem: No such file or directory


I ran

        # sudo depmod -a
        # sudo update-initramfs -u

as requested by the drivers readme file

 rebooted

 ethtool -s enx5c857e38e9b7 autoneg on advertise 0x80000000002f

now works

 ethtool enx5c857e38e9b7
Settings for enx5c857e38e9b7:
        Supported ports: [ MII ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
                                2500baseT/Full
        Supported pause frame use: No
        Supports auto-negotiation: Yes
        Supported FEC modes: Not reported
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
                                2500baseT/Full
        Advertised pause frame use: No
        Advertised auto-negotiation: Yes
        Advertised FEC modes: Not reported
        Link partner advertised link modes:  10baseT/Half 10baseT/Full
                                             100baseT/Half 100baseT/Full
                                             1000baseT/Full
                                             2500baseT/Full
        Link partner advertised pause frame use: No
        Link partner advertised auto-negotiation: Yes
        Link partner advertised FEC modes: Not reported
        Speed: 2500Mb/s
        Duplex: Full
        Auto-negotiation: on
        Port: MII
        PHYAD: 32
        Transceiver: internal
        Supports Wake-on: pumbg
        Wake-on: g
        Current message level: 0x00007fff (32767)
                               drv probe link timer ifdown ifup rx_err tx_err 
tx_queued intr tx_done rx_status pktdata hw wol
        Link detected: yes


checking the version

# modinfo /lib/modules/5.15.0-25-generic/kernel/drivers/net/usb/r8152.ko
filename:       /lib/modules/5.15.0-25-generic/kernel/drivers/net/usb/r8152.ko
version:        v2.15.0 (2021/04/15)
license:        GPL

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/1969211

Title:
  Out of date driver with no capabilities for 2.5Gb full duplex

Status in linux package in Ubuntu:
  Confirmed

Bug description:
  Running on the latest release of ubuntu 22.04, with a usb-2.5gb
  ethernet dongle containing the 8156b chip.

  This chip is supported 8156b  by the R5182 driver.

  see https://www.realtek.com/en/component/zoo/category/network-
  interface-controllers-10-100-1000m-gigabit-ethernet-usb-3-0-software

  The repository states the driver is not required above kernel 5.6, but the 
driver in this release of ubuntu looks to be out of date 
  # modinfo r8152.ko
  filename:       /lib/modules/5.15.0-25-generic/kernel/drivers/net/usb/r8152.ko
  version:        v1.12.12

  and v 2.15.0 int he realtek repository


  The driver only allows the max speed is 2500 / half

  ethtool enx5c857e38e9b7

  Settings for enx5c857e38e9b7:
          Supported ports: [  ]
          Supported link modes:   Not reported
          Supported pause frame use: No
          Supports auto-negotiation: No
          Supported FEC modes: Not reported
          Advertised link modes:  Not reported
          Advertised pause frame use: No
          Advertised auto-negotiation: No
          Advertised FEC modes: Not reported
          Speed: 2500Mb/s
          Duplex: Half
          Auto-negotiation: off
          Port: Twisted Pair
          PHYAD: 0
          Transceiver: internal
          MDI-X: Unknown
          Current message level: 0x00000007 (7)
                                 drv probe link
          Link detected: yes

  and the command to increase the speed

  ethtool -s enx5c857e38e9b7 autoneg on advertise 0x80000000002f

  responds with 
  netlink error: Operation not supported

  
  I tried to build the driver, but it fails to build on ubuntu 22.04, but 
builds fine on older released ( in know not much help)

  /home/andrew/r8152-2.15.0/r8152.c:18530:25: note: (near initialization for 
‘ops.get_coalesce’)
  /home/andrew/r8152-2.15.0/r8152.c:18531:25: error: initialization of ‘int 
(*)(struct net_device *, struct ethtool_coalesce *, struct 
kernel_ethtool_coalesce *, struct netlink_ext_ack *)’ from incompatible pointer 
type ‘int (*)(struct net_device *, struct ethtool_coalesce *)’ 
[-Werror=incompatible-pointer-types]
  18531 |         .set_coalesce = rtl8152_set_coalesce,

  ProblemType: Bug
  DistroRelease: Ubuntu 22.04
  Package: linux-modules-extra-5.15.0-25-generic 5.15.0-25.25 [modified: 
lib/modules/5.15.0-25-generic/kernel/drivers/net/usb/r8152.ko]
  ProcVersionSignature: Ubuntu 5.15.0-25.25-generic 5.15.30
  Uname: Linux 5.15.0-25-generic x86_64
  AlsaVersion: Advanced Linux Sound Architecture Driver Version 
k5.15.0-25-generic.
  AplayDevices: Error: [Errno 2] No such file or directory: 'aplay'
  ApportVersion: 2.20.11-0ubuntu82
  Architecture: amd64
  ArecordDevices: Error: [Errno 2] No such file or directory: 'arecord'
  AudioDevicesInUse: Error: command ['fuser', '-v', '/dev/snd/by-path', 
'/dev/snd/controlC2', '/dev/snd/hwC2D0', '/dev/snd/pcmC2D2c', 
'/dev/snd/pcmC2D1p', '/dev/snd/pcmC2D0c', '/dev/snd/pcmC2D0p', 
'/dev/snd/controlC0', '/dev/snd/hwC0D0', '/dev/snd/pcmC0D10p', 
'/dev/snd/pcmC0D9p', '/dev/snd/pcmC0D8p', '/dev/snd/pcmC0D7p', 
'/dev/snd/pcmC0D3p', '/dev/snd/seq', '/dev/snd/timer'] failed with exit code 1:
  Card0.Amixer.info: Error: [Errno 2] No such file or directory: 'amixer'
  Card0.Amixer.values: Error: [Errno 2] No such file or directory: 'amixer'
  Card2.Amixer.info: Error: [Errno 2] No such file or directory: 'amixer'
  Card2.Amixer.values: Error: [Errno 2] No such file or directory: 'amixer'
  CasperMD5CheckResult: pass
  Date: Fri Apr 15 11:22:22 2022
  InstallationDate: Installed on 2022-04-14 (0 days ago)
  InstallationMedia: Ubuntu-Server 22.04 LTS "Jammy Jellyfish" - Beta amd64 
(20220330)
  IwConfig: Error: [Errno 2] No such file or directory: 'iwconfig'
  MachineType: System manufacturer System Product Name
  ProcEnviron:
   TERM=xterm
   PATH=(custom, no user)
   LANG=en_GB.UTF-8
   SHELL=/bin/bash
  ProcFB: 0 amdgpudrmfb
  ProcKernelCmdLine: BOOT_IMAGE=/vmlinuz-5.15.0-25-generic 
root=/dev/mapper/ubuntu--vg-ubuntu--lv ro
  RelatedPackageVersions:
   linux-restricted-modules-5.15.0-25-generic N/A
   linux-backports-modules-5.15.0-25-generic  N/A
   linux-firmware                             20220329.git681281e4-0ubuntu1
  RfKill: Error: [Errno 2] No such file or directory: 'rfkill'
  SourcePackage: linux
  UpgradeStatus: No upgrade log present (probably fresh install)
  dmi.bios.date: 11/19/2019
  dmi.bios.release: 5.14
  dmi.bios.vendor: American Megatrends Inc.
  dmi.bios.version: 1405
  dmi.board.asset.tag: Default string
  dmi.board.name: PRIME X570-PRO
  dmi.board.vendor: ASUSTeK COMPUTER INC.
  dmi.board.version: Rev X.0x
  dmi.chassis.asset.tag: Default string
  dmi.chassis.type: 3
  dmi.chassis.vendor: Default string
  dmi.chassis.version: Default string
  dmi.modalias: 
dmi:bvnAmericanMegatrendsInc.:bvr1405:bd11/19/2019:br5.14:svnSystemmanufacturer:pnSystemProductName:pvrSystemVersion:rvnASUSTeKCOMPUTERINC.:rnPRIMEX570-PRO:rvrRevX.0x:cvnDefaultstring:ct3:cvrDefaultstring:skuSKU:
  dmi.product.family: To be filled by O.E.M.
  dmi.product.name: System Product Name
  dmi.product.sku: SKU
  dmi.product.version: System Version
  dmi.sys.vendor: System manufacturer

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1969211/+subscriptions


-- 
Mailing list: https://launchpad.net/~kernel-packages
Post to     : kernel-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kernel-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to