hpm2.h 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /*
  2. * Copyright (c) 2012 Pigeon Point Systems. All Rights Reserved.
  3. *
  4. * Redistribution and use in source and binary forms, with or without
  5. * modification, are permitted provided that the following conditions
  6. * are met:
  7. *
  8. * Redistribution of source code must retain the above copyright
  9. * notice, this list of conditions and the following disclaimer.
  10. *
  11. * Redistribution in binary form must reproduce the above copyright
  12. * notice, this list of conditions and the following disclaimer in the
  13. * documentation and/or other materials provided with the distribution.
  14. *
  15. * Neither the name of Pigeon Point Systems nor the names of
  16. * contributors may be used to endorse or promote products derived
  17. * from this software without specific prior written permission.
  18. *
  19. * This software is provided "AS IS," without a warranty of any kind.
  20. * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  21. * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
  22. * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
  23. * PIGEON POINT SYSTEMS ("PPS") AND ITS LICENSORS SHALL NOT BE LIABLE
  24. * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
  25. * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
  26. * PPS OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
  27. * OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
  28. * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
  29. * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
  30. * EVEN IF PPS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
  31. */
  32. #include <stdint.h>
  33. #include <ipmitool/ipmi_intf.h>
  34. /* Global HPM.2 defines */
  35. #define HPM2_REVISION 0x01
  36. #define HPM3_REVISION 0x01
  37. #define HPM2_LAN_PARAMS_REV 0x01
  38. #define HPM2_SOL_PARAMS_REV 0x01
  39. #define HPM3_LAN_PARAMS_REV 0x01
  40. /* IPMI defines parameter revision as
  41. * MSN = present revision,
  42. * LSN = oldest revision parameter is
  43. * backward compatible with. */
  44. #define LAN_PARAM_REV(x, y) (((x) << 4) | ((y) & 0xF))
  45. /* HPM.2 capabilities */
  46. #define HPM2_CAPS_SOL_EXTENSION 0x01
  47. #define HPM2_CAPS_PACKET_TRACE 0x02
  48. #define HPM2_CAPS_EXT_MANAGEMENT 0x04
  49. #define HPM2_CAPS_VERSION_SENSOR 0x08
  50. #define HPM2_CAPS_DYNAMIC_SESSIONS 0x10
  51. #if HAVE_PRAGMA_PACK
  52. # pragma pack(push, 1)
  53. #endif
  54. /* HPM.2 LAN attach capabilities */
  55. struct hpm2_lan_attach_capabilities {
  56. uint8_t hpm2_revision_id;
  57. uint16_t lan_channel_mask;
  58. uint8_t hpm2_caps;
  59. uint8_t hpm2_lan_params_start;
  60. uint8_t hpm2_lan_params_rev;
  61. uint8_t hpm2_sol_params_start;
  62. uint8_t hpm2_sol_params_rev;
  63. } ATTRIBUTE_PACKING;
  64. /* HPM.2 LAN channel capabilities */
  65. struct hpm2_lan_channel_capabilities {
  66. uint8_t capabilities;
  67. uint8_t attach_type;
  68. uint8_t bandwidth_class;
  69. uint16_t max_inbound_pld_size;
  70. uint16_t max_outbound_pld_size;
  71. } ATTRIBUTE_PACKING;
  72. #if HAVE_PRAGMA_PACK
  73. # pragma pack(pop)
  74. #endif
  75. /* HPM.2 command assignments */
  76. #define HPM2_GET_LAN_ATTACH_CAPABILITIES 0x3E
  77. extern int hpm2_get_capabilities(struct ipmi_intf * intf,
  78. struct hpm2_lan_attach_capabilities * caps);
  79. extern int hpm2_get_lan_channel_capabilities(struct ipmi_intf * intf,
  80. uint8_t hpm2_lan_params_start,
  81. struct hpm2_lan_channel_capabilities * caps);
  82. extern int hpm2_detect_max_payload_size(struct ipmi_intf * intf);