summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorharti <harti@FreeBSD.org>2003-05-05 16:35:52 +0000
committerharti <harti@FreeBSD.org>2003-05-05 16:35:52 +0000
commit4d2e2437c20e62618ad0958e7ab0502c29c759e0 (patch)
tree07086a2f5c777d2ccea4d0bdcec8c1f59fb51973 /sys
parent1e484c95bf637cabbbb0bc1ff304f68bdb653f82 (diff)
downloadFreeBSD-src-4d2e2437c20e62618ad0958e7ab0502c29c759e0.zip
FreeBSD-src-4d2e2437c20e62618ad0958e7ab0502c29c759e0.tar.gz
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.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/en/if_en_pci.c32
-rw-r--r--sys/dev/en/midway.c111
-rw-r--r--sys/dev/en/midwayvar.h6
-rw-r--r--sys/net/if_atm.h60
-rw-r--r--sys/net/if_atmsubr.c3
-rw-r--r--sys/pci/if_en_pci.c32
6 files changed, 163 insertions, 81 deletions
diff --git a/sys/dev/en/if_en_pci.c b/sys/dev/en/if_en_pci.c
index 19b174c..b1ab33e 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;
diff --git a/sys/dev/en/midway.c b/sys/dev/en/midway.c
index e468f4f..52eb300 100644
--- a/sys/dev/en/midway.c
+++ b/sys/dev/en/midway.c
@@ -91,7 +91,7 @@
*/
#define DBG(SC, FL, PRINT) do { \
if ((SC)->debug & DBG_##FL) { \
- if_printf(&(SC)->enif, "%s: "#FL": ", __func__); \
+ if_printf(&(SC)->ifatm.ifnet, "%s: "#FL": ", __func__); \
printf PRINT; \
printf("\n"); \
} \
@@ -137,6 +137,7 @@ enum {
#include <vm/uma.h>
#include <net/if.h>
+#include <net/if_media.h>
#include <net/if_atm.h>
#if defined(INET) || defined(INET6)
@@ -390,7 +391,7 @@ en_dump_packet(struct en_softc *sc, struct mbuf *m)
int len;
u_char *ptr;
- if_printf(&sc->enif, "packet len=%d", plen);
+ if_printf(&sc->ifatm.ifnet, "packet len=%d", plen);
while (m != NULL) {
totlen += m->m_len;
ptr = mtod(m, u_char *);
@@ -444,7 +445,8 @@ en_map_ctor(void *mem, int size, void *arg)
if (!(map->flags & ENMAP_ALLOC)) {
err = bus_dmamap_create(sc->txtag, 0, &map->map);
if (err != 0)
- if_printf(&sc->enif, "cannot create DMA map %d\n", err);
+ if_printf(&sc->ifatm.ifnet,
+ "cannot create DMA map %d\n", err);
else
map->flags |= ENMAP_ALLOC;
}
@@ -753,7 +755,8 @@ en_txdma(struct en_softc *sc, struct en_txslot *slot)
lastm->m_next = NULL;
if (error != 0) {
- if_printf(&sc->enif, "loading TX map failed %d\n", error);
+ if_printf(&sc->ifatm.ifnet, "loading TX map failed %d\n",
+ error);
goto dequeue_drop;
}
map->flags |= ENMAP_LOADED;
@@ -768,10 +771,10 @@ en_txdma(struct en_softc *sc, struct en_txslot *slot)
}
EN_COUNT(sc->stats.launch);
- sc->enif.if_opackets++;
+ sc->ifatm.ifnet.if_opackets++;
#ifdef ENABLE_BPF
- if (sc->enif.if_bpf != NULL) {
+ if (sc->ifatm.ifnet.if_bpf != NULL) {
/*
* adjust the top of the mbuf to skip the TBD if present
* before passing the packet to bpf.
@@ -789,7 +792,7 @@ en_txdma(struct en_softc *sc, struct en_txslot *slot)
tx.m->m_pkthdr.len = tx.datalen;
}
- BPF_MTAP(&sc->enif, tx.m);
+ BPF_MTAP(&sc->ifatm.ifnet, tx.m);
}
#endif
@@ -1284,7 +1287,7 @@ en_reset_ul(struct en_softc *sc)
struct mbuf *m;
int lcv, slot;
- if_printf(&sc->enif, "reset\n");
+ if_printf(&sc->ifatm.ifnet, "reset\n");
if (sc->en_busreset)
sc->en_busreset(sc);
@@ -1373,15 +1376,15 @@ en_init(struct en_softc *sc)
int vc, slot;
uint32_t loc;
- if ((sc->enif.if_flags & IFF_UP) == 0) {
+ if ((sc->ifatm.ifnet.if_flags & IFF_UP) == 0) {
DBG(sc, INIT, ("going down"));
en_reset(sc); /* to be safe */
- sc->enif.if_flags &= ~IFF_RUNNING; /* disable */
+ sc->ifatm.ifnet.if_flags &= ~IFF_RUNNING; /* disable */
return;
}
DBG(sc, INIT, ("going up"));
- sc->enif.if_flags |= IFF_RUNNING; /* enable */
+ sc->ifatm.ifnet.if_flags |= IFF_RUNNING; /* enable */
if (sc->en_busreset)
sc->en_busreset(sc);
@@ -1768,8 +1771,9 @@ en_intr_rx_dma(struct en_softc *sc)
_IF_DEQUEUE(&sc->rxslot[slot].indma, m);
if (m == NULL)
panic("enintr: drqsync: %s%d: lost mbuf"
- " in slot %d!", sc->enif.if_name,
- sc->enif.if_unit, slot);
+ " in slot %d!",
+ sc->ifatm.ifnet.if_name,
+ sc->ifatm.ifnet.if_unit, slot);
map = (void *)m->m_pkthdr.rcvif;
uma_zfree(sc->map_zone, map);
}
@@ -1802,16 +1806,16 @@ en_intr_rx_dma(struct en_softc *sc)
sc->rxslot[slot].atm_vci, m,
EN_DQ_LEN(drq), sc->rxslot[slot].rxhand));
- m->m_pkthdr.rcvif = &sc->enif;
- sc->enif.if_ipackets++;
+ m->m_pkthdr.rcvif = &sc->ifatm.ifnet;
+ sc->ifatm.ifnet.if_ipackets++;
#ifdef EN_DEBUG
if (sc->debug & DBG_IPACKETS)
en_dump_packet(sc, m);
#endif
#ifdef ENABLE_BPF
- BPF_MTAP(&sc->enif, m);
+ BPF_MTAP(&sc->ifatm.ifnet, m);
#endif
- atm_input(&sc->enif, &ah, m,
+ atm_input(&sc->ifatm.ifnet, &ah, m,
sc->rxslot[slot].rxhand);
}
}
@@ -2170,16 +2174,16 @@ en_service(struct en_softc *sc)
if (MID_RBD_CNT(rbd) * MID_ATMDATASZ <
MID_PDU_LEN(pdu)) {
- if_printf(&sc->enif, "invalid AAL5 length\n");
+ if_printf(&sc->ifatm.ifnet, "invalid AAL5 length\n");
rx.post_skip = MID_RBD_CNT(rbd) * MID_ATMDATASZ;
mlen = 0;
- sc->enif.if_ierrors++;
+ sc->ifatm.ifnet.if_ierrors++;
} else if (rbd & MID_RBD_CRCERR) {
- if_printf(&sc->enif, "CRC error\n");
+ if_printf(&sc->ifatm.ifnet, "CRC error\n");
rx.post_skip = MID_RBD_CNT(rbd) * MID_ATMDATASZ;
mlen = 0;
- sc->enif.if_ierrors++;
+ sc->ifatm.ifnet.if_ierrors++;
} else {
mlen = MID_PDU_LEN(pdu);
@@ -2256,7 +2260,7 @@ en_service(struct en_softc *sc)
en_rxdma_load, &rx, 0);
if (error != 0) {
- if_printf(&sc->enif, "loading RX map failed "
+ if_printf(&sc->ifatm.ifnet, "loading RX map failed "
"%d\n", error);
uma_zfree(sc->map_zone, map);
m_freem(m);
@@ -2352,13 +2356,13 @@ en_intr(void *arg)
* unexpected errors that need a reset
*/
if ((reg & (MID_INT_IDENT | MID_INT_LERR | MID_INT_DMA_ERR)) != 0) {
- if_printf(&sc->enif, "unexpected interrupt=0x%b, resetting\n",
- reg, MID_INTBITS);
+ if_printf(&sc->ifatm.ifnet, "unexpected interrupt=0x%b, "
+ "resetting\n", reg, MID_INTBITS);
#ifdef EN_DEBUG
#ifdef DDB
Debugger("en: unexpected error");
#endif /* DDB */
- sc->enif.if_flags &= ~IFF_RUNNING; /* FREEZE! */
+ sc->ifatm.ifnet.if_flags &= ~IFF_RUNNING; /* FREEZE! */
#else
en_reset_ul(sc);
en_init(sc);
@@ -2369,8 +2373,8 @@ en_intr(void *arg)
#if 0
if (reg & MID_INT_SUNI)
- if_printf(&sc->enif, "interrupt from SUNI (probably carrier "
- "change)\n");
+ if_printf(&sc->ifatm.ifnet, "interrupt from SUNI (probably "
+ "carrier change)\n");
#endif
kick = 0;
@@ -2679,7 +2683,7 @@ en_dmaprobe(struct en_softc *sc)
int
en_attach(struct en_softc *sc)
{
- struct ifnet *ifp = &sc->enif;
+ struct ifnet *ifp = &sc->ifatm.ifnet;
int sz;
uint32_t reg, lcv, check, ptr, sav, midvloc;
@@ -2734,29 +2738,50 @@ en_attach(struct en_softc *sc)
reg = en_read(sc, MID_RESID);
- if_printf(&sc->enif, "ATM midway v%d, board IDs %d.%d, %s%s%s, "
+ if_printf(&sc->ifatm.ifnet, "ATM midway v%d, board IDs %d.%d, %s%s%s, "
"%ldKB on-board RAM\n", MID_VER(reg), MID_MID(reg), MID_DID(reg),
(MID_IS_SABRE(reg)) ? "sabre controller, " : "",
(MID_IS_SUNI(reg)) ? "SUNI" : "Utopia",
(!MID_IS_SUNI(reg) && MID_IS_UPIPE(reg)) ? " (pipelined)" : "",
(long)sc->en_obmemsz / 1024);
+ /*
+ * fill in common ATM interface stuff
+ */
+ sc->ifatm.mib.hw_version = (MID_VER(reg) << 16) |
+ (MID_MID(reg) << 8) | MID_DID(reg);
+ if (MID_DID(reg) & 0x4)
+ sc->ifatm.mib.media = IFM_ATM_UTP_155;
+ else
+ sc->ifatm.mib.media = IFM_ATM_MM_155;
+
+ sc->ifatm.mib.pcr = ATM_RATE_155M;
+ sc->ifatm.mib.vpi_bits = 0;
+ sc->ifatm.mib.vci_bits = MID_VCI_BITS;
+ sc->ifatm.mib.max_vccs = MID_N_VC;
+ sc->ifatm.mib.max_vpcs = 0;
+
if (sc->is_adaptec) {
+ sc->ifatm.mib.device = ATM_DEVICE_ADP155P;
if (sc->bestburstlen == 64 && sc->alburst == 0)
- if_printf(&sc->enif, "passed 64 byte DMA test\n");
+ if_printf(&sc->ifatm.ifnet,
+ "passed 64 byte DMA test\n");
else
- if_printf(&sc->enif, "FAILED DMA TEST: burst=%d, "
- "alburst=%d\n", sc->bestburstlen, sc->alburst);
+ if_printf(&sc->ifatm.ifnet, "FAILED DMA TEST: "
+ "burst=%d, alburst=%d\n", sc->bestburstlen,
+ sc->alburst);
} else {
- if_printf(&sc->enif, "maximum DMA burst length = %d bytes%s\n",
- sc->bestburstlen, sc->alburst ? sc->noalbursts ?
- " (no large bursts)" : " (must align)" : "");
+ sc->ifatm.mib.device = ATM_DEVICE_ENI155P;
+ if_printf(&sc->ifatm.ifnet, "maximum DMA burst length = %d "
+ "bytes%s\n", sc->bestburstlen, sc->alburst ?
+ sc->noalbursts ? " (no large bursts)" : " (must align)" :
+ "");
}
/*
* link into network subsystem and prepare card
*/
- sc->enif.if_softc = sc;
+ sc->ifatm.ifnet.if_softc = sc;
ifp->if_flags = IFF_SIMPLEX;
ifp->if_ioctl = en_ioctl;
ifp->if_start = en_start;
@@ -2816,7 +2841,7 @@ en_attach(struct en_softc *sc)
ptr = roundup(ptr, EN_TXSZ * 1024); /* align */
sz = sz - (ptr - sav);
if (EN_TXSZ*1024 * EN_NTX > sz) {
- if_printf(&sc->enif, "EN_NTX/EN_TXSZ too big\n");
+ if_printf(&sc->ifatm.ifnet, "EN_NTX/EN_TXSZ too big\n");
goto fail;
}
for (lcv = 0 ;lcv < EN_NTX ;lcv++) {
@@ -2835,7 +2860,7 @@ en_attach(struct en_softc *sc)
sz = sz - (ptr - sav);
sc->en_nrx = sz / (EN_RXSZ * 1024);
if (sc->en_nrx <= 0) {
- if_printf(&sc->enif, "EN_NTX/EN_TXSZ/EN_RXSZ too big\n");
+ if_printf(&sc->ifatm.ifnet, "EN_NTX/EN_TXSZ/EN_RXSZ too big\n");
goto fail;
}
@@ -2867,12 +2892,10 @@ en_attach(struct en_softc *sc)
sc->rxslot[lcv].mode));
}
- bzero(&sc->stats, sizeof(sc->stats));
-
- if_printf(&sc->enif, "%d %dKB receive buffers, %d %dKB transmit "
+ if_printf(&sc->ifatm.ifnet, "%d %dKB receive buffers, %d %dKB transmit "
"buffers\n", sc->en_nrx, EN_RXSZ, EN_NTX, EN_TXSZ);
- if_printf(&sc->enif, "end station identifier (mac address) %6D\n",
- sc->macaddr, ":");
+ if_printf(&sc->ifatm.ifnet, "end station identifier (mac address) "
+ "%6D\n", sc->ifatm.mib.esi, ":");
/*
* final commit
@@ -3110,7 +3133,7 @@ en_dump(int unit, int level)
if (unit != -1 && unit != lcv)
continue;
- if_printf(&sc->enif, "dumping device at level 0x%b\n",
+ if_printf(&sc->ifatm.ifnet, "dumping device at level 0x%b\n",
level, END_BITS);
if (sc->dtq_us == 0) {
diff --git a/sys/dev/en/midwayvar.h b/sys/dev/en/midwayvar.h
index 8942fd9..7b29f52 100644
--- a/sys/dev/en/midwayvar.h
+++ b/sys/dev/en/midwayvar.h
@@ -142,7 +142,7 @@ struct en_rxslot {
*/
struct en_softc {
/* bsd glue */
- struct ifnet enif; /* network ifnet handle */
+ struct ifatm ifatm; /* ATM network ifnet handle */
device_t dev;
/* bus glue */
@@ -211,10 +211,6 @@ struct en_softc {
/* memory zones */
uma_zone_t map_zone;
- /* board info */
- uint8_t macaddr[6];
- uint32_t serial;
-
#ifdef EN_DEBUG
/* debugging */
u_int debug;
diff --git a/sys/net/if_atm.h b/sys/net/if_atm.h
index b8a34a8..98f3b3b 100644
--- a/sys/net/if_atm.h
+++ b/sys/net/if_atm.h
@@ -37,6 +37,66 @@
* net/if_atm.h
*/
+/*
+ * Classification of ATM cards.
+ */
+#define ATM_DEVICE_UNKNOWN 0
+#define ATM_DEVICE_PCA200E 1 /* Fore/Marconi PCA200-E */
+#define ATM_DEVICE_HE155 2 /* Fore/Marconi HE155 */
+#define ATM_DEVICE_HE622 3 /* Fore/Marconi HE622 */
+#define ATM_DEVICE_ENI155P 4 /* Efficient networks 155p */
+#define ATM_DEVICE_ADP155P 5 /* Adaptec 155p */
+
+/* map to strings and vendors */
+#define ATM_DEVICE_NAMES \
+ { "Unknown", "Unknown" }, \
+ { "PCA200-E", "Fore/Marconi" }, \
+ { "HE155", "Fore/Marconi" }, \
+ { "HE622", "Fore/Marconi" }, \
+ { "ENI155p", "Efficient Networks" }, \
+ { "ADP155p", "Adaptec" },
+
+/*
+ * This is the common link layer MIB for all ATM interfaces. Much of the
+ * information here is needed for ILMI. This will be augmented by statistics
+ * at some point.
+ */
+struct ifatm_mib {
+ /* configuration data */
+ uint8_t device; /* type of card */
+ u_char esi[6]; /* end system identifier (MAC) */
+ uint32_t serial; /* card serial number */
+ uint32_t hw_version; /* card version */
+ uint32_t sw_version; /* firmware version (if any) */
+ uint32_t pcr; /* supported peak cell rate */
+ uint32_t media; /* physical media */
+ uint8_t vpi_bits; /* number of used bits in VPI field */
+ uint8_t vci_bits; /* number of used bits in VCI field */
+ uint16_t max_vpcs; /* maximum number of VPCs */
+ uint32_t max_vccs; /* maximum number of VCCs */
+};
+
+#ifdef _KERNEL
+/*
+ * Common fields for all ATM interfaces. Each driver's softc must start with
+ * this structure.
+ */
+struct ifatm {
+ struct ifnet ifnet; /* required by if_var.h */
+ struct ifatm_mib mib; /* exported data */
+ void *phy; /* usually SUNI */
+ void *ngpriv; /* netgraph link */
+};
+#endif
+
+/*
+ * Peak cell rates for various physical media. Note, that there are
+ * different opinions on what the correct values are.
+ */
+#define ATM_RATE_155M 353208
+#define ATM_RATE_622M 1412830
+#define ATM_RATE_24G 5651320
+
#if defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__)
#define RTALLOC1(A,B) rtalloc1((A),(B))
#elif defined(__FreeBSD__)
diff --git a/sys/net/if_atmsubr.c b/sys/net/if_atmsubr.c
index ac1c8da..148c2ec 100644
--- a/sys/net/if_atmsubr.c
+++ b/sys/net/if_atmsubr.c
@@ -296,6 +296,7 @@ atm_ifattach(ifp)
{
struct ifaddr *ifa;
struct sockaddr_dl *sdl;
+ struct ifatm *ifatm = ifp->if_softc;
ifp->if_type = IFT_ATM;
ifp->if_addrlen = 0;
@@ -326,6 +327,8 @@ atm_ifattach(ifp)
break;
}
+ ifp->if_linkmib = &ifatm->mib;
+ ifp->if_linkmiblen = sizeof(ifatm->mib);
}
/*
diff --git a/sys/pci/if_en_pci.c b/sys/pci/if_en_pci.c
index 19b174c..b1ab33e 100644
--- a/sys/pci/if_en_pci.c
+++ b/sys/pci/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;
OpenPOWER on IntegriCloud