tlv_hdr.h 3.0 KB

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