diff options
author | Yuyang Du <yuyang.du@intel.com> | 2017-06-08 07:04:09 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-06-13 10:51:10 +0200 |
commit | 03cd00d538a6feb0492cd153edf256ef7d7bd95e (patch) | |
tree | 405fd03ca406c69c1fd569d5f1ac8573dc56abd4 /drivers/usb/usbip/vhci_rx.c | |
parent | usbip: vhci-hcd: Rework vhci_hcd_init (diff) | |
download | linux-03cd00d538a6feb0492cd153edf256ef7d7bd95e.tar.xz linux-03cd00d538a6feb0492cd153edf256ef7d7bd95e.zip |
usbip: vhci-hcd: Set the vhci structure up to work
This patch enables the new vhci structure. Its lock protects
both the USB2 hub and the shared USB3 hub.
Signed-off-by: Yuyang Du <yuyang.du@intel.com>
Acked-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/usbip/vhci_rx.c')
-rw-r--r-- | drivers/usb/usbip/vhci_rx.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/usb/usbip/vhci_rx.c b/drivers/usb/usbip/vhci_rx.c index 85abe898d7bd..ef2f2d5ca6b2 100644 --- a/drivers/usb/usbip/vhci_rx.c +++ b/drivers/usb/usbip/vhci_rx.c @@ -70,7 +70,8 @@ struct urb *pickup_urb_and_free_priv(struct vhci_device *vdev, __u32 seqnum) static void vhci_recv_ret_submit(struct vhci_device *vdev, struct usbip_header *pdu) { - struct vhci_hcd *vhci = vdev_to_vhci_hcd(vdev); + struct vhci_hcd *vhci_hcd = vdev_to_vhci_hcd(vdev); + struct vhci *vhci = vhci_hcd->vhci; struct usbip_device *ud = &vdev->ud; struct urb *urb; unsigned long flags; @@ -82,7 +83,7 @@ static void vhci_recv_ret_submit(struct vhci_device *vdev, if (!urb) { pr_err("cannot find a urb of seqnum %u\n", pdu->base.seqnum); pr_info("max seqnum %d\n", - atomic_read(&vhci->seqnum)); + atomic_read(&vhci_hcd->seqnum)); usbip_event_add(ud, VDEV_EVENT_ERROR_TCP); return; } @@ -107,10 +108,10 @@ static void vhci_recv_ret_submit(struct vhci_device *vdev, usbip_dbg_vhci_rx("now giveback urb %p\n", urb); spin_lock_irqsave(&vhci->lock, flags); - usb_hcd_unlink_urb_from_ep(vhci_hcd_to_hcd(vhci), urb); + usb_hcd_unlink_urb_from_ep(vhci_hcd_to_hcd(vhci_hcd), urb); spin_unlock_irqrestore(&vhci->lock, flags); - usb_hcd_giveback_urb(vhci_hcd_to_hcd(vhci), urb, urb->status); + usb_hcd_giveback_urb(vhci_hcd_to_hcd(vhci_hcd), urb, urb->status); usbip_dbg_vhci_rx("Leave\n"); } @@ -143,7 +144,8 @@ static struct vhci_unlink *dequeue_pending_unlink(struct vhci_device *vdev, static void vhci_recv_ret_unlink(struct vhci_device *vdev, struct usbip_header *pdu) { - struct vhci_hcd *vhci = vdev_to_vhci_hcd(vdev); + struct vhci_hcd *vhci_hcd = vdev_to_vhci_hcd(vdev); + struct vhci *vhci = vhci_hcd->vhci; struct vhci_unlink *unlink; struct urb *urb; unsigned long flags; @@ -177,10 +179,10 @@ static void vhci_recv_ret_unlink(struct vhci_device *vdev, pr_info("urb->status %d\n", urb->status); spin_lock_irqsave(&vhci->lock, flags); - usb_hcd_unlink_urb_from_ep(vhci_hcd_to_hcd(vhci), urb); + usb_hcd_unlink_urb_from_ep(vhci_hcd_to_hcd(vhci_hcd), urb); spin_unlock_irqrestore(&vhci->lock, flags); - usb_hcd_giveback_urb(vhci_hcd_to_hcd(vhci), urb, urb->status); + usb_hcd_giveback_urb(vhci_hcd_to_hcd(vhci_hcd), urb, urb->status); } kfree(unlink); |