summaryrefslogtreecommitdiffstats
path: root/src/drivers/wifi
diff options
context:
space:
mode:
authorAngel Pons <th3fanbus@gmail.com>2021-09-03 12:18:10 +0200
committerFelix Held <felix-coreboot@felixheld.de>2021-09-13 13:54:03 +0000
commit6a73b2466f388b34086a941572d0af7d0614da3f (patch)
tree9d1c91b8baf9dab33dd87db30ebe3eac9a093cf3 /src/drivers/wifi
parent869e90a3d481951c61024be042f3bf06d2887b89 (diff)
downloadcoreboot-6a73b2466f388b34086a941572d0af7d0614da3f.tar.gz
coreboot-6a73b2466f388b34086a941572d0af7d0614da3f.tar.bz2
coreboot-6a73b2466f388b34086a941572d0af7d0614da3f.zip
SMBIOS: Allow skipping default SMBIOS generation
The call to the `get_smbios_data` device operation is followed by calls to unconditional default functions, which lacks flexibility. Instead, have devices that implement `get_smbios_data` call these default functions as needed. Most `get_smbios_data` implementations are in mainboard code, and are bound to the root device. The default functions only operate with PCI devices because of the `dev->path.type != DEVICE_PATH_PCI` checks, so calling these functions for non-PCI devices is unnecessary. QEMU also implements `get_smbios_data` but binds it to the domain device, which isn't PCI either. Change-Id: Iefbf072b1203d04a98c9d26a30f22cfebe769eb4 Signed-off-by: Angel Pons <th3fanbus@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/57366 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Diffstat (limited to 'src/drivers/wifi')
-rw-r--r--src/drivers/wifi/generic/smbios.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/drivers/wifi/generic/smbios.c b/src/drivers/wifi/generic/smbios.c
index 793349dad080..db22de9793ff 100644
--- a/src/drivers/wifi/generic/smbios.c
+++ b/src/drivers/wifi/generic/smbios.c
@@ -9,6 +9,9 @@
static int smbios_write_intel_wifi(struct device *dev, int *handle, unsigned long *current)
{
+ if (dev->vendor != PCI_VENDOR_ID_INTEL)
+ return 0;
+
struct smbios_type_intel_wifi {
struct smbios_header header;
u8 str;
@@ -29,10 +32,9 @@ static int smbios_write_intel_wifi(struct device *dev, int *handle, unsigned lon
int smbios_write_wifi_pcie(struct device *dev, int *handle, unsigned long *current)
{
- if (dev->vendor == PCI_VENDOR_ID_INTEL)
- return smbios_write_intel_wifi(dev, handle, current);
-
- return 0;
+ int len = smbios_write_intel_wifi(dev, handle, current);
+ len += get_smbios_data(dev, handle, current);
+ return len;
}
int smbios_write_wifi_cnvi(struct device *dev, int *handle, unsigned long *current)