\hypertarget{ng__hci__evnt_8c_source}{}\doxysection{ng\+\_\+hci\+\_\+evnt.\+c}
\label{ng__hci__evnt_8c_source}\index{netgraph/bluetooth/hci/ng\_hci\_evnt.c@{netgraph/bluetooth/hci/ng\_hci\_evnt.c}}
\mbox{\hyperlink{ng__hci__evnt_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00001}00001 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00002}00002 \textcolor{comment}{ * ng\_hci\_evnt.c}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00003}00003 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00004}00004 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00005}00005 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00006}00006 \textcolor{comment}{ * SPDX-\/License-\/Identifier: BSD-\/2-\/Clause-\/FreeBSD}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00007}00007 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00008}00008 \textcolor{comment}{ * Copyright (c) Maksim Yevmenkin <m\_evmenkin@yahoo.com>}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00009}00009 \textcolor{comment}{ * All rights reserved.}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00010}00010 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00011}00011 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00012}00012 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00013}00013 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00014}00014 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00015}00015 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00016}00016 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00017}00017 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00018}00018 \textcolor{comment}{ *    documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00019}00019 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00020}00020 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00021}00021 \textcolor{comment}{ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00022}00022 \textcolor{comment}{ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00023}00023 \textcolor{comment}{ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00024}00024 \textcolor{comment}{ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00025}00025 \textcolor{comment}{ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00026}00026 \textcolor{comment}{ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00027}00027 \textcolor{comment}{ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00028}00028 \textcolor{comment}{ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00029}00029 \textcolor{comment}{ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00030}00030 \textcolor{comment}{ * SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00031}00031 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00032}00032 \textcolor{comment}{ * \$Id: ng\_hci\_evnt.c,v 1.6 2003/09/08 18:57:51 max Exp \$}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00033}00033 \textcolor{comment}{ * \$FreeBSD\$}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00034}00034 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00035}00035 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00036}00036 \textcolor{preprocessor}{\#include <sys/param.h>}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00037}00037 \textcolor{preprocessor}{\#include <sys/systm.h>}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00038}00038 \textcolor{preprocessor}{\#include <sys/kernel.h>}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00039}00039 \textcolor{preprocessor}{\#include <sys/endian.h>}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00040}00040 \textcolor{preprocessor}{\#include <sys/malloc.h>}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00041}00041 \textcolor{preprocessor}{\#include <sys/mbuf.h>}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00042}00042 \textcolor{preprocessor}{\#include <sys/queue.h>}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00043}00043 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{ng__message_8h}{netgraph/ng\_message.h}}>}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00044}00044 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{netgraph_8h}{netgraph/netgraph.h}}>}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00045}00045 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{ng__bluetooth_8h}{netgraph/bluetooth/include/ng\_bluetooth.h}}>}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00046}00046 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{ng__hci_8h}{netgraph/bluetooth/include/ng\_hci.h}}>}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00047}00047 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{ng__hci__var_8h}{netgraph/bluetooth/hci/ng\_hci\_var.h}}>}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00048}00048 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{ng__hci__cmds_8h}{netgraph/bluetooth/hci/ng\_hci\_cmds.h}}>}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00049}00049 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{ng__hci__evnt_8h}{netgraph/bluetooth/hci/ng\_hci\_evnt.h}}>}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00050}00050 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{ng__hci__ulpi_8h}{netgraph/bluetooth/hci/ng\_hci\_ulpi.h}}>}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00051}00051 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{ng__hci__misc_8h}{netgraph/bluetooth/hci/ng\_hci\_misc.h}}>}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00052}00052 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00053}00053 \textcolor{comment}{/******************************************************************************}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00054}00054 \textcolor{comment}{ ******************************************************************************}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00055}00055 \textcolor{comment}{ **                     HCI event processing module}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00056}00056 \textcolor{comment}{ ******************************************************************************}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00057}00057 \textcolor{comment}{ ******************************************************************************/}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00058}00058 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00059}00059 \textcolor{comment}{/* }}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00060}00060 \textcolor{comment}{ * Event processing routines }}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00061}00061 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00062}00062 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00063}00063 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{ng__hci__evnt_8c_abab809945a01586a2be7cebbeb753e18}{inquiry\_result}}             (\mbox{\hyperlink{structng__hci__unit}{ng\_hci\_unit\_p}}, \textcolor{keyword}{struct} mbuf *);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00064}00064 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{ng__hci__evnt_8c_a6f9ae08768e492858b69771155cc5e54}{con\_compl}}                  (\mbox{\hyperlink{structng__hci__unit}{ng\_hci\_unit\_p}}, \textcolor{keyword}{struct} mbuf *);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00065}00065 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{ng__hci__evnt_8c_a3eb36588c77d0fd2ae1033fb4eeb839a}{con\_req}}                    (\mbox{\hyperlink{structng__hci__unit}{ng\_hci\_unit\_p}}, \textcolor{keyword}{struct} mbuf *);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00066}00066 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{ng__hci__evnt_8c_a11c14d537b3b2f548af29cbf236aeeba}{discon\_compl}}               (\mbox{\hyperlink{structng__hci__unit}{ng\_hci\_unit\_p}}, \textcolor{keyword}{struct} mbuf *);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00067}00067 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{ng__hci__evnt_8c_a8a5206742ba2bfd3d1e3f42e08efa506}{encryption\_change}}          (\mbox{\hyperlink{structng__hci__unit}{ng\_hci\_unit\_p}}, \textcolor{keyword}{struct} mbuf *);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00068}00068 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{ng__hci__evnt_8c_ad7181d9da8c2a74468e48987da24a0b3}{read\_remote\_features\_compl}} (\mbox{\hyperlink{structng__hci__unit}{ng\_hci\_unit\_p}}, \textcolor{keyword}{struct} mbuf *);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00069}00069 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{ng__hci__evnt_8c_a63aaf4d4d915e1c1376cbaffb5370ac1}{qos\_setup\_compl}}            (\mbox{\hyperlink{structng__hci__unit}{ng\_hci\_unit\_p}}, \textcolor{keyword}{struct} mbuf *);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00070}00070 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{ng__hci__evnt_8c_a3f3e72f870dabc64f27be769d29f035d}{hardware\_error}}             (\mbox{\hyperlink{structng__hci__unit}{ng\_hci\_unit\_p}}, \textcolor{keyword}{struct} mbuf *);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00071}00071 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{ng__hci__evnt_8c_a312efab4abeca5fc438aec79973ef56a}{role\_change}}                (\mbox{\hyperlink{structng__hci__unit}{ng\_hci\_unit\_p}}, \textcolor{keyword}{struct} mbuf *);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00072}00072 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{ng__hci__evnt_8c_a5558f542091ea57c05e7612ee45c6e76}{num\_compl\_pkts}}             (\mbox{\hyperlink{structng__hci__unit}{ng\_hci\_unit\_p}}, \textcolor{keyword}{struct} mbuf *);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00073}00073 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{ng__hci__evnt_8c_a0904fffb58cb35aa3b8f7b3ffc4a2257}{mode\_change}}                (\mbox{\hyperlink{structng__hci__unit}{ng\_hci\_unit\_p}}, \textcolor{keyword}{struct} mbuf *);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00074}00074 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{ng__hci__evnt_8c_a3dcf0dde47aa271e9791e11f257b385f}{data\_buffer\_overflow}}       (\mbox{\hyperlink{structng__hci__unit}{ng\_hci\_unit\_p}}, \textcolor{keyword}{struct} mbuf *);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00075}00075 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{ng__hci__evnt_8c_a327a9d42ef63dcfd5b2604dc5f55636f}{read\_clock\_offset\_compl}}    (\mbox{\hyperlink{structng__hci__unit}{ng\_hci\_unit\_p}}, \textcolor{keyword}{struct} mbuf *);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00076}00076 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{ng__hci__evnt_8c_a266f8faecc6e3629b5ad517dc0de4114}{qos\_violation}}              (\mbox{\hyperlink{structng__hci__unit}{ng\_hci\_unit\_p}}, \textcolor{keyword}{struct} mbuf *);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00077}00077 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{ng__hci__evnt_8c_addc84fe15f089fcd8afb6ef287ba6f50}{page\_scan\_mode\_change}}      (\mbox{\hyperlink{structng__hci__unit}{ng\_hci\_unit\_p}}, \textcolor{keyword}{struct} mbuf *);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00078}00078 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{ng__hci__evnt_8c_a052f1f563960564e95b5966596126d68}{page\_scan\_rep\_mode\_change}}  (\mbox{\hyperlink{structng__hci__unit}{ng\_hci\_unit\_p}}, \textcolor{keyword}{struct} mbuf *);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00079}00079 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{ng__hci__evnt_8c_a635dbf953ca30460cb22f7ae015ac8a7}{sync\_con\_queue}}             (\mbox{\hyperlink{structng__hci__unit}{ng\_hci\_unit\_p}}, \mbox{\hyperlink{structng__hci__unit__con}{ng\_hci\_unit\_con\_p}}, \textcolor{keywordtype}{int});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00080}00080 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{ng__hci__evnt_8c_a1f333111cb318907f5b6806e0f67f4c6}{send\_data\_packets}}          (\mbox{\hyperlink{structng__hci__unit}{ng\_hci\_unit\_p}}, \textcolor{keywordtype}{int}, \textcolor{keywordtype}{int});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00081}00081 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{ng__hci__evnt_8c_afdc64b80ccde399c20784873a44a9dfe}{le\_event}}                   (\mbox{\hyperlink{structng__hci__unit}{ng\_hci\_unit\_p}}, \textcolor{keyword}{struct} mbuf *);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00082}00082 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00083}00083 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00084}00084 \textcolor{comment}{ * Process HCI event packet}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00085}00085 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00086}00086 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00087}00087 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00088}\mbox{\hyperlink{ng__hci__evnt_8c_a35d52913c72442b50161939bfce6aedb}{00088}} \mbox{\hyperlink{ng__hci__evnt_8c_a35d52913c72442b50161939bfce6aedb}{ng\_hci\_process\_event}}(\mbox{\hyperlink{structng__hci__unit}{ng\_hci\_unit\_p}} unit, \textcolor{keyword}{struct} mbuf *\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}})}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00089}00089 \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00090}00090         ng\_hci\_event\_pkt\_t      *hdr = NULL;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00091}00091         \textcolor{keywordtype}{int}                      error = 0;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00092}00092 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00093}00093         \textcolor{comment}{/* Get event packet header */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00094}00094         \mbox{\hyperlink{ng__hci__var_8h_a8e7394987275c0d3d5c788d003137197}{NG\_HCI\_M\_PULLUP}}(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, \textcolor{keyword}{sizeof}(*hdr));}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00095}00095         \textcolor{keywordflow}{if} (\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}} == NULL)}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00096}00096                 \textcolor{keywordflow}{return} (ENOBUFS);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00097}00097 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00098}00098         hdr = mtod(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, ng\_hci\_event\_pkt\_t *);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00099}00099 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00100}00100         \mbox{\hyperlink{ng__hci__var_8h_a4ce50ea1a4240b3fa3999028dc40deb5}{NG\_HCI\_INFO}}(}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00101}00101 \textcolor{stringliteral}{"{}\%s: \%s -\/ got HCI event=\%\#x, length=\%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00102}00102                 \_\_func\_\_, \mbox{\hyperlink{netgraph_8h_a810ab9f272b092d488c5a52c6d5349e6}{NG\_NODE\_NAME}}(unit-\/>\mbox{\hyperlink{structng__hci__unit_a532226e8a5d24b9b0f2528e580326ef2}{node}}), hdr-\/>event, hdr-\/>length);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00103}00103 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00104}00104         \textcolor{comment}{/* Get rid of event header and process event */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00105}00105         m\_adj(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, \textcolor{keyword}{sizeof}(*hdr));}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00106}00106 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00107}00107         \textcolor{keywordflow}{switch} (hdr-\/>event) \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00108}00108         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__hci_8h_a9f8f4f5e2081e87bea6acd5eccbe2adf}{NG\_HCI\_EVENT\_INQUIRY\_COMPL}}:}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00109}00109         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__hci_8h_ad1a23c430df2dcd5b3301ba02f8f0b58}{NG\_HCI\_EVENT\_RETURN\_LINK\_KEYS}}:}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00110}00110         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__hci_8h_a7dd78ee7ab3179ee0840d97a999446c6}{NG\_HCI\_EVENT\_PIN\_CODE\_REQ}}:}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00111}00111         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__hci_8h_a92d43b8868d6737d11c4e573910bd844}{NG\_HCI\_EVENT\_LINK\_KEY\_REQ}}:}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00112}00112         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__hci_8h_adb5a7e392476e8ff282a762c2a9d3fc4}{NG\_HCI\_EVENT\_LINK\_KEY\_NOTIFICATION}}:}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00113}00113         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__hci_8h_a4f11e4f3e07f8bf4e331a9d487e85966}{NG\_HCI\_EVENT\_LOOPBACK\_COMMAND}}:}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00114}00114         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__hci_8h_a681ccfc47a514921fc40d7a388301a9d}{NG\_HCI\_EVENT\_AUTH\_COMPL}}:}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00115}00115         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__hci_8h_a0b5a4cffd416eb9fa32576838007c5a7}{NG\_HCI\_EVENT\_CHANGE\_CON\_LINK\_KEY\_COMPL}}:}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00116}00116         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__hci_8h_a42fd8925514adf01932d2d0484a48a91}{NG\_HCI\_EVENT\_MASTER\_LINK\_KEY\_COMPL}}:}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00117}00117         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__hci_8h_abebb93b761f262eb243ce11a4c800855}{NG\_HCI\_EVENT\_FLUSH\_OCCUR}}:  \textcolor{comment}{/* XXX Do we have to handle it? */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00118}00118         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__hci_8h_adb624d4c449ed64939b0776641063120}{NG\_HCI\_EVENT\_MAX\_SLOT\_CHANGE}}:}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00119}00119         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__hci_8h_ab58e25d815d79223d338c037737370dc}{NG\_HCI\_EVENT\_CON\_PKT\_TYPE\_CHANGED}}:}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00120}00120         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__hci_8h_a312750c140ea96874eae6b3a5f9da92b}{NG\_HCI\_EVENT\_BT\_LOGO}}:}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00121}00121         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__hci_8h_a783111c7612296a8ef3ff8bdf2caafab}{NG\_HCI\_EVENT\_VENDOR}}:}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00122}00122         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__hci_8h_af8791ae83c2f56328c576928981d54be}{NG\_HCI\_EVENT\_REMOTE\_NAME\_REQ\_COMPL}}:}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00123}00123         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__hci_8h_a7676918d9a00c3cf960b79dfb00ef419}{NG\_HCI\_EVENT\_READ\_REMOTE\_VER\_INFO\_COMPL}}:}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00124}00124                 \textcolor{comment}{/* These do not need post processing */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00125}00125                 \mbox{\hyperlink{netgraph_8h_a2461bfcdc9e024484ed8037d386620e3}{NG\_FREE\_M}}(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00126}00126                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00127}00127         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__hci_8h_a39a05cd6e0b683b240a40330da40fba9}{NG\_HCI\_EVENT\_LE}}:}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00128}00128                 error = \mbox{\hyperlink{ng__hci__evnt_8c_afdc64b80ccde399c20784873a44a9dfe}{le\_event}}(unit, \mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00129}00129                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00130}00130 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00131}00131         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__hci_8h_aed23b25aacf7782ebcd7593201a61066}{NG\_HCI\_EVENT\_INQUIRY\_RESULT}}:}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00132}00132                 error = \mbox{\hyperlink{ng__hci__evnt_8c_abab809945a01586a2be7cebbeb753e18}{inquiry\_result}}(unit, \mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00133}00133                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00134}00134 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00135}00135         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__hci_8h_a5c4c70a82c155e717c5b8097391dd715}{NG\_HCI\_EVENT\_CON\_COMPL}}:}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00136}00136                 error = \mbox{\hyperlink{ng__hci__evnt_8c_a6f9ae08768e492858b69771155cc5e54}{con\_compl}}(unit, \mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00137}00137                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00138}00138 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00139}00139         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__hci_8h_abdf905b2932b8a925f944131bc0c07a4}{NG\_HCI\_EVENT\_CON\_REQ}}:}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00140}00140                 error = \mbox{\hyperlink{ng__hci__evnt_8c_a3eb36588c77d0fd2ae1033fb4eeb839a}{con\_req}}(unit, \mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00141}00141                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00142}00142 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00143}00143         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__hci_8h_ac251cc332bfbb52abae541c76001bff4}{NG\_HCI\_EVENT\_DISCON\_COMPL}}:}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00144}00144                 error = \mbox{\hyperlink{ng__hci__evnt_8c_a11c14d537b3b2f548af29cbf236aeeba}{discon\_compl}}(unit, \mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00145}00145                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00146}00146 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00147}00147         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__hci_8h_ae801981a10dbaf31367248c899cd5c12}{NG\_HCI\_EVENT\_ENCRYPTION\_CHANGE}}:}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00148}00148                 error = \mbox{\hyperlink{ng__hci__evnt_8c_a8a5206742ba2bfd3d1e3f42e08efa506}{encryption\_change}}(unit, \mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00149}00149                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00150}00150 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00151}00151         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__hci_8h_ab1cc8be42d0fc5f7109ed0456afd7b8d}{NG\_HCI\_EVENT\_READ\_REMOTE\_FEATURES\_COMPL}}:}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00152}00152                 error = \mbox{\hyperlink{ng__hci__evnt_8c_ad7181d9da8c2a74468e48987da24a0b3}{read\_remote\_features\_compl}}(unit, \mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00153}00153                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00154}00154 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00155}00155         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__hci_8h_a3e14e958bce498e43e4e5a1fdd1b1d65}{NG\_HCI\_EVENT\_QOS\_SETUP\_COMPL}}:}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00156}00156                 error = \mbox{\hyperlink{ng__hci__evnt_8c_a63aaf4d4d915e1c1376cbaffb5370ac1}{qos\_setup\_compl}}(unit, \mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00157}00157                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00158}00158 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00159}00159         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__hci_8h_a4c3fc369cb4bc3b1054a58d80e3cec77}{NG\_HCI\_EVENT\_COMMAND\_COMPL}}:}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00160}00160                 error = \mbox{\hyperlink{ng__hci__cmds_8c_a43be41f54ccb05a052ee420efb902798}{ng\_hci\_process\_command\_complete}}(unit, \mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00161}00161                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00162}00162 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00163}00163         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__hci_8h_a12702b230b919983f54517d51b36b977}{NG\_HCI\_EVENT\_COMMAND\_STATUS}}:}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00164}00164                 error = \mbox{\hyperlink{ng__hci__cmds_8c_a3b01f49466d9418746cae64985661ba6}{ng\_hci\_process\_command\_status}}(unit, \mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00165}00165                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00166}00166 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00167}00167         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__hci_8h_a1fea7ff4381b6f31e4f20ae896287027}{NG\_HCI\_EVENT\_HARDWARE\_ERROR}}:}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00168}00168                 error = \mbox{\hyperlink{ng__hci__evnt_8c_a3f3e72f870dabc64f27be769d29f035d}{hardware\_error}}(unit, \mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00169}00169                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00170}00170 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00171}00171         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__hci_8h_ae283b2f2646547614ac86e03854211e9}{NG\_HCI\_EVENT\_ROLE\_CHANGE}}:}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00172}00172                 error = \mbox{\hyperlink{ng__hci__evnt_8c_a312efab4abeca5fc438aec79973ef56a}{role\_change}}(unit, \mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00173}00173                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00174}00174 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00175}00175         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__hci_8h_a6112ca70ad191a34793bb59104931e69}{NG\_HCI\_EVENT\_NUM\_COMPL\_PKTS}}:}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00176}00176                 error = \mbox{\hyperlink{ng__hci__evnt_8c_a5558f542091ea57c05e7612ee45c6e76}{num\_compl\_pkts}}(unit, \mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00177}00177                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00178}00178 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00179}00179         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__hci_8h_ae4acaa2f83b1b85a3c87a65324283777}{NG\_HCI\_EVENT\_MODE\_CHANGE}}:}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00180}00180                 error = \mbox{\hyperlink{ng__hci__evnt_8c_a0904fffb58cb35aa3b8f7b3ffc4a2257}{mode\_change}}(unit, \mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00181}00181                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00182}00182 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00183}00183         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__hci_8h_a9fc79059c480b54a7d1c7929793fe856}{NG\_HCI\_EVENT\_DATA\_BUFFER\_OVERFLOW}}:}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00184}00184                 error = \mbox{\hyperlink{ng__hci__evnt_8c_a3dcf0dde47aa271e9791e11f257b385f}{data\_buffer\_overflow}}(unit, \mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00185}00185                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00186}00186 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00187}00187         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__hci_8h_ab6f50606bf09f9b7b5cf51af8e51ce60}{NG\_HCI\_EVENT\_READ\_CLOCK\_OFFSET\_COMPL}}:}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00188}00188                 error = \mbox{\hyperlink{ng__hci__evnt_8c_a327a9d42ef63dcfd5b2604dc5f55636f}{read\_clock\_offset\_compl}}(unit, \mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00189}00189                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00190}00190 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00191}00191         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__hci_8h_a3fba60430c0660a6d00203997347b9b6}{NG\_HCI\_EVENT\_QOS\_VIOLATION}}:}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00192}00192                 error = \mbox{\hyperlink{ng__hci__evnt_8c_a266f8faecc6e3629b5ad517dc0de4114}{qos\_violation}}(unit, \mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00193}00193                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00194}00194 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00195}00195         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__hci_8h_abc98e6abdcb4de6c134d6622e98c7679}{NG\_HCI\_EVENT\_PAGE\_SCAN\_MODE\_CHANGE}}:}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00196}00196                 error = \mbox{\hyperlink{ng__hci__evnt_8c_addc84fe15f089fcd8afb6ef287ba6f50}{page\_scan\_mode\_change}}(unit, \mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00197}00197                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00198}00198 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00199}00199         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__hci_8h_af19ae33e8b1936ec7ee7a3c1c7dc65db}{NG\_HCI\_EVENT\_PAGE\_SCAN\_REP\_MODE\_CHANGE}}:}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00200}00200                 error = \mbox{\hyperlink{ng__hci__evnt_8c_a052f1f563960564e95b5966596126d68}{page\_scan\_rep\_mode\_change}}(unit, \mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00201}00201                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00202}00202 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00203}00203         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00204}00204                 \mbox{\hyperlink{netgraph_8h_a2461bfcdc9e024484ed8037d386620e3}{NG\_FREE\_M}}(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00205}00205                 error = EINVAL;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00206}00206                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00207}00207         \}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00208}00208 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00209}00209         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00210}00210 \} \textcolor{comment}{/* ng\_hci\_process\_event */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00211}00211 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00212}00212 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00213}00213 \textcolor{comment}{ * Send ACL and/or SCO data to the unit driver}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00214}00214 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00215}00215 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00216}00216 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00217}\mbox{\hyperlink{ng__hci__evnt_8c_a2de49eab926d8f05c99c0cc3748ed6c4}{00217}} \mbox{\hyperlink{ng__hci__evnt_8c_a2de49eab926d8f05c99c0cc3748ed6c4}{ng\_hci\_send\_data}}(\mbox{\hyperlink{structng__hci__unit}{ng\_hci\_unit\_p}} unit)}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00218}00218 \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00219}00219         \textcolor{keywordtype}{int}     \mbox{\hyperlink{netflow_8h_af6a39bfc7e1dc3b6f9c997c1c43fa996}{count}};}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00220}00220 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00221}00221         \textcolor{comment}{/* Send ACL data */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00222}00222         \mbox{\hyperlink{ng__hci__var_8h_abee8224a88d3b2ef0df56032319b5337}{NG\_HCI\_BUFF\_ACL\_AVAIL}}(unit-\/>\mbox{\hyperlink{structng__hci__unit_ae360e0f96519ea18d18b3ed06a5198f8}{buffer}}, \mbox{\hyperlink{netflow_8h_af6a39bfc7e1dc3b6f9c997c1c43fa996}{count}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00223}00223 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00224}00224         \mbox{\hyperlink{ng__hci__var_8h_a4ce50ea1a4240b3fa3999028dc40deb5}{NG\_HCI\_INFO}}(}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00225}00225 \textcolor{stringliteral}{"{}\%s: \%s -\/ sending ACL data packets, count=\%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00226}00226                 \_\_func\_\_, \mbox{\hyperlink{netgraph_8h_a810ab9f272b092d488c5a52c6d5349e6}{NG\_NODE\_NAME}}(unit-\/>\mbox{\hyperlink{structng__hci__unit_a532226e8a5d24b9b0f2528e580326ef2}{node}}), \mbox{\hyperlink{netflow_8h_af6a39bfc7e1dc3b6f9c997c1c43fa996}{count}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00227}00227 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00228}00228         \textcolor{keywordflow}{if} (\mbox{\hyperlink{netflow_8h_af6a39bfc7e1dc3b6f9c997c1c43fa996}{count}} > 0) \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00229}00229                 \mbox{\hyperlink{netflow_8h_af6a39bfc7e1dc3b6f9c997c1c43fa996}{count}} = \mbox{\hyperlink{ng__hci__evnt_8c_a1f333111cb318907f5b6806e0f67f4c6}{send\_data\_packets}}(unit, \mbox{\hyperlink{ng__hci_8h_aac64c463cc734bbdf8ba030619e8a64d}{NG\_HCI\_LINK\_ACL}}, \mbox{\hyperlink{netflow_8h_af6a39bfc7e1dc3b6f9c997c1c43fa996}{count}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00230}00230                 \mbox{\hyperlink{ng__hci__var_8h_a60dff33d0f7442dc414f801f9439dfe0}{NG\_HCI\_STAT\_ACL\_SENT}}(unit-\/>\mbox{\hyperlink{structng__hci__unit_ac22f7569b709b8364fded0ddbb77c583}{stat}}, \mbox{\hyperlink{netflow_8h_af6a39bfc7e1dc3b6f9c997c1c43fa996}{count}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00231}00231                 \mbox{\hyperlink{ng__hci__var_8h_a84483a47fd68a133bbb0a024ede961f2}{NG\_HCI\_BUFF\_ACL\_USE}}(unit-\/>\mbox{\hyperlink{structng__hci__unit_ae360e0f96519ea18d18b3ed06a5198f8}{buffer}}, \mbox{\hyperlink{netflow_8h_af6a39bfc7e1dc3b6f9c997c1c43fa996}{count}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00232}00232         \}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00233}00233 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00234}00234         \textcolor{comment}{/* Send SCO data */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00235}00235         \mbox{\hyperlink{ng__hci__var_8h_abb723397c8256b6a5695706f661297dc}{NG\_HCI\_BUFF\_SCO\_AVAIL}}(unit-\/>\mbox{\hyperlink{structng__hci__unit_ae360e0f96519ea18d18b3ed06a5198f8}{buffer}}, \mbox{\hyperlink{netflow_8h_af6a39bfc7e1dc3b6f9c997c1c43fa996}{count}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00236}00236 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00237}00237         \mbox{\hyperlink{ng__hci__var_8h_a4ce50ea1a4240b3fa3999028dc40deb5}{NG\_HCI\_INFO}}(}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00238}00238 \textcolor{stringliteral}{"{}\%s: \%s -\/ sending SCO data packets, count=\%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00239}00239                 \_\_func\_\_, \mbox{\hyperlink{netgraph_8h_a810ab9f272b092d488c5a52c6d5349e6}{NG\_NODE\_NAME}}(unit-\/>\mbox{\hyperlink{structng__hci__unit_a532226e8a5d24b9b0f2528e580326ef2}{node}}), \mbox{\hyperlink{netflow_8h_af6a39bfc7e1dc3b6f9c997c1c43fa996}{count}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00240}00240 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00241}00241         \textcolor{keywordflow}{if} (\mbox{\hyperlink{netflow_8h_af6a39bfc7e1dc3b6f9c997c1c43fa996}{count}} > 0) \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00242}00242                 \mbox{\hyperlink{netflow_8h_af6a39bfc7e1dc3b6f9c997c1c43fa996}{count}} = \mbox{\hyperlink{ng__hci__evnt_8c_a1f333111cb318907f5b6806e0f67f4c6}{send\_data\_packets}}(unit, \mbox{\hyperlink{ng__hci_8h_af8bd621d46e75d10e745698aa7b543b2}{NG\_HCI\_LINK\_SCO}}, \mbox{\hyperlink{netflow_8h_af6a39bfc7e1dc3b6f9c997c1c43fa996}{count}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00243}00243                 \mbox{\hyperlink{ng__hci__var_8h_a9bd5754b79b2a2e53f9d39d250c455f2}{NG\_HCI\_STAT\_SCO\_SENT}}(unit-\/>\mbox{\hyperlink{structng__hci__unit_ac22f7569b709b8364fded0ddbb77c583}{stat}}, \mbox{\hyperlink{netflow_8h_af6a39bfc7e1dc3b6f9c997c1c43fa996}{count}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00244}00244                 \mbox{\hyperlink{ng__hci__var_8h_a378c76045fd695eb959dade134407777}{NG\_HCI\_BUFF\_SCO\_USE}}(unit-\/>\mbox{\hyperlink{structng__hci__unit_ae360e0f96519ea18d18b3ed06a5198f8}{buffer}}, \mbox{\hyperlink{netflow_8h_af6a39bfc7e1dc3b6f9c997c1c43fa996}{count}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00245}00245         \}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00246}00246 \} \textcolor{comment}{/* ng\_hci\_send\_data */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00247}00247 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00248}00248 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00249}00249 \textcolor{comment}{ * Send data packets to the lower layer.}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00250}00250 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00251}00251 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00252}00252 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00253}\mbox{\hyperlink{ng__hci__evnt_8c_a1f333111cb318907f5b6806e0f67f4c6}{00253}} \mbox{\hyperlink{ng__hci__evnt_8c_a1f333111cb318907f5b6806e0f67f4c6}{send\_data\_packets}}(\mbox{\hyperlink{structng__hci__unit}{ng\_hci\_unit\_p}} unit, \textcolor{keywordtype}{int} link\_type, \textcolor{keywordtype}{int} limit)}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00254}00254 \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00255}00255         \mbox{\hyperlink{structng__hci__unit__con}{ng\_hci\_unit\_con\_p}}      con = NULL, winner = NULL;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00256}00256         \textcolor{keywordtype}{int}                     reallink\_type;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00257}00257         \mbox{\hyperlink{structng__item}{item\_p}}                    item = NULL;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00258}00258         \textcolor{keywordtype}{int}                     min\_pending, total\_sent, sent, error, v;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00259}00259 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00260}00260         \textcolor{keywordflow}{for} (total\_sent = 0; limit > 0; ) \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00261}00261                 min\_pending = 0x0fffffff;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00262}00262                 winner = NULL;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00263}00263 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00264}00264                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00265}00265 \textcolor{comment}{                 * Find the connection that has has data to send }}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00266}00266 \textcolor{comment}{                 * and the smallest number of pending packets}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00267}00267 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00268}00268 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00269}00269                 LIST\_FOREACH(con, \&unit-\/>con\_list, next) \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00270}00270                         reallink\_type = (con-\/>\mbox{\hyperlink{structng__hci__unit__con_a3a396246ceda9716f91a480f401bdc7b}{link\_type}} == \mbox{\hyperlink{ng__hci_8h_af8bd621d46e75d10e745698aa7b543b2}{NG\_HCI\_LINK\_SCO}})?}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00271}00271                                 \mbox{\hyperlink{ng__hci_8h_af8bd621d46e75d10e745698aa7b543b2}{NG\_HCI\_LINK\_SCO}}: \mbox{\hyperlink{ng__hci_8h_aac64c463cc734bbdf8ba030619e8a64d}{NG\_HCI\_LINK\_ACL}};}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00272}00272                         \textcolor{keywordflow}{if} (reallink\_type != link\_type)\{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00273}00273                                 \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00274}00274                         \}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00275}00275                         \textcolor{keywordflow}{if} (\mbox{\hyperlink{ng__bluetooth_8h_acb1f5ba7f8f386e1b8724d1dc8576899}{NG\_BT\_ITEMQ\_LEN}}(\&con-\/>\mbox{\hyperlink{structng__hci__unit__con_af20ed149a4ddf303eb6d253c3f362c24}{conq}}) == 0)}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00276}00276                                 \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00277}00277         }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00278}00278                         \textcolor{keywordflow}{if} (con-\/>\mbox{\hyperlink{structng__hci__unit__con_aa23024b50578ed77f37979afcad6539f}{pending}} < min\_pending) \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00279}00279                                 winner = con;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00280}00280                                 min\_pending = con-\/>\mbox{\hyperlink{structng__hci__unit__con_aa23024b50578ed77f37979afcad6539f}{pending}};}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00281}00281                         \}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00282}00282                 \}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00283}00283 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00284}00284                 \textcolor{keywordflow}{if} (winner == NULL)}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00285}00285                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00286}00286 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00287}00287                 \textcolor{comment}{/* }}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00288}00288 \textcolor{comment}{                 * OK, we have a winner now send as much packets as we can}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00289}00289 \textcolor{comment}{                 * Count the number of packets we have sent and then sync}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00290}00290 \textcolor{comment}{                 * winner connection queue.}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00291}00291 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00292}00292 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00293}00293                 \textcolor{keywordflow}{for} (sent = 0; limit > 0; limit -\/-\/, total\_sent ++, sent ++) \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00294}00294                         \mbox{\hyperlink{ng__bluetooth_8h_ac75bfc439cac72b87f9e8fe561a6eb03}{NG\_BT\_ITEMQ\_DEQUEUE}}(\&winner-\/>conq, item);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00295}00295                         \textcolor{keywordflow}{if} (item == NULL)}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00296}00296                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00297}00297                 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00298}00298                         \mbox{\hyperlink{ng__hci__var_8h_a4ce50ea1a4240b3fa3999028dc40deb5}{NG\_HCI\_INFO}}(}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00299}00299 \textcolor{stringliteral}{"{}\%s: \%s -\/ sending data packet, handle=\%d, len=\%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00300}00300                                 \_\_func\_\_, \mbox{\hyperlink{netgraph_8h_a810ab9f272b092d488c5a52c6d5349e6}{NG\_NODE\_NAME}}(unit-\/>\mbox{\hyperlink{structng__hci__unit_a532226e8a5d24b9b0f2528e580326ef2}{node}}), }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00301}00301                                 winner-\/>con\_handle, \mbox{\hyperlink{netgraph_8h_a08cf471587aa844de10e9c3c1d7a8c28}{NGI\_M}}(item)-\/>m\_pkthdr.len);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00302}00302 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00303}00303                         \textcolor{comment}{/* Check if driver hook still there */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00304}00304                         v = (unit-\/>\mbox{\hyperlink{structng__hci__unit_a1bf05d29fef0203e3b36025a41808f04}{drv}} != NULL \&\& \mbox{\hyperlink{netgraph_8h_ac8409b5ecd2c70db4911cc5d9fe66901}{NG\_HOOK\_IS\_VALID}}(unit-\/>\mbox{\hyperlink{structng__hci__unit_a1bf05d29fef0203e3b36025a41808f04}{drv}}));}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00305}00305                         \textcolor{keywordflow}{if} (!v || (unit-\/>\mbox{\hyperlink{structng__hci__unit_a0e60c241953c2263d2ee904b1914e7e7}{state}} \& \mbox{\hyperlink{ng__hci_8h_a9d234f4b5c2b5367f39038a94a5c913f}{NG\_HCI\_UNIT\_READY}}) != }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00306}00306                                         \mbox{\hyperlink{ng__hci_8h_a9d234f4b5c2b5367f39038a94a5c913f}{NG\_HCI\_UNIT\_READY}}) \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00307}00307                                 \mbox{\hyperlink{ng__hci__var_8h_a347403c3d9eebde8aa890c65b4ab5874}{NG\_HCI\_ERR}}(}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00308}00308 \textcolor{stringliteral}{"{}\%s: \%s -\/ could not send data. Hook \(\backslash\)"{}\%s\(\backslash\)"{} is \%svalid, state=\%\#x\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00309}00309                                         \_\_func\_\_, \mbox{\hyperlink{netgraph_8h_a810ab9f272b092d488c5a52c6d5349e6}{NG\_NODE\_NAME}}(unit-\/>\mbox{\hyperlink{structng__hci__unit_a532226e8a5d24b9b0f2528e580326ef2}{node}}),}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00310}00310                                         \mbox{\hyperlink{ng__hci_8h_a00340145c04f85cd8e53989946aa8a31}{NG\_HCI\_HOOK\_DRV}}, ((v)? \textcolor{stringliteral}{"{}"{}} : \textcolor{stringliteral}{"{}not "{}}),}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00311}00311                                         unit-\/>\mbox{\hyperlink{structng__hci__unit_a0e60c241953c2263d2ee904b1914e7e7}{state}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00312}00312 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00313}00313                                 \mbox{\hyperlink{netgraph_8h_ab1451f92a5ed6715897d40bf802b06d5}{NG\_FREE\_ITEM}}(item);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00314}00314                                 error = ENOTCONN;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00315}00315                         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00316}00316                                 v = \mbox{\hyperlink{netgraph_8h_a08cf471587aa844de10e9c3c1d7a8c28}{NGI\_M}}(item)-\/>m\_pkthdr.len;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00317}00317 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00318}00318                                 \textcolor{comment}{/* Give packet to raw hook */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00319}00319                                 \mbox{\hyperlink{ng__hci__misc_8c_ad3c03037f3f36deb03b8bd60ed4f0c46}{ng\_hci\_mtap}}(unit, \mbox{\hyperlink{netgraph_8h_a08cf471587aa844de10e9c3c1d7a8c28}{NGI\_M}}(item));}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00320}00320 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00321}00321                                 \textcolor{comment}{/* ... and forward item to the driver */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00322}00322                                 \mbox{\hyperlink{netgraph_8h_a52b448e5f7440d396bb16d481af55b64}{NG\_FWD\_ITEM\_HOOK}}(error, item, unit-\/>\mbox{\hyperlink{structng__hci__unit_a1bf05d29fef0203e3b36025a41808f04}{drv}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00323}00323                         \}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00324}00324 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00325}00325                         \textcolor{keywordflow}{if} (error != 0) \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00326}00326                                 \mbox{\hyperlink{ng__hci__var_8h_a347403c3d9eebde8aa890c65b4ab5874}{NG\_HCI\_ERR}}(}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00327}00327 \textcolor{stringliteral}{"{}\%s: \%s -\/ could not send data packet, handle=\%d, error=\%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00328}00328                                         \_\_func\_\_, \mbox{\hyperlink{netgraph_8h_a810ab9f272b092d488c5a52c6d5349e6}{NG\_NODE\_NAME}}(unit-\/>\mbox{\hyperlink{structng__hci__unit_a532226e8a5d24b9b0f2528e580326ef2}{node}}),}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00329}00329                                         winner-\/>con\_handle, error);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00330}00330                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00331}00331                         \}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00332}00332 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00333}00333                         winner-\/>pending ++;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00334}00334                         \mbox{\hyperlink{ng__hci__var_8h_ac9412842e19108c8bf6063c977b67d1e}{NG\_HCI\_STAT\_BYTES\_SENT}}(unit-\/>\mbox{\hyperlink{structng__hci__unit_ac22f7569b709b8364fded0ddbb77c583}{stat}}, v);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00335}00335                 \}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00336}00336 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00337}00337                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00338}00338 \textcolor{comment}{                 * Sync connection queue for the winner}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00339}00339 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00340}00340                 \mbox{\hyperlink{ng__hci__evnt_8c_a635dbf953ca30460cb22f7ae015ac8a7}{sync\_con\_queue}}(unit, winner, sent);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00341}00341         \}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00342}00342 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00343}00343         \textcolor{keywordflow}{return} (total\_sent);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00344}00344 \} \textcolor{comment}{/* send\_data\_packets */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00345}00345 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00346}00346 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00347}00347 \textcolor{comment}{ * Send flow control messages to the upper layer}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00348}00348 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00349}00349 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00350}00350 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00351}\mbox{\hyperlink{ng__hci__evnt_8c_a635dbf953ca30460cb22f7ae015ac8a7}{00351}} \mbox{\hyperlink{ng__hci__evnt_8c_a635dbf953ca30460cb22f7ae015ac8a7}{sync\_con\_queue}}(\mbox{\hyperlink{structng__hci__unit}{ng\_hci\_unit\_p}} unit, \mbox{\hyperlink{structng__hci__unit__con}{ng\_hci\_unit\_con\_p}} con, \textcolor{keywordtype}{int} completed)}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00352}00352 \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00353}00353         \mbox{\hyperlink{structng__hook}{hook\_p}}                             hook = NULL;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00354}00354         \textcolor{keyword}{struct }\mbox{\hyperlink{structng__mesg}{ng\_mesg}}                   *msg = NULL;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00355}00355         \mbox{\hyperlink{structng__hci__sync__con__queue__ep}{ng\_hci\_sync\_con\_queue\_ep}}        *\mbox{\hyperlink{ng__pppoe_8c_adc6e5733fc3c22f0a7b2914188c49c90}{state}} = NULL;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00356}00356         \textcolor{keywordtype}{int}                              error;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00357}00357 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00358}00358         hook = (con-\/>\mbox{\hyperlink{structng__hci__unit__con_a3a396246ceda9716f91a480f401bdc7b}{link\_type}} != \mbox{\hyperlink{ng__hci_8h_af8bd621d46e75d10e745698aa7b543b2}{NG\_HCI\_LINK\_SCO}})? unit-\/>\mbox{\hyperlink{structng__hci__unit_a77aaa67e35c0a4d7c3ebcd9d208b1f99}{acl}} : unit-\/>\mbox{\hyperlink{structng__hci__unit_ad221eefe183cbd0ff5ed2ed600e8cc46}{sco}};}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00359}00359         if (hook == NULL || \mbox{\hyperlink{netgraph_8h_a360d005d270d1ff7e5133d800678321f}{NG\_HOOK\_NOT\_VALID}}(hook))}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00360}00360                 \textcolor{keywordflow}{return} (ENOTCONN);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00361}00361 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00362}00362         \mbox{\hyperlink{ng__message_8h_ae4949040eaeb6dbcf2007eb8881b9d9a}{NG\_MKMESSAGE}}(msg, \mbox{\hyperlink{ng__hci_8h_a88d50dc5f2ad81304c0c5d498f3e18d5}{NGM\_HCI\_COOKIE}}, \mbox{\hyperlink{ng__hci_8h_a50f35356e574eee48278cc6765eeaa91}{NGM\_HCI\_SYNC\_CON\_QUEUE}},}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00363}00363                 \textcolor{keyword}{sizeof}(*\mbox{\hyperlink{ng__pppoe_8c_adc6e5733fc3c22f0a7b2914188c49c90}{state}}), M\_NOWAIT);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00364}00364         \textcolor{keywordflow}{if} (msg == NULL)}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00365}00365                 \textcolor{keywordflow}{return} (ENOMEM);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00366}00366 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00367}00367         \mbox{\hyperlink{ng__pppoe_8c_adc6e5733fc3c22f0a7b2914188c49c90}{state}} = (\mbox{\hyperlink{structng__hci__sync__con__queue__ep}{ng\_hci\_sync\_con\_queue\_ep}} *)(msg-\/>\mbox{\hyperlink{structng__mesg_afe7d2a81b120e0f3d15facd293174c6d}{data}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00368}00368         \mbox{\hyperlink{ng__pppoe_8c_adc6e5733fc3c22f0a7b2914188c49c90}{state}}-\/>con\_handle = con-\/>\mbox{\hyperlink{structng__hci__unit__con_a02c77256cfd83dca50038f1281f78c2d}{con\_handle}};}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00369}00369         \mbox{\hyperlink{ng__pppoe_8c_adc6e5733fc3c22f0a7b2914188c49c90}{state}}-\/>completed = completed;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00370}00370 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00371}00371         \mbox{\hyperlink{netgraph_8h_ae8298dadbe3b9101589fd6f978306c4d}{NG\_SEND\_MSG\_HOOK}}(error, unit-\/>\mbox{\hyperlink{structng__hci__unit_a532226e8a5d24b9b0f2528e580326ef2}{node}}, msg, hook, 0);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00372}00372 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00373}00373         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00374}00374 \} \textcolor{comment}{/* sync\_con\_queue */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00375}00375 \textcolor{comment}{/* le meta event */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00376}00376 \textcolor{comment}{/* Inquiry result event */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00377}00377 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00378}\mbox{\hyperlink{ng__hci__evnt_8c_a9bbdbd2bde0ef7ee6eba217c7942a891}{00378}} \mbox{\hyperlink{ng__hci__evnt_8c_a9bbdbd2bde0ef7ee6eba217c7942a891}{le\_advertizing\_report}}(\mbox{\hyperlink{structng__hci__unit}{ng\_hci\_unit\_p}} unit, \textcolor{keyword}{struct} mbuf *\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}})}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00379}00379 \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00380}00380         ng\_hci\_le\_advertising\_report\_ep *ep = NULL;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00381}00381         \mbox{\hyperlink{structng__hci__neighbor}{ng\_hci\_neighbor\_p}}               n = NULL;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00382}00382         bdaddr\_t                         bdaddr;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00383}00383         \textcolor{keywordtype}{int}                              error = 0;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00384}00384         \textcolor{keywordtype}{int}                              num\_reports = 0;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00385}00385         u\_int8\_t event\_type;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00386}00386         u\_int8\_t addr\_type;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00387}00387 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00388}00388         \mbox{\hyperlink{ng__hci__var_8h_a8e7394987275c0d3d5c788d003137197}{NG\_HCI\_M\_PULLUP}}(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, \textcolor{keyword}{sizeof}(*ep));}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00389}00389         \textcolor{keywordflow}{if} (\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}} == NULL)}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00390}00390                 \textcolor{keywordflow}{return} (ENOBUFS);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00391}00391 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00392}00392         ep = mtod(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, ng\_hci\_le\_advertising\_report\_ep *);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00393}00393         num\_reports = ep-\/>num\_reports;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00394}00394         m\_adj(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, \textcolor{keyword}{sizeof}(*ep));}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00395}00395         ep = NULL;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00396}00396 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00397}00397         \textcolor{keywordflow}{for} (; num\_reports > 0; num\_reports -\/-\/) \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00398}00398                 \textcolor{comment}{/* Get remote unit address */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00399}00399                 \mbox{\hyperlink{ng__hci__var_8h_a8e7394987275c0d3d5c788d003137197}{NG\_HCI\_M\_PULLUP}}(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, \textcolor{keyword}{sizeof}(u\_int8\_t));}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00400}00400                 event\_type = *mtod(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, u\_int8\_t *);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00401}00401                 m\_adj(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, \textcolor{keyword}{sizeof}(u\_int8\_t));}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00402}00402                 \mbox{\hyperlink{ng__hci__var_8h_a8e7394987275c0d3d5c788d003137197}{NG\_HCI\_M\_PULLUP}}(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, \textcolor{keyword}{sizeof}(u\_int8\_t));}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00403}00403                 addr\_type = *mtod(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, u\_int8\_t *);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00404}00404                 m\_adj(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, \textcolor{keyword}{sizeof}(u\_int8\_t));}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00405}00405 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00406}00406                 m\_copydata(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, 0, \textcolor{keyword}{sizeof}(bdaddr), (caddr\_t) \&bdaddr);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00407}00407                 m\_adj(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, \textcolor{keyword}{sizeof}(bdaddr));}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00408}00408                 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00409}00409                 \textcolor{comment}{/* Lookup entry in the cache */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00410}00410                 n = \mbox{\hyperlink{ng__hci__misc_8c_afd85df2950d8d6fd0e5237667595c655}{ng\_hci\_get\_neighbor}}(unit, \&bdaddr, (addr\_type) ? \mbox{\hyperlink{ng__hci_8h_a557665f3f28bb33759ed8ec4eb28d385}{NG\_HCI\_LINK\_LE\_RANDOM}}:\mbox{\hyperlink{ng__hci_8h_afecc38805812b20f02942504b17892f4}{NG\_HCI\_LINK\_LE\_PUBLIC}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00411}00411                 \textcolor{keywordflow}{if} (n == NULL) \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00412}00412                         \textcolor{comment}{/* Create new entry */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00413}00413                         n = \mbox{\hyperlink{ng__hci__misc_8c_a27064102479d8203c42f5ddfa980c029}{ng\_hci\_new\_neighbor}}(unit);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00414}00414                         \textcolor{keywordflow}{if} (n == NULL) \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00415}00415                                 error = ENOMEM;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00416}00416                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00417}00417                         \}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00418}00418                         bcopy(\&bdaddr, \&n-\/>\mbox{\hyperlink{structng__hci__neighbor_a9c92229bd13342eb3bcdef1c0c558308}{bdaddr}}, \textcolor{keyword}{sizeof}(n-\/>\mbox{\hyperlink{structng__hci__neighbor_a9c92229bd13342eb3bcdef1c0c558308}{bdaddr}}));}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00419}00419                         n-\/>\mbox{\hyperlink{structng__hci__neighbor_a17508a20bea1459561a655c952746f53}{addrtype}} = (addr\_type)? \mbox{\hyperlink{ng__hci_8h_a557665f3f28bb33759ed8ec4eb28d385}{NG\_HCI\_LINK\_LE\_RANDOM}} :}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00420}00420                           \mbox{\hyperlink{ng__hci_8h_afecc38805812b20f02942504b17892f4}{NG\_HCI\_LINK\_LE\_PUBLIC}};}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00421}00421                         }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00422}00422                 \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00423}00423                         getmicrotime(\&n-\/>\mbox{\hyperlink{structng__hci__neighbor_ada2f574a39016f8415ea44335795347d}{updated}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00424}00424                 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00425}00425                 \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00426}00426                         \textcolor{comment}{/* }}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00427}00427 \textcolor{comment}{                         * TODO: Make these information }}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00428}00428 \textcolor{comment}{                         * Available from userland.}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00429}00429 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00430}00430                         u\_int8\_t length\_data;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00431}00431                         }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00432}00432                         \textcolor{keyword}{event} = m\_pullup(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, \textcolor{keyword}{sizeof}(u\_int8\_t));}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00433}00433                         \textcolor{keywordflow}{if}(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}} == NULL)\{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00434}00434                                 \mbox{\hyperlink{ng__hci__var_8h_add54db430ea340e556df410026a5c003}{NG\_HCI\_WARN}}(\textcolor{stringliteral}{"{}\%s: Event datasize Pullup Failed\(\backslash\)n"{}}, \_\_func\_\_);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00435}00435                                 \textcolor{keywordflow}{goto} out;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00436}00436                         \}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00437}00437                         length\_data = *mtod(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, u\_int8\_t *);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00438}00438                         m\_adj(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, \textcolor{keyword}{sizeof}(u\_int8\_t));}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00439}00439                         n-\/>\mbox{\hyperlink{structng__hci__neighbor_a5b960fa934acd5e884623be0b0044840}{extinq\_size}} = (length\_data < \mbox{\hyperlink{ng__hci_8h_a507e0e3af54d329d7de5528859012743}{NG\_HCI\_EXTINQ\_MAX}})?}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00440}00440                                 length\_data : \mbox{\hyperlink{ng__hci_8h_a507e0e3af54d329d7de5528859012743}{NG\_HCI\_EXTINQ\_MAX}};}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00441}00441                         }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00442}00442                         \textcolor{comment}{/*Advertizement data*/}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00443}00443                         \textcolor{keyword}{event} = m\_pullup(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, n-\/>\mbox{\hyperlink{structng__hci__neighbor_a5b960fa934acd5e884623be0b0044840}{extinq\_size}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00444}00444                         \textcolor{keywordflow}{if}(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}} == NULL)\{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00445}00445                                 \mbox{\hyperlink{ng__hci__var_8h_add54db430ea340e556df410026a5c003}{NG\_HCI\_WARN}}(\textcolor{stringliteral}{"{}\%s: Event data pullup Failed\(\backslash\)n"{}}, \_\_func\_\_);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00446}00446                                 \textcolor{keywordflow}{goto} out;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00447}00447                         \}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00448}00448                         m\_copydata(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, 0, n-\/>\mbox{\hyperlink{structng__hci__neighbor_a5b960fa934acd5e884623be0b0044840}{extinq\_size}}, n-\/>\mbox{\hyperlink{structng__hci__neighbor_aba927c591accb46e7e49eaf78c49069a}{extinq\_data}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00449}00449                         m\_adj(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, n-\/>\mbox{\hyperlink{structng__hci__neighbor_a5b960fa934acd5e884623be0b0044840}{extinq\_size}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00450}00450                         \textcolor{keyword}{event} = m\_pullup(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, \textcolor{keyword}{sizeof}(\textcolor{keywordtype}{char} ));}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00451}00451                         \textcolor{comment}{/*Get RSSI*/}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00452}00452                         \textcolor{keywordflow}{if}(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}} == NULL)\{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00453}00453                                 \mbox{\hyperlink{ng__hci__var_8h_add54db430ea340e556df410026a5c003}{NG\_HCI\_WARN}}(\textcolor{stringliteral}{"{}\%s: Event rssi pull up Failed\(\backslash\)n"{}}, \_\_func\_\_);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00454}00454                                 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00455}00455                                 \textcolor{keywordflow}{goto} out;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00456}00456                         \}                               }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00457}00457                         n-\/>\mbox{\hyperlink{structng__hci__neighbor_af8b3a67a87da9a9f0211a69322a6e811}{page\_scan\_mode}} = *mtod(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, \textcolor{keywordtype}{char} *);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00458}00458                         m\_adj(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, \textcolor{keyword}{sizeof}(u\_int8\_t));}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00459}00459                 \}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00460}00460         \}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00461}00461  out:}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00462}00462         \mbox{\hyperlink{netgraph_8h_a2461bfcdc9e024484ed8037d386620e3}{NG\_FREE\_M}}(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00463}00463 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00464}00464         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00465}00465 \} \textcolor{comment}{/* inquiry\_result */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00466}00466 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00467}\mbox{\hyperlink{ng__hci__evnt_8c_aa927f3453f6fa69bab6c3727dc7dc196}{00467}} \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{ng__hci__evnt_8c_aa927f3453f6fa69bab6c3727dc7dc196}{le\_connection\_complete}}(\mbox{\hyperlink{structng__hci__unit}{ng\_hci\_unit\_p}} unit, \textcolor{keyword}{struct} mbuf *\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}})}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00468}00468 \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00469}00469         \textcolor{keywordtype}{int}                      error = 0;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00470}00470 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00471}00471         ng\_hci\_le\_connection\_complete\_ep        *ep = NULL;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00472}00472         \mbox{\hyperlink{structng__hci__unit__con}{ng\_hci\_unit\_con\_p}}       con = NULL;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00473}00473         \textcolor{keywordtype}{int} link\_type;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00474}00474         uint8\_t uclass[3] = \{0,0,0\};\textcolor{comment}{//dummy uclass}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00475}00475 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00476}00476         \mbox{\hyperlink{ng__hci__var_8h_a8e7394987275c0d3d5c788d003137197}{NG\_HCI\_M\_PULLUP}}(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, \textcolor{keyword}{sizeof}(*ep));}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00477}00477         \textcolor{keywordflow}{if} (\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}} == NULL)}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00478}00478                 \textcolor{keywordflow}{return} (ENOBUFS);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00479}00479 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00480}00480         ep = mtod(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, ng\_hci\_le\_connection\_complete\_ep *);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00481}00481         link\_type = (ep-\/>address\_type)? \mbox{\hyperlink{ng__hci_8h_a557665f3f28bb33759ed8ec4eb28d385}{NG\_HCI\_LINK\_LE\_RANDOM}} :}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00482}00482           \mbox{\hyperlink{ng__hci_8h_afecc38805812b20f02942504b17892f4}{NG\_HCI\_LINK\_LE\_PUBLIC}};}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00483}00483         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00484}00484 \textcolor{comment}{         * Find the first connection descriptor that matches the following:}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00485}00485 \textcolor{comment}{         *}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00486}00486 \textcolor{comment}{         * 1) con-\/>link\_type == link\_type}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00487}00487 \textcolor{comment}{         * 2) con-\/>state == NG\_HCI\_CON\_W4\_CONN\_COMPLETE}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00488}00488 \textcolor{comment}{         * 3) con-\/>bdaddr == ep-\/>address}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00489}00489 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00490}00490         LIST\_FOREACH(con, \&unit-\/>con\_list, next)}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00491}00491                 \textcolor{keywordflow}{if} (con-\/>\mbox{\hyperlink{structng__hci__unit__con_a3a396246ceda9716f91a480f401bdc7b}{link\_type}} == link\_type \&\&}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00492}00492                     con-\/>\mbox{\hyperlink{structng__hci__unit__con_a7620ea8c44d5b7f7b48728f224c8fad3}{state}} == \mbox{\hyperlink{ng__hci_8h_aed2c55be75b962b9cab878e3cc421860}{NG\_HCI\_CON\_W4\_CONN\_COMPLETE}} \&\&}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00493}00493                     bcmp(\&con-\/>\mbox{\hyperlink{structng__hci__unit__con_a42808804831d9632a2db0e8f1f6367f5}{bdaddr}}, \&ep-\/>address, \textcolor{keyword}{sizeof}(bdaddr\_t)) == 0)}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00494}00494                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00495}00495 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00496}00496         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00497}00497 \textcolor{comment}{         * Two possible cases:}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00498}00498 \textcolor{comment}{         *}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00499}00499 \textcolor{comment}{         * 1) We have found connection descriptor. That means upper layer has}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00500}00500 \textcolor{comment}{         *    requested this connection via LP\_CON\_REQ message. In this case}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00501}00501 \textcolor{comment}{         *    connection must have timeout set. If ng\_hci\_con\_untimeout() fails}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00502}00502 \textcolor{comment}{         *    then timeout message already went into node's queue. In this case}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00503}00503 \textcolor{comment}{         *    ignore Connection\_Complete event and let timeout deal with it.}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00504}00504 \textcolor{comment}{         *}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00505}00505 \textcolor{comment}{         * 2) We do not have connection descriptor. That means upper layer}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00506}00506 \textcolor{comment}{         *    nas not requested this connection , (less likely) we gave up}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00507}00507 \textcolor{comment}{         *    on this connection (timeout) or as node act as slave role.}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00508}00508 \textcolor{comment}{         *    The most likely scenario is that}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00509}00509 \textcolor{comment}{         *    we have received LE\_Create\_Connection command }}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00510}00510 \textcolor{comment}{         *    from the RAW hook}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00511}00511 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00512}00512 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00513}00513         \textcolor{keywordflow}{if} (con == NULL) \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00514}00514                 \textcolor{keywordflow}{if} (ep-\/>status != 0)}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00515}00515                         \textcolor{keywordflow}{goto} out;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00516}00516 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00517}00517                 con = \mbox{\hyperlink{ng__hci__misc_8c_ad17315e3c4e8e2524030e436a48d740b}{ng\_hci\_new\_con}}(unit, link\_type);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00518}00518                 \textcolor{keywordflow}{if} (con == NULL) \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00519}00519                         error = ENOMEM;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00520}00520                         \textcolor{keywordflow}{goto} out;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00521}00521                 \}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00522}00522 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00523}00523                 con-\/>\mbox{\hyperlink{structng__hci__unit__con_a7620ea8c44d5b7f7b48728f224c8fad3}{state}} = \mbox{\hyperlink{ng__hci_8h_a525b11293791d61d7d5331ea55917c36}{NG\_HCI\_CON\_W4\_LP\_CON\_RSP}};}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00524}00524                 \mbox{\hyperlink{ng__hci__misc_8c_a2b1f5439028dcbc3404fea5c0234bff5}{ng\_hci\_con\_timeout}}(con);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00525}00525 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00526}00526                 bcopy(\&ep-\/>address, \&con-\/>\mbox{\hyperlink{structng__hci__unit__con_a42808804831d9632a2db0e8f1f6367f5}{bdaddr}}, \textcolor{keyword}{sizeof}(con-\/>\mbox{\hyperlink{structng__hci__unit__con_a42808804831d9632a2db0e8f1f6367f5}{bdaddr}}));}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00527}00527                 error = \mbox{\hyperlink{ng__hci__ulpi_8c_a38410249a3349ce11a02fe83d8700fd9}{ng\_hci\_lp\_con\_ind}}(con, uclass);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00528}00528                 \textcolor{keywordflow}{if} (error != 0) \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00529}00529                         \mbox{\hyperlink{ng__hci__misc_8c_aec1ab0e4733596907113e77d1313c9a7}{ng\_hci\_con\_untimeout}}(con);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00530}00530                         \mbox{\hyperlink{ng__hci__misc_8c_aef20383c1edac9d052a97cdd534ec9c7}{ng\_hci\_free\_con}}(con);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00531}00531                         \textcolor{keywordflow}{goto} out;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00532}00532                 \}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00533}00533 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00534}00534         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} ((error = \mbox{\hyperlink{ng__hci__misc_8c_aec1ab0e4733596907113e77d1313c9a7}{ng\_hci\_con\_untimeout}}(con)) != 0)}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00535}00535                         \textcolor{keywordflow}{goto} out;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00536}00536 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00537}00537         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00538}00538 \textcolor{comment}{         * Update connection descriptor and send notification }}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00539}00539 \textcolor{comment}{         * to the upper layers.}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00540}00540 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00541}00541 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00542}00542         con-\/>\mbox{\hyperlink{structng__hci__unit__con_a02c77256cfd83dca50038f1281f78c2d}{con\_handle}} = \mbox{\hyperlink{ng__hci_8h_aeb50addefab64338354b16c9a89a50ee}{NG\_HCI\_CON\_HANDLE}}(le16toh(ep-\/>handle));}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00543}00543         con-\/>\mbox{\hyperlink{structng__hci__unit__con_a7565c1234822e4ccf772a26f54c6857f}{encryption\_mode}} = \mbox{\hyperlink{ng__hci_8h_ae59bdc1ea0c1a9dea68f615e02b635d8}{NG\_HCI\_ENCRYPTION\_MODE\_NONE}};}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00544}00544 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00545}00545         \mbox{\hyperlink{ng__hci__ulpi_8c_a771e897a940d04cdff7f91354b165f39}{ng\_hci\_lp\_con\_cfm}}(con, ep-\/>status);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00546}00546 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00547}00547         \textcolor{comment}{/* Adjust connection state */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00548}00548         \textcolor{keywordflow}{if} (ep-\/>status != 0)}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00549}00549                 \mbox{\hyperlink{ng__hci__misc_8c_aef20383c1edac9d052a97cdd534ec9c7}{ng\_hci\_free\_con}}(con);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00550}00550         \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00551}00551                 con-\/>\mbox{\hyperlink{structng__hci__unit__con_a7620ea8c44d5b7f7b48728f224c8fad3}{state}} = \mbox{\hyperlink{ng__hci_8h_a03025e63063d215be152dd1f8b86f199}{NG\_HCI\_CON\_OPEN}};}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00552}00552 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00553}00553                 \textcolor{comment}{/*      }}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00554}00554 \textcolor{comment}{                 * Change link policy for the ACL connections. Enable all }}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00555}00555 \textcolor{comment}{                 * supported link modes. Enable Role switch as well if}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00556}00556 \textcolor{comment}{                 * device supports it.}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00557}00557 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00558}00558         \}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00559}00559 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00560}00560 out:}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00561}00561         \mbox{\hyperlink{netgraph_8h_a2461bfcdc9e024484ed8037d386620e3}{NG\_FREE\_M}}(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00562}00562 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00563}00563         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00564}00564 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00565}00565 \}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00566}00566 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00567}\mbox{\hyperlink{ng__hci__evnt_8c_aa4f1347c27e450e956102225a43284a4}{00567}} \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{ng__hci__evnt_8c_aa4f1347c27e450e956102225a43284a4}{le\_connection\_update}}(\mbox{\hyperlink{structng__hci__unit}{ng\_hci\_unit\_p}} unit, \textcolor{keyword}{struct} mbuf *\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}})}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00568}00568 \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00569}00569         \textcolor{keywordtype}{int} error = 0;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00570}00570         \textcolor{comment}{/*TBD*/}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00571}00571 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00572}00572         \mbox{\hyperlink{netgraph_8h_a2461bfcdc9e024484ed8037d386620e3}{NG\_FREE\_M}}(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00573}00573         \textcolor{keywordflow}{return} error;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00574}00574 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00575}00575 \}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00576}00576 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00577}\mbox{\hyperlink{ng__hci__evnt_8c_afdc64b80ccde399c20784873a44a9dfe}{00577}} \mbox{\hyperlink{ng__hci__evnt_8c_afdc64b80ccde399c20784873a44a9dfe}{le\_event}}(\mbox{\hyperlink{structng__hci__unit}{ng\_hci\_unit\_p}} unit, \textcolor{keyword}{struct} mbuf *\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}})}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00578}00578 \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00579}00579         \textcolor{keywordtype}{int} error = 0;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00580}00580         ng\_hci\_le\_ep *lep;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00581}00581 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00582}00582         \mbox{\hyperlink{ng__hci__var_8h_a8e7394987275c0d3d5c788d003137197}{NG\_HCI\_M\_PULLUP}}(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, \textcolor{keyword}{sizeof}(*lep));}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00583}00583         \textcolor{keywordflow}{if}(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}} ==NULL)\{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00584}00584                 \textcolor{keywordflow}{return} ENOBUFS;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00585}00585         \}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00586}00586         lep = mtod(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, ng\_hci\_le\_ep *);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00587}00587         m\_adj(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, \textcolor{keyword}{sizeof}(*lep));}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00588}00588         \textcolor{keywordflow}{switch}(lep-\/>subevent\_code)\{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00589}00589         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__hci_8h_ae0fef3172a076dbf9f4b04ae5616d669}{NG\_HCI\_LEEV\_CON\_COMPL}}:}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00590}00590                 \mbox{\hyperlink{ng__hci__evnt_8c_aa927f3453f6fa69bab6c3727dc7dc196}{le\_connection\_complete}}(unit, \mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00591}00591                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00592}00592         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__hci_8h_ae7a9a4fa38821d5bbd4fdd480ce31f1e}{NG\_HCI\_LEEV\_ADVREP}}:}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00593}00593                 \mbox{\hyperlink{ng__hci__evnt_8c_a9bbdbd2bde0ef7ee6eba217c7942a891}{le\_advertizing\_report}}(unit, \mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00594}00594                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00595}00595         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__hci_8h_ae91ddf911a6608b0a66689981d9a9843}{NG\_HCI\_LEEV\_CON\_UPDATE\_COMPL}}:}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00596}00596                 \mbox{\hyperlink{ng__hci__evnt_8c_aa4f1347c27e450e956102225a43284a4}{le\_connection\_update}}(unit, \mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00597}00597                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00598}00598         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__hci_8h_a3d5d0b464570e54c0c1c060c78cc887c}{NG\_HCI\_LEEV\_READ\_REMOTE\_FEATURES\_COMPL}}:}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00599}00599                 \textcolor{comment}{//TBD}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00600}00600           \textcolor{comment}{/*FALLTHROUGH*/}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00601}00601         \textcolor{keywordflow}{case} \mbox{\hyperlink{ng__hci_8h_a849d30aaad7db34fd07e301c07b15726}{NG\_HCI\_LEEV\_LONG\_TERM\_KEY\_REQUEST}}:}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00602}00602                 \textcolor{comment}{//TBD}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00603}00603           \textcolor{comment}{/*FALLTHROUGH*/}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00604}00604         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00605}00605                 \mbox{\hyperlink{netgraph_8h_a2461bfcdc9e024484ed8037d386620e3}{NG\_FREE\_M}}(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00606}00606         \}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00607}00607         \textcolor{keywordflow}{return} error;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00608}00608 \}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00609}00609 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00610}00610 \textcolor{comment}{/* Inquiry result event */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00611}00611 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00612}\mbox{\hyperlink{ng__hci__evnt_8c_abab809945a01586a2be7cebbeb753e18}{00612}} \mbox{\hyperlink{ng__hci__evnt_8c_abab809945a01586a2be7cebbeb753e18}{inquiry\_result}}(\mbox{\hyperlink{structng__hci__unit}{ng\_hci\_unit\_p}} unit, \textcolor{keyword}{struct} mbuf *\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}})}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00613}00613 \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00614}00614         ng\_hci\_inquiry\_result\_ep        *ep = NULL;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00615}00615         \mbox{\hyperlink{structng__hci__neighbor}{ng\_hci\_neighbor\_p}}               n = NULL;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00616}00616         bdaddr\_t                         bdaddr;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00617}00617         \textcolor{keywordtype}{int}                              error = 0;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00618}00618 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00619}00619         \mbox{\hyperlink{ng__hci__var_8h_a8e7394987275c0d3d5c788d003137197}{NG\_HCI\_M\_PULLUP}}(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, \textcolor{keyword}{sizeof}(*ep));}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00620}00620         \textcolor{keywordflow}{if} (\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}} == NULL)}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00621}00621                 \textcolor{keywordflow}{return} (ENOBUFS);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00622}00622 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00623}00623         ep = mtod(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, ng\_hci\_inquiry\_result\_ep *);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00624}00624         m\_adj(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, \textcolor{keyword}{sizeof}(*ep));}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00625}00625 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00626}00626         \textcolor{keywordflow}{for} (; ep-\/>num\_responses > 0; ep-\/>num\_responses -\/-\/) \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00627}00627                 \textcolor{comment}{/* Get remote unit address */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00628}00628                 m\_copydata(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, 0, \textcolor{keyword}{sizeof}(bdaddr), (caddr\_t) \&bdaddr);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00629}00629                 m\_adj(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, \textcolor{keyword}{sizeof}(bdaddr));}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00630}00630 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00631}00631                 \textcolor{comment}{/* Lookup entry in the cache */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00632}00632                 n = \mbox{\hyperlink{ng__hci__misc_8c_afd85df2950d8d6fd0e5237667595c655}{ng\_hci\_get\_neighbor}}(unit, \&bdaddr, \mbox{\hyperlink{ng__hci_8h_aac64c463cc734bbdf8ba030619e8a64d}{NG\_HCI\_LINK\_ACL}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00633}00633                 \textcolor{keywordflow}{if} (n == NULL) \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00634}00634                         \textcolor{comment}{/* Create new entry */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00635}00635                         n = \mbox{\hyperlink{ng__hci__misc_8c_a27064102479d8203c42f5ddfa980c029}{ng\_hci\_new\_neighbor}}(unit);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00636}00636                         \textcolor{keywordflow}{if} (n == NULL) \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00637}00637                                 error = ENOMEM;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00638}00638                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00639}00639                         \}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00640}00640                 \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00641}00641                         getmicrotime(\&n-\/>\mbox{\hyperlink{structng__hci__neighbor_ada2f574a39016f8415ea44335795347d}{updated}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00642}00642 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00643}00643                 bcopy(\&bdaddr, \&n-\/>\mbox{\hyperlink{structng__hci__neighbor_a9c92229bd13342eb3bcdef1c0c558308}{bdaddr}}, \textcolor{keyword}{sizeof}(n-\/>\mbox{\hyperlink{structng__hci__neighbor_a9c92229bd13342eb3bcdef1c0c558308}{bdaddr}}));}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00644}00644                 n-\/>\mbox{\hyperlink{structng__hci__neighbor_a17508a20bea1459561a655c952746f53}{addrtype}} = \mbox{\hyperlink{ng__hci_8h_aac64c463cc734bbdf8ba030619e8a64d}{NG\_HCI\_LINK\_ACL}};}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00645}00645 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00646}00646                 \textcolor{comment}{/* XXX call m\_pullup here? */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00647}00647 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00648}00648                 n-\/>\mbox{\hyperlink{structng__hci__neighbor_af6f68090e6a8c7c789a7235b4099c639}{page\_scan\_rep\_mode}} = *mtod(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, u\_int8\_t *);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00649}00649                 m\_adj(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, \textcolor{keyword}{sizeof}(u\_int8\_t));}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00650}00650 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00651}00651                 \textcolor{comment}{/* page\_scan\_period\_mode */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00652}00652                 m\_adj(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, \textcolor{keyword}{sizeof}(u\_int8\_t));}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00653}00653 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00654}00654                 n-\/>\mbox{\hyperlink{structng__hci__neighbor_af8b3a67a87da9a9f0211a69322a6e811}{page\_scan\_mode}} = *mtod(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, u\_int8\_t *);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00655}00655                 m\_adj(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, \textcolor{keyword}{sizeof}(u\_int8\_t));}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00656}00656 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00657}00657                 \textcolor{comment}{/* class */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00658}00658                 m\_adj(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, \mbox{\hyperlink{ng__hci_8h_a0420ea1a6c0d3474fd561360dc466a77}{NG\_HCI\_CLASS\_SIZE}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00659}00659 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00660}00660                 \textcolor{comment}{/* clock offset */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00661}00661                 m\_copydata(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, 0, \textcolor{keyword}{sizeof}(n-\/>\mbox{\hyperlink{structng__hci__neighbor_a5f88df1910f72a24c5279a639ee9f3f2}{clock\_offset}}), }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00662}00662                         (caddr\_t) \&n-\/>\mbox{\hyperlink{structng__hci__neighbor_a5f88df1910f72a24c5279a639ee9f3f2}{clock\_offset}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00663}00663                 n-\/>\mbox{\hyperlink{structng__hci__neighbor_a5f88df1910f72a24c5279a639ee9f3f2}{clock\_offset}} = le16toh(n-\/>\mbox{\hyperlink{structng__hci__neighbor_a5f88df1910f72a24c5279a639ee9f3f2}{clock\_offset}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00664}00664         \}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00665}00665 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00666}00666         \mbox{\hyperlink{netgraph_8h_a2461bfcdc9e024484ed8037d386620e3}{NG\_FREE\_M}}(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00667}00667 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00668}00668         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00669}00669 \} \textcolor{comment}{/* inquiry\_result */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00670}00670 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00671}00671 \textcolor{comment}{/* Connection complete event */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00672}00672 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00673}\mbox{\hyperlink{ng__hci__evnt_8c_a6f9ae08768e492858b69771155cc5e54}{00673}} \mbox{\hyperlink{ng__hci__evnt_8c_a6f9ae08768e492858b69771155cc5e54}{con\_compl}}(\mbox{\hyperlink{structng__hci__unit}{ng\_hci\_unit\_p}} unit, \textcolor{keyword}{struct} mbuf *\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}})}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00674}00674 \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00675}00675         ng\_hci\_con\_compl\_ep     *ep = NULL;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00676}00676         \mbox{\hyperlink{structng__hci__unit__con}{ng\_hci\_unit\_con\_p}}       con = NULL;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00677}00677         \textcolor{keywordtype}{int}                      error = 0;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00678}00678 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00679}00679         \mbox{\hyperlink{ng__hci__var_8h_a8e7394987275c0d3d5c788d003137197}{NG\_HCI\_M\_PULLUP}}(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, \textcolor{keyword}{sizeof}(*ep));}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00680}00680         \textcolor{keywordflow}{if} (\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}} == NULL)}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00681}00681                 \textcolor{keywordflow}{return} (ENOBUFS);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00682}00682 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00683}00683         ep = mtod(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, ng\_hci\_con\_compl\_ep *);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00684}00684 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00685}00685         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00686}00686 \textcolor{comment}{         * Find the first connection descriptor that matches the following:}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00687}00687 \textcolor{comment}{         *}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00688}00688 \textcolor{comment}{         * 1) con-\/>link\_type == ep-\/>link\_type}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00689}00689 \textcolor{comment}{         * 2) con-\/>state == NG\_HCI\_CON\_W4\_CONN\_COMPLETE}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00690}00690 \textcolor{comment}{         * 3) con-\/>bdaddr == ep-\/>bdaddr}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00691}00691 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00692}00692 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00693}00693         LIST\_FOREACH(con, \&unit-\/>con\_list, next)}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00694}00694                 \textcolor{keywordflow}{if} (con-\/>\mbox{\hyperlink{structng__hci__unit__con_a3a396246ceda9716f91a480f401bdc7b}{link\_type}} == ep-\/>link\_type \&\&}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00695}00695                     con-\/>\mbox{\hyperlink{structng__hci__unit__con_a7620ea8c44d5b7f7b48728f224c8fad3}{state}} == \mbox{\hyperlink{ng__hci_8h_aed2c55be75b962b9cab878e3cc421860}{NG\_HCI\_CON\_W4\_CONN\_COMPLETE}} \&\&}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00696}00696                     bcmp(\&con-\/>\mbox{\hyperlink{structng__hci__unit__con_a42808804831d9632a2db0e8f1f6367f5}{bdaddr}}, \&ep-\/>bdaddr, \textcolor{keyword}{sizeof}(bdaddr\_t)) == 0)}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00697}00697                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00698}00698 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00699}00699         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00700}00700 \textcolor{comment}{         * Two possible cases:}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00701}00701 \textcolor{comment}{         *}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00702}00702 \textcolor{comment}{         * 1) We have found connection descriptor. That means upper layer has}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00703}00703 \textcolor{comment}{         *    requested this connection via LP\_CON\_REQ message. In this case}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00704}00704 \textcolor{comment}{         *    connection must have timeout set. If ng\_hci\_con\_untimeout() fails}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00705}00705 \textcolor{comment}{         *    then timeout message already went into node's queue. In this case}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00706}00706 \textcolor{comment}{         *    ignore Connection\_Complete event and let timeout deal with it.}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00707}00707 \textcolor{comment}{         *}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00708}00708 \textcolor{comment}{         * 2) We do not have connection descriptor. That means upper layer}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00709}00709 \textcolor{comment}{         *    nas not requested this connection or (less likely) we gave up}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00710}00710 \textcolor{comment}{         *    on this connection (timeout). The most likely scenario is that}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00711}00711 \textcolor{comment}{         *    we have received Create\_Connection/Add\_SCO\_Connection command }}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00712}00712 \textcolor{comment}{         *    from the RAW hook}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00713}00713 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00714}00714 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00715}00715         \textcolor{keywordflow}{if} (con == NULL) \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00716}00716                 \textcolor{keywordflow}{if} (ep-\/>status != 0)}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00717}00717                         \textcolor{keywordflow}{goto} out;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00718}00718 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00719}00719                 con = \mbox{\hyperlink{ng__hci__misc_8c_ad17315e3c4e8e2524030e436a48d740b}{ng\_hci\_new\_con}}(unit, ep-\/>link\_type);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00720}00720                 \textcolor{keywordflow}{if} (con == NULL) \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00721}00721                         error = ENOMEM;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00722}00722                         \textcolor{keywordflow}{goto} out;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00723}00723                 \}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00724}00724 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00725}00725                 bcopy(\&ep-\/>bdaddr, \&con-\/>\mbox{\hyperlink{structng__hci__unit__con_a42808804831d9632a2db0e8f1f6367f5}{bdaddr}}, \textcolor{keyword}{sizeof}(con-\/>\mbox{\hyperlink{structng__hci__unit__con_a42808804831d9632a2db0e8f1f6367f5}{bdaddr}}));}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00726}00726         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} ((error = \mbox{\hyperlink{ng__hci__misc_8c_aec1ab0e4733596907113e77d1313c9a7}{ng\_hci\_con\_untimeout}}(con)) != 0)}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00727}00727                         \textcolor{keywordflow}{goto} out;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00728}00728 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00729}00729         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00730}00730 \textcolor{comment}{         * Update connection descriptor and send notification }}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00731}00731 \textcolor{comment}{         * to the upper layers.}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00732}00732 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00733}00733 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00734}00734         con-\/>\mbox{\hyperlink{structng__hci__unit__con_a02c77256cfd83dca50038f1281f78c2d}{con\_handle}} = \mbox{\hyperlink{ng__hci_8h_aeb50addefab64338354b16c9a89a50ee}{NG\_HCI\_CON\_HANDLE}}(le16toh(ep-\/>con\_handle));}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00735}00735         con-\/>\mbox{\hyperlink{structng__hci__unit__con_a7565c1234822e4ccf772a26f54c6857f}{encryption\_mode}} = ep-\/>encryption\_mode;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00736}00736 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00737}00737         \mbox{\hyperlink{ng__hci__ulpi_8c_a771e897a940d04cdff7f91354b165f39}{ng\_hci\_lp\_con\_cfm}}(con, ep-\/>status);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00738}00738 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00739}00739         \textcolor{comment}{/* Adjust connection state */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00740}00740         \textcolor{keywordflow}{if} (ep-\/>status != 0)}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00741}00741                 \mbox{\hyperlink{ng__hci__misc_8c_aef20383c1edac9d052a97cdd534ec9c7}{ng\_hci\_free\_con}}(con);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00742}00742         \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00743}00743                 con-\/>\mbox{\hyperlink{structng__hci__unit__con_a7620ea8c44d5b7f7b48728f224c8fad3}{state}} = \mbox{\hyperlink{ng__hci_8h_a03025e63063d215be152dd1f8b86f199}{NG\_HCI\_CON\_OPEN}};}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00744}00744 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00745}00745                 \textcolor{comment}{/*      }}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00746}00746 \textcolor{comment}{                 * Change link policy for the ACL connections. Enable all }}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00747}00747 \textcolor{comment}{                 * supported link modes. Enable Role switch as well if}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00748}00748 \textcolor{comment}{                 * device supports it.}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00749}00749 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00750}00750 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00751}00751                 \textcolor{keywordflow}{if} (ep-\/>link\_type == \mbox{\hyperlink{ng__hci_8h_aac64c463cc734bbdf8ba030619e8a64d}{NG\_HCI\_LINK\_ACL}}) \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00752}00752                         \textcolor{keyword}{struct }\_\_link\_policy \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00753}00753                                 ng\_hci\_cmd\_pkt\_t                         hdr;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00754}00754                                 ng\_hci\_write\_link\_policy\_settings\_cp     cp;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00755}00755                         \} \mbox{\hyperlink{ng__ubt__var_8h_a8e67811075b4fba1c03c4f250c77cd91}{\_\_attribute\_\_}} ((packed))                 *lp;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00756}00756                         \textcolor{keyword}{struct }mbuf                                     *m;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00757}00757 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00758}00758                         MGETHDR(m, M\_NOWAIT, MT\_DATA);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00759}00759                         \textcolor{keywordflow}{if} (m != NULL) \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00760}00760                                 m-\/>m\_pkthdr.len = m-\/>m\_len = \textcolor{keyword}{sizeof}(*lp);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00761}00761                                 lp = mtod(m, \textcolor{keyword}{struct} \_\_link\_policy *);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00762}00762 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00763}00763                                 lp-\/>hdr.type = \mbox{\hyperlink{ng__hci_8h_a2530c45c7110ec470c215b4f1886c5ff}{NG\_HCI\_CMD\_PKT}};}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00764}00764                                 lp-\/>hdr.opcode = htole16(\mbox{\hyperlink{ng__hci_8h_aff633255c8eae43316635142208546f6}{NG\_HCI\_OPCODE}}(}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00765}00765                                         \mbox{\hyperlink{ng__hci_8h_a5d05ff53f900335f760745403437e11d}{NG\_HCI\_OGF\_LINK\_POLICY}},}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00766}00766                                         \mbox{\hyperlink{ng__hci_8h_a11b666c947f4f623acbb973f1fb05bac}{NG\_HCI\_OCF\_WRITE\_LINK\_POLICY\_SETTINGS}}));}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00767}00767                                 lp-\/>hdr.length = \textcolor{keyword}{sizeof}(lp-\/>cp);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00768}00768 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00769}00769                                 lp-\/>cp.con\_handle = ep-\/>con\_handle;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00770}00770 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00771}00771                                 lp-\/>cp.settings = 0;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00772}00772                                 \textcolor{keywordflow}{if} ((unit-\/>\mbox{\hyperlink{structng__hci__unit_aa996a4dc37a1ae6baefc2f7b31a819b7}{features}}[0] \& \mbox{\hyperlink{ng__hci_8h_a61217674f6aa096fc13e2b96d859f953}{NG\_HCI\_LMP\_SWITCH}}) \&\&}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00773}00773                                     unit-\/>\mbox{\hyperlink{structng__hci__unit_a0bb7b5bce31956e3061b17420c0a07f5}{role\_switch}})}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00774}00774                                         lp-\/>cp.settings |= 0x1;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00775}00775                                 if (unit-\/>\mbox{\hyperlink{structng__hci__unit_aa996a4dc37a1ae6baefc2f7b31a819b7}{features}}[0] \& \mbox{\hyperlink{ng__hci_8h_aa1b979bd3782e3a55853a12e2621ec13}{NG\_HCI\_LMP\_HOLD\_MODE}})}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00776}00776                                         lp-\/>cp.settings |= 0x2;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00777}00777                                 \textcolor{keywordflow}{if} (unit-\/>\mbox{\hyperlink{structng__hci__unit_aa996a4dc37a1ae6baefc2f7b31a819b7}{features}}[0] \& \mbox{\hyperlink{ng__hci_8h_a0a1b08c419c82efe7fb3190a0aa52101}{NG\_HCI\_LMP\_SNIFF\_MODE}})}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00778}00778                                         lp-\/>cp.settings |= 0x4;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00779}00779                                 \textcolor{keywordflow}{if} (unit-\/>\mbox{\hyperlink{structng__hci__unit_aa996a4dc37a1ae6baefc2f7b31a819b7}{features}}[1] \& \mbox{\hyperlink{ng__hci_8h_a1d7b26ab734f26e5790a7be179b4389c}{NG\_HCI\_LMP\_PARK\_MODE}})}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00780}00780                                         lp-\/>cp.settings |= 0x8;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00781}00781 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00782}00782                                 lp-\/>cp.settings \&= unit-\/>\mbox{\hyperlink{structng__hci__unit_aca8814204215a0e61779b868d073bf37}{link\_policy\_mask}};}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00783}00783                                 lp-\/>cp.settings = htole16(lp-\/>cp.settings);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00784}00784 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00785}00785                                 \mbox{\hyperlink{ng__bluetooth_8h_a4c6b5e44c71c672f0bb8b6338973a944}{NG\_BT\_MBUFQ\_ENQUEUE}}(\&unit-\/>\mbox{\hyperlink{structng__hci__unit_a0d4ba7641d93dd9b0b4aa9c4b67718e6}{cmdq}}, m);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00786}00786                                 \textcolor{keywordflow}{if} (!(unit-\/>\mbox{\hyperlink{structng__hci__unit_a0e60c241953c2263d2ee904b1914e7e7}{state}} \& \mbox{\hyperlink{ng__hci_8h_ac72a62e2f4654b99a9f1ad9797c2e557}{NG\_HCI\_UNIT\_COMMAND\_PENDING}}))}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00787}00787                                         \mbox{\hyperlink{ng__hci__cmds_8c_a7b68579d8378fb89a0a3a1a07db0e387}{ng\_hci\_send\_command}}(unit);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00788}00788                         \}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00789}00789                 \}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00790}00790         \}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00791}00791 out:}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00792}00792         \mbox{\hyperlink{netgraph_8h_a2461bfcdc9e024484ed8037d386620e3}{NG\_FREE\_M}}(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00793}00793 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00794}00794         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00795}00795 \} \textcolor{comment}{/* con\_compl */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00796}00796 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00797}00797 \textcolor{comment}{/* Connection request event */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00798}00798 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00799}\mbox{\hyperlink{ng__hci__evnt_8c_a3eb36588c77d0fd2ae1033fb4eeb839a}{00799}} \mbox{\hyperlink{ng__hci__evnt_8c_a3eb36588c77d0fd2ae1033fb4eeb839a}{con\_req}}(\mbox{\hyperlink{structng__hci__unit}{ng\_hci\_unit\_p}} unit, \textcolor{keyword}{struct} mbuf *\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}})}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00800}00800 \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00801}00801         ng\_hci\_con\_req\_ep       *ep = NULL;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00802}00802         \mbox{\hyperlink{structng__hci__unit__con}{ng\_hci\_unit\_con\_p}}       con = NULL;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00803}00803         \textcolor{keywordtype}{int}                      error = 0;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00804}00804 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00805}00805         \mbox{\hyperlink{ng__hci__var_8h_a8e7394987275c0d3d5c788d003137197}{NG\_HCI\_M\_PULLUP}}(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, \textcolor{keyword}{sizeof}(*ep));}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00806}00806         \textcolor{keywordflow}{if} (\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}} == NULL)}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00807}00807                 \textcolor{keywordflow}{return} (ENOBUFS);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00808}00808 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00809}00809         ep = mtod(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, ng\_hci\_con\_req\_ep *);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00810}00810 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00811}00811         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00812}00812 \textcolor{comment}{         * Find the first connection descriptor that matches the following:}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00813}00813 \textcolor{comment}{         *}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00814}00814 \textcolor{comment}{         * 1) con-\/>link\_type == ep-\/>link\_type}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00815}00815 \textcolor{comment}{         *}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00816}00816 \textcolor{comment}{         * 2) con-\/>state == NG\_HCI\_CON\_W4\_LP\_CON\_RSP ||}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00817}00817 \textcolor{comment}{         *    con-\/>state == NG\_HCI\_CON\_W4\_CONN\_COMPL}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00818}00818 \textcolor{comment}{         * }}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00819}00819 \textcolor{comment}{         * 3) con-\/>bdaddr == ep-\/>bdaddr}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00820}00820 \textcolor{comment}{         *}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00821}00821 \textcolor{comment}{         * Possible cases:}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00822}00822 \textcolor{comment}{         *}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00823}00823 \textcolor{comment}{         * 1) We do not have connection descriptor. This is simple. Create}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00824}00824 \textcolor{comment}{         *    new fresh connection descriptor and send notification to the}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00825}00825 \textcolor{comment}{         *    appropriate upstream hook (based on link\_type).}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00826}00826 \textcolor{comment}{         *}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00827}00827 \textcolor{comment}{         * 2) We found connection handle. This is more complicated.}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00828}00828 \textcolor{comment}{         * }}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00829}00829 \textcolor{comment}{         * 2.1) ACL links}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00830}00830 \textcolor{comment}{         *}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00831}00831 \textcolor{comment}{         *      Since only one ACL link can exist between each pair of}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00832}00832 \textcolor{comment}{         *      units then we have a race. Our upper layer has requested }}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00833}00833 \textcolor{comment}{         *      an ACL connection to the remote unit, but we did not send }}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00834}00834 \textcolor{comment}{         *      command yet. At the same time the remote unit has requested}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00835}00835 \textcolor{comment}{         *      an ACL connection from us. In this case we will ignore }}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00836}00836 \textcolor{comment}{         *      Connection\_Request event. This probably will cause connect}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00837}00837 \textcolor{comment}{         *      failure on both units.}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00838}00838 \textcolor{comment}{         *}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00839}00839 \textcolor{comment}{         * 2.2) SCO links}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00840}00840 \textcolor{comment}{         *}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00841}00841 \textcolor{comment}{         *      The spec on page 45 says :}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00842}00842 \textcolor{comment}{         *}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00843}00843 \textcolor{comment}{         *      "{}The master can support up to three SCO links to the same }}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00844}00844 \textcolor{comment}{         *       slave or to different slaves. A slave can support up to }}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00845}00845 \textcolor{comment}{         *       three SCO links from the same master, or two SCO links if }}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00846}00846 \textcolor{comment}{         *       the links originate from different masters."{}}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00847}00847 \textcolor{comment}{         *}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00848}00848 \textcolor{comment}{         *      The only problem is how to handle multiple SCO links between}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00849}00849 \textcolor{comment}{         *      matster and slave. For now we will assume that multiple SCO}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00850}00850 \textcolor{comment}{         *      links MUST be opened one after another. }}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00851}00851 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00852}00852 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00853}00853         LIST\_FOREACH(con, \&unit-\/>con\_list, next)}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00854}00854                 \textcolor{keywordflow}{if} (con-\/>\mbox{\hyperlink{structng__hci__unit__con_a3a396246ceda9716f91a480f401bdc7b}{link\_type}} == ep-\/>link\_type \&\&}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00855}00855                     (con-\/>\mbox{\hyperlink{structng__hci__unit__con_a7620ea8c44d5b7f7b48728f224c8fad3}{state}} == \mbox{\hyperlink{ng__hci_8h_a525b11293791d61d7d5331ea55917c36}{NG\_HCI\_CON\_W4\_LP\_CON\_RSP}} ||}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00856}00856                      con-\/>\mbox{\hyperlink{structng__hci__unit__con_a7620ea8c44d5b7f7b48728f224c8fad3}{state}} == \mbox{\hyperlink{ng__hci_8h_aed2c55be75b962b9cab878e3cc421860}{NG\_HCI\_CON\_W4\_CONN\_COMPLETE}}) \&\&}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00857}00857                     bcmp(\&con-\/>\mbox{\hyperlink{structng__hci__unit__con_a42808804831d9632a2db0e8f1f6367f5}{bdaddr}}, \&ep-\/>bdaddr, \textcolor{keyword}{sizeof}(bdaddr\_t)) == 0)}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00858}00858                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00859}00859 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00860}00860         \textcolor{keywordflow}{if} (con == NULL) \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00861}00861                 con = \mbox{\hyperlink{ng__hci__misc_8c_ad17315e3c4e8e2524030e436a48d740b}{ng\_hci\_new\_con}}(unit, ep-\/>link\_type);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00862}00862                 \textcolor{keywordflow}{if} (con != NULL) \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00863}00863                         bcopy(\&ep-\/>bdaddr, \&con-\/>\mbox{\hyperlink{structng__hci__unit__con_a42808804831d9632a2db0e8f1f6367f5}{bdaddr}}, \textcolor{keyword}{sizeof}(con-\/>\mbox{\hyperlink{structng__hci__unit__con_a42808804831d9632a2db0e8f1f6367f5}{bdaddr}}));}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00864}00864 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00865}00865                         con-\/>\mbox{\hyperlink{structng__hci__unit__con_a7620ea8c44d5b7f7b48728f224c8fad3}{state}} = \mbox{\hyperlink{ng__hci_8h_a525b11293791d61d7d5331ea55917c36}{NG\_HCI\_CON\_W4\_LP\_CON\_RSP}};}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00866}00866                         \mbox{\hyperlink{ng__hci__misc_8c_a2b1f5439028dcbc3404fea5c0234bff5}{ng\_hci\_con\_timeout}}(con);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00867}00867 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00868}00868                         error = \mbox{\hyperlink{ng__hci__ulpi_8c_a38410249a3349ce11a02fe83d8700fd9}{ng\_hci\_lp\_con\_ind}}(con, ep-\/>uclass);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00869}00869                         \textcolor{keywordflow}{if} (error != 0) \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00870}00870                                 \mbox{\hyperlink{ng__hci__misc_8c_aec1ab0e4733596907113e77d1313c9a7}{ng\_hci\_con\_untimeout}}(con);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00871}00871                                 \mbox{\hyperlink{ng__hci__misc_8c_aef20383c1edac9d052a97cdd534ec9c7}{ng\_hci\_free\_con}}(con);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00872}00872                         \}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00873}00873                 \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00874}00874                         error = ENOMEM;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00875}00875         \}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00876}00876 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00877}00877         \mbox{\hyperlink{netgraph_8h_a2461bfcdc9e024484ed8037d386620e3}{NG\_FREE\_M}}(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00878}00878 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00879}00879         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00880}00880 \} \textcolor{comment}{/* con\_req */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00881}00881 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00882}00882 \textcolor{comment}{/* Disconnect complete event */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00883}00883 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00884}\mbox{\hyperlink{ng__hci__evnt_8c_a11c14d537b3b2f548af29cbf236aeeba}{00884}} \mbox{\hyperlink{ng__hci__evnt_8c_a11c14d537b3b2f548af29cbf236aeeba}{discon\_compl}}(\mbox{\hyperlink{structng__hci__unit}{ng\_hci\_unit\_p}} unit, \textcolor{keyword}{struct} mbuf *\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}})}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00885}00885 \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00886}00886         ng\_hci\_discon\_compl\_ep  *ep = NULL;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00887}00887         \mbox{\hyperlink{structng__hci__unit__con}{ng\_hci\_unit\_con\_p}}       con = NULL;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00888}00888         \textcolor{keywordtype}{int}                      error = 0;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00889}00889         u\_int16\_t                h;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00890}00890 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00891}00891         \mbox{\hyperlink{ng__hci__var_8h_a8e7394987275c0d3d5c788d003137197}{NG\_HCI\_M\_PULLUP}}(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, \textcolor{keyword}{sizeof}(*ep));}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00892}00892         \textcolor{keywordflow}{if} (\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}} == NULL)}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00893}00893                 \textcolor{keywordflow}{return} (ENOBUFS);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00894}00894 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00895}00895         ep = mtod(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, ng\_hci\_discon\_compl\_ep *);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00896}00896 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00897}00897         \textcolor{comment}{/* }}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00898}00898 \textcolor{comment}{         * XXX }}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00899}00899 \textcolor{comment}{         * Do we have to send notification if ep-\/>status != 0? }}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00900}00900 \textcolor{comment}{         * For now we will send notification for both ACL and SCO connections}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00901}00901 \textcolor{comment}{         * ONLY if ep-\/>status == 0.}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00902}00902 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00903}00903 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00904}00904         \textcolor{keywordflow}{if} (ep-\/>status == 0) \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00905}00905                 h = \mbox{\hyperlink{ng__hci_8h_aeb50addefab64338354b16c9a89a50ee}{NG\_HCI\_CON\_HANDLE}}(le16toh(ep-\/>con\_handle));}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00906}00906                 con = \mbox{\hyperlink{ng__hci__misc_8c_a3b509cac93de160d32cdfb5a59ccff54}{ng\_hci\_con\_by\_handle}}(unit, h);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00907}00907                 \textcolor{keywordflow}{if} (con != NULL) \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00908}00908                         error = \mbox{\hyperlink{ng__hci__ulpi_8c_a5c014f20dea1cb50e4b6024465377b06}{ng\_hci\_lp\_discon\_ind}}(con, ep-\/>reason);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00909}00909 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00910}00910                         \textcolor{comment}{/* Remove all timeouts (if any) */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00911}00911                         \textcolor{keywordflow}{if} (con-\/>\mbox{\hyperlink{structng__hci__unit__con_a1a30e40ae9ab7aebe3d872859c5c5ca6}{flags}} \& \mbox{\hyperlink{ng__hci__var_8h_ad12efc8076041274c18cd976c0004ef5}{NG\_HCI\_CON\_TIMEOUT\_PENDING}})}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00912}00912                                 \mbox{\hyperlink{ng__hci__misc_8c_aec1ab0e4733596907113e77d1313c9a7}{ng\_hci\_con\_untimeout}}(con);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00913}00913 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00914}00914                         \mbox{\hyperlink{ng__hci__misc_8c_aef20383c1edac9d052a97cdd534ec9c7}{ng\_hci\_free\_con}}(con);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00915}00915                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00916}00916                         \mbox{\hyperlink{ng__hci__var_8h_a98c5548ff25cec6226d5624900801d5e}{NG\_HCI\_ALERT}}(}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00917}00917 \textcolor{stringliteral}{"{}\%s: \%s -\/ invalid connection handle=\%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00918}00918                                 \_\_func\_\_, \mbox{\hyperlink{netgraph_8h_a810ab9f272b092d488c5a52c6d5349e6}{NG\_NODE\_NAME}}(unit-\/>\mbox{\hyperlink{structng__hci__unit_a532226e8a5d24b9b0f2528e580326ef2}{node}}), h);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00919}00919                         error = ENOENT;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00920}00920                 \}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00921}00921         \}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00922}00922 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00923}00923         \mbox{\hyperlink{netgraph_8h_a2461bfcdc9e024484ed8037d386620e3}{NG\_FREE\_M}}(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00924}00924 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00925}00925         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00926}00926 \} \textcolor{comment}{/* discon\_compl */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00927}00927 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00928}00928 \textcolor{comment}{/* Encryption change event */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00929}00929 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00930}\mbox{\hyperlink{ng__hci__evnt_8c_a8a5206742ba2bfd3d1e3f42e08efa506}{00930}} \mbox{\hyperlink{ng__hci__evnt_8c_a8a5206742ba2bfd3d1e3f42e08efa506}{encryption\_change}}(\mbox{\hyperlink{structng__hci__unit}{ng\_hci\_unit\_p}} unit, \textcolor{keyword}{struct} mbuf *\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}})}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00931}00931 \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00932}00932         ng\_hci\_encryption\_change\_ep     *ep = NULL;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00933}00933         \mbox{\hyperlink{structng__hci__unit__con}{ng\_hci\_unit\_con\_p}}               con = NULL;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00934}00934         \textcolor{keywordtype}{int}                              error = 0;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00935}00935         u\_int16\_t       h;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00936}00936 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00937}00937         \mbox{\hyperlink{ng__hci__var_8h_a8e7394987275c0d3d5c788d003137197}{NG\_HCI\_M\_PULLUP}}(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, \textcolor{keyword}{sizeof}(*ep));}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00938}00938         \textcolor{keywordflow}{if} (\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}} == NULL)}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00939}00939                 \textcolor{keywordflow}{return} (ENOBUFS);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00940}00940 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00941}00941         ep = mtod(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, ng\_hci\_encryption\_change\_ep *);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00942}00942         h = \mbox{\hyperlink{ng__hci_8h_aeb50addefab64338354b16c9a89a50ee}{NG\_HCI\_CON\_HANDLE}}(le16toh(ep-\/>con\_handle));}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00943}00943         con = \mbox{\hyperlink{ng__hci__misc_8c_a3b509cac93de160d32cdfb5a59ccff54}{ng\_hci\_con\_by\_handle}}(unit, h);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00944}00944 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00945}00945         \textcolor{keywordflow}{if} (ep-\/>status == 0) \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00946}00946                 \textcolor{keywordflow}{if} (con == NULL) \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00947}00947                         \mbox{\hyperlink{ng__hci__var_8h_a98c5548ff25cec6226d5624900801d5e}{NG\_HCI\_ALERT}}(}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00948}00948 \textcolor{stringliteral}{"{}\%s: \%s -\/ invalid connection handle=\%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00949}00949                                 \_\_func\_\_, \mbox{\hyperlink{netgraph_8h_a810ab9f272b092d488c5a52c6d5349e6}{NG\_NODE\_NAME}}(unit-\/>\mbox{\hyperlink{structng__hci__unit_a532226e8a5d24b9b0f2528e580326ef2}{node}}), h);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00950}00950                         error = ENOENT;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00951}00951                 \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (con-\/>\mbox{\hyperlink{structng__hci__unit__con_a3a396246ceda9716f91a480f401bdc7b}{link\_type}} == \mbox{\hyperlink{ng__hci_8h_af8bd621d46e75d10e745698aa7b543b2}{NG\_HCI\_LINK\_SCO}}) \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00952}00952                         \mbox{\hyperlink{ng__hci__var_8h_a98c5548ff25cec6226d5624900801d5e}{NG\_HCI\_ALERT}}(}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00953}00953 \textcolor{stringliteral}{"{}\%s: \%s -\/ invalid link type=\%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00954}00954                                 \_\_func\_\_, \mbox{\hyperlink{netgraph_8h_a810ab9f272b092d488c5a52c6d5349e6}{NG\_NODE\_NAME}}(unit-\/>\mbox{\hyperlink{structng__hci__unit_a532226e8a5d24b9b0f2528e580326ef2}{node}}), }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00955}00955                                 con-\/>\mbox{\hyperlink{structng__hci__unit__con_a3a396246ceda9716f91a480f401bdc7b}{link\_type}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00956}00956                         error = EINVAL;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00957}00957                 \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (ep-\/>encryption\_enable)}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00958}00958                         \textcolor{comment}{/* XXX is that true? */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00959}00959                         con-\/>\mbox{\hyperlink{structng__hci__unit__con_a7565c1234822e4ccf772a26f54c6857f}{encryption\_mode}} = \mbox{\hyperlink{ng__hci_8h_a9381405894536cb8a1027faac24111bb}{NG\_HCI\_ENCRYPTION\_MODE\_P2P}};}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00960}00960                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00961}00961                         con-\/>\mbox{\hyperlink{structng__hci__unit__con_a7565c1234822e4ccf772a26f54c6857f}{encryption\_mode}} = \mbox{\hyperlink{ng__hci_8h_ae59bdc1ea0c1a9dea68f615e02b635d8}{NG\_HCI\_ENCRYPTION\_MODE\_NONE}};}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00962}00962         \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00963}00963                 \mbox{\hyperlink{ng__hci__var_8h_a347403c3d9eebde8aa890c65b4ab5874}{NG\_HCI\_ERR}}(}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00964}00964 \textcolor{stringliteral}{"{}\%s: \%s -\/ failed to change encryption mode, status=\%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00965}00965                         \_\_func\_\_, \mbox{\hyperlink{netgraph_8h_a810ab9f272b092d488c5a52c6d5349e6}{NG\_NODE\_NAME}}(unit-\/>\mbox{\hyperlink{structng__hci__unit_a532226e8a5d24b9b0f2528e580326ef2}{node}}), ep-\/>status);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00966}00966 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00967}00967         \textcolor{comment}{/*Anyway, propagete encryption status to upper layer*/}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00968}00968         \mbox{\hyperlink{ng__hci__ulpi_8c_ac18669e3331a9eb15072ba45b0e926ae}{ng\_hci\_lp\_enc\_change}}(con, con-\/>\mbox{\hyperlink{structng__hci__unit__con_a7565c1234822e4ccf772a26f54c6857f}{encryption\_mode}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00969}00969 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00970}00970         \mbox{\hyperlink{netgraph_8h_a2461bfcdc9e024484ed8037d386620e3}{NG\_FREE\_M}}(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00971}00971 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00972}00972         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00973}00973 \} \textcolor{comment}{/* encryption\_change */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00974}00974 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00975}00975 \textcolor{comment}{/* Read remote feature complete event */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00976}00976 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00977}\mbox{\hyperlink{ng__hci__evnt_8c_ad7181d9da8c2a74468e48987da24a0b3}{00977}} \mbox{\hyperlink{ng__hci__evnt_8c_ad7181d9da8c2a74468e48987da24a0b3}{read\_remote\_features\_compl}}(\mbox{\hyperlink{structng__hci__unit}{ng\_hci\_unit\_p}} unit, \textcolor{keyword}{struct} mbuf *\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}})}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00978}00978 \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00979}00979         ng\_hci\_read\_remote\_features\_compl\_ep    *ep = NULL;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00980}00980         \mbox{\hyperlink{structng__hci__unit__con}{ng\_hci\_unit\_con\_p}}                       con = NULL;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00981}00981         \mbox{\hyperlink{structng__hci__neighbor}{ng\_hci\_neighbor\_p}}                       n = NULL;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00982}00982         u\_int16\_t                                h;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00983}00983         \textcolor{keywordtype}{int}                                      error = 0;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00984}00984 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00985}00985         \mbox{\hyperlink{ng__hci__var_8h_a8e7394987275c0d3d5c788d003137197}{NG\_HCI\_M\_PULLUP}}(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, \textcolor{keyword}{sizeof}(*ep));}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00986}00986         \textcolor{keywordflow}{if} (\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}} == NULL)}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00987}00987                 \textcolor{keywordflow}{return} (ENOBUFS);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00988}00988 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00989}00989         ep = mtod(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, ng\_hci\_read\_remote\_features\_compl\_ep *);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00990}00990 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00991}00991         \textcolor{keywordflow}{if} (ep-\/>status == 0) \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00992}00992                 \textcolor{comment}{/* Check if we have this connection handle */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00993}00993                 h = \mbox{\hyperlink{ng__hci_8h_aeb50addefab64338354b16c9a89a50ee}{NG\_HCI\_CON\_HANDLE}}(le16toh(ep-\/>con\_handle));}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00994}00994                 con = \mbox{\hyperlink{ng__hci__misc_8c_a3b509cac93de160d32cdfb5a59ccff54}{ng\_hci\_con\_by\_handle}}(unit, h);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00995}00995                 \textcolor{keywordflow}{if} (con == NULL) \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00996}00996                         \mbox{\hyperlink{ng__hci__var_8h_a98c5548ff25cec6226d5624900801d5e}{NG\_HCI\_ALERT}}(}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00997}00997 \textcolor{stringliteral}{"{}\%s: \%s -\/ invalid connection handle=\%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00998}00998                                 \_\_func\_\_, \mbox{\hyperlink{netgraph_8h_a810ab9f272b092d488c5a52c6d5349e6}{NG\_NODE\_NAME}}(unit-\/>\mbox{\hyperlink{structng__hci__unit_a532226e8a5d24b9b0f2528e580326ef2}{node}}), h);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l00999}00999                         error = ENOENT;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01000}01000                         \textcolor{keywordflow}{goto} out;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01001}01001                 \}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01002}01002 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01003}01003                 \textcolor{comment}{/* Update cache entry */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01004}01004                 n = \mbox{\hyperlink{ng__hci__misc_8c_afd85df2950d8d6fd0e5237667595c655}{ng\_hci\_get\_neighbor}}(unit, \&con-\/>\mbox{\hyperlink{structng__hci__unit__con_a42808804831d9632a2db0e8f1f6367f5}{bdaddr}}, \mbox{\hyperlink{ng__hci_8h_aac64c463cc734bbdf8ba030619e8a64d}{NG\_HCI\_LINK\_ACL}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01005}01005                 \textcolor{keywordflow}{if} (n == NULL) \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01006}01006                         n = \mbox{\hyperlink{ng__hci__misc_8c_a27064102479d8203c42f5ddfa980c029}{ng\_hci\_new\_neighbor}}(unit);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01007}01007                         \textcolor{keywordflow}{if} (n == NULL) \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01008}01008                                 error = ENOMEM;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01009}01009                                 \textcolor{keywordflow}{goto} out;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01010}01010                         \}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01011}01011 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01012}01012                         bcopy(\&con-\/>\mbox{\hyperlink{structng__hci__unit__con_a42808804831d9632a2db0e8f1f6367f5}{bdaddr}}, \&n-\/>\mbox{\hyperlink{structng__hci__neighbor_a9c92229bd13342eb3bcdef1c0c558308}{bdaddr}}, \textcolor{keyword}{sizeof}(n-\/>\mbox{\hyperlink{structng__hci__neighbor_a9c92229bd13342eb3bcdef1c0c558308}{bdaddr}}));}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01013}01013                         n-\/>\mbox{\hyperlink{structng__hci__neighbor_a17508a20bea1459561a655c952746f53}{addrtype}} = \mbox{\hyperlink{ng__hci_8h_aac64c463cc734bbdf8ba030619e8a64d}{NG\_HCI\_LINK\_ACL}};}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01014}01014                 \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01015}01015                         getmicrotime(\&n-\/>\mbox{\hyperlink{structng__hci__neighbor_ada2f574a39016f8415ea44335795347d}{updated}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01016}01016 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01017}01017                 bcopy(ep-\/>features, n-\/>\mbox{\hyperlink{structng__hci__neighbor_ae879727bc4644647778d62b128d91c57}{features}}, \textcolor{keyword}{sizeof}(n-\/>\mbox{\hyperlink{structng__hci__neighbor_ae879727bc4644647778d62b128d91c57}{features}}));}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01018}01018         \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01019}01019                 \mbox{\hyperlink{ng__hci__var_8h_a347403c3d9eebde8aa890c65b4ab5874}{NG\_HCI\_ERR}}(}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01020}01020 \textcolor{stringliteral}{"{}\%s: \%s -\/ failed to read remote unit features, status=\%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01021}01021                         \_\_func\_\_, \mbox{\hyperlink{netgraph_8h_a810ab9f272b092d488c5a52c6d5349e6}{NG\_NODE\_NAME}}(unit-\/>\mbox{\hyperlink{structng__hci__unit_a532226e8a5d24b9b0f2528e580326ef2}{node}}), ep-\/>status);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01022}01022 out:}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01023}01023         \mbox{\hyperlink{netgraph_8h_a2461bfcdc9e024484ed8037d386620e3}{NG\_FREE\_M}}(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01024}01024 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01025}01025         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01026}01026 \} \textcolor{comment}{/* read\_remote\_features\_compl */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01027}01027 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01028}01028 \textcolor{comment}{/* QoS setup complete event */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01029}01029 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01030}\mbox{\hyperlink{ng__hci__evnt_8c_a63aaf4d4d915e1c1376cbaffb5370ac1}{01030}} \mbox{\hyperlink{ng__hci__evnt_8c_a63aaf4d4d915e1c1376cbaffb5370ac1}{qos\_setup\_compl}}(\mbox{\hyperlink{structng__hci__unit}{ng\_hci\_unit\_p}} unit, \textcolor{keyword}{struct} mbuf *\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}})}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01031}01031 \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01032}01032         ng\_hci\_qos\_setup\_compl\_ep       *ep = NULL;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01033}01033         \mbox{\hyperlink{structng__hci__unit__con}{ng\_hci\_unit\_con\_p}}               con = NULL;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01034}01034         u\_int16\_t                        h;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01035}01035         \textcolor{keywordtype}{int}                              error = 0;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01036}01036 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01037}01037         \mbox{\hyperlink{ng__hci__var_8h_a8e7394987275c0d3d5c788d003137197}{NG\_HCI\_M\_PULLUP}}(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, \textcolor{keyword}{sizeof}(*ep));}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01038}01038         \textcolor{keywordflow}{if} (\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}} == NULL)}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01039}01039                 \textcolor{keywordflow}{return} (ENOBUFS);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01040}01040 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01041}01041         ep = mtod(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, ng\_hci\_qos\_setup\_compl\_ep *);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01042}01042 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01043}01043         \textcolor{comment}{/* Check if we have this connection handle */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01044}01044         h = \mbox{\hyperlink{ng__hci_8h_aeb50addefab64338354b16c9a89a50ee}{NG\_HCI\_CON\_HANDLE}}(le16toh(ep-\/>con\_handle));}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01045}01045         con = \mbox{\hyperlink{ng__hci__misc_8c_a3b509cac93de160d32cdfb5a59ccff54}{ng\_hci\_con\_by\_handle}}(unit, h);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01046}01046         \textcolor{keywordflow}{if} (con == NULL) \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01047}01047                 \mbox{\hyperlink{ng__hci__var_8h_a98c5548ff25cec6226d5624900801d5e}{NG\_HCI\_ALERT}}(}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01048}01048 \textcolor{stringliteral}{"{}\%s: \%s -\/ invalid connection handle=\%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01049}01049                         \_\_func\_\_, \mbox{\hyperlink{netgraph_8h_a810ab9f272b092d488c5a52c6d5349e6}{NG\_NODE\_NAME}}(unit-\/>\mbox{\hyperlink{structng__hci__unit_a532226e8a5d24b9b0f2528e580326ef2}{node}}), h);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01050}01050                 error = ENOENT;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01051}01051         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (con-\/>\mbox{\hyperlink{structng__hci__unit__con_a3a396246ceda9716f91a480f401bdc7b}{link\_type}} != \mbox{\hyperlink{ng__hci_8h_aac64c463cc734bbdf8ba030619e8a64d}{NG\_HCI\_LINK\_ACL}}) \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01052}01052                 \mbox{\hyperlink{ng__hci__var_8h_a98c5548ff25cec6226d5624900801d5e}{NG\_HCI\_ALERT}}(}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01053}01053 \textcolor{stringliteral}{"{}\%s: \%s -\/ invalid link type=\%d, handle=\%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01054}01054                         \_\_func\_\_, \mbox{\hyperlink{netgraph_8h_a810ab9f272b092d488c5a52c6d5349e6}{NG\_NODE\_NAME}}(unit-\/>\mbox{\hyperlink{structng__hci__unit_a532226e8a5d24b9b0f2528e580326ef2}{node}}), con-\/>\mbox{\hyperlink{structng__hci__unit__con_a3a396246ceda9716f91a480f401bdc7b}{link\_type}}, h);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01055}01055                 error = EINVAL;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01056}01056         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (con-\/>\mbox{\hyperlink{structng__hci__unit__con_a7620ea8c44d5b7f7b48728f224c8fad3}{state}} != \mbox{\hyperlink{ng__hci_8h_a03025e63063d215be152dd1f8b86f199}{NG\_HCI\_CON\_OPEN}}) \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01057}01057                 \mbox{\hyperlink{ng__hci__var_8h_a98c5548ff25cec6226d5624900801d5e}{NG\_HCI\_ALERT}}(}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01058}01058 \textcolor{stringliteral}{"{}\%s: \%s -\/ invalid connection state=\%d, handle=\%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01059}01059                         \_\_func\_\_, \mbox{\hyperlink{netgraph_8h_a810ab9f272b092d488c5a52c6d5349e6}{NG\_NODE\_NAME}}(unit-\/>\mbox{\hyperlink{structng__hci__unit_a532226e8a5d24b9b0f2528e580326ef2}{node}}), }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01060}01060                         con-\/>\mbox{\hyperlink{structng__hci__unit__con_a7620ea8c44d5b7f7b48728f224c8fad3}{state}}, h);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01061}01061                 error = EINVAL;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01062}01062         \} \textcolor{keywordflow}{else} \textcolor{comment}{/* Notify upper layer */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01063}01063                 error = \mbox{\hyperlink{ng__hci__ulpi_8c_aecef55221eec735249ba0990e10a9a16}{ng\_hci\_lp\_qos\_cfm}}(con, ep-\/>status);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01064}01064 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01065}01065         \mbox{\hyperlink{netgraph_8h_a2461bfcdc9e024484ed8037d386620e3}{NG\_FREE\_M}}(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01066}01066 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01067}01067         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01068}01068 \} \textcolor{comment}{/* qos\_setup\_compl */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01069}01069 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01070}01070 \textcolor{comment}{/* Hardware error event */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01071}01071 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01072}\mbox{\hyperlink{ng__hci__evnt_8c_a3f3e72f870dabc64f27be769d29f035d}{01072}} \mbox{\hyperlink{ng__hci__evnt_8c_a3f3e72f870dabc64f27be769d29f035d}{hardware\_error}}(\mbox{\hyperlink{structng__hci__unit}{ng\_hci\_unit\_p}} unit, \textcolor{keyword}{struct} mbuf *\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}})}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01073}01073 \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01074}01074         \mbox{\hyperlink{ng__hci__var_8h_a98c5548ff25cec6226d5624900801d5e}{NG\_HCI\_ALERT}}(}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01075}01075 \textcolor{stringliteral}{"{}\%s: \%s -\/ hardware error \%\#x\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01076}01076                 \_\_func\_\_, \mbox{\hyperlink{netgraph_8h_a810ab9f272b092d488c5a52c6d5349e6}{NG\_NODE\_NAME}}(unit-\/>\mbox{\hyperlink{structng__hci__unit_a532226e8a5d24b9b0f2528e580326ef2}{node}}), *mtod(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, u\_int8\_t *));}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01077}01077 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01078}01078         \mbox{\hyperlink{netgraph_8h_a2461bfcdc9e024484ed8037d386620e3}{NG\_FREE\_M}}(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01079}01079 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01080}01080         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01081}01081 \} \textcolor{comment}{/* hardware\_error */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01082}01082 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01083}01083 \textcolor{comment}{/* Role change event */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01084}01084 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01085}\mbox{\hyperlink{ng__hci__evnt_8c_a312efab4abeca5fc438aec79973ef56a}{01085}} \mbox{\hyperlink{ng__hci__evnt_8c_a312efab4abeca5fc438aec79973ef56a}{role\_change}}(\mbox{\hyperlink{structng__hci__unit}{ng\_hci\_unit\_p}} unit, \textcolor{keyword}{struct} mbuf *\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}})}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01086}01086 \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01087}01087         ng\_hci\_role\_change\_ep   *ep = NULL;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01088}01088         \mbox{\hyperlink{structng__hci__unit__con}{ng\_hci\_unit\_con\_p}}       con = NULL;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01089}01089 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01090}01090         \mbox{\hyperlink{ng__hci__var_8h_a8e7394987275c0d3d5c788d003137197}{NG\_HCI\_M\_PULLUP}}(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, \textcolor{keyword}{sizeof}(*ep));}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01091}01091         \textcolor{keywordflow}{if} (\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}} == NULL)}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01092}01092                 \textcolor{keywordflow}{return} (ENOBUFS);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01093}01093 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01094}01094         ep = mtod(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, ng\_hci\_role\_change\_ep *);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01095}01095 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01096}01096         \textcolor{keywordflow}{if} (ep-\/>status == 0) \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01097}01097                 \textcolor{comment}{/* XXX shoud we also change "{}role"{} for SCO connections? */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01098}01098                 con = \mbox{\hyperlink{ng__hci__misc_8c_ad9bc4055b9ba79cb181bd3b6ddf1e500}{ng\_hci\_con\_by\_bdaddr}}(unit, \&ep-\/>\mbox{\hyperlink{structng__hci__unit_adf536cb9e87b01fe0d1087bc35e8c3e8}{bdaddr}}, \mbox{\hyperlink{ng__hci_8h_aac64c463cc734bbdf8ba030619e8a64d}{NG\_HCI\_LINK\_ACL}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01099}01099                 \textcolor{keywordflow}{if} (con != NULL)}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01100}01100                         con-\/>\mbox{\hyperlink{structng__hci__unit__con_a6e70e41e1ce8b1ef46fb232fdd4cac3a}{role}} = ep-\/>role;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01101}01101                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01102}01102                         \mbox{\hyperlink{ng__hci__var_8h_a98c5548ff25cec6226d5624900801d5e}{NG\_HCI\_ALERT}}(}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01103}01103 \textcolor{stringliteral}{"{}\%s: \%s -\/ ACL connection does not exist, bdaddr=\%x:\%x:\%x:\%x:\%x:\%x\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01104}01104                                 \_\_func\_\_, \mbox{\hyperlink{netgraph_8h_a810ab9f272b092d488c5a52c6d5349e6}{NG\_NODE\_NAME}}(unit-\/>\mbox{\hyperlink{structng__hci__unit_a532226e8a5d24b9b0f2528e580326ef2}{node}}),}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01105}01105                                 ep-\/>bdaddr.b[5], ep-\/>bdaddr.b[4], }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01106}01106                                 ep-\/>bdaddr.b[3], ep-\/>bdaddr.b[2], }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01107}01107                                 ep-\/>bdaddr.b[1], ep-\/>bdaddr.b[0]);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01108}01108         \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01109}01109                 \mbox{\hyperlink{ng__hci__var_8h_a347403c3d9eebde8aa890c65b4ab5874}{NG\_HCI\_ERR}}(}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01110}01110 \textcolor{stringliteral}{"{}\%s: \%s -\/ failed to change role, status=\%d, bdaddr=\%x:\%x:\%x:\%x:\%x:\%x\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01111}01111                         \_\_func\_\_, \mbox{\hyperlink{netgraph_8h_a810ab9f272b092d488c5a52c6d5349e6}{NG\_NODE\_NAME}}(unit-\/>\mbox{\hyperlink{structng__hci__unit_a532226e8a5d24b9b0f2528e580326ef2}{node}}), ep-\/>status,}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01112}01112                         ep-\/>bdaddr.b[5], ep-\/>bdaddr.b[4], ep-\/>bdaddr.b[3],}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01113}01113                         ep-\/>bdaddr.b[2], ep-\/>bdaddr.b[1], ep-\/>bdaddr.b[0]);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01114}01114 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01115}01115         \mbox{\hyperlink{netgraph_8h_a2461bfcdc9e024484ed8037d386620e3}{NG\_FREE\_M}}(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01116}01116 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01117}01117         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01118}01118 \} \textcolor{comment}{/* role\_change */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01119}01119 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01120}01120 \textcolor{comment}{/* Number of completed packets event */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01121}01121 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01122}\mbox{\hyperlink{ng__hci__evnt_8c_a5558f542091ea57c05e7612ee45c6e76}{01122}} \mbox{\hyperlink{ng__hci__evnt_8c_a5558f542091ea57c05e7612ee45c6e76}{num\_compl\_pkts}}(\mbox{\hyperlink{structng__hci__unit}{ng\_hci\_unit\_p}} unit, \textcolor{keyword}{struct} mbuf *\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}})}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01123}01123 \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01124}01124         ng\_hci\_num\_compl\_pkts\_ep        *ep = NULL;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01125}01125         \mbox{\hyperlink{structng__hci__unit__con}{ng\_hci\_unit\_con\_p}}               con = NULL;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01126}01126         u\_int16\_t                        h, p;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01127}01127 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01128}01128         \mbox{\hyperlink{ng__hci__var_8h_a8e7394987275c0d3d5c788d003137197}{NG\_HCI\_M\_PULLUP}}(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, \textcolor{keyword}{sizeof}(*ep));}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01129}01129         \textcolor{keywordflow}{if} (\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}} == NULL)}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01130}01130                 \textcolor{keywordflow}{return} (ENOBUFS);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01131}01131 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01132}01132         ep = mtod(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, ng\_hci\_num\_compl\_pkts\_ep *);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01133}01133         m\_adj(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, \textcolor{keyword}{sizeof}(*ep));}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01134}01134 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01135}01135         \textcolor{keywordflow}{for} (; ep-\/>num\_con\_handles > 0; ep-\/>num\_con\_handles -\/-\/) \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01136}01136                 \textcolor{comment}{/* Get connection handle */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01137}01137                 m\_copydata(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, 0, \textcolor{keyword}{sizeof}(h), (caddr\_t) \&h);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01138}01138                 m\_adj(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, \textcolor{keyword}{sizeof}(h));}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01139}01139                 h = \mbox{\hyperlink{ng__hci_8h_aeb50addefab64338354b16c9a89a50ee}{NG\_HCI\_CON\_HANDLE}}(le16toh(h));}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01140}01140 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01141}01141                 \textcolor{comment}{/* Get number of completed packets */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01142}01142                 m\_copydata(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, 0, \textcolor{keyword}{sizeof}(p), (caddr\_t) \&p);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01143}01143                 m\_adj(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, \textcolor{keyword}{sizeof}(p));}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01144}01144                 p = le16toh(p);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01145}01145 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01146}01146                 \textcolor{comment}{/* Check if we have this connection handle */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01147}01147                 con = \mbox{\hyperlink{ng__hci__misc_8c_a3b509cac93de160d32cdfb5a59ccff54}{ng\_hci\_con\_by\_handle}}(unit, h);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01148}01148                 \textcolor{keywordflow}{if} (con != NULL) \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01149}01149                         con-\/>\mbox{\hyperlink{structng__hci__unit__con_aa23024b50578ed77f37979afcad6539f}{pending}} -\/= p;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01150}01150                         \textcolor{keywordflow}{if} (con-\/>\mbox{\hyperlink{structng__hci__unit__con_aa23024b50578ed77f37979afcad6539f}{pending}} < 0) \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01151}01151                                 \mbox{\hyperlink{ng__hci__var_8h_add54db430ea340e556df410026a5c003}{NG\_HCI\_WARN}}(}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01152}01152 \textcolor{stringliteral}{"{}\%s: \%s -\/ pending packet counter is out of sync! "{}} \(\backslash\)}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01153}01153 \textcolor{stringliteral}{"{}handle=\%d, pending=\%d, ncp=\%d\(\backslash\)n"{}},      \_\_func\_\_, \mbox{\hyperlink{netgraph_8h_a810ab9f272b092d488c5a52c6d5349e6}{NG\_NODE\_NAME}}(unit-\/>\mbox{\hyperlink{structng__hci__unit_a532226e8a5d24b9b0f2528e580326ef2}{node}}), }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01154}01154                                         con-\/>\mbox{\hyperlink{structng__hci__unit__con_a02c77256cfd83dca50038f1281f78c2d}{con\_handle}}, con-\/>\mbox{\hyperlink{structng__hci__unit__con_aa23024b50578ed77f37979afcad6539f}{pending}}, p);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01155}01155 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01156}01156                                 con-\/>\mbox{\hyperlink{structng__hci__unit__con_aa23024b50578ed77f37979afcad6539f}{pending}} = 0;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01157}01157                         \}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01158}01158 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01159}01159                         \textcolor{comment}{/* Update buffer descriptor */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01160}01160                         \textcolor{keywordflow}{if} (con-\/>\mbox{\hyperlink{structng__hci__unit__con_a3a396246ceda9716f91a480f401bdc7b}{link\_type}} != \mbox{\hyperlink{ng__hci_8h_af8bd621d46e75d10e745698aa7b543b2}{NG\_HCI\_LINK\_SCO}})}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01161}01161                                 \mbox{\hyperlink{ng__hci__var_8h_ae9efc317475cfdd78b25bc159155a7d7}{NG\_HCI\_BUFF\_ACL\_FREE}}(unit-\/>\mbox{\hyperlink{structng__hci__unit_ae360e0f96519ea18d18b3ed06a5198f8}{buffer}}, p);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01162}01162                         \textcolor{keywordflow}{else} }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01163}01163                                 \mbox{\hyperlink{ng__hci__var_8h_ad3c25df52552584c7d58c06f13c23a66}{NG\_HCI\_BUFF\_SCO\_FREE}}(unit-\/>\mbox{\hyperlink{structng__hci__unit_ae360e0f96519ea18d18b3ed06a5198f8}{buffer}}, p);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01164}01164                 \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01165}01165                         \mbox{\hyperlink{ng__hci__var_8h_a98c5548ff25cec6226d5624900801d5e}{NG\_HCI\_ALERT}}(}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01166}01166 \textcolor{stringliteral}{"{}\%s: \%s -\/ invalid connection handle=\%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01167}01167                                 \_\_func\_\_, \mbox{\hyperlink{netgraph_8h_a810ab9f272b092d488c5a52c6d5349e6}{NG\_NODE\_NAME}}(unit-\/>\mbox{\hyperlink{structng__hci__unit_a532226e8a5d24b9b0f2528e580326ef2}{node}}), h);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01168}01168         \}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01169}01169 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01170}01170         \mbox{\hyperlink{netgraph_8h_a2461bfcdc9e024484ed8037d386620e3}{NG\_FREE\_M}}(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01171}01171 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01172}01172         \textcolor{comment}{/* Send more data */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01173}01173         \mbox{\hyperlink{ng__hci__evnt_8c_a2de49eab926d8f05c99c0cc3748ed6c4}{ng\_hci\_send\_data}}(unit);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01174}01174 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01175}01175         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01176}01176 \} \textcolor{comment}{/* num\_compl\_pkts */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01177}01177 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01178}01178 \textcolor{comment}{/* Mode change event */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01179}01179 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01180}\mbox{\hyperlink{ng__hci__evnt_8c_a0904fffb58cb35aa3b8f7b3ffc4a2257}{01180}} \mbox{\hyperlink{ng__hci__evnt_8c_a0904fffb58cb35aa3b8f7b3ffc4a2257}{mode\_change}}(\mbox{\hyperlink{structng__hci__unit}{ng\_hci\_unit\_p}} unit, \textcolor{keyword}{struct} mbuf *\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}})}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01181}01181 \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01182}01182         ng\_hci\_mode\_change\_ep   *ep = NULL;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01183}01183         \mbox{\hyperlink{structng__hci__unit__con}{ng\_hci\_unit\_con\_p}}       con = NULL;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01184}01184         \textcolor{keywordtype}{int}                      error = 0;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01185}01185 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01186}01186         \mbox{\hyperlink{ng__hci__var_8h_a8e7394987275c0d3d5c788d003137197}{NG\_HCI\_M\_PULLUP}}(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, \textcolor{keyword}{sizeof}(*ep));}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01187}01187         \textcolor{keywordflow}{if} (\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}} == NULL)}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01188}01188                 \textcolor{keywordflow}{return} (ENOBUFS);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01189}01189 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01190}01190         ep = mtod(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, ng\_hci\_mode\_change\_ep *);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01191}01191 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01192}01192         \textcolor{keywordflow}{if} (ep-\/>status == 0) \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01193}01193                 u\_int16\_t       h = \mbox{\hyperlink{ng__hci_8h_aeb50addefab64338354b16c9a89a50ee}{NG\_HCI\_CON\_HANDLE}}(le16toh(ep-\/>con\_handle));}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01194}01194 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01195}01195                 con = \mbox{\hyperlink{ng__hci__misc_8c_a3b509cac93de160d32cdfb5a59ccff54}{ng\_hci\_con\_by\_handle}}(unit, h);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01196}01196                 \textcolor{keywordflow}{if} (con == NULL) \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01197}01197                         \mbox{\hyperlink{ng__hci__var_8h_a98c5548ff25cec6226d5624900801d5e}{NG\_HCI\_ALERT}}(}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01198}01198 \textcolor{stringliteral}{"{}\%s: \%s -\/ invalid connection handle=\%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01199}01199                                 \_\_func\_\_, \mbox{\hyperlink{netgraph_8h_a810ab9f272b092d488c5a52c6d5349e6}{NG\_NODE\_NAME}}(unit-\/>\mbox{\hyperlink{structng__hci__unit_a532226e8a5d24b9b0f2528e580326ef2}{node}}), h);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01200}01200                         error = ENOENT;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01201}01201                 \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (con-\/>\mbox{\hyperlink{structng__hci__unit__con_a3a396246ceda9716f91a480f401bdc7b}{link\_type}} != \mbox{\hyperlink{ng__hci_8h_aac64c463cc734bbdf8ba030619e8a64d}{NG\_HCI\_LINK\_ACL}}) \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01202}01202                         \mbox{\hyperlink{ng__hci__var_8h_a98c5548ff25cec6226d5624900801d5e}{NG\_HCI\_ALERT}}(}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01203}01203 \textcolor{stringliteral}{"{}\%s: \%s -\/ invalid link type=\%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01204}01204                                 \_\_func\_\_, \mbox{\hyperlink{netgraph_8h_a810ab9f272b092d488c5a52c6d5349e6}{NG\_NODE\_NAME}}(unit-\/>\mbox{\hyperlink{structng__hci__unit_a532226e8a5d24b9b0f2528e580326ef2}{node}}), }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01205}01205                                 con-\/>\mbox{\hyperlink{structng__hci__unit__con_a3a396246ceda9716f91a480f401bdc7b}{link\_type}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01206}01206                         error = EINVAL;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01207}01207                 \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01208}01208                         con-\/>\mbox{\hyperlink{structng__hci__unit__con_a3d1b8baed1242d9f7611d03560fe7921}{mode}} = ep-\/>unit\_mode;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01209}01209         \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01210}01210                 \mbox{\hyperlink{ng__hci__var_8h_a347403c3d9eebde8aa890c65b4ab5874}{NG\_HCI\_ERR}}(}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01211}01211 \textcolor{stringliteral}{"{}\%s: \%s -\/ failed to change mode, status=\%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01212}01212                         \_\_func\_\_, \mbox{\hyperlink{netgraph_8h_a810ab9f272b092d488c5a52c6d5349e6}{NG\_NODE\_NAME}}(unit-\/>\mbox{\hyperlink{structng__hci__unit_a532226e8a5d24b9b0f2528e580326ef2}{node}}), ep-\/>status);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01213}01213 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01214}01214         \mbox{\hyperlink{netgraph_8h_a2461bfcdc9e024484ed8037d386620e3}{NG\_FREE\_M}}(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01215}01215 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01216}01216         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01217}01217 \} \textcolor{comment}{/* mode\_change */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01218}01218 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01219}01219 \textcolor{comment}{/* Data buffer overflow event */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01220}01220 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01221}\mbox{\hyperlink{ng__hci__evnt_8c_a3dcf0dde47aa271e9791e11f257b385f}{01221}} \mbox{\hyperlink{ng__hci__evnt_8c_a3dcf0dde47aa271e9791e11f257b385f}{data\_buffer\_overflow}}(\mbox{\hyperlink{structng__hci__unit}{ng\_hci\_unit\_p}} unit, \textcolor{keyword}{struct} mbuf *\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}})}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01222}01222 \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01223}01223         \mbox{\hyperlink{ng__hci__var_8h_a98c5548ff25cec6226d5624900801d5e}{NG\_HCI\_ALERT}}(}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01224}01224 \textcolor{stringliteral}{"{}\%s: \%s -\/ \%s data buffer overflow\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01225}01225                 \_\_func\_\_, \mbox{\hyperlink{netgraph_8h_a810ab9f272b092d488c5a52c6d5349e6}{NG\_NODE\_NAME}}(unit-\/>\mbox{\hyperlink{structng__hci__unit_a532226e8a5d24b9b0f2528e580326ef2}{node}}),}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01226}01226                 (*mtod(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, u\_int8\_t *) == \mbox{\hyperlink{ng__hci_8h_aac64c463cc734bbdf8ba030619e8a64d}{NG\_HCI\_LINK\_ACL}})? \textcolor{stringliteral}{"{}ACL"{}} : \textcolor{stringliteral}{"{}SCO"{}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01227}01227 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01228}01228         \mbox{\hyperlink{netgraph_8h_a2461bfcdc9e024484ed8037d386620e3}{NG\_FREE\_M}}(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01229}01229 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01230}01230         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01231}01231 \} \textcolor{comment}{/* data\_buffer\_overflow */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01232}01232 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01233}01233 \textcolor{comment}{/* Read clock offset complete event */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01234}01234 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01235}\mbox{\hyperlink{ng__hci__evnt_8c_a327a9d42ef63dcfd5b2604dc5f55636f}{01235}} \mbox{\hyperlink{ng__hci__evnt_8c_a327a9d42ef63dcfd5b2604dc5f55636f}{read\_clock\_offset\_compl}}(\mbox{\hyperlink{structng__hci__unit}{ng\_hci\_unit\_p}} unit, \textcolor{keyword}{struct} mbuf *\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}})}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01236}01236 \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01237}01237         ng\_hci\_read\_clock\_offset\_compl\_ep       *ep = NULL;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01238}01238         \mbox{\hyperlink{structng__hci__unit__con}{ng\_hci\_unit\_con\_p}}                       con = NULL;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01239}01239         \mbox{\hyperlink{structng__hci__neighbor}{ng\_hci\_neighbor\_p}}                       n = NULL;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01240}01240         \textcolor{keywordtype}{int}                                      error = 0;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01241}01241 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01242}01242         \mbox{\hyperlink{ng__hci__var_8h_a8e7394987275c0d3d5c788d003137197}{NG\_HCI\_M\_PULLUP}}(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, \textcolor{keyword}{sizeof}(*ep));}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01243}01243         \textcolor{keywordflow}{if} (\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}} == NULL)}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01244}01244                 \textcolor{keywordflow}{return} (ENOBUFS);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01245}01245 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01246}01246         ep = mtod(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, ng\_hci\_read\_clock\_offset\_compl\_ep *);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01247}01247 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01248}01248         \textcolor{keywordflow}{if} (ep-\/>status == 0) \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01249}01249                 u\_int16\_t       h = \mbox{\hyperlink{ng__hci_8h_aeb50addefab64338354b16c9a89a50ee}{NG\_HCI\_CON\_HANDLE}}(le16toh(ep-\/>con\_handle));}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01250}01250 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01251}01251                 con = \mbox{\hyperlink{ng__hci__misc_8c_a3b509cac93de160d32cdfb5a59ccff54}{ng\_hci\_con\_by\_handle}}(unit, h);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01252}01252                 \textcolor{keywordflow}{if} (con == NULL) \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01253}01253                         \mbox{\hyperlink{ng__hci__var_8h_a98c5548ff25cec6226d5624900801d5e}{NG\_HCI\_ALERT}}(}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01254}01254 \textcolor{stringliteral}{"{}\%s: \%s -\/ invalid connection handle=\%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01255}01255                                 \_\_func\_\_, \mbox{\hyperlink{netgraph_8h_a810ab9f272b092d488c5a52c6d5349e6}{NG\_NODE\_NAME}}(unit-\/>\mbox{\hyperlink{structng__hci__unit_a532226e8a5d24b9b0f2528e580326ef2}{node}}), h);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01256}01256                         error = ENOENT;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01257}01257                         \textcolor{keywordflow}{goto} out;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01258}01258                 \}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01259}01259 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01260}01260                 \textcolor{comment}{/* Update cache entry */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01261}01261                 n = \mbox{\hyperlink{ng__hci__misc_8c_afd85df2950d8d6fd0e5237667595c655}{ng\_hci\_get\_neighbor}}(unit, \&con-\/>\mbox{\hyperlink{structng__hci__unit__con_a42808804831d9632a2db0e8f1f6367f5}{bdaddr}}, \mbox{\hyperlink{ng__hci_8h_aac64c463cc734bbdf8ba030619e8a64d}{NG\_HCI\_LINK\_ACL}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01262}01262                 \textcolor{keywordflow}{if} (n == NULL) \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01263}01263                         n = \mbox{\hyperlink{ng__hci__misc_8c_a27064102479d8203c42f5ddfa980c029}{ng\_hci\_new\_neighbor}}(unit);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01264}01264                         \textcolor{keywordflow}{if} (n == NULL) \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01265}01265                                 error = ENOMEM;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01266}01266                                 \textcolor{keywordflow}{goto} out;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01267}01267                         \}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01268}01268 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01269}01269                         bcopy(\&con-\/>\mbox{\hyperlink{structng__hci__unit__con_a42808804831d9632a2db0e8f1f6367f5}{bdaddr}}, \&n-\/>\mbox{\hyperlink{structng__hci__neighbor_a9c92229bd13342eb3bcdef1c0c558308}{bdaddr}}, \textcolor{keyword}{sizeof}(n-\/>\mbox{\hyperlink{structng__hci__neighbor_a9c92229bd13342eb3bcdef1c0c558308}{bdaddr}}));}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01270}01270                         n-\/>\mbox{\hyperlink{structng__hci__neighbor_a17508a20bea1459561a655c952746f53}{addrtype}} = \mbox{\hyperlink{ng__hci_8h_aac64c463cc734bbdf8ba030619e8a64d}{NG\_HCI\_LINK\_ACL}};}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01271}01271                 \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01272}01272                         getmicrotime(\&n-\/>\mbox{\hyperlink{structng__hci__neighbor_ada2f574a39016f8415ea44335795347d}{updated}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01273}01273 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01274}01274                 n-\/>\mbox{\hyperlink{structng__hci__neighbor_a5f88df1910f72a24c5279a639ee9f3f2}{clock\_offset}} = le16toh(ep-\/>clock\_offset);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01275}01275         \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01276}01276                 \mbox{\hyperlink{ng__hci__var_8h_a347403c3d9eebde8aa890c65b4ab5874}{NG\_HCI\_ERR}}(}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01277}01277 \textcolor{stringliteral}{"{}\%s: \%s -\/ failed to Read Remote Clock Offset, status=\%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01278}01278                         \_\_func\_\_, \mbox{\hyperlink{netgraph_8h_a810ab9f272b092d488c5a52c6d5349e6}{NG\_NODE\_NAME}}(unit-\/>\mbox{\hyperlink{structng__hci__unit_a532226e8a5d24b9b0f2528e580326ef2}{node}}), ep-\/>status);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01279}01279 out:}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01280}01280         \mbox{\hyperlink{netgraph_8h_a2461bfcdc9e024484ed8037d386620e3}{NG\_FREE\_M}}(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01281}01281 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01282}01282         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01283}01283 \} \textcolor{comment}{/* read\_clock\_offset\_compl */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01284}01284 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01285}01285 \textcolor{comment}{/* QoS violation event */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01286}01286 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01287}\mbox{\hyperlink{ng__hci__evnt_8c_a266f8faecc6e3629b5ad517dc0de4114}{01287}} \mbox{\hyperlink{ng__hci__evnt_8c_a266f8faecc6e3629b5ad517dc0de4114}{qos\_violation}}(\mbox{\hyperlink{structng__hci__unit}{ng\_hci\_unit\_p}} unit, \textcolor{keyword}{struct} mbuf *\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}})}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01288}01288 \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01289}01289         ng\_hci\_qos\_violation\_ep *ep = NULL;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01290}01290         \mbox{\hyperlink{structng__hci__unit__con}{ng\_hci\_unit\_con\_p}}       con = NULL;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01291}01291         u\_int16\_t                h;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01292}01292         \textcolor{keywordtype}{int}                      error = 0;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01293}01293 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01294}01294         \mbox{\hyperlink{ng__hci__var_8h_a8e7394987275c0d3d5c788d003137197}{NG\_HCI\_M\_PULLUP}}(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, \textcolor{keyword}{sizeof}(*ep));}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01295}01295         \textcolor{keywordflow}{if} (\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}} == NULL)}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01296}01296                 \textcolor{keywordflow}{return} (ENOBUFS);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01297}01297 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01298}01298         ep = mtod(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, ng\_hci\_qos\_violation\_ep *);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01299}01299 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01300}01300         \textcolor{comment}{/* Check if we have this connection handle */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01301}01301         h = \mbox{\hyperlink{ng__hci_8h_aeb50addefab64338354b16c9a89a50ee}{NG\_HCI\_CON\_HANDLE}}(le16toh(ep-\/>con\_handle));}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01302}01302         con = \mbox{\hyperlink{ng__hci__misc_8c_a3b509cac93de160d32cdfb5a59ccff54}{ng\_hci\_con\_by\_handle}}(unit, h);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01303}01303         \textcolor{keywordflow}{if} (con == NULL) \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01304}01304                 \mbox{\hyperlink{ng__hci__var_8h_a98c5548ff25cec6226d5624900801d5e}{NG\_HCI\_ALERT}}(}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01305}01305 \textcolor{stringliteral}{"{}\%s: \%s -\/ invalid connection handle=\%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01306}01306                         \_\_func\_\_, \mbox{\hyperlink{netgraph_8h_a810ab9f272b092d488c5a52c6d5349e6}{NG\_NODE\_NAME}}(unit-\/>\mbox{\hyperlink{structng__hci__unit_a532226e8a5d24b9b0f2528e580326ef2}{node}}), h);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01307}01307                 error = ENOENT;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01308}01308         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (con-\/>\mbox{\hyperlink{structng__hci__unit__con_a3a396246ceda9716f91a480f401bdc7b}{link\_type}} != \mbox{\hyperlink{ng__hci_8h_aac64c463cc734bbdf8ba030619e8a64d}{NG\_HCI\_LINK\_ACL}}) \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01309}01309                 \mbox{\hyperlink{ng__hci__var_8h_a98c5548ff25cec6226d5624900801d5e}{NG\_HCI\_ALERT}}(}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01310}01310 \textcolor{stringliteral}{"{}\%s: \%s -\/ invalid link type=\%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01311}01311                         \_\_func\_\_, \mbox{\hyperlink{netgraph_8h_a810ab9f272b092d488c5a52c6d5349e6}{NG\_NODE\_NAME}}(unit-\/>\mbox{\hyperlink{structng__hci__unit_a532226e8a5d24b9b0f2528e580326ef2}{node}}), con-\/>\mbox{\hyperlink{structng__hci__unit__con_a3a396246ceda9716f91a480f401bdc7b}{link\_type}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01312}01312                 error = EINVAL;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01313}01313         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (con-\/>\mbox{\hyperlink{structng__hci__unit__con_a7620ea8c44d5b7f7b48728f224c8fad3}{state}} != \mbox{\hyperlink{ng__hci_8h_a03025e63063d215be152dd1f8b86f199}{NG\_HCI\_CON\_OPEN}}) \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01314}01314                 \mbox{\hyperlink{ng__hci__var_8h_a98c5548ff25cec6226d5624900801d5e}{NG\_HCI\_ALERT}}(}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01315}01315 \textcolor{stringliteral}{"{}\%s: \%s -\/ invalid connection state=\%d, handle=\%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01316}01316                         \_\_func\_\_, \mbox{\hyperlink{netgraph_8h_a810ab9f272b092d488c5a52c6d5349e6}{NG\_NODE\_NAME}}(unit-\/>\mbox{\hyperlink{structng__hci__unit_a532226e8a5d24b9b0f2528e580326ef2}{node}}), con-\/>\mbox{\hyperlink{structng__hci__unit__con_a7620ea8c44d5b7f7b48728f224c8fad3}{state}}, h);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01317}01317                 error = EINVAL;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01318}01318         \} \textcolor{keywordflow}{else} \textcolor{comment}{/* Notify upper layer */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01319}01319                 error = \mbox{\hyperlink{ng__hci__ulpi_8c_ac3bd684213e259e7dac0782884fc3e6d}{ng\_hci\_lp\_qos\_ind}}(con); }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01320}01320 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01321}01321         \mbox{\hyperlink{netgraph_8h_a2461bfcdc9e024484ed8037d386620e3}{NG\_FREE\_M}}(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01322}01322 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01323}01323         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01324}01324 \} \textcolor{comment}{/* qos\_violation */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01325}01325 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01326}01326 \textcolor{comment}{/* Page scan mode change event */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01327}01327 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01328}\mbox{\hyperlink{ng__hci__evnt_8c_addc84fe15f089fcd8afb6ef287ba6f50}{01328}} \mbox{\hyperlink{ng__hci__evnt_8c_addc84fe15f089fcd8afb6ef287ba6f50}{page\_scan\_mode\_change}}(\mbox{\hyperlink{structng__hci__unit}{ng\_hci\_unit\_p}} unit, \textcolor{keyword}{struct} mbuf *\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}})}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01329}01329 \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01330}01330         ng\_hci\_page\_scan\_mode\_change\_ep *ep = NULL;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01331}01331         \mbox{\hyperlink{structng__hci__neighbor}{ng\_hci\_neighbor\_p}}               n = NULL;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01332}01332         \textcolor{keywordtype}{int}                              error = 0;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01333}01333 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01334}01334         \mbox{\hyperlink{ng__hci__var_8h_a8e7394987275c0d3d5c788d003137197}{NG\_HCI\_M\_PULLUP}}(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, \textcolor{keyword}{sizeof}(*ep));}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01335}01335         \textcolor{keywordflow}{if} (\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}} == NULL)}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01336}01336                 \textcolor{keywordflow}{return} (ENOBUFS);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01337}01337 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01338}01338         ep = mtod(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, ng\_hci\_page\_scan\_mode\_change\_ep *);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01339}01339 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01340}01340         \textcolor{comment}{/* Update cache entry */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01341}01341         n = \mbox{\hyperlink{ng__hci__misc_8c_afd85df2950d8d6fd0e5237667595c655}{ng\_hci\_get\_neighbor}}(unit, \&ep-\/>\mbox{\hyperlink{structng__hci__unit_adf536cb9e87b01fe0d1087bc35e8c3e8}{bdaddr}}, \mbox{\hyperlink{ng__hci_8h_aac64c463cc734bbdf8ba030619e8a64d}{NG\_HCI\_LINK\_ACL}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01342}01342         \textcolor{keywordflow}{if} (n == NULL) \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01343}01343                 n = \mbox{\hyperlink{ng__hci__misc_8c_a27064102479d8203c42f5ddfa980c029}{ng\_hci\_new\_neighbor}}(unit);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01344}01344                 \textcolor{keywordflow}{if} (n == NULL) \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01345}01345                         error = ENOMEM;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01346}01346                         \textcolor{keywordflow}{goto} out;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01347}01347                 \}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01348}01348 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01349}01349                 bcopy(\&ep-\/>bdaddr, \&n-\/>\mbox{\hyperlink{structng__hci__neighbor_a9c92229bd13342eb3bcdef1c0c558308}{bdaddr}}, \textcolor{keyword}{sizeof}(n-\/>\mbox{\hyperlink{structng__hci__neighbor_a9c92229bd13342eb3bcdef1c0c558308}{bdaddr}}));}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01350}01350                 n-\/>\mbox{\hyperlink{structng__hci__neighbor_a17508a20bea1459561a655c952746f53}{addrtype}} = \mbox{\hyperlink{ng__hci_8h_aac64c463cc734bbdf8ba030619e8a64d}{NG\_HCI\_LINK\_ACL}};}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01351}01351         \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01352}01352                 getmicrotime(\&n-\/>\mbox{\hyperlink{structng__hci__neighbor_ada2f574a39016f8415ea44335795347d}{updated}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01353}01353 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01354}01354         n-\/>\mbox{\hyperlink{structng__hci__neighbor_af8b3a67a87da9a9f0211a69322a6e811}{page\_scan\_mode}} = ep-\/>page\_scan\_mode;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01355}01355 out:}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01356}01356         \mbox{\hyperlink{netgraph_8h_a2461bfcdc9e024484ed8037d386620e3}{NG\_FREE\_M}}(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01357}01357 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01358}01358         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01359}01359 \} \textcolor{comment}{/* page\_scan\_mode\_change */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01360}01360 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01361}01361 \textcolor{comment}{/* Page scan repetition mode change event */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01362}01362 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01363}\mbox{\hyperlink{ng__hci__evnt_8c_a052f1f563960564e95b5966596126d68}{01363}} \mbox{\hyperlink{ng__hci__evnt_8c_a052f1f563960564e95b5966596126d68}{page\_scan\_rep\_mode\_change}}(\mbox{\hyperlink{structng__hci__unit}{ng\_hci\_unit\_p}} unit, \textcolor{keyword}{struct} mbuf *\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}})}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01364}01364 \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01365}01365         ng\_hci\_page\_scan\_rep\_mode\_change\_ep     *ep = NULL;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01366}01366         \mbox{\hyperlink{structng__hci__neighbor}{ng\_hci\_neighbor\_p}}                       n = NULL;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01367}01367         \textcolor{keywordtype}{int}                                      error = 0;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01368}01368 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01369}01369         \mbox{\hyperlink{ng__hci__var_8h_a8e7394987275c0d3d5c788d003137197}{NG\_HCI\_M\_PULLUP}}(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, \textcolor{keyword}{sizeof}(*ep));}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01370}01370         \textcolor{keywordflow}{if} (\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}} == NULL)}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01371}01371                 \textcolor{keywordflow}{return} (ENOBUFS);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01372}01372 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01373}01373         ep = mtod(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}}, ng\_hci\_page\_scan\_rep\_mode\_change\_ep *);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01374}01374 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01375}01375         \textcolor{comment}{/* Update cache entry */}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01376}01376         n = \mbox{\hyperlink{ng__hci__misc_8c_afd85df2950d8d6fd0e5237667595c655}{ng\_hci\_get\_neighbor}}(unit, \&ep-\/>\mbox{\hyperlink{structng__hci__unit_adf536cb9e87b01fe0d1087bc35e8c3e8}{bdaddr}}, \mbox{\hyperlink{ng__hci_8h_aac64c463cc734bbdf8ba030619e8a64d}{NG\_HCI\_LINK\_ACL}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01377}01377         \textcolor{keywordflow}{if} (n == NULL) \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01378}01378                 n = \mbox{\hyperlink{ng__hci__misc_8c_a27064102479d8203c42f5ddfa980c029}{ng\_hci\_new\_neighbor}}(unit);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01379}01379                 \textcolor{keywordflow}{if} (n == NULL) \{}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01380}01380                         error = ENOMEM;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01381}01381                         \textcolor{keywordflow}{goto} out;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01382}01382                 \}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01383}01383 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01384}01384                 bcopy(\&ep-\/>bdaddr, \&n-\/>\mbox{\hyperlink{structng__hci__neighbor_a9c92229bd13342eb3bcdef1c0c558308}{bdaddr}}, \textcolor{keyword}{sizeof}(n-\/>\mbox{\hyperlink{structng__hci__neighbor_a9c92229bd13342eb3bcdef1c0c558308}{bdaddr}}));}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01385}01385                 n-\/>\mbox{\hyperlink{structng__hci__neighbor_a17508a20bea1459561a655c952746f53}{addrtype}} = \mbox{\hyperlink{ng__hci_8h_aac64c463cc734bbdf8ba030619e8a64d}{NG\_HCI\_LINK\_ACL}};}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01386}01386         \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01387}01387                 getmicrotime(\&n-\/>\mbox{\hyperlink{structng__hci__neighbor_ada2f574a39016f8415ea44335795347d}{updated}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01388}01388 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01389}01389         n-\/>\mbox{\hyperlink{structng__hci__neighbor_af6f68090e6a8c7c789a7235b4099c639}{page\_scan\_rep\_mode}} = ep-\/>page\_scan\_rep\_mode;}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01390}01390 out:}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01391}01391         \mbox{\hyperlink{netgraph_8h_a2461bfcdc9e024484ed8037d386620e3}{NG\_FREE\_M}}(\mbox{\hyperlink{ng__ubt__var_8h_aeef6900f411bc223febdd92c9435693b}{event}});}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01392}01392 }
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01393}01393         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{ng__hci__evnt_8c_source_l01394}01394 \} \textcolor{comment}{/* page\_scan\_rep\_mode\_change */}}

\end{DoxyCode}
