if_rl.c (96112) | if_rl.c (99165) |
---|---|
1/* 2 * Copyright (c) 1997, 1998 3 * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 15 unchanged lines hidden (view full) --- 24 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 30 * THE POSSIBILITY OF SUCH DAMAGE. 31 * | 1/* 2 * Copyright (c) 1997, 1998 3 * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 15 unchanged lines hidden (view full) --- 24 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 30 * THE POSSIBILITY OF SUCH DAMAGE. 31 * |
32 * $FreeBSD: head/sys/pci/if_rl.c 96112 2002-05-06 13:43:00Z jhb $ | 32 * $FreeBSD: head/sys/pci/if_rl.c 99165 2002-06-30 22:16:22Z luigi $ |
33 */ 34 35/* 36 * RealTek 8129/8139 PCI NIC driver 37 * 38 * Supports several extremely cheap PCI 10/100 adapters based on 39 * the RealTek chipset. Datasheets can be obtained from 40 * www.realtek.com.tw. --- 85 unchanged lines hidden (view full) --- 126 * uniprocessor systems though. 127 */ 128#define RL_USEIOSPACE 129 130#include <pci/if_rlreg.h> 131 132#ifndef lint 133static const char rcsid[] = | 33 */ 34 35/* 36 * RealTek 8129/8139 PCI NIC driver 37 * 38 * Supports several extremely cheap PCI 10/100 adapters based on 39 * the RealTek chipset. Datasheets can be obtained from 40 * www.realtek.com.tw. --- 85 unchanged lines hidden (view full) --- 126 * uniprocessor systems though. 127 */ 128#define RL_USEIOSPACE 129 130#include <pci/if_rlreg.h> 131 132#ifndef lint 133static const char rcsid[] = |
134 "$FreeBSD: head/sys/pci/if_rl.c 96112 2002-05-06 13:43:00Z jhb $"; | 134 "$FreeBSD: head/sys/pci/if_rl.c 99165 2002-06-30 22:16:22Z luigi $"; |
135#endif 136 137/* 138 * Various supported device vendors/types and their names. 139 */ 140static struct rl_type rl_devs[] = { 141 { RT_VENDORID, RT_DEVICEID_8129, 142 "RealTek 8129 10/100BaseTX" }, --- 1144 unchanged lines hidden (view full) --- 1287static void rl_txeof(sc) 1288 struct rl_softc *sc; 1289{ 1290 struct ifnet *ifp; 1291 u_int32_t txstat; 1292 1293 ifp = &sc->arpcom.ac_if; 1294 | 135#endif 136 137/* 138 * Various supported device vendors/types and their names. 139 */ 140static struct rl_type rl_devs[] = { 141 { RT_VENDORID, RT_DEVICEID_8129, 142 "RealTek 8129 10/100BaseTX" }, --- 1144 unchanged lines hidden (view full) --- 1287static void rl_txeof(sc) 1288 struct rl_softc *sc; 1289{ 1290 struct ifnet *ifp; 1291 u_int32_t txstat; 1292 1293 ifp = &sc->arpcom.ac_if; 1294 |
1295 /* Clear the timeout timer. */ 1296 ifp->if_timer = 0; 1297 | |
1298 /* 1299 * Go through our tx list and free mbufs for those 1300 * frames that have been uploaded. 1301 */ 1302 do { 1303 txstat = CSR_READ_4(sc, RL_LAST_TXSTAT(sc)); 1304 if (!(txstat & (RL_TXSTAT_TX_OK| 1305 RL_TXSTAT_TX_UNDERRUN|RL_TXSTAT_TXABRT))) --- 26 unchanged lines hidden (view full) --- 1332 if (txstat & RL_TXSTAT_TX_UNDERRUN) 1333 sc->rl_txthresh = oldthresh + 32; 1334 return; 1335 } 1336 RL_INC(sc->rl_cdata.last_tx); 1337 ifp->if_flags &= ~IFF_OACTIVE; 1338 } while (sc->rl_cdata.last_tx != sc->rl_cdata.cur_tx); 1339 | 1295 /* 1296 * Go through our tx list and free mbufs for those 1297 * frames that have been uploaded. 1298 */ 1299 do { 1300 txstat = CSR_READ_4(sc, RL_LAST_TXSTAT(sc)); 1301 if (!(txstat & (RL_TXSTAT_TX_OK| 1302 RL_TXSTAT_TX_UNDERRUN|RL_TXSTAT_TXABRT))) --- 26 unchanged lines hidden (view full) --- 1329 if (txstat & RL_TXSTAT_TX_UNDERRUN) 1330 sc->rl_txthresh = oldthresh + 32; 1331 return; 1332 } 1333 RL_INC(sc->rl_cdata.last_tx); 1334 ifp->if_flags &= ~IFF_OACTIVE; 1335 } while (sc->rl_cdata.last_tx != sc->rl_cdata.cur_tx); 1336 |
1337 ifp->if_timer = 1338 (sc->rl_cdata.last_tx == sc->rl_cdata.cur_tx) ? 0 : 5; 1339 |
|
1340 return; 1341} 1342 1343static void rl_tick(xsc) 1344 void *xsc; 1345{ 1346 struct rl_softc *sc; 1347 struct mii_data *mii; --- 557 unchanged lines hidden --- | 1340 return; 1341} 1342 1343static void rl_tick(xsc) 1344 void *xsc; 1345{ 1346 struct rl_softc *sc; 1347 struct mii_data *mii; --- 557 unchanged lines hidden --- |