1237 #ifdef _MULTI_DATAMODEL
1238 if (ddi_model_convert_from(mode & FMODELS) == DDI_MODEL_ILP32) {
1239 use32 = 1;
1240 }
1241 #endif /* _MULTI_DATAMODEL */
1242
1243 if (use32) {
1244 fc_hba_adapter_attributes32_t *hba_attrs;
1245
1246 if (fcio->fcio_xfer != FCIO_XFER_READ ||
1247 fcio->fcio_olen <
1248 sizeof (fc_hba_adapter_attributes32_t)) {
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;
1257 (void) strncpy(hba_attrs->Manufacturer, "Emulex",
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));
1266 bcopy((caddr_t)&port->wwnn,
1267 (caddr_t)&hba_attrs->NodeWWN, 8);
1268 (void) strncpy((caddr_t)hba_attrs->NodeSymbolicName,
1269 (caddr_t)port->snn,
1270 (sizeof (hba_attrs->NodeSymbolicName)-1));
1271 (void) snprintf(hba_attrs->HardwareVersion,
1272 (sizeof (hba_attrs->HardwareVersion)-1),
1273 "%x", vpd->biuRev);
1274 (void) snprintf(hba_attrs->DriverVersion,
1275 (sizeof (hba_attrs->DriverVersion)-1),
1276 "%s (%s)", emlxs_version, emlxs_revision);
1277 (void) strncpy(hba_attrs->OptionROMVersion,
1283 (void) strncpy(hba_attrs->DriverName, DRIVER_NAME,
1284 (sizeof (hba_attrs->DriverName)-1));
1285 hba_attrs->VendorSpecificID =
1286 ((hba->model_info.device_id << 16) |
1287 PCI_VENDOR_ID_EMULEX);
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;
1303 (void) strncpy(hba_attrs->Manufacturer, "Emulex",
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));
1312 bcopy((caddr_t)&port->wwnn,
1313 (caddr_t)&hba_attrs->NodeWWN, 8);
1314 (void) strncpy((caddr_t)hba_attrs->NodeSymbolicName,
1315 (caddr_t)port->snn,
1316 (sizeof (hba_attrs->NodeSymbolicName)-1));
1317 (void) snprintf(hba_attrs->HardwareVersion,
1318 (sizeof (hba_attrs->HardwareVersion)-1),
1319 "%x", vpd->biuRev);
1320 (void) snprintf(hba_attrs->DriverVersion,
1321 (sizeof (hba_attrs->DriverVersion)-1),
1322 "%s (%s)", emlxs_version, emlxs_revision);
1323 (void) strncpy(hba_attrs->OptionROMVersion,
1430 case LA_2GHZ_LINK:
1431 port_attrs->PortSpeed =
1432 HBA_PORTSPEED_2GBIT;
1433 break;
1434 case LA_4GHZ_LINK:
1435 port_attrs->PortSpeed =
1436 HBA_PORTSPEED_4GBIT;
1437 break;
1438 case LA_8GHZ_LINK:
1439 port_attrs->PortSpeed =
1440 HBA_PORTSPEED_8GBIT;
1441 break;
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;
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 */
1466 if (vpd->link_speed & LMT_16GB_CAPABLE) {
1467 port_attrs->PortSupportedSpeed |=
1468 FC_HBA_PORTSPEED_16GBIT;
1469 }
1576 case LA_2GHZ_LINK:
1577 port_attrs->PortSpeed =
1578 HBA_PORTSPEED_2GBIT;
1579 break;
1580 case LA_4GHZ_LINK:
1581 port_attrs->PortSpeed =
1582 HBA_PORTSPEED_4GBIT;
1583 break;
1584 case LA_8GHZ_LINK:
1585 port_attrs->PortSpeed =
1586 HBA_PORTSPEED_8GBIT;
1587 break;
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;
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 */
1612 if (vpd->link_speed & LMT_16GB_CAPABLE) {
1613 port_attrs->PortSupportedSpeed |=
1614 FC_HBA_PORTSPEED_16GBIT;
1615 }
2209 case LA_2GHZ_LINK:
2210 port_attrs->PortSpeed =
2211 HBA_PORTSPEED_2GBIT;
2212 break;
2213 case LA_4GHZ_LINK:
2214 port_attrs->PortSpeed =
2215 HBA_PORTSPEED_4GBIT;
2216 break;
2217 case LA_8GHZ_LINK:
2218 port_attrs->PortSpeed =
2219 HBA_PORTSPEED_8GBIT;
2220 break;
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;
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 =
2237 FC_HBA_PORTTYPE_NLPORT;
2238
2239 /* We share a common speed */
2240 switch (hba->linkspeed) {
2241 case 0:
2242 port_attrs->PortSpeed =
2243 HBA_PORTSPEED_1GBIT;
2244 break;
2245 case LA_1GHZ_LINK:
2246 port_attrs->PortSpeed =
2247 HBA_PORTSPEED_1GBIT;
2248 break;
2249 case LA_2GHZ_LINK:
2250 port_attrs->PortSpeed =
2251 HBA_PORTSPEED_2GBIT;
2252 break;
2253 case LA_4GHZ_LINK:
2254 port_attrs->PortSpeed =
2255 HBA_PORTSPEED_4GBIT;
2256 break;
2257 case LA_8GHZ_LINK:
2258 port_attrs->PortSpeed =
2259 HBA_PORTSPEED_8GBIT;
2260 break;
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;
2269 }
2270 }
2271 }
2272 }
2273
2274 port_attrs->PortSupportedClassofService =
2275 LE_SWAP32(FC_NS_CLASS3);
2276 /* port_attrs->PortSymbolicName */
2277 /* port_attrs->PortSupportedSpeed */
2278 /* port_attrs->PortSupportedFc4Types */
2279 /* port_attrs->PortActiveFc4Types */
2280 /* port_attrs->PortMaxFrameSize */
2281 /* port_attrs->NumberofDiscoveredPorts */
2282
2283 } else {
2284 fc_hba_port_attributes_t *port_attrs;
2285
2286 if (fcio->fcio_xfer != FCIO_XFER_READ ||
2287 fcio->fcio_ilen < sizeof (uint32_t) ||
2288 fcio->fcio_olen < sizeof (fc_hba_port_attributes_t)) {
2341 case LA_2GHZ_LINK:
2342 port_attrs->PortSpeed =
2343 HBA_PORTSPEED_2GBIT;
2344 break;
2345 case LA_4GHZ_LINK:
2346 port_attrs->PortSpeed =
2347 HBA_PORTSPEED_4GBIT;
2348 break;
2349 case LA_8GHZ_LINK:
2350 port_attrs->PortSpeed =
2351 HBA_PORTSPEED_8GBIT;
2352 break;
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;
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 =
2369 FC_HBA_PORTTYPE_NLPORT;
2370
2371 /* We share a common speed */
2372 switch (hba->linkspeed) {
2373 case 0:
2374 port_attrs->PortSpeed =
2375 HBA_PORTSPEED_1GBIT;
2376 break;
2377 case LA_1GHZ_LINK:
2378 port_attrs->PortSpeed =
2379 HBA_PORTSPEED_1GBIT;
2380 break;
2381 case LA_2GHZ_LINK:
2382 port_attrs->PortSpeed =
2383 HBA_PORTSPEED_2GBIT;
2384 break;
2385 case LA_4GHZ_LINK:
2386 port_attrs->PortSpeed =
2387 HBA_PORTSPEED_4GBIT;
2388 break;
2389 case LA_8GHZ_LINK:
2390 port_attrs->PortSpeed =
2391 HBA_PORTSPEED_8GBIT;
2392 break;
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;
2401 }
2402 }
2403 }
2404 }
2405
2406 port_attrs->PortSupportedClassofService =
2407 LE_SWAP32(FC_NS_CLASS3);
2408 /* port_attrs->PortSymbolicName */
2409 /* port_attrs->PortSupportedSpeed */
2410 /* port_attrs->PortSupportedFc4Types */
2411 /* port_attrs->PortActiveFc4Types */
2412 /* port_attrs->PortMaxFrameSize */
2413 /* port_attrs->NumberofDiscoveredPorts */
2414 }
2415
2416 done:
2417 return (rval);
2418
2419 } /* emlxs_fcio_get_disc_port_attrs() */
2420
2503 case LA_2GHZ_LINK:
2504 port_attrs->PortSpeed =
2505 HBA_PORTSPEED_2GBIT;
2506 break;
2507 case LA_4GHZ_LINK:
2508 port_attrs->PortSpeed =
2509 HBA_PORTSPEED_4GBIT;
2510 break;
2511 case LA_8GHZ_LINK:
2512 port_attrs->PortSpeed =
2513 HBA_PORTSPEED_8GBIT;
2514 break;
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;
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 =
2531 FC_HBA_PORTTYPE_NLPORT;
2532
2533 /* We share a common speed */
2534 switch (hba->linkspeed) {
2535 case 0:
2536 port_attrs->PortSpeed =
2537 HBA_PORTSPEED_1GBIT;
2538 break;
2539 case LA_1GHZ_LINK:
2540 port_attrs->PortSpeed =
2541 HBA_PORTSPEED_1GBIT;
2542 break;
2543 case LA_2GHZ_LINK:
2544 port_attrs->PortSpeed =
2545 HBA_PORTSPEED_2GBIT;
2546 break;
2547 case LA_4GHZ_LINK:
2548 port_attrs->PortSpeed =
2549 HBA_PORTSPEED_4GBIT;
2550 break;
2551 case LA_8GHZ_LINK:
2552 port_attrs->PortSpeed =
2553 HBA_PORTSPEED_8GBIT;
2554 break;
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;
2563 }
2564 }
2565 }
2566 }
2567
2568 port_attrs->PortSupportedClassofService =
2569 LE_SWAP32(FC_NS_CLASS3);
2570 /* port_attrs->PortSymbolicName */
2571 /* port_attrs->PortSupportedSpeed */
2572 /* port_attrs->PortSupportedFc4Types */
2573 /* port_attrs->PortActiveFc4Types */
2574 /* port_attrs->PortMaxFrameSize */
2575 /* port_attrs->NumberofDiscoveredPorts */
2576
2577 } else {
2578 fc_hba_port_attributes_t *port_attrs;
2579
2580 if ((fcio->fcio_xfer != FCIO_XFER_READ) ||
2581 (fcio->fcio_ilen < 8) ||
2582 (fcio->fcio_olen < sizeof (fc_hba_port_attributes_t))) {
2642 case LA_2GHZ_LINK:
2643 port_attrs->PortSpeed =
2644 HBA_PORTSPEED_2GBIT;
2645 break;
2646 case LA_4GHZ_LINK:
2647 port_attrs->PortSpeed =
2648 HBA_PORTSPEED_4GBIT;
2649 break;
2650 case LA_8GHZ_LINK:
2651 port_attrs->PortSpeed =
2652 HBA_PORTSPEED_8GBIT;
2653 break;
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;
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 =
2670 FC_HBA_PORTTYPE_NLPORT;
2671
2672 /* We share a common speed */
2673 switch (hba->linkspeed) {
2674 case 0:
2675 port_attrs->PortSpeed =
2676 HBA_PORTSPEED_1GBIT;
2677 break;
2678 case LA_1GHZ_LINK:
2679 port_attrs->PortSpeed =
2680 HBA_PORTSPEED_1GBIT;
2681 break;
2682 case LA_2GHZ_LINK:
2683 port_attrs->PortSpeed =
2684 HBA_PORTSPEED_2GBIT;
2685 break;
2686 case LA_4GHZ_LINK:
2687 port_attrs->PortSpeed =
2688 HBA_PORTSPEED_4GBIT;
2689 break;
2690 case LA_8GHZ_LINK:
2691 port_attrs->PortSpeed =
2692 HBA_PORTSPEED_8GBIT;
2693 break;
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;
2702 }
2703 }
2704 }
2705 }
2706
2707 port_attrs->PortSupportedClassofService =
2708 LE_SWAP32(FC_NS_CLASS3);
2709 /* port_attrs->PortSymbolicName */
2710 /* port_attrs->PortSupportedSpeed */
2711 /* port_attrs->PortSupportedFc4Types */
2712 /* port_attrs->PortActiveFc4Types */
2713 /* port_attrs->PortMaxFrameSize */
2714 /* port_attrs->NumberofDiscoveredPorts */
2715 }
2716
2717 done:
2718 return (rval);
2719
2720 } /* emlxs_fcio_get_port_attrs() */
2721
3942
3943 if (hba->flag & FC_FABRIC_ATTACHED) {
3944 bcopy(&port->fabric_sparam.nodeName,
3945 hbainfo->fabric_wwnn,
3946 sizeof (hbainfo->fabric_wwnn));
3947 bcopy(&port->fabric_sparam.portName,
3948 hbainfo->fabric_wwpn,
3949 sizeof (hbainfo->fabric_wwpn));
3950 }
3951
3952 if (hba->linkspeed == LA_2GHZ_LINK) {
3953 hbainfo->port_speed = HBA_PORTSPEED_2GBIT;
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;
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;
3970 hbainfo->supported_cos = LE_SWAP32((FC_NS_CLASS3 | FC_NS_CLASS2));
3971
3972 hbainfo->supported_types[0] = LE_SWAP32(0x00000120);
3973 hbainfo->supported_types[1] = LE_SWAP32(0x00000001);
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
4178 } else {
4179 if (hba->flag & FC_PT_TO_PT) {
4180 stats->port_type = HBA_PORTTYPE_PTP;
4181 stats->topology = LNK_PT2PT;
4182 } else {
4183 stats->port_type = HBA_PORTTYPE_NPORT;
4184 stats->topology = LNK_FABRIC;
4185 }
4186 }
4187
4188 if (hba->linkspeed == LA_2GHZ_LINK) {
4189 stats->link_speed = HBA_PORTSPEED_2GBIT;
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;
4198 } else {
4199 stats->link_speed = HBA_PORTSPEED_1GBIT;
4200 }
4201 }
4202
4203 done:
4204
4205 /* Free allocated mbox memory */
4206 if (mbq) {
4207 kmem_free(mbq, sizeof (MAILBOXQ));
4208 }
4209
4210 return (rval);
4211
4212 } /* emlxs_dfc_get_hbastats() */
4213
4214
4215
4216 /*ARGSUSED*/
4217 static int32_t
6430
6431 EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_dfc_detail_msg,
6432 "MENLO_INIT: bb_credit = 0x%x", rsp->bb_credit);
6433 EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_dfc_detail_msg,
6434 "MENLO_INIT: frame_size = 0x%x", rsp->frame_size);
6435 EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_dfc_detail_msg,
6436 "MENLO_INIT: fw_version = 0x%x", rsp->fw_version);
6437 EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_dfc_detail_msg,
6438 "MENLO_INIT: reset_status = 0x%x", rsp->reset_status);
6439 EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_dfc_detail_msg,
6440 "MENLO_INIT: maint_status = 0x%x", rsp->maint_status);
6441 EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_dfc_detail_msg,
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. "
6450 "Return adapter to Emulex for repair.");
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;
6459
6460 case MENLO_FW_TYPE_DIAG:
6461 EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_adapter_notice_msg,
6462 "FCoE chip is running Diagnostic firmware. "
6463 "Operational use of the adapter is suspended.");
6464 break;
6465 }
6466
6467 done:
6468
6469 if (pkt) {
6470 emlxs_pkt_free(pkt);
|
1237 #ifdef _MULTI_DATAMODEL
1238 if (ddi_model_convert_from(mode & FMODELS) == DDI_MODEL_ILP32) {
1239 use32 = 1;
1240 }
1241 #endif /* _MULTI_DATAMODEL */
1242
1243 if (use32) {
1244 fc_hba_adapter_attributes32_t *hba_attrs;
1245
1246 if (fcio->fcio_xfer != FCIO_XFER_READ ||
1247 fcio->fcio_olen <
1248 sizeof (fc_hba_adapter_attributes32_t)) {
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;
1257 (void) strncpy(hba_attrs->Manufacturer,
1258 hba->model_info.manufacturer,
1259 (sizeof (hba_attrs->Manufacturer)-1));
1260 (void) strncpy(hba_attrs->SerialNumber, vpd->serial_num,
1261 (sizeof (hba_attrs->SerialNumber)-1));
1262 (void) strncpy(hba_attrs->Model, hba->model_info.model,
1263 (sizeof (hba_attrs->Model)-1));
1264 (void) strncpy(hba_attrs->ModelDescription,
1265 hba->model_info.model_desc,
1266 (sizeof (hba_attrs->ModelDescription)-1));
1267 bcopy((caddr_t)&port->wwnn,
1268 (caddr_t)&hba_attrs->NodeWWN, 8);
1269 (void) strncpy((caddr_t)hba_attrs->NodeSymbolicName,
1270 (caddr_t)port->snn,
1271 (sizeof (hba_attrs->NodeSymbolicName)-1));
1272 (void) snprintf(hba_attrs->HardwareVersion,
1273 (sizeof (hba_attrs->HardwareVersion)-1),
1274 "%x", vpd->biuRev);
1275 (void) snprintf(hba_attrs->DriverVersion,
1276 (sizeof (hba_attrs->DriverVersion)-1),
1277 "%s (%s)", emlxs_version, emlxs_revision);
1278 (void) strncpy(hba_attrs->OptionROMVersion,
1284 (void) strncpy(hba_attrs->DriverName, DRIVER_NAME,
1285 (sizeof (hba_attrs->DriverName)-1));
1286 hba_attrs->VendorSpecificID =
1287 ((hba->model_info.device_id << 16) |
1288 PCI_VENDOR_ID_EMULEX);
1289 hba_attrs->NumberOfPorts = hba->num_of_ports;
1290 } else {
1291 fc_hba_adapter_attributes_t *hba_attrs;
1292
1293 if (fcio->fcio_xfer != FCIO_XFER_READ ||
1294 fcio->fcio_olen <
1295 sizeof (fc_hba_adapter_attributes_t)) {
1296 rval = EINVAL;
1297 goto done;
1298 }
1299
1300 hba_attrs =
1301 (fc_hba_adapter_attributes_t *)fcio->fcio_obuf;
1302
1303 hba_attrs->version = FC_HBA_ADAPTER_ATTRIBUTES_VERSION;
1304 (void) strncpy(hba_attrs->Manufacturer,
1305 hba->model_info.manufacturer,
1306 (sizeof (hba_attrs->Manufacturer)-1));
1307 (void) strncpy(hba_attrs->SerialNumber, vpd->serial_num,
1308 (sizeof (hba_attrs->SerialNumber)-1));
1309 (void) strncpy(hba_attrs->Model, hba->model_info.model,
1310 (sizeof (hba_attrs->Model)-1));
1311 (void) strncpy(hba_attrs->ModelDescription,
1312 hba->model_info.model_desc,
1313 (sizeof (hba_attrs->ModelDescription)-1));
1314 bcopy((caddr_t)&port->wwnn,
1315 (caddr_t)&hba_attrs->NodeWWN, 8);
1316 (void) strncpy((caddr_t)hba_attrs->NodeSymbolicName,
1317 (caddr_t)port->snn,
1318 (sizeof (hba_attrs->NodeSymbolicName)-1));
1319 (void) snprintf(hba_attrs->HardwareVersion,
1320 (sizeof (hba_attrs->HardwareVersion)-1),
1321 "%x", vpd->biuRev);
1322 (void) snprintf(hba_attrs->DriverVersion,
1323 (sizeof (hba_attrs->DriverVersion)-1),
1324 "%s (%s)", emlxs_version, emlxs_revision);
1325 (void) strncpy(hba_attrs->OptionROMVersion,
1432 case LA_2GHZ_LINK:
1433 port_attrs->PortSpeed =
1434 HBA_PORTSPEED_2GBIT;
1435 break;
1436 case LA_4GHZ_LINK:
1437 port_attrs->PortSpeed =
1438 HBA_PORTSPEED_4GBIT;
1439 break;
1440 case LA_8GHZ_LINK:
1441 port_attrs->PortSpeed =
1442 HBA_PORTSPEED_8GBIT;
1443 break;
1444 case LA_10GHZ_LINK:
1445 port_attrs->PortSpeed =
1446 HBA_PORTSPEED_10GBIT;
1447 break;
1448 case LA_16GHZ_LINK:
1449 port_attrs->PortSpeed =
1450 HBA_PORTSPEED_16GBIT;
1451 break;
1452 case LA_32GHZ_LINK:
1453 port_attrs->PortSpeed =
1454 HBA_PORTSPEED_32GBIT;
1455 break;
1456 default:
1457 port_attrs->PortSpeed =
1458 HBA_PORTSPEED_UNKNOWN;
1459 }
1460
1461 port_attrs->NumberofDiscoveredPorts =
1462 emlxs_nport_count(port);
1463 }
1464
1465 port_attrs->PortSupportedClassofService =
1466 LE_SWAP32(FC_NS_CLASS3);
1467 (void) strncpy((caddr_t)port_attrs->PortSymbolicName,
1468 (caddr_t)port->spn,
1469 (sizeof (port_attrs->PortSymbolicName)-1));
1470
1471 /* Set the hba speed limit */
1472 if (vpd->link_speed & LMT_16GB_CAPABLE) {
1473 port_attrs->PortSupportedSpeed |=
1474 FC_HBA_PORTSPEED_16GBIT;
1475 }
1582 case LA_2GHZ_LINK:
1583 port_attrs->PortSpeed =
1584 HBA_PORTSPEED_2GBIT;
1585 break;
1586 case LA_4GHZ_LINK:
1587 port_attrs->PortSpeed =
1588 HBA_PORTSPEED_4GBIT;
1589 break;
1590 case LA_8GHZ_LINK:
1591 port_attrs->PortSpeed =
1592 HBA_PORTSPEED_8GBIT;
1593 break;
1594 case LA_10GHZ_LINK:
1595 port_attrs->PortSpeed =
1596 HBA_PORTSPEED_10GBIT;
1597 break;
1598 case LA_16GHZ_LINK:
1599 port_attrs->PortSpeed =
1600 HBA_PORTSPEED_16GBIT;
1601 break;
1602 case LA_32GHZ_LINK:
1603 port_attrs->PortSpeed =
1604 HBA_PORTSPEED_32GBIT;
1605 break;
1606 default:
1607 port_attrs->PortSpeed =
1608 HBA_PORTSPEED_UNKNOWN;
1609 }
1610
1611 port_attrs->NumberofDiscoveredPorts =
1612 emlxs_nport_count(port);
1613 }
1614
1615 port_attrs->PortSupportedClassofService =
1616 LE_SWAP32(FC_NS_CLASS3);
1617 (void) strncpy((caddr_t)port_attrs->PortSymbolicName,
1618 (caddr_t)port->spn,
1619 (sizeof (port_attrs->PortSymbolicName)-1));
1620
1621 /* Set the hba speed limit */
1622 if (vpd->link_speed & LMT_16GB_CAPABLE) {
1623 port_attrs->PortSupportedSpeed |=
1624 FC_HBA_PORTSPEED_16GBIT;
1625 }
2219 case LA_2GHZ_LINK:
2220 port_attrs->PortSpeed =
2221 HBA_PORTSPEED_2GBIT;
2222 break;
2223 case LA_4GHZ_LINK:
2224 port_attrs->PortSpeed =
2225 HBA_PORTSPEED_4GBIT;
2226 break;
2227 case LA_8GHZ_LINK:
2228 port_attrs->PortSpeed =
2229 HBA_PORTSPEED_8GBIT;
2230 break;
2231 case LA_10GHZ_LINK:
2232 port_attrs->PortSpeed =
2233 HBA_PORTSPEED_10GBIT;
2234 break;
2235 case LA_16GHZ_LINK:
2236 port_attrs->PortSpeed =
2237 HBA_PORTSPEED_16GBIT;
2238 break;
2239 case LA_32GHZ_LINK:
2240 port_attrs->PortSpeed =
2241 HBA_PORTSPEED_32GBIT;
2242 break;
2243 }
2244 }
2245 /* public loop */
2246 else if (hba->topology == TOPOLOGY_LOOP) {
2247 /* Check for common area and domain */
2248 if ((ndlp->nlp_DID & 0xFFFF00) ==
2249 (port->did & 0xFFFF00)) {
2250 port_attrs->PortType =
2251 FC_HBA_PORTTYPE_NLPORT;
2252
2253 /* We share a common speed */
2254 switch (hba->linkspeed) {
2255 case 0:
2256 port_attrs->PortSpeed =
2257 HBA_PORTSPEED_1GBIT;
2258 break;
2259 case LA_1GHZ_LINK:
2260 port_attrs->PortSpeed =
2261 HBA_PORTSPEED_1GBIT;
2262 break;
2263 case LA_2GHZ_LINK:
2264 port_attrs->PortSpeed =
2265 HBA_PORTSPEED_2GBIT;
2266 break;
2267 case LA_4GHZ_LINK:
2268 port_attrs->PortSpeed =
2269 HBA_PORTSPEED_4GBIT;
2270 break;
2271 case LA_8GHZ_LINK:
2272 port_attrs->PortSpeed =
2273 HBA_PORTSPEED_8GBIT;
2274 break;
2275 case LA_10GHZ_LINK:
2276 port_attrs->PortSpeed =
2277 HBA_PORTSPEED_10GBIT;
2278 break;
2279 case LA_16GHZ_LINK:
2280 port_attrs->PortSpeed =
2281 HBA_PORTSPEED_16GBIT;
2282 break;
2283 case LA_32GHZ_LINK:
2284 port_attrs->PortSpeed =
2285 HBA_PORTSPEED_32GBIT;
2286 break;
2287 }
2288 }
2289 }
2290 }
2291
2292 port_attrs->PortSupportedClassofService =
2293 LE_SWAP32(FC_NS_CLASS3);
2294 /* port_attrs->PortSymbolicName */
2295 /* port_attrs->PortSupportedSpeed */
2296 /* port_attrs->PortSupportedFc4Types */
2297 /* port_attrs->PortActiveFc4Types */
2298 /* port_attrs->PortMaxFrameSize */
2299 /* port_attrs->NumberofDiscoveredPorts */
2300
2301 } else {
2302 fc_hba_port_attributes_t *port_attrs;
2303
2304 if (fcio->fcio_xfer != FCIO_XFER_READ ||
2305 fcio->fcio_ilen < sizeof (uint32_t) ||
2306 fcio->fcio_olen < sizeof (fc_hba_port_attributes_t)) {
2359 case LA_2GHZ_LINK:
2360 port_attrs->PortSpeed =
2361 HBA_PORTSPEED_2GBIT;
2362 break;
2363 case LA_4GHZ_LINK:
2364 port_attrs->PortSpeed =
2365 HBA_PORTSPEED_4GBIT;
2366 break;
2367 case LA_8GHZ_LINK:
2368 port_attrs->PortSpeed =
2369 HBA_PORTSPEED_8GBIT;
2370 break;
2371 case LA_10GHZ_LINK:
2372 port_attrs->PortSpeed =
2373 HBA_PORTSPEED_10GBIT;
2374 break;
2375 case LA_16GHZ_LINK:
2376 port_attrs->PortSpeed =
2377 HBA_PORTSPEED_16GBIT;
2378 break;
2379 case LA_32GHZ_LINK:
2380 port_attrs->PortSpeed =
2381 HBA_PORTSPEED_32GBIT;
2382 break;
2383 }
2384 }
2385 /* public loop */
2386 else if (hba->topology == TOPOLOGY_LOOP) {
2387 /* Check for common area and domain */
2388 if ((ndlp->nlp_DID & 0xFFFF00) ==
2389 (port->did & 0xFFFF00)) {
2390 port_attrs->PortType =
2391 FC_HBA_PORTTYPE_NLPORT;
2392
2393 /* We share a common speed */
2394 switch (hba->linkspeed) {
2395 case 0:
2396 port_attrs->PortSpeed =
2397 HBA_PORTSPEED_1GBIT;
2398 break;
2399 case LA_1GHZ_LINK:
2400 port_attrs->PortSpeed =
2401 HBA_PORTSPEED_1GBIT;
2402 break;
2403 case LA_2GHZ_LINK:
2404 port_attrs->PortSpeed =
2405 HBA_PORTSPEED_2GBIT;
2406 break;
2407 case LA_4GHZ_LINK:
2408 port_attrs->PortSpeed =
2409 HBA_PORTSPEED_4GBIT;
2410 break;
2411 case LA_8GHZ_LINK:
2412 port_attrs->PortSpeed =
2413 HBA_PORTSPEED_8GBIT;
2414 break;
2415 case LA_10GHZ_LINK:
2416 port_attrs->PortSpeed =
2417 HBA_PORTSPEED_10GBIT;
2418 break;
2419 case LA_16GHZ_LINK:
2420 port_attrs->PortSpeed =
2421 HBA_PORTSPEED_16GBIT;
2422 break;
2423 case LA_32GHZ_LINK:
2424 port_attrs->PortSpeed =
2425 HBA_PORTSPEED_32GBIT;
2426 break;
2427 }
2428 }
2429 }
2430 }
2431
2432 port_attrs->PortSupportedClassofService =
2433 LE_SWAP32(FC_NS_CLASS3);
2434 /* port_attrs->PortSymbolicName */
2435 /* port_attrs->PortSupportedSpeed */
2436 /* port_attrs->PortSupportedFc4Types */
2437 /* port_attrs->PortActiveFc4Types */
2438 /* port_attrs->PortMaxFrameSize */
2439 /* port_attrs->NumberofDiscoveredPorts */
2440 }
2441
2442 done:
2443 return (rval);
2444
2445 } /* emlxs_fcio_get_disc_port_attrs() */
2446
2529 case LA_2GHZ_LINK:
2530 port_attrs->PortSpeed =
2531 HBA_PORTSPEED_2GBIT;
2532 break;
2533 case LA_4GHZ_LINK:
2534 port_attrs->PortSpeed =
2535 HBA_PORTSPEED_4GBIT;
2536 break;
2537 case LA_8GHZ_LINK:
2538 port_attrs->PortSpeed =
2539 HBA_PORTSPEED_8GBIT;
2540 break;
2541 case LA_10GHZ_LINK:
2542 port_attrs->PortSpeed =
2543 HBA_PORTSPEED_10GBIT;
2544 break;
2545 case LA_16GHZ_LINK:
2546 port_attrs->PortSpeed =
2547 HBA_PORTSPEED_16GBIT;
2548 break;
2549 case LA_32GHZ_LINK:
2550 port_attrs->PortSpeed =
2551 HBA_PORTSPEED_32GBIT;
2552 break;
2553 }
2554 }
2555 /* public loop */
2556 else if (hba->topology == TOPOLOGY_LOOP) {
2557 /* Check for common area and domain */
2558 if ((ndlp->nlp_DID & 0xFFFF00) ==
2559 (port->did & 0xFFFF00)) {
2560 port_attrs->PortType =
2561 FC_HBA_PORTTYPE_NLPORT;
2562
2563 /* We share a common speed */
2564 switch (hba->linkspeed) {
2565 case 0:
2566 port_attrs->PortSpeed =
2567 HBA_PORTSPEED_1GBIT;
2568 break;
2569 case LA_1GHZ_LINK:
2570 port_attrs->PortSpeed =
2571 HBA_PORTSPEED_1GBIT;
2572 break;
2573 case LA_2GHZ_LINK:
2574 port_attrs->PortSpeed =
2575 HBA_PORTSPEED_2GBIT;
2576 break;
2577 case LA_4GHZ_LINK:
2578 port_attrs->PortSpeed =
2579 HBA_PORTSPEED_4GBIT;
2580 break;
2581 case LA_8GHZ_LINK:
2582 port_attrs->PortSpeed =
2583 HBA_PORTSPEED_8GBIT;
2584 break;
2585 case LA_10GHZ_LINK:
2586 port_attrs->PortSpeed =
2587 HBA_PORTSPEED_10GBIT;
2588 break;
2589 case LA_16GHZ_LINK:
2590 port_attrs->PortSpeed =
2591 HBA_PORTSPEED_16GBIT;
2592 break;
2593 case LA_32GHZ_LINK:
2594 port_attrs->PortSpeed =
2595 HBA_PORTSPEED_32GBIT;
2596 break;
2597 }
2598 }
2599 }
2600 }
2601
2602 port_attrs->PortSupportedClassofService =
2603 LE_SWAP32(FC_NS_CLASS3);
2604 /* port_attrs->PortSymbolicName */
2605 /* port_attrs->PortSupportedSpeed */
2606 /* port_attrs->PortSupportedFc4Types */
2607 /* port_attrs->PortActiveFc4Types */
2608 /* port_attrs->PortMaxFrameSize */
2609 /* port_attrs->NumberofDiscoveredPorts */
2610
2611 } else {
2612 fc_hba_port_attributes_t *port_attrs;
2613
2614 if ((fcio->fcio_xfer != FCIO_XFER_READ) ||
2615 (fcio->fcio_ilen < 8) ||
2616 (fcio->fcio_olen < sizeof (fc_hba_port_attributes_t))) {
2676 case LA_2GHZ_LINK:
2677 port_attrs->PortSpeed =
2678 HBA_PORTSPEED_2GBIT;
2679 break;
2680 case LA_4GHZ_LINK:
2681 port_attrs->PortSpeed =
2682 HBA_PORTSPEED_4GBIT;
2683 break;
2684 case LA_8GHZ_LINK:
2685 port_attrs->PortSpeed =
2686 HBA_PORTSPEED_8GBIT;
2687 break;
2688 case LA_10GHZ_LINK:
2689 port_attrs->PortSpeed =
2690 HBA_PORTSPEED_10GBIT;
2691 break;
2692 case LA_16GHZ_LINK:
2693 port_attrs->PortSpeed =
2694 HBA_PORTSPEED_16GBIT;
2695 break;
2696 case LA_32GHZ_LINK:
2697 port_attrs->PortSpeed =
2698 HBA_PORTSPEED_32GBIT;
2699 break;
2700 }
2701 }
2702 /* public loop */
2703 else if (hba->topology == TOPOLOGY_LOOP) {
2704 /* Check for common area and domain */
2705 if ((ndlp->nlp_DID & 0xFFFF00) ==
2706 (port->did & 0xFFFF00)) {
2707 port_attrs->PortType =
2708 FC_HBA_PORTTYPE_NLPORT;
2709
2710 /* We share a common speed */
2711 switch (hba->linkspeed) {
2712 case 0:
2713 port_attrs->PortSpeed =
2714 HBA_PORTSPEED_1GBIT;
2715 break;
2716 case LA_1GHZ_LINK:
2717 port_attrs->PortSpeed =
2718 HBA_PORTSPEED_1GBIT;
2719 break;
2720 case LA_2GHZ_LINK:
2721 port_attrs->PortSpeed =
2722 HBA_PORTSPEED_2GBIT;
2723 break;
2724 case LA_4GHZ_LINK:
2725 port_attrs->PortSpeed =
2726 HBA_PORTSPEED_4GBIT;
2727 break;
2728 case LA_8GHZ_LINK:
2729 port_attrs->PortSpeed =
2730 HBA_PORTSPEED_8GBIT;
2731 break;
2732 case LA_10GHZ_LINK:
2733 port_attrs->PortSpeed =
2734 HBA_PORTSPEED_10GBIT;
2735 break;
2736 case LA_16GHZ_LINK:
2737 port_attrs->PortSpeed =
2738 HBA_PORTSPEED_16GBIT;
2739 break;
2740 case LA_32GHZ_LINK:
2741 port_attrs->PortSpeed =
2742 HBA_PORTSPEED_32GBIT;
2743 break;
2744 }
2745 }
2746 }
2747 }
2748
2749 port_attrs->PortSupportedClassofService =
2750 LE_SWAP32(FC_NS_CLASS3);
2751 /* port_attrs->PortSymbolicName */
2752 /* port_attrs->PortSupportedSpeed */
2753 /* port_attrs->PortSupportedFc4Types */
2754 /* port_attrs->PortActiveFc4Types */
2755 /* port_attrs->PortMaxFrameSize */
2756 /* port_attrs->NumberofDiscoveredPorts */
2757 }
2758
2759 done:
2760 return (rval);
2761
2762 } /* emlxs_fcio_get_port_attrs() */
2763
3984
3985 if (hba->flag & FC_FABRIC_ATTACHED) {
3986 bcopy(&port->fabric_sparam.nodeName,
3987 hbainfo->fabric_wwnn,
3988 sizeof (hbainfo->fabric_wwnn));
3989 bcopy(&port->fabric_sparam.portName,
3990 hbainfo->fabric_wwpn,
3991 sizeof (hbainfo->fabric_wwpn));
3992 }
3993
3994 if (hba->linkspeed == LA_2GHZ_LINK) {
3995 hbainfo->port_speed = HBA_PORTSPEED_2GBIT;
3996 } else if (hba->linkspeed == LA_4GHZ_LINK) {
3997 hbainfo->port_speed = HBA_PORTSPEED_4GBIT;
3998 } else if (hba->linkspeed == LA_8GHZ_LINK) {
3999 hbainfo->port_speed = HBA_PORTSPEED_8GBIT;
4000 } else if (hba->linkspeed == LA_10GHZ_LINK) {
4001 hbainfo->port_speed = HBA_PORTSPEED_10GBIT;
4002 } else if (hba->linkspeed == LA_16GHZ_LINK) {
4003 hbainfo->port_speed = HBA_PORTSPEED_16GBIT;
4004 } else if (hba->linkspeed == LA_32GHZ_LINK) {
4005 hbainfo->port_speed = HBA_PORTSPEED_32GBIT;
4006 } else {
4007 hbainfo->port_speed = HBA_PORTSPEED_1GBIT;
4008 }
4009
4010 hbainfo->node_count = port->node_count;
4011 }
4012
4013 hbainfo->hard_alpa = cfg[CFG_ASSIGN_ALPA].current;
4014 hbainfo->supported_cos = LE_SWAP32((FC_NS_CLASS3 | FC_NS_CLASS2));
4015
4016 hbainfo->supported_types[0] = LE_SWAP32(0x00000120);
4017 hbainfo->supported_types[1] = LE_SWAP32(0x00000001);
4018
4019 hbainfo->active_types[0] = LE_SWAP32(0x00000120);
4020 hbainfo->active_types[1] = LE_SWAP32(0x00000001);
4021
4022 if (!cfg[CFG_NETWORK_ON].current) {
4023 hbainfo->active_types[0] &= ~(LE_SWAP32(0x00000020));
4024 }
4025
4222 } else {
4223 if (hba->flag & FC_PT_TO_PT) {
4224 stats->port_type = HBA_PORTTYPE_PTP;
4225 stats->topology = LNK_PT2PT;
4226 } else {
4227 stats->port_type = HBA_PORTTYPE_NPORT;
4228 stats->topology = LNK_FABRIC;
4229 }
4230 }
4231
4232 if (hba->linkspeed == LA_2GHZ_LINK) {
4233 stats->link_speed = HBA_PORTSPEED_2GBIT;
4234 } else if (hba->linkspeed == LA_4GHZ_LINK) {
4235 stats->link_speed = HBA_PORTSPEED_4GBIT;
4236 } else if (hba->linkspeed == LA_8GHZ_LINK) {
4237 stats->link_speed = HBA_PORTSPEED_8GBIT;
4238 } else if (hba->linkspeed == LA_10GHZ_LINK) {
4239 stats->link_speed = HBA_PORTSPEED_10GBIT;
4240 } else if (hba->linkspeed == LA_16GHZ_LINK) {
4241 stats->link_speed = HBA_PORTSPEED_16GBIT;
4242 } else if (hba->linkspeed == LA_32GHZ_LINK) {
4243 stats->link_speed = HBA_PORTSPEED_32GBIT;
4244 } else {
4245 stats->link_speed = HBA_PORTSPEED_1GBIT;
4246 }
4247 }
4248
4249 done:
4250
4251 /* Free allocated mbox memory */
4252 if (mbq) {
4253 kmem_free(mbq, sizeof (MAILBOXQ));
4254 }
4255
4256 return (rval);
4257
4258 } /* emlxs_dfc_get_hbastats() */
4259
4260
4261
4262 /*ARGSUSED*/
4263 static int32_t
6476
6477 EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_dfc_detail_msg,
6478 "MENLO_INIT: bb_credit = 0x%x", rsp->bb_credit);
6479 EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_dfc_detail_msg,
6480 "MENLO_INIT: frame_size = 0x%x", rsp->frame_size);
6481 EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_dfc_detail_msg,
6482 "MENLO_INIT: fw_version = 0x%x", rsp->fw_version);
6483 EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_dfc_detail_msg,
6484 "MENLO_INIT: reset_status = 0x%x", rsp->reset_status);
6485 EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_dfc_detail_msg,
6486 "MENLO_INIT: maint_status = 0x%x", rsp->maint_status);
6487 EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_dfc_detail_msg,
6488 "MENLO_INIT: fw_type = 0x%x", rsp->fw_type);
6489 EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_dfc_detail_msg,
6490 "MENLO_INIT: fru_data_valid = 0x%x", rsp->fru_data_valid);
6491
6492 /* Perform attention checks */
6493 if (rsp->fru_data_valid == 0) {
6494 EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_adapter_error_msg,
6495 "Invalid FRU data found on adapter. "
6496 "Return adapter to %s for repair.",
6497 hba->model_info.manufacturer);
6498 }
6499
6500 switch (rsp->fw_type) {
6501 case MENLO_FW_TYPE_GOLDEN:
6502 EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_adapter_warning_msg,
6503 "FCoE chip is running Golden firmware. "
6504 "Update FCoE firmware immediately.");
6505 break;
6506
6507 case MENLO_FW_TYPE_DIAG:
6508 EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_adapter_notice_msg,
6509 "FCoE chip is running Diagnostic firmware. "
6510 "Operational use of the adapter is suspended.");
6511 break;
6512 }
6513
6514 done:
6515
6516 if (pkt) {
6517 emlxs_pkt_free(pkt);
|