if_fatm.c (257176) | if_fatm.c (271849) |
---|---|
1/*- 2 * Copyright (c) 2001-2003 3 * Fraunhofer Institute for Open Communication Systems (FhG Fokus). 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: --- 16 unchanged lines hidden (view full) --- 25 * SUCH DAMAGE. 26 * 27 * Author: Hartmut Brandt <harti@freebsd.org> 28 * 29 * Fore PCA200E driver for NATM 30 */ 31 32#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2001-2003 3 * Fraunhofer Institute for Open Communication Systems (FhG Fokus). 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: --- 16 unchanged lines hidden (view full) --- 25 * SUCH DAMAGE. 26 * 27 * Author: Hartmut Brandt <harti@freebsd.org> 28 * 29 * Fore PCA200E driver for NATM 30 */ 31 32#include <sys/cdefs.h> |
33__FBSDID("$FreeBSD: head/sys/dev/fatm/if_fatm.c 257176 2013-10-26 17:58:36Z glebius $"); | 33__FBSDID("$FreeBSD: head/sys/dev/fatm/if_fatm.c 271849 2014-09-19 03:51:26Z glebius $"); |
34 35#include "opt_inet.h" 36#include "opt_natm.h" 37 38#include <sys/types.h> 39#include <sys/param.h> 40#include <sys/systm.h> 41#include <sys/malloc.h> --- 1517 unchanged lines hidden (view full) --- 1559 BPF_MTAP(sc->ifp, m0); 1560#endif 1561 1562 ATM_PH_FLAGS(&aph) = vc->param.flags; 1563 ATM_PH_VPI(&aph) = vpi; 1564 ATM_PH_SETVCI(&aph, vci); 1565 1566 ifp = sc->ifp; | 34 35#include "opt_inet.h" 36#include "opt_natm.h" 37 38#include <sys/types.h> 39#include <sys/param.h> 40#include <sys/systm.h> 41#include <sys/malloc.h> --- 1517 unchanged lines hidden (view full) --- 1559 BPF_MTAP(sc->ifp, m0); 1560#endif 1561 1562 ATM_PH_FLAGS(&aph) = vc->param.flags; 1563 ATM_PH_VPI(&aph) = vpi; 1564 ATM_PH_SETVCI(&aph, vci); 1565 1566 ifp = sc->ifp; |
1567 ifp->if_ipackets++; | 1567 if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); |
1568 1569 vc->ipackets++; 1570 vc->ibytes += m0->m_pkthdr.len; 1571 1572 atm_input(ifp, &aph, m0, vc->rxhand); 1573 } 1574 1575 H_SETSTAT(q->q.statp, FATM_STAT_FREE); --- 393 unchanged lines hidden (view full) --- 1969 (vc->param.flags & ATM_PH_LLCSNAP)) 1970 BPF_MTAP(sc->ifp, m); 1971#endif 1972 1973 /* map the mbuf */ 1974 error = bus_dmamap_load_mbuf(sc->tx_tag, q->map, m, 1975 fatm_tpd_load, tpd, BUS_DMA_NOWAIT); 1976 if(error) { | 1568 1569 vc->ipackets++; 1570 vc->ibytes += m0->m_pkthdr.len; 1571 1572 atm_input(ifp, &aph, m0, vc->rxhand); 1573 } 1574 1575 H_SETSTAT(q->q.statp, FATM_STAT_FREE); --- 393 unchanged lines hidden (view full) --- 1969 (vc->param.flags & ATM_PH_LLCSNAP)) 1970 BPF_MTAP(sc->ifp, m); 1971#endif 1972 1973 /* map the mbuf */ 1974 error = bus_dmamap_load_mbuf(sc->tx_tag, q->map, m, 1975 fatm_tpd_load, tpd, BUS_DMA_NOWAIT); 1976 if(error) { |
1977 sc->ifp->if_oerrors++; | 1977 if_inc_counter(sc->ifp, IFCOUNTER_OERRORS, 1); |
1978 if_printf(sc->ifp, "mbuf loaded error=%d\n", error); 1979 m_freem(m); 1980 return (0); 1981 } 1982 nsegs = tpd->spec; 1983 1984 bus_dmamap_sync(sc->tx_tag, q->map, BUS_DMASYNC_PREWRITE); 1985 --- 34 unchanged lines hidden (view full) --- 2020 2021 DBG(sc, XMIT, ("XMIT: mlen=%d spec=0x%x nsegs=%d blocks=%d", 2022 mlen, le32toh(tpd->spec), nsegs, nblks)); 2023 2024 WRITE4(sc, q->q.card + 0, q->q.card_ioblk | nblks); 2025 BARRIER_W(sc); 2026 2027 sc->txcnt++; | 1978 if_printf(sc->ifp, "mbuf loaded error=%d\n", error); 1979 m_freem(m); 1980 return (0); 1981 } 1982 nsegs = tpd->spec; 1983 1984 bus_dmamap_sync(sc->tx_tag, q->map, BUS_DMASYNC_PREWRITE); 1985 --- 34 unchanged lines hidden (view full) --- 2020 2021 DBG(sc, XMIT, ("XMIT: mlen=%d spec=0x%x nsegs=%d blocks=%d", 2022 mlen, le32toh(tpd->spec), nsegs, nblks)); 2023 2024 WRITE4(sc, q->q.card + 0, q->q.card_ioblk | nblks); 2025 BARRIER_W(sc); 2026 2027 sc->txcnt++; |
2028 sc->ifp->if_opackets++; | 2028 if_inc_counter(sc->ifp, IFCOUNTER_OPACKETS, 1); |
2029 vc->obytes += m->m_pkthdr.len; 2030 vc->opackets++; 2031 2032 NEXT_QUEUE_ENTRY(sc->txqueue.head, FATM_TX_QLEN); 2033 2034 return (0); 2035} 2036 --- 1055 unchanged lines hidden --- | 2029 vc->obytes += m->m_pkthdr.len; 2030 vc->opackets++; 2031 2032 NEXT_QUEUE_ENTRY(sc->txqueue.head, FATM_TX_QLEN); 2033 2034 return (0); 2035} 2036 --- 1055 unchanged lines hidden --- |