if_ievar.h revision 181134
1306196Sjkim/*-
296593Smarkm * $FreeBSD: head/sys/dev/ie/if_ievar.h 181134 2008-08-01 21:33:07Z jhb $
396593Smarkm */
4142429Snectar
596593Smarkmenum ie_hardware {
696593Smarkm	IE_NONE,
796593Smarkm        IE_STARLAN10,
896593Smarkm        IE_EN100,
996593Smarkm        IE_SLFIBER,
1096593Smarkm        IE_3C507,
1196593Smarkm        IE_NI5210,
1296593Smarkm        IE_EE16,
1396593Smarkm        IE_UNKNOWN
1496593Smarkm};
1596593Smarkm
1696593Smarkm/*
1796593Smarkm * Ethernet status, per interface.
1896593Smarkm */
1996593Smarkmstruct ie_softc {
20215698Ssimon	struct	 ifnet *ifp;
21215698Ssimon	void	 (*ie_reset_586) (struct ie_softc *);
22215698Ssimon	void	 (*ie_chan_attn) (struct ie_softc *);
23215698Ssimon	enum	 ie_hardware hard_type;
24215698Ssimon	int	 hard_vers;
2596593Smarkm	u_char	 enaddr[6];
2696593Smarkm
2796593Smarkm	device_t		dev;
2896593Smarkm
2996593Smarkm	struct resource *	io_res;
3096593Smarkm	int			io_rid;
3196593Smarkm	bus_space_tag_t		io_bt;
3296593Smarkm	bus_space_handle_t	io_bh;
3396593Smarkm
3496593Smarkm	struct resource	*	irq_res;
3596593Smarkm	int			irq_rid;
3696593Smarkm	void *			irq_ih;
3796593Smarkm
3896593Smarkm	struct resource *	mem_res;
3996593Smarkm	int			mem_rid;
4096593Smarkm	bus_space_tag_t		mem_bt;
41276864Sjkim	bus_space_handle_t	mem_bh;
42276864Sjkim
4396593Smarkm	u_int	 port;		/* i/o base address for this interface */
4496593Smarkm	caddr_t	 iomem;		/* memory size */
45215698Ssimon	caddr_t	 iomembot;	/* memory base address */
46215698Ssimon	unsigned iosize;
47215698Ssimon	int	 bus_use;	/* 0 means 16bit, 1 means 8 bit adapter */
48215698Ssimon
49142429Snectar	int	 want_mcsetup;
50215698Ssimon	int	 promisc;
51142429Snectar	int	 nframes;
52142429Snectar	int	 nrxbufs;
53276864Sjkim	int	 ntxbufs;
54276864Sjkim	volatile struct ie_int_sys_conf_ptr *iscp;
55276864Sjkim	volatile struct ie_sys_ctl_block *scb;
5696593Smarkm	volatile struct ie_recv_frame_desc **rframes;	/* nframes worth */
57276864Sjkim	volatile struct ie_recv_buf_desc **rbuffs;	/* nrxbufs worth */
58276864Sjkim	volatile u_char **cbuffs;			/* nrxbufs worth */
59276864Sjkim	int	 rfhead, rftail, rbhead, rbtail;
60276864Sjkim
61276864Sjkim	volatile struct ie_xmit_cmd **xmit_cmds;	/* ntxbufs worth */
62276864Sjkim	volatile struct ie_xmit_buf **xmit_buffs;	/* ntxbufs worth */
63215698Ssimon	volatile u_char	 **xmit_cbuffs;			/* ntxbufs worth */
64276864Sjkim	int	 xmit_count;
65276864Sjkim
66276864Sjkim	struct	 ie_en_addr mcast_addrs[MAXMCAST + 1];
67276864Sjkim	int	 mcast_count;
68276864Sjkim
69215698Ssimon	u_short	 irq_encoded;	/* encoded interrupt on IEE16 */
70276864Sjkim
7196593Smarkm	struct mtx	lock;
7296593Smarkm};
7396593Smarkm#define PORT(sc)	sc->port
7496593Smarkm#define MEM(sc)		sc->iomem
7596593Smarkm
7696593Smarkm#define	IE_LOCK(sc)		mtx_lock(&(sc)->lock)
7796593Smarkm#define	IE_UNLOCK(sc)		mtx_unlock(&(sc)->lock)
7896593Smarkm#define	IE_ASSERT_LOCKED(sc)	mtx_assert(&(sc)->lock, MA_OWNED)
7996593Smarkm
8096593Smarkmvoid            ie_intr			(void *);
8196593Smarkmint		ie_alloc_resources	(device_t);
8296593Smarkmvoid		ie_release_resources	(device_t);
8396593Smarkmint		ie_attach		(device_t);
8496593Smarkmint		ie_detach		(device_t);
8596593Smarkm
8696593Smarkmvoid		el_reset_586		(struct ie_softc *);
8796593Smarkmvoid		el_chan_attn		(struct ie_softc *);
8896593Smarkm
8996593Smarkmvoid		sl_reset_586		(struct ie_softc *);
9096593Smarkmvoid		sl_chan_attn		(struct ie_softc *);
9196593Smarkm
9296593Smarkmvoid		ee16_reset_586		(struct ie_softc *);
9396593Smarkmvoid		ee16_chan_attn		(struct ie_softc *);
9496593Smarkmvoid		ee16_shutdown		(struct ie_softc *);
9596593Smarkm
9696593Smarkmvoid		sl_read_ether		(struct ie_softc *, unsigned char *);
9796593Smarkmint		check_ie_present	(struct ie_softc *);
9896593Smarkm
9996593Smarkm