if_csvar.h revision 71316
171316Simp/*
271316Simp * Copyright (c) 1999 M. Warner Losh <imp@village.org>
371316Simp * All rights reserved.
471316Simp *
571316Simp * Redistribution and use in source and binary forms, with or without
671316Simp * modification, are permitted provided that the following conditions
771316Simp * are met:
871316Simp * 1. Redistributions of source code must retain the above copyright
971316Simp *    notice, this list of conditions and the following disclaimer.
1071316Simp * 2. Redistributions in binary form must reproduce the above copyright
1171316Simp *    notice, this list of conditions and the following disclaimer in the
1271316Simp *    documentation and/or other materials provided with the distribution.
1371316Simp *
1471316Simp * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
1571316Simp * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
1671316Simp * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
1771316Simp * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
1871316Simp * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
1971316Simp * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2071316Simp * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2171316Simp * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2271316Simp * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
2371316Simp * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2471316Simp *
2571316Simp * $FreeBSD: head/sys/dev/cs/if_csvar.h 71316 2001-01-21 04:56:12Z imp $
2671316Simp */
2771316Simp
2871316Simp#ifndef _IF_CSVAR_H
2971316Simp#define _IF_CSVAR_H
3071316Simp
3171316Simp#include <net/if_arp.h>
3271316Simp#include <net/if_media.h>
3371316Simp
3471316Simp/*
3571316Simp * cs_softc: per line info and status
3671316Simp */
3771316Simpstruct cs_softc {
3871316Simp
3971316Simp        /* Ethernet common code */
4071316Simp        struct arpcom arpcom;
4171316Simp
4271316Simp        /* Configuration words from EEPROM */
4371316Simp        int auto_neg_cnf;               /* AutoNegotitation configuration */
4471316Simp	int adapter_cnf;                /* Adapter configuration */
4571316Simp        int isa_config;                 /* ISA configuration */
4671316Simp        int chip_type;			/* Type of chip */
4771316Simp
4871316Simp        struct ifmedia media;		/* Media information */
4971316Simp
5071316Simp	int     port_rid;		/* resource id for port range */
5171316Simp	int     port_used;		/* nonzero if ports used */
5271316Simp	struct resource* port_res;	/* resource for port range */
5371316Simp	int     mem_rid;  		/* resource id for memory range */
5471316Simp        int     mem_used;  		/* nonzero if memory used */
5571316Simp	struct resource* mem_res;	/* resource for memory range */
5671316Simp        int     irq_rid;		/* resource id for irq */
5771316Simp        struct resource* irq_res;	/* resource for irq */
5871316Simp        void*   irq_handle;		/* handle for irq handler */
5971316Simp
6071316Simp        int 	nic_addr; 		/* Base IO address of card */
6171316Simp	int	send_cmd;
6271316Simp        int	line_ctl;		/* */
6371316Simp        int	send_underrun;
6471316Simp        void	*recv_ring;
6571316Simp
6671316Simp        unsigned char *buffer;
6771316Simp        int buf_len;
6871316Simp};
6971316Simp
7071316Simpint	cs_alloc_port(device_t dev, int rid, int size);
7171316Simpint	cs_alloc_memory(device_t dev, int rid, int size);
7271316Simpint	cs_alloc_irq(device_t dev, int rid, int flags);
7371316Simpint	cs_attach(struct cs_softc *, int, int);
7471316Simpint	cs_cs89x0_probe(device_t dev);
7571316Simpvoid	cs_release_resources(device_t dev);
7671316Simpdriver_intr_t	csintr;
7771316Simp
7871316Simp#endif /* _IF_CSVAR_H */
79