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_isr.c"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ISP2xxx Solaris Fibre Channel Adapter (FCA) driver 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.
16dd44c265271a75647fb0bb41109bb7c585a526Daniel Beauregardstatic void ql_handle_uncommon_risc_intr(ql_adapter_state_t *, uint32_t,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic void ql_spurious_intr(ql_adapter_state_t *, int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic void ql_mbx_completion(ql_adapter_state_t *, uint16_t, uint32_t *,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic void ql_async_event(ql_adapter_state_t *, uint32_t, ql_head_t *,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic void ql_response_pkt(ql_adapter_state_t *, ql_head_t *, uint32_t *,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic void ql_error_entry(ql_adapter_state_t *, response_t *, ql_head_t *,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic int ql_status_entry(ql_adapter_state_t *, sts_entry_t *, ql_head_t *,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic int ql_24xx_status_entry(ql_adapter_state_t *, sts_24xx_entry_t *,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic int ql_status_error(ql_adapter_state_t *, ql_srb_t *, sts_entry_t *,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic void ql_status_cont_entry(ql_adapter_state_t *, sts_cont_entry_t *,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic void ql_ip_entry(ql_adapter_state_t *, ip_entry_t *, ql_head_t *,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic void ql_ip_rcv_entry(ql_adapter_state_t *, ip_rcv_entry_t *,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic void ql_ip_rcv_cont_entry(ql_adapter_state_t *,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ip_rcv_cont_entry_t *, ql_head_t *, uint32_t *, uint32_t *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic void ql_ip_24xx_rcv_entry(ql_adapter_state_t *, ip_rcv_24xx_entry_t *,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic void ql_ms_entry(ql_adapter_state_t *, ms_entry_t *, ql_head_t *,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic void ql_report_id_entry(ql_adapter_state_t *, report_id_1_t *,
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregardstatic void ql_els_passthru_entry(ql_adapter_state_t *,
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard els_passthru_entry_rsp_t *, ql_head_t *, uint32_t *, uint32_t *);
a2b3ff35eb5d7a6132b779a25b318545dae47cefDaniel Beauregardstatic ql_srb_t *ql_verify_preprocessed_cmd(ql_adapter_state_t *, uint32_t *,
a2b3ff35eb5d7a6132b779a25b318545dae47cefDaniel Beauregardstatic void ql_signal_abort(ql_adapter_state_t *ha, uint32_t *set_flags);
f885d00f4e3c96a769ce0228a732da31ad9d0b78Daniel Beauregard * Spurious interrupt counter
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Process all INTX intr types.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * arg1: adapter state pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * DDI_INTR_CLAIMED or DDI_INTR_UNCLAIMED
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Interrupt or Kernel context, no mailbox commands allowed.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* ARGSUSED */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ql_isr_default
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Process unknown/unvectored intr types
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * arg1: adapter state pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * arg2: interrupt vector.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * DDI_INTR_CLAIMED or DDI_INTR_UNCLAIMED
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Interrupt or Kernel context, no mailbox commands allowed.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* ARGSUSED */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ql_isr_aif
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Process mailbox and I/O command completions.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * arg: adapter state pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * intvec: interrupt vector.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * DDI_INTR_CLAIMED or DDI_INTR_UNCLAIMED
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Interrupt or Kernel context, no mailbox commands allowed.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* ARGSUSED */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): started\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Looks like we are about to go down soon, exit early.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): power down exit\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Acquire interrupt lock. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Reset idle timer. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Special Fast Post 2200. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Release mailbox registers. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Get handle. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Validate handle. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Set completed status. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Set completion status */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } else if (mbx !=
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " handle=%xh\n",
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " handle pkt=%xh, "
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "isp_abort_needed"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Check for mailbox interrupt. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Release mailbox registers. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Get mailbox data. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } else if (++spurious_intr ==
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Process excessive
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * spurious intrrupts
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "interrupts, "
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "isp_abort_needed\n");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Clear RISC interrupt */
f885d00f4e3c96a769ce0228a732da31ad9d0b78Daniel Beauregard while (((stat = RD32_IO_REG(ha, risc2host)) & RH_RISC_INT) &&
f885d00f4e3c96a769ce0228a732da31ad9d0b78Daniel Beauregard (++ql_max_intr_loop_cnt < ql_max_intr_loop)) {
16dd44c265271a75647fb0bb41109bb7c585a526Daniel Beauregard /* Capture FW defined interrupt info */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Reset idle timer. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Release mailbox registers. */
eb82ff87b34e625264561b2d267577cf9821dab0Daniel Beauregard if ((CFG_IST(ha, CFG_CTRL_24258081)) == 0) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Sun FW, Release mailbox registers. */
eb82ff87b34e625264561b2d267577cf9821dab0Daniel Beauregard if ((CFG_IST(ha, CFG_CTRL_24258081)) == 0) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Sun FW, Release mailbox registers. */
eb82ff87b34e625264561b2d267577cf9821dab0Daniel Beauregard if ((CFG_IST(ha, CFG_CTRL_24258081)) == 0) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } else if (++spurious_intr ==
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Process excessive spurious intr. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "interrupts, isp_abort_needed\n");
f885d00f4e3c96a769ce0228a732da31ad9d0b78Daniel Beauregard "ring index same as before\n",
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Clear RISC interrupt */
eb82ff87b34e625264561b2d267577cf9821dab0Daniel Beauregard } else if (CFG_IST(ha, CFG_CTRL_242581)) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Process claimed interrupts during polls. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (rval == DDI_INTR_UNCLAIMED && ha->intr_claimed == B_TRUE) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Release interrupt lock. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): done\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): interrupt not claimed\n",
16dd44c265271a75647fb0bb41109bb7c585a526Daniel Beauregard * ql_handle_uncommon_risc_intr
16dd44c265271a75647fb0bb41109bb7c585a526Daniel Beauregard * Handle an uncommon RISC interrupt.
16dd44c265271a75647fb0bb41109bb7c585a526Daniel Beauregard * ha: adapter state pointer.
16dd44c265271a75647fb0bb41109bb7c585a526Daniel Beauregard * stat: interrupt status
16dd44c265271a75647fb0bb41109bb7c585a526Daniel Beauregard * Interrupt or Kernel context, no mailbox commands allowed.
16dd44c265271a75647fb0bb41109bb7c585a526Daniel Beauregardql_handle_uncommon_risc_intr(ql_adapter_state_t *ha, uint32_t stat,
16dd44c265271a75647fb0bb41109bb7c585a526Daniel Beauregard (hccr_reg & (BIT_15 | BIT_13 | BIT_11 | BIT_8))) {
16dd44c265271a75647fb0bb41109bb7c585a526Daniel Beauregard cmn_err(CE_WARN, "qlc(%d): isr, Internal Parity/"
16dd44c265271a75647fb0bb41109bb7c585a526Daniel Beauregard "Pause Error - hccr=%xh, stat=%xh, count=%d",
16dd44c265271a75647fb0bb41109bb7c585a526Daniel Beauregard EL(ha, "parity/pause error, isp_abort_needed\n");
16dd44c265271a75647fb0bb41109bb7c585a526Daniel Beauregard if (ql_binary_fw_dump(ha, FALSE) != QL_SUCCESS) {
16dd44c265271a75647fb0bb41109bb7c585a526Daniel Beauregard if (ha->parity_pause_errors < 0xffffffff) {
16dd44c265271a75647fb0bb41109bb7c585a526Daniel Beauregard /* Disable ISP interrupts. */
eb82ff87b34e625264561b2d267577cf9821dab0Daniel Beauregard CFG_IST(ha, CFG_CTRL_8021) ? ql_8021_disable_intrs(ha) :
16dd44c265271a75647fb0bb41109bb7c585a526Daniel Beauregard EL(ha, "UNKNOWN interrupt status=%xh, hccr=%xh\n",
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ql_spurious_intr
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Inform Solaris of spurious interrupts.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ha: adapter state pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * intr_clr: early interrupt clear
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Interrupt or Kernel context, no mailbox commands allowed.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteql_spurious_intr(ql_adapter_state_t *ha, int intr_clr)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Disable ISP interrupts. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Clear RISC interrupt */
eb82ff87b34e625264561b2d267577cf9821dab0Daniel Beauregard } else if (CFG_IST(ha, CFG_CTRL_242581)) {
eb82ff87b34e625264561b2d267577cf9821dab0Daniel Beauregard WRT32_IO_REG(ha, hccr, HC24_CLR_RISC_INT);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ddi_dev_report_fault(ha->dip, DDI_SERVICE_DEGRADED,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ql_mbx_completion
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Processes mailbox completions.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ha: adapter state pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * mb0: Mailbox 0 contents.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * set_flags: task daemon flags to set.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * reset_flags: task daemon flags to reset.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * intr_clr: early interrupt clear
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Interrupt context.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* ARGSUSED */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteql_mbx_completion(ql_adapter_state_t *ha, uint16_t mb0, uint32_t *set_flags,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): started\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Load return mailbox registers. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (cnt = 1; cnt < MAX_MBOX_COUNT && index != 0; cnt++) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Clear RISC interrupt. */
eb82ff87b34e625264561b2d267577cf9821dab0Daniel Beauregard } else if (CFG_IST(ha, CFG_CTRL_242581)) {
eb82ff87b34e625264561b2d267577cf9821dab0Daniel Beauregard WRT32_IO_REG(ha, hccr, HC24_CLR_RISC_INT);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ha->mailbox_flags = (uint8_t)(ha->mailbox_flags | MBX_INTERRUPT);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): done\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ql_async_event
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Processes asynchronous events.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ha: adapter state pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * mbx: Mailbox 0 register.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * done_q: head pointer to done queue.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * set_flags: task daemon flags to set.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * reset_flags: task daemon flags to reset.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * intr_clr: early interrupt clear
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Interrupt or Kernel context, no mailbox commands allowed.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteql_async_event(ql_adapter_state_t *ha, uint32_t mbx, ql_head_t *done_q,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t *set_flags, uint32_t *reset_flags, int intr_clr)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): started\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Setup to process fast completion. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte switch (mb[0]) {
eb82ff87b34e625264561b2d267577cf9821dab0Daniel Beauregard handle = SHORT_TO_LONG(RD16_IO_REG(ha, mailbox_out[1]),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte handle = CFG_IST(ha, CFG_CTRL_2200) ? SHORT_TO_LONG(
eb82ff87b34e625264561b2d267577cf9821dab0Daniel Beauregard SHORT_TO_LONG(MSW(mbx), RD16_IO_REG(ha, mailbox_out[2]));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Handle asynchronous event */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte switch (mb[0]) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_5(CE_CONT, "(%d): Fast post completion\n",
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Clear RISC interrupt */
eb82ff87b34e625264561b2d267577cf9821dab0Daniel Beauregard } else if (CFG_IST(ha, CFG_CTRL_242581)) {
eb82ff87b34e625264561b2d267577cf9821dab0Daniel Beauregard WRT32_IO_REG(ha, hccr, HC24_CLR_RISC_INT);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Get handle. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Validate handle. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Set completed status. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Set completion status */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Place block on done queue */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte EL(ha, "%xh Fast post, mbx1=%xh, mbx2=%xh, mbx3=%xh,"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte EL(ha, "%xh ISP System Error, isp_abort_needed\n mbx1=%xh, "
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "mbx2=%xh, mbx3=%xh, mbx4=%xh, mbx5=%xh, mbx6=%xh,\n "
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "mbx7=%xh, mbx8=%xh, mbx9=%xh, mbx10=%xh, mbx11=%xh, "
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte EL(ha, "%xh ISP System Error, isp_abort_needed\n mbx13=%xh, "
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "mbx14=%xh, mbx15=%xh, mbx16=%xh, mbx17=%xh, mbx18=%xh,\n"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "mbx19=%xh, mbx20=%xh, mbx21=%xh, mbx22=%xh, mbx23=%xh\n",
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte EL(ha, "%xh ISP System Error, mbx24=%xh, mbx25=%xh, "
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "mbx26=%xh,\n mbx27=%xh, mbx28=%xh, mbx29=%xh, "
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) ql_flash_errlog(ha, FLASH_ERRLOG_AEN_8002, mb[1],
4f8b8adc54496e548e2d73094de038a131d9cd45Daniel Beauregard if (CFG_IST(ha, CFG_CTRL_81XX) && mb[7] & SE_MPI_RISC) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case MBA_REQ_TRANSFER_ERR: /* Request Transfer Error */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) ql_flash_errlog(ha, FLASH_ERRLOG_AEN_8003,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case MBA_RSP_TRANSFER_ERR: /* Response Xfer Err */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) ql_flash_errlog(ha, FLASH_ERRLOG_AEN_8004,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case MBA_WAKEUP_THRES: /* Request Queue Wake-up */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case MBA_MENLO_ALERT: /* Menlo Alert Notification */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte EL(ha, "%xh Menlo Alert Notification received, mbx1=%xh,"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " mbx2=%xh, mbx3=%xh\n", mb[0], mb[1], mb[2], mb[3]);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case MBA_LIP_OCCURRED: /* Loop Initialization Procedure */
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard EL(ha, "%xh DCBX_STARTED received, mbx1=%xh, mbx2=%xh"
eb82ff87b34e625264561b2d267577cf9821dab0Daniel Beauregard "\n", mb[0], RD16_IO_REG(ha, mailbox_out[1]),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte FC_STATE_CHANGE | COMMAND_WAIT_NEEDED | LOOP_DOWN);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (ha->loop_down_timer == LOOP_DOWN_TIMER_OFF) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Update AEN queue. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (ha->xioctl->flags & QL_AEN_TRACKING_ENABLE) {
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard if (CFG_IST(ha, (CFG_CTRL_2300 | CFG_CTRL_6322 |
f885d00f4e3c96a769ce0228a732da31ad9d0b78Daniel Beauregard ha->iidma_rate = RD16_IO_REG(ha, mailbox_out[1]);
f885d00f4e3c96a769ce0228a732da31ad9d0b78Daniel Beauregard } else if (ha->iidma_rate == IIDMA_RATE_2GB) {
f885d00f4e3c96a769ce0228a732da31ad9d0b78Daniel Beauregard } else if (ha->iidma_rate == IIDMA_RATE_4GB) {
f885d00f4e3c96a769ce0228a732da31ad9d0b78Daniel Beauregard } else if (ha->iidma_rate == IIDMA_RATE_8GB) {
f885d00f4e3c96a769ce0228a732da31ad9d0b78Daniel Beauregard } else if (ha->iidma_rate == IIDMA_RATE_10GB) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (vha = ha; vha != NULL; vha = vha->vp_next) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte EL(ha, "%d GB %xh Loop Up received\n", index, mb[0]);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Update AEN queue. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (ha->xioctl->flags & QL_AEN_TRACKING_ENABLE) {
4f8b8adc54496e548e2d73094de038a131d9cd45Daniel Beauregard EL(ha, "%xh Loop Down received, mbx1=%xh, mbx2=%xh, mbx3=%xh, "
eb82ff87b34e625264561b2d267577cf9821dab0Daniel Beauregard "mbx4=%xh\n", mb[0], RD16_IO_REG(ha, mailbox_out[1]),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte FC_STATE_CHANGE | COMMAND_WAIT_NEEDED | LOOP_DOWN);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (ha->loop_down_timer == LOOP_DOWN_TIMER_OFF) {
eb82ff87b34e625264561b2d267577cf9821dab0Daniel Beauregard ha->sfp_stat = RD16_IO_REG(ha, mailbox_out[2]);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Update AEN queue. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (ha->xioctl->flags & QL_AEN_TRACKING_ENABLE) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Locate port state structure. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (vha = ha; vha != NULL; vha = vha->vp_next) {
eb82ff87b34e625264561b2d267577cf9821dab0Daniel Beauregard if (CFG_IST(ha, CFG_CTRL_8081) && mb[1] == 0xffff &&
eb82ff87b34e625264561b2d267577cf9821dab0Daniel Beauregard mb[2] == 7 && (MSB(mb[3]) == 0xe || MSB(mb[3]) == 0x1a ||
eb82ff87b34e625264561b2d267577cf9821dab0Daniel Beauregard MSB(mb[3]) == 0x1c || MSB(mb[3]) == 0x1d ||
eb82ff87b34e625264561b2d267577cf9821dab0Daniel Beauregard * received FLOGI reject
eb82ff87b34e625264561b2d267577cf9821dab0Daniel Beauregard * received FLOGO
eb82ff87b34e625264561b2d267577cf9821dab0Daniel Beauregard * FCF configuration changed
eb82ff87b34e625264561b2d267577cf9821dab0Daniel Beauregard * FIP Clear Virtual Link received
eb82ff87b34e625264561b2d267577cf9821dab0Daniel Beauregard if (!(ha->task_daemon_flags & LOOP_DOWN)) {
eb82ff87b34e625264561b2d267577cf9821dab0Daniel Beauregard ql_port_state(ha, FC_STATE_OFFLINE, FC_STATE_CHANGE |
eb82ff87b34e625264561b2d267577cf9821dab0Daniel Beauregard if (ha->loop_down_timer == LOOP_DOWN_TIMER_OFF) {
eb82ff87b34e625264561b2d267577cf9821dab0Daniel Beauregard ha->loop_down_timer = LOOP_DOWN_TIMER_START;
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard * In N port 2 N port topology the FW provides a port
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard * database entry at loop_id 0x7fe which we use to
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard * acquire the Ports WWPN.
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard ((FC_PORT_STATE_MASK(vha->state) != FC_STATE_OFFLINE ||
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard (mb[1] != 0xffff || mb[2] != 6 || mb[3] != 0))))) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "received, mbx1=%xh, mbx2=%xh, mbx3=%xh\n",
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte EL(ha, "%xh Port Database Update received, mbx1=%xh,"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Update AEN queue. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (ha->xioctl->flags & QL_AEN_TRACKING_ENABLE) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Locate port state structure. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (vha = ha; vha != NULL; vha = vha->vp_next) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte EL(ha, "%xh RSCN match adapter, mbx1=%xh, mbx2=%xh, "
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Update AEN queue. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (ha->xioctl->flags & QL_AEN_TRACKING_ENABLE) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case MBA_LIP_ERROR: /* Loop initialization errors. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte EL(ha, "%xh LIP error received, mbx1=%xh\n", mb[0],
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte EL(ha, "%xh IP packet/broadcast received, mbx1=%xh, "
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "mbx2=%xh, mbx3=%xh\n", mb[0], mb[1], mb[2], mb[3]);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Locate device queue. */
eb82ff87b34e625264561b2d267577cf9821dab0Daniel Beauregard cnt = (uint16_t)(CFG_IST(ha, CFG_CTRL_24258081) ?
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte CHAR_TO_SHORT(ha->ip_init_ctrl_blk.cb24.buf_size[0],
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte CHAR_TO_SHORT(ha->ip_init_ctrl_blk.cb.buf_size[0],
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (index = 10; index < ha->reg_off->mbox_cnt && index < cnt;
eb82ff87b34e625264561b2d267577cf9821dab0Daniel Beauregard mb[index] = RD16_IO_REG(ha, mailbox_out[index]);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte tq->ub_loop_id = (uint16_t)(mb[0] == MBA_IP_BROADCAST ?
eb82ff87b34e625264561b2d267577cf9821dab0Daniel Beauregard (CFG_IST(ha, CFG_CTRL_24258081) ? BROADCAST_24XX_HDL :
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "isp_abort_needed\n");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte EL(ha, "%xh IP low water mark / RCV buffer empty received\n",
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte EL(ha, "%xh IP HDR data split received\n", mb[0]);
4f8b8adc54496e548e2d73094de038a131d9cd45Daniel Beauregard EL(ha, "%xh error logging disabled received, "
eb82ff87b34e625264561b2d267577cf9821dab0Daniel Beauregard "mbx1=%xh\n", mb[0], RD16_IO_REG(ha, mailbox_out[1]));
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard /* case MBA_DCBX_COMPLETED: */
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard EL(ha, "%xh DCBX completed received\n", mb[0]);
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard EL(ha, "%xh Point to Point Mode received\n", mb[0]);
4f8b8adc54496e548e2d73094de038a131d9cd45Daniel Beauregard EL(ha, "%xh FCF configuration Error received, mbx1=%xh\n",
4f8b8adc54496e548e2d73094de038a131d9cd45Daniel Beauregard EL(ha, "%xh DCBX parameters changed received, mbx1=%xh\n",
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ql_response_pkt(ha, done_q, set_flags, reset_flags, intr_clr);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte EL(ha, "%xh Port Bypass Changed received, mbx1=%xh\n",
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Event generated when there is a transition on
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * port bypass of crystal+.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Mailbox 1: Bit 0 - External.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Bit 2 - Internal.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * When the bit is 0, the port is bypassed.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * For now we will generate a LIP for all cases.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte EL(ha, "%xh Receive Error received, mbx1=%xh, mbx2=%xh\n",
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte EL(ha, "%xh LS_RJT Response Sent ELS=%xh\n", mb[0],
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte EL(ha, "%xh firmware restart complete received mb1=%xh\n",
f885d00f4e3c96a769ce0228a732da31ad9d0b78Daniel Beauregard * MBA_IDC_COMPLETE & MBA_IDC_NOTIFICATION: We won't get another
f885d00f4e3c96a769ce0228a732da31ad9d0b78Daniel Beauregard * IDC async event until we ACK the current one.
f885d00f4e3c96a769ce0228a732da31ad9d0b78Daniel Beauregard ha->idc_mb[1] = RD16_IO_REG(ha, mailbox_out[1]);
f885d00f4e3c96a769ce0228a732da31ad9d0b78Daniel Beauregard ha->idc_mb[2] = RD16_IO_REG(ha, mailbox_out[2]);
f885d00f4e3c96a769ce0228a732da31ad9d0b78Daniel Beauregard ha->idc_mb[3] = RD16_IO_REG(ha, mailbox_out[3]);
f885d00f4e3c96a769ce0228a732da31ad9d0b78Daniel Beauregard ha->idc_mb[4] = RD16_IO_REG(ha, mailbox_out[4]);
f885d00f4e3c96a769ce0228a732da31ad9d0b78Daniel Beauregard ha->idc_mb[5] = RD16_IO_REG(ha, mailbox_out[5]);
f885d00f4e3c96a769ce0228a732da31ad9d0b78Daniel Beauregard ha->idc_mb[6] = RD16_IO_REG(ha, mailbox_out[6]);
f885d00f4e3c96a769ce0228a732da31ad9d0b78Daniel Beauregard ha->idc_mb[7] = RD16_IO_REG(ha, mailbox_out[7]);
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard EL(ha, "%xh Inter-driver communication complete received, "
eb82ff87b34e625264561b2d267577cf9821dab0Daniel Beauregard " mbx1=%xh, mbx2=%xh, mbx3=%xh, mbx4=%xh, mbx5=%xh,"
f885d00f4e3c96a769ce0228a732da31ad9d0b78Daniel Beauregard " mbx6=%xh, mbx7=%xh\n", mb[0], ha->idc_mb[1],
f885d00f4e3c96a769ce0228a732da31ad9d0b78Daniel Beauregard ha->idc_mb[2], ha->idc_mb[3], ha->idc_mb[4], ha->idc_mb[5],
eb82ff87b34e625264561b2d267577cf9821dab0Daniel Beauregard ha->idc_mb[1] = RD16_IO_REG(ha, mailbox_out[1]);
eb82ff87b34e625264561b2d267577cf9821dab0Daniel Beauregard ha->idc_mb[2] = RD16_IO_REG(ha, mailbox_out[2]);
eb82ff87b34e625264561b2d267577cf9821dab0Daniel Beauregard ha->idc_mb[3] = RD16_IO_REG(ha, mailbox_out[3]);
eb82ff87b34e625264561b2d267577cf9821dab0Daniel Beauregard ha->idc_mb[4] = RD16_IO_REG(ha, mailbox_out[4]);
eb82ff87b34e625264561b2d267577cf9821dab0Daniel Beauregard ha->idc_mb[5] = RD16_IO_REG(ha, mailbox_out[5]);
eb82ff87b34e625264561b2d267577cf9821dab0Daniel Beauregard ha->idc_mb[6] = RD16_IO_REG(ha, mailbox_out[6]);
eb82ff87b34e625264561b2d267577cf9821dab0Daniel Beauregard ha->idc_mb[7] = RD16_IO_REG(ha, mailbox_out[7]);
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard EL(ha, "%xh Inter-driver communication request notification "
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard "received, mbx1=%xh, mbx2=%xh, mbx3=%xh, mbx4=%xh, "
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard "mbx5=%xh, mbx6=%xh, mbx7=%xh\n", mb[0], ha->idc_mb[1],
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard ha->idc_mb[2], ha->idc_mb[3], ha->idc_mb[4], ha->idc_mb[5],
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard EL(ha, "%xh Inter-driver communication time extended received,"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte EL(ha, "%xh UNKNOWN event received, mbx1=%xh, mbx2=%xh, "
eb82ff87b34e625264561b2d267577cf9821dab0Daniel Beauregard "mbx3=%xh\n", mb[0], RD16_IO_REG(ha, mailbox_out[1]),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Clear RISC interrupt */
eb82ff87b34e625264561b2d267577cf9821dab0Daniel Beauregard } else if (CFG_IST(ha, CFG_CTRL_242581)) {
eb82ff87b34e625264561b2d267577cf9821dab0Daniel Beauregard WRT32_IO_REG(ha, hccr, HC24_CLR_RISC_INT);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): done\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ql_fast_fcp_post
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Fast path for good SCSI I/O completion.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * sp: SRB pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Interrupt or Kernel context, no mailbox commands allowed.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): started\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Acquire device queue lock. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Decrement outstanding commands on device. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (sp->fcp->fcp_cntl.cntl_qtype == FCP_QTYPE_UNTAGGED) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Clear the flag for this LUN so that
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * untagged commands can be submitted
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Reset port down retry count on good completion. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte tq->port_down_retry_count = ha->port_down_retry_count;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Remove command from watchdog queue. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Release LU queue specific lock. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Sync buffers if required. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Map ISP completion codes. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Now call the pkt completion callback */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): done\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ql_response_pkt
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Processes response entry.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ha: adapter state pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * done_q: head pointer to done queue.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * set_flags: task daemon flags to set.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * reset_flags: task daemon flags to reset.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * intr_clr: early interrupt clear
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Interrupt or Kernel context, no mailbox commands allowed.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteql_response_pkt(ql_adapter_state_t *ha, ql_head_t *done_q, uint32_t *set_flags,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): started\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Clear RISC interrupt */
eb82ff87b34e625264561b2d267577cf9821dab0Daniel Beauregard } else if (CFG_IST(ha, CFG_CTRL_242581)) {
eb82ff87b34e625264561b2d267577cf9821dab0Daniel Beauregard WRT32_IO_REG(ha, hccr, HC24_CLR_RISC_INT);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): not onlne, done\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Calculate size of response queue entries to sync. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ((uint32_t)(ha->isp_rsp_index - ha->rsp_ring_index) *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ((uint32_t)(RESPONSE_ENTRY_CNT - ha->rsp_ring_index) *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Responses wrap around the Q */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ((uint32_t)(RESPONSE_ENTRY_CNT - ha->rsp_ring_index) *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Sync DMA buffer. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (off_t)(ha->rsp_ring_index * RESPONSE_ENTRY_SIZE +
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte while (ha->rsp_ring_index != ha->isp_rsp_index) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_5(CE_CONT, "(%d): ha->rsp_rg_idx=%xh, mbx[5]=%xh\n",
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ha->instance, ha->rsp_ring_index, ha->isp_rsp_index);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Adjust ring index. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Process packet. */
eb82ff87b34e625264561b2d267577cf9821dab0Daniel Beauregard pkt->entry_status = (uint8_t)(CFG_IST(ha, CFG_CTRL_24258081) ?
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte pkt->entry_status & 0x3c : pkt->entry_status & 0x7e);
eb82ff87b34e625264561b2d267577cf9821dab0Daniel Beauregard status |= CFG_IST(ha, CFG_CTRL_24258081) ?
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Inform RISC of processed responses. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* RESET packet received delay for possible async event. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): done\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ql_error_entry
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Processes error entry.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ha = adapter state pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * pkt = entry pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * done_q = head pointer to done queue.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * set_flags = task daemon flags to set.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * reset_flags = task daemon flags to reset.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Interrupt or Kernel context, no mailbox commands allowed.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* ARGSUSED */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteql_error_entry(ql_adapter_state_t *ha, response_t *pkt, ql_head_t *done_q,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_2(CE_CONT, "(%d): started, packet:\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_DUMP_2((uint8_t *)pkt, 8, RESPONSE_ENTRY_SIZE);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte EL(ha, "UNKNOWN flag = %xh error\n", pkt->entry_status);
a2b3ff35eb5d7a6132b779a25b318545dae47cefDaniel Beauregard /* Validate the response entry handle. */
a2b3ff35eb5d7a6132b779a25b318545dae47cefDaniel Beauregard resp_identifier = ddi_get32(ha->hba_buf.acc_handle, &pkt->handle);
a2b3ff35eb5d7a6132b779a25b318545dae47cefDaniel Beauregard /* the index seems reasonable */
a2b3ff35eb5d7a6132b779a25b318545dae47cefDaniel Beauregard /* Neo, you're the one... */
a2b3ff35eb5d7a6132b779a25b318545dae47cefDaniel Beauregard EL(ha, "IOCB handle mismatch pkt=%xh, sp=%xh\n",
a2b3ff35eb5d7a6132b779a25b318545dae47cefDaniel Beauregard (uint32_t *)&pkt->handle, set_flags, reset_flags);
a2b3ff35eb5d7a6132b779a25b318545dae47cefDaniel Beauregard EL(ha, "osc index out of range, index=%xh, handle=%xh\n",
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Bad payload or header */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (pkt->entry_status & (BIT_5 + BIT_4 + BIT_3 + BIT_2)) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Bad payload or header, set error status. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } else if (pkt->entry_status & BIT_1) /* FULL flag */ {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Set error status. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Set completed status. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Place command on done queue. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): done\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ql_status_entry
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Processes received ISP2200-2300 status entry.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ha: adapter state pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * pkt: entry pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * done_q: done queue pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * set_flags: task daemon flags to set.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * reset_flags: task daemon flags to reset.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * BIT_0 = CS_RESET status received.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Interrupt or Kernel context, no mailbox commands allowed.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* ARGSUSED */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteql_status_entry(ql_adapter_state_t *ha, sts_entry_t *pkt,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ql_head_t *done_q, uint32_t *set_flags, uint32_t *reset_flags)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): started\n", ha->instance);
a2b3ff35eb5d7a6132b779a25b318545dae47cefDaniel Beauregard /* Validate the response entry handle. */
a2b3ff35eb5d7a6132b779a25b318545dae47cefDaniel Beauregard resp_identifier = ddi_get32(ha->hba_buf.acc_handle, &pkt->handle);
a2b3ff35eb5d7a6132b779a25b318545dae47cefDaniel Beauregard /* the index seems reasonable */
a2b3ff35eb5d7a6132b779a25b318545dae47cefDaniel Beauregard /* Neo, you're the one... */
a2b3ff35eb5d7a6132b779a25b318545dae47cefDaniel Beauregard EL(ha, "IOCB handle mismatch pkt=%xh, sp=%xh\n",
a2b3ff35eb5d7a6132b779a25b318545dae47cefDaniel Beauregard (uint32_t *)&pkt->handle, set_flags, reset_flags);
a2b3ff35eb5d7a6132b779a25b318545dae47cefDaniel Beauregard EL(ha, "osc index out of range, index=%xh, handle=%xh\n",
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte comp_status = (uint16_t)ddi_get16(ha->hba_buf.acc_handle,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * We dont care about SCSI QFULLs.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * 2300 firmware marks completion status as data underrun
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * for scsi qfulls. Make it transport complete.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((CFG_IST(ha, (CFG_CTRL_2300 | CFG_CTRL_6322))) &&
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Workaround T3 issue where we do not get any data xferred
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * but get back a good status.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((pkt->state_flags_h & SF_XFERRED_DATA) == 0 &&
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (pkt->state_flags_l & (SF_DATA_OUT | SF_DATA_IN)) ==
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Ideally it should never be true. But there
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * is a bug in FW which upon receiving invalid
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * parameters in MS IOCB returns it as
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * status entry and not as ms entry type.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Fast path to good SCSI I/O completion
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Set completed status. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): ql_fast_fcp_post done\n",
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte rval = ql_status_error(ha, sp, pkt, done_q, set_flags,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): done\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ql_24xx_status_entry
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Processes received ISP24xx status entry.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ha: adapter state pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * pkt: entry pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * done_q: done queue pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * set_flags: task daemon flags to set.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * reset_flags: task daemon flags to reset.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * BIT_0 = CS_RESET status received.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Interrupt or Kernel context, no mailbox commands allowed.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* ARGSUSED */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteql_24xx_status_entry(ql_adapter_state_t *ha, sts_24xx_entry_t *pkt,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ql_head_t *done_q, uint32_t *set_flags, uint32_t *reset_flags)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): started\n", ha->instance);
a2b3ff35eb5d7a6132b779a25b318545dae47cefDaniel Beauregard /* Validate the response entry handle. */
16dd44c265271a75647fb0bb41109bb7c585a526Daniel Beauregard resp_identifier = ddi_get32(ha->hba_buf.acc_handle, &pkt->handle);
a2b3ff35eb5d7a6132b779a25b318545dae47cefDaniel Beauregard /* the index seems reasonable */
a2b3ff35eb5d7a6132b779a25b318545dae47cefDaniel Beauregard /* Neo, you're the one... */
a2b3ff35eb5d7a6132b779a25b318545dae47cefDaniel Beauregard EL(ha, "IOCB handle mismatch pkt=%xh, sp=%xh\n",
a2b3ff35eb5d7a6132b779a25b318545dae47cefDaniel Beauregard (uint32_t *)&pkt->handle, set_flags, reset_flags);
a2b3ff35eb5d7a6132b779a25b318545dae47cefDaniel Beauregard EL(ha, "osc index out of range, index=%xh, handle=%xh\n",
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte comp_status = (uint16_t)ddi_get16(ha->hba_buf.acc_handle,
a2b3ff35eb5d7a6132b779a25b318545dae47cefDaniel Beauregard /* We dont care about SCSI QFULLs. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * 2300 firmware marks completion status as data underrun
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * for scsi qfulls. Make it transport complete.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Workaround T3 issue where we do not get any data xferred
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * but get back a good status.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Fast path to good SCSI I/O completion
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Set completed status. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): ql_fast_fcp_post done\n",
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte rval = ql_status_error(ha, sp, (sts_entry_t *)pkt, done_q,
a2b3ff35eb5d7a6132b779a25b318545dae47cefDaniel Beauregard QL_PRINT_3(CE_CONT, "(%d): done\n", ha->instance);
a2b3ff35eb5d7a6132b779a25b318545dae47cefDaniel Beauregard * ql_verify_preprocessed_cmd
a2b3ff35eb5d7a6132b779a25b318545dae47cefDaniel Beauregard * Handles preprocessed cmds..
a2b3ff35eb5d7a6132b779a25b318545dae47cefDaniel Beauregard * ha: adapter state pointer.
a2b3ff35eb5d7a6132b779a25b318545dae47cefDaniel Beauregard * pkt_handle: handle pointer.
a2b3ff35eb5d7a6132b779a25b318545dae47cefDaniel Beauregard * set_flags: task daemon flags to set.
a2b3ff35eb5d7a6132b779a25b318545dae47cefDaniel Beauregard * reset_flags: task daemon flags to reset.
a2b3ff35eb5d7a6132b779a25b318545dae47cefDaniel Beauregard * srb pointer or NULL
a2b3ff35eb5d7a6132b779a25b318545dae47cefDaniel Beauregard * Interrupt or Kernel context, no mailbox commands allowed.
a2b3ff35eb5d7a6132b779a25b318545dae47cefDaniel Beauregardql_verify_preprocessed_cmd(ql_adapter_state_t *ha, uint32_t *pkt_handle,
a2b3ff35eb5d7a6132b779a25b318545dae47cefDaniel Beauregard uint32_t *set_flags, uint32_t *reset_flags)
a2b3ff35eb5d7a6132b779a25b318545dae47cefDaniel Beauregard /* Get handle. */
a2b3ff35eb5d7a6132b779a25b318545dae47cefDaniel Beauregard resp_identifier = ddi_get32(ha->hba_buf.acc_handle, pkt_handle);
a2b3ff35eb5d7a6132b779a25b318545dae47cefDaniel Beauregard /* Validate handle. */
f33c1cdb6d38eb0715f03cf492f31c3d4d395c98Daniel Beauregard EL(ha, "sp=%xh, resp_id=%xh, get=%d, index=%xh\n", sp,
a2b3ff35eb5d7a6132b779a25b318545dae47cefDaniel Beauregard /* Last chance, Sync whole DMA buffer. */
a2b3ff35eb5d7a6132b779a25b318545dae47cefDaniel Beauregard (void) ddi_dma_sync(ha->hba_buf.dma_handle,
f33c1cdb6d38eb0715f03cf492f31c3d4d395c98Daniel Beauregard EL(ha, "last chance DMA sync, index=%xh\n",
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): done\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ql_status_error
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Processes received ISP status entry error.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ha: adapter state pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * sp: SRB pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * pkt: entry pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * done_q: done queue pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * set_flags: task daemon flags to set.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * reset_flags: task daemon flags to reset.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * BIT_0 = CS_RESET status received.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Interrupt or Kernel context, no mailbox commands allowed.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* ARGSUSED */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteql_status_error(ql_adapter_state_t *ha, ql_srb_t *sp, sts_entry_t *pkt23,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ql_head_t *done_q, uint32_t *set_flags, uint32_t *reset_flags)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): started\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte sts_24xx_entry_t *pkt24 = (sts_24xx_entry_t *)pkt23;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Setup status. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte sts.comp_status = (uint16_t)ddi_get16(ha->hba_buf.acc_handle,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Setup firmware residuals. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte sts.residual_length = sts.comp_status == CS_DATA_UNDERRUN ?
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Setup FCP residuals. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (sts.residual_length != pkt24->fcp_rsp_residual_count)) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte EL(sp->ha, "mismatch resid's: fw=%xh, pkt=%xh\n",
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Setup state flags. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (sp->fcp->fcp_cntl.cntl_qtype == FCP_QTYPE_HEAD_OF_Q) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } else if (sp->fcp->fcp_cntl.cntl_qtype == FCP_QTYPE_ORDERED) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } else if (sp->fcp->fcp_cntl.cntl_qtype == FCP_QTYPE_SIMPLE) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Setup FCP response info. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((sts.scsi_status_h & FCP_RSP_LEN_VALID) != 0) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte sts.rsp_info_length = ddi_get32(ha->hba_buf.acc_handle,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte sizeof (struct fcp_rsp_info)) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte sizeof (struct fcp_rsp_info);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (cnt = 0; cnt < sts.rsp_info_length; cnt += 4) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Setup sense data. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (((uintptr_t)pkt24 + sizeof (sts_24xx_entry_t)) -
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Setup status. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Setup firmware residuals. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte sts.residual_length = sts.comp_status == CS_DATA_UNDERRUN ?
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Setup FCP residuals. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Setup state flags. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Setup FCP response info. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((sts.scsi_status_h & FCP_RSP_LEN_VALID) != 0) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte sizeof (struct fcp_rsp_info)) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte sizeof (struct fcp_rsp_info);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Setup sense data. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte sts.req_sense_length = sts.scsi_status_h & FCP_SNS_LEN_VALID ?
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte rsp = (struct fcp_rsp_info *)(sp->pkt->pkt_resp +
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fcpr->fcp_u.fcp_status.scsi_status = sts.scsi_status_l;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Set ISP completion status */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Update statistics. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte sense_sz = sp->pkt->pkt_rsplen - (uint32_t)sizeof (fcp_rsp_t);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* copy response information data. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ddi_rep_get8(ha->hba_buf.acc_handle, (uint8_t *)rsp,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * EL(sp->ha, "scsi_h=%xh, pkt_rsplen=%xh\n",
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * sts.scsi_status_h, sp->pkt->pkt_rsplen);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Set reset status received. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (sts.comp_status == CS_RESET && LOOP_READY(ha)) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (!(CFG_IST(ha, CFG_ENABLE_LINK_DOWN_REPORTING)) ||
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ha->loop_down_abort_time < LOOP_DOWN_TIMER_START) &&
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte EL(sp->ha, "Loop Not Ready Retry, d_id=%xh, lun=%xh\n",
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Set retry status. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte EL(sp->ha, "Port Down Retry=%xh, d_id=%xh, lun=%xh, count=%d"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "\n", sts.comp_status, tq->d_id.b24, sp->lun_queue->lun_no,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Set retry status. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Acquire device queue lock. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Decrement port down count. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (CFG_IST(ha, CFG_ENABLE_LINK_DOWN_REPORTING)) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (sts.comp_status == CS_QUEUE_FULL && tq->qfull_retry_count != 0) ||
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (sts.comp_status == CS_ABORTED && !(sp->flags & SRB_ABORTING)))) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte EL(sp->ha, "Queue Full Retry, d_id=%xh, lun=%xh, "
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Set retry status. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte sts.fcp_residual_length > sp->fcp->fcp_data_len ?
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "underrun & invalid resid\n");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Ignore firmware underrun error. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte EL(sp->ha, "Cmplt status err = %xh, d_id=%xh, lun=%xh"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Set target request sense data. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Insure data does not exceed buf. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Move sense data. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "d_id=%xh, lun=%xh\n%2xh%3xh%3xh%3xh"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "%3xh%3xh%3xh%3xh%3xh%3xh%3xh%3xh%3xh"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Set completed status. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Place command on done queue. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): done\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ql_status_cont_entry
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Processes status continuation entry.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ha: adapter state pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * pkt: entry pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * done_q: done queue pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * set_flags: task daemon flags to set.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * reset_flags: task daemon flags to reset.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Interrupt or Kernel context, no mailbox commands allowed.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* ARGSUSED */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteql_status_cont_entry(ql_adapter_state_t *ha, sts_cont_entry_t *pkt,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ql_head_t *done_q, uint32_t *set_flags, uint32_t *reset_flags)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): started\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (sp->request_sense_length > sizeof (pkt->req_sense_data)) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Move sense data. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (uint8_t *)&pkt->req_sense_data[0], (size_t)sense_sz,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Place command on done queue. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): done\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ql_ip_entry
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Processes received ISP IP entry.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ha: adapter state pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * pkt: entry pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * done_q: done queue pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * set_flags: task daemon flags to set.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * reset_flags: task daemon flags to reset.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Interrupt or Kernel context, no mailbox commands allowed.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* ARGSUSED */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteql_ip_entry(ql_adapter_state_t *ha, ip_entry_t *pkt23, ql_head_t *done_q,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): started\n", ha->instance);
a2b3ff35eb5d7a6132b779a25b318545dae47cefDaniel Beauregard /* Validate the response entry handle. */
a2b3ff35eb5d7a6132b779a25b318545dae47cefDaniel Beauregard resp_identifier = ddi_get32(ha->hba_buf.acc_handle, &pkt23->handle);
a2b3ff35eb5d7a6132b779a25b318545dae47cefDaniel Beauregard /* the index seems reasonable */
a2b3ff35eb5d7a6132b779a25b318545dae47cefDaniel Beauregard /* Neo, you're the one... */
a2b3ff35eb5d7a6132b779a25b318545dae47cefDaniel Beauregard EL(ha, "IOCB handle mismatch pkt=%xh, sp=%xh\n",
a2b3ff35eb5d7a6132b779a25b318545dae47cefDaniel Beauregard (uint32_t *)&pkt23->handle, set_flags, reset_flags);
a2b3ff35eb5d7a6132b779a25b318545dae47cefDaniel Beauregard EL(ha, "osc index out of range, index=%xh, handle=%xh\n",
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Set ISP completion status */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Set retry status. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte EL(ha, "Port Down Retry=%xh, d_id=%xh, count=%d\n",
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Set retry status. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Acquire device queue lock. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Release device queue specific lock. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Set retry status. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Set completed status. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): done\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ql_ip_rcv_entry
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Processes received ISP IP buffers entry.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ha: adapter state pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * pkt: entry pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * done_q: done queue pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * set_flags: task daemon flags to set.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * reset_flags: task daemon flags to reset.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Interrupt or Kernel context, no mailbox commands allowed.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* ARGSUSED */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteql_ip_rcv_entry(ql_adapter_state_t *ha, ip_rcv_entry_t *pkt,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ql_head_t *done_q, uint32_t *set_flags, uint32_t *reset_flags)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): started\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Locate device queue. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte tq->ub_sequence_length = (uint16_t)ddi_get16(ha->hba_buf.acc_handle,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (cnt = 0; cnt < IP_RCVBUF_HANDLES && tq->ub_seq_cnt <
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte index = (uint16_t)ddi_get16(ha->hba_buf.acc_handle,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (ql_ub_frame_hdr(ha, tq, index, done_q) != QL_SUCCESS) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte EL(ha, "ql_ub_frame_hdr failed, isp_abort_needed\n");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): done\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ql_ip_rcv_cont_entry
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Processes received ISP IP buffers continuation entry.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ha: adapter state pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * pkt: entry pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * done_q: done queue pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * set_flags: task daemon flags to set.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * reset_flags: task daemon flags to reset.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Interrupt or Kernel context, no mailbox commands allowed.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* ARGSUSED */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteql_ip_rcv_cont_entry(ql_adapter_state_t *ha, ip_rcv_cont_entry_t *pkt,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ql_head_t *done_q, uint32_t *set_flags, uint32_t *reset_flags)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): started\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte index = (uint16_t)ddi_get16(ha->hba_buf.acc_handle,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (ql_ub_frame_hdr(ha, tq, index, done_q) != QL_SUCCESS) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte EL(ha, "ql_ub_frame_hdr failed, isp_abort_needed\n");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): done\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ip_rcv_24xx_entry_t
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Processes received ISP24xx IP buffers entry.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ha: adapter state pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * pkt: entry pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * done_q: done queue pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * set_flags: task daemon flags to set.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * reset_flags: task daemon flags to reset.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Interrupt or Kernel context, no mailbox commands allowed.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* ARGSUSED */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteql_ip_24xx_rcv_entry(ql_adapter_state_t *ha, ip_rcv_24xx_entry_t *pkt,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ql_head_t *done_q, uint32_t *set_flags, uint32_t *reset_flags)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): started\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Locate device queue. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (cnt = 0; cnt < IP_24XX_RCVBUF_HANDLES && tq->ub_seq_cnt <
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte index = (uint16_t)ddi_get16(ha->hba_buf.acc_handle,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (ql_ub_frame_hdr(ha, tq, index, done_q) != QL_SUCCESS) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte EL(ha, "ql_ub_frame_hdr failed, isp_abort_needed\n");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): done\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ql_ms_entry
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Processes received Name/Management/CT Pass-Through entry.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ha: adapter state pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * pkt23: entry pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * done_q: done queue pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * set_flags: task daemon flags to set.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * reset_flags: task daemon flags to reset.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Interrupt or Kernel context, no mailbox commands allowed.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* ARGSUSED */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteql_ms_entry(ql_adapter_state_t *ha, ms_entry_t *pkt23, ql_head_t *done_q,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ct_passthru_entry_t *pkt24 = (ct_passthru_entry_t *)pkt23;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): started\n", ha->instance);
a2b3ff35eb5d7a6132b779a25b318545dae47cefDaniel Beauregard /* Validate the response entry handle. */
a2b3ff35eb5d7a6132b779a25b318545dae47cefDaniel Beauregard resp_identifier = ddi_get32(ha->hba_buf.acc_handle, &pkt23->handle);
a2b3ff35eb5d7a6132b779a25b318545dae47cefDaniel Beauregard /* the index seems reasonable */
a2b3ff35eb5d7a6132b779a25b318545dae47cefDaniel Beauregard /* Neo, you're the one... */
a2b3ff35eb5d7a6132b779a25b318545dae47cefDaniel Beauregard EL(ha, "IOCB handle mismatch pkt=%xh, sp=%xh\n",
a2b3ff35eb5d7a6132b779a25b318545dae47cefDaniel Beauregard (uint32_t *)&pkt23->handle, set_flags, reset_flags);
a2b3ff35eb5d7a6132b779a25b318545dae47cefDaniel Beauregard EL(ha, "osc index out of range, index=%xh, handle=%xh\n",
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte EL(ha, "Not SRB_MS_PKT flags=%xh, isp_abort_needed",
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Set ISP completion status */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (sp->pkt->pkt_reason == CS_RESOUCE_UNAVAILABLE &&
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Set retry status. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Acquire device queue lock. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Release device queue specific lock. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Set retry status. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Acquire device queue lock. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Release device queue specific lock. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Set retry status. */
eb82ff87b34e625264561b2d267577cf9821dab0Daniel Beauregard } else if (CFG_IST(ha, CFG_CTRL_24258081) &&
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard QL_PRINT_3(CE_CONT, "(%d): ct_cmdrsp=%x%02xh resp\n",
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_DUMP_3(sp->pkt->pkt_resp, 8, sp->pkt->pkt_rsplen);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* For nameserver restore command, management change header. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Set completed status. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Place command on done queue. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): done\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ql_report_id_entry
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Processes received Name/Management/CT Pass-Through entry.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ha: adapter state pointer.
eb82ff87b34e625264561b2d267577cf9821dab0Daniel Beauregard * pkt: entry pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * done_q: done queue pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * set_flags: task daemon flags to set.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * reset_flags: task daemon flags to reset.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Interrupt or Kernel context, no mailbox commands allowed.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* ARGSUSED */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteql_report_id_entry(ql_adapter_state_t *ha, report_id_1_t *pkt,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ql_head_t *done_q, uint32_t *set_flags, uint32_t *reset_flags)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): started\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Locate port state structure. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (vha = ha; vha != NULL; vha = vha->vp_next) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): done\n", ha->instance);
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard * ql_els_entry
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard * Processes received ELS Pass-Through entry.
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard * ha: adapter state pointer.
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard * pkt23: entry pointer.
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard * done_q: done queue pointer.
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard * set_flags: task daemon flags to set.
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard * reset_flags: task daemon flags to reset.
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard * Interrupt or Kernel context, no mailbox commands allowed.
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregardql_els_passthru_entry(ql_adapter_state_t *ha, els_passthru_entry_rsp_t *rsp,
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard ql_head_t *done_q, uint32_t *set_flags, uint32_t *reset_flags)
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard QL_PRINT_3(CE_CONT, "(%d): started\n", ha->instance);
a2b3ff35eb5d7a6132b779a25b318545dae47cefDaniel Beauregard /* Validate the response entry handle. */
a2b3ff35eb5d7a6132b779a25b318545dae47cefDaniel Beauregard resp_identifier = ddi_get32(ha->hba_buf.acc_handle, &rsp->handle);
a2b3ff35eb5d7a6132b779a25b318545dae47cefDaniel Beauregard /* the index seems reasonable */
a2b3ff35eb5d7a6132b779a25b318545dae47cefDaniel Beauregard /* Neo, you're the one... */
a2b3ff35eb5d7a6132b779a25b318545dae47cefDaniel Beauregard EL(ha, "IOCB handle mismatch pkt=%xh, sp=%xh\n",
a2b3ff35eb5d7a6132b779a25b318545dae47cefDaniel Beauregard (uint32_t *)&rsp->handle, set_flags, reset_flags);
a2b3ff35eb5d7a6132b779a25b318545dae47cefDaniel Beauregard EL(ha, "osc index out of range, index=%xh, handle=%xh\n",
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard EL(ha, "Not SRB_ELS_PKT flags=%xh, isp_abort_needed",
a2b3ff35eb5d7a6132b779a25b318545dae47cefDaniel Beauregard (void) ddi_dma_sync(srb->pkt->pkt_resp_dma, 0, 0,
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard /* Set ISP completion status */
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard ha->hba_buf.acc_handle, &rsp->comp_status);
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard if (srb->pkt->pkt_reason != CS_COMPLETE) {
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard EL(ha, "status err=%xh\n", srb->pkt->pkt_reason);
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard if (srb->pkt->pkt_reason == CS_LOGIN_LOGOUT_ERROR) {
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard rsp->error_subcode1, rsp->error_subcode2);
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard /* Build RJT in the response. */
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard ddi_rep_put8(srb->pkt->pkt_resp_acc, (uint8_t *)&rjt,
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard srb->pkt->pkt_reason = FC_REASON_NO_CONNECTION;
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard if (srb->pkt->pkt_reason == CS_COMPLETE) {
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard /* Indicate ISP completion */
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard loop_id = ddi_get16(ha->hba_buf.acc_handle,
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard /* create a target Q if there isn't one */
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard /* Acquire adapter state lock. */
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard /* on plogi success assume the chosen s_id */
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard EL(ha, "ha=%x srb->ha=%x\n", ha, srb->ha);
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard /* invoke the callback */
5dfd244acc8f144280c5bc8f69ed941185fc3cccDaniel Beauregard QL_PRINT_3(CE_CONT, "(%d): done\n", ha->instance);
a2b3ff35eb5d7a6132b779a25b318545dae47cefDaniel Beauregard * ql_signal_abort
a2b3ff35eb5d7a6132b779a25b318545dae47cefDaniel Beauregard * Signal to the task daemon that a condition warranting an
a2b3ff35eb5d7a6132b779a25b318545dae47cefDaniel Beauregard * isp reset has been detected.
a2b3ff35eb5d7a6132b779a25b318545dae47cefDaniel Beauregard * ha: adapter state pointer.
a2b3ff35eb5d7a6132b779a25b318545dae47cefDaniel Beauregard * set_flags: task daemon flags to set.
a2b3ff35eb5d7a6132b779a25b318545dae47cefDaniel Beauregard * Interrupt or Kernel context, no mailbox commands allowed.
a2b3ff35eb5d7a6132b779a25b318545dae47cefDaniel Beauregardql_signal_abort(ql_adapter_state_t *ha, uint32_t *set_flags)