Lines Matching refs:hdev
59 struct sk_buff *mgmt_alloc_skb(struct hci_dev *hdev, u16 opcode, in mgmt_alloc_skb() argument
69 bt_cb(skb)->mgmt.hdev = hdev; in mgmt_alloc_skb()
78 struct hci_dev *hdev; in mgmt_send_event_skb() local
86 hdev = bt_cb(skb)->mgmt.hdev; in mgmt_send_event_skb()
93 hci_send_monitor_ctrl_event(hdev, bt_cb(skb)->mgmt.opcode, in mgmt_send_event_skb()
99 if (hdev) in mgmt_send_event_skb()
100 hdr->index = cpu_to_le16(hdev->id); in mgmt_send_event_skb()
111 int mgmt_send_event(u16 event, struct hci_dev *hdev, unsigned short channel, in mgmt_send_event() argument
116 skb = mgmt_alloc_skb(hdev, event, data_len); in mgmt_send_event()
218 struct hci_dev *hdev) in mgmt_pending_find() argument
222 mutex_lock(&hdev->mgmt_pending_lock); in mgmt_pending_find()
224 list_for_each_entry_safe(cmd, tmp, &hdev->mgmt_pending, list) { in mgmt_pending_find()
229 mutex_unlock(&hdev->mgmt_pending_lock); in mgmt_pending_find()
234 mutex_unlock(&hdev->mgmt_pending_lock); in mgmt_pending_find()
239 void mgmt_pending_foreach(u16 opcode, struct hci_dev *hdev, bool remove, in mgmt_pending_foreach() argument
245 mutex_lock(&hdev->mgmt_pending_lock); in mgmt_pending_foreach()
247 list_for_each_entry_safe(cmd, tmp, &hdev->mgmt_pending, list) { in mgmt_pending_foreach()
260 mutex_unlock(&hdev->mgmt_pending_lock); in mgmt_pending_foreach()
264 struct hci_dev *hdev, in mgmt_pending_new() argument
274 cmd->hdev = hdev; in mgmt_pending_new()
291 struct hci_dev *hdev, in mgmt_pending_add() argument
296 cmd = mgmt_pending_new(sk, opcode, hdev, data, len); in mgmt_pending_add()
300 mutex_lock(&hdev->mgmt_pending_lock); in mgmt_pending_add()
301 list_add_tail(&cmd->list, &hdev->mgmt_pending); in mgmt_pending_add()
302 mutex_unlock(&hdev->mgmt_pending_lock); in mgmt_pending_add()
316 mutex_lock(&cmd->hdev->mgmt_pending_lock); in mgmt_pending_remove()
318 mutex_unlock(&cmd->hdev->mgmt_pending_lock); in mgmt_pending_remove()
323 void mgmt_mesh_foreach(struct hci_dev *hdev, in mgmt_mesh_foreach() argument
329 list_for_each_entry_safe(mesh_tx, tmp, &hdev->mesh_pending, list) { in mgmt_mesh_foreach()
335 struct mgmt_mesh_tx *mgmt_mesh_next(struct hci_dev *hdev, struct sock *sk) in mgmt_mesh_next() argument
339 if (list_empty(&hdev->mesh_pending)) in mgmt_mesh_next()
342 list_for_each_entry(mesh_tx, &hdev->mesh_pending, list) { in mgmt_mesh_next()
350 struct mgmt_mesh_tx *mgmt_mesh_find(struct hci_dev *hdev, u8 handle) in mgmt_mesh_find() argument
354 if (list_empty(&hdev->mesh_pending)) in mgmt_mesh_find()
357 list_for_each_entry(mesh_tx, &hdev->mesh_pending, list) { in mgmt_mesh_find()
365 struct mgmt_mesh_tx *mgmt_mesh_add(struct sock *sk, struct hci_dev *hdev, in mgmt_mesh_add() argument
374 hdev->mesh_send_ref++; in mgmt_mesh_add()
375 if (!hdev->mesh_send_ref) in mgmt_mesh_add()
376 hdev->mesh_send_ref++; in mgmt_mesh_add()
378 mesh_tx->handle = hdev->mesh_send_ref; in mgmt_mesh_add()
379 mesh_tx->index = hdev->id; in mgmt_mesh_add()
385 list_add_tail(&mesh_tx->list, &hdev->mesh_pending); in mgmt_mesh_add()