aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/uhci-hcd.c
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2007-02-19 15:51:51 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2007-02-23 18:03:45 -0500
commit28b9325e6ae45ffb5e99fedcafe00f25fcaacf06 (patch)
tree91391a8e2d11acc50adc5b7c631b2695bee9e453 /drivers/usb/host/uhci-hcd.c
parentd0374f4f9c35cdfbee0ade72d06732613b4e6628 (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-hcd.c')
-rw-r--r--drivers/usb/host/uhci-hcd.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/drivers/usb/host/uhci-hcd.c b/drivers/usb/host/uhci-hcd.c
index ded4df30a631..1f0833ab294a 100644
--- a/drivers/usb/host/uhci-hcd.c
+++ b/drivers/usb/host/uhci-hcd.c
@@ -116,7 +116,7 @@ static __le32 uhci_frame_skel_link(struct uhci_hcd *uhci, int frame)
116 skelnum = 8 - (int) __ffs(frame | UHCI_NUMFRAMES); 116 skelnum = 8 - (int) __ffs(frame | UHCI_NUMFRAMES);
117 if (skelnum <= 1) 117 if (skelnum <= 1)
118 skelnum = 9; 118 skelnum = 9;
119 return UHCI_PTR_QH | cpu_to_le32(uhci->skelqh[skelnum]->dma_handle); 119 return LINK_TO_QH(uhci->skelqh[skelnum]);
120} 120}
121 121
122#include "uhci-debug.c" 122#include "uhci-debug.c"
@@ -635,25 +635,21 @@ static int uhci_start(struct usb_hcd *hcd)
635 uhci->skel_int16_qh->link = 635 uhci->skel_int16_qh->link =
636 uhci->skel_int8_qh->link = 636 uhci->skel_int8_qh->link =
637 uhci->skel_int4_qh->link = 637 uhci->skel_int4_qh->link =
638 uhci->skel_int2_qh->link = UHCI_PTR_QH | 638 uhci->skel_int2_qh->link = LINK_TO_QH(
639 cpu_to_le32(uhci->skel_int1_qh->dma_handle); 639 uhci->skel_int1_qh);
640 640
641 uhci->skel_int1_qh->link = UHCI_PTR_QH | 641 uhci->skel_int1_qh->link = LINK_TO_QH(uhci->skel_ls_control_qh);
642 cpu_to_le32(uhci->skel_ls_control_qh->dma_handle); 642 uhci->skel_ls_control_qh->link = LINK_TO_QH(uhci->skel_fs_control_qh);
643 uhci->skel_ls_control_qh->link = UHCI_PTR_QH | 643 uhci->skel_fs_control_qh->link = LINK_TO_QH(uhci->skel_bulk_qh);
644 cpu_to_le32(uhci->skel_fs_control_qh->dma_handle); 644 uhci->skel_bulk_qh->link = LINK_TO_QH(uhci->skel_term_qh);
645 uhci->skel_fs_control_qh->link = UHCI_PTR_QH |
646 cpu_to_le32(uhci->skel_bulk_qh->dma_handle);
647 uhci->skel_bulk_qh->link = UHCI_PTR_QH |
648 cpu_to_le32(uhci->skel_term_qh->dma_handle);
649 645
650 /* This dummy TD is to work around a bug in Intel PIIX controllers */ 646 /* This dummy TD is to work around a bug in Intel PIIX controllers */
651 uhci_fill_td(uhci->term_td, 0, uhci_explen(0) | 647 uhci_fill_td(uhci->term_td, 0, uhci_explen(0) |
652 (0x7f << TD_TOKEN_DEVADDR_SHIFT) | USB_PID_IN, 0); 648 (0x7f << TD_TOKEN_DEVADDR_SHIFT) | USB_PID_IN, 0);
653 uhci->term_td->link = cpu_to_le32(uhci->term_td->dma_handle); 649 uhci->term_td->link = LINK_TO_TD(uhci->term_td);
654 650
655 uhci->skel_term_qh->link = UHCI_PTR_TERM; 651 uhci->skel_term_qh->link = UHCI_PTR_TERM;
656 uhci->skel_term_qh->element = cpu_to_le32(uhci->term_td->dma_handle); 652 uhci->skel_term_qh->element = LINK_TO_TD(uhci->term_td);
657 653
658 /* 654 /*
659 * Fill the frame list: make all entries point to the proper 655 * Fill the frame list: make all entries point to the proper