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
c1fad183c9a0deeb49586645ec9baa8f3c1bc8beDaniel Beauregard/* Copyright 2010 QLogic Corporation */
f885d00f4e3c96a769ce0228a732da31ad9d0b78Daniel Beauregard * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
c1fad183c9a0deeb49586645ec9baa8f3c1bc8beDaniel Beauregard#pragma ident "Copyright 2010 QLogic Corporation; ql_ioctl.c"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ISP2xxx Solaris Fibre Channel Adapter (FCA) driver source file.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Fibre Channel Adapter (FCA) driver IOCTL source file.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ***********************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * * NOTICE **
c1fad183c9a0deeb49586645ec9baa8f3c1bc8beDaniel Beauregard * * COPYRIGHT (C) 1996-2010 QLOGIC CORPORATION **
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * * ALL RIGHTS RESERVED **
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ***********************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Local Function Prototypes.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic int ql_busy_notification(ql_adapter_state_t *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic int ql_idle_notification(ql_adapter_state_t *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic int ql_get_feature_bits(ql_adapter_state_t *ha, uint16_t *features);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic int ql_set_feature_bits(ql_adapter_state_t *ha, uint16_t features);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic int ql_set_nvram_adapter_defaults(ql_adapter_state_t *ha);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic void ql_load_nvram(ql_adapter_state_t *ha, uint8_t addr,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic int ql_24xx_load_nvram(ql_adapter_state_t *, uint32_t, uint32_t);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic int ql_adm_op(ql_adapter_state_t *, void *, int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic int ql_adm_adapter_info(ql_adapter_state_t *, ql_adm_op_t *, int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic int ql_adm_extended_logging(ql_adapter_state_t *, ql_adm_op_t *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic int ql_adm_device_list(ql_adapter_state_t *, ql_adm_op_t *, int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic int ql_adm_update_properties(ql_adapter_state_t *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic int ql_adm_prop_update_int(ql_adapter_state_t *, ql_adm_op_t *, int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic int ql_adm_loop_reset(ql_adapter_state_t *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic int ql_adm_fw_dump(ql_adapter_state_t *, ql_adm_op_t *, void *, int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic int ql_adm_nvram_dump(ql_adapter_state_t *, ql_adm_op_t *, int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic int ql_adm_nvram_load(ql_adapter_state_t *, ql_adm_op_t *, int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic int ql_adm_flash_load(ql_adapter_state_t *, ql_adm_op_t *, int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic int ql_adm_vpd_dump(ql_adapter_state_t *, ql_adm_op_t *, int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic int ql_adm_vpd_load(ql_adapter_state_t *, ql_adm_op_t *, int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic int ql_adm_vpd_gettag(ql_adapter_state_t *, ql_adm_op_t *, int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic int ql_adm_updfwmodule(ql_adapter_state_t *, ql_adm_op_t *, int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic uint8_t *ql_vpd_findtag(ql_adapter_state_t *, uint8_t *, int8_t *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* ************************************************************************ */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* cb_ops functions */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* ************************************************************************ */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * opens device
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * dev_p = device pointer
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * flags = open flags
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * otype = open type
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * cred_p = credentials pointer
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * 0 = success
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Kernel context.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* ARGSUSED */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteql_open(dev_t *dev_p, int flags, int otyp, cred_t *cred_p)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ha = ddi_get_soft_state(ql_state, (int32_t)getminor(*dev_p));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): started\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Allow only character opens */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): done\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * opens device
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * dev_p = device pointer
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * flags = open flags
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * otype = open type
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * cred_p = credentials pointer
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * 0 = success
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Kernel context.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* ARGSUSED */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteql_close(dev_t dev, int flags, int otyp, cred_t *cred_p)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ha = ddi_get_soft_state(ql_state, (int32_t)getminor(dev));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): started\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): done\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * control a character device
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * dev = device number
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * cmd = function to perform
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * arg = data type varies with request
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * mode = flags
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * cred_p = credentials pointer
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * rval_p = pointer to result value
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * 0 = success
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Kernel context.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* ARGSUSED */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteql_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *cred_p,
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard QL_PRINT_2(CE_CONT, "ql_ioctl: ddi_in_panic exit\n");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ha = ddi_get_soft_state(ql_state, (int32_t)getminor(dev));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): started\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Quick clean exit for qla2x00 foapi calls which are
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * not supported in qlc.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (cmd >= QL_FOAPI_START && cmd <= QL_FOAPI_END) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_9(CE_CONT, "failed, fo api not supported\n");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* PWR management busy. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte rval = ql_xioctl(ha, cmd, arg, mode, cred_p, rval_p);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (!rval && ddi_copyout((void *)&bits, (void *)arg,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* PWR management idle. */
f885d00f4e3c96a769ce0228a732da31ad9d0b78Daniel Beauregard * Don't show failures caused by pps polling for
f885d00f4e3c96a769ce0228a732da31ad9d0b78Daniel Beauregard * non-existant virtual ports.
f885d00f4e3c96a769ce0228a732da31ad9d0b78Daniel Beauregard EL(ha, "failed, cmd=%d rval=%d\n", cmd, rval);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_9(CE_CONT, "(%d): done\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ql_busy_notification
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Adapter busy notification.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ha = adapter state pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * FC_SUCCESS
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * FC_FAILURE
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Kernel context.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_9(CE_CONT, "(%d): started\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (pm_busy_component(ha->dip, 0) != DDI_SUCCESS) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte EL(ha, "pm_busy_component failed = %xh\n", FC_FAILURE);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (pm_raise_power(ha->dip, 0, 1) != DDI_SUCCESS) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_9(CE_CONT, "(%d): done\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ql_idle_notification
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Adapter idle notification.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ha = adapter state pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * FC_SUCCESS
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * FC_FAILURE
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Kernel context.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_9(CE_CONT, "(%d): started\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (pm_idle_component(ha->dip, 0) != DDI_SUCCESS) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte EL(ha, "pm_idle_component failed = %xh\n", FC_FAILURE);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_9(CE_CONT, "(%d): done\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Get adapter feature bits from NVRAM
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteql_get_feature_bits(ql_adapter_state_t *ha, uint16_t *features)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t offset = offsetof(nvram_t, adapter_features);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_9(CE_CONT, "(%d): started\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The offset can't be greater than max of 8 bits and
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * the following code breaks if the offset isn't at
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * 2 byte boundary.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte rval = ql_lock_nvram(ha, &start_addr, LNF_NVRAM_DATA);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Have the most significant 3 bits represent the read operation
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * followed by the 8 bits representing the offset at which we
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * are going to perform the read operation
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Select the chip and feed the command and address
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Deselect the chip
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_9(CE_CONT, "(%d): done\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Set adapter feature bits in NVRAM
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteql_set_feature_bits(ql_adapter_state_t *ha, uint16_t features)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_9(CE_CONT, "(%d): started\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte rval = ql_lock_nvram(ha, &start_addr, LNF_NVRAM_DATA);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Read off the whole NVRAM
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (count = 0; count < sizeof (nvram_t) / 2; count++) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *wptr = (uint16_t)ql_get_nvram_word(ha, count + start_addr);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * If the checksum is BAD then fail it right here.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte nv->adapter_features[0] = (uint8_t)((features & 0xFF00) >> 8);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte nv->adapter_features[1] = (uint8_t)(features & 0xFF);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Recompute the chesksum now
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (count = 0; count < sizeof (nvram_t) - 1; count++) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Now load the NVRAM
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (count = 0; count < sizeof (nvram_t) / 2; count++) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ql_load_nvram(ha, (uint8_t)(count + start_addr), *wptr++);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Read NVRAM and verify the contents
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (count = 0; count < sizeof (nvram_t) / 2; count++) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (ql_get_nvram_word(ha, count + start_addr) != *wptr) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_9(CE_CONT, "(%d): done\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Fix this function to update just feature bits and checksum in NVRAM
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteql_set_nvram_adapter_defaults(ql_adapter_state_t *ha)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_9(CE_CONT, "(%d): started\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte rval = ql_lock_nvram(ha, &start_addr, LNF_NVRAM_DATA);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Set default host adapter parameters
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * compute the chesksum now
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (count = 0; count < (sizeof (nvram_24xx_t)/4)-1; count++) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Now load the NVRAM
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (count = 0; count < sizeof (nvram_24xx_t) / 4; count++) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Read NVRAM and verify the contents
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (count = 0; count < sizeof (nvram_24xx_t) / 4; count++) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte rval = ql_24xx_read_flash(ha, count + start_addr,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Set default initialization control block.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte nv->firmware_options[0] = BIT_4 | BIT_3 | BIT_2 | BIT_1;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Set default host adapter parameters
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * compute the chesksum now
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (count = 0; count < sizeof (nvram_t) - 1; count++) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Now load the NVRAM
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (count = 0; count < sizeof (nvram_t) / 2; count++) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Read NVRAM and verify the contents
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (count = 0; count < sizeof (nvram_t) / 2; count++) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_9(CE_CONT, "(%d): done\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteql_load_nvram(ql_adapter_state_t *ha, uint8_t addr, uint16_t value)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Deselect the chip
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Erase Location
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Wait for Erase to Finish
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Write data now
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Wait for NVRAM to become ready
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Disable writes
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Deselect the chip now
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ql_24xx_load_nvram
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Enable NVRAM and writes a 32bit word to ISP24xx NVRAM.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ha: adapter state pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * addr: NVRAM address.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * value: data.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ql local function return status code.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Kernel context.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteql_24xx_load_nvram(ql_adapter_state_t *ha, uint32_t addr, uint32_t value)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Enable flash write. */
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard RD32_IO_REG(ha, ctrl_status) | ISP_FLASH_ENABLE);
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard RD32_IO_REG(ha, ctrl_status); /* PCI Posting. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Disable NVRAM write-protection. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) ql_24xx_write_flash(ha, NVRAM_CONF_ADDR | 0x101, 0);
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard if ((rval = ql_24xx_unprotect_flash(ha)) != QL_SUCCESS) {
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard EL(ha, "unprotect_flash failed, rval=%xh\n", rval);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Write to flash. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Enable NVRAM write-protection. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* TODO: Check if 0x8c is correct -- sb: 0x9c ? */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) ql_24xx_write_flash(ha, NVRAM_CONF_ADDR | 0x101, 0x8c);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Disable flash write. */
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard RD32_IO_REG(ha, ctrl_status) & ~ISP_FLASH_ENABLE);
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard RD32_IO_REG(ha, ctrl_status); /* PCI Posting. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ql_nv_util_load
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Loads NVRAM from application.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ha = adapter state pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * bp = user buffer address.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Kernel context.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteql_nv_util_load(ql_adapter_state_t *ha, void *bp, int mode)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_9(CE_CONT, "(%d): started\n", ha->instance);
c1fad183c9a0deeb49586645ec9baa8f3c1bc8beDaniel Beauregard if ((nv = kmem_zalloc(ha->nvram_cache->size, KM_SLEEP)) == NULL) {
c1fad183c9a0deeb49586645ec9baa8f3c1bc8beDaniel Beauregard if (ddi_copyin(bp, nv, ha->nvram_cache->size, mode) != 0) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* See if the buffer passed to us looks sane */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (nptr->id[0] != 'I' || nptr->id[1] != 'S' || nptr->id[2] != 'P' ||
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Quiesce I/O */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte rval = ql_lock_nvram(ha, &start_addr, LNF_NVRAM_DATA);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Load NVRAM. */
c1fad183c9a0deeb49586645ec9baa8f3c1bc8beDaniel Beauregard if ((rval = ql_r_m_w_flash(ha, bp, ha->nvram_cache->size,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte EL(ha, "nvram load failed, rval = %0xh\n", rval);
c1fad183c9a0deeb49586645ec9baa8f3c1bc8beDaniel Beauregard for (cnt = 0; cnt < ha->nvram_cache->size / 4; cnt++) {
c1fad183c9a0deeb49586645ec9baa8f3c1bc8beDaniel Beauregard for (cnt = 0; cnt < ha->nvram_cache->size / 2; cnt++) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ql_load_nvram(ha, (uint8_t)(cnt + start_addr), data);
c1fad183c9a0deeb49586645ec9baa8f3c1bc8beDaniel Beauregard /* switch to the new one */
c1fad183c9a0deeb49586645ec9baa8f3c1bc8beDaniel Beauregard kmem_free(ha->nvram_cache->cache, ha->nvram_cache->size);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_9(CE_CONT, "(%d): done\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ql_nv_util_dump
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Dumps NVRAM to application.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ha = adapter state pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * bp = user buffer address.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Kernel context.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteql_nv_util_dump(ql_adapter_state_t *ha, void *bp, int mode)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_9(CE_CONT, "(%d): started\n", ha->instance);
c1fad183c9a0deeb49586645ec9baa8f3c1bc8beDaniel Beauregard /* Quiesce I/O */
c1fad183c9a0deeb49586645ec9baa8f3c1bc8beDaniel Beauregard if (ql_stall_driver(ha, 0) != QL_SUCCESS) {
c1fad183c9a0deeb49586645ec9baa8f3c1bc8beDaniel Beauregard rval2 = ql_lock_nvram(ha, &start_addr, LNF_NVRAM_DATA);
c1fad183c9a0deeb49586645ec9baa8f3c1bc8beDaniel Beauregard EL(ha, "failed, ql_lock_nvram=%xh\n", rval2);
c1fad183c9a0deeb49586645ec9baa8f3c1bc8beDaniel Beauregard rval2 = ql_get_nvram(ha, ha->nvram_cache->cache,
c1fad183c9a0deeb49586645ec9baa8f3c1bc8beDaniel Beauregard EL(ha, "failed to dump nvram, rval=%x\n", rval);
c1fad183c9a0deeb49586645ec9baa8f3c1bc8beDaniel Beauregard if (ddi_copyout(ha->nvram_cache->cache, bp,
c1fad183c9a0deeb49586645ec9baa8f3c1bc8beDaniel Beauregard QL_PRINT_9(CE_CONT, "(%d): done\n", ha->instance);
c1fad183c9a0deeb49586645ec9baa8f3c1bc8beDaniel Beauregardql_get_nvram(ql_adapter_state_t *ha, void *dest_addr, uint32_t src_addr,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Dump NVRAM. */
c1fad183c9a0deeb49586645ec9baa8f3c1bc8beDaniel Beauregard rval = ql_24xx_read_flash(ha, src_addr++, lptr);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ql_vpd_load
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Loads VPD from application.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ha = adapter state pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * bp = user buffer address.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Kernel context.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteql_vpd_load(ql_adapter_state_t *ha, void *bp, int mode)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_9(CE_CONT, "(%d): started\n", ha->instance);
eb82ff87b34e625264561b2d267577cf9821dab0Daniel Beauregard if ((CFG_IST(ha, CFG_CTRL_24258081)) == 0) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((vpd = kmem_zalloc(vpd_size, KM_SLEEP)) == NULL) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Sanity check the user supplied data via checksum */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((vpdptr = ql_vpd_findtag(ha, vpd, "RV")) == NULL) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte EL(ha, "mismatched checksum, cal=%xh, passed=%xh\n",
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Quiesce I/O */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte rval = ql_lock_nvram(ha, &start_addr, LNF_VPD_DATA);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Load VPD. */
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard if ((rval = ql_r_m_w_flash(ha, bp, vpd_size, start_addr,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Update the vcache */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } else if ((ha->vcache == NULL) && ((ha->vcache =
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } else if (ddi_copyin(bp, ha->vcache, vpd_size, mode) != 0) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_9(CE_CONT, "(%d): done\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ql_vpd_dump
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Dumps VPD to application buffer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ha = adapter state pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * bp = user buffer address.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Kernel context.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteql_vpd_dump(ql_adapter_state_t *ha, void *bp, int mode)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_9(CE_CONT, "(%d): started\n", ha->instance);
eb82ff87b34e625264561b2d267577cf9821dab0Daniel Beauregard if ((CFG_IST(ha, CFG_CTRL_24258081)) == 0) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* copy back the vpd cache data */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (ddi_copyout(ha->vcache, bp, vpd_size, mode) != 0) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((vpd = kmem_zalloc(vpd_size, KM_SLEEP)) == NULL) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Quiesce I/O */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte rval = ql_lock_nvram(ha, &start_addr, LNF_VPD_DATA);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Dump VPD. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte rval = ql_24xx_read_flash(ha, start_addr++, lptr);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_9(CE_CONT, "(%d): done\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ql_vpd_findtag
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Search the passed vpd buffer for the requested VPD tag type.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ha = adapter state pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * vpdbuf = Pointer to start of the buffer to search
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * op = VPD opcode to find (must be NULL terminated).
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Pointer to the opcode in the buffer if opcode found.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * NULL if opcode is not found.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Kernel context.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteql_vpd_findtag(ql_adapter_state_t *ha, uint8_t *vpdbuf, int8_t *opcode)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_9(CE_CONT, "(%d): started\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* check for end of vpd */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* check opcode */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* found opcode requested */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Didn't find the opcode, so calculate start of
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * next tag. Depending on the current tag type,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * the length field can be 1 or 2 bytes
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (!(strncmp((char *)vpd, (char *)VPD_TAG_PRODID, 1))) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } else if (*vpd == VPD_TAG_LRT || *vpd == VPD_TAG_LRTC) {
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard QL_PRINT_9(CE_CONT, "(%d): done\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ql_vpd_lookup
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Return the VPD data for the request VPD tag
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ha = adapter state pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * opcode = VPD opcode to find (must be NULL terminated).
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * bp = Pointer to returned data buffer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * bplen = Length of returned data buffer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Length of data copied into returned data buffer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * >0 = VPD data field (NULL terminated)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * 0 = no data.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * -1 = Could not find opcode in vpd buffer / error.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Kernel context.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * NB: The opcode buffer and the bp buffer *could* be the same buffer!
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteql_vpd_lookup(ql_adapter_state_t *ha, uint8_t *opcode, uint8_t *bp,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_9(CE_CONT, "(%d): started\n", ha->instance);
eb82ff87b34e625264561b2d267577cf9821dab0Daniel Beauregard if ((CFG_IST(ha, CFG_CTRL_24258081)) == 0) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((vpdbuf = (uint8_t *)kmem_zalloc(QL_24XX_VPD_SIZE,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((ql_vpd_dump(ha, vpdbuf, (int)FKIOCTL)) != 0) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((vpd = ql_vpd_findtag(ha, vpdbuf, (int8_t *)opcode)) != NULL) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Found the tag
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (*opcode == VPD_TAG_END || *opcode == VPD_TAG_LRT ||
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * we found it, but the tag doesn't have a data
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * make sure that the vpd len doesn't exceed the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * make sure we don't exceed callers buffer space len
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* copy the data back */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) strncpy((int8_t *)bp, (int8_t *)(vpd+3), (int64_t)len);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* error -- couldn't find tag */
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard QL_PRINT_9(CE_CONT, "(%d): done\n", ha->instance);
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard * ql_r_m_w_flash
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard * Read modify write from user space to flash.
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard * ha: adapter state pointer.
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard * dp: source byte pointer.
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard * bc: byte count.
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard * faddr: flash byte address.
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard * mode: flags.
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard * ql local function return status code.
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard * Kernel context.
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregardql_r_m_w_flash(ql_adapter_state_t *ha, caddr_t dp, uint32_t bc, uint32_t faddr,
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard QL_PRINT_9(CE_CONT, "(%d): started, dp=%ph, faddr=%xh, bc=%xh\n",
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((bp = kmem_zalloc(bsize, KM_SLEEP)) == NULL) {
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard QL_PRINT_9(CE_CONT, "(%d): dp=%ph, saddr=%xh, bc=%xh, "
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard "ofst=%xh, xfer=%xh\n", ha->instance, (void *)dp, saddr,
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard /* Dump Flash sector. */
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard if ((rval = ql_dump_fcode(ha, bp, bsize, saddr)) !=
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Set new data. */
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard if ((rval = ddi_copyin(dp, (caddr_t)(bp + ofst), xfer,
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard EL(ha, "ddi_copyin status=%xh, dp=%ph, ofst=%xh, "
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard "xfer=%xh\n", rval, (void *)dp, ofst, xfer);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Write to flash. */
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard if ((rval = ql_load_fcode(ha, bp, bsize, saddr)) !=
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard QL_PRINT_9(CE_CONT, "(%d): done\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Performs qladm utility operations
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ha: adapter state pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * arg: driver_op_t structure pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * mode: flags.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Kernel context.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteql_adm_op(ql_adapter_state_t *ha, void *arg, int mode)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (ddi_copyin(arg, &dop, sizeof (ql_adm_op_t), mode) != 0) {
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard QL_PRINT_9(CE_CONT, "(%d): started, cmd=%xh, buffer=%llx,"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " length=%xh, option=%xh\n", ha->instance, dop.cmd, dop.buffer,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte EL(ha, "unsupported driver op cmd: %x\n", dop.cmd);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_9(CE_CONT, "(%d): done\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ql_adm_adapter_info
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Performs qladm QL_ADAPTER_INFO command
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ha: adapter state pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * dop: ql_adm_op_t structure pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * mode: flags.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Kernel context.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteql_adm_adapter_info(ql_adapter_state_t *ha, ql_adm_op_t *dop, int mode)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_9(CE_CONT, "(%d): started\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte !(CFG_IST(ha, CFG_CTRL_2200) && !ha->subven_id)) {
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard if ((rval = ql_setup_fcache(ha)) != QL_SUCCESS) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Resume I/O */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ql_awaken_task_daemon(ha, NULL, ISP_ABORT_NEEDED,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) sprintf(hba.fw_ver, "%d.%d.%d", ha->fw_major_version,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /*LINTED [Solaris DDI_DEV_T_ANY Lint warning]*/
16dd44c265271a75647fb0bb41109bb7c585a526Daniel Beauregard DDI_PROP_DONTPASS | DDI_PROP_CANSLEEP, "version", (caddr_t)&dp, &i);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte bcopy((void *)dp, (void *)hba.fcode_ver, length);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (ddi_copyout((void *)&hba, (void *)(uintptr_t)dop->buffer,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_9(CE_CONT, "(%d): done\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ql_adm_extended_logging
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Performs qladm QL_EXTENDED_LOGGING command
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ha: adapter state pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * dop: ql_adm_op_t structure pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Kernel context.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteql_adm_extended_logging(ql_adapter_state_t *ha, ql_adm_op_t *dop)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_9(CE_CONT, "(%d): started\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) sprintf(prop_name, "hba%d-extended-logging", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /*LINTED [Solaris DDI_DEV_T_NONE Lint warning]*/
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte rval = ddi_prop_update_int(DDI_DEV_T_NONE, ha->dip, prop_name,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_9(CE_CONT, "(%d): done\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ql_adm_loop_reset
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Performs qladm QL_LOOP_RESET command
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ha: adapter state pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Kernel context.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_9(CE_CONT, "(%d): started\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } else if ((rval = ql_full_login_lip(ha)) != QL_SUCCESS) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_9(CE_CONT, "(%d): done\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ql_adm_device_list
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Performs qladm QL_DEVICE_LIST command
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ha: adapter state pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * dop: ql_adm_op_t structure pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * mode: flags.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Kernel context.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteql_adm_device_list(ql_adapter_state_t *ha, ql_adm_op_t *dop, int mode)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_9(CE_CONT, "(%d): started\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Scan port list for requested target and fill in the values */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte index < DEVICE_HEAD_LIST_SIZE && link == NULL; index++) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* fill in the values */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (ddi_copyout((void *)&dev, (void *)(uintptr_t)dop->buffer,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_9(CE_CONT, "(%d): done\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ql_adm_update_properties
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Performs qladm QL_UPDATE_PROPERTIES command
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ha: adapter state pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Kernel context.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_9(CE_CONT, "(%d): started\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Stall driver instance. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Save init control blocks. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte bcopy(&ha->init_ctrl_blk, &init_ctrl_blk, sizeof (ql_comb_init_cb_t));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Update PCI configration. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Get configuration properties. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Check for init firmware required. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte sizeof (ql_comb_init_cb_t)) != 0 ||
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte sizeof (ql_comb_ip_init_cb_t)) != 0) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ha->task_daemon_flags |= LOOP_DOWN | ISP_ABORT_NEEDED;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Update AEN queue. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (ha->xioctl->flags & QL_AEN_TRACKING_ENABLE) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Restart driver instance. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_9(CE_CONT, "(%d): done\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ql_adm_prop_update_int
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Performs qladm QL_PROP_UPDATE_INT command
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ha: adapter state pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * dop: ql_adm_op_t structure pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * mode: flags.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Kernel context.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteql_adm_prop_update_int(ql_adapter_state_t *ha, ql_adm_op_t *dop, int mode)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_9(CE_CONT, "(%d): started\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (ddi_copyin((void *)(uintptr_t)dop->buffer, prop_name, dop->length,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /*LINTED [Solaris DDI_DEV_T_ANY Lint warning]*/
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((rval = ddi_prop_update_int(DDI_DEV_T_NONE, ha->dip, prop_name,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_9(CE_CONT, "(%d): done\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ql_adm_fw_dump
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Performs qladm QL_FW_DUMP command
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ha: adapter state pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * dop: ql_adm_op_t structure pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * udop: user space ql_adm_op_t structure pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * mode: flags.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Kernel context.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteql_adm_fw_dump(ql_adapter_state_t *ha, ql_adm_op_t *dop, void *udop, int mode)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_9(CE_CONT, "(%d): started\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte EL(ha, "failed, incorrect length=%xh, size=%xh\n",
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte dop->length = (uint32_t)ql_ascii_fw_dump(ha, dmp);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (ddi_copyout((void *)dmp, (void *)(uintptr_t)dop->buffer,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (ddi_copyout(dop, udop, sizeof (ql_adm_op_t), mode) != 0) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_9(CE_CONT, "(%d): done\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ql_adm_nvram_dump
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Performs qladm QL_NVRAM_DUMP command
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ha: adapter state pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * dop: ql_adm_op_t structure pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * mode: flags.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Kernel context.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteql_adm_nvram_dump(ql_adapter_state_t *ha, ql_adm_op_t *dop, int mode)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_9(CE_CONT, "(%d): started\n", ha->instance);
c1fad183c9a0deeb49586645ec9baa8f3c1bc8beDaniel Beauregard if (dop->length < ha->nvram_cache->size) {
c1fad183c9a0deeb49586645ec9baa8f3c1bc8beDaniel Beauregard EL(ha, "failed, length=%xh, size=%xh\n", dop->length,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((rval = ql_nv_util_dump(ha, (void *)(uintptr_t)dop->buffer,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_9(CE_CONT, "(%d): done\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ql_adm_nvram_load
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Performs qladm QL_NVRAM_LOAD command
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ha: adapter state pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * dop: ql_adm_op_t structure pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * mode: flags.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Kernel context.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteql_adm_nvram_load(ql_adapter_state_t *ha, ql_adm_op_t *dop, int mode)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_9(CE_CONT, "(%d): started\n", ha->instance);
c1fad183c9a0deeb49586645ec9baa8f3c1bc8beDaniel Beauregard if (dop->length < ha->nvram_cache->size) {
c1fad183c9a0deeb49586645ec9baa8f3c1bc8beDaniel Beauregard EL(ha, "failed, length=%xh, size=%xh\n", dop->length,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((rval = ql_nv_util_load(ha, (void *)(uintptr_t)dop->buffer,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_9(CE_CONT, "(%d): done\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ql_adm_flash_load
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Performs qladm QL_FLASH_LOAD command
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ha: adapter state pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * dop: ql_adm_op_t structure pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * mode: flags.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Kernel context.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteql_adm_flash_load(ql_adapter_state_t *ha, ql_adm_op_t *dop, int mode)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_9(CE_CONT, "(%d): started\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((dp = kmem_zalloc(dop->length, KM_SLEEP)) == NULL) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (ddi_copyin((void *)(uintptr_t)dop->buffer, dp, dop->length,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ql_24xx_load_flash(ha, dp, dop->length, dop->option) :
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_9(CE_CONT, "(%d): done\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ql_adm_vpd_dump
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Performs qladm QL_VPD_DUMP command
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ha: adapter state pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * dop: ql_adm_op_t structure pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * mode: flags.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Kernel context.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteql_adm_vpd_dump(ql_adapter_state_t *ha, ql_adm_op_t *dop, int mode)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_9(CE_CONT, "(%d): started\n", ha->instance);
eb82ff87b34e625264561b2d267577cf9821dab0Daniel Beauregard if ((CFG_IST(ha, CFG_CTRL_24258081)) == 0) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte EL(ha, "failed, length=%xh, size=%xh\n", dop->length,
16dd44c265271a75647fb0bb41109bb7c585a526Daniel Beauregard if ((rval = ql_vpd_dump(ha, (void *)(uintptr_t)dop->buffer, mode))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_9(CE_CONT, "(%d): done\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ql_adm_vpd_load
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Performs qladm QL_VPD_LOAD command
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ha: adapter state pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * dop: ql_adm_op_t structure pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * mode: flags.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Kernel context.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteql_adm_vpd_load(ql_adapter_state_t *ha, ql_adm_op_t *dop, int mode)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_9(CE_CONT, "(%d): started\n", ha->instance);
eb82ff87b34e625264561b2d267577cf9821dab0Daniel Beauregard if ((CFG_IST(ha, CFG_CTRL_24258081)) == 0) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte EL(ha, "failed, length=%xh, size=%xh\n", dop->length,
16dd44c265271a75647fb0bb41109bb7c585a526Daniel Beauregard if ((rval = ql_vpd_load(ha, (void *)(uintptr_t)dop->buffer, mode))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_9(CE_CONT, "(%d): done\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ql_adm_vpd_gettag
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Performs qladm QL_VPD_GETTAG command
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ha: adapter state pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * dop: ql_adm_op_t structure pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * mode: flags.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Kernel context.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteql_adm_vpd_gettag(ql_adapter_state_t *ha, ql_adm_op_t *dop, int mode)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_9(CE_CONT, "(%d): started\n", ha->instance);
eb82ff87b34e625264561b2d267577cf9821dab0Daniel Beauregard if ((CFG_IST(ha, CFG_CTRL_24258081)) == 0) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((lbuf = (uint8_t *)kmem_zalloc(dop->length, KM_SLEEP)) == NULL) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte EL(ha, "mem alloc failure of %xh bytes\n", dop->length);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (ddi_copyin((void *)(uintptr_t)dop->buffer, lbuf,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((rval = ql_vpd_lookup(ha, lbuf, lbuf, (int32_t)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (ddi_copyout(lbuf, (void *)(uintptr_t)dop->buffer,
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard QL_PRINT_9(CE_CONT, "(%d): done\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ql_adm_updfwmodule
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Performs qladm QL_UPD_FWMODULE command
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ha: adapter state pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * dop: ql_adm_op_t structure pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * mode: flags.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Kernel context.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* ARGSUSED */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteql_adm_updfwmodule(ql_adapter_state_t *ha, ql_adm_op_t *dop, int mode)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_9(CE_CONT, "(%d): started\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* zero the firmware module reference count */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (link = ql_hba.first; link != NULL; link = link->next) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* reload the f/w modules */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (link = ql_hba.first; link != NULL; link = link->next) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((fw_class == ha2->fw_class) && (ha2->fw_class == NULL)) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((rval = (int32_t)ql_fwmodule_resolve(ha2)) !=
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte EL(ha2, "isp abort needed (%d)\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ql_awaken_task_daemon(ha2, NULL, ISP_ABORT_NEEDED, 0);
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard QL_PRINT_9(CE_CONT, "(%d): done\n", ha->instance);