Christopher Ferris | 8177cdf | 2020-08-03 11:53:55 -0700 | [diff] [blame] | 1 | /**************************************************************************** |
| 2 | **************************************************************************** |
| 3 | *** |
| 4 | *** This header was automatically generated from a Linux kernel header |
| 5 | *** of the same name, to make information necessary for userspace to |
| 6 | *** call into the kernel available to libc. It contains only constants, |
| 7 | *** structures, and macros generated from the original header, and thus, |
| 8 | *** contains no copyrightable information. |
| 9 | *** |
| 10 | *** To edit the content of this header, modify the corresponding |
| 11 | *** source file (e.g. under external/kernel-headers/original/) then |
| 12 | *** run bionic/libc/kernel/tools/update_all.py |
| 13 | *** |
| 14 | *** Any manual change here will be lost the next time this script will |
| 15 | *** be run. You've been warned! |
| 16 | *** |
| 17 | **************************************************************************** |
| 18 | ****************************************************************************/ |
| 19 | #ifndef _UAPI_LINUX_MRP_BRIDGE_H_ |
| 20 | #define _UAPI_LINUX_MRP_BRIDGE_H_ |
| 21 | #include <linux/types.h> |
| 22 | #include <linux/if_ether.h> |
| 23 | #define MRP_MAX_FRAME_LENGTH 200 |
| 24 | #define MRP_DEFAULT_PRIO 0x8000 |
| 25 | #define MRP_DOMAIN_UUID_LENGTH 16 |
| 26 | #define MRP_VERSION 1 |
| 27 | #define MRP_FRAME_PRIO 7 |
| 28 | #define MRP_OUI_LENGTH 3 |
| 29 | #define MRP_MANUFACTURE_DATA_LENGTH 2 |
| 30 | enum br_mrp_ring_role_type { |
| 31 | BR_MRP_RING_ROLE_DISABLED, |
| 32 | BR_MRP_RING_ROLE_MRC, |
| 33 | BR_MRP_RING_ROLE_MRM, |
| 34 | BR_MRP_RING_ROLE_MRA, |
| 35 | }; |
Christopher Ferris | 25c18d4 | 2020-10-14 17:42:58 -0700 | [diff] [blame] | 36 | enum br_mrp_in_role_type { |
| 37 | BR_MRP_IN_ROLE_DISABLED, |
| 38 | BR_MRP_IN_ROLE_MIC, |
| 39 | BR_MRP_IN_ROLE_MIM, |
| 40 | }; |
Christopher Ferris | 8177cdf | 2020-08-03 11:53:55 -0700 | [diff] [blame] | 41 | enum br_mrp_ring_state_type { |
| 42 | BR_MRP_RING_STATE_OPEN, |
| 43 | BR_MRP_RING_STATE_CLOSED, |
| 44 | }; |
Christopher Ferris | 25c18d4 | 2020-10-14 17:42:58 -0700 | [diff] [blame] | 45 | enum br_mrp_in_state_type { |
| 46 | BR_MRP_IN_STATE_OPEN, |
| 47 | BR_MRP_IN_STATE_CLOSED, |
| 48 | }; |
Christopher Ferris | 8177cdf | 2020-08-03 11:53:55 -0700 | [diff] [blame] | 49 | enum br_mrp_port_state_type { |
| 50 | BR_MRP_PORT_STATE_DISABLED, |
| 51 | BR_MRP_PORT_STATE_BLOCKED, |
| 52 | BR_MRP_PORT_STATE_FORWARDING, |
| 53 | BR_MRP_PORT_STATE_NOT_CONNECTED, |
| 54 | }; |
| 55 | enum br_mrp_port_role_type { |
| 56 | BR_MRP_PORT_ROLE_PRIMARY, |
| 57 | BR_MRP_PORT_ROLE_SECONDARY, |
Christopher Ferris | 25c18d4 | 2020-10-14 17:42:58 -0700 | [diff] [blame] | 58 | BR_MRP_PORT_ROLE_INTER, |
Christopher Ferris | 8177cdf | 2020-08-03 11:53:55 -0700 | [diff] [blame] | 59 | }; |
| 60 | enum br_mrp_tlv_header_type { |
| 61 | BR_MRP_TLV_HEADER_END = 0x0, |
| 62 | BR_MRP_TLV_HEADER_COMMON = 0x1, |
| 63 | BR_MRP_TLV_HEADER_RING_TEST = 0x2, |
| 64 | BR_MRP_TLV_HEADER_RING_TOPO = 0x3, |
| 65 | BR_MRP_TLV_HEADER_RING_LINK_DOWN = 0x4, |
| 66 | BR_MRP_TLV_HEADER_RING_LINK_UP = 0x5, |
Christopher Ferris | 25c18d4 | 2020-10-14 17:42:58 -0700 | [diff] [blame] | 67 | BR_MRP_TLV_HEADER_IN_TEST = 0x6, |
| 68 | BR_MRP_TLV_HEADER_IN_TOPO = 0x7, |
| 69 | BR_MRP_TLV_HEADER_IN_LINK_DOWN = 0x8, |
| 70 | BR_MRP_TLV_HEADER_IN_LINK_UP = 0x9, |
Christopher Ferris | 8177cdf | 2020-08-03 11:53:55 -0700 | [diff] [blame] | 71 | BR_MRP_TLV_HEADER_OPTION = 0x7f, |
| 72 | }; |
| 73 | enum br_mrp_sub_tlv_header_type { |
| 74 | BR_MRP_SUB_TLV_HEADER_TEST_MGR_NACK = 0x1, |
| 75 | BR_MRP_SUB_TLV_HEADER_TEST_PROPAGATE = 0x2, |
| 76 | BR_MRP_SUB_TLV_HEADER_TEST_AUTO_MGR = 0x3, |
| 77 | }; |
| 78 | struct br_mrp_tlv_hdr { |
| 79 | __u8 type; |
| 80 | __u8 length; |
| 81 | }; |
| 82 | struct br_mrp_sub_tlv_hdr { |
| 83 | __u8 type; |
| 84 | __u8 length; |
| 85 | }; |
| 86 | struct br_mrp_end_hdr { |
| 87 | struct br_mrp_tlv_hdr hdr; |
| 88 | }; |
| 89 | struct br_mrp_common_hdr { |
| 90 | __be16 seq_id; |
| 91 | __u8 domain[MRP_DOMAIN_UUID_LENGTH]; |
| 92 | }; |
| 93 | struct br_mrp_ring_test_hdr { |
| 94 | __be16 prio; |
| 95 | __u8 sa[ETH_ALEN]; |
| 96 | __be16 port_role; |
| 97 | __be16 state; |
| 98 | __be16 transitions; |
| 99 | __be32 timestamp; |
| 100 | }; |
| 101 | struct br_mrp_ring_topo_hdr { |
| 102 | __be16 prio; |
| 103 | __u8 sa[ETH_ALEN]; |
| 104 | __be16 interval; |
| 105 | }; |
| 106 | struct br_mrp_ring_link_hdr { |
| 107 | __u8 sa[ETH_ALEN]; |
| 108 | __be16 port_role; |
| 109 | __be16 interval; |
| 110 | __be16 blocked; |
| 111 | }; |
| 112 | struct br_mrp_sub_opt_hdr { |
| 113 | __u8 type; |
| 114 | __u8 manufacture_data[MRP_MANUFACTURE_DATA_LENGTH]; |
| 115 | }; |
| 116 | struct br_mrp_test_mgr_nack_hdr { |
| 117 | __be16 prio; |
| 118 | __u8 sa[ETH_ALEN]; |
| 119 | __be16 other_prio; |
| 120 | __u8 other_sa[ETH_ALEN]; |
| 121 | }; |
| 122 | struct br_mrp_test_prop_hdr { |
| 123 | __be16 prio; |
| 124 | __u8 sa[ETH_ALEN]; |
| 125 | __be16 other_prio; |
| 126 | __u8 other_sa[ETH_ALEN]; |
| 127 | }; |
| 128 | struct br_mrp_oui_hdr { |
| 129 | __u8 oui[MRP_OUI_LENGTH]; |
| 130 | }; |
Christopher Ferris | 25c18d4 | 2020-10-14 17:42:58 -0700 | [diff] [blame] | 131 | struct br_mrp_in_test_hdr { |
| 132 | __be16 id; |
| 133 | __u8 sa[ETH_ALEN]; |
| 134 | __be16 port_role; |
| 135 | __be16 state; |
| 136 | __be16 transitions; |
| 137 | __be32 timestamp; |
| 138 | }; |
| 139 | struct br_mrp_in_topo_hdr { |
| 140 | __u8 sa[ETH_ALEN]; |
| 141 | __be16 id; |
| 142 | __be16 interval; |
| 143 | }; |
| 144 | struct br_mrp_in_link_hdr { |
| 145 | __u8 sa[ETH_ALEN]; |
| 146 | __be16 port_role; |
| 147 | __be16 id; |
| 148 | __be16 interval; |
| 149 | }; |
Christopher Ferris | 8177cdf | 2020-08-03 11:53:55 -0700 | [diff] [blame] | 150 | #endif |