fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * CDDL HEADER START
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The contents of this file are subject to the terms of the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Common Development and Distribution License (the "License").
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * You may not use this file except in compliance with the License.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * See the License for the specific language governing permissions
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * and limitations under the License.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * When distributing Covered Code, include this CDDL HEADER in each
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * If applicable, add the following below this CDDL HEADER, with the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * fields enclosed by brackets "[]" replaced with your own identifying
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * information: Portions Copyright [yyyy] [name of copyright owner]
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * CDDL HEADER END
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Use is subject to license terms.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define LUX_SF_MINOR2INST(x) (x >> LUX_SF_INST_SHIFT4MINOR)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern char *dtype[];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern char *whoami;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern const int OPTION_A;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern const int OPTION_B;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern const int OPTION_C;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern const int OPTION_D;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern const int OPTION_E;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern const int OPTION_F;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern const int OPTION_L;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern const int OPTION_P;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern const int OPTION_R;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern const int OPTION_T;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern const int OPTION_V;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern const int OPTION_Z;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern const int OPTION_Y;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern const int OPTION_CAPF;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern const int PVERBOSE;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern const int SAVE;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern const int EXPERT;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic void pho_display_config(char *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic void dpm_display_config(char *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic void n_rem_list_entry(uchar_t, struct gfc_map *,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic void n_rem_list_entry_fabric(int, struct gfc_map *,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic void n_rem_wwn_entry(uchar_t *, WWN_list **);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic void display_disk_info(L_inquiry, L_disk_state,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte Path_struct *, struct mode_page *, int, char *, int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic void display_lun_info(L_disk_state, Path_struct *,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic void display_fc_disk(struct path_struct *, char *, gfc_map_t *,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic void adm_display_err(char *, int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic void temperature_messages(struct l_state_struct *, int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic void ctlr_messages(struct l_state_struct *, int, int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic void fan_messages(struct l_state_struct *, int, int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic void ps_messages(struct l_state_struct *, int, int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic void abnormal_condition_display(struct l_state_struct *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic void loop_messages(struct l_state_struct *, int, int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic void revision_msg(struct l_state_struct *, int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic void mb_messages(struct l_state_struct *, int, int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic void back_plane_messages(struct l_state_struct *, int, int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic void dpm_SSC100_messages(struct l_state_struct *, int, int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic void mb_messages(struct l_state_struct *, int, int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic void back_plane_messages(struct l_state_struct *, int, int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic void dpm_SSC100_messages(struct l_state_struct *, int, int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic void trans_messages(struct l_state_struct *, int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic void adm_print_pathlist(char *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic void display_path_info(char *, char *, WWN_list *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic void copy_wwn_data_to_str(char *, const uchar_t *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic void adm_mplist_free(struct mplist_struct *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic int lun_display(Path_struct *path_struct, L_inquiry inq_struct,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic int non_encl_fc_disk_display(Path_struct *path_struct,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic int get_enclStatus(char *phys_path, char *encl_name, int off_flag);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic int get_host_controller_pwwn(char *hba_path, uchar_t *pwwn);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic int get_path_status(char *devpath, int *status);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic int get_FC4_host_controller_pwwn(char *hba_path, uchar_t *pwwn);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Gets the device's state from the SENA IB and
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * checks whether device is offlined, bypassed
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * or if the slot is empty and prints it to the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * non-zero otherwise
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteprint_devState(char *devname, char *ppath, int fr_flag, int slot,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteuchar_t device_off, ib_status_code, bypass_a_en, bypass_b_en;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((err = l_get_status(ppath, &l_state, verbose_flag)) != 0) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (i = 0; i < (int)l_state.ib_tbl.config.enc_num_elem; i++) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (l_state.ib_tbl.config.type_hdr[i].type == ELM_TYP_BP) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte elem_index += l_state.ib_tbl.config.type_hdr[i].num;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) bcopy((const void *)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) bcopy((const void *)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte device_off = l_state.drv_front[slot].ib_status.dev_off;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte bypass_a_en = l_state.drv_front[slot].ib_status.bypass_a_en;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte bypass_b_en = l_state.drv_front[slot].ib_status.bypass_b_en;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ib_status_code = l_state.drv_front[slot].ib_status.code;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte device_off = l_state.drv_rear[slot].ib_status.dev_off;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte bypass_a_en = l_state.drv_rear[slot].ib_status.bypass_a_en;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte bypass_b_en = l_state.drv_rear[slot].ib_status.bypass_b_en;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ib_status_code = l_state.drv_rear[slot].ib_status.code;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "%s is offlined and bypassed.\n"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Could not get device specific"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " information.\n\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "%s is bypassed (Port:AB).\n"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Could not get device specific"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " information.\n\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "Slot %s is empty.\n\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "Backplane(Port:AB) is bypassed.\n"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Could not get device specific"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " information for"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Error: converting"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " %s to physical path.\n"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Invalid pathname.\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return (-1);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Given an error number, this functions
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * calls the get_errString() to print a
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * corresponding error message to the stderr.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * get_errString() always returns an error
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * message, even in case of undefined error number.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * So, there is no need to check for a NULL pointer
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * while printing the error message to the stdout.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * RETURNS: N/A
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* free the allocated memory for error string */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * adm_inquiry() Display the inquiry information for
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * a SENA enclosure(s) or disk(s).
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((err = l_convert_name(argv[path_index], &path_phys,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Error: converting"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " %s to physical path.\n"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Invalid pathname.\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (err = g_get_serial_number(path_phys, inq80.inq_serial,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (wwn_list_ptr = wwn_list; wwn_list_ptr != NULL;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (strcasecmp(wwn_list_ptr->port_wwn_s, path_struct->argv) ==
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * if the wwn list is null or the arg device not found
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * from the wwn list, still go ahead to issue inquiry.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (err = g_get_serial_number(path_phys, inq80.inq_serial,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (wwn_list_ptr = list_start; wwn_list_ptr != NULL;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } else if (argnwwn) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (err = g_get_serial_number(path_phys, inq80.inq_serial,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * FORCELIP expert function
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint slot, f_r, path_index = 0, err = 0, retval = 0;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((err = l_convert_name(argv[path_index], &path_phys,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Error: converting"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " %s to physical path.\n"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Invalid pathname.\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "Error: Invalid pathname (%s)"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (err = g_force_lip(path_phys, Options & PVERBOSE)) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * DISPLAY function
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint i, slot, f_r, path_index = 0, err = 0, opnerr = 0;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte VERBPRINT(MSGSTR(2108, " Displaying information for: %s\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((err = l_convert_name(argv[path_index], &path_phys,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (strstr(argv[path_index], SCSI_VHCI) == NULL) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Error: converting"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " %s to physical path.\n"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Invalid pathname.\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "Error: Invalid pathname (%s)"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "Error: Invalid pathname (%s)"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * See what kind of device we are talking to.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((opnerr = g_get_inquiry(path_phys, &inq)) != 0) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * We check only for L_OPEN_PATH_FAIL because
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * that is the only error code returned by
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * g_get_inquiry() which is not got from the ioctl
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * call itself. So, we are dependent, in a way, on the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * implementation of g_get_inquiry().
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } else if (strstr((char *)inq.inq_pid, ENCLOSURE_PROD_ID) != NULL) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Display SENA enclosure.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte print_chars(inq.inq_pid, sizeof (inq.inq_pid), 0);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } else if ((((inq.inq_dtype & DTYPE_MASK) == DTYPE_ESI)) &&
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Display for the Daktari/DPM
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * if device is in SENA enclosure
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * if the slot is valid, then I know this is a SENA enclosure
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * and can continue
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * otherwise:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * I first get the ses_path, if this doesn't fail
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * I retrieve the inquiry data from the ses node
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * and check teh PID to make sure this is a SENA
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } else if (((inq.inq_dtype & DTYPE_MASK) == DTYPE_DIRECT) &&
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ((strstr((char *)ses_inq.inq_pid, ENCLOSURE_PROD_ID)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte display_fc_disk(path_struct, ses_path, &map, inq,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } else if (strstr((char *)inq.inq_pid, "SUN_SEN") != 0) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) fprintf(stdout, MSGSTR(2109, "DEVICE is a "));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte print_chars(inq.inq_vid, sizeof (inq.inq_vid), 1);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte print_chars(inq.inq_pid, sizeof (inq.inq_pid), 1);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* if device is not in SENA or SSA enclosures. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } else if ((inq.inq_dtype & DTYPE_MASK) < 0x10) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "Error: getting the device"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " information.\n"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* case 0x01: same as default */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "Device Type:"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } else if ((inq.inq_dtype & DTYPE_MASK) < 0x1f) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Powers off a list of SENA enclosure(s)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * and disk(s) which is provided by the user.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((err = l_convert_name(argv[path_index], &path_phys,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * In case we did not find the device
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * in the /devices directory.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Only valid for pathnames like box,f1
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Error: converting"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " %s to physical path.\n"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Invalid pathname.\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * We are addressing a disk using a path
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * format type box,f1.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Is it Bypassed... try to give more
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * informtaion.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((strstr((char *)inq.inq_pid, ENCLOSURE_PROD_ID) != 0) ||
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* power off SENA enclosure. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (err = l_pho_pwr_up_down(argv[path_index], path_phys,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } else if ((inq.inq_dtype & DTYPE_MASK) == DTYPE_DIRECT) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * SSA section:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((err = l_convert_name(argv[path_index], &path_phys,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * In case we did not find the device
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * in the /devices directory.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Only valid for pathnames like box,f1
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Error: converting"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " %s to physical path.\n"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Invalid pathname.\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * We are addressing a disk using a path
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * format type box,f1 and no disk
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * path was found.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * So set the Force flag so no reserved/busy
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * check is performed.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((strstr((char *)inq.inq_pid, ENCLOSURE_PROD_ID) != 0) ||
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (err = l_bp_bypass_enable(path_phys, bypass_flag,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } else if ((inq.inq_dtype & DTYPE_MASK) == DTYPE_DIRECT) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * adm_download() Download subsystem microcode.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Path must point to a LUX IB.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * See what kind of device we are talking to.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((err = l_convert_name(argv[path_index], &path_phys,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Error: converting"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " %s to physical path.\n"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Invalid pathname.\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((strstr((char *)inq.inq_pid, ENCLOSURE_PROD_ID) != 0) ||
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * display_link_status() Reads and displays the link status.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((err = l_convert_name(argv[path_index], &path_phys,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Error: converting"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " %s to physical path.\n"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Invalid pathname.\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (err = g_rdls(path_phys, &rls, Options & PVERBOSE)) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "information for loop:%s\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) fprintf(stdout, MSGSTR(2008, "al_pa lnk fail "
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " sync loss signal loss sequence err"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " invalid word CRC\n"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "%x\t%-12d%-12d%-14d%-15d%-15d%-12d\n",
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "%x\t%-12u%-12u%-14u%-15u%-15u%-12u\n",
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " cleared by a reset, only power cycles.\n"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "These counts must be compared"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " to previously read counts.\n"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ib_present_chk() Check to see if IB 0 or 1 is present in the box.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * 1 if ib present
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * 0 otherwise
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteib_present_chk(struct l_state_struct *l_state, int which_one)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (i = 0; i < (int)l_state->ib_tbl.config.enc_num_elem; i++) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (l_state->ib_tbl.config.type_hdr[i].type == ELM_TYP_IB) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) bcopy((const void *)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte &l_state->ib_tbl.p2_s.element[elem_index + which_one],
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte elem_index += l_state->ib_tbl.config.type_hdr[i].num;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * print_individual_state() Print individual disk status.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " (Rsrv cnflt:A) "));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " (Rsrv cnflt:B) "));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " (Reserve cnflt)"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * display_disk_msg() Displays status for
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * an individual SENA device.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortedisplay_disk_msg(struct l_disk_state_struct *dsk_ptr,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct l_state_struct *l_state, Bp_elem_st *bp, int front_flag)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (dsk_ptr->ib_status.code == S_NOT_INSTALLED) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "(LED Blinking) "));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (dsk_ptr->ib_status.fault || dsk_ptr->ib_status.fault_req) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "(Bypassed:AB)"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "(Bypassed: A)"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "(Bypassed: B)"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (dsk_ptr->ib_status.fault || dsk_ptr->ib_status.fault_req) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Before printing that the port is bypassed
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * verify that there is an IB for this port.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * If not then don't print.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " (Bypassed BP: A)"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "(Bypassed BP: B)"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "(Bypassed BP:AB)"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte state_a = dsk_ptr->g_disk_state.d_state_flags[PORT_A];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte state_b = dsk_ptr->g_disk_state.d_state_flags[PORT_B];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " (Loop not accessible)"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } else if (dsk_ptr->l_state_flag & L_INVALID_WWN) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " (Invalid WWN) "));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } else if (dsk_ptr->l_state_flag & L_INVALID_MAP) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " (Login failed) "));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } else if (dsk_ptr->l_state_flag & L_NO_PATH_FOUND) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " (No path found)"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } else if (a_and_b) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* NOTE: Double state - should do 2 lines. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } else if (strlen(dsk_ptr->g_disk_state.node_wwn_s)) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * pho_display_config() Displays device status
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * information for a SENA enclosure.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Get global status */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Look for abnormal status.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "SLOT FRONT DISKS (Node WWN) "
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " REAR DISKS (Node WWN)\n"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Print the status for each disk
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (j = 0; j < (int)l_state.ib_tbl.config.enc_num_elem; j++) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (l_state.ib_tbl.config.type_hdr[j].type == ELM_TYP_BP)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte elem_index += l_state.ib_tbl.config.type_hdr[j].num;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) bcopy((const void *)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) bcopy((const void *)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (i = 0; i < (int)l_state.total_num_drv/2; i++) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte display_disk_msg(&l_state.drv_front[i], &l_state, &bpf, 1);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte display_disk_msg(&l_state.drv_rear[i], &l_state, &bpr, 0);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Display the subsystem status.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " SUBSYSTEM STATUS\nFW Revision:"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte sizeof (l_state.ib_tbl.config.prod_revision), 1);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) fprintf(stdout, MSGSTR(2034, " Box ID:%d"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (i = 0; i < 8; i++) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Make sure NULL terminated although it is supposed to be */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (strlen((const char *)l_state.ib_tbl.enclosure_name) <=
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) fprintf(stdout, MSGSTR(2035, " Enclosure Name:%s\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Get and print CONTROLLER messages */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (i = 0; i < (int)l_state.ib_tbl.config.enc_num_elem; i++) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte switch (l_state.ib_tbl.config.type_hdr[i].type) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * NOTE: I just use the Photon's message
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * string here and don't look at the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * language code. The string includes
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * the language name.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (l_state.ib_tbl.config.type_hdr[i].text_len != 0) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Calculate the index to each element.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte elem_index += l_state.ib_tbl.config.type_hdr[i].num;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * dpm_display_config() Displays device status
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * information for a DAKTARI enclosure.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Get global status */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Look for abnormal status.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "SLOT DISKS (Node WWN) \n"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Print the status for each disk
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (j = 0; j < (int)l_state.ib_tbl.config.enc_num_elem; j++) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (l_state.ib_tbl.config.type_hdr[j].type == ELM_TYP_BP)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte elem_index += l_state.ib_tbl.config.type_hdr[j].num;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) bcopy((const void *)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) bcopy((const void *)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (i = 0, count = 0;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte display_disk_msg(&l_state.drv_front[i], &l_state, &bpf, 1);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (i = 0; i < (int)l_state.total_num_drv/2; i++, count++) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte display_disk_msg(&l_state.drv_rear[i], &l_state, &bpf, 1);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Display the subsystem status.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "\t\tSUBSYSTEM STATUS\nFW Revision:"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (i = 0; i < sizeof (l_state.ib_tbl.config.prod_revision); i++) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) fprintf(stdout, MSGSTR(2034, " Box ID:%d"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (i = 0; i < 8; i++) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Make sure NULL terminated although it is supposed to be */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (strlen((const char *)l_state.ib_tbl.enclosure_name) <=
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) fprintf(stdout, MSGSTR(2035, " Enclosure Name:%s\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Get and print CONTROLLER messages */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (i = 0; i < (int)l_state.ib_tbl.config.enc_num_elem; i++) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte switch (l_state.ib_tbl.config.type_hdr[i].type) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * NOTE: I just use the Photon's message
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * string here and don't look at the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * language code. The string includes
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * the language name.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (l_state.ib_tbl.config.type_hdr[i].text_len != 0) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Calculate the index to each element.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte elem_index += l_state.ib_tbl.config.type_hdr[i].num;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Change the FPM (Front Panel Module) password of the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * subsystem associated with the IB addressed by the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * enclosure or pathname to name.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * up_password() Changes the password for SENA enclosure.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((termio_fd = open("/dev/tty", O_RDONLY)) == -1) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Make sure path valid and is to a PHO
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * before bothering operator.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((err = l_convert_name(argv[path_index], &path_phys,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Error: converting"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " %s to physical path.\n"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Invalid pathname.\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((strstr((char *)inq.inq_pid, ENCLOSURE_PROD_ID) == 0) &&
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Again this is like the ssaadm code in that the name
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * is still not defined before this code must be released.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "Changing FPM password for subsystem %s\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (i = 0; input[i]; i++) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " The password"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " must be 4 decimal-digit characters.\n"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (i && (i != 4)) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " The password"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " must be 4 decimal-digit characters.\n"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (j = 0; password[j]; j++) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " The password"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " must be 4 decimal-digit characters.\n"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (i != j) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " try again.\n"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) signal(SIGINT, sig); /* restore signal handler */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Send new password to IB */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Call g_failover to process failover command
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte path_phys = g_get_physical_name(argv[path_index++]);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * up_encl_name() Update the enclosures logical name.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortechar wwn1[(WWN_SIZE*2)+1], name[1024], *path_phys = NULL;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (i = 0; name[i]; i++) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte MSGSTR(2045, "Error: Invalid enclosure name.\n"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "Usage: %s [-v] subcommand {a name consisting of"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " 1-16 alphanumeric characters}"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte MSGSTR(114, "Error: Incorrect number of arguments.\n"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "Usage: %s [-v] subcommand {a name consisting of"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " 1-16 alphanumeric characters}"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((err = l_convert_name(argv[path_index], &path_phys,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Error: converting"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " %s to physical path.\n"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Invalid pathname.\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Make sure we are talking to an IB.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((strstr((char *)inq.inq_pid, ENCLOSURE_PROD_ID) == 0) &&
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Again this is like the ssaadm code in that the name
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * is still not defined before this code must be released.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte MSGSTR(2048, "Error: Pathname does not point to a %s"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (err = g_get_wwn(path_phys, port_wwn, node_wwn, &al_pa,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (i = 0; i < WWN_SIZE; i++) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) sprintf(&wwn1[i << 1], "%02x", node_wwn[i]);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((err = l_get_box_list(&b_list, Options & PVERBOSE)) != 0) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte MSGSTR(2049, "Warning: The name you selected, %s,"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " is already being used.\n"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "Please choose a unique name.\n"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "You can use the \"probe\" subcommand to"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " see all of the enclosure names.\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Send new name to IB */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte MSGSTR(2050, "The enclosure has been renamed to %s\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteget_enclStatus(char *phys_path, char *encl_name, int off_flag)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "Notice: Drives in enclosure"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " \"%s\" have already been"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " powered off.\n\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return (-1);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "Notice: Drives in enclosure"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " \"%s\" have already been"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " powered on.\n\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return (-1);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * adm_led() The led_request subcommand requests the subsystem
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * to display the current state or turn off, on, or blink
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * the yellow LED associated with the disk specified by the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * enclosure or pathname.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((err = l_convert_name(argv[path_index], &path_phys,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Make sure we have a device path. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Error: converting"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " %s to physical path.\n"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Invalid pathname.\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((inq.inq_dtype & DTYPE_MASK) != DTYPE_DIRECT) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "Error: pathname must be to a disk device.\n"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * See if we are in fact talking to a loop or not.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "The led_on functionality is not applicable "
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "to this subsystem.\n"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (err = l_led(path_struct, led_action, &status,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Check to see if we have a daktari */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "device in location: slot %d\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "device in location: slot %d\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "device in location: front,slot %d\n")
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "device in location: rear,slot %d\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "LED state is BLINKING for "
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "LED state is BLINKING for "
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "device in location: slot %d\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "LED state is BLINKING for "
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "device in location: slot %d\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "device in location: front,slot %d\n")
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "device in location: rear,slot %d\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "LED state is OFF for "
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "device in location: slot %d\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "LED state is OFF for "
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "device in location: slot %d\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "device in location: front,slot %d\n")
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "device in location: rear,slot %d\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * dump() Dump information
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * get big buffer
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((hdr = (struct rec_diag_hdr *)calloc(1, MAX_REC_DIAG_LENGTH)) ==
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((err = l_convert_name(argv[path_index], &path_phys,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Error: converting"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " %s to physical path.\n"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Invalid pathname.\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (err = l_get_envsen(path_phys, buf, MAX_REC_DIAG_LENGTH,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte MSGSTR(2066, "\t\tEnvironmental Sense Information\n"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Dump all pages.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) sprintf(hdr_buf, MSGSTR(2067, "Page %d: "),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte sizeof (struct rec_diag_hdr));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * display_socal_stats() Display socal driver kstat information.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortedisplay_socal_stats(int port, char *socal_path, struct socal_stats *fc_stats)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "\tInformation for FC Loop on port %d of"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " FC100/S Host Adapter\n\tat path: %s\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Host Adapter WWN's: Node:%s"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Port:%s\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Host Adapter Firmware Revision: %s\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " This Host Adapter checks S-Bus parity.\n"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Version Resets Req_Q_Intrpts Qfulls"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Unsol_Resps Lips\n"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) fprintf(stdout, " %4d%8d%11d%13d%10d%7d\n",
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Els_rcvd Abts"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Abts_ok Offlines Loop_onlines Onlines\n"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) fprintf(stdout, " %4d%9d%10d%9d%13d%10d\n",
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* If any status conditions exist then display */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (i = 0; i < num_status_entries; i++) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (fc_stats->pstats[port].resp_status[i] != 0) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Fibre Channel Transport status:\n "
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "Status Value"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Count\n"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * display_sf_stats() Display sf driver kstat information.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * This routine is called by private loop device only
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortedisplay_sf_stats(char *path_phys, int dtype, struct sf_stats *sf_stats)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "Information from %s"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte MSGSTR(2073, "\n\t\tInformation from sf driver:\n"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Version Lip_count Lip_fail"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Alloc_fail #_cmds "
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "Throttle_limit Pool_size\n"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) fprintf(stdout, " %4d%9d%12d%11d%10d%11d%12d\n",
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "\n\t\tTARGET ERROR INFORMATION:\n"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "AL_PA Els_fail Timouts Abts_fail"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Tsk_m_fail "
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Data_ro_mis Dl_len_mis Logouts\n"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (err = g_get_dev_map(path_phys, &map, (Options & PVERBOSE))) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (err = g_get_wwn(path_phys, port_wwn, node_wwn, &al_pa,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* for san toleration, only need to modify the code */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* such that the current sf_al_map structure replaced */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* by the new gfc_map structure for private loop device */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (i = 0, dev_addr_list = map.dev_addr; i < map.count;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (dev_addr_list->gfc_port_dev.priv_port.sf_al_pa
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "%3x%10d%8d%10d%11d%13d%11d%9d\n",
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) print_errString(L_INVALID_LOOP_MAP, path_phys);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (i = 0, dev_addr_list = map.dev_addr; i < map.count;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "%3x%10d%8d%10d%11d%13d%11d%9d\n",
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * adm_display_err() Displays enclosure specific
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * error information.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint i, drvr_inst, sf_inst, socal_inst, port, al_pa, err = 0;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortechar *char_ptr, socal_path[MAXPATHLEN], drvr_path[MAXPATHLEN];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((kc = kstat_open()) == (kstat_ctl_t *)NULL) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (err = g_get_pathlist(drvr_path, &pathlist)) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (i = 0; i < pathcnt; i++) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (pathlist.path_info[i].path_state < MAXPATHSTATE) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* on_line path */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* standby or path0 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((char_ptr = strrchr(drvr_path, '/')) == NULL) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) print_errString(L_INVLD_PATH_NO_SLASH_FND,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *char_ptr = '\0'; /* Make into nexus or HBA driver path. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Each HBA and driver stack has its own structures
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * for this, so we have to handle each one individually.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (path_type) { /* Quick sanity check for valid path */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((err = g_get_nexus_path(drvr_path, &char_ptr)) != 0) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* attach :devctl to get node stat instead of dir stat. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) print_errString(L_LSTAT_ERROR, path_phys);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * first take care of ifp card.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "\tInformation for FC Loop of"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " FC100/P Host Adapter\n\tat path: %s\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "Information from %s"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Host Adapter WWN's: Node:%s"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Port:%s\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Host Adapter Firmware Revision: %s\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " This Host Adapter checks "
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "PCI-Bus parity.\n"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Version Lips\n"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* If any status conditions exist then display */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (i = 0; i < FC_STATUS_ENTRIES; i++) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Fibre Channel Transport "
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "status:\n "
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Count\n"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "\n\t\tTARGET ERROR INFORMATION:\n"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "AL_PA logouts_recvd task_mgmt_failures"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " data_ro_mismatches data_len_mismatch\n"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "%3x%14d%18d%20d%20d\n",
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "%3x%14d%18d%20d%20d\n",
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * process cards with sf xport nodes.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) print_errString(L_LSTAT_ERROR, path_phys);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte sf_inst = LUX_SF_MINOR2INST(minor(sbuf.st_rdev));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "statistics"))) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Error: could not lookup driver stats for sf%d\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (!(fc_ks = kstat_lookup(kc, "socal", socal_inst,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "statistics"))) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Error: could not lookup driver stats for socal%d\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Error: could not read driver stats for sf%d\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Error: could not read driver stats for socal%d\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) display_socal_stats(port, socal_path, &fc_stats);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) display_sf_stats(path_phys, dtype, &sf_stats);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } else if ((path_type & FC_FCA_MASK) == FC_PCI_FCA) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "\n WARNING!! display -r on qlc is"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " currently not supported.\n"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "\n WARNING!! display -r is not supported on path\n"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * adm_display_verbose_disk() Gets the mode page information
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * for a SENA disk and prints that information.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((err = l_get_mode_pg(path, &pg_buf, verbose)) == 0) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte mode_header_ptr = (struct mode_header_10_struct *)(int)pg_buf;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (uchar_t *)(uintptr_t)(mode_header_ptr->bdesc_length)));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "Mode Sense page 1 found.\n");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Mode Sense data:\n"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " AWRE:\t\t\t%d\n"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " ARRE:\t\t\t%d\n"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Read Retry Count:\t\t"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Write Retry Count:\t\t"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "Mode Sense page 4 found.\n");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Mode Sense data:\n"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Medium rotation rate:\t"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte offset += pg_hdr->length + sizeof (struct mode_page);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Print out the port_wwn or node_wwn
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " %1.2x%1.2x%1.2x%1.2x%1.2x%1.2x%1.2x%1.2x",
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Print out the fabric dev port_id, hard_addr, port_wwn and node_wwn
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteprint_fabric_prop(int pos, uchar_t *port_wwn, uchar_t *node_wwn, int port_addr,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Print out the private loop dev port_id, hard_addr, port_wwn and node_wwn
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteprint_private_loop_prop(int pos, uchar_t *port_wwn, uchar_t *node_wwn,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte pos, port_addr, g_sf_alpa_to_switch[port_addr], hard_addr);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Get the device map from
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * fc nexus driver and prints the map.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteuchar_t *hba_port_wwn, *port_wwn, *node_wwn, *dtype_prop;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((err = l_convert_name(argv[path_index], &path_phys,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Error: converting"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " %s to physical path.\n"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Invalid pathname.\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* obtain phci */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (err = g_get_pathlist(temp2path, &pathlist)) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (i = 0; i < pathcnt; i++) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* matching input pwwn */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } else if (pathlist.path_info[p_on].path_state ==
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* on_line path */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* standby or path0 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((dev_type = g_get_path_type(temp2path)) == 0) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * This did not work so try the FCIO_GETMAP
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * type ioctl.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "Host Adapter AL_PA: %x\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "Pos AL_PA\n"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (i = 0; i < (uint_t)limited_map.lilp_length; i++) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((map_dev = g_get_first_dev(map_root, &err)) == NULL) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Node WWN Type\n"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "Pos AL_PA ID Hard_Addr "
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "Port WWN Node WWN Type\n"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Gets a list of non-SENA fcal devices
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * found on the system.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * wwn_list pointer
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * NULL: No non-enclosure devices found.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * !NULL: Devices found
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * wwn_list points to a linked list of wwn's.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forten_get_non_encl_list(WWN_list **wwn_list_ptr, int verbose)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortechar phci_path[MAXPATHLEN], oldphci_path[MAXPATHLEN];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Only interested in devices that are not part of
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * a Photon enclosure.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((err = l_get_box_list(&b_list, verbose)) != 0) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (strstr(b_list->b_physical_path, SCSI_VHCI) != NULL) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) strcpy(phci_path, b_list->b_physical_path);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (err = g_get_pathlist(phci_path, &pathlist)) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (k = 0; k < pathcnt; k++) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (strstr(b_list->b_physical_path, SCSI_VHCI) == NULL) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((err = g_get_dev_map(b_list->b_physical_path,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* This function has been added */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* here only to keep from having */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* to tab over farther */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Return the list */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Return the list */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * n_rem_list_entry() We found an IB so remove disks that
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * are in the Photon from the individual device list.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * wwn_list - removes the fcal disks that are in SENA enclosure
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forten_rem_list_entry(uchar_t box_id, struct gfc_map *map,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " with box_id=0x%x from device list.\n", box_id);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (k = 0, dev_addr_list = map->dev_addr; k < map->count;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((g_sf_alpa_to_switch[dev_addr_list->gfc_port_dev.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * n_rem_list_entry_fabric() We found an IB so remove disks that
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * are in the Photon from the individual device list.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * wwn_list - removes the fcal disks that are in SENA enclosure
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forten_rem_list_entry_fabric(int pa, struct gfc_map *map,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " with the same domain and area ID as"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (k = 0, dev_addr_ptr = map->dev_addr; k < map->count;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* matching the domain and area id with input alpa, */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* ignoring last 8 bits. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((dev_addr_ptr->gfc_port_dev.pub_port.dev_did.port_id |
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * n_rem_wwn_entry() removes input wwn from wwn_list.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * wwn_list - removes the input wwn from wwn_list if found.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forten_rem_wwn_entry(uchar_t node_wwn[], struct wwn_list_struct **wwn_list)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Remove this entry from the list */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "Removing Logical=%s "
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "Current=0x%x, "
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "Prev=0x%x, Next=0x%x\n",
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "No non-Photon "
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "devices left"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " in the list.\n");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * non_encl_probe() Finds and displays a list of
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * non-SENA fcal devices which is found on the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortechar lun_a[MAXPATHLEN], lun_b[MAXPATHLEN], temppath[MAXPATHLEN];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (err = n_get_non_encl_list(&wwn_list, (Options & PVERBOSE))) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte MSGSTR(2098, "\nFound Fibre Channel device(s):\n"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte MSGSTR(2099, "\nFound Fibre Channel device:\n"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (strstr(wwn_list->physical_path, SCSI_VHCI) != NULL) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) strcpy(temppath, wwn_list->physical_path);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) fprintf(stdout, "%s ", wwn_list->node_wwn_s);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) fprintf(stdout, MSGSTR(35, "Device Type:"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "Type:Reserved"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "Type:Unknown"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) fprintf(stdout, MSGSTR(31, "Logical Path:%s"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) fprintf(stdout, "\n %s\n", wwn_list->physical_path);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (strcmp(inner->node_wwn_s, wwn_list->node_wwn_s) == 0) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (((tempptra == NULL) || (strcmp(lun_a, lun_b)) == 0)) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Have we retrieved a snapshot yet?
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "\nFailed to get device tree snapshot:\n"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Apply devid to ssd devices only */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (!retr_outer && strstr(wwn_list->physical_path,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Try retrieve of devid only once. If it fails
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * don't try it again but print error,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * There should be a devid prop.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Apply devid to block devices only.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Get devid of inner path and compare
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * with outer path's devid.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* devid isn't applied */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "Physical Path:"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Remove this entry from the list */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } /* End if (compare_result == 0) */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } /* End while (wwn_list != NULL) */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((err = l_get_box_list(&b_list, Options & PVERBOSE)) != 0) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "Found Enclosure(s)"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) fprintf(stdout, MSGSTR(2103, "Found Enclosure"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Don't re-print multiple paths */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Print logical path on same line if not multipathed.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Check for duplicate names */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (l_duplicate_names(o_list, b_list->b_node_wwn_s,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte MSGSTR(2105, "\nWARNING: There are enclosures with "
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "the same names.\n"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "You can not use the \"enclosure\""
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " name to specify these subsystems.\n"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "Please use the \"enclosure_name\""
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " subcommand to select unique names.\n\n"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * display_port_status() Prints the device's
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * port status.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) fprintf(stdout, MSGSTR(28, "Open Failed"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) fprintf(stdout, MSGSTR(88, "Not Readable"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) fprintf(stdout, MSGSTR(70, "SCSI Error"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) fprintf(stdout, MSGSTR(73, "Reservation conflict"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) fprintf(stdout, MSGSTR(92, "No UNIX Label"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Displays individual SENA
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * FC disk information.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Caller to this routine should free the storage due to
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * the use of g_get_dev_map
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortedisplay_fc_disk(struct path_struct *path_struct, char *ses_path,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortechar same_path_phys = B_FALSE; /* To chk for repeat args */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Do a quick check to see if its the same path as in last call.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * path_phys is a static array and so dont worry about its
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * initialization.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (strcmp(path_phys, path_struct->p_physical_path) == 0)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) strcpy(path_phys, path_struct->p_physical_path);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) memset((char *)logical_path, 0, sizeof (logical_path));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * slot_valid is 1 when argument is of the form 'enclosure,[f|r]<n>'.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * If slot_valid != 1, g_get_dev_map and l_get_ses_path would
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * already have been called
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Get the location information. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (err = g_get_dev_map(path_phys, map, (Options & PVERBOSE))) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (err = l_get_ses_path(path_phys, ses_path, map,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Get the WWN for our disk if we already haven't or if there was an
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * error earlier
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (err = g_get_wwn(path_phys, port_wwn, node_wwn,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * We are interested only a couple of ib_tbl fields and
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * those get filled using l_get_ib_status.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Note that NOT ALL of ib_tbl fields get filled here
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Get path to all the FC disk and tape devices.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * if we haven't already done so in a previous pass
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((wwn_list == NULL) && (err = g_get_wwn_list(&wwn_list, verbose))) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Get the disk status if it is a different path_phys from
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * last time.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte sizeof (struct l_disk_state_struct));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (err = l_get_disk_status(path_phys, &l_disk_state,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (l_disk_state.l_state_flag & L_NO_PATH_FOUND) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "\nWARNING: No path found "
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "in /dev/rdsk directory\n"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Please check the logical links in /dev/rdsk\n"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " (It may be necessary to run the \"disks\" "
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "program.)\n\n"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Just call to get the status directly. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (err = l_get_port(ses_path, &port_a_flag, verbose)) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (strlen(l_disk_state.g_disk_state.node_wwn_s) == 0) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) sprintf(l_disk_state.g_disk_state.node_wwn_s,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "%1.2x%1.2x%1.2x%1.2x%1.2x%1.2x%1.2x%1.2x",
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte node_wwn[0], node_wwn[1], node_wwn[2], node_wwn[3],
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte node_wwn[4], node_wwn[5], node_wwn[6], node_wwn[7]);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* get mode page information for FC device */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (l_get_mode_pg(path_phys, &pg_buf, Options & PVERBOSE) == 0) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte mode_header_ptr = (struct mode_header_10_struct *)(int)pg_buf;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (uchar_t *)(uintptr_t)(mode_header_ptr->bdesc_length)));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte offset += pg_hdr->length + sizeof (struct mode_page);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, MSGSTR(121, "DEVICE PROPERTIES for disk: %s\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, MSGSTR(2249, "DEVICE PROPERTIES for tape: %s\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, MSGSTR(2250, "DEVICE PROPERTIES for: %s\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) fprintf(stdout, MSGSTR(141, "Status(Port A):"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte l_disk_state.g_disk_state.d_state_flags[PORT_A]);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (l_state.drv_front[path_struct->slot].ib_status.bypass_a_en)) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Status(Port A):\tBYPASSED\n"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (l_state.drv_rear[path_struct->slot].ib_status.bypass_a_en)) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Status(Port A):\tBYPASSED\n"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) fprintf(stdout, MSGSTR(142, "Status(Port B):"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte display_port_status(l_disk_state.g_disk_state.d_state_flags[PORT_B]);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (l_state.drv_front[path_struct->slot].ib_status.bypass_b_en)) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Status(Port B):\tBYPASSED\n"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (l_state.drv_rear[path_struct->slot].ib_status.bypass_b_en)) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Status(Port B):\tBYPASSED\n"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) fprintf(stdout, MSGSTR(142, "Status(Port B):"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) fprintf(stdout, MSGSTR(141, "Status(Port A):"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte l_disk_state.g_disk_state.d_state_flags[port_a_flag]);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } else if ((!l_disk_state.g_disk_state.port_a_valid) &&
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) fprintf(stdout, MSGSTR(2107, " Status:\t\t"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "No state available.\n"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) display_disk_info(inq, l_disk_state, path_struct, pg_hdr,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte mode_data_avail, (char *)local_inq.inq_box_name, verbose);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * non_encl_fc_disk_display() Prints the device specific
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * information for an individual fcal device.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortenon_encl_fc_disk_display(Path_struct *path_struct,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteuchar_t node_wwn[WWN_SIZE], port_wwn[WWN_SIZE], *pg_buf = NULL;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint i = 0, al_pa, offset, mode_data_avail = 0, err = 0;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint path_a_found = 0, path_b_found = 0, argpwwn = 0,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortechar temppath[MAXPATHLEN], last_logical_path[MAXPATHLEN];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) strcpy(phys_path, path_struct->p_physical_path);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Get path to all the FC disk and tape devices. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (wwn_list_ptr = wwn_list; wwn_list_ptr != NULL;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (wwn_list_ptr = list_start; wwn_list_ptr != NULL;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) strcpy(phys_path, wwn_list_ptr->physical_path);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } else if (argnwwn) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) strcpy(phys_path, wwn_list_ptr->physical_path);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) memset(&l_disk_state, 0, sizeof (struct l_disk_state_struct));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte mlist = l_disk_state.g_disk_state.multipath_list;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte N_DPRINTF(" non_encl_fc_disk_display: Error finding"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " multiple paths to the disk.\n");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return (-1);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* get mode page information for FC device */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (l_get_mode_pg(phys_path, &pg_buf, verbose) == 0) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte mode_header_ptr = (struct mode_header_10_struct *)(int)pg_buf;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (uchar_t *)(uintptr_t)(mode_header_ptr->bdesc_length)));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte offset += pg_hdr->length + sizeof (struct mode_page);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, MSGSTR(121, "DEVICE PROPERTIES for disk: %s\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, MSGSTR(2249, "DEVICE PROPERTIES for tape: %s\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, MSGSTR(2250, "DEVICE PROPERTIES for: %s\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte while ((mlist != NULL) && (!(path_a_found && path_b_found))) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (err = g_get_inquiry(phys_path, &local_inq)) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "non_encl_fc_disk_display: Inquiry failed\n"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return (-1);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((err = g_get_wwn(mlist->dev_path, port_wwn, node_wwn,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return (-1);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (strlen(l_disk_state.g_disk_state.node_wwn_s) == 0) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) sprintf(l_disk_state.g_disk_state.node_wwn_s,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "%1.2x%1.2x%1.2x%1.2x%1.2x%1.2x%1.2x%1.2x",
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte node_wwn[0], node_wwn[1], node_wwn[2], node_wwn[3],
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte node_wwn[4], node_wwn[5], node_wwn[6], node_wwn[7]);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((err = l_get_disk_port_status(phys_path, &l_disk_state,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) sprintf(l_disk_state.g_disk_state.port_a_wwn_s,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "%1.2x%1.2x%1.2x%1.2x%1.2x%1.2x%1.2x%1.2x",
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte port_wwn[0], port_wwn[1], port_wwn[2], port_wwn[3],
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte port_wwn[4], port_wwn[5], port_wwn[6], port_wwn[7]);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte path_a_found = l_disk_state.g_disk_state.port_a_valid = 1;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte path_b_found = l_disk_state.g_disk_state.port_b_valid = 1;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) sprintf(l_disk_state.g_disk_state.port_b_wwn_s,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "%1.2x%1.2x%1.2x%1.2x%1.2x%1.2x%1.2x%1.2x",
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte port_wwn[0], port_wwn[1], port_wwn[2], port_wwn[3],
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte port_wwn[4], port_wwn[5], port_wwn[6], port_wwn[7]);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((strstr(mlist->dev_path, SCSI_VHCI) != NULL) &&
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (!l_get_disk_port_status(phys_path, &l_disk_state,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (i = 0; i < pathcnt; i++) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) fprintf(stdout, MSGSTR(141, "Status(Port A):"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte display_port_status(l_disk_state.g_disk_state.d_state_flags[FC_PORT_A]);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) fprintf(stdout, MSGSTR(142, "Status(Port B):"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte display_port_status(l_disk_state.g_disk_state.d_state_flags[FC_PORT_B]);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) display_disk_info(local_inq, l_disk_state, path_struct,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) g_free_multipath(l_disk_state.g_disk_state.multipath_list);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * display_disk_info() Prints the device specific information
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * for any FC_AL disk device.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortedisplay_disk_info(L_inquiry inq, L_disk_state l_disk_state,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte Path_struct *path_struct, struct mode_page *pg_hdr,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int mode_data_avail, char *name_buf, int options)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte err = g_get_serial_number(path_struct->p_physical_path,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte print_errString(err, path_struct->p_physical_path);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte print_chars(inq.inq_vid, sizeof (inq.inq_vid), 0);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) fprintf(stdout, MSGSTR(2115, "\n Product ID:\t\t"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte print_chars(inq.inq_pid, sizeof (inq.inq_pid), 0);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) fprintf(stdout, MSGSTR(2116, "\n WWN(Node):\t\t%s"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) fprintf(stdout, MSGSTR(2117, "\n WWN(Port A):\t\t%s"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) fprintf(stdout, MSGSTR(2118, "\n WWN(Port B):\t\t%s"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) fprintf(stdout, MSGSTR(2119, "Revision:"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte print_chars(inq.inq_revision, sizeof (inq.inq_revision), 0);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) fprintf(stdout, MSGSTR(17, "Serial Num:"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "Unformatted capacity:\t%6.3f MBytes"), num_blks);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (l_disk_state.g_disk_state.persistent_reserv_flag) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (l_disk_state.g_disk_state.persistent_active) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (l_disk_state.g_disk_state.persistent_registered) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((mode_data_avail) && (pg_hdr->code == MODEPAGE_CACHING)) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Write Cache:\t\t"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "Enabled\n"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Read Cache:\t\t"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "Enabled\n"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Minimum prefetch:"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Maximum prefetch:"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "\t0x%x\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * When /dev/rdsk/cxtxdxsx form of input is specified
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * for display command the initial library version didn't
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * display Location information. The change is made
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * to display the same Location info as the non-library version.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * We have to do another inquiry on the enclosure (name_buf)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * to determine if this device is within a daktari, or
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * a two sided device.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* If either of the above fail, we just assume the default */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "In slot %d in the enclosure named: %s\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "In slot %d in the enclosure named: %s\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } else { /* Default enclosure type */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "In slot %d in the Front of the enclosure named: %s\n")
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "In slot %d in the Rear of the enclosure named: %s\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "In the enclosure named: %s\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte mlist = l_disk_state.g_disk_state.multipath_list;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) fprintf(stdout, MSGSTR(2128, " Path(s):\n"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (strstr(mlist->dev_path, SCSI_VHCI) != NULL) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Only bother if the state is O.K. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (l_disk_state.g_disk_state.d_state_flags[port_a] == 0))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte adm_display_verbose_disk(path_struct->p_physical_path, options);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte else if ((l_disk_state.g_disk_state.port_b_valid) &&
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (l_disk_state.g_disk_state.d_state_flags[port_b] == 0))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte adm_display_verbose_disk(path_struct->p_physical_path, options);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * temp_decode() Display temperature bytes 1-3 state.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ": FAILURE - Over Temperature"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ": FAILURE - Under Temperature"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ": WARNING - Over Temperature"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ": WARNING - Under Temperature"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * disp_degree() Display temperature in Degrees Celsius.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * NL_Comment
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The %c is the degree symbol.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * trans_decode() Display tranceivers state.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "Disabled"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ": Not receiving a signal"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ": Laser failed"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * trans_messages() Display tranceiver status.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * NOTE: The decoding of the status assumes that the elements
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * are in order with the first two elements are for the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * "A" IB. It also assumes the tranceivers are numbered
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetrans_messages(struct l_state_struct *l_state, int ib_a_flag)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Get and print messages */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (i = 0; i < (int)l_state->ib_tbl.config.enc_num_elem; i++) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (l_state->ib_tbl.config.type_hdr[i].type == ELM_TYP_FL) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (l_state->ib_tbl.config.type_hdr[i].text_len != 0) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (j = 0; j <
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (int)l_state->ib_tbl.config.type_hdr[i].num; j++) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Only display the status for the selected IB.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) bcopy((const void *)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (k == 0) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Calculate the index to each element.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte elem_index += l_state->ib_tbl.config.type_hdr[i].num;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * temperature_messages() Display temperature status.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetemperature_messages(struct l_state_struct *l_state, int rear_flag)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Get and print messages */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (i = 0; i < (int)l_state->ib_tbl.config.enc_num_elem; i++) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (l_state->ib_tbl.config.type_hdr[i].type == ELM_TYP_TS) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte rear_flag = 1; /* only do front or rear backplane */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (l_state->ib_tbl.config.type_hdr[i].text_len != 0) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Check global status and if not all O.K.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * then print individually.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) bcopy((const void *)&l_state->ib_tbl.p2_s.element[i],
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (j = 0; j <
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (int)l_state->ib_tbl.config.type_hdr[i].num; j++) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) bcopy((const void *)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "NORMAL.)"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte elem_index += l_state->ib_tbl.config.type_hdr[i].num;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ib_decode() Display IB byte 3 state.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " - IB Over Temperature Alert "));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " - IB Loop 1 has failed "));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " - IB Loop 0 has failed "));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * mb_messages() Display motherboard
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * (interconnect assembly) messages.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortemb_messages(struct l_state_struct *l_state, int index, int elem_index)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (l_state->ib_tbl.config.type_hdr[index].text_len != 0) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (j = 0; j < (int)l_state->ib_tbl.config.type_hdr[index].num;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) bcopy((const void *)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } else if (interconnect.code == S_NOT_INSTALLED) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "Critical Failure: EEPROM failure"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "Critical Failure: Unknown failure"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "Non-Critical Failure: EEPROM failure"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "Non-Critical Failure: Unknown failure"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } else if (interconnect.code == S_NOT_AVAILABLE) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * back_plane_messages() Display back_plane messages
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * including the temperature's.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteback_plane_messages(struct l_state_struct *l_state, int index, int elem_index)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (l_state->ib_tbl.config.type_hdr[index].text_len != 0) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (j = 0; j < (int)l_state->ib_tbl.config.type_hdr[index].num;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) bcopy((const void *)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (j == 0) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) l_element_msg_string(bp.code, status_string);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } else if ((bp.byp_b_enabled || bp.en_bypass_b) &&
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* This case covers where a and b are bypassed */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * dpm_SSC100_messages() Display SSC100 messages
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * including the temperature's.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortedpm_SSC100_messages(struct l_state_struct *l_state, int index, int elem_index)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (l_state->ib_tbl.config.type_hdr[index].text_len != 0) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (j = 0; j < (int)l_state->ib_tbl.config.type_hdr[index].num;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) bcopy((const void *)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) fprintf(stdout, MSGSTR(2246, " SSC100 #%d: "), j);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) l_element_msg_string(bp.code, status_string);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } else if ((bp.byp_b_enabled || bp.en_bypass_b) &&
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* This case covers where a and b are bypassed */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * loop_messages() Display loop messages.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteloop_messages(struct l_state_struct *l_state, int index, int elem_index)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (l_state->ib_tbl.config.type_hdr[index].text_len != 0) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (j = 0; j < (int)l_state->ib_tbl.config.type_hdr[index].num;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) bcopy((const void *)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (j == 0) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "Loop A is configured as two separate loops."));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "Loop A is configured as a single loop."));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "Loop B is configured as two separate loops."));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "Loop B is configured as a single loop."));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ctlr_messages() Display ESI Controller status.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortectlr_messages(struct l_state_struct *l_state, int index, int elem_index)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (l_state->ib_tbl.config.type_hdr[index].text_len != 0) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (j = 0; j < (int)l_state->ib_tbl.config.type_hdr[index].num;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) bcopy((const void *)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (j == 0) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* If any byte 3 bits set display */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Display Version message */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Display the tranciver module state for this
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * fan_decode() Display Fans bytes 1-3 state.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ":Yellow LED is on"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ":Fan stopped"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ":Fan speed Low"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ":Fan speed Hi"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * fan_messages() Display Fan status.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortefan_messages(struct l_state_struct *l_state, int hdr_index, int elem_index)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Get and print messages */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (l_state->ib_tbl.config.type_hdr[hdr_index].text_len != 0) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (j = 0; j < (int)l_state->ib_tbl.config.type_hdr[hdr_index].num;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) bcopy((const void *)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ps_decode() Display Power Supply bytes 1-3 state.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ": DC Voltage too high"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ": DC Voltage too low"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ": DC Current too high"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ": Temperature too high"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ": AC Failed"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ": DC Failed"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * revision_msg() Print the revision message from page 7.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forterevision_msg(struct l_state_struct *l_state, int index)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (strlen((const char *)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte l_state->ib_tbl.p7_s.element_desc[index].desc_string)) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte l_state->ib_tbl.p7_s.element_desc[index].desc_string);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ps_messages() Display Power Supply status.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteps_messages(struct l_state_struct *l_state, int index, int elem_index)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Get and print Power Supply messages */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (l_state->ib_tbl.config.type_hdr[index].text_len != 0) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (j = 0; j < (int)l_state->ib_tbl.config.type_hdr[index].num;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) bcopy((const void *)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * abnormal_condition() Display any abnormal condition messages.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteabnormal_condition_display(struct l_state_struct *l_state)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "CRITICAL CONDITION DETECTED\n"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "WARNING: NON-CRITICAL CONDITION DETECTED\n"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "WARNING: Invalid Operation bit set.\n"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "\tThis means an Enclosure Control page"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " or an Array Control page with an invalid\n"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "\tformat has previously been transmitted to the"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Enclosure Services card by a\n\tSend Diagnostic"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " SCSI command.\n"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * adm_start() Spin up the given list
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * of SENA devices.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Error: converting"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " %s to physical path.\n"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Invalid pathname.\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte VERBPRINT(MSGSTR(101, "Issuing start to:\n %s\n"), *argv);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * adm_stop() Spin down a
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * given list of SENA devices.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Error: converting"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " %s to physical path.\n"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Invalid pathname.\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * scsi stop is not supported for tape drives.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The scsi unload op code for tape is the same as a
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * scsi stop for disk so this command will eject the tape.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * If an eject is the desired behavior then remove the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * following if block. ('mt offline' will give you
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * the same eject functionality).
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte VERBPRINT(MSGSTR(100, "Issuing stop to:\n %s\n"), *argv);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * On a SOC+ chip, the port is either put into (offline) or pulled out
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * of (online) a loopback mode since the laser cannot be turned on or off.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * As of this writing, this feature is yet to be supported by the ifp
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * driver on a QLogic card.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Command line args and flag - LUX_P_ONLINE or LUX_P_OFFLINE
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The path that is passed has to be the physical path to the port.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * For example :
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * /devices/sbus@2,0/SUNW,socal@2,0:0
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * /devices/io-unit@f,e0200000/sbi@0,0/SUNW,socal@2,0:0
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * /devices/pci@1f,4000/SUNW,ifp@2:devctl
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Error: converting"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " %s to physical path.\n"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Invalid pathname.\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Get the nexus path - need this to print messages */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((err = g_get_nexus_path(path_phys, &nexus_path_ptr)) != 0) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "Unknown action requested "
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "on port - %d\nIgnoring."),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Expert level subcommand 'luxadm -e port'
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * which displays all FC ports on a host and state information for
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * connectivity (CONNECTED or NOT CONNECTED) indicating whether there
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * are devices attached to the port.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Sample output for ifp:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * /devices/pci@1f,4000/SUNW,ifp@2:devctl CONNECTED
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * /devices/pci@1f,2000/SUNW,ifp@1:devctl NOT CONNECTED
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Sample output for socal:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * /devices/sbus@2,0/SUNW,socal@d,10000:0 CONNECTED
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * /devices/sbus@2,0/SUNW,socal@d,10000:1 NOT CONNECTED
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * /devices/sbus@2,0/SUNW,socal@2,0:0 NOT CONNECTED
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * /devices/sbus@2,0/SUNW,socal@2,0:1 CONNECTED
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Note: for socal the path returned is not a devctl path as there is no
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * devctl path for socal.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Sample output for fp:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * /devices/sbus@2,0/SUNW,qlc@5/fp@0,0:devctl CONNECTED
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * /devices/sbus@2,0/SUNW,qlc@4/fp@1,0:devctl CONNECTED
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * If another port driver needs to be searched, add it here
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Look for all HBA ports as listed in portdrvr_list[]
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (err = g_get_port_path(portdrvr_list[x], &portlist)) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * For each port path found get the connection state.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * If there are devices attached the state is considered connected.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) print_errString(err, portlist.physpath[x]);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "CONNECTED\n"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "NOT CONNECTED\n"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Expert level subcommand 'luxadm -e external_loopback <portpath>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * internal_loopback
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * no_loopback
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Does just what you would think. Sets port in designated loopback
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * INPUT: portpath - path to device on which to set loopback mode
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * flag - loopback mode to set. Values are:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * EXT_LOOPBACK
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * INT_LOOPBACK
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * NO_LOOPBACK
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * RETURN: 0 on success
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * non-zero on failure
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Error: converting"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " %s to physical path.\n"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " Invalid pathname.\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return (-1);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "Unknown action requested "
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "on port - %d\nIgnoring."),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return (-1);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((err = g_loopback_mode(path_phys, cmd)) != 0) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return (-1);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "External loopback mode set "
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "on:\n%s\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "Internal loopback mode set "
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "on:\n%s\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "Loopback mode unset "
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "on:\n%s\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * To print the pathlist and mpxio path attributes
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (i = 0; i < pathcnt; i++) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (pathlist.path_info[i].path_state < MAXPATHSTATE) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((ext_state & MDI_PATHINFO_STATE_USER_DISABLE)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " I/Os disabled on this %s path\n\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Free memory for per path info properties */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * compare_multipath
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * compares path with all paths in pathlist
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * If there is a match, 0 is returned, otherwise 1 is returned
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortecompare_multipath(char *path, struct mplist_struct *pathlist)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (strncmp(path, pathlist->devpath, MAXPATHLEN) == 0) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * lun_display() Prints the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * information for an individual lun.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortelun_display(Path_struct *path_struct, L_inquiry inq_struct, int verbose)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortechar phys_path[MAXPATHLEN], last_logical_path[MAXPATHLEN];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte mplistp = mpl = mpln = (struct mplist_struct *)NULL;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Get path to all the FC disk and tape devices.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * If there is no slash in the argument in this routine, we assume
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * it is a wwn argument.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((err = g_get_wwn_list(&wwn_list, verbose)) != 0) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (wwn_list_ptr = wwn_list; wwn_list_ptr != NULL;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (wwn_list_ptr = list_start; wwn_list_ptr != NULL;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) strcpy(phys_path, wwn_list_ptr->physical_path);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } else if (argnwwn) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) strcpy(phys_path, wwn_list_ptr->physical_path);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (compare_multipath(wwn_list_ptr->logical_path,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) memset(&l_disk_state, 0, sizeof (struct l_disk_state_struct));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Don't call g_get_multipath if this is a SCSI_VHCI device
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * dlist gets alloc'ed here to retain the free at the end
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte mlist = l_disk_state.g_disk_state.multipath_list;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " multiple paths to the disk.\n");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Search for match on physical path name */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (wwn_list_find = list_start; wwn_list_find != NULL;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (strncmp(wwn_list_find->physical_path, phys_path,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte strlen(wwn_list_find->logical_path) + 1)) == NULL) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte strncpy(dlist->logical_path, wwn_list_find->logical_path,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte strncpy(dlist->dev_path, phys_path, strlen(phys_path));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte l_disk_state.g_disk_state.multipath_list = dlist;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (mlist = l_disk_state.g_disk_state.multipath_list;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* add the path to the list for compare */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* get mode page information for FC device */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (l_get_mode_pg(phys_path, &pg_buf, verbose) == 0) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte mode_header_ptr = (struct mode_header_10_struct *)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte offset += pg_hdr->length + sizeof (struct mode_page);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, MSGSTR(121, "DEVICE PROPERTIES for disk: %s\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, MSGSTR(2249, "DEVICE PROPERTIES for tape: %s\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, MSGSTR(2250, "DEVICE PROPERTIES for: %s\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) display_lun_info(l_disk_state, path_struct, pg_hdr,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) g_free_multipath(l_disk_state.g_disk_state.multipath_list);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } /* End for wwn_list_ptr = list_start... */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * display_lun_info() Prints the device specific information
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * for a lun.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortedisplay_lun_info(L_disk_state l_disk_state, Path_struct *path_struct,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct mode_page *pg_hdr, int mode_data_avail, WWN_list
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (err = g_get_serial_number(phys_path, inq80.inq_serial,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * check to see if the peripheral qualifier is zero
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * if it is non-zero, we will return with an error.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stderr, MSGSTR(2254, "\n Error: Logical Unit "
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte print_chars(inq.inq_vid, sizeof (inq.inq_vid), 0);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, MSGSTR(2115, "\n Product ID:\t\t"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte print_chars(inq.inq_pid, sizeof (inq.inq_pid), 0);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte print_chars(inq.inq_revision, sizeof (inq.inq_revision), 0);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((inq.inq_dtype & DTYPE_MASK) == DTYPE_DIRECT) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((err = get_lun_capacity(phys_path, &cap_data)) != 0) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (cap_data.sc_capacity > 0 && cap_data.sc_lbasize > 0) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "Unformatted capacity:\t%6.3f MBytes"), lunMbytes);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((mode_data_avail) && (pg_hdr->code == MODEPAGE_CACHING)) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte pg8_buf = (struct my_mode_caching *)(void *)pg_hdr;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "Enabled\n"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "Enabled\n"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, MSGSTR(2124, " Minimum prefetch:"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "\t0x%x\n Maximum prefetch:\t0x%x\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, " %s\t\t%s\n", MSGSTR(35, "Device Type:"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((mlist = l_disk_state.g_disk_state.multipath_list) == NULL) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stderr, MSGSTR(2323, "Error: No paths found (%s)"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (strstr(mlist->dev_path, SCSI_VHCI) != NULL) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * first display user's requested path
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * This will avoid duplicate inquiries as well
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (mlist = l_disk_state.g_disk_state.multipath_list;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((strcmp(mlist->dev_path, path_struct->p_physical_path))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte display_path_info(mlist->dev_path, mlist->logical_path,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Now display rest of paths
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * skipping one already displayed
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (mlist = l_disk_state.g_disk_state.multipath_list;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((strcmp(mlist->dev_path, path_struct->p_physical_path))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (err = g_get_inquiry(mlist->dev_path, &inq)) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte display_path_info(mlist->dev_path, mlist->logical_path,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "\t\tTime = %lld millisec\n",
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * display_path_info() Prints the path specific information
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * for a lun.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Note: Only applies to ssd nodes currently
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortedisplay_path_info(char *devpath, char *logicalpath, WWN_list *wwn_list)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, " %s\t\t", MSGSTR(2321, "LUN path port WWN:"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Walk the wwn list passed in and print the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * port wwn matching the device path
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (wwn_list_walk = wwn_list; wwn_list_walk != NULL;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (strcmp(wwn_list_walk->physical_path, devpath) == 0) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, "%s", wwn_list_walk->port_wwn_s);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * newline here in case port wwn not found
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (((cptr = strstr(drvr_path, SLSH_DRV_NAME_SSD)) != NULL) ||
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ((cptr = strstr(drvr_path, SLSH_DRV_NAME_ST)) != NULL)) {;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stderr, MSGSTR(2324, "Error: Incorrect path (%s)\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte MSGSTR(2322, "Host controller port WWN:"), wwns);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Determine path status
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((err = get_path_status(devpath, &status)) != 0) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, " %s\t\t", MSGSTR(2329, "Path status:"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Retrieves the lun capacity
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteget_lun_capacity(char *devpath, struct scsi_capacity_16 *cap_data)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((fd = g_object_open(devpath, O_RDONLY | O_NDELAY)) == -1) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) g_scsi_read_capacity_1016_cmd(fd, cap_data,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte sizeof (struct scsi_capacity_16));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Retrieves the reservation status
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((fd = g_object_open(devpath, O_RDONLY | O_NDELAY)) == -1) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Description:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Retrieves the port wwn associated with the hba node
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * hba_path: /devices/pci@8,600000/SUNW,qlc@4/fp@0,0
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * pwwn: ptr to a uchar_t array of size WWN_SIZE
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteget_host_controller_pwwn(char *hba_path, uchar_t *pwwn)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((path_type = g_get_path_type(hba_path)) == 0) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ifp nodes do not have a port-wwn prom property
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * so handle them via FC4 device map
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((err = get_FC4_host_controller_pwwn(hba_path, pwwn)) != 0) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* For Leadville path get the port wwn through g_get_host param. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * For Leadville path, get the port wwn through
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * g_get_host param. This is a general solution
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * to support 3rd party vendor Leadville FCA.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) strlcat(my_hba_path, hba_path, sizeof (my_hba_path));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) snprintf(my_hba_path, sizeof (my_hba_path), "%s%s",
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) memcpy(pwwn, &hba_port.dev_pwwn.raw_wwn[0],
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } else if ((path_type & FC_FCA_MASK) == FC_PCI_FCA) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Get port WWN through prom property
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) strlcat(my_hba_path, hba_path, sizeof (my_hba_path));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * sanity check for /devices mount point
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (strlen(my_hba_path) > (devlen = strlen("/devices"))) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Now strip off the trailing "/fp@"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((node = di_init(cptr, DINFOCPYALL)) == DI_NODE_NIL) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte di_ret = di_prop_lookup_bytes(DDI_DEV_T_ANY, node,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((ph = di_prom_init()) == DI_PROM_HANDLE_NIL) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte promprop = di_prom_prop_next(ph, node, promprop)) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Found port-wwn */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Description:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Retrieve pwwn via SFIOCGMAP
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteget_FC4_host_controller_pwwn(char *hba_path, uchar_t *pwwn)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) snprintf(my_hba_path, sizeof (my_hba_path), "%s%s",
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((fd = g_object_open(my_hba_path, O_NDELAY | O_RDONLY)) == -1) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) memcpy(pwwn, &sf_map.sf_hba_addr.sf_port_wwn[0], WWN_SIZE);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * from_ptr: ptr to uchar_t array of size WWN_SIZE
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * to_ptr: char ptr to string of size WWN_SIZE*2+1
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortecopy_wwn_data_to_str(char *to_ptr, const uchar_t *from_ptr)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte sprintf(to_ptr, "%1.2x%1.2x%1.2x%1.2x%1.2x%1.2x%1.2x%1.2x",
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte from_ptr[0], from_ptr[1], from_ptr[2], from_ptr[3],
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte from_ptr[4], from_ptr[5], from_ptr[6], from_ptr[7]);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Frees a previously allocated mplist_struct
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return (-1);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) fprintf(stdout, MSGSTR(2212, "Download file O.K. \n\n"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Print out private loop dev dtype
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteprint_private_loop_dtype_prop(uchar_t *hba_port_wwn, uchar_t *port_wwn,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (dtype_prop & DTYPE_MASK), dtype[(dtype_prop & DTYPE_MASK)]);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " 0x%-2x (Unknown Type"), (dtype_prop & DTYPE_MASK));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Check to see if this is the HBA */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (wwnConversion(hba_port_wwn) == wwnConversion(port_wwn)) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ",Host Bus Adapter)\n"));