Skip to content

Commit 5a8f9a2

Browse files
jhedbergolivier-le-sage
authored andcommitted
[nrf fromtree] Bluetooth: Host: iso: Use bt_hci_cmd_alloc()
Use bt_hci_cmd_alloc() instead of the soon to be deprecated bt_hci_cmd_create(). Signed-off-by: Johan Hedberg <[email protected]> (cherry picked from commit e9f0612)
1 parent 66d72a5 commit 5a8f9a2

File tree

1 file changed

+14
-16
lines changed
  • subsys/bluetooth/host

1 file changed

+14
-16
lines changed

subsys/bluetooth/host/iso.c

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ static int hci_le_setup_iso_data_path(const struct bt_conn *iso, uint8_t dir,
196196
uint8_t *cc;
197197
int err;
198198

199-
buf = bt_hci_cmd_create(BT_HCI_OP_LE_SETUP_ISO_PATH, sizeof(*cp) + path->cc_len);
199+
buf = bt_hci_cmd_alloc(K_FOREVER);
200200
if (!buf) {
201201
return -ENOBUFS;
202202
}
@@ -345,7 +345,7 @@ static int hci_le_remove_iso_data_path(struct bt_conn *iso, uint8_t dir)
345345
struct net_buf *buf, *rsp;
346346
int err;
347347

348-
buf = bt_hci_cmd_create(BT_HCI_OP_LE_REMOVE_ISO_PATH, sizeof(*cp));
348+
buf = bt_hci_cmd_alloc(K_FOREVER);
349349
if (!buf) {
350350
return -ENOBUFS;
351351
}
@@ -1061,7 +1061,7 @@ int bt_iso_chan_get_tx_sync(const struct bt_iso_chan *chan, struct bt_iso_tx_inf
10611061
return -ENOTCONN;
10621062
}
10631063

1064-
buf = bt_hci_cmd_create(BT_HCI_OP_LE_READ_ISO_TX_SYNC, sizeof(*cp));
1064+
buf = bt_hci_cmd_alloc(K_FOREVER);
10651065
if (!buf) {
10661066
return -ENOMEM;
10671067
}
@@ -1491,7 +1491,7 @@ static int hci_le_reject_cis(uint16_t handle, uint8_t reason)
14911491
struct net_buf *buf;
14921492
int err;
14931493

1494-
buf = bt_hci_cmd_create(BT_HCI_OP_LE_REJECT_CIS, sizeof(*cp));
1494+
buf = bt_hci_cmd_alloc(K_FOREVER);
14951495
if (!buf) {
14961496
return -ENOBUFS;
14971497
}
@@ -1514,7 +1514,7 @@ static int hci_le_accept_cis(uint16_t handle)
15141514
struct net_buf *buf;
15151515
int err;
15161516

1517-
buf = bt_hci_cmd_create(BT_HCI_OP_LE_ACCEPT_CIS, sizeof(*cp));
1517+
buf = bt_hci_cmd_alloc(K_FOREVER);
15181518
if (!buf) {
15191519
return -ENOBUFS;
15201520
}
@@ -1683,7 +1683,7 @@ static int hci_le_remove_cig(uint8_t cig_id)
16831683
struct bt_hci_cp_le_remove_cig *req;
16841684
struct net_buf *buf;
16851685

1686-
buf = bt_hci_cmd_create(BT_HCI_OP_LE_REMOVE_CIG, sizeof(*req));
1686+
buf = bt_hci_cmd_alloc(K_FOREVER);
16871687
if (!buf) {
16881688
return -ENOBUFS;
16891689
}
@@ -1706,8 +1706,7 @@ static struct net_buf *hci_le_set_cig_params(const struct bt_iso_cig *cig,
17061706
struct net_buf *rsp;
17071707
int i, err;
17081708

1709-
buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_CIG_PARAMS,
1710-
sizeof(*req) + sizeof(*cis_param) * param->num_cis);
1709+
buf = bt_hci_cmd_alloc(K_FOREVER);
17111710
if (!buf) {
17121711
return NULL;
17131712
}
@@ -1795,8 +1794,7 @@ static struct net_buf *hci_le_set_cig_test_params(const struct bt_iso_cig *cig,
17951794
struct net_buf *rsp;
17961795
int err;
17971796

1798-
buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_CIG_PARAMS_TEST,
1799-
sizeof(*req) + sizeof(*cis_param) * param->num_cis);
1797+
buf = bt_hci_cmd_alloc(K_FOREVER);
18001798
if (!buf) {
18011799
return NULL;
18021800
}
@@ -2444,7 +2442,7 @@ static int hci_le_create_cis(const struct bt_iso_connect_param *param, size_t co
24442442
struct bt_hci_cp_le_create_cis *req;
24452443
struct net_buf *buf;
24462444

2447-
buf = bt_hci_cmd_create(BT_HCI_OP_LE_CREATE_CIS, sizeof(*req) + sizeof(*cis) * count);
2445+
buf = bt_hci_cmd_alloc(K_FOREVER);
24482446
if (!buf) {
24492447
return -ENOBUFS;
24502448
}
@@ -2784,7 +2782,7 @@ static int hci_le_create_big(struct bt_le_ext_adv *padv, struct bt_iso_big *big,
27842782
int err;
27852783
struct bt_iso_chan *bis;
27862784

2787-
buf = bt_hci_cmd_create(BT_HCI_OP_LE_CREATE_BIG, sizeof(*req));
2785+
buf = bt_hci_cmd_alloc(K_FOREVER);
27882786

27892787
if (!buf) {
27902788
return -ENOBUFS;
@@ -2844,7 +2842,7 @@ static int hci_le_create_big_test(const struct bt_le_ext_adv *padv, struct bt_is
28442842
struct net_buf *buf;
28452843
int err;
28462844

2847-
buf = bt_hci_cmd_create(BT_HCI_OP_LE_CREATE_BIG_TEST, sizeof(*req));
2845+
buf = bt_hci_cmd_alloc(K_FOREVER);
28482846

28492847
if (!buf) {
28502848
return -ENOBUFS;
@@ -3198,7 +3196,7 @@ static int hci_le_terminate_big(struct bt_iso_big *big)
31983196
struct bt_hci_cp_le_terminate_big *req;
31993197
struct net_buf *buf;
32003198

3201-
buf = bt_hci_cmd_create(BT_HCI_OP_LE_TERMINATE_BIG, sizeof(*req));
3199+
buf = bt_hci_cmd_alloc(K_FOREVER);
32023200
if (!buf) {
32033201
return -ENOBUFS;
32043202
}
@@ -3218,7 +3216,7 @@ static int hci_le_big_sync_term(struct bt_iso_big *big)
32183216
struct net_buf *rsp;
32193217
int err;
32203218

3221-
buf = bt_hci_cmd_create(BT_HCI_OP_LE_BIG_TERMINATE_SYNC, sizeof(*req));
3219+
buf = bt_hci_cmd_alloc(K_FOREVER);
32223220
if (!buf) {
32233221
return -ENOBUFS;
32243222
}
@@ -3391,7 +3389,7 @@ static int hci_le_big_create_sync(const struct bt_le_per_adv_sync *sync, struct
33913389
int err;
33923390
uint8_t bit_idx = 0;
33933391

3394-
buf = bt_hci_cmd_create(BT_HCI_OP_LE_BIG_CREATE_SYNC, sizeof(*req) + big->num_bis);
3392+
buf = bt_hci_cmd_alloc(K_FOREVER);
33953393
if (!buf) {
33963394
return -ENOBUFS;
33973395
}

0 commit comments

Comments
 (0)