if_fxp.c (270876) | if_fxp.c (271782) |
---|---|
1/*- 2 * Copyright (c) 1995, David Greenman 3 * Copyright (c) 2001 Jonathan Lemon <jlemon@freebsd.org> 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 14 unchanged lines hidden (view full) --- 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 * 28 */ 29 30#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1995, David Greenman 3 * Copyright (c) 2001 Jonathan Lemon <jlemon@freebsd.org> 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 14 unchanged lines hidden (view full) --- 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 * 28 */ 29 30#include <sys/cdefs.h> |
31__FBSDID("$FreeBSD: head/sys/dev/fxp/if_fxp.c 270876 2014-08-31 12:48:13Z glebius $"); | 31__FBSDID("$FreeBSD: head/sys/dev/fxp/if_fxp.c 271782 2014-09-18 15:56:14Z glebius $"); |
32 33/* 34 * Intel EtherExpress Pro/100B PCI Fast Ethernet driver 35 */ 36 37#ifdef HAVE_KERNEL_OPTION_HEADERS 38#include "opt_device_polling.h" 39#endif --- 1967 unchanged lines hidden (view full) --- 2007 FXP_UNLOCK(sc); 2008 if_input(ifp, m); 2009 FXP_LOCK(sc); 2010 rx_npkts++; 2011 if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0) 2012 return (rx_npkts); 2013 } else { 2014 /* Reuse RFA and loaded DMA map. */ | 32 33/* 34 * Intel EtherExpress Pro/100B PCI Fast Ethernet driver 35 */ 36 37#ifdef HAVE_KERNEL_OPTION_HEADERS 38#include "opt_device_polling.h" 39#endif --- 1967 unchanged lines hidden (view full) --- 2007 FXP_UNLOCK(sc); 2008 if_input(ifp, m); 2009 FXP_LOCK(sc); 2010 rx_npkts++; 2011 if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0) 2012 return (rx_npkts); 2013 } else { 2014 /* Reuse RFA and loaded DMA map. */ |
2015 if_inciqdrops(ifp, 1); | 2015 if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); |
2016 fxp_discard_rfabuf(sc, rxp); 2017 } 2018 fxp_add_rfabuf(sc, rxp); 2019 } 2020 if (rnr) { 2021 fxp_scb_wait(sc); 2022 CSR_WRITE_4(sc, FXP_CSR_SCB_GENERAL, 2023 sc->fxp_desc.rx_head->rx_addr); --- 41 unchanged lines hidden (view full) --- 2065 hsp->rx_cdt_errors += le32toh(sp->rx_cdt_errors); 2066 hsp->rx_shortframes += le32toh(sp->rx_shortframes); 2067 hsp->tx_pause += le32toh(sp->tx_pause); 2068 hsp->rx_pause += le32toh(sp->rx_pause); 2069 hsp->rx_controls += le32toh(sp->rx_controls); 2070 hsp->tx_tco += le16toh(sp->tx_tco); 2071 hsp->rx_tco += le16toh(sp->rx_tco); 2072 | 2016 fxp_discard_rfabuf(sc, rxp); 2017 } 2018 fxp_add_rfabuf(sc, rxp); 2019 } 2020 if (rnr) { 2021 fxp_scb_wait(sc); 2022 CSR_WRITE_4(sc, FXP_CSR_SCB_GENERAL, 2023 sc->fxp_desc.rx_head->rx_addr); --- 41 unchanged lines hidden (view full) --- 2065 hsp->rx_cdt_errors += le32toh(sp->rx_cdt_errors); 2066 hsp->rx_shortframes += le32toh(sp->rx_shortframes); 2067 hsp->tx_pause += le32toh(sp->tx_pause); 2068 hsp->rx_pause += le32toh(sp->rx_pause); 2069 hsp->rx_controls += le32toh(sp->rx_controls); 2070 hsp->tx_tco += le16toh(sp->tx_tco); 2071 hsp->rx_tco += le16toh(sp->rx_tco); 2072 |
2073 if_incopackets(ifp, le32toh(sp->tx_good)); 2074 if_inccollisions(ifp, le32toh(sp->tx_total_collisions)); | 2073 if_inc_counter(ifp, IFCOUNTER_OPACKETS, le32toh(sp->tx_good)); 2074 if_inc_counter(ifp, IFCOUNTER_COLLISIONS, 2075 le32toh(sp->tx_total_collisions)); |
2075 if (sp->rx_good) { | 2076 if (sp->rx_good) { |
2076 if_incipackets(ifp, le32toh(sp->rx_good)); | 2077 if_inc_counter(ifp, IFCOUNTER_IPACKETS, 2078 le32toh(sp->rx_good)); |
2077 sc->rx_idle_secs = 0; 2078 } else if (sc->flags & FXP_FLAG_RXBUG) { 2079 /* 2080 * Receiver's been idle for another second. 2081 */ 2082 sc->rx_idle_secs++; 2083 } | 2079 sc->rx_idle_secs = 0; 2080 } else if (sc->flags & FXP_FLAG_RXBUG) { 2081 /* 2082 * Receiver's been idle for another second. 2083 */ 2084 sc->rx_idle_secs++; 2085 } |
2084 if_incierrors(ifp, | 2086 if_inc_counter(ifp, IFCOUNTER_IERRORS, |
2085 le32toh(sp->rx_crc_errors) + 2086 le32toh(sp->rx_alignment_errors) + 2087 le32toh(sp->rx_rnr_errors) + 2088 le32toh(sp->rx_overrun_errors)); 2089 /* 2090 * If any transmit underruns occured, bump up the transmit 2091 * threshold by another 512 bytes (64 * 8). 2092 */ 2093 if (sp->tx_underruns) { | 2087 le32toh(sp->rx_crc_errors) + 2088 le32toh(sp->rx_alignment_errors) + 2089 le32toh(sp->rx_rnr_errors) + 2090 le32toh(sp->rx_overrun_errors)); 2091 /* 2092 * If any transmit underruns occured, bump up the transmit 2093 * threshold by another 512 bytes (64 * 8). 2094 */ 2095 if (sp->tx_underruns) { |
2094 if_incoerrors(ifp, le32toh(sp->tx_underruns)); | 2096 if_inc_counter(ifp, IFCOUNTER_OERRORS, 2097 le32toh(sp->tx_underruns)); |
2095 if (tx_threshold < 192) 2096 tx_threshold += 64; 2097 } 2098 *status = 0; 2099 bus_dmamap_sync(sc->fxp_stag, sc->fxp_smap, 2100 BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); 2101 } 2102} --- 136 unchanged lines hidden (view full) --- 2239 if_t ifp = sc->ifp; 2240 2241 FXP_LOCK_ASSERT(sc, MA_OWNED); 2242 2243 if (sc->watchdog_timer == 0 || --sc->watchdog_timer) 2244 return; 2245 2246 device_printf(sc->dev, "device timeout\n"); | 2098 if (tx_threshold < 192) 2099 tx_threshold += 64; 2100 } 2101 *status = 0; 2102 bus_dmamap_sync(sc->fxp_stag, sc->fxp_smap, 2103 BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); 2104 } 2105} --- 136 unchanged lines hidden (view full) --- 2242 if_t ifp = sc->ifp; 2243 2244 FXP_LOCK_ASSERT(sc, MA_OWNED); 2245 2246 if (sc->watchdog_timer == 0 || --sc->watchdog_timer) 2247 return; 2248 2249 device_printf(sc->dev, "device timeout\n"); |
2247 if_incoerrors(ifp, 1); | 2250 if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); |
2248 2249 if_setdrvflagbits(ifp, 0, IFF_DRV_RUNNING); 2250 fxp_init_body(sc, 1); 2251} 2252 2253/* 2254 * Acquire locks and then call the real initialization function. This 2255 * is necessary because ether_ioctl() calls if_init() and this would --- 1004 unchanged lines hidden --- | 2251 2252 if_setdrvflagbits(ifp, 0, IFF_DRV_RUNNING); 2253 fxp_init_body(sc, 1); 2254} 2255 2256/* 2257 * Acquire locks and then call the real initialization function. This 2258 * is necessary because ether_ioctl() calls if_init() and this would --- 1004 unchanged lines hidden --- |