summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/netgraph/bluetooth/include/ng_hci.h17
-rw-r--r--usr.sbin/bluetooth/hccontrol/link_control.c9
2 files changed, 11 insertions, 15 deletions
diff --git a/sys/netgraph/bluetooth/include/ng_hci.h b/sys/netgraph/bluetooth/include/ng_hci.h
index ba7796f..a304d04 100644
--- a/sys/netgraph/bluetooth/include/ng_hci.h
+++ b/sys/netgraph/bluetooth/include/ng_hci.h
@@ -1436,15 +1436,18 @@ typedef struct {
#define NG_HCI_EVENT_INQUIRY_RESULT 0x02
typedef struct {
u_int8_t num_responses; /* number of responses */
-/* these are repeated "num_responses" times
- bdaddr_t bdaddr; --- unit address(es)
- u_int8_t page_scan_rep_mode; --- page scan rep. mode(s)
- u_int8_t page_scan_period_mode; --- page scan period mode(s)
- u_int8_t page_scan_mode; --- page scan mode(s)
- u_int8_t uclass[NG_HCI_CLASS_SIZE]; --- unit class(es)
- u_int16_t clock_offset; --- clock offset(s) */
+/* ng_hci_inquiry_response[num_responses] -- see below */
} __attribute__ ((packed)) ng_hci_inquiry_result_ep;
+typedef struct {
+ bdaddr_t bdaddr; /* unit address */
+ u_int8_t page_scan_rep_mode; /* page scan rep. mode */
+ u_int8_t page_scan_period_mode; /* page scan period mode */
+ u_int8_t page_scan_mode; /* page scan mode */
+ u_int8_t class[NG_HCI_CLASS_SIZE]; /* unit class */
+ u_int16_t clock_offset; /* clock offset */
+} __attribute__ ((packed)) ng_hci_inquiry_response;
+
#define NG_HCI_EVENT_CON_COMPL 0x03
typedef struct {
u_int8_t status; /* 0x00 - success */
diff --git a/usr.sbin/bluetooth/hccontrol/link_control.c b/usr.sbin/bluetooth/hccontrol/link_control.c
index b90ce00..7d01f04 100644
--- a/usr.sbin/bluetooth/hccontrol/link_control.c
+++ b/usr.sbin/bluetooth/hccontrol/link_control.c
@@ -146,14 +146,7 @@ wait_for_more:
static void
hci_inquiry_response(int n, uint8_t **b)
{
- struct inquiry_response {
- bdaddr_t bdaddr;
- uint8_t page_scan_rep_mode;
- uint8_t page_scan_period_mode;
- uint8_t page_scan_mode;
- uint8_t class[NG_HCI_CLASS_SIZE];
- uint16_t clock_offset;
- } *ir = (struct inquiry_response *)(*b);
+ ng_hci_inquiry_response *ir = (ng_hci_inquiry_response *)(*b);
fprintf(stdout, "Inquiry result #%d\n", n);
fprintf(stdout, "\tBD_ADDR: %s\n", hci_bdaddr2str(&ir->bdaddr));
OpenPOWER on IntegriCloud