Bluetooth: L2CAP: Fix regression causing credits not to be restored
Patch 8c118f8673
causes the wrong semaphore
to checked so receiving credits are never restored which caused the
channel to get stuck after all the credits are consumed.
JIRA: ZEP-1199
Change-Id: I9cd5474b3bcaafcb19d15613939ce30d07befe0a
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This commit is contained in:
parent
621c1d6dbd
commit
4f39b4ceb1
1 changed files with 2 additions and 2 deletions
|
@ -1165,13 +1165,13 @@ static void l2cap_chan_update_credits(struct bt_l2cap_le_chan *chan)
|
|||
uint16_t credits;
|
||||
|
||||
/* Only give more credits if it went bellow the defined threshold */
|
||||
if (nano_sem_count_get(&chan->tx.credits) >
|
||||
if (nano_sem_count_get(&chan->rx.credits) >
|
||||
L2CAP_LE_CREDITS_THRESHOLD) {
|
||||
goto done;
|
||||
}
|
||||
|
||||
/* Restore credits */
|
||||
credits = L2CAP_LE_MAX_CREDITS - nano_sem_count_get(&chan->tx.credits);
|
||||
credits = L2CAP_LE_MAX_CREDITS - nano_sem_count_get(&chan->rx.credits);
|
||||
l2cap_chan_rx_give_credits(chan, credits);
|
||||
|
||||
buf = bt_l2cap_create_pdu(&le_sig, 0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue