Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F175782826
D60665.id189643.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
13 KB
Referenced Files
None
Subscribers
None
D60665.id189643.diff
View Options
diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc
--- a/ObsoleteFiles.inc
+++ b/ObsoleteFiles.inc
@@ -51,6 +51,10 @@
# xargs -n1 | sort | uniq -d;
# done
+# 2026xxxx: Retire vpd(4)
+OLD_FILES+=usr/share/man/man4/i386/vpd.4.gz
+OLD_FILES+=usr/share/man/man4/vpd.4.gz
+
# 2026xxxx: Retire sbni(4)
OLD_FILES+=usr/share/man/man4/i386/if_sbni.4.gz
OLD_FILES+=usr/share/man/man4/i386/sbni.4.gz
diff --git a/share/man/man4/man4.i386/Makefile b/share/man/man4/man4.i386/Makefile
--- a/share/man/man4/man4.i386/Makefile
+++ b/share/man/man4/man4.i386/Makefile
@@ -6,8 +6,7 @@
pae.4 \
pnp.4 \
pnpbios.4 \
- smapi.4 \
- vpd.4
+ smapi.4
MLINKS= CPU_ELAN.4 CPU_SOEKRIS.4
MLINKS+=pae.4 PAE.4
diff --git a/share/man/man4/man4.i386/vpd.4 b/share/man/man4/man4.i386/vpd.4
deleted file mode 100644
--- a/share/man/man4/man4.i386/vpd.4
+++ /dev/null
@@ -1,88 +0,0 @@
-.\" Copyright (c) 2003 Matthew N. Dodd <winter@jurai.net>
-.\" All rights reserved.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.Dd August 31, 2004
-.Dt VPD 4 i386
-.Os
-.Sh NAME
-.Nm vpd
-.Nd "Vital Product Data kernel interface"
-.Sh SYNOPSIS
-.Cd "device vpd"
-.Sh DESCRIPTION
-.Tn IBM ThinkPad
-notebooks (and most
-.Tn IBM
-desktop PCs) have a 48-byte
-Vital Product Data (VPD) structure located in the BIOS Shadow RAM.
-.Pp
-The VPD provides machine type and model information, the build ID
-(this is roughly the BIOS version) and serial number information.
-.Pp
-The
-.Nm
-driver scans the BIOS area and claims the memory used by the VPD
-structure.
-It provides the
-.Xr sysctl 3
-branch
-.Va hw.vpd
-to allow this information to be accessed by the userland.
-The following variables are provided, one per VPD attachment (there should
-only be one):
-.Pp
-.Bl -tag -width ".Dv MACHINE_MODEL" -compact
-.It Dv MACHINE_TYPE
-.Pq Va machine.type
-Machine type.
-.It Dv MACHINE_MODEL
-.Pq Va machine.model
-Machine model.
-.It Dv BUILD_ID
-.Pq Va build.id
-BIOS Build ID.
-.It Dv SERIAL_BOX
-.Pq Va serial.box
-Box Serial Number.
-.It Dv SERIAL_PLANAR
-.Pq Va serial.planar
-Motherboard Serial Number.
-.El
-.Sh SEE ALSO
-.Rs
-.%T "TP General - Using the BIOS Build ID to identify IBM ThinkPad systems"
-.%N "Reference #: MIGR-45120"
-.%D "November 22, 2002"
-.%U "http://www.ibm.com/support/docview.wss?uid=psg1MIGR-45120"
-.Re
-.Sh HISTORY
-The
-.Nm
-driver first appeared in
-.Fx 5.1 .
-.Sh AUTHORS
-The
-.Nm
-driver and this manual page were written by
-.An Matthew N. Dodd Aq Mt mdodd@FreeBSD.org .
diff --git a/sys/conf/files.x86 b/sys/conf/files.x86
--- a/sys/conf/files.x86
+++ b/sys/conf/files.x86
@@ -351,7 +351,6 @@
x86/acpica/OsdEnvironment.c optional acpi
x86/acpica/acpi_apm.c optional acpi
x86/acpica/srat.c optional acpi
-x86/bios/vpd.c optional vpd
x86/cpufreq/est.c optional cpufreq
x86/cpufreq/hwpstate_amd.c optional cpufreq
x86/cpufreq/hwpstate_common.c optional cpufreq
diff --git a/sys/modules/bios/Makefile b/sys/modules/bios/Makefile
--- a/sys/modules/bios/Makefile
+++ b/sys/modules/bios/Makefile
@@ -1,6 +1,6 @@
#
-SUBDIR= smbios vpd
+SUBDIR= smbios
.if ${MACHINE_ARCH} == "i386"
SUBDIR+= smapi
diff --git a/sys/modules/bios/vpd/Makefile b/sys/modules/bios/vpd/Makefile
deleted file mode 100644
--- a/sys/modules/bios/vpd/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-#
-
-.PATH: ${SRCTOP}/sys/x86/bios
-
-KMOD= vpd
-SRCS= vpd.c \
- bus_if.h device_if.h
-
-.include <bsd.kmod.mk>
diff --git a/sys/x86/bios/vpd.c b/sys/x86/bios/vpd.c
deleted file mode 100644
--- a/sys/x86/bios/vpd.c
+++ /dev/null
@@ -1,307 +0,0 @@
-/*-
- * SPDX-License-Identifier: BSD-2-Clause
- *
- * Copyright (c) 2003 Matthew N. Dodd <winter@jurai.net>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-/*
- * VPD decoder for IBM systems (Thinkpads)
- * http://www-1.ibm.com/support/docview.wss?uid=psg1MIGR-45120
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/socket.h>
-#include <sys/sysctl.h>
-
-#include <sys/module.h>
-#include <sys/bus.h>
-
-#include <machine/bus.h>
-#include <machine/resource.h>
-#include <sys/rman.h>
-
-#include <vm/vm.h>
-#include <vm/vm_param.h>
-#include <vm/pmap.h>
-#include <machine/md_var.h>
-#include <machine/pc/bios.h>
-
-/*
- * Vital Product Data
- */
-struct vpd {
- u_int16_t Header; /* 0x55AA */
- u_int8_t Signature[3]; /* Always 'VPD' */
- u_int8_t Length; /* Sructure Length */
-
- u_int8_t Reserved[7]; /* Reserved */
-
- u_int8_t BuildID[9]; /* BIOS Build ID */
- u_int8_t BoxSerial[7]; /* Box Serial Number */
- u_int8_t PlanarSerial[11]; /* Motherboard Serial Number */
- u_int8_t MachType[7]; /* Machine Type/Model */
- u_int8_t Checksum; /* Checksum */
-} __packed;
-
-struct vpd_softc {
- device_t dev;
- struct resource * res;
- int rid;
-
- struct vpd * vpd;
-
- struct sysctl_ctx_list ctx;
-
- char BuildID[10];
- char BoxSerial[8];
- char PlanarSerial[12];
- char MachineType[5];
- char MachineModel[4];
-};
-
-#define VPD_START 0xf0000
-#define VPD_STEP 0x10
-#define VPD_OFF 2
-#define VPD_LEN 3
-#define VPD_SIG "VPD"
-
-#define RES2VPD(res) ((struct vpd *)rman_get_virtual(res))
-#define ADDR2VPD(addr) ((struct vpd *)BIOS_PADDRTOVADDR(addr))
-
-static void vpd_identify (driver_t *, device_t);
-static int vpd_probe (device_t);
-static int vpd_attach (device_t);
-static int vpd_detach (device_t);
-static int vpd_modevent (module_t, int, void *);
-
-static int vpd_cksum (struct vpd *);
-
-static SYSCTL_NODE(_hw, OID_AUTO, vpd, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL,
- NULL);
-static SYSCTL_NODE(_hw_vpd, OID_AUTO, machine,
- CTLFLAG_RD | CTLFLAG_MPSAFE, NULL,
- NULL);
-static SYSCTL_NODE(_hw_vpd_machine, OID_AUTO, type,
- CTLFLAG_RD | CTLFLAG_MPSAFE, NULL,
- NULL);
-static SYSCTL_NODE(_hw_vpd_machine, OID_AUTO, model,
- CTLFLAG_RD | CTLFLAG_MPSAFE, NULL,
- NULL);
-static SYSCTL_NODE(_hw_vpd, OID_AUTO, build_id,
- CTLFLAG_RD | CTLFLAG_MPSAFE, NULL,
- NULL);
-static SYSCTL_NODE(_hw_vpd, OID_AUTO, serial,
- CTLFLAG_RD | CTLFLAG_MPSAFE, NULL,
- NULL);
-static SYSCTL_NODE(_hw_vpd_serial, OID_AUTO, box,
- CTLFLAG_RD | CTLFLAG_MPSAFE, NULL,
- NULL);
-static SYSCTL_NODE(_hw_vpd_serial, OID_AUTO, planar,
- CTLFLAG_RD | CTLFLAG_MPSAFE, NULL,
- NULL);
-
-static void
-vpd_identify (driver_t *driver, device_t parent)
-{
- device_t child;
- u_int32_t addr;
- int length;
- int rid;
-
- if (!device_is_alive(parent))
- return;
-
- addr = bios_sigsearch(VPD_START, VPD_SIG, VPD_LEN, VPD_STEP, VPD_OFF);
- if (addr != 0) {
- rid = 0;
- length = ADDR2VPD(addr)->Length;
-
- child = BUS_ADD_CHILD(parent, 5, "vpd", DEVICE_UNIT_ANY);
- device_set_driver(child, driver);
- bus_set_resource(child, SYS_RES_MEMORY, rid, addr, length);
- device_set_desc(child, "Vital Product Data Area");
- }
-
- return;
-}
-
-static int
-vpd_probe (device_t dev)
-{
- struct resource *res;
- int rid;
- int error;
-
- error = 0;
- rid = 0;
- res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE);
- if (res == NULL) {
- device_printf(dev, "Unable to allocate memory resource.\n");
- error = ENOMEM;
- goto bad;
- }
-
- if (vpd_cksum(RES2VPD(res)))
- device_printf(dev, "VPD checksum failed. BIOS update may be required.\n");
-
-bad:
- if (res)
- bus_release_resource(dev, SYS_RES_MEMORY, rid, res);
- return (error);
-}
-
-static int
-vpd_attach (device_t dev)
-{
- struct vpd_softc *sc;
- char unit[4];
- int error;
-
- sc = device_get_softc(dev);
- error = 0;
-
- sc->dev = dev;
- sc->rid = 0;
- sc->res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->rid,
- RF_ACTIVE);
- if (sc->res == NULL) {
- device_printf(dev, "Unable to allocate memory resource.\n");
- error = ENOMEM;
- goto bad;
- }
- sc->vpd = RES2VPD(sc->res);
-
- snprintf(unit, sizeof(unit), "%d", device_get_unit(sc->dev));
- snprintf(sc->MachineType, 5, "%.4s", sc->vpd->MachType);
- snprintf(sc->MachineModel, 4, "%.3s", sc->vpd->MachType+4);
- snprintf(sc->BuildID, 10, "%.9s", sc->vpd->BuildID);
- snprintf(sc->BoxSerial, 8, "%.7s", sc->vpd->BoxSerial);
- snprintf(sc->PlanarSerial, 12, "%.11s", sc->vpd->PlanarSerial);
-
- sysctl_ctx_init(&sc->ctx);
- SYSCTL_ADD_STRING(&sc->ctx,
- SYSCTL_STATIC_CHILDREN(_hw_vpd_machine_type), OID_AUTO,
- unit, CTLFLAG_RD, sc->MachineType, 0, NULL);
- SYSCTL_ADD_STRING(&sc->ctx,
- SYSCTL_STATIC_CHILDREN(_hw_vpd_machine_model), OID_AUTO,
- unit, CTLFLAG_RD, sc->MachineModel, 0, NULL);
- SYSCTL_ADD_STRING(&sc->ctx,
- SYSCTL_STATIC_CHILDREN(_hw_vpd_build_id), OID_AUTO,
- unit, CTLFLAG_RD, sc->BuildID, 0, NULL);
- SYSCTL_ADD_STRING(&sc->ctx,
- SYSCTL_STATIC_CHILDREN(_hw_vpd_serial_box), OID_AUTO,
- unit, CTLFLAG_RD, sc->BoxSerial, 0, NULL);
- SYSCTL_ADD_STRING(&sc->ctx,
- SYSCTL_STATIC_CHILDREN(_hw_vpd_serial_planar), OID_AUTO,
- unit, CTLFLAG_RD, sc->PlanarSerial, 0, NULL);
-
- device_printf(dev, "Machine Type: %.4s, Model: %.3s, Build ID: %.9s\n",
- sc->MachineType, sc->MachineModel, sc->BuildID);
- device_printf(dev, "Box Serial: %.7s, Planar Serial: %.11s\n",
- sc->BoxSerial, sc->PlanarSerial);
-
- return (0);
-bad:
- if (sc->res)
- bus_release_resource(dev, SYS_RES_MEMORY, sc->rid, sc->res);
- return (error);
-}
-
-static int
-vpd_detach (device_t dev)
-{
- struct vpd_softc *sc;
-
- sc = device_get_softc(dev);
-
- if (sc->res)
- bus_release_resource(dev, SYS_RES_MEMORY, sc->rid, sc->res);
-
- sysctl_ctx_free(&sc->ctx);
-
- return (0);
-}
-
-static int
-vpd_modevent (module_t mod, int what, void *arg)
-{
- device_t * devs;
- int count;
- int i;
-
- switch (what) {
- case MOD_LOAD:
- break;
- case MOD_UNLOAD:
- devclass_get_devices(devclass_find("vpd"), &devs, &count);
- for (i = 0; i < count; i++) {
- device_delete_child(device_get_parent(devs[i]), devs[i]);
- }
- break;
- default:
- break;
- }
-
- return (0);
-}
-
-static device_method_t vpd_methods[] = {
- /* Device interface */
- DEVMETHOD(device_identify, vpd_identify),
- DEVMETHOD(device_probe, vpd_probe),
- DEVMETHOD(device_attach, vpd_attach),
- DEVMETHOD(device_detach, vpd_detach),
- { 0, 0 }
-};
-
-static driver_t vpd_driver = {
- "vpd",
- vpd_methods,
- sizeof(struct vpd_softc),
-};
-
-DRIVER_MODULE(vpd, nexus, vpd_driver, vpd_modevent, 0);
-MODULE_VERSION(vpd, 1);
-
-/*
- * Perform a checksum over the VPD structure, starting with
- * the BuildID. (Jean Delvare <khali@linux-fr.org>)
- */
-static int
-vpd_cksum (struct vpd *v)
-{
- u_int8_t *ptr;
- u_int8_t cksum;
- int i;
-
- ptr = (u_int8_t *)v;
- cksum = 0;
- for (i = offsetof(struct vpd, BuildID); i < v->Length ; i++)
- cksum += ptr[i];
- return (cksum);
-}
diff --git a/sys/x86/conf/NOTES b/sys/x86/conf/NOTES
--- a/sys/x86/conf/NOTES
+++ b/sys/x86/conf/NOTES
@@ -524,12 +524,10 @@
#
# ipmi: Intelligent Platform Management Interface
# smbios: DMI/SMBIOS entry point (requires EFIRT option)
-# vpd: Vital Product Data kernel interface
# tpm: Trusted Platform Module
device ipmi
device smbios
-device vpd
device tpm
device padlock_rng # VIA Padlock RNG
device rdrand_rng # Intel Bull Mountain RNG
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Oct 14, 8:06 AM (2 h, 25 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
40777172
Default Alt Text
D60665.id189643.diff (13 KB)
Attached To
Mode
D60665: vpd: Remove the vpd(4) driver
Attached
Detach File
Event Timeline
Log In to Comment