1 /* 2 * Copyright (c) 2019, The Linux Foundation. All rights reserved. 3 * 4 * Permission to use, copy, modify, and/or distribute this software for any 5 * purpose with or without fee is hereby granted, provided that the above 6 * copyright notice and this permission notice appear in all copies. 7 * 8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 */ 16 17 #ifndef _TLV_HDR_H_ 18 19 #define _TLV_HDR_H_ 20 21 #if !defined(__ASSEMBLER__) 22 23 #endif 24 25 26 27 struct tlv_usr_16_hdr { 28 29 volatile uint16_t tlv_cflg_reserved : 1, 30 31 tlv_tag : 5, 32 33 tlv_len : 4, 34 35 tlv_usrid : 6; 36 37 }; 38 39 40 41 struct tlv_16_hdr { 42 43 volatile uint16_t tlv_cflg_reserved : 1, 44 45 tlv_tag : 5, 46 47 tlv_len : 4, 48 49 tlv_reserved : 6; 50 51 }; 52 53 54 55 struct tlv_usr_32_hdr { 56 57 volatile uint32_t tlv_cflg_reserved : 1, 58 59 tlv_tag : 9, 60 61 tlv_len : 16, 62 63 tlv_usrid : 6; 64 65 }; 66 67 68 69 struct tlv_32_hdr { 70 71 volatile uint32_t tlv_cflg_reserved : 1, 72 73 tlv_tag : 9, 74 75 tlv_len : 16, 76 77 tlv_reserved : 6; 78 79 }; 80 81 82 83 struct tlv_usr_42_hdr { 84 85 volatile uint64_t tlv_compression : 1, 86 87 tlv_tag : 9, 88 89 tlv_len : 16, 90 91 tlv_usrid : 6, 92 93 tlv_reserved : 10, 94 95 pad_42to64_bit : 22; 96 97 }; 98 99 100 101 struct tlv_42_hdr { 102 103 volatile uint64_t tlv_compression : 1, 104 105 tlv_tag : 9, 106 107 tlv_len : 16, 108 109 tlv_reserved : 16, 110 111 pad_42to64_bit : 22; 112 113 }; 114 115 116 117 struct tlv_usr_c_42_hdr { 118 119 volatile uint64_t tlv_compression : 1, 120 121 tlv_ctag : 3, 122 123 tlv_usrid : 6, 124 125 tlv_cdata : 32, 126 127 pad_42to64_bit : 22; 128 129 }; 130 131 132 133 #endif 134 135