3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22 /*
23 * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
25 */
26
27 /*
28 * SMBIOS Information Routines
29 *
30 * The routines in this file are used to convert from the SMBIOS data format to
31 * a more reasonable and stable set of structures offered as part of our ABI.
32 * These functions take the general form:
33 *
34 * stp = smb_lookup_type(shp, foo);
35 * smb_foo_t foo;
36 *
37 * smb_info_bcopy(stp->smbst_hdr, &foo, sizeof (foo));
38 * bzero(caller's struct);
39 *
40 * copy/convert foo members into caller's struct
41 *
42 * We copy the internal structure on to an automatic variable so as to avoid
394 return (-1); /* errno is set for us */
395
396 if (stp->smbst_hdr->smbh_type != SMB_TYPE_BASEBOARD)
397 return (smb_set_errno(shp, ESMB_TYPE));
398
399 smb_info_bcopy(stp->smbst_hdr, &bb, sizeof (bb));
400 bzero(bbp, sizeof (smbios_bboard_t));
401
402 bbp->smbb_chassis = bb.smbbb_chassis;
403 bbp->smbb_flags = bb.smbbb_flags;
404 bbp->smbb_type = bb.smbbb_type;
405 bbp->smbb_contn = bb.smbbb_cn;
406
407 return (0);
408 }
409
410 int
411 smbios_info_chassis(smbios_hdl_t *shp, id_t id, smbios_chassis_t *chp)
412 {
413 const smb_struct_t *stp = smb_lookup_id(shp, id);
414 smb_chassis_t ch;
415
416 if (stp == NULL)
417 return (-1); /* errno is set for us */
418
419 if (stp->smbst_hdr->smbh_type != SMB_TYPE_CHASSIS)
420 return (smb_set_errno(shp, ESMB_TYPE));
421
422 smb_info_bcopy(stp->smbst_hdr, &ch, sizeof (ch));
423 bzero(chp, sizeof (smbios_chassis_t));
424
425 chp->smbc_oemdata = ch.smbch_oemdata;
426 chp->smbc_lock = (ch.smbch_type & SMB_CHT_LOCK) != 0;
427 chp->smbc_type = ch.smbch_type & ~SMB_CHT_LOCK;
428 chp->smbc_bustate = ch.smbch_bustate;
429 chp->smbc_psstate = ch.smbch_psstate;
430 chp->smbc_thstate = ch.smbch_thstate;
431 chp->smbc_security = ch.smbch_security;
432 chp->smbc_uheight = ch.smbch_uheight;
433 chp->smbc_cords = ch.smbch_cords;
434 chp->smbc_elems = ch.smbch_cn;
435 chp->smbc_elemlen = ch.smbch_cm;
436
437 return (0);
438 }
439
440 int
441 smbios_info_processor(smbios_hdl_t *shp, id_t id, smbios_processor_t *pp)
442 {
443 const smb_struct_t *stp = smb_lookup_id(shp, id);
444 smb_processor_t p;
445
446 if (stp == NULL)
447 return (-1); /* errno is set for us */
448
449 if (stp->smbst_hdr->smbh_type != SMB_TYPE_PROCESSOR)
450 return (smb_set_errno(shp, ESMB_TYPE));
451
452 smb_info_bcopy(stp->smbst_hdr, &p, sizeof (p));
453 bzero(pp, sizeof (smbios_processor_t));
454
455 pp->smbp_cpuid = p.smbpr_cpuid;
456 pp->smbp_type = p.smbpr_type;
457 pp->smbp_family = p.smbpr_family;
458 pp->smbp_voltage = p.smbpr_voltage;
459 pp->smbp_maxspeed = p.smbpr_maxspeed;
460 pp->smbp_curspeed = p.smbpr_curspeed;
461 pp->smbp_status = p.smbpr_status;
462 pp->smbp_upgrade = p.smbpr_upgrade;
463 pp->smbp_l1cache = p.smbpr_l1cache;
464 pp->smbp_l2cache = p.smbpr_l2cache;
465 pp->smbp_l3cache = p.smbpr_l3cache;
466
467 return (0);
468 }
469
470 int
471 smbios_info_cache(smbios_hdl_t *shp, id_t id, smbios_cache_t *cap)
472 {
473 const smb_struct_t *stp = smb_lookup_id(shp, id);
474 smb_cache_t c;
475
476 if (stp == NULL)
477 return (-1); /* errno is set for us */
478
479 if (stp->smbst_hdr->smbh_type != SMB_TYPE_CACHE)
480 return (smb_set_errno(shp, ESMB_TYPE));
481
482 smb_info_bcopy(stp->smbst_hdr, &c, sizeof (c));
483 bzero(cap, sizeof (smbios_cache_t));
484
485 cap->smba_maxsize = SMB_CACHE_SIZE(c.smbca_maxsize);
486 cap->smba_size = SMB_CACHE_SIZE(c.smbca_size);
701 const smb_struct_t *stp = smb_lookup_id(shp, id);
702 smb_memarray_t m;
703
704 if (stp == NULL)
705 return (-1); /* errno is set for us */
706
707 if (stp->smbst_hdr->smbh_type != SMB_TYPE_MEMARRAY)
708 return (smb_set_errno(shp, ESMB_TYPE));
709
710 smb_info_bcopy(stp->smbst_hdr, &m, sizeof (m));
711 bzero(map, sizeof (smbios_memarray_t));
712
713 map->smbma_location = m.smbmarr_loc;
714 map->smbma_use = m.smbmarr_use;
715 map->smbma_ecc = m.smbmarr_ecc;
716 map->smbma_ndevs = m.smbmarr_ndevs;
717 map->smbma_err = m.smbmarr_err;
718
719 if (m.smbmarr_cap != 0x80000000)
720 map->smbma_size = (uint64_t)m.smbmarr_cap * 1024;
721 else
722 map->smbma_size = 0; /* unknown */
723
724 return (0);
725 }
726
727 int
728 smbios_info_memarrmap(smbios_hdl_t *shp, id_t id, smbios_memarrmap_t *map)
729 {
730 const smb_struct_t *stp = smb_lookup_id(shp, id);
731 smb_memarrmap_t m;
732
733 if (stp == NULL)
734 return (-1); /* errno is set for us */
735
736 if (stp->smbst_hdr->smbh_type != SMB_TYPE_MEMARRAYMAP)
737 return (smb_set_errno(shp, ESMB_TYPE));
738
739 smb_info_bcopy(stp->smbst_hdr, &m, sizeof (m));
740 bzero(map, sizeof (smbios_memarrmap_t));
741
742 map->smbmam_array = m.smbamap_array;
743 map->smbmam_width = m.smbamap_width;
744 map->smbmam_addr = (uint64_t)m.smbamap_start * 1024;
745 map->smbmam_size = (uint64_t)
746 (m.smbamap_end - m.smbamap_start + 1) * 1024;
747
748 return (0);
749 }
750
751 int
752 smbios_info_memdevice(smbios_hdl_t *shp, id_t id, smbios_memdevice_t *mdp)
753 {
754 const smb_struct_t *stp = smb_lookup_id(shp, id);
755 smb_memdevice_t m;
756
757 if (stp == NULL)
758 return (-1); /* errno is set for us */
759
760 if (stp->smbst_hdr->smbh_type != SMB_TYPE_MEMDEVICE)
761 return (smb_set_errno(shp, ESMB_TYPE));
762
763 smb_info_bcopy(stp->smbst_hdr, &m, sizeof (m));
764 bzero(mdp, sizeof (smbios_memdevice_t));
765
766 mdp->smbmd_array = m.smbmdev_array;
767 mdp->smbmd_error = m.smbmdev_error;
768 mdp->smbmd_twidth = m.smbmdev_twidth == 0xFFFF ? -1U : m.smbmdev_twidth;
769 mdp->smbmd_dwidth = m.smbmdev_dwidth == 0xFFFF ? -1U : m.smbmdev_dwidth;
770
771 if (mdp->smbmd_size != 0xFFFF) {
772 mdp->smbmd_size = (uint64_t)(m.smbmdev_size & ~SMB_MDS_KBYTES);
773 if (m.smbmdev_size & SMB_MDS_KBYTES)
774 mdp->smbmd_size *= 1024;
775 else
776 mdp->smbmd_size *= 1024 * 1024;
777 } else
778 mdp->smbmd_size = -1ULL; /* size unknown */
779
780 mdp->smbmd_form = m.smbmdev_form;
781 mdp->smbmd_set = m.smbmdev_set;
782 mdp->smbmd_type = m.smbmdev_type;
783 mdp->smbmd_flags = m.smbmdev_flags;
784 mdp->smbmd_dloc = smb_strptr(stp, m.smbmdev_dloc);
785 mdp->smbmd_bloc = smb_strptr(stp, m.smbmdev_bloc);
786
787 if (m.smbmdev_speed != 0)
788 mdp->smbmd_speed = 1000 / m.smbmdev_speed; /* MHz -> nsec */
789
790 return (0);
791 }
792
793 int
794 smbios_info_memdevmap(smbios_hdl_t *shp, id_t id, smbios_memdevmap_t *mdp)
795 {
796 const smb_struct_t *stp = smb_lookup_id(shp, id);
797 smb_memdevmap_t m;
798
799 if (stp == NULL)
800 return (-1); /* errno is set for us */
801
802 if (stp->smbst_hdr->smbh_type != SMB_TYPE_MEMDEVICEMAP)
803 return (smb_set_errno(shp, ESMB_TYPE));
804
805 smb_info_bcopy(stp->smbst_hdr, &m, sizeof (m));
806 bzero(mdp, sizeof (smbios_memdevmap_t));
807
808 mdp->smbmdm_device = m.smbdmap_device;
809 mdp->smbmdm_arrmap = m.smbdmap_array;
810 mdp->smbmdm_addr = (uint64_t)m.smbdmap_start * 1024;
811 mdp->smbmdm_size = (uint64_t)
812 (m.smbdmap_end - m.smbdmap_start + 1) * 1024;
813 mdp->smbmdm_rpos = m.smbdmap_rpos;
814 mdp->smbmdm_ipos = m.smbdmap_ipos;
815 mdp->smbmdm_idepth = m.smbdmap_idepth;
816
817 return (0);
818 }
819
820 id_t
821 smbios_info_hwsec(smbios_hdl_t *shp, smbios_hwsec_t *hsp)
822 {
823 const smb_struct_t *stp = smb_lookup_type(shp, SMB_TYPE_SECURITY);
824 smb_hwsec_t hs;
825
826 if (stp == NULL)
827 return (-1); /* errno is set for us */
828
829 smb_info_bcopy(stp->smbst_hdr, &hs, sizeof (hs));
830 bzero(hsp, sizeof (smbios_hwsec_t));
831
832 hsp->smbh_pwr_ps = SMB_HWS_PWR_PS(hs.smbhs_settings);
833 hsp->smbh_kbd_ps = SMB_HWS_KBD_PS(hs.smbhs_settings);
834 hsp->smbh_adm_ps = SMB_HWS_ADM_PS(hs.smbhs_settings);
835 hsp->smbh_pan_ps = SMB_HWS_PAN_PS(hs.smbhs_settings);
836
|
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22 /*
23 * Copyright 2015 OmniTI Computer Consulting, Inc. All rights reserved.
24 * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
25 * Use is subject to license terms.
26 */
27
28 /*
29 * SMBIOS Information Routines
30 *
31 * The routines in this file are used to convert from the SMBIOS data format to
32 * a more reasonable and stable set of structures offered as part of our ABI.
33 * These functions take the general form:
34 *
35 * stp = smb_lookup_type(shp, foo);
36 * smb_foo_t foo;
37 *
38 * smb_info_bcopy(stp->smbst_hdr, &foo, sizeof (foo));
39 * bzero(caller's struct);
40 *
41 * copy/convert foo members into caller's struct
42 *
43 * We copy the internal structure on to an automatic variable so as to avoid
395 return (-1); /* errno is set for us */
396
397 if (stp->smbst_hdr->smbh_type != SMB_TYPE_BASEBOARD)
398 return (smb_set_errno(shp, ESMB_TYPE));
399
400 smb_info_bcopy(stp->smbst_hdr, &bb, sizeof (bb));
401 bzero(bbp, sizeof (smbios_bboard_t));
402
403 bbp->smbb_chassis = bb.smbbb_chassis;
404 bbp->smbb_flags = bb.smbbb_flags;
405 bbp->smbb_type = bb.smbbb_type;
406 bbp->smbb_contn = bb.smbbb_cn;
407
408 return (0);
409 }
410
411 int
412 smbios_info_chassis(smbios_hdl_t *shp, id_t id, smbios_chassis_t *chp)
413 {
414 const smb_struct_t *stp = smb_lookup_id(shp, id);
415 /* Length is measurable by one byte, so it'll be no more than 255. */
416 uint8_t buf[256];
417 smb_chassis_t *ch = (smb_chassis_t *)&buf[0];
418
419 if (stp == NULL)
420 return (-1); /* errno is set for us */
421
422 if (stp->smbst_hdr->smbh_type != SMB_TYPE_CHASSIS)
423 return (smb_set_errno(shp, ESMB_TYPE));
424
425 smb_info_bcopy(stp->smbst_hdr, ch, sizeof (buf));
426 bzero(chp, sizeof (smbios_chassis_t));
427
428 chp->smbc_oemdata = ch->smbch_oemdata;
429 chp->smbc_lock = (ch->smbch_type & SMB_CHT_LOCK) != 0;
430 chp->smbc_type = ch->smbch_type & ~SMB_CHT_LOCK;
431 chp->smbc_bustate = ch->smbch_bustate;
432 chp->smbc_psstate = ch->smbch_psstate;
433 chp->smbc_thstate = ch->smbch_thstate;
434 chp->smbc_security = ch->smbch_security;
435 chp->smbc_uheight = ch->smbch_uheight;
436 chp->smbc_cords = ch->smbch_cords;
437 chp->smbc_elems = ch->smbch_cn;
438 chp->smbc_elemlen = ch->smbch_cm;
439
440 if (shp->sh_smbvers >= SMB_VERSION_27) {
441 (void) strlcpy(chp->smbc_sku, SMB_CH_SKU(ch),
442 sizeof (chp->smbc_sku));
443 }
444
445 return (0);
446 }
447
448 int
449 smbios_info_processor(smbios_hdl_t *shp, id_t id, smbios_processor_t *pp)
450 {
451 const smb_struct_t *stp = smb_lookup_id(shp, id);
452 smb_processor_t p;
453
454 if (stp == NULL)
455 return (-1); /* errno is set for us */
456
457 if (stp->smbst_hdr->smbh_type != SMB_TYPE_PROCESSOR)
458 return (smb_set_errno(shp, ESMB_TYPE));
459
460 smb_info_bcopy(stp->smbst_hdr, &p, sizeof (p));
461 bzero(pp, sizeof (smbios_processor_t));
462
463 pp->smbp_cpuid = p.smbpr_cpuid;
464 pp->smbp_type = p.smbpr_type;
465 pp->smbp_family = p.smbpr_family;
466 pp->smbp_voltage = p.smbpr_voltage;
467 pp->smbp_maxspeed = p.smbpr_maxspeed;
468 pp->smbp_curspeed = p.smbpr_curspeed;
469 pp->smbp_status = p.smbpr_status;
470 pp->smbp_upgrade = p.smbpr_upgrade;
471 pp->smbp_l1cache = p.smbpr_l1cache;
472 pp->smbp_l2cache = p.smbpr_l2cache;
473 pp->smbp_l3cache = p.smbpr_l3cache;
474
475 if (shp->sh_smbvers >= SMB_VERSION_25) {
476 pp->smbp_corecount = p.smbpr_corecount;
477 pp->smbp_coresenabled = p.smbpr_coresenabled;
478 pp->smbp_threadcount = p.smbpr_threadcount;
479 pp->smbp_cflags = p.smbpr_cflags;
480 }
481
482 if (shp->sh_smbvers >= SMB_VERSION_26)
483 pp->smbp_family2 = p.smbpr_family2;
484
485 return (0);
486 }
487
488 int
489 smbios_info_cache(smbios_hdl_t *shp, id_t id, smbios_cache_t *cap)
490 {
491 const smb_struct_t *stp = smb_lookup_id(shp, id);
492 smb_cache_t c;
493
494 if (stp == NULL)
495 return (-1); /* errno is set for us */
496
497 if (stp->smbst_hdr->smbh_type != SMB_TYPE_CACHE)
498 return (smb_set_errno(shp, ESMB_TYPE));
499
500 smb_info_bcopy(stp->smbst_hdr, &c, sizeof (c));
501 bzero(cap, sizeof (smbios_cache_t));
502
503 cap->smba_maxsize = SMB_CACHE_SIZE(c.smbca_maxsize);
504 cap->smba_size = SMB_CACHE_SIZE(c.smbca_size);
719 const smb_struct_t *stp = smb_lookup_id(shp, id);
720 smb_memarray_t m;
721
722 if (stp == NULL)
723 return (-1); /* errno is set for us */
724
725 if (stp->smbst_hdr->smbh_type != SMB_TYPE_MEMARRAY)
726 return (smb_set_errno(shp, ESMB_TYPE));
727
728 smb_info_bcopy(stp->smbst_hdr, &m, sizeof (m));
729 bzero(map, sizeof (smbios_memarray_t));
730
731 map->smbma_location = m.smbmarr_loc;
732 map->smbma_use = m.smbmarr_use;
733 map->smbma_ecc = m.smbmarr_ecc;
734 map->smbma_ndevs = m.smbmarr_ndevs;
735 map->smbma_err = m.smbmarr_err;
736
737 if (m.smbmarr_cap != 0x80000000)
738 map->smbma_size = (uint64_t)m.smbmarr_cap * 1024;
739 else if (m.smbmarr_extcap != 0)
740 map->smbma_size = m.smbmarr_extcap;
741 else
742 map->smbma_size = 0; /* unknown */
743
744 return (0);
745 }
746
747 int
748 smbios_info_memarrmap(smbios_hdl_t *shp, id_t id, smbios_memarrmap_t *map)
749 {
750 const smb_struct_t *stp = smb_lookup_id(shp, id);
751 smb_memarrmap_t m;
752
753 if (stp == NULL)
754 return (-1); /* errno is set for us */
755
756 if (stp->smbst_hdr->smbh_type != SMB_TYPE_MEMARRAYMAP)
757 return (smb_set_errno(shp, ESMB_TYPE));
758
759 smb_info_bcopy(stp->smbst_hdr, &m, sizeof (m));
760 bzero(map, sizeof (smbios_memarrmap_t));
761
762 map->smbmam_array = m.smbamap_array;
763 map->smbmam_width = m.smbamap_width;
764
765 if (m.smbamap_start != 0xFFFFFFFF && m.smbamap_end != 0xFFFFFFFF) {
766 map->smbmam_addr = (uint64_t)m.smbamap_start * 1024;
767 map->smbmam_size = (uint64_t)
768 (m.smbamap_end - m.smbamap_start + 1) * 1024;
769 } else if (m.smbamap_extstart != 0 && m.smbamap_extend != 0) {
770 map->smbmam_addr = m.smbamap_extstart;
771 map->smbmam_size = m.smbamap_extend - m.smbamap_extstart + 1;
772 }
773
774 return (0);
775 }
776
777 int
778 smbios_info_memdevice(smbios_hdl_t *shp, id_t id, smbios_memdevice_t *mdp)
779 {
780 const smb_struct_t *stp = smb_lookup_id(shp, id);
781 smb_memdevice_t m;
782
783 if (stp == NULL)
784 return (-1); /* errno is set for us */
785
786 if (stp->smbst_hdr->smbh_type != SMB_TYPE_MEMDEVICE)
787 return (smb_set_errno(shp, ESMB_TYPE));
788
789 smb_info_bcopy(stp->smbst_hdr, &m, sizeof (m));
790 bzero(mdp, sizeof (smbios_memdevice_t));
791
792 mdp->smbmd_array = m.smbmdev_array;
793 mdp->smbmd_error = m.smbmdev_error;
794 mdp->smbmd_twidth = m.smbmdev_twidth == 0xFFFF ? -1U : m.smbmdev_twidth;
795 mdp->smbmd_dwidth = m.smbmdev_dwidth == 0xFFFF ? -1U : m.smbmdev_dwidth;
796
797 if (m.smbmdev_size == 0x7FFF) {
798 mdp->smbmd_size = (uint64_t)m.smbmdev_extsize;
799 mdp->smbmd_size *= 1024 * 1024; /* convert MB to bytes */
800 } else if (m.smbmdev_size != 0xFFFF) {
801 mdp->smbmd_size = (uint64_t)(m.smbmdev_size & ~SMB_MDS_KBYTES);
802 if (m.smbmdev_size & SMB_MDS_KBYTES)
803 mdp->smbmd_size *= 1024;
804 else
805 mdp->smbmd_size *= 1024 * 1024;
806 } else
807 mdp->smbmd_size = -1ULL; /* size unknown */
808
809 mdp->smbmd_form = m.smbmdev_form;
810 mdp->smbmd_set = m.smbmdev_set;
811 mdp->smbmd_type = m.smbmdev_type;
812 mdp->smbmd_speed = m.smbmdev_speed;
813 mdp->smbmd_flags = m.smbmdev_flags;
814 mdp->smbmd_dloc = smb_strptr(stp, m.smbmdev_dloc);
815 mdp->smbmd_bloc = smb_strptr(stp, m.smbmdev_bloc);
816
817 if (shp->sh_smbvers >= SMB_VERSION_26)
818 mdp->smbmd_rank = m.smbmdev_attrs & 0x0F;
819
820 if (shp->sh_smbvers >= SMB_VERSION_27)
821 mdp->smbmd_clkspeed = m.smbmdev_clkspeed;
822
823 if (shp->sh_smbvers >= SMB_VERSION_28) {
824 mdp->smbmd_minvolt = m.smbmdev_minvolt;
825 mdp->smbmd_maxvolt = m.smbmdev_maxvolt;
826 mdp->smbmd_confvolt = m.smbmdev_confvolt;
827 }
828
829 return (0);
830 }
831
832 int
833 smbios_info_memdevmap(smbios_hdl_t *shp, id_t id, smbios_memdevmap_t *mdp)
834 {
835 const smb_struct_t *stp = smb_lookup_id(shp, id);
836 smb_memdevmap_t m;
837
838 if (stp == NULL)
839 return (-1); /* errno is set for us */
840
841 if (stp->smbst_hdr->smbh_type != SMB_TYPE_MEMDEVICEMAP)
842 return (smb_set_errno(shp, ESMB_TYPE));
843
844 smb_info_bcopy(stp->smbst_hdr, &m, sizeof (m));
845 bzero(mdp, sizeof (smbios_memdevmap_t));
846
847 mdp->smbmdm_device = m.smbdmap_device;
848 mdp->smbmdm_arrmap = m.smbdmap_array;
849 mdp->smbmdm_rpos = m.smbdmap_rpos;
850 mdp->smbmdm_ipos = m.smbdmap_ipos;
851 mdp->smbmdm_idepth = m.smbdmap_idepth;
852
853 if (m.smbdmap_start != 0xFFFFFFFF && m.smbdmap_end != 0xFFFFFFFF) {
854 mdp->smbmdm_addr = (uint64_t)m.smbdmap_start * 1024;
855 mdp->smbmdm_size = (uint64_t)
856 (m.smbdmap_end - m.smbdmap_start + 1) * 1024;
857 } else if (m.smbdmap_extstart != 0 && m.smbdmap_extend != 0) {
858 mdp->smbmdm_addr = m.smbdmap_extstart;
859 mdp->smbmdm_size = m.smbdmap_extend - m.smbdmap_extstart + 1;
860 }
861
862 return (0);
863 }
864
865 id_t
866 smbios_info_hwsec(smbios_hdl_t *shp, smbios_hwsec_t *hsp)
867 {
868 const smb_struct_t *stp = smb_lookup_type(shp, SMB_TYPE_SECURITY);
869 smb_hwsec_t hs;
870
871 if (stp == NULL)
872 return (-1); /* errno is set for us */
873
874 smb_info_bcopy(stp->smbst_hdr, &hs, sizeof (hs));
875 bzero(hsp, sizeof (smbios_hwsec_t));
876
877 hsp->smbh_pwr_ps = SMB_HWS_PWR_PS(hs.smbhs_settings);
878 hsp->smbh_kbd_ps = SMB_HWS_KBD_PS(hs.smbhs_settings);
879 hsp->smbh_adm_ps = SMB_HWS_ADM_PS(hs.smbhs_settings);
880 hsp->smbh_pan_ps = SMB_HWS_PAN_PS(hs.smbhs_settings);
881
|