2000-06-14 00:00:02 +04:00
|
|
|
/* $NetBSD: tropicvar.h,v 1.8 2000/06/13 20:00:03 soren Exp $ */
|
1999-03-23 02:01:36 +03:00
|
|
|
|
1999-03-23 01:21:26 +03:00
|
|
|
/*
|
|
|
|
* Mach Operating System
|
|
|
|
* Copyright (c) 1991 Carnegie Mellon University
|
|
|
|
* Copyright (c) 1991 IBM Corporation
|
|
|
|
* All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Permission to use, copy, modify and distribute this software and its
|
|
|
|
* documentation is hereby granted, provided that both the copyright
|
|
|
|
* notice and this permission notice appear in all copies of the
|
|
|
|
* software, derivative works or modified versions, and any portions
|
|
|
|
* thereof, and that both notices appear in supporting documentation,
|
|
|
|
* and that the name IBM not be used in advertising or publicity
|
|
|
|
* pertaining to distribution of the software without specific, written
|
|
|
|
* prior permission.
|
|
|
|
*
|
|
|
|
* CARNEGIE MELLON AND IBM ALLOW FREE USE OF THIS SOFTWARE IN ITS "AS IS"
|
|
|
|
* CONDITION. CARNEGIE MELLON AND IBM DISCLAIM ANY LIABILITY OF ANY KIND FOR
|
|
|
|
* ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
|
|
|
|
*
|
|
|
|
* Carnegie Mellon requests users of this software to return to
|
|
|
|
*
|
|
|
|
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
|
|
|
|
* School of Computer Science
|
|
|
|
* Carnegie Mellon University
|
|
|
|
* Pittsburgh PA 15213-3890
|
|
|
|
*
|
|
|
|
* any improvements or extensions that they make and grant Carnegie Mellon
|
|
|
|
* the rights to redistribute these changes.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* $ACIS:if_lanvar.h 12.0$ */
|
|
|
|
|
2000-03-23 10:01:25 +03:00
|
|
|
#include <sys/callout.h>
|
|
|
|
|
1999-03-23 01:21:26 +03:00
|
|
|
/*
|
|
|
|
* This file contains structures used in the "tr" driver for the
|
|
|
|
* IBM TOKEN-RING NETWORK PC ADAPTER
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* Receive buffer control block */
|
|
|
|
struct rbcb {
|
|
|
|
bus_size_t rbufp; /* offset of current receive buffer */
|
|
|
|
bus_size_t rbufp_next; /* offset of next receive buffer */
|
|
|
|
bus_size_t rbuf_datap; /* offset of data in receive buffer */
|
|
|
|
unsigned short data_len; /* amount of data in this rec buffer */
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Token-Ring software status per adapter
|
|
|
|
*/
|
|
|
|
struct tr_softc {
|
|
|
|
struct device sc_dev;
|
|
|
|
void *sc_ih;
|
|
|
|
struct ethercom sc_ethercom;
|
|
|
|
struct ifmedia sc_media;
|
|
|
|
u_char sc_xmit_correlator;
|
|
|
|
int sc_xmit_buffers;
|
|
|
|
#if 1
|
|
|
|
int sc_xmit_head;
|
|
|
|
int sc_xmit_tail;
|
|
|
|
#endif
|
|
|
|
int sc_minbuf;
|
|
|
|
int sc_nbuf;
|
|
|
|
bus_size_t sc_txca;
|
|
|
|
|
|
|
|
bus_space_tag_t sc_piot;
|
|
|
|
bus_space_tag_t sc_memt;
|
|
|
|
bus_space_handle_t sc_pioh; /* handle pio area */
|
|
|
|
bus_space_handle_t sc_sramh; /* handle for the shared ram area */
|
|
|
|
bus_space_handle_t sc_mmioh; /* handle for the bios/mmio area */
|
|
|
|
|
2000-03-23 10:01:25 +03:00
|
|
|
struct callout sc_init_callout;
|
|
|
|
struct callout sc_reinit_callout;
|
|
|
|
|
1999-03-23 01:21:26 +03:00
|
|
|
int (*sc_mediachange) __P((struct tr_softc *));
|
|
|
|
void (*sc_mediastatus) __P((struct tr_softc *, struct ifmediareq *));
|
|
|
|
struct rbcb rbc; /* receiver buffer control block */
|
|
|
|
bus_size_t sc_aca; /* offset of adapter ACA */
|
|
|
|
bus_size_t sc_ssb; /* offset of System Status Block */
|
|
|
|
bus_size_t sc_arb; /* offset of Adapter Request Block */
|
|
|
|
bus_size_t sc_srb; /* offset of System Request Block */
|
|
|
|
bus_size_t sc_asb; /* offset of Adapter Status Block */
|
1999-04-29 19:47:02 +04:00
|
|
|
u_int sc_maddr; /* mapped shared memory address */
|
1999-03-23 01:21:26 +03:00
|
|
|
u_int sc_memwinsz; /* mapped shared memory window size */
|
|
|
|
u_int sc_memsize; /* memory installed on adapter */
|
|
|
|
u_int sc_memreserved; /* reserved memory on adapter */
|
|
|
|
int sc_dhb4maxsz; /* max. dhb size at 4MBIT ring speed */
|
|
|
|
int sc_dhb16maxsz; /* max. dbh size at 16MBIT ring speed */
|
|
|
|
int sc_maxmtu; /* max. MTU supported by adapter */
|
|
|
|
unsigned char sc_init_status;
|
1999-04-29 19:47:02 +04:00
|
|
|
caddr_t tr_sleepevent; /* tr event signalled on successful */
|
1999-03-23 01:21:26 +03:00
|
|
|
/* open of adapter */
|
|
|
|
unsigned short exsap_station; /* station assigned by open sap cmd */
|
2000-06-06 20:26:57 +04:00
|
|
|
|
2000-06-14 00:00:02 +04:00
|
|
|
void *sc_sdhook;
|
2000-06-06 20:26:57 +04:00
|
|
|
|
|
|
|
/* Power management hooks */
|
2000-06-14 00:00:02 +04:00
|
|
|
int (*sc_enable) __P((struct tr_softc *));
|
|
|
|
void (*sc_disable) __P((struct tr_softc *));
|
|
|
|
int sc_enabled;
|
1999-03-23 01:21:26 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
int tr_config __P((struct tr_softc *));
|
1999-04-29 19:47:02 +04:00
|
|
|
int tr_attach __P((struct tr_softc *));
|
1999-03-23 01:21:26 +03:00
|
|
|
int tr_intr __P((void *));
|
|
|
|
void tr_init __P((void *));
|
|
|
|
int tr_ioctl __P((struct ifnet *, u_long, caddr_t));
|
1999-04-29 19:47:02 +04:00
|
|
|
void tr_stop __P((struct tr_softc *));
|
|
|
|
int tr_reset __P((struct tr_softc *));
|
1999-03-23 01:21:26 +03:00
|
|
|
void tr_sleep __P((struct tr_softc *));
|
|
|
|
int tr_setspeed __P((struct tr_softc *, u_int8_t));
|
2000-06-06 20:26:57 +04:00
|
|
|
int tr_enable __P((struct tr_softc *));
|
|
|
|
void tr_disable __P((struct tr_softc *));
|
|
|
|
int tr_activate __P((struct device *, enum devact));
|
|
|
|
int tr_detach __P((struct device *, int flags));
|