1/*
2 * Copyright 2007, Broadcom Corporation
3 * All Rights Reserved.
4 *
5 * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
6 * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
7 * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
8 * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
9 *
10 * Fundamental types and constants relating to 802.1D
11 *
12 * $Id: 802.1d.h,v 1.1.1.1 2008/10/15 03:25:54 james26_jang Exp $
13 */
14
15#ifndef _802_1_D_
16#define _802_1_D_
17
18/* 802.1D priority defines */
19#define	PRIO_8021D_NONE		2	/* None = - */
20#define	PRIO_8021D_BK		1	/* BK - Background */
21#define	PRIO_8021D_BE		0	/* BE - Best-effort */
22#define	PRIO_8021D_EE		3	/* EE - Excellent-effort */
23#define	PRIO_8021D_CL		4	/* CL - Controlled Load */
24#define	PRIO_8021D_VI		5	/* Vi - Video */
25#define	PRIO_8021D_VO		6	/* Vo - Voice */
26#define	PRIO_8021D_NC		7	/* NC - Network Control */
27#define	MAXPRIO			7	/* 0-7 */
28#define NUMPRIO			(MAXPRIO + 1)
29
30#define ALLPRIO		-1	/* All prioirty */
31
32/* Converts prio to precedence since the numerical value of
33 * PRIO_8021D_BE and PRIO_8021D_NONE are swapped.
34 */
35#define PRIO2PREC(prio) \
36	(((prio) == PRIO_8021D_NONE || (prio) == PRIO_8021D_BE) ? ((prio^2)) : (prio))
37
38#endif /* _802_1_D__ */
39