usb: xhci: Fix panic if disconnect
[pandora-kernel.git] / drivers / usb / host / uhci-q.c
index 84ed28b..d2c6f5a 100644 (file)
@@ -280,7 +280,7 @@ static struct uhci_qh *uhci_alloc_qh(struct uhci_hcd *uhci,
                        qh->load = usb_calc_bus_time(udev->speed,
                                        usb_endpoint_dir_in(&hep->desc),
                                        qh->type == USB_ENDPOINT_XFER_ISOC,
-                                       le16_to_cpu(hep->desc.wMaxPacketSize))
+                                       usb_endpoint_maxp(&hep->desc))
                                / 1000 + 1;
 
        } else {                /* Skeleton QH */
@@ -792,7 +792,7 @@ static int uhci_submit_control(struct uhci_hcd *uhci, struct urb *urb,
 {
        struct uhci_td *td;
        unsigned long destination, status;
-       int maxsze = le16_to_cpu(qh->hep->desc.wMaxPacketSize);
+       int maxsze = usb_endpoint_maxp(&qh->hep->desc);
        int len = urb->transfer_buffer_length;
        dma_addr_t data = urb->transfer_dma;
        __hc32 *plink;
@@ -918,7 +918,7 @@ static int uhci_submit_common(struct uhci_hcd *uhci, struct urb *urb,
 {
        struct uhci_td *td;
        unsigned long destination, status;
-       int maxsze = le16_to_cpu(qh->hep->desc.wMaxPacketSize);
+       int maxsze = usb_endpoint_maxp(&qh->hep->desc);
        int len = urb->transfer_buffer_length;
        int this_sg_len;
        dma_addr_t data;
@@ -943,7 +943,7 @@ static int uhci_submit_common(struct uhci_hcd *uhci, struct urb *urb,
        if (usb_pipein(urb->pipe))
                status |= TD_CTRL_SPD;
 
-       i = urb->num_sgs;
+       i = urb->num_mapped_sgs;
        if (len > 0 && i > 0) {
                sg = urb->sg;
                data = sg_dma_address(sg);