FreeBSD kernel netgraph code
ng_ubt_var.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  ubt_hci_cmd
 
struct  ubt_hci_evhdr
 
struct  ubt_hci_event
 
struct  ubt_hci_event_command_compl
 
struct  ubt_softc
 

Macros

#define UBT_DEBUG(level, sc, fmt, ...)
 
#define UBT_ALERT(...)   UBT_DEBUG(NG_UBT_ALERT_LEVEL, __VA_ARGS__)
 
#define UBT_ERR(...)   UBT_DEBUG(NG_UBT_ERR_LEVEL, __VA_ARGS__)
 
#define UBT_WARN(...)   UBT_DEBUG(NG_UBT_WARN_LEVEL, __VA_ARGS__)
 
#define UBT_INFO(...)   UBT_DEBUG(NG_UBT_INFO_LEVEL, __VA_ARGS__)
 
#define UBT_NG_LOCK(sc)   mtx_lock(&(sc)->sc_ng_mtx)
 
#define UBT_NG_UNLOCK(sc)   mtx_unlock(&(sc)->sc_ng_mtx)
 
#define UBT_HCI_REQUEST   0x20
 
#define UBT_DEFAULT_QLEN   64
 
#define UBT_ISOC_NFRAMES   32 /* should be factor of 8 */
 
#define UBT_HCI_CMD_SIZE(cmd)    ((cmd)->length + offsetof(struct ubt_hci_cmd, data))
 
#define UBT_HCI_EVENT_SIZE(evt)    ((evt)->header.length + offsetof(struct ubt_hci_event, data))
 
#define UBT_HCI_EVENT_COMPL_HEAD_SIZE
 
#define UBT_STAT_PCKTS_SENT(sc)   (sc)->sc_stat.pckts_sent ++
 
#define UBT_STAT_BYTES_SENT(sc, n)   (sc)->sc_stat.bytes_sent += (n)
 
#define UBT_STAT_PCKTS_RECV(sc)   (sc)->sc_stat.pckts_recv ++
 
#define UBT_STAT_BYTES_RECV(sc, n)   (sc)->sc_stat.bytes_recv += (n)
 
#define UBT_STAT_OERROR(sc)   (sc)->sc_stat.oerrors ++
 
#define UBT_STAT_IERROR(sc)   (sc)->sc_stat.ierrors ++
 
#define UBT_STAT_RESET(sc)   bzero(&(sc)->sc_stat, sizeof((sc)->sc_stat))
 
#define UBT_CTRL_BUFFER_SIZE
 
#define UBT_INTR_BUFFER_SIZE   (MCLBYTES-1) /* reserve 1 byte for ID-tag */
 
#define UBT_BULK_READ_BUFFER_SIZE   (MCLBYTES-1) /* reserve 1 byte for ID-tag */
 
#define UBT_BULK_WRITE_BUFFER_SIZE   (MCLBYTES)
 
#define UBT_FLAG_T_PENDING   (1 << 0) /* task pending */
 
#define UBT_FLAG_T_STOP_ALL   (1 << 1) /* stop all xfers */
 
#define UBT_FLAG_T_START_ALL
 
#define UBT_FLAG_T_START_CTRL   (1 << 3) /* start control xfer (write) */
 
#define UBT_FLAG_T_START_BULK   (1 << 4) /* start bulk xfer (write) */
 

Typedefs

typedef struct ubt_softc ubt_softc_t
 
typedef struct ubt_softcubt_softc_p
 

Enumerations

enum  {
  UBT_IF_0_BULK_DT_WR = 0 , UBT_IF_0_BULK_DT_RD , UBT_IF_0_INTR_DT_RD , UBT_IF_0_CTRL_DT_WR ,
  UBT_IF_1_ISOC_DT_RD1 , UBT_IF_1_ISOC_DT_RD2 , UBT_IF_1_ISOC_DT_WR1 , UBT_IF_1_ISOC_DT_WR2 ,
  UBT_N_TRANSFER
}
 

Functions

struct ubt_hci_cmd __attribute__ ((packed))
 
usb_error_t ubt_do_hci_request (struct usb_device *, struct ubt_hci_cmd *, void *, usb_timeout_t)
 

Variables

uint16_t opcode
 
uint8_t length
 
uint8_t data []
 
uint8_t event
 
struct ubt_hci_evhdr header
 
uint8_t numpkt
 
struct ubt_softc __attribute__
 
devclass_t ubt_devclass
 
driver_t ubt_driver
 

Macro Definition Documentation

◆ UBT_ALERT

#define UBT_ALERT (   ...)    UBT_DEBUG(NG_UBT_ALERT_LEVEL, __VA_ARGS__)

Definition at line 47 of file ng_ubt_var.h.

◆ UBT_BULK_READ_BUFFER_SIZE

#define UBT_BULK_READ_BUFFER_SIZE   (MCLBYTES-1) /* reserve 1 byte for ID-tag */

Definition at line 140 of file ng_ubt_var.h.

◆ UBT_BULK_WRITE_BUFFER_SIZE

#define UBT_BULK_WRITE_BUFFER_SIZE   (MCLBYTES)

Definition at line 141 of file ng_ubt_var.h.

◆ UBT_CTRL_BUFFER_SIZE

#define UBT_CTRL_BUFFER_SIZE
Value:
(sizeof(struct usb_device_request) + \
sizeof(ng_hci_cmd_pkt_t) + NG_HCI_CMD_PKT_SIZE)
#define NG_HCI_CMD_PKT_SIZE
Definition: ng_hci.h:409

Definition at line 134 of file ng_ubt_var.h.

◆ UBT_DEBUG

#define UBT_DEBUG (   level,
  sc,
  fmt,
  ... 
)
Value:
do { \
if ((sc)->sc_debug >= (level)) \
device_printf((sc)->sc_dev, "%s:%d: " fmt, \
__FUNCTION__, __LINE__,## __VA_ARGS__); \
} while (0)

Definition at line 40 of file ng_ubt_var.h.

◆ UBT_DEFAULT_QLEN

#define UBT_DEFAULT_QLEN   64

Definition at line 57 of file ng_ubt_var.h.

◆ UBT_ERR

#define UBT_ERR (   ...)    UBT_DEBUG(NG_UBT_ERR_LEVEL, __VA_ARGS__)

Definition at line 48 of file ng_ubt_var.h.

◆ UBT_FLAG_T_PENDING

#define UBT_FLAG_T_PENDING   (1 << 0) /* task pending */

Definition at line 153 of file ng_ubt_var.h.

◆ UBT_FLAG_T_START_ALL

#define UBT_FLAG_T_START_ALL
Value:
(1 << 2) /* start all read and isoc
write xfers */

Definition at line 155 of file ng_ubt_var.h.

◆ UBT_FLAG_T_START_BULK

#define UBT_FLAG_T_START_BULK   (1 << 4) /* start bulk xfer (write) */

Definition at line 157 of file ng_ubt_var.h.

◆ UBT_FLAG_T_START_CTRL

#define UBT_FLAG_T_START_CTRL   (1 << 3) /* start control xfer (write) */

Definition at line 156 of file ng_ubt_var.h.

◆ UBT_FLAG_T_STOP_ALL

#define UBT_FLAG_T_STOP_ALL   (1 << 1) /* stop all xfers */

Definition at line 154 of file ng_ubt_var.h.

◆ UBT_HCI_CMD_SIZE

#define UBT_HCI_CMD_SIZE (   cmd)     ((cmd)->length + offsetof(struct ubt_hci_cmd, data))

Definition at line 83 of file ng_ubt_var.h.

◆ UBT_HCI_EVENT_COMPL_HEAD_SIZE

#define UBT_HCI_EVENT_COMPL_HEAD_SIZE
Value:
(offsetof(struct ubt_hci_event_command_compl, data) - \
uint8_t data[]
Definition: ng_ubt_var.h:2
uint8_t numpkt
Definition: ng_ubt_var.h:1

Definition at line 105 of file ng_ubt_var.h.

◆ UBT_HCI_EVENT_SIZE

#define UBT_HCI_EVENT_SIZE (   evt)     ((evt)->header.length + offsetof(struct ubt_hci_event, data))

Definition at line 103 of file ng_ubt_var.h.

◆ UBT_HCI_REQUEST

#define UBT_HCI_REQUEST   0x20

Definition at line 56 of file ng_ubt_var.h.

◆ UBT_INFO

#define UBT_INFO (   ...)    UBT_DEBUG(NG_UBT_INFO_LEVEL, __VA_ARGS__)

Definition at line 50 of file ng_ubt_var.h.

◆ UBT_INTR_BUFFER_SIZE

#define UBT_INTR_BUFFER_SIZE   (MCLBYTES-1) /* reserve 1 byte for ID-tag */

Definition at line 136 of file ng_ubt_var.h.

◆ UBT_ISOC_NFRAMES

#define UBT_ISOC_NFRAMES   32 /* should be factor of 8 */

Definition at line 58 of file ng_ubt_var.h.

◆ UBT_NG_LOCK

#define UBT_NG_LOCK (   sc)    mtx_lock(&(sc)->sc_ng_mtx)

Definition at line 52 of file ng_ubt_var.h.

◆ UBT_NG_UNLOCK

#define UBT_NG_UNLOCK (   sc)    mtx_unlock(&(sc)->sc_ng_mtx)

Definition at line 53 of file ng_ubt_var.h.

◆ UBT_STAT_BYTES_RECV

#define UBT_STAT_BYTES_RECV (   sc,
 
)    (sc)->sc_stat.bytes_recv += (n)

Definition at line 121 of file ng_ubt_var.h.

◆ UBT_STAT_BYTES_SENT

#define UBT_STAT_BYTES_SENT (   sc,
 
)    (sc)->sc_stat.bytes_sent += (n)

Definition at line 119 of file ng_ubt_var.h.

◆ UBT_STAT_IERROR

#define UBT_STAT_IERROR (   sc)    (sc)->sc_stat.ierrors ++

Definition at line 123 of file ng_ubt_var.h.

◆ UBT_STAT_OERROR

#define UBT_STAT_OERROR (   sc)    (sc)->sc_stat.oerrors ++

Definition at line 122 of file ng_ubt_var.h.

◆ UBT_STAT_PCKTS_RECV

#define UBT_STAT_PCKTS_RECV (   sc)    (sc)->sc_stat.pckts_recv ++

Definition at line 120 of file ng_ubt_var.h.

◆ UBT_STAT_PCKTS_SENT

#define UBT_STAT_PCKTS_SENT (   sc)    (sc)->sc_stat.pckts_sent ++

Definition at line 118 of file ng_ubt_var.h.

◆ UBT_STAT_RESET

#define UBT_STAT_RESET (   sc)    bzero(&(sc)->sc_stat, sizeof((sc)->sc_stat))

Definition at line 124 of file ng_ubt_var.h.

◆ UBT_WARN

#define UBT_WARN (   ...)    UBT_DEBUG(NG_UBT_WARN_LEVEL, __VA_ARGS__)

Definition at line 49 of file ng_ubt_var.h.

Typedef Documentation

◆ ubt_softc_p

typedef struct ubt_softc* ubt_softc_p

Definition at line 162 of file ng_ubt_var.h.

◆ ubt_softc_t

typedef struct ubt_softc ubt_softc_t

Definition at line 161 of file ng_ubt_var.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
UBT_IF_0_BULK_DT_WR 
UBT_IF_0_BULK_DT_RD 
UBT_IF_0_INTR_DT_RD 
UBT_IF_0_CTRL_DT_WR 
UBT_IF_1_ISOC_DT_RD1 
UBT_IF_1_ISOC_DT_RD2 
UBT_IF_1_ISOC_DT_WR1 
UBT_IF_1_ISOC_DT_WR2 
UBT_N_TRANSFER 

Definition at line 61 of file ng_ubt_var.h.

Function Documentation

◆ __attribute__()

struct ubt_hci_cmd __attribute__ ( (packed)  )

◆ ubt_do_hci_request()

usb_error_t ubt_do_hci_request ( struct usb_device *  udev,
struct ubt_hci_cmd cmd,
void *  evt,
usb_timeout_t  timeout 
)

Definition at line 539 of file ng_ubt.c.

References UBT_HCI_CMD_SIZE, UBT_HCI_REQUEST, UBT_INTR_BUFFER_SIZE, and ubt_probe_intr_callback.

Referenced by ubt_intel_do_hci_request().

Here is the caller graph for this function:

Variable Documentation

◆ __attribute__

◆ data

◆ event

◆ header

◆ length

◆ numpkt

uint8_t numpkt

Definition at line 1 of file ng_ubt_var.h.

◆ opcode

◆ ubt_devclass

devclass_t ubt_devclass
extern

Definition at line 1995 of file ng_ubt.c.

◆ ubt_driver

driver_t ubt_driver
extern

Definition at line 2005 of file ng_ubt.c.