1 /* 2 * Copyright (c) 2018 The Linux Foundation. All rights reserved. 3 * 4 * Permission to use, copy, modify, and/or distribute this software for 5 * any purpose with or without fee is hereby granted, provided that the 6 * above copyright notice and this permission notice appear in all 7 * copies. 8 * 9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL 10 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED 11 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE 12 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL 13 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR 14 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 15 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 16 * PERFORMANCE OF THIS SOFTWARE. 17 */ 18 #ifndef _TLV_HDR_H_ 19 #define _TLV_HDR_H_ 20 #if !defined(__ASSEMBLER__) 21 #endif 22 23 struct tlv_usr_16_hdr { 24 volatile uint16_t tlv_cflg_reserved : 1, 25 tlv_tag : 5, 26 tlv_len : 4, 27 tlv_usrid : 6; 28 }; 29 30 struct tlv_16_hdr { 31 volatile uint16_t tlv_cflg_reserved : 1, 32 tlv_tag : 5, 33 tlv_len : 4, 34 tlv_reserved : 6; 35 }; 36 37 struct tlv_usr_32_hdr { 38 volatile uint32_t tlv_cflg_reserved : 1, 39 tlv_tag : 9, 40 tlv_len : 16, 41 tlv_usrid : 6; 42 }; 43 44 struct tlv_32_hdr { 45 volatile uint32_t tlv_cflg_reserved : 1, 46 tlv_tag : 9, 47 tlv_len : 16, 48 tlv_reserved : 6; 49 }; 50 51 struct tlv_usr_42_hdr { 52 volatile uint64_t tlv_compression : 1, 53 tlv_tag : 9, 54 tlv_len : 16, 55 tlv_usrid : 6, 56 tlv_reserved : 10, 57 pad_42to64_bit : 22; 58 }; 59 60 struct tlv_42_hdr { 61 volatile uint64_t tlv_compression : 1, 62 tlv_tag : 9, 63 tlv_len : 16, 64 tlv_reserved : 16, 65 pad_42to64_bit : 22; 66 }; 67 68 struct tlv_usr_c_42_hdr { 69 volatile uint64_t tlv_compression : 1, 70 tlv_ctag : 3, 71 tlv_usrid : 6, 72 tlv_cdata : 32, 73 pad_42to64_bit : 22; 74 }; 75 76 #endif 77