diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-09-08 14:46:36 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-09-08 21:15:06 -0700 |
commit | f8942e07a3db9d82e8fb11d3d494876b8bae9ff9 (patch) | |
tree | 2406636a4f9a4ac6b0bfc90e07aefa8b1b18b8ff /drivers/staging/bcm/IPv6ProtocolHdr.h | |
parent | 2d2f03b022186e6d7520a758abdea9c04a2969fe (diff) | |
download | linux-f8942e07a3db9d82e8fb11d3d494876b8bae9ff9.tar.bz2 |
staging: Beeceem USB Wimax driver
The Sprint 4G network uses a Wimax dongle with Beecem
chipset. The driver is typical of out of tree drivers, but
maybe useful for people, and the hardware is readily available.
Here is a staging ready version (i.e warts and all)
0. Started with Rel_5.2.7.3P1_USB from Sprint4GDeveloperPack-1.1
1. Consolidated files in staging
2. Remove Dos cr/lf
3. Remove unnecessary ioctl from usbbcm_fops
Applied patches that were in the developer pack, surprising
there were ones for 2.6.35 already.
This is compile tested only, see TODO for what still needs
to be done.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/bcm/IPv6ProtocolHdr.h')
-rw-r--r-- | drivers/staging/bcm/IPv6ProtocolHdr.h | 119 |
1 files changed, 119 insertions, 0 deletions
diff --git a/drivers/staging/bcm/IPv6ProtocolHdr.h b/drivers/staging/bcm/IPv6ProtocolHdr.h new file mode 100644 index 000000000000..b93f7902e283 --- /dev/null +++ b/drivers/staging/bcm/IPv6ProtocolHdr.h @@ -0,0 +1,119 @@ +#ifndef _IPV6_PROTOCOL_DEFINES_ +#define _IPV6_PROTOCOL_DEFINES_ + + +#define IPV6HDR_TYPE_HOPBYHOP 0x0 +#define IPV6HDR_TYPE_ROUTING 0x2B +#define IPV6HDR_TYPE_FRAGMENTATION 0x2C +#define IPV6HDR_TYPE_DESTOPTS 0x3c +#define IPV6HDR_TYPE_AUTHENTICATION 0x33 +#define IPV6HDR_TYPE_ENCRYPTEDSECURITYPAYLOAD 0x34 +#define MASK_IPV6_CS_SPEC 0x2 + + +#define TCP_HEADER_TYPE 0x6 +#define UDP_HEADER_TYPE 0x11 +#define IPV6_ICMP_HDR_TYPE 0x2 +#define IPV6_FLOWLABEL_BITOFFSET 9 + +#define IPV6_MAX_CHAINEDHDR_BUFFBYTES 0x64 +/* +// Size of Dest Options field of Destinations Options Header +// in bytes. +*/ +#define IPV6_DESTOPTS_HDR_OPTIONSIZE 0x8 + +//typedef unsigned char UCHAR; +//typedef unsigned short USHORT; +//typedef unsigned long int ULONG; + +typedef struct IPV6HeaderFormatTag +{ + UCHAR ucVersionPrio; + UCHAR aucFlowLabel[3]; + USHORT usPayloadLength; + UCHAR ucNextHeader; + UCHAR ucHopLimit; + ULONG ulSrcIpAddress[4]; + ULONG ulDestIpAddress[4]; +}IPV6Header; + +typedef struct IPV6RoutingHeaderFormatTag +{ + UCHAR ucNextHeader; + UCHAR ucRoutingType; + UCHAR ucNumAddresses; + UCHAR ucNextAddress; + ULONG ulReserved; + //UCHAR aucAddressList[0]; + +}IPV6RoutingHeader; + +typedef struct IPV6FragmentHeaderFormatTag +{ + UCHAR ucNextHeader; + UCHAR ucReserved; + USHORT usFragmentOffset; + ULONG ulIdentification; +}IPV6FragmentHeader; + +typedef struct IPV6DestOptionsHeaderFormatTag +{ + UCHAR ucNextHeader; + UCHAR ucHdrExtLen; + UCHAR ucDestOptions[6]; + //UCHAR udExtDestOptions[0]; +}IPV6DestOptionsHeader; + +typedef struct IPV6HopByHopOptionsHeaderFormatTag +{ + UCHAR ucNextHeader; + UCHAR ucMisc[3]; + ULONG ulJumboPayloadLen; +}IPV6HopByHopOptionsHeader; + +typedef struct IPV6AuthenticationHeaderFormatTag +{ + UCHAR ucNextHeader; + UCHAR ucLength; + USHORT usReserved; + ULONG ulSecurityParametersIndex; + //UCHAR ucAuthenticationData[0]; + +}IPV6AuthenticationHeader; + +typedef struct IPV6IcmpHeaderFormatTag +{ + UCHAR ucType; + UCHAR ucCode; + USHORT usChecksum; + //UCHAR ucIcmpMsg[0]; + +}IPV6IcmpHeader; + +typedef enum _E_IPADDR_CONTEXT +{ + eSrcIpAddress, + eDestIpAddress + +}E_IPADDR_CONTEXT; + + + +//Function Prototypes +BOOLEAN MatchSrcIpv6Address(S_CLASSIFIER_RULE *pstClassifierRule,IPV6Header *pstIpv6Header); +BOOLEAN MatchDestIpv6Address(S_CLASSIFIER_RULE *pstClassifierRule,IPV6Header *pstIpv6Header); + +USHORT IpVersion6(PMINI_ADAPTER Adapter, /**< Pointer to the driver control structure */ + PVOID pcIpHeader, /**<Pointer to the IP Hdr of the packet*/ + S_CLASSIFIER_RULE *pstClassifierRule ); + +VOID DumpIpv6Address(ULONG *puIpv6Address); +VOID DumpIpv6Header(IPV6Header *pstIpv6Header); + +extern BOOLEAN MatchSrcPort(S_CLASSIFIER_RULE *pstClassifierRule,USHORT ushSrcPort); +extern BOOLEAN MatchDestPort(S_CLASSIFIER_RULE *pstClassifierRule,USHORT ushSrcPort); +extern BOOLEAN MatchProtocol(S_CLASSIFIER_RULE *pstClassifierRule,UCHAR ucProtocol); + + +#endif |