mb/google/brya: Create rull variant
[coreboot2.git] / src / drivers / wifi / generic / smbios.c
blobe6ccd5d8a65a8b99fbe84902300333fb81ae9b8d
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <device/device.h>
4 #include <device/pci_ids.h>
5 #include <smbios.h>
7 #include "wifi_private.h"
9 static int smbios_write_intel_wifi(struct device *dev, int *handle, unsigned long *current)
11 if (dev->vendor != PCI_VID_INTEL)
12 return 0;
14 struct smbios_type_intel_wifi {
15 struct smbios_header header;
16 u8 str;
17 u8 eos[2];
18 } __packed;
20 struct smbios_type_intel_wifi *t = smbios_carve_table(*current, 0x85,
21 sizeof(*t), *handle);
23 /* Intel wifi driver expects this string to be in the table 0x85. */
24 t->str = smbios_add_string(t->eos, "KHOIHGIUCCHHII");
26 const int len = smbios_full_table_len(&t->header, t->eos);
27 *current += len;
28 *handle += 1;
29 return len;
32 int smbios_write_wifi_pcie(struct device *dev, int *handle, unsigned long *current)
34 int len = smbios_write_intel_wifi(dev, handle, current);
35 len += get_smbios_data(dev, handle, current);
36 return len;
39 int smbios_write_wifi_cnvi(struct device *dev, int *handle, unsigned long *current)
41 return smbios_write_wifi_pcie(dev->upstream->dev, handle, current);