if_var.h (189851) | if_var.h (191033) |
---|---|
1/*- 2 * Copyright (c) 1982, 1986, 1989, 1993 3 * The Regents of the University of California. 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 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * 29 * From: @(#)if.h 8.1 (Berkeley) 6/10/93 | 1/*- 2 * Copyright (c) 1982, 1986, 1989, 1993 3 * The Regents of the University of California. 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 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * 29 * From: @(#)if.h 8.1 (Berkeley) 6/10/93 |
30 * $FreeBSD: head/sys/net/if_var.h 189851 2009-03-15 14:21:05Z rwatson $ | 30 * $FreeBSD: head/sys/net/if_var.h 191033 2009-04-14 00:27:59Z kmacy $ |
31 */ 32 33#ifndef _NET_IF_VAR_H_ 34#define _NET_IF_VAR_H_ 35 36/* 37 * Structures defining a network interface, providing a packet 38 * transport mechanism (ala level 0 of the PUP protocols). --- 516 unchanged lines hidden (view full) --- 555 556static __inline int 557drbr_enqueue(struct ifnet *ifp, struct buf_ring *br, struct mbuf *m) 558{ 559 int error = 0; 560 int len = m->m_pkthdr.len; 561 int mflags = m->m_flags; 562 | 31 */ 32 33#ifndef _NET_IF_VAR_H_ 34#define _NET_IF_VAR_H_ 35 36/* 37 * Structures defining a network interface, providing a packet 38 * transport mechanism (ala level 0 of the PUP protocols). --- 516 unchanged lines hidden (view full) --- 555 556static __inline int 557drbr_enqueue(struct ifnet *ifp, struct buf_ring *br, struct mbuf *m) 558{ 559 int error = 0; 560 int len = m->m_pkthdr.len; 561 int mflags = m->m_flags; 562 |
563#ifdef ALTQ 564 if (ALTQ_IS_ENABLED(&ifp->if_snd)) { 565 IFQ_ENQUEUE(&ifp->if_snd, m, error); 566 return (error); 567 } 568#endif |
|
563 if ((error = buf_ring_enqueue(br, m)) == ENOBUFS) { 564 br->br_drops++; 565 _IF_DROP(&ifp->if_snd); 566 m_freem(m); 567 } else 568 drbr_stats_update(ifp, len, mflags); 569 570 return (error); --- 4 unchanged lines hidden (view full) --- 575{ 576 struct mbuf *m; 577 578 while ((m = buf_ring_dequeue_sc(br)) != NULL) 579 m_freem(m); 580 581 buf_ring_free(br, type); 582} | 569 if ((error = buf_ring_enqueue(br, m)) == ENOBUFS) { 570 br->br_drops++; 571 _IF_DROP(&ifp->if_snd); 572 m_freem(m); 573 } else 574 drbr_stats_update(ifp, len, mflags); 575 576 return (error); --- 4 unchanged lines hidden (view full) --- 581{ 582 struct mbuf *m; 583 584 while ((m = buf_ring_dequeue_sc(br)) != NULL) 585 m_freem(m); 586 587 buf_ring_free(br, type); 588} |
589 590static __inline struct mbuf * 591drbr_dequeue(struct ifnet *ifp, struct buf_ring *br) 592{ 593#ifdef ALTQ 594 struct mbuf *m; 595 596 if (ALTQ_IS_ENABLED(&ifp->if_snd)) { 597 IFQ_DRV_DEQUEUE(&ifp->if_snd, m); 598 return (m); 599 } |
|
583#endif | 600#endif |
601 return (buf_ring_dequeue_sc(br)); 602} |
|
584 | 603 |
604static __inline int 605drbr_empty(struct ifnet *ifp, struct buf_ring *br) 606{ 607#ifdef ALTQ 608 if (ALTQ_IS_ENABLED(&ifp->if_snd)) 609 return (IFQ_DRV_IS_EMPTY(&ifp->if_snd)); 610#endif 611 return (buf_ring_empty(br)); 612} 613#endif |
|
585/* 586 * 72 was chosen below because it is the size of a TCP/IP 587 * header (40) + the minimum mss (32). 588 */ 589#define IF_MINMTU 72 590#define IF_MAXMTU 65535 591 592#endif /* _KERNEL */ --- 177 unchanged lines hidden --- | 614/* 615 * 72 was chosen below because it is the size of a TCP/IP 616 * header (40) + the minimum mss (32). 617 */ 618#define IF_MINMTU 72 619#define IF_MAXMTU 65535 620 621#endif /* _KERNEL */ --- 177 unchanged lines hidden --- |