diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2013-10-05 06:01:04 -0400 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2013-10-05 06:03:38 -0400 |
commit | f3d3444a4d7f76e79841c59c78105a45295cc4b0 (patch) | |
tree | b23d78feebc363b6b028fd366cde3b618f706d20 /net/bluetooth/mgmt.c | |
parent | 46a190cbd3d8992a017664367e9227dcd357ce53 (diff) |
Bluetooth: Rename HCI_LE_PERIPHERAL to HCI_ADVERTISING
This flag is used to indicate whether we want to have advertising
enabled or not, so give it a more suitable name.
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.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index 16125ff918f1..7e43d376e2e6 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c | |||
@@ -425,7 +425,7 @@ static u32 get_current_settings(struct hci_dev *hdev) | |||
425 | if (test_bit(HCI_HS_ENABLED, &hdev->dev_flags)) | 425 | if (test_bit(HCI_HS_ENABLED, &hdev->dev_flags)) |
426 | settings |= MGMT_SETTING_HS; | 426 | settings |= MGMT_SETTING_HS; |
427 | 427 | ||
428 | if (test_bit(HCI_LE_PERIPHERAL, &hdev->dev_flags)) | 428 | if (test_bit(HCI_ADVERTISING, &hdev->dev_flags)) |
429 | settings |= MGMT_SETTING_ADVERTISING; | 429 | settings |= MGMT_SETTING_ADVERTISING; |
430 | 430 | ||
431 | return settings; | 431 | return settings; |
@@ -1463,8 +1463,8 @@ static int set_le(struct sock *sk, struct hci_dev *hdev, void *data, u16 len) | |||
1463 | changed = true; | 1463 | changed = true; |
1464 | } | 1464 | } |
1465 | 1465 | ||
1466 | if (!val && test_bit(HCI_LE_PERIPHERAL, &hdev->dev_flags)) { | 1466 | if (!val && test_bit(HCI_ADVERTISING, &hdev->dev_flags)) { |
1467 | clear_bit(HCI_LE_PERIPHERAL, &hdev->dev_flags); | 1467 | clear_bit(HCI_ADVERTISING, &hdev->dev_flags); |
1468 | changed = true; | 1468 | changed = true; |
1469 | } | 1469 | } |
1470 | 1470 | ||
@@ -1500,7 +1500,7 @@ static int set_le(struct sock *sk, struct hci_dev *hdev, void *data, u16 len) | |||
1500 | 1500 | ||
1501 | hci_req_init(&req, hdev); | 1501 | hci_req_init(&req, hdev); |
1502 | 1502 | ||
1503 | if (test_bit(HCI_LE_PERIPHERAL, &hdev->dev_flags) && !val) | 1503 | if (test_bit(HCI_ADVERTISING, &hdev->dev_flags) && !val) |
1504 | hci_req_add(&req, HCI_OP_LE_SET_ADV_ENABLE, sizeof(val), &val); | 1504 | hci_req_add(&req, HCI_OP_LE_SET_ADV_ENABLE, sizeof(val), &val); |
1505 | 1505 | ||
1506 | hci_req_add(&req, HCI_OP_WRITE_LE_HOST_SUPPORTED, sizeof(hci_cp), | 1506 | hci_req_add(&req, HCI_OP_WRITE_LE_HOST_SUPPORTED, sizeof(hci_cp), |
@@ -2888,7 +2888,7 @@ static int start_discovery(struct sock *sk, struct hci_dev *hdev, | |||
2888 | goto failed; | 2888 | goto failed; |
2889 | } | 2889 | } |
2890 | 2890 | ||
2891 | if (test_bit(HCI_LE_PERIPHERAL, &hdev->dev_flags)) { | 2891 | if (test_bit(HCI_ADVERTISING, &hdev->dev_flags)) { |
2892 | err = cmd_status(sk, hdev->id, MGMT_OP_START_DISCOVERY, | 2892 | err = cmd_status(sk, hdev->id, MGMT_OP_START_DISCOVERY, |
2893 | MGMT_STATUS_REJECTED); | 2893 | MGMT_STATUS_REJECTED); |
2894 | mgmt_pending_remove(cmd); | 2894 | mgmt_pending_remove(cmd); |
@@ -3236,13 +3236,13 @@ static int set_advertising(struct sock *sk, struct hci_dev *hdev, void *data, u1 | |||
3236 | hci_dev_lock(hdev); | 3236 | hci_dev_lock(hdev); |
3237 | 3237 | ||
3238 | val = !!cp->val; | 3238 | val = !!cp->val; |
3239 | enabled = test_bit(HCI_LE_PERIPHERAL, &hdev->dev_flags); | 3239 | enabled = test_bit(HCI_ADVERTISING, &hdev->dev_flags); |
3240 | 3240 | ||
3241 | if (!hdev_is_powered(hdev) || val == enabled) { | 3241 | if (!hdev_is_powered(hdev) || val == enabled) { |
3242 | bool changed = false; | 3242 | bool changed = false; |
3243 | 3243 | ||
3244 | if (val != test_bit(HCI_LE_PERIPHERAL, &hdev->dev_flags)) { | 3244 | if (val != test_bit(HCI_ADVERTISING, &hdev->dev_flags)) { |
3245 | change_bit(HCI_LE_PERIPHERAL, &hdev->dev_flags); | 3245 | change_bit(HCI_ADVERTISING, &hdev->dev_flags); |
3246 | changed = true; | 3246 | changed = true; |
3247 | } | 3247 | } |
3248 | 3248 | ||
@@ -3851,7 +3851,7 @@ static int powered_update_hci(struct hci_dev *hdev) | |||
3851 | &hdev->static_addr); | 3851 | &hdev->static_addr); |
3852 | } | 3852 | } |
3853 | 3853 | ||
3854 | if (test_bit(HCI_LE_PERIPHERAL, &hdev->dev_flags)) { | 3854 | if (test_bit(HCI_ADVERTISING, &hdev->dev_flags)) { |
3855 | u8 adv = 0x01; | 3855 | u8 adv = 0x01; |
3856 | 3856 | ||
3857 | hci_req_add(&req, HCI_OP_LE_SET_ADV_ENABLE, sizeof(adv), &adv); | 3857 | hci_req_add(&req, HCI_OP_LE_SET_ADV_ENABLE, sizeof(adv), &adv); |