fix USB driver to compile with ADMH_VERBOSE_DEBUG defined

SVN-Revision: 9593
master
Gabor Juhos 17 years ago
parent 5a1a5dcf58
commit 4263fdd731
  1. 11
      target/linux/adm5120/files/drivers/usb/host/adm5120-dbg.c
  2. 5
      target/linux/adm5120/files/drivers/usb/host/adm5120-hcd.c
  3. 10
      target/linux/adm5120/files/drivers/usb/host/adm5120-q.c

@ -81,7 +81,7 @@ urb_print(struct admhcd *ahcd, struct urb *urb, char * str, int small)
unsigned int pipe = urb->pipe;
if (!urb->dev || !urb->dev->bus) {
admhc_dbg("%s URB: no dev", str);
admhc_dbg(ahcd, "%s URB: no dev", str);
return;
}
@ -89,7 +89,7 @@ urb_print(struct admhcd *ahcd, struct urb *urb, char * str, int small)
if (urb->status != 0)
#endif
admhc_dbg(ahcd, "URB-%s %p dev=%d ep=%d%s-%s flags=%x len=%d/%d "
"stat=%d",
"stat=%d\n",
str,
urb,
usb_pipedevice (pipe),
@ -112,14 +112,14 @@ urb_print(struct admhcd *ahcd, struct urb *urb, char * str, int small)
printk ("\n");
}
if (urb->transfer_buffer_length > 0 && urb->transfer_buffer) {
printk(KERN_DEBUG __FILE__ ": data(%d/%d):",
admhc_dbg(ahcd, "data(%d/%d):",
urb->actual_length,
urb->transfer_buffer_length);
len = usb_pipeout(pipe)?
urb->transfer_buffer_length: urb->actual_length;
for (i = 0; i < 16 && i < len; i++)
printk(" %02x", ((__u8 *)urb->transfer_buffer)[i]);
admhc_dbg("%s stat:%d\n", i < len? "...": "", urb->status);
printk("%s stat:%d\n", i < len? "...": "", urb->status);
}
}
#endif /* ADMHC_VERBOSE_DEBUG */
@ -363,7 +363,8 @@ admhc_dump_ed(const struct admhcd *ahcd, const char *label,
#else /* ifdef DEBUG */
static inline void urb_print(struct urb * urb, char * str, int small) {}
static inline void urb_print(struct admhcd *ahcd, struct urb * urb, char * str,
int small) {}
static inline void admhc_dump_ed(const struct admhcd *ahcd, const char *label,
const struct ed *ed, int verbose) {}
static inline void admhc_dump_td(const struct admhcd *ahcd, const char *label,

@ -45,7 +45,7 @@
#include "../core/hcd.h"
#include "../core/hub.h"
#define DRIVER_VERSION "v0.10"
#define DRIVER_VERSION "v0.10.1"
#define DRIVER_AUTHOR "Gabor Juhos <juhosg at openwrt.org>"
#define DRIVER_DESC "ADMtek USB 1.1 Host Controller Driver"
@ -228,11 +228,12 @@ static int admhc_urb_dequeue(struct usb_hcd *hcd, struct urb *urb)
struct admhcd *ahcd = hcd_to_admhcd(hcd);
unsigned long flags;
spin_lock_irqsave(&ahcd->lock, flags);
#ifdef ADMHC_VERBOSE_DEBUG
urb_print(ahcd, urb, "DEQUEUE", 1);
#endif
spin_lock_irqsave(&ahcd->lock, flags);
if (HC_IS_RUNNING(hcd->state)) {
struct urb_priv *urb_priv;

@ -38,7 +38,7 @@ __acquires(ahcd->lock)
&& urb->status == 0) {
urb->status = -EREMOTEIO;
#ifdef ADMHC_VERBOSE_DEBUG
urb_print(urb, "SHORT", usb_pipeout (urb->pipe));
urb_print(ahcd, urb, "SHORT", usb_pipeout(urb->pipe));
#endif
}
spin_unlock(&urb->lock);
@ -53,7 +53,7 @@ __acquires(ahcd->lock)
}
#ifdef ADMHC_VERBOSE_DEBUG
urb_print(urb, "RET", usb_pipeout (urb->pipe));
urb_print(ahcd, urb, "RET", usb_pipeout (urb->pipe));
#endif
/* urb->complete() can reenter this HCD */
@ -432,9 +432,7 @@ static void td_submit_urb(struct admhcd *ahcd, struct urb *urb)
int cnt = 0;
u32 info = 0;
int is_out = usb_pipeout(urb->pipe);
int periodic = 0;
u32 toggle = 0;
struct td *td;
/* OHCI handles the bulk/interrupt data toggles itself. We just
* use the device toggle bits for resetting, and rely on the fact
@ -795,7 +793,7 @@ rescan_this:
*prev = td->hwNextTD | savebits;
/* HC may have partly processed this TD */
urb_print(urb, "PARTIAL", 1);
urb_print(ahcd, urb, "PARTIAL", 1);
td_done(ahcd, urb, td);
/* if URB is done, clean up */
@ -838,10 +836,8 @@ rescan_this:
static void ed_unhalt(struct admhcd *ahcd, struct ed *ed, struct urb *urb)
{
struct list_head *entry,*tmp;
struct urb_priv *urb_priv = urb->hcpriv;
__hc32 toggle = ed->hwHeadP & cpu_to_hc32(ahcd, ED_C);
#ifdef ADMHC_VERBOSE_DEBUG
admhc_dump_ed(ahcd, "UNHALT", ed, 0);
#endif

Loading…
Cancel
Save