Browse Source

Build in gpxe

tags/v0.9.3
Michael Brown 19 years ago
parent
commit
d08ce741a4
1 changed files with 14 additions and 23 deletions
  1. 14
    23
      src/drivers/net/via-velocity.c

+ 14
- 23
src/drivers/net/via-velocity.c View File

1
-#define EB54 1
2
 /**************************************************************************
1
 /**************************************************************************
3
 *    via-velocity.c: Etherboot device driver for the VIA 6120 Gigabit
2
 *    via-velocity.c: Etherboot device driver for the VIA 6120 Gigabit
4
 *    Changes for Etherboot port:
3
 *    Changes for Etherboot port:
627
 	vptr->flags &= (~VELOCITY_FLAGS_OPENED);
626
 	vptr->flags &= (~VELOCITY_FLAGS_OPENED);
628
 }
627
 }
629
 
628
 
630
-#ifdef EB54
631
 /**************************************************************************
629
 /**************************************************************************
632
 IRQ - handle interrupts
630
 IRQ - handle interrupts
633
 ***************************************************************************/
631
 ***************************************************************************/
660
 		break;
658
 		break;
661
 	}
659
 	}
662
 }
660
 }
663
-#endif
661
+
662
+static struct nic_operations velocity_operations = {
663
+	.connect	= dummy_connect,
664
+	.poll		= velocity_poll,
665
+	.transmit	= velocity_transmit,
666
+	.irq		= velocity_irq,
667
+};
668
+
664
 /**************************************************************************
669
 /**************************************************************************
665
 PROBE - Look for an adapter, this routine's visible to the outside
670
 PROBE - Look for an adapter, this routine's visible to the outside
666
 ***************************************************************************/
671
 ***************************************************************************/
667
-
668
-#define board_found 1
669
-#define valid_link 0
670
 static int velocity_probe(struct dev *dev, struct pci_device *pci)
672
 static int velocity_probe(struct dev *dev, struct pci_device *pci)
671
 {
673
 {
672
 	struct nic *nic = (struct nic *) dev;
674
 	struct nic *nic = (struct nic *) dev;
674
 	struct mac_regs *regs;
676
 	struct mac_regs *regs;
675
 
677
 
676
 	printf("via-velocity.c: Found %s Vendor=0x%hX Device=0x%hX\n",
678
 	printf("via-velocity.c: Found %s Vendor=0x%hX Device=0x%hX\n",
677
-	       pci->name, pci->vendor, pci->dev_id);
679
+	       pci->name, pci->vendor_id, pci->device_id);
678
 
680
 
679
 	/* point to private storage */
681
 	/* point to private storage */
680
 	vptr = &vptx;
682
 	vptr = &vptx;
740
 	velocity_open(nic, pci);
742
 	velocity_open(nic, pci);
741
 
743
 
742
 	/* store NIC parameters */
744
 	/* store NIC parameters */
743
-#ifdef EB54
744
-	nic->ioaddr = pci->ioaddr & ~3;
745
-	nic->irqno = pci->irq;
746
-	nic->irq = velocity_irq;
747
-#endif
748
-	dev->disable = velocity_disable;
749
-	nic->poll = velocity_poll;
750
-	nic->transmit = velocity_transmit;
745
+	nic->nic_op = &velocity_operations;
751
 	return 1;
746
 	return 1;
752
 }
747
 }
753
 
748
 
1939
 	PCI_ROM(0x1106, 0x3119, "via-velocity", "VIA Networking Velocity Family Gigabit Ethernet Adapter"),
1934
 	PCI_ROM(0x1106, 0x3119, "via-velocity", "VIA Networking Velocity Family Gigabit Ethernet Adapter"),
1940
 };
1935
 };
1941
 
1936
 
1942
-static struct pci_driver velocity_driver __pci_driver = {
1943
-	.type = NIC_DRIVER,
1944
-	.name = "VIA-VELOCITY/PCI",
1945
-	.probe = velocity_probe,
1946
-	.ids = velocity_nics,
1947
-	.id_count = sizeof(velocity_nics) / sizeof(velocity_nics[0]),
1948
-	.class = 0,
1949
-};
1937
+PCI_DRIVER ( velocity_driver, velocity_nics, PCI_NO_CLASS );
1938
+
1939
+DRIVER ( "VIA-VELOCITY/PCI", nic_driver, pci_driver, velocity_driver,
1940
+         velocity_probe, velocity_disable );

Loading…
Cancel
Save