Lines Matching refs:hid
70 struct hid_dev_s *hid = (struct hid_dev_s *)filep->f_inode->i_private;
72 if (hid == NULL)
78 atomic_set(&hid->open_flag, 1);
85 struct hid_dev_s *hid = (struct hid_dev_s *)filep->f_inode->i_private;
87 if (hid == NULL)
93 atomic_set(&hid->open_flag, 0);
98 int hid_fops_init(struct hid_dev_s *hid)
102 hid->open_flag = 0;
103 ret = register_driver(USB_HID_DEV, &g_hid_fops, O_RDWR, hid);
112 int hid_fops_deinit(const struct hid_dev_s *hid)
116 if (hid == NULL)
137 usb_err("Malloc hid queue node failed\n");
147 usb_err("Malloc hid queue node buf failed\n");
211 struct hid_dev_s *hid = (struct hid_dev_s *)filep->f_inode->i_private;
216 if (hid == NULL)
224 ret = LOS_EventPoll(&hid->read_event.uwEventID, USB_HID_READ_EVENT, LOS_WAITMODE_OR);
236 struct hid_dev_s *hid = (struct hid_dev_s *)filep->f_inode->i_private;
252 if (hid == NULL)
258 (VOID)LOS_EventRead(&hid->read_event, USB_HID_READ_EVENT, LOS_WAITMODE_OR | LOS_WAITMODE_CLR, LOS_WAIT_FOREVER);
260 spin_lock_irqsave(&hid->hid_lock, flags);
261 ret = usbd_copy_to_user(buffer, buflen, (const void *)hid->read_buf, hid->read_len);
262 spin_unlock_irqrestore(&hid->hid_lock, flags);
276 struct hid_dev_s *hid = (struct hid_dev_s *)filep->f_inode->i_private;
286 if (hid == NULL)
306 spin_lock_irqsave(&hid->hid_lock, flags);
307 if (hid->hid_queue_len > 8)
309 hid_queue_free(hid);
312 list_add_tail(&node->irqqueue, &hid->hid_queue);
313 hid->hid_queue_len++;
315 if (atomic_read(&hid->busy_flag))
317 spin_unlock_irqrestore(&hid->hid_lock, flags);
321 if (!list_empty(&hid->hid_queue))
323 node_temp = list_first_entry(&hid->hid_queue, struct hid_queue_node, irqqueue);
325 hid->hid_queue_len--;
326 hid->cur_node = node_temp;
327 hid_send_data_sub(hid);
329 spin_unlock_irqrestore(&hid->hid_lock, flags);