Changeset View
Changeset View
Standalone View
Standalone View
head/sys/netgraph/bluetooth/drivers/ubt/ng_ubt_var.h
Show First 20 Lines • Show All 68 Lines • ▼ Show 20 Lines | enum { | ||||
UBT_IF_1_ISOC_DT_RD1, | UBT_IF_1_ISOC_DT_RD1, | ||||
UBT_IF_1_ISOC_DT_RD2, | UBT_IF_1_ISOC_DT_RD2, | ||||
UBT_IF_1_ISOC_DT_WR1, | UBT_IF_1_ISOC_DT_WR1, | ||||
UBT_IF_1_ISOC_DT_WR2, | UBT_IF_1_ISOC_DT_WR2, | ||||
UBT_N_TRANSFER, /* total number of transfers */ | UBT_N_TRANSFER, /* total number of transfers */ | ||||
}; | }; | ||||
/* USB control request (HCI command) structure */ | |||||
struct ubt_hci_cmd { | |||||
uint16_t opcode; | |||||
uint8_t length; | |||||
uint8_t data[]; | |||||
} __attribute__ ((packed)); | |||||
#define UBT_HCI_CMD_SIZE(cmd) \ | |||||
((cmd)->length + offsetof(struct ubt_hci_cmd, data)) | |||||
/* USB interrupt transfer HCI event header structure */ | |||||
struct ubt_hci_evhdr { | |||||
uint8_t event; | |||||
uint8_t length; | |||||
} __attribute__ ((packed)); | |||||
/* USB interrupt transfer (generic HCI event) structure */ | |||||
struct ubt_hci_event { | |||||
struct ubt_hci_evhdr header; | |||||
uint8_t data[]; | |||||
} __attribute__ ((packed)); | |||||
/* USB interrupt transfer (HCI command completion event) structure */ | |||||
struct ubt_hci_event_command_compl { | |||||
struct ubt_hci_evhdr header; | |||||
uint8_t numpkt; | |||||
uint16_t opcode; | |||||
uint8_t data[]; | |||||
} __attribute__ ((packed)); | |||||
#define UBT_HCI_EVENT_SIZE(evt) \ | |||||
((evt)->header.length + offsetof(struct ubt_hci_event, data)) | |||||
/* USB device softc structure */ | /* USB device softc structure */ | ||||
struct ubt_softc { | struct ubt_softc { | ||||
device_t sc_dev; /* for debug printf */ | device_t sc_dev; /* for debug printf */ | ||||
/* State */ | /* State */ | ||||
ng_ubt_node_debug_ep sc_debug; /* debug level */ | ng_ubt_node_debug_ep sc_debug; /* debug level */ | ||||
ng_ubt_node_stat_ep sc_stat; /* statistic */ | ng_ubt_node_stat_ep sc_stat; /* statistic */ | ||||
Show All 38 Lines | #define UBT_FLAG_T_START_ALL (1 << 2) /* start all read and isoc | ||||
write xfers */ | write xfers */ | ||||
#define UBT_FLAG_T_START_CTRL (1 << 3) /* start control xfer (write) */ | #define UBT_FLAG_T_START_CTRL (1 << 3) /* start control xfer (write) */ | ||||
#define UBT_FLAG_T_START_BULK (1 << 4) /* start bulk xfer (write) */ | #define UBT_FLAG_T_START_BULK (1 << 4) /* start bulk xfer (write) */ | ||||
struct task sc_task; | struct task sc_task; | ||||
}; | }; | ||||
typedef struct ubt_softc ubt_softc_t; | typedef struct ubt_softc ubt_softc_t; | ||||
typedef struct ubt_softc * ubt_softc_p; | typedef struct ubt_softc * ubt_softc_p; | ||||
usb_error_t ubt_do_hci_request(struct usb_device *, struct ubt_hci_cmd *, | |||||
void *, usb_timeout_t); | |||||
extern devclass_t ubt_devclass; | |||||
extern driver_t ubt_driver; | |||||
#endif /* ndef _NG_UBT_VAR_H_ */ | #endif /* ndef _NG_UBT_VAR_H_ */ | ||||