Mange / rtl8192eu-linux-driver

Drivers for the rtl8192eu chipset for wireless adapters (D-Link DWA-131 rev E1 included!)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

make fails on Debian 11.7 Kernel 5.10.0-25-amd64 with error: redefinition of ‘eth_hw_addr_set’

m-bach opened this issue · comments

Mo 11. Sep 12:30:03 CEST 2023
make ARCH=x86_64 CROSS_COMPILE= -C /lib/modules/5.10.0-25-amd64/build M=/var/lib/dkms/rtl8192eu/1.0/build  modules
make[1]: Verzeichnis „/usr/src/linux-headers-5.10.0-25-amd64“ wird betreten
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_cmd.o
In file included from /var/lib/dkms/rtl8192eu/1.0/build/include/osdep_service.h:45,
                 from /var/lib/dkms/rtl8192eu/1.0/build/include/drv_types.h:27,
                 from /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_cmd.c:17:
/var/lib/dkms/rtl8192eu/1.0/build/include/osdep_service_linux.h:222:20: error: redefinition of ‘eth_hw_addr_set’
  222 | static inline void eth_hw_addr_set(struct net_device *dev, const u8 *addr)
      |                    ^~~~~~~~~~~~~~~
In file included from /var/lib/dkms/rtl8192eu/1.0/build/include/osdep_service_linux.h:45,
                 from /var/lib/dkms/rtl8192eu/1.0/build/include/osdep_service.h:45,
                 from /var/lib/dkms/rtl8192eu/1.0/build/include/drv_types.h:27,
                 from /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_cmd.c:17:
/usr/src/linux-headers-5.10.0-25-common/include/linux/etherdevice.h:309:20: note: previous definition of ‘eth_hw_addr_set’ was here
  309 | static inline void eth_hw_addr_set(struct net_device *dev, const u8 *addr)
      |                    ^~~~~~~~~~~~~~~
make[3]: *** [/usr/src/linux-headers-5.10.0-25-common/scripts/Makefile.build:291: /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_cmd.o] Fehler 1
make[2]: *** [/usr/src/linux-headers-5.10.0-25-common/Makefile:1856: /var/lib/dkms/rtl8192eu/1.0/build] Fehler 2
make[1]: *** [/usr/src/linux-headers-5.10.0-25-common/Makefile:192: __sub-make] Fehler 2
make[1]: Verzeichnis „/usr/src/linux-headers-5.10.0-25-amd64“ wird verlassen
make: *** [Makefile:2287: modules] Fehler 2

It looks like eth_hw_addr_set is already defined in the kernel headers.

There is code to avoid that

#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0))
/* Porting from linux kernel v5.15-rc1 48eab831ae8b9f7002a533fa4235eed63ea1f1a3 */
static inline void eth_hw_addr_set(struct net_device *dev, const u8 *addr)
{
memcpy(dev->dev_addr, addr, ETH_ALEN);
}
#endif

Looks like the patch has been backported in debian?

commented

There is code to avoid that

#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0))
/* Porting from linux kernel v5.15-rc1 48eab831ae8b9f7002a533fa4235eed63ea1f1a3 */
static inline void eth_hw_addr_set(struct net_device *dev, const u8 *addr)
{
memcpy(dev->dev_addr, addr, ETH_ALEN);
}
#endif

Looks like the patch has been backported in debian?

Hi, removing that code before building fixed it in debian. Thanks a lot!

The fix is to git checkout eth_hw_addr_set_fix after changing into the rtl8192eu-linux-driver directory