1/*
2 * Hardware-specific Receive Data Header for the
3 * Broadcom Home Networking Division
4 * BCM47XX GbE cores.
5 *
6 * Copyright (C) 2010, Broadcom Corporation
7 * All Rights Reserved.
8 *
9 * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Broadcom Corporation;
10 * the contents of this file may not be disclosed to third parties, copied
11 * or duplicated in any form, in whole or in part, without the prior
12 * written permission of Broadcom Corporation.
13 * $Id: bcmgmacrxh.h,v 13.1 2008/07/18 00:29:07 Exp $
14 */
15
16#ifndef _bcmgmacrxh_h_
17#define	_bcmgmacrxh_h_
18
19/*
20 * The Ethernet GMAC core returns an 8-byte Receive Frame Data Header
21 * with every frame consisting of
22 * 16 bits of frame length, followed by
23 * 16 bits of GMAC rx descriptor info, followed by 32bits of undefined.
24 */
25typedef volatile struct {
26	uint16	len;
27	uint16	flags;
28	uint16	pad[12];
29} bcmgmacrxh_t;
30
31#define	RXHDR_LEN	28	/* Header length */
32
33#define	GRXF_DT_MASK	((uint16)0xf)		/* data type */
34#define	GRXF_DT_SHIFT	12
35#define	GRXF_DC_MASK	((uint16)0xf)		/* (num descr to xfer the frame) - 1 */
36#define	GRXF_DC_SHIFT	8
37#define	GRXF_OVF	((uint16)1 << 7)	/* overflow error occured */
38#define	GRXF_OVERSIZE	((uint16)1 << 4)	/* frame size > rxmaxlength */
39#define	GRXF_CRC	((uint16)1 << 3)	/* crc error */
40#define	GRXF_VLAN	((uint16)1 << 2)	/* vlan tag detected */
41#define	GRXF_PT_MASK	((uint16)3)		/* packet type 0 - Unicast,
42						 * 1 - Multicast, 2 - Broadcast
43						 */
44
45#endif	/* _bcmgmacrxh_h_ */
46