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>
This commit is contained in:

کامیت شده توسط
Greg Kroah-Hartman

والد
d0374f4f9c
کامیت
28b9325e6a
@@ -129,6 +129,8 @@ struct uhci_qh {
|
||||
__le32 element; /* Queue element (TD) pointer */
|
||||
|
||||
/* Software fields */
|
||||
dma_addr_t dma_handle;
|
||||
|
||||
struct list_head node; /* Node in the list of QHs */
|
||||
struct usb_host_endpoint *hep; /* Endpoint information */
|
||||
struct usb_device *udev;
|
||||
@@ -150,8 +152,6 @@ struct uhci_qh {
|
||||
int state; /* QH_STATE_xxx; see above */
|
||||
int type; /* Queue type (control, bulk, etc) */
|
||||
|
||||
dma_addr_t dma_handle;
|
||||
|
||||
unsigned int initial_toggle:1; /* Endpoint's current toggle value */
|
||||
unsigned int needs_fixup:1; /* Must fix the TD toggle values */
|
||||
unsigned int is_stopped:1; /* Queue was stopped by error/unlink */
|
||||
@@ -171,6 +171,8 @@ static inline __le32 qh_element(struct uhci_qh *qh) {
|
||||
return element;
|
||||
}
|
||||
|
||||
#define LINK_TO_QH(qh) (UHCI_PTR_QH | cpu_to_le32((qh)->dma_handle))
|
||||
|
||||
|
||||
/*
|
||||
* Transfer Descriptors
|
||||
@@ -264,6 +266,8 @@ static inline u32 td_status(struct uhci_td *td) {
|
||||
return le32_to_cpu(status);
|
||||
}
|
||||
|
||||
#define LINK_TO_TD(td) (cpu_to_le32((td)->dma_handle))
|
||||
|
||||
|
||||
/*
|
||||
* Skeleton Queue Headers
|
||||
|
مرجع در شماره جدید
Block a user