Skip to content

Commit cb02a25

Browse files
Dean Jenkinsholtmann
authored andcommitted
Bluetooth: __l2cap_wait_ack() use msecs_to_jiffies()
Use msecs_to_jiffies() instead of using HZ so that it is easier to specify the time in milliseconds. Also add a #define L2CAP_WAIT_ACK_POLL_PERIOD to specify the 200ms polling period so that it is defined in a single place. Signed-off-by: Dean Jenkins <Dean_Jenkins@mentor.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
1 parent 451e4c6 commit cb02a25

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

‎include/net/bluetooth/l2cap.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
#define L2CAP_INFO_TIMEOUT msecs_to_jiffies(4000)
5656
#define L2CAP_MOVE_TIMEOUT msecs_to_jiffies(4000)
5757
#define L2CAP_MOVE_ERTX_TIMEOUT msecs_to_jiffies(60000)
58+
#define L2CAP_WAIT_ACK_POLL_PERIOD msecs_to_jiffies(200)
5859

5960
#define L2CAP_A2MP_DEFAULT_MTU 670
6061

‎net/bluetooth/l2cap_sock.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,15 +1058,15 @@ static int __l2cap_wait_ack(struct sock *sk, struct l2cap_chan *chan)
10581058
{
10591059
DECLARE_WAITQUEUE(wait, current);
10601060
int err = 0;
1061-
int timeo = HZ/5;
1061+
int timeo = L2CAP_WAIT_ACK_POLL_PERIOD;
10621062

10631063
add_wait_queue(sk_sleep(sk), &wait);
10641064
set_current_state(TASK_INTERRUPTIBLE);
10651065
do {
10661066
BT_DBG("Waiting for %d ACKs", chan->unacked_frames);
10671067

10681068
if (!timeo)
1069-
timeo = HZ/5;
1069+
timeo = L2CAP_WAIT_ACK_POLL_PERIOD;
10701070

10711071
if (signal_pending(current)) {
10721072
err = sock_intr_errno(timeo);

0 commit comments

Comments
 (0)