Bluetooth: Move buffer type enum to driver.h
Since the buffer type is essentially a HCI driver - HCI core communication detail the appropriate place for it is driver.h. At the same time remove the unnecessary and slightly confusing BT_DUMMY type. Change-Id: Ic813ad24d8f0530d3779006063ea21b010d29cf6 Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
parent
e000290627
commit
ff2d104105
3 changed files with 12 additions and 11 deletions
|
@ -22,6 +22,13 @@
|
|||
|
||||
#include <net/buf.h>
|
||||
|
||||
enum bt_buf_type {
|
||||
BT_CMD, /** HCI command */
|
||||
BT_EVT, /** HCI event */
|
||||
BT_ACL_OUT, /** Outgoing ACL data */
|
||||
BT_ACL_IN, /** Incoming ACL data */
|
||||
};
|
||||
|
||||
/* Allocate a buffer for an HCI event */
|
||||
struct net_buf *bt_buf_get_evt(void);
|
||||
|
||||
|
|
|
@ -508,15 +508,17 @@ void bt_conn_set_state(struct bt_conn *conn, bt_conn_state_t state)
|
|||
notify_connected(conn);
|
||||
break;
|
||||
case BT_CONN_DISCONNECTED:
|
||||
/* Send dummy buffer to wake up and stop the tx fiber
|
||||
* for states where it was running
|
||||
/* Notify disconnection and queue a dummy buffer to wake
|
||||
* up and stop the tx fiber for states where it was
|
||||
* running.
|
||||
*/
|
||||
if (old_state == BT_CONN_CONNECTED ||
|
||||
old_state == BT_CONN_DISCONNECT) {
|
||||
bt_l2cap_disconnected(conn);
|
||||
notify_disconnected(conn);
|
||||
|
||||
nano_fifo_put(&conn->tx_queue, bt_buf_get(BT_DUMMY, 0));
|
||||
nano_fifo_put(&conn->tx_queue,
|
||||
bt_l2cap_create_pdu(conn));
|
||||
}
|
||||
|
||||
/* Release the reference we took for the very first
|
||||
|
|
|
@ -192,14 +192,6 @@ int bt_le_scan_update(void);
|
|||
#define BT_BUF_ACL_IN_MAX 7
|
||||
#define BT_BUF_ACL_OUT_MAX 7
|
||||
|
||||
enum bt_buf_type {
|
||||
BT_CMD, /** HCI command */
|
||||
BT_EVT, /** HCI event */
|
||||
BT_ACL_OUT, /** Outgoing ACL data */
|
||||
BT_ACL_IN, /** Incoming ACL data */
|
||||
BT_DUMMY = BT_CMD, /** Only used for waking up fibers */
|
||||
};
|
||||
|
||||
struct bt_hci_data {
|
||||
/** Type of data contained in a buffer (bt_buf_type) */
|
||||
uint8_t type;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue