aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXin LI <delphij@FreeBSD.org>2019-08-03 03:36:18 +0000
committerXin LI <delphij@FreeBSD.org>2019-08-03 03:36:18 +0000
commit1dbf944a91cfccba2c18fa273f69985cd15a5081 (patch)
treeae17a24d8c9df9268ee048a35a4caa057c0777e5
parenta6d222eb6835ba8f9334a330f99f2fa0001e713d (diff)
downloadsrc-1dbf944a91cfccba2c18fa273f69985cd15a5081.tar.gz
src-1dbf944a91cfccba2c18fa273f69985cd15a5081.zip
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
Notes
Notes: svn path=/head/; revision=350554
-rw-r--r--share/man/man4/mxge.43
-rw-r--r--sys/conf/files3
-rw-r--r--sys/dev/mxge/if_mxge.c23
-rw-r--r--sys/modules/mxge/mxge/Makefile2
4 files changed, 10 insertions, 21 deletions
diff --git a/share/man/man4/mxge.4 b/share/man/man4/mxge.4
index 3e54062fd212..675ee1473ac3 100644
--- a/share/man/man4/mxge.4
+++ b/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 @@ place the following lines in your
kernel configuration file:
.Bd -ragged -offset indent
.Cd "device firmware"
+.Cd "device zlib"
.Cd "device mxge"
.Ed
.Pp
diff --git a/sys/conf/files b/sys/conf/files
index bbc66f88bc41..1e009a121d79 100644
--- a/sys/conf/files
+++ b/sys/conf/files
@@ -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
diff --git a/sys/dev/mxge/if_mxge.c b/sys/dev/mxge/if_mxge.c
index 5ffba31d51be..1f8defbb576d 100644
--- a/sys/dev/mxge/if_mxge.c
+++ b/sys/dev/mxge/if_mxge.c
@@ -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;
diff --git a/sys/modules/mxge/mxge/Makefile b/sys/modules/mxge/mxge/Makefile
index a924aef52021..bedbcbe9e0c3 100644
--- a/sys/modules/mxge/mxge/Makefile
+++ b/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 <bsd.kmod.mk>