97#include <sys/stdint.h>
98#include <sys/stddef.h>
100#include <sys/queue.h>
101#include <sys/types.h>
102#include <sys/systm.h>
103#include <sys/kernel.h>
105#include <sys/module.h>
107#include <sys/mutex.h>
108#include <sys/condvar.h>
109#include <sys/sysctl.h>
111#include <sys/unistd.h>
112#include <sys/callout.h>
113#include <sys/malloc.h>
117#include <dev/usb/usb.h>
118#include <dev/usb/usbdi.h>
119#include <dev/usb/usbdi_util.h>
121#define USB_DEBUG_VAR usb_debug
122#include <dev/usb/usb_debug.h>
123#include <dev/usb/usb_busdma.h>
126#include <sys/taskqueue.h>
144#define ubt_xfer_start(sc, i) usbd_transfer_start((sc)->sc_xfer[(i)])
157SYSCTL_INT(_net_bluetooth, OID_AUTO, usb_isoc_enable, CTLFLAG_RWTUN | CTLFLAG_MPSAFE,
295 .endpoint = UE_ADDR_ANY,
296 .direction = UE_DIR_OUT,
299 .flags = { .pipe_bof = 1, .force_short_xfer = 1, },
305 .endpoint = UE_ADDR_ANY,
306 .direction = UE_DIR_IN,
309 .flags = { .pipe_bof = 1, .short_xfer_ok = 1, },
314 .type = UE_INTERRUPT,
315 .endpoint = UE_ADDR_ANY,
316 .direction = UE_DIR_IN,
318 .flags = { .pipe_bof = 1, .short_xfer_ok = 1, },
326 .direction = UE_DIR_ANY,
339 .type = UE_ISOCHRONOUS,
340 .endpoint = UE_ADDR_ANY,
341 .direction = UE_DIR_IN,
345 .flags = { .short_xfer_ok = 1, },
350 .type = UE_ISOCHRONOUS,
351 .endpoint = UE_ADDR_ANY,
352 .direction = UE_DIR_IN,
356 .flags = { .short_xfer_ok = 1, },
361 .type = UE_ISOCHRONOUS,
362 .endpoint = UE_ADDR_ANY,
363 .direction = UE_DIR_OUT,
367 .flags = { .short_xfer_ok = 1, },
372 .type = UE_ISOCHRONOUS,
373 .endpoint = UE_ADDR_ANY,
374 .direction = UE_DIR_OUT,
378 .flags = { .short_xfer_ok = 1, },
396 { USB_VPI(USB_VENDOR_AVM, 0x2200, 0) },
399 { USB_VPI(0x0cf3, 0x3002, 0) },
400 { USB_VPI(0x0cf3, 0xe019, 0) },
401 { USB_VPI(0x13d3, 0x3304, 0) },
402 { USB_VPI(0x0930, 0x0215, 0) },
403 { USB_VPI(0x0489, 0xe03d, 0) },
404 { USB_VPI(0x0489, 0xe027, 0) },
407 { USB_VPI(0x03f0, 0x311d, 0) },
410 { USB_VPI(0x0cf3, 0x3004, 0), USB_DEV_BCD_LTEQ(1) },
411 { USB_VPI(0x0cf3, 0x311d, 0), USB_DEV_BCD_LTEQ(1) },
412 { USB_VPI(0x13d3, 0x3375, 0), USB_DEV_BCD_LTEQ(1) },
413 { USB_VPI(0x04ca, 0x3005, 0), USB_DEV_BCD_LTEQ(1) },
414 { USB_VPI(0x04ca, 0x3006, 0), USB_DEV_BCD_LTEQ(1) },
415 { USB_VPI(0x04ca, 0x3008, 0), USB_DEV_BCD_LTEQ(1) },
416 { USB_VPI(0x13d3, 0x3362, 0), USB_DEV_BCD_LTEQ(1) },
417 { USB_VPI(0x0cf3, 0xe004, 0), USB_DEV_BCD_LTEQ(1) },
418 { USB_VPI(0x0930, 0x0219, 0), USB_DEV_BCD_LTEQ(1) },
419 { USB_VPI(0x0489, 0xe057, 0), USB_DEV_BCD_LTEQ(1) },
420 { USB_VPI(0x13d3, 0x3393, 0), USB_DEV_BCD_LTEQ(1) },
421 { USB_VPI(0x0489, 0xe04e, 0), USB_DEV_BCD_LTEQ(1) },
422 { USB_VPI(0x0489, 0xe056, 0), USB_DEV_BCD_LTEQ(1) },
425 { USB_VPI(0x0489, 0xe02c, 0), USB_DEV_BCD_LTEQ(1) },
428 { USB_VPI(0x0489, 0xe03c, 0), USB_DEV_BCD_LTEQ(1) },
429 { USB_VPI(0x0489, 0xe036, 0), USB_DEV_BCD_LTEQ(1) },
432 { USB_VPI(USB_VENDOR_INTEL2, 0x07dc, 0) },
433 { USB_VPI(USB_VENDOR_INTEL2, 0x0a2a, 0) },
434 { USB_VPI(USB_VENDOR_INTEL2, 0x0aa7, 0) },
435 { USB_VPI(USB_VENDOR_INTEL2, 0x0a2b, 0) },
436 { USB_VPI(USB_VENDOR_INTEL2, 0x0aaa, 0) },
437 { USB_VPI(USB_VENDOR_INTEL2, 0x0025, 0) },
438 { USB_VPI(USB_VENDOR_INTEL2, 0x0026, 0) },
439 { USB_VPI(USB_VENDOR_INTEL2, 0x0029, 0) },
445 { USB_VPI(USB_VENDOR_INTEL2, 0x0032, 0) },
446 { USB_VPI(USB_VENDOR_INTEL2, 0x0033, 0) },
453 { USB_IFACE_CLASS(UDCLASS_WIRELESS),
454 USB_IFACE_SUBCLASS(UDSUBCLASS_RF),
455 USB_IFACE_PROTOCOL(UDPROTO_BLUETOOTH) },
458 { USB_VPI(USB_VENDOR_AVM, 0x3800, 0) },
461 { USB_VENDOR(USB_VENDOR_BROADCOM),
462 USB_IFACE_CLASS(UICLASS_VENDOR),
463 USB_IFACE_SUBCLASS(UDSUBCLASS_RF),
464 USB_IFACE_PROTOCOL(UDPROTO_BLUETOOTH) },
467 { USB_VENDOR(USB_VENDOR_APPLE),
468 USB_IFACE_CLASS(UICLASS_VENDOR),
469 USB_IFACE_SUBCLASS(UDSUBCLASS_RF),
470 USB_IFACE_PROTOCOL(UDPROTO_BLUETOOTH) },
473 { USB_VENDOR(USB_VENDOR_FOXCONN),
474 USB_IFACE_CLASS(UICLASS_VENDOR),
475 USB_IFACE_SUBCLASS(UDSUBCLASS_RF),
476 USB_IFACE_PROTOCOL(UDPROTO_BLUETOOTH) },
479 { USB_VPI(USB_VENDOR_MEDIATEK, 0x763f, 0) },
482 { USB_VPI(USB_VENDOR_BROADCOM, 0x21e1, 0) },
485 { USB_VPI(USB_VENDOR_APPLE, 0x8213, 0) },
488 { USB_VPI(USB_VENDOR_APPLE, 0x8215, 0) },
491 { USB_VPI(USB_VENDOR_APPLE, 0x8218, 0) },
494 { USB_VPI(USB_VENDOR_APPLE, 0x821b, 0) },
497 { USB_VPI(USB_VENDOR_APPLE, 0x821f, 0) },
500 { USB_VPI(USB_VENDOR_APPLE, 0x828f, 0) },
503 { USB_VPI(USB_VENDOR_APPLE, 0x821a, 0) },
506 { USB_VPI(USB_VENDOR_APPLE, 0x8281, 0) },
509 { USB_VPI(USB_VENDOR_TDK, 0x030a, 0) },
512 { USB_VPI(USB_VENDOR_ALPS, 0x3001, 0) },
513 { USB_VPI(USB_VENDOR_ALPS, 0x3002, 0) },
515 { USB_VPI(USB_VENDOR_ERICSSON2, 0x1002, 0) },
518 { USB_VPI(USB_VENDOR_CANYON, 0x0000, 0) },
521 { USB_VPI(USB_VENDOR_ASUS, 0x17b5, 0) },
522 { USB_VPI(USB_VENDOR_ASUS, 0x17cb, 0) },
523 { USB_VPI(USB_VENDOR_LITEON, 0x2003, 0) },
524 { USB_VPI(USB_VENDOR_FOXCONN, 0xe042, 0) },
525 { USB_VPI(USB_VENDOR_DELL, 0x8197, 0) },
526 { USB_VPI(USB_VENDOR_BELKIN, 0x065a, 0) },
540 void *evt, usb_timeout_t timeout)
542 static const struct usb_config ubt_probe_config = {
543 .type = UE_INTERRUPT,
544 .endpoint = UE_ADDR_ANY,
545 .direction = UE_DIR_IN,
546 .flags = { .pipe_bof = 1, .short_xfer_ok = 1 },
550 struct usb_device_request req;
551 struct usb_xfer *xfer[1];
553 usb_error_t error = USB_ERR_NORMAL_COMPLETION;
554 uint8_t iface_index = 0;
557 bzero(&req,
sizeof(req));
559 req.wIndex[0] = iface_index;
562 error = usbd_do_request(udev, NULL, &req,
cmd);
563 if (error != USB_ERR_NORMAL_COMPLETION) {
564 printf(
"ng_ubt: usbd_do_request error=%s\n",
570 return (USB_ERR_NORMAL_COMPLETION);
573 mtx_init(&mtx,
"ubt pb", NULL, MTX_DEF | MTX_NEW);
575 error = usbd_transfer_setup(udev, &iface_index, xfer,
576 &ubt_probe_config, 1, evt, &mtx);
577 if (error == USB_ERR_NORMAL_COMPLETION) {
579 usbd_transfer_start(*xfer);
581 if (msleep_sbt(evt, &mtx, 0,
"ubt pb", SBT_1MS * timeout,
582 0, C_HARDCLOCK) == EWOULDBLOCK) {
583 printf(
"ng_ubt: HCI command 0x%04x timed out\n",
584 le16toh(
cmd->opcode));
585 error = USB_ERR_TIMEOUT;
588 usbd_transfer_stop(*xfer);
591 usbd_transfer_unsetup(xfer, 1);
593 printf(
"ng_ubt: usbd_transfer_setup error=%s\n",
609 struct usb_attach_arg *uaa = device_get_ivars(dev);
612 if (uaa->usb_mode != USB_MODE_HOST)
615 if (uaa->info.bIfaceIndex != 0)
624 return (BUS_PROBE_GENERIC);
636 struct usb_attach_arg *uaa = device_get_ivars(dev);
637 struct ubt_softc *sc = device_get_softc(dev);
638 struct usb_endpoint_descriptor *ed;
639 struct usb_interface_descriptor *
id;
640 struct usb_interface *iface;
641 uint32_t wMaxPacketSize;
642 uint8_t alt_index, i, j;
643 uint8_t iface_index[2] = { 0, 1 };
645 device_set_usb_desc(dev);
655 UBT_ALERT(sc,
"could not create Netgraph node\n");
661 UBT_ALERT(sc,
"could not name Netgraph node\n");
673 mtx_init(&sc->
sc_ng_mtx,
"ubt ng", NULL, MTX_DEF);
674 mtx_init(&sc->
sc_if_mtx,
"ubt if", NULL, MTX_DEF | MTX_RECURSE);
717 while ((ed = (
struct usb_endpoint_descriptor *)usb_desc_foreach(
718 usbd_get_config_descriptor(uaa->device),
719 (
struct usb_descriptor *)ed))) {
720 if ((ed->bDescriptorType == UDESC_INTERFACE) &&
721 (ed->bLength >=
sizeof(*
id))) {
722 id = (
struct usb_interface_descriptor *)ed;
723 i =
id->bInterfaceNumber;
724 j =
id->bAlternateSetting;
727 if ((ed->bDescriptorType == UDESC_ENDPOINT) &&
728 (ed->bLength >=
sizeof(*ed)) &&
732 temp = usbd_get_max_frame_length(
733 ed, NULL, usbd_get_speed(uaa->device));
734 if (temp > wMaxPacketSize) {
735 wMaxPacketSize = temp;
742 if (wMaxPacketSize > 0 &&
743 usbd_set_alt_interface_index(uaa->device, 1, alt_index)) {
744 UBT_ALERT(sc,
"could not set alternate setting %d " \
745 "for interface 1!\n", alt_index);
753 UBT_ALERT(sc,
"could not allocate transfers\n");
759 iface = usbd_get_iface(uaa->device, i);
762 id = usbd_get_interface_descriptor(iface);
765 (
id->bInterfaceClass == UICLASS_WIRELESS) &&
766 (
id->bInterfaceSubClass == UISUBCLASS_RF) &&
767 (
id->bInterfaceProtocol == UIPROTO_BLUETOOTH)) {
768 usbd_set_parent_iface(uaa->device, i,
769 uaa->info.bIfaceIndex);
788 struct ubt_softc *sc = device_get_softc(dev);
799 taskqueue_drain(taskqueue_swi, &sc->
sc_task);
827 struct usb_page_cache *pc;
830 usbd_xfer_status(xfer, &actlen, NULL, NULL, NULL);
832 switch (USB_GET_STATE(xfer)) {
833 case USB_ST_TRANSFERRED:
836 pc = usbd_xfer_get_frame(xfer, 0);
837 usbd_copy_out(pc, 0, evt, actlen);
844 usbd_xfer_set_frame_len(xfer, 0, usbd_xfer_max_len(xfer));
845 usbd_transfer_submit(xfer);
849 if (error != USB_ERR_CANCELLED) {
850 printf(
"ng_ubt: interrupt transfer failed: %s\n",
853 usbd_xfer_set_stall(xfer);
869 struct ubt_softc *sc = usbd_xfer_softc(xfer);
870 struct usb_device_request req;
872 struct usb_page_cache *pc;
875 usbd_xfer_status(xfer, &actlen, NULL, NULL, NULL);
877 switch (USB_GET_STATE(xfer)) {
878 case USB_ST_TRANSFERRED:
879 UBT_INFO(sc,
"sent %d bytes to control pipe\n", actlen);
892 UBT_INFO(sc,
"HCI command queue is empty\n");
897 bzero(&req,
sizeof(req));
899 USETW(req.wLength, m->m_pkthdr.len);
901 UBT_INFO(sc,
"Sending control request, " \
902 "bmRequestType=0x%02x, wLength=%d\n",
903 req.bmRequestType, UGETW(req.wLength));
905 pc = usbd_xfer_get_frame(xfer, 0);
906 usbd_copy_in(pc, 0, &req,
sizeof(req));
907 pc = usbd_xfer_get_frame(xfer, 1);
908 usbd_m_copy_in(pc, 0, m, 0, m->m_pkthdr.len);
910 usbd_xfer_set_frame_len(xfer, 0,
sizeof(req));
911 usbd_xfer_set_frame_len(xfer, 1, m->m_pkthdr.len);
912 usbd_xfer_set_frames(xfer, 2);
916 usbd_transfer_submit(xfer);
920 if (error != USB_ERR_CANCELLED) {
921 UBT_WARN(sc,
"control transfer failed: %s\n",
942 struct ubt_softc *sc = usbd_xfer_softc(xfer);
944 ng_hci_event_pkt_t *hdr;
945 struct usb_page_cache *pc;
948 usbd_xfer_status(xfer, &actlen, NULL, NULL, NULL);
952 switch (USB_GET_STATE(xfer)) {
953 case USB_ST_TRANSFERRED:
955 MGETHDR(m, M_NOWAIT, MT_DATA);
961 if (!(MCLGET(m, M_NOWAIT))) {
968 m->m_pkthdr.len = m->m_len = 1;
970 if (actlen > MCLBYTES - 1)
971 actlen = MCLBYTES - 1;
973 pc = usbd_xfer_get_frame(xfer, 0);
974 usbd_copy_out(pc, 0, mtod(m, uint8_t *) + 1, actlen);
975 m->m_pkthdr.len += actlen;
978 UBT_INFO(sc,
"got %d bytes from interrupt pipe\n",
982 if (m->m_pkthdr.len < (
int)
sizeof(*hdr)) {
983 UBT_INFO(sc,
"HCI event packet is too short\n");
989 hdr = mtod(m, ng_hci_event_pkt_t *);
990 if (hdr->length != (m->m_pkthdr.len -
sizeof(*hdr))) {
991 UBT_ERR(sc,
"Invalid HCI event packet size, " \
992 "length=%d, pktlen=%d\n",
993 hdr->length, m->m_pkthdr.len);
999 UBT_INFO(sc,
"got complete HCI event frame, pktlen=%d, " \
1000 "length=%d\n", m->m_pkthdr.len, hdr->length);
1013 usbd_xfer_set_frame_len(xfer, 0, usbd_xfer_max_len(xfer));
1014 usbd_transfer_submit(xfer);
1018 if (error != USB_ERR_CANCELLED) {
1019 UBT_WARN(sc,
"interrupt transfer failed: %s\n",
1020 usbd_errstr(error));
1023 usbd_xfer_set_stall(xfer);
1040 struct ubt_softc *sc = usbd_xfer_softc(xfer);
1042 ng_hci_acldata_pkt_t *hdr;
1043 struct usb_page_cache *pc;
1047 usbd_xfer_status(xfer, &actlen, NULL, NULL, NULL);
1051 switch (USB_GET_STATE(xfer)) {
1052 case USB_ST_TRANSFERRED:
1054 MGETHDR(m, M_NOWAIT, MT_DATA);
1060 if (!(MCLGET(m, M_NOWAIT))) {
1067 m->m_pkthdr.len = m->m_len = 1;
1069 if (actlen > MCLBYTES - 1)
1070 actlen = MCLBYTES - 1;
1072 pc = usbd_xfer_get_frame(xfer, 0);
1073 usbd_copy_out(pc, 0, mtod(m, uint8_t *) + 1, actlen);
1074 m->m_pkthdr.len += actlen;
1077 UBT_INFO(sc,
"got %d bytes from bulk-in pipe\n",
1081 if (m->m_pkthdr.len < (
int)
sizeof(*hdr)) {
1082 UBT_INFO(sc,
"HCI ACL packet is too short\n");
1088 hdr = mtod(m, ng_hci_acldata_pkt_t *);
1089 len = le16toh(hdr->length);
1090 if (len != (
int)(m->m_pkthdr.len -
sizeof(*hdr))) {
1091 UBT_ERR(sc,
"Invalid ACL packet size, length=%d, " \
1092 "pktlen=%d\n", len, m->m_pkthdr.len);
1098 UBT_INFO(sc,
"got complete ACL data packet, pktlen=%d, " \
1099 "length=%d\n", m->m_pkthdr.len, len);
1112 usbd_xfer_set_frame_len(xfer, 0, usbd_xfer_max_len(xfer));
1113 usbd_transfer_submit(xfer);
1117 if (error != USB_ERR_CANCELLED) {
1118 UBT_WARN(sc,
"bulk-in transfer failed: %s\n",
1119 usbd_errstr(error));
1122 usbd_xfer_set_stall(xfer);
1139 struct ubt_softc *sc = usbd_xfer_softc(xfer);
1141 struct usb_page_cache *pc;
1144 usbd_xfer_status(xfer, &actlen, NULL, NULL, NULL);
1146 switch (USB_GET_STATE(xfer)) {
1147 case USB_ST_TRANSFERRED:
1148 UBT_INFO(sc,
"sent %d bytes to bulk-out pipe\n", actlen);
1161 UBT_INFO(sc,
"ACL data queue is empty\n");
1170 pc = usbd_xfer_get_frame(xfer, 0);
1171 usbd_m_copy_in(pc, 0, m, 0, m->m_pkthdr.len);
1172 usbd_xfer_set_frame_len(xfer, 0, m->m_pkthdr.len);
1174 UBT_INFO(sc,
"bulk-out transfer has been started, len=%d\n",
1179 usbd_transfer_submit(xfer);
1183 if (error != USB_ERR_CANCELLED) {
1184 UBT_WARN(sc,
"bulk-out transfer failed: %s\n",
1185 usbd_errstr(error));
1190 usbd_xfer_set_stall(xfer);
1207 struct ubt_softc *sc = usbd_xfer_softc(xfer);
1209 int actlen, nframes;
1211 usbd_xfer_status(xfer, &actlen, NULL, NULL, &nframes);
1213 switch (USB_GET_STATE(xfer)) {
1214 case USB_ST_TRANSFERRED:
1215 for (n = 0; n < nframes; n ++)
1222 for (n = 0; n < nframes; n ++)
1223 usbd_xfer_set_frame_len(xfer, n,
1224 usbd_xfer_max_framelen(xfer));
1226 usbd_transfer_submit(xfer);
1230 if (error != USB_ERR_CANCELLED) {
1249 struct ubt_softc *sc = usbd_xfer_softc(xfer);
1250 struct usb_page_cache *pc;
1252 int len, want, got, total;
1255 pc = usbd_xfer_get_frame(xfer, 0);
1257 total = usbd_xfer_frame_len(xfer, frame_no);
1263 MGETHDR(m, M_NOWAIT, MT_DATA);
1269 if (!(MCLGET(m, M_NOWAIT))) {
1277 m->m_pkthdr.len = m->m_len = got = 1;
1278 want =
sizeof(ng_hci_scodata_pkt_t);
1284 got = m->m_pkthdr.len;
1285 want =
sizeof(ng_hci_scodata_pkt_t);
1288 want += mtod(m, ng_hci_scodata_pkt_t *)->length;
1293 if (got + len > want)
1296 usbd_copy_out(pc, frame_no * usbd_xfer_max_framelen(xfer),
1297 mtod(m, uint8_t *) + m->m_pkthdr.len, len);
1299 m->m_pkthdr.len += len;
1308 UBT_INFO(sc,
"got complete SCO data frame, pktlen=%d, " \
1309 "length=%d\n", m->m_pkthdr.len,
1310 mtod(m, ng_hci_scodata_pkt_t *)->
length);
1334 struct ubt_softc *sc = usbd_xfer_softc(xfer);
1335 struct usb_page_cache *pc;
1337 int n, space, offset;
1338 int actlen, nframes;
1340 usbd_xfer_status(xfer, &actlen, NULL, NULL, &nframes);
1341 pc = usbd_xfer_get_frame(xfer, 0);
1343 switch (USB_GET_STATE(xfer)) {
1344 case USB_ST_TRANSFERRED:
1345 UBT_INFO(sc,
"sent %d bytes to isoc-out pipe\n", actlen);
1353 space = usbd_xfer_max_framelen(xfer) * nframes;
1366 n =
min(space, m->m_pkthdr.len);
1368 usbd_m_copy_in(pc, offset, m,0, n);
1375 if (m->m_pkthdr.len == 0)
1394 for (n = 0; n < nframes; n ++) {
1395 usbd_xfer_set_frame_len(xfer, n,
1396 min(offset, usbd_xfer_max_framelen(xfer)));
1397 offset -= usbd_xfer_frame_len(xfer, n);
1400 usbd_transfer_submit(xfer);
1404 if (error != USB_ERR_CANCELLED) {
1443 if ((hook = sc->
sc_hook) != NULL)
1505 if (taskqueue_enqueue(taskqueue_swi, &sc->
sc_task) == 0) {
1537 usbd_transfer_drain(sc->
sc_xfer[i]);
1705 struct ng_mesg *msg, *rsp = NULL;
1707 int error = 0, queue, qlen;
1723 "Task flags: %#x\n" \
1725 "CMD queue: [have:%d,max:%d]\n" \
1726 "ACL queue: [have:%d,max:%d]\n" \
1727 "SCO queue: [have:%d,max:%d]",
1880 int action, error = 0;
1897 if (m->m_pkthdr.len < 4)
1898 panic(
"HCI frame size is too small! pktlen=%d\n",
1902 switch (*mtod(m, uint8_t *)) {
1905 panic(
"HCI command frame size is too big! " \
1906 "buffer size=%zd, packet len=%d\n",
1915 panic(
"ACL data frame size is too big! " \
1916 "buffer size=%d, packet len=%d\n",
1929 UBT_ERR(sc,
"Dropping unsupported HCI frame, type=0x%02x, " \
1930 "pktlen=%d\n", *mtod(m, uint8_t *), m->m_pkthdr.len);
1943 UBT_ERR(sc,
"Dropping HCI frame 0x%02x, len=%d. Queue full\n",
1944 *mtod(m, uint8_t *), m->m_pkthdr.len);
1949 m_adj(m,
sizeof(uint8_t));
1979 printf(
"%s: Could not register Netgraph node type, " \
int ng_connect_t(hook_p hook)
#define NG_HOOK_NODE(hook)
#define NG_HOOK_UNREF(hook)
int ng_rcvmsg_t(node_p node, item_p item, hook_p lasthook)
int ng_disconnect_t(hook_p hook)
#define NG_NODE_SET_PRIVATE(node, val)
int ng_newtype(struct ng_type *tp)
#define NG_RESPOND_MSG(error, here, item, resp)
#define NG_NODE_FORCE_WRITER(node)
#define NG_HOOK_PEER(hook)
#define NG_NODE_UNREF(node)
int ng_rmnode_self(node_p here)
#define NG_SEND_DATA_ONLY(error, hook, m)
#define NG_NODE_REVIVE(node)
#define NG_HOOK_FORCE_QUEUE(hook)
#define NG_HOOK_REF(hook)
int ng_rcvdata_t(hook_p hook, item_p item)
#define NG_NODE_REALLY_DIE(node)
int ng_shutdown_t(node_p node)
#define NG_FREE_ITEM(item)
int ng_rmtype(struct ng_type *tp)
int ng_make_node_common(struct ng_type *typep, node_p *nodep)
int ng_name_node(node_p node, const char *name)
int ng_constructor_t(node_p node)
#define NGI_GET_MSG(i, m)
#define NG_NODE_PRIVATE(node)
int ng_newhook_t(node_p node, hook_p hook, const char *name)
#define NG_BT_MBUFQ_DRAIN(q)
#define NG_BT_MBUFQ_DEQUEUE(q, i)
#define NG_BT_MBUFQ_DROP(q)
#define NG_BT_MBUFQ_INIT(q, _maxlen)
#define NG_BT_MBUFQ_ENQUEUE(q, i)
#define NG_BT_MBUFQ_DESTROY(q)
#define NG_BLUETOOTH_VERSION
#define NG_BT_MBUFQ_PREPEND(q, i)
#define NG_BT_MBUFQ_FULL(q)
#define NG_HCI_ACL_DATA_PKT
#define NG_HCI_SCO_DATA_PKT
#define NG_MKRESPONSE(rsp, msg, len, how)
#define NGM_GENERIC_COOKIE
const struct ng_parse_type ng_parse_uint16_type
const struct ng_parse_type ng_parse_int32_type
const struct ng_parse_type ng_parse_struct_type
const struct ng_parse_type ng_parse_uint32_type
static task_fn_t ubt_task
static device_detach_t ubt_detach
SYSCTL_INT(_net_bluetooth, OID_AUTO, usb_isoc_enable, CTLFLAG_RWTUN|CTLFLAG_MPSAFE, &ng_usb_isoc_enable, 0, "enable isochronous transfers")
MODULE_DEPEND(ng_ubt, netgraph, NG_ABI_VERSION, NG_ABI_VERSION, NG_ABI_VERSION)
static usb_callback_t ubt_isoc_read_callback
static const struct ng_parse_struct_field ng_ubt_node_qlen_type_fields[]
static device_method_t ubt_methods[]
static ng_constructor_t ng_ubt_constructor
static const STRUCT_USB_HOST_ID ubt_devs[]
static usb_callback_t ubt_bulk_read_callback
static const STRUCT_USB_HOST_ID ubt_ignore_devs[]
static int ubt_modevent(module_t, int, void *)
static ng_shutdown_t ng_ubt_shutdown
static device_attach_t ubt_attach
static const struct usb_config ubt_config[UBT_N_TRANSFER]
static ng_newhook_t ng_ubt_newhook
static struct ng_type typestruct
static usb_callback_t ubt_ctrl_write_callback
static ng_connect_t ng_ubt_connect
static usb_callback_t ubt_probe_intr_callback
static usb_callback_t ubt_intr_read_callback
static const struct ng_cmdlist ng_ubt_cmdlist[]
MODULE_VERSION(ng_ubt, NG_BLUETOOTH_VERSION)
static int ng_usb_isoc_enable
#define ubt_xfer_start(sc, i)
static const struct ng_parse_type ng_ubt_node_qlen_type
static int ubt_isoc_read_one_frame(struct usb_xfer *, int)
static ng_disconnect_t ng_ubt_disconnect
static int ubt_fwd_mbuf_up(ubt_softc_p, struct mbuf **)
static const struct ng_parse_struct_field ng_ubt_node_stat_type_fields[]
USB_PNP_HOST_INFO(ubt_devs)
DRIVER_MODULE(ng_ubt, uhub, ubt_driver, ubt_devclass, ubt_modevent, 0)
static ng_rcvmsg_t ng_ubt_rcvmsg
static device_probe_t ubt_probe
static ng_rcvdata_t ng_ubt_rcvdata
usb_error_t ubt_do_hci_request(struct usb_device *udev, struct ubt_hci_cmd *cmd, void *evt, usb_timeout_t timeout)
static const struct ng_parse_type ng_ubt_node_stat_type
static void ubt_task_schedule(ubt_softc_p, int)
static usb_callback_t ubt_bulk_write_callback
static usb_callback_t ubt_isoc_write_callback
#define NG_UBT_WARN_LEVEL
u_int16_t ng_ubt_node_debug_ep
#define NGM_UBT_NODE_GET_QLEN
#define NGM_UBT_NODE_GET_STAT
#define NGM_UBT_NODE_QUEUE_ACL
#define NGM_UBT_NODE_QUEUE_SCO
#define NGM_UBT_NODE_SET_DEBUG
#define NGM_UBT_NODE_GET_DEBUG
#define NGM_UBT_NODE_SET_QLEN
#define NGM_UBT_NODE_RESET_STAT
#define NGM_UBT_NODE_QUEUE_CMD
#define UBT_STAT_IERROR(sc)
#define UBT_HCI_CMD_SIZE(cmd)
#define UBT_BULK_READ_BUFFER_SIZE
#define UBT_NG_UNLOCK(sc)
#define UBT_STAT_PCKTS_RECV(sc)
#define UBT_STAT_RESET(sc)
#define UBT_FLAG_T_STOP_ALL
#define UBT_FLAG_T_START_CTRL
#define UBT_STAT_BYTES_RECV(sc, n)
#define UBT_FLAG_T_PENDING
#define UBT_BULK_WRITE_BUFFER_SIZE
#define UBT_STAT_PCKTS_SENT(sc)
#define UBT_STAT_OERROR(sc)
#define UBT_FLAG_T_START_BULK
#define UBT_HCI_EVENT_SIZE(evt)
#define UBT_CTRL_BUFFER_SIZE
#define UBT_INTR_BUFFER_SIZE
#define UBT_FLAG_T_START_ALL
#define UBT_STAT_BYTES_SENT(sc, n)
struct ng_mesg::ng_msghdr header
struct usb_xfer * sc_xfer[UBT_N_TRANSFER]
struct ng_bt_mbufq sc_scoq
ng_ubt_node_stat_ep sc_stat
ng_ubt_node_debug_ep sc_debug
struct ng_bt_mbufq sc_cmdq
struct mbuf * sc_isoc_in_buffer
struct ng_bt_mbufq sc_aclq