if_csvar.h revision 140927
1178172Simp/*-
2178172Simp * Copyright (c) 1999 M. Warner Losh <imp@village.org>
3178172Simp * All rights reserved.
4178172Simp *
5178172Simp * Redistribution and use in source and binary forms, with or without
6178172Simp * modification, are permitted provided that the following conditions
7178172Simp * are met:
8178172Simp * 1. Redistributions of source code must retain the above copyright
9178172Simp *    notice, this list of conditions and the following disclaimer.
10178172Simp * 2. Redistributions in binary form must reproduce the above copyright
11178172Simp *    notice, this list of conditions and the following disclaimer in the
12178172Simp *    documentation and/or other materials provided with the distribution.
13178172Simp *
14178172Simp * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
15178172Simp * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
16178172Simp * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
17178172Simp * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
18178172Simp * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19178172Simp * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20178172Simp * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21178172Simp * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22178172Simp * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23178172Simp * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24178172Simp *
25178172Simp * $FreeBSD: head/sys/dev/cs/if_csvar.h 140927 2005-01-28 06:45:42Z imp $
26178172Simp */
27178172Simp
28178172Simp#ifndef _IF_CSVAR_H
29178172Simp#define _IF_CSVAR_H
30178172Simp
31178172Simp#include <net/if_arp.h>
32178172Simp#include <net/if_media.h>
33178172Simp
34178172Simp/*
35178172Simp * cs_softc: per line info and status
36178172Simp */
37178172Simpstruct cs_softc {
38178172Simp	/* Ethernet common code */
39178172Simp	struct arpcom arpcom;
40178172Simp
41178172Simp	/* Configuration words from EEPROM */
42178172Simp	int auto_neg_cnf;               /* AutoNegotitation configuration */
43178172Simp	int adapter_cnf;                /* Adapter configuration */
44178172Simp	int isa_config;                 /* ISA configuration */
45178172Simp	int chip_type;			/* Type of chip */
46178172Simp
47178172Simp	struct ifmedia media;		/* Media information */
48178172Simp
49178172Simp	int     port_rid;		/* resource id for port range */
50178172Simp	int     port_used;		/* nonzero if ports used */
51178172Simp	struct resource* port_res;	/* resource for port range */
52178172Simp	int     mem_rid;  		/* resource id for memory range */
53178172Simp	int     mem_used;  		/* nonzero if memory used */
54178172Simp	struct resource* mem_res;	/* resource for memory range */
55178172Simp	int     irq_rid;		/* resource id for irq */
56178172Simp	struct resource* irq_res;	/* resource for irq */
57178172Simp	void*   irq_handle;		/* handle for irq handler */
58178172Simp
59178172Simp	int	flags;
60178172Simp#define	CS_NO_IRQ	0x1
61178172Simp	int 	nic_addr; 		/* Base IO address of card */
62178172Simp	int	send_cmd;
63178172Simp	int	line_ctl;		/* */
64178172Simp	int	send_underrun;
65178172Simp	void	*recv_ring;
66178172Simp
67178172Simp	unsigned char *buffer;
68178172Simp	int buf_len;
69178172Simp};
70178172Simp
71178172Simpint	cs_alloc_port(device_t dev, int rid, int size);
72178172Simpint	cs_alloc_memory(device_t dev, int rid, int size);
73178172Simpint	cs_alloc_irq(device_t dev, int rid, int flags);
74178172Simpint	cs_attach(device_t dev);
75178172Simpint	cs_cs89x0_probe(device_t dev);
76178172Simpint	cs_detach(device_t dev);
77178172Simpvoid	cs_release_resources(device_t dev);
78178172Simpdriver_intr_t	csintr;
79178172Simp
80178172Simp#endif /* _IF_CSVAR_H */
81178172Simp