Skip to content

Commit 180b51d

Browse files
alwa-nordiccvinayak
authored andcommitted
Bluetooth: Host: Remove bt_buf_get_cmd_complete
After the previous commit, this function no longer has any users. Signed-off-by: Aleksander Wasaznik <[email protected]> (cherry picked from commit b6a1051) Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
1 parent ce11e85 commit 180b51d

File tree

8 files changed

+0
-239
lines changed

8 files changed

+0
-239
lines changed

include/zephyr/bluetooth/buf.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -129,17 +129,6 @@ struct net_buf *bt_buf_get_rx(enum bt_buf_type type, k_timeout_t timeout);
129129
struct net_buf *bt_buf_get_tx(enum bt_buf_type type, k_timeout_t timeout,
130130
const void *data, size_t size);
131131

132-
/** Allocate a buffer for an HCI Command Complete/Status Event
133-
*
134-
* This will set the buffer type so bt_buf_set_type() does not need to
135-
* be explicitly called before bt_recv_prio().
136-
*
137-
* @param timeout Non-negative waiting period to obtain a buffer or one of the
138-
* special values K_NO_WAIT and K_FOREVER.
139-
* @return A new buffer.
140-
*/
141-
struct net_buf *bt_buf_get_cmd_complete(k_timeout_t timeout);
142-
143132
/** Allocate a buffer for an HCI Event
144133
*
145134
* This will set the buffer type so bt_buf_set_type() does not need to

subsys/bluetooth/host/buf.c

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -86,22 +86,6 @@ struct net_buf *bt_buf_get_rx(enum bt_buf_type type, k_timeout_t timeout)
8686
return buf;
8787
}
8888

89-
struct net_buf *bt_buf_get_cmd_complete(k_timeout_t timeout)
90-
{
91-
struct net_buf *buf;
92-
93-
buf = (struct net_buf *)atomic_ptr_clear((atomic_ptr_t *)&bt_dev.sent_cmd);
94-
if (buf) {
95-
bt_buf_set_type(buf, BT_BUF_EVT);
96-
buf->len = 0U;
97-
net_buf_reserve(buf, BT_BUF_RESERVE);
98-
99-
return buf;
100-
}
101-
102-
return bt_buf_get_rx(BT_BUF_EVT, timeout);
103-
}
104-
10589
struct net_buf *bt_buf_get_evt(uint8_t evt, bool discardable,
10690
k_timeout_t timeout)
10791
{

subsys/bluetooth/host/hci_raw.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -177,11 +177,6 @@ struct net_buf *bt_buf_get_tx(enum bt_buf_type type, k_timeout_t timeout,
177177
return buf;
178178
}
179179

180-
struct net_buf *bt_buf_get_cmd_complete(k_timeout_t timeout)
181-
{
182-
return bt_buf_get_rx(BT_BUF_EVT, timeout);
183-
}
184-
185180
struct net_buf *bt_buf_get_evt(uint8_t evt, bool discardable, k_timeout_t timeout)
186181
{
187182
return bt_buf_get_rx(BT_BUF_EVT, timeout);

tests/bluetooth/host/buf/bt_buf_get_cmd_complete/CMakeLists.txt

Lines changed: 0 additions & 16 deletions
This file was deleted.

tests/bluetooth/host/buf/bt_buf_get_cmd_complete/prj.conf

Lines changed: 0 additions & 5 deletions
This file was deleted.

tests/bluetooth/host/buf/bt_buf_get_cmd_complete/src/main.c

Lines changed: 0 additions & 164 deletions
This file was deleted.

tests/bluetooth/host/buf/bt_buf_get_cmd_complete/testcase.yaml

Lines changed: 0 additions & 21 deletions
This file was deleted.

tests/bluetooth/host/buf/mocks/net_buf_expects.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
* Expected behaviour:
1313
* - net_buf_alloc() to be called once with :
1414
* - correct memory allocation pool
15-
* - same timeout value passed to bt_buf_get_cmd_complete()
1615
*/
1716
void expect_single_call_net_buf_alloc(struct net_buf_pool *pool, k_timeout_t *timeout);
1817

0 commit comments

Comments
 (0)