Bluetooth: hci_check_conn_params() check proper range
authorSeungyoun Ju <sy39.ju@samsung.com>
Mon, 13 Jul 2015 08:28:13 +0000 (17:28 +0900)
committerMarcel Holtmann <marcel@holtmann.org>
Thu, 23 Jul 2015 15:10:51 +0000 (17:10 +0200)
Slave latency range has been changed in Core Spec. 4.2 by Erratum 5419
of ESR08_V1.0.0. And it should be applied to Core Spec. 4.0 and 4.1.

Before:
   connSlaveLatency <= ((connSupervisionTimeout / connIntervalMax) - 1)

After:
   connSlaveLatency <= ((connSupervisionTimeout / (connIntervalMax*2)) - 1)

This patch makes hci_check_conn_params() check the allowable slave
latency range using the changed way.

Signed-off-by: Seungyoun Ju <sy39.ju@samsung.com>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
include/net/bluetooth/hci_core.h

index 3bd618d3e55dcf8735fb878a1d59bc8cf18bcc2d..2a6b0919e23f71af5f4660fce0a349bfa09b2fd9 100644 (file)
@@ -1297,7 +1297,7 @@ static inline int hci_check_conn_params(u16 min, u16 max, u16 latency,
        if (max >= to_multiplier * 8)
                return -EINVAL;
 
-       max_latency = (to_multiplier * 8 / max) - 1;
+       max_latency = (to_multiplier * 4 / max) - 1;
        if (latency > 499 || latency > max_latency)
                return -EINVAL;
 
This page took 0.025366 seconds and 5 git commands to generate.