summaryrefslogtreecommitdiff
path: root/include/usb.h
diff options
context:
space:
mode:
authorWolfgang Denk <wd@pollux.denx.de>2006-11-27 16:52:20 +0100
committerWolfgang Denk <wd@denx.de>2006-11-27 16:52:20 +0100
commit83dc830b1693252d996bda920cd5f3161d7c64a9 (patch)
tree7ddf0efb7a5dc45e38b82e7a0625f794352a8acd /include/usb.h
parentd3c5e8b2f5945d93de8f23b053e9dcd033983245 (diff)
parent58b485776698c3d71ec5a215e392123b4c15afa3 (diff)
downloadu-boot-imx-83dc830b1693252d996bda920cd5f3161d7c64a9.zip
u-boot-imx-83dc830b1693252d996bda920cd5f3161d7c64a9.tar.gz
u-boot-imx-83dc830b1693252d996bda920cd5f3161d7c64a9.tar.bz2
Merge with /home/mk/git/u-boot-generic_ohci#generic_ohci
Diffstat (limited to 'include/usb.h')
-rw-r--r--include/usb.h17
1 files changed, 10 insertions, 7 deletions
diff --git a/include/usb.h b/include/usb.h
index bf71554..419a7e3 100644
--- a/include/usb.h
+++ b/include/usb.h
@@ -169,7 +169,7 @@ struct usb_device {
* this is how the lowlevel part communicate with the outer world
*/
-#if defined(CONFIG_USB_UHCI) || defined(CONFIG_USB_OHCI) || defined (CONFIG_USB_SL811HS)
+#if defined(CONFIG_USB_UHCI) || defined(CONFIG_USB_OHCI) || defined (CONFIG_USB_SL811HS) || defined(CONFIG_USB_OHCI_NEW)
int usb_lowlevel_init(void);
int usb_lowlevel_stop(void);
int submit_bulk_msg(struct usb_device *dev, unsigned long pipe, void *buffer,int transfer_len);
@@ -230,16 +230,12 @@ int usb_set_interface(struct usb_device *dev, int interface, int alternate);
/* big endian -> little endian conversion */
/* some CPUs are already little endian e.g. the ARM920T */
-#ifdef LITTLEENDIAN
-#define swap_16(x) ((unsigned short)(x))
-#define swap_32(x) ((unsigned long)(x))
-#else
-#define swap_16(x) \
+#define __swap_16(x) \
({ unsigned short x_ = (unsigned short)x; \
(unsigned short)( \
((x_ & 0x00FFU) << 8) | ((x_ & 0xFF00U) >> 8) ); \
})
-#define swap_32(x) \
+#define __swap_32(x) \
({ unsigned long x_ = (unsigned long)x; \
(unsigned long)( \
((x_ & 0x000000FFUL) << 24) | \
@@ -247,6 +243,13 @@ int usb_set_interface(struct usb_device *dev, int interface, int alternate);
((x_ & 0x00FF0000UL) >> 8) | \
((x_ & 0xFF000000UL) >> 24) ); \
})
+
+#ifdef LITTLEENDIAN
+# define swap_16(x) (x)
+# define swap_32(x) (x)
+#else
+# define swap_16(x) __swap_16(x)
+# define swap_32(x) __swap_32(x)
#endif /* LITTLEENDIAN */
/*