summaryrefslogtreecommitdiffstats
path: root/sys/dev/ep/if_epvar.h
diff options
context:
space:
mode:
authormdodd <mdodd@FreeBSD.org>1999-10-27 06:25:16 +0000
committermdodd <mdodd@FreeBSD.org>1999-10-27 06:25:16 +0000
commit5b7d331b4dc9d7b8fd701fbb5328ef1b7fcd5dfb (patch)
treee829fbdae4384eba77df0f37236cbb52bd7bb73c /sys/dev/ep/if_epvar.h
parent21f0026c8502ee6b99ec2b4554601965e4ff56c4 (diff)
downloadFreeBSD-src-5b7d331b4dc9d7b8fd701fbb5328ef1b7fcd5dfb.zip
FreeBSD-src-5b7d331b4dc9d7b8fd701fbb5328ef1b7fcd5dfb.tar.gz
HEADS UP! All 3c5x9 users!
- Rip out all the static softc stuff and do softc allocation the right way. - Rewrite most of the ISA code so that it provides a DEVICE_IDENTIFY method to enumerate all non-PnP ISA devices. This has the following consequences: - No 'ep' devices may be hardwired. - All hardwired devices will probably be detected twice. By hardwired I mean: device ep0 at isa? port 0x300 irq 10 - 'ep' devices are ordered by bus, slot, and then MAC address. - Make 3c509B cards work in PnP mode. Yes, they really work. - Convert over to using ifmedia for media selection. No more of this lame 'linkX' stuff. - Consolidate a lot of duplicated code. - Make a stab at not breaking MII based PCCARD devices. I doubt that the PCCARD stuff works any more than it did before my changes but theres hope. My PCCARD hardware should arrive in a week or so. - Retreive the media settings from the card EEPROM rather than guessing. I've got a 3c509-TPO that thinks its got an AUI port and if others can report similar problems I'll write a bit of clever code that will fix this but right now it works correctly on all but 1 card. - Clean up a few things and make some cosmetic changes. - Add myself as the MAINTAINER since nobody else wants to. I'm in the best position to do this as I've got an example of most of the cards: EISA 3c579 bnc/aui MCA 3c529 tp/aui ISA 3c509 tpo ISA-PnP 3c509B combo If someone wants to send me a any cards I don't have I'd appriciate it. Also welcome are 3c59x boards since I'll be folding if_vx and if_ep at some point.
Diffstat (limited to 'sys/dev/ep/if_epvar.h')
-rw-r--r--sys/dev/ep/if_epvar.h77
1 files changed, 40 insertions, 37 deletions
diff --git a/sys/dev/ep/if_epvar.h b/sys/dev/ep/if_epvar.h
index f11c3f7..397a6b9 100644
--- a/sys/dev/ep/if_epvar.h
+++ b/sys/dev/ep/if_epvar.h
@@ -22,29 +22,48 @@
* $FreeBSD$
*/
+struct ep_board {
+ u_short prod_id; /* product ID */
+ int cmd_off; /* command offset (bit shift) */
+ int mii_trans; /* activate MII transiever */
+ u_short res_cfg; /* resource configuration */
+};
+
/*
* Ethernet software status per interface.
*/
struct ep_softc {
- struct arpcom arpcom; /* Ethernet common part */
- int ep_io_addr; /* i/o bus address */
- struct mbuf * top;
- struct mbuf * mcur;
- short cur_len;
- u_short ep_connectors; /* Connectors on this card. */
- u_char ep_connector; /* Configured connector. */
- int stat; /* some flags */
- int gone; /* adapter is not present (for PCCARD) */
- struct resource *irq; /* IRQ resource */
- void *ih; /* Interrupt handle cookie */
-#define F_RX_FIRST 0x1
-#define F_PROMISC 0x8
+ struct arpcom arpcom; /* Ethernet common part */
+ struct ifmedia ifmedia; /* media info */
+
+ device_t dev;
+
+ struct resource * iobase;
+ struct resource * irq;
+
+ bus_space_handle_t ep_bhandle;
+ bus_space_tag_t ep_btag;
+ void * ep_intrhand;
+
+ int ep_io_addr; /* i/o bus address */
+
+ u_short ep_connectors; /* Connectors on this card. */
+ u_char ep_connector; /* Configured connector.*/
+ struct mbuf * top;
+ struct mbuf * mcur;
+ short cur_len;
+
+ int stat; /* some flags */
+#define F_RX_FIRST 0x001
+#define F_PROMISC 0x008
#define F_ACCESS_32_BITS 0x100
- struct ep_board *epb;
+ int gone; /* adapter is not present (for PCCARD) */
+
+ struct ep_board epb;
- int unit;
+ int unit;
#ifdef EP_LOCAL_STATS
short tx_underrun;
@@ -56,25 +75,9 @@ struct ep_softc {
#endif
};
-struct ep_board {
- int epb_addr; /* address of this board */
- char epb_used; /* was this entry already used for configuring ? */
- /* data from EEPROM for later use */
- u_short eth_addr[3]; /* Ethernet address */
- u_short prod_id; /* product ID */
- int cmd_off; /* command offset (bit shift) */
- int mii_trans; /* activate MII transiever */
- u_short res_cfg; /* resource configuration */
-};
-
-extern struct ep_softc* ep_softc[];
-extern struct ep_board ep_board[];
-extern int ep_boards;
-extern u_long ep_unit;
-
-extern struct ep_softc* ep_alloc (int, struct ep_board *);
-extern int ep_attach (struct ep_softc *);
-extern void ep_free (struct ep_softc *);
-extern void ep_intr (void *);
-
-extern u_int16_t get_e (struct ep_softc *, int);
+int ep_alloc (device_t);
+void ep_free (device_t);
+void ep_get_media (struct ep_softc *);
+int ep_attach (struct ep_softc *);
+void ep_intr (void *);
+u_int16_t get_e (struct ep_softc *, int);
OpenPOWER on IntegriCloud