Lines Matching refs:sp

705 	ql_srb_t		*sp;  in ql_async_event()  local
810 sp = index < ha->osc_max_cnt ? in ql_async_event()
813 if (sp == QL_ABORTED_SRB(ha)) { in ql_async_event()
819 if (sp != NULL && sp->handle == handles[cnt]) { in ql_async_event()
821 sp->handle = 0; in ql_async_event()
822 sp->flags &= ~SRB_IN_TOKEN_ARRAY; in ql_async_event()
825 sp->flags |= SRB_ISP_COMPLETED; in ql_async_event()
828 sp->pkt->pkt_reason = CS_COMPLETE; in ql_async_event()
830 if (!(sp->flags & SRB_FCP_CMD_PKT)) { in ql_async_event()
832 ql_add_link_b(done_q, &sp->cmd); in ql_async_event()
834 ql_fast_fcp_post(sp, rsp_q); in ql_async_event()
837 if (sp == NULL) { in ql_async_event()
843 handles[cnt], sp->handle); in ql_async_event()
1499 ql_fast_fcp_post(ql_srb_t *sp, ql_response_q_t *rsp_q) in ql_fast_fcp_post() argument
1501 ql_adapter_state_t *ha = sp->ha; in ql_fast_fcp_post()
1502 ql_lun_t *lq = sp->lun_queue; in ql_fast_fcp_post()
1515 if (sp->flags & SRB_FCP_CMD_PKT) { in ql_fast_fcp_post()
1516 if (sp->fcp->fcp_cntl.cntl_qtype == FCP_QTYPE_UNTAGGED) { in ql_fast_fcp_post()
1536 if (sp->flags & SRB_WATCHDOG_ENABLED) { in ql_fast_fcp_post()
1537 ql_remove_link(&tq->wdg, &sp->wdg); in ql_fast_fcp_post()
1538 sp->flags &= ~SRB_WATCHDOG_ENABLED; in ql_fast_fcp_post()
1552 if (sp->flags & SRB_MS_PKT) { in ql_fast_fcp_post()
1553 (void) ddi_dma_sync(sp->pkt->pkt_resp_dma, 0, 0, in ql_fast_fcp_post()
1558 sp->pkt->pkt_expln = FC_EXPLN_NONE; in ql_fast_fcp_post()
1559 sp->pkt->pkt_action = FC_ACTION_RETRYABLE; in ql_fast_fcp_post()
1560 sp->pkt->pkt_state = FC_PKT_SUCCESS; in ql_fast_fcp_post()
1562 (void) qlc_fm_check_pkt_dma_handle(ha, sp); in ql_fast_fcp_post()
1565 if (sp->flags & SRB_POLL) { in ql_fast_fcp_post()
1566 sp->flags &= ~SRB_POLL; in ql_fast_fcp_post()
1567 } else if (ha->completion_thds == 1 && sp->pkt->pkt_comp && in ql_fast_fcp_post()
1570 (*sp->pkt->pkt_comp)(sp->pkt); in ql_fast_fcp_post()
1573 ql_io_comp(sp); in ql_fast_fcp_post()
1796 ql_srb_t *sp = NULL; in ql_error_entry() local
1845 if ((sp = ha->outstanding_cmds[index]) == NULL) { in ql_error_entry()
1846 sp = ql_verify_preprocessed_cmd(ha, rsp_q, in ql_error_entry()
1851 if (sp != NULL) { in ql_error_entry()
1852 if (sp == QL_ABORTED_SRB(ha)) { in ql_error_entry()
1855 sp = NULL; in ql_error_entry()
1857 } else if (sp->handle == resp_identifier) { in ql_error_entry()
1860 sp->handle = 0; in ql_error_entry()
1861 sp->flags &= ~SRB_IN_TOKEN_ARRAY; in ql_error_entry()
1864 resp_identifier, sp->handle); in ql_error_entry()
1865 sp = NULL; in ql_error_entry()
1875 if (sp != NULL) { in ql_error_entry()
1879 sp->pkt->pkt_reason = CS_BAD_PAYLOAD; in ql_error_entry()
1881 sp->pkt->pkt_reason = CS_QUEUE_FULL; in ql_error_entry()
1884 sp->pkt->pkt_reason = CS_UNKNOWN; in ql_error_entry()
1888 sp->flags |= SRB_ISP_COMPLETED; in ql_error_entry()
1891 ql_add_link_b(done_q, &sp->cmd); in ql_error_entry()
1921 ql_srb_t *sp = NULL; in ql_status_entry() local
1933 if ((sp = ha->outstanding_cmds[index]) == NULL) { in ql_status_entry()
1934 sp = ql_verify_preprocessed_cmd(ha, rsp_q, in ql_status_entry()
1939 if (sp != NULL) { in ql_status_entry()
1940 if (sp == QL_ABORTED_SRB(ha)) { in ql_status_entry()
1943 sp = NULL; in ql_status_entry()
1945 } else if (sp->handle == resp_identifier) { in ql_status_entry()
1948 sp->handle = 0; in ql_status_entry()
1949 sp->flags &= ~SRB_IN_TOKEN_ARRAY; in ql_status_entry()
1952 resp_identifier, sp->handle); in ql_status_entry()
1953 sp = NULL; in ql_status_entry()
1963 if (sp != NULL) { in ql_status_entry()
1972 sp->lun_queue->target_queue->d_id.b24, in ql_status_entry()
1973 sp->lun_queue->lun_no); in ql_status_entry()
1996 sp->fcp && in ql_status_entry()
1997 sp->fcp->fcp_data_len != 0 && in ql_status_entry()
2003 if (sp->flags & SRB_MS_PKT) { in ql_status_entry()
2023 sp->flags |= SRB_ISP_COMPLETED; in ql_status_entry()
2024 sp->pkt->pkt_reason = comp_status; in ql_status_entry()
2025 ql_fast_fcp_post(sp, rsp_q); in ql_status_entry()
2029 rval = ql_status_error(ha, rsp_q, sp, pkt, done_q, set_flags, in ql_status_entry()
2061 ql_srb_t *sp = NULL; in ql_24xx_status_entry() local
2073 if ((sp = ha->outstanding_cmds[index]) == NULL) { in ql_24xx_status_entry()
2074 sp = ql_verify_preprocessed_cmd(ha, rsp_q, in ql_24xx_status_entry()
2079 if (sp != NULL) { in ql_24xx_status_entry()
2080 if (sp == QL_ABORTED_SRB(ha)) { in ql_24xx_status_entry()
2083 sp = NULL; in ql_24xx_status_entry()
2085 } else if (sp->handle == resp_identifier) { in ql_24xx_status_entry()
2088 sp->handle = 0; in ql_24xx_status_entry()
2089 sp->flags &= ~SRB_IN_TOKEN_ARRAY; in ql_24xx_status_entry()
2092 resp_identifier, sp->handle); in ql_24xx_status_entry()
2093 sp = NULL; in ql_24xx_status_entry()
2103 if (sp != NULL) { in ql_24xx_status_entry()
2109 EL(sp->ha, "CS_QUEUE_FULL, d_id=%xh, lun=%xh\n", in ql_24xx_status_entry()
2110 sp->lun_queue->target_queue->d_id.b24, in ql_24xx_status_entry()
2111 sp->lun_queue->lun_no); in ql_24xx_status_entry()
2132 sp->fcp && in ql_24xx_status_entry()
2133 sp->fcp->fcp_data_len != 0 && in ql_24xx_status_entry()
2134 sp->fcp->fcp_cntl.cntl_write_data) { in ql_24xx_status_entry()
2145 sp->flags |= SRB_ISP_COMPLETED; in ql_24xx_status_entry()
2146 sp->pkt->pkt_reason = comp_status; in ql_24xx_status_entry()
2147 ql_fast_fcp_post(sp, rsp_q); in ql_24xx_status_entry()
2151 rval = ql_status_error(ha, rsp_q, sp, (sts_entry_t *)pkt, in ql_24xx_status_entry()
2183 ql_srb_t *sp = NULL; in ql_verify_preprocessed_cmd() local
2194 sp = ha->outstanding_cmds[index]; in ql_verify_preprocessed_cmd()
2197 if (sp != NULL) { in ql_verify_preprocessed_cmd()
2198 EL(ha, "sp=%xh, resp_id=%xh, get=%d, index=%xh\n", sp, in ql_verify_preprocessed_cmd()
2215 return (sp); in ql_verify_preprocessed_cmd()
2240 ql_status_error(ql_adapter_state_t *ha, ql_response_q_t *rsp_q, ql_srb_t *sp, in ql_status_error() argument
2291 EL(sp->ha, "mismatch resid's: fw=%xh, pkt=%xh\n", in ql_status_error()
2302 if (sp->fcp->fcp_data_len && in ql_status_error()
2304 sts.residual_length != sp->fcp->fcp_data_len)) { in ql_status_error()
2315 if (sp->fcp->fcp_cntl.cntl_write_data) { in ql_status_error()
2318 } else if (sp->fcp->fcp_cntl.cntl_read_data) { in ql_status_error()
2322 if (sp->fcp->fcp_cntl.cntl_qtype == FCP_QTYPE_HEAD_OF_Q) { in ql_status_error()
2325 } else if (sp->fcp->fcp_cntl.cntl_qtype == FCP_QTYPE_ORDERED) { in ql_status_error()
2328 } else if (sp->fcp->fcp_cntl.cntl_qtype == FCP_QTYPE_SIMPLE) { in ql_status_error()
2412 bzero(sp->pkt->pkt_resp, sp->pkt->pkt_rsplen); in ql_status_error()
2414 fcpr = (fcp_rsp_t *)sp->pkt->pkt_resp; in ql_status_error()
2415 rsp = (struct fcp_rsp_info *)(sp->pkt->pkt_resp + in ql_status_error()
2418 tq = sp->lun_queue->target_queue; in ql_status_error()
2436 sp->pkt->pkt_reason = sts.comp_status; in ql_status_error()
2440 (sp->pkt->pkt_rsplen > sizeof (fcp_rsp_t))) { in ql_status_error()
2442 sense_sz = sp->pkt->pkt_rsplen - (uint32_t)sizeof (fcp_rsp_t); in ql_status_error()
2498 EL(sp->ha, "Loop Not Ready Retry, d_id=%xh, lun=%xh\n", in ql_status_error()
2499 tq->d_id.b24, sp->lun_queue->lun_no); in ql_status_error()
2502 sp->flags |= SRB_RETRY; in ql_status_error()
2510 EL(sp->ha, "Port Down Retry=%xh, d_id=%xh, lun=%xh, count=%d" in ql_status_error()
2511 "\n", sts.comp_status, tq->d_id.b24, sp->lun_queue->lun_no, in ql_status_error()
2515 sp->flags |= SRB_RETRY; in ql_status_error()
2534 sp->ha->adapter_stats->d_stats[lobyte( in ql_status_error()
2536 ql_send_logo(sp->ha, tq, done_q); in ql_status_error()
2552 (sts.comp_status == CS_ABORTED && !(sp->flags & SRB_ABORTING)))) { in ql_status_error()
2554 EL(sp->ha, "Reset Retry, d_id=%xh, lun=%xh\n", in ql_status_error()
2555 tq->d_id.b24, sp->lun_queue->lun_no); in ql_status_error()
2557 EL(sp->ha, "Queue Full Retry, d_id=%xh, lun=%xh, " in ql_status_error()
2558 "cnt=%d\n", tq->d_id.b24, sp->lun_queue->lun_no, in ql_status_error()
2577 EL(sp->ha, "Abort Retry, d_id=%xh, lun=%xh\n", in ql_status_error()
2578 tq->d_id.b24, sp->lun_queue->lun_no); in ql_status_error()
2587 sp->flags |= SRB_RETRY; in ql_status_error()
2590 sts.fcp_residual_length > sp->fcp->fcp_data_len ? in ql_status_error()
2591 sp->fcp->fcp_data_len : sts.fcp_residual_length; in ql_status_error()
2597 sp->pkt->pkt_reason = CS_COMPLETE; in ql_status_error()
2603 sp->pkt->pkt_reason = CS_FCP_RESPONSE_ERROR; in ql_status_error()
2612 sp->pkt->pkt_reason = CS_COMPLETE; in ql_status_error()
2615 if (sp->pkt->pkt_reason != CS_COMPLETE) { in ql_status_error()
2617 EL(sp->ha, "Cmplt status err = %xh, d_id=%xh, lun=%xh," in ql_status_error()
2620 sp->lun_queue->lun_no, sp->pkt->pkt_reason, in ql_status_error()
2621 sp->flags, sp); in ql_status_error()
2628 if (sp->pkt->pkt_reason == CS_COMPLETE && in ql_status_error()
2638 if (sp->pkt->pkt_rsplen <= in ql_status_error()
2641 sp->request_sense_length = 0; in ql_status_error()
2643 sp->request_sense_length = (uint32_t) in ql_status_error()
2644 (sp->pkt->pkt_rsplen - in ql_status_error()
2650 sp->request_sense_length) { in ql_status_error()
2651 sp->request_sense_length = in ql_status_error()
2655 sp->request_sense_ptr = (caddr_t)rsp; in ql_status_error()
2661 if (sp->request_sense_length < in ql_status_error()
2664 sp->request_sense_length; in ql_status_error()
2671 (uint8_t *)sp->request_sense_ptr, in ql_status_error()
2676 sp->request_sense_ptr += sense_sz; in ql_status_error()
2677 sp->request_sense_length -= sense_sz; in ql_status_error()
2678 if (sp->request_sense_length != 0 && in ql_status_error()
2680 rsp_q->status_srb = sp; in ql_status_error()
2685 EL(sp->ha, "check condition sense data, " in ql_status_error()
2689 sp->lun_queue->lun_no, in ql_status_error()
2709 EL(sp->ha, "check condition, d_id=%xh, lun=%xh" in ql_status_error()
2710 "\n", tq->d_id.b24, sp->lun_queue->lun_no); in ql_status_error()
2716 sp->flags |= SRB_ISP_COMPLETED; in ql_status_error()
2720 ql_add_link_b(done_q, &sp->cmd); in ql_status_error()
2750 ql_srb_t *sp = rsp_q->status_srb; in ql_status_cont_entry() local
2754 if (sp != NULL && sp->request_sense_length) { in ql_status_cont_entry()
2755 if (sp->request_sense_length > sizeof (pkt->req_sense_data)) { in ql_status_cont_entry()
2758 sense_sz = sp->request_sense_length; in ql_status_cont_entry()
2770 (uint8_t *)sp->request_sense_ptr, in ql_status_cont_entry()
2774 sp->request_sense_ptr += sense_sz; in ql_status_cont_entry()
2775 sp->request_sense_length -= sense_sz; in ql_status_cont_entry()
2778 if (sp->request_sense_length == 0) { in ql_status_cont_entry()
2779 ql_add_link_b(done_q, &sp->cmd); in ql_status_cont_entry()
2807 ql_srb_t *sp = NULL; in ql_ip_entry() local
2819 if ((sp = ha->outstanding_cmds[index]) == NULL) { in ql_ip_entry()
2820 sp = ql_verify_preprocessed_cmd(ha, rsp_q, in ql_ip_entry()
2825 if (sp != NULL) { in ql_ip_entry()
2826 if (sp == QL_ABORTED_SRB(ha)) { in ql_ip_entry()
2829 sp = NULL; in ql_ip_entry()
2831 } else if (sp->handle == resp_identifier) { in ql_ip_entry()
2834 sp->handle = 0; in ql_ip_entry()
2835 sp->flags &= ~SRB_IN_TOKEN_ARRAY; in ql_ip_entry()
2838 resp_identifier, sp->handle); in ql_ip_entry()
2839 sp = NULL; in ql_ip_entry()
2849 if (sp != NULL) { in ql_ip_entry()
2850 tq = sp->lun_queue->target_queue; in ql_ip_entry()
2856 sp->pkt->pkt_reason = ddi_get16( in ql_ip_entry()
2859 sp->pkt->pkt_reason = ddi_get16( in ql_ip_entry()
2868 sp->flags |= SRB_RETRY; in ql_ip_entry()
2871 (sp->pkt->pkt_reason == CS_INCOMPLETE || in ql_ip_entry()
2872 sp->pkt->pkt_reason == CS_PORT_UNAVAILABLE || in ql_ip_entry()
2873 sp->pkt->pkt_reason == CS_PORT_LOGGED_OUT || in ql_ip_entry()
2874 sp->pkt->pkt_reason == CS_PORT_CONFIG_CHG || in ql_ip_entry()
2875 sp->pkt->pkt_reason == CS_PORT_BUSY)) { in ql_ip_entry()
2877 sp->pkt->pkt_reason, tq->d_id.b24, in ql_ip_entry()
2881 sp->flags |= SRB_RETRY; in ql_ip_entry()
2883 if (sp->pkt->pkt_reason == CS_PORT_LOGGED_OUT || in ql_ip_entry()
2884 sp->pkt->pkt_reason == CS_PORT_UNAVAILABLE) { in ql_ip_entry()
2912 } else if (sp->pkt->pkt_reason == CS_RESET) { in ql_ip_entry()
2916 sp->flags |= SRB_RETRY; in ql_ip_entry()
2918 if (sp->pkt->pkt_reason != CS_COMPLETE) { in ql_ip_entry()
2920 sp->pkt->pkt_reason, tq->d_id.b24); in ql_ip_entry()
2925 sp->flags |= SRB_ISP_COMPLETED; in ql_ip_entry()
2927 ql_add_link_b(done_q, &sp->cmd); in ql_ip_entry()
3127 ql_srb_t *sp = NULL; in ql_ms_entry() local
3140 if ((sp = ha->outstanding_cmds[index]) == NULL) { in ql_ms_entry()
3141 sp = ql_verify_preprocessed_cmd(ha, rsp_q, in ql_ms_entry()
3146 if (sp != NULL) { in ql_ms_entry()
3147 if (sp == QL_ABORTED_SRB(ha)) { in ql_ms_entry()
3150 sp = NULL; in ql_ms_entry()
3152 } else if (sp->handle == resp_identifier) { in ql_ms_entry()
3155 sp->handle = 0; in ql_ms_entry()
3156 sp->flags &= ~SRB_IN_TOKEN_ARRAY; in ql_ms_entry()
3159 resp_identifier, sp->handle); in ql_ms_entry()
3160 sp = NULL; in ql_ms_entry()
3170 if (sp != NULL) { in ql_ms_entry()
3171 if (!(sp->flags & SRB_MS_PKT)) { in ql_ms_entry()
3173 sp->flags); in ql_ms_entry()
3178 tq = sp->lun_queue->target_queue; in ql_ms_entry()
3182 sp->pkt->pkt_reason = ddi_get16( in ql_ms_entry()
3185 sp->pkt->pkt_reason = ddi_get16( in ql_ms_entry()
3189 if (sp->pkt->pkt_reason == CS_RESOUCE_UNAVAILABLE && in ql_ms_entry()
3190 sp->retry_count) { in ql_ms_entry()
3192 sp->retry_count); in ql_ms_entry()
3195 sp->retry_count--; in ql_ms_entry()
3196 sp->flags |= SRB_RETRY; in ql_ms_entry()
3215 (sp->pkt->pkt_reason == CS_PORT_CONFIG_CHG || in ql_ms_entry()
3216 sp->pkt->pkt_reason == CS_PORT_BUSY)) { in ql_ms_entry()
3220 sp->flags |= SRB_RETRY; in ql_ms_entry()
3243 } else if (sp->pkt->pkt_reason == CS_RESET) { in ql_ms_entry()
3247 sp->flags |= SRB_RETRY; in ql_ms_entry()
3250 sp->pkt->pkt_reason == CS_DATA_UNDERRUN) { in ql_ms_entry()
3256 sp->pkt->pkt_reason = CS_COMPLETE; in ql_ms_entry()
3259 } else if (sp->pkt->pkt_reason == CS_PORT_UNAVAILABLE || in ql_ms_entry()
3260 sp->pkt->pkt_reason == CS_PORT_LOGGED_OUT) { in ql_ms_entry()
3261 EL(ha, "Port unavailable %xh\n", sp->pkt->pkt_reason); in ql_ms_entry()
3265 sp->pkt->pkt_reason = CS_TIMEOUT; in ql_ms_entry()
3267 } else if (sp->pkt->pkt_reason != CS_COMPLETE) { in ql_ms_entry()
3268 EL(ha, "status err=%xh\n", sp->pkt->pkt_reason); in ql_ms_entry()
3271 if (sp->pkt->pkt_reason == CS_COMPLETE) { in ql_ms_entry()
3274 sp->pkt->pkt_cmd[8], sp->pkt->pkt_cmd[9]); in ql_ms_entry()
3275 QL_DUMP_3(sp->pkt->pkt_resp, 8, sp->pkt->pkt_rsplen); in ql_ms_entry()
3279 if ((sp->flags & SRB_RETRY) == 0) { in ql_ms_entry()
3281 ql_cthdr_endian(sp->pkt->pkt_cmd_acc, in ql_ms_entry()
3282 sp->pkt->pkt_cmd, B_TRUE) : in ql_ms_entry()
3283 ql_cthdr_endian(sp->pkt->pkt_resp_acc, in ql_ms_entry()
3284 sp->pkt->pkt_resp, B_TRUE); in ql_ms_entry()
3288 sp->flags |= SRB_ISP_COMPLETED; in ql_ms_entry()
3291 ql_add_link_b(done_q, &sp->cmd); in ql_ms_entry()