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