FreeBSD kernel usb device Code
usb_mbuf.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  usb_mbuf
 

Macros

#define USB_IF_ENQUEUE(ifq, m)
 
#define USB_IF_DEQUEUE(ifq, m)
 
#define USB_IF_PREPEND(ifq, m)
 
#define USB_IF_QFULL(ifq)   ((ifq)->ifq_len >= (ifq)->ifq_maxlen)
 
#define USB_IF_QLEN(ifq)   ((ifq)->ifq_len)
 
#define USB_IF_POLL(ifq, m)   ((m) = (ifq)->ifq_head)
 
#define USB_MBUF_RESET(m)
 

Functions

void * usb_alloc_mbufs (struct malloc_type *type, struct usb_ifqueue *ifq, usb_size_t block_size, uint16_t nblocks)
 

Macro Definition Documentation

◆ USB_IF_DEQUEUE

#define USB_IF_DEQUEUE (   ifq,
 
)
Value:
do { \
(m) = (ifq)->ifq_head; \
if (m) { \
if (((ifq)->ifq_head = (m)->usb_nextpkt) == NULL) { \
(ifq)->ifq_tail = NULL; \
} \
(m)->usb_nextpkt = NULL; \
(ifq)->ifq_len--; \
} \
} while (0)

Definition at line 58 of file usb_mbuf.h.

◆ USB_IF_ENQUEUE

#define USB_IF_ENQUEUE (   ifq,
 
)
Value:
do { \
(m)->usb_nextpkt = NULL; \
if ((ifq)->ifq_tail == NULL) \
(ifq)->ifq_head = (m); \
else \
(ifq)->ifq_tail->usb_nextpkt = (m); \
(ifq)->ifq_tail = (m); \
(ifq)->ifq_len++; \
} while (0)

Definition at line 48 of file usb_mbuf.h.

◆ USB_IF_POLL

#define USB_IF_POLL (   ifq,
 
)    ((m) = (ifq)->ifq_head)

Definition at line 80 of file usb_mbuf.h.

◆ USB_IF_PREPEND

#define USB_IF_PREPEND (   ifq,
 
)
Value:
do { \
(m)->usb_nextpkt = (ifq)->ifq_head; \
if ((ifq)->ifq_tail == NULL) { \
(ifq)->ifq_tail = (m); \
} \
(ifq)->ifq_head = (m); \
(ifq)->ifq_len++; \
} while (0)

Definition at line 69 of file usb_mbuf.h.

◆ USB_IF_QFULL

#define USB_IF_QFULL (   ifq)    ((ifq)->ifq_len >= (ifq)->ifq_maxlen)

Definition at line 78 of file usb_mbuf.h.

◆ USB_IF_QLEN

#define USB_IF_QLEN (   ifq)    ((ifq)->ifq_len)

Definition at line 79 of file usb_mbuf.h.

◆ USB_MBUF_RESET

#define USB_MBUF_RESET (   m)
Value:
do { \
(m)->cur_data_ptr = (m)->min_data_ptr; \
(m)->cur_data_len = (m)->max_data_len; \
(m)->last_packet = 0; \
} while (0)

Definition at line 82 of file usb_mbuf.h.

Function Documentation

◆ usb_alloc_mbufs()

void * usb_alloc_mbufs ( struct malloc_type *  type,
struct usb_ifqueue ifq,
usb_size_t  block_size,
uint16_t  nblocks 
)