usb: host: use usb_endpoint_maxp instead of usb_maxpacket
fhci_queue_urb() shouldn't use urb->pipe to compute the maxpacket size anyway.It should use usb_endpoint_maxp(&urb->ep->desc). Signed-off-by: Yan Zhu <zhuyan34@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
381419fa72
commit
9bcb762ce0
|
@ -727,8 +727,7 @@ void fhci_queue_urb(struct fhci_hcd *fhci, struct urb *urb)
|
||||||
}
|
}
|
||||||
ed->speed = (urb->dev->speed == USB_SPEED_LOW) ?
|
ed->speed = (urb->dev->speed == USB_SPEED_LOW) ?
|
||||||
FHCI_LOW_SPEED : FHCI_FULL_SPEED;
|
FHCI_LOW_SPEED : FHCI_FULL_SPEED;
|
||||||
ed->max_pkt_size = usb_maxpacket(urb->dev,
|
ed->max_pkt_size = usb_endpoint_maxp(&urb->ep->desc);
|
||||||
urb->pipe, usb_pipeout(urb->pipe));
|
|
||||||
urb->ep->hcpriv = ed;
|
urb->ep->hcpriv = ed;
|
||||||
fhci_dbg(fhci, "new ep speed=%d max_pkt_size=%d\n",
|
fhci_dbg(fhci, "new ep speed=%d max_pkt_size=%d\n",
|
||||||
ed->speed, ed->max_pkt_size);
|
ed->speed, ed->max_pkt_size);
|
||||||
|
@ -768,8 +767,7 @@ void fhci_queue_urb(struct fhci_hcd *fhci, struct urb *urb)
|
||||||
if (urb->transfer_flags & URB_ZERO_PACKET &&
|
if (urb->transfer_flags & URB_ZERO_PACKET &&
|
||||||
urb->transfer_buffer_length > 0 &&
|
urb->transfer_buffer_length > 0 &&
|
||||||
((urb->transfer_buffer_length %
|
((urb->transfer_buffer_length %
|
||||||
usb_maxpacket(urb->dev, urb->pipe,
|
usb_endpoint_maxp(&urb->ep->desc)) == 0))
|
||||||
usb_pipeout(urb->pipe))) == 0))
|
|
||||||
urb_state = US_BULK0;
|
urb_state = US_BULK0;
|
||||||
while (data_len > 4096) {
|
while (data_len > 4096) {
|
||||||
td = fhci_td_fill(fhci, urb, urb_priv, ed, cnt,
|
td = fhci_td_fill(fhci, urb, urb_priv, ed, cnt,
|
||||||
|
@ -807,8 +805,8 @@ void fhci_queue_urb(struct fhci_hcd *fhci, struct urb *urb)
|
||||||
break;
|
break;
|
||||||
case FHCI_TF_CTRL:
|
case FHCI_TF_CTRL:
|
||||||
ed->dev_addr = usb_pipedevice(urb->pipe);
|
ed->dev_addr = usb_pipedevice(urb->pipe);
|
||||||
ed->max_pkt_size = usb_maxpacket(urb->dev, urb->pipe,
|
ed->max_pkt_size = usb_endpoint_maxp(&urb->ep->desc);
|
||||||
usb_pipeout(urb->pipe));
|
|
||||||
/* setup stage */
|
/* setup stage */
|
||||||
td = fhci_td_fill(fhci, urb, urb_priv, ed, cnt++, FHCI_TA_SETUP,
|
td = fhci_td_fill(fhci, urb, urb_priv, ed, cnt++, FHCI_TA_SETUP,
|
||||||
USB_TD_TOGGLE_DATA0, urb->setup_packet, 8, 0, 0, true);
|
USB_TD_TOGGLE_DATA0, urb->setup_packet, 8, 0, 0, true);
|
||||||
|
|
Loading…
Reference in New Issue