Bluetooth: Refactor br_init()
Don't jump to BR/EDR read buffer size if LE read buffer size returned LE data packet length value > 0 in le_init(). Change-Id: If0efa9f239ef75d832cf0f89ae6f227788cbf175 Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
This commit is contained in:
parent
99bd06deaa
commit
4970defaa4
1 changed files with 11 additions and 9 deletions
|
@ -1454,17 +1454,19 @@ static int br_init(void)
|
|||
return 0;
|
||||
}
|
||||
|
||||
/* Use BR/EDR buffer size if LE reports zero buffers */
|
||||
if (!bt_dev.le.mtu) {
|
||||
err = bt_hci_cmd_send_sync(BT_HCI_OP_READ_BUFFER_SIZE, NULL,
|
||||
&rsp);
|
||||
if (err) {
|
||||
return err;
|
||||
}
|
||||
read_buffer_size_complete(rsp);
|
||||
net_buf_unref(rsp);
|
||||
if (bt_dev.le.mtu) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Use BR/EDR buffer size if LE reports zero buffers */
|
||||
err = bt_hci_cmd_send_sync(BT_HCI_OP_READ_BUFFER_SIZE, NULL, &rsp);
|
||||
if (err) {
|
||||
return err;
|
||||
}
|
||||
|
||||
read_buffer_size_complete(rsp);
|
||||
net_buf_unref(rsp);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue