Lines Matching defs:rio
56 /* stall/wait timeout for rio */
61 /* Size of the rio buffer */
80 struct rio_usb_data *rio = &rio_instance;
84 mutex_lock(&(rio->lock));
86 if (rio->isopen || !rio->present) {
87 mutex_unlock(&(rio->lock));
91 rio->isopen = 1;
93 init_waitqueue_head(&rio->wait_q);
95 mutex_unlock(&(rio->lock));
97 dev_info(&rio->rio_dev->dev, "Rio opened.\n");
105 struct rio_usb_data *rio = &rio_instance;
107 rio->isopen = 0;
109 dev_info(&rio->rio_dev->dev, "Rio closed.\n");
116 struct rio_usb_data *rio = &rio_instance;
123 mutex_lock(&(rio->lock));
124 /* Sanity check to make sure rio is connected, powered, etc */
125 if (rio->present == 0 || rio->rio_dev == NULL) {
160 /* Send rio control message */
163 result = usb_control_msg(rio->rio_dev,
164 usb_rcvctrlpipe(rio-> rio_dev, 0),
189 data which has been returned from rio. Data is
227 /* Send rio control message */
230 result = usb_control_msg(rio->rio_dev,
231 usb_sndctrlpipe(rio-> rio_dev, 0),
260 mutex_unlock(&(rio->lock));
269 struct rio_usb_data *rio = &rio_instance;
280 intr = mutex_lock_interruptible(&(rio->lock));
283 /* Sanity check to make sure rio is connected, powered, etc */
284 if (rio->present == 0 || rio->rio_dev == NULL) {
285 mutex_unlock(&(rio->lock));
293 char *obuf = rio->obuf;
297 if (copy_from_user(rio->obuf, buffer, copy_size)) {
303 if (!rio->rio_dev) {
308 mutex_unlock(&(rio->lock));
312 result = usb_bulk_msg(rio->rio_dev,
313 usb_sndbulkpipe(rio->rio_dev, 2),
324 prepare_to_wait(&rio->wait_q, &wait, TASK_INTERRUPTIBLE);
326 finish_wait(&rio->wait_q, &wait);
344 mutex_unlock(&(rio->lock));
349 mutex_unlock(&(rio->lock));
357 struct rio_usb_data *rio = &rio_instance;
366 intr = mutex_lock_interruptible(&(rio->lock));
369 /* Sanity check to make sure rio is connected, powered, etc */
370 if (rio->present == 0 || rio->rio_dev == NULL) {
371 mutex_unlock(&(rio->lock));
375 ibuf = rio->ibuf;
382 mutex_unlock(&(rio->lock));
385 if (!rio->rio_dev) {
386 mutex_unlock(&(rio->lock));
391 result = usb_bulk_msg(rio->rio_dev,
392 usb_rcvbulkpipe(rio->rio_dev, 1),
403 mutex_unlock(&(rio->lock));
407 prepare_to_wait(&rio->wait_q, &wait, TASK_INTERRUPTIBLE);
409 finish_wait(&rio->wait_q, &wait);
412 mutex_unlock(&(rio->lock));
417 mutex_unlock(&(rio->lock));
423 mutex_unlock(&(rio->lock));
431 mutex_unlock(&(rio->lock));
454 struct rio_usb_data *rio = &rio_instance;
465 rio->rio_dev = dev;
467 if (!(rio->obuf = kmalloc(OBUF_SIZE, GFP_KERNEL))) {
472 dbg("probe_rio: obuf address:%p", rio->obuf);
474 if (!(rio->ibuf = kmalloc(IBUF_SIZE, GFP_KERNEL))) {
477 kfree(rio->obuf);
480 dbg("probe_rio: ibuf address:%p", rio->ibuf);
482 mutex_init(&(rio->lock));
484 usb_set_intfdata (intf, rio);
485 rio->present = 1;
492 struct rio_usb_data *rio = usb_get_intfdata (intf);
496 if (rio) {
499 mutex_lock(&(rio->lock));
500 if (rio->isopen) {
501 rio->isopen = 0;
503 rio->rio_dev = NULL;
504 mutex_unlock(&(rio->lock));
508 kfree(rio->ibuf);
509 kfree(rio->obuf);
513 rio->present = 0;
514 mutex_unlock(&(rio->lock));
550 struct rio_usb_data *rio = &rio_instance;
552 rio->present = 0;