aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_request.c
diff options
context:
space:
mode:
authorŁukasz Rymanowski <lukasz.rymanowski@codecoup.pl>2018-02-09 12:26:02 -0500
committerMarcel Holtmann <marcel@holtmann.org>2018-02-10 12:37:29 -0500
commit62ebdc25c4002e5fc104ab536ce7d99ba76be03f (patch)
tree34a7bbf33dbc1a4640dabe3048aab847a1649c04 /net/bluetooth/hci_request.c
parent06633ee14d5c9bff3b46be67be2824138c75594a (diff)
Bluetooth: Fix incorrect bits for LE states
This patch fixes incorrect checks for LE states. Issues found when doing mgmt tests for scenario when Linux Kernel should do connectable advertising while connected. Signed-off-by: Łukasz Rymanowski <lukasz.rymanowski@codecoup.pl> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/hci_request.c')
-rw-r--r--net/bluetooth/hci_request.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/bluetooth/hci_request.c b/net/bluetooth/hci_request.c
index 3394e6791673..66c0781773df 100644
--- a/net/bluetooth/hci_request.c
+++ b/net/bluetooth/hci_request.c
@@ -934,8 +934,8 @@ static bool is_advertising_allowed(struct hci_dev *hdev, bool connectable)
934 /* Slave connection state and connectable mode bit 38 934 /* Slave connection state and connectable mode bit 38
935 * and scannable bit 21. 935 * and scannable bit 21.
936 */ 936 */
937 if (connectable && (!(hdev->le_states[4] & 0x01) || 937 if (connectable && (!(hdev->le_states[4] & 0x40) ||
938 !(hdev->le_states[2] & 0x40))) 938 !(hdev->le_states[2] & 0x20)))
939 return false; 939 return false;
940 } 940 }
941 941
@@ -948,7 +948,7 @@ static bool is_advertising_allowed(struct hci_dev *hdev, bool connectable)
948 /* Master connection state and connectable mode bit 35 and 948 /* Master connection state and connectable mode bit 35 and
949 * scannable 19. 949 * scannable 19.
950 */ 950 */
951 if (connectable && (!(hdev->le_states[4] & 0x10) || 951 if (connectable && (!(hdev->le_states[4] & 0x08) ||
952 !(hdev->le_states[2] & 0x08))) 952 !(hdev->le_states[2] & 0x08)))
953 return false; 953 return false;
954 } 954 }