From e23d5a080121fe8a862e23dcfe69da96f57e7ecb Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Thu, 19 Jun 2025 03:52:47 +0300 Subject: [PATCH] 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 --- subsys/bluetooth/host/cs.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/subsys/bluetooth/host/cs.c b/subsys/bluetooth/host/cs.c index a7bdefa77a1..baad4204bc6 100644 --- a/subsys/bluetooth/host/cs.c +++ b/subsys/bluetooth/host/cs.c @@ -296,7 +296,7 @@ int bt_le_cs_read_remote_supported_capabilities(struct bt_conn *conn) struct bt_hci_cp_le_read_remote_supported_capabilities *cp; struct net_buf *buf; - buf = bt_hci_cmd_create(BT_HCI_OP_LE_CS_READ_REMOTE_SUPPORTED_CAPABILITIES, sizeof(*cp)); + buf = bt_hci_cmd_alloc(K_FOREVER); if (!buf) { return -ENOBUFS; } @@ -439,7 +439,7 @@ int bt_le_cs_set_default_settings(struct bt_conn *conn, struct bt_hci_cp_le_cs_set_default_settings *cp; struct net_buf *buf; - buf = bt_hci_cmd_create(BT_HCI_OP_LE_CS_SET_DEFAULT_SETTINGS, sizeof(*cp)); + buf = bt_hci_cmd_alloc(K_FOREVER); if (!buf) { return -ENOBUFS; } @@ -466,7 +466,7 @@ int bt_le_cs_read_remote_fae_table(struct bt_conn *conn) struct bt_hci_cp_le_read_remote_fae_table *cp; struct net_buf *buf; - buf = bt_hci_cmd_create(BT_HCI_OP_LE_CS_READ_REMOTE_FAE_TABLE, sizeof(*cp)); + buf = bt_hci_cmd_alloc(K_FOREVER); if (!buf) { return -ENOBUFS; } @@ -884,7 +884,7 @@ int bt_le_cs_create_config(struct bt_conn *conn, struct bt_le_cs_create_config_p struct bt_hci_cp_le_cs_create_config *cp; struct net_buf *buf; - buf = bt_hci_cmd_create(BT_HCI_OP_LE_CS_CREATE_CONFIG, sizeof(*cp)); + buf = bt_hci_cmd_alloc(K_FOREVER); if (!buf) { return -ENOBUFS; } @@ -917,7 +917,7 @@ int bt_le_cs_remove_config(struct bt_conn *conn, uint8_t config_id) struct bt_hci_cp_le_cs_remove_config *cp; struct net_buf *buf; - buf = bt_hci_cmd_create(BT_HCI_OP_LE_CS_REMOVE_CONFIG, sizeof(*cp)); + buf = bt_hci_cmd_alloc(K_FOREVER); if (!buf) { return -ENOBUFS; } @@ -934,7 +934,7 @@ int bt_le_cs_security_enable(struct bt_conn *conn) struct bt_hci_cp_le_security_enable *cp; struct net_buf *buf; - buf = bt_hci_cmd_create(BT_HCI_OP_LE_CS_SECURITY_ENABLE, sizeof(*cp)); + buf = bt_hci_cmd_alloc(K_FOREVER); if (!buf) { return -ENOBUFS; } @@ -951,7 +951,7 @@ int bt_le_cs_procedure_enable(struct bt_conn *conn, struct bt_hci_cp_le_procedure_enable *cp; struct net_buf *buf; - buf = bt_hci_cmd_create(BT_HCI_OP_LE_CS_PROCEDURE_ENABLE, sizeof(*cp)); + buf = bt_hci_cmd_alloc(K_FOREVER); if (!buf) { return -ENOBUFS; } @@ -970,7 +970,7 @@ int bt_le_cs_set_procedure_parameters(struct bt_conn *conn, struct bt_hci_cp_le_set_procedure_parameters *cp; struct net_buf *buf; - buf = bt_hci_cmd_create(BT_HCI_OP_LE_CS_SET_PROCEDURE_PARAMETERS, sizeof(*cp)); + buf = bt_hci_cmd_alloc(K_FOREVER); if (!buf) { return -ENOBUFS; } @@ -999,7 +999,7 @@ int bt_le_cs_set_channel_classification(uint8_t channel_classification[10]) uint8_t *cp; struct net_buf *buf; - buf = bt_hci_cmd_create(BT_HCI_OP_LE_CS_SET_CHANNEL_CLASSIFICATION, 10); + buf = bt_hci_cmd_alloc(K_FOREVER); if (!buf) { return -ENOBUFS; } @@ -1111,9 +1111,7 @@ int bt_le_cs_write_cached_remote_supported_capabilities( struct bt_hci_cp_le_write_cached_remote_supported_capabilities *cp; struct net_buf *buf; - buf = bt_hci_cmd_create(BT_HCI_OP_LE_CS_WRITE_CACHED_REMOTE_SUPPORTED_CAPABILITIES, - sizeof(*cp)); - + buf = bt_hci_cmd_alloc(K_FOREVER); if (!buf) { return -ENOBUFS; } @@ -1210,7 +1208,7 @@ int bt_le_cs_write_cached_remote_fae_table(struct bt_conn *conn, int8_t remote_f struct bt_hci_cp_le_write_cached_remote_fae_table *cp; struct net_buf *buf; - buf = bt_hci_cmd_create(BT_HCI_OP_LE_CS_WRITE_CACHED_REMOTE_FAE_TABLE, sizeof(*cp)); + buf = bt_hci_cmd_alloc(K_FOREVER); if (!buf) { return -ENOBUFS; } @@ -1308,7 +1306,7 @@ int bt_le_cs_stop_test(void) { struct net_buf *buf; - buf = bt_hci_cmd_create(BT_HCI_OP_LE_CS_TEST_END, 0); + buf = bt_hci_cmd_alloc(K_FOREVER); if (!buf) { return -ENOBUFS; }