* your option) any later version.
*/
+/* to get toupper() */
+#include <ctype.h>
/* to get some global routines like printf */
#include "etherboot.h"
/* to get the interface to the body of the program */
#include "nic.h"
+/* to get the PCI support functions, if this is a PCI NIC */
+#include <gpxe/pci.h>
+/* to get the ISA support functions, if this is an ISA NIC */
+#include <gpxe/isa.h>
#include "mt_version.c"
#include "mt23108_imp.c"
for (tmo = currticks() + secs * TICKS_PER_SEC; currticks() < tmo;) {
if (iskey()) {
- ch = getchar();
- /* toupper does not work ... */
- if (ch == 'v')
- ch = 'V';
- if (ch == 'i')
- ch = 'I';
+ ch = toupper(getchar());
if ((ch=='V') || (ch=='I')) {
*ch_p = ch;
return 1;
/**************************************************************************
DISABLE - Turn off ethernet interface
***************************************************************************/
-static void tavor_disable(struct nic *nic)
+static void tavor_disable(struct dev *dev)
{
/* put the card in its initial state */
/* This function serves 3 purposes.
* This allows etherboot to reinitialize the interface
* if something is something goes wrong.
*/
- if (nic || 1) { // ????
+ if (dev || 1) { // ????
disable_imp();
}
}
-static struct nic_operations tavor_operations = {
- .connect = dummy_connect,
- .poll = tavor_poll,
- .transmit = tavor_transmit,
- .irq = tavor_irq,
-};
-
/**************************************************************************
PROBE - Look for an adapter, this routine's visible to the outside
***************************************************************************/
-static int tavor_probe(struct nic *nic, struct pci_device *pci)
+static int tavor_probe(struct dev *dev, struct pci_device *pci)
{
+ struct nic *nic = (struct nic *)dev;
int rc;
unsigned char user_request;
nic->ioaddr = pci->ioaddr & ~3;
nic->irqno = pci->irq;
/* point to NIC specific routines */
- nic->nic_op = &tavor_operations;
+ dev->disable = tavor_disable;
+ nic->poll = tavor_poll;
+ nic->transmit = tavor_transmit;
+ nic->irq = tavor_irq;
return 1;
}
return 0;
}
-static struct pci_device_id tavor_nics[] = {
+static struct pci_id tavor_nics[] = {
PCI_ROM(0x15b3, 0x5a44, "MT23108", "MT23108 HCA driver"),
PCI_ROM(0x15b3, 0x6278, "MT25208", "MT25208 HCA driver"),
};
-PCI_DRIVER ( tavor_driver, tavor_nics, PCI_NO_CLASS );
-
-DRIVER ( "MT23108/MT25208", nic_driver, pci_driver, tavor_driver,
- tavor_probe, tavor_disable );
+struct pci_driver tavor_driver __pci_driver = {
+ .type = NIC_DRIVER,
+ .name = "MT23108/MT25208",
+ .probe = tavor_probe,
+ .ids = tavor_nics,
+ .id_count = sizeof(tavor_nics) / sizeof(tavor_nics[0]),
+ .class = 0,
+};