summaryrefslogtreecommitdiff
path: root/sys/dev/pci/if_nxe.c
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2007-08-15 07:06:37 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2007-08-15 07:06:37 +0000
commit14787b86db06793ddc3a3ffea135953a42fb5f9b (patch)
treebd275c907f74d8f445155669651294ef9db99f4f /sys/dev/pci/if_nxe.c
parente20b3c14a73e32a37ad93a20cbdba9c7da62d49b (diff)
program the lladdr when the chip is brought up.
Diffstat (limited to 'sys/dev/pci/if_nxe.c')
-rw-r--r--sys/dev/pci/if_nxe.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/sys/dev/pci/if_nxe.c b/sys/dev/pci/if_nxe.c
index a7c6c13e638..b9a0c48fbd7 100644
--- a/sys/dev/pci/if_nxe.c
+++ b/sys/dev/pci/if_nxe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_nxe.c,v 1.35 2007/08/15 07:03:23 dlg Exp $ */
+/* $OpenBSD: if_nxe.c,v 1.36 2007/08/15 07:06:36 dlg Exp $ */
/*
* Copyright (c) 2007 David Gwynne <dlg@openbsd.org>
@@ -741,6 +741,7 @@ void nxe_start(struct ifnet *);
void nxe_watchdog(struct ifnet *);
void nxe_up(struct nxe_softc *);
+void nxe_lladdr(struct nxe_softc *);
void nxe_iff(struct nxe_softc *);
void nxe_down(struct nxe_softc *);
@@ -1100,9 +1101,13 @@ nxe_up(struct nxe_softc *sc)
(u_int32_t)dva);
nxe_crb_write(sc, NXE_1_SW_CONTEXT_ADDR_HI(sc->sc_function),
(u_int32_t)(dva >> 32));
- nxe_crb_write(sc, NXE_1_SW_CONTEXT(sc->sc_port),
+ nxe_crb_write(sc, NXE_1_SW_CONTEXT(sc->sc_port),
NXE_1_SW_CONTEXT_SIG(sc->sc_port));
+ nxe_crb_set(sc, 0);
+ nxe_lladdr(sc);
+ nxe_crb_set(sc, 1);
+
SET(ifp->if_flags, IFF_RUNNING);
CLR(ifp->if_flags, IFF_OACTIVE);
@@ -1153,6 +1158,20 @@ nxe_up_fw(struct nxe_softc *sc)
}
void
+nxe_lladdr(struct nxe_softc *sc)
+{
+ u_int8_t *lladdr = sc->sc_ac.ac_enaddr;
+
+ DASSERT(sc->sc_window == 0);
+
+ nxe_crb_write(sc, NXE_0_XG_MAC_LO(sc->sc_port),
+ (lladdr[0] << 24) | (lladdr[1] << 16));
+ nxe_crb_write(sc, NXE_0_XG_MAC_HI(sc->sc_port),
+ (lladdr[2] << 24) | (lladdr[3] << 16) |
+ (lladdr[4] << 8) | (lladdr[5] << 0));
+}
+
+void
nxe_iff(struct nxe_softc *sc)
{