Skip to content

Commit 2d7bb30

Browse files
jhedbergolivier-le-sage
authored andcommitted
[nrf fromtree] Bluetooth: Host: cs: 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 e23d5a0)
1 parent 9f49a42 commit 2d7bb30

File tree

1 file changed

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

1 file changed

+12
-14
lines changed

subsys/bluetooth/host/cs.c

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ int bt_le_cs_read_remote_supported_capabilities(struct bt_conn *conn)
296296
struct bt_hci_cp_le_read_remote_supported_capabilities *cp;
297297
struct net_buf *buf;
298298

299-
buf = bt_hci_cmd_create(BT_HCI_OP_LE_CS_READ_REMOTE_SUPPORTED_CAPABILITIES, sizeof(*cp));
299+
buf = bt_hci_cmd_alloc(K_FOREVER);
300300
if (!buf) {
301301
return -ENOBUFS;
302302
}
@@ -439,7 +439,7 @@ int bt_le_cs_set_default_settings(struct bt_conn *conn,
439439
struct bt_hci_cp_le_cs_set_default_settings *cp;
440440
struct net_buf *buf;
441441

442-
buf = bt_hci_cmd_create(BT_HCI_OP_LE_CS_SET_DEFAULT_SETTINGS, sizeof(*cp));
442+
buf = bt_hci_cmd_alloc(K_FOREVER);
443443
if (!buf) {
444444
return -ENOBUFS;
445445
}
@@ -466,7 +466,7 @@ int bt_le_cs_read_remote_fae_table(struct bt_conn *conn)
466466
struct bt_hci_cp_le_read_remote_fae_table *cp;
467467
struct net_buf *buf;
468468

469-
buf = bt_hci_cmd_create(BT_HCI_OP_LE_CS_READ_REMOTE_FAE_TABLE, sizeof(*cp));
469+
buf = bt_hci_cmd_alloc(K_FOREVER);
470470
if (!buf) {
471471
return -ENOBUFS;
472472
}
@@ -884,7 +884,7 @@ int bt_le_cs_create_config(struct bt_conn *conn, struct bt_le_cs_create_config_p
884884
struct bt_hci_cp_le_cs_create_config *cp;
885885
struct net_buf *buf;
886886

887-
buf = bt_hci_cmd_create(BT_HCI_OP_LE_CS_CREATE_CONFIG, sizeof(*cp));
887+
buf = bt_hci_cmd_alloc(K_FOREVER);
888888
if (!buf) {
889889
return -ENOBUFS;
890890
}
@@ -917,7 +917,7 @@ int bt_le_cs_remove_config(struct bt_conn *conn, uint8_t config_id)
917917
struct bt_hci_cp_le_cs_remove_config *cp;
918918
struct net_buf *buf;
919919

920-
buf = bt_hci_cmd_create(BT_HCI_OP_LE_CS_REMOVE_CONFIG, sizeof(*cp));
920+
buf = bt_hci_cmd_alloc(K_FOREVER);
921921
if (!buf) {
922922
return -ENOBUFS;
923923
}
@@ -934,7 +934,7 @@ int bt_le_cs_security_enable(struct bt_conn *conn)
934934
struct bt_hci_cp_le_security_enable *cp;
935935
struct net_buf *buf;
936936

937-
buf = bt_hci_cmd_create(BT_HCI_OP_LE_CS_SECURITY_ENABLE, sizeof(*cp));
937+
buf = bt_hci_cmd_alloc(K_FOREVER);
938938
if (!buf) {
939939
return -ENOBUFS;
940940
}
@@ -951,7 +951,7 @@ int bt_le_cs_procedure_enable(struct bt_conn *conn,
951951
struct bt_hci_cp_le_procedure_enable *cp;
952952
struct net_buf *buf;
953953

954-
buf = bt_hci_cmd_create(BT_HCI_OP_LE_CS_PROCEDURE_ENABLE, sizeof(*cp));
954+
buf = bt_hci_cmd_alloc(K_FOREVER);
955955
if (!buf) {
956956
return -ENOBUFS;
957957
}
@@ -970,7 +970,7 @@ int bt_le_cs_set_procedure_parameters(struct bt_conn *conn,
970970
struct bt_hci_cp_le_set_procedure_parameters *cp;
971971
struct net_buf *buf;
972972

973-
buf = bt_hci_cmd_create(BT_HCI_OP_LE_CS_SET_PROCEDURE_PARAMETERS, sizeof(*cp));
973+
buf = bt_hci_cmd_alloc(K_FOREVER);
974974
if (!buf) {
975975
return -ENOBUFS;
976976
}
@@ -999,7 +999,7 @@ int bt_le_cs_set_channel_classification(uint8_t channel_classification[10])
999999
uint8_t *cp;
10001000
struct net_buf *buf;
10011001

1002-
buf = bt_hci_cmd_create(BT_HCI_OP_LE_CS_SET_CHANNEL_CLASSIFICATION, 10);
1002+
buf = bt_hci_cmd_alloc(K_FOREVER);
10031003
if (!buf) {
10041004
return -ENOBUFS;
10051005
}
@@ -1111,9 +1111,7 @@ int bt_le_cs_write_cached_remote_supported_capabilities(
11111111
struct bt_hci_cp_le_write_cached_remote_supported_capabilities *cp;
11121112
struct net_buf *buf;
11131113

1114-
buf = bt_hci_cmd_create(BT_HCI_OP_LE_CS_WRITE_CACHED_REMOTE_SUPPORTED_CAPABILITIES,
1115-
sizeof(*cp));
1116-
1114+
buf = bt_hci_cmd_alloc(K_FOREVER);
11171115
if (!buf) {
11181116
return -ENOBUFS;
11191117
}
@@ -1210,7 +1208,7 @@ int bt_le_cs_write_cached_remote_fae_table(struct bt_conn *conn, int8_t remote_f
12101208
struct bt_hci_cp_le_write_cached_remote_fae_table *cp;
12111209
struct net_buf *buf;
12121210

1213-
buf = bt_hci_cmd_create(BT_HCI_OP_LE_CS_WRITE_CACHED_REMOTE_FAE_TABLE, sizeof(*cp));
1211+
buf = bt_hci_cmd_alloc(K_FOREVER);
12141212
if (!buf) {
12151213
return -ENOBUFS;
12161214
}
@@ -1308,7 +1306,7 @@ int bt_le_cs_stop_test(void)
13081306
{
13091307
struct net_buf *buf;
13101308

1311-
buf = bt_hci_cmd_create(BT_HCI_OP_LE_CS_TEST_END, 0);
1309+
buf = bt_hci_cmd_alloc(K_FOREVER);
13121310
if (!buf) {
13131311
return -ENOBUFS;
13141312
}

0 commit comments

Comments
 (0)