[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[MiNT] [PATCH][3/3] Remove USB endianess header files
Commit message:
Remove endianess support header files in USB directory that were
imported from U-Boot.
Contributed by David Galvez
diff -r e55aa706e8f4 -r df32c7c2a930 sys/usb/src.km/endian/byteorder.h
--- a/sys/usb/src.km/endian/byteorder.h Sat Jan 03 20:30:45 2015 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,114 +0,0 @@
-/*
- * Copyright (C) 2004-2007 Freescale Semiconductor, Inc.
- * TsiChung Liew (Tsi-Chung.Liew@freescale.com)
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-# ifndef _M68K_BYTEORDER_H
-# define _M68K_BYTEORDER_H
-
-# include <mint/ktypes.h>
-
-# ifdef __GNUC__
-# define __sw16(x) \
- ((__u16)( \
- (((__u16)(x) & (__u16)0x00ffU) << 8) | \
- (((__u16)(x) & (__u16)0xff00U) >> 8) ))
-# define __sw32(x) \
- ((__u32)( \
- (((__u32)(x)) << 24) | \
- (((__u32)(x) & (__u32)0x0000ff00UL) << 8) | \
- (((__u32)(x) & (__u32)0x00ff0000UL) >> 8) | \
- (((__u32)(x)) >> 24) ))
-
-/* declared protoypes to avoid warnings from -Wmissing-prototypes (see gcc manual)*/
-extern __inline__ unsigned ld_le16(const volatile unsigned short *addr);
-extern __inline__ void st_le16(volatile unsigned short *addr,
- const unsigned val);
-extern __inline__ unsigned ld_le32(const volatile unsigned *addr);
-extern __inline__ void st_le32(volatile unsigned *addr, const unsigned val);
-
-extern __inline__ unsigned ld_le16(const volatile unsigned short *addr)
-{
- unsigned result = *addr;
- return __sw16(result);
-}
-
-extern __inline__ void st_le16(volatile unsigned short *addr,
- const unsigned val)
-{
- *addr = __sw16(val);
-}
-
-extern __inline__ unsigned ld_le32(const volatile unsigned *addr)
-{
- unsigned result = *addr;
- return __sw32(result);
-}
-
-extern __inline__ void st_le32(volatile unsigned *addr, const unsigned val)
-{
- *addr = __sw32(val);
-}
-
-# if 0
-/* alas, egcs sounds like it has a bug in this code that doesn't use the
- inline asm correctly, and can cause file corruption. Until I hear that
- it's fixed, I can live without the extra speed. I hope. */
-# if !(__GNUC__ >= 2 && __GNUC_MINOR__ >= 90)
-# if 0
-# define __arch_swab16(x) ld_le16(&x)
-# define __arch_swab32(x) ld_le32(&x)
-#else
-static __inline__ __attribute__ ((const))
-__u16 ___arch__swab16(__u16 value)
-{
- return __sw16(value);
-}
-
-static __inline__ __attribute__ ((const))
-__u32 ___arch__swab32(__u32 value)
-{
- return __sw32(value);
-}
-
-# define __arch__swab32(x) ___arch__swab32(x)
-# define __arch__swab16(x) ___arch__swab16(x)
-# endif /* 0 */
-
-# endif
-
-/* The same, but returns converted value from the location pointer by addr. */
-# define __arch__swab16p(addr) ld_le16(addr)
-# define __arch__swab32p(addr) ld_le32(addr)
-
-/* The same, but do the conversion in situ, ie. put the value back to addr. */
-# define __arch__swab16s(addr) st_le16(addr,*addr)
-# define __arch__swab32s(addr) st_le32(addr,*addr)
-# endif
-
-# endif /* __GNUC__ */
-
-# if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-# define __BYTEORDER_HAS_U64__
-# endif
-//# include "byteorder/big_endian.h"
-
-# endif /* _M68K_BYTEORDER_H */
diff -r e55aa706e8f4 -r df32c7c2a930 sys/usb/src.km/endian/byteorder/big_endian.h
--- a/sys/usb/src.km/endian/byteorder/big_endian.h Sat Jan 03 20:30:45 2015 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +0,0 @@
-# ifndef _LINUX_BYTEORDER_BIG_ENDIAN_H
-# define _LINUX_BYTEORDER_BIG_ENDIAN_H
-
-# ifndef __BIG_ENDIAN
-# define __BIG_ENDIAN 4321
-# endif
-# ifndef __BIG_ENDIAN_BITFIELD
-# define __BIG_ENDIAN_BITFIELD
-# endif
-# define __BYTE_ORDER __BIG_ENDIAN
-
-# include "swab.h"
-
-# define __constant_htonl(x) ((__u32)(x))
-# define __constant_ntohl(x) ((__u32)(x))
-# define __constant_htons(x) ((__u16)(x))
-# define __constant_ntohs(x) ((__u16)(x))
-# define __constant_cpu_to_le64(x) ___swab64((x))
-# define __constant_le64_to_cpu(x) ___swab64((x))
-# define __constant_cpu_to_le32(x) ___swab32((x))
-# define __constant_le32_to_cpu(x) ___swab32((x))
-# define __constant_cpu_to_le16(x) ___swab16((x))
-# define __constant_le16_to_cpu(x) ___swab16((x))
-# define __constant_cpu_to_be64(x) ((__u64)(x))
-# define __constant_be64_to_cpu(x) ((__u64)(x))
-# define __constant_cpu_to_be32(x) ((__u32)(x))
-# define __constant_be32_to_cpu(x) ((__u32)(x))
-# define __constant_cpu_to_be16(x) ((__u16)(x))
-# define __constant_be16_to_cpu(x) ((__u16)(x))
-# define __cpu_to_le64(x) __swab64((x))
-# define __le64_to_cpu(x) __swab64((x))
-# define __cpu_to_le32(x) __swab32((x))
-# define __le32_to_cpu(x) __swab32((x))
-# define __cpu_to_le16(x) __swab16((x))
-# define __le16_to_cpu(x) __swab16((x))
-# define __cpu_to_be64(x) ((__u64)(x))
-# define __be64_to_cpu(x) ((__u64)(x))
-# define __cpu_to_be32(x) ((__u32)(x))
-# define __be32_to_cpu(x) ((__u32)(x))
-# define __cpu_to_be16(x) ((__u16)(x))
-# define __be16_to_cpu(x) ((__u16)(x))
-# define __cpu_to_le64p(x) __swab64p((x))
-# define __le64_to_cpup(x) __swab64p((x))
-# define __cpu_to_le32p(x) __swab32p((x))
-# define __le32_to_cpup(x) __swab32p((x))
-# define __cpu_to_le16p(x) __swab16p((x))
-# define __le16_to_cpup(x) __swab16p((x))
-# define __cpu_to_be64p(x) (*(__u64*)(x))
-# define __be64_to_cpup(x) (*(__u64*)(x))
-# define __cpu_to_be32p(x) (*(__u32*)(x))
-# define __be32_to_cpup(x) (*(__u32*)(x))
-# define __cpu_to_be16p(x) (*(__u16*)(x))
-# define __be16_to_cpup(x) (*(__u16*)(x))
-# define __cpu_to_le64s(x) __swab64s((x))
-# define __le64_to_cpus(x) __swab64s((x))
-# define __cpu_to_le32s(x) __swab32s((x))
-# define __le32_to_cpus(x) __swab32s((x))
-# define __cpu_to_le16s(x) __swab16s((x))
-# define __le16_to_cpus(x) __swab16s((x))
-# define __cpu_to_be64s(x) do {} while (0)
-# define __be64_to_cpus(x) do {} while (0)
-# define __cpu_to_be32s(x) do {} while (0)
-# define __be32_to_cpus(x) do {} while (0)
-# define __cpu_to_be16s(x) do {} while (0)
-# define __be16_to_cpus(x) do {} while (0)
-
-# include "generic.h"
-
-# endif /* _LINUX_BYTEORDER_BIG_ENDIAN_H */
diff -r e55aa706e8f4 -r df32c7c2a930 sys/usb/src.km/endian/byteorder/generic.h
--- a/sys/usb/src.km/endian/byteorder/generic.h Sat Jan 03 20:30:45 2015 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,180 +0,0 @@
-# ifndef _LINUX_BYTEORDER_GENERIC_H
-# define _LINUX_BYTEORDER_GENERIC_H
-
-/*
- * linux/byteorder_generic.h
- * Generic Byte-reordering support
- *
- * Francois-Rene Rideau <fare@tunes.org> 19970707
- * gathered all the good ideas from all asm-foo/byteorder.h into one file,
- * cleaned them up.
- * I hope it is compliant with non-GCC compilers.
- * I decided to put __BYTEORDER_HAS_U64__ in byteorder.h,
- * because I wasn't sure it would be ok to put it in types.h
- * Upgraded it to 2.1.43
- * Francois-Rene Rideau <fare@tunes.org> 19971012
- * Upgraded it to 2.1.57
- * to please Linus T., replaced huge # ifdef's between little/big endian
- * by nestedly # include'd files.
- * Francois-Rene Rideau <fare@tunes.org> 19971205
- * Made it to 2.1.71; now a facelift:
- * Put files under include/linux/byteorder/
- * Split swab from generic support.
- *
- * TODO:
- * = Regular kernel maintainers could also replace all these manual
- * byteswap macros that remain, disseminated among drivers,
- * after some grep or the sources...
- * = Linus might want to rename all these macros and files to fit his taste,
- * to fit his personal naming scheme.
- * = it seems that a few drivers would also appreciate
- * nybble swapping support...
- * = every architecture could add their byteswap macro in asm/byteorder.h
- * see how some architectures already do (i386, alpha, ppc, etc)
- * = cpu_to_beXX and beXX_to_cpu might some day need to be well
- * distinguished throughout the kernel. This is not the case currently,
- * since little endian, big endian, and pdp endian machines needn't it.
- * But this might be the case for, say, a port of Linux to 20/21 bit
- * architectures (and F21 Linux addict around?).
- */
-
-/*
- * The following macros are to be defined by <asm/byteorder.h>:
- *
- * Conversion of long and short int between network and host format
- * ntohl(__u32 x)
- * ntohs(__u16 x)
- * htonl(__u32 x)
- * htons(__u16 x)
- * It seems that some programs (which? where? or perhaps a standard? POSIX?)
- * might like the above to be functions, not macros (why?).
- * if that's true, then detect them, and take measures.
- * Anyway, the measure is: define only ___ntohl as a macro instead,
- * and in a separate file, have
- * unsigned long inline ntohl(x){return ___ntohl(x);}
- *
- * The same for constant arguments
- * __constant_ntohl(__u32 x)
- * __constant_ntohs(__u16 x)
- * __constant_htonl(__u32 x)
- * __constant_htons(__u16 x)
- *
- * Conversion of XX-bit integers (16- 32- or 64-)
- * between native CPU format and little/big endian format
- * 64-bit stuff only defined for proper architectures
- * cpu_to_[bl]eXX(__uXX x)
- * [bl]eXX_to_cpu(__uXX x)
- *
- * The same, but takes a pointer to the value to convert
- * cpu_to_[bl]eXXp(__uXX x)
- * [bl]eXX_to_cpup(__uXX x)
- *
- * The same, but change in situ
- * cpu_to_[bl]eXXs(__uXX x)
- * [bl]eXX_to_cpus(__uXX x)
- *
- * See asm-foo/byteorder.h for examples of how to provide
- * architecture-optimized versions
- *
- */
-
-
-# if defined(__KERNEL__)
-/*
- * inside the kernel, we can use nicknames;
- * outside of it, we must avoid POSIX namespace pollution...
- */
-# define cpu_to_le64 __cpu_to_le64
-# define le64_to_cpu __le64_to_cpu
-# define cpu_to_le32 __cpu_to_le32
-# define le32_to_cpu __le32_to_cpu
-# define cpu_to_le16 __cpu_to_le16
-# define le16_to_cpu __le16_to_cpu
-# define cpu_to_be64 __cpu_to_be64
-# define be64_to_cpu __be64_to_cpu
-# define cpu_to_be32 __cpu_to_be32
-# define be32_to_cpu __be32_to_cpu
-# define cpu_to_be16 __cpu_to_be16
-# define be16_to_cpu __be16_to_cpu
-# define cpu_to_le64p __cpu_to_le64p
-# define le64_to_cpup __le64_to_cpup
-# define cpu_to_le32p __cpu_to_le32p
-# define le32_to_cpup __le32_to_cpup
-# define cpu_to_le16p __cpu_to_le16p
-# define le16_to_cpup __le16_to_cpup
-# define cpu_to_be64p __cpu_to_be64p
-# define be64_to_cpup __be64_to_cpup
-# define cpu_to_be32p __cpu_to_be32p
-# define be32_to_cpup __be32_to_cpup
-# define cpu_to_be16p __cpu_to_be16p
-# define be16_to_cpup __be16_to_cpup
-# define cpu_to_le64s __cpu_to_le64s
-# define le64_to_cpus __le64_to_cpus
-# define cpu_to_le32s __cpu_to_le32s
-# define le32_to_cpus __le32_to_cpus
-# define cpu_to_le16s __cpu_to_le16s
-# define le16_to_cpus __le16_to_cpus
-# define cpu_to_be64s __cpu_to_be64s
-# define be64_to_cpus __be64_to_cpus
-# define cpu_to_be32s __cpu_to_be32s
-# define be32_to_cpus __be32_to_cpus
-# define cpu_to_be16s __cpu_to_be16s
-# define be16_to_cpus __be16_to_cpus
-# endif
-
-# if 0 /* Galvez: uncomment to avoid colision with kernel stuff */
-/*
- * Handle ntohl and suches. These have various compatibility
- * issues - like we want to give the prototype even though we
- * also have a macro for them in case some strange program
- * wants to take the address of the thing or something..
- *
- * Note that these used to return a "long" in libc5, even though
- * long is often 64-bit these days.. Thus the casts.
- *
- * They have to be macros in order to do the constant folding
- * correctly - if the argument passed into a inline function
- * it is no longer constant according to gcc..
- */
-
-# undef ntohl
-# undef ntohs
-# undef htonl
-# undef htons
-
-/*
- * Do the prototypes. Somebody might want to take the
- * address or some such sick thing..
- */
-# if defined(__KERNEL__) || (defined (__GLIBC__) && __GLIBC__ >= 2)
-extern __u32 ntohl(__u32);
-extern __u32 htonl(__u32);
-# else
-extern unsigned long int ntohl(unsigned long int);
-extern unsigned long int htonl(unsigned long int);
-# endif
-extern unsigned short int ntohs(unsigned short int);
-extern unsigned short int htons(unsigned short int);
-
-
-# if defined(__GNUC__) && (__GNUC__ >= 2)
-
-# define ___htonl(x) __cpu_to_be32(x)
-# define ___htons(x) __cpu_to_be16(x)
-# define ___ntohl(x) __be32_to_cpu(x)
-# define ___ntohs(x) __be16_to_cpu(x)
-
-# if defined(__KERNEL__) || (defined (__GLIBC__) && __GLIBC__ >= 2)
-# define htonl(x) ___htonl(x)
-# define ntohl(x) ___ntohl(x)
-# else
-# define htonl(x) ((unsigned long)___htonl(x))
-# define ntohl(x) ((unsigned long)___ntohl(x))
-# endif
-# define htons(x) ___htons(x)
-# define ntohs(x) ___ntohs(x)
-
-# endif /* OPTIMIZE */
-# endif
-
-# endif /* _LINUX_BYTEORDER_GENERIC_H */
diff -r e55aa706e8f4 -r df32c7c2a930 sys/usb/src.km/endian/byteorder/little_endian.h
--- a/sys/usb/src.km/endian/byteorder/little_endian.h Sat Jan 03 20:30:45 2015 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +0,0 @@
-# ifndef _LINUX_BYTEORDER_LITTLE_ENDIAN_H
-# define _LINUX_BYTEORDER_LITTLE_ENDIAN_H
-
-# ifndef __LITTLE_ENDIAN
-# define __LITTLE_ENDIAN 1234
-# endif
-# ifndef __LITTLE_ENDIAN_BITFIELD
-# define __LITTLE_ENDIAN_BITFIELD
-# endif
-# define __BYTE_ORDER __LITTLE_ENDIAN
-
-# include "swab.h"
-
-# define __constant_htonl(x) ___constant_swab32((x))
-# define __constant_ntohl(x) ___constant_swab32((x))
-# define __constant_htons(x) ___constant_swab16((x))
-# define __constant_ntohs(x) ___constant_swab16((x))
-# define __constant_cpu_to_le64(x) ((__u64)(x))
-# define __constant_le64_to_cpu(x) ((__u64)(x))
-# define __constant_cpu_to_le32(x) ((__u32)(x))
-# define __constant_le32_to_cpu(x) ((__u32)(x))
-# define __constant_cpu_to_le16(x) ((__u16)(x))
-# define __constant_le16_to_cpu(x) ((__u16)(x))
-# define __constant_cpu_to_be64(x) ___constant_swab64((x))
-# define __constant_be64_to_cpu(x) ___constant_swab64((x))
-# define __constant_cpu_to_be32(x) ___constant_swab32((x))
-# define __constant_be32_to_cpu(x) ___constant_swab32((x))
-# define __constant_cpu_to_be16(x) ___constant_swab16((x))
-# define __constant_be16_to_cpu(x) ___constant_swab16((x))
-# define __cpu_to_le64(x) ((__u64)(x))
-# define __le64_to_cpu(x) ((__u64)(x))
-# define __cpu_to_le32(x) ((__u32)(x))
-# define __le32_to_cpu(x) ((__u32)(x))
-# define __cpu_to_le16(x) ((__u16)(x))
-# define __le16_to_cpu(x) ((__u16)(x))
-# define __cpu_to_be64(x) __swab64((x))
-# define __be64_to_cpu(x) __swab64((x))
-# define __cpu_to_be32(x) __swab32((x))
-# define __be32_to_cpu(x) __swab32((x))
-# define __cpu_to_be16(x) __swab16((x))
-# define __be16_to_cpu(x) __swab16((x))
-# define __cpu_to_le64p(x) (*(__u64*)(x))
-# define __le64_to_cpup(x) (*(__u64*)(x))
-# define __cpu_to_le32p(x) (*(__u32*)(x))
-# define __le32_to_cpup(x) (*(__u32*)(x))
-# define __cpu_to_le16p(x) (*(__u16*)(x))
-# define __le16_to_cpup(x) (*(__u16*)(x))
-# define __cpu_to_be64p(x) __swab64p((x))
-# define __be64_to_cpup(x) __swab64p((x))
-# define __cpu_to_be32p(x) __swab32p((x))
-# define __be32_to_cpup(x) __swab32p((x))
-# define __cpu_to_be16p(x) __swab16p((x))
-# define __be16_to_cpup(x) __swab16p((x))
-# define __cpu_to_le64s(x) do {} while (0)
-# define __le64_to_cpus(x) do {} while (0)
-# define __cpu_to_le32s(x) do {} while (0)
-# define __le32_to_cpus(x) do {} while (0)
-# define __cpu_to_le16s(x) do {} while (0)
-# define __le16_to_cpus(x) do {} while (0)
-# define __cpu_to_be64s(x) __swab64s((x))
-# define __be64_to_cpus(x) __swab64s((x))
-# define __cpu_to_be32s(x) __swab32s((x))
-# define __be32_to_cpus(x) __swab32s((x))
-# define __cpu_to_be16s(x) __swab16s((x))
-# define __be16_to_cpus(x) __swab16s((x))
-
-# include "generic.h"
-
-# endif /* _LINUX_BYTEORDER_LITTLE_ENDIAN_H */
diff -r e55aa706e8f4 -r df32c7c2a930 sys/usb/src.km/endian/byteorder/swab.h
--- a/sys/usb/src.km/endian/byteorder/swab.h Sat Jan 03 20:30:45 2015 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,158 +0,0 @@
-# ifndef _LINUX_BYTEORDER_SWAB_H
-# define _LINUX_BYTEORDER_SWAB_H
-
-/*
- * linux/byteorder/swab.h
- * Byte-swapping, independently from CPU endianness
- * swabXX[ps]?(foo)
- *
- * Francois-Rene Rideau <fare@tunes.org> 19971205
- * separated swab functions from cpu_to_XX,
- * to clean up support for bizarre-endian architectures.
- *
- * See asm-i386/byteorder.h and suches for examples of how to provide
- * architecture-dependent optimized versions
- *
- */
-
-/* casts are necessary for constants, because we never know how for sure
- * how U/UL/ULL map to __u16, __u32, __u64. At least not in a portable way.
- */
-# define ___swab16(x) \
- ((__u16)( \
- (((__u16)(x) & (__u16)0x00ffU) << 8) | \
- (((__u16)(x) & (__u16)0xff00U) >> 8) ))
-# define ___swab32(x) \
- ((__u32)( \
- (((__u32)(x) & (__u32)0x000000ffUL) << 24) | \
- (((__u32)(x) & (__u32)0x0000ff00UL) << 8) | \
- (((__u32)(x) & (__u32)0x00ff0000UL) >> 8) | \
- (((__u32)(x) & (__u32)0xff000000UL) >> 24) ))
-# define ___swab64(x) \
- ((__u64)( \
- (__u64)(((__u64)(x) & (__u64)0x00000000000000ffULL) << 56) | \
- (__u64)(((__u64)(x) & (__u64)0x000000000000ff00ULL) << 40) | \
- (__u64)(((__u64)(x) & (__u64)0x0000000000ff0000ULL) << 24) | \
- (__u64)(((__u64)(x) & (__u64)0x00000000ff000000ULL) << 8) | \
- (__u64)(((__u64)(x) & (__u64)0x000000ff00000000ULL) >> 8) | \
- (__u64)(((__u64)(x) & (__u64)0x0000ff0000000000ULL) >> 24) | \
- (__u64)(((__u64)(x) & (__u64)0x00ff000000000000ULL) >> 40) | \
- (__u64)(((__u64)(x) & (__u64)0xff00000000000000ULL) >> 56) ))
-
-/*
- * provide defaults when no architecture-specific optimization is detected
- */
-# ifndef __arch__swab16
-# define __arch__swab16(x) ___swab16(x)
-# endif
-# ifndef __arch__swab32
-# define __arch__swab32(x) ___swab32(x)
-# endif
-# ifndef __arch__swab64
-# define __arch__swab64(x) ___swab64(x)
-# endif
-
-# ifndef __arch__swab16p
-# define __arch__swab16p(x) __swab16(*(x))
-# endif
-# ifndef __arch__swab32p
-# define __arch__swab32p(x) __swab32(*(x))
-# endif
-# ifndef __arch__swab64p
-# define __arch__swab64p(x) __swab64(*(x))
-# endif
-
-# ifndef __arch__swab16s
-# define __arch__swab16s(x) do { *(x) = __swab16p((x)); } while (0)
-# endif
-# ifndef __arch__swab32s
-# define __arch__swab32s(x) do { *(x) = __swab32p((x)); } while (0)
-# endif
-# ifndef __arch__swab64s
-# define __arch__swab64s(x) do { *(x) = __swab64p((x)); } while (0)
-# endif
-
-
-/*
- * Allow constant folding
- */
-# if defined(__GNUC__) && (__GNUC__ >= 2) && defined(__OPTIMIZE__)
-# define __swab16(x) \
-(__builtin_constant_p((__u16)(x)) ? \
- ___swab16((x)) : \
- __fswab16((x)))
-# define __swab32(x) \
-(__builtin_constant_p((__u32)(x)) ? \
- ___swab32((x)) : \
- __fswab32((x)))
-# define __swab64(x) \
-(__builtin_constant_p((__u64)(x)) ? \
- ___swab64((x)) : \
- __fswab64((x)))
-# else
-# define __swab16(x) __fswab16(x)
-# define __swab32(x) __fswab32(x)
-# define __swab64(x) __fswab64(x)
-# endif /* OPTIMIZE */
-
-
-static __inline__ __attribute__((const)) __u16 __fswab16(__u16 x)
-{
- return __arch__swab16(x);
-}
-static __inline__ __u16 __swab16p(__u16 *x)
-{
- return __arch__swab16p(x);
-}
-static __inline__ void __swab16s(__u16 *addr)
-{
- __arch__swab16s(addr);
-}
-
-static __inline__ __attribute__((const)) __u32 __fswab32(__u32 x)
-{
- return __arch__swab32(x);
-}
-static __inline__ __u32 __swab32p(__u32 *x)
-{
- return __arch__swab32p(x);
-}
-static __inline__ void __swab32s(__u32 *addr)
-{
- __arch__swab32s(addr);
-}
-
-# ifdef __BYTEORDER_HAS_U64__
-static __inline__ __attribute__((const)) __u64 __fswab64(__u64 x)
-{
-# ifdef __SWAB_64_THRU_32__
- __u32 h = x >> 32;
- __u32 l = x & ((1ULL<<32)-1);
- return (((__u64)__swab32(l)) << 32) | ((__u64)(__swab32(h)));
-# else
- return __arch__swab64(x);
-# endif
-}
-static __inline__ __u64 __swab64p(__u64 *x)
-{
- return __arch__swab64p(x);
-}
-static __inline__ void __swab64s(__u64 *addr)
-{
- __arch__swab64s(addr);
-}
-# endif /* __BYTEORDER_HAS_U64__ */
-
-# if defined(__KERNEL__)
-# define swab16 __swab16
-# define swab32 __swab32
-# define swab64 __swab64
-# define swab16p __swab16p
-# define swab32p __swab32p
-# define swab64p __swab64p
-# define swab16s __swab16s
-# define swab32s __swab32s
-# define swab64s __swab64s
-# endif
-
-# endif /* _LINUX_BYTEORDER_SWAB_H */
diff -r e55aa706e8f4 -r df32c7c2a930 sys/usb/src.km/endian/io.h
--- a/sys/usb/src.km/endian/io.h Sat Jan 03 20:30:45 2015 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,298 +0,0 @@
-/*
- * IO header file
- *
- * Copyright (C) 2004-2007 Freescale Semiconductor, Inc.
- * TsiChung Liew (Tsi-Chung.Liew@freescale.com)
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-# ifndef __ASM_M68K_IO_H__
-# define __ASM_M68K_IO_H__
-
-# include "byteorder.h"
-
-/* Galvez: For insertion in MiNT kernel tree */
-# define u8 __u8
-# define u16 __u16
-# define u32 __u32
-typedef unsigned long phys_addr_t;
-typedef unsigned long phys_size_t;
-
-/* Galvez: Declaring prototypes MiNT compilation needs it */
-extern inline void _insb(volatile u8 * port, void *buf, int ns);
-extern inline void _outsb(volatile u8 * port, const void *buf, int ns);
-extern inline void _insw(volatile u16 * port, void *buf, int ns);
-extern inline void _outsw(volatile u16 * port, const void *buf, int ns);
-extern inline void _insl(volatile u32 * port, void *buf, int nl);
-extern inline void _outsl(volatile u32 * port, const void *buf, int nl);
-extern inline void _insw_ns(volatile u16 * port, void *buf, int ns);
-extern inline void _outsw_ns(volatile u16 * port, const void *buf, int ns);
-extern inline void _insl_ns(volatile u32 * port, void *buf, int nl);
-extern inline void _outsl_ns(volatile u32 * port, const void *buf, int nl);
-extern inline int in_8(volatile u8 * addr);
-extern inline void out_8(volatile u8 * addr, int val);
-extern inline int in_le16(volatile u16 * addr);
-extern inline int in_be16(volatile u16 * addr);
-extern inline void out_le16(volatile u16 * addr, int val);
-extern inline void out_be16(volatile u16 * addr, int val);
-extern inline unsigned in_le32(volatile u32 * addr);
-extern inline unsigned in_be32(volatile u32 * addr);
-extern inline void out_le32(volatile unsigned *addr, int val);
-extern inline void out_be32(volatile unsigned *addr, int val);
-
-
-
-# define __raw_readb(addr) (*(volatile u8 *)(addr))
-# define __raw_readw(addr) (*(volatile u16 *)(addr))
-# define __raw_readl(addr) (*(volatile u32 *)(addr))
-
-# define __raw_writeb(b,addr) ((*(volatile u8 *) (addr)) = (b))
-# define __raw_writew(w,addr) ((*(volatile u16 *) (addr)) = (w))
-# define __raw_writel(l,addr) ((*(volatile u32 *) (addr)) = (l))
-
-# define readb(addr) in_8((volatile u8 *)(addr))
-# define writeb(b,addr) out_8((volatile u8 *)(addr), (b))
-# if !defined(__BIG_ENDIAN)
-//# if defined(__BIG_ENDIAN)
-# define readw(addr) (*(volatile u16 *) (addr))
-# define readl(addr) (*(volatile u32 *) (addr))
-# define writew(b,addr) ((*(volatile u16 *) (addr)) = (b))
-# define writel(b,addr) ((*(volatile u32 *) (addr)) = (b))
-# else /* Galvez: in_le16() does the swap reading
- * twice from fifo (register), when reading
- * from fifo once the value is changed by the new one */
-# define readw(addr) ld_le16((volatile u16 *)(addr)) /* instead of in_le16((volatile u16 *)(addr))*/
-# define readl(addr) in_le32((volatile u32 *)(addr))
-# define writew(b,addr) out_le16((volatile u16 *)(addr),(b))
-# define writel(b,addr) out_le32((volatile u32 *)(addr),(b))
-# endif
-
-/*
- * The insw/outsw/insl/outsl macros don't do byte-swapping.
- * They are only used in practice for transferring buffers which
- * are arrays of bytes, and byte-swapping is not appropriate in
- * that case. - paulus
- */
-# define insb(port, buf, ns) _insb((u8 *)((port)+_IO_BASE), (buf), (ns))
-# define outsb(port, buf, ns) _outsb((u8 *)((port)+_IO_BASE), (buf), (ns))
-# define insw(port, buf, ns) _insw_ns((u16 *)((port)+_IO_BASE), (buf), (ns))
-# define outsw(port, buf, ns) _outsw_ns((u16 *)((port)+_IO_BASE), (buf), (ns))
-# define insl(port, buf, nl) _insl_ns((u32 *)((port)+_IO_BASE), (buf), (nl))
-# define outsl(port, buf, nl) _outsl_ns((u32 *)((port)+_IO_BASE), (buf), (nl))
-
-# define inb(port) in_8((u8 *)((port)+_IO_BASE))
-# define outb(val, port) out_8((u8 *)((port)+_IO_BASE), (val))
-# if !defined(__BIG_ENDIAN)
-//# if defined(__BIG_ENDIAN)
-# define inw(port) in_be16((u16 *)((port)+_IO_BASE))
-# define outw(val, port) out_be16((u16 *)((port)+_IO_BASE), (val))
-# define inl(port) in_be32((u32 *)((port)+_IO_BASE))
-# define outl(val, port) out_be32((u32 *)((port)+_IO_BASE), (val))
-# else
-# define inw(port) in_le16((u16 *)((port)+_IO_BASE))
-# define outw(val, port) out_le16((u16 *)((port)+_IO_BASE), (val))
-# define inl(port) in_le32((u32 *)((port)+_IO_BASE))
-# define outl(val, port) out_le32((u32 *)((port)+_IO_BASE), (val))
-# endif
-
-extern inline void _insb(volatile u8 * port, void *buf, int ns)
-{
- u8 *data = (u8 *) buf;
- while (ns--)
- *data++ = *port;
-}
-
-extern inline void _outsb(volatile u8 * port, const void *buf, int ns)
-{
- const u8 *data = (const u8 *) buf; /* Galvez: add const qualifier to avoid warning */
- while (ns--)
- *port = *data++;
-}
-
-extern inline void _insw(volatile u16 * port, void *buf, int ns)
-{
- u16 *data = (u16 *) buf;
- while (ns--)
- *data++ = __sw16(*port);
-}
-
-extern inline void _outsw(volatile u16 * port, const void *buf, int ns)
-{
- const u16 *data = (const u16 *) buf;
- while (ns--)
- {
- *port = __sw16(*data);
- data++;
- }
-}
-
-extern inline void _insl(volatile u32 * port, void *buf, int nl)
-{
- u32 *data = (u32 *) buf;
- while (nl--)
- *data++ = __sw32(*port);
-}
-
-extern inline void _outsl(volatile u32 * port, const void *buf, int nl)
-{
- const u32 *data = (const u32 *) buf;
- while (nl--)
- {
- *port = __sw32(*data);
- data++;
- }
-}
-
-extern inline void _insw_ns(volatile u16 * port, void *buf, int ns)
-{
- u16 *data = (u16 *) buf;
- while (ns--)
- *data++ = *port;
-}
-
-extern inline void _outsw_ns(volatile u16 * port, const void *buf, int ns)
-{
- const u16 *data = (const u16 *) buf;
- while (ns--)
- {
- *port = *data++;
- }
-}
-
-extern inline void _insl_ns(volatile u32 * port, void *buf, int nl)
-{
- u32 *data = (u32 *) buf;
- while (nl--)
- *data++ = *port;
-}
-
-extern inline void _outsl_ns(volatile u32 * port, const void *buf, int nl)
-{
- const u32 *data = (const u32 *) buf;
- while (nl--)
- {
- *port = *data;
- data++;
- }
-}
-
-/*
- * The *_ns versions below don't do byte-swapping.
- * Neither do the standard versions now, these are just here
- * for older code.
- */
-# define insw_ns(port, buf, ns) _insw_ns((u16 *)((port)+_IO_BASE), (buf), (ns))
-# define outsw_ns(port, buf, ns) _outsw_ns((u16 *)((port)+_IO_BASE), (buf), (ns))
-# define insl_ns(port, buf, nl) _insl_ns((u32 *)((port)+_IO_BASE), (buf), (nl))
-# define outsl_ns(port, buf, nl) _outsl_ns((u32 *)((port)+_IO_BASE), (buf), (nl))
-
-# define IO_SPACE_LIMIT ~0
-
-/*
- * 8, 16 and 32 bit, big and little endian I/O operations, with barrier.
- */
-extern inline int in_8(volatile u8 * addr)
-{
- return (int)*addr;
-}
-
-extern inline void out_8(volatile u8 * addr, int val)
-{
- *addr = (u8) val;
-}
-
-extern inline int in_le16(volatile u16 * addr)
-{
- return __sw16(*addr);
-}
-
-extern inline int in_be16(volatile u16 * addr)
-{
- return (*addr & 0xFFFF);
-}
-
-extern inline void out_le16(volatile u16 * addr, int val)
-{
- *addr = __sw16(val);
-}
-
-extern inline void out_be16(volatile u16 * addr, int val)
-{
- *addr = (u16) val;
-}
-
-extern inline unsigned in_le32(volatile u32 * addr)
-{
- return __sw32(*addr);
-}
-
-extern inline unsigned in_be32(volatile u32 * addr)
-{
- return (*addr);
-}
-
-extern inline void out_le32(volatile unsigned *addr, int val)
-{
- *addr = __sw32(val);
-}
-
-extern inline void out_be32(volatile unsigned *addr, int val)
-{
- *addr = val;
-}
-
-static inline void sync(void)
-{
- /* This sync function is for PowerPC or other architecture instruction
- * ColdFire does not have this instruction. Dummy function, added for
- * compatibility (CFI driver)
- */
-}
-
-/*
- * Given a physical address and a length, return a virtual address
- * that can be used to access the memory range with the caching
- * properties specified by "flags".
- */
-# define MAP_NOCACHE (0)
-# define MAP_WRCOMBINE (0)
-# define MAP_WRBACK (0)
-# define MAP_WRTHROUGH (0)
-
-static inline void *map_physmem(phys_addr_t paddr, unsigned long len,
- unsigned long flags)
-{
- return (void *)paddr;
-}
-
-/*
- * Take down a mapping set up by map_physmem().
- */
-static inline void unmap_physmem(void *vaddr, unsigned long flags)
-{
-
-}
-
-static inline phys_addr_t virt_to_phys(void * vaddr)
-{
- return (phys_addr_t)(vaddr);
-}
-
-#endif /* __ASM_M68K_IO_H__ */
diff -r e55aa706e8f4 -r df32c7c2a930 sys/usb/src.km/ucd/ehci/ehci-hcd.c
--- a/sys/usb/src.km/ucd/ehci/ehci-hcd.c Sat Jan 03 20:30:45 2015 +0100
+++ b/sys/usb/src.km/ucd/ehci/ehci-hcd.c Sat Jan 03 20:45:48 2015 +0100
@@ -39,7 +39,6 @@
#include "../../global.h"
-#include "../../endian/io.h"
#include "mint/endian.h"
#include "mint/mdelay.h"
#include "../../usb.h"
diff -r e55aa706e8f4 -r df32c7c2a930 sys/usb/src.km/ucd/ehci/ehci-pci.c
--- a/sys/usb/src.km/ucd/ehci/ehci-pci.c Sat Jan 03 20:30:45 2015 +0100
+++ b/sys/usb/src.km/ucd/ehci/ehci-pci.c Sat Jan 03 20:45:48 2015 +0100
@@ -32,7 +32,6 @@
#include "../../global.h"
-#include "../../endian/io.h"
#include "mint/endian.h"
#include "mint/mdelay.h"
#include "../../usb.h"
diff -r e55aa706e8f4 -r df32c7c2a930 sys/usb/src.km/ucd/netusbee/isp116x-hcd.c
--- a/sys/usb/src.km/ucd/netusbee/isp116x-hcd.c Sat Jan 03 20:30:45 2015 +0100
+++ b/sys/usb/src.km/ucd/netusbee/isp116x-hcd.c Sat Jan 03 20:45:48 2015 +0100
@@ -64,8 +64,8 @@
#include "libkern/libkern.h"
#include "mint/mdelay.h"
#include "mint/dcntl.h"
+#include "mint/swap.h"
-#include "../../endian/io.h"
#include "../../usb.h"
#include "../../usb_api.h"
diff -r e55aa706e8f4 -r df32c7c2a930 sys/usb/src.km/ucd/netusbee/isp116x.h
--- a/sys/usb/src.km/ucd/netusbee/isp116x.h Sat Jan 03 20:30:45 2015 +0100
+++ b/sys/usb/src.km/ucd/netusbee/isp116x.h Sat Jan 03 20:45:48 2015 +0100
@@ -401,15 +401,36 @@
# define isp116x_delay(h,d) do {} while (0)
#endif
+/* ISP116x registers access */
+
+inline void write_le16_reg(volatile unsigned short * addr, short val);
+inline unsigned read_le16_reg(const volatile unsigned short *addr);
+
+inline void write_le16_reg(volatile unsigned short * addr, short val)
+{
+ *addr = SWAP16(val);
+}
+
+inline unsigned read_le16_reg(const volatile unsigned short *addr)
+{
+ unsigned result = *addr;
+ return SWAP16(result);
+}
+
+# define raw_readw(addr) (*(volatile unsigned short *)(addr))
+# define raw_writew(w,addr) ((*(volatile unsigned short *) (addr)) = (w))
+# define readw(addr) read_le16_reg((volatile unsigned short *)(addr))
+# define writew(b,addr) write_le16_reg((volatile unsigned short *)(addr),(b))
+
static inline void isp116x_write_addr(struct isp116x *isp116x, unsigned reg)
{
- u16 dumm;
+ unsigned short dumm;
- isp116x->data_reg = (u16*)(ISP116X_HCD_DATA + ((reg & 0x00ff)<<1));
- dumm = __raw_readw(isp116x->data_reg);
- isp116x->addr_reg = (u16*)ISP116X_HCD_ADDR;
- dumm = __raw_readw(isp116x->addr_reg);
+ isp116x->data_reg = (unsigned short*)(ISP116X_HCD_DATA + ((reg & 0x00ff)<<1));
+ dumm = raw_readw(isp116x->data_reg);
+ isp116x->addr_reg = (unsigned short*)ISP116X_HCD_ADDR;
+ dumm = raw_readw(isp116x->addr_reg);
isp116x_delay(isp116x, UDELAY);
UNUSED (dumm);
@@ -417,12 +438,12 @@
static inline void isp116x_write_data16(struct isp116x *isp116x, unsigned short val)
{
- u16 dumm;
+ unsigned short dumm;
- isp116x->data_reg = (u16*)(ISP116X_HCD_DATA + ((val & 0xff00)>>7));
- dumm = __raw_readw(isp116x->data_reg);
- isp116x->addr_reg = (u16*)((ISP116X_HCD_ADDR - 0x4000) + ((val & 0x00ff)<<1));
- dumm = __raw_readw(isp116x->addr_reg);
+ isp116x->data_reg = (unsigned short*)(ISP116X_HCD_DATA + ((val & 0xff00)>>7));
+ dumm = raw_readw(isp116x->data_reg);
+ isp116x->addr_reg = (unsigned short*)((ISP116X_HCD_ADDR - 0x4000) + ((val & 0x00ff)<<1));
+ dumm = raw_readw(isp116x->addr_reg);
isp116x_delay(isp116x, UDELAY);
UNUSED (dumm);
@@ -430,12 +451,12 @@
static inline void isp116x_raw_write_data16(struct isp116x *isp116x, unsigned short val)
{
- u16 dumm;
+ unsigned short dumm;
- isp116x->data_reg = (u16*)(ISP116X_HCD_DATA + ((val & 0x00ff)<<1));
- dumm = __raw_readw(isp116x->data_reg);
- isp116x->addr_reg = (u16*)((ISP116X_HCD_ADDR - 0x4000) + ((val & 0xff00)>>7));
- dumm = __raw_readw(isp116x->addr_reg);
+ isp116x->data_reg = (unsigned short*)(ISP116X_HCD_DATA + ((val & 0x00ff)<<1));
+ dumm = raw_readw(isp116x->data_reg);
+ isp116x->addr_reg = (unsigned short*)((ISP116X_HCD_ADDR - 0x4000) + ((val & 0xff00)>>7));
+ dumm = raw_readw(isp116x->addr_reg);
isp116x_delay(isp116x, UDELAY);
UNUSED (dumm);
@@ -445,7 +466,7 @@
{
unsigned short val;
- isp116x->data_reg = (u16*)(ISP116X_HCD_DATA + 0x8000);
+ isp116x->data_reg = (unsigned short*)(ISP116X_HCD_DATA + 0x8000);
val = readw(isp116x->data_reg );
isp116x_delay(isp116x, UDELAY);
@@ -456,8 +477,8 @@
{
unsigned short val;
- isp116x->data_reg = (u16*)(ISP116X_HCD_DATA + 0x8000);
- val = __raw_readw(isp116x->data_reg );
+ isp116x->data_reg = (unsigned short*)(ISP116X_HCD_DATA + 0x8000);
+ val = raw_readw(isp116x->data_reg );
isp116x_delay(isp116x, UDELAY);
return val;
@@ -478,17 +499,17 @@
*/
static inline void isp116x_raw_write_data32(struct isp116x *isp116x, unsigned long val)
{
- u16 dumm;
+ unsigned short dumm;
- isp116x->data_reg = (u16*)(ISP116X_HCD_DATA + ((val & 0x000000ff)<<1));
- dumm = __raw_readw(isp116x->data_reg);
- isp116x->addr_reg = (u16*)((ISP116X_HCD_ADDR - 0x4000) + ((val & 0x0000ff00)>>7));
- dumm = __raw_readw(isp116x->addr_reg);
+ isp116x->data_reg = (unsigned short*)(ISP116X_HCD_DATA + ((val & 0x000000ff)<<1));
+ dumm = raw_readw(isp116x->data_reg);
+ isp116x->addr_reg = (unsigned short*)((ISP116X_HCD_ADDR - 0x4000) + ((val & 0x0000ff00)>>7));
+ dumm = raw_readw(isp116x->addr_reg);
isp116x_delay(isp116x, UDELAY);
- isp116x->data_reg = (u16*)(ISP116X_HCD_DATA + ((val & 0x00ff0000)>>15));
- dumm = __raw_readw(isp116x->data_reg);
- isp116x->addr_reg = (u16*)((ISP116X_HCD_ADDR - 0x4000) + ((val & 0xff000000)>>23) );
- dumm = __raw_readw(isp116x->addr_reg);
+ isp116x->data_reg = (unsigned short*)(ISP116X_HCD_DATA + ((val & 0x00ff0000)>>15));
+ dumm = raw_readw(isp116x->data_reg);
+ isp116x->addr_reg = (unsigned short*)((ISP116X_HCD_ADDR - 0x4000) + ((val & 0xff000000)>>23) );
+ dumm = raw_readw(isp116x->addr_reg);
isp116x_delay(isp116x, UDELAY);
UNUSED (dumm);
@@ -515,10 +536,10 @@
{
unsigned long val;
- isp116x->data_reg = (u16*)(ISP116X_HCD_DATA + 0x8000);
- val = (u32) __raw_readw(isp116x->data_reg );
+ isp116x->data_reg = (unsigned short*)(ISP116X_HCD_DATA + 0x8000);
+ val = (unsigned long) raw_readw(isp116x->data_reg );
isp116x_delay(isp116x, UDELAY);
- val |= ((u32) __raw_readw(isp116x->data_reg )) << 16;
+ val |= ((unsigned long) raw_readw(isp116x->data_reg )) << 16;
isp116x_delay(isp116x, UDELAY);
return val;
diff -r e55aa706e8f4 -r df32c7c2a930 sys/usb/src.km/ucd/unicorn/sl811-hcd.c
--- a/sys/usb/src.km/ucd/unicorn/sl811-hcd.c Sat Jan 03 20:30:45 2015 +0100
+++ b/sys/usb/src.km/ucd/unicorn/sl811-hcd.c Sat Jan 03 20:45:48 2015 +0100
@@ -48,7 +48,6 @@
#include "../../global.h"
-#include "../../endian/io.h"
#include "mint/endian.h"
#include "mint/mdelay.h"
#include "../../usb.h"
@@ -181,31 +180,31 @@
#endif
-static inline void sl811_write (__u8 index, __u8 data)
+static inline void sl811_write (unsigned char index, unsigned char data)
{
DACCESS = index;
DACCESS = data;
}
-static inline __u8 sl811_read (__u8 index)
+static inline unsigned char sl811_read (unsigned char index)
{
register unsigned short data;
DACCESS = index;
data = DACCESS;
- return (__u8)data;
+ return (unsigned char)data;
}
/*
* Read consecutive bytes of data from the SL811H/SL11H buffer
*/
-static void inline sl811_read_buf(__u8 offset, __u8 *buf, __u8 size)
+static void inline sl811_read_buf(unsigned char offset, unsigned char *buf, unsigned char size)
{
if ((long)buf & 1) {
/* Make it even, to prevent crashes on 68000. */
DACCESS = offset++;
- *buf++ = (__u8) DACCESS;
+ *buf++ = (unsigned char) DACCESS;
size--;
}
@@ -315,14 +314,14 @@
* So you need to write address, then read or write data.
*/
DACCESS = offset++;
- *buf++ = (__u8) DACCESS;
+ *buf++ = (unsigned char) DACCESS;
}
}
/*
* Write consecutive bytes of data to the SL811H/SL11H buffer
*/
-static void inline sl811_write_buf(__u8 offset, __u8 *buf, __u8 size)
+static void inline sl811_write_buf(unsigned char offset, unsigned char *buf, unsigned char size)
{
if ((long)buf & 1) {
/* Make it even, to prevent crashes on 68000. */
@@ -468,14 +467,14 @@
return (0);
}
-static void sl811_write_intr(__u8 irq)
+static void sl811_write_intr(unsigned char irq)
{
sl811_write(SL811_INTR, irq);
}
static long sl811_hc_reset(void)
{
- __u8 status;
+ unsigned char status;
sl811_write(SL811_CTRL2, SL811_CTL2_HOST | SL811_12M_HI);
sl811_write(SL811_CTRL1, SL811_CTRL1_RESET);
@@ -624,11 +623,11 @@
return !need_preamble ? bytes * 8 + 5120 : bytes * 64 + 3072;
}
-static long sl811_send_packet(struct usb_device *dev, unsigned long pipe, __u8 *buffer, long len, long flags)
+static long sl811_send_packet(struct usb_device *dev, unsigned long pipe, unsigned char *buffer, long len, long flags)
{
register unsigned long time_start = get_hz_200();
- register __u8 ctrl = SL811_USB_CTRL_ARM | SL811_USB_CTRL_ENABLE;
- register __u8 status = 0;
+ register unsigned char ctrl = SL811_USB_CTRL_ARM | SL811_USB_CTRL_ENABLE;
+ register unsigned char status = 0;
long err = 0;
long nak = 0;
long need_preamble = !(rh_status.wPortStatus & USB_PORT_STAT_LOW_SPEED) &&
@@ -689,7 +688,7 @@
status = sl811_read(SL811_STS_A);
if (status & SL811_USB_STS_ACK) {
- __u8 remainder = sl811_read(SL811_CNT_A);
+ unsigned char remainder = sl811_read(SL811_CNT_A);
if (remainder) {
// DEBUG(("usb transfer remainder = %d", remainder));
len -= remainder;
@@ -791,7 +790,7 @@
long res;
long nlen = (max > (len - done)) ? (len - done) : max;
- res = sl811_send_packet(dev, pipe, (__u8*)buffer+done, nlen, flags);
+ res = sl811_send_packet(dev, pipe, (unsigned char*)buffer+done, nlen, flags);
if (res < 0) {
UNLOCKUSB;
dev->act_len = done;
@@ -873,7 +872,7 @@
/* setup phase */
usb_settoggle(dev, ep, 1, 0);
if (sl811_send_packet(dev, usb_sndctrlpipe(dev, ep),
- (__u8*)setup, sizeof(*setup), 0) == sizeof(*setup)) {
+ (unsigned char*)setup, sizeof(*setup), 0) == sizeof(*setup)) {
int dir_in = usb_pipein(pipe);
/* data phase */
@@ -888,7 +887,7 @@
while (done < len) {
long res;
long nlen = (max > (len - done)) ? (len - done) : max;
- res = sl811_send_packet(dev, pipe, (__u8*)buffer+done, nlen, 0);
+ res = sl811_send_packet(dev, pipe, (unsigned char*)buffer+done, nlen, 0);
if (res < 0) {
ALERT(("1status data failed!"));
dev->status = -res;
@@ -949,7 +948,7 @@
long res;
long nlen = (max > (len - done)) ? (len - done) : max;
- res = sl811_send_packet(dev, pipe, (__u8*)buffer+done, nlen, 0);
+ res = sl811_send_packet(dev, pipe, (unsigned char*)buffer+done, nlen, 0);
if (res < 0) {
UNLOCKUSB;
@@ -978,7 +977,7 @@
*/
/* Device descriptor */
-static __u8 sl811_rh_dev_des[] =
+static unsigned char sl811_rh_dev_des[] =
{
0x12, /* __u8 bLength; */
0x01, /* __u8 bDescriptorType; Device */
@@ -1001,7 +1000,7 @@
};
/* Configuration descriptor */
-static __u8 sl811_rh_config_des[] =
+static unsigned char sl811_rh_config_des[] =
{
0x09, /* __u8 bLength; */
0x02, /* __u8 bDescriptorType; Configuration */
@@ -1037,7 +1036,7 @@
};
/* root hub class descriptor*/
-static __u8 sl811_rh_hub_des[] =
+static unsigned char sl811_rh_hub_des[] =
{
0x09, /* __u8 bLength; */
0x29, /* __u8 bDescriptorType; Hub-descriptor */
@@ -1054,7 +1053,7 @@
* helper routine for returning string descriptors in UTF-16LE
* input can actually be ISO-8859-1; ASCII is its 7-bit subset
*/
-static int ascii2utf (char *s, u8 *utf, int utfmax)
+static int ascii2utf (char *s, unsigned char *utf, int utfmax)
{
int retval;
@@ -1069,7 +1068,7 @@
* root_hub_string is used by each host controller's root hub code,
* so that they're identified consistently throughout the system.
*/
-static int usb_root_hub_string (int id, __u8 *data, long len)
+static int usb_root_hub_string (int id, unsigned char *data, long len)
{
char buf [30];
@@ -1112,8 +1111,8 @@
static inline long sl811_rh_submit_urb(struct usb_device *usb_dev, unsigned long pipe,
void *data, unsigned short buf_len, struct devrequest *cmd)
{
- __u8 data_buf[16];
- __u8 *bufp = data_buf;
+ unsigned char data_buf[16];
+ unsigned char *bufp = data_buf;
unsigned short len = 0;
long status = 0;
__u16 bmRType_bReq;
@@ -1468,7 +1467,7 @@
#endif
if (!(MFP_GPIP & 0x20)) {
- __u8 status;
+ unsigned char status;
if (check_flock() != 0) {
return;