help TX201 driver for ubuntu 23.10

This thread has been locked for further replies. You can start a new thread to share your ideas or ask questions.

help TX201 driver for ubuntu 23.10

This thread has been locked for further replies. You can start a new thread to share your ideas or ask questions.
help TX201 driver for ubuntu 23.10
help TX201 driver for ubuntu 23.10
2024-03-02 03:44:31 - last edited 2024-03-04 01:53:19
Model: Archer TX20E  
Hardware Version: V1
Firmware Version:
if you get this errors when you try to install the drivers with the kernel 6.5 on ubuntu 23.10 :
 
Check old driver and unload it.
rmmod r8169
Build the module and install
warning: the compiler differs from the one used to build the kernel
  The kernel was built by: x86_64-linux-gnu-gcc-13 (Ubuntu 13.2.0-4ubuntu3) 13.2.0
  You are using:           gcc-13 (Ubuntu 13.2.0-4ubuntu3) 13.2.0
/home/x/drivers/r8125-9.009.01/src/r8125_n.c: In function ‘rtl8125_init_board’:
/home/x/drivers/r8125-9.009.01/src/r8125_n.c:11955:14: error: implicit declaration of function ‘pci_set_dma_mask’ [-Werror=implicit-function-declaration]
11955 |             !pci_set_dma_mask(pdev, DMA_BIT_MASK(64)) &&
      |              ^~~~~~~~~~~~~~~~
/home/x/drivers/r8125-9.009.01/src/r8125_n.c:11956:14: error: implicit declaration of function ‘pci_set_consistent_dma_mask’ [-Werror=implicit-function-declaration]
11956 |             !pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64))) {
      |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/x/drivers/r8125-9.009.01/src/r8125_n.c:83:
/home/x/drivers/r8125-9.009.01/src/r8125_n.c: In function ‘rtl8125_init_napi’:
/home/x/drivers/r8125-9.009.01/src/r8125.h:631:57: error: too many arguments to function ‘netif_napi_add’
  631 | #define RTL_NAPI_CONFIG(ndev, priv, function, weight)   netif_napi_add(ndev, &priv->napi, function, weight)
      |                                                         ^~~~~~~~~~~~~~
/home/x/drivers/r8125-9.009.01/src/r8125_n.c:12605:17: note: in expansion of macro ‘RTL_NAPI_CONFIG’
12605 |                 RTL_NAPI_CONFIG(tp->dev, r8125napi, poll, R8125_NAPI_WEIGHT);
      |                 ^~~~~~~~~~~~~~~
In file included from /home/x/drivers/r8125-9.009.01/src/r8125_n.c:42:
./include/linux/netdevice.h:2639:1: note: declared here
 2639 | netif_napi_add(struct net_device *dev, struct napi_struct *napi,
      | ^~~~~~~~~~~~~~
/home/x/drivers/r8125-9.009.01/src/r8125_n.c: In function ‘rtl8125_init_one’:
/home/x/drivers/r8125-9.009.01/src/r8125_n.c:12718:17: error: implicit declaration of function ‘netif_set_gso_max_size’; did you mean ‘netif_set_tso_max_size’? [-Werror=implicit-function-declaration]
12718 |                 netif_set_gso_max_size(dev, LSO_64K);
      |                 ^~~~~~~~~~~~~~~~~~~~~~
      |                 netif_set_tso_max_size
cc1: some warnings being treated as errors
make[4]: *** [scripts/Makefile.build:251: /home/x/drivers/r8125-9.009.01/src/r8125_n.o] Error 1
make[3]: *** [/usr/src/linux-headers-6.5.0-21-generic/Makefile:2039: /home/x/drivers/r8125-9.009.01/src] Error 2
make[2]: *** [Makefile:234: __sub-make] Error 2
make[1]: *** [Makefile:176: modules] Error 2
make: *** [Makefile:41: modules] Error 2
 
you have to edit some sources files :
1) error : pci_set_dma_mask, pci_set_consistent_dma_mask & netif_set_gso_max_size:
edit file r8125_n.c
 
replace pci_set_dma_mask(pdev, DMA_BIT_MASK(64))

by dma_set_mask(&pdev->dev, DMA_BIT_MASK(64))

 

replace pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64))

by dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(64))

 

replace netif_set_gso_max_size(dev, LSO_64K)

by netif_set_tso_max_size(dev, LSO_64K)

 

2) error : netif_napi_add :
edit file r8125.h
 
replace #define RTL_NAPI_CONFIG(ndev, priv, function, weight)   netif_napi_add(ndev, &priv->napi, function, weight)
by #define RTL_NAPI_CONFIG(ndev, priv, function, weight)   netif_napi_add(ndev, &priv->napi, function)
 
Happy coding!

 
  2      
  2      
#1
Options