summaryrefslogtreecommitdiff
path: root/net/bluetooth
diff options
context:
space:
mode:
authorAndre Guedes <andre.guedes@openbossa.org>2013-04-30 18:29:31 (GMT)
committerGustavo Padovan <gustavo.padovan@collabora.co.uk>2013-06-22 23:23:50 (GMT)
commit0d8cc935e01c0fd1312a10881f4c0f1c4b4d05ab (patch)
treee31ae2647fc8f61d2709beb2bd0f508538b9be35 /net/bluetooth
parent41dc2bd6d13bfccc34d05586be2eb65876a5990a (diff)
downloadlinux-0d8cc935e01c0fd1312a10881f4c0f1c4b4d05ab.tar.xz
Bluetooth: Move discovery macros to hci_core.h
Some of discovery macros will be used in hci_core so we need to define them in common place such as hci_core.h. Thus, this patch moves discovery macros to hci_core.h and also adds the DISCOV_ prefix to them. Signed-off-by: Andre Guedes <andre.guedes@openbossa.org> Acked-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Diffstat (limited to 'net/bluetooth')
-rw-r--r--net/bluetooth/mgmt.c24
1 files changed, 6 insertions, 18 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index a9bd271..6b31e93 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -102,18 +102,6 @@ static const u16 mgmt_events[] = {
MGMT_EV_PASSKEY_NOTIFY,
};
-/*
- * These LE scan and inquiry parameters were chosen according to LE General
- * Discovery Procedure specification.
- */
-#define LE_SCAN_WIN 0x12
-#define LE_SCAN_INT 0x12
-#define LE_SCAN_TIMEOUT_LE_ONLY msecs_to_jiffies(10240)
-#define LE_SCAN_TIMEOUT_BREDR_LE msecs_to_jiffies(5120)
-
-#define INQUIRY_LEN_BREDR 0x08 /* TGAP(100) */
-#define INQUIRY_LEN_BREDR_LE 0x04 /* TGAP(100)/2 */
-
#define CACHE_TIMEOUT msecs_to_jiffies(2 * 1000)
#define hdev_is_powered(hdev) (test_bit(HCI_UP, &hdev->flags) && \
@@ -2641,7 +2629,7 @@ int mgmt_interleaved_discovery(struct hci_dev *hdev)
hci_dev_lock(hdev);
- err = hci_do_inquiry(hdev, INQUIRY_LEN_BREDR_LE);
+ err = hci_do_inquiry(hdev, DISCOV_INTERLEAVED_INQUIRY_LEN);
if (err < 0)
hci_discovery_set_state(hdev, DISCOVERY_STOPPED);
@@ -2689,12 +2677,12 @@ static void start_discovery_complete(struct hci_dev *hdev, u8 status)
switch (hdev->discovery.type) {
case DISCOV_TYPE_LE:
queue_delayed_work(hdev->workqueue, &hdev->le_scan_disable,
- LE_SCAN_TIMEOUT_LE_ONLY);
+ DISCOV_LE_TIMEOUT);
break;
case DISCOV_TYPE_INTERLEAVED:
queue_delayed_work(hdev->workqueue, &hdev->le_scan_disable,
- LE_SCAN_TIMEOUT_BREDR_LE);
+ DISCOV_INTERLEAVED_TIMEOUT);
break;
case DISCOV_TYPE_BREDR:
@@ -2770,7 +2758,7 @@ static int start_discovery(struct sock *sk, struct hci_dev *hdev,
memset(&inq_cp, 0, sizeof(inq_cp));
memcpy(&inq_cp.lap, lap, sizeof(inq_cp.lap));
- inq_cp.length = INQUIRY_LEN_BREDR;
+ inq_cp.length = DISCOV_BREDR_INQUIRY_LEN;
hci_req_add(&req, HCI_OP_INQUIRY, sizeof(inq_cp), &inq_cp);
break;
@@ -2807,8 +2795,8 @@ static int start_discovery(struct sock *sk, struct hci_dev *hdev,
memset(&param_cp, 0, sizeof(param_cp));
param_cp.type = LE_SCAN_ACTIVE;
- param_cp.interval = cpu_to_le16(LE_SCAN_INT);
- param_cp.window = cpu_to_le16(LE_SCAN_WIN);
+ param_cp.interval = cpu_to_le16(DISCOV_LE_SCAN_INT);
+ param_cp.window = cpu_to_le16(DISCOV_LE_SCAN_WIN);
hci_req_add(&req, HCI_OP_LE_SET_SCAN_PARAM, sizeof(param_cp),
&param_cp);