void print_error_data(u64 *data) { int length; u64 type = EHEA_BMASK_GET(ERROR_DATA_TYPE, data[2]); u64 resource = data[1]; length = EHEA_BMASK_GET(ERROR_DATA_LENGTH, data[0]); if (length > EHEA_PAGESIZE) length = EHEA_PAGESIZE; if (type == 0x8) /* Queue Pair */ ehea_error("QP (resource=%lX) state: AER=0x%lX, AERR=0x%lX, " "port=%lX", resource, data[6], data[12], data[22]); if (type == 0x4) /* Completion Queue */ ehea_error("CQ (resource=%lX) state: AER=0x%lX", resource, data[6]); if (type == 0x3) /* Event Queue */ ehea_error("EQ (resource=%lX) state: AER=0x%lX", resource, data[6]); ehea_dump(data, length, "error data"); }
u64 ehea_h_query_ehea(const u64 adapter_handle, void *cb_addr) { u64 hret, cb_logaddr; cb_logaddr = virt_to_abs(cb_addr); hret = ehea_plpar_hcall_norets(H_QUERY_HEA, adapter_handle, /* R4 */ cb_logaddr, /* R5 */ 0, 0, 0, 0, 0); /* R6-R10 */ #ifdef DEBUG ehea_dump(cb_addr, sizeof(struct hcp_query_ehea), "hcp_query_ehea"); #endif return hret; }
u64 ehea_h_modify_ehea_port(const u64 adapter_handle, const u16 port_num, const u8 cb_cat, const u64 select_mask, void *cb_addr) { unsigned long outs[PLPAR_HCALL9_BUFSIZE]; u64 port_info; u64 arr_index = 0; u64 cb_logaddr = virt_to_abs(cb_addr); port_info = EHEA_BMASK_SET(H_MEHEAPORT_CAT, cb_cat) | EHEA_BMASK_SET(H_MEHEAPORT_PN, port_num); #ifdef DEBUG ehea_dump(cb_addr, sizeof(struct hcp_ehea_port_cb0), "Before HCALL"); #endif return ehea_plpar_hcall9(H_MODIFY_HEA_PORT, outs, adapter_handle, /* R4 */ port_info, /* R5 */ select_mask, /* R6 */ arr_index, /* R7 */ cb_logaddr, /* R8 */ 0, 0, 0, 0); /* R9-R12 */ }