if_csvar.h revision 147256
1139749Simp/*- 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 147256 2005-06-10 16:49:24Z brooks $ 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 { 38140927Simp /* Ethernet common code */ 39147256Sbrooks struct ifnet *ifp; 4071316Simp 41140927Simp /* Configuration words from EEPROM */ 42140927Simp int auto_neg_cnf; /* AutoNegotitation configuration */ 4371316Simp int adapter_cnf; /* Adapter configuration */ 44140927Simp int isa_config; /* ISA configuration */ 45140927Simp int chip_type; /* Type of chip */ 4671316Simp 47147256Sbrooks u_char enaddr[6]; 48147256Sbrooks 49140927Simp struct ifmedia media; /* Media information */ 5071316Simp 5171316Simp int port_rid; /* resource id for port range */ 5271316Simp int port_used; /* nonzero if ports used */ 5371316Simp struct resource* port_res; /* resource for port range */ 5471316Simp int mem_rid; /* resource id for memory range */ 55140927Simp int mem_used; /* nonzero if memory used */ 5671316Simp struct resource* mem_res; /* resource for memory range */ 57140927Simp int irq_rid; /* resource id for irq */ 58140927Simp struct resource* irq_res; /* resource for irq */ 59140927Simp void* irq_handle; /* handle for irq handler */ 6071316Simp 61140926Simp int flags; 62140926Simp#define CS_NO_IRQ 0x1 63140927Simp int nic_addr; /* Base IO address of card */ 6471316Simp int send_cmd; 65140927Simp int line_ctl; /* */ 66140927Simp int send_underrun; 67140927Simp void *recv_ring; 6871316Simp 69140927Simp unsigned char *buffer; 70140927Simp int buf_len; 7171316Simp}; 7271316Simp 7371316Simpint cs_alloc_port(device_t dev, int rid, int size); 7471316Simpint cs_alloc_memory(device_t dev, int rid, int size); 7571316Simpint cs_alloc_irq(device_t dev, int rid, int flags); 76121816Sbrooksint cs_attach(device_t dev); 7771316Simpint cs_cs89x0_probe(device_t dev); 78140888Simpint cs_detach(device_t dev); 7971316Simpvoid cs_release_resources(device_t dev); 8071316Simpdriver_intr_t csintr; 8171316Simp 8271316Simp#endif /* _IF_CSVAR_H */ 83