2
* Decoding of OEM-specific entries
3
* This file is part of the dmidecode project.
5
* (C) 2007 Jean Delvare <khali@linux-fr.org>
7
* This program is free software; you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation; either version 2 of the License, or
10
* (at your option) any later version.
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
17
* You should have received a copy of the GNU General Public License
18
* along with this program; if not, write to the Free Software
19
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26
#include "dmidecode.h"
31
* Globals for vendor-specific decodes
34
enum DMI_VENDORS { VENDOR_UNKNOWN, VENDOR_HP };
36
static enum DMI_VENDORS dmi_vendor=VENDOR_UNKNOWN;
39
* Remember the system vendor for later use. We only actually store the
40
* value if we know how to decode at least one specific entry type for
43
void dmi_set_vendor(const char *s)
45
if(strcmp(s, "HP")==0)
50
* HP-specific data structures are decoded here.
52
* Code contributed by John Cagle.
55
static int dmi_decode_hp(struct dmi_header *h, const struct libbiosdevname_state *state)
61
struct pci_device *pdev;
68
* Vendor Specific: HP ProLiant NIC MAC Information
70
* This prints the BIOS NIC number,
71
* PCI bus/device/function, and MAC address
80
while(h->length>=ptr+8)
83
device = data[ptr]>>3;
85
pdev = find_pci_dev_by_pci_addr(state, 0, bus, device, func);
87
if((data[ptr]==0x00 && data[ptr+1]==0x00) ||
88
(data[ptr]==0xFF && data[ptr+1]==0xFF))
89
pdev->smbios_enabled = 0;
91
pdev->smbios_enabled = 1;
92
pdev->smbios_type = smbios_type;
93
pdev->smbios_instance = nic;
94
pdev->physical_slot = 0;
109
* Dispatch vendor-specific entries decoding
110
* Return 1 if decoding was successful, 0 otherwise
112
int dmi_decode_oem(struct dmi_header *h, const struct libbiosdevname_state *state)
117
return dmi_decode_hp(h, state);