5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China/*
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * CDDL HEADER START
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China *
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * The contents of this file are subject to the terms of the
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * Common Development and Distribution License (the "License").
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * You may not use this file except in compliance with the License.
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China *
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * or http://www.opensolaris.org/os/licensing.
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * See the License for the specific language governing permissions
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * and limitations under the License.
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China *
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * When distributing Covered Code, include this CDDL HEADER in each
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * If applicable, add the following below this CDDL HEADER, with the
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * fields enclosed by brackets "[]" replaced with your own identifying
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * information: Portions Copyright [yyyy] [name of copyright owner]
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China *
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * CDDL HEADER END
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China */
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China/*
da4badc008f69df74f592b0831d92baa6dfcee76Keith M Wesolowski * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
da4badc008f69df74f592b0831d92baa6dfcee76Keith M Wesolowski * Use is subject to license terms.
940efceed6b67909bbec473feca747d2fbaa32b9Andy Giles * Copyright (c) 2014, Tegile Systems Inc. All rights reserved.
39fd84a866206a99cbb6b6e63e0c38a367aaa88eHans Rosenfeld * Copyright 2015 Nexenta Systems, Inc. All rights reserved.
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China */
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China/*
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada * Copyright (c) 2000 to 2010, LSI Corporation.
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * All rights reserved.
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China *
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * Redistribution and use in source and binary forms of all code within
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * this file that is exclusively owned by LSI, with or without
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * modification, is permitted provided that, in addition to the CDDL 1.0
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * License requirements, the following conditions are met:
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China *
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * Neither the name of the author nor the names of its contributors may be
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * used to endorse or promote products derived from this software without
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * specific prior written permission.
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China *
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * DAMAGE.
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China */
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China/*
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * mptsas_raid - This file contains all the RAID related functions for the
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * MPT interface.
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China */
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China#if defined(lint) || defined(DEBUG)
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China#define MPTSAS_DEBUG
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China#endif
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China#define MPI_RAID_VOL_PAGE_0_PHYSDISK_MAX 2
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China/*
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * standard header files
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China */
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China#include <sys/note.h>
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China#include <sys/scsi/scsi.h>
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China#include <sys/byteorder.h>
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China#include <sys/raidioctl.h>
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China#pragma pack(1)
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China#include <sys/scsi/adapters/mpt_sas/mpi/mpi2_type.h>
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China#include <sys/scsi/adapters/mpt_sas/mpi/mpi2.h>
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China#include <sys/scsi/adapters/mpt_sas/mpi/mpi2_cnfg.h>
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China#include <sys/scsi/adapters/mpt_sas/mpi/mpi2_init.h>
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China#include <sys/scsi/adapters/mpt_sas/mpi/mpi2_ioc.h>
76a4caf6c7b8f1c35d80a77bd8005aeae6197786Ada#include <sys/scsi/adapters/mpt_sas/mpi/mpi2_raid.h>
76a4caf6c7b8f1c35d80a77bd8005aeae6197786Ada#include <sys/scsi/adapters/mpt_sas/mpi/mpi2_tool.h>
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China#pragma pack()
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China/*
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * private header files.
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China */
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China#include <sys/scsi/adapters/mpt_sas/mptsas_var.h>
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing Chinastatic int mptsas_get_raid_wwid(mptsas_t *mpt, mptsas_raidvol_t *raidvol);
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing Chinaextern int mptsas_check_dma_handle(ddi_dma_handle_t handle);
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing Chinaextern int mptsas_check_acc_handle(ddi_acc_handle_t handle);
39fd84a866206a99cbb6b6e63e0c38a367aaa88eHans Rosenfeldextern mptsas_target_t *mptsas_tgt_alloc(refhash_t *, uint16_t,
da4badc008f69df74f592b0831d92baa6dfcee76Keith M Wesolowski uint64_t, uint32_t, mptsas_phymask_t, uint8_t);
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing Chinastatic int
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing Chinamptsas_raidconf_page_0_cb(mptsas_t *mpt, caddr_t page_memp,
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China ddi_acc_handle_t accessp, uint16_t iocstatus, uint32_t iocloginfo,
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China va_list ap)
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China{
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China#ifndef __lock_lint
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China _NOTE(ARGUNUSED(ap))
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China#endif
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China pMpi2RaidConfigurationPage0_t raidconfig_page0;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China pMpi2RaidConfig0ConfigElement_t element;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China uint32_t *confignum;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China int rval = DDI_SUCCESS, i;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China uint8_t numelements, vol, disk;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China uint16_t elementtype, voldevhandle;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China uint16_t etype_vol, etype_pd, etype_hs;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China uint16_t etype_oce;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China m_raidconfig_t *raidconfig;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China uint64_t raidwwn;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China uint32_t native;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China mptsas_target_t *ptgt;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China uint32_t configindex;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China if (iocstatus == MPI2_IOCSTATUS_CONFIG_INVALID_PAGE) {
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China return (DDI_FAILURE);
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China }
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China if (iocstatus != MPI2_IOCSTATUS_SUCCESS) {
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China mptsas_log(mpt, CE_WARN, "mptsas_get_raid_conf_page0 "
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China "config: IOCStatus=0x%x, IOCLogInfo=0x%x",
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China iocstatus, iocloginfo);
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China rval = DDI_FAILURE;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China return (rval);
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China }
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China confignum = va_arg(ap, uint32_t *);
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China configindex = va_arg(ap, uint32_t);
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China raidconfig_page0 = (pMpi2RaidConfigurationPage0_t)page_memp;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China /*
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * Get all RAID configurations.
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China */
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China etype_vol = MPI2_RAIDCONFIG0_EFLAGS_VOLUME_ELEMENT;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China etype_pd = MPI2_RAIDCONFIG0_EFLAGS_VOL_PHYS_DISK_ELEMENT;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China etype_hs = MPI2_RAIDCONFIG0_EFLAGS_HOT_SPARE_ELEMENT;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China etype_oce = MPI2_RAIDCONFIG0_EFLAGS_OCE_ELEMENT;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China /*
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * Set up page address for next time through.
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China */
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China *confignum = ddi_get8(accessp,
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China &raidconfig_page0->ConfigNum);
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China /*
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * Point to the right config in the structure.
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * Increment the number of valid RAID configs.
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China */
da5ab83fc888325fc812733d8a54bc5eab65c65cKeith M Wesolowski raidconfig = &mpt->m_raidconfig[configindex];
da5ab83fc888325fc812733d8a54bc5eab65c65cKeith M Wesolowski mpt->m_num_raid_configs++;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China /*
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * Set the native flag if this is not a foreign
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * configuration.
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China */
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China native = ddi_get32(accessp, &raidconfig_page0->Flags);
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China if (native & MPI2_RAIDCONFIG0_FLAG_FOREIGN_CONFIG) {
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China native = FALSE;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China } else {
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China native = TRUE;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China }
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China raidconfig->m_native = (uint8_t)native;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China /*
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * Get volume information for the volumes in the
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * config.
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China */
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China numelements = ddi_get8(accessp, &raidconfig_page0->NumElements);
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China vol = 0;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China disk = 0;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China element = (pMpi2RaidConfig0ConfigElement_t)
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China &raidconfig_page0->ConfigElement;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada for (i = 0; ((i < numelements) && native); i++, element++) {
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China /*
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * Get the element type. Could be Volume,
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * PhysDisk, Hot Spare, or Online Capacity
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * Expansion PhysDisk.
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China */
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China elementtype = ddi_get16(accessp, &element->ElementFlags);
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China elementtype &= MPI2_RAIDCONFIG0_EFLAGS_MASK_ELEMENT_TYPE;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China /*
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * For volumes, get the RAID settings and the
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * WWID.
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China */
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China if (elementtype == etype_vol) {
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China voldevhandle = ddi_get16(accessp,
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China &element->VolDevHandle);
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China raidconfig->m_raidvol[vol].m_israid = 1;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China raidconfig->m_raidvol[vol].
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China m_raidhandle = voldevhandle;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China /*
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * Get the settings for the raid
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * volume. This includes the
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * DevHandles for the disks making up
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * the raid volume.
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China */
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China if (mptsas_get_raid_settings(mpt,
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China &raidconfig->m_raidvol[vol]))
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China continue;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China /*
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * Get the WWID of the RAID volume for
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * SAS HBA
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China */
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China if (mptsas_get_raid_wwid(mpt,
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China &raidconfig->m_raidvol[vol]))
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China continue;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China raidwwn = raidconfig->m_raidvol[vol].
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China m_raidwwid;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China /*
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * RAID uses phymask of 0.
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China */
39fd84a866206a99cbb6b6e63e0c38a367aaa88eHans Rosenfeld ptgt = mptsas_tgt_alloc(mpt->m_targets,
da4badc008f69df74f592b0831d92baa6dfcee76Keith M Wesolowski voldevhandle, raidwwn, 0, 0, 0);
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China raidconfig->m_raidvol[vol].m_raidtgt =
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China ptgt;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China /*
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * Increment volume index within this
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * raid config.
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China */
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China vol++;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China } else if ((elementtype == etype_pd) ||
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China (elementtype == etype_hs) ||
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China (elementtype == etype_oce)) {
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China /*
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * For all other element types, put
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * their DevHandles in the phys disk
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * list of the config. These are all
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * some variation of a Phys Disk and
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * this list is used to keep these
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * disks from going online.
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China */
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China raidconfig->m_physdisk_devhdl[disk] = ddi_get16(accessp,
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China &element->PhysDiskDevHandle);
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China /*
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * Increment disk index within this
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * raid config.
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China */
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China disk++;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China }
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China }
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China return (rval);
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China}
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing Chinaint
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing Chinamptsas_get_raid_info(mptsas_t *mpt)
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China{
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China int rval = DDI_SUCCESS;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China uint32_t confignum, pageaddress;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China uint8_t configindex;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China ASSERT(mutex_owned(&mpt->m_mutex));
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China /*
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * Clear all RAID info before starting.
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China */
da5ab83fc888325fc812733d8a54bc5eab65c65cKeith M Wesolowski bzero(mpt->m_raidconfig, sizeof (mpt->m_raidconfig));
da5ab83fc888325fc812733d8a54bc5eab65c65cKeith M Wesolowski mpt->m_num_raid_configs = 0;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China configindex = 0;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China confignum = 0xff;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China pageaddress = MPI2_RAID_PGAD_FORM_GET_NEXT_CONFIGNUM | confignum;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China while (rval == DDI_SUCCESS) {
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China /*
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * Get the header and config page. reply contains the reply
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * frame, which holds status info for the request.
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China */
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China rval = mptsas_access_config_page(mpt,
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China MPI2_CONFIG_ACTION_PAGE_READ_CURRENT,
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China MPI2_CONFIG_EXTPAGETYPE_RAID_CONFIG, 0, pageaddress,
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China mptsas_raidconf_page_0_cb, &confignum, configindex);
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China configindex++;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China pageaddress = MPI2_RAID_PGAD_FORM_GET_NEXT_CONFIGNUM |
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China confignum;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China }
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China return (rval);
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China}
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing Chinastatic int
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing Chinamptsas_raidvol_page_0_cb(mptsas_t *mpt, caddr_t page_memp,
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China ddi_acc_handle_t accessp, uint16_t iocstatus, uint32_t iocloginfo,
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China va_list ap)
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China{
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China#ifndef __lock_lint
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China _NOTE(ARGUNUSED(ap))
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China#endif
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China pMpi2RaidVolPage0_t raidpage;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China int rval = DDI_SUCCESS, i;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China mptsas_raidvol_t *raidvol;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China uint8_t numdisks, volstate, voltype, physdisknum;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China uint32_t volsetting;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China uint32_t statusflags, resync_flag;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China if (iocstatus == MPI2_IOCSTATUS_CONFIG_INVALID_PAGE)
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China return (DDI_FAILURE);
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China if (iocstatus != MPI2_IOCSTATUS_SUCCESS) {
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China mptsas_log(mpt, CE_WARN, "mptsas_raidvol_page0_cb "
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China "config: IOCStatus=0x%x, IOCLogInfo=0x%x",
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China iocstatus, iocloginfo);
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China rval = DDI_FAILURE;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China return (rval);
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China }
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China raidvol = va_arg(ap, mptsas_raidvol_t *);
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China raidpage = (pMpi2RaidVolPage0_t)page_memp;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China volstate = ddi_get8(accessp, &raidpage->VolumeState);
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China volsetting = ddi_get32(accessp,
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China (uint32_t *)(void *)&raidpage->VolumeSettings);
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China statusflags = ddi_get32(accessp, &raidpage->VolumeStatusFlags);
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China voltype = ddi_get8(accessp, &raidpage->VolumeType);
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China raidvol->m_state = volstate;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China raidvol->m_statusflags = statusflags;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China /*
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * Volume size is not used right now. Set to 0.
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China */
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China raidvol->m_raidsize = 0;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China raidvol->m_settings = volsetting;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China raidvol->m_raidlevel = voltype;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China if (statusflags & MPI2_RAIDVOL0_STATUS_FLAG_QUIESCED) {
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China mptsas_log(mpt, CE_NOTE, "?Volume %d is quiesced\n",
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China raidvol->m_raidhandle);
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China }
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China if (statusflags &
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China MPI2_RAIDVOL0_STATUS_FLAG_RESYNC_IN_PROGRESS) {
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China mptsas_log(mpt, CE_NOTE, "?Volume %d is resyncing\n",
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China raidvol->m_raidhandle);
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China }
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China resync_flag = MPI2_RAIDVOL0_STATUS_FLAG_RESYNC_IN_PROGRESS;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China switch (volstate) {
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China case MPI2_RAID_VOL_STATE_OPTIMAL:
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China mptsas_log(mpt, CE_NOTE, "?Volume %d is "
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China "optimal\n", raidvol->m_raidhandle);
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China break;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China case MPI2_RAID_VOL_STATE_DEGRADED:
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China if ((statusflags & resync_flag) == 0) {
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China mptsas_log(mpt, CE_WARN, "Volume %d "
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China "is degraded\n",
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China raidvol->m_raidhandle);
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China }
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China break;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China case MPI2_RAID_VOL_STATE_FAILED:
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China mptsas_log(mpt, CE_WARN, "Volume %d is "
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China "failed\n", raidvol->m_raidhandle);
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China break;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China case MPI2_RAID_VOL_STATE_MISSING:
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China mptsas_log(mpt, CE_WARN, "Volume %d is "
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China "missing\n", raidvol->m_raidhandle);
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China break;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China default:
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China break;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China }
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China numdisks = raidpage->NumPhysDisks;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China raidvol->m_ndisks = numdisks;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China for (i = 0; i < numdisks; i++) {
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China physdisknum = raidpage->PhysDisk[i].PhysDiskNum;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China raidvol->m_disknum[i] = physdisknum;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China if (mptsas_get_physdisk_settings(mpt, raidvol,
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China physdisknum))
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China break;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China }
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China return (rval);
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China}
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing Chinaint
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing Chinamptsas_get_raid_settings(mptsas_t *mpt, mptsas_raidvol_t *raidvol)
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China{
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China int rval = DDI_SUCCESS;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China uint32_t page_address;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China ASSERT(mutex_owned(&mpt->m_mutex));
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China /*
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * Get the header and config page. reply contains the reply frame,
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * which holds status info for the request.
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China */
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China page_address = (MPI2_RAID_VOLUME_PGAD_FORM_MASK &
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China MPI2_RAID_VOLUME_PGAD_FORM_HANDLE) | raidvol->m_raidhandle;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China rval = mptsas_access_config_page(mpt,
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China MPI2_CONFIG_ACTION_PAGE_READ_CURRENT,
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China MPI2_CONFIG_PAGETYPE_RAID_VOLUME, 0, page_address,
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China mptsas_raidvol_page_0_cb, raidvol);
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China return (rval);
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China}
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing Chinastatic int
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing Chinamptsas_raidvol_page_1_cb(mptsas_t *mpt, caddr_t page_memp,
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China ddi_acc_handle_t accessp, uint16_t iocstatus, uint32_t iocloginfo,
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China va_list ap)
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China{
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China#ifndef __lock_lint
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China _NOTE(ARGUNUSED(ap))
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China#endif
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China pMpi2RaidVolPage1_t raidpage;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China int rval = DDI_SUCCESS, i;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China uint8_t *sas_addr = NULL;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China uint8_t tmp_sas_wwn[SAS_WWN_BYTE_SIZE];
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China uint64_t *sas_wwn;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China if (iocstatus != MPI2_IOCSTATUS_SUCCESS) {
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China mptsas_log(mpt, CE_WARN, "mptsas_raidvol_page_1_cb "
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China "config: IOCStatus=0x%x, IOCLogInfo=0x%x",
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China iocstatus, iocloginfo);
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China rval = DDI_FAILURE;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China return (rval);
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China }
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China sas_wwn = va_arg(ap, uint64_t *);
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China raidpage = (pMpi2RaidVolPage1_t)page_memp;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China sas_addr = (uint8_t *)(&raidpage->WWID);
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China for (i = 0; i < SAS_WWN_BYTE_SIZE; i++) {
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China tmp_sas_wwn[i] = ddi_get8(accessp, sas_addr + i);
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China }
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China bcopy(tmp_sas_wwn, sas_wwn, SAS_WWN_BYTE_SIZE);
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China *sas_wwn = LE_64(*sas_wwn);
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China return (rval);
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China}
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing Chinastatic int
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing Chinamptsas_get_raid_wwid(mptsas_t *mpt, mptsas_raidvol_t *raidvol)
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China{
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China int rval = DDI_SUCCESS;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China uint32_t page_address;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China uint64_t sas_wwn;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China ASSERT(mutex_owned(&mpt->m_mutex));
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China /*
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * Get the header and config page. reply contains the reply frame,
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * which holds status info for the request.
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China */
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China page_address = (MPI2_RAID_VOLUME_PGAD_FORM_MASK &
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China MPI2_RAID_VOLUME_PGAD_FORM_HANDLE) | raidvol->m_raidhandle;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China rval = mptsas_access_config_page(mpt,
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China MPI2_CONFIG_ACTION_PAGE_READ_CURRENT,
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China MPI2_CONFIG_PAGETYPE_RAID_VOLUME, 1, page_address,
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China mptsas_raidvol_page_1_cb, &sas_wwn);
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China /*
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * Get the required information from the page.
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China */
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China if (rval == DDI_SUCCESS) {
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China /*
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * replace top nibble of WWID of RAID to '3' for OBP
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China */
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China sas_wwn = MPTSAS_RAID_WWID(sas_wwn);
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China raidvol->m_raidwwid = sas_wwn;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China }
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China return (rval);
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China}
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing Chinastatic int
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing Chinamptsas_raidphydsk_page_0_cb(mptsas_t *mpt, caddr_t page_memp,
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China ddi_acc_handle_t accessp, uint16_t iocstatus, uint32_t iocloginfo,
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China va_list ap)
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China{
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China#ifndef __lock_lint
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China _NOTE(ARGUNUSED(ap))
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China#endif
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China pMpi2RaidPhysDiskPage0_t diskpage;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China int rval = DDI_SUCCESS;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China uint16_t *devhdl;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China uint8_t *state;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China if (iocstatus == MPI2_IOCSTATUS_CONFIG_INVALID_PAGE)
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China return (DDI_FAILURE);
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China if (iocstatus != MPI2_IOCSTATUS_SUCCESS) {
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China mptsas_log(mpt, CE_WARN, "mptsas_raidphydsk_page0_cb "
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China "config: IOCStatus=0x%x, IOCLogInfo=0x%x",
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China iocstatus, iocloginfo);
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China rval = DDI_FAILURE;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China return (rval);
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China }
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China devhdl = va_arg(ap, uint16_t *);
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China state = va_arg(ap, uint8_t *);
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China diskpage = (pMpi2RaidPhysDiskPage0_t)page_memp;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China *devhdl = ddi_get16(accessp, &diskpage->DevHandle);
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China *state = ddi_get8(accessp, &diskpage->PhysDiskState);
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China return (rval);
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China}
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing Chinaint
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing Chinamptsas_get_physdisk_settings(mptsas_t *mpt, mptsas_raidvol_t *raidvol,
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China uint8_t physdisknum)
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China{
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China int rval = DDI_SUCCESS, i;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China uint8_t state;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China uint16_t devhdl;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China uint32_t page_address;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China ASSERT(mutex_owned(&mpt->m_mutex));
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China /*
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * Get the header and config page. reply contains the reply frame,
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * which holds status info for the request.
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China */
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China page_address = (MPI2_PHYSDISK_PGAD_FORM_MASK &
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China MPI2_PHYSDISK_PGAD_FORM_PHYSDISKNUM) | physdisknum;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China rval = mptsas_access_config_page(mpt,
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China MPI2_CONFIG_ACTION_PAGE_READ_CURRENT,
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China MPI2_CONFIG_PAGETYPE_RAID_PHYSDISK, 0, page_address,
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China mptsas_raidphydsk_page_0_cb, &devhdl, &state);
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China /*
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China * Get the required information from the page.
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China */
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China if (rval == DDI_SUCCESS) {
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China for (i = 0; i < MPTSAS_MAX_DISKS_IN_VOL; i++) {
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China /* find the correct position in the arrays */
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China if (raidvol->m_disknum[i] == physdisknum)
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China break;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China }
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China raidvol->m_devhdl[i] = devhdl;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China switch (state) {
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China case MPI2_RAID_PD_STATE_OFFLINE:
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China raidvol->m_diskstatus[i] =
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China RAID_DISKSTATUS_FAILED;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China break;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China case MPI2_RAID_PD_STATE_HOT_SPARE:
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China case MPI2_RAID_PD_STATE_NOT_CONFIGURED:
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China case MPI2_RAID_PD_STATE_NOT_COMPATIBLE:
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China break;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China case MPI2_RAID_PD_STATE_DEGRADED:
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China case MPI2_RAID_PD_STATE_OPTIMAL:
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China case MPI2_RAID_PD_STATE_REBUILDING:
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China case MPI2_RAID_PD_STATE_ONLINE:
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China default:
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China raidvol->m_diskstatus[i] =
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China RAID_DISKSTATUS_GOOD;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China break;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China }
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China }
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China return (rval);
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China}
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China
76a4caf6c7b8f1c35d80a77bd8005aeae6197786Ada/*
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada * RAID Action for System Shutdown. This request uses the dedicated TM slot to
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada * avoid a call to mptsas_save_cmd. Since Solaris requires that the mutex is
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada * not held during the mptsas_quiesce function, this RAID action must not use
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada * the normal code path of requests and replies.
76a4caf6c7b8f1c35d80a77bd8005aeae6197786Ada */
76a4caf6c7b8f1c35d80a77bd8005aeae6197786Adavoid
76a4caf6c7b8f1c35d80a77bd8005aeae6197786Adamptsas_raid_action_system_shutdown(mptsas_t *mpt)
76a4caf6c7b8f1c35d80a77bd8005aeae6197786Ada{
76a4caf6c7b8f1c35d80a77bd8005aeae6197786Ada pMpi2RaidActionRequest_t action;
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada uint8_t ir_active = FALSE, reply_type;
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada uint8_t function, found_reply = FALSE;
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada uint16_t SMID, action_type;
76a4caf6c7b8f1c35d80a77bd8005aeae6197786Ada mptsas_slots_t *slots = mpt->m_active;
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada int config, vol;
76a4caf6c7b8f1c35d80a77bd8005aeae6197786Ada mptsas_cmd_t *cmd;
940efceed6b67909bbec473feca747d2fbaa32b9Andy Giles uint32_t reply_addr;
940efceed6b67909bbec473feca747d2fbaa32b9Andy Giles uint64_t request_desc;
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada int cnt;
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada pMpi2ReplyDescriptorsUnion_t reply_desc_union;
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada pMPI2DefaultReply_t reply;
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada pMpi2AddressReplyDescriptor_t address_reply;
76a4caf6c7b8f1c35d80a77bd8005aeae6197786Ada
76a4caf6c7b8f1c35d80a77bd8005aeae6197786Ada /*
76a4caf6c7b8f1c35d80a77bd8005aeae6197786Ada * Before doing the system shutdown RAID Action, make sure that the IOC
76a4caf6c7b8f1c35d80a77bd8005aeae6197786Ada * supports IR and make sure there is a valid volume for the request.
76a4caf6c7b8f1c35d80a77bd8005aeae6197786Ada */
76a4caf6c7b8f1c35d80a77bd8005aeae6197786Ada if (mpt->m_ir_capable) {
da5ab83fc888325fc812733d8a54bc5eab65c65cKeith M Wesolowski for (config = 0; (config < mpt->m_num_raid_configs) &&
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada (!ir_active); config++) {
76a4caf6c7b8f1c35d80a77bd8005aeae6197786Ada for (vol = 0; vol < MPTSAS_MAX_RAIDVOLS; vol++) {
da5ab83fc888325fc812733d8a54bc5eab65c65cKeith M Wesolowski if (mpt->m_raidconfig[config].m_raidvol[vol].
76a4caf6c7b8f1c35d80a77bd8005aeae6197786Ada m_israid) {
76a4caf6c7b8f1c35d80a77bd8005aeae6197786Ada ir_active = TRUE;
76a4caf6c7b8f1c35d80a77bd8005aeae6197786Ada break;
76a4caf6c7b8f1c35d80a77bd8005aeae6197786Ada }
76a4caf6c7b8f1c35d80a77bd8005aeae6197786Ada }
76a4caf6c7b8f1c35d80a77bd8005aeae6197786Ada }
76a4caf6c7b8f1c35d80a77bd8005aeae6197786Ada }
76a4caf6c7b8f1c35d80a77bd8005aeae6197786Ada if (!ir_active) {
76a4caf6c7b8f1c35d80a77bd8005aeae6197786Ada return;
76a4caf6c7b8f1c35d80a77bd8005aeae6197786Ada }
76a4caf6c7b8f1c35d80a77bd8005aeae6197786Ada
76a4caf6c7b8f1c35d80a77bd8005aeae6197786Ada /*
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada * If TM slot is already being used (highly unlikely), show message and
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada * don't issue the RAID action.
76a4caf6c7b8f1c35d80a77bd8005aeae6197786Ada */
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada if (slots->m_slot[MPTSAS_TM_SLOT(mpt)] != NULL) {
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada mptsas_log(mpt, CE_WARN, "RAID Action slot in use. Cancelling"
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada " System Shutdown RAID Action.\n");
76a4caf6c7b8f1c35d80a77bd8005aeae6197786Ada return;
76a4caf6c7b8f1c35d80a77bd8005aeae6197786Ada }
76a4caf6c7b8f1c35d80a77bd8005aeae6197786Ada
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada /*
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada * Create the cmd and put it in the dedicated TM slot.
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada */
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada cmd = &(mpt->m_event_task_mgmt.m_event_cmd);
76a4caf6c7b8f1c35d80a77bd8005aeae6197786Ada bzero((caddr_t)cmd, sizeof (*cmd));
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada cmd->cmd_pkt = NULL;
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada cmd->cmd_slot = MPTSAS_TM_SLOT(mpt);
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada slots->m_slot[MPTSAS_TM_SLOT(mpt)] = cmd;
76a4caf6c7b8f1c35d80a77bd8005aeae6197786Ada
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada /*
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada * Form message for raid action.
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada */
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada action = (pMpi2RaidActionRequest_t)(mpt->m_req_frame +
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada (mpt->m_req_frame_size * cmd->cmd_slot));
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada bzero(action, mpt->m_req_frame_size);
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada action->Function = MPI2_FUNCTION_RAID_ACTION;
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada action->Action = MPI2_RAID_ACTION_SYSTEM_SHUTDOWN_INITIATED;
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada /*
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada * Send RAID Action.
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada */
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada (void) ddi_dma_sync(mpt->m_dma_req_frame_hdl, 0, 0,
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada DDI_DMA_SYNC_FORDEV);
940efceed6b67909bbec473feca747d2fbaa32b9Andy Giles request_desc = (cmd->cmd_slot << 16) +
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE;
940efceed6b67909bbec473feca747d2fbaa32b9Andy Giles MPTSAS_START_CMD(mpt, request_desc);
76a4caf6c7b8f1c35d80a77bd8005aeae6197786Ada
76a4caf6c7b8f1c35d80a77bd8005aeae6197786Ada /*
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada * Even though reply does not matter because the system is shutting
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada * down, wait no more than 5 seconds here to get the reply just because
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada * we don't want to leave it hanging if it's coming. Poll because
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada * interrupts are disabled when this function is called.
76a4caf6c7b8f1c35d80a77bd8005aeae6197786Ada */
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada for (cnt = 0; cnt < 5000; cnt++) {
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada /*
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada * Check for a reply.
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada */
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada (void) ddi_dma_sync(mpt->m_dma_post_queue_hdl, 0, 0,
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada DDI_DMA_SYNC_FORCPU);
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada reply_desc_union = (pMpi2ReplyDescriptorsUnion_t)
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada MPTSAS_GET_NEXT_REPLY(mpt, mpt->m_post_index);
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada if (ddi_get32(mpt->m_acc_post_queue_hdl,
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada &reply_desc_union->Words.Low) == 0xFFFFFFFF ||
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada ddi_get32(mpt->m_acc_post_queue_hdl,
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada &reply_desc_union->Words.High) == 0xFFFFFFFF) {
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada drv_usecwait(1000);
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada continue;
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada }
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada /*
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada * There is a reply. If it's not an address reply, ignore it.
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada */
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada reply_type = ddi_get8(mpt->m_acc_post_queue_hdl,
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada &reply_desc_union->Default.ReplyFlags);
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada reply_type &= MPI2_RPY_DESCRIPT_FLAGS_TYPE_MASK;
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada if (reply_type != MPI2_RPY_DESCRIPT_FLAGS_ADDRESS_REPLY) {
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada goto clear_and_continue;
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada }
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada /*
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada * SMID must be the TM slot since that's what we're using for
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada * this RAID action. If not, ignore this reply.
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada */
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada address_reply =
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada (pMpi2AddressReplyDescriptor_t)reply_desc_union;
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada SMID = ddi_get16(mpt->m_acc_post_queue_hdl,
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada &address_reply->SMID);
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada if (SMID != MPTSAS_TM_SLOT(mpt)) {
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada goto clear_and_continue;
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada }
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada /*
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada * If reply frame is not in the proper range ignore it.
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada */
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada reply_addr = ddi_get32(mpt->m_acc_post_queue_hdl,
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada &address_reply->ReplyFrameAddress);
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada if ((reply_addr < mpt->m_reply_frame_dma_addr) ||
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada (reply_addr >= (mpt->m_reply_frame_dma_addr +
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada (mpt->m_reply_frame_size * mpt->m_free_queue_depth))) ||
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada ((reply_addr - mpt->m_reply_frame_dma_addr) %
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada mpt->m_reply_frame_size != 0)) {
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada goto clear_and_continue;
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada }
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada /*
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada * If not a RAID action reply ignore it.
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada */
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada (void) ddi_dma_sync(mpt->m_dma_reply_frame_hdl, 0, 0,
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada DDI_DMA_SYNC_FORCPU);
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada reply = (pMPI2DefaultReply_t)(mpt->m_reply_frame +
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada (reply_addr - mpt->m_reply_frame_dma_addr));
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada function = ddi_get8(mpt->m_acc_reply_frame_hdl,
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada &reply->Function);
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada if (function != MPI2_FUNCTION_RAID_ACTION) {
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada goto clear_and_continue;
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada }
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada
76a4caf6c7b8f1c35d80a77bd8005aeae6197786Ada /*
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada * Finally, make sure this is the System Shutdown RAID action.
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada * If not, ignore reply.
76a4caf6c7b8f1c35d80a77bd8005aeae6197786Ada */
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada action_type = ddi_get16(mpt->m_acc_reply_frame_hdl,
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada &reply->FunctionDependent1);
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada if (action_type !=
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada MPI2_RAID_ACTION_SYSTEM_SHUTDOWN_INITIATED) {
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada goto clear_and_continue;
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada }
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada found_reply = TRUE;
76a4caf6c7b8f1c35d80a77bd8005aeae6197786Ada
c8f74a56af6974058d11efe681daeb7f4cdb78d1Adaclear_and_continue:
76a4caf6c7b8f1c35d80a77bd8005aeae6197786Ada /*
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada * Clear the reply descriptor for re-use and increment index.
76a4caf6c7b8f1c35d80a77bd8005aeae6197786Ada */
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada ddi_put64(mpt->m_acc_post_queue_hdl,
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada &((uint64_t *)(void *)mpt->m_post_queue)[mpt->m_post_index],
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada 0xFFFFFFFFFFFFFFFF);
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada (void) ddi_dma_sync(mpt->m_dma_post_queue_hdl, 0, 0,
76a4caf6c7b8f1c35d80a77bd8005aeae6197786Ada DDI_DMA_SYNC_FORDEV);
76a4caf6c7b8f1c35d80a77bd8005aeae6197786Ada
76a4caf6c7b8f1c35d80a77bd8005aeae6197786Ada /*
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada * Update the global reply index and keep looking for the
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada * reply if not found yet.
76a4caf6c7b8f1c35d80a77bd8005aeae6197786Ada */
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada if (++mpt->m_post_index == mpt->m_post_queue_depth) {
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada mpt->m_post_index = 0;
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada }
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada ddi_put32(mpt->m_datap, &mpt->m_reg->ReplyPostHostIndex,
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada mpt->m_post_index);
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada if (!found_reply) {
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada continue;
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada }
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada break;
76a4caf6c7b8f1c35d80a77bd8005aeae6197786Ada }
76a4caf6c7b8f1c35d80a77bd8005aeae6197786Ada
76a4caf6c7b8f1c35d80a77bd8005aeae6197786Ada /*
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada * clear the used slot as the last step.
76a4caf6c7b8f1c35d80a77bd8005aeae6197786Ada */
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada slots->m_slot[MPTSAS_TM_SLOT(mpt)] = NULL;
76a4caf6c7b8f1c35d80a77bd8005aeae6197786Ada}
76a4caf6c7b8f1c35d80a77bd8005aeae6197786Ada
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing Chinaint
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing Chinamptsas_delete_volume(mptsas_t *mpt, uint16_t volid)
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China{
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada int config, i = 0, vol = (-1);
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China
da5ab83fc888325fc812733d8a54bc5eab65c65cKeith M Wesolowski for (config = 0; (config < mpt->m_num_raid_configs) && (vol != i);
c8f74a56af6974058d11efe681daeb7f4cdb78d1Ada config++) {
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China for (i = 0; i < MPTSAS_MAX_RAIDVOLS; i++) {
da5ab83fc888325fc812733d8a54bc5eab65c65cKeith M Wesolowski if (mpt->m_raidconfig[config].m_raidvol[i].
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China m_raidhandle == volid) {
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China vol = i;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China break;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China }
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China }
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China }
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China if (vol < 0) {
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China mptsas_log(mpt, CE_WARN, "raid doesn't exist at specified "
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China "target.");
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China return (-1);
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China }
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China
da5ab83fc888325fc812733d8a54bc5eab65c65cKeith M Wesolowski mpt->m_raidconfig[config].m_raidvol[vol].m_israid = 0;
da5ab83fc888325fc812733d8a54bc5eab65c65cKeith M Wesolowski mpt->m_raidconfig[config].m_raidvol[vol].m_ndisks = 0;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China for (i = 0; i < MPTSAS_MAX_DISKS_IN_VOL; i++) {
da5ab83fc888325fc812733d8a54bc5eab65c65cKeith M Wesolowski mpt->m_raidconfig[config].m_raidvol[vol].m_disknum[i] = 0;
da5ab83fc888325fc812733d8a54bc5eab65c65cKeith M Wesolowski mpt->m_raidconfig[config].m_raidvol[vol].m_devhdl[i] = 0;
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China }
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China return (0);
5b5046010dc014958659914f953b1197da4054acjiang wu - Sun Microsystems - Beijing China}