summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorZdenek Styblik <stybla@turnovfree.net>2014-04-08 15:18:50 +0200
committerZdenek Styblik <stybla@turnovfree.net>2014-04-08 15:18:50 +0200
commit23e9340b49c7f339762dda0c3d56a1db6ef6efb1 (patch)
tree07480b230c96a8082ba715582a18aa2998ac08fb /include
parent707d77ffbc8930fe3a899da16fa1405a76c5eb19 (diff)
downloadipmitool-23e9340b49c7f339762dda0c3d56a1db6ef6efb1.tar.gz
ID:302 - HPM.2 long message support
This patch adds basic long message support for PICMG-based systems according to the HPM.2 specification. It also introduces APIs for setting inbound and outbound messages sizes per selected interface. This APIs are used in LAN and LAN+ interfaces to set autonomously detected inbound and outbound message sizes. The newly introduced APIs also replace the existing message size detection code in several ipmitool commands in order to leverage the advantages of long message support (HPM.1 upgrade, SDR acquring, FRU inventory read and write). The Kontron-specific long message support is moved under a OEM option. Commit for Dmitry Bazhenov
Diffstat (limited to 'include')
-rw-r--r--include/ipmitool/hpm2.h86
-rw-r--r--include/ipmitool/ipmi_intf.h5
2 files changed, 90 insertions, 1 deletions
diff --git a/include/ipmitool/hpm2.h b/include/ipmitool/hpm2.h
new file mode 100644
index 0000000..1c0a612
--- /dev/null
+++ b/include/ipmitool/hpm2.h
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2012 Pigeon Point Systems. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Pigeon Point Systems nor the names of
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind.
+ * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
+ * PIGEON POINT SYSTEMS ("PPS") AND ITS LICENSORS SHALL NOT BE LIABLE
+ * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
+ * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
+ * PPS OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
+ * OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
+ * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
+ * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
+ * EVEN IF PPS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#include <stdint.h>
+#include <ipmitool/ipmi_intf.h>
+
+/* Global HPM.2 defines */
+#define HPM2_REVISION 0x01
+#define HPM3_REVISION 0x01
+#define HPM2_LAN_PARAMS_REV 0x01
+#define HPM2_SOL_PARAMS_REV 0x01
+#define HPM3_LAN_PARAMS_REV 0x01
+
+/* HPM.2 capabilities */
+#define HPM2_CAPS_SOL_EXTENSION 0x01
+#define HPM2_CAPS_PACKET_TRACE 0x02
+#define HPM2_CAPS_EXT_MANAGEMENT 0x04
+#define HPM2_CAPS_VERSION_SENSOR 0x08
+#define HPM2_CAPS_DYNAMIC_SESSIONS 0x10
+
+#if HAVE_PRAGMA_PACK
+# pragma pack(push, 1)
+#endif
+
+/* HPM.2 LAN attach capabilities */
+struct hpm2_lan_attach_capabilities {
+ uint8_t hpm2_revision_id;
+ uint16_t lan_channel_mask;
+ uint8_t hpm2_caps;
+ uint8_t hpm2_lan_params_start;
+ uint8_t hpm2_lan_params_rev;
+ uint8_t hpm2_sol_params_start;
+ uint8_t hpm2_sol_params_rev;
+} ATTRIBUTE_PACKING;
+
+/* HPM.2 LAN channel capabilities */
+struct hpm2_lan_channel_capabilities {
+ uint8_t capabilities;
+ uint8_t attach_type;
+ uint8_t bandwidth_class;
+ uint16_t max_inbound_pld_size;
+ uint16_t max_outbound_pld_size;
+} ATTRIBUTE_PACKING;
+
+#if HAVE_PRAGMA_PACK
+# pragma pack(pop)
+#endif
+
+/* HPM.2 command assignments */
+#define HPM2_GET_LAN_ATTACH_CAPABILITIES 0x3E
+
+extern int hpm2_get_capabilities(struct ipmi_intf * intf,
+ struct hpm2_lan_attach_capabilities * caps);
+extern int hpm2_get_lan_channel_capabilities(struct ipmi_intf * intf,
+ uint8_t hpm2_lan_params_start,
+ struct hpm2_lan_channel_capabilities * caps);
+extern int hpm2_detect_max_payload_size(struct ipmi_intf * intf);
diff --git a/include/ipmitool/ipmi_intf.h b/include/ipmitool/ipmi_intf.h
index 774c6b2..437a427 100644
--- a/include/ipmitool/ipmi_intf.h
+++ b/include/ipmitool/ipmi_intf.h
@@ -180,7 +180,8 @@ struct ipmi_intf {
uint8_t target_channel;
uint32_t transit_addr;
uint8_t transit_channel;
- uint8_t channel_buf_size;
+ uint16_t max_request_data_size;
+ uint16_t max_response_data_size;
uint8_t devnum;
@@ -193,6 +194,8 @@ struct ipmi_intf {
struct ipmi_rs *(*send_sol)(struct ipmi_intf * intf, struct ipmi_v2_payload * payload);
int (*keepalive)(struct ipmi_intf * intf);
int (*set_my_addr)(struct ipmi_intf * intf, uint8_t addr);
+ void (*set_max_request_data_size)(struct ipmi_intf * intf, uint16_t size);
+ void (*set_max_response_data_size)(struct ipmi_intf * intf, uint16_t size);
};
struct ipmi_intf * ipmi_intf_load(char * name);