1878ed226SJulian Elischer.\" Copyright (c) 2001-2002 Maksim Yevmenkin <m_evmenkin@yahoo.com> 2878ed226SJulian Elischer.\" All rights reserved. 3878ed226SJulian Elischer.\" 4878ed226SJulian Elischer.\" Redistribution and use in source and binary forms, with or without 5878ed226SJulian Elischer.\" modification, are permitted provided that the following conditions 6878ed226SJulian Elischer.\" are met: 7878ed226SJulian Elischer.\" 1. Redistributions of source code must retain the above copyright 8878ed226SJulian Elischer.\" notice, this list of conditions and the following disclaimer. 9878ed226SJulian Elischer.\" 2. Redistributions in binary form must reproduce the above copyright 10878ed226SJulian Elischer.\" notice, this list of conditions and the following disclaimer in the 11878ed226SJulian Elischer.\" documentation and/or other materials provided with the distribution. 12878ed226SJulian Elischer.\" 13878ed226SJulian Elischer.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 14878ed226SJulian Elischer.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15878ed226SJulian Elischer.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16878ed226SJulian Elischer.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 17878ed226SJulian Elischer.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18878ed226SJulian Elischer.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19878ed226SJulian Elischer.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20878ed226SJulian Elischer.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21878ed226SJulian Elischer.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22878ed226SJulian Elischer.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23878ed226SJulian Elischer.\" SUCH DAMAGE. 24878ed226SJulian Elischer.\" 250986ab12SMaksim Yevmenkin.\" $Id: ng_hci.4,v 1.3 2003/05/21 19:37:35 max Exp $ 2672f00208SRuslan Ermilov.\" 27878ed226SJulian Elischer.Dd June 25, 2002 28878ed226SJulian Elischer.Dt NG_HCI 4 29878ed226SJulian Elischer.Os 30878ed226SJulian Elischer.Sh NAME 3172f00208SRuslan Ermilov.Nm ng_hci 32878ed226SJulian Elischer.Nd Netgraph node type that is also a Bluetooth Host Controller Interface 33878ed226SJulian Elischer(HCI) layer 34878ed226SJulian Elischer.Sh SYNOPSIS 35878ed226SJulian Elischer.In sys/types.h 363a08bb88SMaksim Yevmenkin.In netgraph/bluetooth/include/ng_hci.h 37878ed226SJulian Elischer.Sh DESCRIPTION 38878ed226SJulian ElischerThe 3972f00208SRuslan Ermilov.Nm hci 40878ed226SJulian Elischernode type is a Netgraph node type that implements Bluetooth Host Controller 41878ed226SJulian ElischerInterface (HCI) layer as per chapter H1 of the Bluetooth Specification Book 42878ed226SJulian Elischerv1.1. 43878ed226SJulian Elischer.Sh INTRODUCTION TO BLUETOOTH 44878ed226SJulian ElischerBluetooth is a short-range radio link intended to replace the cable(s) 4572f00208SRuslan Ermilovconnecting portable and/or fixed electronic devices. 4672f00208SRuslan ErmilovBluetooth operates in the unlicensed ISM band at 2.4 GHz. 4772f00208SRuslan ErmilovThe Bluetooth protocol uses a 4872f00208SRuslan Ermilovcombination of circuit and packet switching. 4972f00208SRuslan ErmilovBluetooth can support an 50878ed226SJulian Elischerasynchronous data channel, up to three simultaneous synchronous voice 51878ed226SJulian Elischerchannels, or a channel which simultaneously supports asynchronous data 5272f00208SRuslan Ermilovand synchronous voice. 5372f00208SRuslan ErmilovEach voice channel supports a 64 kb/s synchronous 5472f00208SRuslan Ermilov(voice) channel in each direction. 5572f00208SRuslan ErmilovThe asynchronous channel can support 56878ed226SJulian Elischermaximal 723.2 kb/s asymmetric (and still up to 57.6 kb/s in the return 57878ed226SJulian Elischerdirection), or 433.9 kb/s symmetric. 58878ed226SJulian Elischer.Pp 59878ed226SJulian ElischerThe Bluetooth system provides a point-to-point connection (only two 6072f00208SRuslan ErmilovBluetooth units involved), or a point-to-multipoint connection. 6172f00208SRuslan ErmilovIn the point-to-multipoint connection, 6272f00208SRuslan Ermilovthe channel is shared among several Bluetooth units. 6372f00208SRuslan ErmilovTwo or more units sharing the same channel form a 6472f00208SRuslan Ermilov.Dq piconet . 65878ed226SJulian ElischerOne Bluetooth unit acts as the master of the piconet, whereas the other 6672f00208SRuslan Ermilovunit(s) acts as slave(s). 6772f00208SRuslan ErmilovUp to seven slaves can be active in the piconet. 68878ed226SJulian ElischerIn addition, many more slaves can remain locked to the master in a so-called 6972f00208SRuslan Ermilovparked state. 7072f00208SRuslan ErmilovThese parked slaves cannot be active on the channel, but remain 7172f00208SRuslan Ermilovsynchronized to the master. 7272f00208SRuslan ErmilovBoth for active and parked slaves, the channel 73878ed226SJulian Elischeraccess is controlled by the master. 74878ed226SJulian Elischer.Pp 75878ed226SJulian ElischerMultiple piconets with overlapping coverage areas form a 7672f00208SRuslan Ermilov.Dq scatternet . 7772f00208SRuslan ErmilovEach piconet can only have a single master. 7872f00208SRuslan ErmilovHowever, slaves can participate 7972f00208SRuslan Ermilovin different piconets on a time-division multiplex basis. 8072f00208SRuslan ErmilovIn addition, a master in one piconet can be a slave in another piconet. 8172f00208SRuslan ErmilovThe piconets shall not be frequency-synchronized. 8272f00208SRuslan ErmilovEach piconet has its own hopping channel. 8372f00208SRuslan Ermilov.Ss Time Slots 8472f00208SRuslan ErmilovThe channel is divided into time slots, each 625 usec in length. 8572f00208SRuslan ErmilovThe time 86878ed226SJulian Elischerslots are numbered according to the Bluetooth clock of the piconet master. 87878ed226SJulian ElischerThe slot numbering ranges from 0 to 2^27 -1 and is cyclic with a cycle length 8872f00208SRuslan Ermilovof 2^27. 8972f00208SRuslan ErmilovIn the time slots, master and slave can transmit packets. 9072f00208SRuslan Ermilov.Ss SCO Link 91878ed226SJulian ElischerThe SCO link is a symmetric, point-to-point link between the master and a 9272f00208SRuslan Ermilovspecific slave. 9372f00208SRuslan ErmilovThe SCO link reserves slots and can therefore be considered 9472f00208SRuslan Ermilovas a circuit-switched connection between the master and the slave. 9572f00208SRuslan ErmilovThe SCO link typically supports time-bounded information like voice. 9672f00208SRuslan ErmilovThe master can 9772f00208SRuslan Ermilovsupport up to three SCO links to the same slave or to different slaves. 9872f00208SRuslan ErmilovA slave can support up to three SCO links from the same master, or two SCO 9972f00208SRuslan Ermilovlinks if the links originate from different masters. 10072f00208SRuslan ErmilovSCO packets are never retransmitted. 10172f00208SRuslan Ermilov.Ss ACL Link 102878ed226SJulian ElischerIn the slots not reserved for SCO links, the master can exchange packets 10372f00208SRuslan Ermilovwith any slave on a per-slot basis. 10472f00208SRuslan ErmilovThe ACL link provides a packet-switched 105878ed226SJulian Elischerconnection between the master and all active slaves participating in the 10672f00208SRuslan Ermilovpiconet. 10772f00208SRuslan ErmilovBoth asynchronous and isochronous services are supported. 10872f00208SRuslan ErmilovBetween a master and a slave only a single ACL link can exist. 10972f00208SRuslan ErmilovFor most ACL packets, 1105512804bSRebecca Cranpacket retransmission is applied to assure data integrity. 111878ed226SJulian Elischer.Sh HOST CONTROLLER INTERFACE (HCI) 112878ed226SJulian ElischerThe HCI provides a command interface to the baseband controller and link 11372f00208SRuslan Ermilovmanager, and access to hardware status and control registers. 11472f00208SRuslan ErmilovThis interface 115878ed226SJulian Elischerprovides a uniform method of accessing the Bluetooth baseband capabilities. 116878ed226SJulian Elischer.Pp 117878ed226SJulian ElischerThe HCI layer on the Host exchanges data and commands with the HCI firmware 11872f00208SRuslan Ermilovon the Bluetooth hardware. 1195203edcdSRuslan ErmilovThe Host Controller Transport Layer (i.e., physical 120878ed226SJulian Elischerbus) driver provides both HCI layers with the ability to exchange information 121878ed226SJulian Elischerwith each other. 122878ed226SJulian Elischer.Pp 123878ed226SJulian ElischerThe Host will receive asynchronous notifications of HCI events independent 12472f00208SRuslan Ermilovof which Host Controller Transport Layer is used. 12572f00208SRuslan ErmilovHCI events are used for 12672f00208SRuslan Ermilovnotifying the Host when something occurs. 12772f00208SRuslan ErmilovWhen the Host discovers that an 128878ed226SJulian Elischerevent has occurred it will then parse the received event packet to determine 129878ed226SJulian Elischerwhich event occurred. 130878ed226SJulian ElischerThe next sections specify the HCI packet formats. 13172f00208SRuslan Ermilov.Ss HCI Command Packet 132878ed226SJulian Elischer.Bd -literal -offset indent 133878ed226SJulian Elischer#define NG_HCI_CMD_PKT 0x01 134878ed226SJulian Elischertypedef struct { 1356b99842aSEd Schouten uint8_t type; /* MUST be 0x1 */ 1366b99842aSEd Schouten uint16_t opcode; /* OpCode */ 1376b99842aSEd Schouten uint8_t length; /* parameter(s) length in bytes */ 138878ed226SJulian Elischer} __attribute__ ((packed)) ng_hci_cmd_pkt_t; 139878ed226SJulian Elischer.Ed 140878ed226SJulian Elischer.Pp 141878ed226SJulian ElischerThe HCI command packet is used to send commands to the Host Controller 14272f00208SRuslan Ermilovfrom the Host. 14372f00208SRuslan ErmilovWhen the Host Controller completes most of the commands, 14472f00208SRuslan Ermilova Command Complete event is sent to the Host. 14572f00208SRuslan ErmilovSome commands do not receive 14672f00208SRuslan Ermilova Command Complete event when they have been completed. 14772f00208SRuslan ErmilovInstead, when the 148878ed226SJulian ElischerHost Controller receives one of these commands the Host Controller sends 149878ed226SJulian Elischera Command Status event back to the Host when it has begun to execute the 15072f00208SRuslan Ermilovcommand. 15172f00208SRuslan ErmilovLater on, when the actions associated with the command have finished, 152878ed226SJulian Elischeran event that is associated with the sent command will be sent by the Host 153878ed226SJulian ElischerController to the Host. 15472f00208SRuslan Ermilov.Ss HCI Event Packet 155878ed226SJulian Elischer.Bd -literal -offset indent 156878ed226SJulian Elischer#define NG_HCI_EVENT_PKT 0x04 157878ed226SJulian Elischertypedef struct { 1586b99842aSEd Schouten uint8_t type; /* MUST be 0x4 */ 1596b99842aSEd Schouten uint8_t event; /* event */ 1606b99842aSEd Schouten uint8_t length; /* parameter(s) length in bytes */ 161878ed226SJulian Elischer} __attribute__ ((packed)) ng_hci_event_pkt_t; 162878ed226SJulian Elischer.Ed 163878ed226SJulian Elischer.Pp 164878ed226SJulian ElischerThe HCI event packet is used by the Host Controller to notify the Host 165878ed226SJulian Elischerwhen events occur. 16672f00208SRuslan Ermilov.Ss HCI ACL Data Packet 167878ed226SJulian Elischer.Bd -literal -offset indent 168878ed226SJulian Elischer#define NG_HCI_ACL_DATA_PKT 0x02 169878ed226SJulian Elischertypedef struct { 1706b99842aSEd Schouten uint8_t type; /* MUST be 0x2 */ 1716b99842aSEd Schouten uint16_t con_handle; /* connection handle + PB + BC flags */ 1726b99842aSEd Schouten uint16_t length; /* payload length in bytes */ 173878ed226SJulian Elischer} __attribute__ ((packed)) ng_hci_acldata_pkt_t; 174878ed226SJulian Elischer.Ed 175878ed226SJulian Elischer.Pp 176878ed226SJulian ElischerHCI ACL data packets are used to exchange ACL data between the Host and 177878ed226SJulian ElischerHost Controller. 17872f00208SRuslan Ermilov.Ss HCI SCO Data Packet 179878ed226SJulian Elischer.Bd -literal -offset indent 180878ed226SJulian Elischer#define NG_HCI_SCO_DATA_PKT 0x03 181878ed226SJulian Elischertypedef struct { 1826b99842aSEd Schouten uint8_t type; /* MUST be 0x3 */ 1836b99842aSEd Schouten uint16_t con_handle; /* connection handle + reserved bits */ 1846b99842aSEd Schouten uint8_t length; /* payload length in bytes */ 185878ed226SJulian Elischer} __attribute__ ((packed)) ng_hci_scodata_pkt_t; 186878ed226SJulian Elischer.Ed 187878ed226SJulian Elischer.Pp 188878ed226SJulian ElischerHCI SCO data packets are used to exchange SCO data between the Host and 189878ed226SJulian ElischerHost Controller. 190878ed226SJulian Elischer.Sh HCI INITIALIZATION 191878ed226SJulian ElischerOn initialization, HCI control application must issue the following HCI 192878ed226SJulian Elischercommands (in any order). 193c60bda17SJoel Dahl.Bl -tag -width foo 194878ed226SJulian Elischer.It Dv Read_BD_ADDR 195878ed226SJulian ElischerTo obtain BD_ADDR of the Bluetooth unit. 196878ed226SJulian Elischer.It Dv Read_Local_Supported_Features 197878ed226SJulian ElischerTo obtain the list of features supported by Bluetooth unit. 198878ed226SJulian Elischer.It Dv Read_Buffer_Size 199878ed226SJulian ElischerTo determine the maximum size of HCI ACL and SCO HCI data packets (excluding 20072f00208SRuslan Ermilovheader) that can be sent from the Host to the Host Controller. 20172f00208SRuslan ErmilovThere are also 202878ed226SJulian Elischertwo additional return parameters that specify the total number of HCI ACL and 203878ed226SJulian ElischerSCO data packets that the Host Controller can have waiting for transmission in 204878ed226SJulian Elischerits buffers. 205878ed226SJulian Elischer.El 206878ed226SJulian Elischer.Pp 20772f00208SRuslan ErmilovAs soon as HCI initialization has been successfully performed, HCI control 208878ed226SJulian Elischerapplication must turn on 209878ed226SJulian Elischer.Dq inited 21072f00208SRuslan Ermilovbit for the node. 211b7e25836SRuslan ErmilovOnce HCI node has been initialized all upstream hooks 212878ed226SJulian Elischerwill receive a 213878ed226SJulian Elischer.Dv NGM_HCI_NODE_UP 214878ed226SJulian ElischerNetgraph message defined as follows. 215878ed226SJulian Elischer.Bd -literal -offset indent 216878ed226SJulian Elischer#define NGM_HCI_NODE_UP 112 /* HCI -> Upper */ 217878ed226SJulian Elischertypedef struct { 2186b99842aSEd Schouten uint16_t pkt_size; /* max. ACL/SCO packet size (w/o hdr) */ 2196b99842aSEd Schouten uint16_t num_pkts; /* ACL/SCO packet queue size */ 2206b99842aSEd Schouten uint16_t reserved; /* place holder */ 221878ed226SJulian Elischer bdaddr_t bdaddr; /* bdaddr */ 222878ed226SJulian Elischer} ng_hci_node_up_ep; 223878ed226SJulian Elischer.Ed 224878ed226SJulian Elischer.Sh HCI FLOW CONTROL 2255203edcdSRuslan ErmilovHCI layer performs flow control on baseband connection basis (i.e., ACL and 22672f00208SRuslan ErmilovSCO link). 22772f00208SRuslan ErmilovEach baseband connection has 22872f00208SRuslan Ermilov.Dq "connection handle" 22972f00208SRuslan Ermilovand queue of outgoing data packets. 23072f00208SRuslan ErmilovUpper layers protocols are allowed to 23172f00208SRuslan Ermilovsend up to 23272f00208SRuslan Ermilov.Dv ( num_pkts 23372f00208SRuslan Ermilov\- 234878ed226SJulian Elischer.Dv pending ) 23572f00208SRuslan Ermilovpackets at one time. 23672f00208SRuslan ErmilovHCI layer will send 237878ed226SJulian Elischer.Dv NGM_HCI_SYNC_CON_QUEUE 238878ed226SJulian ElischerNetgraph messages to inform upper layers about current queue state for each 23972f00208SRuslan Ermilovconnection handle. 24072f00208SRuslan ErmilovThe 241878ed226SJulian Elischer.Dv NGM_HCI_SYNC_CON_QUEUE 242878ed226SJulian ElischerNetgraph message is defined as follows. 243878ed226SJulian Elischer.Bd -literal -offset indent 244878ed226SJulian Elischer#define NGM_HCI_SYNC_CON_QUEUE 113 /* HCI -> Upper */ 245878ed226SJulian Elischertypedef struct { 2466b99842aSEd Schouten uint16_t con_handle; /* connection handle */ 2476b99842aSEd Schouten uint16_t completed; /* number of completed packets */ 248878ed226SJulian Elischer} ng_hci_sync_con_queue_ep; 249878ed226SJulian Elischer.Ed 250878ed226SJulian Elischer.Sh HOOKS 251878ed226SJulian ElischerThis node type supports the following hooks: 252c60bda17SJoel Dahl.Bl -tag -width ".Va drv" 253c60bda17SJoel Dahl.It Va drv 25472f00208SRuslan ErmilovBluetooth Host Controller Transport Layer hook. 25572f00208SRuslan ErmilovSingle HCI packet contained in single 25672f00208SRuslan Ermilov.Vt mbuf 257878ed226SJulian Elischerstructure. 258c60bda17SJoel Dahl.It Va acl 25972f00208SRuslan ErmilovUpper layer protocol/node is connected to the hook. 26072f00208SRuslan ErmilovSingle HCI ACL data packet contained in single 26172f00208SRuslan Ermilov.Vt mbuf 262878ed226SJulian Elischerstructure. 263c60bda17SJoel Dahl.It Va sco 26472f00208SRuslan ErmilovUpper layer protocol/node is connected to the hook. 26572f00208SRuslan ErmilovSingle HCI SCO data packet contained in single 26672f00208SRuslan Ermilov.Vt mbuf 267878ed226SJulian Elischerstructure. 268c60bda17SJoel Dahl.It Va raw 26972f00208SRuslan ErmilovRaw hook. 27072f00208SRuslan ErmilovEvery HCI frame (including HCI command frame) that goes in 27172f00208SRuslan Ermilovor out will be delivered to the hook. 27272f00208SRuslan ErmilovUsually the Bluetooth raw HCI socket layer is connected to the hook. 27372f00208SRuslan ErmilovSingle HCI frame contained in single 27472f00208SRuslan Ermilov.Vt mbuf 275878ed226SJulian Elischerstructure. 276878ed226SJulian Elischer.El 277878ed226SJulian Elischer.Sh BLUETOOTH UPPER LAYER PROTOCOLS INTERFACE (LP CONTROL MESSAGES) 278c60bda17SJoel Dahl.Bl -tag -width foo 279878ed226SJulian Elischer.It Dv NGM_HCI_LP_CON_REQ 28072f00208SRuslan ErmilovRequests the lower protocol to create a connection. 28172f00208SRuslan ErmilovIf a physical link 282878ed226SJulian Elischerto the remote device does not exist, this message must be sent to the lower 283878ed226SJulian Elischerprotocol (baseband) to establish the physical connection. 284878ed226SJulian Elischer.It Dv NGM_HCI_LP_DISCON_REQ 285878ed226SJulian ElischerRequests the lower protocol (baseband) to terminate a connection. 286878ed226SJulian Elischer.It Dv NGM_HCI_LP_CON_CFM 287878ed226SJulian ElischerConfirms success or failure of the 28872f00208SRuslan Ermilov.Dv NGM_HCI_LP_CON_REQ 28972f00208SRuslan Ermilovrequest to establish a lower layer (baseband) connection. 290878ed226SJulian ElischerThis includes passing the authentication challenge if authentication is 291878ed226SJulian Elischerrequired to establish the physical link. 292878ed226SJulian Elischer.It Dv NGM_HCI_LP_CON_IND 293878ed226SJulian ElischerIndicates the lower protocol (baseband) has successfully established 294878ed226SJulian Elischerincoming connection. 295878ed226SJulian Elischer.It Dv NGM_HCI_LP_CON_RSP 296878ed226SJulian ElischerA response accepting or rejecting the previous connection indication request. 297878ed226SJulian Elischer.It Dv NGM_HCI_LP_DISCON_IND 29872f00208SRuslan ErmilovIndicates the lower protocol (baseband) has terminated connection. 29972f00208SRuslan ErmilovThis could be a response to 300878ed226SJulian Elischer.Dv NGM_HCI_LP_DISCON_REQ 301878ed226SJulian Elischeror a timeout event. 302878ed226SJulian Elischer.It Dv NGM_HCI_LP_QOS_REQ 303878ed226SJulian ElischerRequests the lower protocol (baseband) to accommodate a particular QoS 304878ed226SJulian Elischerparameter set. 305878ed226SJulian Elischer.It Dv NGM_HCI_LP_QOS_CFM 306878ed226SJulian ElischerConfirms success or failure of the request for a given quality of service. 307878ed226SJulian Elischer.It Dv NGM_HCI_LP_QOS_IND 308878ed226SJulian ElischerIndicates the lower protocol (baseband) has detected a violation of the QoS 309878ed226SJulian Elischeragreement. 310878ed226SJulian Elischer.El 311878ed226SJulian Elischer.Sh NETGRAPH CONTROL MESSAGES 312878ed226SJulian ElischerThis node type supports the generic control messages, plus the following: 313c60bda17SJoel Dahl.Bl -tag -width foo 314878ed226SJulian Elischer.It Dv NGM_HCI_NODE_GET_STATE 315878ed226SJulian ElischerReturns current state for the node. 316878ed226SJulian Elischer.It Dv NGM_HCI_NODE_INIT 317878ed226SJulian ElischerTurn on 318878ed226SJulian Elischer.Dq inited 319878ed226SJulian Elischerbit for the node. 320878ed226SJulian Elischer.It Dv NGM_HCI_NODE_GET_DEBUG 321878ed226SJulian ElischerReturns an integer containing the current debug level for the node. 322878ed226SJulian Elischer.It Dv NGM_HCI_NODE_SET_DEBUG 323878ed226SJulian ElischerThis command takes an integer argument and sets current debug level 324878ed226SJulian Elischerfor the node. 325878ed226SJulian Elischer.It Dv NGM_HCI_NODE_GET_BUFFER 326878ed226SJulian ElischerReturns current state of data buffers. 327878ed226SJulian Elischer.It Dv NGM_HCI_NODE_GET_BDADDR 328878ed226SJulian ElischerReturns BD_ADDR as cached in the node. 329878ed226SJulian Elischer.It Dv NGM_HCI_NODE_GET_FEATURES 330878ed226SJulian ElischerReturns the list of features supported by hardware (as cached by the node). 331878ed226SJulian Elischer.It Dv NGM_HCI_NODE_GET_NEIGHBOR_CACHE 332878ed226SJulian ElischerReturns content of the neighbor cache. 333878ed226SJulian Elischer.It Dv NGM_HCI_NODE_FLUSH_NEIGHBOR_CACHE 334878ed226SJulian ElischerRemove all neighbor cache entries. 335878ed226SJulian Elischer.It Dv NGM_HCI_NODE_GET_CON_LIST 3365203edcdSRuslan ErmilovReturns list of active baseband connections (i.e., ACL and SCO links). 337878ed226SJulian Elischer.It Dv NGM_HCI_NODE_GET_STAT 338878ed226SJulian ElischerReturns various statistic counters. 339878ed226SJulian Elischer.It Dv NGM_HCI_NODE_RESET_STAT 340878ed226SJulian ElischerResets all statistic counters to zero. 341878ed226SJulian Elischer.It NGM_HCI_NODE_SET_LINK_POLICY_SETTINGS_MASK 34272f00208SRuslan ErmilovSets current link policy settings mask. 34372f00208SRuslan ErmilovAfter the new ACL connection is 34472f00208SRuslan Ermilovcreated the HCI node will try set link policy for the ACL connection. 34572f00208SRuslan ErmilovBy default, every supported Link Manager (LM) mode will be enabled. 34672f00208SRuslan ErmilovUser can 347878ed226SJulian Elischeroverride this by setting link policy settings mask which specifies LM 348878ed226SJulian Elischermodes to be enabled. 349878ed226SJulian Elischer.It NGM_HCI_NODE_GET_LINK_POLICY_SETTINGS_MASK 350878ed226SJulian ElischerReturns current link policy settings mask. 351878ed226SJulian Elischer.It NGM_HCI_NODE_SET_PACKET_MASK 35272f00208SRuslan ErmilovSets current packet mask. 35372f00208SRuslan ErmilovWhen new baseband (ACL or SCO) connection is 354878ed226SJulian Elischercreated the HCI node will specify every packet type supported by the device. 355878ed226SJulian ElischerUser can override this by setting packet mask which specifies packet types 356878ed226SJulian Elischerto be used for new baseband connections. 357878ed226SJulian Elischer.It NGM_HCI_NODE_GET_PACKET_MASK 358878ed226SJulian ElischerReturns current packet mask. 359f2bb1caeSJulian Elischer.It NGM_HCI_NODE_SET_ROLE_SWITCH 36072f00208SRuslan ErmilovSets the value of the role switch. 36172f00208SRuslan ErmilovRole switch is enabled when this value is not zero. 36272f00208SRuslan ErmilovThis is the default state. 363c48524c2SMike PritchardNote that actual role switch at Bluetooth link level will only be performed if 36472f00208SRuslan Ermilovhardware supports role switch and it was enabled. 365f2bb1caeSJulian Elischer.It NGM_HCI_NODE_GET_ROLE_SWITCH 366f2bb1caeSJulian ElischerReturns the value of the role switch for the node. 367878ed226SJulian Elischer.El 368878ed226SJulian Elischer.Sh SHUTDOWN 36972f00208SRuslan ErmilovThis node shuts down upon receipt of a 37072f00208SRuslan Ermilov.Dv NGM_SHUTDOWN 37172f00208SRuslan Ermilovcontrol message, or 372878ed226SJulian Elischerwhen all hooks have been disconnected. 373878ed226SJulian Elischer.Sh SEE ALSO 374878ed226SJulian Elischer.Xr netgraph 4 , 37572f00208SRuslan Ermilov.Xr hccontrol 8 , 37672f00208SRuslan Ermilov.Xr ngctl 8 377878ed226SJulian Elischer.Sh HISTORY 378878ed226SJulian ElischerThe 37972f00208SRuslan Ermilov.Nm hci 380878ed226SJulian Elischernode type was implemented in 381878ed226SJulian Elischer.Fx 5.0 . 382878ed226SJulian Elischer.Sh AUTHORS 383*6c899950SBaptiste Daroussin.An Maksim Yevmenkin Aq Mt m_evmenkin@yahoo.com 3849cbda590SRuslan Ermilov.Sh BUGS 3859cbda590SRuslan ErmilovMost likely. 3869cbda590SRuslan ErmilovPlease report if found. 387