2N/A * The contents of this file are subject to the terms of the 2N/A * Common Development and Distribution License (the "License"). 2N/A * You may not use this file except in compliance with the License. 2N/A * See the License for the specific language governing permissions 2N/A * and limitations under the License. 2N/A * When distributing Covered Code, include this CDDL HEADER in each 2N/A * If applicable, add the following below this CDDL HEADER, with the 2N/A * fields enclosed by brackets "[]" replaced with your own identifying 2N/A * information: Portions Copyright [yyyy] [name of copyright owner] 2N/A * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. 2N/A/* free hba port info for the given hba */ 2N/A /* Free the nested structures (port and attached port) */ 2N/A /* Free discovered port structure list. */ 2N/A /* Free target mapping data list first. */ 2N/A * Internal routine for adding an HBA port 2N/A "Sun_sas handle ptr set to NULL.");
2N/A "Unable to get device path from HBA Port Node.");
2N/A * Let's take a branch snap shot for pulling attributes. 2N/A * The attribute change doesn't invalidate devinfo cache snapshot. 2N/A * Phy info prop and num-phys can be obsolate when the same hba 2N/A * connected to the same expander(SIM) thus phy numbers are increased. 2N/A * Also the phy number may get decreased when a connection is removed 2N/A * while the iport still exist through another connection. 2N/A /* something is wrong here. */ 2N/A "Unable to take devinfoi branch snapshot on HBA port \"%s\"" 2N/A "HBA port node %s is either OFFLINE or DETACHED",
2N/A "Unable to get initiator-port from HBA port node %s.",
2N/A "No proper intiator-port prop value on HBA port %s",
2N/A "Unable to get attached-port from HBA port node %s.",
2N/A /* continue even if the attached port is NULL. */ 2N/A "No proper attached-port prop value: " 2N/A "HBA port Local SAS Address(%016llx)",
2N/A "Unable to get NumberofPhys from HBA port %s.",
2N/A "Failed to get phy info on HBA port %s.",
2N/A /* now done with prop checking. remove branchNode. */ 2N/A /* Construct discovered target port. */ 2N/A "Failed to get attached device info HBA port %s.",
2N/A /* add new port onto hba handle list */ 2N/A * clean up existing hba port, discovered target, phy info. 2N/A * leave open handles intact. 2N/A "HBA node doesn't have iport child.");
2N/A "Unable to get supported-protocol from HBA node.");
2N/A /* ignore a virtual port. */ 2N/A * Discover information for one HBA in the device tree. 2N/A * The di_node_t argument should be a node with smhba-supported prop set 2N/A * Without iport support, the devinfo node will represent one port hba. 2N/A * This routine assumes the locks have been taken. 2N/A "portNode has instance of -1");
2N/A "device path from hbaNode");
2N/A /* check to see if this is a repeat HBA */ 2N/A /* this is a new hba */ 2N/A /* FirmwareVersion */ 2N/A "Property \"%s\" not found for device \"%s\"",
2N/A /* HardwareVersion */ 2N/A "Property \"%s\" not found for device \"%s\"",
2N/A "Property \"%s\" not found for device \"%s\"",
2N/A "Unable to get supported-protocol from HBA node.");
2N/A /* We don't use these */ 2N/A "HBA driver name not found for device \"%s\"",
2N/A * Name the adapter: like SUNW-pmcs-1 2N/A * Using di_instance number as the suffix for the name for persistent 2N/A "HBA driver doesn't have iport child. \"%s\"",
2N/A /* continue on with an hba without any port. */ 2N/A * add newly created handle into global_hba_head list 2N/A * Make sure to move the open_handles list to back to 2N/A * the head if it's there (for refresh scenario) 2N/A /* Now bump the new one to the head of the list */ 2N/A /* ignore a virtual port. */ 2N/A * add newly created handle into global_hba_head list 2N/A * Make sure to move the open_handles list to back to the 2N/A * head if it's there (for refresh scenario) 2N/A /* Now bump the new one to the head of the list */ 2N/A * Discover information for all HBAs found on the system. 2N/A * The di_node_t argument should be the root of the device tree. 2N/A * This routine assumes the locks have been taken 2N/A /* Skip stub(instance -1) nodes */ 2N/A /* add the hba to the hba list */ 2N/A /* Found a node. No need to walk the child. */ 2N/A * Discover information for all HBAs found on the system. 2N/A * The di_node_t argument should be the root of the device tree. 2N/A * This routine assumes the locks have been taken 2N/A * Now determine what status code to return, taking 2N/A * partial failure scenarios into consideration. 2N/A * If we have at least one working HBA, then we return an 2N/A * OK status. If we have no good HBAs, but at least one 2N/A * failed HBA, we return an ERROR status. If we have 2N/A * no HBAs and no failures, we return OK. 2N/A * We've got at least one HBA and possibly some 2N/A /* We have no HBAs but have failures */ 2N/A /* We have no HBAs and no failures */