mgmt.c (5425f98e863ac5e4798a186475d4a8d95a2c08e8) | mgmt.c (72000df2c01d6927319ad7e3f43460f6d0227de5) |
---|---|
1/* 2 BlueZ - Bluetooth protocol stack for Linux 3 4 Copyright (C) 2010 Nokia Corporation 5 Copyright (C) 2011-2012 Intel Corporation 6 7 This program is free software; you can redistribute it and/or modify 8 it under the terms of the GNU General Public License version 2 as --- 119 unchanged lines hidden (view full) --- 128 MGMT_EV_DEVICE_ADDED, 129 MGMT_EV_DEVICE_REMOVED, 130 MGMT_EV_NEW_CONN_PARAM, 131 MGMT_EV_UNCONF_INDEX_ADDED, 132 MGMT_EV_UNCONF_INDEX_REMOVED, 133 MGMT_EV_NEW_CONFIG_OPTIONS, 134 MGMT_EV_EXT_INDEX_ADDED, 135 MGMT_EV_EXT_INDEX_REMOVED, | 1/* 2 BlueZ - Bluetooth protocol stack for Linux 3 4 Copyright (C) 2010 Nokia Corporation 5 Copyright (C) 2011-2012 Intel Corporation 6 7 This program is free software; you can redistribute it and/or modify 8 it under the terms of the GNU General Public License version 2 as --- 119 unchanged lines hidden (view full) --- 128 MGMT_EV_DEVICE_ADDED, 129 MGMT_EV_DEVICE_REMOVED, 130 MGMT_EV_NEW_CONN_PARAM, 131 MGMT_EV_UNCONF_INDEX_ADDED, 132 MGMT_EV_UNCONF_INDEX_REMOVED, 133 MGMT_EV_NEW_CONFIG_OPTIONS, 134 MGMT_EV_EXT_INDEX_ADDED, 135 MGMT_EV_EXT_INDEX_REMOVED, |
136 MGMT_EV_LOCAL_OOB_DATA_UPDATED, |
|
136}; 137 138#define CACHE_TIMEOUT msecs_to_jiffies(2 * 1000) 139 140#define ZERO_KEY "\x00\x00\x00\x00\x00\x00\x00\x00" \ 141 "\x00\x00\x00\x00\x00\x00\x00\x00" 142 143struct mgmt_pending_cmd { --- 113 unchanged lines hidden (view full) --- 257 258static int mgmt_index_event(u16 event, struct hci_dev *hdev, void *data, 259 u16 len, int flag) 260{ 261 return mgmt_send_event(event, hdev, HCI_CHANNEL_CONTROL, data, len, 262 flag, NULL); 263} 264 | 137}; 138 139#define CACHE_TIMEOUT msecs_to_jiffies(2 * 1000) 140 141#define ZERO_KEY "\x00\x00\x00\x00\x00\x00\x00\x00" \ 142 "\x00\x00\x00\x00\x00\x00\x00\x00" 143 144struct mgmt_pending_cmd { --- 113 unchanged lines hidden (view full) --- 258 259static int mgmt_index_event(u16 event, struct hci_dev *hdev, void *data, 260 u16 len, int flag) 261{ 262 return mgmt_send_event(event, hdev, HCI_CHANNEL_CONTROL, data, len, 263 flag, NULL); 264} 265 |
266static int mgmt_limited_event(u16 event, struct hci_dev *hdev, void *data, 267 u16 len, int flag, struct sock *skip_sk) 268{ 269 return mgmt_send_event(event, hdev, HCI_CHANNEL_CONTROL, data, len, 270 flag, skip_sk); 271} 272 |
|
265static int mgmt_generic_event(u16 event, struct hci_dev *hdev, void *data, 266 u16 len, struct sock *skip_sk) 267{ 268 return mgmt_send_event(event, hdev, HCI_CHANNEL_CONTROL, data, len, 269 HCI_MGMT_GENERIC_EVENTS, skip_sk); 270} 271 272static int mgmt_event(u16 event, struct hci_dev *hdev, void *data, u16 len, --- 6109 unchanged lines hidden (view full) --- 6382 break; 6383 } 6384 6385 rp->type = cp->type; 6386 rp->eir_len = cpu_to_le16(eir_len); 6387 6388 hci_dev_unlock(hdev); 6389 | 273static int mgmt_generic_event(u16 event, struct hci_dev *hdev, void *data, 274 u16 len, struct sock *skip_sk) 275{ 276 return mgmt_send_event(event, hdev, HCI_CHANNEL_CONTROL, data, len, 277 HCI_MGMT_GENERIC_EVENTS, skip_sk); 278} 279 280static int mgmt_event(u16 event, struct hci_dev *hdev, void *data, u16 len, --- 6109 unchanged lines hidden (view full) --- 6390 break; 6391 } 6392 6393 rp->type = cp->type; 6394 rp->eir_len = cpu_to_le16(eir_len); 6395 6396 hci_dev_unlock(hdev); 6397 |
6398 hci_sock_set_flag(sk, HCI_MGMT_OOB_DATA_EVENTS); 6399 |
|
6390 err = mgmt_cmd_complete(sk, hdev->id, MGMT_OP_READ_LOCAL_OOB_EXT_DATA, 6391 MGMT_STATUS_SUCCESS, rp, sizeof(*rp) + eir_len); | 6400 err = mgmt_cmd_complete(sk, hdev->id, MGMT_OP_READ_LOCAL_OOB_EXT_DATA, 6401 MGMT_STATUS_SUCCESS, rp, sizeof(*rp) + eir_len); |
6402 if (err < 0) 6403 goto done; |
|
6392 | 6404 |
6405 err = mgmt_limited_event(MGMT_EV_LOCAL_OOB_DATA_UPDATED, hdev, 6406 rp, sizeof(*rp) + eir_len, 6407 HCI_MGMT_OOB_DATA_EVENTS, sk); 6408 |
|
6393done: 6394 kfree(rp); 6395 6396 return err; 6397} 6398 6399static int read_adv_features(struct sock *sk, struct hci_dev *hdev, 6400 void *data, u16 data_len) --- 1434 unchanged lines hidden --- | 6409done: 6410 kfree(rp); 6411 6412 return err; 6413} 6414 6415static int read_adv_features(struct sock *sk, struct hci_dev *hdev, 6416 void *data, u16 data_len) --- 1434 unchanged lines hidden --- |