summaryrefslogtreecommitdiff
path: root/usr/src/common
diff options
context:
space:
mode:
authorRobert Mustacchi <rm@fingolfin.org>2020-09-10 08:38:39 -0700
committerRobert Mustacchi <rm@fingolfin.org>2020-09-10 08:39:02 -0700
commit374fc6954a786a037fbb28b1cd6fd62d05d13a37 (patch)
treeaed6e3138da25100b414c02a4bb28306130b3075 /usr/src/common
parentfcfe1af15109d9332f8d8f6330b4eea92effb41d (diff)
downloadillumos-joyent-374fc6954a786a037fbb28b1cd6fd62d05d13a37.tar.gz
backout: 13119, 13121 (mistaken integration)
Diffstat (limited to 'usr/src/common')
-rw-r--r--usr/src/common/smbios/smb_info.c42
-rw-r--r--usr/src/common/smbios/smb_open.c1
2 files changed, 5 insertions, 38 deletions
diff --git a/usr/src/common/smbios/smb_info.c b/usr/src/common/smbios/smb_info.c
index 9aba4deba8..47c19e7fcb 100644
--- a/usr/src/common/smbios/smb_info.c
+++ b/usr/src/common/smbios/smb_info.c
@@ -22,7 +22,6 @@
/*
* Copyright 2015 OmniTI Computer Consulting, Inc. All rights reserved.
* Copyright 2019 Joyent, Inc.
- * Copyright 2020 Oxide Computer Company
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -233,24 +232,13 @@ smb_info_strptr(const smb_struct_t *stp, uint8_t off, int *n)
}
static void
-smb_info_bcopy_offset(const smb_header_t *hp, void *dst, size_t dstlen,
- size_t offset)
-{
- if (offset >= hp->smbh_len) {
- bzero(dst, dstlen);
- } else if (offset + dstlen > hp->smbh_len) {
- size_t nvalid = MIN(hp->smbh_len - offset, dstlen);
- bcopy((char *)hp + offset, dst, nvalid);
- bzero((char *)dst + nvalid, dstlen - nvalid);
- } else {
- bcopy((char *)hp + offset, dst, dstlen);
- }
-}
-
-static void
smb_info_bcopy(const smb_header_t *hp, void *dst, size_t dstlen)
{
- return (smb_info_bcopy_offset(hp, dst, dstlen, 0));
+ if (dstlen > hp->smbh_len) {
+ bcopy(hp, dst, hp->smbh_len);
+ bzero((char *)dst + hp->smbh_len, dstlen - hp->smbh_len);
+ } else
+ bcopy(hp, dst, dstlen);
}
smbios_entry_point_t
@@ -686,8 +674,6 @@ smbios_info_slot(smbios_hdl_t *shp, id_t id, smbios_slot_t *sp)
{
const smb_struct_t *stp = smb_lookup_id(shp, id);
smb_slot_t s;
- smb_slot_cont_t cont;
- size_t off;
if (stp == NULL)
return (-1); /* errno is set for us */
@@ -715,24 +701,6 @@ smbios_info_slot(smbios_hdl_t *shp, id_t id, smbios_slot_t *sp)
sp->smbl_npeers = s.smbsl_npeers;
}
- if (!smb_libgteq(shp, SMB_VERSION_34)) {
- return (0);
- }
-
- /*
- * In SMBIOS 3.4, several members were added to follow the variable
- * number of peers. These are defined to start at byte 0x14 + 5 *
- * npeers. If the table is from before 3.4, we simple zero things out.
- * Otherwise we check if the length covers the peers and this addendum
- * to include it as the table length is allowed to be less than this and
- * not include it.
- */
- off = SMB_SLOT_CONT_START + 5 * s.smbsl_npeers;
- smb_info_bcopy_offset(stp->smbst_hdr, &cont, sizeof (cont), off);
- sp->smbl_info = cont.smbsl_info;
- sp->smbl_pwidth = cont.smbsl_pwidth;
- sp->smbl_pitch = cont.smbsl_pitch;
-
return (0);
}
diff --git a/usr/src/common/smbios/smb_open.c b/usr/src/common/smbios/smb_open.c
index 6747c84499..372b2b619b 100644
--- a/usr/src/common/smbios/smb_open.c
+++ b/usr/src/common/smbios/smb_open.c
@@ -231,7 +231,6 @@ smbios_bufopen(const smbios_entry_t *ep, const void *buf, size_t len,
case SMB_VERSION_31:
case SMB_VERSION_32:
case SMB_VERSION_33:
- case SMB_VERSION_34:
break;
default:
return (smb_open_error(shp, errp, ESMB_VERSION));