/*
* Copyright 1997
* Digital Equipment Corporation. All rights reserved.
*
* This software is furnished under license and may be used and
* copied only in accordance with the following terms and conditions.
* Subject to these conditions, you may download, copy, install,
* use, modify and distribute this software in source and/or binary
* form. No title or ownership is transferred hereby.
*
* 1) Any source code used, modified or distributed must reproduce
* and retain this copyright notice and list of conditions as
* they appear in the source file.
*
* 2) No right is granted to use any trade name, trademark, or logo of
* Digital Equipment Corporation. Neither the "Digital Equipment
* Corporation" name nor any trademark or logo of Digital Equipment
* Corporation may be used to endorse or promote products derived
* from this software without the prior written permission of
* Digital Equipment Corporation.
*
* 3) This software is provided "AS-IS" and any express or implied
* warranties, including but not limited to, any implied warranties
* of merchantability, fitness for a particular purpose, or
* non-infringement are disclaimed. In no event shall DIGITAL be
* liable for any damages whatsoever, and in particular, DIGITAL
* shall not be liable for special, indirect, consequential, or
* incidental damages or damages for lost profits, loss of
* revenue or loss of use, whether such damages arise in contract,
* negligence, tort, under statute, in equity, at law or otherwise,
* even if advised of the possibility of such damage.
*/
/*
* Ethernet software status per interface.
*
* Each interface is referenced by a network interface structure,
* arpcom.ac_if, which the routing code uses to locate the interface.
* This structure contains the output queue for the interface,
* its address, ...
*/
struct cs_softc {
device_t sc_dev; /* base device glue */
struct ethercom sc_ethercom; /* Ethernet common */
struct ifmedia sc_media; /* media control structures */
void *sc_ih; /* interrupt handler */
bus_space_tag_t sc_iot; /* bus space tag for IO */
bus_space_tag_t sc_memt; /* bus space tag for memory mode */
bus_space_handle_t sc_ioh; /* bus space handles */
bus_space_handle_t sc_memh;
#if 0
isa_chipset_tag_t sc_ic; /* ISA chipset */
#endif
int sc_irq; /* IRQ line */
int sc_prodid; /* saved product ID */
int sc_prodrev; /* saved product rev */
bus_addr_t sc_pktpgaddr; /* PacketPage bus memory address */
int sc_cfgflags; /* software configuration flags */
int sc_memorymode; /* are we in memory mode? */
int sc_txbusy; /* transmit in progress */
int sc_resetting; /* reset in progress */
int sc_xe_ent; /* current early-xmit table entry */
int sc_xe_togo; /* # of packets to go at this ent */
int sc_carrier; /* has carrier */
u_int8_t sc_enaddr[ETHER_ADDR_LEN]; /* MAC address */
int eeprom_size; /* how large is the eeprom (in bytes) */
u_int16_t *eeprom_data; /* copy of the eeprom data */
krndsource_t rnd_source; /* random source */
/* power management */
int (*sc_enable)(struct cs_softc *);
void (*sc_disable)(struct cs_softc *);
if (sc->sc_cfgflags & CFGFLG_CARDBUS_HACK) {
/*
* hack for EtherJet PCMCIA and cardbus (obtained from freebsd)
*
* EtherJet PCMCIA don't work with cardbus bridges
* (at least TI1250) without this hack.
*/
result = (IO_READ_1(sc, off) & 0xff);
result |= ((IO_READ_1(sc, off+1) & 0xff) << 8);
}
else {
result = IO_READ_2(sc, off);
}