summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/bfa/include/defs/bfa_defs_status.h
blob: cdceaeb9f4b822e2d34ac31af76e6c48158c816b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
/*
 * Copyright (c) 2005-2009 Brocade Communications Systems, Inc.
 * All rights reserved
 * www.brocade.com
 *
 * Linux driver for Brocade Fibre Channel Host Bus Adapter.
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License (GPL) Version 2 as
 * published by the Free Software Foundation
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 */
#ifndef __BFA_DEFS_STATUS_H__
#define __BFA_DEFS_STATUS_H__

/**
 * API status return values
 *
 * NOTE: The error msgs are auto generated from the comments. Only singe line
 * comments are supported
 */
enum bfa_status {
	BFA_STATUS_OK 		= 0,	/*  Success */
	BFA_STATUS_FAILED 	= 1,	/*  Operation failed */
	BFA_STATUS_EINVAL 	= 2,	/*  Invalid params Check input
					 * parameters */
	BFA_STATUS_ENOMEM 	= 3,	/*  Out of resources */
	BFA_STATUS_ENOSYS 	= 4,	/*  Function not implemented */
	BFA_STATUS_ETIMER 	= 5,	/*  Timer expired - Retry, if
					 * persists, contact support */
	BFA_STATUS_EPROTOCOL 	= 6,	/*  Protocol error */
	BFA_STATUS_ENOFCPORTS 	= 7,	/*  No FC ports resources */
	BFA_STATUS_NOFLASH 	= 8,	/*  Flash not present */
	BFA_STATUS_BADFLASH 	= 9,	/*  Flash is corrupted or bad */
	BFA_STATUS_SFP_UNSUPP 	= 10,	/*  Unsupported SFP - Replace SFP */
	BFA_STATUS_UNKNOWN_VFID = 11,	/*  VF_ID not found */
	BFA_STATUS_DATACORRUPTED = 12,	/*  Diag returned data corrupted
					 * contact support */
	BFA_STATUS_DEVBUSY 	= 13,	/*  Device busy - Retry operation */
	BFA_STATUS_ABORTED 	= 14,	/*  Operation aborted */
	BFA_STATUS_NODEV 	= 15,	/*  Dev is not present */
	BFA_STATUS_HDMA_FAILED 	= 16,	/*  Host dma failed contact support */
	BFA_STATUS_FLASH_BAD_LEN = 17,	/*  Flash bad length */
	BFA_STATUS_UNKNOWN_LWWN = 18,	/*  LPORT PWWN not found */
	BFA_STATUS_UNKNOWN_RWWN = 19,	/*  RPORT PWWN not found */
	BFA_STATUS_FCPT_LS_RJT 	= 20,	/*  Got LS_RJT for FC Pass
					 * through Req */
	BFA_STATUS_VPORT_EXISTS = 21,	/*  VPORT already exists */
	BFA_STATUS_VPORT_MAX 	= 22,	/*  Reached max VPORT supported
					 * limit */
	BFA_STATUS_UNSUPP_SPEED = 23,	/*  Invalid Speed Check speed
					 * setting */
	BFA_STATUS_INVLD_DFSZ 	= 24,	/*  Invalid Max data field size */
	BFA_STATUS_CNFG_FAILED 	= 25,	/*  Setting can not be persisted */
	BFA_STATUS_CMD_NOTSUPP 	= 26,	/*  Command/API not supported */
	BFA_STATUS_NO_ADAPTER 	= 27,	/*  No Brocade Adapter Found */
	BFA_STATUS_LINKDOWN 	= 28,	/*  Link is down - Check or replace
					 * SFP/cable */
	BFA_STATUS_FABRIC_RJT 	= 29,	/*  Reject from attached fabric */
	BFA_STATUS_UNKNOWN_VWWN = 30,	/*  VPORT PWWN not found */
	BFA_STATUS_NSLOGIN_FAILED = 31,	/*  Nameserver login failed */
	BFA_STATUS_NO_RPORTS 	= 32,	/*  No remote ports found */
	BFA_STATUS_NSQUERY_FAILED = 33,	/*  Nameserver query failed */
	BFA_STATUS_PORT_OFFLINE = 34,	/*  Port is not online */
	BFA_STATUS_RPORT_OFFLINE = 35,	/*  RPORT is not online */
	BFA_STATUS_TGTOPEN_FAILED = 36,	/*  Remote SCSI target open failed */
	BFA_STATUS_BAD_LUNS 	= 37,	/*  No valid LUNs found */
	BFA_STATUS_IO_FAILURE 	= 38,	/*  SCSI target IO failure */
	BFA_STATUS_NO_FABRIC 	= 39,	/*  No switched fabric present */
	BFA_STATUS_EBADF 	= 40,	/*  Bad file descriptor */
	BFA_STATUS_EINTR 	= 41,	/*  A signal was caught during ioctl */
	BFA_STATUS_EIO 		= 42,	/*  I/O error */
	BFA_STATUS_ENOTTY 	= 43,	/*  Inappropriate I/O control
					 * operation */
	BFA_STATUS_ENXIO 	= 44,	/*  No such device or address */
	BFA_STATUS_EFOPEN 	= 45,	/*  Failed to open file */
	BFA_STATUS_VPORT_WWN_BP = 46,	/*  WWN is same as base port's WWN */
	BFA_STATUS_PORT_NOT_DISABLED = 47, /*  Port not disabled disable port
					    * first */
	BFA_STATUS_BADFRMHDR 	= 48,	/*  Bad frame header */
	BFA_STATUS_BADFRMSZ 	= 49,	/*  Bad frame size check and replace
					 * SFP/cable */
	BFA_STATUS_MISSINGFRM 	= 50,	/*  Missing frame check and replace
					 * SFP/cable */
	BFA_STATUS_LINKTIMEOUT 	= 51,	/*  Link timeout check and replace
					 * SFP/cable */
	BFA_STATUS_NO_FCPIM_NEXUS = 52,	/*  No FCP Nexus exists with the
					 * rport */
	BFA_STATUS_CHECKSUM_FAIL = 53,	/*  checksum failure */
	BFA_STATUS_GZME_FAILED 	= 54,	/*  Get zone member query failed */
	BFA_STATUS_SCSISTART_REQD = 55,	/*  SCSI disk require START command */
	BFA_STATUS_IOC_FAILURE 	= 56,	/*  IOC failure - Retry, if persists
					 * contact support */
	BFA_STATUS_INVALID_WWN 	= 57,	/*  Invalid WWN */
	BFA_STATUS_MISMATCH 	= 58,	/*  Version mismatch */
	BFA_STATUS_IOC_ENABLED 	= 59,	/*  IOC is already enabled */
	BFA_STATUS_ADAPTER_ENABLED = 60, /*  Adapter is not disabled disable
					  * adapter first */
	BFA_STATUS_IOC_NON_OP 	= 61,	/*  IOC is not operational. Enable IOC
					 * and if it still fails,
					 * contact support */
	BFA_STATUS_ADDR_MAP_FAILURE = 62, /*  PCI base address not mapped
					   * in OS */
	BFA_STATUS_SAME_NAME 	= 63,	/*  Name exists! use a different
					 * name */
	BFA_STATUS_PENDING      = 64,   /*  API completes asynchronously */
	BFA_STATUS_8G_SPD	= 65,	/*  Speed setting not valid for
					 * 8G HBA */
	BFA_STATUS_4G_SPD	= 66,	/*  Speed setting not valid for
					 * 4G HBA */
	BFA_STATUS_AD_IS_ENABLE = 67,	/*  Adapter is already enabled */
	BFA_STATUS_EINVAL_TOV 	= 68,	/*  Invalid path failover TOV */
	BFA_STATUS_EINVAL_QDEPTH = 69,	/*  Invalid queue depth value */
	BFA_STATUS_VERSION_FAIL = 70,	/*  Application/Driver version
					 * mismatch */
	BFA_STATUS_DIAG_BUSY    = 71,	/*  diag busy */
	BFA_STATUS_BEACON_ON	= 72,	/*  Port Beacon already on */
	BFA_STATUS_BEACON_OFF	= 73,	/*  Port Beacon already off */
	BFA_STATUS_LBEACON_ON   = 74,	/*  Link End-to-End Beacon already
					 * on */
	BFA_STATUS_LBEACON_OFF	= 75,	/*  Link End-to-End Beacon already
					 * off */
	BFA_STATUS_PORT_NOT_INITED = 76, /*  Port not initialized */
	BFA_STATUS_RPSC_ENABLED = 77, /*  Target has a valid speed */
	BFA_STATUS_ENOFSAVE = 78,	/*  No saved firmware trace */
	BFA_STATUS_BAD_FILE = 79,	/*  Not a valid Brocade Boot Code
					 * file */
	BFA_STATUS_RLIM_EN = 80,	/*  Target rate limiting is already
					 * enabled */
	BFA_STATUS_RLIM_DIS = 81,  /*  Target rate limiting is already
				    * disabled */
	BFA_STATUS_IOC_DISABLED = 82,   /*  IOC is already disabled */
	BFA_STATUS_ADAPTER_DISABLED = 83,   /*  Adapter is already disabled */
	BFA_STATUS_BIOS_DISABLED = 84,   /*  Bios is already disabled */
	BFA_STATUS_AUTH_ENABLED = 85,   /*  Authentication is already
					 * enabled */
	BFA_STATUS_AUTH_DISABLED = 86,   /*  Authentication is already
					 * disabled */
	BFA_STATUS_ERROR_TRL_ENABLED = 87,   /*  Target rate limiting is
					      * enabled */
	BFA_STATUS_ERROR_QOS_ENABLED = 88,   /*  QoS is enabled */
	BFA_STATUS_NO_SFP_DEV = 89, /*  No SFP device check or replace SFP */
	BFA_STATUS_MEMTEST_FAILED = 90,	/*  Memory test failed contact
					 * support */
	BFA_STATUS_INVALID_DEVID = 91,	/*  Invalid device id provided */
	BFA_STATUS_QOS_ENABLED = 92, /*  QOS is already enabled */
	BFA_STATUS_QOS_DISABLED = 93, /*  QOS is already disabled */
	BFA_STATUS_INCORRECT_DRV_CONFIG = 94, /*  Check configuration
					       * key/value pair */
	BFA_STATUS_REG_FAIL = 95, /*  Can't read windows registry */
	BFA_STATUS_IM_INV_CODE = 96, /*  Invalid IOCTL code */
	BFA_STATUS_IM_INV_VLAN = 97, /*  Invalid VLAN ID */
	BFA_STATUS_IM_INV_ADAPT_NAME = 98, /*  Invalid adapter name */
	BFA_STATUS_IM_LOW_RESOURCES = 99, /*  Memory allocation failure in
					   * driver */
	BFA_STATUS_IM_VLANID_IS_PVID = 100, /*  Given VLAN id same as PVID */
	BFA_STATUS_IM_VLANID_EXISTS = 101, /*  Given VLAN id already exists */
	BFA_STATUS_IM_FW_UPDATE_FAIL = 102, /*  Updating firmware with new
					     * VLAN ID failed */
	BFA_STATUS_PORTLOG_ENABLED = 103, /*  Port Log is already enabled */
	BFA_STATUS_PORTLOG_DISABLED = 104, /*  Port Log is already disabled */
	BFA_STATUS_FILE_NOT_FOUND = 105, /*  Specified file could not be
					  * found */
	BFA_STATUS_QOS_FC_ONLY = 106, /*  QOS can be enabled for FC mode
				       * only */
	BFA_STATUS_RLIM_FC_ONLY = 107, /*  RATELIM can be enabled for FC mode
					* only */
	BFA_STATUS_CT_SPD = 108, /*  Invalid speed selection for Catapult. */
	BFA_STATUS_LEDTEST_OP = 109, /*  LED test is operating */
	BFA_STATUS_CEE_NOT_DN = 110, /*  eth port is not at down state, please
				      * bring down first */
	BFA_STATUS_10G_SPD = 111, /*  Speed setting not valid for 10G HBA */
	BFA_STATUS_IM_INV_TEAM_NAME = 112, /*  Invalid team name */
	BFA_STATUS_IM_DUP_TEAM_NAME = 113, /*  Given team name already
					    * exists */
	BFA_STATUS_IM_ADAPT_ALREADY_IN_TEAM = 114, /*  Given adapter is part
						    * of another team */
	BFA_STATUS_IM_ADAPT_HAS_VLANS = 115, /*  Adapter has VLANs configured.
					      * Delete all VLANs before
					      * creating team */
	BFA_STATUS_IM_PVID_MISMATCH = 116, /*  Mismatching PVIDs configured
					    * for adapters */
	BFA_STATUS_IM_LINK_SPEED_MISMATCH = 117, /*  Mismatching link speeds
						  * configured for adapters */
	BFA_STATUS_IM_MTU_MISMATCH = 118, /*  Mismatching MTUs configured for
					   * adapters */
	BFA_STATUS_IM_RSS_MISMATCH = 119, /*  Mismatching RSS parameters
					   * configured for adapters */
	BFA_STATUS_IM_HDS_MISMATCH = 120, /*  Mismatching HDS parameters
					   * configured for adapters */
	BFA_STATUS_IM_OFFLOAD_MISMATCH = 121, /*  Mismatching offload
					       * parameters configured for
					       * adapters */
	BFA_STATUS_IM_PORT_PARAMS = 122, /*  Error setting port parameters */
	BFA_STATUS_IM_PORT_NOT_IN_TEAM = 123, /*  Port is not part of team */
	BFA_STATUS_IM_CANNOT_REM_PRI = 124, /*  Primary adapter cannot be
					     * removed. Change primary before
					     * removing */
	BFA_STATUS_IM_MAX_PORTS_REACHED = 125, /*  Exceeding maximum ports
						* per team */
	BFA_STATUS_IM_LAST_PORT_DELETE = 126, /*  Last port in team being
					       * deleted */
	BFA_STATUS_IM_NO_DRIVER = 127, /*  IM driver is not installed */
	BFA_STATUS_IM_MAX_VLANS_REACHED = 128, /*  Exceeding maximum VLANs
						* per port */
	BFA_STATUS_TOMCAT_SPD_NOT_ALLOWED = 129, /* Bios speed config not
						  * allowed for CNA */
	BFA_STATUS_NO_MINPORT_DRIVER = 130, /*  Miniport driver is not
					     * loaded */
	BFA_STATUS_CARD_TYPE_MISMATCH = 131, /*  Card type mismatch */
	BFA_STATUS_BAD_ASICBLK = 132, /*  Bad ASIC block */
	BFA_STATUS_NO_DRIVER = 133, /*  Storage/Ethernet driver not loaded */
	BFA_STATUS_INVALID_MAC = 134, /*  Invalid mac address */
	BFA_STATUS_IM_NO_VLAN = 135, /*  No VLANs configured on the adapter */
	BFA_STATUS_IM_ETH_LB_FAILED = 136, /*  Ethernet loopback test failed */
	BFA_STATUS_IM_PVID_REMOVE = 137, /*  Cannot remove port vlan (PVID) */
	BFA_STATUS_IM_PVID_EDIT = 138, /*  Cannot edit port vlan (PVID) */
	BFA_STATUS_CNA_NO_BOOT = 139, /*  Boot upload not allowed for CNA */
	BFA_STATUS_IM_PVID_NON_ZERO = 140, /*  Port VLAN ID (PVID) is Set to
					    * Non-Zero Value */
	BFA_STATUS_IM_INETCFG_LOCK_FAILED = 141, /*  Acquiring Network
						  * Subsytem Lock Failed.Please
						  * try after some time */
	BFA_STATUS_IM_GET_INETCFG_FAILED = 142, /*  Acquiring Network Subsytem
						 * handle Failed. Please try
						 * after some time */
	BFA_STATUS_IM_NOT_BOUND = 143, /*  Brocade 10G Ethernet Service is not
					* Enabled on this port */
	BFA_STATUS_INSUFFICIENT_PERMS = 144, /*  User doesn't have sufficient
					      * permissions to execute the BCU
					      * application */
	BFA_STATUS_IM_INV_VLAN_NAME = 145, /*  Invalid/Reserved Vlan name
					    * string. The name is not allowed
					    * for the normal Vlans */
	BFA_STATUS_CMD_NOTSUPP_CNA = 146, /*  Command not supported for CNA */
	BFA_STATUS_IM_PASSTHRU_EDIT = 147, /*  Can not edit passthru vlan id */
	BFA_STATUS_IM_BIND_FAILED = 148, /*! < IM Driver bind operation
					  * failed */
	BFA_STATUS_IM_UNBIND_FAILED = 149, /* ! < IM Driver unbind operation
					    * failed */
	BFA_STATUS_MAX_VAL		/*  Unknown error code */
};
#define bfa_status_t enum bfa_status

enum bfa_eproto_status {
	BFA_EPROTO_BAD_ACCEPT = 0,
	BFA_EPROTO_UNKNOWN_RSP = 1
};
#define bfa_eproto_status_t enum bfa_eproto_status

#endif /* __BFA_DEFS_STATUS_H__ */
d-color: #e3d2d2 } /* Error */ .highlight .k { color: #008800; font-weight: bold } /* Keyword */ .highlight .ch { color: #888888 } /* Comment.Hashbang */ .highlight .cm { color: #888888 } /* Comment.Multiline */ .highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */ .highlight .cpf { color: #888888 } /* Comment.PreprocFile */ .highlight .c1 { color: #888888 } /* Comment.Single */ .highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */ .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ .highlight .ge { font-style: italic } /* Generic.Emph */ .highlight .gr { color: #aa0000 } /* Generic.Error */ .highlight .gh { color: #333333 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
================
EISA bus support
================

:Author: Marc Zyngier <maz@wild-wind.fr.eu.org>

This document groups random notes about porting EISA drivers to the
new EISA/sysfs API.

Starting from version 2.5.59, the EISA bus is almost given the same
status as other much more mainstream busses such as PCI or USB. This
has been possible through sysfs, which defines a nice enough set of
abstractions to manage busses, devices and drivers.

Although the new API is quite simple to use, converting existing
drivers to the new infrastructure is not an easy task (mostly because
detection code is generally also used to probe ISA cards). Moreover,
most EISA drivers are among the oldest Linux drivers so, as you can
imagine, some dust has settled here over the years.

The EISA infrastructure is made up of three parts:

    - The bus code implements most of the generic code. It is shared
      among all the architectures that the EISA code runs on. It
      implements bus probing (detecting EISA cards available on the bus),
      allocates I/O resources, allows fancy naming through sysfs, and
      offers interfaces for driver to register.

    - The bus root driver implements the glue between the bus hardware
      and the generic bus code. It is responsible for discovering the
      device implementing the bus, and setting it up to be latter probed
      by the bus code. This can go from something as simple as reserving
      an I/O region on x86, to the rather more complex, like the hppa
      EISA code. This is the part to implement in order to have EISA
      running on an "new" platform.

    - The driver offers the bus a list of devices that it manages, and
      implements the necessary callbacks to probe and release devices
      whenever told to.

Every function/structure below lives in <linux/eisa.h>, which depends
heavily on <linux/device.h>.

Bus root driver
===============

::

	int eisa_root_register (struct eisa_root_device *root);

The eisa_root_register function is used to declare a device as the
root of an EISA bus. The eisa_root_device structure holds a reference
to this device, as well as some parameters for probing purposes::

	struct eisa_root_device {
		struct device   *dev;	 /* Pointer to bridge device */
		struct resource *res;
		unsigned long    bus_base_addr;
		int		 slots;  /* Max slot number */
		int		 force_probe; /* Probe even when no slot 0 */
		u64		 dma_mask; /* from bridge device */
		int              bus_nr; /* Set by eisa_root_register */
		struct resource  eisa_root_res;	/* ditto */
	};

============= ======================================================
node          used for eisa_root_register internal purpose
dev           pointer to the root device
res           root device I/O resource
bus_base_addr slot 0 address on this bus
slots	      max slot number to probe
force_probe   Probe even when slot 0 is empty (no EISA mainboard)
dma_mask      Default DMA mask. Usually the bridge device dma_mask.
bus_nr	      unique bus id, set by eisa_root_register
============= ======================================================

Driver
======

::

	int eisa_driver_register (struct eisa_driver *edrv);
	void eisa_driver_unregister (struct eisa_driver *edrv);

Clear enough ?

::

	struct eisa_device_id {
		char sig[EISA_SIG_LEN];
		unsigned long driver_data;
	};

	struct eisa_driver {
		const struct eisa_device_id *id_table;
		struct device_driver         driver;
	};

=============== ====================================================
id_table	an array of NULL terminated EISA id strings,
		followed by an empty string. Each string can
		optionally be paired with a driver-dependent value
		(driver_data).

driver		a generic driver, such as described in
		Documentation/driver-api/driver-model/driver.rst. Only .name,
		.probe and .remove members are mandatory.
=============== ====================================================

An example is the 3c59x driver::

	static struct eisa_device_id vortex_eisa_ids[] = {
		{ "TCM5920", EISA_3C592_OFFSET },
		{ "TCM5970", EISA_3C597_OFFSET },
		{ "" }
	};

	static struct eisa_driver vortex_eisa_driver = {
		.id_table = vortex_eisa_ids,
		.driver   = {
			.name    = "3c59x",
			.probe   = vortex_eisa_probe,
			.remove  = vortex_eisa_remove
		}
	};

Device
======

The sysfs framework calls .probe and .remove functions upon device
discovery and removal (note that the .remove function is only called
when driver is built as a module).

Both functions are passed a pointer to a 'struct device', which is
encapsulated in a 'struct eisa_device' described as follows::

	struct eisa_device {
		struct eisa_device_id id;
		int                   slot;
		int                   state;
		unsigned long         base_addr;
		struct resource       res[EISA_MAX_RESOURCES];
		u64                   dma_mask;
		struct device         dev; /* generic device */
	};

======== ============================================================
id	 EISA id, as read from device. id.driver_data is set from the
	 matching driver EISA id.
slot	 slot number which the device was detected on
state    set of flags indicating the state of the device. Current
	 flags are EISA_CONFIG_ENABLED and EISA_CONFIG_FORCED.
res	 set of four 256 bytes I/O regions allocated to this device
dma_mask DMA mask set from the parent device.
dev	 generic device (see Documentation/driver-api/driver-model/device.rst)
======== ============================================================

You can get the 'struct eisa_device' from 'struct device' using the
'to_eisa_device' macro.

Misc stuff
==========

::

	void eisa_set_drvdata (struct eisa_device *edev, void *data);

Stores data into the device's driver_data area.

::

	void *eisa_get_drvdata (struct eisa_device *edev):

Gets the pointer previously stored into the device's driver_data area.

::

	int eisa_get_region_index (void *addr);

Returns the region number (0 <= x < EISA_MAX_RESOURCES) of a given
address.

Kernel parameters
=================

eisa_bus.enable_dev
	A comma-separated list of slots to be enabled, even if the firmware
	set the card as disabled. The driver must be able to properly
	initialize the device in such conditions.

eisa_bus.disable_dev
	A comma-separated list of slots to be disabled, even if the firmware
	set the card as enabled. The driver won't be called to handle this
	device.

virtual_root.force_probe
	Force the probing code to probe EISA slots even when it cannot find an
	EISA compliant mainboard (nothing appears on slot 0). Defaults to 0
	(don't force), and set to 1 (force probing) when either
	CONFIG_ALPHA_JENSEN or CONFIG_EISA_VLB_PRIMING are set.

Random notes
============

Converting an EISA driver to the new API mostly involves *deleting*
code (since probing is now in the core EISA code). Unfortunately, most
drivers share their probing routine between ISA, and EISA. Special
care must be taken when ripping out the EISA code, so other busses
won't suffer from these surgical strikes...

You *must not* expect any EISA device to be detected when returning
from eisa_driver_register, since the chances are that the bus has not
yet been probed. In fact, that's what happens most of the time (the
bus root driver usually kicks in rather late in the boot process).
Unfortunately, most drivers are doing the probing by themselves, and
expect to have explored the whole machine when they exit their probe
routine.

For example, switching your favorite EISA SCSI card to the "hotplug"
model is "the right thing"(tm).

Thanks
======

I'd like to thank the following people for their help:

- Xavier Benigni for lending me a wonderful Alpha Jensen,
- James Bottomley, Jeff Garzik for getting this stuff into the kernel,
- Andries Brouwer for contributing numerous EISA ids,
- Catrin Jones for coping with far too many machines at home.