Shorten define names containing PCI_{DEVICE,VENDOR}_ID_ with PCI_{DID,VID}_ using the commands below, which also take care of some spacing issues. An additional clean up of pci_ids.h is done in CB:61531. Used commands: * find -type f -exec sed -i 's/PCI_\([DV]\)\(EVICE\|ENDOR\)_ID_\([_0-9A-Za-z]\{2\}\([_0-9A-Za-z]\{8\}\)*[_0-9A-Za-z]\{0,5\}\)\t/PCI_\1ID_\3\t\t/g' * find -type f -exec sed -i 's/PCI_\([DV]\)\(EVICE\|ENDOR\)_ID_\([_0-9A-Za-z]*\)/PCI_\1ID_\3/g' Change-Id: If9027700f53b6d0d3964c26a41a1f9b8f62be178 Signed-off-by: Felix Singer <felixsinger@posteo.net> Reviewed-on: https://review.coreboot.org/c/coreboot/+/39331 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Michael Niewöhner <foss@mniewoehner.de>
43 lines
1.1 KiB
C
43 lines
1.1 KiB
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
|
|
#include <device/device.h>
|
|
#include <device/pci_ids.h>
|
|
#include <smbios.h>
|
|
|
|
#include "wifi_private.h"
|
|
|
|
static int smbios_write_intel_wifi(struct device *dev, int *handle, unsigned long *current)
|
|
{
|
|
if (dev->vendor != PCI_VID_INTEL)
|
|
return 0;
|
|
|
|
struct smbios_type_intel_wifi {
|
|
struct smbios_header header;
|
|
u8 str;
|
|
u8 eos[2];
|
|
} __packed;
|
|
|
|
struct smbios_type_intel_wifi *t = smbios_carve_table(*current, 0x85,
|
|
sizeof(*t), *handle);
|
|
|
|
/* Intel wifi driver expects this string to be in the table 0x85. */
|
|
t->str = smbios_add_string(t->eos, "KHOIHGIUCCHHII");
|
|
|
|
const int len = smbios_full_table_len(&t->header, t->eos);
|
|
*current += len;
|
|
*handle += 1;
|
|
return len;
|
|
}
|
|
|
|
int smbios_write_wifi_pcie(struct device *dev, int *handle, unsigned long *current)
|
|
{
|
|
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)
|
|
{
|
|
return smbios_write_wifi_pcie(dev->bus->dev, handle, current);
|
|
}
|