Add files via upload
This commit is contained in:
parent
a8e42694d4
commit
c00c6771bf
|
@ -0,0 +1,82 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2017 Realtek Corporation.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
*****************************************************************************/
|
||||
#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
|
||||
|
||||
#include <byteorder/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) ___constant_swab64((x))
|
||||
#define __constant_le64_to_cpu(x) ___constant_swab64((x))
|
||||
#define __constant_cpu_to_le32(x) ___constant_swab32((x))
|
||||
#define __constant_le32_to_cpu(x) ___constant_swab32((x))
|
||||
#define __constant_cpu_to_le16(x) ___constant_swab16((x))
|
||||
#define __constant_le16_to_cpu(x) ___constant_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 <byteorder/generic.h>
|
||||
|
||||
#endif /* _LINUX_BYTEORDER_BIG_ENDIAN_H */
|
|
@ -0,0 +1,207 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2017 Realtek Corporation.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
*****************************************************************************/
|
||||
#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(PLATFORM_LINUX) || defined(PLATFORM_WINDOWS) || defined(PLATFORM_MPIXEL) || defined(PLATFORM_FREEBSD)
|
||||
/*
|
||||
* 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
|
||||
|
||||
|
||||
/*
|
||||
* 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(PLATFORM_LINUX) || (defined(__GLIBC__) && __GLIBC__ >= 2)
|
||||
extern __u32 ntohl(__u32);
|
||||
extern __u32 htonl(__u32);
|
||||
#else /* defined(PLATFORM_LINUX) || (defined (__GLIBC__) && __GLIBC__ >= 2) */
|
||||
#ifndef PLATFORM_FREEBSD
|
||||
extern unsigned long int ntohl(unsigned long int);
|
||||
extern unsigned long int htonl(unsigned long int);
|
||||
#endif
|
||||
#endif
|
||||
#ifndef PLATFORM_FREEBSD
|
||||
extern unsigned short int ntohs(unsigned short int);
|
||||
extern unsigned short int htons(unsigned short int);
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && (__GNUC__ >= 2) && defined(__OPTIMIZE__) || defined(PLATFORM_MPIXEL)
|
||||
|
||||
#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(PLATFORM_LINUX) || (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 */
|
||||
|
||||
|
||||
#if defined(PLATFORM_WINDOWS)
|
||||
|
||||
#define htonl(x) __cpu_to_be32(x)
|
||||
#define ntohl(x) __be32_to_cpu(x)
|
||||
#define htons(x) __cpu_to_be16(x)
|
||||
#define ntohs(x) __be16_to_cpu(x)
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* _LINUX_BYTEORDER_GENERIC_H */
|
|
@ -0,0 +1,84 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2017 Realtek Corporation.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
*****************************************************************************/
|
||||
#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
|
||||
|
||||
#include <byteorder/swab.h>
|
||||
|
||||
#ifndef __constant_htonl
|
||||
#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))
|
||||
#endif /* __constant_htonl */
|
||||
|
||||
#include <byteorder/generic.h>
|
||||
|
||||
#endif /* _LINUX_BYTEORDER_LITTLE_ENDIAN_H */
|
|
@ -0,0 +1,136 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2017 Realtek Corporation.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
*****************************************************************************/
|
||||
#ifndef _LINUX_BYTEORDER_SWAB_H
|
||||
#define _LINUX_BYTEORDER_SWAB_H
|
||||
|
||||
#if !defined(CONFIG_PLATFORM_MSTAR)
|
||||
#ifndef __u16
|
||||
typedef unsigned short __u16;
|
||||
#endif
|
||||
|
||||
#ifndef __u32
|
||||
typedef unsigned int __u32;
|
||||
#endif
|
||||
|
||||
#ifndef __u8
|
||||
typedef unsigned char __u8;
|
||||
#endif
|
||||
|
||||
#ifndef __u64
|
||||
typedef unsigned long long __u64;
|
||||
#endif
|
||||
|
||||
|
||||
__inline static __u16 ___swab16(__u16 x)
|
||||
{
|
||||
__u16 __x = x;
|
||||
return
|
||||
(__u16)(
|
||||
(((__u16)(__x)&(__u16)0x00ffU) << 8) |
|
||||
(((__u16)(__x)&(__u16)0xff00U) >> 8));
|
||||
|
||||
}
|
||||
|
||||
__inline static __u32 ___swab32(__u32 x)
|
||||
{
|
||||
__u32 __x = (x);
|
||||
return (__u32)(
|
||||
(((__u32)(__x)&(__u32)0x000000ffUL) << 24) |
|
||||
(((__u32)(__x)&(__u32)0x0000ff00UL) << 8) |
|
||||
(((__u32)(__x)&(__u32)0x00ff0000UL) >> 8) |
|
||||
(((__u32)(__x)&(__u32)0xff000000UL) >> 24));
|
||||
}
|
||||
|
||||
__inline static __u64 ___swab64(__u64 x)
|
||||
{
|
||||
__u64 __x = (x);
|
||||
|
||||
return
|
||||
(__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));
|
||||
\
|
||||
}
|
||||
#endif /* CONFIG_PLATFORM_MSTAR */
|
||||
|
||||
#ifndef __arch__swab16
|
||||
__inline static __u16 __arch__swab16(__u16 x)
|
||||
{
|
||||
return ___swab16(x);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef __arch__swab32
|
||||
__inline static __u32 __arch__swab32(__u32 x)
|
||||
{
|
||||
__u32 __tmp = (x) ;
|
||||
return ___swab32(__tmp);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef __arch__swab64
|
||||
|
||||
__inline static __u64 __arch__swab64(__u64 x)
|
||||
{
|
||||
__u64 __tmp = (x) ;
|
||||
return ___swab64(__tmp);
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef __swab16
|
||||
#define __swab16(x) __fswab16(x)
|
||||
#define __swab32(x) __fswab32(x)
|
||||
#define __swab64(x) __fswab64(x)
|
||||
#endif /* __swab16 */
|
||||
|
||||
#ifdef PLATFORM_FREEBSD
|
||||
__inline static __u16 __fswab16(__u16 x)
|
||||
#else
|
||||
__inline static const __u16 __fswab16(__u16 x)
|
||||
#endif /* PLATFORM_FREEBSD */
|
||||
{
|
||||
return __arch__swab16(x);
|
||||
}
|
||||
#ifdef PLATFORM_FREEBSD
|
||||
__inline static __u32 __fswab32(__u32 x)
|
||||
#else
|
||||
__inline static const __u32 __fswab32(__u32 x)
|
||||
#endif /* PLATFORM_FREEBSD */
|
||||
{
|
||||
return __arch__swab32(x);
|
||||
}
|
||||
|
||||
#if defined(PLATFORM_LINUX) || defined(PLATFORM_WINDOWS)
|
||||
#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 */
|
|
@ -0,0 +1,151 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2017 Realtek Corporation.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
*****************************************************************************/
|
||||
#ifndef _LINUX_BYTEORDER_SWABB_H
|
||||
#define _LINUX_BYTEORDER_SWABB_H
|
||||
|
||||
/*
|
||||
* linux/byteorder/swabb.h
|
||||
* SWAp Bytes Bizarrely
|
||||
* swaHHXX[ps]?(foo)
|
||||
*
|
||||
* Support for obNUXIous pdp-endian and other bizarre architectures.
|
||||
* Will Linux ever run on such ancient beasts? if not, this file
|
||||
* will be but a programming pearl. Still, it's a reminder that we
|
||||
* shouldn't be making too many assumptions when trying to be portable.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Meaning of the names I chose (vaxlinux people feel free to correct them):
|
||||
* swahw32 swap 16-bit half-words in a 32-bit word
|
||||
* swahb32 swap 8-bit halves of each 16-bit half-word in a 32-bit word
|
||||
*
|
||||
* No 64-bit support yet. I don't know NUXI conventions for long longs.
|
||||
* I guarantee it will be a mess when it's there, though :->
|
||||
* It will be even worse if there are conflicting 64-bit conventions.
|
||||
* Hopefully, no one ever used 64-bit objects on NUXI machines.
|
||||
*
|
||||
*/
|
||||
|
||||
#define ___swahw32(x) \
|
||||
({ \
|
||||
__u32 __x = (x); \
|
||||
((__u32)(\
|
||||
(((__u32)(__x) & (__u32)0x0000ffffUL) << 16) | \
|
||||
(((__u32)(__x) & (__u32)0xffff0000UL) >> 16))); \
|
||||
})
|
||||
#define ___swahb32(x) \
|
||||
({ \
|
||||
__u32 __x = (x); \
|
||||
((__u32)(\
|
||||
(((__u32)(__x) & (__u32)0x00ff00ffUL) << 8) | \
|
||||
(((__u32)(__x) & (__u32)0xff00ff00UL) >> 8))); \
|
||||
})
|
||||
|
||||
#define ___constant_swahw32(x) \
|
||||
((__u32)(\
|
||||
(((__u32)(x) & (__u32)0x0000ffffUL) << 16) | \
|
||||
(((__u32)(x) & (__u32)0xffff0000UL) >> 16)))
|
||||
#define ___constant_swahb32(x) \
|
||||
((__u32)(\
|
||||
(((__u32)(x) & (__u32)0x00ff00ffUL) << 8) | \
|
||||
(((__u32)(x) & (__u32)0xff00ff00UL) >> 8)))
|
||||
|
||||
/*
|
||||
* provide defaults when no architecture-specific optimization is detected
|
||||
*/
|
||||
#ifndef __arch__swahw32
|
||||
#define __arch__swahw32(x) ___swahw32(x)
|
||||
#endif
|
||||
#ifndef __arch__swahb32
|
||||
#define __arch__swahb32(x) ___swahb32(x)
|
||||
#endif
|
||||
|
||||
#ifndef __arch__swahw32p
|
||||
#define __arch__swahw32p(x) __swahw32(*(x))
|
||||
#endif
|
||||
#ifndef __arch__swahb32p
|
||||
#define __arch__swahb32p(x) __swahb32(*(x))
|
||||
#endif
|
||||
|
||||
#ifndef __arch__swahw32s
|
||||
#define __arch__swahw32s(x) do { *(x) = __swahw32p((x)); } while (0)
|
||||
#endif
|
||||
#ifndef __arch__swahb32s
|
||||
#define __arch__swahb32s(x) do { *(x) = __swahb32p((x)); } while (0)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Allow constant folding
|
||||
*/
|
||||
#if defined(__GNUC__) && (__GNUC__ >= 2) && defined(__OPTIMIZE__)
|
||||
# define __swahw32(x) \
|
||||
(__builtin_constant_p((__u32)(x)) ? \
|
||||
___swahw32((x)) : \
|
||||
__fswahw32((x)))
|
||||
# define __swahb32(x) \
|
||||
(__builtin_constant_p((__u32)(x)) ? \
|
||||
___swahb32((x)) : \
|
||||
__fswahb32((x)))
|
||||
#else
|
||||
# define __swahw32(x) __fswahw32(x)
|
||||
# define __swahb32(x) __fswahb32(x)
|
||||
#endif /* OPTIMIZE */
|
||||
|
||||
|
||||
__inline static__ __const__ __u32 __fswahw32(__u32 x)
|
||||
{
|
||||
return __arch__swahw32(x);
|
||||
}
|
||||
__inline static__ __u32 __swahw32p(__u32 *x)
|
||||
{
|
||||
return __arch__swahw32p(x);
|
||||
}
|
||||
__inline static__ void __swahw32s(__u32 *addr)
|
||||
{
|
||||
__arch__swahw32s(addr);
|
||||
}
|
||||
|
||||
|
||||
__inline static__ __const__ __u32 __fswahb32(__u32 x)
|
||||
{
|
||||
return __arch__swahb32(x);
|
||||
}
|
||||
__inline static__ __u32 __swahb32p(__u32 *x)
|
||||
{
|
||||
return __arch__swahb32p(x);
|
||||
}
|
||||
__inline static__ void __swahb32s(__u32 *addr)
|
||||
{
|
||||
__arch__swahb32s(addr);
|
||||
}
|
||||
|
||||
#ifdef __BYTEORDER_HAS_U64__
|
||||
/*
|
||||
* Not supported yet
|
||||
*/
|
||||
#endif /* __BYTEORDER_HAS_U64__ */
|
||||
|
||||
#if defined(PLATFORM_LINUX)
|
||||
#define swahw32 __swahw32
|
||||
#define swahb32 __swahb32
|
||||
#define swahw32p __swahw32p
|
||||
#define swahb32p __swahb32p
|
||||
#define swahw32s __swahw32s
|
||||
#define swahb32s __swahb32s
|
||||
#endif
|
||||
|
||||
#endif /* _LINUX_BYTEORDER_SWABB_H */
|
|
@ -0,0 +1,279 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* 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.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
/*This header file is for all driver teams to use the same station info.
|
||||
If you want to change this file please make sure notify all driver teams maintainers.*/
|
||||
|
||||
/*Created by YuChen 20170301*/
|
||||
|
||||
#ifndef __INC_RTW_STA_INFO_H
|
||||
#define __INC_RTW_STA_INFO_H
|
||||
|
||||
/*--------------------Define ---------------------------------------*/
|
||||
|
||||
#define STA_DM_CTRL_ACTIVE BIT(0)
|
||||
#define STA_DM_CTRL_CFO_TRACKING BIT(1)
|
||||
|
||||
#ifdef CONFIG_BEAMFORMING
|
||||
#define BEAMFORMING_HT_BEAMFORMER_ENABLE BIT(0) /*Declare sta support beamformer*/
|
||||
#define BEAMFORMING_HT_BEAMFORMEE_ENABLE BIT(1) /*Declare sta support beamformee*/
|
||||
#define BEAMFORMING_HT_BEAMFORMER_TEST BIT(2) /*Transmiting Beamforming no matter the target supports it or not*/
|
||||
#define BEAMFORMING_HT_BEAMFORMER_STEER_NUM (BIT(4)|BIT(5)) /*Sta Bfer's capability*/
|
||||
#define BEAMFORMING_HT_BEAMFORMEE_CHNL_EST_CAP (BIT(6)|BIT(7)) /*Sta BFee's capability*/
|
||||
|
||||
#define BEAMFORMING_VHT_BEAMFORMER_ENABLE BIT(0) /*Declare sta support beamformer*/
|
||||
#define BEAMFORMING_VHT_BEAMFORMEE_ENABLE BIT(1) /*Declare sta support beamformee*/
|
||||
#define BEAMFORMING_VHT_MU_MIMO_AP_ENABLE BIT(2) /*Declare sta support MU beamformer*/
|
||||
#define BEAMFORMING_VHT_MU_MIMO_STA_ENABLE BIT(3) /*Declare sta support MU beamformer*/
|
||||
#define BEAMFORMING_VHT_BEAMFORMER_TEST BIT(4) /*Transmiting Beamforming no matter the target supports it or not*/
|
||||
#define BEAMFORMING_VHT_BEAMFORMER_STS_CAP (BIT(8)|BIT(9)|BIT(10)) /*Sta BFee's capability*/
|
||||
#define BEAMFORMING_VHT_BEAMFORMEE_SOUND_DIM (BIT(12)|BIT(13)|BIT(14)) /*Sta Bfer's capability*/
|
||||
#endif
|
||||
|
||||
#define HT_STBC_EN BIT(0)
|
||||
#define VHT_STBC_EN BIT(1)
|
||||
|
||||
#define HT_LDPC_EN BIT(0)
|
||||
#define VHT_LDPC_EN BIT(1)
|
||||
|
||||
#define SM_PS_STATIC 0
|
||||
#define SM_PS_DYNAMIC 1
|
||||
#define SM_PS_INVALID 2
|
||||
#define SM_PS_DISABLE 3
|
||||
|
||||
|
||||
/*cmn_sta_info.ra_sta_info.txrx_state*/
|
||||
#define TX_STATE 0
|
||||
#define RX_STATE 1
|
||||
#define BI_DIRECTION_STATE 2
|
||||
|
||||
/*--------------------Define Enum-----------------------------------*/
|
||||
enum channel_width {
|
||||
CHANNEL_WIDTH_20 = 0,
|
||||
CHANNEL_WIDTH_40 = 1,
|
||||
CHANNEL_WIDTH_80 = 2,
|
||||
CHANNEL_WIDTH_160 = 3,
|
||||
CHANNEL_WIDTH_80_80 = 4,
|
||||
CHANNEL_WIDTH_5 = 5,
|
||||
CHANNEL_WIDTH_10 = 6,
|
||||
CHANNEL_WIDTH_MAX = 7,
|
||||
};
|
||||
|
||||
enum rf_type {
|
||||
RF_1T1R = 0,
|
||||
RF_1T2R = 1,
|
||||
RF_2T2R = 2,
|
||||
RF_2T3R = 3,
|
||||
RF_2T4R = 4,
|
||||
RF_3T3R = 5,
|
||||
RF_3T4R = 6,
|
||||
RF_4T4R = 7,
|
||||
RF_4T3R = 8,
|
||||
RF_4T2R = 9,
|
||||
RF_4T1R = 10,
|
||||
RF_3T2R = 11,
|
||||
RF_3T1R = 12,
|
||||
RF_2T1R = 13,
|
||||
RF_1T4R = 14,
|
||||
RF_1T3R = 15,
|
||||
RF_TYPE_MAX,
|
||||
};
|
||||
|
||||
enum bb_path {
|
||||
BB_PATH_NON = 0,
|
||||
BB_PATH_A = 0x00000001,
|
||||
BB_PATH_B = 0x00000002,
|
||||
BB_PATH_C = 0x00000004,
|
||||
BB_PATH_D = 0x00000008,
|
||||
|
||||
BB_PATH_AB = (BB_PATH_A | BB_PATH_B),
|
||||
BB_PATH_AC = (BB_PATH_A | BB_PATH_C),
|
||||
BB_PATH_AD = (BB_PATH_A | BB_PATH_D),
|
||||
BB_PATH_BC = (BB_PATH_B | BB_PATH_C),
|
||||
BB_PATH_BD = (BB_PATH_B | BB_PATH_D),
|
||||
BB_PATH_CD = (BB_PATH_C | BB_PATH_D),
|
||||
|
||||
BB_PATH_ABC = (BB_PATH_A | BB_PATH_B | BB_PATH_C),
|
||||
BB_PATH_ABD = (BB_PATH_A | BB_PATH_B | BB_PATH_D),
|
||||
BB_PATH_ACD = (BB_PATH_A | BB_PATH_C | BB_PATH_D),
|
||||
BB_PATH_BCD = (BB_PATH_B | BB_PATH_C | BB_PATH_D),
|
||||
|
||||
BB_PATH_ABCD = (BB_PATH_A | BB_PATH_B | BB_PATH_C | BB_PATH_D),
|
||||
BB_PATH_AUTO = 0xff /*for path diversity*/
|
||||
};
|
||||
|
||||
enum rf_path {
|
||||
RF_PATH_A = 0,
|
||||
RF_PATH_B = 1,
|
||||
RF_PATH_C = 2,
|
||||
RF_PATH_D = 3,
|
||||
RF_PATH_AB,
|
||||
RF_PATH_AC,
|
||||
RF_PATH_AD,
|
||||
RF_PATH_BC,
|
||||
RF_PATH_BD,
|
||||
RF_PATH_CD,
|
||||
RF_PATH_ABC,
|
||||
RF_PATH_ABD,
|
||||
RF_PATH_ACD,
|
||||
RF_PATH_BCD,
|
||||
RF_PATH_ABCD,
|
||||
};
|
||||
|
||||
enum rf_syn {
|
||||
RF_SYN0 = 0,
|
||||
RF_SYN1 = 1,
|
||||
};
|
||||
|
||||
enum rfc_mode {
|
||||
rfc_4x4 = 0,
|
||||
rfc_2x2 = 1,
|
||||
};
|
||||
|
||||
enum wireless_set {
|
||||
WIRELESS_CCK = 0x00000001,
|
||||
WIRELESS_OFDM = 0x00000002,
|
||||
WIRELESS_HT = 0x00000004,
|
||||
WIRELESS_VHT = 0x00000008,
|
||||
};
|
||||
|
||||
/*--------------------Define MACRO---------------------------------*/
|
||||
|
||||
/*--------------------Define Struct-----------------------------------*/
|
||||
|
||||
#ifdef CONFIG_BEAMFORMING
|
||||
struct bf_cmn_info {
|
||||
u8 ht_beamform_cap; /*Sta capablity*/
|
||||
u16 vht_beamform_cap; /*Sta capablity*/
|
||||
u16 p_aid;
|
||||
u8 g_id;
|
||||
};
|
||||
#endif
|
||||
struct rssi_info {
|
||||
s8 rssi;
|
||||
s8 rssi_cck;
|
||||
s8 rssi_ofdm;
|
||||
u8 packet_map;
|
||||
u8 ofdm_pkt_cnt;
|
||||
u8 cck_pkt_cnt;
|
||||
u16 cck_sum_power;
|
||||
u8 is_send_rssi;
|
||||
u8 valid_bit;
|
||||
s16 rssi_acc; /*accumulate RSSI for per packet MA sum*/
|
||||
};
|
||||
|
||||
struct ra_sta_info {
|
||||
u8 rate_id; /*[PHYDM] ratr_idx*/
|
||||
u8 rssi_level; /*[PHYDM]*/
|
||||
u8 is_first_connect:1; /*[PHYDM] CE: ra_rpt_linked, AP: H2C_rssi_rpt*/
|
||||
u8 is_support_sgi:1; /*[driver]*/
|
||||
u8 is_vht_enable:2; /*[driver]*/
|
||||
u8 disable_ra:1; /*[driver]*/
|
||||
u8 disable_pt:1; /*[driver] remove is_disable_power_training*/
|
||||
u8 txrx_state:2; /*[PHYDM] 0: Tx, 1:Rx, 2:bi-direction*/
|
||||
u8 is_noisy:1; /*[PHYDM]*/
|
||||
u8 curr_tx_rate; /*[PHYDM] FW->Driver*/
|
||||
enum channel_width ra_bw_mode; /*[Driver] max bandwidth, for RA only*/
|
||||
enum channel_width curr_tx_bw; /*[PHYDM] FW->Driver*/
|
||||
u8 curr_retry_ratio; /*[PHYDM] FW->Driver*/
|
||||
u64 ramask;
|
||||
};
|
||||
|
||||
struct dtp_info {
|
||||
u8 dyn_tx_power; /*Dynamic Tx power offset*/
|
||||
u8 last_tx_power;
|
||||
boolean sta_is_alive;
|
||||
u8 sta_tx_high_power_lvl:4;
|
||||
u8 sta_last_dtp_lvl:4;
|
||||
};
|
||||
|
||||
struct cmn_sta_info {
|
||||
u16 dm_ctrl; /*[Driver]*/
|
||||
enum channel_width bw_mode; /*[Driver] max support BW*/
|
||||
u8 mac_id; /*[Driver]*/
|
||||
u8 mac_addr[6]; /*[Driver]*/
|
||||
u16 aid; /*[Driver]*/
|
||||
enum rf_type mimo_type; /*[Driver] sta XTXR*/
|
||||
struct rssi_info rssi_stat; /*[PHYDM]*/
|
||||
struct ra_sta_info ra_info; /*[Driver&PHYDM]*/
|
||||
u16 tx_moving_average_tp; /*[Driver] tx average MBps*/
|
||||
u16 rx_moving_average_tp; /*[Driver] rx average MBps*/
|
||||
u8 stbc_en:2; /*[Driver] really transmitt STBC*/
|
||||
u8 ldpc_en:2; /*[Driver] really transmitt LDPC*/
|
||||
enum wireless_set support_wireless_set;/*[Driver]*/
|
||||
#ifdef CONFIG_BEAMFORMING
|
||||
struct bf_cmn_info bf_info; /*[Driver]*/
|
||||
#endif
|
||||
u8 sm_ps:2; /*[Driver]*/
|
||||
struct dtp_info dtp_stat; /*[PHYDM] Dynamic Tx power offset*/
|
||||
/*u8 pw2cca_over_TH_cnt;*/
|
||||
/*u8 total_pw2cca_cnt;*/
|
||||
};
|
||||
|
||||
struct phydm_phyinfo_fw_struct {
|
||||
u8 rx_rssi[4]; /* RSSI in 0~100 index */
|
||||
};
|
||||
|
||||
struct phydm_phyinfo_struct {
|
||||
boolean physts_rpt_valid; /* @if physts_rpt_valid is false, please ignore the parsing result in this structure*/
|
||||
u8 rx_pwdb_all;
|
||||
u8 signal_quality; /* OFDM: signal_quality=rx_mimo_signal_quality[0], CCK: signal qualityin 0-100 index. */
|
||||
u8 rx_mimo_signal_strength[4]; /* RSSI in 0~100 index */
|
||||
s8 rx_mimo_signal_quality[4]; /* OFDM: per-path's EVM translate to 0~100% , no used for CCK*/
|
||||
u8 rx_mimo_evm_dbm[4]; /* per-path's original EVM (dbm) */
|
||||
s16 cfo_short[4]; /* per-path's cfo_short */
|
||||
s16 cfo_tail[4]; /* per-path's cfo_tail */
|
||||
s8 rx_power; /* in dBm Translate from PWdB */
|
||||
s8 recv_signal_power; /* Real power in dBm for this packet, no beautification and aggregation. Keep this raw info to be used for the other procedures. */
|
||||
u8 bt_rx_rssi_percentage;
|
||||
u8 signal_strength; /* in 0-100 index. */
|
||||
s8 rx_pwr[4]; /* per-path's pwdb */
|
||||
s8 rx_snr[4]; /* per-path's SNR */
|
||||
u8 ant_idx[4]; /*per-path's antenna index*/
|
||||
/*ODM_PHY_STATUS_NEW_TYPE_SUPPORT*/
|
||||
u8 rx_count:2; /* RX path counter---*/
|
||||
u8 band_width:3;
|
||||
u8 rxsc:4; /* sub-channel---*/
|
||||
u8 channel; /* channel number---*/
|
||||
u8 is_mu_packet:1; /* is MU packet or not---boolean*/
|
||||
u8 is_beamformed:1; /* BF packet---boolean*/
|
||||
u8 cnt_pw2cca;
|
||||
u8 cnt_cca2agc_rdy;
|
||||
/*ODM_PHY_STATUS_NEW_TYPE_SUPPORT*/
|
||||
u8 rx_cck_evm;
|
||||
};
|
||||
|
||||
struct phydm_perpkt_info_struct {
|
||||
u8 data_rate;
|
||||
u8 station_id;
|
||||
u8 is_cck_rate: 1;
|
||||
u8 rate_ss:3; /*spatial stream of data rate*/
|
||||
u8 is_packet_match_bssid:1; /*boolean*/
|
||||
u8 is_packet_to_self:1; /*boolean*/
|
||||
u8 is_packet_beacon:1; /*boolean*/
|
||||
u8 is_to_self:1; /*boolean*/
|
||||
u8 ppdu_cnt;
|
||||
};
|
||||
|
||||
/*--------------------Export global variable----------------------------*/
|
||||
|
||||
/*--------------------Function declaration-----------------------------*/
|
||||
|
||||
#endif
|
|
@ -0,0 +1,87 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2017 Realtek Corporation.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef _LINUX_WIRELESS_H
|
||||
#define _LINUX_WIRELESS_H
|
||||
|
||||
/***************************** INCLUDES *****************************/
|
||||
|
||||
#if 0
|
||||
#include <linux/types.h> /* for __u* and __s* typedefs */
|
||||
#include <linux/socket.h> /* for "struct sockaddr" et al */
|
||||
#include <linux/if.h> /* for IFNAMSIZ and co... */
|
||||
#else
|
||||
#define __user
|
||||
/* typedef uint16_t __u16; */
|
||||
#include <sys/socket.h> /* for "struct sockaddr" et al */
|
||||
#include <net/if.h> /* for IFNAMSIZ and co... */
|
||||
#endif
|
||||
|
||||
/****************************** TYPES ******************************/
|
||||
#ifdef CONFIG_COMPAT
|
||||
struct compat_iw_point {
|
||||
compat_caddr_t pointer;
|
||||
__u16 length;
|
||||
__u16 flags;
|
||||
};
|
||||
#endif
|
||||
/* --------------------------- SUBTYPES --------------------------- */
|
||||
/*
|
||||
* For all data larger than 16 octets, we need to use a
|
||||
* pointer to memory allocated in user space.
|
||||
*/
|
||||
struct iw_point {
|
||||
void __user *pointer; /* Pointer to the data (in user space) */
|
||||
__u16 length; /* number of fields or size in bytes */
|
||||
__u16 flags; /* Optional params */
|
||||
};
|
||||
|
||||
|
||||
/* ------------------------ IOCTL REQUEST ------------------------ */
|
||||
/*
|
||||
* This structure defines the payload of an ioctl, and is used
|
||||
* below.
|
||||
*
|
||||
* Note that this structure should fit on the memory footprint
|
||||
* of iwreq (which is the same as ifreq), which mean a max size of
|
||||
* 16 octets = 128 bits. Warning, pointers might be 64 bits wide...
|
||||
* You should check this when increasing the structures defined
|
||||
* above in this file...
|
||||
*/
|
||||
union iwreq_data {
|
||||
/* Config - generic */
|
||||
char name[IFNAMSIZ];
|
||||
/* Name : used to verify the presence of wireless extensions.
|
||||
* Name of the protocol/provider... */
|
||||
|
||||
struct iw_point data; /* Other large parameters */
|
||||
};
|
||||
|
||||
/*
|
||||
* The structure to exchange data for ioctl.
|
||||
* This structure is the same as 'struct ifreq', but (re)defined for
|
||||
* convenience...
|
||||
* Do I need to remind you about structure size (32 octets) ?
|
||||
*/
|
||||
struct iwreq {
|
||||
union {
|
||||
char ifrn_name[IFNAMSIZ]; /* if name, e.g. "eth0" */
|
||||
} ifr_ifrn;
|
||||
|
||||
/* Data part (defined just above) */
|
||||
union iwreq_data u;
|
||||
};
|
||||
|
||||
#endif /* _LINUX_WIRELESS_H */
|
Loading…
Reference in New Issue