| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* | 
 | 2 |  * The bios low-memory structure | 
 | 3 |  * | 
 | 4 |  * Some of the variables in here can be used to set parameters that | 
 | 5 |  * are stored in NVRAM and will retain their old values the next time | 
 | 6 |  * the card is brought up.  To use the values stored in NVRAM, the | 
 | 7 |  * parameter should be set to "all ones".  This tells the firmware to | 
 | 8 |  * use the NVRAM value or a suitable default.  The value that is used | 
 | 9 |  * will be stored back into this structure by the firmware.  If the | 
 | 10 |  * value of the variable is not "all ones", then that value will be | 
 | 11 |  * used and will be stored into NVRAM if it isn't already there. | 
 | 12 |  * The variables this applies to are the following: | 
 | 13 |  *	Variable	Set to:		Gets default of: | 
 | 14 |  *	bc_hashexpire	-1		300	(5 minutes) | 
 | 15 |  *	bc_spantree	-1		1	(spanning tree on) | 
 | 16 |  *	bc_ipaddr	FF:FF:FF:FF	0	(no SNMP IP address) | 
 | 17 |  *	bc_ipxnet	FF:FF:FF:FF	0	(no SNMP IPX net) | 
 | 18 |  *	bc_iptrap	FF:FF:FF:FF	0	(no SNMP IP trap address) | 
 | 19 |  * | 
 | 20 |  * Some variables MUST have their value set after the firmware | 
 | 21 |  * is loaded onto the board, but before the processor is released. | 
 | 22 |  * These are: | 
 | 23 |  *	bc_host		0 means no host "port", run as standalone switch. | 
 | 24 |  *			1 means run as a switch, with a host port. (normal) | 
 | 25 |  *			2 means run as multiple NICs, not as a switch. | 
 | 26 |  *			-1 means run in diagnostics mode. | 
 | 27 |  *	bc_nowait | 
 | 28 |  *	bc_hostarea_len | 
 | 29 |  *	bc_filter_len | 
 | 30 |  *			 | 
 | 31 |  */ | 
 | 32 | BEGIN_STRUCT(bios_comm) | 
 | 33 | 	S4(ulong, bc_intflag)	/* Count of all interrupts */ | 
 | 34 | 	S4(ulong, bc_lbolt)	/* Count of timer interrupts */ | 
 | 35 | 	S4(ulong, bc_maincnt)	/* Count of main loops */ | 
 | 36 | 	S4(ulong, bc_hashcnt)	/* Count of entries in hash table */ | 
 | 37 | 	S4A(ulong, bc_cnt, 8)	/* Misc counters, for debugging */ | 
 | 38 | 	S4A(ulong, bc_flag, 8)	/* Misc flags, for debugging */ | 
 | 39 | 	S4(ulong, bc_memsize)	/* Size of memory */ | 
 | 40 | 	S4(ulong, bc_dcache)	/* Size of working dcache */ | 
 | 41 | 	S4(ulong, bc_icache)	/* Size of working icache */ | 
 | 42 | 	S4(long, bc_status)	/* Firmware status */ | 
 | 43 | 	S1A(char, bc_file, 8)	/* File name of assertion failure */ | 
 | 44 | 	S4(ulong, bc_line)	/* Line # of assertion failure */ | 
 | 45 | 	S4(uchar *, bc_ramstart) | 
 | 46 | 	S4(uchar *, bc_ramend) | 
 | 47 | 	S4(uchar *, bc_heapstart) /* Start of heap (end of loaded memory) */ | 
 | 48 | 	S4(uchar *, bc_heapend)	/* End of heap */ | 
 | 49 |  | 
 | 50 | 	/* Configurable Parameters */ | 
 | 51 | 	S4(long, bc_host)	/* 1=Host Port, 0=No Host Port, -1=Test Mode */ | 
 | 52 | 	S4(long, bc_nowait)	/* Don't wait for 2host circ buffer to empty*/ | 
 | 53 | 	S4(long, bc_150ohm)	/* 0 == 100 ohm UTP, 1 == 150 ohm STP */ | 
 | 54 | 	S4(long, bc_squelch)	/* 0 == normal squelch, 1 == reduced squelch */ | 
 | 55 | 	S4(ulong, bc_hashexpire) /* Expiry time in seconds for hash table */ | 
 | 56 | 	S4(long, bc_spantree)	/* 1 == enable IEEE spanning tree */ | 
 | 57 |  | 
 | 58 | 	S2A(ushort, bc_eaddr, 3) /* New ether address */ | 
 | 59 | 	S2(ushort, bc_dummy1)	/* padding for DOS compilers */ | 
 | 60 |  | 
 | 61 | 	/* Various debugging aids */ | 
 | 62 | 	S4(long, bc_debug)	/* Debugging is turned on */ | 
 | 63 | 	S4(long, bc_spew)	/* Spew data on port 4 for bs_spew seconds */ | 
 | 64 | 	S4(long, bc_spewlen)	/* Length of spewed data packets */ | 
 | 65 | 	S4(long, bc_maxrfd)	/* If != 0, max number of RFD's to allocate */ | 
 | 66 | 	S4(long, bc_maxrbd)	/* If != 0, max number of RBD's to allocate */ | 
 | 67 |  | 
 | 68 | 	/* Circular buffers for messages to/from host */ | 
 | 69 | 	S4(ulong, bc_2host_head) | 
 | 70 | 	S4(ulong, bc_2host_tail) | 
 | 71 | 	S4(ulong, bc_2host_mask) | 
 | 72 | 	S1A(char, bc_2host, 0x200)	/* Circ buff to host */ | 
 | 73 |  | 
 | 74 | 	S4(ulong, bc_2idt_head) | 
 | 75 | 	S4(ulong, bc_2idt_tail) | 
 | 76 | 	S4(ulong, bc_2idt_mask) | 
 | 77 | 	S1A(char, bc_2idt, 0x200)	/* Circ buff to idt */ | 
 | 78 |  | 
 | 79 | 	/* Pointers to structures for driver access */ | 
 | 80 | 	S4(uchar *, bc_port)	/* pointer to Port[] structures */ | 
 | 81 | 	S4(long, bc_nports)	/* Number of ports */ | 
 | 82 | 	S4(long, bc_portlen)	/* sizeof(PORT) */ | 
 | 83 | 	S4(uchar *, bc_hash)	/* Pointer to hash table */ | 
 | 84 | 	S4(long, bc_hashlen)	/* sizeof(Table) */ | 
 | 85 |  | 
 | 86 | 	/* SNMP agent addresses */ | 
 | 87 | 	S1A(uchar, bc_ipaddr, 4) /* IP address for SNMP */ | 
 | 88 | 	S1A(uchar, bc_ipxnet, 4) /* IPX net address for SNMP */ | 
 | 89 |  | 
 | 90 | 	S4(long, bc_nohostintr) /* Do not cause periodic host interrupts */ | 
 | 91 |  | 
 | 92 | 	S4(uchar *, bc_dmaaddr) /* Physical addr of host DMA buf for diags */ | 
 | 93 | 	S4(ulong, bc_dmalen)	/* Length of DMA buffer 0..2048 */ | 
 | 94 |  | 
 | 95 | 	/* | 
 | 96 | 	 *	Board memory allocated on startup for use by host, usually | 
 | 97 | 	 *	for the purposes of creating DMA chain descriptors.  The | 
 | 98 | 	 *	"len" must be set before the processor is released.  The | 
 | 99 | 	 *	address of the area is returned in bc_hostarea.  The area | 
 | 100 | 	 *	is guaranteed to be aligned on a 16 byte boundary. | 
 | 101 | 	 */ | 
 | 102 | 	S4(ulong, bc_hostarea_len)	/* RW: Number of bytes to allocate */ | 
 | 103 | 	S4(uchar *, bc_hostarea)	/* RO: Address of allocated memory */ | 
 | 104 |  | 
 | 105 | 	/* | 
 | 106 | 	 *	Variables for communicating filters into the board | 
 | 107 | 	 */ | 
 | 108 | 	S4(ulong *, bc_filter_area)	/* RO: Space to put filter into */ | 
 | 109 | 	S4(ulong, bc_filter_area_len)	/* RO: Length of area, in bytes */ | 
 | 110 | 	S4(long, bc_filter_cmd)		/* RW: Filter command, see below */ | 
 | 111 | 	S4(ulong, bc_filter_len)	/* RW: Actual length of filter */ | 
 | 112 | 	S4(ulong, bc_filter_port)	/* RW: Port # for filter 0..6 */ | 
 | 113 | 	S4(ulong, bc_filter_num)	/* RW: Filter #, 0=input, 1=output */ | 
 | 114 |  | 
 | 115 | 	/* more SNMP agent addresses */ | 
 | 116 | 	S1A(uchar, bc_iptrap, 4) /* IP address for SNMP */ | 
 | 117 |  | 
 | 118 | 	S4A(long, bc_spare, 2)	/* spares */ | 
 | 119 | END_STRUCT(bios_comm) | 
 | 120 |  | 
 | 121 | #define	bc	VMO(struct bios_comm, 0xa3000100) | 
 | 122 |  | 
 | 123 | /* | 
 | 124 |  *	bc_status values | 
 | 125 |  */ | 
 | 126 | #define	BC_INIT	0 | 
 | 127 | #define	BC_RUN	100 | 
 | 128 |  | 
 | 129 | /* | 
 | 130 |  *	bc_host values | 
 | 131 |  */ | 
 | 132 | #define	BC_DIAGS	-1 | 
 | 133 | #define BC_SASWITCH	0 | 
 | 134 | #define	BC_SWITCH	1 | 
 | 135 | #define	BC_MULTINIC	2 | 
 | 136 |  | 
 | 137 | /* | 
 | 138 |  *	Values for spew (debugging) | 
 | 139 |  */ | 
 | 140 | #define	BC_SPEW_ENABLE	0x80000000 | 
 | 141 |  | 
 | 142 | /* | 
 | 143 |  *	filter commands | 
 | 144 |  */ | 
 | 145 | #define	BC_FILTER_ERR	-1 | 
 | 146 | #define	BC_FILTER_OK	0 | 
 | 147 | #define	BC_FILTER_SET	1 | 
 | 148 | #define	BC_FILTER_CLR	2 |