summaryrefslogtreecommitdiffstats
path: root/src/drivers/net/ns83820.c
diff options
context:
space:
mode:
authorMichael Brown2005-04-21 21:20:39 +0200
committerMichael Brown2005-04-21 21:20:39 +0200
commit614c39a8a40a32146793bd25906964659d90f95b (patch)
tree9acc979cce4658905d1bffd26d03058435c5d4c5 /src/drivers/net/ns83820.c
parentTweaked API to minimise changes to existing drivers even further. (diff)
downloadipxe-614c39a8a40a32146793bd25906964659d90f95b.tar.gz
ipxe-614c39a8a40a32146793bd25906964659d90f95b.tar.xz
ipxe-614c39a8a40a32146793bd25906964659d90f95b.zip
Automatically updated with the program
#!/usr/bin/perl -w -pi -0777 use strict; ( my $type ) = /find_(\w+?)_boot_device/ or die "Could not find type\n"; ( my $disable ) = /\.disable\s*=\s*(\w+)/ or die "Could not locate disable\n"; s/(${disable}\s*\(\s*struct\s+nic\s+\*nic)(\s*\)\s*\{)(\s*)/${1}, struct ${type}_device \*${type} __unused${2}${3}nic_disable ( nic );${3}/s; s/(${disable}\s*\(\s*struct\s+nic\s+\*nic)(\s*\)\s*;)/${1}, struct ${type}_device \*${type}${2}/g; s/^\s*.disable\s*=\s*${disable}\s*,\s*?$//m; s/(_probe\s*\(\s*)struct\s+dev\s+\*dev/${1}struct nic \*nic/g; s/^\s*struct\s+nic\s+\*nic\s*=\s*nic_device\s*\(\s*dev\s*\)\s*;\s*?$//m; s/^(\s*)(nic->(ioaddr|irqno)\s*=\s*${type})/${1}${type}_fill_nic ( nic, ${type} );\n${1}${2}/m;
Diffstat (limited to 'src/drivers/net/ns83820.c')
-rwxr-xr-xsrc/drivers/net/ns83820.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/drivers/net/ns83820.c b/src/drivers/net/ns83820.c
index 2df74ac56..6698f4f6c 100755
--- a/src/drivers/net/ns83820.c
+++ b/src/drivers/net/ns83820.c
@@ -756,7 +756,8 @@ static void ns83820_transmit(struct nic *nic, const char *d, /* Destination */
/**************************************************************************
DISABLE - Turn off ethernet interface
***************************************************************************/
-static void ns83820_disable ( struct nic *nic ) {
+static void ns83820_disable ( struct nic *nic, struct pci_device *pci __unused ) {
+ nic_disable ( nic );
/* put the card in its initial state */
/* This function serves 3 purposes.
* This disables DMA and interrupts so we don't receive
@@ -809,7 +810,7 @@ static struct nic_operations ns83820_operations = {
.poll = ns83820_poll,
.transmit = ns83820_transmit,
.irq = ns83820_irq,
- .disable = ns83820_disable,
+
};
static struct pci_id ns83820_nics[] = {
@@ -817,7 +818,7 @@ static struct pci_id ns83820_nics[] = {
};
static struct pci_driver ns83820_driver =
- PCI_DRIVER ( "NS83820/PCI", ns83820_nics, PCI_NO_CLASS );
+ PCI_DRIVER ( ns83820_nics, PCI_NO_CLASS );
/**************************************************************************
PROBE - Look for an adapter, this routine's visible to the outside
@@ -825,8 +826,8 @@ PROBE - Look for an adapter, this routine's visible to the outside
#define board_found 1
#define valid_link 0
-static int ns83820_probe ( struct dev *dev, struct pci_device *pci ) {
- struct nic *nic = nic_device ( dev );
+static int ns83820_probe ( struct nic *nic, struct pci_device *pci ) {
+
int sz;
long addr;
int using_dac = 0;
@@ -852,6 +853,7 @@ static int ns83820_probe ( struct dev *dev, struct pci_device *pci ) {
return 0;
nic->irqno = 0;
+ pci_fill_nic ( nic, pci );
nic->ioaddr = pci->ioaddr & ~3;
/* disable interrupts */
@@ -1016,4 +1018,5 @@ static int ns83820_probe ( struct dev *dev, struct pci_device *pci ) {
return 1;
}
-BOOT_DRIVER ( "NS83820/PCI", find_pci_boot_device, ns83820_driver, ns83820_probe );
+DRIVER ( "NS83820/PCI", nic_driver, pci_driver, ns83820_driver,
+ ns83820_probe, ns83820_disable );