Lines Matching full:ud
462 if (vhci_hcd->vdev[rhport].ud.status == in vhci_hub_control()
464 vhci_hcd->vdev[rhport].ud.status == in vhci_hub_control()
469 vhci_hcd->vdev[rhport].ud.status); in vhci_hub_control()
672 usbip_event_add(&vdev->ud, VDEV_EVENT_ERROR_MALLOC); in vhci_tx_urb()
724 spin_lock(&vdev->ud.lock); in vhci_urb_enqueue()
725 if (vdev->ud.status == VDEV_ST_NULL || in vhci_urb_enqueue()
726 vdev->ud.status == VDEV_ST_ERROR) { in vhci_urb_enqueue()
728 spin_unlock(&vdev->ud.lock); in vhci_urb_enqueue()
732 spin_unlock(&vdev->ud.lock); in vhci_urb_enqueue()
769 spin_lock(&vdev->ud.lock); in vhci_urb_enqueue()
770 vdev->ud.status = VDEV_ST_USED; in vhci_urb_enqueue()
771 spin_unlock(&vdev->ud.lock); in vhci_urb_enqueue()
900 if (!vdev->ud.tcp_socket) { in vhci_urb_dequeue()
932 usbip_event_add(&vdev->ud, VDEV_EVENT_ERROR_MALLOC); in vhci_urb_dequeue()
1013 static void vhci_shutdown_connection(struct usbip_device *ud) in vhci_shutdown_connection() argument
1015 struct vhci_device *vdev = container_of(ud, struct vhci_device, ud); in vhci_shutdown_connection()
1018 if (ud->tcp_socket) { in vhci_shutdown_connection()
1019 pr_debug("shutdown tcp_socket %d\n", ud->sockfd); in vhci_shutdown_connection()
1020 kernel_sock_shutdown(ud->tcp_socket, SHUT_RDWR); in vhci_shutdown_connection()
1024 if (vdev->ud.tcp_rx) { in vhci_shutdown_connection()
1025 kthread_stop_put(vdev->ud.tcp_rx); in vhci_shutdown_connection()
1026 vdev->ud.tcp_rx = NULL; in vhci_shutdown_connection()
1028 if (vdev->ud.tcp_tx) { in vhci_shutdown_connection()
1029 kthread_stop_put(vdev->ud.tcp_tx); in vhci_shutdown_connection()
1030 vdev->ud.tcp_tx = NULL; in vhci_shutdown_connection()
1035 if (vdev->ud.tcp_socket) { in vhci_shutdown_connection()
1036 sockfd_put(vdev->ud.tcp_socket); in vhci_shutdown_connection()
1037 vdev->ud.tcp_socket = NULL; in vhci_shutdown_connection()
1038 vdev->ud.sockfd = -1; in vhci_shutdown_connection()
1069 static void vhci_device_reset(struct usbip_device *ud) in vhci_device_reset() argument
1071 struct vhci_device *vdev = container_of(ud, struct vhci_device, ud); in vhci_device_reset()
1075 spin_lock_irqsave(&ud->lock, flags); in vhci_device_reset()
1083 if (ud->tcp_socket) { in vhci_device_reset()
1084 sockfd_put(ud->tcp_socket); in vhci_device_reset()
1085 ud->tcp_socket = NULL; in vhci_device_reset()
1086 ud->sockfd = -1; in vhci_device_reset()
1088 ud->status = VDEV_ST_NULL; in vhci_device_reset()
1090 spin_unlock_irqrestore(&ud->lock, flags); in vhci_device_reset()
1093 static void vhci_device_unusable(struct usbip_device *ud) in vhci_device_unusable() argument
1097 spin_lock_irqsave(&ud->lock, flags); in vhci_device_unusable()
1098 ud->status = VDEV_ST_ERROR; in vhci_device_unusable()
1099 spin_unlock_irqrestore(&ud->lock, flags); in vhci_device_unusable()
1106 vdev->ud.side = USBIP_VHCI; in vhci_device_init()
1107 vdev->ud.status = VDEV_ST_NULL; in vhci_device_init()
1108 spin_lock_init(&vdev->ud.lock); in vhci_device_init()
1109 mutex_init(&vdev->ud.sysfs_lock); in vhci_device_init()
1119 vdev->ud.eh_ops.shutdown = vhci_shutdown_connection; in vhci_device_init()
1120 vdev->ud.eh_ops.reset = vhci_device_reset; in vhci_device_init()
1121 vdev->ud.eh_ops.unusable = vhci_device_unusable; in vhci_device_init()
1123 usbip_start_eh(&vdev->ud); in vhci_device_init()
1247 usbip_event_add(&vdev->ud, VDEV_EVENT_REMOVED); in vhci_stop()
1248 usbip_stop_eh(&vdev->ud); in vhci_stop()