X-Git-Url: http://git.rohieb.name/openwrt.git/blobdiff_plain/b4f5ad450602411b30e6d9849ce0406a93ffb597..6d8520bc411b3836bbe557de4bf7ce6aaa4c5842:/target/linux/adm5120/files/drivers/usb/host/adm5120-q.c diff --git a/target/linux/adm5120/files/drivers/usb/host/adm5120-q.c b/target/linux/adm5120/files/drivers/usb/host/adm5120-q.c index 9995d4254..52bd1e4e8 100644 --- a/target/linux/adm5120/files/drivers/usb/host/adm5120-q.c +++ b/target/linux/adm5120/files/drivers/usb/host/adm5120-q.c @@ -1,13 +1,16 @@ /* * ADM5120 HCD (Host Controller Driver) for USB * - * Copyright (C) 2007 Gabor Juhos + * Copyright (C) 2007,2008 Gabor Juhos * * This file was derived from: drivers/usb/host/ohci-q.c * (C) Copyright 1999 Roman Weissgaerber * (C) Copyright 2000-2002 David Brownell * - * This file is licenced under the GPL. + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published + * by the Free Software Foundation. + * */ #include @@ -543,7 +546,10 @@ static void td_submit_urb(struct admhcd *ahcd, struct urb *urb) * we could often reduce the number of TDs here. */ case PIPE_ISOCHRONOUS: - info = TD_SCC_NOTACCESSED; + info = is_out + ? TD_T_CARRY | TD_SCC_NOTACCESSED | TD_DP_OUT + : TD_T_CARRY | TD_SCC_NOTACCESSED | TD_DP_IN; + for (cnt = 0; cnt < urb->number_of_packets; cnt++) { int frame = urb->start_frame; @@ -571,51 +577,52 @@ static void td_submit_urb(struct admhcd *ahcd, struct urb *urb) static int td_done(struct admhcd *ahcd, struct urb *urb, struct td *td) { struct urb_priv *urb_priv = urb->hcpriv; - u32 info = hc32_to_cpup(ahcd, &td->hwINFO); + u32 info; + u32 bl; + u32 tdDBP; int type = usb_pipetype(urb->pipe); int cc; + info = hc32_to_cpup(ahcd, &td->hwINFO); + tdDBP = hc32_to_cpup(ahcd, &td->hwDBP); + bl = TD_BL_GET(hc32_to_cpup(ahcd, &td->hwCBL)); cc = TD_CC_GET(info); /* ISO ... drivers see per-TD length/status */ if (type == PIPE_ISOCHRONOUS) { -#if 0 /* TODO */ int dlen = 0; /* NOTE: assumes FC in tdINFO == 0, and that * only the first of 0..MAXPSW psws is used. */ - - cc = TD_CC_GET(td); +#if 0 if (tdINFO & TD_CC) /* hc didn't touch? */ return; - - if (usb_pipeout (urb->pipe)) - dlen = urb->iso_frame_desc [td->index].length; +#endif + if (usb_pipeout(urb->pipe)) + dlen = urb->iso_frame_desc[td->index].length; else { /* short reads are always OK for ISO */ - if (cc == TD_DATAUNDERRUN) + if (cc == TD_CC_DATAUNDERRUN) cc = TD_CC_NOERROR; - dlen = tdPSW & 0x3ff; + dlen = tdDBP - td->data_dma + bl; } + urb->actual_length += dlen; - urb->iso_frame_desc [td->index].actual_length = dlen; - urb->iso_frame_desc [td->index].status = cc_to_error [cc]; + urb->iso_frame_desc[td->index].actual_length = dlen; + urb->iso_frame_desc[td->index].status = cc_to_error[cc]; if (cc != TD_CC_NOERROR) admhc_vdbg (ahcd, "urb %p iso td %p (%d) len %d cc %d\n", urb, td, 1 + td->index, dlen, cc); -#endif + /* BULK, INT, CONTROL ... drivers see aggregate length/status, * except that "setup" bytes aren't counted and "short" transfers * might not be reported as errors. */ } else { - u32 bl = TD_BL_GET(hc32_to_cpup(ahcd, &td->hwCBL)); - u32 tdDBP = hc32_to_cpup(ahcd, &td->hwDBP); - /* update packet status if needed (short is normally ok) */ if (cc == TD_CC_DATAUNDERRUN && !(urb->transfer_flags & URB_SHORT_NOT_OK))