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 2008 Sun Microsystems, Inc. All rights reserved. 2N/A * Use is subject to license terms. 2N/A * This module is part of the photon library 2N/A * I18N message number ranges 2N/A * This file: 8500 - 8999 2N/A * Shared common messages: 1 - 1999 2N/A/* #define _POSIX_SOURCE 1 */ 2N/A/* Global variables */ 2N/A * This function checks if the passed char pointer has WWN_SIZE nulls (zeroes). 2N/A * This is only a convenience function. 2N/A * wwn_ptr - pointer to a character string of length WWN_SIZE 2N/A * It is expected to be holding the WWN 2N/A * Ex: A WWN like 508002000000ddc1 is expected to be stored as 2N/A * the following 8 bytes - 2N/A * 0x50, 0x80, 0x00, 0x20, ... etc 2N/A * 0 - if there is atleast one of WWN_SIZE bytes is != '\0' 2N/A * non-zero - if all WWN_SIZE bytes are '\0' 2N/A * the given ses_path. 2N/A * ses_path - pointer to the ses_path 2N/A * map - pointer to the map 2N/A * dtype - dtype of the device whose path is to be constructed 2N/A * dev_path - pointer to the device path of type dtype and with tid 2N/A * - Caller has to free this after use 2N/A * non-zero - otherwise 2N/A /* Make sure that the port WWN is valid */ 2N/A /* TBD: Must find path, not just use :c */ 2N/A /* First lets get the PA from the ses path passed in */ 2N/A * Now we go through every entry in the map and match the 2N/A * area and domain ids with the PA of the passed ses path. 2N/A * If we find a match, we then match the low order byte 2N/A /* Make sure that the port WWN is valid */ 2N/A /* TBD: Must find path, not just use :c */ 2N/A }
/* End of switch on port_topology */ 2N/A * checks for null wwn to a disk. 2N/A * and returns -1 if found, 0 2N/A * non-zero otherwise 2N/A * verify and continue only if the argv 2N/A * has a format like box,{f/r}<slot #>. 2N/A * Otherwise, return to the caller. 2N/A * The only way to address null wwn disk 2N/A * is using the box,{f/r}<slot#> format. 2N/A/* add support for new {f/r/s}<slot#> support for DPM */ 2N/A ((*(
ptr +
1) ==
'f') || (*(
ptr +
1) ==
'r') ||
2N/A * Get the list of enclosures 2N/A * connected to the system. 2N/A * The following method is safer to get an ses path 2N/A * to the enclosure than calling l_get_ses_path(), 2N/A * with physical path to null WWN disk. 2N/A * Because, l_get_ses_path uses the disk's 2N/A * al_pa to get the box id and then ses path 2N/A * to the box. When a disk has null wwn, it may 2N/A * not have a valid al_pa, and hard address. 2N/A * There is a possibility that l_get_ses_path() 2N/A * not returning ses path to the correct enclosure. 2N/A /* free the box list */ 2N/A /* check for null WWN */ 2N/A return (0);
/* Non-null wwn */ 2N/A * If OVERALL_STATUS is sent as the "func", 2N/A * the code pointer must be valid (non NULL). 2N/A * Otherwise NULL is a valid input for the code pointer. 2N/A * non-zero otherwise 2N/A /* Skip global element */ 2N/A * Finds whether device id (tid) exists in the 2N/A * Arbitrated loop map or not. 2N/A * ses_path - pointer to a ses path 2N/A * tid - the target id of the device we want to check on 2N/A * - only the low order 8 bits has the tid 2N/A * map - pointer to a map of the system 2N/A * verbose_flag - self explanatory 2N/A * dev_path - the device path of the device with "tid". 2N/A * Caller is responsible for freeing it 2N/A * 1 if device present 2N/A * Make sure that the port WWN is valid 2N/A * Get the phys address (port id) of this ses device 2N/A * We have a device. First match the area and 2N/A * domain ids and if they match, then see if 2N/A * the 8bit tid matches the last 8 bits of 2N/A * Make sure that the port WWN is valid 2N/A }
/* End of switch on port_topology */ 2N/A * onlines the given list of devices 2N/A * and free up the allocated memory. 2N/A * offlines all the disks in a 2N/A * non-zero otherwise 2N/A /* Get global status for this Photon */ 2N/A * prepares a char string 2N/A * containing the name of the 2N/A * device which will be hotplugged. 2N/A /* If either of the above fail, we use the default value of 0 */