Skip to content

Commit eebfe80

Browse files
Vudentzgregkh
authored andcommitted
Bluetooth: hci_core: Fix not accounting for BIS/CIS/PA links separately
[ Upstream commit 9d4b01a ] 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: Sasha Levin <sashal@kernel.org>
1 parent 087812a commit eebfe80

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
@@ -129,7 +129,9 @@ struct hci_conn_hash {
129129
struct list_head list;
130130
unsigned int acl_num;
131131
unsigned int sco_num;
132-
unsigned int iso_num;
132+
unsigned int cis_num;
133+
unsigned int bis_num;
134+
unsigned int pa_num;
133135
unsigned int le_num;
134136
unsigned int le_num_peripheral;
135137
};
@@ -1014,9 +1016,13 @@ static inline void hci_conn_hash_add(struct hci_dev *hdev, struct hci_conn *c)
10141016
h->sco_num++;
10151017
break;
10161018
case CIS_LINK:
1019+
h->cis_num++;
1020+
break;
10171021
case BIS_LINK:
1022+
h->bis_num++;
1023+
break;
10181024
case PA_LINK:
1019-
h->iso_num++;
1025+
h->pa_num++;
10201026
break;
10211027
}
10221028
}
@@ -1042,9 +1048,13 @@ static inline void hci_conn_hash_del(struct hci_dev *hdev, struct hci_conn *c)
10421048
h->sco_num--;
10431049
break;
10441050
case CIS_LINK:
1051+
h->cis_num--;
1052+
break;
10451053
case BIS_LINK:
1054+
h->bis_num--;
1055+
break;
10461056
case PA_LINK:
1047-
h->iso_num--;
1057+
h->pa_num--;
10481058
break;
10491059
}
10501060
}
@@ -1061,9 +1071,11 @@ static inline unsigned int hci_conn_num(struct hci_dev *hdev, __u8 type)
10611071
case ESCO_LINK:
10621072
return h->sco_num;
10631073
case CIS_LINK:
1074+
return h->cis_num;
10641075
case BIS_LINK:
1076+
return h->bis_num;
10651077
case PA_LINK:
1066-
return h->iso_num;
1078+
return h->pa_num;
10671079
default:
10681080
return 0;
10691081
}
@@ -1073,7 +1085,15 @@ static inline unsigned int hci_conn_count(struct hci_dev *hdev)
10731085
{
10741086
struct hci_conn_hash *c = &hdev->conn_hash;
10751087

1076-
return c->acl_num + c->sco_num + c->le_num + c->iso_num;
1088+
return c->acl_num + c->sco_num + c->le_num + c->cis_num + c->bis_num +
1089+
c->pa_num;
1090+
}
1091+
1092+
static inline unsigned int hci_iso_count(struct hci_dev *hdev)
1093+
{
1094+
struct hci_conn_hash *c = &hdev->conn_hash;
1095+
1096+
return c->cis_num + c->bis_num;
10771097
}
10781098

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

0 commit comments

Comments
 (0)