Skip to content

Commit e70152f

Browse files
committed
Bluetooth: hci_core: Fix not accounting for BIS/CIS/PA links separately
JIRA: https://issues.redhat.com/browse/RHEL-107922 commit 9d4b01a Author: Luiz Augusto von Dentz <luiz.von.dentz@intel.com> Date: Thu Aug 14 11:57:19 2025 -0400 Bluetooth: hci_core: Fix not accounting for BIS/CIS/PA links separately This fixes the likes of hci_conn_num(CIS_LINK) returning the total of ISO connection which includes BIS_LINK as well, so this splits the iso_num into each link type and introduces hci_iso_num that can be used in places where the total number of ISO connection still needs to be used. Fixes: 2320556 ("Bluetooth: separate CIS_LINK and BIS_LINK link types") Fixes: a7bcffc ("Bluetooth: Add PA_LINK to distinguish BIG sync and PA sync connections") Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com> Signed-off-by: David Marlin <dmarlin@redhat.com>
1 parent f32ad53 commit e70152f

File tree

1 file changed

+25
-5
lines changed

1 file changed

+25
-5
lines changed

include/net/bluetooth/hci_core.h

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,9 @@ struct hci_conn_hash {
127127
struct list_head list;
128128
unsigned int acl_num;
129129
unsigned int sco_num;
130-
unsigned int iso_num;
130+
unsigned int cis_num;
131+
unsigned int bis_num;
132+
unsigned int pa_num;
131133
unsigned int le_num;
132134
unsigned int le_num_peripheral;
133135
};
@@ -1008,9 +1010,13 @@ static inline void hci_conn_hash_add(struct hci_dev *hdev, struct hci_conn *c)
10081010
h->sco_num++;
10091011
break;
10101012
case CIS_LINK:
1013+
h->cis_num++;
1014+
break;
10111015
case BIS_LINK:
1016+
h->bis_num++;
1017+
break;
10121018
case PA_LINK:
1013-
h->iso_num++;
1019+
h->pa_num++;
10141020
break;
10151021
}
10161022
}
@@ -1036,9 +1042,13 @@ static inline void hci_conn_hash_del(struct hci_dev *hdev, struct hci_conn *c)
10361042
h->sco_num--;
10371043
break;
10381044
case CIS_LINK:
1045+
h->cis_num--;
1046+
break;
10391047
case BIS_LINK:
1048+
h->bis_num--;
1049+
break;
10401050
case PA_LINK:
1041-
h->iso_num--;
1051+
h->pa_num--;
10421052
break;
10431053
}
10441054
}
@@ -1055,9 +1065,11 @@ static inline unsigned int hci_conn_num(struct hci_dev *hdev, __u8 type)
10551065
case ESCO_LINK:
10561066
return h->sco_num;
10571067
case CIS_LINK:
1068+
return h->cis_num;
10581069
case BIS_LINK:
1070+
return h->bis_num;
10591071
case PA_LINK:
1060-
return h->iso_num;
1072+
return h->pa_num;
10611073
default:
10621074
return 0;
10631075
}
@@ -1067,7 +1079,15 @@ static inline unsigned int hci_conn_count(struct hci_dev *hdev)
10671079
{
10681080
struct hci_conn_hash *c = &hdev->conn_hash;
10691081

1070-
return c->acl_num + c->sco_num + c->le_num + c->iso_num;
1082+
return c->acl_num + c->sco_num + c->le_num + c->cis_num + c->bis_num +
1083+
c->pa_num;
1084+
}
1085+
1086+
static inline unsigned int hci_iso_count(struct hci_dev *hdev)
1087+
{
1088+
struct hci_conn_hash *c = &hdev->conn_hash;
1089+
1090+
return c->cis_num + c->bis_num;
10711091
}
10721092

10731093
static inline bool hci_conn_valid(struct hci_dev *hdev, struct hci_conn *conn)

0 commit comments

Comments
 (0)