if_mxge: update zlib version 1.0.4 to 1.2.11.

PR:		229763
Submitted by:	Yoshihiro Ota <ota j email ne jp>
Differential Revision:	https://reviews.freebsd.org/D20272
This commit is contained in:
Xin LI 2019-08-03 03:36:18 +00:00
parent a6d222eb68
commit 1dbf944a91
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=350554
4 changed files with 10 additions and 21 deletions

View File

@ -31,7 +31,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd February 13, 2008
.Dd August 2, 2019
.Dt MXGE 4
.Os
.Sh NAME
@ -43,6 +43,7 @@ place the following lines in your
kernel configuration file:
.Bd -ragged -offset indent
.Cd "device firmware"
.Cd "device zlib"
.Cd "device mxge"
.Ed
.Pp

View File

@ -2442,7 +2442,8 @@ mwlboot.fw optional mwlfw \
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

View File

@ -47,7 +47,8 @@ __FBSDID("$FreeBSD$");
#include <sys/sysctl.h>
#include <sys/sx.h>
#include <sys/taskqueue.h>
#include <sys/zlib.h>
#include <contrib/zlib/zlib.h>
#include <dev/zlib/zcalloc.h>
#include <net/if.h>
#include <net/if_var.h>
@ -683,22 +684,6 @@ mxge_validate_firmware(mxge_softc_t *sc, const mcp_gen_header_t *hdr)
}
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 @@ mxge_load_firmware_helper(mxge_softc_t *sc, uint32_t *limit)
/* 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;

View File

@ -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 <bsd.kmod.mk>