diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2007-02-19 15:51:51 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-02-23 18:03:45 -0500 |
commit | 28b9325e6ae45ffb5e99fedcafe00f25fcaacf06 (patch) | |
tree | 91391a8e2d11acc50adc5b7c631b2695bee9e453 /drivers/usb/host/uhci-debug.c | |
parent | d0374f4f9c35cdfbee0ade72d06732613b4e6628 (diff) |
UHCI: Add macros for computing DMA values
This patch (as855) adds some convenience macros to uhci-hcd, to help
simplify the code for computing hardware DMA pointers.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host/uhci-debug.c')
-rw-r--r-- | drivers/usb/host/uhci-debug.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/usb/host/uhci-debug.c b/drivers/usb/host/uhci-debug.c index 5d6c06bc4524..a0677133577b 100644 --- a/drivers/usb/host/uhci-debug.c +++ b/drivers/usb/host/uhci-debug.c | |||
@@ -196,7 +196,7 @@ static int uhci_show_qh(struct uhci_qh *qh, char *buf, int len, int space) | |||
196 | struct uhci_td *td = list_entry(urbp->td_list.next, | 196 | struct uhci_td *td = list_entry(urbp->td_list.next, |
197 | struct uhci_td, list); | 197 | struct uhci_td, list); |
198 | 198 | ||
199 | if (cpu_to_le32(td->dma_handle) != (element & ~UHCI_PTR_BITS)) | 199 | if (element != LINK_TO_TD(td)) |
200 | out += sprintf(out, "%*s Element != First TD\n", | 200 | out += sprintf(out, "%*s Element != First TD\n", |
201 | space, ""); | 201 | space, ""); |
202 | i = nurbs = 0; | 202 | i = nurbs = 0; |
@@ -393,7 +393,7 @@ static int uhci_sprint_schedule(struct uhci_hcd *uhci, char *buf, int len) | |||
393 | do { | 393 | do { |
394 | td = list_entry(tmp, struct uhci_td, fl_list); | 394 | td = list_entry(tmp, struct uhci_td, fl_list); |
395 | tmp = tmp->next; | 395 | tmp = tmp->next; |
396 | if (cpu_to_le32(td->dma_handle) != link) { | 396 | if (link != LINK_TO_TD(td)) { |
397 | if (nframes > 0) | 397 | if (nframes > 0) |
398 | out += sprintf(out, " link does " | 398 | out += sprintf(out, " link does " |
399 | "not match list entry!\n"); | 399 | "not match list entry!\n"); |
@@ -440,7 +440,7 @@ check_link: | |||
440 | if (qh->link != UHCI_PTR_TERM) | 440 | if (qh->link != UHCI_PTR_TERM) |
441 | out += sprintf(out, " bandwidth reclamation on!\n"); | 441 | out += sprintf(out, " bandwidth reclamation on!\n"); |
442 | 442 | ||
443 | if (qh_element(qh) != cpu_to_le32(uhci->term_td->dma_handle)) | 443 | if (qh_element(qh) != LINK_TO_TD(uhci->term_td)) |
444 | out += sprintf(out, " skel_term_qh element is not set to term_td!\n"); | 444 | out += sprintf(out, " skel_term_qh element is not set to term_td!\n"); |
445 | 445 | ||
446 | continue; | 446 | continue; |
@@ -461,8 +461,7 @@ check_link: | |||
461 | out += sprintf(out, " Skipped %d QHs\n", cnt); | 461 | out += sprintf(out, " Skipped %d QHs\n", cnt); |
462 | 462 | ||
463 | if (i > 1 && i < UHCI_NUM_SKELQH - 1) { | 463 | if (i > 1 && i < UHCI_NUM_SKELQH - 1) { |
464 | if (qh->link != | 464 | if (qh->link != LINK_TO_QH(uhci->skelqh[j])) |
465 | (cpu_to_le32(uhci->skelqh[j]->dma_handle) | UHCI_PTR_QH)) | ||
466 | out += sprintf(out, " last QH not linked to next skeleton!\n"); | 465 | out += sprintf(out, " last QH not linked to next skeleton!\n"); |
467 | } | 466 | } |
468 | } | 467 | } |