Module Name:    src
Committed By:   riastradh
Date:           Sat Jul 25 22:37:48 UTC 2020

Modified Files:
        src/sys/dev/marvell: mvxpsec.c

Log Message:
Make this build with or without options IPSEC.

Not really that useful without options IPSEC, but simply uncommenting
mvxpsec in conf/ARMADAXP didn't build, and this change is trivial, so
why not.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/marvell/mvxpsec.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/marvell/mvxpsec.c
diff -u src/sys/dev/marvell/mvxpsec.c:1.6 src/sys/dev/marvell/mvxpsec.c:1.7
--- src/sys/dev/marvell/mvxpsec.c:1.6	Sat Jul 25 22:37:16 2020
+++ src/sys/dev/marvell/mvxpsec.c	Sat Jul 25 22:37:48 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: mvxpsec.c,v 1.6 2020/07/25 22:37:16 riastradh Exp $	*/
+/*	$NetBSD: mvxpsec.c,v 1.7 2020/07/25 22:37:48 riastradh Exp $	*/
 /*
  * Copyright (c) 2015 Internet Initiative Japan Inc.
  * All rights reserved.
@@ -24,6 +24,11 @@
  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
  */
+
+#ifdef _KERNEL_OPT
+#include "opt_ipsec.h"
+#endif
+
 /*
  * Cryptographic Engine and Security Accelerator(MVXPSEC)
  */
@@ -63,7 +68,9 @@
 #include <netinet/ip.h>
 #include <netinet/ip6.h>
 
+#if NIPSEC > 0
 #include <netipsec/esp_var.h>
+#endif
 
 #include <arm/cpufunc.h>
 #include <arm/marvell/mvsocvar.h>
@@ -2513,6 +2520,7 @@ mvxpsec_packet_setmbuf(struct mvxpsec_pa
 		}
 	}
 	if (pktlen > SRAM_PAYLOAD_SIZE) {
+#if NIPSEC > 0
 		extern   percpu_t *espstat_percpu;
 	       	/* XXX:
 		 * layer violation. opencrypto knows our max packet size
@@ -2520,6 +2528,7 @@ mvxpsec_packet_setmbuf(struct mvxpsec_pa
 		 */
 
 		_NET_STATINC(espstat_percpu, ESP_STAT_TOOBIG);
+#endif
 		log(LOG_ERR,
 		    "%s: ESP Packet too large: %zu [oct.] > %zu [oct.]\n",
 		    device_xname(sc->sc_dev),
@@ -2562,6 +2571,7 @@ mvxpsec_packet_setuio(struct mvxpsec_pac
 	struct mvxpsec_softc *sc = mv_s->sc;
 
 	if (uio->uio_resid > SRAM_PAYLOAD_SIZE) {
+#if NIPSEC > 0
 		extern   percpu_t *espstat_percpu;
 	       	/* XXX:
 		 * layer violation. opencrypto knows our max packet size
@@ -2569,6 +2579,7 @@ mvxpsec_packet_setuio(struct mvxpsec_pac
 		 */
 
 		_NET_STATINC(espstat_percpu, ESP_STAT_TOOBIG);
+#endif
 		log(LOG_ERR,
 		    "%s: uio request too large: %zu [oct.] > %zu [oct.]\n",
 		    device_xname(sc->sc_dev),

Reply via email to