diff options
Diffstat (limited to 'usr/src/uts/common/sys')
-rw-r--r-- | usr/src/uts/common/sys/Makefile | 1 | ||||
-rw-r--r-- | usr/src/uts/common/sys/dld_impl.h | 9 | ||||
-rw-r--r-- | usr/src/uts/common/sys/dls.h | 5 | ||||
-rw-r--r-- | usr/src/uts/common/sys/dls_impl.h | 5 | ||||
-rw-r--r-- | usr/src/uts/common/sys/dls_soft_ring.h | 9 | ||||
-rw-r--r-- | usr/src/uts/common/sys/ethernet.h | 17 | ||||
-rw-r--r-- | usr/src/uts/common/sys/gld.h | 23 | ||||
-rw-r--r-- | usr/src/uts/common/sys/gldpriv.h | 67 | ||||
-rw-r--r-- | usr/src/uts/common/sys/mac.h | 3 | ||||
-rw-r--r-- | usr/src/uts/common/sys/pfmod.h | 69 | ||||
-rw-r--r-- | usr/src/uts/common/sys/stream.h | 11 | ||||
-rw-r--r-- | usr/src/uts/common/sys/vlan.h | 15 |
12 files changed, 145 insertions, 89 deletions
diff --git a/usr/src/uts/common/sys/Makefile b/usr/src/uts/common/sys/Makefile index 2754405b01..df16a73f89 100644 --- a/usr/src/uts/common/sys/Makefile +++ b/usr/src/uts/common/sys/Makefile @@ -533,6 +533,7 @@ CHKHDRS= \ vfstab.h \ vgareg.h \ visual_io.h \ + vlan.h \ vm.h \ vmem.h \ vmem_impl.h \ diff --git a/usr/src/uts/common/sys/dld_impl.h b/usr/src/uts/common/sys/dld_impl.h index 6c1c3ade21..c3274aea0b 100644 --- a/usr/src/uts/common/sys/dld_impl.h +++ b/usr/src/uts/common/sys/dld_impl.h @@ -216,17 +216,16 @@ extern void dld_str_destroy(dld_str_t *); extern int dld_str_attach(dld_str_t *, t_uscalar_t); extern void dld_str_detach(dld_str_t *); extern void dld_str_rx_raw(void *, mac_resource_handle_t, - mblk_t *, size_t); + mblk_t *, mac_header_info_t *); extern void dld_str_rx_fastpath(void *, mac_resource_handle_t, - mblk_t *, size_t); + mblk_t *, mac_header_info_t *); extern void dld_str_rx_unitdata(void *, mac_resource_handle_t, - mblk_t *, size_t); + mblk_t *, mac_header_info_t *); extern void dld_tx_flush(dld_str_t *); extern void dld_tx_enqueue(dld_str_t *, mblk_t *, boolean_t); extern void dld_str_notify_ind(dld_str_t *); - extern void str_mdata_fastpath_put(dld_str_t *, mblk_t *); -extern void str_mdata_raw_put(dld_str_t *, mblk_t *); +extern void dld_tx_single(dld_str_t *, mblk_t *); /* * dld_proto.c diff --git a/usr/src/uts/common/sys/dls.h b/usr/src/uts/common/sys/dls.h index 12f9a6a8a2..f43cb816de 100644 --- a/usr/src/uts/common/sys/dls.h +++ b/usr/src/uts/common/sys/dls.h @@ -91,10 +91,11 @@ extern int dls_multicst_add(dls_channel_t, const uint8_t *); extern int dls_multicst_remove(dls_channel_t, const uint8_t *); extern mblk_t *dls_header(dls_channel_t, const uint8_t *, uint16_t, uint_t, - mblk_t *); + mblk_t **); extern int dls_header_info(dls_channel_t, mblk_t *, mac_header_info_t *); -typedef void (*dls_rx_t)(void *, mac_resource_handle_t, mblk_t *, size_t); +typedef void (*dls_rx_t)(void *, mac_resource_handle_t, mblk_t *, + mac_header_info_t *); extern void dls_rx_set(dls_channel_t, dls_rx_t, void *); diff --git a/usr/src/uts/common/sys/dls_impl.h b/usr/src/uts/common/sys/dls_impl.h index ad97fe72da..0b5dec3fb1 100644 --- a/usr/src/uts/common/sys/dls_impl.h +++ b/usr/src/uts/common/sys/dls_impl.h @@ -118,7 +118,7 @@ extern void dls_link_rele(dls_link_t *); extern void dls_link_add(dls_link_t *, uint32_t, dls_impl_t *); extern void dls_link_remove(dls_link_t *, dls_impl_t *); extern int dls_link_header_info(dls_link_t *, mblk_t *, - mac_header_info_t *, uint16_t *); + mac_header_info_t *); extern int dls_mac_hold(dls_link_t *); extern void dls_mac_rele(dls_link_t *); @@ -138,7 +138,8 @@ extern void dls_init(void); extern int dls_fini(void); extern boolean_t dls_accept(dls_impl_t *, mac_header_info_t *, dls_rx_t *, void **); -extern boolean_t dls_accept_loopback(dls_impl_t *, dls_rx_t *, void **); +extern boolean_t dls_accept_loopback(dls_impl_t *, mac_header_info_t *, + dls_rx_t *, void **); #ifdef __cplusplus } diff --git a/usr/src/uts/common/sys/dls_soft_ring.h b/usr/src/uts/common/sys/dls_soft_ring.h index 96a5e7ccc4..cc7365c9dc 100644 --- a/usr/src/uts/common/sys/dls_soft_ring.h +++ b/usr/src/uts/common/sys/dls_soft_ring.h @@ -1,5 +1,5 @@ /* - * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -16,10 +16,11 @@ extern "C" { #include <sys/processor.h> #include <sys/stream.h> #include <sys/squeue.h> +#include <sys/mac.h> #define S_RING_NAMELEN 64 -typedef void (*s_ring_proc_t)(void *, void *, mblk_t *, size_t); +typedef void (*s_ring_proc_t)(void *, void *, mblk_t *, mac_header_info_t *); typedef struct soft_ring_s { /* Keep the most used members 64bytes cache aligned */ @@ -85,8 +86,8 @@ extern void soft_ring_set_destroy(soft_ring_t **, int); extern void soft_ring_process(soft_ring_t *, mblk_t *, uint8_t); extern void soft_ring_bind(void *, processorid_t); extern void soft_ring_unbind(void *); -extern void dls_ether_soft_ring_fanout(void *, - void *, mblk_t *, size_t); +extern void dls_ether_soft_ring_fanout(void *, void *, mblk_t *, + mac_header_info_t *); extern boolean_t dls_soft_ring_enable(dls_channel_t, dl_capab_dls_t *); extern void dls_soft_ring_disable(dls_channel_t); extern boolean_t dls_soft_ring_workers(dls_channel_t); diff --git a/usr/src/uts/common/sys/ethernet.h b/usr/src/uts/common/sys/ethernet.h index 3161f73608..9e35b2ec3d 100644 --- a/usr/src/uts/common/sys/ethernet.h +++ b/usr/src/uts/common/sys/ethernet.h @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -20,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -71,6 +70,15 @@ struct ether_vlan_header { ushort_t ether_type; }; +/* + * The VLAN tag. Available for applications that cannot make use of struct + * ether_vlan_header because they assume Ethernet encapsulation. + */ +struct ether_vlan_extinfo { + ushort_t ether_tci; + ushort_t ether_type; +}; + #define ETHERTYPE_PUP (0x0200) /* PUP protocol */ #define ETHERTYPE_802_MIN (0x0600) /* Min valid ethernet type */ /* under IEEE 802.3 rules */ @@ -79,6 +87,7 @@ struct ether_vlan_header { #define ETHERTYPE_REVARP (0x8035) /* Reverse ARP */ #define ETHERTYPE_AT (0x809b) /* AppleTalk protocol */ #define ETHERTYPE_AARP (0x80f3) /* AppleTalk ARP */ +#define ETHERTYPE_VLAN (0x8100) /* 802.1Q VLAN */ #define ETHERTYPE_IPV6 (0x86dd) /* IPv6 */ #define ETHERTYPE_SLOW (0x8809) /* Slow Protocol */ #define ETHERTYPE_PPPOED (0x8863) /* PPPoE Discovery Stage */ diff --git a/usr/src/uts/common/sys/gld.h b/usr/src/uts/common/sys/gld.h index e42bb62f28..3f3c01848e 100644 --- a/usr/src/uts/common/sys/gld.h +++ b/usr/src/uts/common/sys/gld.h @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -20,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -344,21 +343,27 @@ extern int gld_rsrv(queue_t *); /* * Macros to construct a TCI or VTAG. The user must ensure values are in - * range. In particular, VID 0 is not a valid argument to these constructor - * macros; when the VID is 0 (VLAN_VID_NONE), the whole VTAG should be 0 - * (VLAN_VTAG_NONE), not 0x81000000. + * range. Note that in the special case of priority tag, VLAN_VID_NONE + * is also a valid argument to these constructor macros. */ #define GLD_MAKE_TCI(pri, cfi, vid) (((pri) << VLAN_PRI_SHIFT) | \ ((cfi) << VLAN_CFI_SHIFT) | \ ((vid) << VLAN_VID_SHIFT)) -#define GLD_MAKE_VTAG(tci) ((VLAN_TPID << VLAN_TPID_SHIFT) | (tci)) +#define GLD_MAKE_VTAG(pri, cfi, vid) \ + (((uint32_t)ETHERTYPE_VLAN << VLAN_TPID_SHIFT) | \ + ((pri) << VLAN_PRI_SHIFT) | \ + ((cfi) << VLAN_CFI_SHIFT) | \ + ((vid) << VLAN_VID_SHIFT)) + +#define GLD_TCI2VTAG(tci) \ + (((uint32_t)ETHERTYPE_VLAN << VLAN_TPID_SHIFT) | (tci)) /* * Macros to construct a prototype TCI/VTAG and then convert it to a real one */ #define GLD_MK_PTCI(cfi, vid) GLD_MAKE_TCI(VLAN_PRI_MAX, cfi, vid) -#define GLD_MK_PTAG(cfi, vid) GLD_MAKE_VTAG(GLD_MK_PTCI(cfi, vid)) +#define GLD_MK_PTAG(cfi, vid) GLD_MAKE_VTAG(VLAN_PRI_MAX, cfi, vid) #define GLD_MK_PMSK(pri) (((pri) << VLAN_PRI_SHIFT) | ~VLAN_PRI_MASK) #define GLD_MK_VTAG(ptag, pri) ((ptag) & GLD_MK_PMSK(pri)) diff --git a/usr/src/uts/common/sys/gldpriv.h b/usr/src/uts/common/sys/gldpriv.h index 6b864064b9..cbbb872232 100644 --- a/usr/src/uts/common/sys/gldpriv.h +++ b/usr/src/uts/common/sys/gldpriv.h @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -20,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2004 Sun Microsystems, Inc. All rights reserved. + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -207,6 +206,7 @@ typedef struct pktinfo { uint_t vid:12; uint_t wasAccepted:1; uint_t nosource:1; + uint_t isTagged:1; uint_t macLen; uint_t hdrLen; uint_t pktLen; @@ -246,9 +246,10 @@ typedef struct { uint_t mac_type; uint_t mtu_size; int hdr_size; - int (*interpreter)(gld_mac_info_t *, mblk_t *, pktinfo_t *, int); + int (*interpreter)(gld_mac_info_t *, mblk_t *, pktinfo_t *, + packet_flag_t); void (*interpreter_mdt)(gld_mac_info_t *, mblk_t *, - struct pdescinfo_s *, pktinfo_t *, int); + struct pdescinfo_s *, pktinfo_t *, mdt_packet_flag_t); mblk_t *(*mkfastpath)(gld_t *, mblk_t *); mblk_t *(*mkunitdata)(gld_t *, mblk_t *); void (*init)(gld_mac_info_t *); @@ -338,16 +339,16 @@ typedef struct gld_vlan { gld_mac_info_t *gldv_mac; queue_t *gldv_ipq; queue_t *gldv_ipv6q; - uint8_t gldv_ipq_flags; struct gld *gldv_str_next; /* list of attached streams */ struct gld *gldv_str_prev; kstat_t *gldv_kstatp; struct gld_stats *gldv_stats; + /* The number of streams that are in promiscous mode */ + uint_t gldv_nprom; + /* The number of streams that are interested in VLAN tagged packets. */ + uint_t gldv_nvlan_sap; } gld_vlan_t; -#define IPQ_DISABLED 0x01 -#define IPQ_FORBIDDEN 0x02 - #define VLAN_HASHSZ 23 /* Per-mac info used by GLD */ @@ -587,16 +588,6 @@ struct llc_snap_hdr { #define LSAP_SNAP 0xaa /* SAP for SubNet Access Protocol */ #define CNTL_LLC_UI 0x03 /* un-numbered information packet */ -/* ============================ */ -/* Ethernet related definitions */ -/* ============================ */ - -struct ether_mac_frm { - mac_addr_t ether_dhost; - mac_addr_t ether_shost; - ushort_t ether_type; -}; - /* ======================== */ /* FDDI related definitions */ /* ======================== */ @@ -626,6 +617,42 @@ struct tr_mac_frm { struct gld_ri tr_ri; /* Routing Information Field */ }; +/* + * Note that the pad field is used to save the value of tci. + */ +#define GLD_SAVE_MBLK_VTAG(mp, vtag) (DB_TCI(mp) = GLD_VTAG_TCI(vtag)) +#define GLD_CLEAR_MBLK_VTAG(mp) GLD_SAVE_MBLK_VTAG(mp, 0) +#define GLD_GET_MBLK_VTAG(mp) GLD_TCI2VTAG(DB_TCI(mp)) + +int gld_interpret_ether(gld_mac_info_t *, mblk_t *, pktinfo_t *, packet_flag_t); +int gld_interpret_fddi(gld_mac_info_t *, mblk_t *, pktinfo_t *, packet_flag_t); +int gld_interpret_tr(gld_mac_info_t *, mblk_t *, pktinfo_t *, packet_flag_t); +int gld_interpret_ib(gld_mac_info_t *, mblk_t *, pktinfo_t *, packet_flag_t); +void gld_interpret_mdt_ib(gld_mac_info_t *, mblk_t *, pdescinfo_t *, + pktinfo_t *, mdt_packet_flag_t); + +mblk_t *gld_fastpath_ether(gld_t *, mblk_t *); +mblk_t *gld_fastpath_fddi(gld_t *, mblk_t *); +mblk_t *gld_fastpath_tr(gld_t *, mblk_t *); +mblk_t *gld_fastpath_ib(gld_t *, mblk_t *); + +mblk_t *gld_insert_vtag_ether(mblk_t *, uint32_t); + +mblk_t *gld_unitdata_ether(gld_t *, mblk_t *); +mblk_t *gld_unitdata_fddi(gld_t *, mblk_t *); +mblk_t *gld_unitdata_tr(gld_t *, mblk_t *); +mblk_t *gld_unitdata_ib(gld_t *, mblk_t *); + +void gld_init_ether(gld_mac_info_t *); +void gld_init_fddi(gld_mac_info_t *); +void gld_init_tr(gld_mac_info_t *); +void gld_init_ib(gld_mac_info_t *); + +void gld_uninit_ether(gld_mac_info_t *); +void gld_uninit_fddi(gld_mac_info_t *); +void gld_uninit_tr(gld_mac_info_t *); +void gld_uninit_ib(gld_mac_info_t *); + #ifdef __cplusplus } #endif diff --git a/usr/src/uts/common/sys/mac.h b/usr/src/uts/common/sys/mac.h index 729ecfaa9e..ee51f24423 100644 --- a/usr/src/uts/common/sys/mac.h +++ b/usr/src/uts/common/sys/mac.h @@ -28,6 +28,7 @@ #pragma ident "%Z%%M% %I% %E% SMI" +#include <sys/types.h> #include <sys/ddi.h> #include <sys/sunddi.h> #include <sys/stream.h> @@ -350,6 +351,8 @@ typedef struct mac_header_info_s { uint32_t mhi_origsap; uint32_t mhi_bindsap; mac_addrtype_t mhi_dsttype; + boolean_t mhi_istagged; + uint16_t mhi_tci; } mac_header_info_t; /* diff --git a/usr/src/uts/common/sys/pfmod.h b/usr/src/uts/common/sys/pfmod.h index 682f3ec03d..379847e3e6 100644 --- a/usr/src/uts/common/sys/pfmod.h +++ b/usr/src/uts/common/sys/pfmod.h @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -20,8 +19,8 @@ * CDDL HEADER END */ /* - * Copyright (c) 1991,1997-1998 by Sun Microsystems, Inc. - * All rights reserved. + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. */ #ifndef _SYS_PFMOD_H @@ -43,7 +42,7 @@ extern "C" { #define PF_MAXFILTERS 2047 /* max short words for newpacketfilt */ /* - * filter structure for SETF + * filter structure for SETF */ struct packetfilt { uchar_t Pf_Priority; /* priority of filter */ @@ -61,34 +60,34 @@ struct Pf_ext_packetfilt { }; /* - * We now allow specification of up to MAXFILTERS (short) words of a filter - * command list to be applied to incoming packets to determine if - * those packets should be given to a particular open ethernet file. - * Alternatively, PF_MAXFILTERS and Pf_ext_packetfilt structure can be - * used in case even bigger filter command list is needed. + * We now allow specification of up to MAXFILTERS (short) words of a filter + * command list to be applied to incoming packets to determine if + * those packets should be given to a particular open ethernet file. + * Alternatively, PF_MAXFILTERS and Pf_ext_packetfilt structure can be + * used in case even bigger filter command list is needed. * - * In this context, "word" means a short (16-bit) integer. + * In this context, "word" means a short (16-bit) integer. * - * Each open enet file specifies the filter command list via ioctl. - * Each filter command list specifies a sequence of actions that leaves a - * boolean value on the top of an internal stack. Each word of the - * command list specifies an action from the set {PUSHLIT, PUSHZERO, - * PUSHWORD+N} which respectively push the next word of the filter, zero, - * or word N of the incoming packet on the stack, and a binary operator - * from the set {EQ, LT, LE, GT, GE, AND, OR, XOR} which operates on the - * top two elements of the stack and replaces them with its result. The - * special action NOPUSH and the special operator NOP can be used to only - * perform the binary operation or to only push a value on the stack. + * The filter command list is specified using ioctl(). Each filter command + * list specifies a sequence of actions that leaves a boolean value on the + * top of an internal stack. There is also an offset register which is + * initialized to zero. Each word of the command list specifies an action + * from the set {PUSHLIT, PUSHZERO, PUSHWORD+N, LOAD_OFFSET, BRTR, BRFL, POP} + * (see #defines below for definitions), and a binary operator from the set + * {EQ, LT, LE, GT, GE, AND, OR, XOR} which operates on the top two elements + * of the stack and replaces them with its result. The special action NOPUSH + * and the special operator NOP can be used to only perform the binary + * operation or to only push a value on the stack. * - * If the final value of the filter operation is true, then the packet is - * accepted for the open file which specified the filter. + * If the final value of the filter operation is true, then the packet is + * accepted for the open file which specified the filter. */ -/* these must sum to sizeof (ushort_t)! */ +/* these must sum to sizeof (ushort_t)! */ #define ENF_NBPA 10 /* # bits / action */ #define ENF_NBPO 6 /* # bits / operator */ -/* binary operators */ +/* binary operators */ #define ENF_NOP (0 << ENF_NBPA) #define ENF_EQ (1 << ENF_NBPA) #define ENF_LT (2 << ENF_NBPA) @@ -104,14 +103,18 @@ struct Pf_ext_packetfilt { #define ENF_CNAND (12 << ENF_NBPA) #define ENF_NEQ (13 << ENF_NBPA) -/* stack actions */ +/* stack actions */ #define ENF_NOPUSH 0 -#define ENF_PUSHLIT 1 -#define ENF_PUSHZERO 2 -#define ENF_PUSHONE 3 -#define ENF_PUSHFFFF 4 -#define ENF_PUSHFF00 5 -#define ENF_PUSH00FF 6 +#define ENF_PUSHLIT 1 /* Push the next word on the stack */ +#define ENF_PUSHZERO 2 /* Push 0 on the stack */ +#define ENF_PUSHONE 3 /* Push 1 on the stack */ +#define ENF_PUSHFFFF 4 /* Push 0xffff on the stack */ +#define ENF_PUSHFF00 5 /* Push 0xff00 on the stack */ +#define ENF_PUSH00FF 6 /* Push 0x00ff on the stack */ +#define ENF_LOAD_OFFSET 7 /* Load the next word into the offset register */ +#define ENF_BRTR 8 /* Branch if the stack's top element is true */ +#define ENF_BRFL 9 /* Branch if the stack's top element is false */ +#define ENF_POP 10 /* Pop the top element from the stack */ #define ENF_PUSHWORD 16 #ifdef __cplusplus diff --git a/usr/src/uts/common/sys/stream.h b/usr/src/uts/common/sys/stream.h index 6fd38f724a..cb5a92b7d3 100644 --- a/usr/src/uts/common/sys/stream.h +++ b/usr/src/uts/common/sys/stream.h @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -20,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -357,6 +356,10 @@ typedef struct datab { #define DB_CRED(mp) ((mp)->b_datap->db_credp) #define DB_CREDDEF(mp, cr) (DB_CRED(mp) != NULL ? DB_CRED(mp) : (cr)) #define DB_FTHDR(mp) ((mp)->b_datap->db_fthdr) +/* + * Used by GLDv2 to store the TCI information. + */ +#define DB_TCI(mp) ((mp)->b_datap->db_struioun.cksum.pad) /* * Message block descriptor diff --git a/usr/src/uts/common/sys/vlan.h b/usr/src/uts/common/sys/vlan.h index eba8ea3c4e..2a4e4c8ef0 100644 --- a/usr/src/uts/common/sys/vlan.h +++ b/usr/src/uts/common/sys/vlan.h @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -20,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -39,8 +38,6 @@ extern "C" { #define VLAN_TAGSZ 4 -#define VLAN_TPID 0x8100u - #define VLAN_ID_MASK 0x0fffu #define VLAN_ID_SIZE 12 #define VLAN_ID_SHIFT 0 @@ -69,6 +66,12 @@ extern "C" { #define VLAN_CFI(tci) (((tci) >> VLAN_CFI_SHIFT) & VLAN_CFI_MASK) #define VLAN_ID(tci) (((tci) >> VLAN_ID_SHIFT) & VLAN_ID_MASK) +#define VLAN_BAND_MAP 32 + +#define VLAN_MBLKPRI(mp) \ + ((((mp)->b_band) / VLAN_BAND_MAP) > 7 ? 0 : \ + (((mp)->b_band) / VLAN_BAND_MAP)) + #ifdef __cplusplus } #endif |