1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-12-25 23:49:34 +02:00

[adm5120] usb-driver: add preliminary support of ISOCHRONOUS transfer

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@10077 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
juhosg 2008-01-01 14:37:50 +00:00
parent d710276d5d
commit 9fe061d4a7
8 changed files with 57 additions and 32 deletions

View File

@ -1,13 +1,16 @@
/* /*
* ADM5120 HCD (Host Controller Driver) for USB * ADM5120 HCD (Host Controller Driver) for USB
* *
* Copyright (C) 2007 Gabor Juhos <juhosg at openwrt.org> * Copyright (C) 2007,2008 Gabor Juhos <juhosg at openwrt.org>
* *
* This file was derived from: drivers/usb/host/ohci-dbg.c * This file was derived from: drivers/usb/host/ohci-dbg.c
* (C) Copyright 1999 Roman Weissgaerber <weissg@vienna.at> * (C) Copyright 1999 Roman Weissgaerber <weissg@vienna.at>
* (C) Copyright 2000-2002 David Brownell <dbrownell@users.sourceforge.net> * (C) Copyright 2000-2002 David Brownell <dbrownell@users.sourceforge.net>
* *
* 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.
*
*/ */
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/* /*
* ADM5120 HCD (Host Controller Driver) for USB * ADM5120 HCD (Host Controller Driver) for USB
* *
* Copyright (C) 2007 Gabor Juhos <juhosg at openwrt.org> * Copyright (C) 2007,2008 Gabor Juhos <juhosg at openwrt.org>
* *
* This file was derived from: drivers/usb/host/ohci-au1xxx.c * This file was derived from: drivers/usb/host/ohci-au1xxx.c
* (C) Copyright 1999 Roman Weissgaerber <weissg@vienna.at> * (C) Copyright 1999 Roman Weissgaerber <weissg@vienna.at>
@ -16,7 +16,10 @@
* Modified for AMD Alchemy Au1xxx * Modified for AMD Alchemy Au1xxx
* by Matt Porter <mporter@kernel.crashing.org> * by Matt Porter <mporter@kernel.crashing.org>
* *
* 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 <linux/platform_device.h> #include <linux/platform_device.h>

View File

@ -1,7 +1,7 @@
/* /*
* ADM5120 HCD (Host Controller Driver) for USB * ADM5120 HCD (Host Controller Driver) for USB
* *
* Copyright (C) 2007 Gabor Juhos <juhosg at openwrt.org> * Copyright (C) 2007,2008 Gabor Juhos <juhosg at openwrt.org>
* *
* This file was derived from: drivers/usb/host/ohci-hcd.c * This file was derived from: drivers/usb/host/ohci-hcd.c
* (C) Copyright 1999 Roman Weissgaerber <weissg@vienna.at> * (C) Copyright 1999 Roman Weissgaerber <weissg@vienna.at>
@ -12,7 +12,10 @@
* [ (C) Copyright 1999 Linus Torvalds ] * [ (C) Copyright 1999 Linus Torvalds ]
* [ (C) Copyright 1999 Gregory P. Smith] * [ (C) Copyright 1999 Gregory P. Smith]
* *
* 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 <linux/module.h> #include <linux/module.h>
@ -42,7 +45,7 @@
#include "../core/hcd.h" #include "../core/hcd.h"
#include "../core/hub.h" #include "../core/hub.h"
#define DRIVER_VERSION "0.14.1" #define DRIVER_VERSION "0.16.0"
#define DRIVER_AUTHOR "Gabor Juhos <juhosg at openwrt.org>" #define DRIVER_AUTHOR "Gabor Juhos <juhosg at openwrt.org>"
#define DRIVER_DESC "ADMtek USB 1.1 Host Controller Driver" #define DRIVER_DESC "ADMtek USB 1.1 Host Controller Driver"

View File

@ -1,13 +1,16 @@
/* /*
* ADM5120 HCD (Host Controller Driver) for USB * ADM5120 HCD (Host Controller Driver) for USB
* *
* Copyright (C) 2007 Gabor Juhos <juhosg at openwrt.org> * Copyright (C) 2007,2008 Gabor Juhos <juhosg at openwrt.org>
* *
* This file was derived from: drivers/usb/host/ohci-hub.c * This file was derived from: drivers/usb/host/ohci-hub.c
* (C) Copyright 1999 Roman Weissgaerber <weissg@vienna.at> * (C) Copyright 1999 Roman Weissgaerber <weissg@vienna.at>
* (C) Copyright 2000-2004 David Brownell <dbrownell@users.sourceforge.net> * (C) Copyright 2000-2004 David Brownell <dbrownell@users.sourceforge.net>
* *
* 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.
*
*/ */
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/

View File

@ -1,13 +1,16 @@
/* /*
* ADM5120 HCD (Host Controller Driver) for USB * ADM5120 HCD (Host Controller Driver) for USB
* *
* Copyright (C) 2007 Gabor Juhos <juhosg at openwrt.org> * Copyright (C) 2007,2008 Gabor Juhos <juhosg at openwrt.org>
* *
* This file was derived from: drivers/usb/host/ohci-mem.c * This file was derived from: drivers/usb/host/ohci-mem.c
* (C) Copyright 1999 Roman Weissgaerber <weissg@vienna.at> * (C) Copyright 1999 Roman Weissgaerber <weissg@vienna.at>
* (C) Copyright 2000-2002 David Brownell <dbrownell@users.sourceforge.net> * (C) Copyright 2000-2002 David Brownell <dbrownell@users.sourceforge.net>
* *
* 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.
*
*/ */
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/

View File

@ -1,13 +1,16 @@
/* /*
* ADM5120 HCD (Host Controller Driver) for USB * ADM5120 HCD (Host Controller Driver) for USB
* *
* Copyright (C) 2007 Gabor Juhos <juhosg at openwrt.org> * Copyright (C) 2007,2008 Gabor Juhos <juhosg at openwrt.org>
* *
* This file was derived from fragments of the OHCI driver. * This file was derived from fragments of the OHCI driver.
* (C) Copyright 1999 Roman Weissgaerber <weissg@vienna.at> * (C) Copyright 1999 Roman Weissgaerber <weissg@vienna.at>
* (C) Copyright 2000-2004 David Brownell <dbrownell@users.sourceforge.net> * (C) Copyright 2000-2004 David Brownell <dbrownell@users.sourceforge.net>
* *
* 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.
*
*/ */
#define OHCI_SCHED_ENABLES \ #define OHCI_SCHED_ENABLES \

View File

@ -1,13 +1,16 @@
/* /*
* ADM5120 HCD (Host Controller Driver) for USB * ADM5120 HCD (Host Controller Driver) for USB
* *
* Copyright (C) 2007 Gabor Juhos <juhosg at openwrt.org> * Copyright (C) 2007,2008 Gabor Juhos <juhosg at openwrt.org>
* *
* This file was derived from: drivers/usb/host/ohci-q.c * This file was derived from: drivers/usb/host/ohci-q.c
* (C) Copyright 1999 Roman Weissgaerber <weissg@vienna.at> * (C) Copyright 1999 Roman Weissgaerber <weissg@vienna.at>
* (C) Copyright 2000-2002 David Brownell <dbrownell@users.sourceforge.net> * (C) Copyright 2000-2002 David Brownell <dbrownell@users.sourceforge.net>
* *
* 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 <linux/irq.h> #include <linux/irq.h>
@ -571,34 +574,38 @@ static void td_submit_urb(struct admhcd *ahcd, struct urb *urb)
static int td_done(struct admhcd *ahcd, struct urb *urb, struct td *td) static int td_done(struct admhcd *ahcd, struct urb *urb, struct td *td)
{ {
struct urb_priv *urb_priv = urb->hcpriv; 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 type = usb_pipetype(urb->pipe);
int cc; 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); cc = TD_CC_GET(info);
/* ISO ... drivers see per-TD length/status */ /* ISO ... drivers see per-TD length/status */
if (type == PIPE_ISOCHRONOUS) { if (type == PIPE_ISOCHRONOUS) {
#if 0
/* TODO */ /* TODO */
int dlen = 0; int dlen = 0;
/* NOTE: assumes FC in tdINFO == 0, and that /* NOTE: assumes FC in tdINFO == 0, and that
* only the first of 0..MAXPSW psws is used. * only the first of 0..MAXPSW psws is used.
*/ */
#if 0
cc = TD_CC_GET(td);
if (tdINFO & TD_CC) /* hc didn't touch? */ if (tdINFO & TD_CC) /* hc didn't touch? */
return; return;
#endif
if (usb_pipeout(urb->pipe)) if (usb_pipeout(urb->pipe))
dlen = urb->iso_frame_desc[td->index].length; dlen = urb->iso_frame_desc[td->index].length;
else { else {
/* short reads are always OK for ISO */ /* short reads are always OK for ISO */
if (cc == TD_DATAUNDERRUN) if (cc == TD_CC_DATAUNDERRUN)
cc = TD_CC_NOERROR; cc = TD_CC_NOERROR;
dlen = tdPSW & 0x3ff; dlen = tdDBP - td->data_dma + bl;
} }
urb->actual_length += dlen; urb->actual_length += dlen;
urb->iso_frame_desc[td->index].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].status = cc_to_error[cc];
@ -607,15 +614,12 @@ static int td_done(struct admhcd *ahcd, struct urb *urb, struct td *td)
admhc_vdbg (ahcd, admhc_vdbg (ahcd,
"urb %p iso td %p (%d) len %d cc %d\n", "urb %p iso td %p (%d) len %d cc %d\n",
urb, td, 1 + td->index, dlen, cc); urb, td, 1 + td->index, dlen, cc);
#endif
/* BULK, INT, CONTROL ... drivers see aggregate length/status, /* BULK, INT, CONTROL ... drivers see aggregate length/status,
* except that "setup" bytes aren't counted and "short" transfers * except that "setup" bytes aren't counted and "short" transfers
* might not be reported as errors. * might not be reported as errors.
*/ */
} else { } 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) */ /* update packet status if needed (short is normally ok) */
if (cc == TD_CC_DATAUNDERRUN if (cc == TD_CC_DATAUNDERRUN
&& !(urb->transfer_flags & URB_SHORT_NOT_OK)) && !(urb->transfer_flags & URB_SHORT_NOT_OK))

View File

@ -1,13 +1,16 @@
/* /*
* ADM5120 HCD (Host Controller Driver) for USB * ADM5120 HCD (Host Controller Driver) for USB
* *
* Copyright (C) 2007 Gabor Juhos <juhosg at openwrt.org> * Copyright (C) 2007,2008 Gabor Juhos <juhosg at openwrt.org>
* *
* This file was derived from: drivers/usb/host/ohci.h * This file was derived from: drivers/usb/host/ohci.h
* (C) Copyright 1999 Roman Weissgaerber <weissg@vienna.at> * (C) Copyright 1999 Roman Weissgaerber <weissg@vienna.at>
* (C) Copyright 2000-2002 David Brownell <dbrownell@users.sourceforge.net> * (C) Copyright 2000-2002 David Brownell <dbrownell@users.sourceforge.net>
* *
* 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.
*
*/ */
/* /*