aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/mgmt.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2013-10-14 09:20:06 -0400
committerMarcel Holtmann <marcel@holtmann.org>2013-10-14 09:48:08 -0400
commit95c66e75baf34024213a779dac08f95e6b5aa6a4 (patch)
tree7215e0c06cb104c22c72db00e339b0b494228a20 /net/bluetooth/mgmt.c
parent37438c1f7f6d26e1532d6bfc588c958b7dfae668 (diff)
Bluetooth: Move static advertising functions to avoid forward declarations
These functions will soon be used by set_connectable() so move them to a location in mgmt.c that doesn't require forward declarations. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/mgmt.c')
-rw-r--r--net/bluetooth/mgmt.c56
1 files changed, 28 insertions, 28 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index a5c015cadd55..caa552cf21f3 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -1072,6 +1072,34 @@ static void write_fast_connectable(struct hci_request *req, bool enable)
1072 hci_req_add(req, HCI_OP_WRITE_PAGE_SCAN_TYPE, 1, &type); 1072 hci_req_add(req, HCI_OP_WRITE_PAGE_SCAN_TYPE, 1, &type);
1073} 1073}
1074 1074
1075static void enable_advertising(struct hci_request *req)
1076{
1077 struct hci_dev *hdev = req->hdev;
1078 struct hci_cp_le_set_adv_param cp;
1079 u8 enable = 0x01;
1080
1081 memset(&cp, 0, sizeof(cp));
1082 cp.min_interval = __constant_cpu_to_le16(0x0800);
1083 cp.max_interval = __constant_cpu_to_le16(0x0800);
1084 cp.type = LE_ADV_IND;
1085 if (bacmp(&hdev->bdaddr, BDADDR_ANY))
1086 cp.own_address_type = ADDR_LE_DEV_PUBLIC;
1087 else
1088 cp.own_address_type = ADDR_LE_DEV_RANDOM;
1089 cp.channel_map = 0x07;
1090
1091 hci_req_add(req, HCI_OP_LE_SET_ADV_PARAM, sizeof(cp), &cp);
1092
1093 hci_req_add(req, HCI_OP_LE_SET_ADV_ENABLE, sizeof(enable), &enable);
1094}
1095
1096static void disable_advertising(struct hci_request *req)
1097{
1098 u8 enable = 0x00;
1099
1100 hci_req_add(req, HCI_OP_LE_SET_ADV_ENABLE, sizeof(enable), &enable);
1101}
1102
1075static void set_connectable_complete(struct hci_dev *hdev, u8 status) 1103static void set_connectable_complete(struct hci_dev *hdev, u8 status)
1076{ 1104{
1077 struct pending_cmd *cmd; 1105 struct pending_cmd *cmd;
@@ -1440,34 +1468,6 @@ unlock:
1440 return err; 1468 return err;
1441} 1469}
1442 1470
1443static void enable_advertising(struct hci_request *req)
1444{
1445 struct hci_dev *hdev = req->hdev;
1446 struct hci_cp_le_set_adv_param cp;
1447 u8 enable = 0x01;
1448
1449 memset(&cp, 0, sizeof(cp));
1450 cp.min_interval = __constant_cpu_to_le16(0x0800);
1451 cp.max_interval = __constant_cpu_to_le16(0x0800);
1452 cp.type = LE_ADV_IND;
1453 if (bacmp(&hdev->bdaddr, BDADDR_ANY))
1454 cp.own_address_type = ADDR_LE_DEV_PUBLIC;
1455 else
1456 cp.own_address_type = ADDR_LE_DEV_RANDOM;
1457 cp.channel_map = 0x07;
1458
1459 hci_req_add(req, HCI_OP_LE_SET_ADV_PARAM, sizeof(cp), &cp);
1460
1461 hci_req_add(req, HCI_OP_LE_SET_ADV_ENABLE, sizeof(enable), &enable);
1462}
1463
1464static void disable_advertising(struct hci_request *req)
1465{
1466 u8 enable = 0x00;
1467
1468 hci_req_add(req, HCI_OP_LE_SET_ADV_ENABLE, sizeof(enable), &enable);
1469}
1470
1471static void le_enable_complete(struct hci_dev *hdev, u8 status) 1471static void le_enable_complete(struct hci_dev *hdev, u8 status)
1472{ 1472{
1473 struct cmd_lookup match = { NULL, hdev }; 1473 struct cmd_lookup match = { NULL, hdev };