xref: /OK3568_Linux_fs/external/rkwifibt/drivers/rtl8822cs/include/ethernet.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /******************************************************************************
2*4882a593Smuzhiyun  *
3*4882a593Smuzhiyun  * Copyright(c) 2007 - 2017 Realtek Corporation.
4*4882a593Smuzhiyun  *
5*4882a593Smuzhiyun  * This program is free software; you can redistribute it and/or modify it
6*4882a593Smuzhiyun  * under the terms of version 2 of the GNU General Public License as
7*4882a593Smuzhiyun  * published by the Free Software Foundation.
8*4882a593Smuzhiyun  *
9*4882a593Smuzhiyun  * This program is distributed in the hope that it will be useful, but WITHOUT
10*4882a593Smuzhiyun  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11*4882a593Smuzhiyun  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12*4882a593Smuzhiyun  * more details.
13*4882a593Smuzhiyun  *
14*4882a593Smuzhiyun  *****************************************************************************/
15*4882a593Smuzhiyun /*! \file */
16*4882a593Smuzhiyun #ifndef __INC_ETHERNET_H
17*4882a593Smuzhiyun #define __INC_ETHERNET_H
18*4882a593Smuzhiyun 
19*4882a593Smuzhiyun #define ETHERNET_ADDRESS_LENGTH				6		/* !< Ethernet Address Length */
20*4882a593Smuzhiyun #define ETHERNET_HEADER_SIZE				14		/* !< Ethernet Header Length */
21*4882a593Smuzhiyun #define LLC_HEADER_SIZE						6		/* !< LLC Header Length */
22*4882a593Smuzhiyun #define TYPE_LENGTH_FIELD_SIZE				2		/* !< Type/Length Size */
23*4882a593Smuzhiyun #define MINIMUM_ETHERNET_PACKET_SIZE		60		/* !< Minimum Ethernet Packet Size */
24*4882a593Smuzhiyun #define MAXIMUM_ETHERNET_PACKET_SIZE		1514	/* !< Maximum Ethernet Packet Size */
25*4882a593Smuzhiyun 
26*4882a593Smuzhiyun #define RT_ETH_IS_MULTICAST(_pAddr)	((((u8 *)(_pAddr))[0]&0x01) != 0)		/* !< Is Multicast Address? */
27*4882a593Smuzhiyun #define RT_ETH_IS_BROADCAST(_pAddr)	(\
28*4882a593Smuzhiyun 		((u8 *)(_pAddr))[0] == 0xff	&&		\
29*4882a593Smuzhiyun 		((u8 *)(_pAddr))[1] == 0xff	&&		\
30*4882a593Smuzhiyun 		((u8 *)(_pAddr))[2] == 0xff	&&		\
31*4882a593Smuzhiyun 		((u8 *)(_pAddr))[3] == 0xff	&&		\
32*4882a593Smuzhiyun 		((u8 *)(_pAddr))[4] == 0xff	&&		\
33*4882a593Smuzhiyun 		((u8 *)(_pAddr))[5] == 0xff)	/* !< Is Broadcast Address? */
34*4882a593Smuzhiyun 
35*4882a593Smuzhiyun 
36*4882a593Smuzhiyun #endif /*  #ifndef __INC_ETHERNET_H */
37