summaryrefslogtreecommitdiffstats
path: root/src/drivers/net/epic100.c
diff options
context:
space:
mode:
authorMichael Brown2005-04-13 03:31:44 +0200
committerMichael Brown2005-04-13 03:31:44 +0200
commitf39cc6d978e29b7371f94d38de231a0d534e8d86 (patch)
treeee4885e45d688e995760cdd663feaa3abe37285b /src/drivers/net/epic100.c
parentFix type of dummy_irq() (diff)
downloadipxe-f39cc6d978e29b7371f94d38de231a0d534e8d86.tar.gz
ipxe-f39cc6d978e29b7371f94d38de231a0d534e8d86.tar.xz
ipxe-f39cc6d978e29b7371f94d38de231a0d534e8d86.zip
Finished by hand
Diffstat (limited to 'src/drivers/net/epic100.c')
-rw-r--r--src/drivers/net/epic100.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/src/drivers/net/epic100.c b/src/drivers/net/epic100.c
index 2360aed2..efe93c98 100644
--- a/src/drivers/net/epic100.c
+++ b/src/drivers/net/epic100.c
@@ -8,6 +8,7 @@
#include "pci.h"
#include "nic.h"
#include "timer.h"
+#include "console.h"
#include "epic100.h"
/* Condensed operations for readability */
@@ -59,6 +60,9 @@ static int read_eeprom(int location);
static int mii_read(int phy_id, int location);
static void epic100_irq(struct nic *nic, irq_action_t action);
+static struct nic_operations epic100_operations;
+static struct pci_driver epic100_driver;
+
static int ioaddr;
static int command;
@@ -94,16 +98,17 @@ static unsigned char tx_packet[PKT_BUF_SZ * TX_RING_SIZE];
/***********************************************************************/
- static int
+static int
epic100_probe ( struct dev *dev ) {
-
struct nic *nic = nic_device ( dev );
-
struct pci_device *pci = pci_device ( dev );
int i;
unsigned short* ap;
unsigned int phy, phy_idx;
+ if ( ! find_pci_device ( pci, &epic100_driver ) )
+ return 0;
+
if (pci->ioaddr == 0)
return 0;
@@ -202,14 +207,6 @@ epic100_probe ( struct dev *dev ) {
}
epic100_open();
-static struct nic_operations epic100_operations;
-static struct nic_operations epic100_operations = {
- .connect = dummy_connect,
- .poll = epic100_poll,
- .transmit = epic100_transmit,
- .irq = epic100_irq,
- .disable = epic100_disable,
-};
nic->nic_op = &epic100_operations;
return 1;
@@ -509,6 +506,13 @@ mii_read(int phy_id, int location)
return inw(mmdata);
}
+static struct nic_operations epic100_operations = {
+ .connect = dummy_connect,
+ .poll = epic100_poll,
+ .transmit = epic100_transmit,
+ .irq = epic100_irq,
+ .disable = epic100_disable,
+};
static struct pci_id epic100_nics[] = {
PCI_ROM(0x10b8, 0x0005, "epic100", "SMC EtherPowerII"), /* SMC 83c170 EPIC/100 */