|
@@ -189,13 +189,14 @@ static void hci_debugfs_create_basic(struct hci_dev *hdev)
|
|
&vendor_diag_fops);
|
|
&vendor_diag_fops);
|
|
}
|
|
}
|
|
|
|
|
|
-static void hci_reset_req(struct hci_request *req, unsigned long opt)
|
|
|
|
|
|
+static int hci_reset_req(struct hci_request *req, unsigned long opt)
|
|
{
|
|
{
|
|
BT_DBG("%s %ld", req->hdev->name, opt);
|
|
BT_DBG("%s %ld", req->hdev->name, opt);
|
|
|
|
|
|
/* Reset device */
|
|
/* Reset device */
|
|
set_bit(HCI_RESET, &req->hdev->flags);
|
|
set_bit(HCI_RESET, &req->hdev->flags);
|
|
hci_req_add(req, HCI_OP_RESET, 0, NULL);
|
|
hci_req_add(req, HCI_OP_RESET, 0, NULL);
|
|
|
|
+ return 0;
|
|
}
|
|
}
|
|
|
|
|
|
static void bredr_init(struct hci_request *req)
|
|
static void bredr_init(struct hci_request *req)
|
|
@@ -235,7 +236,7 @@ static void amp_init1(struct hci_request *req)
|
|
hci_req_add(req, HCI_OP_READ_LOCATION_DATA, 0, NULL);
|
|
hci_req_add(req, HCI_OP_READ_LOCATION_DATA, 0, NULL);
|
|
}
|
|
}
|
|
|
|
|
|
-static void amp_init2(struct hci_request *req)
|
|
|
|
|
|
+static int amp_init2(struct hci_request *req)
|
|
{
|
|
{
|
|
/* Read Local Supported Features. Not all AMP controllers
|
|
/* Read Local Supported Features. Not all AMP controllers
|
|
* support this so it's placed conditionally in the second
|
|
* support this so it's placed conditionally in the second
|
|
@@ -243,9 +244,11 @@ static void amp_init2(struct hci_request *req)
|
|
*/
|
|
*/
|
|
if (req->hdev->commands[14] & 0x20)
|
|
if (req->hdev->commands[14] & 0x20)
|
|
hci_req_add(req, HCI_OP_READ_LOCAL_FEATURES, 0, NULL);
|
|
hci_req_add(req, HCI_OP_READ_LOCAL_FEATURES, 0, NULL);
|
|
|
|
+
|
|
|
|
+ return 0;
|
|
}
|
|
}
|
|
|
|
|
|
-static void hci_init1_req(struct hci_request *req, unsigned long opt)
|
|
|
|
|
|
+static int hci_init1_req(struct hci_request *req, unsigned long opt)
|
|
{
|
|
{
|
|
struct hci_dev *hdev = req->hdev;
|
|
struct hci_dev *hdev = req->hdev;
|
|
|
|
|
|
@@ -268,6 +271,8 @@ static void hci_init1_req(struct hci_request *req, unsigned long opt)
|
|
BT_ERR("Unknown device type %d", hdev->dev_type);
|
|
BT_ERR("Unknown device type %d", hdev->dev_type);
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ return 0;
|
|
}
|
|
}
|
|
|
|
|
|
static void bredr_setup(struct hci_request *req)
|
|
static void bredr_setup(struct hci_request *req)
|
|
@@ -416,7 +421,7 @@ static void hci_setup_event_mask(struct hci_request *req)
|
|
hci_req_add(req, HCI_OP_SET_EVENT_MASK, sizeof(events), events);
|
|
hci_req_add(req, HCI_OP_SET_EVENT_MASK, sizeof(events), events);
|
|
}
|
|
}
|
|
|
|
|
|
-static void hci_init2_req(struct hci_request *req, unsigned long opt)
|
|
|
|
|
|
+static int hci_init2_req(struct hci_request *req, unsigned long opt)
|
|
{
|
|
{
|
|
struct hci_dev *hdev = req->hdev;
|
|
struct hci_dev *hdev = req->hdev;
|
|
|
|
|
|
@@ -496,6 +501,8 @@ static void hci_init2_req(struct hci_request *req, unsigned long opt)
|
|
hci_req_add(req, HCI_OP_WRITE_AUTH_ENABLE, sizeof(enable),
|
|
hci_req_add(req, HCI_OP_WRITE_AUTH_ENABLE, sizeof(enable),
|
|
&enable);
|
|
&enable);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ return 0;
|
|
}
|
|
}
|
|
|
|
|
|
static void hci_setup_link_policy(struct hci_request *req)
|
|
static void hci_setup_link_policy(struct hci_request *req)
|
|
@@ -570,7 +577,7 @@ static void hci_set_event_mask_page_2(struct hci_request *req)
|
|
hci_req_add(req, HCI_OP_SET_EVENT_MASK_PAGE_2, sizeof(events), events);
|
|
hci_req_add(req, HCI_OP_SET_EVENT_MASK_PAGE_2, sizeof(events), events);
|
|
}
|
|
}
|
|
|
|
|
|
-static void hci_init3_req(struct hci_request *req, unsigned long opt)
|
|
|
|
|
|
+static int hci_init3_req(struct hci_request *req, unsigned long opt)
|
|
{
|
|
{
|
|
struct hci_dev *hdev = req->hdev;
|
|
struct hci_dev *hdev = req->hdev;
|
|
u8 p;
|
|
u8 p;
|
|
@@ -709,9 +716,11 @@ static void hci_init3_req(struct hci_request *req, unsigned long opt)
|
|
hci_req_add(req, HCI_OP_READ_LOCAL_EXT_FEATURES,
|
|
hci_req_add(req, HCI_OP_READ_LOCAL_EXT_FEATURES,
|
|
sizeof(cp), &cp);
|
|
sizeof(cp), &cp);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ return 0;
|
|
}
|
|
}
|
|
|
|
|
|
-static void hci_init4_req(struct hci_request *req, unsigned long opt)
|
|
|
|
|
|
+static int hci_init4_req(struct hci_request *req, unsigned long opt)
|
|
{
|
|
{
|
|
struct hci_dev *hdev = req->hdev;
|
|
struct hci_dev *hdev = req->hdev;
|
|
|
|
|
|
@@ -762,6 +771,8 @@ static void hci_init4_req(struct hci_request *req, unsigned long opt)
|
|
hci_req_add(req, HCI_OP_WRITE_SC_SUPPORT,
|
|
hci_req_add(req, HCI_OP_WRITE_SC_SUPPORT,
|
|
sizeof(support), &support);
|
|
sizeof(support), &support);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ return 0;
|
|
}
|
|
}
|
|
|
|
|
|
static int __hci_init(struct hci_dev *hdev)
|
|
static int __hci_init(struct hci_dev *hdev)
|
|
@@ -821,7 +832,7 @@ static int __hci_init(struct hci_dev *hdev)
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
-static void hci_init0_req(struct hci_request *req, unsigned long opt)
|
|
|
|
|
|
+static int hci_init0_req(struct hci_request *req, unsigned long opt)
|
|
{
|
|
{
|
|
struct hci_dev *hdev = req->hdev;
|
|
struct hci_dev *hdev = req->hdev;
|
|
|
|
|
|
@@ -837,6 +848,8 @@ static void hci_init0_req(struct hci_request *req, unsigned long opt)
|
|
/* Read BD Address */
|
|
/* Read BD Address */
|
|
if (hdev->set_bdaddr)
|
|
if (hdev->set_bdaddr)
|
|
hci_req_add(req, HCI_OP_READ_BD_ADDR, 0, NULL);
|
|
hci_req_add(req, HCI_OP_READ_BD_ADDR, 0, NULL);
|
|
|
|
+
|
|
|
|
+ return 0;
|
|
}
|
|
}
|
|
|
|
|
|
static int __hci_unconf_init(struct hci_dev *hdev)
|
|
static int __hci_unconf_init(struct hci_dev *hdev)
|
|
@@ -856,7 +869,7 @@ static int __hci_unconf_init(struct hci_dev *hdev)
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
-static void hci_scan_req(struct hci_request *req, unsigned long opt)
|
|
|
|
|
|
+static int hci_scan_req(struct hci_request *req, unsigned long opt)
|
|
{
|
|
{
|
|
__u8 scan = opt;
|
|
__u8 scan = opt;
|
|
|
|
|
|
@@ -864,9 +877,10 @@ static void hci_scan_req(struct hci_request *req, unsigned long opt)
|
|
|
|
|
|
/* Inquiry and Page scans */
|
|
/* Inquiry and Page scans */
|
|
hci_req_add(req, HCI_OP_WRITE_SCAN_ENABLE, 1, &scan);
|
|
hci_req_add(req, HCI_OP_WRITE_SCAN_ENABLE, 1, &scan);
|
|
|
|
+ return 0;
|
|
}
|
|
}
|
|
|
|
|
|
-static void hci_auth_req(struct hci_request *req, unsigned long opt)
|
|
|
|
|
|
+static int hci_auth_req(struct hci_request *req, unsigned long opt)
|
|
{
|
|
{
|
|
__u8 auth = opt;
|
|
__u8 auth = opt;
|
|
|
|
|
|
@@ -874,9 +888,10 @@ static void hci_auth_req(struct hci_request *req, unsigned long opt)
|
|
|
|
|
|
/* Authentication */
|
|
/* Authentication */
|
|
hci_req_add(req, HCI_OP_WRITE_AUTH_ENABLE, 1, &auth);
|
|
hci_req_add(req, HCI_OP_WRITE_AUTH_ENABLE, 1, &auth);
|
|
|
|
+ return 0;
|
|
}
|
|
}
|
|
|
|
|
|
-static void hci_encrypt_req(struct hci_request *req, unsigned long opt)
|
|
|
|
|
|
+static int hci_encrypt_req(struct hci_request *req, unsigned long opt)
|
|
{
|
|
{
|
|
__u8 encrypt = opt;
|
|
__u8 encrypt = opt;
|
|
|
|
|
|
@@ -884,9 +899,10 @@ static void hci_encrypt_req(struct hci_request *req, unsigned long opt)
|
|
|
|
|
|
/* Encryption */
|
|
/* Encryption */
|
|
hci_req_add(req, HCI_OP_WRITE_ENCRYPT_MODE, 1, &encrypt);
|
|
hci_req_add(req, HCI_OP_WRITE_ENCRYPT_MODE, 1, &encrypt);
|
|
|
|
+ return 0;
|
|
}
|
|
}
|
|
|
|
|
|
-static void hci_linkpol_req(struct hci_request *req, unsigned long opt)
|
|
|
|
|
|
+static int hci_linkpol_req(struct hci_request *req, unsigned long opt)
|
|
{
|
|
{
|
|
__le16 policy = cpu_to_le16(opt);
|
|
__le16 policy = cpu_to_le16(opt);
|
|
|
|
|
|
@@ -894,6 +910,7 @@ static void hci_linkpol_req(struct hci_request *req, unsigned long opt)
|
|
|
|
|
|
/* Default link policy */
|
|
/* Default link policy */
|
|
hci_req_add(req, HCI_OP_WRITE_DEF_LINK_POLICY, 2, &policy);
|
|
hci_req_add(req, HCI_OP_WRITE_DEF_LINK_POLICY, 2, &policy);
|
|
|
|
+ return 0;
|
|
}
|
|
}
|
|
|
|
|
|
/* Get HCI device by index.
|
|
/* Get HCI device by index.
|
|
@@ -1138,7 +1155,7 @@ static int inquiry_cache_dump(struct hci_dev *hdev, int num, __u8 *buf)
|
|
return copied;
|
|
return copied;
|
|
}
|
|
}
|
|
|
|
|
|
-static void hci_inq_req(struct hci_request *req, unsigned long opt)
|
|
|
|
|
|
+static int hci_inq_req(struct hci_request *req, unsigned long opt)
|
|
{
|
|
{
|
|
struct hci_inquiry_req *ir = (struct hci_inquiry_req *) opt;
|
|
struct hci_inquiry_req *ir = (struct hci_inquiry_req *) opt;
|
|
struct hci_dev *hdev = req->hdev;
|
|
struct hci_dev *hdev = req->hdev;
|
|
@@ -1147,13 +1164,15 @@ static void hci_inq_req(struct hci_request *req, unsigned long opt)
|
|
BT_DBG("%s", hdev->name);
|
|
BT_DBG("%s", hdev->name);
|
|
|
|
|
|
if (test_bit(HCI_INQUIRY, &hdev->flags))
|
|
if (test_bit(HCI_INQUIRY, &hdev->flags))
|
|
- return;
|
|
|
|
|
|
+ return 0;
|
|
|
|
|
|
/* Start Inquiry */
|
|
/* Start Inquiry */
|
|
memcpy(&cp.lap, &ir->lap, 3);
|
|
memcpy(&cp.lap, &ir->lap, 3);
|
|
cp.length = ir->length;
|
|
cp.length = ir->length;
|
|
cp.num_rsp = ir->num_rsp;
|
|
cp.num_rsp = ir->num_rsp;
|
|
hci_req_add(req, HCI_OP_INQUIRY, sizeof(cp), &cp);
|
|
hci_req_add(req, HCI_OP_INQUIRY, sizeof(cp), &cp);
|
|
|
|
+
|
|
|
|
+ return 0;
|
|
}
|
|
}
|
|
|
|
|
|
int hci_inquiry(void __user *arg)
|
|
int hci_inquiry(void __user *arg)
|