mirror of
https://github.com/ipxe/ipxe
synced 2026-02-14 02:31:26 +03:00
[pci] Correct invalid base-class/sub-class/prog-if order in PCIR
PCI Configuration Space contains fields prog-if at the offset 0x09, sub-class at the offset 0x0a and base-class at the offset 0x0b (it respects little endian). PCIR structure uses these fields in the same order. Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
committed by
Michael Brown
parent
133f4c47ba
commit
ba0d5aa993
@@ -500,7 +500,7 @@ mpciheader:
|
|||||||
.word 0x0000 /* Device list pointer */
|
.word 0x0000 /* Device list pointer */
|
||||||
.word mpciheader_len /* PCI data structure length */
|
.word mpciheader_len /* PCI data structure length */
|
||||||
.byte 0x03 /* PCI data structure revision */
|
.byte 0x03 /* PCI data structure revision */
|
||||||
.byte 0x02, 0x00, 0x00 /* Class code */
|
.byte 0x00, 0x00, 0x02 /* Class code */
|
||||||
mpciheader_image_length:
|
mpciheader_image_length:
|
||||||
.word 0 /* Image length */
|
.word 0 /* Image length */
|
||||||
.word 0x0001 /* Revision level */
|
.word 0x0001 /* Revision level */
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ pciheader:
|
|||||||
.word ( pci_devlist - pciheader ) /* Device list pointer */
|
.word ( pci_devlist - pciheader ) /* Device list pointer */
|
||||||
.word pciheader_len /* PCI data structure length */
|
.word pciheader_len /* PCI data structure length */
|
||||||
.byte 0x03 /* PCI data structure revision */
|
.byte 0x03 /* PCI data structure revision */
|
||||||
.byte 0x02, 0x00, 0x00 /* Class code */
|
.byte 0x00, 0x00, 0x02 /* Class code */
|
||||||
pciheader_image_length:
|
pciheader_image_length:
|
||||||
.word 0 /* Image length */
|
.word 0 /* Image length */
|
||||||
.word 0x0001 /* Revision level */
|
.word 0x0001 /* Revision level */
|
||||||
|
|||||||
@@ -508,9 +508,9 @@ sub new {
|
|||||||
device_list => { offset => 0x08, length => 0x02, pack => "S" },
|
device_list => { offset => 0x08, length => 0x02, pack => "S" },
|
||||||
struct_length => { offset => 0x0a, length => 0x02, pack => "S" },
|
struct_length => { offset => 0x0a, length => 0x02, pack => "S" },
|
||||||
struct_revision =>{ offset => 0x0c, length => 0x01, pack => "C" },
|
struct_revision =>{ offset => 0x0c, length => 0x01, pack => "C" },
|
||||||
base_class => { offset => 0x0d, length => 0x01, pack => "C" },
|
prog_intf => { offset => 0x0d, length => 0x01, pack => "C" },
|
||||||
sub_class => { offset => 0x0e, length => 0x01, pack => "C" },
|
sub_class => { offset => 0x0e, length => 0x01, pack => "C" },
|
||||||
prog_intf => { offset => 0x0f, length => 0x01, pack => "C" },
|
base_class => { offset => 0x0f, length => 0x01, pack => "C" },
|
||||||
image_length => { offset => 0x10, length => 0x02, pack => "S" },
|
image_length => { offset => 0x10, length => 0x02, pack => "S" },
|
||||||
revision => { offset => 0x12, length => 0x02, pack => "S" },
|
revision => { offset => 0x12, length => 0x02, pack => "S" },
|
||||||
code_type => { offset => 0x14, length => 0x01, pack => "C" },
|
code_type => { offset => 0x14, length => 0x01, pack => "C" },
|
||||||
|
|||||||
@@ -149,7 +149,7 @@ static void make_efi_rom ( FILE *pe, FILE *rom, struct options *opts ) {
|
|||||||
headers->pci.VendorId = opts->vendor;
|
headers->pci.VendorId = opts->vendor;
|
||||||
headers->pci.DeviceId = opts->device;
|
headers->pci.DeviceId = opts->device;
|
||||||
headers->pci.Length = sizeof ( headers->pci );
|
headers->pci.Length = sizeof ( headers->pci );
|
||||||
headers->pci.ClassCode[0] = PCI_CLASS_NETWORK;
|
headers->pci.ClassCode[2] = PCI_CLASS_NETWORK;
|
||||||
headers->pci.ImageLength = ( rom_size / 512 );
|
headers->pci.ImageLength = ( rom_size / 512 );
|
||||||
headers->pci.CodeType = 0x03; /* No constant in EFI headers? */
|
headers->pci.CodeType = 0x03; /* No constant in EFI headers? */
|
||||||
headers->pci.Indicator = 0x80; /* No constant in EFI headers? */
|
headers->pci.Indicator = 0x80; /* No constant in EFI headers? */
|
||||||
|
|||||||
Reference in New Issue
Block a user