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 2010 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 CFG_FCT_QDEPTH, /* fct-queue-depth */ 120 #endif /* SFCT_SUPPORT */ 121 CFG_NUM_WQ, /* num-wq (hidden) */ 122 CFG_PERSIST_LINKDOWN, /* persist-linkdown */ 123 CFG_ENABLE_PATCH, /* enable-patch (hidden) */ 124 CFG_FAST_TGT_RESET, /* fast-tgt-reset (hidden) */ 125 CFG_FAST_TGT_RESET_TMR, /* fast-tgt-reset-timer (hidden) */ 126 127 CFG_FCF_SOLICIT_DELAY, /* fcf-solicit-delay (hidden) */ 128 CFG_FCF_FAILOVER_DELAY, /* fcf-failover-delay (hidden) */ 129 CFG_FCF_RESOLICIT_DELAY, /* fcf-resolicit-delay (hidden) */ 130 131 NUM_CFG_PARAM 132 133 } emlxs_cfg_parm_t; 134 135 #define PARM_HIDDEN 0x80000000 136 137 138 139 #ifdef DEF_ICFG 140 141 /* 142 * The entries in this array must be in the exact order 143 * defined in emlxs_cfg_parm_t 144 */ 145 emlxs_config_t emlxs_cfg[] = { 146 /* CFG_CONSOLE_NOTICES */ 147 {"console-notices", 148 0, 0xffffffff, 0, 0, 149 PARM_DYNAMIC | PARM_HEX, 150 "Verbose mask for notice messages to the console."}, 151 152 /* CFG_CONSOLE_WARNINGS */ 153 {"console-warnings", 154 0, 0xffffffff, 0, 0, 155 PARM_DYNAMIC | PARM_HEX, 156 "Verbose mask for warning messages to the console."}, 157 158 /* CFG_CONSOLE_ERRORS */ 159 {"console-errors", 160 0, 0xffffffff, 0, 0, 161 PARM_DYNAMIC | PARM_HEX, 162 "Verbose mask for error messages to the console."}, 163 164 /* CFG_CONSOLE_DEBUGS */ 165 {"console-debugs", 166 0, 0xffffffff, 0, 0, 167 PARM_DYNAMIC | PARM_HEX | PARM_HIDDEN, 168 "Verbose mask for debugging messages to the console."}, 169 170 /* CFG_LOG_NOTICES */ 171 {"log-notices", 172 0, 0xffffffff, 0xffffffff, 0, 173 PARM_DYNAMIC | PARM_HEX, 174 "Verbose mask for notice messages to the messages file."}, 175 176 /* CFG_LOG_WARNINGS */ 177 {"log-warnings", 178 0, 0xffffffff, 0xffffffff, 0, 179 PARM_DYNAMIC | PARM_HEX, 180 "Verbose mask for warning messages to the messages file."}, 181 182 /* CFG_LOG_ERRORS */ 183 {"log-errors", 184 0, 0xffffffff, 0xffffffff, 0, 185 PARM_DYNAMIC | PARM_HEX, 186 "Verbose mask for error messages to the messages file."}, 187 188 /* CFG_LOG_DEBUGS */ 189 {"log-debugs", 190 0, 0xffffffff, 0, 0, 191 PARM_DYNAMIC | PARM_HEX | PARM_HIDDEN, 192 "Verbose mask for debugging messages to the messages file."}, 193 194 195 /* CFG_NUM_IOCBS */ 196 {"num-iocbs", 197 128, 10240, 1024, 0, 198 PARM_DYNAMIC_RESET, 199 "Number of IOCB buffers the driver should allocate."}, 200 201 /* CFG_MAX_XFER_SIZE */ 202 {"max-xfer-size", 203 131072, 1388544, 339968, 0, 204 0, 205 "Sets maximum bytes per IO the driver can transfer."}, 206 207 /* CFG_UB_BUFS */ 208 {"ub-bufs", 209 40, 16320, 1000, 0, 210 0, 211 "Number of unsolicited buffers the driver should allocate."}, 212 213 /* IP specific parameters */ 214 215 /* CFG_NETWORK_ON */ 216 {"network-on", 217 0, 1, 1, 0, 218 PARM_BOOLEAN, 219 "Enable IP processing. [0=Disabled, 1=Enabled]"}, 220 221 /* Fibre Channel specific parameters */ 222 223 /* CFG_ACK0 */ 224 {"ack0", 225 0, 1, 0, 0, 226 PARM_DYNAMIC_LINK | PARM_BOOLEAN, 227 "Enables ACK0 support. [0=Disabled, 1=Enabled]"}, 228 229 /* CFG_TOPOLOGY */ 230 {"topology", 231 0, 6, 0, 0, 232 PARM_DYNAMIC_LINK, 233 "Select Fibre Channel topology. " 234 "[0=Loop->PTP, 2=PTP, 4=Loop, 6=PTP->Loop]"}, 235 236 /* CFG_LINK_SPEED */ 237 {"link-speed", 238 0, 8, 0, 0, 239 PARM_DYNAMIC_LINK, 240 "Select link speed. [0=Auto, 1=1Gb, 2=2Gb, 4=4Gb, 8=8Gb]"}, 241 242 /* CFG_NUM_NODES */ 243 {"num-nodes", 244 0, 4096, 0, 0, 245 PARM_DYNAMIC_RESET, 246 "Number of fibre channel nodes (NPorts) the driver will support. " 247 "[0=no_limit]"}, 248 249 /* CFG_CR_DELAY */ 250 {"cr-delay", 251 0, 63, 0, 0, 252 PARM_DYNAMIC_LINK, 253 "A count of milliseconds after which " 254 "an interrupt response is generated"}, 255 256 /* CFG_CR_COUNT */ 257 {"cr-count", 258 1, 255, 1, 0, 259 PARM_DYNAMIC_LINK, 260 "A count of I/O completions after " 261 "which an interrupt response is generated"}, 262 263 /* CFG_ASSIGN_ALPA */ 264 {"assign-alpa", 265 0, 0xef, 0, 0, 266 PARM_DYNAMIC_LINK | PARM_HEX, 267 "Assigns a preferred ALPA to the port. Only used in Loop topology."}, 268 269 /* CFG_ADISC_SUPPORT */ 270 {"adisc-support", 271 0, 2, 1, 0, 272 PARM_DYNAMIC, 273 "Sets the Fibre Channel ADISC login support level. " 274 "[0=None, 1=Partial, 2=Full]"}, 275 276 /* CFG_PM_SUPPORT */ 277 {"pm-support", 278 0, 1, 0, 0, 279 PARM_BOOLEAN, 280 "Enables power management support. [0=Disabled, 1=Enabled]"}, 281 282 /* CFG_PM_IDLE */ 283 {"pm-idle", 284 0, 3600, 300, 0, 285 PARM_DYNAMIC | PARM_HIDDEN, 286 "Sets power management idle timeout value (seconds)."}, 287 288 /* CFG_FW_CHECK */ 289 {"fw-check", 290 0, 7, 1, 0, 291 PARM_DYNAMIC_RESET | PARM_HEX | PARM_HIDDEN, 292 "Enables firmware revision checking. " 293 "[0=Off 1=Sun-only 2=All 4=kern-update]"}, 294 295 /* CFG_TRI_REQUIRED */ 296 {"tri-required", 297 0, 1, 0, 0, 298 PARM_DYNAMIC | PARM_BOOLEAN | PARM_HIDDEN, 299 "Requires Task Retry Id support by a remote device " 300 "for FCP-2 error recovery."}, 301 302 /* CFG_DISC_TIMEOUT */ 303 {"discovery-timeout", 304 0, 600, 25, 0, 305 PARM_DYNAMIC | PARM_HIDDEN, 306 "Sets the discovery timeout period (seconds) " 307 "for managing FCP-2 devices."}, 308 309 /* CFG_LINKUP_TIMEOUT */ 310 {"linkup-timeout", 311 0, 10, 2, 0, 312 PARM_DYNAMIC | PARM_HIDDEN, 313 "Sets the linkup timeout period (seconds)."}, 314 315 /* CFG_LINKUP_DELAY */ 316 {"linkup-delay", 317 0, 60, 10, 0, 318 PARM_DYNAMIC_RESET, 319 "Sets the driver wait period (seconds) " 320 "for a linkup after initialization."}, 321 322 /* CFG_OFFLINE_TIMEOUT */ 323 {"offline-timeout", 324 0, 600, 45, 0, 325 PARM_DYNAMIC | PARM_HIDDEN, 326 "Sets the offline timeout period (seconds)."}, 327 328 /* CFG_LILP_ENABLE */ 329 {"enable-lilp", 330 0, 1, 1, 0, 331 PARM_DYNAMIC_RESET | PARM_BOOLEAN | PARM_HIDDEN, 332 "Enables LIRP/LILP support in the driver. [0=Disabled, 1=Enabled]"}, 333 334 /* CFG_PCI_MAX_READ */ 335 {"pci-max-read", 336 512, 4096, 2048, 0, 337 PARM_DYNAMIC_RESET, 338 "Sets the PCI-X max memory read byte count. [512,1024,2048 or 4096]"}, 339 340 /* CFG_HEARTBEAT_ENABLE */ 341 {"heartbeat-enable", 342 0, 1, 1, 0, 343 PARM_DYNAMIC | PARM_BOOLEAN | PARM_HIDDEN, 344 "Enables driver's mailbox heartbeat to the adapter. " 345 "[0=Disabled, 1=Enabled]"}, 346 347 /* CFG_RESET_ENABLE */ 348 {"reset-enable", 349 0, 1, 1, 0, 350 PARM_DYNAMIC | PARM_BOOLEAN | PARM_HIDDEN, 351 "Enables driver's ability to reset the adapter. " 352 "[0=Disabled, 1=Enabled]"}, 353 354 /* CFG_TIMEOUT_ENABLE */ 355 {"timeout-enable", 356 0, 1, 1, 0, 357 PARM_DYNAMIC | PARM_BOOLEAN | PARM_HIDDEN, 358 "Enables driver's ability to timeout commands. " 359 "[0=Disabled, 1=Enabled]"}, 360 361 /* CFG_NUM_IOTAGS */ 362 {"num-iotags", 363 0, 4096, 0, 0, 364 PARM_DYNAMIC_RESET | PARM_HIDDEN, 365 "Sets number of outstanding IO's. " 366 "[0=max determined by type of HBA]"}, 367 368 #ifdef FMA_SUPPORT 369 /* CFG_FM_CAPS */ 370 {"fm-capable", 371 0, 0xF, 0xB, 0, 372 PARM_HEX | PARM_HIDDEN, 373 "Sets FMA capabilities. [bit 3:errcb, 2:dmachk, 1:accchk, 0:ereport]"}, 374 #endif /* FMA_SUPPORT */ 375 376 377 #ifdef MAX_RRDY_SUPPORT 378 /* CFG_MAX_RRDY */ 379 {"max-rrdy", 380 0, 255, 2, 0, 381 PARM_DYNAMIC_RESET | PARM_HIDDEN, 382 "Sets maximum number RRDY's for the adapter on private loop."}, 383 #endif /* MAX_RRDY_SUPPORT */ 384 385 #ifdef MSI_SUPPORT 386 /* CFG_MSI_MODE */ 387 {"msi-mode", 388 0, 3, 3, 0, 389 PARM_HIDDEN, 390 "Sets the default MSI mode in driver. " 391 "[0=Off 1=Single-MSI 2=Multi-MSI 3=Auto]"}, 392 #endif /* MSI_SUPPORT */ 393 394 /* CFG_SLI_MODE */ 395 {"sli-mode", 396 0, 4, 0, 0, 397 PARM_DYNAMIC_RESET | PARM_HIDDEN, 398 "Sets default SLI mode. " 399 "[0=Auto, 2=SLI2-remove all vports first, 3=SLI3, 4=SLI4]"}, 400 401 /* CFG_NPIV_ENABLE */ 402 {"enable-npiv", 403 0, 1, 0, 0, 404 PARM_DYNAMIC_RESET | PARM_BOOLEAN, 405 "Enables NPIV. [0=Disabled-remove all vports first, " 406 "1=Enabled-requires SLI3+]"}, 407 408 /* CFG_VPORT_RESTRICTED */ 409 {"vport-restrict-login", 410 0, 1, 1, 0, 411 PARM_DYNAMIC_LINK | PARM_BOOLEAN, 412 "Restricts login to virtual ports to conserve resources. " 413 "[0=Disabled, 1=Enabled]"}, 414 415 /* CFG_NPIV_DELAY */ 416 {"enable-npiv-delay", 417 0, 1, 1, 0, 418 PARM_DYNAMIC | PARM_HIDDEN, 419 "Enable FDISC/NS command delay from vports to switch. " 420 "[0=Disabled, 1=Enabled]"}, 421 422 #ifdef DHCHAP_SUPPORT 423 /* CFG_AUTH_ENABLE */ 424 {"enable-auth", 425 0, 1, 0, 0, 426 PARM_DYNAMIC_LINK | PARM_BOOLEAN, 427 "Enables DHCHAP support in the driver. [0=Disabled, 1=Enabled]"}, 428 429 /* CFG_AUTH_E2E */ 430 {"auth-e2e", 431 0, 1, 0, 0, 432 PARM_DYNAMIC_LINK | PARM_BOOLEAN | PARM_HIDDEN, 433 "Enables end-to-end DHCHAP support in the driver. " 434 "[0=Disabled, 1=Enabled]"}, 435 436 /* CFG_AUTH_NPIV */ 437 {"auth-npiv", 438 0, 1, 0, 0, 439 PARM_DYNAMIC_LINK | PARM_BOOLEAN | PARM_HIDDEN, 440 "Enables DHCHAP support for virtual ports. [0=Disabled, 1=Enabled]"}, 441 442 /* CFG_AUTH_TMO */ 443 {"auth-tmo", 444 20, 999, 45, 0, 445 PARM_DYNAMIC_LINK | PARM_HIDDEN, 446 "Sets authentication timeout value. (seconds)"}, 447 448 /* CFG_AUTH_MODE */ 449 {"auth-mode", 450 1, 3, 1, 0, 451 PARM_DYNAMIC_LINK | PARM_HIDDEN, 452 "Sets authentication mode. [1=Disabled, 2=Active, 3=Passive]"}, 453 454 /* CFG_AUTH_BIDIR */ 455 {"auth-bidir", 456 0, 1, 0, 0, 457 PARM_DYNAMIC_LINK | PARM_BOOLEAN | PARM_HIDDEN, 458 "Sets authentication bidirectional mode. [0=Disabled, 1=Enabled]"}, 459 460 /* CFG_AUTH_TYPE */ 461 {"auth-type", 462 0, 0x1111, 0x1000, 0, 463 PARM_DYNAMIC_LINK | PARM_HEX | PARM_HIDDEN, 464 "Sets authentication type priorities[4]. [0=Undef, 1=DHCHAP]"}, 465 466 /* CFG_AUTH_HASH */ 467 {"auth-hash", 468 0, 0x2222, 0x1200, 0, 469 PARM_DYNAMIC_LINK | PARM_HEX | PARM_HIDDEN, 470 "Sets authentication hash priorities[4]. [0=Undef, 1=MD5, 2=SHA1]"}, 471 472 /* CFG_AUTH_GROUP */ 473 {"auth-group", 474 0, 0x55555555, 0x54321000, 0, 475 PARM_DYNAMIC_LINK | PARM_HEX | PARM_HIDDEN, 476 "Sets auth group priorities[8]. " 477 "[0=Undef,1=NULL,2=1024,3=1280,4=1536,5=2048]"}, 478 479 /* CFG_AUTH_INTERVAL */ 480 {"auth-interval", 481 0, 3600, 300, 0, 482 PARM_DYNAMIC_LINK | PARM_HIDDEN, 483 "Sets re-authentication interval. (minutes)"}, 484 485 #endif /* DHCHAP_SUPPORT */ 486 487 #ifdef SFCT_SUPPORT 488 /* CFG_TARGET_MODE */ 489 {"target-mode", 490 #ifdef SFCT_ENABLED 491 0, 1, 1, 0, 492 #else 493 0, 1, 0, 0, 494 #endif /* SFCT_ENABLED */ 495 0, 496 "Enables target mode support in driver. [0=Disabled, 1=Enabled]"}, 497 498 /* CFG_FCT_QDEPTH */ 499 {"fct-queue-depth", 500 0, 4096, 0, 0, 501 PARM_BOOLEAN, 502 "Queue depth of target mode port. " 503 "[0=max determined by type of HBA]"}, 504 #endif /* SFCT_SUPPORT */ 505 506 /* CFG_NUM_WQ */ 507 {"num-wq", 508 1, 4, 1, 0, 509 PARM_DYNAMIC_RESET | PARM_HIDDEN, 510 "Defines number of Work Queues (WQs) per EQ."}, 511 512 /* CFG_PERSIST_LINKDOWN */ 513 {"persist-linkdown", 514 0, 1, 0, 0, 515 PARM_DYNAMIC_RESET | PARM_BOOLEAN, 516 "Set link persistently down [0=Disabled, 1=Enabled]."}, 517 518 /* CFG_ENABLE_PATCH */ 519 {"enable-patch", 520 0, 0xFFFFFFFF, DEFAULT_PATCHES, 0, 521 PARM_DYNAMIC | PARM_HEX | PARM_HIDDEN, 522 "Enables patches in driver."}, 523 524 /* CFG_FAST_TGT_RESET */ 525 {"fast-tgt-reset", 526 0, 1, 0, 0, 527 PARM_DYNAMIC_RESET | PARM_BOOLEAN | PARM_HIDDEN, 528 "Enables alternative target reset processing. " 529 "[0=Disabled 1=Enabled]"}, 530 531 /* CFG_FAST_TGT_RESET_TMR */ 532 {"fast-tgt-reset-timer", 533 0, 60, 10, 0, 534 PARM_DYNAMIC_RESET | PARM_BOOLEAN | PARM_HIDDEN, 535 "RSCN notification timer for fast target reset. " 536 "[0=Disabled 1-60=seconds]"}, 537 538 /* CFG_FCF_SOLICIT_DELAY */ 539 {"fcf-solicit-delay", 540 0, 60, 3, 0, 541 PARM_DYNAMIC | PARM_HIDDEN, 542 "Sets delay after FCF solicit request before reading FCF table. " 543 "[0-60=seconds]"}, 544 545 /* CFG_FCF_FAILOVER_DELAY */ 546 {"fcf-failover-delay", 547 0, 60, 0, 0, 548 PARM_DYNAMIC | PARM_HIDDEN, 549 "Sets delay before attempting failover to a new FCF. " 550 "[0-60=seconds]"}, 551 552 /* CFG_FCF_RESOLICIT_DELAY */ 553 {"fcf-resolicit-delay", 554 0, 60, 3, 0, 555 PARM_DYNAMIC | PARM_HIDDEN, 556 "Sets delay after total FCF failure before resoliciting. " 557 "[0-60=seconds]"}, 558 }; 559 560 #endif /* DEF_ICFG */ 561 562 #ifdef __cplusplus 563 } 564 #endif 565 566 #endif /* _EMLXS_CONFIG_H */ 567