Staging: vt6655: use is_broadcast_ether_addr instead of custom macro
[deliverable/linux.git] / drivers / staging / vt6655 / tether.h
CommitLineData
5449c685
FB
1/*
2 * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
3 * All rights reserved.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * File: tether.h
20 *
21 * Purpose:
22 *
23 * Author: Tevin Chen
24 *
25 * Date: Jan. 28, 1997
26 *
27 */
28
5449c685
FB
29#ifndef __TETHER_H__
30#define __TETHER_H__
31
670ea81e 32#include <linux/etherdevice.h>
5449c685 33#include "ttype.h"
5449c685
FB
34
35/*--------------------- Export Definitions -------------------------*/
36//
37// constants
38//
078b078f 39#define U_ETHER_ADDR_STR_LEN (ETH_ALEN * 2 + 1)
5449c685
FB
40 // Ethernet address string length
41
f4a68b93 42#define MAX_LOOKAHEAD_SIZE ETH_FRAME_LEN
5449c685
FB
43
44#define U_MULTI_ADDR_LEN 8 // multicast address length
45
46
47#ifdef __BIG_ENDIAN
48
49#define TYPE_PKT_IP 0x0800 //
50#define TYPE_PKT_ARP 0x0806 //
51#define TYPE_PKT_RARP 0x8035 //
52#define TYPE_PKT_IPX 0x8137 //
53#define TYPE_PKT_802_1x 0x888e
54#define TYPE_PKT_PreAuth 0x88C7
55
56#define TYPE_PKT_PING_M_REQ 0x8011 // master reguest
57#define TYPE_PKT_PING_S_GNT 0x8022 // slave grant
58#define TYPE_PKT_PING_M 0x8077 // pingpong master packet
59#define TYPE_PKT_PING_S 0x8088 // pingpong slave packet
60#define TYPE_PKT_WOL_M_REQ 0x8033 // WOL waker request
61#define TYPE_PKT_WOL_S_GNT 0x8044 // WOL sleeper grant
62#define TYPE_MGMT_PROBE_RSP 0x5000
63#define TYPE_PKT_VNT_DIAG 0x8011 // Diag Pkt
64#define TYPE_PKT_VNT_PER 0x8888 // Diag PER Pkt
65//
66// wFrameCtl field in the S802_11Header
67//
68// NOTE....
69// in network byte order, high byte is going first
70#define FC_TODS 0x0001
71#define FC_FROMDS 0x0002
72#define FC_MOREFRAG 0x0004
73#define FC_RETRY 0x0008
74#define FC_POWERMGT 0x0010
75#define FC_MOREDATA 0x0020
76#define FC_WEP 0x0040
77#define TYPE_802_11_ATIM 0x9000
78
79#define TYPE_802_11_DATA 0x0800
80#define TYPE_802_11_CTL 0x0400
81#define TYPE_802_11_MGMT 0x0000
82#define TYPE_802_11_MASK 0x0C00
83#define TYPE_SUBTYPE_MASK 0xFC00
84#define TYPE_802_11_NODATA 0x4000
85#define TYPE_DATE_NULL 0x4800
86
87#define TYPE_CTL_PSPOLL 0xa400
88#define TYPE_CTL_RTS 0xb400
89#define TYPE_CTL_CTS 0xc400
90#define TYPE_CTL_ACK 0xd400
91
92
93//#define WEP_IV_MASK 0xFFFFFF00
94
95#else //if LITTLE_ENDIAN
96//
97// wType field in the SEthernetHeader
98//
99// NOTE....
100// in network byte order, high byte is going first
101#define TYPE_PKT_IP 0x0008 //
102#define TYPE_PKT_ARP 0x0608 //
103#define TYPE_PKT_RARP 0x3580 //
104#define TYPE_PKT_IPX 0x3781 //
105
106#define TYPE_PKT_802_1x 0x8e88
107#define TYPE_PKT_PreAuth 0xC788
108
109#define TYPE_PKT_PING_M_REQ 0x1180 // master reguest
110#define TYPE_PKT_PING_S_GNT 0x2280 // slave grant
111#define TYPE_PKT_PING_M 0x7780 // pingpong master packet
112#define TYPE_PKT_PING_S 0x8880 // pingpong slave packet
113#define TYPE_PKT_WOL_M_REQ 0x3380 // WOL waker request
114#define TYPE_PKT_WOL_S_GNT 0x4480 // WOL sleeper grant
115#define TYPE_MGMT_PROBE_RSP 0x0050
116#define TYPE_PKT_VNT_DIAG 0x1180 // Diag Pkt
117#define TYPE_PKT_VNT_PER 0x8888 // Diag PER Pkt
118//
119// wFrameCtl field in the S802_11Header
120//
121// NOTE....
122// in network byte order, high byte is going first
123#define FC_TODS 0x0100
124#define FC_FROMDS 0x0200
125#define FC_MOREFRAG 0x0400
126#define FC_RETRY 0x0800
127#define FC_POWERMGT 0x1000
128#define FC_MOREDATA 0x2000
129#define FC_WEP 0x4000
130#define TYPE_802_11_ATIM 0x0090
131
132#define TYPE_802_11_DATA 0x0008
133#define TYPE_802_11_CTL 0x0004
134#define TYPE_802_11_MGMT 0x0000
135#define TYPE_802_11_MASK 0x000C
136#define TYPE_SUBTYPE_MASK 0x00FC
137#define TYPE_802_11_NODATA 0x0040
138#define TYPE_DATE_NULL 0x0048
139
140#define TYPE_CTL_PSPOLL 0x00a4
141#define TYPE_CTL_RTS 0x00b4
142#define TYPE_CTL_CTS 0x00c4
143#define TYPE_CTL_ACK 0x00d4
144
145
146//#define WEP_IV_MASK 0x00FFFFFF
147
148#endif //#ifdef __BIG_ENDIAN
149
150#define WEP_IV_MASK 0x00FFFFFF
151
152/*--------------------- Export Types ------------------------------*/
153//
154// Ethernet packet
155//
156typedef struct tagSEthernetHeader {
078b078f
CC
157 BYTE abyDstAddr[ETH_ALEN];
158 BYTE abySrcAddr[ETH_ALEN];
5449c685
FB
159 WORD wType;
160}__attribute__ ((__packed__))
a884847a 161SEthernetHeader, *PSEthernetHeader;
5449c685
FB
162
163
164//
165// 802_3 packet
166//
167typedef struct tagS802_3Header {
078b078f
CC
168 BYTE abyDstAddr[ETH_ALEN];
169 BYTE abySrcAddr[ETH_ALEN];
5449c685
FB
170 WORD wLen;
171}__attribute__ ((__packed__))
a884847a 172S802_3Header, *PS802_3Header;
5449c685
FB
173
174//
175// 802_11 packet
176//
177typedef struct tagS802_11Header {
178 WORD wFrameCtl;
179 WORD wDurationID;
078b078f
CC
180 BYTE abyAddr1[ETH_ALEN];
181 BYTE abyAddr2[ETH_ALEN];
182 BYTE abyAddr3[ETH_ALEN];
5449c685 183 WORD wSeqCtl;
078b078f 184 BYTE abyAddr4[ETH_ALEN];
5449c685 185}__attribute__ ((__packed__))
a884847a 186S802_11Header, *PS802_11Header;
5449c685
FB
187
188/*--------------------- Export Macros ------------------------------*/
189// Frame type macro
190
5449c685
FB
191#define IS_NULL_ADDRESS(pbyEtherAddr) ( \
192 (*(PDWORD)(pbyEtherAddr) == 0L) && \
193 (*(PWORD)((PBYTE)(pbyEtherAddr) + 4) == 0) \
194)
195
196#define IS_ETH_ADDRESS_EQUAL(pbyAddr1, pbyAddr2) ( \
197 (*(PDWORD)(pbyAddr1) == *(PDWORD)(pbyAddr2)) && \
198 (*(PWORD)((PBYTE)(pbyAddr1) + 4) == \
199 *(PWORD)((PBYTE)(pbyAddr2) + 4)) \
200)
201
202/*--------------------- Export Classes ----------------------------*/
203
204/*--------------------- Export Variables --------------------------*/
205
206/*--------------------- Export Functions --------------------------*/
5449c685
FB
207
208BYTE ETHbyGetHashIndexByCrc32(PBYTE pbyMultiAddr);
209//BYTE ETHbyGetHashIndexByCrc(PBYTE pbyMultiAddr);
210BOOL ETHbIsBufferCrc32Ok(PBYTE pbyBuffer, UINT cbFrameLength);
211
5449c685
FB
212#endif // __TETHER_H__
213
214
215
This page took 0.131436 seconds and 5 git commands to generate.