Example #1
0
/**
 * print_re_vend_specific_scn
 * @brief print the contents of a vendor specific section
 *
 * @param res rtas_event_scn to print
 * @param verbosity verbose level
 * @return number of bytes written
 */
int 
print_re_vend_errlog_scn(struct scn_header *shdr, int verbosity)
{
    struct rtas_vend_errlog *ve;
    int len = 0;

    if (shdr->scn_id != RTAS_VEND_ERRLOG_SCN)  {
        errno = EFAULT;
        return -1;
    }

    ve = (struct rtas_vend_errlog *)shdr;

    len += print_scn_title("Vendor Error Log Section");

    len += rtas_print("%-20s%c%c%c%c\n", "Vendor ID:", ve->vendor_id[0],
                      ve->vendor_id[1], ve->vendor_id[2], ve->vendor_id[3]);
    
    if (ve->vendor_data != NULL) {
        len += rtas_print("Raw Vendor Error Log:\n");
        len += print_raw_data(ve->vendor_data, ve->vendor_data_sz);
    }

    return len;
}
Example #2
0
/**
 * print_mtms
 *
 */
int
print_mtms(struct rtas_mtms *mtms)
{
    int len;

    len = rtas_print("%-20s%s (tttt-mmm)\n", "Model/Type:", mtms->model);
    len += rtas_print("%-20s%s\n", "Serial Number:", mtms->serial_no);

    return len;
}
Example #3
0
/**
 * print_re_src_scn
 * @brief print the contents of a SRC section
 *
 * @param res rtas_event_scn pointer for SRC section
 * @param verbosity verbose level of output
 * @return number of bytes written
 */
int
print_re_src_scn(struct scn_header *shdr, int verbosity)
{
    struct rtas_src_scn *src;
    struct rtas_fru_scn *fru;
    int len = 0;
    int count = 1;

    if ((shdr->scn_id != RTAS_PSRC_SCN) && (shdr->scn_id != RTAS_SSRC_SCN)) {
        errno = EFAULT;
        return 0;
    }

    src = (struct rtas_src_scn *)shdr;

    if (strncmp(src->v6hdr.id, RTAS_PSRC_SCN_ID, 2) == 0)
        len += print_v6_hdr("Primary SRC Section",
			    (struct rtas_v6_hdr *)&src->v6hdr, verbosity);
    else
        len += print_v6_hdr("Secondary SRC Section",
			    (struct rtas_v6_hdr *)&src->v6hdr, verbosity);

    if (verbosity >= 2) {
        len += rtas_print(PRNT_FMT_2"\n", "SRC Version:", src->version,
                          "Subsections:", src_subscns_included(src));
    }

    len += rtas_print("Platform Data:\n");
    len += print_raw_data((char*)src->src_platform_data, 
                          sizeof(src->src_platform_data));
    len += rtas_print("\n");

    len += rtas_print("Extended Reference Codes:\n");
    len += rtas_print("2: %08x  3: %08x  4: %08x  5: %08x\n", 
                      src->ext_refcode2, src->ext_refcode3, 
                      src->ext_refcode4, src->ext_refcode5);
    len += rtas_print("6: %08x  7: %08x  8: %08x  9: %08x\n\n", 
                      src->ext_refcode6, src->ext_refcode7, 
                      src->ext_refcode8, src->ext_refcode9);

    len += print_src_refcode(src);

    if (src_subscns_included(src)) {
        if (verbosity >= 2) {
            len += rtas_print(PRNT_FMT_2, "Sub-Section ID:", src->subscn_id,
                              "Platform Data:", src->subscn_platform_data);
            len += rtas_print(PRNT_FMT_R, "Length:", src->subscn_length);
        }
    }

    len += rtas_print("\n");

    for (fru = src->fru_scns; fru != NULL; fru = fru->next) {
        len += print_re_fru_scn(fru, verbosity, count);
        count++;
    }

    return len;
}
Example #4
0
/**
 * print_fru_hdr
 * @brief print the contents of a FRU header
 *
 * @param fruhdr pointer to fru_hdr to print
 * @param verbosity verbose level
 * @returns the number of bytes printed
 */
static int
print_fru_hdr(struct rtas_fru_hdr *fruhdr, int verbosity)
{
    int len = 0;

    len += rtas_print("%-20s%c%c          "PRNT_FMT_R, "ID:", fruhdr->id[0],
                      fruhdr->id[1], "Flags:", fruhdr->flags);

    if (verbosity >= 2) 
        len += rtas_print(PRNT_FMT_R, "Length:", fruhdr->length);

    return len;
}
Example #5
0
/**
 * print_scn_title
 * @brief print the title of the RTAS event section
 *
 * @param fmt string format for section title
 * @param ... additional args a la printf()
 * @return number of characters printed
 */
int
print_scn_title(char *fmt, ...)
{
    va_list ap;
    int rspace;
    char buf[1024];
    int i, len, offset;

    memset(buf, 0, sizeof(buf));

    offset = snprintf(buf, sizeof(buf), "==== ");

    va_start(ap, fmt);
    offset += vsnprintf(buf + offset, sizeof(buf) - offset, fmt, ap);
    va_end(ap);

    offset += snprintf(buf + offset, sizeof(buf) - offset, " ");

    rspace = (rtas_print_width - (strlen(buf) + 2 + 9));
    for (i = 0; i < rspace; i++)
        offset += snprintf(buf + offset, sizeof(buf) - offset, "=");

    offset += snprintf(buf + offset, sizeof(buf) - offset, "\n");

    len = rtas_print(buf);
    
    return len; 
}
Example #6
0
/**
 * print_fru_pe_scn
 * @bried print the contents of a FRU Power Enclosure substructure
 *
 * @param fruhdr pointer to the fru_hdr of the FRU PE section to print
 * @param verbosity verbose level
 * @returns the number of bytes printed
 */
static int
print_fru_pe_scn(struct rtas_fru_hdr *fruhdr, int verbosity)
{
    struct rtas_fru_pe_scn  *fru_pe = (struct rtas_fru_pe_scn *)fruhdr;
    int len;

    len = print_scn_title("FRU PE Section");
    len += print_fru_hdr(fruhdr, verbosity);
    len += print_mtms(&fru_pe->pce_mtms);

    if (fru_pe->pce_name[0] != '\0')
        len += rtas_print("%-20s%s\n\n", "PCE Name:", fru_pe->pce_name);
    else
        len += rtas_print("\n\n");

    return len;
}
Example #7
0
/**
 * print_fru_priority
 * @brief decode the FRU prority level and print a description of it.
 *
 * @param priority
 * @returns the number of bytes printed
 */
static int
print_fru_priority(char priority)
{
    int len = 0;

    len = rtas_print("%-20s%c - ", "Priority:", priority);
    switch (priority) {
        case RTAS_FRU_PRIORITY_HIGH:
            len += rtas_print("High priority and mandatory call-out.\n");
            break;
            
        case RTAS_FRU_PRIORITY_MEDIUM:
            len += rtas_print("Medium priority.\n");
            break;
            
        case RTAS_FRU_PRIORITY_MEDIUM_A:
            len += rtas_print("Medium priority group A (1st group).\n");
            break;
            
        case RTAS_FRU_PRIORITY_MEDIUM_B:
            len += rtas_print("Medium priority group B (2nd group).\n");
            break;
            
        case RTAS_FRU_PRIORITY_MEDIUM_C:
            len += rtas_print("Medium priority group C (3rd group).\n");
            break;
            
        case RTAS_FRU_PRIORITY_LOW:
            len += rtas_print("Low Priority.\n");
            break;
    }

    return len;
}
Example #8
0
/**
 * print_v6_scn_hdr
 * @brief print the generic version 6 section header
 *
 * @param name section name
 * @param shdr rtas_v6_scn_hdr pointer
 * @param verbosity verbose level of output
 * @return number of bytes written
 */
int
print_v6_hdr(char *name, struct rtas_v6_hdr *v6hdr, int verbosity)
{
    int len;

    len = print_scn_title(name);

    if (verbosity > 1) {
        len += rtas_print("%-20s      %c%c    "PRNT_FMT_R, 
                          "Section ID:", v6hdr->id[0], v6hdr->id[1], 
                          "Section Length:", v6hdr->length);
        len += rtas_print(PRNT_FMT_2, "Version:", v6hdr->version, 
                          "Sub_type:", v6hdr->subtype);
        len += rtas_print(PRNT_FMT_R, "Component ID:", 
                          v6hdr->creator_comp_id);
    }

    return len;
}
Example #9
0
/**
 * print_usr_hdr_action
 * @brief print the RTAS User Header Section action data
 *
 * @param mainb rtas_v6_us_hdr_scn pointer
 * @return number of bytes written
 */
int
print_usr_hdr_action(struct rtas_usr_hdr_scn *usrhdr)
{
    int len = 0;

    len += rtas_print(PRNT_FMT" ", "Action Flag:", usrhdr->action);

    switch (usrhdr->action) {
        case 0x8000:
	    len += rtas_print("Service Action ");
	    if (usrhdr->action & 0x4000)
	        len += rtas_print("(hidden error) ");
	    if (usrhdr->action & 0x0800)
	        len += rtas_print("call home) ");
            len += rtas_print("Required.\n");
	    break;
            
	case 0x2000:
	    len += rtas_print("Report Externally, ");
	    if (usrhdr->action & 0x1000)
	        len += rtas_print("(HMC only).\n");
	    else
	        len += rtas_print("(HMC and Hypervisor).\n");
	    break;
            
	case 0x0400:
	    len += rtas_print("Error isolation incomplete,\n"
                              "                               "
                              "further analysis required.\n");
	    break;
            
	case 0x0000:
	    break;

	default:
	    len += rtas_print("Unknown action flag (0x%08x).\n", 
                              usrhdr->action);
    }

    return len;
}
Example #10
0
/**
 * print_re_fru_scn
 * @brief print the contents of an FRU section
 *
 * @param res rtas_event_scn pointer for a fru section
 * @param verbosity verbose level of output
 * @param count current fru section number that we are printing
 * @return number of bytes written
 */
int
print_re_fru_scn(struct rtas_fru_scn *fru, int verbosity, int count)
{
    struct rtas_fru_hdr *fruhdr;
    int len = 0;

    len += print_scn_title("FRU Section (%d)", count);

    if (verbosity >= 2) {
        len += rtas_print(PRNT_FMT_2, "Length:", fru->length, 
	                  "Call-Out Type:", fru->type);
        
        len += rtas_print("%-20s%-8s    %-20s%-8s\n", "Fru ID Included:",
                          (fru->fru_id_included) ? "Yes" : "No", 
                          "Fru Subscns:", 
                          (fru->fru_subscn_included) ? "Yes" : "No");
    }

    len += print_fru_priority(fru->priority);

    if (fru->loc_code_length) {
        if (verbosity >= 2)
            len += rtas_print(PRNT_FMT_R, "Loc Code Length:", 
                              fru->loc_code_length);
        
        len += rtas_print("%-20s%s\n", "Location Code:", fru->loc_code);
    }

    len += rtas_print("\n");

    for (fruhdr = fru->subscns; fruhdr != NULL; fruhdr = fruhdr->next) {
        if (strncmp(fruhdr->id, "ID", 2) == 0) 
            len += print_fru_id_scn(fruhdr, verbosity);
        else if (strncmp(fruhdr->id, "PE", 2) == 0)
            len += print_fru_pe_scn(fruhdr, verbosity);
        else if (strncmp(fruhdr->id, "MR", 2) == 0)
            len += print_fru_mr_scn(fruhdr, verbosity);
    }

    return len;
}
Example #11
0
/**
 * print_fru_mr_scn
 * @bried print the contents of a FRU Manufacturing Replaceable substructure
 *
 * @param fruhdr pointer to the fru_hdr of the FRU MR section to print
 * @param verbosity verbose level
 * @returns the number of bytes printed
 */
static int
print_fru_mr_scn(struct rtas_fru_hdr *fruhdr, int verbosity)
{
    struct rtas_fru_mr_scn  *fru_mr = (struct rtas_fru_mr_scn *)fruhdr;
    int i, len;

    len = print_scn_title("FRU MR Section");
    len += print_fru_hdr(fruhdr, verbosity);

    len += rtas_print("\nManufacturing Replaceable Unit Fields (%d):\n",
		      frumr_num_callouts(fru_mr));
    for (i = 0; i < frumr_num_callouts(fru_mr); i++) {
        struct fru_mru *mru = &fru_mr->mrus[i];

        len += rtas_print("%-20s%c           %-20s%08x\n", "MRU Priority:", 
			  mru->priority, "MRU ID:", mru->id);
    }

    len += rtas_print("\n");
    return len;
}
Example #12
0
/**
 * print_raw_data
 * @brief dump raw data 
 *
 * @param data pointer to data to dump
 * @param data_len length of data to dump
 * @return number of bytes written
 */ 
int
print_raw_data(char *data, int data_len)
{
    unsigned char *h, *a;
    unsigned char *end = (unsigned char *)data + data_len;
    unsigned int offset = 0;
    int i,j;
    int len = 0;

    /* make sure we're starting on a new line */
    if (line_offset != 0)
        len += rtas_print("\n");

    h = a = (unsigned char *)data;

    while (h < end) {
        /* print offset */
        len += fprintf(ostream, "0x%04x:  ", offset);
        offset += 16;

        /* print hex */
        for (i = 0; i < 4; i++) {
            for (j = 0; j < 4; j++) {
                if (h < end)
                    len += fprintf(ostream, "%02x", *h++);
                else
                    len += fprintf(ostream, "  ");
            }
            len += fprintf(ostream, " ");
        }

        /* print ascii */
        len += fprintf(ostream, "    [");
        for (i = 0; i < 16; i++) {
            if (a <= end) {
                if ((*a >= ' ') && (*a <= '~'))
                    len += fprintf(ostream, "%c", *a);
                else
                    len += fprintf(ostream, ".");
                a++;
            } else
                len += fprintf(ostream, " ");

        }
        len += fprintf(ostream, "]\n");
    }

    return len;
}
Example #13
0
/**
 * print_re_generic_scn
 *
 */
int
print_re_generic_scn(struct scn_header *shdr, int verbosity)
{
    struct rtas_v6_generic *gen;
    uint32_t len = 0;

    if (shdr->scn_id != RTAS_GENERIC_SCN) {
        errno = EFAULT;
        return 0;
    }

    gen = (struct rtas_v6_generic *)shdr;
    len += print_v6_hdr("Unknown Section", &gen->v6hdr, 2);
    len += rtas_print("\n");

    if (gen->data != NULL) {
        len += rtas_print("Raw Section Data:\n");
        len += print_raw_data(gen->data, 
                              gen->v6hdr.length - sizeof(struct rtas_v6_hdr_raw));
    }

    len += rtas_print("\n");
    return len;
}
Example #14
0
/**
 * print_src_refcode
 * @brief print a detailed description of the SRC reference code
 *
 * @param src rtas_v6_src_scn pointer
 * @return number of bytes written
 */
int
print_src_refcode(struct rtas_src_scn *src)
{
    int i, len = 0;

    len += rtas_print("%s \"", "Primary Reference Code:");
    for (i = 0; i < 32; i++) {
        if (src->primary_refcode[i] == '\0') 
            break;
        len += rtas_print("%c", src->primary_refcode[i]);
    }
    len += rtas_print("\"\n");

    i = 0;
    while (src_codes[i].desc != NULL) {
        if (strcmp(src->primary_refcode, src_codes[i].id) == 0) {
            len += rtas_print("%s\n", src_codes[i].desc);
            return len;
        }
        i++;
    }
    
    return len;
}
Example #15
0
/**
 * print_v6_dump_scn
 * @brief Print the contents of a version 6 dump locator section
 *
 * @param res rtas_event_scn pointer for dump locator section
 * @param verbosity verbose level of output
 * @return number of bytes written
 */
int
print_re_dump_scn(struct scn_header *shdr, int verbosity)
{
    struct rtas_dump_scn *dump;
    int len = 0;

    if (shdr->scn_id != RTAS_DUMP_SCN) {
        errno = EFAULT;
        return 0;
    }

    dump = (struct rtas_dump_scn *)shdr;

    len += print_v6_hdr("Dump Locator section", &dump->v6hdr, verbosity);
    len += rtas_print(PRNT_FMT_L, "Dump ID:", dump->id);

    len += rtas_print("%-20s%8s\n", "Dump Field Format:", 
                      (dump->fname_type ? "hex" : "ascii"));
    len += rtas_print("%-20s%s\n", "Dump Location:", 
                      (dump->location ? "HMC" : "Partition"));
    len += rtas_print(PRNT_FMT_ADDR, "Dump Size:", 
                      dump->size_hi, dump->size_lo);

    if (verbosity >= 2) {
        len += rtas_print("%-20s%8s    ", "Dump Size Valid:", 
                          (dump->size_valid ? "Yes" : "No"));
        len += rtas_print(PRNT_FMT_R, "Dump ID Length:", dump->id_len);
 
        if (dump->id_len) {
            len += rtas_print("Dump ID:");
            if (dump->fname_type)
                len += print_raw_data(dump->os_id, dump->id_len);
            else
                len += rtas_print("%s\n", dump->os_id);
        }
    }

    len += rtas_print("\n");
    return len;
}
Example #16
0
/**
 * print_re_hdr_scn
 * @brief Print the contents of an RTAS main event header
 *
 * @param res rtas_event_scn pointer for main RTAS event header
 * @param verbosity verbose level for output
 * @return number of bytes written
 */
int
print_re_hdr_scn(struct scn_header *shdr, int verbosity)
{
    struct rtas_event_hdr *re_hdr;
    int len = 0;

    if (shdr->scn_id != RTAS_EVENT_HDR) {
        errno = EFAULT;
        return 0;
    }    

    re_hdr = (struct rtas_event_hdr *)shdr;

    len += rtas_print(PRNT_FMT"    ", "Version:", re_hdr->version);
    len += rtas_print(PRNT_FMT" (%s)\n", "Severity:", re_hdr->severity,
                      rtas_severity_names[re_hdr->severity]);

    if (re_hdr->disposition || (verbosity >= 2)) {
        len += rtas_print(PRNT_FMT" (%s)\n", "Disposition:", 
                          re_hdr->disposition, 
                          rtas_disposition_names[re_hdr->disposition]);
    }

    if (verbosity >= 2) {
        len += rtas_print(PRNT_FMT"    ", "Extended:", re_hdr->extended);
        len += rtas_print(PRNT_FMT"\n", "Log Length:", 
                          re_hdr->ext_log_length);
    }

    if (re_hdr->initiator || verbosity >=2) {
        len += rtas_print(PRNT_FMT" (%s)\n", "Initiator", re_hdr->initiator,
                          rtas_entity_names[re_hdr->initiator]);
    }

    if (re_hdr->target || (verbosity >= 2)) {
        len += rtas_print(PRNT_FMT" (%s)\n", "Target", re_hdr->target, 
                          rtas_entity_names[re_hdr->target]);
    }

    len += rtas_print(PRNT_FMT" (%s)\n", "Type", re_hdr->type, 
                      rtas_error_type(re_hdr->type));

    return len;
}
Example #17
0
/**
 * print_re_ibm_diag_scn
 * @brief print the contents of an IBM diagnostics log section
 *
 * @param res rtas_event_scn pointer for IBM diagnostics log section
 * @param verbosity verbose level of output
 * @return number of bytes written
 */
int
print_re_ibm_diag_scn(struct scn_header *shdr, int verbosity)
{
    struct rtas_ibm_diag_scn *ibmdiag;
    int len = 0;
   
    if (shdr->scn_id != RTAS_IBM_DIAG_SCN) {
        errno = EFAULT;
        return -1;
    }

    ibmdiag = (struct rtas_ibm_diag_scn *)shdr;

    len += print_scn_title("IBM Diagnostics Section");
    len += rtas_print(PRNT_FMT"\n", "Event ID:", ibmdiag->event_id);

    return len;
}
Example #18
0
/**
 * print_re_mt_scn
 * @brief print the contents of a Machine Type section
 *
 * @param res rtas_event_scn pointer for mtms section
 * @param verbosity verbose level of output
 * @return number of bytes written
 */
int
print_re_mt_scn(struct scn_header *shdr, int verbosity)
{
    struct rtas_mt_scn *mt;
    int len = 0;

    if (shdr->scn_id != RTAS_MT_SCN) {
        errno = EFAULT;
        return 0;
    }

    mt = (struct rtas_mt_scn *)shdr;
    
    len += print_v6_hdr("Machine Type", (struct rtas_v6_hdr *)&mt->v6hdr, verbosity);
    len += print_mtms(&mt->mtms);
    len += rtas_print("\n");

    return len;
}
Example #19
0
/**
 * print_re_usr_hdr_scn
 * @brief print the contents of a RTAS User Header section
 *
 * @param res rtas_event_scn ponter
 * @param verbosity verbose level of ouput
 * @return number of bytes written
 */
int
print_re_usr_hdr_scn(struct scn_header *shdr, int verbosity)
{
    struct rtas_usr_hdr_scn *usrhdr;
    int len = 0;

    if (shdr->scn_id != RTAS_USR_HDR_SCN) {
        errno = EFAULT;
        return 0;
    }

    usrhdr = (struct rtas_usr_hdr_scn *)shdr;

    len += print_v6_hdr("User Header", &usrhdr->v6hdr, verbosity);
    len += print_usr_hdr_subsystem_id(usrhdr);
    len += print_usr_hdr_event_data(usrhdr);
    len += print_usr_hdr_action(usrhdr);

    len += rtas_print("\n");
    return len;
}
Example #20
0
/**
 * print_cpu_failure
 * @brief Print the contents of a cpu section
 *
 * @param res rtas_event_scn pointer to cpu section
 * @param verbosity verbose level of output
 * @return number of bytes written
 */
int
print_re_cpu_scn(struct scn_header *shdr, int verbosity)
{
    struct rtas_cpu_scn *cpu;
    int len = 0;

    if (shdr->scn_id != RTAS_CPU_SCN) {
        errno = EFAULT;
        return 0;
    }

    cpu = (struct rtas_cpu_scn *)shdr;

    len += print_scn_title("CPU Section");

    if (cpu->internal) 
       len += rtas_print("Internal error (not cache).\n");
    if (cpu->intcache) 
       len += rtas_print("Internal cache.\n");
    if (cpu->extcache_parity) 
       len += rtas_print("External cache parity (or multi-bit).\n");
    if (cpu->extcache_ecc) 
       len += rtas_print("External cache ECC.\n");
    if (cpu->sysbus_timeout) 
       len += rtas_print("System bus timeout.\n");
    if (cpu->io_timeout) 
       len += rtas_print("I/O timeout.\n");
    if (cpu->sysbus_parity) 
       len += rtas_print("System bus parity.\n");
    if (cpu->sysbus_protocol) 
       len += rtas_print("System bus protocol/transfer.\n");

    len += rtas_print(PRNT_FMT_2, "CPU id:", cpu->id,
                      "Failing Element:", cpu->element);
    
    len += rtas_print(PRNT_FMT_ADDR, "Failing address:", 
	              cpu->failing_address_hi, 
                      cpu->failing_address_lo);
    
    if ((shdr->re->version >= 4) && (cpu->try_reboot))
	len += rtas_print("A reboot of the system may correct the problem.\n");

    len += rtas_print("\n");
    return len;
}
Example #21
0
/**
 * print_re_exthdr_scn
 * @brief print the contents of the RTAS extended header section
 *
 * @param res rtas_event_scn pointer for the extended header
 * @param verbosity verbose level of output
 * @return number of bytes written
 */
int
print_re_exthdr_scn(struct scn_header *shdr, int verbosity)
{
    struct rtas_event_exthdr *rex_hdr;
    int len = 0;
    int version;

    if (shdr->scn_id != RTAS_EVENT_EXT_HDR) {
        errno = EFAULT;
        return 0;
    }    

    rex_hdr = (struct rtas_event_exthdr *)shdr;
    version = shdr->re->version;

    if (!rex_hdr->valid) {
        if (rex_hdr->bigendian && rex_hdr->power_pc)
            len += rtas_print("Extended log data is not valid.\n\n");
        else
            len += rtas_print("Extended log data can not be decoded.\n\n");

        return len;
    }

    /* Dump useful stuff in the rex_hdr */
    len += rtas_print("%-19s%s%s%s%s%s\n", "Status:",
                      rex_hdr->unrecoverable ? " unrecoverable" : "",
                      rex_hdr->recoverable ? " recoverable" : "",
                      rex_hdr->unrecoverable_bypassed ? " bypassed" : "",
                      rex_hdr->predictive ? " predictive" : "",
                      rex_hdr->newlog ? " new" : "");

    if (version < 6) {
        if (version >= 3) {
            if (rex_hdr->non_hardware)
                len += rtas_print("Error may be caused by defects in " 
                                  "software or firmware.\n");
            if (rex_hdr->hot_plug)
                len += rtas_print("Error is isolated to hot-pluggable unit.\n");
            if (rex_hdr->group_failure)
                len += rtas_print("Error is isolated to a group of failing "
                                  "units.\n");
        }

        if (rex_hdr->residual)
            len += rtas_print("Residual error from previous boot.\n");
        if (rex_hdr->boot)
            len += rtas_print("Error detected during IPL process.\n");
        if (rex_hdr->config_change)
            len += rtas_print("Configuration changed since last boot.\n");
        if (rex_hdr->post)
            len += rtas_print("Error detected prior to IPL.\n");

	len += rtas_print("%-20s%x/%x/%x  %-20s%x:%x:%x:%x\n\n", "Date:",
			  rex_hdr->date.year, rex_hdr->date.month, 
			  rex_hdr->date.day, "Time:", rex_hdr->time.hour, 
			  rex_hdr->time.minutes, rex_hdr->time.seconds,
			  rex_hdr->time.hundredths);
    } 
    else {
        rtas_print("\n");
    }

    return len;
}
Example #22
0
/**
 * print_re_priv_hdr_scn
 * @brief print the RTAS private header section
 *
 * @param res rtas_event_scn pointer to main a section
 * @param verbosity verbose level of output
 * @return number of bytes written
 */
int
print_re_priv_hdr_scn(struct scn_header *shdr, int verbosity)
{
    struct rtas_priv_hdr_scn *privhdr;
    int len = 0;

    if (shdr->scn_id != RTAS_PRIV_HDR_SCN) {
        errno = EFAULT;
        return 0;
    }

    privhdr = (struct rtas_priv_hdr_scn *)shdr;

    len += print_v6_hdr("Private Header", &privhdr->v6hdr, verbosity);
    
    len += rtas_print("%-20s%x %s %x\n", "Date:", privhdr->date.day,
                      months[privhdr->date.month], privhdr->date.year);
    len += rtas_print("%-20s%x:%x:%x:%x\n", "Time:", 
                      privhdr->time.hour, privhdr->time.minutes, 
                      privhdr->time.seconds, privhdr->time.hundredths);

    len += rtas_print("%-20s", "Creator ID:");
    switch(privhdr->creator_id) {
        case 'C':
            len += rtas_print("Hardware Management Console");
            break;
            
        case 'E':
	    len += rtas_print("Service Processor");
	    break;
            
        case 'H':
	    len += rtas_print("PHyp");
	    break;
            
        case 'W':
	    len += rtas_print("Power Control");
	    break;
            
        case 'L':
	    len += rtas_print("Partition Firmware");
	    break;

        case 'S':
            len += rtas_print("SLIC");
            break;

        default:
            len += rtas_print("Unknown");
            break;
    }
    len += rtas_print(" (%c).\n", privhdr->creator_id);
    
    if (verbosity >= 2)
        len += rtas_print(PRNT_FMT_R, "Section Count:", privhdr->scn_count); 
   
    if (privhdr->creator_id == 'E')
        len += rtas_print("Creator Subsystem Name: %s.\n", 
                          privhdr->creator_subid_name);
    else
        len += rtas_print("Creator Subsystem Version: %08x%08x.\n",
                          privhdr->creator_subid_hi, privhdr->creator_subid_lo);

    len += rtas_print(PRNT_FMT_2, "Platform Log ID:", privhdr->plid,
                      "Log Entry ID:", privhdr->log_entry_id);

    len += rtas_print("\n");
    
    return len;
}
Example #23
0
/**
 * print_usr_hdr_subsystem_id
 * @brief Print the subsystem id from the Main B section
 *
 * @param mainb rtas_v6_main_b_scn pointer
 * @return number of bytes written
 */
int
print_usr_hdr_subsystem_id(struct rtas_usr_hdr_scn *usrhdr)
{
    unsigned int id = usrhdr->subsystem_id;
    int len = 0;

    len += rtas_print(PRNT_FMT" ", "Subsystem ID:", id);
    
    if ((id >= 0x10) && (id <= 0x1F))
        len += rtas_print("(Processor, including internal cache)\n"); 
    else if ((id >= 0x20) && (id <= 0x2F))
        len += rtas_print("(Memory, including external cache)\n");
    else if ((id >= 0x30) && (id <= 0x3F))
        len += rtas_print("(I/O (hub, bridge, bus))\n");
    else if ((id >= 0x40) && (id <= 0x4F))
        len += rtas_print("(I/O adapter, device and peripheral)\n"); 
    else if ((id >= 0x50) && (id <= 0x5F))
        len += rtas_print("(CEC Hardware)\n");
    else if ((id >= 0x60) && (id <= 0x6F))
        len += rtas_print("(Power/Cooling System)\n");
    else if ((id >= 0x70) && (id <= 0x79))
        len += rtas_print("(Other Subsystems)\n");
    else if ((id >= 0x7A) && (id <= 0x7F))
        len += rtas_print("(Surveillance Error)\n");
    else if ((id >= 0x80) && (id <= 0x8F))
        len += rtas_print("(Platform Firmware)\n");
    else if ((id >= 0x90) && (id <= 0x9F))
        len += rtas_print("(Software)\n");
    else if ((id >= 0xA0) && (id <= 0xAF))
        len += rtas_print("(External Environment)\n");
    else
        len += rtas_print("\n");

    return len;
}
Example #24
0
/**
 * print_usr_hdr_event
 * @brief print the RTAS User Header section type data
 *
 * @param mainb rtas_usr_hdr_scn pointer
 * @return number of bytes written
 */
int
print_usr_hdr_event_data(struct rtas_usr_hdr_scn *usrhdr)
{
    int len = 0;

    len += rtas_print(PRNT_FMT_R, "Event Data", usrhdr->event_data);
    len += rtas_print("\n"PRNT_FMT_R, "Event Type:", usrhdr->event_type);
    
    switch (usrhdr->event_type) {
        case 0x01:
	    len += rtas_print("Miscellaneous, informational only.\n");
            break;
	case 0x08:
	    len += rtas_print("Dump notification.\n");
            break;
	case 0x10:
	    len += rtas_print("Previously reported error has been "
                              "corrected by system.\n");
            break;
	case 0x20:
	    len += rtas_print("System resources manually "
                              "deconfigured by user.\n");
            break;
	case 0x21:
	    len += rtas_print("System resources deconfigured by system due"
                              "to prior error event.\n");
            break;
	case 0x22:
	    len += rtas_print("Resource deallocation event notification.\n");
            break;
	case 0x30:
	    len += rtas_print("Customer environmental problem has "
                              "returned to normal.\n");
            break;
	case 0x40:
	    len += rtas_print("Concurrent maintenance event.\n");
            break;
	case 0x60:
	    len += rtas_print("Capacity upgrade event.\n");
            break;
	case 0x70:
	    len += rtas_print("Resource sparing event.\n");
            break;
	case 0x80:
	    len += rtas_print("Dynamic reconfiguration event.\n");
            break;
	case 0xD0:
	    len += rtas_print("Normal system/platform shutdown "
                              "or powered off.\n");
            break;
	case 0xE0:
	    len += rtas_print("Platform powered off by user without normal "
                              "shutdown.\n");
            break;
        default:
	    len += rtas_print("Unknown event type (%d).\n", usrhdr->event_type);
            break;
    }
    
    len += rtas_print("\n"PRNT_FMT_R, "Event Severity:", 
                      usrhdr->event_severity);
    switch (usrhdr->event_severity) {
        case 0x00:
            len += rtas_print("Informational or non-error event,\n");
            break;
	case 0x10:
	    len += rtas_print("Recovered error, general.\n");
	    break;
	case 0x20:
	    len += rtas_print("Predictive error, general.\n");
	    break;
	case 0x21:
	    len += rtas_print("Predictive error, degraded performance.\n");
	    break;
	case 0x22:
	    len += rtas_print("Predictive error, fault may be corrected "
                              "after platform re-IPL.\n");
	    break;
	case 0x23:
	    len += rtas_print("Predictive Error, fault may be corrected "
                              "after IPL, degraded performance.\n");
	    break;
	case 0x24:
	    len += rtas_print("Predictive error, loss of redundancy.\n");
	    break;
	case 0x40:
	    len += rtas_print("Unrecoverable error, general.\n");
	    break;
	case 0x41:
	    len += rtas_print("Unrecoverable error, bypassed with "
                              "degraded performance.\n");
	    break;
	case 0x44:
	    len += rtas_print("Unrecoverable error, bypassed with "
                              "loss of redundancy.\n");
	    break;
	case 0x45:
	    len += rtas_print("Unrecoverable error, bypassed with loss of\n" 
                              "redundancy and performance.\n");
            break;
	case 0x48:
	    len += rtas_print("Unrecoverable error, bypassed with "
                              "loss of function.\n");
            break;
	case 0x60:
	    len += rtas_print("Error on diagnostic test, general.\n");
            break;
	case 0x61:
	    len += rtas_print("Error on diagnostic test, resource may "
                              "produce incorrect results.\n");
            break;
	default:
	    len += rtas_print("Unknown event severity (%d).\n",
                              usrhdr->event_type);
            break;
    }

    len += rtas_print("\n");
    return len;
}
Example #25
0
/**
 * print_fru_id_scn
 * @bried print the contents of a FRU Identity substructure
 *
 * @param fruhdr pointer to the fru_hdr of the FRU ID section to print
 * @param verbosity verbose level
 * @returns the number of bytes printed
 */
static int
print_fru_id_scn(struct rtas_fru_hdr *fruhdr, int verbosity)
{
    struct rtas_fru_id_scn  *fru_id = (struct rtas_fru_id_scn *)fruhdr;
    int len;
    uint32_t component;

    len = print_scn_title("FRU ID Section");
    len += print_fru_hdr(fruhdr, verbosity);

    component = fru_id->fruhdr.flags & RTAS_FRUID_COMP_MASK;

    if (component) {
        len += rtas_print(PRNT_FMT" ", "Failing Component:", component);
            
        switch (component) {
            case RTAS_FRUID_COMP_HARDWARE:
                len += rtas_print("(\"normal\" hardware FRU)\n");
                break;
                
            case RTAS_FRUID_COMP_CODE:
                len += rtas_print("(Code FRU)\n");
                break;
                
            case RTAS_FRUID_COMP_CONFIG_ERROR:
                len += rtas_print("(Configuration error)\n");
                break;
                
            case RTAS_FRUID_COMP_MAINT_REQUIRED:
                len += rtas_print("(Mainteneace procedure required)\n");
                break;
                
            case RTAS_FRUID_COMP_EXTERNAL: 
                len += rtas_print("(External FRU)\n");
                break;
                
            case RTAS_FRUID_COMP_EXTERNAL_CODE:
                len += rtas_print("(External Code FRU)\n");
                break;
                
            case RTAS_FRUID_COMP_TOOL:
                len += rtas_print("(Tool FRU)\n");
                break;
                
            case RTAS_FRUID_COMP_SYMBOLIC:
                len += rtas_print("(Symbolic FRU)\n");
                break;
                
            default:
                len += rtas_print("\n");
                break;
        }
    }

    if (fruid_has_part_no(fru_id))
        len += rtas_print("%-20s%s\n", "FRU Stocking Part:", fru_id->part_no);

    if (fruid_has_proc_id(fru_id))
        len += rtas_print("%-20s%s\n", "Procedure ID:", fru_id->procedure_id);

    if (fruid_has_ccin(fru_id))
        len += rtas_print("%-20s%s\n", "CCIN:", fru_id->ccin);

    if (fruid_has_serial_no(fru_id))
        len += rtas_print("%-20s%s\n", "Serial Number:", fru_id->serial_no);

    len += rtas_print("\n");
    return len;
}