summaryrefslogtreecommitdiffstats
path: root/sys/arm/at91
diff options
context:
space:
mode:
authorcognet <cognet@FreeBSD.org>2006-02-06 22:17:42 +0000
committercognet <cognet@FreeBSD.org>2006-02-06 22:17:42 +0000
commit35615ccad69c1857cb5610e50911c6598e5fc445 (patch)
treeae84dcd811ce87d16f2b45c1b3f4f15b84b0265d /sys/arm/at91
parent69e67d72fa59caeb290aa051c4710c0b6cd90529 (diff)
downloadFreeBSD-src-35615ccad69c1857cb5610e50911c6598e5fc445.zip
FreeBSD-src-35615ccad69c1857cb5610e50911c6598e5fc445.tar.gz
- Call mii_phy_probe() after we allocated an ifp. mii has this evil
hack where it assumes the first field of the driver softc is the struct ifnet, and it copies its value in mii_phy_probe(). - In the interrupt handler, set the mbuf m_len field on packet receive.
Diffstat (limited to 'sys/arm/at91')
-rw-r--r--sys/arm/at91/if_ate.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/arm/at91/if_ate.c b/sys/arm/at91/if_ate.c
index 2736240..eec84d36 100644
--- a/sys/arm/at91/if_ate.c
+++ b/sys/arm/at91/if_ate.c
@@ -181,13 +181,13 @@ ate_attach(device_t dev)
ate_get_mac(sc, eaddr);
+ sc->ifp = ifp = if_alloc(IFT_ETHER);
if (mii_phy_probe(dev, &sc->miibus, ate_ifmedia_upd, ate_ifmedia_sts)) {
device_printf(dev, "Cannot find my PHY.\n");
err = ENXIO;
goto out;
}
- sc->ifp = ifp = if_alloc(IFT_ETHER);
ifp->if_softc = sc;
if_initname(ifp, device_get_name(dev), device_get_unit(dev));
ifp->if_mtu = ETHERMTU;
@@ -611,6 +611,8 @@ ate_intr(void *xsc)
BUS_DMASYNC_PREWRITE);
continue;
}
+ mb->m_len = sc->rx_descs[i].status &
+ ETH_LEN_MASK;
/*
* For the last buffer, set the wrap bit so
* the controller restarts from the first
@@ -817,7 +819,7 @@ atestop(struct ate_softc *sc)
/*
* Enable some parts of the MAC that are needed always (like the
* MII bus. This turns off the RE and TE bits, which will remain
- * off until atestart() is called to turn them on. With RE and TE
+ * off until ateinit() is called to turn them on. With RE and TE
* turned off, there's no DMA to worry about after this write.
*/
WR4(sc, ETH_CTL, ETH_CTL_MPE);
OpenPOWER on IntegriCloud