if_ep.c (190907) | if_ep.c (190908) |
---|---|
1/*- 2 * Copyright (c) 1994 Herb Peyerl <hpeyerl@novatel.ca> 3 * 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 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 */ 30 31#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1994 Herb Peyerl <hpeyerl@novatel.ca> 3 * 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 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 */ 30 31#include <sys/cdefs.h> |
32__FBSDID("$FreeBSD: head/sys/dev/ep/if_ep.c 190907 2009-04-11 02:47:03Z imp $"); | 32__FBSDID("$FreeBSD: head/sys/dev/ep/if_ep.c 190908 2009-04-11 04:30:38Z imp $"); |
33 34/* 35 * Modified from the FreeBSD 1.1.5.1 version by: 36 * Andres Vega Garcia 37 * INRIA - Sophia Antipolis, France 38 * avega@sophia.inria.fr 39 */ 40 --- 389 unchanged lines hidden (view full) --- 430 FIL_MULTICAST | FIL_BRDCST | FIL_PROMISC); 431 else 432 CSR_WRITE_2(sc, EP_COMMAND, SET_RX_FILTER | FIL_INDIVIDUAL | 433 FIL_MULTICAST | FIL_BRDCST); 434 435 if (!sc->epb.mii_trans) 436 ep_ifmedia_upd(ifp); 437 | 33 34/* 35 * Modified from the FreeBSD 1.1.5.1 version by: 36 * Andres Vega Garcia 37 * INRIA - Sophia Antipolis, France 38 * avega@sophia.inria.fr 39 */ 40 --- 389 unchanged lines hidden (view full) --- 430 FIL_MULTICAST | FIL_BRDCST | FIL_PROMISC); 431 else 432 CSR_WRITE_2(sc, EP_COMMAND, SET_RX_FILTER | FIL_INDIVIDUAL | 433 FIL_MULTICAST | FIL_BRDCST); 434 435 if (!sc->epb.mii_trans) 436 ep_ifmedia_upd(ifp); 437 |
438 CSR_WRITE_2(sc, EP_COMMAND, TX_PLL_ENABLE); | 438 if (sc->stat & F_HAS_TX_PLL) 439 CSR_WRITE_2(sc, EP_COMMAND, TX_PLL_ENABLE); |
439 CSR_WRITE_2(sc, EP_COMMAND, RX_ENABLE); 440 CSR_WRITE_2(sc, EP_COMMAND, TX_ENABLE); 441 442 ifp->if_drv_flags |= IFF_DRV_RUNNING; 443 ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; /* just in case */ 444 445#ifdef EP_LOCAL_STATS 446 sc->rx_no_first = sc->rx_no_mbuf = --- 22 unchanged lines hidden (view full) --- 469} 470 471static void 472epstart_locked(struct ifnet *ifp) 473{ 474 struct ep_softc *sc; 475 u_int len; 476 struct mbuf *m, *m0; | 440 CSR_WRITE_2(sc, EP_COMMAND, RX_ENABLE); 441 CSR_WRITE_2(sc, EP_COMMAND, TX_ENABLE); 442 443 ifp->if_drv_flags |= IFF_DRV_RUNNING; 444 ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; /* just in case */ 445 446#ifdef EP_LOCAL_STATS 447 sc->rx_no_first = sc->rx_no_mbuf = --- 22 unchanged lines hidden (view full) --- 470} 471 472static void 473epstart_locked(struct ifnet *ifp) 474{ 475 struct ep_softc *sc; 476 u_int len; 477 struct mbuf *m, *m0; |
477 int pad; | 478 int pad, started; |
478 479 sc = ifp->if_softc; 480 if (sc->gone) 481 return; 482 EP_ASSERT_LOCKED(sc); 483 EP_BUSY_WAIT(sc); 484 if (ifp->if_drv_flags & IFF_DRV_OACTIVE) 485 return; | 479 480 sc = ifp->if_softc; 481 if (sc->gone) 482 return; 483 EP_ASSERT_LOCKED(sc); 484 EP_BUSY_WAIT(sc); 485 if (ifp->if_drv_flags & IFF_DRV_OACTIVE) 486 return; |
487 started = 0; |
|
486startagain: 487 /* Sneak a peek at the next packet */ 488 IFQ_DRV_DEQUEUE(&ifp->if_snd, m0); 489 if (m0 == NULL) 490 return; | 488startagain: 489 /* Sneak a peek at the next packet */ 490 IFQ_DRV_DEQUEUE(&ifp->if_snd, m0); 491 if (m0 == NULL) 492 return; |
493 if (!started && (sc->stat & F_HAS_TX_PLL)) 494 CSR_WRITE_2(sc, EP_COMMAND, TX_PLL_ENABLE); 495 started++; |
|
491 for (len = 0, m = m0; m != NULL; m = m->m_next) 492 len += m->m_len; 493 494 pad = (4 - len) & 3; 495 496 /* 497 * The 3c509 automatically pads short packets to minimum 498 * ethernet length, but we drop packets that are too large. --- 497 unchanged lines hidden --- | 496 for (len = 0, m = m0; m != NULL; m = m->m_next) 497 len += m->m_len; 498 499 pad = (4 - len) & 3; 500 501 /* 502 * The 3c509 automatically pads short packets to minimum 503 * ethernet length, but we drop packets that are too large. --- 497 unchanged lines hidden --- |