Module Name: src
Committed By: jmcneill
Date: Sun Sep 26 20:14:07 UTC 2021
Modified Files:
src/sys/dev/pci: if_mcx.c
Log Message:
Enable checksum offload features by default.
To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/dev/pci/if_mcx.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/pci/if_mcx.c
diff -u src/sys/dev/pci/if_mcx.c:1.21 src/sys/dev/pci/if_mcx.c:1.22
--- src/sys/dev/pci/if_mcx.c:1.21 Sun Sep 26 15:01:55 2021
+++ src/sys/dev/pci/if_mcx.c Sun Sep 26 20:14:07 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: if_mcx.c,v 1.21 2021/09/26 15:01:55 jmcneill Exp $ */
+/* $NetBSD: if_mcx.c,v 1.22 2021/09/26 20:14:07 jmcneill Exp $ */
/* $OpenBSD: if_mcx.c,v 1.101 2021/06/02 19:16:11 patrick Exp $ */
/*
@@ -23,7 +23,7 @@
#endif
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_mcx.c,v 1.21 2021/09/26 15:01:55 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_mcx.c,v 1.22 2021/09/26 20:14:07 jmcneill Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -2743,6 +2743,7 @@ mcx_attach(device_t parent, device_t sel
struct mcx_softc *sc = device_private(self);
struct ifnet *ifp = &sc->sc_ec.ec_if;
struct pci_attach_args *pa = aux;
+ struct ifcapreq ifcr;
uint8_t enaddr[ETHER_ADDR_LEN];
int counts[PCI_INTR_TYPE_SIZE];
char intrxname[32];
@@ -2993,6 +2994,12 @@ mcx_attach(device_t parent, device_t sel
ifmedia_set(&sc->sc_media, IFM_ETHER | IFM_AUTO);
if_attach(ifp);
+
+ /* Enable hardware offload by default */
+ memset(&ifcr, 0, sizeof(ifcr));
+ ifcr.ifcr_capenable = ifp->if_capabilities;
+ ifioctl_common(ifp, SIOCSIFCAP, &ifcr);
+
if_deferred_start_init(ifp, NULL);
ether_ifattach(ifp, enaddr);