Lines Matching refs: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()
767 spin_lock(&vdev->ud.lock); in vhci_urb_enqueue()
768 vdev->ud.status = VDEV_ST_USED; in vhci_urb_enqueue()
769 spin_unlock(&vdev->ud.lock); in vhci_urb_enqueue()
898 if (!vdev->ud.tcp_socket) { in vhci_urb_dequeue()
930 usbip_event_add(&vdev->ud, VDEV_EVENT_ERROR_MALLOC); in vhci_urb_dequeue()
1011 static void vhci_shutdown_connection(struct usbip_device *ud) in vhci_shutdown_connection() argument
1013 struct vhci_device *vdev = container_of(ud, struct vhci_device, ud); in vhci_shutdown_connection()
1016 if (ud->tcp_socket) { in vhci_shutdown_connection()
1017 pr_debug("shutdown tcp_socket %d\n", ud->sockfd); in vhci_shutdown_connection()
1018 kernel_sock_shutdown(ud->tcp_socket, SHUT_RDWR); in vhci_shutdown_connection()
1022 if (vdev->ud.tcp_rx) { in vhci_shutdown_connection()
1023 kthread_stop_put(vdev->ud.tcp_rx); in vhci_shutdown_connection()
1024 vdev->ud.tcp_rx = NULL; in vhci_shutdown_connection()
1026 if (vdev->ud.tcp_tx) { in vhci_shutdown_connection()
1027 kthread_stop_put(vdev->ud.tcp_tx); in vhci_shutdown_connection()
1028 vdev->ud.tcp_tx = NULL; in vhci_shutdown_connection()
1033 if (vdev->ud.tcp_socket) { in vhci_shutdown_connection()
1034 sockfd_put(vdev->ud.tcp_socket); in vhci_shutdown_connection()
1035 vdev->ud.tcp_socket = NULL; in vhci_shutdown_connection()
1036 vdev->ud.sockfd = -1; in vhci_shutdown_connection()
1067 static void vhci_device_reset(struct usbip_device *ud) in vhci_device_reset() argument
1069 struct vhci_device *vdev = container_of(ud, struct vhci_device, ud); in vhci_device_reset()
1072 spin_lock_irqsave(&ud->lock, flags); in vhci_device_reset()
1080 if (ud->tcp_socket) { in vhci_device_reset()
1081 sockfd_put(ud->tcp_socket); in vhci_device_reset()
1082 ud->tcp_socket = NULL; in vhci_device_reset()
1083 ud->sockfd = -1; in vhci_device_reset()
1085 ud->status = VDEV_ST_NULL; in vhci_device_reset()
1087 spin_unlock_irqrestore(&ud->lock, flags); in vhci_device_reset()
1090 static void vhci_device_unusable(struct usbip_device *ud) in vhci_device_unusable() argument
1094 spin_lock_irqsave(&ud->lock, flags); in vhci_device_unusable()
1095 ud->status = VDEV_ST_ERROR; in vhci_device_unusable()
1096 spin_unlock_irqrestore(&ud->lock, flags); in vhci_device_unusable()
1103 vdev->ud.side = USBIP_VHCI; in vhci_device_init()
1104 vdev->ud.status = VDEV_ST_NULL; in vhci_device_init()
1105 spin_lock_init(&vdev->ud.lock); in vhci_device_init()
1106 mutex_init(&vdev->ud.sysfs_lock); in vhci_device_init()
1116 vdev->ud.eh_ops.shutdown = vhci_shutdown_connection; in vhci_device_init()
1117 vdev->ud.eh_ops.reset = vhci_device_reset; in vhci_device_init()
1118 vdev->ud.eh_ops.unusable = vhci_device_unusable; in vhci_device_init()
1120 usbip_start_eh(&vdev->ud); in vhci_device_init()
1243 usbip_event_add(&vdev->ud, VDEV_EVENT_REMOVED); in vhci_stop()
1244 usbip_stop_eh(&vdev->ud); in vhci_stop()