cannot compile (old) trng driver under FreeBSD 14

Hi,
I am using https://github.com/jj1bdx/freebsd-dev-trng since longtime with https://www.gniibe.org/memo/development/gnuk/rng/neug.html hardware. Sometimes i can work around such issues but I am not a developer at all. I think since the code did not change since years, some things changed in the compiler.
maybe somebody can hint for solution?

Code:
trng.c:190:59: error: too many arguments provided to function-like macro invocation
DRIVER_MODULE(trng, nexus, trng_driver, trng_devclass, 0, 0);
                                                          ^
/usr/src/sys/sys/bus.h:832:9: note: macro 'DRIVER_MODULE' defined here
#define DRIVER_MODULE(name, busname, driver, evh, arg)                  \
        ^
trng.c:190:1: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Werror,-Wimplicit-int]
DRIVER_MODULE(trng, nexus, trng_driver, trng_devclass, 0, 0);
^
int
 
Hi Jose,
thanks. Looks better.
Leaded to next error
C:
trng.c:147:22: error: variable 'sc' set but not used [-Werror,-Wunused-but-set-variable]

Which i could work around with commenting out two more Lines:


C:
static int trng_write(struct cdev *dev __unused, struct uio *uio,
                      int ioflag __unused) {
  /*struct trng_softc *sc; */
  size_t amt;
  int error;
  uint8_t buf[BUFFERSIZE];

  /*sc = dev->si_drv1;*/
Not tested yet, but it is a bit risky to use a trng kernel driver without the full understanding of the internals ;-)
 
Back
Top