Bluetooth: BR/EDR: Use correct ACL Tx MTU and semaphore
Selects right ACL Tx MTU and semaphor based on connection link type and indirectly controller buffers capabilities. Change-Id: I1df1ba81e6b09d9d5bdcd34a93d9a3d255133143 Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
This commit is contained in:
parent
746ae052ca
commit
c4a503b6b4
2 changed files with 16 additions and 2 deletions
|
@ -383,8 +383,15 @@ fail:
|
|||
|
||||
static inline uint16_t conn_mtu(struct bt_conn *conn)
|
||||
{
|
||||
ARG_UNUSED(conn);
|
||||
#if defined(CONFIG_BLUETOOTH_BREDR)
|
||||
if (conn->type == BT_CONN_TYPE_BREDR || !bt_dev.le.mtu) {
|
||||
return bt_dev.br.mtu;
|
||||
} else {
|
||||
return bt_dev.le.mtu;
|
||||
}
|
||||
#else
|
||||
return bt_dev.le.mtu;
|
||||
#endif
|
||||
}
|
||||
|
||||
static struct net_buf *create_frag(struct bt_conn *conn, struct net_buf *buf)
|
||||
|
|
|
@ -146,6 +146,13 @@ int bt_conn_init(void);
|
|||
/* Selects based on connecton type right semaphore for ACL packets */
|
||||
static inline struct nano_sem *bt_conn_get_pkts(struct bt_conn *conn)
|
||||
{
|
||||
ARG_UNUSED(conn);
|
||||
#if defined(CONFIG_BLUETOOTH_BREDR)
|
||||
if (conn->type == BT_CONN_TYPE_BREDR || !bt_dev.le.mtu) {
|
||||
return &bt_dev.br.pkts;
|
||||
} else {
|
||||
return &bt_dev.le.pkts_sem;
|
||||
}
|
||||
#else
|
||||
return &bt_dev.le.pkts_sem;
|
||||
#endif
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue