Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/x86/pci Set ifflags callback so that the device can...



details:   https://anonhg.NetBSD.org/src/rev/227e48e144ee
branches:  trunk
changeset: 331547:227e48e144ee
user:      hikaru <hikaru%NetBSD.org@localhost>
date:      Thu Aug 14 05:42:16 2014 +0000

description:
Set ifflags callback so that the device can enter promiscuous mode.

diffstat:

 sys/arch/x86/pci/if_vmx.c |  15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diffs (50 lines):

diff -r c3296cd1bcf0 -r 227e48e144ee sys/arch/x86/pci/if_vmx.c
--- a/sys/arch/x86/pci/if_vmx.c Thu Aug 14 04:14:33 2014 +0000
+++ b/sys/arch/x86/pci/if_vmx.c Thu Aug 14 05:42:16 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_vmx.c,v 1.4 2014/07/19 06:12:24 hikaru Exp $        */
+/*     $NetBSD: if_vmx.c,v 1.5 2014/08/14 05:42:16 hikaru Exp $        */
 /*     $OpenBSD: if_vmx.c,v 1.16 2014/01/22 06:04:17 brad Exp $        */
 
 /*
@@ -18,7 +18,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_vmx.c,v 1.4 2014/07/19 06:12:24 hikaru Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vmx.c,v 1.5 2014/08/14 05:42:16 hikaru Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -158,6 +158,7 @@
 void vmxnet3_txintr(struct vmxnet3_softc *, struct vmxnet3_txqueue *);
 void vmxnet3_rxintr(struct vmxnet3_softc *, struct vmxnet3_rxqueue *);
 void vmxnet3_iff(struct vmxnet3_softc *);
+int vmxnet3_ifflags_cb(struct ethercom *);
 void vmxnet3_rx_csum(struct vmxnet3_rxcompdesc *, struct mbuf *);
 int vmxnet3_getbuf(struct vmxnet3_softc *, struct vmxnet3_rxring *);
 void vmxnet3_stop(struct ifnet *, int disable);
@@ -308,6 +309,7 @@
 
        if_attach(ifp);
        ether_ifattach(ifp, enaddr);
+       ether_set_ifflags_cb(&sc->sc_ethercom, vmxnet3_ifflags_cb);
        vmxnet3_link_state(sc);
 }
 
@@ -859,6 +861,15 @@
        WRITE_CMD(sc, VMXNET3_CMD_SET_RXMODE);
 }
 
+int
+vmxnet3_ifflags_cb(struct ethercom *ec)
+{
+
+       vmxnet3_iff((struct vmxnet3_softc *)ec->ec_if.if_softc);
+
+       return 0;
+}
+
 
 void
 vmxnet3_rx_csum(struct vmxnet3_rxcompdesc *rxcd, struct mbuf *m)



Home | Main Index | Thread Index | Old Index