xref: /illumos-gate/usr/src/uts/common/sys/fibre-channel/fca/emlxs/emlxs_config.h (revision 825277341c15b6b0d2c4b8b622ae7b1d2bdc0390)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 
22 /*
23  * Copyright 2009 Emulex.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef _EMLXS_CONFIG_H
28 #define	_EMLXS_CONFIG_H
29 
30 #ifdef	__cplusplus
31 extern "C" {
32 #endif
33 
34 #define	EMLXS_CFG_STR_SIZE	32
35 #define	EMLXS_CFG_HELP_SIZE	80
36 
37 typedef struct emlxs_config
38 {
39 	char		string[EMLXS_CFG_STR_SIZE];
40 	uint32_t	low;
41 	uint32_t	hi;
42 	uint32_t	def;
43 	uint32_t	current;
44 	uint32_t	flags;
45 	char		help[EMLXS_CFG_HELP_SIZE];
46 } emlxs_config_t;
47 
48 
49 typedef enum emlxs_cfg_parm
50 {
51 	CFG_CONSOLE_NOTICES,	/* console-notices */
52 	CFG_CONSOLE_WARNINGS,	/* console-warnings */
53 	CFG_CONSOLE_ERRORS,	/* console-errors */
54 	CFG_CONSOLE_DEBUGS,	/* console-debugs (hidden) */
55 	CFG_LOG_NOTICES,	/* log-notices */
56 	CFG_LOG_WARNINGS,	/* log-warnings */
57 	CFG_LOG_ERRORS,		/* log-errors */
58 	CFG_LOG_DEBUGS,		/* log-debugs (hidden) */
59 	CFG_NUM_IOCBS,		/* num-iocbs */
60 	CFG_MAX_XFER_SIZE,	/* max-xfer-size */
61 	CFG_UB_BUFS,		/* ub-bufs */
62 	CFG_NETWORK_ON,		/* network-on */
63 	CFG_ACK0,		/* ack0 */
64 	CFG_TOPOLOGY,		/* topology */
65 	CFG_LINK_SPEED,		/* link-speed */
66 	CFG_NUM_NODES,		/* num-nodes */
67 	CFG_CR_DELAY,		/* cr-delay */
68 	CFG_CR_COUNT,		/* cr-count */
69 	CFG_ASSIGN_ALPA,	/* assign-alpa */
70 	CFG_ADISC_SUPPORT,	/* adisc-support */
71 	CFG_PM_SUPPORT,		/* pm-support */
72 	CFG_PM_IDLE,		/* pm-idle */
73 	CFG_FW_CHECK,		/* fw-check (hidden) */
74 	CFG_TRI_REQUIRED,	/* tri-required (hidden) */
75 	CFG_DISC_TIMEOUT,	/* discovery-timeout (hidden) */
76 	CFG_LINKUP_TIMEOUT,	/* linkup-timeout (hidden) */
77 	CFG_LINKUP_DELAY,	/* linkup-delay */
78 	CFG_OFFLINE_TIMEOUT,	/* offline-timeout (hidden) */
79 	CFG_LILP_ENABLE,	/* enable-lilp (hidden) */
80 	CFG_PCI_MAX_READ,	/* pci-max-read */
81 	CFG_HEARTBEAT_ENABLE,	/* heartbeat-enable (hidden) */
82 	CFG_RESET_ENABLE,	/* reset-enable (hidden) */
83 	CFG_TIMEOUT_ENABLE,	/* timeout-enable (hidden) */
84 	CFG_NUM_IOTAGS,		/* num-iotags (hidden) */
85 
86 #ifdef FMA_SUPPORT
87 	CFG_FM_CAPS,		/* fm-capable (hidden) */
88 #endif	/* FMA_SUPPORT */
89 
90 
91 #ifdef MAX_RRDY_SUPPORT
92 	CFG_MAX_RRDY,		/* max-rrdy (hidden) */
93 #endif	/* MAX_RRDY_SUPPORT */
94 
95 #ifdef MSI_SUPPORT
96 	CFG_MSI_MODE,		/* msi-mode (hidden) */
97 #endif	/* MSI_SUPPORT */
98 
99 	CFG_SLI_MODE,		/* sli-mode (hidden) */
100 	CFG_NPIV_ENABLE,	/* enable-npiv */
101 	CFG_VPORT_RESTRICTED,	/* vport-restrict-login */
102 	CFG_NPIV_DELAY,		/* enable-npiv-delay */
103 
104 #ifdef DHCHAP_SUPPORT
105 	CFG_AUTH_ENABLE, 	/* enable-auth */
106 	CFG_AUTH_E2E,		/* auth-e2e */
107 	CFG_AUTH_NPIV,		/* auth-npiv (hidden) */
108 	CFG_AUTH_TMO,    	/* auth-tmo (hidden) */
109 	CFG_AUTH_MODE,   	/* auth-mode (hidden) */
110 	CFG_AUTH_BIDIR, 	/* auth-bidir (hidden) */
111 	CFG_AUTH_TYPE,   	/* auth-type (hidden) */
112 	CFG_AUTH_HASH,   	/* auth-hash (hidden) */
113 	CFG_AUTH_GROUP,  	/* auth-group (hidden) */
114 	CFG_AUTH_INTERVAL,  	/* auth-interval (hidden) */
115 #endif	/* DHCHAP_SUPPORT */
116 
117 #ifdef SFCT_SUPPORT
118 	CFG_TARGET_MODE,	/* target-mode */
119 #endif /* SFCT_SUPPORT */
120 	CFG_NUM_WQ,		/* num-wq (hidden) */
121 	CFG_PERSIST_LINKDOWN,	/* persist-linkdown */
122 	CFG_ENABLE_PATCH,	/* enable-patch (hidden) */
123 	CFG_FAST_TGT_RESET,	/* fast-tgt-reset (hidden) */
124 	CFG_FAST_TGT_RESET_TMR,	/* fast-tgt-reset-timer (hidden) */
125 
126 	NUM_CFG_PARAM
127 
128 } emlxs_cfg_parm_t;
129 
130 #define	PARM_HIDDEN	0x80000000
131 
132 
133 
134 #ifdef DEF_ICFG
135 
136 /*
137  * The entries in this array must be in the exact order
138  * defined in emlxs_cfg_parm_t
139  */
140 emlxs_config_t  emlxs_cfg[] = {
141 	/* CFG_CONSOLE_NOTICES */
142 	{"console-notices",
143 		0, 0xffffffff, 0, 0,
144 		PARM_DYNAMIC | PARM_HEX,
145 	"Verbose mask for notice messages to the console."},
146 
147 	/* CFG_CONSOLE_WARNINGS */
148 	{"console-warnings",
149 		0, 0xffffffff, 0, 0,
150 		PARM_DYNAMIC | PARM_HEX,
151 	"Verbose mask for warning messages to the console."},
152 
153 	/* CFG_CONSOLE_ERRORS */
154 	{"console-errors",
155 		0, 0xffffffff, 0, 0,
156 		PARM_DYNAMIC | PARM_HEX,
157 	"Verbose mask for error messages to the console."},
158 
159 	/* CFG_CONSOLE_DEBUGS */
160 	{"console-debugs",
161 		0, 0xffffffff, 0, 0,
162 		PARM_DYNAMIC | PARM_HEX | PARM_HIDDEN,
163 	"Verbose mask for debugging messages to the console."},
164 
165 	/* CFG_LOG_NOTICES */
166 	{"log-notices",
167 		0, 0xffffffff, 0xffffffff, 0,
168 		PARM_DYNAMIC | PARM_HEX,
169 	"Verbose mask for notice messages to the messages file."},
170 
171 	/* CFG_LOG_WARNINGS */
172 	{"log-warnings",
173 		0, 0xffffffff, 0xffffffff, 0,
174 		PARM_DYNAMIC | PARM_HEX,
175 	"Verbose mask for warning messages to the messages file."},
176 
177 	/* CFG_LOG_ERRORS */
178 	{"log-errors",
179 		0, 0xffffffff, 0xffffffff, 0,
180 		PARM_DYNAMIC | PARM_HEX,
181 	"Verbose mask for error messages to the messages file."},
182 
183 	/* CFG_LOG_DEBUGS */
184 	{"log-debugs",
185 		0, 0xffffffff, 0, 0,
186 		PARM_DYNAMIC | PARM_HEX | PARM_HIDDEN,
187 	"Verbose mask for debugging messages to the messages file."},
188 
189 
190 	/* CFG_NUM_IOCBS */
191 	{"num-iocbs",
192 		128, 10240, 1024, 0,
193 		PARM_DYNAMIC_RESET,
194 	"Number of IOCB buffers the driver should allocate."},
195 
196 	/* CFG_MAX_XFER_SIZE */
197 	{"max-xfer-size",
198 		131072, 1388544, 339968, 0,
199 		0,
200 	"Sets maximum bytes per IO the driver can transfer."},
201 
202 	/* CFG_UB_BUFS */
203 	{"ub-bufs",
204 		40, 16320, 1000, 0,
205 		0,
206 	"Number of unsolicited buffers the driver should allocate."},
207 
208 	/* IP specific parameters */
209 
210 	/* CFG_NETWORK_ON */
211 	{"network-on",
212 		0, 1, 1, 0,
213 		PARM_BOOLEAN,
214 	"Enable IP processing. [0=Disabled, 1=Enabled]"},
215 
216 	/* Fibre Channel specific parameters */
217 
218 	/* CFG_ACK0 */
219 	{"ack0",
220 		0, 1, 0, 0,
221 		PARM_DYNAMIC_LINK | PARM_BOOLEAN,
222 	"Enables ACK0 support. [0=Disabled, 1=Enabled]"},
223 
224 	/* CFG_TOPOLOGY */
225 	{"topology",
226 		0, 6, 0, 0,
227 		PARM_DYNAMIC_LINK,
228 	"Select Fibre Channel topology. "
229 		"[0=Loop->PTP, 2=PTP, 4=Loop, 6=PTP->Loop]"},
230 
231 	/* CFG_LINK_SPEED */
232 	{"link-speed",
233 		0, 8, 0, 0,
234 		PARM_DYNAMIC_LINK,
235 	"Select link speed. [0=Auto, 1=1Gb, 2=2Gb, 4=4Gb, 8=8Gb]"},
236 
237 	/* CFG_NUM_NODES */
238 	{"num-nodes",
239 		0, 4096, 0, 0,
240 		PARM_DYNAMIC_RESET,
241 	"Number of fibre channel nodes (NPorts) the driver will support. "
242 		"[0=no_limit]"},
243 
244 	/* CFG_CR_DELAY */
245 	{"cr-delay",
246 		0, 63, 0, 0,
247 		PARM_DYNAMIC_LINK,
248 	"A count of milliseconds after which "
249 		"an interrupt response is generated"},
250 
251 	/* CFG_CR_COUNT */
252 	{"cr-count",
253 		1, 255, 1, 0,
254 		PARM_DYNAMIC_LINK,
255 	"A count of I/O completions after "
256 		"which an interrupt response is generated"},
257 
258 	/* CFG_ASSIGN_ALPA */
259 	{"assign-alpa",
260 		0, 0xef, 0, 0,
261 		PARM_DYNAMIC_LINK | PARM_HEX,
262 	"Assigns a preferred ALPA to the port. Only used in Loop topology."},
263 
264 	/* CFG_ADISC_SUPPORT */
265 	{"adisc-support",
266 		0, 2, 1, 0,
267 		PARM_DYNAMIC,
268 	"Sets the Fibre Channel ADISC login support level. "
269 		"[0=None, 1=Partial, 2=Full]"},
270 
271 	/* CFG_PM_SUPPORT */
272 	{"pm-support",
273 		0, 1, 0, 0,
274 		PARM_BOOLEAN,
275 	"Enables power management support. [0=Disabled, 1=Enabled]"},
276 
277 	/* CFG_PM_IDLE */
278 	{"pm-idle",
279 		0, 3600, 300, 0,
280 		PARM_DYNAMIC | PARM_HIDDEN,
281 	"Sets power management idle timeout value (seconds)."},
282 
283 	/* CFG_FW_CHECK */
284 	{"fw-check",
285 		0, 2, 1, 0,
286 		PARM_DYNAMIC_RESET | PARM_BOOLEAN | PARM_HIDDEN,
287 	"Enables firmware revision checking of adapters. "
288 		"[0=Off 1=Sun-only 2=All]"},
289 
290 	/* CFG_TRI_REQUIRED */
291 	{"tri-required",
292 		0, 1, 0, 0,
293 		PARM_DYNAMIC | PARM_BOOLEAN | PARM_HIDDEN,
294 	"Requires Task Retry Id support by a remote device "
295 		"for FCP-2 error recovery."},
296 
297 	/* CFG_DISC_TIMEOUT */
298 	{"discovery-timeout",
299 		0, 600, 25, 0,
300 		PARM_DYNAMIC | PARM_HIDDEN,
301 	"Sets the discovery timeout period (seconds) "
302 		"for managing FCP-2 devices."},
303 
304 	/* CFG_LINKUP_TIMEOUT */
305 	{"linkup-timeout",
306 		0, 10, 2, 0,
307 		PARM_DYNAMIC | PARM_HIDDEN,
308 	"Sets the linkup timeout period (seconds)."},
309 
310 	/* CFG_LINKUP_DELAY */
311 	{"linkup-delay",
312 		0, 60, 10, 0,
313 		PARM_DYNAMIC_RESET,
314 	"Sets the driver wait period (seconds) "
315 		"for a linkup after initialization."},
316 
317 	/* CFG_OFFLINE_TIMEOUT */
318 	{"offline-timeout",
319 		0, 600, 45, 0,
320 		PARM_DYNAMIC | PARM_HIDDEN,
321 	"Sets the offline timeout period (seconds)."},
322 
323 	/* CFG_LILP_ENABLE */
324 	{"enable-lilp",
325 		0, 1, 1, 0,
326 		PARM_DYNAMIC_RESET | PARM_BOOLEAN | PARM_HIDDEN,
327 	"Enables LIRP/LILP support in the driver. [0=Disabled, 1=Enabled]"},
328 
329 	/* CFG_PCI_MAX_READ */
330 	{"pci-max-read",
331 		512, 4096, 2048, 0,
332 		PARM_DYNAMIC_RESET,
333 	"Sets the PCI-X max memory read byte count. [512,1024,2048 or 4096]"},
334 
335 	/* CFG_HEARTBEAT_ENABLE */
336 	{"heartbeat-enable",
337 		0, 1, 1, 0,
338 		PARM_DYNAMIC | PARM_BOOLEAN | PARM_HIDDEN,
339 	"Enables driver's mailbox heartbeat to the adapter. "
340 		"[0=Disabled, 1=Enabled]"},
341 
342 	/* CFG_RESET_ENABLE */
343 	{"reset-enable",
344 		0, 1, 1, 0,
345 		PARM_DYNAMIC | PARM_BOOLEAN | PARM_HIDDEN,
346 	"Enables driver's ability to reset the adapter. "
347 		"[0=Disabled, 1=Enabled]"},
348 
349 	/* CFG_TIMEOUT_ENABLE */
350 	{"timeout-enable",
351 		0, 1, 1, 0,
352 		PARM_DYNAMIC | PARM_BOOLEAN | PARM_HIDDEN,
353 	"Enables driver's ability to timeout commands. "
354 		"[0=Disabled, 1=Enabled]"},
355 
356 	/* CFG_NUM_IOTAGS */
357 	{"num-iotags",
358 		0, 4096, 0, 0,
359 		PARM_DYNAMIC_RESET | PARM_HIDDEN,
360 	"Sets number of outstanding IO's. "
361 		"[0=max determined by type of HBA]"},
362 
363 #ifdef FMA_SUPPORT
364 	/* CFG_FM_CAPS */
365 	{"fm-capable",
366 		0, 0xF, 0xF, 0,
367 		PARM_HEX | PARM_HIDDEN,
368 	"Sets FMA capabilities. [bit 3:errcb, 2:dmachk, 1:accchk, 0:ereport]"},
369 #endif	/* FMA_SUPPORT */
370 
371 
372 #ifdef MAX_RRDY_SUPPORT
373 	/* CFG_MAX_RRDY */
374 	{"max-rrdy",
375 		0, 255, 2, 0,
376 		PARM_DYNAMIC_RESET | PARM_HIDDEN,
377 	"Sets maximum number RRDY's for the adapter on private loop."},
378 #endif	/* MAX_RRDY_SUPPORT */
379 
380 #ifdef MSI_SUPPORT
381 	/* CFG_MSI_MODE */
382 	{"msi-mode",
383 		0, 3, 3, 0,
384 		PARM_HIDDEN,
385 	"Sets the default MSI mode in driver. "
386 		"[0=Off 1=Single-MSI 2=Multi-MSI 3=Auto]"},
387 #endif	/* MSI_SUPPORT */
388 
389 	/* CFG_SLI_MODE */
390 	{"sli-mode",
391 		0, 4, 0, 0,
392 		PARM_DYNAMIC_RESET | PARM_HIDDEN,
393 	"Sets default SLI mode. "
394 		"[0=Auto, 2=SLI2-remove all vports first, 3=SLI3, 4=SLI4]"},
395 
396 	/* CFG_NPIV_ENABLE */
397 	{"enable-npiv",
398 		0, 1, 0, 0,
399 		PARM_DYNAMIC_RESET | PARM_BOOLEAN,
400 	"Enables NPIV. [0=Disabled-remove all vports first, "
401 		"1=Enabled-requires SLI3]"},
402 
403 	/* CFG_VPORT_RESTRICTED */
404 	{"vport-restrict-login",
405 		0, 1, 1, 0,
406 		PARM_DYNAMIC_LINK | PARM_BOOLEAN,
407 	"Restricts login to virtual ports to conserve resources. "
408 		"[0=Disabled, 1=Enabled]"},
409 
410 	/* CFG_NPIV_DELAY */
411 	{"enable-npiv-delay",
412 		0, 1, 1, 0,
413 		PARM_DYNAMIC | PARM_HIDDEN,
414 	"Enable FDISC/NS command delay from vports to switch. "
415 		"[0=Disabled, 1=Enabled]"},
416 
417 #ifdef DHCHAP_SUPPORT
418 	/* CFG_AUTH_ENABLE */
419 	{"enable-auth",
420 		0, 1, 0, 0,
421 		PARM_DYNAMIC_LINK | PARM_BOOLEAN,
422 	"Enables DHCHAP support in the driver. [0=Disabled, 1=Enabled]"},
423 
424 	/* CFG_AUTH_E2E */
425 	{"auth-e2e",
426 		0, 1, 0, 0,
427 		PARM_DYNAMIC_LINK | PARM_BOOLEAN | PARM_HIDDEN,
428 	"Enables end-to-end DHCHAP support in the driver. "
429 		"[0=Disabled, 1=Enabled]"},
430 
431 	/* CFG_AUTH_NPIV */
432 	{"auth-npiv",
433 		0, 1, 0, 0,
434 		PARM_DYNAMIC_LINK | PARM_BOOLEAN | PARM_HIDDEN,
435 	"Enables DHCHAP support for virtual ports. [0=Disabled, 1=Enabled]"},
436 
437 	/* CFG_AUTH_TMO */
438 	{"auth-tmo",
439 		20, 999, 45, 0,
440 		PARM_DYNAMIC_LINK | PARM_HIDDEN,
441 	"Sets authentication timeout value. (seconds)"},
442 
443 	/* CFG_AUTH_MODE */
444 	{"auth-mode",
445 		1, 3, 1, 0,
446 		PARM_DYNAMIC_LINK | PARM_HIDDEN,
447 	"Sets authentication mode. [1=Disabled, 2=Active, 3=Passive]"},
448 
449 	/* CFG_AUTH_BIDIR */
450 	{"auth-bidir",
451 		0, 1, 0, 0,
452 		PARM_DYNAMIC_LINK | PARM_BOOLEAN | PARM_HIDDEN,
453 	"Sets authentication bidirectional mode. [0=Disabled, 1=Enabled]"},
454 
455 	/* CFG_AUTH_TYPE */
456 	{"auth-type",
457 		0, 0x1111, 0x1000, 0,
458 		PARM_DYNAMIC_LINK | PARM_HEX | PARM_HIDDEN,
459 	"Sets authentication type priorities[4]. [0=Undef, 1=DHCHAP]"},
460 
461 	/* CFG_AUTH_HASH */
462 	{"auth-hash",
463 		0, 0x2222, 0x1200, 0,
464 		PARM_DYNAMIC_LINK | PARM_HEX | PARM_HIDDEN,
465 	"Sets authentication hash priorities[4]. [0=Undef, 1=MD5, 2=SHA1]"},
466 
467 	/* CFG_AUTH_GROUP */
468 	{"auth-group",
469 		0, 0x55555555, 0x54321000, 0,
470 		PARM_DYNAMIC_LINK | PARM_HEX | PARM_HIDDEN,
471 	"Sets auth group priorities[8]. "
472 		"[0=Undef,1=NULL,2=1024,3=1280,4=1536,5=2048]"},
473 
474 	/* CFG_AUTH_INTERVAL */
475 	{"auth-interval",
476 		0, 3600, 300, 0,
477 		PARM_DYNAMIC_LINK | PARM_HIDDEN,
478 	"Sets re-authentication interval. (minutes)"},
479 
480 #endif	/* DHCHAP_SUPPORT */
481 
482 #ifdef SFCT_SUPPORT
483 	/* CFG_TARGET_MODE */
484 	{"target-mode",
485 #ifdef SFCT_ENABLED
486 		0, 1, 1, 0,
487 #else
488 		0, 1, 0, 0,
489 #endif /* SFCT_ENABLED */
490 		PARM_BOOLEAN,
491 	"Enables target mode support in driver. [0=Disabled, 1=Enabled]"},
492 #endif /* SFCT_SUPPORT */
493 
494 	/* CFG_NUM_WQ */
495 	{"num-wq",
496 		1, 4, 1, 0,
497 		PARM_DYNAMIC_RESET | PARM_HIDDEN,
498 	"Defines number of Work Queues (WQs) per EQ."},
499 
500 	/* CFG_PERSIST_LINKDOWN */
501 	{"persist-linkdown",
502 		0, 1, 0, 0,
503 		PARM_DYNAMIC_RESET | PARM_BOOLEAN,
504 	"Set link persistently down [0=Disabled, 1=Enabled]."},
505 
506 	/* CFG_ENABLE_PATCH */
507 	{"enable-patch",
508 		0, 0xFFFFFFFF, DEFAULT_PATCHES, 0,
509 		PARM_DYNAMIC | PARM_HEX | PARM_HIDDEN,
510 	"Enables patches in driver."},
511 
512 	/* CFG_FAST_TGT_RESET */
513 	{"fast-tgt-reset",
514 		0, 1, 0, 0,
515 		PARM_DYNAMIC_RESET | PARM_BOOLEAN | PARM_HIDDEN,
516 	"Enables alternative target reset processing. "
517 		"[0=Disabled 1=Enabled]"},
518 
519 	/* CFG_FAST_TGT_RESET_TMR */
520 	{"fast-tgt-reset-timer",
521 		0, 60, 10, 0,
522 		PARM_DYNAMIC_RESET | PARM_BOOLEAN | PARM_HIDDEN,
523 	"RSCN notification timer for fast target reset. "
524 		"[0=Disabled 1-60=seconds]"},
525 
526 };
527 
528 #endif	/* DEF_ICFG */
529 
530 #ifdef	__cplusplus
531 }
532 #endif
533 
534 #endif	/* _EMLXS_CONFIG_H */
535