ng_hci(4) 맨 페이지 - 윈디하나의 솔라나라

개요

섹션
맨 페이지 이름
검색(S)

ng_hci(4)

(HCI) layer The node type is a Netgraph node type that implements
Bluetooth Host Controller Interface (HCI) layer as per chapter H1
of  the Bluetooth Specification Book v1.1.  Bluetooth is a short-
range radio link intended  to  replace  the  cable(s)  connecting
portable  and/or fixed electronic devices.  Bluetooth operates in
the unlicensed ISM band at 2.4 GHz.  The Bluetooth protocol  uses
a  combination  of  circuit  and packet switching.  Bluetooth can
support an asynchronous data channel, up  to  three  simultaneous
synchronous  voice  channels,  or  a channel which simultaneously
supports asynchronous data and  synchronous  voice.   Each  voice
channel  supports  a  64 kb/s synchronous (voice) channel in each
direction.  The asynchronous channel can  support  maximal  723.2
kb/s  asymmetric  (and still up to 57.6 kb/s in the return direc‐
tion), or 433.9 kb/s symmetric.  The Bluetooth system provides  a
point-to-point connection (only two Bluetooth units involved), or
a  point-to-multipoint  connection.   In  the point-to-multipoint
connection, the channel is shared among several Bluetooth  units.
Two  or  more units sharing the same channel form a One Bluetooth
unit acts as the master of the piconet, whereas the other unit(s)
acts as slave(s).  Up to seven slaves can be active  in  the  pi‐
conet.   In  addition,  many more slaves can remain locked to the
master in a so-called parked state.  These parked  slaves  cannot
be  active on the channel, but remain synchronized to the master.
Both for active and parked slaves, the  channel  access  is  con‐
trolled by the master.  Multiple piconets with overlapping cover‐
age  areas  form  a  Each  piconet can only have a single master.
However, slaves can participate in different piconets on a  time-
division  multiplex  basis.  In addition, a master in one piconet
can be a slave in another piconet.  The  piconets  shall  not  be
frequency-synchronized.   Each  piconet has its own hopping chan‐
nel.  The channel is divided into time slots, each  625  usec  in
length.   The  time slots are numbered according to the Bluetooth
clock of the piconet master.  The slot numbering ranges from 0 to
2^27 -1 and is cyclic with a cycle length of 2^27.  In  the  time
slots,  master and slave can transmit packets.  The SCO link is a
symmetric, point-to-point link between the master and a  specific
slave.   The SCO link reserves slots and can therefore be consid‐
ered as a circuit-switched connection between the master and  the
slave.   The SCO link typically supports time-bounded information
like voice.  The master can support up to three SCO links to  the
same  slave  or  to  different slaves.  A slave can support up to
three SCO links from the same master, or two  SCO  links  if  the
links  originate  from  different masters.  SCO packets are never
retransmitted.  In the slots not reserved for SCO links, the mas‐
ter can exchange packets with any slave on a per-slot basis.  The
ACL link provides a packet-switched connection between the master
and all active slaves participating in the piconet.   Both  asyn‐
chronous  and isochronous services are supported.  Between a mas‐
ter and a slave only a single ACL link can exist.  For  most  ACL
packets,  packet  retransmission  is  applied  to assure data in‐
tegrity.  The HCI provides a command interface  to  the  baseband
controller  and  link  manager, and access to hardware status and
control registers.  This interface provides a uniform  method  of
accessing  the Bluetooth baseband capabilities.  The HCI layer on
the Host exchanges data and commands with the HCI firmware on the
Bluetooth hardware.  The Host Controller Transport  Layer  (i.e.,
physical bus) driver provides both HCI layers with the ability to
exchange  information  with  each  other.   The Host will receive
asynchronous notifications of HCI  events  independent  of  which
Host Controller Transport Layer is used.  HCI events are used for
notifying  the Host when something occurs.  When the Host discov‐
ers that an event has occurred it will then  parse  the  received
event  packet  to  determine which event occurred.  The next sec‐
tions specify the HCI  packet  formats.   #define  NG_HCI_CMD_PKT
0x01 typedef struct {
        uint8_t  type;   /* MUST be 0x1 */
        uint16_t opcode; /* OpCode */
        uint8_t   length;  /*  parameter(s)  length in bytes */ }
__attribute__ ((packed)) ng_hci_cmd_pkt_t; The HCI command packet
is used to send commands to the Host Controller  from  the  Host.
When  the  Host Controller completes most of the commands, a Com‐
mand Complete event is sent to the Host.  Some  commands  do  not
receive  a  Command Complete event when they have been completed.
Instead, when the Host Controller receives one of these  commands
the Host Controller sends a Command Status event back to the Host
when it has begun to execute the command.  Later on, when the ac‐
tions associated with the command have finished, an event that is
associated  with  the  sent command will be sent by the Host Con‐
troller to  the  Host.   #define  NG_HCI_EVENT_PKT  0x04  typedef
struct {
        uint8_t type;   /* MUST be 0x4 */
        uint8_t event;  /* event */
        uint8_t  length;  /*  parameter(s)  length  in bytes */ }
__attribute__ ((packed)) ng_hci_event_pkt_t; The HCI event packet
is used by the Host Controller to notify the Host when events oc‐
cur.  #define NG_HCI_ACL_DATA_PKT 0x02 typedef struct {
        uint8_t  type;       /* MUST be 0x2 */
        uint16_t con_handle; /* connection handle + PB + BC flags
*/
        uint16_t length;     /* payload  length  in  bytes  */  }
__attribute__ ((packed)) ng_hci_acldata_pkt_t; HCI ACL data pack‐
ets  are used to exchange ACL data between the Host and Host Con‐
troller.  #define NG_HCI_SCO_DATA_PKT 0x03 typedef struct {
        uint8_t  type;       /* MUST be 0x3 */
        uint16_t con_handle; /* connection handle + reserved bits
*/
        uint8_t  length;     /* payload  length  in  bytes  */  }
__attribute__ ((packed)) ng_hci_scodata_pkt_t; HCI SCO data pack‐
ets  are used to exchange SCO data between the Host and Host Con‐
troller.  On initialization, HCI control application  must  issue
the  following HCI commands (in any order).  To obtain BD_ADDR of
the Bluetooth unit.  To obtain the list of features supported  by
Bluetooth unit.  To determine the maximum size of HCI ACL and SCO
HCI  data  packets  (excluding  header) that can be sent from the
Host to the Host Controller.  There are also two  additional  re‐
turn  parameters that specify the total number of HCI ACL and SCO
data packets that the Host Controller can have waiting for trans‐
mission in its buffers.  As soon as HCI initialization  has  been
successfully  performed, HCI control application must turn on bit
for the node.  Once HCI node has been  initialized  all  upstream
hooks  will  receive a Netgraph message defined as follows.  #de‐
fine NGM_HCI_NODE_UP 112 /* HCI -> Upper */ typedef struct {
        uint16_t  pkt_size; /* max. ACL/SCO packet size (w/o hdr)
*/
        uint16_t  num_pkts; /* ACL/SCO packet queue size */
        uint16_t  reserved; /* place holder */
        bdaddr_t  bdaddr;   /* bdaddr */ } ng_hci_node_up_ep; HCI
layer performs flow control on baseband connection  basis  (i.e.,
ACL  and  SCO  link).   Each baseband connection has and queue of
outgoing data packets.  Upper layers  protocols  are  allowed  to
send  up  to - packets at one time.  HCI layer will send Netgraph
messages to inform upper layers about  current  queue  state  for
each  connection handle.  The Netgraph message is defined as fol‐
lows.  #define NGM_HCI_SYNC_CON_QUEUE 113  /*  HCI  ->  Upper  */
typedef struct {
        uint16_t con_handle; /* connection handle */
        uint16_t  completed;  /* number of completed packets */ }
ng_hci_sync_con_queue_ep; This node type supports  the  following
hooks:  Bluetooth  Host  Controller Transport Layer hook.  Single
HCI packet contained in single  structure.   Upper  layer  proto‐
col/node  is  connected  to the hook.  Single HCI ACL data packet
contained in single structure.  Upper layer protocol/node is con‐
nected to the hook.  Single HCI SCO data packet contained in sin‐
gle structure.  Raw hook.  Every HCI frame (including HCI command
frame) that goes in or out will be delivered to the  hook.   Usu‐
ally the Bluetooth raw HCI socket layer is connected to the hook.
Single  HCI  frame  contained  in single structure.  Requests the
lower protocol to create a connection.  If a physical link to the
remote device does not exist, this message must be  sent  to  the
lower  protocol  (baseband) to establish the physical connection.
Requests the lower protocol (baseband) to terminate a connection.
Confirms success or failure of the request to establish  a  lower
layer (baseband) connection.  This includes passing the authenti‐
cation  challenge  if authentication is required to establish the
physical link.  Indicates the lower protocol (baseband) has  suc‐
cessfully  established incoming connection.  A response accepting
or rejecting the previous connection indication  request.   Indi‐
cates  the  lower  protocol (baseband) has terminated connection.
This could be a response to or a  timeout  event.   Requests  the
lower protocol (baseband) to accommodate a particular QoS parame‐
ter  set.  Confirms success or failure of the request for a given
quality of service.  Indicates the lower protocol (baseband)  has
detected  a  violation of the QoS agreement.  This node type sup‐
ports the generic control messages, plus the  following:  Returns
current  state  for the node.  Turn on bit for the node.  Returns
an integer containing the current debug level for the node.  This
command takes an integer argument and sets  current  debug  level
for  the  node.   Returns current state of data buffers.  Returns
BD_ADDR as cached in the node.  Returns the list of features sup‐
ported by hardware (as cached by the node).  Returns  content  of
the  neighbor cache.  Remove all neighbor cache entries.  Returns
list of active baseband connections (i.e., ACL  and  SCO  links).
Returns  various  statistic counters.  Resets all statistic coun‐
ters to zero.  Sets current link policy settings mask.  After the
new ACL connection is created the HCI node will try set link pol‐
icy for the ACL connection.  By  default,  every  supported  Link
Manager  (LM)  mode  will  be enabled.  User can override this by
setting link policy settings mask which specifies LM modes to  be
enabled.   Returns  current link policy settings mask.  Sets cur‐
rent packet mask.  When new baseband (ACL or SCO)  connection  is
created  the HCI node will specify every packet type supported by
the device.  User can override this by setting packet mask  which
specifies  packet  types to be used for new baseband connections.
Returns current packet mask.  Sets the value of the role  switch.
Role  switch is enabled when this value is not zero.  This is the
default state.  Note that actual role switch  at  Bluetooth  link
level will only be performed if hardware supports role switch and
it  was  enabled.   Returns  the value of the role switch for the
node.  This node shuts down upon receipt of a control message, or
when all hooks have been disconnected.  The node type was  imple‐
mented in Most likely.  Please report if found.

















맨 페이지 내용의 저작권은 맨 페이지 작성자에게 있습니다.
RSS ATOM XHTML 5 CSS3