[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bluetooth-dev] Hard Hat LINUX Bluetooth

Peter Kjellerstedt wrote:
> I assume this is a big endian processor, or I cannot see how this could
> happen.

Yes, you're right !

> Look in the local.h file in linux/include/linux/bluetooth.
> There are the definition/declaration of cpu_to_le16().
> For big endian machines this is declared as an inline function.
> Try changing the extern inline to static inline.

It helps. I made that change some days ago ! 

#ifndef __KERNEL__
#  ifdef __LITTLE_ENDIAN
#    define cpu_to_le16(x) (x)
#    define cpu_to_le32(x) (x)
#    define cpu_to_be16(x) htons((x))
#    define cpu_to_be32(x) htonl((x))
#  else
#    define cpu_to_be16(x) (x)
#    define cpu_to_be32(x) (x)
     static inline __u16 cpu_to_le16(__u16 x) { return (x<<8) | (x>>8);}
     static inline __u32 cpu_to_le32(__u32 x) { return((x>>24) |
((x>>8)&0xff00) | ((x<<8)&0xff0000) | (x<<24));}

This is how the section in local.h should look like ! 

It only works if you do a "make clean" after you changed the header
file. local.h is not in the dependancies of the makefiles.

To unsubscribe from this list: send the line "unsubscribe bluetooth-dev" in
the body of a message to majordomo@xxxxxxx.com