diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2013-10-19 01:38:09 +0200 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2013-10-19 15:28:06 +0200 |
commit | 79830f66e3cbd224bcf697b032dce9828b5a3c9e (patch) | |
tree | 420c67d76a63acee3b8996d36683325e5fc6cb32 /net/bluetooth/mgmt.c | |
parent | Bluetooth: Expose current list of long term keys via debugfs (diff) | |
download | linux-79830f66e3cbd224bcf697b032dce9828b5a3c9e.tar.xz linux-79830f66e3cbd224bcf697b032dce9828b5a3c9e.zip |
Bluetooth: Select the own address type during initial setup phase
The own address type is based on the fact if the controller has
a public address or not. This means that this detail can be just
configured once during setup phase.
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net/bluetooth/mgmt.c')
-rw-r--r-- | net/bluetooth/mgmt.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index a727b47fcac5..fb7fc9f17af1 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c @@ -1325,10 +1325,7 @@ static void enable_advertising(struct hci_request *req) cp.min_interval = __constant_cpu_to_le16(0x0800); cp.max_interval = __constant_cpu_to_le16(0x0800); cp.type = get_adv_type(hdev); - if (bacmp(&hdev->bdaddr, BDADDR_ANY)) - cp.own_address_type = ADDR_LE_DEV_PUBLIC; - else - cp.own_address_type = ADDR_LE_DEV_RANDOM; + cp.own_address_type = hdev->own_addr_type; cp.channel_map = 0x07; hci_req_add(req, HCI_OP_LE_SET_ADV_PARAM, sizeof(cp), &cp); @@ -3237,10 +3234,7 @@ static int start_discovery(struct sock *sk, struct hci_dev *hdev, param_cp.type = LE_SCAN_ACTIVE; param_cp.interval = cpu_to_le16(DISCOV_LE_SCAN_INT); param_cp.window = cpu_to_le16(DISCOV_LE_SCAN_WIN); - if (bacmp(&hdev->bdaddr, BDADDR_ANY)) - param_cp.own_address_type = ADDR_LE_DEV_PUBLIC; - else - param_cp.own_address_type = ADDR_LE_DEV_RANDOM; + param_cp.own_address_type = hdev->own_addr_type; hci_req_add(&req, HCI_OP_LE_SET_SCAN_PARAM, sizeof(param_cp), ¶m_cp); |