Deleted Added
full compact
if_vx.c (106937) if_vx.c (109623)
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

--- 13 unchanged lines hidden (view full) ---

22 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
23 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
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 *
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

--- 13 unchanged lines hidden (view full) ---

22 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
23 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
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 * $FreeBSD: head/sys/dev/vx/if_vx.c 106937 2002-11-14 23:54:55Z sam $
30 * $FreeBSD: head/sys/dev/vx/if_vx.c 109623 2003-01-21 08:56:16Z alfred $
31 *
32 */
33
34/*
35 * Created from if_ep.c driver by Fred Gray (fgray@rice.edu) to support
36 * the 3c590 family.
37 */
38

--- 717 unchanged lines hidden (view full) ---

756 struct ifnet *ifp = &sc->arpcom.ac_if;
757 struct mbuf *top, **mp, *m;
758 int len;
759 int sh;
760
761 m = sc->mb[sc->next_mb];
762 sc->mb[sc->next_mb] = 0;
763 if (m == 0) {
31 *
32 */
33
34/*
35 * Created from if_ep.c driver by Fred Gray (fgray@rice.edu) to support
36 * the 3c590 family.
37 */
38

--- 717 unchanged lines hidden (view full) ---

756 struct ifnet *ifp = &sc->arpcom.ac_if;
757 struct mbuf *top, **mp, *m;
758 int len;
759 int sh;
760
761 m = sc->mb[sc->next_mb];
762 sc->mb[sc->next_mb] = 0;
763 if (m == 0) {
764 MGETHDR(m, M_DONTWAIT, MT_DATA);
764 MGETHDR(m, M_NOWAIT, MT_DATA);
765 if (m == 0)
766 return 0;
767 } else {
768 /* If the queue is no longer full, refill. */
769 if (sc->last_mb == sc->next_mb && sc->buffill_pending == 0) {
770 sc->ch = timeout(vxmbuffill, sc, 1);
771 sc->buffill_pending = 1;
772 }

--- 22 unchanged lines hidden (view full) ---

795 * The while loop will be performed iff we have a packet with
796 * MLEN < m_len < MINCLSIZE.
797 */
798 while (totlen > 0) {
799 if (top) {
800 m = sc->mb[sc->next_mb];
801 sc->mb[sc->next_mb] = 0;
802 if (m == 0) {
765 if (m == 0)
766 return 0;
767 } else {
768 /* If the queue is no longer full, refill. */
769 if (sc->last_mb == sc->next_mb && sc->buffill_pending == 0) {
770 sc->ch = timeout(vxmbuffill, sc, 1);
771 sc->buffill_pending = 1;
772 }

--- 22 unchanged lines hidden (view full) ---

795 * The while loop will be performed iff we have a packet with
796 * MLEN < m_len < MINCLSIZE.
797 */
798 while (totlen > 0) {
799 if (top) {
800 m = sc->mb[sc->next_mb];
801 sc->mb[sc->next_mb] = 0;
802 if (m == 0) {
803 MGET(m, M_DONTWAIT, MT_DATA);
803 MGET(m, M_NOWAIT, MT_DATA);
804 if (m == 0) {
805 splx(sh);
806 m_freem(top);
807 return 0;
808 }
809 } else {
810 sc->next_mb = (sc->next_mb + 1) % MAX_MBS;
811 }
812 len = MLEN;
813 }
814 if (totlen >= MINCLSIZE) {
804 if (m == 0) {
805 splx(sh);
806 m_freem(top);
807 return 0;
808 }
809 } else {
810 sc->next_mb = (sc->next_mb + 1) % MAX_MBS;
811 }
812 len = MLEN;
813 }
814 if (totlen >= MINCLSIZE) {
815 MCLGET(m, M_DONTWAIT);
815 MCLGET(m, M_NOWAIT);
816 if (m->m_flags & M_EXT)
817 len = MCLBYTES;
818 }
819 len = min(totlen, len);
820 if (len > 3)
821 bus_space_read_multi_4(sc->vx_btag, sc->vx_bhandle,
822 VX_W1_RX_PIO_RD_1, mtod(m, u_int32_t *), len / 4);
823 if (len & 3) {

--- 164 unchanged lines hidden (view full) ---

988{
989 struct vx_softc *sc = (struct vx_softc *) sp;
990 int s, i;
991
992 s = splimp();
993 i = sc->last_mb;
994 do {
995 if (sc->mb[i] == NULL)
816 if (m->m_flags & M_EXT)
817 len = MCLBYTES;
818 }
819 len = min(totlen, len);
820 if (len > 3)
821 bus_space_read_multi_4(sc->vx_btag, sc->vx_bhandle,
822 VX_W1_RX_PIO_RD_1, mtod(m, u_int32_t *), len / 4);
823 if (len & 3) {

--- 164 unchanged lines hidden (view full) ---

988{
989 struct vx_softc *sc = (struct vx_softc *) sp;
990 int s, i;
991
992 s = splimp();
993 i = sc->last_mb;
994 do {
995 if (sc->mb[i] == NULL)
996 MGET(sc->mb[i], M_DONTWAIT, MT_DATA);
996 MGET(sc->mb[i], M_NOWAIT, MT_DATA);
997 if (sc->mb[i] == NULL)
998 break;
999 i = (i + 1) % MAX_MBS;
1000 } while (i != sc->next_mb);
1001 sc->last_mb = i;
1002 /* If the queue was not filled, try again. */
1003 if (sc->last_mb != sc->next_mb) {
1004 sc->ch = timeout(vxmbuffill, sc, 1);

--- 25 unchanged lines hidden ---
997 if (sc->mb[i] == NULL)
998 break;
999 i = (i + 1) % MAX_MBS;
1000 } while (i != sc->next_mb);
1001 sc->last_mb = i;
1002 /* If the queue was not filled, try again. */
1003 if (sc->last_mb != sc->next_mb) {
1004 sc->ch = timeout(vxmbuffill, sc, 1);

--- 25 unchanged lines hidden ---