From 192ed2a52453ccc059e6794cccb4df82f4d9d97a Mon Sep 17 00:00:00 2001 From: Josef Karthauser Date: Sun, 7 Apr 2002 15:41:45 +0000 Subject: [PATCH] Re-add the definitions of htole32(x) and le32toh(x) for OpenBSD. --- sys/dev/usb/ohci.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sys/dev/usb/ohci.c b/sys/dev/usb/ohci.c index 749f75fc2a0..1c54a4f7d3a 100644 --- a/sys/dev/usb/ohci.c +++ b/sys/dev/usb/ohci.c @@ -99,6 +99,20 @@ int ohcidebug = 1; #define DPRINTFN(n,x) #endif +/* + * The OHCI controller is little endian, so on big endian machines + * the data strored in memory needs to be swapped. + */ +#if defined(__OpenBSD__) +#if BYTE_ORDER == BIG_ENDIAN +#define htole32(x) (bswap32(x)) +#define le32toh(x) (bswap32(x)) +#else +#define htole32(x) (x) +#define le32toh(x) (x) +#endif +#endif + struct ohci_pipe; Static ohci_soft_ed_t *ohci_alloc_sed(ohci_softc_t *);