From 5deb3317cb51ac52de922bb55f8492624018906d Mon Sep 17 00:00:00 2001 From: Roman Yeryomin Date: Thu, 13 Sep 2012 00:40:35 +0300 Subject: Add realtek target files Signed-off-by: Roman Yeryomin --- .../include/net/rtl/rtl865x_igmpsnooping_glue.h | 113 +++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 target/linux/realtek/files/include/net/rtl/rtl865x_igmpsnooping_glue.h (limited to 'target/linux/realtek/files/include/net/rtl/rtl865x_igmpsnooping_glue.h') diff --git a/target/linux/realtek/files/include/net/rtl/rtl865x_igmpsnooping_glue.h b/target/linux/realtek/files/include/net/rtl/rtl865x_igmpsnooping_glue.h new file mode 100644 index 000000000..c648df3f2 --- /dev/null +++ b/target/linux/realtek/files/include/net/rtl/rtl865x_igmpsnooping_glue.h @@ -0,0 +1,113 @@ +/* +* Copyright c Realsil Semiconductor Corporation, 2006 +* All rights reserved. +* +* Program : IGMP glue file +* Abstract : +* Author :qinjunjie +* Email:qinjunjie1980@hotmail.com +* +*/ + +#ifndef NULL +#define NULL 0 +#endif + +#ifndef TRUE +#define TRUE 1 +#endif + +#ifndef FALSE +#define FALSE 0 +#endif + +#ifndef SUCCESS +#define SUCCESS 0 +#endif + +#ifndef FAILED +#define FAILED -1 +#endif + + +#if 0 +#ifndef _RTL_TYPES_H +typedef unsigned int uint32; +typedef int int32; +typedef unsigned short uint16; +typedef short int16; +typedef unsigned char uint8; +typedef char int8; +#endif +#else +#include "rtl_types.h" +#endif + +#ifndef RTL_MULTICAST_SNOOPING_GLUE +#define RTL_MULTICAST_SNOOPING_GLUE + + +#define swapl32(x)\ + ((((x) & 0xff000000U) >> 24) | \ + (((x) & 0x00ff0000U) >> 8) | \ + (((x) & 0x0000ff00U) << 8) | \ + (((x) & 0x000000ffU) << 24)) +#define swaps16(x) \ + ((((x) & 0xff00) >> 8) | \ + (((x) & 0x00ff) << 8)) + +#ifdef _LITTLE_ENDIAN + +#ifndef ntohs + #define ntohs(x) (swaps16(x)) +#endif + +#ifndef ntohl + #define ntohl(x) (swapl32(x)) +#endif + +#ifndef htons + #define htons(x) (swaps16(x)) +#endif + +#ifndef htonl + #define htonl(x) (swapl32(x)) +#endif + +#else + +#ifndef ntohs + #define ntohs(x) (x) +#endif + +#ifndef ntohl + #define ntohl(x) (x) +#endif + +#ifndef htons + #define htons(x) (x) +#endif + +#ifndef htonl + #define htonl(x) (x) +#endif + +#endif + +#ifdef __KERNEL__ + #define rtl_gluePrintf printk +#else + #define rtl_gluePrintf printf +#endif + + +void *rtl_glueMalloc(uint32 NBYTES); +void rtl_glueFree(void *memblock); + +void rtl_glueMutexLock(void); +void rtl_glueMutexUnlock(void); + +#endif + + + -- cgit v1.2.3