mirror of
https://github.com/ipxe/ipxe
synced 2025-12-23 13:30:57 +03:00
Restructured PCI subsystem to fit the new device model.
Generic PCI code now handles 64-bit BARs correctly when setting "membase"; drivers should need to call pci_bar_start() only if they want to use BARs other than the first memory or I/O BAR. Split rarely-used PCI functions out into pciextra.c. Core PCI code is now 662 bytes (down from 1308 bytes in Etherboot 5.4). 284 bytes of this saving comes from the pci/pciextra split. Cosmetic changes to lots of drivers (e.g. vendor_id->vendor in order to match the names used in Linux).
This commit is contained in:
@@ -1245,7 +1245,7 @@ static int forcedeth_probe ( struct nic *nic, struct pci_device *pci ) {
|
||||
return 0;
|
||||
|
||||
printf("forcedeth.c: Found %s, vendor=0x%hX, device=0x%hX\n",
|
||||
pci->name, pci->vendor_id, pci->device_id);
|
||||
pci->name, pci->vendor, pci->device);
|
||||
|
||||
pci_fill_nic ( nic, pci );
|
||||
|
||||
@@ -1263,9 +1263,9 @@ static int forcedeth_probe ( struct nic *nic, struct pci_device *pci ) {
|
||||
return 0;
|
||||
|
||||
/* handle different descriptor versions */
|
||||
if (pci->device_id == PCI_DEVICE_ID_NVIDIA_NVENET_1 ||
|
||||
pci->device_id == PCI_DEVICE_ID_NVIDIA_NVENET_2 ||
|
||||
pci->device_id == PCI_DEVICE_ID_NVIDIA_NVENET_3)
|
||||
if (pci->device == PCI_DEVICE_ID_NVIDIA_NVENET_1 ||
|
||||
pci->device == PCI_DEVICE_ID_NVIDIA_NVENET_2 ||
|
||||
pci->device == PCI_DEVICE_ID_NVIDIA_NVENET_3)
|
||||
np->desc_ver = DESC_VER_1;
|
||||
else
|
||||
np->desc_ver = DESC_VER_2;
|
||||
@@ -1316,7 +1316,7 @@ static int forcedeth_probe ( struct nic *nic, struct pci_device *pci ) {
|
||||
np->tx_flags = NV_TX2_LASTPACKET | NV_TX2_VALID;
|
||||
}
|
||||
|
||||
switch (pci->device_id) {
|
||||
switch (pci->device) {
|
||||
case 0x01C3: // nforce
|
||||
// DEV_IRQMASK_1|DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER,
|
||||
np->irqmask = NVREG_IRQMASK_WANTED_2 | NVREG_IRQ_TIMER;
|
||||
@@ -1406,7 +1406,7 @@ static int forcedeth_probe ( struct nic *nic, struct pci_device *pci ) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
static struct pci_id forcedeth_nics[] = {
|
||||
static struct pci_device_id forcedeth_nics[] = {
|
||||
PCI_ROM(0x10de, 0x01C3, "nforce", "nForce NVENET_1 Ethernet Controller"),
|
||||
PCI_ROM(0x10de, 0x0066, "nforce2", "nForce NVENET_2 Ethernet Controller"),
|
||||
PCI_ROM(0x10de, 0x00D6, "nforce3", "nForce NVENET_3 Ethernet Controller"),
|
||||
|
||||
Reference in New Issue
Block a user