summaryrefslogtreecommitdiffstats
path: root/sys/netgraph/bluetooth/hci/ng_hci_misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/netgraph/bluetooth/hci/ng_hci_misc.c')
-rw-r--r--sys/netgraph/bluetooth/hci/ng_hci_misc.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/netgraph/bluetooth/hci/ng_hci_misc.c b/sys/netgraph/bluetooth/hci/ng_hci_misc.c
index 2209fbd..c33b873 100644
--- a/sys/netgraph/bluetooth/hci/ng_hci_misc.c
+++ b/sys/netgraph/bluetooth/hci/ng_hci_misc.c
@@ -214,7 +214,7 @@ ng_hci_flush_neighbor_cache(ng_hci_unit_p unit)
*/
ng_hci_neighbor_p
-ng_hci_get_neighbor(ng_hci_unit_p unit, bdaddr_p bdaddr)
+ng_hci_get_neighbor(ng_hci_unit_p unit, bdaddr_p bdaddr,int link_type)
{
ng_hci_neighbor_p n = NULL;
@@ -222,7 +222,8 @@ ng_hci_get_neighbor(ng_hci_unit_p unit, bdaddr_p bdaddr)
ng_hci_neighbor_p nn = LIST_NEXT(n, next);
if (!ng_hci_neighbor_stale(n)) {
- if (bcmp(&n->bdaddr, bdaddr, sizeof(*bdaddr)) == 0)
+ if (n->addrtype == link_type &&
+ bcmp(&n->bdaddr, bdaddr, sizeof(*bdaddr)) == 0)
break;
} else
ng_hci_free_neighbor(n); /* remove old entry */
@@ -284,7 +285,7 @@ ng_hci_new_con(ng_hci_unit_p unit, int link_type)
con->link_type = link_type;
- if (con->link_type == NG_HCI_LINK_ACL)
+ if (con->link_type != NG_HCI_LINK_SCO)
NG_HCI_BUFF_ACL_TOTAL(unit->buffer, num_pkts);
else
NG_HCI_BUFF_SCO_TOTAL(unit->buffer, num_pkts);
@@ -313,7 +314,7 @@ ng_hci_free_con(ng_hci_unit_con_p con)
* flushed these packets and we can free them too
*/
- if (con->link_type == NG_HCI_LINK_ACL)
+ if (con->link_type != NG_HCI_LINK_SCO)
NG_HCI_BUFF_ACL_FREE(con->unit->buffer, con->pending);
else
NG_HCI_BUFF_SCO_FREE(con->unit->buffer, con->pending);
OpenPOWER on IntegriCloud