tlv_hdr.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. /*
  2. * Copyright (c) 2023 Qualcomm Innovation Center, Inc. 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. struct tlv_usr_16_hdr {
  23. volatile uint16_t tlv_cflg_reserved : 1,
  24. tlv_tag : 5,
  25. tlv_len : 4,
  26. tlv_usrid : 6;
  27. };
  28. struct tlv_16_hdr {
  29. volatile uint16_t tlv_cflg_reserved : 1,
  30. tlv_tag : 5,
  31. tlv_len : 4,
  32. tlv_reserved : 6;
  33. };
  34. struct tlv_usr_32_hdr {
  35. volatile uint32_t tlv_cflg_reserved : 1,
  36. tlv_tag : 9,
  37. tlv_len : 16,
  38. tlv_usrid : 6;
  39. };
  40. struct tlv_32_hdr {
  41. volatile uint32_t tlv_cflg_reserved : 1,
  42. tlv_tag : 9,
  43. tlv_len : 16,
  44. tlv_reserved : 6;
  45. };
  46. struct tlv_usr_42_hdr {
  47. volatile uint64_t tlv_compression : 1,
  48. tlv_tag : 9,
  49. tlv_len : 16,
  50. tlv_usrid : 6,
  51. tlv_reserved : 10,
  52. pad_42to64_bit : 22;
  53. };
  54. struct tlv_42_hdr {
  55. volatile uint64_t tlv_compression : 1,
  56. tlv_tag : 9,
  57. tlv_len : 16,
  58. tlv_reserved : 16,
  59. pad_42to64_bit : 22;
  60. };
  61. struct tlv_usr_c_42_hdr {
  62. volatile uint64_t tlv_compression : 1,
  63. tlv_ctag : 3,
  64. tlv_usrid : 6,
  65. tlv_cdata : 32,
  66. pad_42to64_bit : 22;
  67. };
  68. #endif