1*4882a593Smuzhiyun /* 2*4882a593Smuzhiyun * Broadcom Ethernettype protocol definitions 3*4882a593Smuzhiyun * 4*4882a593Smuzhiyun * Copyright (C) 2020, Broadcom. 5*4882a593Smuzhiyun * 6*4882a593Smuzhiyun * Unless you and Broadcom execute a separate written software license 7*4882a593Smuzhiyun * agreement governing use of this software, this software is licensed to you 8*4882a593Smuzhiyun * under the terms of the GNU General Public License version 2 (the "GPL"), 9*4882a593Smuzhiyun * available at http://www.broadcom.com/licenses/GPLv2.php, with the 10*4882a593Smuzhiyun * following added to such license: 11*4882a593Smuzhiyun * 12*4882a593Smuzhiyun * As a special exception, the copyright holders of this software give you 13*4882a593Smuzhiyun * permission to link this software with independent modules, and to copy and 14*4882a593Smuzhiyun * distribute the resulting executable under terms of your choice, provided that 15*4882a593Smuzhiyun * you also meet, for each linked independent module, the terms and conditions of 16*4882a593Smuzhiyun * the license of that module. An independent module is a module which is not 17*4882a593Smuzhiyun * derived from this software. The special exception does not apply to any 18*4882a593Smuzhiyun * modifications of the software. 19*4882a593Smuzhiyun * 20*4882a593Smuzhiyun * 21*4882a593Smuzhiyun * <<Broadcom-WL-IPTag/Dual:>> 22*4882a593Smuzhiyun */ 23*4882a593Smuzhiyun 24*4882a593Smuzhiyun /* 25*4882a593Smuzhiyun * Broadcom Ethernet protocol defines 26*4882a593Smuzhiyun */ 27*4882a593Smuzhiyun 28*4882a593Smuzhiyun #ifndef _BCMETH_H_ 29*4882a593Smuzhiyun #define _BCMETH_H_ 30*4882a593Smuzhiyun 31*4882a593Smuzhiyun #ifndef _TYPEDEFS_H_ 32*4882a593Smuzhiyun #include <typedefs.h> 33*4882a593Smuzhiyun #endif 34*4882a593Smuzhiyun 35*4882a593Smuzhiyun /* This marks the start of a packed structure section. */ 36*4882a593Smuzhiyun #include <packed_section_start.h> 37*4882a593Smuzhiyun 38*4882a593Smuzhiyun /* ETHER_TYPE_BRCM is defined in ethernet.h */ 39*4882a593Smuzhiyun 40*4882a593Smuzhiyun /* 41*4882a593Smuzhiyun * Following the 2byte BRCM ether_type is a 16bit BRCM subtype field 42*4882a593Smuzhiyun * in one of two formats: (only subtypes 32768-65535 are in use now) 43*4882a593Smuzhiyun * 44*4882a593Smuzhiyun * subtypes 0-32767: 45*4882a593Smuzhiyun * 8 bit subtype (0-127) 46*4882a593Smuzhiyun * 8 bit length in bytes (0-255) 47*4882a593Smuzhiyun * 48*4882a593Smuzhiyun * subtypes 32768-65535: 49*4882a593Smuzhiyun * 16 bit big-endian subtype 50*4882a593Smuzhiyun * 16 bit big-endian length in bytes (0-65535) 51*4882a593Smuzhiyun * 52*4882a593Smuzhiyun * length is the number of additional bytes beyond the 4 or 6 byte header 53*4882a593Smuzhiyun * 54*4882a593Smuzhiyun * Reserved values: 55*4882a593Smuzhiyun * 0 reserved 56*4882a593Smuzhiyun * 5-15 reserved for iLine protocol assignments 57*4882a593Smuzhiyun * 17-126 reserved, assignable 58*4882a593Smuzhiyun * 127 reserved 59*4882a593Smuzhiyun * 32768 reserved 60*4882a593Smuzhiyun * 32769-65534 reserved, assignable 61*4882a593Smuzhiyun * 65535 reserved 62*4882a593Smuzhiyun */ 63*4882a593Smuzhiyun 64*4882a593Smuzhiyun /* 65*4882a593Smuzhiyun * While adding the subtypes and their specific processing code make sure 66*4882a593Smuzhiyun * bcmeth_bcm_hdr_t is the first data structure in the user specific data structure definition 67*4882a593Smuzhiyun */ 68*4882a593Smuzhiyun 69*4882a593Smuzhiyun #define BCMILCP_SUBTYPE_RATE 1 70*4882a593Smuzhiyun #define BCMILCP_SUBTYPE_LINK 2 71*4882a593Smuzhiyun #define BCMILCP_SUBTYPE_CSA 3 72*4882a593Smuzhiyun #define BCMILCP_SUBTYPE_LARQ 4 73*4882a593Smuzhiyun #define BCMILCP_SUBTYPE_VENDOR 5 74*4882a593Smuzhiyun #define BCMILCP_SUBTYPE_FLH 17 75*4882a593Smuzhiyun 76*4882a593Smuzhiyun #define BCMILCP_SUBTYPE_VENDOR_LONG 32769 77*4882a593Smuzhiyun #define BCMILCP_SUBTYPE_CERT 32770 78*4882a593Smuzhiyun #define BCMILCP_SUBTYPE_SES 32771 79*4882a593Smuzhiyun 80*4882a593Smuzhiyun #define BCMILCP_BCM_SUBTYPE_RESERVED 0 81*4882a593Smuzhiyun #define BCMILCP_BCM_SUBTYPE_EVENT 1 82*4882a593Smuzhiyun #define BCMILCP_BCM_SUBTYPE_SES 2 83*4882a593Smuzhiyun /* 84*4882a593Smuzhiyun * The EAPOL type is not used anymore. Instead EAPOL messages are now embedded 85*4882a593Smuzhiyun * within BCMILCP_BCM_SUBTYPE_EVENT type messages 86*4882a593Smuzhiyun */ 87*4882a593Smuzhiyun /* #define BCMILCP_BCM_SUBTYPE_EAPOL 3 */ 88*4882a593Smuzhiyun #define BCMILCP_BCM_SUBTYPE_DPT 4 89*4882a593Smuzhiyun #define BCMILCP_BCM_SUBTYPE_DNGLEVENT 5 90*4882a593Smuzhiyun 91*4882a593Smuzhiyun #define BCMILCP_BCM_SUBTYPEHDR_MINLENGTH 8 92*4882a593Smuzhiyun #define BCMILCP_BCM_SUBTYPEHDR_VERSION 0 93*4882a593Smuzhiyun #define BCMILCP_BCM_SUBTYPE_EVENT_DATA_PAD 2 94*4882a593Smuzhiyun 95*4882a593Smuzhiyun /* These fields are stored in network order */ 96*4882a593Smuzhiyun typedef BWL_PRE_PACKED_STRUCT struct bcmeth_hdr 97*4882a593Smuzhiyun { 98*4882a593Smuzhiyun uint16 subtype; /* Vendor specific..32769 */ 99*4882a593Smuzhiyun uint16 length; 100*4882a593Smuzhiyun uint8 version; /* Version is 0 */ 101*4882a593Smuzhiyun uint8 oui[3]; /* Broadcom OUI */ 102*4882a593Smuzhiyun /* user specific Data */ 103*4882a593Smuzhiyun uint16 usr_subtype; 104*4882a593Smuzhiyun } BWL_POST_PACKED_STRUCT bcmeth_hdr_t; 105*4882a593Smuzhiyun 106*4882a593Smuzhiyun /* This marks the end of a packed structure section. */ 107*4882a593Smuzhiyun #include <packed_section_end.h> 108*4882a593Smuzhiyun 109*4882a593Smuzhiyun #endif /* _BCMETH_H_ */ 110