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 $ 26878ed226SJulian Elischer.\" $FreeBSD$ 2772f00208SRuslan Ermilov.\" 28878ed226SJulian Elischer.Dd June 25, 2002 29878ed226SJulian Elischer.Dt NG_HCI 4 30878ed226SJulian Elischer.Os 31878ed226SJulian Elischer.Sh NAME 3272f00208SRuslan Ermilov.Nm ng_hci 33878ed226SJulian Elischer.Nd Netgraph node type that is also a Bluetooth Host Controller Interface 34878ed226SJulian Elischer(HCI) layer 35878ed226SJulian Elischer.Sh SYNOPSIS 36878ed226SJulian Elischer.In sys/types.h 373a08bb88SMaksim Yevmenkin.In netgraph/bluetooth/include/ng_hci.h 38878ed226SJulian Elischer.Sh DESCRIPTION 39878ed226SJulian ElischerThe 4072f00208SRuslan Ermilov.Nm hci 41878ed226SJulian Elischernode type is a Netgraph node type that implements Bluetooth Host Controller 42878ed226SJulian ElischerInterface (HCI) layer as per chapter H1 of the Bluetooth Specification Book 43878ed226SJulian Elischerv1.1. 44878ed226SJulian Elischer.Sh INTRODUCTION TO BLUETOOTH 45878ed226SJulian ElischerBluetooth is a short-range radio link intended to replace the cable(s) 4672f00208SRuslan Ermilovconnecting portable and/or fixed electronic devices. 4772f00208SRuslan ErmilovBluetooth operates in the unlicensed ISM band at 2.4 GHz. 4872f00208SRuslan ErmilovThe Bluetooth protocol uses a 4972f00208SRuslan Ermilovcombination of circuit and packet switching. 5072f00208SRuslan ErmilovBluetooth can support an 51878ed226SJulian Elischerasynchronous data channel, up to three simultaneous synchronous voice 52878ed226SJulian Elischerchannels, or a channel which simultaneously supports asynchronous data 5372f00208SRuslan Ermilovand synchronous voice. 5472f00208SRuslan ErmilovEach voice channel supports a 64 kb/s synchronous 5572f00208SRuslan Ermilov(voice) channel in each direction. 5672f00208SRuslan ErmilovThe asynchronous channel can support 57878ed226SJulian Elischermaximal 723.2 kb/s asymmetric (and still up to 57.6 kb/s in the return 58878ed226SJulian Elischerdirection), or 433.9 kb/s symmetric. 59878ed226SJulian Elischer.Pp 60878ed226SJulian ElischerThe Bluetooth system provides a point-to-point connection (only two 6172f00208SRuslan ErmilovBluetooth units involved), or a point-to-multipoint connection. 6272f00208SRuslan ErmilovIn the point-to-multipoint connection, 6372f00208SRuslan Ermilovthe channel is shared among several Bluetooth units. 6472f00208SRuslan ErmilovTwo or more units sharing the same channel form a 6572f00208SRuslan Ermilov.Dq piconet . 66878ed226SJulian ElischerOne Bluetooth unit acts as the master of the piconet, whereas the other 6772f00208SRuslan Ermilovunit(s) acts as slave(s). 6872f00208SRuslan ErmilovUp to seven slaves can be active in the piconet. 69878ed226SJulian ElischerIn addition, many more slaves can remain locked to the master in a so-called 7072f00208SRuslan Ermilovparked state. 7172f00208SRuslan ErmilovThese parked slaves cannot be active on the channel, but remain 7272f00208SRuslan Ermilovsynchronized to the master. 7372f00208SRuslan ErmilovBoth for active and parked slaves, the channel 74878ed226SJulian Elischeraccess is controlled by the master. 75878ed226SJulian Elischer.Pp 76878ed226SJulian ElischerMultiple piconets with overlapping coverage areas form a 7772f00208SRuslan Ermilov.Dq scatternet . 7872f00208SRuslan ErmilovEach piconet can only have a single master. 7972f00208SRuslan ErmilovHowever, slaves can participate 8072f00208SRuslan Ermilovin different piconets on a time-division multiplex basis. 8172f00208SRuslan ErmilovIn addition, a master in one piconet can be a slave in another piconet. 8272f00208SRuslan ErmilovThe piconets shall not be frequency-synchronized. 8372f00208SRuslan ErmilovEach piconet has its own hopping channel. 8472f00208SRuslan Ermilov.Ss Time Slots 8572f00208SRuslan ErmilovThe channel is divided into time slots, each 625 usec in length. 8672f00208SRuslan ErmilovThe time 87878ed226SJulian Elischerslots are numbered according to the Bluetooth clock of the piconet master. 88878ed226SJulian ElischerThe slot numbering ranges from 0 to 2^27 -1 and is cyclic with a cycle length 8972f00208SRuslan Ermilovof 2^27. 9072f00208SRuslan ErmilovIn the time slots, master and slave can transmit packets. 9172f00208SRuslan Ermilov.Ss SCO Link 92878ed226SJulian ElischerThe SCO link is a symmetric, point-to-point link between the master and a 9372f00208SRuslan Ermilovspecific slave. 9472f00208SRuslan ErmilovThe SCO link reserves slots and can therefore be considered 9572f00208SRuslan Ermilovas a circuit-switched connection between the master and the slave. 9672f00208SRuslan ErmilovThe SCO link typically supports time-bounded information like voice. 9772f00208SRuslan ErmilovThe master can 9872f00208SRuslan Ermilovsupport up to three SCO links to the same slave or to different slaves. 9972f00208SRuslan ErmilovA slave can support up to three SCO links from the same master, or two SCO 10072f00208SRuslan Ermilovlinks if the links originate from different masters. 10172f00208SRuslan ErmilovSCO packets are never retransmitted. 10272f00208SRuslan Ermilov.Ss ACL Link 103878ed226SJulian ElischerIn the slots not reserved for SCO links, the master can exchange packets 10472f00208SRuslan Ermilovwith any slave on a per-slot basis. 10572f00208SRuslan ErmilovThe ACL link provides a packet-switched 106878ed226SJulian Elischerconnection between the master and all active slaves participating in the 10772f00208SRuslan Ermilovpiconet. 10872f00208SRuslan ErmilovBoth asynchronous and isochronous services are supported. 10972f00208SRuslan ErmilovBetween a master and a slave only a single ACL link can exist. 11072f00208SRuslan ErmilovFor most ACL packets, 1115512804bSRebecca Cranpacket retransmission is applied to assure data integrity. 112878ed226SJulian Elischer.Sh HOST CONTROLLER INTERFACE (HCI) 113878ed226SJulian ElischerThe HCI provides a command interface to the baseband controller and link 11472f00208SRuslan Ermilovmanager, and access to hardware status and control registers. 11572f00208SRuslan ErmilovThis interface 116878ed226SJulian Elischerprovides a uniform method of accessing the Bluetooth baseband capabilities. 117878ed226SJulian Elischer.Pp 118878ed226SJulian ElischerThe HCI layer on the Host exchanges data and commands with the HCI firmware 11972f00208SRuslan Ermilovon the Bluetooth hardware. 1205203edcdSRuslan ErmilovThe Host Controller Transport Layer (i.e., physical 121878ed226SJulian Elischerbus) driver provides both HCI layers with the ability to exchange information 122878ed226SJulian Elischerwith each other. 123878ed226SJulian Elischer.Pp 124878ed226SJulian ElischerThe Host will receive asynchronous notifications of HCI events independent 12572f00208SRuslan Ermilovof which Host Controller Transport Layer is used. 12672f00208SRuslan ErmilovHCI events are used for 12772f00208SRuslan Ermilovnotifying the Host when something occurs. 12872f00208SRuslan ErmilovWhen the Host discovers that an 129878ed226SJulian Elischerevent has occurred it will then parse the received event packet to determine 130878ed226SJulian Elischerwhich event occurred. 131878ed226SJulian ElischerThe next sections specify the HCI packet formats. 13272f00208SRuslan Ermilov.Ss HCI Command Packet 133878ed226SJulian Elischer.Bd -literal -offset indent 134878ed226SJulian Elischer#define NG_HCI_CMD_PKT 0x01 135878ed226SJulian Elischertypedef struct { 1366b99842aSEd Schouten uint8_t type; /* MUST be 0x1 */ 1376b99842aSEd Schouten uint16_t opcode; /* OpCode */ 1386b99842aSEd Schouten uint8_t length; /* parameter(s) length in bytes */ 139878ed226SJulian Elischer} __attribute__ ((packed)) ng_hci_cmd_pkt_t; 140878ed226SJulian Elischer.Ed 141878ed226SJulian Elischer.Pp 142878ed226SJulian ElischerThe HCI command packet is used to send commands to the Host Controller 14372f00208SRuslan Ermilovfrom the Host. 14472f00208SRuslan ErmilovWhen the Host Controller completes most of the commands, 14572f00208SRuslan Ermilova Command Complete event is sent to the Host. 14672f00208SRuslan ErmilovSome commands do not receive 14772f00208SRuslan Ermilova Command Complete event when they have been completed. 14872f00208SRuslan ErmilovInstead, when the 149878ed226SJulian ElischerHost Controller receives one of these commands the Host Controller sends 150878ed226SJulian Elischera Command Status event back to the Host when it has begun to execute the 15172f00208SRuslan Ermilovcommand. 15272f00208SRuslan ErmilovLater on, when the actions associated with the command have finished, 153878ed226SJulian Elischeran event that is associated with the sent command will be sent by the Host 154878ed226SJulian ElischerController to the Host. 15572f00208SRuslan Ermilov.Ss HCI Event Packet 156878ed226SJulian Elischer.Bd -literal -offset indent 157878ed226SJulian Elischer#define NG_HCI_EVENT_PKT 0x04 158878ed226SJulian Elischertypedef struct { 1596b99842aSEd Schouten uint8_t type; /* MUST be 0x4 */ 1606b99842aSEd Schouten uint8_t event; /* event */ 1616b99842aSEd Schouten uint8_t length; /* parameter(s) length in bytes */ 162878ed226SJulian Elischer} __attribute__ ((packed)) ng_hci_event_pkt_t; 163878ed226SJulian Elischer.Ed 164878ed226SJulian Elischer.Pp 165878ed226SJulian ElischerThe HCI event packet is used by the Host Controller to notify the Host 166878ed226SJulian Elischerwhen events occur. 16772f00208SRuslan Ermilov.Ss HCI ACL Data Packet 168878ed226SJulian Elischer.Bd -literal -offset indent 169878ed226SJulian Elischer#define NG_HCI_ACL_DATA_PKT 0x02 170878ed226SJulian Elischertypedef struct { 1716b99842aSEd Schouten uint8_t type; /* MUST be 0x2 */ 1726b99842aSEd Schouten uint16_t con_handle; /* connection handle + PB + BC flags */ 1736b99842aSEd Schouten uint16_t length; /* payload length in bytes */ 174878ed226SJulian Elischer} __attribute__ ((packed)) ng_hci_acldata_pkt_t; 175878ed226SJulian Elischer.Ed 176878ed226SJulian Elischer.Pp 177878ed226SJulian ElischerHCI ACL data packets are used to exchange ACL data between the Host and 178878ed226SJulian ElischerHost Controller. 17972f00208SRuslan Ermilov.Ss HCI SCO Data Packet 180878ed226SJulian Elischer.Bd -literal -offset indent 181878ed226SJulian Elischer#define NG_HCI_SCO_DATA_PKT 0x03 182878ed226SJulian Elischertypedef struct { 1836b99842aSEd Schouten uint8_t type; /* MUST be 0x3 */ 1846b99842aSEd Schouten uint16_t con_handle; /* connection handle + reserved bits */ 1856b99842aSEd Schouten uint8_t length; /* payload length in bytes */ 186878ed226SJulian Elischer} __attribute__ ((packed)) ng_hci_scodata_pkt_t; 187878ed226SJulian Elischer.Ed 188878ed226SJulian Elischer.Pp 189878ed226SJulian ElischerHCI SCO data packets are used to exchange SCO data between the Host and 190878ed226SJulian ElischerHost Controller. 191878ed226SJulian Elischer.Sh HCI INITIALIZATION 192878ed226SJulian ElischerOn initialization, HCI control application must issue the following HCI 193878ed226SJulian Elischercommands (in any order). 194c60bda17SJoel Dahl.Bl -tag -width foo 195878ed226SJulian Elischer.It Dv Read_BD_ADDR 196878ed226SJulian ElischerTo obtain BD_ADDR of the Bluetooth unit. 197878ed226SJulian Elischer.It Dv Read_Local_Supported_Features 198878ed226SJulian ElischerTo obtain the list of features supported by Bluetooth unit. 199878ed226SJulian Elischer.It Dv Read_Buffer_Size 200878ed226SJulian ElischerTo determine the maximum size of HCI ACL and SCO HCI data packets (excluding 20172f00208SRuslan Ermilovheader) that can be sent from the Host to the Host Controller. 20272f00208SRuslan ErmilovThere are also 203878ed226SJulian Elischertwo additional return parameters that specify the total number of HCI ACL and 204878ed226SJulian ElischerSCO data packets that the Host Controller can have waiting for transmission in 205878ed226SJulian Elischerits buffers. 206878ed226SJulian Elischer.El 207878ed226SJulian Elischer.Pp 20872f00208SRuslan ErmilovAs soon as HCI initialization has been successfully performed, HCI control 209878ed226SJulian Elischerapplication must turn on 210878ed226SJulian Elischer.Dq inited 21172f00208SRuslan Ermilovbit for the node. 212b7e25836SRuslan ErmilovOnce HCI node has been initialized all upstream hooks 213878ed226SJulian Elischerwill receive a 214878ed226SJulian Elischer.Dv NGM_HCI_NODE_UP 215878ed226SJulian ElischerNetgraph message defined as follows. 216878ed226SJulian Elischer.Bd -literal -offset indent 217878ed226SJulian Elischer#define NGM_HCI_NODE_UP 112 /* HCI -> Upper */ 218878ed226SJulian Elischertypedef struct { 2196b99842aSEd Schouten uint16_t pkt_size; /* max. ACL/SCO packet size (w/o hdr) */ 2206b99842aSEd Schouten uint16_t num_pkts; /* ACL/SCO packet queue size */ 2216b99842aSEd Schouten uint16_t reserved; /* place holder */ 222878ed226SJulian Elischer bdaddr_t bdaddr; /* bdaddr */ 223878ed226SJulian Elischer} ng_hci_node_up_ep; 224878ed226SJulian Elischer.Ed 225878ed226SJulian Elischer.Sh HCI FLOW CONTROL 2265203edcdSRuslan ErmilovHCI layer performs flow control on baseband connection basis (i.e., ACL and 22772f00208SRuslan ErmilovSCO link). 22872f00208SRuslan ErmilovEach baseband connection has 22972f00208SRuslan Ermilov.Dq "connection handle" 23072f00208SRuslan Ermilovand queue of outgoing data packets. 23172f00208SRuslan ErmilovUpper layers protocols are allowed to 23272f00208SRuslan Ermilovsend up to 23372f00208SRuslan Ermilov.Dv ( num_pkts 23472f00208SRuslan Ermilov\- 235878ed226SJulian Elischer.Dv pending ) 23672f00208SRuslan Ermilovpackets at one time. 23772f00208SRuslan ErmilovHCI layer will send 238878ed226SJulian Elischer.Dv NGM_HCI_SYNC_CON_QUEUE 239878ed226SJulian ElischerNetgraph messages to inform upper layers about current queue state for each 24072f00208SRuslan Ermilovconnection handle. 24172f00208SRuslan ErmilovThe 242878ed226SJulian Elischer.Dv NGM_HCI_SYNC_CON_QUEUE 243878ed226SJulian ElischerNetgraph message is defined as follows. 244878ed226SJulian Elischer.Bd -literal -offset indent 245878ed226SJulian Elischer#define NGM_HCI_SYNC_CON_QUEUE 113 /* HCI -> Upper */ 246878ed226SJulian Elischertypedef struct { 2476b99842aSEd Schouten uint16_t con_handle; /* connection handle */ 2486b99842aSEd Schouten uint16_t completed; /* number of completed packets */ 249878ed226SJulian Elischer} ng_hci_sync_con_queue_ep; 250878ed226SJulian Elischer.Ed 251878ed226SJulian Elischer.Sh HOOKS 252878ed226SJulian ElischerThis node type supports the following hooks: 253c60bda17SJoel Dahl.Bl -tag -width ".Va drv" 254c60bda17SJoel Dahl.It Va drv 25572f00208SRuslan ErmilovBluetooth Host Controller Transport Layer hook. 25672f00208SRuslan ErmilovSingle HCI packet contained in single 25772f00208SRuslan Ermilov.Vt mbuf 258878ed226SJulian Elischerstructure. 259c60bda17SJoel Dahl.It Va acl 26072f00208SRuslan ErmilovUpper layer protocol/node is connected to the hook. 26172f00208SRuslan ErmilovSingle HCI ACL data packet contained in single 26272f00208SRuslan Ermilov.Vt mbuf 263878ed226SJulian Elischerstructure. 264c60bda17SJoel Dahl.It Va sco 26572f00208SRuslan ErmilovUpper layer protocol/node is connected to the hook. 26672f00208SRuslan ErmilovSingle HCI SCO data packet contained in single 26772f00208SRuslan Ermilov.Vt mbuf 268878ed226SJulian Elischerstructure. 269c60bda17SJoel Dahl.It Va raw 27072f00208SRuslan ErmilovRaw hook. 27172f00208SRuslan ErmilovEvery HCI frame (including HCI command frame) that goes in 27272f00208SRuslan Ermilovor out will be delivered to the hook. 27372f00208SRuslan ErmilovUsually the Bluetooth raw HCI socket layer is connected to the hook. 27472f00208SRuslan ErmilovSingle HCI frame contained in single 27572f00208SRuslan Ermilov.Vt mbuf 276878ed226SJulian Elischerstructure. 277878ed226SJulian Elischer.El 278878ed226SJulian Elischer.Sh BLUETOOTH UPPER LAYER PROTOCOLS INTERFACE (LP CONTROL MESSAGES) 279c60bda17SJoel Dahl.Bl -tag -width foo 280878ed226SJulian Elischer.It Dv NGM_HCI_LP_CON_REQ 28172f00208SRuslan ErmilovRequests the lower protocol to create a connection. 28272f00208SRuslan ErmilovIf a physical link 283878ed226SJulian Elischerto the remote device does not exist, this message must be sent to the lower 284878ed226SJulian Elischerprotocol (baseband) to establish the physical connection. 285878ed226SJulian Elischer.It Dv NGM_HCI_LP_DISCON_REQ 286878ed226SJulian ElischerRequests the lower protocol (baseband) to terminate a connection. 287878ed226SJulian Elischer.It Dv NGM_HCI_LP_CON_CFM 288878ed226SJulian ElischerConfirms success or failure of the 28972f00208SRuslan Ermilov.Dv NGM_HCI_LP_CON_REQ 29072f00208SRuslan Ermilovrequest to establish a lower layer (baseband) connection. 291878ed226SJulian ElischerThis includes passing the authentication challenge if authentication is 292878ed226SJulian Elischerrequired to establish the physical link. 293878ed226SJulian Elischer.It Dv NGM_HCI_LP_CON_IND 294878ed226SJulian ElischerIndicates the lower protocol (baseband) has successfully established 295878ed226SJulian Elischerincoming connection. 296878ed226SJulian Elischer.It Dv NGM_HCI_LP_CON_RSP 297878ed226SJulian ElischerA response accepting or rejecting the previous connection indication request. 298878ed226SJulian Elischer.It Dv NGM_HCI_LP_DISCON_IND 29972f00208SRuslan ErmilovIndicates the lower protocol (baseband) has terminated connection. 30072f00208SRuslan ErmilovThis could be a response to 301878ed226SJulian Elischer.Dv NGM_HCI_LP_DISCON_REQ 302878ed226SJulian Elischeror a timeout event. 303878ed226SJulian Elischer.It Dv NGM_HCI_LP_QOS_REQ 304878ed226SJulian ElischerRequests the lower protocol (baseband) to accommodate a particular QoS 305878ed226SJulian Elischerparameter set. 306878ed226SJulian Elischer.It Dv NGM_HCI_LP_QOS_CFM 307878ed226SJulian ElischerConfirms success or failure of the request for a given quality of service. 308878ed226SJulian Elischer.It Dv NGM_HCI_LP_QOS_IND 309878ed226SJulian ElischerIndicates the lower protocol (baseband) has detected a violation of the QoS 310878ed226SJulian Elischeragreement. 311878ed226SJulian Elischer.El 312878ed226SJulian Elischer.Sh NETGRAPH CONTROL MESSAGES 313878ed226SJulian ElischerThis node type supports the generic control messages, plus the following: 314c60bda17SJoel Dahl.Bl -tag -width foo 315878ed226SJulian Elischer.It Dv NGM_HCI_NODE_GET_STATE 316878ed226SJulian ElischerReturns current state for the node. 317878ed226SJulian Elischer.It Dv NGM_HCI_NODE_INIT 318878ed226SJulian ElischerTurn on 319878ed226SJulian Elischer.Dq inited 320878ed226SJulian Elischerbit for the node. 321878ed226SJulian Elischer.It Dv NGM_HCI_NODE_GET_DEBUG 322878ed226SJulian ElischerReturns an integer containing the current debug level for the node. 323878ed226SJulian Elischer.It Dv NGM_HCI_NODE_SET_DEBUG 324878ed226SJulian ElischerThis command takes an integer argument and sets current debug level 325878ed226SJulian Elischerfor the node. 326878ed226SJulian Elischer.It Dv NGM_HCI_NODE_GET_BUFFER 327878ed226SJulian ElischerReturns current state of data buffers. 328878ed226SJulian Elischer.It Dv NGM_HCI_NODE_GET_BDADDR 329878ed226SJulian ElischerReturns BD_ADDR as cached in the node. 330878ed226SJulian Elischer.It Dv NGM_HCI_NODE_GET_FEATURES 331878ed226SJulian ElischerReturns the list of features supported by hardware (as cached by the node). 332878ed226SJulian Elischer.It Dv NGM_HCI_NODE_GET_NEIGHBOR_CACHE 333878ed226SJulian ElischerReturns content of the neighbor cache. 334878ed226SJulian Elischer.It Dv NGM_HCI_NODE_FLUSH_NEIGHBOR_CACHE 335878ed226SJulian ElischerRemove all neighbor cache entries. 336878ed226SJulian Elischer.It Dv NGM_HCI_NODE_GET_CON_LIST 3375203edcdSRuslan ErmilovReturns list of active baseband connections (i.e., ACL and SCO links). 338878ed226SJulian Elischer.It Dv NGM_HCI_NODE_GET_STAT 339878ed226SJulian ElischerReturns various statistic counters. 340878ed226SJulian Elischer.It Dv NGM_HCI_NODE_RESET_STAT 341878ed226SJulian ElischerResets all statistic counters to zero. 342878ed226SJulian Elischer.It NGM_HCI_NODE_SET_LINK_POLICY_SETTINGS_MASK 34372f00208SRuslan ErmilovSets current link policy settings mask. 34472f00208SRuslan ErmilovAfter the new ACL connection is 34572f00208SRuslan Ermilovcreated the HCI node will try set link policy for the ACL connection. 34672f00208SRuslan ErmilovBy default, every supported Link Manager (LM) mode will be enabled. 34772f00208SRuslan ErmilovUser can 348878ed226SJulian Elischeroverride this by setting link policy settings mask which specifies LM 349878ed226SJulian Elischermodes to be enabled. 350878ed226SJulian Elischer.It NGM_HCI_NODE_GET_LINK_POLICY_SETTINGS_MASK 351878ed226SJulian ElischerReturns current link policy settings mask. 352878ed226SJulian Elischer.It NGM_HCI_NODE_SET_PACKET_MASK 35372f00208SRuslan ErmilovSets current packet mask. 35472f00208SRuslan ErmilovWhen new baseband (ACL or SCO) connection is 355878ed226SJulian Elischercreated the HCI node will specify every packet type supported by the device. 356878ed226SJulian ElischerUser can override this by setting packet mask which specifies packet types 357878ed226SJulian Elischerto be used for new baseband connections. 358878ed226SJulian Elischer.It NGM_HCI_NODE_GET_PACKET_MASK 359878ed226SJulian ElischerReturns current packet mask. 360f2bb1caeSJulian Elischer.It NGM_HCI_NODE_SET_ROLE_SWITCH 36172f00208SRuslan ErmilovSets the value of the role switch. 36272f00208SRuslan ErmilovRole switch is enabled when this value is not zero. 36372f00208SRuslan ErmilovThis is the default state. 364c48524c2SMike PritchardNote that actual role switch at Bluetooth link level will only be performed if 36572f00208SRuslan Ermilovhardware supports role switch and it was enabled. 366f2bb1caeSJulian Elischer.It NGM_HCI_NODE_GET_ROLE_SWITCH 367f2bb1caeSJulian ElischerReturns the value of the role switch for the node. 368878ed226SJulian Elischer.El 369878ed226SJulian Elischer.Sh SHUTDOWN 37072f00208SRuslan ErmilovThis node shuts down upon receipt of a 37172f00208SRuslan Ermilov.Dv NGM_SHUTDOWN 37272f00208SRuslan Ermilovcontrol message, or 373878ed226SJulian Elischerwhen all hooks have been disconnected. 374878ed226SJulian Elischer.Sh SEE ALSO 375878ed226SJulian Elischer.Xr netgraph 4 , 37672f00208SRuslan Ermilov.Xr hccontrol 8 , 37772f00208SRuslan Ermilov.Xr ngctl 8 378878ed226SJulian Elischer.Sh HISTORY 379878ed226SJulian ElischerThe 38072f00208SRuslan Ermilov.Nm hci 381878ed226SJulian Elischernode type was implemented in 382878ed226SJulian Elischer.Fx 5.0 . 383878ed226SJulian Elischer.Sh AUTHORS 384*6c899950SBaptiste Daroussin.An Maksim Yevmenkin Aq Mt m_evmenkin@yahoo.com 3859cbda590SRuslan Ermilov.Sh BUGS 3869cbda590SRuslan ErmilovMost likely. 3879cbda590SRuslan ErmilovPlease report if found. 388