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