Lines Matching +full:peer +full:- +full:hub

1 // SPDX-License-Identifier: GPL-2.0
3 * usb.c - Hardware dependent module for USB
5 * Copyright (C) 2013-2015 Microchip Technology Germany II GmbH & Co. KG
22 #include <linux/dma-mapping.h>
60 * struct most_dci_obj - Direct Communication Interface
85 * struct most_dev - holds all usb interface specific stuff
132 * drci_rd_reg - read a DCI register
147 return -ENOMEM; in drci_rd_reg()
163 * drci_wr_reg - write a DCI register
189 * get_stream_frame_size - calculate frame size of current configuration
197 unsigned int sub_size = cfg->subbuffer_size; in get_stream_frame_size()
203 switch (cfg->data_type) { in get_stream_frame_size()
208 if (cfg->packets_per_xact == 0) { in get_stream_frame_size()
211 } else if (cfg->packets_per_xact == 0xFF) { in get_stream_frame_size()
214 frame_size = cfg->packets_per_xact * sub_size; in get_stream_frame_size()
218 dev_warn(dev, "Query frame size of non-streaming channel\n"); in get_stream_frame_size()
226 * hdm_poison_channel - mark buffers of this channel as invalid
242 if (channel < 0 || channel >= iface->num_channels) { in hdm_poison_channel()
243 dev_warn(&mdev->usb_device->dev, "Channel ID out of range.\n"); in hdm_poison_channel()
244 return -ECHRNG; in hdm_poison_channel()
247 lock = mdev->channel_lock + channel; in hdm_poison_channel()
249 mdev->is_channel_healthy[channel] = false; in hdm_poison_channel()
252 cancel_work_sync(&mdev->clear_work[channel].ws); in hdm_poison_channel()
254 mutex_lock(&mdev->io_mutex); in hdm_poison_channel()
255 usb_kill_anchored_urbs(&mdev->busy_urbs[channel]); in hdm_poison_channel()
256 if (mdev->padding_active[channel]) in hdm_poison_channel()
257 mdev->padding_active[channel] = false; in hdm_poison_channel()
259 if (mdev->conf[channel].data_type == MOST_CH_ASYNC) { in hdm_poison_channel()
260 del_timer_sync(&mdev->link_stat_timer); in hdm_poison_channel()
261 cancel_work_sync(&mdev->poll_work_obj); in hdm_poison_channel()
263 mutex_unlock(&mdev->io_mutex); in hdm_poison_channel()
268 * hdm_add_padding - add padding bytes
278 struct most_channel_config *conf = &mdev->conf[channel]; in hdm_add_padding()
279 unsigned int frame_size = get_stream_frame_size(&mdev->dev, conf); in hdm_add_padding()
283 return -EINVAL; in hdm_add_padding()
284 num_frames = mbo->buffer_length / frame_size; in hdm_add_padding()
287 dev_err(&mdev->usb_device->dev, in hdm_add_padding()
289 return -EINVAL; in hdm_add_padding()
292 for (j = num_frames - 1; j > 0; j--) in hdm_add_padding()
293 memmove(mbo->virt_address + j * USB_MTU, in hdm_add_padding()
294 mbo->virt_address + j * frame_size, in hdm_add_padding()
296 mbo->buffer_length = num_frames * USB_MTU; in hdm_add_padding()
301 * hdm_remove_padding - remove padding bytes
312 struct most_channel_config *const conf = &mdev->conf[channel]; in hdm_remove_padding()
313 unsigned int frame_size = get_stream_frame_size(&mdev->dev, conf); in hdm_remove_padding()
317 return -EINVAL; in hdm_remove_padding()
318 num_frames = mbo->processed_length / USB_MTU; in hdm_remove_padding()
321 memmove(mbo->virt_address + frame_size * j, in hdm_remove_padding()
322 mbo->virt_address + USB_MTU * j, in hdm_remove_padding()
325 mbo->processed_length = frame_size * num_frames; in hdm_remove_padding()
330 * hdm_write_completion - completion function for submitted Tx URBs
342 struct mbo *mbo = urb->context; in hdm_write_completion()
343 struct most_dev *mdev = to_mdev(mbo->ifp); in hdm_write_completion()
344 unsigned int channel = mbo->hdm_channel_id; in hdm_write_completion()
345 spinlock_t *lock = mdev->channel_lock + channel; in hdm_write_completion()
350 mbo->processed_length = 0; in hdm_write_completion()
351 mbo->status = MBO_E_INVAL; in hdm_write_completion()
352 if (likely(mdev->is_channel_healthy[channel])) { in hdm_write_completion()
353 switch (urb->status) { in hdm_write_completion()
355 case -ESHUTDOWN: in hdm_write_completion()
356 mbo->processed_length = urb->actual_length; in hdm_write_completion()
357 mbo->status = MBO_SUCCESS; in hdm_write_completion()
359 case -EPIPE: in hdm_write_completion()
360 dev_warn(&mdev->usb_device->dev, in hdm_write_completion()
362 mdev->ep_address[channel]); in hdm_write_completion()
363 mdev->is_channel_healthy[channel] = false; in hdm_write_completion()
364 mdev->clear_work[channel].pipe = urb->pipe; in hdm_write_completion()
365 schedule_work(&mdev->clear_work[channel].ws); in hdm_write_completion()
367 case -ENODEV: in hdm_write_completion()
368 case -EPROTO: in hdm_write_completion()
369 mbo->status = MBO_E_CLOSE; in hdm_write_completion()
376 if (likely(mbo->complete)) in hdm_write_completion()
377 mbo->complete(mbo); in hdm_write_completion()
382 * hdm_read_completion - completion function for submitted Rx URBs
388 * padding bytes -if necessary- and calls the completion function.
394 struct mbo *mbo = urb->context; in hdm_read_completion()
395 struct most_dev *mdev = to_mdev(mbo->ifp); in hdm_read_completion()
396 unsigned int channel = mbo->hdm_channel_id; in hdm_read_completion()
397 struct device *dev = &mdev->usb_device->dev; in hdm_read_completion()
398 spinlock_t *lock = mdev->channel_lock + channel; in hdm_read_completion()
403 mbo->processed_length = 0; in hdm_read_completion()
404 mbo->status = MBO_E_INVAL; in hdm_read_completion()
405 if (likely(mdev->is_channel_healthy[channel])) { in hdm_read_completion()
406 switch (urb->status) { in hdm_read_completion()
408 case -ESHUTDOWN: in hdm_read_completion()
409 mbo->processed_length = urb->actual_length; in hdm_read_completion()
410 mbo->status = MBO_SUCCESS; in hdm_read_completion()
411 if (mdev->padding_active[channel] && in hdm_read_completion()
413 mbo->processed_length = 0; in hdm_read_completion()
414 mbo->status = MBO_E_INVAL; in hdm_read_completion()
417 case -EPIPE: in hdm_read_completion()
419 mdev->ep_address[channel]); in hdm_read_completion()
420 mdev->is_channel_healthy[channel] = false; in hdm_read_completion()
421 mdev->clear_work[channel].pipe = urb->pipe; in hdm_read_completion()
422 schedule_work(&mdev->clear_work[channel].ws); in hdm_read_completion()
424 case -ENODEV: in hdm_read_completion()
425 case -EPROTO: in hdm_read_completion()
426 mbo->status = MBO_E_CLOSE; in hdm_read_completion()
428 case -EOVERFLOW: in hdm_read_completion()
430 mdev->ep_address[channel]); in hdm_read_completion()
437 if (likely(mbo->complete)) in hdm_read_completion()
438 mbo->complete(mbo); in hdm_read_completion()
443 * hdm_enqueue - receive a buffer to be used for data transfer
468 return -EINVAL; in hdm_enqueue()
469 if (iface->num_channels <= channel || channel < 0) in hdm_enqueue()
470 return -ECHRNG; in hdm_enqueue()
474 return -ENOMEM; in hdm_enqueue()
476 conf = &mdev->conf[channel]; in hdm_enqueue()
478 mutex_lock(&mdev->io_mutex); in hdm_enqueue()
479 if (!mdev->usb_device) { in hdm_enqueue()
480 retval = -ENODEV; in hdm_enqueue()
484 if ((conf->direction & MOST_CH_TX) && mdev->padding_active[channel] && in hdm_enqueue()
486 retval = -EINVAL; in hdm_enqueue()
490 urb->transfer_dma = mbo->bus_address; in hdm_enqueue()
491 virt_address = mbo->virt_address; in hdm_enqueue()
492 length = mbo->buffer_length; in hdm_enqueue()
494 if (conf->direction & MOST_CH_TX) { in hdm_enqueue()
495 usb_fill_bulk_urb(urb, mdev->usb_device, in hdm_enqueue()
496 usb_sndbulkpipe(mdev->usb_device, in hdm_enqueue()
497 mdev->ep_address[channel]), in hdm_enqueue()
502 if (conf->data_type != MOST_CH_ISOC && in hdm_enqueue()
503 conf->data_type != MOST_CH_SYNC) in hdm_enqueue()
504 urb->transfer_flags |= URB_ZERO_PACKET; in hdm_enqueue()
506 usb_fill_bulk_urb(urb, mdev->usb_device, in hdm_enqueue()
507 usb_rcvbulkpipe(mdev->usb_device, in hdm_enqueue()
508 mdev->ep_address[channel]), in hdm_enqueue()
510 length + conf->extra_len, in hdm_enqueue()
514 urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; in hdm_enqueue()
516 usb_anchor_urb(urb, &mdev->busy_urbs[channel]); in hdm_enqueue()
520 dev_err(&mdev->usb_device->dev, in hdm_enqueue()
524 mutex_unlock(&mdev->io_mutex); in hdm_enqueue()
531 mutex_unlock(&mdev->io_mutex); in hdm_enqueue()
537 struct most_dev *mdev = to_mdev(mbo->ifp); in hdm_dma_alloc()
539 return usb_alloc_coherent(mdev->usb_device, size, GFP_KERNEL, in hdm_dma_alloc()
540 &mbo->bus_address); in hdm_dma_alloc()
545 struct most_dev *mdev = to_mdev(mbo->ifp); in hdm_dma_free()
547 usb_free_coherent(mdev->usb_device, size, mbo->virt_address, in hdm_dma_free()
548 mbo->bus_address); in hdm_dma_free()
552 * hdm_configure_channel - receive channel configuration from core
572 struct device *dev = &mdev->usb_device->dev; in hdm_configure_channel()
576 return -EINVAL; in hdm_configure_channel()
578 if (channel < 0 || channel >= iface->num_channels) { in hdm_configure_channel()
580 return -EINVAL; in hdm_configure_channel()
583 mdev->is_channel_healthy[channel] = true; in hdm_configure_channel()
584 mdev->clear_work[channel].channel = channel; in hdm_configure_channel()
585 mdev->clear_work[channel].mdev = mdev; in hdm_configure_channel()
586 INIT_WORK(&mdev->clear_work[channel].ws, wq_clear_halt); in hdm_configure_channel()
588 if (!conf->num_buffers || !conf->buffer_size) { in hdm_configure_channel()
590 return -EINVAL; in hdm_configure_channel()
593 if (conf->data_type != MOST_CH_SYNC && in hdm_configure_channel()
594 !(conf->data_type == MOST_CH_ISOC && in hdm_configure_channel()
595 conf->packets_per_xact != 0xFF)) { in hdm_configure_channel()
596 mdev->padding_active[channel] = false; in hdm_configure_channel()
605 mdev->padding_active[channel] = true; in hdm_configure_channel()
607 frame_size = get_stream_frame_size(&mdev->dev, conf); in hdm_configure_channel()
610 return -EINVAL; in hdm_configure_channel()
613 num_frames = conf->buffer_size / frame_size; in hdm_configure_channel()
615 if (conf->buffer_size % frame_size) { in hdm_configure_channel()
616 u16 old_size = conf->buffer_size; in hdm_configure_channel()
618 conf->buffer_size = num_frames * frame_size; in hdm_configure_channel()
619 dev_warn(dev, "%s: fixed buffer size (%d -> %d)\n", in hdm_configure_channel()
620 mdev->suffix[channel], old_size, conf->buffer_size); in hdm_configure_channel()
624 conf->extra_len = num_frames * (USB_MTU - frame_size); in hdm_configure_channel()
627 mdev->conf[channel] = *conf; in hdm_configure_channel()
628 if (conf->data_type == MOST_CH_ASYNC) { in hdm_configure_channel()
629 u16 ep = mdev->ep_address[channel]; in hdm_configure_channel()
631 if (start_sync_ep(mdev->usb_device, ep) < 0) in hdm_configure_channel()
638 * hdm_request_netinfo - request network information
653 mdev->on_netinfo = on_netinfo; in hdm_request_netinfo()
657 mdev->link_stat_timer.expires = jiffies + HZ; in hdm_request_netinfo()
658 mod_timer(&mdev->link_stat_timer, mdev->link_stat_timer.expires); in hdm_request_netinfo()
662 * link_stat_timer_handler - schedule work obtaining mac address and link status
672 schedule_work(&mdev->poll_work_obj); in link_stat_timer_handler()
673 mdev->link_stat_timer.expires = jiffies + (2 * HZ); in link_stat_timer_handler()
674 add_timer(&mdev->link_stat_timer); in link_stat_timer_handler()
678 * wq_netinfo - work queue function to deliver latest networking information
686 struct usb_device *usb_device = mdev->usb_device; in wq_netinfo()
687 struct device *dev = &usb_device->dev; in wq_netinfo()
718 if (mdev->on_netinfo) in wq_netinfo()
719 mdev->on_netinfo(&mdev->iface, link, hw_addr); in wq_netinfo()
723 * wq_clear_halt - work queue function
731 struct most_dev *mdev = clear_work->mdev; in wq_clear_halt()
732 unsigned int channel = clear_work->channel; in wq_clear_halt()
733 int pipe = clear_work->pipe; in wq_clear_halt()
735 int peer; in wq_clear_halt() local
737 mutex_lock(&mdev->io_mutex); in wq_clear_halt()
738 most_stop_enqueue(&mdev->iface, channel); in wq_clear_halt()
739 usb_kill_anchored_urbs(&mdev->busy_urbs[channel]); in wq_clear_halt()
740 if (usb_clear_halt(mdev->usb_device, pipe)) in wq_clear_halt()
741 dev_warn(&mdev->usb_device->dev, "Failed to reset endpoint.\n"); in wq_clear_halt()
745 * too, since the hardware runs its clean-up sequence on both in wq_clear_halt()
751 if (mdev->conf[channel].data_type == MOST_CH_ASYNC && in wq_clear_halt()
752 mdev->conf[channel].direction == MOST_CH_RX) { in wq_clear_halt()
754 peer = 1; in wq_clear_halt()
756 peer = 0; in wq_clear_halt()
757 snd_pipe = usb_sndbulkpipe(mdev->usb_device, in wq_clear_halt()
758 mdev->ep_address[peer]); in wq_clear_halt()
759 usb_clear_halt(mdev->usb_device, snd_pipe); in wq_clear_halt()
761 mdev->is_channel_healthy[channel] = true; in wq_clear_halt()
762 most_resume_enqueue(&mdev->iface, channel); in wq_clear_halt()
763 mutex_unlock(&mdev->io_mutex); in wq_clear_halt()
767 * hdm_usb_fops - file operation table for USB driver
774 * usb_device_id - ID table for HCD device probing
818 return -EINVAL; in get_stat_reg_addr()
827 const char *name = attr->attr.name; in value_show()
834 return sysfs_emit(buf, "%04x\n", dci_obj->reg_addr); in value_show()
837 reg_addr = dci_obj->reg_addr; in value_show()
840 return -EINVAL; in value_show()
842 err = drci_rd_reg(dci_obj->usb_device, reg_addr, &val); in value_show()
854 const char *name = attr->attr.name; in value_store()
856 struct usb_device *usb_dev = dci_obj->usb_device; in value_store()
864 dci_obj->reg_addr = val; in value_store()
869 err = drci_wr_reg(usb_dev, dci_obj->reg_addr, val); in value_store()
875 return -EINVAL; in value_store()
924 put_device(dev->parent); in release_dci()
935 * hdm_probe - probe function of USB device driver
949 struct usb_host_interface *usb_iface_desc = interface->cur_altsetting; in hdm_probe()
951 struct device *dev = &usb_dev->dev; in hdm_probe()
957 int ret = -ENOMEM; in hdm_probe()
961 return -ENOMEM; in hdm_probe()
964 num_endpoints = usb_iface_desc->desc.bNumEndpoints; in hdm_probe()
967 return -EINVAL; in hdm_probe()
969 mutex_init(&mdev->io_mutex); in hdm_probe()
970 INIT_WORK(&mdev->poll_work_obj, wq_netinfo); in hdm_probe()
971 timer_setup(&mdev->link_stat_timer, link_stat_timer_handler, 0); in hdm_probe()
973 mdev->usb_device = usb_dev; in hdm_probe()
974 mdev->link_stat_timer.expires = jiffies + (2 * HZ); in hdm_probe()
976 mdev->iface.mod = hdm_usb_fops.owner; in hdm_probe()
977 mdev->iface.dev = &mdev->dev; in hdm_probe()
978 mdev->iface.driver_dev = &interface->dev; in hdm_probe()
979 mdev->iface.interface = ITYPE_USB; in hdm_probe()
980 mdev->iface.configure = hdm_configure_channel; in hdm_probe()
981 mdev->iface.request_netinfo = hdm_request_netinfo; in hdm_probe()
982 mdev->iface.enqueue = hdm_enqueue; in hdm_probe()
983 mdev->iface.poison_channel = hdm_poison_channel; in hdm_probe()
984 mdev->iface.dma_alloc = hdm_dma_alloc; in hdm_probe()
985 mdev->iface.dma_free = hdm_dma_free; in hdm_probe()
986 mdev->iface.description = mdev->description; in hdm_probe()
987 mdev->iface.num_channels = num_endpoints; in hdm_probe()
989 snprintf(mdev->description, sizeof(mdev->description), in hdm_probe()
990 "%d-%s:%d.%d", in hdm_probe()
991 usb_dev->bus->busnum, in hdm_probe()
992 usb_dev->devpath, in hdm_probe()
993 usb_dev->config->desc.bConfigurationValue, in hdm_probe()
994 usb_iface_desc->desc.bInterfaceNumber); in hdm_probe()
996 mdev->dev.init_name = mdev->description; in hdm_probe()
997 mdev->dev.parent = &interface->dev; in hdm_probe()
998 mdev->dev.release = release_mdev; in hdm_probe()
999 mdev->conf = kcalloc(num_endpoints, sizeof(*mdev->conf), GFP_KERNEL); in hdm_probe()
1000 if (!mdev->conf) in hdm_probe()
1003 mdev->cap = kcalloc(num_endpoints, sizeof(*mdev->cap), GFP_KERNEL); in hdm_probe()
1004 if (!mdev->cap) in hdm_probe()
1007 mdev->iface.channel_vector = mdev->cap; in hdm_probe()
1008 mdev->ep_address = in hdm_probe()
1009 kcalloc(num_endpoints, sizeof(*mdev->ep_address), GFP_KERNEL); in hdm_probe()
1010 if (!mdev->ep_address) in hdm_probe()
1013 mdev->busy_urbs = in hdm_probe()
1014 kcalloc(num_endpoints, sizeof(*mdev->busy_urbs), GFP_KERNEL); in hdm_probe()
1015 if (!mdev->busy_urbs) in hdm_probe()
1018 tmp_cap = mdev->cap; in hdm_probe()
1020 ep_desc = &usb_iface_desc->endpoint[i].desc; in hdm_probe()
1021 mdev->ep_address[i] = ep_desc->bEndpointAddress; in hdm_probe()
1022 mdev->padding_active[i] = false; in hdm_probe()
1023 mdev->is_channel_healthy[i] = true; in hdm_probe()
1025 snprintf(&mdev->suffix[i][0], MAX_SUFFIX_LEN, "ep%02x", in hdm_probe()
1026 mdev->ep_address[i]); in hdm_probe()
1028 tmp_cap->name_suffix = &mdev->suffix[i][0]; in hdm_probe()
1029 tmp_cap->buffer_size_packet = MAX_BUF_SIZE; in hdm_probe()
1030 tmp_cap->buffer_size_streaming = MAX_BUF_SIZE; in hdm_probe()
1031 tmp_cap->num_buffers_packet = BUF_CHAIN_SIZE; in hdm_probe()
1032 tmp_cap->num_buffers_streaming = BUF_CHAIN_SIZE; in hdm_probe()
1033 tmp_cap->data_type = MOST_CH_CONTROL | MOST_CH_ASYNC | in hdm_probe()
1036 tmp_cap->direction = MOST_CH_RX; in hdm_probe()
1038 tmp_cap->direction = MOST_CH_TX; in hdm_probe()
1040 init_usb_anchor(&mdev->busy_urbs[i]); in hdm_probe()
1041 spin_lock_init(&mdev->channel_lock[i]); in hdm_probe()
1044 le16_to_cpu(usb_dev->descriptor.idVendor), in hdm_probe()
1045 le16_to_cpu(usb_dev->descriptor.idProduct), in hdm_probe()
1046 usb_dev->bus->busnum, in hdm_probe()
1047 usb_dev->devnum); in hdm_probe()
1049 dev_dbg(dev, "device path: /sys/bus/usb/devices/%d-%s:%d.%d\n", in hdm_probe()
1050 usb_dev->bus->busnum, in hdm_probe()
1051 usb_dev->devpath, in hdm_probe()
1052 usb_dev->config->desc.bConfigurationValue, in hdm_probe()
1053 usb_iface_desc->desc.bInterfaceNumber); in hdm_probe()
1055 ret = most_register_interface(&mdev->iface); in hdm_probe()
1059 mutex_lock(&mdev->io_mutex); in hdm_probe()
1060 if (le16_to_cpu(usb_dev->descriptor.idProduct) == USB_DEV_ID_OS81118 || in hdm_probe()
1061 le16_to_cpu(usb_dev->descriptor.idProduct) == USB_DEV_ID_OS81119 || in hdm_probe()
1062 le16_to_cpu(usb_dev->descriptor.idProduct) == USB_DEV_ID_OS81210) { in hdm_probe()
1063 mdev->dci = kzalloc(sizeof(*mdev->dci), GFP_KERNEL); in hdm_probe()
1064 if (!mdev->dci) { in hdm_probe()
1065 mutex_unlock(&mdev->io_mutex); in hdm_probe()
1066 most_deregister_interface(&mdev->iface); in hdm_probe()
1067 ret = -ENOMEM; in hdm_probe()
1071 mdev->dci->dev.init_name = "dci"; in hdm_probe()
1072 mdev->dci->dev.parent = get_device(mdev->iface.dev); in hdm_probe()
1073 mdev->dci->dev.groups = dci_groups; in hdm_probe()
1074 mdev->dci->dev.release = release_dci; in hdm_probe()
1075 if (device_register(&mdev->dci->dev)) { in hdm_probe()
1076 mutex_unlock(&mdev->io_mutex); in hdm_probe()
1077 most_deregister_interface(&mdev->iface); in hdm_probe()
1078 ret = -ENOMEM; in hdm_probe()
1081 mdev->dci->usb_device = mdev->usb_device; in hdm_probe()
1083 mutex_unlock(&mdev->io_mutex); in hdm_probe()
1086 put_device(&mdev->dci->dev); in hdm_probe()
1088 kfree(mdev->busy_urbs); in hdm_probe()
1090 kfree(mdev->ep_address); in hdm_probe()
1092 kfree(mdev->cap); in hdm_probe()
1094 kfree(mdev->conf); in hdm_probe()
1096 put_device(&mdev->dev); in hdm_probe()
1101 * hdm_disconnect - disconnect function of USB device driver
1107 * Context: hub kernel thread
1113 mutex_lock(&mdev->io_mutex); in hdm_disconnect()
1115 mdev->usb_device = NULL; in hdm_disconnect()
1116 mutex_unlock(&mdev->io_mutex); in hdm_disconnect()
1118 del_timer_sync(&mdev->link_stat_timer); in hdm_disconnect()
1119 cancel_work_sync(&mdev->poll_work_obj); in hdm_disconnect()
1121 if (mdev->dci) in hdm_disconnect()
1122 device_unregister(&mdev->dci->dev); in hdm_disconnect()
1123 most_deregister_interface(&mdev->iface); in hdm_disconnect()
1125 kfree(mdev->busy_urbs); in hdm_disconnect()
1126 kfree(mdev->cap); in hdm_disconnect()
1127 kfree(mdev->conf); in hdm_disconnect()
1128 kfree(mdev->ep_address); in hdm_disconnect()
1129 put_device(&mdev->dci->dev); in hdm_disconnect()
1130 put_device(&mdev->dev); in hdm_disconnect()
1138 mutex_lock(&mdev->io_mutex); in hdm_suspend()
1139 for (i = 0; i < mdev->iface.num_channels; i++) { in hdm_suspend()
1140 most_stop_enqueue(&mdev->iface, i); in hdm_suspend()
1141 usb_kill_anchored_urbs(&mdev->busy_urbs[i]); in hdm_suspend()
1143 mutex_unlock(&mdev->io_mutex); in hdm_suspend()
1152 mutex_lock(&mdev->io_mutex); in hdm_resume()
1153 for (i = 0; i < mdev->iface.num_channels; i++) in hdm_resume()
1154 most_resume_enqueue(&mdev->iface, i); in hdm_resume()
1155 mutex_unlock(&mdev->io_mutex); in hdm_resume()