Path: blob/main/sys/netgraph/bluetooth/hci/ng_hci_prse.h
34814 views
/*1* ng_hci_prse.h2*/34/*-5* SPDX-License-Identifier: BSD-2-Clause6*7* Copyright (c) 2001 Maksim Yevmenkin <[email protected]>8* All rights reserved.9*10* Redistribution and use in source and binary forms, with or without11* modification, are permitted provided that the following conditions12* are met:13* 1. Redistributions of source code must retain the above copyright14* notice, this list of conditions and the following disclaimer.15* 2. Redistributions in binary form must reproduce the above copyright16* notice, this list of conditions and the following disclaimer in the17* documentation and/or other materials provided with the distribution.18*19* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND20* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE21* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE22* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE23* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL24* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS25* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)26* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT27* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY28* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF29* SUCH DAMAGE.30*31* $Id: ng_hci_prse.h,v 1.2 2003/03/18 00:09:36 max Exp $32*/3334/***************************************************************************35***************************************************************************36** ng_parse definitions for the HCI node37***************************************************************************38***************************************************************************/3940#ifndef _NETGRAPH_HCI_PRSE_H_41#define _NETGRAPH_HCI_PRSE_H_4243/* BDADDR */44static const struct ng_parse_fixedarray_info ng_hci_bdaddr_type_info = {45&ng_parse_uint8_type,46NG_HCI_BDADDR_SIZE47};48static const struct ng_parse_type ng_hci_bdaddr_type = {49&ng_parse_fixedarray_type,50&ng_hci_bdaddr_type_info51};5253/* Features */54static const struct ng_parse_fixedarray_info ng_hci_features_type_info = {55&ng_parse_uint8_type,56NG_HCI_FEATURES_SIZE57};58static const struct ng_parse_type ng_hci_features_type = {59&ng_parse_fixedarray_type,60&ng_hci_features_type_info61};6263/* Buffer info */64static const struct ng_parse_struct_field ng_hci_buffer_type_fields[] =65{66{ "cmd_free", &ng_parse_uint8_type, },67{ "sco_size", &ng_parse_uint8_type, },68{ "sco_pkts", &ng_parse_uint16_type, },69{ "sco_free", &ng_parse_uint16_type, },70{ "acl_size", &ng_parse_uint16_type, },71{ "acl_pkts", &ng_parse_uint16_type, },72{ "acl_free", &ng_parse_uint16_type, },73{ NULL, }74};75static const struct ng_parse_type ng_hci_buffer_type = {76&ng_parse_struct_type,77&ng_hci_buffer_type_fields78};7980/* Stat info */81static const struct ng_parse_struct_field ng_hci_stat_type_fields[] =82{83{ "cmd_sent", &ng_parse_uint32_type, },84{ "evnt_recv", &ng_parse_uint32_type, },85{ "acl_recv", &ng_parse_uint32_type, },86{ "acl_sent", &ng_parse_uint32_type, },87{ "sco_recv", &ng_parse_uint32_type, },88{ "sco_sent", &ng_parse_uint32_type, },89{ "bytes_recv", &ng_parse_uint32_type, },90{ "bytes_sent", &ng_parse_uint32_type, },91{ NULL, }92};93static const struct ng_parse_type ng_hci_stat_type = {94&ng_parse_struct_type,95&ng_hci_stat_type_fields96};9798/*99* HCI node command list100*/101102static const struct ng_cmdlist ng_hci_cmdlist[] = {103{104NGM_HCI_COOKIE,105NGM_HCI_NODE_GET_STATE,106"get_state",107NULL,108&ng_parse_uint16_type109},110{111NGM_HCI_COOKIE,112NGM_HCI_NODE_INIT,113"init",114NULL,115NULL116},117{118NGM_HCI_COOKIE,119NGM_HCI_NODE_GET_DEBUG,120"get_debug",121NULL,122&ng_parse_uint16_type123},124{125NGM_HCI_COOKIE,126NGM_HCI_NODE_SET_DEBUG,127"set_debug",128&ng_parse_uint16_type,129NULL130},131{132NGM_HCI_COOKIE,133NGM_HCI_NODE_GET_BUFFER,134"get_buff_info",135NULL,136&ng_hci_buffer_type137},138{139NGM_HCI_COOKIE,140NGM_HCI_NODE_GET_BDADDR,141"get_bdaddr",142NULL,143&ng_hci_bdaddr_type144},145{146NGM_HCI_COOKIE,147NGM_HCI_NODE_GET_FEATURES,148"get_features",149NULL,150&ng_hci_features_type151},152{153NGM_HCI_COOKIE,154NGM_HCI_NODE_GET_STAT,155"get_stat",156NULL,157&ng_hci_stat_type158},159{160NGM_HCI_COOKIE,161NGM_HCI_NODE_RESET_STAT,162"reset_stat",163NULL,164NULL165},166{167NGM_HCI_COOKIE,168NGM_HCI_NODE_FLUSH_NEIGHBOR_CACHE,169"flush_ncache",170NULL,171NULL172},173{174NGM_HCI_COOKIE,175NGM_HCI_NODE_GET_LINK_POLICY_SETTINGS_MASK,176"get_lm_mask",177NULL,178&ng_parse_uint16_type179},180{181NGM_HCI_COOKIE,182NGM_HCI_NODE_SET_LINK_POLICY_SETTINGS_MASK,183"set_lm_mask",184&ng_parse_uint16_type,185NULL186},187{188NGM_HCI_COOKIE,189NGM_HCI_NODE_GET_PACKET_MASK,190"get_pkt_mask",191NULL,192&ng_parse_uint16_type193},194{195NGM_HCI_COOKIE,196NGM_HCI_NODE_SET_PACKET_MASK,197"set_pkt_mask",198&ng_parse_uint16_type,199NULL200},201{202NGM_HCI_COOKIE,203NGM_HCI_NODE_GET_ROLE_SWITCH,204"get_role_sw",205NULL,206&ng_parse_uint16_type207},208{209NGM_HCI_COOKIE,210NGM_HCI_NODE_SET_ROLE_SWITCH,211"set_role_sw",212&ng_parse_uint16_type,213NULL214},215{ 0, }216};217218#endif /* ndef _NETGRAPH_HCI_PRSE_H_ */219220221