Lines Matching defs:data

58 	struct vhci_data *data = hci_get_drvdata(hdev);
60 skb_queue_purge(&data->readq);
67 struct vhci_data *data = hci_get_drvdata(hdev);
69 skb_queue_purge(&data->readq);
76 struct vhci_data *data = hci_get_drvdata(hdev);
80 skb_queue_tail(&data->readq, skb);
82 if (atomic_read(&data->initialized))
83 wake_up_interruptible(&data->read_wait);
107 struct vhci_data *data = hci_get_drvdata(hdev);
109 return data->wakeup;
115 struct vhci_data *data = file->private_data;
118 buf[0] = data->suspended ? 'Y' : 'N';
126 struct vhci_data *data = container_of(work, struct vhci_data,
129 if (data->suspended)
130 hci_suspend_dev(data->hdev);
132 hci_resume_dev(data->hdev);
139 struct vhci_data *data = file->private_data;
147 if (data->suspended == enable)
150 data->suspended = enable;
152 schedule_work(&data->suspend_work);
167 struct vhci_data *data = file->private_data;
170 buf[0] = data->wakeup ? 'Y' : 'N';
180 struct vhci_data *data = file->private_data;
188 if (data->wakeup == enable)
191 data->wakeup = enable;
203 static int msft_opcode_set(void *data, u64 val)
205 struct vhci_data *vhci = data;
218 static int msft_opcode_get(void *data, u64 *val)
220 struct vhci_data *vhci = data;
312 char data[MAX_COREDUMP_LINE_LEN];
326 struct vhci_data *data = file->private_data;
327 struct hci_dev *hdev = data->hdev;
333 if (count < offsetof(struct devcoredump_test_data, data) ||
340 data_size = count - offsetof(struct devcoredump_test_data, data);
344 skb_put_data(skb, &dump_data.data, data_size);
383 static int __vhci_create_device(struct vhci_data *data, __u8 opcode)
389 if (data->hdev)
412 data->hdev = hdev;
416 hci_set_drvdata(hdev, data);
441 data->hdev = NULL;
446 debugfs_create_file("force_suspend", 0644, hdev->debugfs, data,
449 debugfs_create_file("force_wakeup", 0644, hdev->debugfs, data,
453 debugfs_create_file("msft_opcode", 0644, hdev->debugfs, data,
457 debugfs_create_file("aosp_capable", 0644, hdev->debugfs, data,
460 debugfs_create_file("force_devcoredump", 0644, hdev->debugfs, data,
468 skb_queue_head(&data->readq, skb);
469 atomic_inc(&data->initialized);
471 wake_up_interruptible(&data->read_wait);
475 static int vhci_create_device(struct vhci_data *data, __u8 opcode)
479 mutex_lock(&data->open_mutex);
480 err = __vhci_create_device(data, opcode);
481 mutex_unlock(&data->open_mutex);
486 static inline ssize_t vhci_get_user(struct vhci_data *data,
506 pkt_type = *((__u8 *) skb->data);
514 if (!data->hdev) {
521 ret = hci_recv_frame(data->hdev, skb);
525 cancel_delayed_work_sync(&data->open_timeout);
527 opcode = *((__u8 *) skb->data);
537 ret = vhci_create_device(data, opcode);
548 static inline ssize_t vhci_put_user(struct vhci_data *data,
557 if (copy_to_user(ptr, skb->data, len))
560 if (!data->hdev)
563 data->hdev->stat.byte_tx += len;
567 data->hdev->stat.cmd_tx++;
570 data->hdev->stat.acl_tx++;
573 data->hdev->stat.sco_tx++;
583 struct vhci_data *data = file->private_data;
588 skb = skb_dequeue(&data->readq);
590 ret = vhci_put_user(data, skb, buf, count);
592 skb_queue_head(&data->readq, skb);
603 ret = wait_event_interruptible(data->read_wait,
604 !skb_queue_empty(&data->readq));
615 struct vhci_data *data = file->private_data;
617 return vhci_get_user(data, from);
622 struct vhci_data *data = file->private_data;
624 poll_wait(file, &data->read_wait, wait);
626 if (!skb_queue_empty(&data->readq))
634 struct vhci_data *data = container_of(work, struct vhci_data,
637 vhci_create_device(data, amp ? HCI_AMP : HCI_PRIMARY);
642 struct vhci_data *data;
644 data = kzalloc(sizeof(struct vhci_data), GFP_KERNEL);
645 if (!data)
648 skb_queue_head_init(&data->readq);
649 init_waitqueue_head(&data->read_wait);
651 mutex_init(&data->open_mutex);
652 INIT_DELAYED_WORK(&data->open_timeout, vhci_open_timeout);
653 INIT_WORK(&data->suspend_work, vhci_suspend_work);
655 file->private_data = data;
658 schedule_delayed_work(&data->open_timeout, msecs_to_jiffies(1000));
665 struct vhci_data *data = file->private_data;
668 cancel_delayed_work_sync(&data->open_timeout);
669 flush_work(&data->suspend_work);
671 hdev = data->hdev;
678 skb_queue_purge(&data->readq);
680 kfree(data);