4c06356b0f0fffb4fc1b6eccc8e5d8e2254a84d6dh * CDDL HEADER START
4c06356b0f0fffb4fc1b6eccc8e5d8e2254a84d6dh * The contents of this file are subject to the terms of the
4c06356b0f0fffb4fc1b6eccc8e5d8e2254a84d6dh * Common Development and Distribution License (the "License").
4c06356b0f0fffb4fc1b6eccc8e5d8e2254a84d6dh * You may not use this file except in compliance with the License.
4c06356b0f0fffb4fc1b6eccc8e5d8e2254a84d6dh * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
4c06356b0f0fffb4fc1b6eccc8e5d8e2254a84d6dh * See the License for the specific language governing permissions
4c06356b0f0fffb4fc1b6eccc8e5d8e2254a84d6dh * and limitations under the License.
4c06356b0f0fffb4fc1b6eccc8e5d8e2254a84d6dh * When distributing Covered Code, include this CDDL HEADER in each
4c06356b0f0fffb4fc1b6eccc8e5d8e2254a84d6dh * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
4c06356b0f0fffb4fc1b6eccc8e5d8e2254a84d6dh * If applicable, add the following below this CDDL HEADER, with the
4c06356b0f0fffb4fc1b6eccc8e5d8e2254a84d6dh * fields enclosed by brackets "[]" replaced with your own identifying
4c06356b0f0fffb4fc1b6eccc8e5d8e2254a84d6dh * information: Portions Copyright [yyyy] [name of copyright owner]
4c06356b0f0fffb4fc1b6eccc8e5d8e2254a84d6dh * CDDL HEADER END
658280b6253b61dbb155f43d0e3cbcffa85ccb90David Hollister * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
4c06356b0f0fffb4fc1b6eccc8e5d8e2254a84d6dh * This file contains SM-HBA support for PMC-S driver
4c06356b0f0fffb4fc1b6eccc8e5d8e2254a84d6dh switch (dt) {
c3bc407cfbd238a18e4728ad5f36f39cecdb062fdh "Unhandled datatype(%d) for (%s). Skipping prop update.",
145e0143b4896d03ce53b1af6787afa1a7e73959dh * Called with iport lock held.
4c06356b0f0fffb4fc1b6eccc8e5d8e2254a84d6dhpmcs_smhba_add_iport_prop(pmcs_iport_t *iport, data_type_t dt,
4c06356b0f0fffb4fc1b6eccc8e5d8e2254a84d6dh switch (dt) {
c3bc407cfbd238a18e4728ad5f36f39cecdb062fdh "Unhandled datatype(%d) for(%s). Skipping prop update.",
4c06356b0f0fffb4fc1b6eccc8e5d8e2254a84d6dhpmcs_smhba_add_tgt_prop(pmcs_xscsi_t *tgt, data_type_t dt,
4c06356b0f0fffb4fc1b6eccc8e5d8e2254a84d6dh switch (dt) {
c3bc407cfbd238a18e4728ad5f36f39cecdb062fdh "Unhandled datatype(%d) for (%s). Skipping prop update.",
4c06356b0f0fffb4fc1b6eccc8e5d8e2254a84d6dh/* ARGSUSED */
4c06356b0f0fffb4fc1b6eccc8e5d8e2254a84d6dhpmcs_smhba_set_scsi_device_props(pmcs_hw_t *pwp, pmcs_phy_t *pptr,
c80dec56debdecfa03d9c0c18755df818e408772David Hollister paddr = kmem_zalloc(PMCS_MAX_UA_SIZE, KM_SLEEP);
c80dec56debdecfa03d9c0c18755df818e408772David Hollister (void) scsi_wwn_to_wwnstr(pwwn, ua_form, paddr);
c80dec56debdecfa03d9c0c18755df818e408772David Hollister if ((pptr->dtype == SATA) || pptr->virtual) {
658280b6253b61dbb155f43d0e3cbcffa85ccb90David Hollister SCSI_DEVICE_PROP_PATH, SCSI_ADDR_PROP_TARGET_PORT_DEPTH,
4c06356b0f0fffb4fc1b6eccc8e5d8e2254a84d6dh phy_props = kmem_zalloc(sizeof (nvlist_t *) * iport->nphy, KM_SLEEP);
4c06356b0f0fffb4fc1b6eccc8e5d8e2254a84d6dh (void) nvlist_add_int8(phy_props[i], SAS_PROG_MIN_LINK_RATE,
4c06356b0f0fffb4fc1b6eccc8e5d8e2254a84d6dh (void) nvlist_add_int8(phy_props[i], SAS_HW_MIN_LINK_RATE,
4c06356b0f0fffb4fc1b6eccc8e5d8e2254a84d6dh (void) nvlist_add_int8(phy_props[i], SAS_PROG_MAX_LINK_RATE,
4c06356b0f0fffb4fc1b6eccc8e5d8e2254a84d6dh (void) nvlist_add_int8(phy_props[i], SAS_HW_MAX_LINK_RATE,
4c06356b0f0fffb4fc1b6eccc8e5d8e2254a84d6dh (void) nvlist_add_nvlist_array(nvl, SAS_PHY_INFO_NVL, phy_props,
4c06356b0f0fffb4fc1b6eccc8e5d8e2254a84d6dh (void) ddi_prop_update_byte_array(DDI_DEV_T_NONE, iport->dip,
4c06356b0f0fffb4fc1b6eccc8e5d8e2254a84d6dh for (i = 0; i < iport->nphy && phy_props[i] != NULL; i++) {
4c06356b0f0fffb4fc1b6eccc8e5d8e2254a84d6dh * Called with PHY lock held on phyp
4c06356b0f0fffb4fc1b6eccc8e5d8e2254a84d6dhpmcs_smhba_log_sysevent(pmcs_hw_t *pwp, char *subclass, char *etype,
4c06356b0f0fffb4fc1b6eccc8e5d8e2254a84d6dh if (nvlist_alloc(&attr_list, NV_UNIQUE_NAME_TYPE, 0) != 0) {
4c06356b0f0fffb4fc1b6eccc8e5d8e2254a84d6dh if (nvlist_add_string(attr_list, SAS_PORT_ADDR, sas_addr) != 0)
4c06356b0f0fffb4fc1b6eccc8e5d8e2254a84d6dh if (nvlist_add_string(attr_list, SAS_DEVFS_PATH, pname) != 0)
4c06356b0f0fffb4fc1b6eccc8e5d8e2254a84d6dh if (nvlist_add_uint8(attr_list, SAS_PHY_ID, phynum) != 0)
4c06356b0f0fffb4fc1b6eccc8e5d8e2254a84d6dh if (nvlist_add_uint8(attr_list, SAS_LINK_RATE, lrate) != 0)
4c06356b0f0fffb4fc1b6eccc8e5d8e2254a84d6dh if (nvlist_add_string(attr_list, SAS_EVENT_TYPE, etype) != 0)