\hypertarget{ng__ubt_8c_source}{}\doxysection{ng\+\_\+ubt.\+c}
\label{ng__ubt_8c_source}\index{netgraph/bluetooth/drivers/ubt/ng\_ubt.c@{netgraph/bluetooth/drivers/ubt/ng\_ubt.c}}
\mbox{\hyperlink{ng__ubt_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00001}00001 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00002}00002 \textcolor{comment}{ * ng\_ubt.c}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00003}00003 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00004}00004 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00005}00005 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00006}00006 \textcolor{comment}{ * SPDX-\/License-\/Identifier: BSD-\/2-\/Clause-\/FreeBSD}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00007}00007 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00008}00008 \textcolor{comment}{ * Copyright (c) 2001-\/2009 Maksim Yevmenkin <m\_evmenkin@yahoo.com>}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00009}00009 \textcolor{comment}{ * All rights reserved.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00010}00010 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00011}00011 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00012}00012 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00013}00013 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00014}00014 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00015}00015 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00016}00016 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00017}00017 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00018}00018 \textcolor{comment}{ *    documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00019}00019 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00020}00020 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00021}00021 \textcolor{comment}{ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00022}00022 \textcolor{comment}{ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00023}00023 \textcolor{comment}{ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00024}00024 \textcolor{comment}{ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00025}00025 \textcolor{comment}{ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00026}00026 \textcolor{comment}{ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00027}00027 \textcolor{comment}{ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00028}00028 \textcolor{comment}{ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00029}00029 \textcolor{comment}{ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00030}00030 \textcolor{comment}{ * SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00031}00031 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00032}00032 \textcolor{comment}{ * \$Id: ng\_ubt.c,v 1.16 2003/10/10 19:15:06 max Exp \$}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00033}00033 \textcolor{comment}{ * \$FreeBSD\$}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00034}00034 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00035}00035 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00036}00036 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00037}00037 \textcolor{comment}{ * NOTE: ng\_ubt2 driver has a split personality. On one side it is}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00038}00038 \textcolor{comment}{ * a USB device driver and on the other it is a Netgraph node. This}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00039}00039 \textcolor{comment}{ * driver will *NOT* create traditional /dev/ enties, only Netgraph }}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00040}00040 \textcolor{comment}{ * node.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00041}00041 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00042}00042 \textcolor{comment}{ * NOTE ON LOCKS USED: ng\_ubt2 drives uses 2 locks (mutexes)}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00043}00043 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00044}00044 \textcolor{comment}{ * 1) sc\_if\_mtx -\/ lock for device's interface \#0 and \#1. This lock is used}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00045}00045 \textcolor{comment}{ *    by USB for any USB request going over device's interface \#0 and \#1,}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00046}00046 \textcolor{comment}{ *    i.e. interrupt, control, bulk and isoc. transfers.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00047}00047 \textcolor{comment}{ * }}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00048}00048 \textcolor{comment}{ * 2) sc\_ng\_mtx -\/ this lock is used to protect shared (between USB, Netgraph}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00049}00049 \textcolor{comment}{ *    and Taskqueue) data, such as outgoing mbuf queues, task flags and hook}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00050}00050 \textcolor{comment}{ *    pointer. This lock *SHOULD NOT* be grabbed for a long time. In fact,}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00051}00051 \textcolor{comment}{ *    think of it as a spin lock.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00052}00052 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00053}00053 \textcolor{comment}{ * NOTE ON LOCKING STRATEGY: ng\_ubt2 driver operates in 3 different contexts.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00054}00054 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00055}00055 \textcolor{comment}{ * 1) USB context. This is where all the USB related stuff happens. All}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00056}00056 \textcolor{comment}{ *    callbacks run in this context. All callbacks are called (by USB) with}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00057}00057 \textcolor{comment}{ *    appropriate interface lock held. It is (generally) allowed to grab}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00058}00058 \textcolor{comment}{ *    any additional locks.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00059}00059 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00060}00060 \textcolor{comment}{ * 2) Netgraph context. This is where all the Netgraph related stuff happens.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00061}00061 \textcolor{comment}{ *    Since we mark node as WRITER, the Netgraph node will be "{}locked"{} (from}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00062}00062 \textcolor{comment}{ *    Netgraph point of view). Any variable that is only modified from the}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00063}00063 \textcolor{comment}{ *    Netgraph context does not require any additional locking. It is generally}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00064}00064 \textcolor{comment}{ *    *NOT* allowed to grab *ANY* additional locks. Whatever you do, *DO NOT*}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00065}00065 \textcolor{comment}{ *    grab any lock in the Netgraph context that could cause de-\/scheduling of}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00066}00066 \textcolor{comment}{ *    the Netgraph thread for significant amount of time. In fact, the only}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00067}00067 \textcolor{comment}{ *    lock that is allowed in the Netgraph context is the sc\_ng\_mtx lock.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00068}00068 \textcolor{comment}{ *    Also make sure that any code that is called from the Netgraph context}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00069}00069 \textcolor{comment}{ *    follows the rule above.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00070}00070 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00071}00071 \textcolor{comment}{ * 3) Taskqueue context. This is where ubt\_task runs. Since we are generally}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00072}00072 \textcolor{comment}{ *    NOT allowed to grab any lock that could cause de-\/scheduling in the}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00073}00073 \textcolor{comment}{ *    Netgraph context, and, USB requires us to grab interface lock before}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00074}00074 \textcolor{comment}{ *    doing things with transfers, it is safer to transition from the Netgraph}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00075}00075 \textcolor{comment}{ *    context to the Taskqueue context before we can call into USB subsystem.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00076}00076 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00077}00077 \textcolor{comment}{ * So, to put everything together, the rules are as follows.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00078}00078 \textcolor{comment}{ *      It is OK to call from the USB context or the Taskqueue context into}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00079}00079 \textcolor{comment}{ * the Netgraph context (i.e. call NG\_SEND\_xxx functions). In other words}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00080}00080 \textcolor{comment}{ * it is allowed to call into the Netgraph context with locks held.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00081}00081 \textcolor{comment}{ *      Is it *NOT* OK to call from the Netgraph context into the USB context,}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00082}00082 \textcolor{comment}{ * because USB requires us to grab interface locks, and, it is safer to}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00083}00083 \textcolor{comment}{ * avoid it. So, to make things safer we set task flags to indicate which}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00084}00084 \textcolor{comment}{ * actions we want to perform and schedule ubt\_task which would run in the}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00085}00085 \textcolor{comment}{ * Taskqueue context.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00086}00086 \textcolor{comment}{ *      Is is OK to call from the Taskqueue context into the USB context,}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00087}00087 \textcolor{comment}{ * and, ubt\_task does just that (i.e. grabs appropriate interface locks}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00088}00088 \textcolor{comment}{ * before calling into USB).}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00089}00089 \textcolor{comment}{ *      Access to the outgoing queues, task flags and hook pointer is}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00090}00090 \textcolor{comment}{ * controlled by the sc\_ng\_mtx lock. It is an unavoidable evil. Again,}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00091}00091 \textcolor{comment}{ * sc\_ng\_mtx should really be a spin lock (and it is very likely to an}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00092}00092 \textcolor{comment}{ * equivalent of spin lock due to adaptive nature of FreeBSD mutexes).}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00093}00093 \textcolor{comment}{ *      All USB callbacks accept softc pointer as a private data. USB ensures}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00094}00094 \textcolor{comment}{ * that this pointer is valid.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00095}00095 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00096}00096 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00097}00097 \textcolor{preprocessor}{\#include <sys/stdint.h>}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00098}00098 \textcolor{preprocessor}{\#include <sys/stddef.h>}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00099}00099 \textcolor{preprocessor}{\#include <sys/param.h>}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00100}00100 \textcolor{preprocessor}{\#include <sys/queue.h>}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00101}00101 \textcolor{preprocessor}{\#include <sys/types.h>}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00102}00102 \textcolor{preprocessor}{\#include <sys/systm.h>}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00103}00103 \textcolor{preprocessor}{\#include <sys/kernel.h>}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00104}00104 \textcolor{preprocessor}{\#include <sys/bus.h>}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00105}00105 \textcolor{preprocessor}{\#include <sys/module.h>}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00106}00106 \textcolor{preprocessor}{\#include <sys/lock.h>}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00107}00107 \textcolor{preprocessor}{\#include <sys/mutex.h>}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00108}00108 \textcolor{preprocessor}{\#include <sys/condvar.h>}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00109}00109 \textcolor{preprocessor}{\#include <sys/sysctl.h>}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00110}00110 \textcolor{preprocessor}{\#include <sys/sx.h>}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00111}00111 \textcolor{preprocessor}{\#include <sys/unistd.h>}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00112}00112 \textcolor{preprocessor}{\#include <sys/callout.h>}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00113}00113 \textcolor{preprocessor}{\#include <sys/malloc.h>}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00114}00114 \textcolor{preprocessor}{\#include <sys/priv.h>}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00115}00115 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00116}00116 \textcolor{preprocessor}{\#include "{}usbdevs.h"{}}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00117}00117 \textcolor{preprocessor}{\#include <dev/usb/usb.h>}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00118}00118 \textcolor{preprocessor}{\#include <dev/usb/usbdi.h>}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00119}00119 \textcolor{preprocessor}{\#include <dev/usb/usbdi\_util.h>}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00120}00120 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00121}\mbox{\hyperlink{ng__ubt_8c_a927dd6f59caf10a2991dfb564bcbb1e1}{00121}} \textcolor{preprocessor}{\#define USB\_DEBUG\_VAR usb\_debug}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00122}00122 \textcolor{preprocessor}{\#include <dev/usb/usb\_debug.h>}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00123}00123 \textcolor{preprocessor}{\#include <dev/usb/usb\_busdma.h>}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00124}00124 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00125}00125 \textcolor{preprocessor}{\#include <sys/mbuf.h>}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00126}00126 \textcolor{preprocessor}{\#include <sys/taskqueue.h>}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00127}00127 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00128}00128 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{ng__message_8h}{netgraph/ng\_message.h}}>}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00129}00129 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{netgraph_8h}{netgraph/netgraph.h}}>}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00130}00130 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{ng__parse_8h}{netgraph/ng\_parse.h}}>}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00131}00131 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{ng__bluetooth_8h}{netgraph/bluetooth/include/ng\_bluetooth.h}}>}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00132}00132 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{ng__hci_8h}{netgraph/bluetooth/include/ng\_hci.h}}>}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00133}00133 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{ng__ubt_8h}{netgraph/bluetooth/include/ng\_ubt.h}}>}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00134}00134 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{ng__ubt__var_8h}{netgraph/bluetooth/drivers/ubt/ng\_ubt\_var.h}}>}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00135}00135 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00136}00136 \textcolor{keyword}{static} \textcolor{keywordtype}{int}              \mbox{\hyperlink{ng__ubt_8c_a39cfdb0c8915123573dea71ac81142f2}{ubt\_modevent}}(module\_t, \textcolor{keywordtype}{int}, \textcolor{keywordtype}{void} *);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00137}\mbox{\hyperlink{ng__ubt_8c_ad03d0b0a01b86016c25a80a189d2a9cf}{00137}} \textcolor{keyword}{static} device\_probe\_t   \mbox{\hyperlink{ng__ubt_8c_ad03d0b0a01b86016c25a80a189d2a9cf}{ubt\_probe}};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00138}\mbox{\hyperlink{ng__ubt_8c_a4a6250ade8d193ca25789e46415a2756}{00138}} \textcolor{keyword}{static} device\_attach\_t  \mbox{\hyperlink{ng__ubt_8c_a4a6250ade8d193ca25789e46415a2756}{ubt\_attach}};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00139}\mbox{\hyperlink{ng__ubt_8c_a0807ce14484285543ed8184c65217f7f}{00139}} \textcolor{keyword}{static} device\_detach\_t  \mbox{\hyperlink{ng__ubt_8c_a0807ce14484285543ed8184c65217f7f}{ubt\_detach}};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00140}00140 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00141}00141 \textcolor{keyword}{static} \textcolor{keywordtype}{void}             \mbox{\hyperlink{ng__ubt_8c_ae246805ef9c86a2e43954cd9ad9e6ecd}{ubt\_task\_schedule}}(\mbox{\hyperlink{structubt__softc}{ubt\_softc\_p}}, \textcolor{keywordtype}{int});}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00142}\mbox{\hyperlink{ng__ubt_8c_a07664a30e5ce5a89597e6db805c971ba}{00142}} \textcolor{keyword}{static} task\_fn\_t        \mbox{\hyperlink{ng__ubt_8c_a07664a30e5ce5a89597e6db805c971ba}{ubt\_task}};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00143}00143 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00144}\mbox{\hyperlink{ng__ubt_8c_aa01335806f737804f570b6ca36821ce0}{00144}} \textcolor{preprocessor}{\#define ubt\_xfer\_start(sc, i)   usbd\_transfer\_start((sc)-\/>sc\_xfer[(i)])}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00145}00145 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00146}00146 \textcolor{comment}{/* Netgraph methods */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00147}\mbox{\hyperlink{ng__ubt_8c_a266fb8ff5f8c42eecbc0fbb61a1811f7}{00147}} \textcolor{keyword}{static} \mbox{\hyperlink{netgraph_8h_abb75b9ed2849e15851d6402d2ab5b899}{ng\_constructor\_t}} \mbox{\hyperlink{ng__ubt_8c_a266fb8ff5f8c42eecbc0fbb61a1811f7}{ng\_ubt\_constructor}};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00148}\mbox{\hyperlink{ng__ubt_8c_a3cb9fd0ab47580ece9847b98f5faff6c}{00148}} \textcolor{keyword}{static} \mbox{\hyperlink{netgraph_8h_aab0a679789a1af312a7f856b4668ad74}{ng\_shutdown\_t}}       \mbox{\hyperlink{ng__ubt_8c_a3cb9fd0ab47580ece9847b98f5faff6c}{ng\_ubt\_shutdown}};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00149}\mbox{\hyperlink{ng__ubt_8c_a7df7bcd70a40fa1fcfb8d6f27ad8780a}{00149}} \textcolor{keyword}{static} \mbox{\hyperlink{netgraph_8h_afa50639df4ed6eb400f8220a890d56e6}{ng\_newhook\_t}} \mbox{\hyperlink{ng__ubt_8c_a7df7bcd70a40fa1fcfb8d6f27ad8780a}{ng\_ubt\_newhook}};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00150}\mbox{\hyperlink{ng__ubt_8c_a8f58f63b832aa3b690b3a9ecbb443ca0}{00150}} \textcolor{keyword}{static} \mbox{\hyperlink{netgraph_8h_a0e4a4a62e48409635e5f33c548baaea7}{ng\_connect\_t}} \mbox{\hyperlink{ng__ubt_8c_a8f58f63b832aa3b690b3a9ecbb443ca0}{ng\_ubt\_connect}};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00151}\mbox{\hyperlink{ng__ubt_8c_ab626c838bcf354fe851d210ae24872ca}{00151}} \textcolor{keyword}{static} \mbox{\hyperlink{netgraph_8h_a669e1783335f933b4a4f90f17d22f381}{ng\_disconnect\_t}}   \mbox{\hyperlink{ng__ubt_8c_ab626c838bcf354fe851d210ae24872ca}{ng\_ubt\_disconnect}};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00152}\mbox{\hyperlink{ng__ubt_8c_ac4351a342a4fca4236b6d07ff99181f2}{00152}} \textcolor{keyword}{static} \mbox{\hyperlink{netgraph_8h_a47b860e2900386e775707cc1ae661162}{ng\_rcvmsg\_t}}   \mbox{\hyperlink{ng__ubt_8c_ac4351a342a4fca4236b6d07ff99181f2}{ng\_ubt\_rcvmsg}};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00153}\mbox{\hyperlink{ng__ubt_8c_ad588d2e65bb59f910d3a52f41453eed9}{00153}} \textcolor{keyword}{static} \mbox{\hyperlink{netgraph_8h_aa87ef7415b345b801747ceaf99de6c43}{ng\_rcvdata\_t}} \mbox{\hyperlink{ng__ubt_8c_ad588d2e65bb59f910d3a52f41453eed9}{ng\_ubt\_rcvdata}};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00154}00154 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00155}\mbox{\hyperlink{ng__ubt_8c_a9ffe035b8ab79eb7d4cd41f9559499dc}{00155}} \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{ng__ubt_8c_a9ffe035b8ab79eb7d4cd41f9559499dc}{ng\_usb\_isoc\_enable}} = 1;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00156}00156 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00157}\mbox{\hyperlink{ng__ubt_8c_a0e30c62d74b8d03997dd789bee2e51e4}{00157}} \mbox{\hyperlink{ng__ubt_8c_a0e30c62d74b8d03997dd789bee2e51e4}{SYSCTL\_INT}}(\_net\_bluetooth, OID\_AUTO, usb\_isoc\_enable, CTLFLAG\_RWTUN | CTLFLAG\_MPSAFE,}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00158}00158     \&\mbox{\hyperlink{ng__ubt_8c_a9ffe035b8ab79eb7d4cd41f9559499dc}{ng\_usb\_isoc\_enable}}, 0, \textcolor{stringliteral}{"{}enable isochronous transfers"{}});}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00159}00159 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00160}00160 \textcolor{comment}{/* Queue length */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00161}\mbox{\hyperlink{ng__ubt_8c_a134e1162915e0ffb4ed8eb6a70f48a57}{00161}} \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structng__parse__struct__field}{ng\_parse\_struct\_field}}  \mbox{\hyperlink{ng__ubt_8c_a134e1162915e0ffb4ed8eb6a70f48a57}{ng\_ubt\_node\_qlen\_type\_fields}}[] =}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00162}00162 \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00163}00163         \{ \textcolor{stringliteral}{"{}queue"{}}, \&\mbox{\hyperlink{ng__parse_8c_a20fdb7664c089b34fc33f9a53b3d6622}{ng\_parse\_int32\_type}}, \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00164}00164         \{ \textcolor{stringliteral}{"{}qlen"{}},  \&\mbox{\hyperlink{ng__parse_8c_a20fdb7664c089b34fc33f9a53b3d6622}{ng\_parse\_int32\_type}}, \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00165}00165         \{ NULL, \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00166}00166 \};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00167}\mbox{\hyperlink{ng__ubt_8c_aad32cc4e1d5494cfac4b66463e26f0e1}{00167}} \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structng__parse__type}{ng\_parse\_type}}          \mbox{\hyperlink{ng__ubt_8c_aad32cc4e1d5494cfac4b66463e26f0e1}{ng\_ubt\_node\_qlen\_type}} =}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00168}00168 \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00169}00169         \&\mbox{\hyperlink{ng__parse_8c_aa8b7049fbd698972a3d2ce77dfd7d079}{ng\_parse\_struct\_type}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00170}00170         \&\mbox{\hyperlink{ng__ubt_8c_a134e1162915e0ffb4ed8eb6a70f48a57}{ng\_ubt\_node\_qlen\_type\_fields}}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00171}00171 \};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00172}00172 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00173}00173 \textcolor{comment}{/* Stat info */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00174}\mbox{\hyperlink{ng__ubt_8c_abedce3b61602cb6e2565f7251f978d9b}{00174}} \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structng__parse__struct__field}{ng\_parse\_struct\_field}}  \mbox{\hyperlink{ng__ubt_8c_abedce3b61602cb6e2565f7251f978d9b}{ng\_ubt\_node\_stat\_type\_fields}}[] =}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00175}00175 \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00176}00176         \{ \textcolor{stringliteral}{"{}pckts\_recv"{}}, \&\mbox{\hyperlink{ng__parse_8c_ac8ed58dbf4650a5ddc5bfd882e064519}{ng\_parse\_uint32\_type}}, \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00177}00177         \{ \textcolor{stringliteral}{"{}bytes\_recv"{}}, \&\mbox{\hyperlink{ng__parse_8c_ac8ed58dbf4650a5ddc5bfd882e064519}{ng\_parse\_uint32\_type}}, \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00178}00178         \{ \textcolor{stringliteral}{"{}pckts\_sent"{}}, \&\mbox{\hyperlink{ng__parse_8c_ac8ed58dbf4650a5ddc5bfd882e064519}{ng\_parse\_uint32\_type}}, \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00179}00179         \{ \textcolor{stringliteral}{"{}bytes\_sent"{}}, \&\mbox{\hyperlink{ng__parse_8c_ac8ed58dbf4650a5ddc5bfd882e064519}{ng\_parse\_uint32\_type}}, \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00180}00180         \{ \textcolor{stringliteral}{"{}oerrors"{}},    \&\mbox{\hyperlink{ng__parse_8c_ac8ed58dbf4650a5ddc5bfd882e064519}{ng\_parse\_uint32\_type}}, \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00181}00181         \{ \textcolor{stringliteral}{"{}ierrors"{}},    \&\mbox{\hyperlink{ng__parse_8c_ac8ed58dbf4650a5ddc5bfd882e064519}{ng\_parse\_uint32\_type}}, \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00182}00182         \{ NULL, \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00183}00183 \};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00184}\mbox{\hyperlink{ng__ubt_8c_adef7a4416165f5e96e7f9dd2a21a82b7}{00184}} \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structng__parse__type}{ng\_parse\_type}}          \mbox{\hyperlink{ng__ubt_8c_adef7a4416165f5e96e7f9dd2a21a82b7}{ng\_ubt\_node\_stat\_type}} =}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00185}00185 \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00186}00186         \&\mbox{\hyperlink{ng__parse_8c_aa8b7049fbd698972a3d2ce77dfd7d079}{ng\_parse\_struct\_type}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00187}00187         \&\mbox{\hyperlink{ng__ubt_8c_abedce3b61602cb6e2565f7251f978d9b}{ng\_ubt\_node\_stat\_type\_fields}}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00188}00188 \};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00189}00189 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00190}00190 \textcolor{comment}{/* Netgraph node command list */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00191}\mbox{\hyperlink{ng__ubt_8c_a96af226936247ea557578e7e9db5e80b}{00191}} \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structng__cmdlist}{ng\_cmdlist}}                        \mbox{\hyperlink{ng__ubt_8c_a96af226936247ea557578e7e9db5e80b}{ng\_ubt\_cmdlist}}[] =}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00192}00192 \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00193}00193         \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00194}00194                 \mbox{\hyperlink{ng__ubt_8h_a52a68343fc6c28a5376d4d055a049b56}{NGM\_UBT\_COOKIE}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00195}00195                 \mbox{\hyperlink{ng__ubt_8h_aa9c5095b22e0dcaf13d641cebc299f6d}{NGM\_UBT\_NODE\_SET\_DEBUG}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00196}00196                 \textcolor{stringliteral}{"{}set\_debug"{}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00197}00197                 \&\mbox{\hyperlink{ng__parse_8c_a0fada424d8e3a3fd9c81a6cc6a0386cc}{ng\_parse\_uint16\_type}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00198}00198                 NULL}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00199}00199         \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00200}00200         \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00201}00201                 \mbox{\hyperlink{ng__ubt_8h_a52a68343fc6c28a5376d4d055a049b56}{NGM\_UBT\_COOKIE}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00202}00202                 \mbox{\hyperlink{ng__ubt_8h_ac3def1d6f12cd4d56e0f34bccd00d49e}{NGM\_UBT\_NODE\_GET\_DEBUG}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00203}00203                 \textcolor{stringliteral}{"{}get\_debug"{}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00204}00204                 NULL,}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00205}00205                 \&\mbox{\hyperlink{ng__parse_8c_a0fada424d8e3a3fd9c81a6cc6a0386cc}{ng\_parse\_uint16\_type}}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00206}00206         \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00207}00207         \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00208}00208                 \mbox{\hyperlink{ng__ubt_8h_a52a68343fc6c28a5376d4d055a049b56}{NGM\_UBT\_COOKIE}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00209}00209                 \mbox{\hyperlink{ng__ubt_8h_aefe54fedff9e6c5602ba047376e7f4a1}{NGM\_UBT\_NODE\_SET\_QLEN}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00210}00210                 \textcolor{stringliteral}{"{}set\_qlen"{}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00211}00211                 \&\mbox{\hyperlink{ng__ubt_8c_aad32cc4e1d5494cfac4b66463e26f0e1}{ng\_ubt\_node\_qlen\_type}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00212}00212                 NULL}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00213}00213         \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00214}00214         \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00215}00215                 \mbox{\hyperlink{ng__ubt_8h_a52a68343fc6c28a5376d4d055a049b56}{NGM\_UBT\_COOKIE}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00216}00216                 \mbox{\hyperlink{ng__ubt_8h_a4f255bb904a4e4f7a634f4e19cd0524e}{NGM\_UBT\_NODE\_GET\_QLEN}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00217}00217                 \textcolor{stringliteral}{"{}get\_qlen"{}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00218}00218                 \&\mbox{\hyperlink{ng__ubt_8c_aad32cc4e1d5494cfac4b66463e26f0e1}{ng\_ubt\_node\_qlen\_type}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00219}00219                 \&\mbox{\hyperlink{ng__ubt_8c_aad32cc4e1d5494cfac4b66463e26f0e1}{ng\_ubt\_node\_qlen\_type}}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00220}00220         \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00221}00221         \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00222}00222                 \mbox{\hyperlink{ng__ubt_8h_a52a68343fc6c28a5376d4d055a049b56}{NGM\_UBT\_COOKIE}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00223}00223                 \mbox{\hyperlink{ng__ubt_8h_a708bf69b444e2a2b8f5439bebac85a1e}{NGM\_UBT\_NODE\_GET\_STAT}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00224}00224                 \textcolor{stringliteral}{"{}get\_stat"{}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00225}00225                 NULL,}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00226}00226                 \&\mbox{\hyperlink{ng__ubt_8c_adef7a4416165f5e96e7f9dd2a21a82b7}{ng\_ubt\_node\_stat\_type}}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00227}00227         \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00228}00228         \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00229}00229                 \mbox{\hyperlink{ng__ubt_8h_a52a68343fc6c28a5376d4d055a049b56}{NGM\_UBT\_COOKIE}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00230}00230                 \mbox{\hyperlink{ng__ubt_8h_af0f2e7d6fc1dd88c64e70d5703db3ad3}{NGM\_UBT\_NODE\_RESET\_STAT}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00231}00231                 \textcolor{stringliteral}{"{}reset\_stat"{}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00232}00232                 NULL,}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00233}00233                 NULL}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00234}00234         \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00235}00235         \{ 0, \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00236}00236 \};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00237}00237 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00238}00238 \textcolor{comment}{/* Netgraph node type */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00239}\mbox{\hyperlink{ng__ubt_8c_a80a131770518c7fa3758d85054006e7a}{00239}} \textcolor{keyword}{static} \textcolor{keyword}{struct }\mbox{\hyperlink{structng__type}{ng\_type}}    \mbox{\hyperlink{ng__ubt_8c_a80a131770518c7fa3758d85054006e7a}{typestruct}} =}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00240}00240 \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00241}00241         .\mbox{\hyperlink{structng__type_adbc1c8884ff0e625c19c4b513262fd0e}{version}} =       \mbox{\hyperlink{netgraph_8h_acc6b5f853e8058f4d5a8ca825ee60c97}{NG\_ABI\_VERSION}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00242}00242         .name =         \mbox{\hyperlink{ng__ubt_8h_a903f6064301f1e9967566ea05cf798a1}{NG\_UBT\_NODE\_TYPE}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00243}00243         .constructor =  \mbox{\hyperlink{ng__ubt_8c_a266fb8ff5f8c42eecbc0fbb61a1811f7}{ng\_ubt\_constructor}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00244}00244         .rcvmsg =       \mbox{\hyperlink{ng__ubt_8c_ac4351a342a4fca4236b6d07ff99181f2}{ng\_ubt\_rcvmsg}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00245}00245         .shutdown =     \mbox{\hyperlink{ng__ubt_8c_a3cb9fd0ab47580ece9847b98f5faff6c}{ng\_ubt\_shutdown}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00246}00246         .newhook =      \mbox{\hyperlink{ng__ubt_8c_a7df7bcd70a40fa1fcfb8d6f27ad8780a}{ng\_ubt\_newhook}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00247}00247         .connect =      \mbox{\hyperlink{ng__ubt_8c_a8f58f63b832aa3b690b3a9ecbb443ca0}{ng\_ubt\_connect}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00248}00248         .rcvdata =      \mbox{\hyperlink{ng__ubt_8c_ad588d2e65bb59f910d3a52f41453eed9}{ng\_ubt\_rcvdata}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00249}00249         .disconnect =   \mbox{\hyperlink{ng__ubt_8c_ab626c838bcf354fe851d210ae24872ca}{ng\_ubt\_disconnect}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00250}00250         .cmdlist =      \mbox{\hyperlink{ng__ubt_8c_a96af226936247ea557578e7e9db5e80b}{ng\_ubt\_cmdlist}}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00251}00251 \};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00252}00252 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00253}00253 \textcolor{comment}{/****************************************************************************}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00254}00254 \textcolor{comment}{ ****************************************************************************}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00255}00255 \textcolor{comment}{ **                              USB specific}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00256}00256 \textcolor{comment}{ ****************************************************************************}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00257}00257 \textcolor{comment}{ ****************************************************************************/}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00258}00258 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00259}00259 \textcolor{comment}{/* USB methods */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00260}\mbox{\hyperlink{ng__ubt_8c_a90d60caa3baeadf79e0414363a478121}{00260}} \textcolor{keyword}{static} usb\_callback\_t   \mbox{\hyperlink{ng__ubt_8c_a90d60caa3baeadf79e0414363a478121}{ubt\_probe\_intr\_callback}};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00261}\mbox{\hyperlink{ng__ubt_8c_a8cfc1c20f4989015fbe8389f5eae08fa}{00261}} \textcolor{keyword}{static} usb\_callback\_t   \mbox{\hyperlink{ng__ubt_8c_a8cfc1c20f4989015fbe8389f5eae08fa}{ubt\_ctrl\_write\_callback}};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00262}\mbox{\hyperlink{ng__ubt_8c_a9468c082e5b8cdc5bae70bf35c00c118}{00262}} \textcolor{keyword}{static} usb\_callback\_t   \mbox{\hyperlink{ng__ubt_8c_a9468c082e5b8cdc5bae70bf35c00c118}{ubt\_intr\_read\_callback}};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00263}\mbox{\hyperlink{ng__ubt_8c_a2ff123c3c7491c5077789e57fa651478}{00263}} \textcolor{keyword}{static} usb\_callback\_t   \mbox{\hyperlink{ng__ubt_8c_a2ff123c3c7491c5077789e57fa651478}{ubt\_bulk\_read\_callback}};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00264}\mbox{\hyperlink{ng__ubt_8c_af1276a3b306e8b10188594e07cde1a8c}{00264}} \textcolor{keyword}{static} usb\_callback\_t   \mbox{\hyperlink{ng__ubt_8c_af1276a3b306e8b10188594e07cde1a8c}{ubt\_bulk\_write\_callback}};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00265}\mbox{\hyperlink{ng__ubt_8c_a10921286322e18fe5252f378b1256b20}{00265}} \textcolor{keyword}{static} usb\_callback\_t   \mbox{\hyperlink{ng__ubt_8c_a10921286322e18fe5252f378b1256b20}{ubt\_isoc\_read\_callback}};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00266}\mbox{\hyperlink{ng__ubt_8c_af694eeb98e9e32de74102551f1129639}{00266}} \textcolor{keyword}{static} usb\_callback\_t   \mbox{\hyperlink{ng__ubt_8c_af694eeb98e9e32de74102551f1129639}{ubt\_isoc\_write\_callback}};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00267}00267 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00268}00268 \textcolor{keyword}{static} \textcolor{keywordtype}{int}              \mbox{\hyperlink{ng__ubt_8c_ab8ad7dbd316ac4662bad36d85784c302}{ubt\_fwd\_mbuf\_up}}(\mbox{\hyperlink{structubt__softc}{ubt\_softc\_p}}, \textcolor{keyword}{struct} mbuf **);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00269}00269 \textcolor{keyword}{static} \textcolor{keywordtype}{int}              \mbox{\hyperlink{ng__ubt_8c_ab2c717515c38bf4f23ccb6a2c02ddc7b}{ubt\_isoc\_read\_one\_frame}}(\textcolor{keyword}{struct} usb\_xfer *, \textcolor{keywordtype}{int});}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00270}00270 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00271}00271 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00272}00272 \textcolor{comment}{ * USB config}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00273}00273 \textcolor{comment}{ * }}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00274}00274 \textcolor{comment}{ * The following desribes usb transfers that could be submitted on USB device.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00275}00275 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00276}00276 \textcolor{comment}{ * Interface 0 on the USB device must present the following endpoints}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00277}00277 \textcolor{comment}{ *      1) Interrupt endpoint to receive HCI events}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00278}00278 \textcolor{comment}{ *      2) Bulk IN endpoint to receive ACL data}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00279}00279 \textcolor{comment}{ *      3) Bulk OUT endpoint to send ACL data}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00280}00280 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00281}00281 \textcolor{comment}{ * Interface 1 on the USB device must present the following endpoints}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00282}00282 \textcolor{comment}{ *      1) Isochronous IN endpoint to receive SCO data}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00283}00283 \textcolor{comment}{ *      2) Isochronous OUT endpoint to send SCO data}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00284}00284 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00285}00285 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00286}\mbox{\hyperlink{ng__ubt_8c_a546f84ffc316d847b6e296a2d91ad3ff}{00286}} \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keyword}{struct }usb\_config          \mbox{\hyperlink{ng__ubt_8c_a546f84ffc316d847b6e296a2d91ad3ff}{ubt\_config}}[\mbox{\hyperlink{ng__ubt__var_8h_a61dadd085c1777f559549e05962b2c9ea8777288eff72531769533666f9c172eb}{UBT\_N\_TRANSFER}}] =}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00287}00287 \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00288}00288         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00289}00289 \textcolor{comment}{         * Interface \#0}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00290}00290 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00291}00291 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00292}00292         \textcolor{comment}{/* Outgoing bulk transfer -\/ ACL packets */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00293}00293         [\mbox{\hyperlink{ng__ubt__var_8h_a61dadd085c1777f559549e05962b2c9ea54ef09b34da75d4e15e9c763b31c481e}{UBT\_IF\_0\_BULK\_DT\_WR}}] = \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00294}00294                 .type =         UE\_BULK,}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00295}00295                 .endpoint =     UE\_ADDR\_ANY,}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00296}00296                 .direction =    UE\_DIR\_OUT,}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00297}00297                 .if\_index =     0,}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00298}00298                 .bufsize =      \mbox{\hyperlink{ng__ubt__var_8h_a73b4006054c40b9806148260fce130f5}{UBT\_BULK\_WRITE\_BUFFER\_SIZE}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00299}00299                 .flags =        \{ .pipe\_bof = 1, .force\_short\_xfer = 1, \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00300}00300                 .callback =     \&\mbox{\hyperlink{ng__ubt_8c_af1276a3b306e8b10188594e07cde1a8c}{ubt\_bulk\_write\_callback}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00301}00301         \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00302}00302         \textcolor{comment}{/* Incoming bulk transfer -\/ ACL packets */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00303}00303         [\mbox{\hyperlink{ng__ubt__var_8h_a61dadd085c1777f559549e05962b2c9ea699cc36ee9751921e6f2600df611811b}{UBT\_IF\_0\_BULK\_DT\_RD}}] = \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00304}00304                 .type =         UE\_BULK,}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00305}00305                 .endpoint =     UE\_ADDR\_ANY,}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00306}00306                 .direction =    UE\_DIR\_IN,}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00307}00307                 .if\_index =     0,}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00308}00308                 .bufsize =      \mbox{\hyperlink{ng__ubt__var_8h_a159541a04e1c87989df3cb351ecb1523}{UBT\_BULK\_READ\_BUFFER\_SIZE}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00309}00309                 .flags =        \{ .pipe\_bof = 1, .short\_xfer\_ok = 1, \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00310}00310                 .callback =     \&\mbox{\hyperlink{ng__ubt_8c_a2ff123c3c7491c5077789e57fa651478}{ubt\_bulk\_read\_callback}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00311}00311         \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00312}00312         \textcolor{comment}{/* Incoming interrupt transfer -\/ HCI events */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00313}00313         [\mbox{\hyperlink{ng__ubt__var_8h_a61dadd085c1777f559549e05962b2c9ea0f1828dcb63f2a0d21c5c5531b141cc4}{UBT\_IF\_0\_INTR\_DT\_RD}}] = \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00314}00314                 .type =         UE\_INTERRUPT,}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00315}00315                 .endpoint =     UE\_ADDR\_ANY,}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00316}00316                 .direction =    UE\_DIR\_IN,}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00317}00317                 .if\_index =     0,}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00318}00318                 .flags =        \{ .pipe\_bof = 1, .short\_xfer\_ok = 1, \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00319}00319                 .bufsize =      \mbox{\hyperlink{ng__ubt__var_8h_ab7168928d4f3757273c9f21c1829cf52}{UBT\_INTR\_BUFFER\_SIZE}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00320}00320                 .callback =     \&\mbox{\hyperlink{ng__ubt_8c_a9468c082e5b8cdc5bae70bf35c00c118}{ubt\_intr\_read\_callback}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00321}00321         \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00322}00322         \textcolor{comment}{/* Outgoing control transfer -\/ HCI commands */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00323}00323         [\mbox{\hyperlink{ng__ubt__var_8h_a61dadd085c1777f559549e05962b2c9ead939be12c55cf7a2c4bd55485eafb38a}{UBT\_IF\_0\_CTRL\_DT\_WR}}] = \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00324}00324                 .type =         UE\_CONTROL,}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00325}00325                 .endpoint =     0x00,   \textcolor{comment}{/* control pipe */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00326}00326                 .direction =    UE\_DIR\_ANY,}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00327}00327                 .if\_index =     0,}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00328}00328                 .bufsize =      \mbox{\hyperlink{ng__ubt__var_8h_aac7b3f8375b0701710602807ade5dd6f}{UBT\_CTRL\_BUFFER\_SIZE}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00329}00329                 .callback =     \&\mbox{\hyperlink{ng__ubt_8c_a8cfc1c20f4989015fbe8389f5eae08fa}{ubt\_ctrl\_write\_callback}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00330}00330                 .timeout =      5000,   \textcolor{comment}{/* 5 seconds */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00331}00331         \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00332}00332 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00333}00333         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00334}00334 \textcolor{comment}{         * Interface \#1}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00335}00335 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00336}00336 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00337}00337         \textcolor{comment}{/* Incoming isochronous transfer \#1 -\/ SCO packets */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00338}00338         [\mbox{\hyperlink{ng__ubt__var_8h_a61dadd085c1777f559549e05962b2c9ea846c125fbff157d33b79b8ddeafc7ebd}{UBT\_IF\_1\_ISOC\_DT\_RD1}}] = \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00339}00339                 .type =         UE\_ISOCHRONOUS,}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00340}00340                 .endpoint =     UE\_ADDR\_ANY,}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00341}00341                 .direction =    UE\_DIR\_IN,}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00342}00342                 .if\_index =     1,}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00343}00343                 .bufsize =      0,      \textcolor{comment}{/* use "{}wMaxPacketSize * frames"{} */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00344}00344                 .frames =       \mbox{\hyperlink{ng__ubt__var_8h_a456776343a40ed49368e2d75a280c31c}{UBT\_ISOC\_NFRAMES}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00345}00345                 .flags =        \{ .short\_xfer\_ok = 1, \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00346}00346                 .callback =     \&\mbox{\hyperlink{ng__ubt_8c_a10921286322e18fe5252f378b1256b20}{ubt\_isoc\_read\_callback}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00347}00347         \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00348}00348         \textcolor{comment}{/* Incoming isochronous transfer \#2 -\/ SCO packets */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00349}00349         [\mbox{\hyperlink{ng__ubt__var_8h_a61dadd085c1777f559549e05962b2c9eaa926c7178774761c3a526ec773aec39a}{UBT\_IF\_1\_ISOC\_DT\_RD2}}] = \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00350}00350                 .type =         UE\_ISOCHRONOUS,}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00351}00351                 .endpoint =     UE\_ADDR\_ANY,}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00352}00352                 .direction =    UE\_DIR\_IN,}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00353}00353                 .if\_index =     1,}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00354}00354                 .bufsize =      0,      \textcolor{comment}{/* use "{}wMaxPacketSize * frames"{} */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00355}00355                 .frames =       \mbox{\hyperlink{ng__ubt__var_8h_a456776343a40ed49368e2d75a280c31c}{UBT\_ISOC\_NFRAMES}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00356}00356                 .flags =        \{ .short\_xfer\_ok = 1, \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00357}00357                 .callback =     \&\mbox{\hyperlink{ng__ubt_8c_a10921286322e18fe5252f378b1256b20}{ubt\_isoc\_read\_callback}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00358}00358         \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00359}00359         \textcolor{comment}{/* Outgoing isochronous transfer \#1 -\/ SCO packets */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00360}00360         [\mbox{\hyperlink{ng__ubt__var_8h_a61dadd085c1777f559549e05962b2c9ea4954145b3b488d2a311a49a00151de0e}{UBT\_IF\_1\_ISOC\_DT\_WR1}}] = \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00361}00361                 .type =         UE\_ISOCHRONOUS,}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00362}00362                 .endpoint =     UE\_ADDR\_ANY,}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00363}00363                 .direction =    UE\_DIR\_OUT,}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00364}00364                 .if\_index =     1,}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00365}00365                 .bufsize =      0,      \textcolor{comment}{/* use "{}wMaxPacketSize * frames"{} */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00366}00366                 .frames =       \mbox{\hyperlink{ng__ubt__var_8h_a456776343a40ed49368e2d75a280c31c}{UBT\_ISOC\_NFRAMES}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00367}00367                 .flags =        \{ .short\_xfer\_ok = 1, \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00368}00368                 .callback =     \&\mbox{\hyperlink{ng__ubt_8c_af694eeb98e9e32de74102551f1129639}{ubt\_isoc\_write\_callback}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00369}00369         \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00370}00370         \textcolor{comment}{/* Outgoing isochronous transfer \#2 -\/ SCO packets */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00371}00371         [\mbox{\hyperlink{ng__ubt__var_8h_a61dadd085c1777f559549e05962b2c9eaff55cf95a954801b2d3bb08ed98c0e73}{UBT\_IF\_1\_ISOC\_DT\_WR2}}] = \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00372}00372                 .type =         UE\_ISOCHRONOUS,}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00373}00373                 .endpoint =     UE\_ADDR\_ANY,}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00374}00374                 .direction =    UE\_DIR\_OUT,}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00375}00375                 .if\_index =     1,}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00376}00376                 .bufsize =      0,      \textcolor{comment}{/* use "{}wMaxPacketSize * frames"{} */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00377}00377                 .frames =       \mbox{\hyperlink{ng__ubt__var_8h_a456776343a40ed49368e2d75a280c31c}{UBT\_ISOC\_NFRAMES}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00378}00378                 .flags =        \{ .short\_xfer\_ok = 1, \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00379}00379                 .callback =     \&\mbox{\hyperlink{ng__ubt_8c_af694eeb98e9e32de74102551f1129639}{ubt\_isoc\_write\_callback}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00380}00380         \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00381}00381 \};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00382}00382 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00383}00383 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00384}00384 \textcolor{comment}{ * If for some reason device should not be attached then put}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00385}00385 \textcolor{comment}{ * VendorID/ProductID pair into the list below. The format is}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00386}00386 \textcolor{comment}{ * as follows:}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00387}00387 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00388}00388 \textcolor{comment}{ *      \{ USB\_VPI(VENDOR\_ID, PRODUCT\_ID, 0) \},}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00389}00389 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00390}00390 \textcolor{comment}{ * where VENDOR\_ID and PRODUCT\_ID are hex numbers.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00391}00391 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00392}00392 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00393}\mbox{\hyperlink{ng__ubt_8c_a384888050ff3c166ae81ed588800c665}{00393}} \textcolor{keyword}{static} \textcolor{keyword}{const} STRUCT\_USB\_HOST\_ID \mbox{\hyperlink{ng__ubt_8c_a384888050ff3c166ae81ed588800c665}{ubt\_ignore\_devs}}[] = }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00394}00394 \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00395}00395         \textcolor{comment}{/* AVM USB Bluetooth-\/Adapter BlueFritz! v1.0 */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00396}00396         \{ USB\_VPI(USB\_VENDOR\_AVM, 0x2200, 0) \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00397}00397 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00398}00398         \textcolor{comment}{/* Atheros 3011 with sflash firmware */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00399}00399         \{ USB\_VPI(0x0cf3, 0x3002, 0) \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00400}00400         \{ USB\_VPI(0x0cf3, 0xe019, 0) \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00401}00401         \{ USB\_VPI(0x13d3, 0x3304, 0) \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00402}00402         \{ USB\_VPI(0x0930, 0x0215, 0) \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00403}00403         \{ USB\_VPI(0x0489, 0xe03d, 0) \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00404}00404         \{ USB\_VPI(0x0489, 0xe027, 0) \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00405}00405 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00406}00406         \textcolor{comment}{/* Atheros AR9285 Malbec with sflash firmware */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00407}00407         \{ USB\_VPI(0x03f0, 0x311d, 0) \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00408}00408 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00409}00409         \textcolor{comment}{/* Atheros 3012 with sflash firmware */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00410}00410         \{ USB\_VPI(0x0cf3, 0x3004, 0), USB\_DEV\_BCD\_LTEQ(1) \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00411}00411         \{ USB\_VPI(0x0cf3, 0x311d, 0), USB\_DEV\_BCD\_LTEQ(1) \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00412}00412         \{ USB\_VPI(0x13d3, 0x3375, 0), USB\_DEV\_BCD\_LTEQ(1) \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00413}00413         \{ USB\_VPI(0x04ca, 0x3005, 0), USB\_DEV\_BCD\_LTEQ(1) \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00414}00414         \{ USB\_VPI(0x04ca, 0x3006, 0), USB\_DEV\_BCD\_LTEQ(1) \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00415}00415         \{ USB\_VPI(0x04ca, 0x3008, 0), USB\_DEV\_BCD\_LTEQ(1) \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00416}00416         \{ USB\_VPI(0x13d3, 0x3362, 0), USB\_DEV\_BCD\_LTEQ(1) \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00417}00417         \{ USB\_VPI(0x0cf3, 0xe004, 0), USB\_DEV\_BCD\_LTEQ(1) \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00418}00418         \{ USB\_VPI(0x0930, 0x0219, 0), USB\_DEV\_BCD\_LTEQ(1) \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00419}00419         \{ USB\_VPI(0x0489, 0xe057, 0), USB\_DEV\_BCD\_LTEQ(1) \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00420}00420         \{ USB\_VPI(0x13d3, 0x3393, 0), USB\_DEV\_BCD\_LTEQ(1) \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00421}00421         \{ USB\_VPI(0x0489, 0xe04e, 0), USB\_DEV\_BCD\_LTEQ(1) \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00422}00422         \{ USB\_VPI(0x0489, 0xe056, 0), USB\_DEV\_BCD\_LTEQ(1) \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00423}00423 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00424}00424         \textcolor{comment}{/* Atheros AR5BBU12 with sflash firmware */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00425}00425         \{ USB\_VPI(0x0489, 0xe02c, 0), USB\_DEV\_BCD\_LTEQ(1) \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00426}00426 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00427}00427         \textcolor{comment}{/* Atheros AR5BBU12 with sflash firmware */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00428}00428         \{ USB\_VPI(0x0489, 0xe03c, 0), USB\_DEV\_BCD\_LTEQ(1) \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00429}00429         \{ USB\_VPI(0x0489, 0xe036, 0), USB\_DEV\_BCD\_LTEQ(1) \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00430}00430 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00431}00431         \textcolor{comment}{/* Intel Wireless controllers are handled in ng\_ubt\_intel.c */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00432}00432         \{ USB\_VPI(USB\_VENDOR\_INTEL2, 0x07dc, 0) \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00433}00433         \{ USB\_VPI(USB\_VENDOR\_INTEL2, 0x0a2a, 0) \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00434}00434         \{ USB\_VPI(USB\_VENDOR\_INTEL2, 0x0aa7, 0) \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00435}00435         \{ USB\_VPI(USB\_VENDOR\_INTEL2, 0x0a2b, 0) \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00436}00436         \{ USB\_VPI(USB\_VENDOR\_INTEL2, 0x0aaa, 0) \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00437}00437         \{ USB\_VPI(USB\_VENDOR\_INTEL2, 0x0025, 0) \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00438}00438         \{ USB\_VPI(USB\_VENDOR\_INTEL2, 0x0026, 0) \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00439}00439         \{ USB\_VPI(USB\_VENDOR\_INTEL2, 0x0029, 0) \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00440}00440 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00441}00441         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00442}00442 \textcolor{comment}{         * Some Intel controllers are not yet supported by ng\_ubt\_intel and}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00443}00443 \textcolor{comment}{         * should be ignored.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00444}00444 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00445}00445         \{ USB\_VPI(USB\_VENDOR\_INTEL2, 0x0032, 0) \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00446}00446         \{ USB\_VPI(USB\_VENDOR\_INTEL2, 0x0033, 0) \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00447}00447 \};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00448}00448 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00449}00449 \textcolor{comment}{/* List of supported bluetooth devices */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00450}\mbox{\hyperlink{ng__ubt_8c_a27dab7af037633d2ff4e204eb88bd670}{00450}} \textcolor{keyword}{static} \textcolor{keyword}{const} STRUCT\_USB\_HOST\_ID \mbox{\hyperlink{ng__ubt_8c_a27dab7af037633d2ff4e204eb88bd670}{ubt\_devs}}[] =}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00451}00451 \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00452}00452         \textcolor{comment}{/* Generic Bluetooth class devices */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00453}00453         \{ USB\_IFACE\_CLASS(UDCLASS\_WIRELESS),}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00454}00454           USB\_IFACE\_SUBCLASS(UDSUBCLASS\_RF),}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00455}00455           USB\_IFACE\_PROTOCOL(UDPROTO\_BLUETOOTH) \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00456}00456 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00457}00457         \textcolor{comment}{/* AVM USB Bluetooth-\/Adapter BlueFritz! v2.0 */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00458}00458         \{ USB\_VPI(USB\_VENDOR\_AVM, 0x3800, 0) \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00459}00459 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00460}00460         \textcolor{comment}{/* Broadcom USB dongles, mostly BCM20702 and BCM20702A0 */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00461}00461         \{ USB\_VENDOR(USB\_VENDOR\_BROADCOM),}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00462}00462           USB\_IFACE\_CLASS(UICLASS\_VENDOR),}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00463}00463           USB\_IFACE\_SUBCLASS(UDSUBCLASS\_RF),}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00464}00464           USB\_IFACE\_PROTOCOL(UDPROTO\_BLUETOOTH) \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00465}00465 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00466}00466         \textcolor{comment}{/* Apple-\/specific (Broadcom) devices */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00467}00467         \{ USB\_VENDOR(USB\_VENDOR\_APPLE),}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00468}00468           USB\_IFACE\_CLASS(UICLASS\_VENDOR),}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00469}00469           USB\_IFACE\_SUBCLASS(UDSUBCLASS\_RF),}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00470}00470           USB\_IFACE\_PROTOCOL(UDPROTO\_BLUETOOTH) \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00471}00471 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00472}00472         \textcolor{comment}{/* Foxconn -\/ Hon Hai */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00473}00473         \{ USB\_VENDOR(USB\_VENDOR\_FOXCONN),}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00474}00474           USB\_IFACE\_CLASS(UICLASS\_VENDOR),}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00475}00475           USB\_IFACE\_SUBCLASS(UDSUBCLASS\_RF),}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00476}00476           USB\_IFACE\_PROTOCOL(UDPROTO\_BLUETOOTH) \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00477}00477 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00478}00478         \textcolor{comment}{/* MediaTek MT76x0E */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00479}00479         \{ USB\_VPI(USB\_VENDOR\_MEDIATEK, 0x763f, 0) \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00480}00480 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00481}00481         \textcolor{comment}{/* Broadcom SoftSailing reporting vendor specific */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00482}00482         \{ USB\_VPI(USB\_VENDOR\_BROADCOM, 0x21e1, 0) \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00483}00483 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00484}00484         \textcolor{comment}{/* Apple MacBookPro 7,1 */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00485}00485         \{ USB\_VPI(USB\_VENDOR\_APPLE, 0x8213, 0) \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00486}00486 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00487}00487         \textcolor{comment}{/* Apple iMac11,1 */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00488}00488         \{ USB\_VPI(USB\_VENDOR\_APPLE, 0x8215, 0) \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00489}00489 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00490}00490         \textcolor{comment}{/* Apple MacBookPro6,2 */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00491}00491         \{ USB\_VPI(USB\_VENDOR\_APPLE, 0x8218, 0) \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00492}00492 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00493}00493         \textcolor{comment}{/* Apple MacBookAir3,1, MacBookAir3,2 */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00494}00494         \{ USB\_VPI(USB\_VENDOR\_APPLE, 0x821b, 0) \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00495}00495 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00496}00496         \textcolor{comment}{/* Apple MacBookAir4,1 */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00497}00497         \{ USB\_VPI(USB\_VENDOR\_APPLE, 0x821f, 0) \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00498}00498 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00499}00499         \textcolor{comment}{/* MacBookAir6,1 */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00500}00500         \{ USB\_VPI(USB\_VENDOR\_APPLE, 0x828f, 0) \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00501}00501 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00502}00502         \textcolor{comment}{/* Apple MacBookPro8,2 */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00503}00503         \{ USB\_VPI(USB\_VENDOR\_APPLE, 0x821a, 0) \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00504}00504 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00505}00505         \textcolor{comment}{/* Apple MacMini5,1 */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00506}00506         \{ USB\_VPI(USB\_VENDOR\_APPLE, 0x8281, 0) \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00507}00507 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00508}00508         \textcolor{comment}{/* Bluetooth Ultraport Module from IBM */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00509}00509         \{ USB\_VPI(USB\_VENDOR\_TDK, 0x030a, 0) \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00510}00510 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00511}00511         \textcolor{comment}{/* ALPS Modules with non-\/standard ID */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00512}00512         \{ USB\_VPI(USB\_VENDOR\_ALPS, 0x3001, 0) \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00513}00513         \{ USB\_VPI(USB\_VENDOR\_ALPS, 0x3002, 0) \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00514}00514 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00515}00515         \{ USB\_VPI(USB\_VENDOR\_ERICSSON2, 0x1002, 0) \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00516}00516 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00517}00517         \textcolor{comment}{/* Canyon CN-\/BTU1 with HID interfaces */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00518}00518         \{ USB\_VPI(USB\_VENDOR\_CANYON, 0x0000, 0) \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00519}00519 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00520}00520         \textcolor{comment}{/* Broadcom BCM20702A0 */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00521}00521         \{ USB\_VPI(USB\_VENDOR\_ASUS, 0x17b5, 0) \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00522}00522         \{ USB\_VPI(USB\_VENDOR\_ASUS, 0x17cb, 0) \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00523}00523         \{ USB\_VPI(USB\_VENDOR\_LITEON, 0x2003, 0) \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00524}00524         \{ USB\_VPI(USB\_VENDOR\_FOXCONN, 0xe042, 0) \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00525}00525         \{ USB\_VPI(USB\_VENDOR\_DELL, 0x8197, 0) \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00526}00526         \{ USB\_VPI(USB\_VENDOR\_BELKIN, 0x065a, 0) \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00527}00527 \};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00528}00528 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00529}00529 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00530}00530 \textcolor{comment}{ * Does a synchronous (waits for completion event) execution of HCI command.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00531}00531 \textcolor{comment}{ * Size of both command and response buffers are passed in length field of}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00532}00532 \textcolor{comment}{ * corresponding structures in "{}Parameter Total Length"{} format i.e.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00533}00533 \textcolor{comment}{ * not including HCI packet headers.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00534}00534 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00535}00535 \textcolor{comment}{ * Must not be used after USB transfers have been configured in attach routine.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00536}00536 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00537}00537 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00538}00538 usb\_error\_t}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00539}\mbox{\hyperlink{ng__ubt_8c_addef186e7181c37eb255bf87b1f66d4f}{00539}} \mbox{\hyperlink{ng__ubt_8c_addef186e7181c37eb255bf87b1f66d4f}{ubt\_do\_hci\_request}}(\textcolor{keyword}{struct} usb\_device *udev, \textcolor{keyword}{struct} \mbox{\hyperlink{structubt__hci__cmd}{ubt\_hci\_cmd}} *\mbox{\hyperlink{ng__pppoe_8h_adfc5ba7e22f5e4a6221c12a70503bef3}{cmd}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00540}00540     \textcolor{keywordtype}{void} *evt, usb\_timeout\_t timeout)}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00541}00541 \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00542}00542         \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keyword}{struct }usb\_config ubt\_probe\_config = \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00543}00543                 .type = UE\_INTERRUPT,}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00544}00544                 .endpoint = UE\_ADDR\_ANY,}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00545}00545                 .direction = UE\_DIR\_IN,}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00546}00546                 .flags = \{ .pipe\_bof = 1, .short\_xfer\_ok = 1 \},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00547}00547                 .bufsize = \mbox{\hyperlink{ng__ubt__var_8h_ab7168928d4f3757273c9f21c1829cf52}{UBT\_INTR\_BUFFER\_SIZE}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00548}00548                 .callback = \&\mbox{\hyperlink{ng__ubt_8c_a90d60caa3baeadf79e0414363a478121}{ubt\_probe\_intr\_callback}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00549}00549         \};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00550}00550         \textcolor{keyword}{struct }usb\_device\_request req;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00551}00551         \textcolor{keyword}{struct }usb\_xfer *xfer[1];}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00552}00552         \textcolor{keyword}{struct }mtx mtx;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00553}00553         usb\_error\_t error = USB\_ERR\_NORMAL\_COMPLETION;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00554}00554         uint8\_t iface\_index = 0;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00555}00555 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00556}00556         \textcolor{comment}{/* Initialize a USB control request and then do it */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00557}00557         bzero(\&req, \textcolor{keyword}{sizeof}(req));}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00558}00558         req.bmRequestType = \mbox{\hyperlink{ng__ubt__var_8h_a04c099f8fb42406107b8e464ac43c2e5}{UBT\_HCI\_REQUEST}};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00559}00559         req.wIndex[0] = iface\_index;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00560}00560         USETW(req.wLength, \mbox{\hyperlink{ng__ubt__var_8h_a13d6cc55c73fb81f6cea599fb92b6900}{UBT\_HCI\_CMD\_SIZE}}(\mbox{\hyperlink{ng__pppoe_8h_adfc5ba7e22f5e4a6221c12a70503bef3}{cmd}}));}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00561}00561 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00562}00562         error = usbd\_do\_request(udev, NULL, \&req, \mbox{\hyperlink{ng__pppoe_8h_adfc5ba7e22f5e4a6221c12a70503bef3}{cmd}});}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00563}00563         \textcolor{keywordflow}{if} (error != USB\_ERR\_NORMAL\_COMPLETION) \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00564}00564                 printf(\textcolor{stringliteral}{"{}ng\_ubt: usbd\_do\_request error=\%s\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00565}00565                         usbd\_errstr(error));}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00566}00566                 \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00567}00567         \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00568}00568 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00569}00569         \textcolor{keywordflow}{if} (evt == NULL)}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00570}00570                 \textcolor{keywordflow}{return} (USB\_ERR\_NORMAL\_COMPLETION);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00571}00571 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00572}00572         \textcolor{comment}{/* Initialize INTR endpoint xfer and wait for response */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00573}00573         mtx\_init(\&mtx, \textcolor{stringliteral}{"{}ubt pb"{}}, NULL, MTX\_DEF | MTX\_NEW);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00574}00574 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00575}00575         error = usbd\_transfer\_setup(udev, \&iface\_index, xfer,}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00576}00576             \&ubt\_probe\_config, 1, evt, \&mtx);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00577}00577         \textcolor{keywordflow}{if} (error == USB\_ERR\_NORMAL\_COMPLETION) \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00578}00578                 mtx\_lock(\&mtx);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00579}00579                 usbd\_transfer\_start(*xfer);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00580}00580 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00581}00581                 \textcolor{keywordflow}{if} (msleep\_sbt(evt, \&mtx, 0, \textcolor{stringliteral}{"{}ubt pb"{}}, SBT\_1MS * timeout,}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00582}00582                                 0, C\_HARDCLOCK) == EWOULDBLOCK) \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00583}00583                         printf(\textcolor{stringliteral}{"{}ng\_ubt: HCI command 0x\%04x timed out\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00584}00584                                 le16toh(\mbox{\hyperlink{ng__pppoe_8h_adfc5ba7e22f5e4a6221c12a70503bef3}{cmd}}-\/>opcode));}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00585}00585                         error = USB\_ERR\_TIMEOUT;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00586}00586                 \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00587}00587 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00588}00588                 usbd\_transfer\_stop(*xfer);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00589}00589                 mtx\_unlock(\&mtx);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00590}00590 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00591}00591                 usbd\_transfer\_unsetup(xfer, 1);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00592}00592         \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00593}00593                 printf(\textcolor{stringliteral}{"{}ng\_ubt: usbd\_transfer\_setup error=\%s\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00594}00594                         usbd\_errstr(error));}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00595}00595 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00596}00596         mtx\_destroy(\&mtx);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00597}00597 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00598}00598         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00599}00599 \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00600}00600 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00601}00601 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00602}00602 \textcolor{comment}{ * Probe for a USB Bluetooth device.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00603}00603 \textcolor{comment}{ * USB context.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00604}00604 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00605}00605 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00606}00606 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00607}\mbox{\hyperlink{ng__ubt_8c_a26839410e2892c678aff49f7148db516}{00607}} \mbox{\hyperlink{ng__ubt_8c_ad03d0b0a01b86016c25a80a189d2a9cf}{ubt\_probe}}(device\_t dev)}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00608}00608 \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00609}00609         \textcolor{keyword}{struct }usb\_attach\_arg   *uaa = device\_get\_ivars(dev);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00610}00610         \textcolor{keywordtype}{int} error;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00611}00611 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00612}00612         \textcolor{keywordflow}{if} (uaa-\/>usb\_mode != USB\_MODE\_HOST)}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00613}00613                 \textcolor{keywordflow}{return} (ENXIO);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00614}00614 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00615}00615         \textcolor{keywordflow}{if} (uaa-\/>info.bIfaceIndex != 0)}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00616}00616                 \textcolor{keywordflow}{return} (ENXIO);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00617}00617 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00618}00618         \textcolor{keywordflow}{if} (usbd\_lookup\_id\_by\_uaa(\mbox{\hyperlink{ng__ubt_8c_a384888050ff3c166ae81ed588800c665}{ubt\_ignore\_devs}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00619}00619                         \textcolor{keyword}{sizeof}(\mbox{\hyperlink{ng__ubt_8c_a384888050ff3c166ae81ed588800c665}{ubt\_ignore\_devs}}), uaa) == 0)}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00620}00620                 \textcolor{keywordflow}{return} (ENXIO);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00621}00621 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00622}00622         error = usbd\_lookup\_id\_by\_uaa(\mbox{\hyperlink{ng__ubt_8c_a27dab7af037633d2ff4e204eb88bd670}{ubt\_devs}}, \textcolor{keyword}{sizeof}(\mbox{\hyperlink{ng__ubt_8c_a27dab7af037633d2ff4e204eb88bd670}{ubt\_devs}}), uaa);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00623}00623         \textcolor{keywordflow}{if} (error == 0)}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00624}00624                 \textcolor{keywordflow}{return} (BUS\_PROBE\_GENERIC);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00625}00625         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00626}00626 \} \textcolor{comment}{/* ubt\_probe */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00627}00627 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00628}00628 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00629}00629 \textcolor{comment}{ * Attach the device.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00630}00630 \textcolor{comment}{ * USB context.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00631}00631 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00632}00632 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00633}00633 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00634}\mbox{\hyperlink{ng__ubt_8c_a787abbda710d8c13d39f4b6fab025bf6}{00634}} \mbox{\hyperlink{ng__ubt_8c_a4a6250ade8d193ca25789e46415a2756}{ubt\_attach}}(device\_t dev)}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00635}00635 \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00636}00636         \textcolor{keyword}{struct }usb\_attach\_arg           *uaa = device\_get\_ivars(dev);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00637}00637         \textcolor{keyword}{struct }\mbox{\hyperlink{structubt__softc}{ubt\_softc}}               *sc = device\_get\_softc(dev);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00638}00638         \textcolor{keyword}{struct }usb\_endpoint\_descriptor  *ed;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00639}00639         \textcolor{keyword}{struct }usb\_interface\_descriptor *\mbox{\hyperlink{netflow__v9_8h_a4fc3a0c58dfbd1e68224521185cb9384}{id}};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00640}00640         \textcolor{keyword}{struct }usb\_interface            *iface;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00641}00641         uint32\_t                        wMaxPacketSize;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00642}00642         uint8\_t                         alt\_index, i, j;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00643}00643         uint8\_t                         iface\_index[2] = \{ 0, 1 \};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00644}00644 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00645}00645         device\_set\_usb\_desc(dev);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00646}00646 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00647}00647         sc-\/>\mbox{\hyperlink{structubt__softc_ab8e50013bddb8bf6847cba8931c78e56}{sc\_dev}} = dev;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00648}00648         sc-\/>\mbox{\hyperlink{structubt__softc_a4e4b230c8afcafa3e606b685f972bcd2}{sc\_debug}} = \mbox{\hyperlink{ng__ubt_8h_a17974533755cb83297fad7f9efdbd4a7}{NG\_UBT\_WARN\_LEVEL}};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00649}00649 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00650}00650         \textcolor{comment}{/* }}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00651}00651 \textcolor{comment}{         * Create Netgraph node}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00652}00652 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00653}00653 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00654}00654         \textcolor{keywordflow}{if} (\mbox{\hyperlink{netgraph_8h_aba2cbbfc891d71bd283ce2368c8392db}{ng\_make\_node\_common}}(\&\mbox{\hyperlink{ng__ubt_8c_a80a131770518c7fa3758d85054006e7a}{typestruct}}, \&sc-\/>\mbox{\hyperlink{structubt__softc_a7e1f49116313472c608ce39ea63783c3}{sc\_node}}) != 0) \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00655}00655                 \mbox{\hyperlink{ng__ubt__var_8h_a0223e6584b95646f0296b9c1837904fb}{UBT\_ALERT}}(sc, \textcolor{stringliteral}{"{}could not create Netgraph node\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00656}00656                 \textcolor{keywordflow}{return} (ENXIO);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00657}00657         \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00658}00658 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00659}00659         \textcolor{comment}{/* Name Netgraph node */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00660}00660         \textcolor{keywordflow}{if} (\mbox{\hyperlink{netgraph_8h_abae5851c9f312eebd398b1cd085fe067}{ng\_name\_node}}(sc-\/>\mbox{\hyperlink{structubt__softc_a7e1f49116313472c608ce39ea63783c3}{sc\_node}}, device\_get\_nameunit(dev)) != 0) \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00661}00661                 \mbox{\hyperlink{ng__ubt__var_8h_a0223e6584b95646f0296b9c1837904fb}{UBT\_ALERT}}(sc, \textcolor{stringliteral}{"{}could not name Netgraph node\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00662}00662                 \mbox{\hyperlink{netgraph_8h_a7e3862fa34646a9c66c9b02ac5383d1a}{NG\_NODE\_UNREF}}(sc-\/>\mbox{\hyperlink{structubt__softc_a7e1f49116313472c608ce39ea63783c3}{sc\_node}});}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00663}00663                 \textcolor{keywordflow}{return} (ENXIO);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00664}00664         \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00665}00665         \mbox{\hyperlink{netgraph_8h_a674a9dcfdef6a73d16cccde37234f470}{NG\_NODE\_SET\_PRIVATE}}(sc-\/>\mbox{\hyperlink{structubt__softc_a7e1f49116313472c608ce39ea63783c3}{sc\_node}}, sc);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00666}00666         \mbox{\hyperlink{netgraph_8h_a6d4c43ac57be8e504d3e071346416153}{NG\_NODE\_FORCE\_WRITER}}(sc-\/>\mbox{\hyperlink{structubt__softc_a7e1f49116313472c608ce39ea63783c3}{sc\_node}});}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00667}00667 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00668}00668         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00669}00669 \textcolor{comment}{         * Initialize device softc structure}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00670}00670 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00671}00671 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00672}00672         \textcolor{comment}{/* initialize locks */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00673}00673         mtx\_init(\&sc-\/>\mbox{\hyperlink{structubt__softc_a836aeaac9447307e3b6dfc6c40ad12c3}{sc\_ng\_mtx}}, \textcolor{stringliteral}{"{}ubt ng"{}}, NULL, MTX\_DEF);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00674}00674         mtx\_init(\&sc-\/>\mbox{\hyperlink{structubt__softc_a3db86e695ced0f0746113f01e600d8c2}{sc\_if\_mtx}}, \textcolor{stringliteral}{"{}ubt if"{}}, NULL, MTX\_DEF | MTX\_RECURSE);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00675}00675 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00676}00676         \textcolor{comment}{/* initialize packet queues */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00677}00677         \mbox{\hyperlink{ng__bluetooth_8h_a2ed0c2392e5e6712e99b178aacad369b}{NG\_BT\_MBUFQ\_INIT}}(\&sc-\/>\mbox{\hyperlink{structubt__softc_a5e4b6430054706f547499884f2ae05ff}{sc\_cmdq}}, \mbox{\hyperlink{ng__ubt__var_8h_a77e0a79af22888d5723704e1be37f13d}{UBT\_DEFAULT\_QLEN}});}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00678}00678         \mbox{\hyperlink{ng__bluetooth_8h_a2ed0c2392e5e6712e99b178aacad369b}{NG\_BT\_MBUFQ\_INIT}}(\&sc-\/>\mbox{\hyperlink{structubt__softc_a7dc6ede6d989cf54430b4acb5df5ca55}{sc\_aclq}}, \mbox{\hyperlink{ng__ubt__var_8h_a77e0a79af22888d5723704e1be37f13d}{UBT\_DEFAULT\_QLEN}});}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00679}00679         \mbox{\hyperlink{ng__bluetooth_8h_a2ed0c2392e5e6712e99b178aacad369b}{NG\_BT\_MBUFQ\_INIT}}(\&sc-\/>\mbox{\hyperlink{structubt__softc_a35dfa933a0465ef112d4b0b35226acba}{sc\_scoq}}, \mbox{\hyperlink{ng__ubt__var_8h_a77e0a79af22888d5723704e1be37f13d}{UBT\_DEFAULT\_QLEN}});}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00680}00680 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00681}00681         \textcolor{comment}{/* initialize glue task */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00682}00682         TASK\_INIT(\&sc-\/>\mbox{\hyperlink{structubt__softc_a029e03eba4280a0e70361622de3c18ec}{sc\_task}}, 0, \mbox{\hyperlink{ng__ubt_8c_a07664a30e5ce5a89597e6db805c971ba}{ubt\_task}}, sc);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00683}00683 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00684}00684         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00685}00685 \textcolor{comment}{         * Configure Bluetooth USB device. Discover all required USB}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00686}00686 \textcolor{comment}{         * interfaces and endpoints.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00687}00687 \textcolor{comment}{         *}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00688}00688 \textcolor{comment}{         * USB device must present two interfaces:}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00689}00689 \textcolor{comment}{         * 1) Interface 0 that has 3 endpoints}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00690}00690 \textcolor{comment}{         *      1) Interrupt endpoint to receive HCI events}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00691}00691 \textcolor{comment}{         *      2) Bulk IN endpoint to receive ACL data}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00692}00692 \textcolor{comment}{         *      3) Bulk OUT endpoint to send ACL data}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00693}00693 \textcolor{comment}{         *}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00694}00694 \textcolor{comment}{         * 2) Interface 1 then has 2 endpoints}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00695}00695 \textcolor{comment}{         *      1) Isochronous IN endpoint to receive SCO data}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00696}00696 \textcolor{comment}{         *      2) Isochronous OUT endpoint to send SCO data}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00697}00697 \textcolor{comment}{         *}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00698}00698 \textcolor{comment}{         * Interface 1 (with isochronous endpoints) has several alternate}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00699}00699 \textcolor{comment}{         * configurations with different packet size.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00700}00700 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00701}00701 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00702}00702         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00703}00703 \textcolor{comment}{         * For interface \#1 search alternate settings, and find}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00704}00704 \textcolor{comment}{         * the descriptor with the largest wMaxPacketSize}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00705}00705 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00706}00706 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00707}00707         wMaxPacketSize = 0;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00708}00708         alt\_index = 0;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00709}00709         i = 0;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00710}00710         j = 0;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00711}00711         ed = NULL;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00712}00712 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00713}00713         \textcolor{comment}{/* }}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00714}00714 \textcolor{comment}{         * Search through all the descriptors looking for the largest}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00715}00715 \textcolor{comment}{         * packet size:}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00716}00716 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00717}00717         \textcolor{keywordflow}{while} ((ed = (\textcolor{keyword}{struct} usb\_endpoint\_descriptor *)usb\_desc\_foreach(}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00718}00718             usbd\_get\_config\_descriptor(uaa-\/>device), }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00719}00719             (\textcolor{keyword}{struct} usb\_descriptor *)ed))) \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00720}00720                 \textcolor{keywordflow}{if} ((ed-\/>bDescriptorType == UDESC\_INTERFACE) \&\&}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00721}00721                     (ed-\/>bLength >= \textcolor{keyword}{sizeof}(*\textcolor{keywordtype}{id}))) \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00722}00722                         \textcolor{keywordtype}{id} = (\textcolor{keyword}{struct }usb\_interface\_descriptor *)ed;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00723}00723                         i = \textcolor{keywordtype}{id}-\/>bInterfaceNumber;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00724}00724                         j = \textcolor{keywordtype}{id}-\/>bAlternateSetting;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00725}00725                 \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00726}00726 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00727}00727                 \textcolor{keywordflow}{if} ((ed-\/>bDescriptorType == UDESC\_ENDPOINT) \&\&}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00728}00728                     (ed-\/>bLength >= \textcolor{keyword}{sizeof}(*ed)) \&\&}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00729}00729                     (i == 1)) \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00730}00730                         uint32\_t temp;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00731}00731 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00732}00732                         temp = usbd\_get\_max\_frame\_length(}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00733}00733                             ed, NULL, usbd\_get\_speed(uaa-\/>device));}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00734}00734                         \textcolor{keywordflow}{if} (temp > wMaxPacketSize) \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00735}00735                                 wMaxPacketSize = temp;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00736}00736                                 alt\_index = j;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00737}00737                         \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00738}00738                 \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00739}00739         \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00740}00740 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00741}00741         \textcolor{comment}{/* Set alt configuration on interface \#1 only if we found it */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00742}00742         \textcolor{keywordflow}{if} (wMaxPacketSize > 0 \&\&}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00743}00743             usbd\_set\_alt\_interface\_index(uaa-\/>device, 1, alt\_index)) \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00744}00744                 \mbox{\hyperlink{ng__ubt__var_8h_a0223e6584b95646f0296b9c1837904fb}{UBT\_ALERT}}(sc, \textcolor{stringliteral}{"{}could not set alternate setting \%d "{}} \(\backslash\)}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00745}00745                         \textcolor{stringliteral}{"{}for interface 1!\(\backslash\)n"{}}, alt\_index);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00746}00746                 \textcolor{keywordflow}{goto} detach;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00747}00747         \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00748}00748 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00749}00749         \textcolor{comment}{/* Setup transfers for both interfaces */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00750}00750         \textcolor{keywordflow}{if} (usbd\_transfer\_setup(uaa-\/>device, iface\_index, sc-\/>\mbox{\hyperlink{structubt__softc_a08c8cedc6e8f88396c00e0667ecbcc57}{sc\_xfer}}, \mbox{\hyperlink{ng__ubt_8c_a546f84ffc316d847b6e296a2d91ad3ff}{ubt\_config}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00751}00751                         \mbox{\hyperlink{ng__ubt_8c_a9ffe035b8ab79eb7d4cd41f9559499dc}{ng\_usb\_isoc\_enable}} ? \mbox{\hyperlink{ng__ubt__var_8h_a61dadd085c1777f559549e05962b2c9ea8777288eff72531769533666f9c172eb}{UBT\_N\_TRANSFER}} : \mbox{\hyperlink{ng__ubt__var_8h_a61dadd085c1777f559549e05962b2c9ea846c125fbff157d33b79b8ddeafc7ebd}{UBT\_IF\_1\_ISOC\_DT\_RD1}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00752}00752                         sc, \&sc-\/>\mbox{\hyperlink{structubt__softc_a3db86e695ced0f0746113f01e600d8c2}{sc\_if\_mtx}})) \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00753}00753                 \mbox{\hyperlink{ng__ubt__var_8h_a0223e6584b95646f0296b9c1837904fb}{UBT\_ALERT}}(sc, \textcolor{stringliteral}{"{}could not allocate transfers\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00754}00754                 \textcolor{keywordflow}{goto} detach;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00755}00755         \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00756}00756 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00757}00757         \textcolor{comment}{/* Claim all interfaces belonging to the Bluetooth part */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00758}00758         \textcolor{keywordflow}{for} (i = 1;; i++) \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00759}00759                 iface = usbd\_get\_iface(uaa-\/>device, i);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00760}00760                 \textcolor{keywordflow}{if} (iface == NULL)}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00761}00761                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00762}00762                 \textcolor{keywordtype}{id} = usbd\_get\_interface\_descriptor(iface);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00763}00763 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00764}00764                 \textcolor{keywordflow}{if} ((\textcolor{keywordtype}{id} != NULL) \&\&}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00765}00765                     (\mbox{\hyperlink{netflow__v9_8h_a4fc3a0c58dfbd1e68224521185cb9384}{id}}-\/>bInterfaceClass == UICLASS\_WIRELESS) \&\&}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00766}00766                     (\mbox{\hyperlink{netflow__v9_8h_a4fc3a0c58dfbd1e68224521185cb9384}{id}}-\/>bInterfaceSubClass == UISUBCLASS\_RF) \&\&}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00767}00767                     (\mbox{\hyperlink{netflow__v9_8h_a4fc3a0c58dfbd1e68224521185cb9384}{id}}-\/>bInterfaceProtocol == UIPROTO\_BLUETOOTH)) \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00768}00768                         usbd\_set\_parent\_iface(uaa-\/>device, i,}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00769}00769                             uaa-\/>info.bIfaceIndex);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00770}00770                 \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00771}00771         \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00772}00772         \textcolor{keywordflow}{return} (0); \textcolor{comment}{/* success */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00773}00773 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00774}00774 detach:}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00775}00775         \mbox{\hyperlink{ng__ubt_8c_a0807ce14484285543ed8184c65217f7f}{ubt\_detach}}(dev);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00776}00776 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00777}00777         \textcolor{keywordflow}{return} (ENXIO);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00778}00778 \} \textcolor{comment}{/* ubt\_attach */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00779}00779 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00780}00780 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00781}00781 \textcolor{comment}{ * Detach the device.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00782}00782 \textcolor{comment}{ * USB context.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00783}00783 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00784}00784 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00785}00785 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00786}\mbox{\hyperlink{ng__ubt_8c_afdd3cc21dddde20c32eff76d59387948}{00786}} \mbox{\hyperlink{ng__ubt_8c_a0807ce14484285543ed8184c65217f7f}{ubt\_detach}}(device\_t dev)}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00787}00787 \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00788}00788         \textcolor{keyword}{struct }\mbox{\hyperlink{structubt__softc}{ubt\_softc}}       *sc = device\_get\_softc(dev);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00789}00789         \mbox{\hyperlink{structng__node}{node\_p}}                    node = sc-\/>\mbox{\hyperlink{structubt__softc_a7e1f49116313472c608ce39ea63783c3}{sc\_node}};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00790}00790 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00791}00791         \textcolor{comment}{/* Destroy Netgraph node */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00792}00792         \textcolor{keywordflow}{if} (node != NULL) \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00793}00793                 sc-\/>\mbox{\hyperlink{structubt__softc_a7e1f49116313472c608ce39ea63783c3}{sc\_node}} = NULL;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00794}00794                 \mbox{\hyperlink{netgraph_8h_aa97caec60fe3552a79e2b9ade6cec6d5}{NG\_NODE\_REALLY\_DIE}}(node);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00795}00795                 \mbox{\hyperlink{netgraph_8h_a85914ce0da2b314478aaf7efcdcd3ff0}{ng\_rmnode\_self}}(node);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00796}00796         \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00797}00797 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00798}00798         \textcolor{comment}{/* Make sure ubt\_task in gone */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00799}00799         taskqueue\_drain(taskqueue\_swi, \&sc-\/>\mbox{\hyperlink{structubt__softc_a029e03eba4280a0e70361622de3c18ec}{sc\_task}});}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00800}00800 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00801}00801         \textcolor{comment}{/* Free USB transfers, if any */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00802}00802         usbd\_transfer\_unsetup(sc-\/>\mbox{\hyperlink{structubt__softc_a08c8cedc6e8f88396c00e0667ecbcc57}{sc\_xfer}}, \mbox{\hyperlink{ng__ubt__var_8h_a61dadd085c1777f559549e05962b2c9ea8777288eff72531769533666f9c172eb}{UBT\_N\_TRANSFER}});}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00803}00803 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00804}00804         \textcolor{comment}{/* Destroy queues */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00805}00805         \mbox{\hyperlink{ng__ubt__var_8h_a8a12b94a49c10664d782068bf9b23604}{UBT\_NG\_LOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00806}00806         \mbox{\hyperlink{ng__bluetooth_8h_a8f6edd770ab064299e3e13987a5934a2}{NG\_BT\_MBUFQ\_DESTROY}}(\&sc-\/>\mbox{\hyperlink{structubt__softc_a5e4b6430054706f547499884f2ae05ff}{sc\_cmdq}});}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00807}00807         \mbox{\hyperlink{ng__bluetooth_8h_a8f6edd770ab064299e3e13987a5934a2}{NG\_BT\_MBUFQ\_DESTROY}}(\&sc-\/>\mbox{\hyperlink{structubt__softc_a7dc6ede6d989cf54430b4acb5df5ca55}{sc\_aclq}});}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00808}00808         \mbox{\hyperlink{ng__bluetooth_8h_a8f6edd770ab064299e3e13987a5934a2}{NG\_BT\_MBUFQ\_DESTROY}}(\&sc-\/>\mbox{\hyperlink{structubt__softc_a35dfa933a0465ef112d4b0b35226acba}{sc\_scoq}});}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00809}00809         \mbox{\hyperlink{ng__ubt__var_8h_a1bff5f8c5b576b7fc8457daa9dbf876c}{UBT\_NG\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00810}00810 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00811}00811         mtx\_destroy(\&sc-\/>\mbox{\hyperlink{structubt__softc_a3db86e695ced0f0746113f01e600d8c2}{sc\_if\_mtx}});}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00812}00812         mtx\_destroy(\&sc-\/>\mbox{\hyperlink{structubt__softc_a836aeaac9447307e3b6dfc6c40ad12c3}{sc\_ng\_mtx}});}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00813}00813 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00814}00814         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00815}00815 \} \textcolor{comment}{/* ubt\_detach */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00816}00816 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00817}00817 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00818}00818 \textcolor{comment}{ * Called when incoming interrupt transfer (HCI event) has completed, i.e.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00819}00819 \textcolor{comment}{ * HCI event was received from the device during device probe stage.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00820}00820 \textcolor{comment}{ * USB context.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00821}00821 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00822}00822 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00823}00823 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00824}\mbox{\hyperlink{ng__ubt_8c_a277f9620e5d8e0d1b8c66ede52c926fc}{00824}} \mbox{\hyperlink{ng__ubt_8c_a90d60caa3baeadf79e0414363a478121}{ubt\_probe\_intr\_callback}}(\textcolor{keyword}{struct} usb\_xfer *xfer, usb\_error\_t error)}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00825}00825 \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00826}00826         \textcolor{keyword}{struct }\mbox{\hyperlink{structubt__hci__event}{ubt\_hci\_event}}       *evt = usbd\_xfer\_softc(xfer);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00827}00827         \textcolor{keyword}{struct }usb\_page\_cache   *pc;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00828}00828         \textcolor{keywordtype}{int}                     actlen;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00829}00829 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00830}00830         usbd\_xfer\_status(xfer, \&actlen, NULL, NULL, NULL);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00831}00831 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00832}00832         \textcolor{keywordflow}{switch} (USB\_GET\_STATE(xfer)) \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00833}00833         \textcolor{keywordflow}{case} USB\_ST\_TRANSFERRED:}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00834}00834                 \textcolor{keywordflow}{if} (actlen > \mbox{\hyperlink{ng__ubt__var_8h_aaa185069eefebb50ad900187c1a218e5}{UBT\_HCI\_EVENT\_SIZE}}(evt))}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00835}00835                         actlen = \mbox{\hyperlink{ng__ubt__var_8h_aaa185069eefebb50ad900187c1a218e5}{UBT\_HCI\_EVENT\_SIZE}}(evt);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00836}00836                 pc = usbd\_xfer\_get\_frame(xfer, 0);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00837}00837                 usbd\_copy\_out(pc, 0, evt, actlen);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00838}00838                 \textcolor{comment}{/* OneShot mode */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00839}00839                 wakeup(evt);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00840}00840                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00841}00841 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00842}00842         \textcolor{keywordflow}{case} USB\_ST\_SETUP:}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00843}00843 submit\_next:}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00844}00844                 usbd\_xfer\_set\_frame\_len(xfer, 0, usbd\_xfer\_max\_len(xfer));}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00845}00845                 usbd\_transfer\_submit(xfer);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00846}00846                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00847}00847 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00848}00848         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00849}00849                 \textcolor{keywordflow}{if} (error != USB\_ERR\_CANCELLED) \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00850}00850                         printf(\textcolor{stringliteral}{"{}ng\_ubt: interrupt transfer failed: \%s\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00851}00851                                 usbd\_errstr(error));}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00852}00852                         \textcolor{comment}{/* Try clear stall first */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00853}00853                         usbd\_xfer\_set\_stall(xfer);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00854}00854                         \textcolor{keywordflow}{goto} submit\_next;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00855}00855                 \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00856}00856                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00857}00857         \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00858}00858 \} \textcolor{comment}{/* ubt\_probe\_intr\_callback */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00859}00859 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00860}00860 \textcolor{comment}{/* }}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00861}00861 \textcolor{comment}{ * Called when outgoing control request (HCI command) has completed, i.e.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00862}00862 \textcolor{comment}{ * HCI command was sent to the device.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00863}00863 \textcolor{comment}{ * USB context.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00864}00864 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00865}00865 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00866}00866 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00867}\mbox{\hyperlink{ng__ubt_8c_ad446925d5c6b23258e00ab21b9e19f12}{00867}} \mbox{\hyperlink{ng__ubt_8c_a8cfc1c20f4989015fbe8389f5eae08fa}{ubt\_ctrl\_write\_callback}}(\textcolor{keyword}{struct} usb\_xfer *xfer, usb\_error\_t error)}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00868}00868 \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00869}00869         \textcolor{keyword}{struct }\mbox{\hyperlink{structubt__softc}{ubt\_softc}}               *sc = usbd\_xfer\_softc(xfer);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00870}00870         \textcolor{keyword}{struct }usb\_device\_request       req;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00871}00871         \textcolor{keyword}{struct }mbuf                     *m;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00872}00872         \textcolor{keyword}{struct }usb\_page\_cache           *pc;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00873}00873         \textcolor{keywordtype}{int}                             actlen;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00874}00874 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00875}00875         usbd\_xfer\_status(xfer, \&actlen, NULL, NULL, NULL);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00876}00876 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00877}00877         \textcolor{keywordflow}{switch} (USB\_GET\_STATE(xfer)) \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00878}00878         \textcolor{keywordflow}{case} USB\_ST\_TRANSFERRED:}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00879}00879                 \mbox{\hyperlink{ng__ubt__var_8h_a5157c1b8b77845750545d5dee365f846}{UBT\_INFO}}(sc, \textcolor{stringliteral}{"{}sent \%d bytes to control pipe\(\backslash\)n"{}}, actlen);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00880}00880                 \mbox{\hyperlink{ng__ubt__var_8h_ae8cf496e05c4037b4ae02bfa24d41607}{UBT\_STAT\_BYTES\_SENT}}(sc, actlen);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00881}00881                 \mbox{\hyperlink{ng__ubt__var_8h_a7a851f7066cf3178b0d8e94ebdd2123e}{UBT\_STAT\_PCKTS\_SENT}}(sc);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00882}00882                 \textcolor{comment}{/* FALLTHROUGH */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00883}00883 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00884}00884         \textcolor{keywordflow}{case} USB\_ST\_SETUP:}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00885}00885 send\_next:}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00886}00886                 \textcolor{comment}{/* Get next command mbuf, if any */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00887}00887                 \mbox{\hyperlink{ng__ubt__var_8h_a8a12b94a49c10664d782068bf9b23604}{UBT\_NG\_LOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00888}00888                 \mbox{\hyperlink{ng__bluetooth_8h_a09b2f032f3cbca13246f7fada8c5eae2}{NG\_BT\_MBUFQ\_DEQUEUE}}(\&sc-\/>\mbox{\hyperlink{structubt__softc_a5e4b6430054706f547499884f2ae05ff}{sc\_cmdq}}, m);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00889}00889                 \mbox{\hyperlink{ng__ubt__var_8h_a1bff5f8c5b576b7fc8457daa9dbf876c}{UBT\_NG\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00890}00890 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00891}00891                 \textcolor{keywordflow}{if} (m == NULL) \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00892}00892                         \mbox{\hyperlink{ng__ubt__var_8h_a5157c1b8b77845750545d5dee365f846}{UBT\_INFO}}(sc, \textcolor{stringliteral}{"{}HCI command queue is empty\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00893}00893                         \textcolor{keywordflow}{break};  \textcolor{comment}{/* transfer complete */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00894}00894                 \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00895}00895 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00896}00896                 \textcolor{comment}{/* Initialize a USB control request and then schedule it */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00897}00897                 bzero(\&req, \textcolor{keyword}{sizeof}(req));}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00898}00898                 req.bmRequestType = \mbox{\hyperlink{ng__ubt__var_8h_a04c099f8fb42406107b8e464ac43c2e5}{UBT\_HCI\_REQUEST}};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00899}00899                 USETW(req.wLength, m-\/>m\_pkthdr.len);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00900}00900 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00901}00901                 \mbox{\hyperlink{ng__ubt__var_8h_a5157c1b8b77845750545d5dee365f846}{UBT\_INFO}}(sc, \textcolor{stringliteral}{"{}Sending control request, "{}} \(\backslash\)}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00902}00902                         \textcolor{stringliteral}{"{}bmRequestType=0x\%02x, wLength=\%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00903}00903                         req.bmRequestType, UGETW(req.wLength));}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00904}00904 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00905}00905                 pc = usbd\_xfer\_get\_frame(xfer, 0);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00906}00906                 usbd\_copy\_in(pc, 0, \&req, \textcolor{keyword}{sizeof}(req));}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00907}00907                 pc = usbd\_xfer\_get\_frame(xfer, 1);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00908}00908                 usbd\_m\_copy\_in(pc, 0, m, 0, m-\/>m\_pkthdr.len);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00909}00909 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00910}00910                 usbd\_xfer\_set\_frame\_len(xfer, 0, \textcolor{keyword}{sizeof}(req));}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00911}00911                 usbd\_xfer\_set\_frame\_len(xfer, 1, m-\/>m\_pkthdr.len);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00912}00912                 usbd\_xfer\_set\_frames(xfer, 2);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00913}00913 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00914}00914                 \mbox{\hyperlink{netgraph_8h_a2461bfcdc9e024484ed8037d386620e3}{NG\_FREE\_M}}(m);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00915}00915 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00916}00916                 usbd\_transfer\_submit(xfer);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00917}00917                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00918}00918 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00919}00919         \textcolor{keywordflow}{default}: \textcolor{comment}{/* Error */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00920}00920                 \textcolor{keywordflow}{if} (error != USB\_ERR\_CANCELLED) \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00921}00921                         \mbox{\hyperlink{ng__ubt__var_8h_af199de836b33c121c82d41fad27c4e00}{UBT\_WARN}}(sc, \textcolor{stringliteral}{"{}control transfer failed: \%s\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00922}00922                                 usbd\_errstr(error));}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00923}00923 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00924}00924                         \mbox{\hyperlink{ng__ubt__var_8h_a898215196764bfcb75c5e9cecc9265d2}{UBT\_STAT\_OERROR}}(sc);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00925}00925                         \textcolor{keywordflow}{goto} send\_next;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00926}00926                 \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00927}00927 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00928}00928                 \textcolor{comment}{/* transfer cancelled */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00929}00929                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00930}00930         \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00931}00931 \} \textcolor{comment}{/* ubt\_ctrl\_write\_callback */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00932}00932 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00933}00933 \textcolor{comment}{/* }}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00934}00934 \textcolor{comment}{ * Called when incoming interrupt transfer (HCI event) has completed, i.e.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00935}00935 \textcolor{comment}{ * HCI event was received from the device.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00936}00936 \textcolor{comment}{ * USB context.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00937}00937 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00938}00938 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00939}00939 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00940}\mbox{\hyperlink{ng__ubt_8c_ae058fb4021a034c4258f53cad0a242b9}{00940}} \mbox{\hyperlink{ng__ubt_8c_a9468c082e5b8cdc5bae70bf35c00c118}{ubt\_intr\_read\_callback}}(\textcolor{keyword}{struct} usb\_xfer *xfer, usb\_error\_t error)}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00941}00941 \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00942}00942         \textcolor{keyword}{struct }\mbox{\hyperlink{structubt__softc}{ubt\_softc}}       *sc = usbd\_xfer\_softc(xfer);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00943}00943         \textcolor{keyword}{struct }mbuf             *m;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00944}00944         ng\_hci\_event\_pkt\_t      *hdr;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00945}00945         \textcolor{keyword}{struct }usb\_page\_cache   *pc;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00946}00946         \textcolor{keywordtype}{int}                     actlen;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00947}00947 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00948}00948         usbd\_xfer\_status(xfer, \&actlen, NULL, NULL, NULL);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00949}00949 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00950}00950         m = NULL;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00951}00951 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00952}00952         \textcolor{keywordflow}{switch} (USB\_GET\_STATE(xfer)) \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00953}00953         \textcolor{keywordflow}{case} USB\_ST\_TRANSFERRED:}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00954}00954                 \textcolor{comment}{/* Allocate a new mbuf */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00955}00955                 MGETHDR(m, M\_NOWAIT, MT\_DATA);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00956}00956                 \textcolor{keywordflow}{if} (m == NULL) \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00957}00957                         \mbox{\hyperlink{ng__ubt__var_8h_a0d911b49b4675fe3d8fda839cd13a878}{UBT\_STAT\_IERROR}}(sc);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00958}00958                         \textcolor{keywordflow}{goto} submit\_next;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00959}00959                 \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00960}00960 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00961}00961                 \textcolor{keywordflow}{if} (!(MCLGET(m, M\_NOWAIT))) \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00962}00962                         \mbox{\hyperlink{ng__ubt__var_8h_a0d911b49b4675fe3d8fda839cd13a878}{UBT\_STAT\_IERROR}}(sc);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00963}00963                         \textcolor{keywordflow}{goto} submit\_next;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00964}00964                 \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00965}00965 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00966}00966                 \textcolor{comment}{/* Add HCI packet type */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00967}00967                 *mtod(m, uint8\_t *)= \mbox{\hyperlink{ng__hci_8h_ae0433c8df51cf4bed9cec3c932b39d4c}{NG\_HCI\_EVENT\_PKT}};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00968}00968                 m-\/>m\_pkthdr.len = m-\/>m\_len = 1;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00969}00969 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00970}00970                 \textcolor{keywordflow}{if} (actlen > MCLBYTES -\/ 1)}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00971}00971                         actlen = MCLBYTES -\/ 1;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00972}00972 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00973}00973                 pc = usbd\_xfer\_get\_frame(xfer, 0);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00974}00974                 usbd\_copy\_out(pc, 0, mtod(m, uint8\_t *) + 1, actlen);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00975}00975                 m-\/>m\_pkthdr.len += actlen;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00976}00976                 m-\/>m\_len += actlen;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00977}00977 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00978}00978                 \mbox{\hyperlink{ng__ubt__var_8h_a5157c1b8b77845750545d5dee365f846}{UBT\_INFO}}(sc, \textcolor{stringliteral}{"{}got \%d bytes from interrupt pipe\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00979}00979                         actlen);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00980}00980 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00981}00981                 \textcolor{comment}{/* Validate packet and send it up the stack */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00982}00982                 \textcolor{keywordflow}{if} (m-\/>m\_pkthdr.len < (\textcolor{keywordtype}{int})\textcolor{keyword}{sizeof}(*hdr)) \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00983}00983                         \mbox{\hyperlink{ng__ubt__var_8h_a5157c1b8b77845750545d5dee365f846}{UBT\_INFO}}(sc, \textcolor{stringliteral}{"{}HCI event packet is too short\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00984}00984 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00985}00985                         \mbox{\hyperlink{ng__ubt__var_8h_a0d911b49b4675fe3d8fda839cd13a878}{UBT\_STAT\_IERROR}}(sc);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00986}00986                         \textcolor{keywordflow}{goto} submit\_next;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00987}00987                 \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00988}00988 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00989}00989                 hdr = mtod(m, ng\_hci\_event\_pkt\_t *);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00990}00990                 \textcolor{keywordflow}{if} (hdr-\/>length != (m-\/>m\_pkthdr.len -\/ \textcolor{keyword}{sizeof}(*hdr))) \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00991}00991                         \mbox{\hyperlink{ng__ubt__var_8h_a4589b90425ae2a8a4be1340d03c2a38e}{UBT\_ERR}}(sc, \textcolor{stringliteral}{"{}Invalid HCI event packet size, "{}} \(\backslash\)}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00992}00992                                 \textcolor{stringliteral}{"{}length=\%d, pktlen=\%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00993}00993                                 hdr-\/>length, m-\/>m\_pkthdr.len);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00994}00994 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00995}00995                         \mbox{\hyperlink{ng__ubt__var_8h_a0d911b49b4675fe3d8fda839cd13a878}{UBT\_STAT\_IERROR}}(sc);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00996}00996                         \textcolor{keywordflow}{goto} submit\_next;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00997}00997                 \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00998}00998 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l00999}00999                 \mbox{\hyperlink{ng__ubt__var_8h_a5157c1b8b77845750545d5dee365f846}{UBT\_INFO}}(sc, \textcolor{stringliteral}{"{}got complete HCI event frame, pktlen=\%d, "{}} \(\backslash\)}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01000}01000                         \textcolor{stringliteral}{"{}length=\%d\(\backslash\)n"{}}, m-\/>m\_pkthdr.len, hdr-\/>length);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01001}01001 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01002}01002                 \mbox{\hyperlink{ng__ubt__var_8h_a1e49c363458010653e3dd47ba43667ca}{UBT\_STAT\_PCKTS\_RECV}}(sc);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01003}01003                 \mbox{\hyperlink{ng__ubt__var_8h_a597b6250721e963ed3c1ff47e7642fb5}{UBT\_STAT\_BYTES\_RECV}}(sc, m-\/>m\_pkthdr.len);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01004}01004 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01005}01005                 \mbox{\hyperlink{ng__ubt_8c_ab8ad7dbd316ac4662bad36d85784c302}{ubt\_fwd\_mbuf\_up}}(sc, \&m);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01006}01006                 \textcolor{comment}{/* m == NULL at this point */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01007}01007                 \textcolor{comment}{/* FALLTHROUGH */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01008}01008 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01009}01009         \textcolor{keywordflow}{case} USB\_ST\_SETUP:}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01010}01010 submit\_next:}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01011}01011                 \mbox{\hyperlink{netgraph_8h_a2461bfcdc9e024484ed8037d386620e3}{NG\_FREE\_M}}(m); \textcolor{comment}{/* checks for m != NULL */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01012}01012 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01013}01013                 usbd\_xfer\_set\_frame\_len(xfer, 0, usbd\_xfer\_max\_len(xfer));}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01014}01014                 usbd\_transfer\_submit(xfer);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01015}01015                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01016}01016 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01017}01017         \textcolor{keywordflow}{default}: \textcolor{comment}{/* Error */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01018}01018                 \textcolor{keywordflow}{if} (error != USB\_ERR\_CANCELLED) \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01019}01019                         \mbox{\hyperlink{ng__ubt__var_8h_af199de836b33c121c82d41fad27c4e00}{UBT\_WARN}}(sc, \textcolor{stringliteral}{"{}interrupt transfer failed: \%s\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01020}01020                                 usbd\_errstr(error));}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01021}01021 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01022}01022                         \textcolor{comment}{/* Try to clear stall first */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01023}01023                         usbd\_xfer\_set\_stall(xfer);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01024}01024                         \textcolor{keywordflow}{goto} submit\_next;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01025}01025                 \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01026}01026                         \textcolor{comment}{/* transfer cancelled */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01027}01027                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01028}01028         \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01029}01029 \} \textcolor{comment}{/* ubt\_intr\_read\_callback */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01030}01030 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01031}01031 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01032}01032 \textcolor{comment}{ * Called when incoming bulk transfer (ACL packet) has completed, i.e.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01033}01033 \textcolor{comment}{ * ACL packet was received from the device.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01034}01034 \textcolor{comment}{ * USB context.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01035}01035 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01036}01036 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01037}01037 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01038}\mbox{\hyperlink{ng__ubt_8c_a524ee6d742908631a92b2b9a5e60781d}{01038}} \mbox{\hyperlink{ng__ubt_8c_a2ff123c3c7491c5077789e57fa651478}{ubt\_bulk\_read\_callback}}(\textcolor{keyword}{struct} usb\_xfer *xfer, usb\_error\_t error)}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01039}01039 \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01040}01040         \textcolor{keyword}{struct }\mbox{\hyperlink{structubt__softc}{ubt\_softc}}       *sc = usbd\_xfer\_softc(xfer);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01041}01041         \textcolor{keyword}{struct }mbuf             *m;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01042}01042         ng\_hci\_acldata\_pkt\_t    *hdr;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01043}01043         \textcolor{keyword}{struct }usb\_page\_cache   *pc;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01044}01044         \textcolor{keywordtype}{int} len;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01045}01045         \textcolor{keywordtype}{int} actlen;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01046}01046 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01047}01047         usbd\_xfer\_status(xfer, \&actlen, NULL, NULL, NULL);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01048}01048 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01049}01049         m = NULL;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01050}01050 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01051}01051         \textcolor{keywordflow}{switch} (USB\_GET\_STATE(xfer)) \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01052}01052         \textcolor{keywordflow}{case} USB\_ST\_TRANSFERRED:}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01053}01053                 \textcolor{comment}{/* Allocate new mbuf */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01054}01054                 MGETHDR(m, M\_NOWAIT, MT\_DATA);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01055}01055                 \textcolor{keywordflow}{if} (m == NULL) \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01056}01056                         \mbox{\hyperlink{ng__ubt__var_8h_a0d911b49b4675fe3d8fda839cd13a878}{UBT\_STAT\_IERROR}}(sc);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01057}01057                         \textcolor{keywordflow}{goto} submit\_next;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01058}01058                 \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01059}01059 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01060}01060                 \textcolor{keywordflow}{if} (!(MCLGET(m, M\_NOWAIT))) \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01061}01061                         \mbox{\hyperlink{ng__ubt__var_8h_a0d911b49b4675fe3d8fda839cd13a878}{UBT\_STAT\_IERROR}}(sc);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01062}01062                         \textcolor{keywordflow}{goto} submit\_next;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01063}01063                 \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01064}01064 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01065}01065                 \textcolor{comment}{/* Add HCI packet type */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01066}01066                 *mtod(m, uint8\_t *)= \mbox{\hyperlink{ng__hci_8h_a7a55d93d4198a77b598624983c98a10e}{NG\_HCI\_ACL\_DATA\_PKT}};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01067}01067                 m-\/>m\_pkthdr.len = m-\/>m\_len = 1;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01068}01068 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01069}01069                 \textcolor{keywordflow}{if} (actlen > MCLBYTES -\/ 1)}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01070}01070                         actlen = MCLBYTES -\/ 1;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01071}01071 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01072}01072                 pc = usbd\_xfer\_get\_frame(xfer, 0);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01073}01073                 usbd\_copy\_out(pc, 0, mtod(m, uint8\_t *) + 1, actlen);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01074}01074                 m-\/>m\_pkthdr.len += actlen;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01075}01075                 m-\/>m\_len += actlen;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01076}01076 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01077}01077                 \mbox{\hyperlink{ng__ubt__var_8h_a5157c1b8b77845750545d5dee365f846}{UBT\_INFO}}(sc, \textcolor{stringliteral}{"{}got \%d bytes from bulk-\/in pipe\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01078}01078                         actlen);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01079}01079 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01080}01080                 \textcolor{comment}{/* Validate packet and send it up the stack */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01081}01081                 \textcolor{keywordflow}{if} (m-\/>m\_pkthdr.len < (\textcolor{keywordtype}{int})\textcolor{keyword}{sizeof}(*hdr)) \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01082}01082                         \mbox{\hyperlink{ng__ubt__var_8h_a5157c1b8b77845750545d5dee365f846}{UBT\_INFO}}(sc, \textcolor{stringliteral}{"{}HCI ACL packet is too short\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01083}01083 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01084}01084                         \mbox{\hyperlink{ng__ubt__var_8h_a0d911b49b4675fe3d8fda839cd13a878}{UBT\_STAT\_IERROR}}(sc);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01085}01085                         \textcolor{keywordflow}{goto} submit\_next;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01086}01086                 \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01087}01087 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01088}01088                 hdr = mtod(m, ng\_hci\_acldata\_pkt\_t *);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01089}01089                 len = le16toh(hdr-\/>length);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01090}01090                 \textcolor{keywordflow}{if} (len != (\textcolor{keywordtype}{int})(m-\/>m\_pkthdr.len -\/ \textcolor{keyword}{sizeof}(*hdr))) \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01091}01091                         \mbox{\hyperlink{ng__ubt__var_8h_a4589b90425ae2a8a4be1340d03c2a38e}{UBT\_ERR}}(sc, \textcolor{stringliteral}{"{}Invalid ACL packet size, length=\%d, "{}} \(\backslash\)}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01092}01092                                 \textcolor{stringliteral}{"{}pktlen=\%d\(\backslash\)n"{}}, len, m-\/>m\_pkthdr.len);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01093}01093 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01094}01094                         \mbox{\hyperlink{ng__ubt__var_8h_a0d911b49b4675fe3d8fda839cd13a878}{UBT\_STAT\_IERROR}}(sc);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01095}01095                         \textcolor{keywordflow}{goto} submit\_next;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01096}01096                 \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01097}01097 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01098}01098                 \mbox{\hyperlink{ng__ubt__var_8h_a5157c1b8b77845750545d5dee365f846}{UBT\_INFO}}(sc, \textcolor{stringliteral}{"{}got complete ACL data packet, pktlen=\%d, "{}} \(\backslash\)}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01099}01099                         \textcolor{stringliteral}{"{}length=\%d\(\backslash\)n"{}}, m-\/>m\_pkthdr.len, len);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01100}01100 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01101}01101                 \mbox{\hyperlink{ng__ubt__var_8h_a1e49c363458010653e3dd47ba43667ca}{UBT\_STAT\_PCKTS\_RECV}}(sc);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01102}01102                 \mbox{\hyperlink{ng__ubt__var_8h_a597b6250721e963ed3c1ff47e7642fb5}{UBT\_STAT\_BYTES\_RECV}}(sc, m-\/>m\_pkthdr.len);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01103}01103 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01104}01104                 \mbox{\hyperlink{ng__ubt_8c_ab8ad7dbd316ac4662bad36d85784c302}{ubt\_fwd\_mbuf\_up}}(sc, \&m);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01105}01105                 \textcolor{comment}{/* m == NULL at this point */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01106}01106                 \textcolor{comment}{/* FALLTHOUGH */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01107}01107 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01108}01108         \textcolor{keywordflow}{case} USB\_ST\_SETUP:}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01109}01109 submit\_next:}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01110}01110                 \mbox{\hyperlink{netgraph_8h_a2461bfcdc9e024484ed8037d386620e3}{NG\_FREE\_M}}(m); \textcolor{comment}{/* checks for m != NULL */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01111}01111 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01112}01112                 usbd\_xfer\_set\_frame\_len(xfer, 0, usbd\_xfer\_max\_len(xfer));}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01113}01113                 usbd\_transfer\_submit(xfer);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01114}01114                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01115}01115 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01116}01116         \textcolor{keywordflow}{default}: \textcolor{comment}{/* Error */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01117}01117                 \textcolor{keywordflow}{if} (error != USB\_ERR\_CANCELLED) \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01118}01118                         \mbox{\hyperlink{ng__ubt__var_8h_af199de836b33c121c82d41fad27c4e00}{UBT\_WARN}}(sc, \textcolor{stringliteral}{"{}bulk-\/in transfer failed: \%s\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01119}01119                                 usbd\_errstr(error));}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01120}01120 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01121}01121                         \textcolor{comment}{/* Try to clear stall first */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01122}01122                         usbd\_xfer\_set\_stall(xfer);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01123}01123                         \textcolor{keywordflow}{goto} submit\_next;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01124}01124                 \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01125}01125                         \textcolor{comment}{/* transfer cancelled */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01126}01126                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01127}01127         \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01128}01128 \} \textcolor{comment}{/* ubt\_bulk\_read\_callback */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01129}01129 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01130}01130 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01131}01131 \textcolor{comment}{ * Called when outgoing bulk transfer (ACL packet) has completed, i.e.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01132}01132 \textcolor{comment}{ * ACL packet was sent to the device.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01133}01133 \textcolor{comment}{ * USB context.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01134}01134 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01135}01135 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01136}01136 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01137}\mbox{\hyperlink{ng__ubt_8c_a3271e49c8a1cedbd9456768d9dd3e2fa}{01137}} \mbox{\hyperlink{ng__ubt_8c_af1276a3b306e8b10188594e07cde1a8c}{ubt\_bulk\_write\_callback}}(\textcolor{keyword}{struct} usb\_xfer *xfer, usb\_error\_t error)}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01138}01138 \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01139}01139         \textcolor{keyword}{struct }\mbox{\hyperlink{structubt__softc}{ubt\_softc}}       *sc = usbd\_xfer\_softc(xfer);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01140}01140         \textcolor{keyword}{struct }mbuf             *m;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01141}01141         \textcolor{keyword}{struct }usb\_page\_cache   *pc;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01142}01142         \textcolor{keywordtype}{int}                     actlen;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01143}01143 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01144}01144         usbd\_xfer\_status(xfer, \&actlen, NULL, NULL, NULL);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01145}01145 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01146}01146         \textcolor{keywordflow}{switch} (USB\_GET\_STATE(xfer)) \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01147}01147         \textcolor{keywordflow}{case} USB\_ST\_TRANSFERRED:}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01148}01148                 \mbox{\hyperlink{ng__ubt__var_8h_a5157c1b8b77845750545d5dee365f846}{UBT\_INFO}}(sc, \textcolor{stringliteral}{"{}sent \%d bytes to bulk-\/out pipe\(\backslash\)n"{}}, actlen);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01149}01149                 \mbox{\hyperlink{ng__ubt__var_8h_ae8cf496e05c4037b4ae02bfa24d41607}{UBT\_STAT\_BYTES\_SENT}}(sc, actlen);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01150}01150                 \mbox{\hyperlink{ng__ubt__var_8h_a7a851f7066cf3178b0d8e94ebdd2123e}{UBT\_STAT\_PCKTS\_SENT}}(sc);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01151}01151                 \textcolor{comment}{/* FALLTHROUGH */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01152}01152 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01153}01153         \textcolor{keywordflow}{case} USB\_ST\_SETUP:}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01154}01154 send\_next:}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01155}01155                 \textcolor{comment}{/* Get next mbuf, if any */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01156}01156                 \mbox{\hyperlink{ng__ubt__var_8h_a8a12b94a49c10664d782068bf9b23604}{UBT\_NG\_LOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01157}01157                 \mbox{\hyperlink{ng__bluetooth_8h_a09b2f032f3cbca13246f7fada8c5eae2}{NG\_BT\_MBUFQ\_DEQUEUE}}(\&sc-\/>\mbox{\hyperlink{structubt__softc_a7dc6ede6d989cf54430b4acb5df5ca55}{sc\_aclq}}, m);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01158}01158                 \mbox{\hyperlink{ng__ubt__var_8h_a1bff5f8c5b576b7fc8457daa9dbf876c}{UBT\_NG\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01159}01159 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01160}01160                 \textcolor{keywordflow}{if} (m == NULL) \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01161}01161                         \mbox{\hyperlink{ng__ubt__var_8h_a5157c1b8b77845750545d5dee365f846}{UBT\_INFO}}(sc, \textcolor{stringliteral}{"{}ACL data queue is empty\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01162}01162                         \textcolor{keywordflow}{break}; \textcolor{comment}{/* transfer completed */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01163}01163                 \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01164}01164 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01165}01165                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01166}01166 \textcolor{comment}{                 * Copy ACL data frame back to a linear USB transfer buffer}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01167}01167 \textcolor{comment}{                 * and schedule transfer}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01168}01168 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01169}01169 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01170}01170                 pc = usbd\_xfer\_get\_frame(xfer, 0);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01171}01171                 usbd\_m\_copy\_in(pc, 0, m, 0, m-\/>m\_pkthdr.len);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01172}01172                 usbd\_xfer\_set\_frame\_len(xfer, 0, m-\/>m\_pkthdr.len);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01173}01173 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01174}01174                 \mbox{\hyperlink{ng__ubt__var_8h_a5157c1b8b77845750545d5dee365f846}{UBT\_INFO}}(sc, \textcolor{stringliteral}{"{}bulk-\/out transfer has been started, len=\%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01175}01175                         m-\/>m\_pkthdr.len);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01176}01176 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01177}01177                 \mbox{\hyperlink{netgraph_8h_a2461bfcdc9e024484ed8037d386620e3}{NG\_FREE\_M}}(m);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01178}01178 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01179}01179                 usbd\_transfer\_submit(xfer);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01180}01180                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01181}01181 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01182}01182         \textcolor{keywordflow}{default}: \textcolor{comment}{/* Error */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01183}01183                 \textcolor{keywordflow}{if} (error != USB\_ERR\_CANCELLED) \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01184}01184                         \mbox{\hyperlink{ng__ubt__var_8h_af199de836b33c121c82d41fad27c4e00}{UBT\_WARN}}(sc, \textcolor{stringliteral}{"{}bulk-\/out transfer failed: \%s\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01185}01185                                 usbd\_errstr(error));}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01186}01186 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01187}01187                         \mbox{\hyperlink{ng__ubt__var_8h_a898215196764bfcb75c5e9cecc9265d2}{UBT\_STAT\_OERROR}}(sc);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01188}01188 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01189}01189                         \textcolor{comment}{/* try to clear stall first */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01190}01190                         usbd\_xfer\_set\_stall(xfer);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01191}01191                         \textcolor{keywordflow}{goto} send\_next;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01192}01192                 \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01193}01193                         \textcolor{comment}{/* transfer cancelled */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01194}01194                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01195}01195         \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01196}01196 \} \textcolor{comment}{/* ubt\_bulk\_write\_callback */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01197}01197 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01198}01198 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01199}01199 \textcolor{comment}{ * Called when incoming isoc transfer (SCO packet) has completed, i.e.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01200}01200 \textcolor{comment}{ * SCO packet was received from the device.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01201}01201 \textcolor{comment}{ * USB context.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01202}01202 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01203}01203 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01204}01204 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01205}\mbox{\hyperlink{ng__ubt_8c_abc3ba77fa2b80a8119f57e0db0a1d7c3}{01205}} \mbox{\hyperlink{ng__ubt_8c_a10921286322e18fe5252f378b1256b20}{ubt\_isoc\_read\_callback}}(\textcolor{keyword}{struct} usb\_xfer *xfer, usb\_error\_t error)}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01206}01206 \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01207}01207         \textcolor{keyword}{struct }\mbox{\hyperlink{structubt__softc}{ubt\_softc}}       *sc = usbd\_xfer\_softc(xfer);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01208}01208         \textcolor{keywordtype}{int}                     n;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01209}01209         \textcolor{keywordtype}{int} actlen, nframes;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01210}01210 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01211}01211         usbd\_xfer\_status(xfer, \&actlen, NULL, NULL, \&nframes);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01212}01212 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01213}01213         \textcolor{keywordflow}{switch} (USB\_GET\_STATE(xfer)) \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01214}01214         \textcolor{keywordflow}{case} USB\_ST\_TRANSFERRED:}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01215}01215                 \textcolor{keywordflow}{for} (n = 0; n < nframes; n ++)}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01216}01216                         \textcolor{keywordflow}{if} (\mbox{\hyperlink{ng__ubt_8c_ab2c717515c38bf4f23ccb6a2c02ddc7b}{ubt\_isoc\_read\_one\_frame}}(xfer, n) < 0)}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01217}01217                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01218}01218                 \textcolor{comment}{/* FALLTHROUGH */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01219}01219 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01220}01220         \textcolor{keywordflow}{case} USB\_ST\_SETUP:}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01221}01221 read\_next:}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01222}01222                 \textcolor{keywordflow}{for} (n = 0; n < nframes; n ++)}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01223}01223                         usbd\_xfer\_set\_frame\_len(xfer, n,}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01224}01224                             usbd\_xfer\_max\_framelen(xfer));}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01225}01225 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01226}01226                 usbd\_transfer\_submit(xfer);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01227}01227                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01228}01228 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01229}01229         \textcolor{keywordflow}{default}: \textcolor{comment}{/* Error */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01230}01230                 \textcolor{keywordflow}{if} (error != USB\_ERR\_CANCELLED) \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01231}01231                         \mbox{\hyperlink{ng__ubt__var_8h_a0d911b49b4675fe3d8fda839cd13a878}{UBT\_STAT\_IERROR}}(sc);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01232}01232                         \textcolor{keywordflow}{goto} read\_next;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01233}01233                 \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01234}01234 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01235}01235                 \textcolor{comment}{/* transfer cancelled */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01236}01236                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01237}01237         \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01238}01238 \} \textcolor{comment}{/* ubt\_isoc\_read\_callback */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01239}01239 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01240}01240 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01241}01241 \textcolor{comment}{ * Helper function. Called from ubt\_isoc\_read\_callback() to read}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01242}01242 \textcolor{comment}{ * SCO data from one frame.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01243}01243 \textcolor{comment}{ * USB context.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01244}01244 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01245}01245 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01246}01246 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01247}\mbox{\hyperlink{ng__ubt_8c_ab2c717515c38bf4f23ccb6a2c02ddc7b}{01247}} \mbox{\hyperlink{ng__ubt_8c_ab2c717515c38bf4f23ccb6a2c02ddc7b}{ubt\_isoc\_read\_one\_frame}}(\textcolor{keyword}{struct} usb\_xfer *xfer, \textcolor{keywordtype}{int} frame\_no)}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01248}01248 \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01249}01249         \textcolor{keyword}{struct }\mbox{\hyperlink{structubt__softc}{ubt\_softc}}       *sc = usbd\_xfer\_softc(xfer);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01250}01250         \textcolor{keyword}{struct }usb\_page\_cache   *pc;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01251}01251         \textcolor{keyword}{struct }mbuf             *m;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01252}01252         \textcolor{keywordtype}{int}                     len, want, got, total;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01253}01253 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01254}01254         \textcolor{comment}{/* Get existing SCO reassembly buffer */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01255}01255         pc = usbd\_xfer\_get\_frame(xfer, 0);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01256}01256         m = sc-\/>\mbox{\hyperlink{structubt__softc_a70ebafb4dfcf24218c8f314f714ff953}{sc\_isoc\_in\_buffer}};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01257}01257         total = usbd\_xfer\_frame\_len(xfer, frame\_no);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01258}01258 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01259}01259         \textcolor{comment}{/* While we have data in the frame */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01260}01260         \textcolor{keywordflow}{while} (total > 0) \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01261}01261                 \textcolor{keywordflow}{if} (m == NULL) \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01262}01262                         \textcolor{comment}{/* Start new reassembly buffer */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01263}01263                         MGETHDR(m, M\_NOWAIT, MT\_DATA);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01264}01264                         \textcolor{keywordflow}{if} (m == NULL) \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01265}01265                                 \mbox{\hyperlink{ng__ubt__var_8h_a0d911b49b4675fe3d8fda839cd13a878}{UBT\_STAT\_IERROR}}(sc);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01266}01266                                 \textcolor{keywordflow}{return} (-\/1);    \textcolor{comment}{/* XXX out of sync! */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01267}01267                         \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01268}01268 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01269}01269                         \textcolor{keywordflow}{if} (!(MCLGET(m, M\_NOWAIT))) \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01270}01270                                 \mbox{\hyperlink{ng__ubt__var_8h_a0d911b49b4675fe3d8fda839cd13a878}{UBT\_STAT\_IERROR}}(sc);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01271}01271                                 \mbox{\hyperlink{netgraph_8h_a2461bfcdc9e024484ed8037d386620e3}{NG\_FREE\_M}}(m);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01272}01272                                 \textcolor{keywordflow}{return} (-\/1);    \textcolor{comment}{/* XXX out of sync! */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01273}01273                         \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01274}01274 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01275}01275                         \textcolor{comment}{/* Expect SCO header */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01276}01276                         *mtod(m, uint8\_t *) = \mbox{\hyperlink{ng__hci_8h_ad861d48c1315b92231baf62c1dd8619c}{NG\_HCI\_SCO\_DATA\_PKT}};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01277}01277                         m-\/>m\_pkthdr.len = m-\/>m\_len = got = 1;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01278}01278                         want = \textcolor{keyword}{sizeof}(ng\_hci\_scodata\_pkt\_t);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01279}01279                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01280}01280                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01281}01281 \textcolor{comment}{                         * Check if we have SCO header and if so }}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01282}01282 \textcolor{comment}{                         * adjust amount of data we want}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01283}01283 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01284}01284                         got = m-\/>m\_pkthdr.len;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01285}01285                         want = \textcolor{keyword}{sizeof}(ng\_hci\_scodata\_pkt\_t);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01286}01286 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01287}01287                         \textcolor{keywordflow}{if} (got >= want)}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01288}01288                                 want += mtod(m, ng\_hci\_scodata\_pkt\_t *)-\/>length;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01289}01289                 \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01290}01290 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01291}01291                 \textcolor{comment}{/* Append frame data to the SCO reassembly buffer */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01292}01292                 len = total;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01293}01293                 \textcolor{keywordflow}{if} (got + len > want)}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01294}01294                         len = want -\/ got;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01295}01295 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01296}01296                 usbd\_copy\_out(pc, frame\_no * usbd\_xfer\_max\_framelen(xfer),}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01297}01297                         mtod(m, uint8\_t *) + m-\/>m\_pkthdr.len, len);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01298}01298 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01299}01299                 m-\/>m\_pkthdr.len += len;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01300}01300                 m-\/>m\_len += len;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01301}01301                 total -\/= len;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01302}01302 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01303}01303                 \textcolor{comment}{/* Check if we got everything we wanted, if not -\/ continue */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01304}01304                 \textcolor{keywordflow}{if} (got != want)}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01305}01305                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01306}01306 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01307}01307                 \textcolor{comment}{/* If we got here then we got complete SCO frame */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01308}01308                 \mbox{\hyperlink{ng__ubt__var_8h_a5157c1b8b77845750545d5dee365f846}{UBT\_INFO}}(sc, \textcolor{stringliteral}{"{}got complete SCO data frame, pktlen=\%d, "{}} \(\backslash\)}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01309}01309                         \textcolor{stringliteral}{"{}length=\%d\(\backslash\)n"{}}, m-\/>m\_pkthdr.len,}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01310}01310                         mtod(m, ng\_hci\_scodata\_pkt\_t *)-\/>\mbox{\hyperlink{ng__ubt__var_8h_a6ae8e371985856eea14ae695f65dfab2}{length}});}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01311}01311 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01312}01312                 \mbox{\hyperlink{ng__ubt__var_8h_a1e49c363458010653e3dd47ba43667ca}{UBT\_STAT\_PCKTS\_RECV}}(sc);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01313}01313                 \mbox{\hyperlink{ng__ubt__var_8h_a597b6250721e963ed3c1ff47e7642fb5}{UBT\_STAT\_BYTES\_RECV}}(sc, m-\/>m\_pkthdr.len);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01314}01314 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01315}01315                 \mbox{\hyperlink{ng__ubt_8c_ab8ad7dbd316ac4662bad36d85784c302}{ubt\_fwd\_mbuf\_up}}(sc, \&m);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01316}01316                 \textcolor{comment}{/* m == NULL at this point */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01317}01317         \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01318}01318 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01319}01319         \textcolor{comment}{/* Put SCO reassembly buffer back */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01320}01320         sc-\/>\mbox{\hyperlink{structubt__softc_a70ebafb4dfcf24218c8f314f714ff953}{sc\_isoc\_in\_buffer}} = m;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01321}01321 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01322}01322         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01323}01323 \} \textcolor{comment}{/* ubt\_isoc\_read\_one\_frame */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01324}01324 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01325}01325 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01326}01326 \textcolor{comment}{ * Called when outgoing isoc transfer (SCO packet) has completed, i.e.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01327}01327 \textcolor{comment}{ * SCO packet was sent to the device.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01328}01328 \textcolor{comment}{ * USB context.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01329}01329 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01330}01330 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01331}01331 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01332}\mbox{\hyperlink{ng__ubt_8c_a76b2ba0d31990c5700b3f7209875f055}{01332}} \mbox{\hyperlink{ng__ubt_8c_af694eeb98e9e32de74102551f1129639}{ubt\_isoc\_write\_callback}}(\textcolor{keyword}{struct} usb\_xfer *xfer, usb\_error\_t error)}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01333}01333 \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01334}01334         \textcolor{keyword}{struct }\mbox{\hyperlink{structubt__softc}{ubt\_softc}}       *sc = usbd\_xfer\_softc(xfer);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01335}01335         \textcolor{keyword}{struct }usb\_page\_cache   *pc;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01336}01336         \textcolor{keyword}{struct }mbuf             *m;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01337}01337         \textcolor{keywordtype}{int}                     n, space, offset;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01338}01338         \textcolor{keywordtype}{int}                     actlen, nframes;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01339}01339 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01340}01340         usbd\_xfer\_status(xfer, \&actlen, NULL, NULL, \&nframes);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01341}01341         pc = usbd\_xfer\_get\_frame(xfer, 0);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01342}01342 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01343}01343         \textcolor{keywordflow}{switch} (USB\_GET\_STATE(xfer)) \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01344}01344         \textcolor{keywordflow}{case} USB\_ST\_TRANSFERRED:}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01345}01345                 \mbox{\hyperlink{ng__ubt__var_8h_a5157c1b8b77845750545d5dee365f846}{UBT\_INFO}}(sc, \textcolor{stringliteral}{"{}sent \%d bytes to isoc-\/out pipe\(\backslash\)n"{}}, actlen);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01346}01346                 \mbox{\hyperlink{ng__ubt__var_8h_ae8cf496e05c4037b4ae02bfa24d41607}{UBT\_STAT\_BYTES\_SENT}}(sc, actlen);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01347}01347                 \mbox{\hyperlink{ng__ubt__var_8h_a7a851f7066cf3178b0d8e94ebdd2123e}{UBT\_STAT\_PCKTS\_SENT}}(sc);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01348}01348                 \textcolor{comment}{/* FALLTHROUGH */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01349}01349 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01350}01350         \textcolor{keywordflow}{case} USB\_ST\_SETUP:}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01351}01351 send\_next:}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01352}01352                 offset = 0;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01353}01353                 space = usbd\_xfer\_max\_framelen(xfer) * nframes;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01354}01354                 m = NULL;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01355}01355 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01356}01356                 \textcolor{keywordflow}{while} (space > 0) \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01357}01357                         \textcolor{keywordflow}{if} (m == NULL) \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01358}01358                                 \mbox{\hyperlink{ng__ubt__var_8h_a8a12b94a49c10664d782068bf9b23604}{UBT\_NG\_LOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01359}01359                                 \mbox{\hyperlink{ng__bluetooth_8h_a09b2f032f3cbca13246f7fada8c5eae2}{NG\_BT\_MBUFQ\_DEQUEUE}}(\&sc-\/>\mbox{\hyperlink{structubt__softc_a35dfa933a0465ef112d4b0b35226acba}{sc\_scoq}}, m);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01360}01360                                 \mbox{\hyperlink{ng__ubt__var_8h_a1bff5f8c5b576b7fc8457daa9dbf876c}{UBT\_NG\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01361}01361 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01362}01362                                 \textcolor{keywordflow}{if} (m == NULL)}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01363}01363                                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01364}01364                         \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01365}01365 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01366}01366                         n = \mbox{\hyperlink{ng__hci__cmds_8c_ac6afabdc09a49a433ee19d8a9486056d}{min}}(space, m-\/>m\_pkthdr.len);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01367}01367                         \textcolor{keywordflow}{if} (n > 0) \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01368}01368                                 usbd\_m\_copy\_in(pc, offset, m,0, n);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01369}01369                                 m\_adj(m, n);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01370}01370 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01371}01371                                 offset += n;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01372}01372                                 space -\/= n;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01373}01373                         \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01374}01374 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01375}01375                         \textcolor{keywordflow}{if} (m-\/>m\_pkthdr.len == 0)}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01376}01376                                 \mbox{\hyperlink{netgraph_8h_a2461bfcdc9e024484ed8037d386620e3}{NG\_FREE\_M}}(m); \textcolor{comment}{/* sets m = NULL */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01377}01377                 \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01378}01378 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01379}01379                 \textcolor{comment}{/* Put whatever is left from mbuf back on queue */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01380}01380                 \textcolor{keywordflow}{if} (m != NULL) \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01381}01381                         \mbox{\hyperlink{ng__ubt__var_8h_a8a12b94a49c10664d782068bf9b23604}{UBT\_NG\_LOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01382}01382                         \mbox{\hyperlink{ng__bluetooth_8h_ac501b21141b172fa50b55c4606a3a758}{NG\_BT\_MBUFQ\_PREPEND}}(\&sc-\/>\mbox{\hyperlink{structubt__softc_a35dfa933a0465ef112d4b0b35226acba}{sc\_scoq}}, m);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01383}01383                         \mbox{\hyperlink{ng__ubt__var_8h_a1bff5f8c5b576b7fc8457daa9dbf876c}{UBT\_NG\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01384}01384                 \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01385}01385 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01386}01386                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01387}01387 \textcolor{comment}{                 * Calculate sizes for isoc frames.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01388}01388 \textcolor{comment}{                 * Note that offset could be 0 at this point (i.e. we have}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01389}01389 \textcolor{comment}{                 * nothing to send). That is fine, as we have isoc. transfers}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01390}01390 \textcolor{comment}{                 * going in both directions all the time. In this case it}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01391}01391 \textcolor{comment}{                 * would be just empty isoc. transfer.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01392}01392 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01393}01393 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01394}01394                 \textcolor{keywordflow}{for} (n = 0; n < nframes; n ++) \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01395}01395                         usbd\_xfer\_set\_frame\_len(xfer, n,}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01396}01396                             \mbox{\hyperlink{ng__hci__cmds_8c_ac6afabdc09a49a433ee19d8a9486056d}{min}}(offset, usbd\_xfer\_max\_framelen(xfer)));}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01397}01397                         offset -\/= usbd\_xfer\_frame\_len(xfer, n);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01398}01398                 \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01399}01399 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01400}01400                 usbd\_transfer\_submit(xfer);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01401}01401                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01402}01402 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01403}01403         \textcolor{keywordflow}{default}: \textcolor{comment}{/* Error */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01404}01404                 \textcolor{keywordflow}{if} (error != USB\_ERR\_CANCELLED) \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01405}01405                         \mbox{\hyperlink{ng__ubt__var_8h_a898215196764bfcb75c5e9cecc9265d2}{UBT\_STAT\_OERROR}}(sc);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01406}01406                         \textcolor{keywordflow}{goto} send\_next;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01407}01407                 \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01408}01408 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01409}01409                 \textcolor{comment}{/* transfer cancelled */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01410}01410                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01411}01411         \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01412}01412 \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01413}01413 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01414}01414 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01415}01415 \textcolor{comment}{ * Utility function to forward provided mbuf upstream (i.e. up the stack).}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01416}01416 \textcolor{comment}{ * Modifies value of the mbuf pointer (sets it to NULL).}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01417}01417 \textcolor{comment}{ * Save to call from any context.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01418}01418 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01419}01419 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01420}01420 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01421}\mbox{\hyperlink{ng__ubt_8c_ab8ad7dbd316ac4662bad36d85784c302}{01421}} \mbox{\hyperlink{ng__ubt_8c_ab8ad7dbd316ac4662bad36d85784c302}{ubt\_fwd\_mbuf\_up}}(\mbox{\hyperlink{structubt__softc}{ubt\_softc\_p}} sc, \textcolor{keyword}{struct} mbuf **m)}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01422}01422 \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01423}01423         \mbox{\hyperlink{structng__hook}{hook\_p}}    hook;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01424}01424         \textcolor{keywordtype}{int}     error;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01425}01425 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01426}01426         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01427}01427 \textcolor{comment}{         * Close the race with Netgraph hook newhook/disconnect methods.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01428}01428 \textcolor{comment}{         * Save the hook pointer atomically. Two cases are possible:}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01429}01429 \textcolor{comment}{         *}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01430}01430 \textcolor{comment}{         * 1) The hook pointer is NULL. It means disconnect method got}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01431}01431 \textcolor{comment}{         *    there first. In this case we are done.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01432}01432 \textcolor{comment}{         *}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01433}01433 \textcolor{comment}{         * 2) The hook pointer is not NULL. It means that hook pointer}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01434}01434 \textcolor{comment}{         *    could be either in valid or invalid (i.e. in the process}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01435}01435 \textcolor{comment}{         *    of disconnect) state. In any case grab an extra reference}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01436}01436 \textcolor{comment}{         *    to protect the hook pointer.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01437}01437 \textcolor{comment}{         *}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01438}01438 \textcolor{comment}{         * It is ok to pass hook in invalid state to NG\_SEND\_DATA\_ONLY() as}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01439}01439 \textcolor{comment}{         * it checks for it. Drop extra reference after NG\_SEND\_DATA\_ONLY().}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01440}01440 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01441}01441 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01442}01442         \mbox{\hyperlink{ng__ubt__var_8h_a8a12b94a49c10664d782068bf9b23604}{UBT\_NG\_LOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01443}01443         \textcolor{keywordflow}{if} ((hook = sc-\/>\mbox{\hyperlink{structubt__softc_ac4fdc8a8f985c496f840dbbcdbd4a874}{sc\_hook}}) != NULL)}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01444}01444                 \mbox{\hyperlink{netgraph_8h_aa62902771ada6bf2c313d96abadb3c85}{NG\_HOOK\_REF}}(hook);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01445}01445         \mbox{\hyperlink{ng__ubt__var_8h_a1bff5f8c5b576b7fc8457daa9dbf876c}{UBT\_NG\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01446}01446 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01447}01447         \textcolor{keywordflow}{if} (hook == NULL) \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01448}01448                 \mbox{\hyperlink{netgraph_8h_a2461bfcdc9e024484ed8037d386620e3}{NG\_FREE\_M}}(*m);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01449}01449                 \textcolor{keywordflow}{return} (ENETDOWN);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01450}01450         \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01451}01451 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01452}01452         \mbox{\hyperlink{netgraph_8h_a8c5e877ed70dff86bb57062afe4cee38}{NG\_SEND\_DATA\_ONLY}}(error, hook, *m);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01453}01453         \mbox{\hyperlink{netgraph_8h_a2b9c519a8b574618def581e0091cbf49}{NG\_HOOK\_UNREF}}(hook);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01454}01454 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01455}01455         \textcolor{keywordflow}{if} (error != 0)}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01456}01456                 \mbox{\hyperlink{ng__ubt__var_8h_a0d911b49b4675fe3d8fda839cd13a878}{UBT\_STAT\_IERROR}}(sc);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01457}01457 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01458}01458         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01459}01459 \} \textcolor{comment}{/* ubt\_fwd\_mbuf\_up */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01460}01460 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01461}01461 \textcolor{comment}{/****************************************************************************}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01462}01462 \textcolor{comment}{ ****************************************************************************}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01463}01463 \textcolor{comment}{ **                                 Glue }}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01464}01464 \textcolor{comment}{ ****************************************************************************}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01465}01465 \textcolor{comment}{ ****************************************************************************/}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01466}01466 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01467}01467 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01468}01468 \textcolor{comment}{ * Schedule glue task. Should be called with sc\_ng\_mtx held. }}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01469}01469 \textcolor{comment}{ * Netgraph context.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01470}01470 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01471}01471 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01472}01472 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01473}\mbox{\hyperlink{ng__ubt_8c_ae246805ef9c86a2e43954cd9ad9e6ecd}{01473}} \mbox{\hyperlink{ng__ubt_8c_ae246805ef9c86a2e43954cd9ad9e6ecd}{ubt\_task\_schedule}}(\mbox{\hyperlink{structubt__softc}{ubt\_softc\_p}} sc, \textcolor{keywordtype}{int} action)}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01474}01474 \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01475}01475         mtx\_assert(\&sc-\/>\mbox{\hyperlink{structubt__softc_a836aeaac9447307e3b6dfc6c40ad12c3}{sc\_ng\_mtx}}, MA\_OWNED);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01476}01476 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01477}01477         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01478}01478 \textcolor{comment}{         * Try to handle corner case when "{}start all"{} and "{}stop all"{}}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01479}01479 \textcolor{comment}{         * actions can both be set before task is executed.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01480}01480 \textcolor{comment}{         *}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01481}01481 \textcolor{comment}{         * The rules are}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01482}01482 \textcolor{comment}{         *}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01483}01483 \textcolor{comment}{         * sc\_task\_flags        action          new sc\_task\_flags}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01484}01484 \textcolor{comment}{         * -\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01485}01485 \textcolor{comment}{         * 0                    start           start}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01486}01486 \textcolor{comment}{         * 0                    stop            stop}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01487}01487 \textcolor{comment}{         * start                start           start}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01488}01488 \textcolor{comment}{         * start                stop            stop}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01489}01489 \textcolor{comment}{         * stop                 start           stop|start}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01490}01490 \textcolor{comment}{         * stop                 stop            stop}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01491}01491 \textcolor{comment}{         * stop|start           start           stop|start}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01492}01492 \textcolor{comment}{         * stop|start           stop            stop}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01493}01493 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01494}01494 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01495}01495         \textcolor{keywordflow}{if} (action != 0) \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01496}01496                 \textcolor{keywordflow}{if} ((action \& \mbox{\hyperlink{ng__ubt__var_8h_a3480f7dc535f65efeb8f3799f80f5569}{UBT\_FLAG\_T\_STOP\_ALL}}) != 0)}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01497}01497                         sc-\/>\mbox{\hyperlink{structubt__softc_a9298ad58c08a8a9b3d9094a2b6b35323}{sc\_task\_flags}} \&= \string~UBT\_FLAG\_T\_START\_ALL;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01498}01498 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01499}01499                 sc-\/>\mbox{\hyperlink{structubt__softc_a9298ad58c08a8a9b3d9094a2b6b35323}{sc\_task\_flags}} |= action;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01500}01500         \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01501}01501 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01502}01502         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structubt__softc_a9298ad58c08a8a9b3d9094a2b6b35323}{sc\_task\_flags}} \& \mbox{\hyperlink{ng__ubt__var_8h_a6a25ec70374d89b2445205124daa406d}{UBT\_FLAG\_T\_PENDING}})}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01503}01503                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01504}01504 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01505}01505         \textcolor{keywordflow}{if} (taskqueue\_enqueue(taskqueue\_swi, \&sc-\/>\mbox{\hyperlink{structubt__softc_a029e03eba4280a0e70361622de3c18ec}{sc\_task}}) == 0) \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01506}01506                 sc-\/>\mbox{\hyperlink{structubt__softc_a9298ad58c08a8a9b3d9094a2b6b35323}{sc\_task\_flags}} |= \mbox{\hyperlink{ng__ubt__var_8h_a6a25ec70374d89b2445205124daa406d}{UBT\_FLAG\_T\_PENDING}};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01507}01507                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01508}01508         \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01509}01509 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01510}01510         \textcolor{comment}{/* XXX: i think this should never happen */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01511}01511 \} \textcolor{comment}{/* ubt\_task\_schedule */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01512}01512 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01513}01513 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01514}01514 \textcolor{comment}{ * Glue task. Examines sc\_task\_flags and does things depending on it.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01515}01515 \textcolor{comment}{ * Taskqueue context.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01516}01516 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01517}01517 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01518}01518 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01519}\mbox{\hyperlink{ng__ubt_8c_ac8a4dec0815057f13484790aa2df8cd6}{01519}} \mbox{\hyperlink{ng__ubt_8c_a07664a30e5ce5a89597e6db805c971ba}{ubt\_task}}(\textcolor{keywordtype}{void} *context, \textcolor{keywordtype}{int} pending)}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01520}01520 \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01521}01521         \mbox{\hyperlink{structubt__softc}{ubt\_softc\_p}}  sc = context;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01522}01522         \textcolor{keywordtype}{int}             task\_flags, i;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01523}01523 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01524}01524         \mbox{\hyperlink{ng__ubt__var_8h_a8a12b94a49c10664d782068bf9b23604}{UBT\_NG\_LOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01525}01525         task\_flags = sc-\/>\mbox{\hyperlink{structubt__softc_a9298ad58c08a8a9b3d9094a2b6b35323}{sc\_task\_flags}};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01526}01526         sc-\/>\mbox{\hyperlink{structubt__softc_a9298ad58c08a8a9b3d9094a2b6b35323}{sc\_task\_flags}} = 0;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01527}01527         \mbox{\hyperlink{ng__ubt__var_8h_a1bff5f8c5b576b7fc8457daa9dbf876c}{UBT\_NG\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01528}01528 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01529}01529         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01530}01530 \textcolor{comment}{         * Stop all USB transfers synchronously.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01531}01531 \textcolor{comment}{         * Stop interface \#0 and \#1 transfers at the same time and in the}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01532}01532 \textcolor{comment}{         * same loop. usbd\_transfer\_drain() will do appropriate locking.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01533}01533 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01534}01534 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01535}01535         \textcolor{keywordflow}{if} (task\_flags \& \mbox{\hyperlink{ng__ubt__var_8h_a3480f7dc535f65efeb8f3799f80f5569}{UBT\_FLAG\_T\_STOP\_ALL}})}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01536}01536                 \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{ng__ubt__var_8h_a61dadd085c1777f559549e05962b2c9ea8777288eff72531769533666f9c172eb}{UBT\_N\_TRANSFER}}; i ++)}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01537}01537                         usbd\_transfer\_drain(sc-\/>\mbox{\hyperlink{structubt__softc_a08c8cedc6e8f88396c00e0667ecbcc57}{sc\_xfer}}[i]);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01538}01538 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01539}01539         \textcolor{comment}{/* Start incoming interrupt and bulk, and all isoc. USB transfers */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01540}01540         \textcolor{keywordflow}{if} (task\_flags \& \mbox{\hyperlink{ng__ubt__var_8h_ac328febe31b9c5471a32327e2b61e8ed}{UBT\_FLAG\_T\_START\_ALL}}) \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01541}01541                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01542}01542 \textcolor{comment}{                 * Interface \#0}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01543}01543 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01544}01544 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01545}01545                 mtx\_lock(\&sc-\/>\mbox{\hyperlink{structubt__softc_a3db86e695ced0f0746113f01e600d8c2}{sc\_if\_mtx}});}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01546}01546 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01547}01547                 \mbox{\hyperlink{ng__ubt_8c_aa01335806f737804f570b6ca36821ce0}{ubt\_xfer\_start}}(sc, \mbox{\hyperlink{ng__ubt__var_8h_a61dadd085c1777f559549e05962b2c9ea0f1828dcb63f2a0d21c5c5531b141cc4}{UBT\_IF\_0\_INTR\_DT\_RD}});}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01548}01548                 \mbox{\hyperlink{ng__ubt_8c_aa01335806f737804f570b6ca36821ce0}{ubt\_xfer\_start}}(sc, \mbox{\hyperlink{ng__ubt__var_8h_a61dadd085c1777f559549e05962b2c9ea699cc36ee9751921e6f2600df611811b}{UBT\_IF\_0\_BULK\_DT\_RD}});}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01549}01549 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01550}01550                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01551}01551 \textcolor{comment}{                 * Interface \#1}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01552}01552 \textcolor{comment}{                 * Start both read and write isoc. transfers by default.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01553}01553 \textcolor{comment}{                 * Get them going all the time even if we have nothing}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01554}01554 \textcolor{comment}{                 * to send to avoid any delays.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01555}01555 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01556}01556 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01557}01557                 \mbox{\hyperlink{ng__ubt_8c_aa01335806f737804f570b6ca36821ce0}{ubt\_xfer\_start}}(sc, \mbox{\hyperlink{ng__ubt__var_8h_a61dadd085c1777f559549e05962b2c9ea846c125fbff157d33b79b8ddeafc7ebd}{UBT\_IF\_1\_ISOC\_DT\_RD1}});}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01558}01558                 \mbox{\hyperlink{ng__ubt_8c_aa01335806f737804f570b6ca36821ce0}{ubt\_xfer\_start}}(sc, \mbox{\hyperlink{ng__ubt__var_8h_a61dadd085c1777f559549e05962b2c9eaa926c7178774761c3a526ec773aec39a}{UBT\_IF\_1\_ISOC\_DT\_RD2}});}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01559}01559                 \mbox{\hyperlink{ng__ubt_8c_aa01335806f737804f570b6ca36821ce0}{ubt\_xfer\_start}}(sc, \mbox{\hyperlink{ng__ubt__var_8h_a61dadd085c1777f559549e05962b2c9ea4954145b3b488d2a311a49a00151de0e}{UBT\_IF\_1\_ISOC\_DT\_WR1}});}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01560}01560                 \mbox{\hyperlink{ng__ubt_8c_aa01335806f737804f570b6ca36821ce0}{ubt\_xfer\_start}}(sc, \mbox{\hyperlink{ng__ubt__var_8h_a61dadd085c1777f559549e05962b2c9eaff55cf95a954801b2d3bb08ed98c0e73}{UBT\_IF\_1\_ISOC\_DT\_WR2}});}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01561}01561 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01562}01562                 mtx\_unlock(\&sc-\/>\mbox{\hyperlink{structubt__softc_a3db86e695ced0f0746113f01e600d8c2}{sc\_if\_mtx}});}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01563}01563         \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01564}01564 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01565}01565         \textcolor{comment}{/* Start outgoing control transfer */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01566}01566         \textcolor{keywordflow}{if} (task\_flags \& \mbox{\hyperlink{ng__ubt__var_8h_a3fab44e80ddc306e559d42def853d10c}{UBT\_FLAG\_T\_START\_CTRL}}) \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01567}01567                 mtx\_lock(\&sc-\/>\mbox{\hyperlink{structubt__softc_a3db86e695ced0f0746113f01e600d8c2}{sc\_if\_mtx}});}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01568}01568                 \mbox{\hyperlink{ng__ubt_8c_aa01335806f737804f570b6ca36821ce0}{ubt\_xfer\_start}}(sc, \mbox{\hyperlink{ng__ubt__var_8h_a61dadd085c1777f559549e05962b2c9ead939be12c55cf7a2c4bd55485eafb38a}{UBT\_IF\_0\_CTRL\_DT\_WR}});}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01569}01569                 mtx\_unlock(\&sc-\/>\mbox{\hyperlink{structubt__softc_a3db86e695ced0f0746113f01e600d8c2}{sc\_if\_mtx}});}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01570}01570         \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01571}01571 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01572}01572         \textcolor{comment}{/* Start outgoing bulk transfer */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01573}01573         \textcolor{keywordflow}{if} (task\_flags \& \mbox{\hyperlink{ng__ubt__var_8h_a9c7213cf7908de634d62fd2e0b3a5a1e}{UBT\_FLAG\_T\_START\_BULK}}) \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01574}01574                 mtx\_lock(\&sc-\/>\mbox{\hyperlink{structubt__softc_a3db86e695ced0f0746113f01e600d8c2}{sc\_if\_mtx}});}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01575}01575                 \mbox{\hyperlink{ng__ubt_8c_aa01335806f737804f570b6ca36821ce0}{ubt\_xfer\_start}}(sc, \mbox{\hyperlink{ng__ubt__var_8h_a61dadd085c1777f559549e05962b2c9ea54ef09b34da75d4e15e9c763b31c481e}{UBT\_IF\_0\_BULK\_DT\_WR}});}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01576}01576                 mtx\_unlock(\&sc-\/>\mbox{\hyperlink{structubt__softc_a3db86e695ced0f0746113f01e600d8c2}{sc\_if\_mtx}});}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01577}01577         \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01578}01578 \} \textcolor{comment}{/* ubt\_task */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01579}01579 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01580}01580 \textcolor{comment}{/****************************************************************************}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01581}01581 \textcolor{comment}{ ****************************************************************************}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01582}01582 \textcolor{comment}{ **                        Netgraph specific}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01583}01583 \textcolor{comment}{ ****************************************************************************}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01584}01584 \textcolor{comment}{ ****************************************************************************/}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01585}01585 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01586}01586 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01587}01587 \textcolor{comment}{ * Netgraph node constructor. Do not allow to create node of this type.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01588}01588 \textcolor{comment}{ * Netgraph context.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01589}01589 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01590}01590 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01591}01591 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01592}\mbox{\hyperlink{ng__ubt_8c_ac63e88e0b03612efaed558d68949b101}{01592}} \mbox{\hyperlink{ng__ubt_8c_a266fb8ff5f8c42eecbc0fbb61a1811f7}{ng\_ubt\_constructor}}(\mbox{\hyperlink{structng__node}{node\_p}} node)}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01593}01593 \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01594}01594         \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01595}01595 \} \textcolor{comment}{/* ng\_ubt\_constructor */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01596}01596 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01597}01597 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01598}01598 \textcolor{comment}{ * Netgraph node destructor. Destroy node only when device has been detached.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01599}01599 \textcolor{comment}{ * Netgraph context.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01600}01600 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01601}01601 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01602}01602 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01603}\mbox{\hyperlink{ng__ubt_8c_a7402ee67bd6880bfd2c070ae0594ce76}{01603}} \mbox{\hyperlink{ng__ubt_8c_a3cb9fd0ab47580ece9847b98f5faff6c}{ng\_ubt\_shutdown}}(\mbox{\hyperlink{structng__node}{node\_p}} node)}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01604}01604 \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01605}01605         \textcolor{keywordflow}{if} (node-\/>\mbox{\hyperlink{structng__node_af3c113361b68278c4fbc309e2a6f97d2}{nd\_flags}} \& \mbox{\hyperlink{netgraph_8h_a46dcde626b52a54a8da9c668b83eca5d}{NGF\_REALLY\_DIE}}) \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01606}01606                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01607}01607 \textcolor{comment}{                 * We came here because the USB device is being}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01608}01608 \textcolor{comment}{                 * detached, so stop being persistent.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01609}01609 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01610}01610                 \mbox{\hyperlink{netgraph_8h_a674a9dcfdef6a73d16cccde37234f470}{NG\_NODE\_SET\_PRIVATE}}(node, NULL);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01611}01611                 \mbox{\hyperlink{netgraph_8h_a7e3862fa34646a9c66c9b02ac5383d1a}{NG\_NODE\_UNREF}}(node);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01612}01612         \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01613}01613                 \mbox{\hyperlink{netgraph_8h_a9a68362867d019aabd137ed493b87d55}{NG\_NODE\_REVIVE}}(node); \textcolor{comment}{/* tell ng\_rmnode we are persisant */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01614}01614 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01615}01615         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01616}01616 \} \textcolor{comment}{/* ng\_ubt\_shutdown */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01617}01617 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01618}01618 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01619}01619 \textcolor{comment}{ * Create new hook. There can only be one.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01620}01620 \textcolor{comment}{ * Netgraph context.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01621}01621 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01622}01622 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01623}01623 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01624}\mbox{\hyperlink{ng__ubt_8c_a5b1598eb9c3e9f07b7a8cd5e91bda70e}{01624}} \mbox{\hyperlink{ng__ubt_8c_a7df7bcd70a40fa1fcfb8d6f27ad8780a}{ng\_ubt\_newhook}}(\mbox{\hyperlink{structng__node}{node\_p}} node, \mbox{\hyperlink{structng__hook}{hook\_p}} hook, \textcolor{keywordtype}{char} \textcolor{keyword}{const} *\mbox{\hyperlink{ng__ppp_8c_ab2adbf48c2df32ccf9cced3bc8c3dc26}{name}})}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01625}01625 \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01626}01626         \textcolor{keyword}{struct }\mbox{\hyperlink{structubt__softc}{ubt\_softc}}       *sc = \mbox{\hyperlink{netgraph_8h_ae76b377c72ed8b60e8cbe1a204f70598}{NG\_NODE\_PRIVATE}}(node);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01627}01627 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01628}01628         \textcolor{keywordflow}{if} (strcmp(\mbox{\hyperlink{ng__ppp_8c_ab2adbf48c2df32ccf9cced3bc8c3dc26}{name}}, \mbox{\hyperlink{ng__ubt_8h_aa1e97073b4b53583eb404f6d668edd7a}{NG\_UBT\_HOOK}}) != 0)}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01629}01629                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01630}01630 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01631}01631         \mbox{\hyperlink{ng__ubt__var_8h_a8a12b94a49c10664d782068bf9b23604}{UBT\_NG\_LOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01632}01632         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structubt__softc_ac4fdc8a8f985c496f840dbbcdbd4a874}{sc\_hook}} != NULL) \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01633}01633                 \mbox{\hyperlink{ng__ubt__var_8h_a1bff5f8c5b576b7fc8457daa9dbf876c}{UBT\_NG\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01634}01634 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01635}01635                 \textcolor{keywordflow}{return} (EISCONN);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01636}01636         \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01637}01637 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01638}01638         sc-\/>\mbox{\hyperlink{structubt__softc_ac4fdc8a8f985c496f840dbbcdbd4a874}{sc\_hook}} = hook;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01639}01639         \mbox{\hyperlink{ng__ubt__var_8h_a1bff5f8c5b576b7fc8457daa9dbf876c}{UBT\_NG\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01640}01640 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01641}01641         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01642}01642 \} \textcolor{comment}{/* ng\_ubt\_newhook */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01643}01643 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01644}01644 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01645}01645 \textcolor{comment}{ * Connect hook. Start incoming USB transfers.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01646}01646 \textcolor{comment}{ * Netgraph context.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01647}01647 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01648}01648 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01649}01649 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01650}\mbox{\hyperlink{ng__ubt_8c_aebb1cc908c102de1f3760657b52d9bee}{01650}} \mbox{\hyperlink{ng__ubt_8c_a8f58f63b832aa3b690b3a9ecbb443ca0}{ng\_ubt\_connect}}(\mbox{\hyperlink{structng__hook}{hook\_p}} hook)}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01651}01651 \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01652}01652         \textcolor{keyword}{struct }\mbox{\hyperlink{structubt__softc}{ubt\_softc}}       *sc = \mbox{\hyperlink{netgraph_8h_ae76b377c72ed8b60e8cbe1a204f70598}{NG\_NODE\_PRIVATE}}(\mbox{\hyperlink{netgraph_8h_a1d027698ed92e240870e67cd8362f1d4}{NG\_HOOK\_NODE}}(hook));}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01653}01653 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01654}01654         \mbox{\hyperlink{netgraph_8h_aa1237a32cabb47ae66cce0f75d2baceb}{NG\_HOOK\_FORCE\_QUEUE}}(\mbox{\hyperlink{netgraph_8h_a74d793bf65c44f5732dbaf331d871681}{NG\_HOOK\_PEER}}(hook));}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01655}01655 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01656}01656         \mbox{\hyperlink{ng__ubt__var_8h_a8a12b94a49c10664d782068bf9b23604}{UBT\_NG\_LOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01657}01657         \mbox{\hyperlink{ng__ubt_8c_ae246805ef9c86a2e43954cd9ad9e6ecd}{ubt\_task\_schedule}}(sc, \mbox{\hyperlink{ng__ubt__var_8h_ac328febe31b9c5471a32327e2b61e8ed}{UBT\_FLAG\_T\_START\_ALL}});}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01658}01658         \mbox{\hyperlink{ng__ubt__var_8h_a1bff5f8c5b576b7fc8457daa9dbf876c}{UBT\_NG\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01659}01659 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01660}01660         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01661}01661 \} \textcolor{comment}{/* ng\_ubt\_connect */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01662}01662 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01663}01663 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01664}01664 \textcolor{comment}{ * Disconnect hook.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01665}01665 \textcolor{comment}{ * Netgraph context.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01666}01666 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01667}01667 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01668}01668 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01669}\mbox{\hyperlink{ng__ubt_8c_ac8258da830b469f8fec3a1c4de3642e3}{01669}} \mbox{\hyperlink{ng__ubt_8c_ab626c838bcf354fe851d210ae24872ca}{ng\_ubt\_disconnect}}(\mbox{\hyperlink{structng__hook}{hook\_p}} hook)}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01670}01670 \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01671}01671         \textcolor{keyword}{struct }\mbox{\hyperlink{structubt__softc}{ubt\_softc}}       *sc = \mbox{\hyperlink{netgraph_8h_ae76b377c72ed8b60e8cbe1a204f70598}{NG\_NODE\_PRIVATE}}(\mbox{\hyperlink{netgraph_8h_a1d027698ed92e240870e67cd8362f1d4}{NG\_HOOK\_NODE}}(hook));}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01672}01672 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01673}01673         \mbox{\hyperlink{ng__ubt__var_8h_a8a12b94a49c10664d782068bf9b23604}{UBT\_NG\_LOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01674}01674 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01675}01675         \textcolor{keywordflow}{if} (hook != sc-\/>\mbox{\hyperlink{structubt__softc_ac4fdc8a8f985c496f840dbbcdbd4a874}{sc\_hook}}) \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01676}01676                 \mbox{\hyperlink{ng__ubt__var_8h_a1bff5f8c5b576b7fc8457daa9dbf876c}{UBT\_NG\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01677}01677 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01678}01678                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01679}01679         \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01680}01680 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01681}01681         sc-\/>\mbox{\hyperlink{structubt__softc_ac4fdc8a8f985c496f840dbbcdbd4a874}{sc\_hook}} = NULL;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01682}01682 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01683}01683         \textcolor{comment}{/* Kick off task to stop all USB xfers */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01684}01684         \mbox{\hyperlink{ng__ubt_8c_ae246805ef9c86a2e43954cd9ad9e6ecd}{ubt\_task\_schedule}}(sc, \mbox{\hyperlink{ng__ubt__var_8h_a3480f7dc535f65efeb8f3799f80f5569}{UBT\_FLAG\_T\_STOP\_ALL}});}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01685}01685 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01686}01686         \textcolor{comment}{/* Drain queues */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01687}01687         \mbox{\hyperlink{ng__bluetooth_8h_a08c470db29c52e343e355cceb74f92c0}{NG\_BT\_MBUFQ\_DRAIN}}(\&sc-\/>\mbox{\hyperlink{structubt__softc_a5e4b6430054706f547499884f2ae05ff}{sc\_cmdq}});}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01688}01688         \mbox{\hyperlink{ng__bluetooth_8h_a08c470db29c52e343e355cceb74f92c0}{NG\_BT\_MBUFQ\_DRAIN}}(\&sc-\/>\mbox{\hyperlink{structubt__softc_a7dc6ede6d989cf54430b4acb5df5ca55}{sc\_aclq}});}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01689}01689         \mbox{\hyperlink{ng__bluetooth_8h_a08c470db29c52e343e355cceb74f92c0}{NG\_BT\_MBUFQ\_DRAIN}}(\&sc-\/>\mbox{\hyperlink{structubt__softc_a35dfa933a0465ef112d4b0b35226acba}{sc\_scoq}});}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01690}01690 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01691}01691         \mbox{\hyperlink{ng__ubt__var_8h_a1bff5f8c5b576b7fc8457daa9dbf876c}{UBT\_NG\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01692}01692 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01693}01693         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01694}01694 \} \textcolor{comment}{/* ng\_ubt\_disconnect */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01695}01695 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01696}01696 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01697}01697 \textcolor{comment}{ * Process control message.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01698}01698 \textcolor{comment}{ * Netgraph context.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01699}01699 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01700}01700 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01701}01701 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01702}\mbox{\hyperlink{ng__ubt_8c_ab125a2ea98405c009efff0d024d656c3}{01702}} \mbox{\hyperlink{ng__ubt_8c_ac4351a342a4fca4236b6d07ff99181f2}{ng\_ubt\_rcvmsg}}(\mbox{\hyperlink{structng__node}{node\_p}} node, \mbox{\hyperlink{structng__item}{item\_p}} item, \mbox{\hyperlink{structng__hook}{hook\_p}} lasthook)}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01703}01703 \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01704}01704         \textcolor{keyword}{struct }\mbox{\hyperlink{structubt__softc}{ubt\_softc}}       *sc = \mbox{\hyperlink{netgraph_8h_ae76b377c72ed8b60e8cbe1a204f70598}{NG\_NODE\_PRIVATE}}(node);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01705}01705         \textcolor{keyword}{struct }\mbox{\hyperlink{structng__mesg}{ng\_mesg}}           *msg, *rsp = NULL;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01706}01706         \textcolor{keyword}{struct }\mbox{\hyperlink{structng__bt__mbufq}{ng\_bt\_mbufq}}   *q;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01707}01707         \textcolor{keywordtype}{int}                     error = 0, queue, qlen;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01708}01708 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01709}01709         \mbox{\hyperlink{netgraph_8h_adc9a04fd174ef3c29ecae94016b84839}{NGI\_GET\_MSG}}(item, msg);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01710}01710 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01711}01711         \textcolor{keywordflow}{switch} (msg-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_ab59e14593b69a406ed5ca4209d489a10}{typecookie}}) \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01712}01712         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__message_8h_a577acb07400a990f6e293df85928c01e}{NGM\_GENERIC\_COOKIE}}:}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01713}01713                 \textcolor{keywordflow}{switch} (msg-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_a8e76e57bf8666004146ceb1ba38ad3a5}{cmd}}) \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01714}01714                 \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__message_8h_ae8a3b6a5d0d3244ed73924ab2421a0d0af7e8d918ab39873056284fe1b8dfe71b}{NGM\_TEXT\_STATUS}}:}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01715}01715                         \mbox{\hyperlink{ng__message_8h_a216c0b1bcd68ffab4668cdab2e4e0981}{NG\_MKRESPONSE}}(rsp, msg, \mbox{\hyperlink{ng__message_8h_a3a84bfff41ce7395b73b14eb82a0f4e1}{NG\_TEXTRESPONSE}}, M\_NOWAIT);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01716}01716                         \textcolor{keywordflow}{if} (rsp == NULL) \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01717}01717                                 error = ENOMEM;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01718}01718                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01719}01719                         \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01720}01720 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01721}01721                         snprintf(rsp-\/>\mbox{\hyperlink{structng__mesg_afe7d2a81b120e0f3d15facd293174c6d}{data}}, \mbox{\hyperlink{ng__message_8h_a3a84bfff41ce7395b73b14eb82a0f4e1}{NG\_TEXTRESPONSE}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01722}01722                                 \textcolor{stringliteral}{"{}Hook: \%s\(\backslash\)n"{}} \(\backslash\)}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01723}01723                                 \textcolor{stringliteral}{"{}Task flags: \%\#x\(\backslash\)n"{}} \(\backslash\)}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01724}01724                                 \textcolor{stringliteral}{"{}Debug: \%d\(\backslash\)n"{}} \(\backslash\)}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01725}01725                                 \textcolor{stringliteral}{"{}CMD queue: [have:\%d,max:\%d]\(\backslash\)n"{}} \(\backslash\)}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01726}01726                                 \textcolor{stringliteral}{"{}ACL queue: [have:\%d,max:\%d]\(\backslash\)n"{}} \(\backslash\)}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01727}01727                                 \textcolor{stringliteral}{"{}SCO queue: [have:\%d,max:\%d]"{}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01728}01728                                 (sc-\/>\mbox{\hyperlink{structubt__softc_ac4fdc8a8f985c496f840dbbcdbd4a874}{sc\_hook}} != NULL) ? \mbox{\hyperlink{ng__ubt_8h_aa1e97073b4b53583eb404f6d668edd7a}{NG\_UBT\_HOOK}} : \textcolor{stringliteral}{"{}"{}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01729}01729                                 sc-\/>\mbox{\hyperlink{structubt__softc_a9298ad58c08a8a9b3d9094a2b6b35323}{sc\_task\_flags}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01730}01730                                 sc-\/>\mbox{\hyperlink{structubt__softc_a4e4b230c8afcafa3e606b685f972bcd2}{sc\_debug}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01731}01731                                 sc-\/>\mbox{\hyperlink{structubt__softc_a5e4b6430054706f547499884f2ae05ff}{sc\_cmdq}}.\mbox{\hyperlink{structng__bt__mbufq_a197274160c732538a975b977f3bfb519}{len}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01732}01732                                 sc-\/>\mbox{\hyperlink{structubt__softc_a5e4b6430054706f547499884f2ae05ff}{sc\_cmdq}}.\mbox{\hyperlink{structng__bt__mbufq_a7b56a327746ef01461b853ed524a2047}{maxlen}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01733}01733                                 sc-\/>\mbox{\hyperlink{structubt__softc_a7dc6ede6d989cf54430b4acb5df5ca55}{sc\_aclq}}.\mbox{\hyperlink{structng__bt__mbufq_a197274160c732538a975b977f3bfb519}{len}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01734}01734                                 sc-\/>\mbox{\hyperlink{structubt__softc_a7dc6ede6d989cf54430b4acb5df5ca55}{sc\_aclq}}.\mbox{\hyperlink{structng__bt__mbufq_a7b56a327746ef01461b853ed524a2047}{maxlen}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01735}01735                                 sc-\/>\mbox{\hyperlink{structubt__softc_a35dfa933a0465ef112d4b0b35226acba}{sc\_scoq}}.\mbox{\hyperlink{structng__bt__mbufq_a197274160c732538a975b977f3bfb519}{len}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01736}01736                                 sc-\/>\mbox{\hyperlink{structubt__softc_a35dfa933a0465ef112d4b0b35226acba}{sc\_scoq}}.\mbox{\hyperlink{structng__bt__mbufq_a7b56a327746ef01461b853ed524a2047}{maxlen}});}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01737}01737                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01738}01738 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01739}01739                 \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01740}01740                         error = EINVAL;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01741}01741                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01742}01742                 \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01743}01743                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01744}01744 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01745}01745         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__ubt_8h_a52a68343fc6c28a5376d4d055a049b56}{NGM\_UBT\_COOKIE}}:}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01746}01746                 \textcolor{keywordflow}{switch} (msg-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_a8e76e57bf8666004146ceb1ba38ad3a5}{cmd}}) \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01747}01747                 \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__ubt_8h_aa9c5095b22e0dcaf13d641cebc299f6d}{NGM\_UBT\_NODE\_SET\_DEBUG}}:}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01748}01748                         \textcolor{keywordflow}{if} (msg-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_a8f8d7499b617aa48f128bd10e40b5a13}{arglen}} != \textcolor{keyword}{sizeof}(\mbox{\hyperlink{ng__ubt_8h_a49d15a234f0b3f8b5cd5c8910a83d86d}{ng\_ubt\_node\_debug\_ep}}))\{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01749}01749                                 error = EMSGSIZE;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01750}01750                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01751}01751                         \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01752}01752 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01753}01753                         sc-\/>\mbox{\hyperlink{structubt__softc_a4e4b230c8afcafa3e606b685f972bcd2}{sc\_debug}} = *((\mbox{\hyperlink{ng__ubt_8h_a49d15a234f0b3f8b5cd5c8910a83d86d}{ng\_ubt\_node\_debug\_ep}} *) (msg-\/>\mbox{\hyperlink{structng__mesg_afe7d2a81b120e0f3d15facd293174c6d}{data}}));}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01754}01754                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01755}01755 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01756}01756                 \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__ubt_8h_ac3def1d6f12cd4d56e0f34bccd00d49e}{NGM\_UBT\_NODE\_GET\_DEBUG}}:}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01757}01757                         \mbox{\hyperlink{ng__message_8h_a216c0b1bcd68ffab4668cdab2e4e0981}{NG\_MKRESPONSE}}(rsp, msg, \textcolor{keyword}{sizeof}(\mbox{\hyperlink{ng__ubt_8h_a49d15a234f0b3f8b5cd5c8910a83d86d}{ng\_ubt\_node\_debug\_ep}}),}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01758}01758                             M\_NOWAIT);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01759}01759                         \textcolor{keywordflow}{if} (rsp == NULL) \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01760}01760                                 error = ENOMEM;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01761}01761                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01762}01762                         \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01763}01763 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01764}01764                         *((\mbox{\hyperlink{ng__ubt_8h_a49d15a234f0b3f8b5cd5c8910a83d86d}{ng\_ubt\_node\_debug\_ep}} *) (rsp-\/>\mbox{\hyperlink{structng__mesg_afe7d2a81b120e0f3d15facd293174c6d}{data}})) = sc-\/>\mbox{\hyperlink{structubt__softc_a4e4b230c8afcafa3e606b685f972bcd2}{sc\_debug}};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01765}01765                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01766}01766 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01767}01767                 \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__ubt_8h_aefe54fedff9e6c5602ba047376e7f4a1}{NGM\_UBT\_NODE\_SET\_QLEN}}:}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01768}01768                         if (msg-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_a8f8d7499b617aa48f128bd10e40b5a13}{arglen}} != \textcolor{keyword}{sizeof}(\mbox{\hyperlink{structng__ubt__node__qlen__ep}{ng\_ubt\_node\_qlen\_ep}})) \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01769}01769                                 error = EMSGSIZE;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01770}01770                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01771}01771                         \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01772}01772 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01773}01773                         queue = ((\mbox{\hyperlink{structng__ubt__node__qlen__ep}{ng\_ubt\_node\_qlen\_ep}} *) (msg-\/>\mbox{\hyperlink{structng__mesg_afe7d2a81b120e0f3d15facd293174c6d}{data}}))-\/>queue;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01774}01774                         qlen = ((\mbox{\hyperlink{structng__ubt__node__qlen__ep}{ng\_ubt\_node\_qlen\_ep}} *) (msg-\/>\mbox{\hyperlink{structng__mesg_afe7d2a81b120e0f3d15facd293174c6d}{data}}))-\/>qlen;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01775}01775 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01776}01776                         \textcolor{keywordflow}{switch} (queue) \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01777}01777                         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__ubt_8h_afaae9d26fd9b3b5984c12fc79a9925ca}{NGM\_UBT\_NODE\_QUEUE\_CMD}}:}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01778}01778                                 q = \&sc-\/>\mbox{\hyperlink{structubt__softc_a5e4b6430054706f547499884f2ae05ff}{sc\_cmdq}};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01779}01779                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01780}01780 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01781}01781                         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__ubt_8h_a8669f1cc279631542982223b50e7fa82}{NGM\_UBT\_NODE\_QUEUE\_ACL}}:}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01782}01782                                 q = \&sc-\/>\mbox{\hyperlink{structubt__softc_a7dc6ede6d989cf54430b4acb5df5ca55}{sc\_aclq}};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01783}01783                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01784}01784 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01785}01785                         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__ubt_8h_a9d7ec82bb91f844145f9426c12d04e5a}{NGM\_UBT\_NODE\_QUEUE\_SCO}}:}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01786}01786                                 q = \&sc-\/>\mbox{\hyperlink{structubt__softc_a35dfa933a0465ef112d4b0b35226acba}{sc\_scoq}};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01787}01787                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01788}01788 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01789}01789                         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01790}01790                                 error = EINVAL;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01791}01791                                 \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01792}01792                                 \textcolor{comment}{/* NOT REACHED */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01793}01793                         \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01794}01794 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01795}01795                         q-\/>\mbox{\hyperlink{structng__bt__mbufq_a7b56a327746ef01461b853ed524a2047}{maxlen}} = qlen;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01796}01796                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01797}01797 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01798}01798                 \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__ubt_8h_a4f255bb904a4e4f7a634f4e19cd0524e}{NGM\_UBT\_NODE\_GET\_QLEN}}:}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01799}01799                         \textcolor{keywordflow}{if} (msg-\/>\mbox{\hyperlink{structng__mesg_a16ea313a1e38531a10a14902b7579210}{header}}.\mbox{\hyperlink{structng__mesg_1_1ng__msghdr_a8f8d7499b617aa48f128bd10e40b5a13}{arglen}} != \textcolor{keyword}{sizeof}(\mbox{\hyperlink{structng__ubt__node__qlen__ep}{ng\_ubt\_node\_qlen\_ep}})) \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01800}01800                                 error = EMSGSIZE;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01801}01801                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01802}01802                         \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01803}01803 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01804}01804                         queue = ((\mbox{\hyperlink{structng__ubt__node__qlen__ep}{ng\_ubt\_node\_qlen\_ep}} *) (msg-\/>\mbox{\hyperlink{structng__mesg_afe7d2a81b120e0f3d15facd293174c6d}{data}}))-\/>queue;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01805}01805 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01806}01806                         \textcolor{keywordflow}{switch} (queue) \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01807}01807                         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__ubt_8h_afaae9d26fd9b3b5984c12fc79a9925ca}{NGM\_UBT\_NODE\_QUEUE\_CMD}}:}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01808}01808                                 q = \&sc-\/>\mbox{\hyperlink{structubt__softc_a5e4b6430054706f547499884f2ae05ff}{sc\_cmdq}};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01809}01809                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01810}01810 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01811}01811                         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__ubt_8h_a8669f1cc279631542982223b50e7fa82}{NGM\_UBT\_NODE\_QUEUE\_ACL}}:}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01812}01812                                 q = \&sc-\/>\mbox{\hyperlink{structubt__softc_a7dc6ede6d989cf54430b4acb5df5ca55}{sc\_aclq}};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01813}01813                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01814}01814 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01815}01815                         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__ubt_8h_a9d7ec82bb91f844145f9426c12d04e5a}{NGM\_UBT\_NODE\_QUEUE\_SCO}}:}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01816}01816                                 q = \&sc-\/>\mbox{\hyperlink{structubt__softc_a35dfa933a0465ef112d4b0b35226acba}{sc\_scoq}};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01817}01817                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01818}01818 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01819}01819                         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01820}01820                                 error = EINVAL;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01821}01821                                 \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01822}01822                                 \textcolor{comment}{/* NOT REACHED */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01823}01823                         \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01824}01824 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01825}01825                         \mbox{\hyperlink{ng__message_8h_a216c0b1bcd68ffab4668cdab2e4e0981}{NG\_MKRESPONSE}}(rsp, msg, \textcolor{keyword}{sizeof}(\mbox{\hyperlink{structng__ubt__node__qlen__ep}{ng\_ubt\_node\_qlen\_ep}}),}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01826}01826                                 M\_NOWAIT);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01827}01827                         \textcolor{keywordflow}{if} (rsp == NULL) \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01828}01828                                 error = ENOMEM;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01829}01829                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01830}01830                         \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01831}01831 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01832}01832                         ((\mbox{\hyperlink{structng__ubt__node__qlen__ep}{ng\_ubt\_node\_qlen\_ep}} *) (rsp-\/>\mbox{\hyperlink{structng__mesg_afe7d2a81b120e0f3d15facd293174c6d}{data}}))-\/>queue = queue;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01833}01833                         ((\mbox{\hyperlink{structng__ubt__node__qlen__ep}{ng\_ubt\_node\_qlen\_ep}} *) (rsp-\/>\mbox{\hyperlink{structng__mesg_afe7d2a81b120e0f3d15facd293174c6d}{data}}))-\/>qlen = q-\/>\mbox{\hyperlink{structng__bt__mbufq_a7b56a327746ef01461b853ed524a2047}{maxlen}};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01834}01834                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01835}01835 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01836}01836                 \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__ubt_8h_a708bf69b444e2a2b8f5439bebac85a1e}{NGM\_UBT\_NODE\_GET\_STAT}}:}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01837}01837                         \mbox{\hyperlink{ng__message_8h_a216c0b1bcd68ffab4668cdab2e4e0981}{NG\_MKRESPONSE}}(rsp, msg, \textcolor{keyword}{sizeof}(\mbox{\hyperlink{structng__ubt__node__stat__ep}{ng\_ubt\_node\_stat\_ep}}),}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01838}01838                             M\_NOWAIT);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01839}01839                         \textcolor{keywordflow}{if} (rsp == NULL) \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01840}01840                                 error = ENOMEM;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01841}01841                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01842}01842                         \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01843}01843 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01844}01844                         bcopy(\&sc-\/>\mbox{\hyperlink{structubt__softc_a3d6a48c197ffa046d9e17a639311d7c8}{sc\_stat}}, rsp-\/>\mbox{\hyperlink{structng__mesg_afe7d2a81b120e0f3d15facd293174c6d}{data}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01845}01845                                 \textcolor{keyword}{sizeof}(\mbox{\hyperlink{structng__ubt__node__stat__ep}{ng\_ubt\_node\_stat\_ep}}));}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01846}01846                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01847}01847 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01848}01848                 \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__ubt_8h_af0f2e7d6fc1dd88c64e70d5703db3ad3}{NGM\_UBT\_NODE\_RESET\_STAT}}:}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01849}01849                         \mbox{\hyperlink{ng__ubt__var_8h_a2265a417f45a510d169c3d570072e611}{UBT\_STAT\_RESET}}(sc);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01850}01850                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01851}01851 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01852}01852                 \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01853}01853                         error = EINVAL;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01854}01854                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01855}01855                 \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01856}01856                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01857}01857 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01858}01858         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01859}01859                 error = EINVAL;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01860}01860                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01861}01861         \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01862}01862 done:}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01863}01863         \mbox{\hyperlink{netgraph_8h_a69db50ed7f968e936580df029ab5c5dc}{NG\_RESPOND\_MSG}}(error, node, item, rsp);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01864}01864         \mbox{\hyperlink{netgraph_8h_abd7a8c5f70b0f15aa17bfda43a9cf6b2}{NG\_FREE\_MSG}}(msg);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01865}01865 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01866}01866         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01867}01867 \} \textcolor{comment}{/* ng\_ubt\_rcvmsg */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01868}01868 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01869}01869 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01870}01870 \textcolor{comment}{ * Process data.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01871}01871 \textcolor{comment}{ * Netgraph context.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01872}01872 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01873}01873 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01874}01874 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01875}\mbox{\hyperlink{ng__ubt_8c_a1322edad2f827368c3ad5ce7afd5c7e8}{01875}} \mbox{\hyperlink{ng__ubt_8c_ad588d2e65bb59f910d3a52f41453eed9}{ng\_ubt\_rcvdata}}(\mbox{\hyperlink{structng__hook}{hook\_p}} hook, \mbox{\hyperlink{structng__item}{item\_p}} item)}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01876}01876 \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01877}01877         \textcolor{keyword}{struct }\mbox{\hyperlink{structubt__softc}{ubt\_softc}}       *sc = \mbox{\hyperlink{netgraph_8h_ae76b377c72ed8b60e8cbe1a204f70598}{NG\_NODE\_PRIVATE}}(\mbox{\hyperlink{netgraph_8h_a1d027698ed92e240870e67cd8362f1d4}{NG\_HOOK\_NODE}}(hook));}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01878}01878         \textcolor{keyword}{struct }mbuf             *m;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01879}01879         \textcolor{keyword}{struct }\mbox{\hyperlink{structng__bt__mbufq}{ng\_bt\_mbufq}}   *q;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01880}01880         \textcolor{keywordtype}{int}                     action, error = 0;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01881}01881 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01882}01882         \textcolor{keywordflow}{if} (hook != sc-\/>\mbox{\hyperlink{structubt__softc_ac4fdc8a8f985c496f840dbbcdbd4a874}{sc\_hook}}) \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01883}01883                 error = EINVAL;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01884}01884                 \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01885}01885         \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01886}01886 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01887}01887         \textcolor{comment}{/* Deatch mbuf and get HCI frame type */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01888}01888         \mbox{\hyperlink{netgraph_8h_abbb0acb5f480576cff9901caddeef57f}{NGI\_GET\_M}}(item, m);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01889}01889 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01890}01890         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01891}01891 \textcolor{comment}{         * Minimal size of the HCI frame is 4 bytes: 1 byte frame type,}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01892}01892 \textcolor{comment}{         * 2 bytes connection handle and at least 1 byte of length.}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01893}01893 \textcolor{comment}{         * Panic on data frame that has size smaller than 4 bytes (it}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01894}01894 \textcolor{comment}{         * should not happen)}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01895}01895 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01896}01896 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01897}01897         \textcolor{keywordflow}{if} (m-\/>m\_pkthdr.len < 4)}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01898}01898                 panic(\textcolor{stringliteral}{"{}HCI frame size is too small! pktlen=\%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01899}01899                         m-\/>m\_pkthdr.len);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01900}01900 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01901}01901         \textcolor{comment}{/* Process HCI frame */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01902}01902         \textcolor{keywordflow}{switch} (*mtod(m, uint8\_t *)) \{  \textcolor{comment}{/* XXX call m\_pullup ? */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01903}01903         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__hci_8h_a2530c45c7110ec470c215b4f1886c5ff}{NG\_HCI\_CMD\_PKT}}:}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01904}01904                 \textcolor{keywordflow}{if} (m-\/>m\_pkthdr.len -\/ 1 > (\textcolor{keywordtype}{int})\mbox{\hyperlink{ng__ubt__var_8h_aac7b3f8375b0701710602807ade5dd6f}{UBT\_CTRL\_BUFFER\_SIZE}})}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01905}01905                         panic(\textcolor{stringliteral}{"{}HCI command frame size is too big! "{}} \(\backslash\)}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01906}01906                                 \textcolor{stringliteral}{"{}buffer size=\%zd, packet len=\%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01907}01907                                 \mbox{\hyperlink{ng__ubt__var_8h_aac7b3f8375b0701710602807ade5dd6f}{UBT\_CTRL\_BUFFER\_SIZE}}, m-\/>m\_pkthdr.len);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01908}01908 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01909}01909                 q = \&sc-\/>\mbox{\hyperlink{structubt__softc_a5e4b6430054706f547499884f2ae05ff}{sc\_cmdq}};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01910}01910                 action = \mbox{\hyperlink{ng__ubt__var_8h_a3fab44e80ddc306e559d42def853d10c}{UBT\_FLAG\_T\_START\_CTRL}};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01911}01911                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01912}01912 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01913}01913         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__hci_8h_a7a55d93d4198a77b598624983c98a10e}{NG\_HCI\_ACL\_DATA\_PKT}}:}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01914}01914                 \textcolor{keywordflow}{if} (m-\/>m\_pkthdr.len -\/ 1 > \mbox{\hyperlink{ng__ubt__var_8h_a73b4006054c40b9806148260fce130f5}{UBT\_BULK\_WRITE\_BUFFER\_SIZE}})}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01915}01915                         panic(\textcolor{stringliteral}{"{}ACL data frame size is too big! "{}} \(\backslash\)}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01916}01916                                 \textcolor{stringliteral}{"{}buffer size=\%d, packet len=\%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01917}01917                                 \mbox{\hyperlink{ng__ubt__var_8h_a73b4006054c40b9806148260fce130f5}{UBT\_BULK\_WRITE\_BUFFER\_SIZE}}, m-\/>m\_pkthdr.len);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01918}01918 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01919}01919                 q = \&sc-\/>\mbox{\hyperlink{structubt__softc_a7dc6ede6d989cf54430b4acb5df5ca55}{sc\_aclq}};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01920}01920                 action = \mbox{\hyperlink{ng__ubt__var_8h_a9c7213cf7908de634d62fd2e0b3a5a1e}{UBT\_FLAG\_T\_START\_BULK}};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01921}01921                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01922}01922 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01923}01923         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__hci_8h_ad861d48c1315b92231baf62c1dd8619c}{NG\_HCI\_SCO\_DATA\_PKT}}:}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01924}01924                 q = \&sc-\/>\mbox{\hyperlink{structubt__softc_a35dfa933a0465ef112d4b0b35226acba}{sc\_scoq}};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01925}01925                 action = 0;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01926}01926                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01927}01927 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01928}01928         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01929}01929                 \mbox{\hyperlink{ng__ubt__var_8h_a4589b90425ae2a8a4be1340d03c2a38e}{UBT\_ERR}}(sc, \textcolor{stringliteral}{"{}Dropping unsupported HCI frame, type=0x\%02x, "{}} \(\backslash\)}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01930}01930                         \textcolor{stringliteral}{"{}pktlen=\%d\(\backslash\)n"{}}, *mtod(m, uint8\_t *), m-\/>m\_pkthdr.len);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01931}01931 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01932}01932                 \mbox{\hyperlink{netgraph_8h_a2461bfcdc9e024484ed8037d386620e3}{NG\_FREE\_M}}(m);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01933}01933                 error = EINVAL;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01934}01934                 \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01935}01935                 \textcolor{comment}{/* NOT REACHED */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01936}01936         \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01937}01937 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01938}01938         \mbox{\hyperlink{ng__ubt__var_8h_a8a12b94a49c10664d782068bf9b23604}{UBT\_NG\_LOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01939}01939         \textcolor{keywordflow}{if} (\mbox{\hyperlink{ng__bluetooth_8h_af3406a88285ed50213fb26024c5480ad}{NG\_BT\_MBUFQ\_FULL}}(q)) \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01940}01940                 \mbox{\hyperlink{ng__bluetooth_8h_a16ef778a37a9615ca317b0360b91c45c}{NG\_BT\_MBUFQ\_DROP}}(q);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01941}01941                 \mbox{\hyperlink{ng__ubt__var_8h_a1bff5f8c5b576b7fc8457daa9dbf876c}{UBT\_NG\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01942}01942                 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01943}01943                 \mbox{\hyperlink{ng__ubt__var_8h_a4589b90425ae2a8a4be1340d03c2a38e}{UBT\_ERR}}(sc, \textcolor{stringliteral}{"{}Dropping HCI frame 0x\%02x, len=\%d. Queue full\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01944}01944                         *mtod(m, uint8\_t *), m-\/>m\_pkthdr.len);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01945}01945 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01946}01946                 \mbox{\hyperlink{netgraph_8h_a2461bfcdc9e024484ed8037d386620e3}{NG\_FREE\_M}}(m);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01947}01947         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01948}01948                 \textcolor{comment}{/* Loose HCI packet type, enqueue mbuf and kick off task */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01949}01949                 m\_adj(m, \textcolor{keyword}{sizeof}(uint8\_t));}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01950}01950                 \mbox{\hyperlink{ng__bluetooth_8h_a4c6b5e44c71c672f0bb8b6338973a944}{NG\_BT\_MBUFQ\_ENQUEUE}}(q, m);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01951}01951                 \mbox{\hyperlink{ng__ubt_8c_ae246805ef9c86a2e43954cd9ad9e6ecd}{ubt\_task\_schedule}}(sc, action);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01952}01952                 \mbox{\hyperlink{ng__ubt__var_8h_a1bff5f8c5b576b7fc8457daa9dbf876c}{UBT\_NG\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01953}01953         \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01954}01954 done:}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01955}01955         \mbox{\hyperlink{netgraph_8h_ab1451f92a5ed6715897d40bf802b06d5}{NG\_FREE\_ITEM}}(item);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01956}01956 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01957}01957         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01958}01958 \} \textcolor{comment}{/* ng\_ubt\_rcvdata */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01959}01959 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01960}01960 \textcolor{comment}{/****************************************************************************}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01961}01961 \textcolor{comment}{ ****************************************************************************}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01962}01962 \textcolor{comment}{ **                              Module}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01963}01963 \textcolor{comment}{ ****************************************************************************}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01964}01964 \textcolor{comment}{ ****************************************************************************/}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01965}01965 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01966}01966 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01967}01967 \textcolor{comment}{ * Load/Unload the driver module}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01968}01968 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01969}01969 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01970}01970 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01971}\mbox{\hyperlink{ng__ubt_8c_a39cfdb0c8915123573dea71ac81142f2}{01971}} \mbox{\hyperlink{ng__ubt_8c_a39cfdb0c8915123573dea71ac81142f2}{ubt\_modevent}}(module\_t mod, \textcolor{keywordtype}{int} \mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, \textcolor{keywordtype}{void} *\mbox{\hyperlink{ng__ubt__var_8h_a7f897df1949af68456ee830f2468e476}{data}})}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01972}01972 \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01973}01973         \textcolor{keywordtype}{int}     error;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01974}01974 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01975}01975         \textcolor{keywordflow}{switch} (\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}) \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01976}01976         \textcolor{keywordflow}{case} MOD\_LOAD:}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01977}01977                 error = \mbox{\hyperlink{netgraph_8h_a67f567d871dc683c4cb7a75dcfedf458}{ng\_newtype}}(\&\mbox{\hyperlink{ng__ubt_8c_a80a131770518c7fa3758d85054006e7a}{typestruct}});}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01978}01978                 \textcolor{keywordflow}{if} (error != 0)}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01979}01979                         printf(\textcolor{stringliteral}{"{}\%s: Could not register Netgraph node type, "{}} \(\backslash\)}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01980}01980                                 \textcolor{stringliteral}{"{}error=\%d\(\backslash\)n"{}}, \mbox{\hyperlink{ng__ubt_8h_a903f6064301f1e9967566ea05cf798a1}{NG\_UBT\_NODE\_TYPE}}, error);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01981}01981                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01982}01982 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01983}01983         \textcolor{keywordflow}{case} MOD\_UNLOAD:}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01984}01984                 error = \mbox{\hyperlink{netgraph_8h_ab38b5c23d992569bd43607fbc99ca862}{ng\_rmtype}}(\&\mbox{\hyperlink{ng__ubt_8c_a80a131770518c7fa3758d85054006e7a}{typestruct}});}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01985}01985                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01986}01986 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01987}01987         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01988}01988                 error = EOPNOTSUPP;}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01989}01989                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01990}01990         \}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01991}01991 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01992}01992         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01993}01993 \} \textcolor{comment}{/* ubt\_modevent */}}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01994}01994 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01995}\mbox{\hyperlink{ng__ubt_8c_a38c8a341f6da19f2dcfc313aa1d734f5}{01995}} devclass\_t      \mbox{\hyperlink{ng__ubt_8c_a38c8a341f6da19f2dcfc313aa1d734f5}{ubt\_devclass}};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01996}01996 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01997}\mbox{\hyperlink{ng__ubt_8c_a246338f6c23d3aee1529d7737ffe16b5}{01997}} \textcolor{keyword}{static} device\_method\_t  \mbox{\hyperlink{ng__ubt_8c_a246338f6c23d3aee1529d7737ffe16b5}{ubt\_methods}}[] =}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01998}01998 \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l01999}01999         DEVMETHOD(device\_probe, \mbox{\hyperlink{ng__ubt_8c_ad03d0b0a01b86016c25a80a189d2a9cf}{ubt\_probe}}),}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l02000}02000         DEVMETHOD(device\_attach, \mbox{\hyperlink{ng__ubt_8c_a4a6250ade8d193ca25789e46415a2756}{ubt\_attach}}),}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l02001}02001         DEVMETHOD(device\_detach, \mbox{\hyperlink{ng__ubt_8c_a0807ce14484285543ed8184c65217f7f}{ubt\_detach}}),}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l02002}02002         DEVMETHOD\_END}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l02003}02003 \};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l02004}02004 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l02005}\mbox{\hyperlink{ng__ubt_8c_a4166b795a9d2ddc5da2d4ccf9774cc3d}{02005}} driver\_t                \mbox{\hyperlink{ng__ubt_8c_a4166b795a9d2ddc5da2d4ccf9774cc3d}{ubt\_driver}} =}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l02006}02006 \{}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l02007}02007         .name =    \textcolor{stringliteral}{"{}ubt"{}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l02008}02008         .methods = \mbox{\hyperlink{ng__ubt_8c_a246338f6c23d3aee1529d7737ffe16b5}{ubt\_methods}},}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l02009}02009         .size =    \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structubt__softc}{ubt\_softc}}),}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l02010}02010 \};}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l02011}02011 }
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l02012}\mbox{\hyperlink{ng__ubt_8c_ac409e37aef430d56c9be5b00d4cbb35a}{02012}} \mbox{\hyperlink{ng__ubt_8c_ac409e37aef430d56c9be5b00d4cbb35a}{DRIVER\_MODULE}}(ng\_ubt, uhub, \mbox{\hyperlink{ng__ubt_8c_a4166b795a9d2ddc5da2d4ccf9774cc3d}{ubt\_driver}}, \mbox{\hyperlink{ng__ubt_8c_a38c8a341f6da19f2dcfc313aa1d734f5}{ubt\_devclass}}, \mbox{\hyperlink{ng__ubt_8c_a39cfdb0c8915123573dea71ac81142f2}{ubt\_modevent}}, 0);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l02013}\mbox{\hyperlink{ng__ubt_8c_a9c8a559ad3bc9a10fa1eec2fea5197c7}{02013}} \mbox{\hyperlink{ng__ubt_8c_a9c8a559ad3bc9a10fa1eec2fea5197c7}{MODULE\_VERSION}}(ng\_ubt, \mbox{\hyperlink{ng__bluetooth_8h_aa0d4fe7aaf68485ee71a69d38410da16}{NG\_BLUETOOTH\_VERSION}});}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l02014}\mbox{\hyperlink{ng__ubt_8c_a0edf77b9f1a73a04a2e4d747d80df9ff}{02014}} \mbox{\hyperlink{ng__ubt_8c_a0edf77b9f1a73a04a2e4d747d80df9ff}{MODULE\_DEPEND}}(ng\_ubt, netgraph, \mbox{\hyperlink{netgraph_8h_acc6b5f853e8058f4d5a8ca825ee60c97}{NG\_ABI\_VERSION}}, \mbox{\hyperlink{netgraph_8h_acc6b5f853e8058f4d5a8ca825ee60c97}{NG\_ABI\_VERSION}}, \mbox{\hyperlink{netgraph_8h_acc6b5f853e8058f4d5a8ca825ee60c97}{NG\_ABI\_VERSION}});}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l02015}\mbox{\hyperlink{ng__ubt_8c_af46600f8286ae1a5c5c25358f4afa751}{02015}} \mbox{\hyperlink{ng__ubt_8c_a0edf77b9f1a73a04a2e4d747d80df9ff}{MODULE\_DEPEND}}(ng\_ubt, ng\_hci, \mbox{\hyperlink{ng__bluetooth_8h_aa0d4fe7aaf68485ee71a69d38410da16}{NG\_BLUETOOTH\_VERSION}}, \mbox{\hyperlink{ng__bluetooth_8h_aa0d4fe7aaf68485ee71a69d38410da16}{NG\_BLUETOOTH\_VERSION}}, \mbox{\hyperlink{ng__bluetooth_8h_aa0d4fe7aaf68485ee71a69d38410da16}{NG\_BLUETOOTH\_VERSION}});}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l02016}\mbox{\hyperlink{ng__ubt_8c_a78784ca340bcd3816dbc6f805d927cbc}{02016}} \mbox{\hyperlink{ng__ubt_8c_a0edf77b9f1a73a04a2e4d747d80df9ff}{MODULE\_DEPEND}}(ng\_ubt, ng\_bluetooth, \mbox{\hyperlink{ng__bluetooth_8h_aa0d4fe7aaf68485ee71a69d38410da16}{NG\_BLUETOOTH\_VERSION}}, \mbox{\hyperlink{ng__bluetooth_8h_aa0d4fe7aaf68485ee71a69d38410da16}{NG\_BLUETOOTH\_VERSION}}, \mbox{\hyperlink{ng__bluetooth_8h_aa0d4fe7aaf68485ee71a69d38410da16}{NG\_BLUETOOTH\_VERSION}});}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l02017}\mbox{\hyperlink{ng__ubt_8c_a40f7f1a0052382c5485461767e1db853}{02017}} \mbox{\hyperlink{ng__ubt_8c_a0edf77b9f1a73a04a2e4d747d80df9ff}{MODULE\_DEPEND}}(ng\_ubt, usb, 1, 1, 1);}
\DoxyCodeLine{\Hypertarget{ng__ubt_8c_source_l02018}\mbox{\hyperlink{ng__ubt_8c_ac0bf1bb43e6f13a5755cc23663a9b1d9}{02018}} \mbox{\hyperlink{ng__ubt_8c_ac0bf1bb43e6f13a5755cc23663a9b1d9}{USB\_PNP\_HOST\_INFO}}(\mbox{\hyperlink{ng__ubt_8c_a27dab7af037633d2ff4e204eb88bd670}{ubt\_devs}});}

\end{DoxyCode}
