aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/ed/if_ed_novell.c
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2005-02-14 23:00:41 +0000
committerWarner Losh <imp@FreeBSD.org>2005-02-14 23:00:41 +0000
commit206189067ddfc5ca5db59c56ac8c4da43841a0ce (patch)
tree9c3b15b5214d4e806bde5e1b1bbaccce312755a9 /sys/dev/ed/if_ed_novell.c
parent16c52c1000d92526cd09bcff41d59bfc4bfe163d (diff)
downloadsrc-206189067ddfc5ca5db59c56ac8c4da43841a0ce.tar.gz
src-206189067ddfc5ca5db59c56ac8c4da43841a0ce.zip
Move the harvesting of the MAC address out of the generic novell probe
and into the bus front ends. For ISA and C-BUS cards, we always need to grab it. For PC Card, already committed, we need to do some sanity checking on the data that's in the ROMs before we decide that they are OK to use. The PC Card code has already been committed and is independent of this code (which also has to work on NE-1000 cards, assuming that those cards still work :-).
Notes
Notes: svn path=/head/; revision=141932
Diffstat (limited to 'sys/dev/ed/if_ed_novell.c')
-rw-r--r--sys/dev/ed/if_ed_novell.c31
1 files changed, 18 insertions, 13 deletions
diff --git a/sys/dev/ed/if_ed_novell.c b/sys/dev/ed/if_ed_novell.c
index 980ee05c19b0..ff55a280d577 100644
--- a/sys/dev/ed/if_ed_novell.c
+++ b/sys/dev/ed/if_ed_novell.c
@@ -64,13 +64,13 @@ static int ed_probe_gwether(device_t);
/*
* Probe and vendor-specific initialization routine for NE1000/2000 boards
*/
-int
+static int
ed_probe_Novell_generic(device_t dev, int flags)
{
struct ed_softc *sc = device_get_softc(dev);
- u_int memsize, n;
+ u_int memsize;
int error;
- u_char romdata[16], tmp;
+ u_char tmp;
static char test_pattern[32] = "THIS is A memory TEST pattern";
char test_buffer[32];
@@ -192,16 +192,6 @@ ed_probe_Novell_generic(device_t dev, int flags)
sc->rec_page_stop = sc->tx_page_start + memsize / ED_PAGE_SIZE;
sc->mem_ring = sc->mem_start + sc->txb_cnt * ED_PAGE_SIZE * ED_TXBUF_SIZE;
-
- ed_pio_readmem(sc, 0, romdata, 16);
- for (n = 0; n < ETHER_ADDR_LEN; n++)
- sc->arpcom.ac_enaddr[n] = romdata[n * (sc->isa16bit + 1)];
-
- if ((ED_FLAGS_GETTYPE(flags) == ED_FLAGS_GWETHER) &&
- (sc->arpcom.ac_enaddr[2] == 0x86)) {
- sc->type_str = "Gateway AT";
- }
-
/* clear any pending interrupts that might have occurred above */
ed_nic_outb(sc, ED_P0_ISR, 0xff);
@@ -290,3 +280,18 @@ ed_probe_gwether(device_t dev)
sc->tx_page_start = mstart / ED_PAGE_SIZE;
return 0;
}
+
+void
+ed_Novell_read_mac(struct ed_softc *sc)
+{
+ int n;
+ uint8_t romdata[16];
+
+ /*
+ * Pull the MAC address out of the roms that are on the isa
+ * version of these cards.
+ */
+ ed_pio_readmem(sc, 0, romdata, 16);
+ for (n = 0; n < ETHER_ADDR_LEN; n++)
+ sc->arpcom.ac_enaddr[n] = romdata[n * (sc->isa16bit + 1)];
+}