emlxs_dfc.c (8f23e9fa) | emlxs_dfc.c (a3170057) |
---|---|
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 --- 8 unchanged lines hidden (view full) --- 17 * information: Portions Copyright [yyyy] [name of copyright owner] 18 * 19 * CDDL HEADER END 20 */ 21 22/* 23 * Copyright (c) 2004-2012 Emulex. All rights reserved. 24 * Use is subject to license terms. | 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 --- 8 unchanged lines hidden (view full) --- 17 * information: Portions Copyright [yyyy] [name of copyright owner] 18 * 19 * CDDL HEADER END 20 */ 21 22/* 23 * Copyright (c) 2004-2012 Emulex. All rights reserved. 24 * Use is subject to license terms. |
25 * Copyright 2020 RackTop Systems, Inc. |
|
25 */ 26 27#include <emlxs.h> 28 29/* Required for EMLXS_CONTEXT in EMLXS_MSGF calls */ 30EMLXS_MSG_DEF(EMLXS_DFC_C); 31 32static int32_t emlxs_dfc_get_rev(emlxs_hba_t *hba, dfc_t *dfc, --- 1216 unchanged lines hidden (view full) --- 1249 rval = EINVAL; 1250 goto done; 1251 } 1252 1253 hba_attrs = 1254 (fc_hba_adapter_attributes32_t *)fcio->fcio_obuf; 1255 1256 hba_attrs->version = FC_HBA_ADAPTER_ATTRIBUTES_VERSION; | 26 */ 27 28#include <emlxs.h> 29 30/* Required for EMLXS_CONTEXT in EMLXS_MSGF calls */ 31EMLXS_MSG_DEF(EMLXS_DFC_C); 32 33static int32_t emlxs_dfc_get_rev(emlxs_hba_t *hba, dfc_t *dfc, --- 1216 unchanged lines hidden (view full) --- 1250 rval = EINVAL; 1251 goto done; 1252 } 1253 1254 hba_attrs = 1255 (fc_hba_adapter_attributes32_t *)fcio->fcio_obuf; 1256 1257 hba_attrs->version = FC_HBA_ADAPTER_ATTRIBUTES_VERSION; |
1257 (void) strncpy(hba_attrs->Manufacturer, "Emulex", | 1258 (void) strncpy(hba_attrs->Manufacturer, 1259 hba->model_info.manufacturer, |
1258 (sizeof (hba_attrs->Manufacturer)-1)); 1259 (void) strncpy(hba_attrs->SerialNumber, vpd->serial_num, 1260 (sizeof (hba_attrs->SerialNumber)-1)); 1261 (void) strncpy(hba_attrs->Model, hba->model_info.model, 1262 (sizeof (hba_attrs->Model)-1)); 1263 (void) strncpy(hba_attrs->ModelDescription, 1264 hba->model_info.model_desc, 1265 (sizeof (hba_attrs->ModelDescription)-1)); --- 12 unchanged lines hidden (view full) --- 1278 vpd->fcode_version, 1279 (sizeof (hba_attrs->OptionROMVersion)-1)); 1280 (void) snprintf(hba_attrs->FirmwareVersion, 1281 (sizeof (hba_attrs->FirmwareVersion)-1), 1282 "%s (%s)", vpd->fw_version, vpd->fw_label); 1283 (void) strncpy(hba_attrs->DriverName, DRIVER_NAME, 1284 (sizeof (hba_attrs->DriverName)-1)); 1285 hba_attrs->VendorSpecificID = | 1260 (sizeof (hba_attrs->Manufacturer)-1)); 1261 (void) strncpy(hba_attrs->SerialNumber, vpd->serial_num, 1262 (sizeof (hba_attrs->SerialNumber)-1)); 1263 (void) strncpy(hba_attrs->Model, hba->model_info.model, 1264 (sizeof (hba_attrs->Model)-1)); 1265 (void) strncpy(hba_attrs->ModelDescription, 1266 hba->model_info.model_desc, 1267 (sizeof (hba_attrs->ModelDescription)-1)); --- 12 unchanged lines hidden (view full) --- 1280 vpd->fcode_version, 1281 (sizeof (hba_attrs->OptionROMVersion)-1)); 1282 (void) snprintf(hba_attrs->FirmwareVersion, 1283 (sizeof (hba_attrs->FirmwareVersion)-1), 1284 "%s (%s)", vpd->fw_version, vpd->fw_label); 1285 (void) strncpy(hba_attrs->DriverName, DRIVER_NAME, 1286 (sizeof (hba_attrs->DriverName)-1)); 1287 hba_attrs->VendorSpecificID = |
1286 ((hba->model_info.device_id << 16) | 1287 PCI_VENDOR_ID_EMULEX); | 1288 (hba->model_info.device_id << 16) | 1289 hba->model_info.vendor_id; |
1288 hba_attrs->NumberOfPorts = hba->num_of_ports; 1289 } else { 1290 fc_hba_adapter_attributes_t *hba_attrs; 1291 1292 if (fcio->fcio_xfer != FCIO_XFER_READ || 1293 fcio->fcio_olen < 1294 sizeof (fc_hba_adapter_attributes_t)) { 1295 rval = EINVAL; 1296 goto done; 1297 } 1298 1299 hba_attrs = 1300 (fc_hba_adapter_attributes_t *)fcio->fcio_obuf; 1301 1302 hba_attrs->version = FC_HBA_ADAPTER_ATTRIBUTES_VERSION; | 1290 hba_attrs->NumberOfPorts = hba->num_of_ports; 1291 } else { 1292 fc_hba_adapter_attributes_t *hba_attrs; 1293 1294 if (fcio->fcio_xfer != FCIO_XFER_READ || 1295 fcio->fcio_olen < 1296 sizeof (fc_hba_adapter_attributes_t)) { 1297 rval = EINVAL; 1298 goto done; 1299 } 1300 1301 hba_attrs = 1302 (fc_hba_adapter_attributes_t *)fcio->fcio_obuf; 1303 1304 hba_attrs->version = FC_HBA_ADAPTER_ATTRIBUTES_VERSION; |
1303 (void) strncpy(hba_attrs->Manufacturer, "Emulex", | 1305 (void) strncpy(hba_attrs->Manufacturer, 1306 hba->model_info.manufacturer, |
1304 (sizeof (hba_attrs->Manufacturer)-1)); 1305 (void) strncpy(hba_attrs->SerialNumber, vpd->serial_num, 1306 (sizeof (hba_attrs->SerialNumber)-1)); 1307 (void) strncpy(hba_attrs->Model, hba->model_info.model, 1308 (sizeof (hba_attrs->Model)-1)); 1309 (void) strncpy(hba_attrs->ModelDescription, 1310 hba->model_info.model_desc, 1311 (sizeof (hba_attrs->ModelDescription)-1)); --- 12 unchanged lines hidden (view full) --- 1324 vpd->fcode_version, 1325 (sizeof (hba_attrs->OptionROMVersion)-1)); 1326 (void) snprintf(hba_attrs->FirmwareVersion, 1327 (sizeof (hba_attrs->FirmwareVersion)-1), 1328 "%s (%s)", vpd->fw_version, vpd->fw_label); 1329 (void) strncpy(hba_attrs->DriverName, DRIVER_NAME, 1330 (sizeof (hba_attrs->DriverName)-1)); 1331 hba_attrs->VendorSpecificID = | 1307 (sizeof (hba_attrs->Manufacturer)-1)); 1308 (void) strncpy(hba_attrs->SerialNumber, vpd->serial_num, 1309 (sizeof (hba_attrs->SerialNumber)-1)); 1310 (void) strncpy(hba_attrs->Model, hba->model_info.model, 1311 (sizeof (hba_attrs->Model)-1)); 1312 (void) strncpy(hba_attrs->ModelDescription, 1313 hba->model_info.model_desc, 1314 (sizeof (hba_attrs->ModelDescription)-1)); --- 12 unchanged lines hidden (view full) --- 1327 vpd->fcode_version, 1328 (sizeof (hba_attrs->OptionROMVersion)-1)); 1329 (void) snprintf(hba_attrs->FirmwareVersion, 1330 (sizeof (hba_attrs->FirmwareVersion)-1), 1331 "%s (%s)", vpd->fw_version, vpd->fw_label); 1332 (void) strncpy(hba_attrs->DriverName, DRIVER_NAME, 1333 (sizeof (hba_attrs->DriverName)-1)); 1334 hba_attrs->VendorSpecificID = |
1332 ((hba->model_info.device_id << 16) | 1333 PCI_VENDOR_ID_EMULEX); | 1335 (hba->model_info.device_id << 16) | 1336 hba->model_info.vendor_id; |
1334 hba_attrs->NumberOfPorts = hba->num_of_ports; 1335 } 1336 1337done: 1338 return (rval); 1339 1340} /* emlxs_fcio_get_adapter_attrs() */ 1341 --- 100 unchanged lines hidden (view full) --- 1442 case LA_10GHZ_LINK: 1443 port_attrs->PortSpeed = 1444 HBA_PORTSPEED_10GBIT; 1445 break; 1446 case LA_16GHZ_LINK: 1447 port_attrs->PortSpeed = 1448 HBA_PORTSPEED_16GBIT; 1449 break; | 1337 hba_attrs->NumberOfPorts = hba->num_of_ports; 1338 } 1339 1340done: 1341 return (rval); 1342 1343} /* emlxs_fcio_get_adapter_attrs() */ 1344 --- 100 unchanged lines hidden (view full) --- 1445 case LA_10GHZ_LINK: 1446 port_attrs->PortSpeed = 1447 HBA_PORTSPEED_10GBIT; 1448 break; 1449 case LA_16GHZ_LINK: 1450 port_attrs->PortSpeed = 1451 HBA_PORTSPEED_16GBIT; 1452 break; |
1453 case LA_32GHZ_LINK: 1454 port_attrs->PortSpeed = 1455 HBA_PORTSPEED_32GBIT; 1456 break; |
|
1450 default: 1451 port_attrs->PortSpeed = 1452 HBA_PORTSPEED_UNKNOWN; 1453 } 1454 1455 port_attrs->NumberofDiscoveredPorts = 1456 emlxs_nport_count(port); 1457 } 1458 1459 port_attrs->PortSupportedClassofService = 1460 LE_SWAP32(FC_NS_CLASS3); 1461 (void) strncpy((caddr_t)port_attrs->PortSymbolicName, 1462 (caddr_t)port->spn, 1463 (sizeof (port_attrs->PortSymbolicName)-1)); 1464 1465 /* Set the hba speed limit */ | 1457 default: 1458 port_attrs->PortSpeed = 1459 HBA_PORTSPEED_UNKNOWN; 1460 } 1461 1462 port_attrs->NumberofDiscoveredPorts = 1463 emlxs_nport_count(port); 1464 } 1465 1466 port_attrs->PortSupportedClassofService = 1467 LE_SWAP32(FC_NS_CLASS3); 1468 (void) strncpy((caddr_t)port_attrs->PortSymbolicName, 1469 (caddr_t)port->spn, 1470 (sizeof (port_attrs->PortSymbolicName)-1)); 1471 1472 /* Set the hba speed limit */ |
1473 if (vpd->link_speed & LMT_32GB_CAPABLE) { 1474 port_attrs->PortSupportedSpeed |= 1475 FC_HBA_PORTSPEED_32GBIT; 1476 } |
|
1466 if (vpd->link_speed & LMT_16GB_CAPABLE) { 1467 port_attrs->PortSupportedSpeed |= 1468 FC_HBA_PORTSPEED_16GBIT; 1469 } 1470 if (vpd->link_speed & LMT_10GB_CAPABLE) { 1471 port_attrs->PortSupportedSpeed |= 1472 FC_HBA_PORTSPEED_10GBIT; 1473 } --- 114 unchanged lines hidden (view full) --- 1588 case LA_10GHZ_LINK: 1589 port_attrs->PortSpeed = 1590 HBA_PORTSPEED_10GBIT; 1591 break; 1592 case LA_16GHZ_LINK: 1593 port_attrs->PortSpeed = 1594 HBA_PORTSPEED_16GBIT; 1595 break; | 1477 if (vpd->link_speed & LMT_16GB_CAPABLE) { 1478 port_attrs->PortSupportedSpeed |= 1479 FC_HBA_PORTSPEED_16GBIT; 1480 } 1481 if (vpd->link_speed & LMT_10GB_CAPABLE) { 1482 port_attrs->PortSupportedSpeed |= 1483 FC_HBA_PORTSPEED_10GBIT; 1484 } --- 114 unchanged lines hidden (view full) --- 1599 case LA_10GHZ_LINK: 1600 port_attrs->PortSpeed = 1601 HBA_PORTSPEED_10GBIT; 1602 break; 1603 case LA_16GHZ_LINK: 1604 port_attrs->PortSpeed = 1605 HBA_PORTSPEED_16GBIT; 1606 break; |
1607 case LA_32GHZ_LINK: 1608 port_attrs->PortSpeed = 1609 HBA_PORTSPEED_32GBIT; 1610 break; |
|
1596 default: 1597 port_attrs->PortSpeed = 1598 HBA_PORTSPEED_UNKNOWN; 1599 } 1600 1601 port_attrs->NumberofDiscoveredPorts = 1602 emlxs_nport_count(port); 1603 } 1604 1605 port_attrs->PortSupportedClassofService = 1606 LE_SWAP32(FC_NS_CLASS3); 1607 (void) strncpy((caddr_t)port_attrs->PortSymbolicName, 1608 (caddr_t)port->spn, 1609 (sizeof (port_attrs->PortSymbolicName)-1)); 1610 1611 /* Set the hba speed limit */ | 1611 default: 1612 port_attrs->PortSpeed = 1613 HBA_PORTSPEED_UNKNOWN; 1614 } 1615 1616 port_attrs->NumberofDiscoveredPorts = 1617 emlxs_nport_count(port); 1618 } 1619 1620 port_attrs->PortSupportedClassofService = 1621 LE_SWAP32(FC_NS_CLASS3); 1622 (void) strncpy((caddr_t)port_attrs->PortSymbolicName, 1623 (caddr_t)port->spn, 1624 (sizeof (port_attrs->PortSymbolicName)-1)); 1625 1626 /* Set the hba speed limit */ |
1627 if (vpd->link_speed & LMT_32GB_CAPABLE) { 1628 port_attrs->PortSupportedSpeed |= 1629 FC_HBA_PORTSPEED_32GBIT; 1630 } |
|
1612 if (vpd->link_speed & LMT_16GB_CAPABLE) { 1613 port_attrs->PortSupportedSpeed |= 1614 FC_HBA_PORTSPEED_16GBIT; 1615 } 1616 if (vpd->link_speed & LMT_10GB_CAPABLE) { 1617 port_attrs->PortSupportedSpeed |= 1618 FC_HBA_PORTSPEED_10GBIT; 1619 } --- 601 unchanged lines hidden (view full) --- 2221 case LA_10GHZ_LINK: 2222 port_attrs->PortSpeed = 2223 HBA_PORTSPEED_10GBIT; 2224 break; 2225 case LA_16GHZ_LINK: 2226 port_attrs->PortSpeed = 2227 HBA_PORTSPEED_16GBIT; 2228 break; | 1631 if (vpd->link_speed & LMT_16GB_CAPABLE) { 1632 port_attrs->PortSupportedSpeed |= 1633 FC_HBA_PORTSPEED_16GBIT; 1634 } 1635 if (vpd->link_speed & LMT_10GB_CAPABLE) { 1636 port_attrs->PortSupportedSpeed |= 1637 FC_HBA_PORTSPEED_10GBIT; 1638 } --- 601 unchanged lines hidden (view full) --- 2240 case LA_10GHZ_LINK: 2241 port_attrs->PortSpeed = 2242 HBA_PORTSPEED_10GBIT; 2243 break; 2244 case LA_16GHZ_LINK: 2245 port_attrs->PortSpeed = 2246 HBA_PORTSPEED_16GBIT; 2247 break; |
2248 case LA_32GHZ_LINK: 2249 port_attrs->PortSpeed = 2250 HBA_PORTSPEED_32GBIT; 2251 break; |
|
2229 } 2230 } 2231 /* public loop */ 2232 else if (hba->topology == TOPOLOGY_LOOP) { 2233 /* Check for common area and domain */ 2234 if ((ndlp->nlp_DID & 0xFFFF00) == 2235 (port->did & 0xFFFF00)) { 2236 port_attrs->PortType = --- 24 unchanged lines hidden (view full) --- 2261 case LA_10GHZ_LINK: 2262 port_attrs->PortSpeed = 2263 HBA_PORTSPEED_10GBIT; 2264 break; 2265 case LA_16GHZ_LINK: 2266 port_attrs->PortSpeed = 2267 HBA_PORTSPEED_16GBIT; 2268 break; | 2252 } 2253 } 2254 /* public loop */ 2255 else if (hba->topology == TOPOLOGY_LOOP) { 2256 /* Check for common area and domain */ 2257 if ((ndlp->nlp_DID & 0xFFFF00) == 2258 (port->did & 0xFFFF00)) { 2259 port_attrs->PortType = --- 24 unchanged lines hidden (view full) --- 2284 case LA_10GHZ_LINK: 2285 port_attrs->PortSpeed = 2286 HBA_PORTSPEED_10GBIT; 2287 break; 2288 case LA_16GHZ_LINK: 2289 port_attrs->PortSpeed = 2290 HBA_PORTSPEED_16GBIT; 2291 break; |
2292 case LA_32GHZ_LINK: 2293 port_attrs->PortSpeed = 2294 HBA_PORTSPEED_32GBIT; 2295 break; |
|
2269 } 2270 } 2271 } 2272 } 2273 2274 port_attrs->PortSupportedClassofService = 2275 LE_SWAP32(FC_NS_CLASS3); 2276 /* port_attrs->PortSymbolicName */ --- 76 unchanged lines hidden (view full) --- 2353 case LA_10GHZ_LINK: 2354 port_attrs->PortSpeed = 2355 HBA_PORTSPEED_10GBIT; 2356 break; 2357 case LA_16GHZ_LINK: 2358 port_attrs->PortSpeed = 2359 HBA_PORTSPEED_16GBIT; 2360 break; | 2296 } 2297 } 2298 } 2299 } 2300 2301 port_attrs->PortSupportedClassofService = 2302 LE_SWAP32(FC_NS_CLASS3); 2303 /* port_attrs->PortSymbolicName */ --- 76 unchanged lines hidden (view full) --- 2380 case LA_10GHZ_LINK: 2381 port_attrs->PortSpeed = 2382 HBA_PORTSPEED_10GBIT; 2383 break; 2384 case LA_16GHZ_LINK: 2385 port_attrs->PortSpeed = 2386 HBA_PORTSPEED_16GBIT; 2387 break; |
2388 case LA_32GHZ_LINK: 2389 port_attrs->PortSpeed = 2390 HBA_PORTSPEED_32GBIT; 2391 break; |
|
2361 } 2362 } 2363 /* public loop */ 2364 else if (hba->topology == TOPOLOGY_LOOP) { 2365 /* Check for common area and domain */ 2366 if ((ndlp->nlp_DID & 0xFFFF00) == 2367 (port->did & 0xFFFF00)) { 2368 port_attrs->PortType = --- 24 unchanged lines hidden (view full) --- 2393 case LA_10GHZ_LINK: 2394 port_attrs->PortSpeed = 2395 HBA_PORTSPEED_10GBIT; 2396 break; 2397 case LA_16GHZ_LINK: 2398 port_attrs->PortSpeed = 2399 HBA_PORTSPEED_16GBIT; 2400 break; | 2392 } 2393 } 2394 /* public loop */ 2395 else if (hba->topology == TOPOLOGY_LOOP) { 2396 /* Check for common area and domain */ 2397 if ((ndlp->nlp_DID & 0xFFFF00) == 2398 (port->did & 0xFFFF00)) { 2399 port_attrs->PortType = --- 24 unchanged lines hidden (view full) --- 2424 case LA_10GHZ_LINK: 2425 port_attrs->PortSpeed = 2426 HBA_PORTSPEED_10GBIT; 2427 break; 2428 case LA_16GHZ_LINK: 2429 port_attrs->PortSpeed = 2430 HBA_PORTSPEED_16GBIT; 2431 break; |
2432 case LA_32GHZ_LINK: 2433 port_attrs->PortSpeed = 2434 HBA_PORTSPEED_32GBIT; 2435 break; |
|
2401 } 2402 } 2403 } 2404 } 2405 2406 port_attrs->PortSupportedClassofService = 2407 LE_SWAP32(FC_NS_CLASS3); 2408 /* port_attrs->PortSymbolicName */ --- 106 unchanged lines hidden (view full) --- 2515 case LA_10GHZ_LINK: 2516 port_attrs->PortSpeed = 2517 HBA_PORTSPEED_10GBIT; 2518 break; 2519 case LA_16GHZ_LINK: 2520 port_attrs->PortSpeed = 2521 HBA_PORTSPEED_16GBIT; 2522 break; | 2436 } 2437 } 2438 } 2439 } 2440 2441 port_attrs->PortSupportedClassofService = 2442 LE_SWAP32(FC_NS_CLASS3); 2443 /* port_attrs->PortSymbolicName */ --- 106 unchanged lines hidden (view full) --- 2550 case LA_10GHZ_LINK: 2551 port_attrs->PortSpeed = 2552 HBA_PORTSPEED_10GBIT; 2553 break; 2554 case LA_16GHZ_LINK: 2555 port_attrs->PortSpeed = 2556 HBA_PORTSPEED_16GBIT; 2557 break; |
2558 case LA_32GHZ_LINK: 2559 port_attrs->PortSpeed = 2560 HBA_PORTSPEED_32GBIT; 2561 break; |
|
2523 } 2524 } 2525 /* public loop */ 2526 else if (hba->topology == TOPOLOGY_LOOP) { 2527 /* Check for common area and domain */ 2528 if ((ndlp->nlp_DID & 0xFFFF00) == 2529 (port->did & 0xFFFF00)) { 2530 port_attrs->PortType = --- 24 unchanged lines hidden (view full) --- 2555 case LA_10GHZ_LINK: 2556 port_attrs->PortSpeed = 2557 HBA_PORTSPEED_10GBIT; 2558 break; 2559 case LA_16GHZ_LINK: 2560 port_attrs->PortSpeed = 2561 HBA_PORTSPEED_16GBIT; 2562 break; | 2562 } 2563 } 2564 /* public loop */ 2565 else if (hba->topology == TOPOLOGY_LOOP) { 2566 /* Check for common area and domain */ 2567 if ((ndlp->nlp_DID & 0xFFFF00) == 2568 (port->did & 0xFFFF00)) { 2569 port_attrs->PortType = --- 24 unchanged lines hidden (view full) --- 2594 case LA_10GHZ_LINK: 2595 port_attrs->PortSpeed = 2596 HBA_PORTSPEED_10GBIT; 2597 break; 2598 case LA_16GHZ_LINK: 2599 port_attrs->PortSpeed = 2600 HBA_PORTSPEED_16GBIT; 2601 break; |
2602 case LA_32GHZ_LINK: 2603 port_attrs->PortSpeed = 2604 HBA_PORTSPEED_32GBIT; 2605 break; |
|
2563 } 2564 } 2565 } 2566 } 2567 2568 port_attrs->PortSupportedClassofService = 2569 LE_SWAP32(FC_NS_CLASS3); 2570 /* port_attrs->PortSymbolicName */ --- 83 unchanged lines hidden (view full) --- 2654 case LA_10GHZ_LINK: 2655 port_attrs->PortSpeed = 2656 HBA_PORTSPEED_10GBIT; 2657 break; 2658 case LA_16GHZ_LINK: 2659 port_attrs->PortSpeed = 2660 HBA_PORTSPEED_16GBIT; 2661 break; | 2606 } 2607 } 2608 } 2609 } 2610 2611 port_attrs->PortSupportedClassofService = 2612 LE_SWAP32(FC_NS_CLASS3); 2613 /* port_attrs->PortSymbolicName */ --- 83 unchanged lines hidden (view full) --- 2697 case LA_10GHZ_LINK: 2698 port_attrs->PortSpeed = 2699 HBA_PORTSPEED_10GBIT; 2700 break; 2701 case LA_16GHZ_LINK: 2702 port_attrs->PortSpeed = 2703 HBA_PORTSPEED_16GBIT; 2704 break; |
2705 case LA_32GHZ_LINK: 2706 port_attrs->PortSpeed = 2707 HBA_PORTSPEED_32GBIT; 2708 break; |
|
2662 } 2663 } 2664 /* public loop */ 2665 else if (hba->topology == TOPOLOGY_LOOP) { 2666 /* Check for common area and domain */ 2667 if ((ndlp->nlp_DID & 0xFFFF00) == 2668 (port->did & 0xFFFF00)) { 2669 port_attrs->PortType = --- 24 unchanged lines hidden (view full) --- 2694 case LA_10GHZ_LINK: 2695 port_attrs->PortSpeed = 2696 HBA_PORTSPEED_10GBIT; 2697 break; 2698 case LA_16GHZ_LINK: 2699 port_attrs->PortSpeed = 2700 HBA_PORTSPEED_16GBIT; 2701 break; | 2709 } 2710 } 2711 /* public loop */ 2712 else if (hba->topology == TOPOLOGY_LOOP) { 2713 /* Check for common area and domain */ 2714 if ((ndlp->nlp_DID & 0xFFFF00) == 2715 (port->did & 0xFFFF00)) { 2716 port_attrs->PortType = --- 24 unchanged lines hidden (view full) --- 2741 case LA_10GHZ_LINK: 2742 port_attrs->PortSpeed = 2743 HBA_PORTSPEED_10GBIT; 2744 break; 2745 case LA_16GHZ_LINK: 2746 port_attrs->PortSpeed = 2747 HBA_PORTSPEED_16GBIT; 2748 break; |
2749 case LA_32GHZ_LINK: 2750 port_attrs->PortSpeed = 2751 HBA_PORTSPEED_32GBIT; 2752 break; |
|
2702 } 2703 } 2704 } 2705 } 2706 2707 port_attrs->PortSupportedClassofService = 2708 LE_SWAP32(FC_NS_CLASS3); 2709 /* port_attrs->PortSymbolicName */ --- 1080 unchanged lines hidden (view full) --- 3790 (void) strncpy(hbainfo->vpd_model_desc, vpd->model_desc, 3791 (sizeof (hbainfo->vpd_model_desc)-1)); 3792 (void) strncpy(hbainfo->vpd_prog_types, vpd->prog_types, 3793 (sizeof (hbainfo->vpd_prog_types)-1)); 3794 (void) strncpy(hbainfo->vpd_id, vpd->id, 3795 (sizeof (hbainfo->vpd_id)-1)); 3796 3797 hbainfo->device_id = hba->model_info.device_id; | 2753 } 2754 } 2755 } 2756 } 2757 2758 port_attrs->PortSupportedClassofService = 2759 LE_SWAP32(FC_NS_CLASS3); 2760 /* port_attrs->PortSymbolicName */ --- 1080 unchanged lines hidden (view full) --- 3841 (void) strncpy(hbainfo->vpd_model_desc, vpd->model_desc, 3842 (sizeof (hbainfo->vpd_model_desc)-1)); 3843 (void) strncpy(hbainfo->vpd_prog_types, vpd->prog_types, 3844 (sizeof (hbainfo->vpd_prog_types)-1)); 3845 (void) strncpy(hbainfo->vpd_id, vpd->id, 3846 (sizeof (hbainfo->vpd_id)-1)); 3847 3848 hbainfo->device_id = hba->model_info.device_id; |
3798 hbainfo->vendor_id = 3799 ddi_get32(hba->pci_acc_handle, 3800 (uint32_t *)(hba->pci_addr + PCI_VENDOR_ID_REGISTER)) & 0xffff; | 3849 hbainfo->vendor_id = hba->model_info.vendor_id; |
3801 3802 hbainfo->ports = hba->num_of_ports; 3803 hbainfo->port_index = vpd->port_index; 3804 3805 bcopy(&hba->wwnn, hbainfo->wwnn, sizeof (hbainfo->wwnn)); 3806 (void) strncpy(hbainfo->snn, port->snn, (sizeof (hbainfo->snn)-1)); 3807 3808 bcopy(&hba->wwpn, hbainfo->wwpn, sizeof (hbainfo->wwpn)); --- 145 unchanged lines hidden (view full) --- 3954 } else if (hba->linkspeed == LA_4GHZ_LINK) { 3955 hbainfo->port_speed = HBA_PORTSPEED_4GBIT; 3956 } else if (hba->linkspeed == LA_8GHZ_LINK) { 3957 hbainfo->port_speed = HBA_PORTSPEED_8GBIT; 3958 } else if (hba->linkspeed == LA_10GHZ_LINK) { 3959 hbainfo->port_speed = HBA_PORTSPEED_10GBIT; 3960 } else if (hba->linkspeed == LA_16GHZ_LINK) { 3961 hbainfo->port_speed = HBA_PORTSPEED_16GBIT; | 3850 3851 hbainfo->ports = hba->num_of_ports; 3852 hbainfo->port_index = vpd->port_index; 3853 3854 bcopy(&hba->wwnn, hbainfo->wwnn, sizeof (hbainfo->wwnn)); 3855 (void) strncpy(hbainfo->snn, port->snn, (sizeof (hbainfo->snn)-1)); 3856 3857 bcopy(&hba->wwpn, hbainfo->wwpn, sizeof (hbainfo->wwpn)); --- 145 unchanged lines hidden (view full) --- 4003 } else if (hba->linkspeed == LA_4GHZ_LINK) { 4004 hbainfo->port_speed = HBA_PORTSPEED_4GBIT; 4005 } else if (hba->linkspeed == LA_8GHZ_LINK) { 4006 hbainfo->port_speed = HBA_PORTSPEED_8GBIT; 4007 } else if (hba->linkspeed == LA_10GHZ_LINK) { 4008 hbainfo->port_speed = HBA_PORTSPEED_10GBIT; 4009 } else if (hba->linkspeed == LA_16GHZ_LINK) { 4010 hbainfo->port_speed = HBA_PORTSPEED_16GBIT; |
4011 } else if (hba->linkspeed == LA_32GHZ_LINK) { 4012 hbainfo->port_speed = HBA_PORTSPEED_32GBIT; |
|
3962 } else { 3963 hbainfo->port_speed = HBA_PORTSPEED_1GBIT; 3964 } 3965 3966 hbainfo->node_count = port->node_count; 3967 } 3968 3969 hbainfo->hard_alpa = cfg[CFG_ASSIGN_ALPA].current; --- 4 unchanged lines hidden (view full) --- 3974 3975 hbainfo->active_types[0] = LE_SWAP32(0x00000120); 3976 hbainfo->active_types[1] = LE_SWAP32(0x00000001); 3977 3978 if (!cfg[CFG_NETWORK_ON].current) { 3979 hbainfo->active_types[0] &= ~(LE_SWAP32(0x00000020)); 3980 } 3981 | 4013 } else { 4014 hbainfo->port_speed = HBA_PORTSPEED_1GBIT; 4015 } 4016 4017 hbainfo->node_count = port->node_count; 4018 } 4019 4020 hbainfo->hard_alpa = cfg[CFG_ASSIGN_ALPA].current; --- 4 unchanged lines hidden (view full) --- 4025 4026 hbainfo->active_types[0] = LE_SWAP32(0x00000120); 4027 hbainfo->active_types[1] = LE_SWAP32(0x00000001); 4028 4029 if (!cfg[CFG_NETWORK_ON].current) { 4030 hbainfo->active_types[0] &= ~(LE_SWAP32(0x00000020)); 4031 } 4032 |
4033 if (vpd->link_speed & LMT_32GB_CAPABLE) { 4034 hbainfo->supported_speeds |= FC_HBA_PORTSPEED_32GBIT; 4035 } |
|
3982 if (vpd->link_speed & LMT_16GB_CAPABLE) { 3983 hbainfo->supported_speeds |= FC_HBA_PORTSPEED_16GBIT; 3984 } 3985 if (vpd->link_speed & LMT_10GB_CAPABLE) { 3986 hbainfo->supported_speeds |= FC_HBA_PORTSPEED_10GBIT; 3987 } 3988 if (vpd->link_speed & LMT_8GB_CAPABLE) { 3989 hbainfo->supported_speeds |= FC_HBA_PORTSPEED_8GBIT; --- 200 unchanged lines hidden (view full) --- 4190 } else if (hba->linkspeed == LA_4GHZ_LINK) { 4191 stats->link_speed = HBA_PORTSPEED_4GBIT; 4192 } else if (hba->linkspeed == LA_8GHZ_LINK) { 4193 stats->link_speed = HBA_PORTSPEED_8GBIT; 4194 } else if (hba->linkspeed == LA_10GHZ_LINK) { 4195 stats->link_speed = HBA_PORTSPEED_10GBIT; 4196 } else if (hba->linkspeed == LA_16GHZ_LINK) { 4197 stats->link_speed = HBA_PORTSPEED_16GBIT; | 4036 if (vpd->link_speed & LMT_16GB_CAPABLE) { 4037 hbainfo->supported_speeds |= FC_HBA_PORTSPEED_16GBIT; 4038 } 4039 if (vpd->link_speed & LMT_10GB_CAPABLE) { 4040 hbainfo->supported_speeds |= FC_HBA_PORTSPEED_10GBIT; 4041 } 4042 if (vpd->link_speed & LMT_8GB_CAPABLE) { 4043 hbainfo->supported_speeds |= FC_HBA_PORTSPEED_8GBIT; --- 200 unchanged lines hidden (view full) --- 4244 } else if (hba->linkspeed == LA_4GHZ_LINK) { 4245 stats->link_speed = HBA_PORTSPEED_4GBIT; 4246 } else if (hba->linkspeed == LA_8GHZ_LINK) { 4247 stats->link_speed = HBA_PORTSPEED_8GBIT; 4248 } else if (hba->linkspeed == LA_10GHZ_LINK) { 4249 stats->link_speed = HBA_PORTSPEED_10GBIT; 4250 } else if (hba->linkspeed == LA_16GHZ_LINK) { 4251 stats->link_speed = HBA_PORTSPEED_16GBIT; |
4252 } else if (hba->linkspeed == LA_32GHZ_LINK) { 4253 stats->link_speed = HBA_PORTSPEED_32GBIT; |
|
4198 } else { 4199 stats->link_speed = HBA_PORTSPEED_1GBIT; 4200 } 4201 } 4202 4203done: 4204 4205 /* Free allocated mbox memory */ --- 305 unchanged lines hidden (view full) --- 4511 /* Reset with restart */ 4512 EMLXS_SLI_HBA_RESET(hba, 1, 1, 0); 4513 4514 mutex_enter(&EMLXS_PORT_LOCK); 4515 } 4516 break; 4517 4518 case DDI_DIAGDI: | 4254 } else { 4255 stats->link_speed = HBA_PORTSPEED_1GBIT; 4256 } 4257 } 4258 4259done: 4260 4261 /* Free allocated mbox memory */ --- 305 unchanged lines hidden (view full) --- 4567 /* Reset with restart */ 4568 EMLXS_SLI_HBA_RESET(hba, 1, 1, 0); 4569 4570 mutex_enter(&EMLXS_PORT_LOCK); 4571 } 4572 break; 4573 4574 case DDI_DIAGDI: |
4519 if (!(hba->model_info.chip & EMLXS_LANCER_CHIP)) { | 4575 if (!(hba->model_info.chip & EMLXS_LANCER_CHIPS)) { |
4520 EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_dfc_error_msg, 4521 "set_hba_mode: Invalid mode. mode=%x", 4522 mode); 4523 mutex_exit(&EMLXS_PORT_LOCK); 4524 return (0); 4525 } 4526 4527 mutex_exit(&EMLXS_PORT_LOCK); --- 1336 unchanged lines hidden (view full) --- 5864 uint32_t rsp_size = 0; 5865 uint32_t cmd_size = 0; 5866 uint32_t rval = 0; 5867 5868 EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_dfc_detail_msg, 5869 "%s: csize=%d rsize=%d", emlxs_dfc_xlate(dfc->cmd), dfc->buf1_size, 5870 dfc->buf2_size); 5871 | 4576 EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_dfc_error_msg, 4577 "set_hba_mode: Invalid mode. mode=%x", 4578 mode); 4579 mutex_exit(&EMLXS_PORT_LOCK); 4580 return (0); 4581 } 4582 4583 mutex_exit(&EMLXS_PORT_LOCK); --- 1336 unchanged lines hidden (view full) --- 5920 uint32_t rsp_size = 0; 5921 uint32_t cmd_size = 0; 5922 uint32_t rval = 0; 5923 5924 EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_dfc_detail_msg, 5925 "%s: csize=%d rsize=%d", emlxs_dfc_xlate(dfc->cmd), dfc->buf1_size, 5926 dfc->buf2_size); 5927 |
5872 if (hba->model_info.device_id != PCI_DEVICE_ID_HORNET) { | 5928 if (hba->model_info.vendor_id != PCI_VENDOR_ID_EMULEX || 5929 hba->model_info.device_id != PCI_DEVICE_ID_HORNET) { |
5873 EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_dfc_error_msg, | 5930 EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_dfc_error_msg, |
5874 "%s: Menlo device not present. device=%x,%x", 5875 emlxs_dfc_xlate(dfc->cmd), hba->model_info.device_id, 5876 hba->model_info.ssdid); | 5931 "%s: Menlo device not present. device=%x,%x,%x", 5932 emlxs_dfc_xlate(dfc->cmd), hba->model_info.vendor_id, 5933 hba->model_info.device_id, hba->model_info.ssdid); |
5877 5878 rval = DFC_INVALID_ADAPTER; 5879 goto done; 5880 } 5881 5882 if (!dfc->buf1_size || !dfc->buf1) { 5883 EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_dfc_error_msg, 5884 "%s: Null buffer1 found.", emlxs_dfc_xlate(dfc->cmd)); --- 557 unchanged lines hidden (view full) --- 6442 "MENLO_INIT: fw_type = 0x%x", rsp->fw_type); 6443 EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_dfc_detail_msg, 6444 "MENLO_INIT: fru_data_valid = 0x%x", rsp->fru_data_valid); 6445 6446 /* Perform attention checks */ 6447 if (rsp->fru_data_valid == 0) { 6448 EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_adapter_error_msg, 6449 "Invalid FRU data found on adapter. " | 5934 5935 rval = DFC_INVALID_ADAPTER; 5936 goto done; 5937 } 5938 5939 if (!dfc->buf1_size || !dfc->buf1) { 5940 EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_dfc_error_msg, 5941 "%s: Null buffer1 found.", emlxs_dfc_xlate(dfc->cmd)); --- 557 unchanged lines hidden (view full) --- 6499 "MENLO_INIT: fw_type = 0x%x", rsp->fw_type); 6500 EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_dfc_detail_msg, 6501 "MENLO_INIT: fru_data_valid = 0x%x", rsp->fru_data_valid); 6502 6503 /* Perform attention checks */ 6504 if (rsp->fru_data_valid == 0) { 6505 EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_adapter_error_msg, 6506 "Invalid FRU data found on adapter. " |
6450 "Return adapter to Emulex for repair."); | 6507 "Return adapter to %s for repair.", 6508 hba->model_info.manufacturer); |
6451 } 6452 6453 switch (rsp->fw_type) { 6454 case MENLO_FW_TYPE_GOLDEN: 6455 EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_adapter_warning_msg, 6456 "FCoE chip is running Golden firmware. " 6457 "Update FCoE firmware immediately."); 6458 break; --- 2122 unchanged lines hidden (view full) --- 8581 EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_dfc_error_msg, 8582 "%s: Unable to bring adapter online.", 8583 emlxs_dfc_xlate(dfc->cmd)); 8584 8585 return (DFC_OFFLINE_ERROR); 8586 } 8587 8588#ifdef MENLO_SUPPORT | 6509 } 6510 6511 switch (rsp->fw_type) { 6512 case MENLO_FW_TYPE_GOLDEN: 6513 EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_adapter_warning_msg, 6514 "FCoE chip is running Golden firmware. " 6515 "Update FCoE firmware immediately."); 6516 break; --- 2122 unchanged lines hidden (view full) --- 8639 EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_dfc_error_msg, 8640 "%s: Unable to bring adapter online.", 8641 emlxs_dfc_xlate(dfc->cmd)); 8642 8643 return (DFC_OFFLINE_ERROR); 8644 } 8645 8646#ifdef MENLO_SUPPORT |
8589 if (hba->model_info.device_id == PCI_DEVICE_ID_HORNET) { | 8647 if (hba->model_info.vendor_id == PCI_VENDOR_ID_EMULEX && 8648 hba->model_info.device_id == PCI_DEVICE_ID_HORNET) { |
8590 EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_dfc_error_msg, 8591 "%s: Menlo support detected: mode:x%x", 8592 emlxs_dfc_xlate(dfc->cmd), new_mode); 8593 8594 if (new_mode == FC_ILB_MODE) { 8595 rval = emlxs_dfc_set_menlo_loopback(hba); 8596 if (rval) 8597 goto done; --- 127 unchanged lines hidden (view full) --- 8725 rval = DFC_DRV_ERROR; 8726 goto done; 8727 } 8728 8729 EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_dfc_debug_msg, 8730 "%s: Node created. node=%p", emlxs_dfc_xlate(dfc->cmd), ndlp); 8731 8732#ifdef MENLO_SUPPORT | 8649 EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_dfc_error_msg, 8650 "%s: Menlo support detected: mode:x%x", 8651 emlxs_dfc_xlate(dfc->cmd), new_mode); 8652 8653 if (new_mode == FC_ILB_MODE) { 8654 rval = emlxs_dfc_set_menlo_loopback(hba); 8655 if (rval) 8656 goto done; --- 127 unchanged lines hidden (view full) --- 8784 rval = DFC_DRV_ERROR; 8785 goto done; 8786 } 8787 8788 EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_dfc_debug_msg, 8789 "%s: Node created. node=%p", emlxs_dfc_xlate(dfc->cmd), ndlp); 8790 8791#ifdef MENLO_SUPPORT |
8733 if (hba->model_info.device_id == PCI_DEVICE_ID_HORNET) { | 8792 if (hba->model_info.vendor_id == PCI_VENDOR_ID_EMULEX && 8793 hba->model_info.device_id == PCI_DEVICE_ID_HORNET) { |
8734 EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_dfc_error_msg, 8735 "%s: Menlo support detected: mode:x%x", 8736 emlxs_dfc_xlate(dfc->cmd), new_mode); 8737 8738 rval = emlxs_dfc_set_menlo_fte(hba); 8739 if (rval) 8740 goto done; 8741 } --- 51 unchanged lines hidden (view full) --- 8793 if (mbq) { 8794 kmem_free(mbq, sizeof (MAILBOXQ)); 8795 } 8796 8797 if (rval) { 8798resetdone: 8799 /* Reset the adapter */ 8800#ifdef MENLO_SUPPORT | 8794 EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_dfc_error_msg, 8795 "%s: Menlo support detected: mode:x%x", 8796 emlxs_dfc_xlate(dfc->cmd), new_mode); 8797 8798 rval = emlxs_dfc_set_menlo_fte(hba); 8799 if (rval) 8800 goto done; 8801 } --- 51 unchanged lines hidden (view full) --- 8853 if (mbq) { 8854 kmem_free(mbq, sizeof (MAILBOXQ)); 8855 } 8856 8857 if (rval) { 8858resetdone: 8859 /* Reset the adapter */ 8860#ifdef MENLO_SUPPORT |
8801 if (hba->model_info.device_id == PCI_DEVICE_ID_HORNET) { | 8861 if (hba->model_info.vendor_id == PCI_VENDOR_ID_EMULEX && 8862 hba->model_info.device_id == PCI_DEVICE_ID_HORNET) { |
8802 8803 rval = emlxs_dfc_reset_menlo(hba); 8804 8805 EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_dfc_debug_msg, 8806 "%s: Menlo reset: rval:x%x", 8807 emlxs_dfc_xlate(dfc->cmd), rval); 8808 } 8809#endif /* MENLO_SUPPORT */ --- 2243 unchanged lines hidden --- | 8863 8864 rval = emlxs_dfc_reset_menlo(hba); 8865 8866 EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_dfc_debug_msg, 8867 "%s: Menlo reset: rval:x%x", 8868 emlxs_dfc_xlate(dfc->cmd), rval); 8869 } 8870#endif /* MENLO_SUPPORT */ --- 2243 unchanged lines hidden --- |