diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2014-07-01 08:11:20 -0400 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2014-07-03 11:42:53 -0400 |
commit | af58925ca6175695e502fa792f43a946f7474765 (patch) | |
tree | f0e50a2398cbf7a2f04ccb4d2be9115d1ed310fa /net/bluetooth/mgmt.c | |
parent | 42bd6a56ed1ab4b2cb50f4d4e674874da9b47f46 (diff) |
Bluetooth: Provide flags parameter direct to mgmt_device_found
Providing the flags parameter directly to mgmt_device_found function
makes the core simpler and more readable. With this it becomes a lot
easier to add new flags in the future.
This also changes hci_inquiry_cache_update to just return that flags
needed for mgmt_device_found since that is its only use for the two
return parameters anyway.
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, 3 insertions, 7 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index c6e9b551242b..336a2311bdca 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c | |||
@@ -6233,9 +6233,8 @@ void mgmt_read_local_oob_data_complete(struct hci_dev *hdev, u8 *hash192, | |||
6233 | } | 6233 | } |
6234 | 6234 | ||
6235 | void mgmt_device_found(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, | 6235 | void mgmt_device_found(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, |
6236 | u8 addr_type, u8 *dev_class, s8 rssi, u8 cfm_name, | 6236 | u8 addr_type, u8 *dev_class, s8 rssi, u32 flags, |
6237 | u8 ssp, u8 *eir, u16 eir_len, u8 *scan_rsp, | 6237 | u8 *eir, u16 eir_len, u8 *scan_rsp, u8 scan_rsp_len) |
6238 | u8 scan_rsp_len) | ||
6239 | { | 6238 | { |
6240 | char buf[512]; | 6239 | char buf[512]; |
6241 | struct mgmt_ev_device_found *ev = (void *) buf; | 6240 | struct mgmt_ev_device_found *ev = (void *) buf; |
@@ -6263,10 +6262,7 @@ void mgmt_device_found(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, | |||
6263 | } | 6262 | } |
6264 | 6263 | ||
6265 | ev->rssi = rssi; | 6264 | ev->rssi = rssi; |
6266 | if (cfm_name) | 6265 | ev->flags = cpu_to_le32(flags); |
6267 | ev->flags |= cpu_to_le32(MGMT_DEV_FOUND_CONFIRM_NAME); | ||
6268 | if (!ssp) | ||
6269 | ev->flags |= cpu_to_le32(MGMT_DEV_FOUND_LEGACY_PAIRING); | ||
6270 | 6266 | ||
6271 | if (eir_len > 0) | 6267 | if (eir_len > 0) |
6272 | memcpy(ev->eir, eir, eir_len); | 6268 | memcpy(ev->eir, eir, eir_len); |