diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2007-08-21 15:39:21 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-10-12 17:55:19 -0400 |
commit | b0d9efba3ec53468984aecef8eeaf079089f2e5a (patch) | |
tree | a372d053daddc5ff041949b80bab347317a76938 /drivers/usb/host/r8a66597-hcd.c | |
parent | ee7d1f3f0c32d8abe9627aa73dc62ee5bf2daf7f (diff) |
USB: centralize -EREMOTEIO handling
This patch (as969) continues the ongoing changes to the way HCDs
report URB statuses. The programming interface has been simplified by
making usbcore responsible for clearing urb->hcpriv and for setting
-EREMOTEIO status when an URB with the URB_SHORT_NOT_OK flag ends up
as a short transfer.
By moving the work out of the HCDs, this removes a fair amount of
repeated code.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
CC: David Brownell <david-b@pacbell.net>
CC: Olav Kongas <ok@artecdesign.ee>
CC: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
CC: Tony Olech <tony.olech@elandigitalsystems.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host/r8a66597-hcd.c')
-rw-r--r-- | drivers/usb/host/r8a66597-hcd.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/usb/host/r8a66597-hcd.c b/drivers/usb/host/r8a66597-hcd.c index 49cf998c172a..60248b01ce14 100644 --- a/drivers/usb/host/r8a66597-hcd.c +++ b/drivers/usb/host/r8a66597-hcd.c | |||
@@ -783,7 +783,6 @@ static void force_dequeue(struct r8a66597 *r8a66597, u16 pipenum, u16 address) | |||
783 | 783 | ||
784 | if (urb) { | 784 | if (urb) { |
785 | urb->status = -ENODEV; | 785 | urb->status = -ENODEV; |
786 | urb->hcpriv = NULL; | ||
787 | usb_hcd_unlink_urb_from_ep(r8a66597_to_hcd(r8a66597), | 786 | usb_hcd_unlink_urb_from_ep(r8a66597_to_hcd(r8a66597), |
788 | urb); | 787 | urb); |
789 | 788 | ||
@@ -1134,7 +1133,6 @@ __releases(r8a66597->lock) __acquires(r8a66597->lock) | |||
1134 | if (usb_pipeisoc(urb->pipe)) | 1133 | if (usb_pipeisoc(urb->pipe)) |
1135 | urb->start_frame = r8a66597_get_frame(hcd); | 1134 | urb->start_frame = r8a66597_get_frame(hcd); |
1136 | 1135 | ||
1137 | urb->hcpriv = NULL; | ||
1138 | usb_hcd_unlink_urb_from_ep(r8a66597_to_hcd(r8a66597), urb); | 1136 | usb_hcd_unlink_urb_from_ep(r8a66597_to_hcd(r8a66597), urb); |
1139 | 1137 | ||
1140 | spin_unlock(&r8a66597->lock); | 1138 | spin_unlock(&r8a66597->lock); |
@@ -1202,9 +1200,6 @@ static void packet_read(struct r8a66597 *r8a66597, u16 pipenum) | |||
1202 | td->zero_packet = 1; | 1200 | td->zero_packet = 1; |
1203 | if (rcv_len < bufsize) { | 1201 | if (rcv_len < bufsize) { |
1204 | td->short_packet = 1; | 1202 | td->short_packet = 1; |
1205 | if (urb->transfer_buffer_length != urb->actual_length && | ||
1206 | urb->transfer_flags & URB_SHORT_NOT_OK) | ||
1207 | status = -EREMOTEIO; | ||
1208 | } | 1203 | } |
1209 | if (usb_pipeisoc(urb->pipe)) { | 1204 | if (usb_pipeisoc(urb->pipe)) { |
1210 | urb->iso_frame_desc[td->iso_cnt].actual_length = size; | 1205 | urb->iso_frame_desc[td->iso_cnt].actual_length = size; |
@@ -1214,7 +1209,7 @@ static void packet_read(struct r8a66597 *r8a66597, u16 pipenum) | |||
1214 | } | 1209 | } |
1215 | 1210 | ||
1216 | /* check transfer finish */ | 1211 | /* check transfer finish */ |
1217 | if (check_transfer_finish(td, urb)) { | 1212 | if (finish || check_transfer_finish(td, urb)) { |
1218 | pipe_stop(r8a66597, td->pipe); | 1213 | pipe_stop(r8a66597, td->pipe); |
1219 | pipe_irq_disable(r8a66597, pipenum); | 1214 | pipe_irq_disable(r8a66597, pipenum); |
1220 | finish = 1; | 1215 | finish = 1; |