diff options
author | Markus Klotzbuecher <mk@denx.de> | 2007-03-23 09:52:17 +0100 |
---|---|---|
committer | Markus Klotzbuecher <mk@pollux.denx.de> | 2007-03-23 09:52:17 +0100 |
commit | f2b07ebd32e42a5b1126c98efc768ddb8908de62 (patch) | |
tree | e2a374a15d0abf6872fbbdeecf8e34855e56d3c9 /include/usb.h | |
parent | 44ba464b99001f8bd1c456a1e9d59726252f707a (diff) | |
parent | 83dc830b1693252d996bda920cd5f3161d7c64a9 (diff) |
Merge with git://www.denx.de/git/u-boot.git#testing-USB
Diffstat (limited to 'include/usb.h')
-rw-r--r-- | include/usb.h | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/include/usb.h b/include/usb.h index bf7155404..419a7e364 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 */ /* |