]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Bluetooth: HCI name update to hci_request.c
authorJohan Hedberg <johan.hedberg@intel.com>
Wed, 25 Nov 2015 14:15:41 +0000 (16:15 +0200)
committerMarcel Holtmann <marcel@holtmann.org>
Wed, 9 Dec 2015 23:51:48 +0000 (00:51 +0100)
We'll soon need this both from hci_request.c and mgmt.c so move it as
a request helper function to hci_request.c.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
net/bluetooth/hci_request.c
net/bluetooth/hci_request.h
net/bluetooth/mgmt.c

index fe14fd121d367e55f0d4485c489123399efe46ae..3150461c52a4c344c5ac5a288fca6fc0301ae4ed 100644 (file)
@@ -420,6 +420,16 @@ static void __hci_update_background_scan(struct hci_request *req)
        }
 }
 
+void __hci_req_update_name(struct hci_request *req)
+{
+       struct hci_dev *hdev = req->hdev;
+       struct hci_cp_write_local_name cp;
+
+       memcpy(cp.name, hdev->dev_name, sizeof(cp.name));
+
+       hci_req_add(req, HCI_OP_WRITE_LOCAL_NAME, sizeof(cp), &cp);
+}
+
 void hci_req_add_le_scan_disable(struct hci_request *req)
 {
        struct hci_cp_le_set_scan_enable cp;
index 41920348d68bf12ad4ac836c560a5f7e9aac6779..4e65a9c7906a90ba89e5ecda02d3ee75fb53f6bf 100644 (file)
@@ -55,6 +55,8 @@ void hci_req_sync_cancel(struct hci_dev *hdev, int err);
 struct sk_buff *hci_prepare_cmd(struct hci_dev *hdev, u16 opcode, u32 plen,
                                const void *param);
 
+void __hci_req_update_name(struct hci_request *req);
+
 void hci_req_add_le_scan_disable(struct hci_request *req);
 void hci_req_add_le_passive_scan(struct hci_request *req);
 
index 29b3bb70ae9f39f48d6cc75bfcb88d6f2c695b6e..001a29a320e6db3a9026b9ec8a09f4da7511484e 100644 (file)
@@ -3153,16 +3153,6 @@ static int user_passkey_neg_reply(struct sock *sk, struct hci_dev *hdev,
                                 HCI_OP_USER_PASSKEY_NEG_REPLY, 0);
 }
 
-static void update_name(struct hci_request *req)
-{
-       struct hci_dev *hdev = req->hdev;
-       struct hci_cp_write_local_name cp;
-
-       memcpy(cp.name, hdev->dev_name, sizeof(cp.name));
-
-       hci_req_add(req, HCI_OP_WRITE_LOCAL_NAME, sizeof(cp), &cp);
-}
-
 static void set_name_complete(struct hci_dev *hdev, u8 status, u16 opcode)
 {
        struct mgmt_cp_set_local_name *cp;
@@ -3241,7 +3231,7 @@ static int set_local_name(struct sock *sk, struct hci_dev *hdev, void *data,
        hci_req_init(&req, hdev);
 
        if (lmp_bredr_capable(hdev)) {
-               update_name(&req);
+               __hci_req_update_name(&req);
                update_eir(&req);
        }
 
@@ -6768,7 +6758,7 @@ static int powered_update_hci(struct hci_dev *hdev)
                        write_fast_connectable(&req, false);
                __hci_req_update_scan(&req);
                __hci_req_update_class(&req);
-               update_name(&req);
+               __hci_req_update_name(&req);
                update_eir(&req);
        }