vishwabmc | ba0bd5f | 2015-09-30 16:50:23 +0530 | [diff] [blame] | 1 | #include "apphandler.h" |
| 2 | #include "ipmid-api.h" |
Chris Austen | 6caf28b | 2015-10-13 12:40:40 -0500 | [diff] [blame] | 3 | #include "ipmid.H" |
vishwabmc | ba0bd5f | 2015-09-30 16:50:23 +0530 | [diff] [blame] | 4 | #include <stdio.h> |
| 5 | #include <string.h> |
Chris Austen | 6caf28b | 2015-10-13 12:40:40 -0500 | [diff] [blame] | 6 | #include <stdint.h> |
Adriana Kobylak | 3a552e1 | 2015-10-19 16:11:00 -0500 | [diff] [blame] | 7 | #include <systemd/sd-bus.h> |
| 8 | |
| 9 | extern sd_bus *bus; |
vishwabmc | ba0bd5f | 2015-09-30 16:50:23 +0530 | [diff] [blame] | 10 | |
Chris Austen | 6caf28b | 2015-10-13 12:40:40 -0500 | [diff] [blame] | 11 | void register_netfn_app_functions() __attribute__((constructor)); |
vishwabmc | ba0bd5f | 2015-09-30 16:50:23 +0530 | [diff] [blame] | 12 | |
Chris Austen | 6caf28b | 2015-10-13 12:40:40 -0500 | [diff] [blame] | 13 | |
Adriana Kobylak | 3a552e1 | 2015-10-19 16:11:00 -0500 | [diff] [blame] | 14 | ipmi_ret_t ipmi_app_read_event(ipmi_netfn_t netfn, ipmi_cmd_t cmd, |
| 15 | ipmi_request_t request, ipmi_response_t response, |
Chris Austen | 6caf28b | 2015-10-13 12:40:40 -0500 | [diff] [blame] | 16 | ipmi_data_len_t data_len, ipmi_context_t context) |
| 17 | { |
| 18 | ipmi_ret_t rc = IPMI_CC_OK; |
| 19 | *data_len = 0; |
| 20 | |
| 21 | printf("IPMI APP READ EVENT Ignoring for now\n"); |
| 22 | return rc; |
| 23 | |
| 24 | } |
| 25 | |
| 26 | |
Adriana Kobylak | 3a552e1 | 2015-10-19 16:11:00 -0500 | [diff] [blame] | 27 | ipmi_ret_t ipmi_app_set_acpi_power_state(ipmi_netfn_t netfn, ipmi_cmd_t cmd, |
| 28 | ipmi_request_t request, ipmi_response_t response, |
Chris Austen | 6caf28b | 2015-10-13 12:40:40 -0500 | [diff] [blame] | 29 | ipmi_data_len_t data_len, ipmi_context_t context) |
| 30 | { |
| 31 | ipmi_ret_t rc = IPMI_CC_OK; |
| 32 | *data_len = 0; |
| 33 | |
| 34 | printf("IPMI SET ACPI STATE Ignoring for now\n"); |
| 35 | return rc; |
| 36 | } |
| 37 | |
Adriana Kobylak | 3a552e1 | 2015-10-19 16:11:00 -0500 | [diff] [blame] | 38 | ipmi_ret_t ipmi_app_get_device_id(ipmi_netfn_t netfn, ipmi_cmd_t cmd, |
| 39 | ipmi_request_t request, ipmi_response_t response, |
Chris Austen | 6caf28b | 2015-10-13 12:40:40 -0500 | [diff] [blame] | 40 | ipmi_data_len_t data_len, ipmi_context_t context) |
| 41 | { |
| 42 | ipmi_ret_t rc = IPMI_CC_OK; |
| 43 | |
Patrick Williams | 76b51f6 | 2015-10-28 12:14:56 -0500 | [diff] [blame] | 44 | // TODO: |
| 45 | // This value is the IANA number assigned to "IBM Platform Firmware |
| 46 | // Division", which is also used by our service processor. We may want |
| 47 | // a different number or at least a different version? |
Chris Austen | 6caf28b | 2015-10-13 12:40:40 -0500 | [diff] [blame] | 48 | uint8_t str[] = {0x00, 0, 1, 1,2, 0xD, 0x41, 0xA7, 0x00, 0x43, 0x40}; |
| 49 | |
| 50 | // Data length |
| 51 | *data_len = sizeof(str); |
| 52 | |
| 53 | // Pack the actual response |
| 54 | memcpy(response, &str, *data_len); |
| 55 | return rc; |
| 56 | } |
| 57 | |
Adriana Kobylak | d100ee5 | 2015-10-20 17:02:37 -0500 | [diff] [blame] | 58 | ipmi_ret_t ipmi_app_get_device_guid(ipmi_netfn_t netfn, ipmi_cmd_t cmd, |
| 59 | ipmi_request_t request, ipmi_response_t response, |
| 60 | ipmi_data_len_t data_len, ipmi_context_t context) |
| 61 | { |
| 62 | const char *busname = "org.openbmc.control.Chassis"; |
| 63 | const char *objname = "/org/openbmc/control/chassis0"; |
Adriana Kobylak | 31bccae | 2015-11-05 13:31:06 -0600 | [diff] [blame] | 64 | const char *iface = "org.freedesktop.DBus.Properties"; |
| 65 | const char *chassis_iface = "org.openbmc.control.Chassis"; |
Adriana Kobylak | d100ee5 | 2015-10-20 17:02:37 -0500 | [diff] [blame] | 66 | sd_bus_message *reply = NULL, *m = NULL; |
| 67 | sd_bus_error error = SD_BUS_ERROR_NULL; |
| 68 | int r = 0; |
| 69 | char *uuid = NULL; |
| 70 | |
| 71 | // Status code. |
| 72 | ipmi_ret_t rc = IPMI_CC_OK; |
| 73 | *data_len = 0; |
| 74 | |
| 75 | printf("IPMI GET DEVICE GUID\n"); |
| 76 | |
Adriana Kobylak | 31bccae | 2015-11-05 13:31:06 -0600 | [diff] [blame] | 77 | // Call Get properties method with the interface and property name |
| 78 | r = sd_bus_message_new_method_call(bus,&m,busname,objname,iface,"Get"); |
Adriana Kobylak | d100ee5 | 2015-10-20 17:02:37 -0500 | [diff] [blame] | 79 | if (r < 0) { |
Adriana Kobylak | 31bccae | 2015-11-05 13:31:06 -0600 | [diff] [blame] | 80 | fprintf(stderr, "Failed to add the Get method object: %s\n", strerror(-r)); |
Adriana Kobylak | d100ee5 | 2015-10-20 17:02:37 -0500 | [diff] [blame] | 81 | return IPMI_CC_UNSPECIFIED_ERROR; |
| 82 | } |
Adriana Kobylak | 31bccae | 2015-11-05 13:31:06 -0600 | [diff] [blame] | 83 | r = sd_bus_message_append(m, "ss", chassis_iface, "uuid"); |
| 84 | if (r < 0) { |
| 85 | fprintf(stderr, "Failed to append arguments: %s\n", strerror(-r)); |
| 86 | return -1; |
| 87 | } |
Adriana Kobylak | d100ee5 | 2015-10-20 17:02:37 -0500 | [diff] [blame] | 88 | r = sd_bus_call(bus, m, 0, &error, &reply); |
| 89 | if (r < 0) { |
Adriana Kobylak | 31bccae | 2015-11-05 13:31:06 -0600 | [diff] [blame] | 90 | fprintf(stderr, "Failed to call the Get method: %s\n", strerror(-r)); |
Adriana Kobylak | d100ee5 | 2015-10-20 17:02:37 -0500 | [diff] [blame] | 91 | return IPMI_CC_UNSPECIFIED_ERROR; |
| 92 | } |
Adriana Kobylak | 31bccae | 2015-11-05 13:31:06 -0600 | [diff] [blame] | 93 | r = sd_bus_message_read(reply, "v", "s", &uuid); |
Adriana Kobylak | d100ee5 | 2015-10-20 17:02:37 -0500 | [diff] [blame] | 94 | if (r < 0) { |
| 95 | fprintf(stderr, "Failed to get a response: %s", strerror(-r)); |
| 96 | return IPMI_CC_RESPONSE_ERROR; |
| 97 | } |
| 98 | if (uuid == NULL) |
| 99 | { |
| 100 | fprintf(stderr, "Failed to get a valid response: %s", strerror(-r)); |
| 101 | return IPMI_CC_RESPONSE_ERROR; |
| 102 | } |
| 103 | |
| 104 | // UUID is in RFC4122 format. Ex: 61a39523-78f2-11e5-9862-e6402cfc3223 |
| 105 | // Per IPMI Spec 2.0 need to convert to 16 hex bytes and reverse the byte order |
| 106 | // Ex: 0x2332fc2c40e66298e511f2782395a361 |
| 107 | |
| 108 | const int resp_size = 16; // Response is 16 hex bytes per IPMI Spec |
| 109 | uint8_t resp_uuid[resp_size]; // Array to hold the formatted response |
| 110 | int resp_loc = resp_size-1; // Point resp end of array to save in reverse order |
| 111 | int i = 0; |
| 112 | char *tokptr = NULL; |
| 113 | |
| 114 | // Traverse the UUID |
| 115 | char* id_octet = strtok_r(uuid, "-", &tokptr); // Get the UUID octects separated by dash |
| 116 | |
| 117 | if (id_octet == NULL) |
| 118 | { // Error |
| 119 | fprintf(stderr, "Unexpected UUID format: %s", uuid); |
| 120 | return IPMI_CC_RESPONSE_ERROR; |
| 121 | } |
| 122 | |
| 123 | while (id_octet != NULL) |
| 124 | { |
| 125 | // Calculate the octet string size since it varies |
| 126 | // Divide it by 2 for the array size since 1 byte is built from 2 chars |
| 127 | int tmp_size = strlen(id_octet)/2; |
| 128 | |
| 129 | for(i = 0; i < tmp_size; i++) |
| 130 | { |
| 131 | char tmp_array[3]; // Holder of the 2 chars that will become a byte |
| 132 | tmp_array[3] = '\0'; |
| 133 | strncpy(tmp_array, id_octet, 2); // 2 chars at a time |
| 134 | |
| 135 | int resp_byte = strtoul(tmp_array, NULL, 16); // Convert to hex byte |
| 136 | memcpy((void*)&resp_uuid[resp_loc], &resp_byte, 1); // Copy end to first |
| 137 | resp_loc--; |
| 138 | id_octet+=2; // Finished with the 2 chars, advance |
| 139 | } |
| 140 | id_octet=strtok_r(NULL, "-", &tokptr); // Get next octet |
| 141 | } |
| 142 | |
| 143 | // Data length |
| 144 | *data_len = resp_size; |
| 145 | |
| 146 | // Pack the actual response |
| 147 | memcpy(response, &resp_uuid, *data_len); |
| 148 | |
| 149 | sd_bus_error_free(&error); |
| 150 | sd_bus_message_unref(m); |
| 151 | |
| 152 | return rc; |
| 153 | } |
Chris Austen | 6caf28b | 2015-10-13 12:40:40 -0500 | [diff] [blame] | 154 | |
Adriana Kobylak | 3a552e1 | 2015-10-19 16:11:00 -0500 | [diff] [blame] | 155 | ipmi_ret_t ipmi_app_get_bt_capabilities(ipmi_netfn_t netfn, ipmi_cmd_t cmd, |
| 156 | ipmi_request_t request, ipmi_response_t response, |
vishwabmc | ba0bd5f | 2015-09-30 16:50:23 +0530 | [diff] [blame] | 157 | ipmi_data_len_t data_len, ipmi_context_t context) |
| 158 | { |
| 159 | printf("Handling Netfn:[0x%X], Cmd:[0x%X]\n",netfn,cmd); |
| 160 | |
| 161 | // Status code. |
| 162 | ipmi_ret_t rc = IPMI_CC_OK; |
| 163 | |
Chris Austen | 6caf28b | 2015-10-13 12:40:40 -0500 | [diff] [blame] | 164 | uint8_t str[] = {0x01, MAX_IPMI_BUFFER, MAX_IPMI_BUFFER, 0x0A, 0x01}; |
vishwabmc | ba0bd5f | 2015-09-30 16:50:23 +0530 | [diff] [blame] | 165 | |
| 166 | // Data length |
| 167 | *data_len = sizeof(str); |
| 168 | |
| 169 | // Pack the actual response |
| 170 | memcpy(response, &str, *data_len); |
| 171 | |
| 172 | return rc; |
| 173 | } |
| 174 | |
Chris Austen | 6caf28b | 2015-10-13 12:40:40 -0500 | [diff] [blame] | 175 | |
| 176 | struct set_wd_data_t { |
| 177 | uint8_t t_use; |
| 178 | uint8_t t_action; |
| 179 | uint8_t preset; |
| 180 | uint8_t flags; |
| 181 | uint8_t ls; |
| 182 | uint8_t ms; |
| 183 | } __attribute__ ((packed)); |
| 184 | |
| 185 | |
| 186 | |
Adriana Kobylak | 3a552e1 | 2015-10-19 16:11:00 -0500 | [diff] [blame] | 187 | ipmi_ret_t ipmi_app_set_watchdog(ipmi_netfn_t netfn, ipmi_cmd_t cmd, |
| 188 | ipmi_request_t request, ipmi_response_t response, |
Chris Austen | 6caf28b | 2015-10-13 12:40:40 -0500 | [diff] [blame] | 189 | ipmi_data_len_t data_len, ipmi_context_t context) |
| 190 | { |
Adriana Kobylak | 3a552e1 | 2015-10-19 16:11:00 -0500 | [diff] [blame] | 191 | const char *busname = "org.openbmc.watchdog.Host"; |
Chris Austen | 454acfe | 2015-10-29 23:03:34 -0500 | [diff] [blame] | 192 | const char *objname = "/org/openbmc/watchdog/host0"; |
Adriana Kobylak | 3a552e1 | 2015-10-19 16:11:00 -0500 | [diff] [blame] | 193 | const char *iface = "org.openbmc.Watchdog"; |
| 194 | sd_bus_message *reply = NULL, *m = NULL; |
| 195 | sd_bus_error error = SD_BUS_ERROR_NULL; |
| 196 | int r = 0; |
Chris Austen | 6caf28b | 2015-10-13 12:40:40 -0500 | [diff] [blame] | 197 | |
| 198 | set_wd_data_t *reqptr = (set_wd_data_t*) request; |
| 199 | uint16_t timer = 0; |
Adriana Kobylak | 3a552e1 | 2015-10-19 16:11:00 -0500 | [diff] [blame] | 200 | uint32_t timer_ms = 0; |
Chris Austen | 6caf28b | 2015-10-13 12:40:40 -0500 | [diff] [blame] | 201 | // Status code. |
| 202 | ipmi_ret_t rc = IPMI_CC_OK; |
| 203 | |
| 204 | *data_len = 0; |
| 205 | |
Adriana Kobylak | 3a552e1 | 2015-10-19 16:11:00 -0500 | [diff] [blame] | 206 | // Get number of 100ms intervals |
Chris Austen | 6caf28b | 2015-10-13 12:40:40 -0500 | [diff] [blame] | 207 | timer = (((uint16_t)reqptr->ms) << 8) + reqptr->ls; |
Adriana Kobylak | 3a552e1 | 2015-10-19 16:11:00 -0500 | [diff] [blame] | 208 | // Get timer value in ms |
| 209 | timer_ms = timer * 100; |
Chris Austen | 6caf28b | 2015-10-13 12:40:40 -0500 | [diff] [blame] | 210 | |
| 211 | printf("WATCHDOG SET Timer:[0x%X] 100ms intervals\n",timer); |
| 212 | |
Adriana Kobylak | 3a552e1 | 2015-10-19 16:11:00 -0500 | [diff] [blame] | 213 | // Set watchdog timer |
| 214 | r = sd_bus_message_new_method_call(bus,&m,busname,objname,iface,"set"); |
| 215 | if (r < 0) { |
| 216 | fprintf(stderr, "Failed to add the set method object: %s\n", strerror(-r)); |
| 217 | return -1; |
| 218 | } |
| 219 | r = sd_bus_message_append(m, "i", timer_ms); |
| 220 | if (r < 0) { |
| 221 | fprintf(stderr, "Failed to add timer value: %s\n", strerror(-r)); |
| 222 | return -1; |
| 223 | } |
| 224 | r = sd_bus_call(bus, m, 0, &error, &reply); |
| 225 | if (r < 0) { |
| 226 | fprintf(stderr, "Failed to call the set method: %s\n", strerror(-r)); |
| 227 | return -1; |
| 228 | } |
| 229 | |
Adriana Kobylak | 0896be3 | 2015-10-22 13:27:23 -0500 | [diff] [blame] | 230 | // Stop the current watchdog if any |
| 231 | r = sd_bus_message_new_method_call(bus,&m,busname,objname,iface,"stop"); |
Adriana Kobylak | 3a552e1 | 2015-10-19 16:11:00 -0500 | [diff] [blame] | 232 | if (r < 0) { |
| 233 | fprintf(stderr, "Failed to add the start method object: %s\n", strerror(-r)); |
| 234 | return -1; |
| 235 | } |
| 236 | r = sd_bus_call(bus, m, 0, &error, &reply); |
| 237 | if (r < 0) { |
| 238 | fprintf(stderr, "Failed to call the start method: %s\n", strerror(-r)); |
| 239 | return -1; |
| 240 | } |
| 241 | |
Adriana Kobylak | 0896be3 | 2015-10-22 13:27:23 -0500 | [diff] [blame] | 242 | // Start the watchdog if requested |
| 243 | if (reqptr->t_use & 0x40) |
| 244 | { |
| 245 | r = sd_bus_message_new_method_call(bus,&m,busname,objname,iface,"start"); |
| 246 | if (r < 0) { |
| 247 | fprintf(stderr, "Failed to add the start method object: %s\n", strerror(-r)); |
| 248 | return -1; |
| 249 | } |
| 250 | r = sd_bus_call(bus, m, 0, &error, &reply); |
| 251 | if (r < 0) { |
| 252 | fprintf(stderr, "Failed to call the start method: %s\n", strerror(-r)); |
| 253 | return -1; |
| 254 | } |
| 255 | } |
| 256 | |
Adriana Kobylak | 3a552e1 | 2015-10-19 16:11:00 -0500 | [diff] [blame] | 257 | sd_bus_error_free(&error); |
| 258 | sd_bus_message_unref(m); |
Chris Austen | 6caf28b | 2015-10-13 12:40:40 -0500 | [diff] [blame] | 259 | |
| 260 | return rc; |
| 261 | } |
| 262 | |
| 263 | |
Adriana Kobylak | 3a552e1 | 2015-10-19 16:11:00 -0500 | [diff] [blame] | 264 | ipmi_ret_t ipmi_app_reset_watchdog(ipmi_netfn_t netfn, ipmi_cmd_t cmd, |
| 265 | ipmi_request_t request, ipmi_response_t response, |
Chris Austen | 6caf28b | 2015-10-13 12:40:40 -0500 | [diff] [blame] | 266 | ipmi_data_len_t data_len, ipmi_context_t context) |
| 267 | { |
Adriana Kobylak | 3a552e1 | 2015-10-19 16:11:00 -0500 | [diff] [blame] | 268 | const char *busname = "org.openbmc.watchdog.Host"; |
Chris Austen | 454acfe | 2015-10-29 23:03:34 -0500 | [diff] [blame] | 269 | const char *objname = "/org/openbmc/watchdog/host0"; |
Adriana Kobylak | 3a552e1 | 2015-10-19 16:11:00 -0500 | [diff] [blame] | 270 | const char *iface = "org.openbmc.Watchdog"; |
| 271 | sd_bus_message *reply = NULL, *m = NULL; |
| 272 | sd_bus_error error = SD_BUS_ERROR_NULL; |
| 273 | int r = 0; |
| 274 | |
Chris Austen | 6caf28b | 2015-10-13 12:40:40 -0500 | [diff] [blame] | 275 | // Status code. |
| 276 | ipmi_ret_t rc = IPMI_CC_OK; |
| 277 | *data_len = 0; |
| 278 | |
| 279 | printf("WATCHDOG RESET\n"); |
Adriana Kobylak | 3a552e1 | 2015-10-19 16:11:00 -0500 | [diff] [blame] | 280 | |
| 281 | // Refresh watchdog |
| 282 | r = sd_bus_message_new_method_call(bus,&m,busname,objname,iface,"poke"); |
| 283 | if (r < 0) { |
| 284 | fprintf(stderr, "Failed to add the method object: %s\n", strerror(-r)); |
| 285 | return -1; |
| 286 | } |
| 287 | r = sd_bus_call(bus, m, 0, &error, &reply); |
| 288 | if (r < 0) { |
| 289 | fprintf(stderr, "Failed to call the method: %s\n", strerror(-r)); |
| 290 | return -1; |
| 291 | } |
| 292 | |
| 293 | sd_bus_error_free(&error); |
| 294 | sd_bus_message_unref(m); |
| 295 | |
Chris Austen | 6caf28b | 2015-10-13 12:40:40 -0500 | [diff] [blame] | 296 | return rc; |
| 297 | } |
| 298 | |
Adriana Kobylak | dfc8d77 | 2015-10-20 09:34:48 -0500 | [diff] [blame] | 299 | ipmi_ret_t ipmi_app_set_bmc_global_enables(ipmi_netfn_t netfn, ipmi_cmd_t cmd, |
| 300 | ipmi_request_t request, ipmi_response_t response, |
| 301 | ipmi_data_len_t data_len, ipmi_context_t context) |
| 302 | { |
| 303 | ipmi_ret_t rc = IPMI_CC_OK; |
| 304 | *data_len = 0; |
Chris Austen | 6caf28b | 2015-10-13 12:40:40 -0500 | [diff] [blame] | 305 | |
Adriana Kobylak | dfc8d77 | 2015-10-20 09:34:48 -0500 | [diff] [blame] | 306 | // Event and message logging enabled by default so return for now |
| 307 | printf("IPMI APP SET BMC GLOBAL ENABLES Ignoring for now\n"); |
| 308 | |
| 309 | return rc; |
| 310 | } |
Chris Austen | 6caf28b | 2015-10-13 12:40:40 -0500 | [diff] [blame] | 311 | |
| 312 | |
| 313 | |
Adriana Kobylak | 3a552e1 | 2015-10-19 16:11:00 -0500 | [diff] [blame] | 314 | ipmi_ret_t ipmi_app_wildcard_handler(ipmi_netfn_t netfn, ipmi_cmd_t cmd, |
| 315 | ipmi_request_t request, ipmi_response_t response, |
vishwabmc | ba0bd5f | 2015-09-30 16:50:23 +0530 | [diff] [blame] | 316 | ipmi_data_len_t data_len, ipmi_context_t context) |
| 317 | { |
| 318 | printf("Handling WILDCARD Netfn:[0x%X], Cmd:[0x%X]\n",netfn, cmd); |
| 319 | |
| 320 | // Status code. |
| 321 | ipmi_ret_t rc = IPMI_CC_OK; |
| 322 | |
| 323 | *data_len = strlen("THIS IS WILDCARD"); |
| 324 | |
| 325 | // Now pack actual response |
| 326 | memcpy(response, "THIS IS WILDCARD", *data_len); |
| 327 | |
| 328 | return rc; |
| 329 | } |
| 330 | |
Chris Austen | 6caf28b | 2015-10-13 12:40:40 -0500 | [diff] [blame] | 331 | void register_netfn_app_functions() |
vishwabmc | ba0bd5f | 2015-09-30 16:50:23 +0530 | [diff] [blame] | 332 | { |
| 333 | printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",NETFUN_APP, IPMI_CMD_GET_CAP_BIT); |
Chris Austen | 6caf28b | 2015-10-13 12:40:40 -0500 | [diff] [blame] | 334 | ipmi_register_callback(NETFUN_APP, IPMI_CMD_GET_CAP_BIT, NULL, ipmi_app_get_bt_capabilities); |
| 335 | |
| 336 | printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",NETFUN_APP, IPMI_CMD_WILDCARD); |
| 337 | ipmi_register_callback(NETFUN_APP, IPMI_CMD_WILDCARD, NULL, ipmi_app_wildcard_handler); |
| 338 | |
| 339 | printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",NETFUN_APP, IPMI_CMD_RESET_WD); |
| 340 | ipmi_register_callback(NETFUN_APP, IPMI_CMD_RESET_WD, NULL, ipmi_app_reset_watchdog); |
| 341 | |
| 342 | printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",NETFUN_APP, IPMI_CMD_SET_WD); |
| 343 | ipmi_register_callback(NETFUN_APP, IPMI_CMD_SET_WD, NULL, ipmi_app_set_watchdog); |
| 344 | |
| 345 | printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",NETFUN_APP, IPMI_CMD_GET_DEVICE_ID); |
| 346 | ipmi_register_callback(NETFUN_APP, IPMI_CMD_GET_DEVICE_ID, NULL, ipmi_app_get_device_id); |
| 347 | |
Adriana Kobylak | d100ee5 | 2015-10-20 17:02:37 -0500 | [diff] [blame] | 348 | printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",NETFUN_APP, IPMI_CMD_GET_DEVICE_GUID); |
| 349 | ipmi_register_callback(NETFUN_APP, IPMI_CMD_GET_DEVICE_GUID, NULL, ipmi_app_get_device_guid); |
| 350 | |
Chris Austen | 6caf28b | 2015-10-13 12:40:40 -0500 | [diff] [blame] | 351 | printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",NETFUN_APP, IPMI_CMD_SET_ACPI); |
| 352 | ipmi_register_callback(NETFUN_APP, IPMI_CMD_SET_ACPI, NULL, ipmi_app_set_acpi_power_state); |
| 353 | |
| 354 | printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",NETFUN_APP, IPMI_CMD_READ_EVENT); |
| 355 | ipmi_register_callback(NETFUN_APP, IPMI_CMD_READ_EVENT, NULL, ipmi_app_read_event); |
Adriana Kobylak | dfc8d77 | 2015-10-20 09:34:48 -0500 | [diff] [blame] | 356 | |
| 357 | printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",NETFUN_APP, |
| 358 | IPMI_CMD_SET_BMC_GLOBAL_ENABLES); |
| 359 | ipmi_register_callback(NETFUN_APP, IPMI_CMD_SET_BMC_GLOBAL_ENABLES, NULL, |
| 360 | ipmi_app_set_bmc_global_enables); |
| 361 | |
vishwabmc | ba0bd5f | 2015-09-30 16:50:23 +0530 | [diff] [blame] | 362 | return; |
| 363 | } |
| 364 | |
Chris Austen | 6caf28b | 2015-10-13 12:40:40 -0500 | [diff] [blame] | 365 | |