aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/en/if_en_pci.c
diff options
context:
space:
mode:
authorHartmut Brandt <harti@FreeBSD.org>2003-05-05 16:35:52 +0000
committerHartmut Brandt <harti@FreeBSD.org>2003-05-05 16:35:52 +0000
commit2102bdf21a67857354f08fb71df2361ec8867b56 (patch)
tree07086a2f5c777d2ccea4d0bdcec8c1f59fb51973 /sys/dev/en/if_en_pci.c
parent988c8cab316e8212a71ada0c0debc9f1911c6b58 (diff)
downloadsrc-2102bdf21a67857354f08fb71df2361ec8867b56.tar.gz
src-2102bdf21a67857354f08fb71df2361ec8867b56.zip
Define a link layer MIB for ATM. Most fields of this MIB are needed by
ILMI daemons. Factor out common softc fields for all ATM interfaces that need to be externally visible into an ifatm structure and make the midway driver using this structure and fill the MIB.
Notes
Notes: svn path=/head/; revision=114739
Diffstat (limited to 'sys/dev/en/if_en_pci.c')
-rw-r--r--sys/dev/en/if_en_pci.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/sys/dev/en/if_en_pci.c b/sys/dev/en/if_en_pci.c
index 19b174c299ef..b1ab33e40506 100644
--- a/sys/dev/en/if_en_pci.c
+++ b/sys/dev/en/if_en_pci.c
@@ -141,7 +141,7 @@ adp_busreset(void *v)
dummy = bus_space_read_4(sc->en_memt, sc->en_base, ADP_PCIREG);
if ((dummy & (ADP_PCIREG_SWAP_WORD | ADP_PCIREG_SWAP_DMA)) !=
ADP_PCIREG_SWAP_DMA)
- if_printf(&sc->enif, "adp_busreset: Adaptec ATM did "
+ if_printf(&sc->ifatm.ifnet, "adp_busreset: Adaptec ATM did "
"NOT reset!\n");
}
@@ -190,8 +190,8 @@ en_pci_attach(device_t dev)
scp = (struct en_pci_softc *)sc;
unit = device_get_unit(dev);
- sc->enif.if_unit = unit;
- sc->enif.if_name = "en";
+ sc->ifatm.ifnet.if_unit = unit;
+ sc->ifatm.ifnet.if_name = "en";
/*
* Enable bus mastering.
@@ -265,7 +265,7 @@ en_pci_attach(device_t dev)
en_intr, sc, &scp->ih);
if (error) {
en_reset(sc);
- atm_ifdetach(&sc->enif);
+ atm_ifdetach(&sc->ifatm.ifnet);
device_printf(dev, "could not setup irq\n");
bus_release_resource(dev, SYS_RES_IRQ, 0, scp->irq);
bus_release_resource(dev, SYS_RES_MEMORY, PCI_CBMA, scp->res);
@@ -291,16 +291,16 @@ en_pci_detach(device_t dev)
/*
* Stop DMA and drop transmit queue.
*/
- if ((sc->enif.if_flags & IFF_RUNNING)) {
- if_printf(&sc->enif, "still running\n");
- sc->enif.if_flags &= ~IFF_RUNNING;
+ if ((sc->ifatm.ifnet.if_flags & IFF_RUNNING)) {
+ if_printf(&sc->ifatm.ifnet, "still running\n");
+ sc->ifatm.ifnet.if_flags &= ~IFF_RUNNING;
}
/*
* Close down routes etc.
*/
en_reset(sc);
- atm_ifdetach(&sc->enif);
+ atm_ifdetach(&sc->ifatm.ifnet);
/*
* Deallocate resources.
@@ -339,9 +339,9 @@ adp_get_macaddr(struct en_pci_softc *scp)
struct en_softc * sc = (struct en_softc *)scp;
int lcv;
- for (lcv = 0; lcv < sizeof(sc->macaddr); lcv++)
- sc->macaddr[lcv] = bus_space_read_1(sc->en_memt, sc->en_base,
- MID_ADPMACOFF + lcv);
+ for (lcv = 0; lcv < sizeof(sc->ifatm.mib.esi); lcv++)
+ sc->ifatm.mib.esi[lcv] = bus_space_read_1(sc->en_memt,
+ sc->en_base, MID_ADPMACOFF + lcv);
}
/*
@@ -439,13 +439,13 @@ eni_get_macaddr(device_t dev, struct en_pci_softc *scp)
data = EN_PROM_MAGIC | EN_PROM_DATA | EN_PROM_CLK;
pci_write_config(dev, EN_TONGA, data, 4);
- for (i = 0; i < sizeof(sc->macaddr); i ++)
- sc->macaddr[i] = eni_get_byte(dev, &data, i + EN_ESI);
+ for (i = 0; i < sizeof(sc->ifatm.mib.esi); i ++)
+ sc->ifatm.mib.esi[i] = eni_get_byte(dev, &data, i + EN_ESI);
- sc->serial = 0;
+ sc->ifatm.mib.serial = 0;
for (i = 0; i < 4; i++) {
- sc->serial <<= 8;
- sc->serial |= eni_get_byte(dev, &data, i + EN_SERIAL);
+ sc->ifatm.mib.serial <<= 8;
+ sc->ifatm.mib.serial |= eni_get_byte(dev, &data, i + EN_SERIAL);
}
/* stop operation */
data &= ~EN_PROM_DATA;