ceton / infinitv_pcie

Linux driver for the Ceton InfiniTV PCIe
15 stars 16 forks source link

Fails to compile on kernel 5.17 (Fedora 34) #18

Open bc4040 opened 2 years ago

bc4040 commented 2 years ago

I have switched SUBDIRS= to M= as recommended in a previous issue, but now receive the following errors when compiling on 5.17 Fedora 34:

make
make[1]: Entering directory '/usr/src/kernels/5.17.12-100.fc34.x86_64'
  CC [M]  /root/infinitv_pcie-master/ctn91xx_event.o
  CC [M]  /root/infinitv_pcie-master/ctn91xx_net.o
  CC [M]  /root/infinitv_pcie-master/ctn91xx_pci.o
/root/infinitv_pcie-master/ctn91xx_event.c: In function ‘ctn91xx_event_read_common’:
/root/infinitv_pcie-master/ctn91xx_event.c:189:14: error: ‘struct task_struct’ has no member named ‘state’; did you mean ‘stats’?
  189 |     current->state = TASK_RUNNING;
      |              ^~~~~
      |              stats
/root/infinitv_pcie-master/ctn91xx_net.c:25:23: error: initialization of ‘void (*)(struct net_device *, unsigned int)’ from incompatible pointer type ‘void (*)(struct net_device *)’ [-Werror=incompatible-pointer-types]
   25 |     .ndo_tx_timeout = ctn91xx_net_tx_timeout,
      |                       ^~~~~~~~~~~~~~~~~~~~~~
/root/infinitv_pcie-master/ctn91xx_net.c:25:23: note: (near initialization for ‘ctn91xx_net_device_ops.ndo_tx_timeout’)
/root/infinitv_pcie-master/ctn91xx_net.c: In function ‘ctn91xx_net_init’:
/root/infinitv_pcie-master/ctn91xx_net.c:73:25: error: assignment of read-only location ‘*netdev->dev_addr’
   73 |     netdev->dev_addr[0] = 0x00;
      |                         ^
/root/infinitv_pcie-master/ctn91xx_net.c:74:25: error: assignment of read-only location ‘*(netdev->dev_addr + 1)’
   74 |     netdev->dev_addr[1] = 0x22;
      |                         ^
/root/infinitv_pcie-master/ctn91xx_net.c:75:25: error: assignment of read-only location ‘*(netdev->dev_addr + 2)’
   75 |     netdev->dev_addr[2] = 0x2c;
      |                         ^
/root/infinitv_pcie-master/ctn91xx_net.c:76:25: error: assignment of read-only location ‘*(netdev->dev_addr + 3)’
   76 |     netdev->dev_addr[3] = 0xff;
      |                         ^
/root/infinitv_pcie-master/ctn91xx_net.c:77:25: error: assignment of read-only location ‘*(netdev->dev_addr + 4)’
   77 |     netdev->dev_addr[4] = 0xff;
      |                         ^
/root/infinitv_pcie-master/ctn91xx_net.c:78:25: error: assignment of read-only location ‘*(netdev->dev_addr + 5)’
   78 |     netdev->dev_addr[5] = 0xff - dev->board_number;
      |                         ^
/root/infinitv_pcie-master/ctn91xx_net.c: In function ‘ctn91xx_net_set_mac_addr’:
/root/infinitv_pcie-master/ctn91xx_net.c:118:18: warning: passing argument 1 of ‘memcpy’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  118 |     memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
      |            ~~~~~~^~~~~~~~~~
In file included from ./include/linux/string.h:253,
                 from ./include/linux/bitmap.h:11,
                 from ./include/linux/cpumask.h:12,
                 from ./arch/x86/include/asm/cpumask.h:5,
                 from ./arch/x86/include/asm/msr.h:11,
                 from ./arch/x86/include/asm/processor.h:22,
                 from ./arch/x86/include/asm/timex.h:5,
                 from ./include/linux/timex.h:67,
                 from ./include/linux/time32.h:13,
                 from ./include/linux/time.h:60,
                 from ./include/linux/stat.h:19,
                 from ./include/linux/module.h:13,
                 from /root/infinitv_pcie-master/ctn91xx_kal.h:6,
                 from /root/infinitv_pcie-master/ctn91xx.h:109,
                 from /root/infinitv_pcie-master/ctn91xx_net.h:4,
                 from /root/infinitv_pcie-master/ctn91xx_net.c:1:
./include/linux/fortify-string.h:212:37: note: expected ‘void *’ but argument is of type ‘const unsigned char *’
  212 | __FORTIFY_INLINE void *memcpy(void *p, const void *q, __kernel_size_t size)
      |                               ~~~~~~^
make[2]: *** [scripts/Makefile.build:288: /root/infinitv_pcie-master/ctn91xx_event.o] Error 1
make[2]: *** Waiting for unfinished jobs....
cc1: some warnings being treated as errors
/root/infinitv_pcie-master/ctn91xx_pci.c: In function ‘ctn91xx_register’:
/root/infinitv_pcie-master/ctn91xx_pci.c:59:17: error: implicit declaration of function ‘ioremap_nocache’; did you mean ‘ioremap_cache’? [-Werror=implicit-function-declaration]
   59 |     dev->base = ioremap_nocache(dev->hw_reg_base, CTN91XX_REG_REGION_SIZE);
      |                 ^~~~~~~~~~~~~~~
      |                 ioremap_cache
/root/infinitv_pcie-master/ctn91xx_pci.c:59:15: warning: assignment to ‘void *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
   59 |     dev->base = ioremap_nocache(dev->hw_reg_base, CTN91XX_REG_REGION_SIZE);
      |               ^
/root/infinitv_pcie-master/ctn91xx_pci.c:70:27: warning: assignment to ‘void *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
   70 |     dev->translation_base = ioremap_nocache(dev->translation_hw_reg_base, CTN91XX_TRANSLATION_REG_REGION_SIZE);
      |                           ^
make[2]: *** [scripts/Makefile.build:288: /root/infinitv_pcie-master/ctn91xx_net.o] Error 1
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:288: /root/infinitv_pcie-master/ctn91xx_pci.o] Error 1
make[1]: *** [Makefile:1841: /root/infinitv_pcie-master] Error 2
make[1]: Leaving directory '/usr/src/kernels/5.17.12-100.fc34.x86_64'
make: *** [Makefile:38: ctn91xx_module] Error 2
kimmer2k commented 1 year ago

Were you able to resolve this issue? I'm running into the same error on Debian 11.

bc4040 commented 1 year ago

No, but I was able to compile this forked version https://github.com/JamesRHarris/infinitv_pcie

kimmer2k commented 1 year ago

That worked!!! Thanks for the quick reply, and thanks to @JamesRHarris for updating ctn91xx_event.c as well!!!