[Skiboot] [PATCH v2 05/12] hdat: Grab system model name from HDAT when available
Stewart Smith
stewart at linux.vnet.ibm.com
Tue Dec 20 17:04:51 AEDT 2016
Vasant Hegde <hegdevasant at linux.vnet.ibm.com> writes:
> --- a/hdata/vpd.c
> +++ b/hdata/vpd.c
> @@ -598,6 +598,36 @@ struct dt_node *dt_add_vpd_node(const struct HDIF_common_hdr *hdr,
> return node;
> }
>
> +static void dt_add_model_name(char *model)
> +{
> + const struct machine_info *mi;
> + const struct iplparams_sysparams *p;
> + const struct HDIF_common_hdr *iplp;
> +
> + iplp = get_hdif(&spira.ntuples.ipl_parms, "IPLPMS");
> + if (!iplp)
> + goto def_model;
> +
> + p = HDIF_get_idata(iplp, IPLPARAMS_SYSPARAMS, NULL);
> + if (!CHECK_SPPTR(p))
> + goto def_model;
> +
> + if (proc_gen >= proc_gen_p9) {
> + dt_add_property_string(dt_root,
> + "model-name", p->sys_type_str);
> + return;
> + }
Is there just an empty string otherwise? Why not fall through if there's
an empty string instead? or check version?
> +
> +def_model:
> + mi = machine_info_lookup(model);
> + if (mi) {
> + dt_add_property_string(dt_root, "model-name", mi->name);
> + } else {
> + dt_add_property_string(dt_root, "model-name", "Unknown");
> + prlog(PR_WARNING, "VPD: Model name %s not known\n", model);
> + }
> +}
> +
--
Stewart Smith
OPAL Architect, IBM.
More information about the Skiboot
mailing list