ql_iocb.c revision 16dd44c265271a75647fb0bb41109bb7c585a526
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
16dd44c265271a75647fb0bb41109bb7c585a526Daniel Beauregard/* Copyright 2009 QLogic Corporation */
16dd44c265271a75647fb0bb41109bb7c585a526Daniel Beauregard * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Use is subject to license terms.
16dd44c265271a75647fb0bb41109bb7c585a526Daniel Beauregard#pragma ident "Copyright 2009 QLogic Corporation; ql_iocb.c"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ISP2xxx Solaris Fibre Channel Adapter (FCA) driver source file.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ***********************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * * NOTICE **
16dd44c265271a75647fb0bb41109bb7c585a526Daniel Beauregard * * COPYRIGHT (C) 1996-2009 QLOGIC CORPORATION **
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * * ALL RIGHTS RESERVED **
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ***********************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Local Function Prototypes.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic void ql_continuation_iocb(ql_adapter_state_t *, ddi_dma_cookie_t *,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic void ql_isp24xx_rcvbuf(ql_adapter_state_t *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ql_start_iocb
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The start IOCB is responsible for building request packets
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * on request ring and modifying ISP input pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ha: adapter state pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * sp: srb structure pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Interrupt or Kernel context, no mailbox commands allowed.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteql_start_iocb(ql_adapter_state_t *vha, ql_srb_t *sp)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): started\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Acquire ring lock. */
16dd44c265271a75647fb0bb41109bb7c585a526Daniel Beauregard * If the pending queue is not empty maintain order
16dd44c265271a75647fb0bb41109bb7c585a526Daniel Beauregard * by puting this srb at the tail and geting the head.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Remove command from pending command queue */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Get command from pending command queue if not empty. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Release ring specific lock */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Remove command from pending command queue */
16dd44c265271a75647fb0bb41109bb7c585a526Daniel Beauregard /* start this request and as many others as possible */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Calculate number of free request entries. */
16dd44c265271a75647fb0bb41109bb7c585a526Daniel Beauregard * If no room in request ring put this srb at
16dd44c265271a75647fb0bb41109bb7c585a526Daniel Beauregard * the head of the pending queue and exit.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " req_q_cnt=%d, req_ring_index=%d\n",
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Check for room in outstanding command list. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (cnt = 1; cnt < MAX_OUTSTANDING_COMMANDS; cnt++) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (ha->outstanding_cmds[ha->osc_index] == NULL) {
16dd44c265271a75647fb0bb41109bb7c585a526Daniel Beauregard * If no room in outstanding array put this srb at
16dd44c265271a75647fb0bb41109bb7c585a526Daniel Beauregard * the head of the pending queue and exit.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_8(CE_CONT, "(%d): no room in outstanding "
16dd44c265271a75647fb0bb41109bb7c585a526Daniel Beauregard /* nothing to stop us now. */
16dd44c265271a75647fb0bb41109bb7c585a526Daniel Beauregard /* create and save a unique response identifier in the srb */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte sp->handle = ha->adapter_stats->ncmds << OSC_INDEX_SHIFT |
16dd44c265271a75647fb0bb41109bb7c585a526Daniel Beauregard /* build the iocb in the request ring */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Zero out packet. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Setup IOCB common data. */
16dd44c265271a75647fb0bb41109bb7c585a526Daniel Beauregard /* mark the iocb with the response identifier */
16dd44c265271a75647fb0bb41109bb7c585a526Daniel Beauregard /* Setup IOCB unique data. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_5(CE_CONT, "(%d,%d): req packet, sp=%p\n",
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_DUMP_5((uint8_t *)pkt, 8, REQUEST_ENTRY_SIZE);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Sync DMA buffer. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (off_t)(ha->req_ring_index * REQUEST_ENTRY_SIZE +
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte REQUEST_Q_BUFFER_OFFSET), (size_t)REQUEST_ENTRY_SIZE,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Adjust ring index. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Reset watchdog timer */
16dd44c265271a75647fb0bb41109bb7c585a526Daniel Beauregard * Send it by setting the new ring index in the ISP Request
16dd44c265271a75647fb0bb41109bb7c585a526Daniel Beauregard * Ring In Pointer register. This is the mechanism
16dd44c265271a75647fb0bb41109bb7c585a526Daniel Beauregard * used to notify the isp that a new iocb has been
16dd44c265271a75647fb0bb41109bb7c585a526Daniel Beauregard * placed on the request ring.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Update outstanding command count statistic. */
16dd44c265271a75647fb0bb41109bb7c585a526Daniel Beauregard /* if there is a pending command, try to start it. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Remove command from pending command queue */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Release ring specific lock */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): done\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ql_req_pkt
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Function is responsible for locking ring and
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * getting a zeroed out request packet.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ha: adapter state pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * pkt: address for packet pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ql local function return status code.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Interrupt or Kernel context, no mailbox commands allowed.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteql_req_pkt(ql_adapter_state_t *vha, request_t **pktp)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): started\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Wait for 30 seconds for slot. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Acquire ring lock. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Calculate number of free request entries. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Found empty request ring slot? */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Zero out packet. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (cnt = 0; cnt < REQUEST_ENTRY_SIZE/4; cnt++) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Setup IOCB common data. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Release request queue lock. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Check for pending interrupts. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * XXX protect interrupt routine from calling itself.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Need to revisit this routine. So far we never
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * hit this case as req slot was available
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ql_awaken_task_daemon(ha, NULL, ISP_ABORT_NEEDED, 0);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte EL(ha, "failed, rval = %xh, isp_abort_needed\n", rval);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): done\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ql_isp_cmd
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Function is responsible for modifying ISP input pointer.
16dd44c265271a75647fb0bb41109bb7c585a526Daniel Beauregard * This action notifies the isp that a new request has been
16dd44c265271a75647fb0bb41109bb7c585a526Daniel Beauregard * added to the request ring.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Releases ring lock.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ha: adapter state 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 QL_PRINT_5(CE_CONT, "(%d): req packet:\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_DUMP_5((uint8_t *)ha->request_ring_ptr, 8, REQUEST_ENTRY_SIZE);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Sync DMA buffer. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (off_t)(ha->req_ring_index * REQUEST_ENTRY_SIZE +
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte REQUEST_Q_BUFFER_OFFSET), (size_t)REQUEST_ENTRY_SIZE,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Adjust ring index. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Set chip new ring index. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Release ring lock. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): done\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ql_command_iocb
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Setup of command IOCB.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ha: adapter state pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * sp: srb structure pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * arg: request queue packet.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Interrupt or Kernel context, no mailbox commands allowed.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteql_command_iocb(ql_adapter_state_t *ha, ql_srb_t *sp, void *arg)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): started\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Set LUN number */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Set target ID */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Set tag queue control flags */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (fcp->fcp_cntl.cntl_qtype == FCP_QTYPE_HEAD_OF_Q) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } else if (fcp->fcp_cntl.cntl_qtype == FCP_QTYPE_ORDERED) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* else if (fcp->fcp_cntl.cntl_qtype == FCP_QTYPE_SIMPLE) */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Set ISP command timeout. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ddi_put16(ha->hba_buf.acc_handle, &pkt->timeout, sp->isp_timeout);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Load SCSI CDB */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ddi_rep_put8(ha->hba_buf.acc_handle, fcp->fcp_cdb,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): done\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Set transfer direction. Load Data segments.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ha->xioctl->IOOutputByteCnt += fcp->fcp_data_len;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Set data segment count. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte seg_cnt = (uint16_t)sp->pkt->pkt_data_cookie_cnt;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ddi_put16(ha->hba_buf.acc_handle, &pkt->dseg_count, seg_cnt);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Load total byte count. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ddi_put32(ha->hba_buf.acc_handle, &pkt->byte_count, fcp->fcp_data_len);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Load command data segment. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ddi_put32(ha->hba_buf.acc_handle, ptr32++, cp->dmac_address);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Build continuation packets.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (boolean_t)(CFG_IST(ha, CFG_ENABLE_64BIT_ADDRESSING)));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): done\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ql_continuation_iocb
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Setup of continuation IOCB.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ha: adapter state pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * cp: cookie list pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * seg_cnt: number of segments.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * addr64: 64 bit addresses.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Interrupt or Kernel context, no mailbox commands allowed.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteql_continuation_iocb(ql_adapter_state_t *ha, ddi_dma_cookie_t *cp,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): started\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Build continuation packets.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Sync DMA buffer. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (off_t)(ha->req_ring_index * REQUEST_ENTRY_SIZE +
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Adjust ring pointer, and deal with wrap. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Zero out packet. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Build continuation packet.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_5(CE_CONT, "(%d): packet:\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_DUMP_5((uint8_t *)pkt, 8, REQUEST_ENTRY_SIZE);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): done\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ql_command_24xx_iocb
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Setup of ISP24xx command IOCB.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ha: adapter state pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * sp: srb structure pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * arg: request queue packet.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Interrupt or Kernel context, no mailbox commands allowed.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteql_command_24xx_iocb(ql_adapter_state_t *ha, ql_srb_t *sp, void *arg)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): started\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Set LUN number */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Set N_port handle */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ddi_put16(pha->hba_buf.acc_handle, &pkt->n_port_hdl, tq->loop_id);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Set target ID */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Set ISP command timeout. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ddi_put16(pha->hba_buf.acc_handle, &pkt->timeout,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Load SCSI CDB */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ddi_rep_put8(pha->hba_buf.acc_handle, fcp->fcp_cdb, pkt->scsi_cdb,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ql_chg_endian((uint8_t *)&pkt->scsi_cdb + cnt, 4);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Set tag queue control flags
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Cannot copy fcp->fcp_cntl.cntl_qtype directly,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * problem with x86 in 32bit kernel mode
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): done\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Set transfer direction. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte pha->xioctl->IOOutputByteCnt += fcp->fcp_data_len;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte pha->xioctl->IOInputByteCnt += fcp->fcp_data_len;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Set data segment count. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte seg_cnt = (uint16_t)sp->pkt->pkt_data_cookie_cnt;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ddi_put16(pha->hba_buf.acc_handle, &pkt->dseg_count, seg_cnt);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Load total byte count. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ddi_put32(pha->hba_buf.acc_handle, &pkt->total_byte_count,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Load command data segment. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ddi_put32(pha->hba_buf.acc_handle, ptr32++, cp->dmac_address);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ddi_put32(pha->hba_buf.acc_handle, ptr32++, cp->dmac_notused);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ddi_put32(pha->hba_buf.acc_handle, ptr32, (uint32_t)cp->dmac_size);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Build continuation packets.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): done\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Function issues marker IOCB.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ha: adapter state pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * loop_id: device loop ID
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * lun: device LUN
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * type: marker modifier
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ql local function return status code.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Interrupt or Kernel context, no mailbox commands allowed.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteql_marker(ql_adapter_state_t *ha, uint16_t loop_id, uint16_t lun,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): started\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Set LUN number */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Set N_port handle */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Issue command to ISP */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): done\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ql_ms_iocb
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Setup of name/management server IOCB.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ha = adapter state pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * sp = srb structure pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * arg = request queue packet.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Interrupt or Kernel context, no mailbox commands allowed.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteql_ms_iocb(ql_adapter_state_t *ha, ql_srb_t *sp, void *arg)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): started\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_DUMP_3(sp->pkt->pkt_cmd, 8, sp->pkt->pkt_cmdlen);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Build command packet.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Set loop ID */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Set ISP command timeout. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ddi_put16(ha->hba_buf.acc_handle, &pkt->timeout, sp->isp_timeout);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Set cmd data segment count. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Set total data segment count */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte seg_cnt = (uint16_t)(sp->pkt->pkt_resp_cookie_cnt + 1);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ddi_put16(ha->hba_buf.acc_handle, &pkt->total_dseg_count, seg_cnt);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Load ct cmd byte count. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ddi_put32(ha->hba_buf.acc_handle, &pkt->cmd_byte_count,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Load ct rsp byte count. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ddi_put32(ha->hba_buf.acc_handle, &pkt->resp_byte_count,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Load MS command data segments. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ddi_put32(ha->hba_buf.acc_handle, ptr32++, cp->dmac_address);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ddi_put32(ha->hba_buf.acc_handle, ptr32++, cp->dmac_notused);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ddi_put32(ha->hba_buf.acc_handle, ptr32++, (uint32_t)cp->dmac_size);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Load MS response entry data segments. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ddi_put32(ha->hba_buf.acc_handle, ptr32++, cp->dmac_address);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ddi_put32(ha->hba_buf.acc_handle, ptr32++, cp->dmac_notused);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ddi_put32(ha->hba_buf.acc_handle, ptr32, (uint32_t)cp->dmac_size);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Build continuation packets.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): done\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ql_ms_24xx_iocb
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Setup of name/management server IOCB.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ha: adapter state pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * sp: srb structure pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * arg: request queue packet.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Interrupt or Kernel context, no mailbox commands allowed.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteql_ms_24xx_iocb(ql_adapter_state_t *ha, ql_srb_t *sp, void *arg)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): started\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_DUMP_3(sp->pkt->pkt_cmd, 8, sp->pkt->pkt_cmdlen);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Build command packet.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Set loop ID */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ddi_put16(pha->hba_buf.acc_handle, &pkt->n_port_hdl, tq->loop_id);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Set ISP command timeout. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ddi_put16(pha->hba_buf.acc_handle, &pkt->timeout,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Set cmd/response data segment counts. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ddi_put16(pha->hba_buf.acc_handle, &pkt->cmd_dseg_count, 1);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte seg_cnt = (uint16_t)sp->pkt->pkt_resp_cookie_cnt;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ddi_put16(pha->hba_buf.acc_handle, &pkt->resp_dseg_count, seg_cnt);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Load ct cmd byte count. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ddi_put32(pha->hba_buf.acc_handle, &pkt->cmd_byte_count,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Load ct rsp byte count. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ddi_put32(pha->hba_buf.acc_handle, &pkt->resp_byte_count,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Load MS command entry data segments. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ddi_put32(pha->hba_buf.acc_handle, ptr32++, cp->dmac_address);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ddi_put32(pha->hba_buf.acc_handle, ptr32++, cp->dmac_notused);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ddi_put32(pha->hba_buf.acc_handle, ptr32++, (uint32_t)cp->dmac_size);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Load MS response entry data segments. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ddi_put32(pha->hba_buf.acc_handle, ptr32++, cp->dmac_address);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ddi_put32(pha->hba_buf.acc_handle, ptr32++, cp->dmac_notused);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ddi_put32(pha->hba_buf.acc_handle, ptr32, (uint32_t)cp->dmac_size);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Build continuation packets.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): done\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ql_ip_iocb
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Setup of IP IOCB.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ha: adapter state pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * sp: srb structure pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * arg: request queue packet.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Interrupt or Kernel context, no mailbox commands allowed.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteql_ip_iocb(ql_adapter_state_t *ha, ql_srb_t *sp, void *arg)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): started\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Set loop ID */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Set control flags */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (sp->pkt->pkt_tran_flags & FC_TRAN_HI_PRIORITY) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Set ISP command timeout. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ddi_put16(ha->hba_buf.acc_handle, &pkt->timeout, sp->isp_timeout);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Set data segment count. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Load total byte count. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ddi_put32(ha->hba_buf.acc_handle, &pkt->byte_count,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ddi_put16(ha->hba_buf.acc_handle, &pkt->dseg_count, seg_cnt);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Build command packet.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Load command entry data segments. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ddi_put32(ha->hba_buf.acc_handle, ptr32++, cp->dmac_address);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Build continuation packets.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (boolean_t)(CFG_IST(ha, CFG_ENABLE_64BIT_ADDRESSING)));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): done\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ql_ip_24xx_iocb
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Setup of IP IOCB for ISP24xx.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ha: adapter state pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * sp: srb structure pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * arg: request queue packet.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Interrupt or Kernel context, no mailbox commands allowed.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteql_ip_24xx_iocb(ql_adapter_state_t *ha, ql_srb_t *sp, void *arg)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): started\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Set N_port handle */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ddi_put16(ha->hba_buf.acc_handle, &pkt->hdl_status, tq->loop_id);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Set ISP command timeout. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ddi_put16(ha->hba_buf.acc_handle, &pkt->timeout_hdl,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Set data segment count. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Load total byte count. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ddi_put32(ha->hba_buf.acc_handle, &pkt->byte_count,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ddi_put16(ha->hba_buf.acc_handle, &pkt->dseg_count, seg_cnt);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Set control flags */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ddi_put16(ha->hba_buf.acc_handle, &pkt->control_flags,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Set frame header control flags */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ddi_put16(ha->hba_buf.acc_handle, &pkt->frame_hdr_cntrl_flgs,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Load command data segment. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ddi_put32(ha->hba_buf.acc_handle, ptr32++, cp->dmac_address);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ddi_put32(ha->hba_buf.acc_handle, ptr32++, cp->dmac_notused);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ddi_put32(ha->hba_buf.acc_handle, ptr32, (uint32_t)cp->dmac_size);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Build continuation packets.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): done\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ql_isp_rcvbuf
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Locates free buffers and places it on the receive buffer queue.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ha = adapter state 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 adapter state lock. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Calculate number of free receive buffer entries. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* This should never happen */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte rcv_q_cnt = (uint16_t)(ha->rcvbuf_ring_index < index ?
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte index - ha->rcvbuf_ring_index : RCVBUF_CONTAINER_CNT -
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Load all free buffers in ISP receive buffer ring. */
16dd44c265271a75647fb0bb41109bb7c585a526Daniel Beauregard while (rcv_q_cnt > (uint16_t)0 && index < QL_UB_LIMIT) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Locate a buffer to give. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Build container.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ddi_put16(ha->hba_buf.acc_handle, &container->handle,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Adjust ring index. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (ha->rcvbuf_ring_index == RCVBUF_CONTAINER_CNT) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Sync queue. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (off_t)RCVBUF_Q_BUFFER_OFFSET, (size_t)RCVBUF_QUEUE_SIZE,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Set chip new ring index. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte WRT16_IO_REG(ha, mailbox[8], ha->rcvbuf_ring_index);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Release adapter state lock. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): done\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ql_isp24xx_rcvbuf
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Locates free buffers and send it to adapter.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ha = adapter state 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 /* Locate a buffer to give. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Get IOCB packet for buffers. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Build container.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ddi_put32(ha->hba_buf.acc_handle, &container->bufp[0],
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ddi_put32(ha->hba_buf.acc_handle, &container->bufp[1],
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ddi_put16(ha->hba_buf.acc_handle, &container->handle,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): done\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ql_modify_lun
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Function enables, modifies or disables ISP to respond as a target.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ha = adapter state pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * count = number buffers for incoming commands.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ql local function return status code.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Interrupt or Kernel context, no mailbox commands allowed.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): started\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Count the number of SCSI unsolicited buffers, that have been
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * allocated.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (!(ha->flags & TARGET_MODE_INITIALIZED) && (ubcount == 0)) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): done\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Disable the target mode Luns */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Modify the command count for target mode */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * calculate the new value of command count
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * and notify count and then issue the command
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * to change the values in the firmware.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Save one for immediate notify. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* cmd_count value increased */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* cmd_count value reduced */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Update the driver's command/notify count values */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Enable the Luns for the target mode */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Save one for immediate notify. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte pkt->immediate_notify_count = ha->ub_notify_count;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Issue command to ISP */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): done\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ql_notify_acknowledge_iocb
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Setup of notify acknowledge IOCB for pending
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * immediate notify entry.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ha: adapter state pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * cmd: target command context pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * pkt: request queue packet.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Interrupt or Kernel context, no mailbox commands allowed.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteql_notify_acknowledge_iocb(ql_adapter_state_t *ha, tgt_cmd_t *cmd,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): started\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Handle LIP reset event. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ddi_put16(ha->hba_buf.acc_handle, &pkt->status, cmd->status);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): done\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ql_continue_target_io_iocb
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Setup of continue target I/O IOCB for pending
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * accept target I/O entry.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ha = adapter state pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * sp = srb structure pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * arg = request queue packet.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Interrupt or Kernel context, no mailbox commands allowed.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteql_continue_target_io_iocb(ql_adapter_state_t *ha, ql_srb_t *sp, void *arg)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): started\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Set ISP command timeout. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } else if (sp->pkt->pkt_tran_type == FC_PKT_INBOUND) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Set relative offset. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* (sp->flags & SRB_FCP_RSP_PKT) */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Load data segments.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Transfer length. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (uint32_t *)(void *)&pkt->type.s0_32bit.byte_count,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Load data segments. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): done\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ql_continue_target_io_2400_iocb
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Setup of continue target I/O IOCB for pending
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * accept target I/O entry.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ha = adapter state pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * sp = srb structure pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * arg = request queue packet.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Interrupt or Kernel context, no mailbox commands allowed.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* ARGSUSED */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteql_continue_target_io_2400_iocb(ql_adapter_state_t *ha, ql_srb_t *sp,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): started\n", ha->instance);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte QL_PRINT_3(CE_CONT, "(%d): done\n", ha->instance);