Index: head/share/man/man4/mxge.4 =================================================================== --- head/share/man/man4/mxge.4 +++ head/share/man/man4/mxge.4 @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 13, 2008 +.Dd August 2, 2019 .Dt MXGE 4 .Os .Sh NAME @@ -43,6 +43,7 @@ kernel configuration file: .Bd -ragged -offset indent .Cd "device firmware" +.Cd "device zlib" .Cd "device mxge" .Ed .Pp Index: head/sys/conf/files =================================================================== --- head/sys/conf/files +++ head/sys/conf/files @@ -2442,7 +2442,8 @@ compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "mwlboot.fw" -dev/mxge/if_mxge.c optional mxge pci +dev/mxge/if_mxge.c optional mxge pci \ + compile-with "${ZLIB_C}" dev/mxge/mxge_eth_z8e.c optional mxge pci dev/mxge/mxge_ethp_z8e.c optional mxge pci dev/mxge/mxge_rss_eth_z8e.c optional mxge pci Index: head/sys/dev/mxge/if_mxge.c =================================================================== --- head/sys/dev/mxge/if_mxge.c +++ head/sys/dev/mxge/if_mxge.c @@ -47,7 +47,8 @@ #include #include #include -#include +#include +#include #include #include @@ -683,22 +684,6 @@ } -static void * -z_alloc(void *nil, u_int items, u_int size) -{ - void *ptr; - - ptr = malloc(items * size, M_TEMP, M_NOWAIT); - return ptr; -} - -static void -z_free(void *nil, void *ptr) -{ - free(ptr, M_TEMP); -} - - static int mxge_load_firmware_helper(mxge_softc_t *sc, uint32_t *limit) { @@ -723,8 +708,8 @@ /* setup zlib and decompress f/w */ bzero(&zs, sizeof (zs)); - zs.zalloc = z_alloc; - zs.zfree = z_free; + zs.zalloc = zcalloc_nowait; + zs.zfree = zcfree; status = inflateInit(&zs); if (status != Z_OK) { status = EIO; Index: head/sys/modules/mxge/mxge/Makefile =================================================================== --- head/sys/modules/mxge/mxge/Makefile +++ head/sys/modules/mxge/mxge/Makefile @@ -5,4 +5,6 @@ KMOD= if_mxge SRCS= if_mxge.c device_if.h bus_if.h pci_if.h opt_inet.h opt_inet6.h +CFLAGS.if_mxge.c+= ${ZLIB_CFLAGS} + .include