aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/mgmt.c
diff options
context:
space:
mode:
authorAndre Guedes <andre.guedes@openbossa.org>2011-11-07 09:45:24 -0500
committerGustavo F. Padovan <padovan@profusion.mobi>2011-11-08 09:54:07 -0500
commit2519a1fc82490eb13d69610f81fe84930f3b0e3f (patch)
treebc6093f6109b512e82063665d5d80359c2d21c08 /net/bluetooth/mgmt.c
parent66af7aaf9edff55b7995bbe1ff508513666d0671 (diff)
Bluetooth: Create hci_do_inquiry()
This patch adds a function to hci_core to carry out inquiry. All inquiry code from start_discovery() were replaced by a hci_do_inquiry() call. Signed-off-by: Andre Guedes <andre.guedes@openbossa.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'net/bluetooth/mgmt.c')
-rw-r--r--net/bluetooth/mgmt.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 747366a1f23c..17c7fbbc1210 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -32,6 +32,8 @@
32#define MGMT_VERSION 0 32#define MGMT_VERSION 0
33#define MGMT_REVISION 1 33#define MGMT_REVISION 1
34 34
35#define INQUIRY_LEN_BREDR 0x08 /* TGAP(100) */
36
35struct pending_cmd { 37struct pending_cmd {
36 struct list_head list; 38 struct list_head list;
37 __u16 opcode; 39 __u16 opcode;
@@ -1598,8 +1600,6 @@ static int remove_remote_oob_data(struct sock *sk, u16 index,
1598 1600
1599static int start_discovery(struct sock *sk, u16 index) 1601static int start_discovery(struct sock *sk, u16 index)
1600{ 1602{
1601 u8 lap[3] = { 0x33, 0x8b, 0x9e };
1602 struct hci_cp_inquiry cp;
1603 struct pending_cmd *cmd; 1603 struct pending_cmd *cmd;
1604 struct hci_dev *hdev; 1604 struct hci_dev *hdev;
1605 int err; 1605 int err;
@@ -1618,12 +1618,7 @@ static int start_discovery(struct sock *sk, u16 index)
1618 goto failed; 1618 goto failed;
1619 } 1619 }
1620 1620
1621 memset(&cp, 0, sizeof(cp)); 1621 err = hci_do_inquiry(hdev, INQUIRY_LEN_BREDR);
1622 memcpy(&cp.lap, lap, 3);
1623 cp.length = 0x08;
1624 cp.num_rsp = 0x00;
1625
1626 err = hci_send_cmd(hdev, HCI_OP_INQUIRY, sizeof(cp), &cp);
1627 if (err < 0) 1622 if (err < 0)
1628 mgmt_pending_remove(cmd); 1623 mgmt_pending_remove(cmd);
1629 1624