2012-10-27 21:17:22 +04:00
|
|
|
/* $NetBSD: tropicvar.h,v 1.14 2012/10/27 17:18:23 chs Exp $ */
|
1999-03-23 02:01:36 +03:00
|
|
|
|
2005-02-27 03:26:58 +03:00
|
|
|
/*
|
1999-03-23 01:21:26 +03:00
|
|
|
* Mach Operating System
|
|
|
|
* Copyright (c) 1991 Carnegie Mellon University
|
2005-02-27 03:26:58 +03:00
|
|
|
* Copyright (c) 1991 IBM Corporation
|
1999-03-23 01:21:26 +03:00
|
|
|
* All Rights Reserved.
|
2005-02-27 03:26:58 +03:00
|
|
|
*
|
1999-03-23 01:21:26 +03:00
|
|
|
* 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,
|
2005-02-27 03:26:58 +03:00
|
|
|
* and that the name IBM not be used in advertising or publicity
|
1999-03-23 01:21:26 +03:00
|
|
|
* pertaining to distribution of the software without specific, written
|
|
|
|
* prior permission.
|
2005-02-27 03:26:58 +03:00
|
|
|
*
|
1999-03-23 01:21:26 +03:00
|
|
|
* 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.
|
2005-02-27 03:26:58 +03:00
|
|
|
*
|
1999-03-23 01:21:26 +03:00
|
|
|
* Carnegie Mellon requests users of this software to return to
|
2005-02-27 03:26:58 +03:00
|
|
|
*
|
1999-03-23 01:21:26 +03:00
|
|
|
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
|
|
|
|
* School of Computer Science
|
|
|
|
* Carnegie Mellon University
|
|
|
|
* Pittsburgh PA 15213-3890
|
2005-02-27 03:26:58 +03:00
|
|
|
*
|
1999-03-23 01:21:26 +03:00
|
|
|
* 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 {
|
2012-10-27 21:17:22 +04:00
|
|
|
device_t sc_dev;
|
1999-03-23 01:21:26 +03:00
|
|
|
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;
|
|
|
|
|
2005-02-04 05:10:35 +03:00
|
|
|
int (*sc_mediachange)(struct tr_softc *);
|
|
|
|
void (*sc_mediastatus)(struct tr_softc *, struct ifmediareq *);
|
1999-03-23 01:21:26 +03:00
|
|
|
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;
|
2007-03-04 08:59:00 +03:00
|
|
|
void * 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
|
|
|
|
2005-02-27 03:26:58 +03:00
|
|
|
/* Power management hooks */
|
2005-02-04 05:10:35 +03:00
|
|
|
int (*sc_enable)(struct tr_softc *);
|
|
|
|
void (*sc_disable)(struct tr_softc *);
|
2000-06-14 00:00:02 +04:00
|
|
|
int sc_enabled;
|
1999-03-23 01:21:26 +03:00
|
|
|
};
|
|
|
|
|
2005-02-04 05:10:35 +03:00
|
|
|
int tr_config(struct tr_softc *);
|
|
|
|
int tr_attach(struct tr_softc *);
|
|
|
|
int tr_intr(void *);
|
|
|
|
void tr_init(void *);
|
2007-03-04 08:59:00 +03:00
|
|
|
int tr_ioctl(struct ifnet *, u_long, void *);
|
2005-02-04 05:10:35 +03:00
|
|
|
void tr_stop(struct tr_softc *);
|
|
|
|
int tr_reset(struct tr_softc *);
|
|
|
|
void tr_sleep(struct tr_softc *);
|
|
|
|
int tr_setspeed(struct tr_softc *, u_int8_t);
|
|
|
|
int tr_enable(struct tr_softc *);
|
|
|
|
void tr_disable(struct tr_softc *);
|
2009-05-12 18:16:35 +04:00
|
|
|
int tr_activate(device_t, enum devact);
|
|
|
|
int tr_detach(device_t, int flags);
|