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