Lines Matching refs:fpkt

424 static void fcp_ipkt_sema_callback(struct fc_packet *fpkt);
441 static void fcp_unsol_callback(fc_packet_t *fpkt);
456 static void fcp_icmd_callback(fc_packet_t *fpkt);
459 static int fcp_check_reportlun(struct fcp_rsp *rsp, fc_packet_t *fpkt);
460 static void fcp_scsi_callback(fc_packet_t *fpkt);
461 static void fcp_retry_scsi_cmd(fc_packet_t *fpkt);
462 static void fcp_handle_inquiry(fc_packet_t *fpkt, struct fcp_ipkt *icmd);
463 static void fcp_handle_reportlun(fc_packet_t *fpkt, struct fcp_ipkt *icmd);
491 static void fcp_cmd_callback(fc_packet_t *fpkt);
492 static void fcp_complete_pkt(fc_packet_t *fpkt);
502 static void fcp_queue_ipkt(struct fcp_port *pptr, fc_packet_t *fpkt);
503 static int fcp_transport(opaque_t port_handle, fc_packet_t *fpkt,
515 static int fcp_alloc_cmd_resp(struct fcp_port *pptr, fc_packet_t *fpkt,
517 static void fcp_free_cmd_resp(struct fcp_port *pptr, fc_packet_t *fpkt);
580 static void fcp_print_error(fc_packet_t *fpkt);
616 fc_packet_t *fpkt);
716 #define FCP_MUST_RETRY(fpkt) \ argument
717 ((fpkt)->pkt_state == FC_PKT_LOCAL_BSY || \
718 (fpkt)->pkt_state == FC_PKT_LOCAL_RJT || \
719 (fpkt)->pkt_state == FC_PKT_TRAN_BSY || \
720 (fpkt)->pkt_state == FC_PKT_ELS_IN_PROGRESS || \
721 (fpkt)->pkt_state == FC_PKT_NPORT_BSY || \
722 (fpkt)->pkt_state == FC_PKT_FABRIC_BSY || \
723 (fpkt)->pkt_state == FC_PKT_PORT_OFFLINE || \
724 (fpkt)->pkt_reason == FC_REASON_OFFLINE)
2296 fc_packet_t *fpkt = NULL; in fcp_send_scsi_ioctl() local
2580 fpkt = icmd->ipkt_fpkt; in fcp_send_scsi_ioctl()
2582 fpkt->pkt_tran_flags = FC_TRAN_CLASS3 | FC_TRAN_INTR; in fcp_send_scsi_ioctl()
2583 fpkt->pkt_tran_type = FC_PKT_FCP_READ; /* only rd for now */ in fcp_send_scsi_ioctl()
2584 fpkt->pkt_timeout = fscsi->scsi_timeout; in fcp_send_scsi_ioctl()
2591 fcmd = (struct fcp_cmd *)fpkt->pkt_cmd; in fcp_send_scsi_ioctl()
2620 hp = &fpkt->pkt_cmd_fhdr; in fcp_send_scsi_ioctl()
2644 FCP_CP_OUT((uint8_t *)fcmd, fpkt->pkt_cmd, in fcp_send_scsi_ioctl()
2645 fpkt->pkt_cmd_acc, sizeof (struct fcp_cmd)); in fcp_send_scsi_ioctl()
2659 fpkt); in fcp_send_scsi_ioctl()
2684 rsp = (struct fcp_rsp *)fpkt->pkt_resp; in fcp_send_scsi_ioctl()
2740 fcp_is_reconfig_needed(ptgt, fpkt); in fcp_send_scsi_ioctl()
2798 fscsi->scsi_pkt_state = fpkt->pkt_state; in fcp_send_scsi_ioctl()
2799 fscsi->scsi_pkt_action = fpkt->pkt_action; in fcp_send_scsi_ioctl()
2800 fscsi->scsi_pkt_reason = fpkt->pkt_reason; in fcp_send_scsi_ioctl()
2815 FCP_CP_IN(fpkt->pkt_data, in fcp_send_scsi_ioctl()
2817 fpkt->pkt_data_acc, in fcp_send_scsi_ioctl()
2866 fc_packet_t *fpkt) in fcp_is_reconfig_needed() argument
2880 report_lun = kmem_zalloc(fpkt->pkt_datalen, KM_SLEEP); in fcp_is_reconfig_needed()
2882 FCP_CP_IN(fpkt->pkt_data, report_lun, fpkt->pkt_data_acc, in fcp_is_reconfig_needed()
2883 fpkt->pkt_datalen); in fcp_is_reconfig_needed()
2892 lun_buflen = (fpkt->pkt_datalen - in fcp_is_reconfig_needed()
2936 kmem_free(report_lun, fpkt->pkt_datalen); in fcp_is_reconfig_needed()
2981 kmem_free(report_lun, fpkt->pkt_datalen); in fcp_is_reconfig_needed()
3282 struct fc_packet *fpkt; in fcp_tgt_send_plogi() local
3321 fpkt = icmd->ipkt_fpkt; in fcp_tgt_send_plogi()
3323 fpkt->pkt_tran_flags = FC_TRAN_CLASS3 | FC_TRAN_INTR; in fcp_tgt_send_plogi()
3324 fpkt->pkt_tran_type = FC_PKT_EXCHANGE; in fcp_tgt_send_plogi()
3325 fpkt->pkt_timeout = FCP_ELS_TIMEOUT; in fcp_tgt_send_plogi()
3330 hp = &fpkt->pkt_cmd_fhdr; in fcp_tgt_send_plogi()
3351 FCP_CP_OUT((uint8_t *)&logi, fpkt->pkt_cmd, in fcp_tgt_send_plogi()
3352 fpkt->pkt_cmd_acc, sizeof (struct la_els_logi)); in fcp_tgt_send_plogi()
3358 fc_ulp_login(pptr->port_fp_handle, &fpkt, 1); in fcp_tgt_send_plogi()
3370 *fc_pkt_state = fpkt->pkt_state; in fcp_tgt_send_plogi()
3371 *fc_pkt_reason = fpkt->pkt_reason; in fcp_tgt_send_plogi()
3372 *fc_pkt_action = fpkt->pkt_action; in fcp_tgt_send_plogi()
3423 struct fc_packet *fpkt; in fcp_ipkt_sema_init() local
3425 fpkt = icmd->ipkt_fpkt; in fcp_ipkt_sema_init()
3431 fpkt->pkt_comp = fcp_ipkt_sema_callback; in fcp_ipkt_sema_init()
3455 struct fc_packet *fpkt; in fcp_ipkt_sema_wait() local
3459 fpkt = icmd->ipkt_fpkt; in fcp_ipkt_sema_wait()
3469 switch (fpkt->pkt_state) { in fcp_ipkt_sema_wait()
3474 switch (fpkt->pkt_reason) { in fcp_ipkt_sema_wait()
3495 switch (fpkt->pkt_reason) { in fcp_ipkt_sema_wait()
3502 switch (fpkt->pkt_reason) { in fcp_ipkt_sema_wait()
3528 fcp_ipkt_sema_callback(struct fc_packet *fpkt) in fcp_ipkt_sema_callback() argument
3532 icmd = (struct fcp_ipkt *)fpkt->pkt_ulp_private; in fcp_ipkt_sema_callback()
5151 fc_packet_t *fpkt; in fcp_send_els() local
5189 fpkt = icmd->ipkt_fpkt; in fcp_send_els()
5191 fpkt->pkt_cmdlen = cmd_len; in fcp_send_els()
5192 fpkt->pkt_rsplen = resp_len; in fcp_send_els()
5193 fpkt->pkt_datalen = 0; in fcp_send_els()
5197 fpkt->pkt_tran_flags = FC_TRAN_CLASS3 | FC_TRAN_INTR; in fcp_send_els()
5198 fpkt->pkt_tran_type = FC_PKT_EXCHANGE; in fcp_send_els()
5199 fpkt->pkt_timeout = FCP_ELS_TIMEOUT; in fcp_send_els()
5202 hp = &fpkt->pkt_cmd_fhdr; in fcp_send_els()
5235 hp = &fpkt->pkt_cmd_fhdr; in fcp_send_els()
5240 FCP_CP_OUT((uint8_t *)&logi, fpkt->pkt_cmd, in fcp_send_els()
5241 fpkt->pkt_cmd_acc, sizeof (struct la_els_logi)); in fcp_send_els()
5250 rval = fc_ulp_login(pptr->port_fp_handle, &fpkt, 1); in fcp_send_els()
5277 hp = &fpkt->pkt_cmd_fhdr; in fcp_send_els()
5314 FCP_CP_OUT((uint8_t *)&prli, fpkt->pkt_cmd, in fcp_send_els()
5315 fpkt->pkt_cmd_acc, sizeof (struct la_els_prli)); in fcp_send_els()
5324 rval = fc_ulp_issue_els(pptr->port_fp_handle, fpkt); in fcp_send_els()
5550 fcp_unsol_callback(fc_packet_t *fpkt) in fcp_unsol_callback() argument
5552 struct fcp_ipkt *icmd = (struct fcp_ipkt *)fpkt->pkt_ulp_private; in fcp_unsol_callback()
5555 if (fpkt->pkt_state != FC_PKT_SUCCESS) { in fcp_unsol_callback()
5558 (void) fc_ulp_pkt_error(fpkt, &state, &reason, in fcp_unsol_callback()
5564 state, reason, fpkt->pkt_cmd_fhdr.ox_id, in fcp_unsol_callback()
5565 fpkt->pkt_cmd_fhdr.rx_id); in fcp_unsol_callback()
5600 fc_packet_t *fpkt; in fcp_unsol_prli() local
5630 fpkt = icmd->ipkt_fpkt; in fcp_unsol_prli()
5631 fpkt->pkt_tran_flags = FC_TRAN_CLASS3 | FC_TRAN_INTR; in fcp_unsol_prli()
5632 fpkt->pkt_tran_type = FC_PKT_OUTBOUND; in fcp_unsol_prli()
5633 fpkt->pkt_timeout = FCP_ELS_TIMEOUT; in fcp_unsol_prli()
5634 fpkt->pkt_cmdlen = sizeof (la_els_prli_t); in fcp_unsol_prli()
5635 fpkt->pkt_rsplen = 0; in fcp_unsol_prli()
5636 fpkt->pkt_datalen = 0; in fcp_unsol_prli()
5672 FCP_CP_OUT((uint8_t *)from, fpkt->pkt_resp, in fcp_unsol_prli()
5673 fpkt->pkt_resp_acc, sizeof (struct la_els_prli)); in fcp_unsol_prli()
5675 FCP_CP_OUT((uint8_t *)&prli, fpkt->pkt_cmd, in fcp_unsol_prli()
5676 fpkt->pkt_cmd_acc, sizeof (struct la_els_prli)); in fcp_unsol_prli()
5678 fcp_unsol_resp_init(fpkt, buf, R_CTL_ELS_RSP, FC_TYPE_EXTENDED_LS); in fcp_unsol_prli()
5685 if ((rval = fc_ulp_issue_els(pptr->port_fp_handle, fpkt)) != in fcp_unsol_prli()
5689 fcp_queue_ipkt(pptr, fpkt); in fcp_unsol_prli()
5739 fc_packet_t *fpkt; in fcp_icmd_alloc() local
5783 fpkt = icmd->ipkt_fpkt; in fcp_icmd_alloc()
5784 fpkt->pkt_data_cookie = (ddi_dma_cookie_t *)((caddr_t)icmd + in fcp_icmd_alloc()
5789 fpkt->pkt_fca_device = ptgt->tgt_fca_dev; in fcp_icmd_alloc()
5792 fpkt->pkt_comp = fcp_icmd_callback; in fcp_icmd_alloc()
5793 fpkt->pkt_tran_flags = (FC_TRAN_CLASS3 | FC_TRAN_INTR); in fcp_icmd_alloc()
5794 fpkt->pkt_cmdlen = cmd_len; in fcp_icmd_alloc()
5795 fpkt->pkt_rsplen = resp_len; in fcp_icmd_alloc()
5796 fpkt->pkt_datalen = data_len; in fcp_icmd_alloc()
5811 fpkt->pkt_ulp_rscn_infop = NULL; in fcp_icmd_alloc()
5813 fpkt->pkt_ulp_rscn_infop = kmem_zalloc( in fcp_icmd_alloc()
5815 if (fpkt->pkt_ulp_rscn_infop == NULL) { in fcp_icmd_alloc()
5822 if (fpkt->pkt_ulp_rscn_infop != NULL) { in fcp_icmd_alloc()
5825 rscnp = (fc_ulp_rscn_info_t *)fpkt->pkt_ulp_rscn_infop; in fcp_icmd_alloc()
5841 fpkt->pkt_pd = ptgt->tgt_pd_handle; in fcp_icmd_alloc()
5844 if (fc_ulp_init_packet(pptr->port_fp_handle, fpkt, KM_NOSLEEP) in fcp_icmd_alloc()
5854 if (fc_ulp_init_packet(pptr->port_fp_handle, fpkt, KM_NOSLEEP) in fcp_icmd_alloc()
5870 rval = fc_ulp_uninit_packet(pptr->port_fp_handle, fpkt); in fcp_icmd_alloc()
5889 if (fpkt->pkt_ulp_rscn_infop != NULL) { in fcp_icmd_alloc()
5890 kmem_free(fpkt->pkt_ulp_rscn_infop, in fcp_icmd_alloc()
5892 fpkt->pkt_ulp_rscn_infop = NULL; in fcp_icmd_alloc()
5968 fc_packet_t *fpkt; in fcp_alloc_dma() local
5973 fpkt = &icmd->ipkt_fc_packet; in fcp_alloc_dma()
5975 ASSERT(fpkt->pkt_cmd_dma == NULL && fpkt->pkt_data_dma == NULL && in fcp_alloc_dma()
5976 fpkt->pkt_resp_dma == NULL); in fcp_alloc_dma()
5981 fpkt->pkt_cmd = kmem_zalloc(fpkt->pkt_cmdlen, flags); in fcp_alloc_dma()
5982 if (fpkt->pkt_cmd == NULL) { in fcp_alloc_dma()
5986 fpkt->pkt_resp = kmem_zalloc(fpkt->pkt_rsplen, flags); in fcp_alloc_dma()
5987 if (fpkt->pkt_resp == NULL) { in fcp_alloc_dma()
5991 ASSERT(fpkt->pkt_cmdlen && fpkt->pkt_rsplen); in fcp_alloc_dma()
5993 rval = fcp_alloc_cmd_resp(pptr, fpkt, flags); in fcp_alloc_dma()
5995 ASSERT(fpkt->pkt_cmd_dma == NULL && in fcp_alloc_dma()
5996 fpkt->pkt_resp_dma == NULL); in fcp_alloc_dma()
6002 if ((fpkt->pkt_datalen != 0) && in fcp_alloc_dma()
6009 NULL, &fpkt->pkt_data_dma) != DDI_SUCCESS) { in fcp_alloc_dma()
6013 if (ddi_dma_mem_alloc(fpkt->pkt_data_dma, fpkt->pkt_datalen, in fcp_alloc_dma()
6015 DDI_DMA_DONTWAIT, NULL, &fpkt->pkt_data, in fcp_alloc_dma()
6016 &real_size, &fpkt->pkt_data_acc) != DDI_SUCCESS) { in fcp_alloc_dma()
6021 if (real_size < fpkt->pkt_datalen) { in fcp_alloc_dma()
6026 if (ddi_dma_addr_bind_handle(fpkt->pkt_data_dma, in fcp_alloc_dma()
6027 NULL, fpkt->pkt_data, real_size, DDI_DMA_READ | in fcp_alloc_dma()
6038 fpkt->pkt_data_cookie_cnt = ccount; in fcp_alloc_dma()
6040 cp = fpkt->pkt_data_cookie; in fcp_alloc_dma()
6045 ddi_dma_nextcookie(fpkt->pkt_data_dma, in fcp_alloc_dma()
6050 } else if (fpkt->pkt_datalen != 0) { in fcp_alloc_dma()
6055 fpkt->pkt_data = kmem_alloc(fpkt->pkt_datalen, flags); in fcp_alloc_dma()
6056 if (fpkt->pkt_data == NULL) { in fcp_alloc_dma()
6066 (void) ddi_dma_unbind_handle(fpkt->pkt_data_dma); in fcp_alloc_dma()
6069 if (fpkt->pkt_data_dma) { in fcp_alloc_dma()
6070 if (fpkt->pkt_data) { in fcp_alloc_dma()
6071 ddi_dma_mem_free(&fpkt->pkt_data_acc); in fcp_alloc_dma()
6073 ddi_dma_free_handle(&fpkt->pkt_data_dma); in fcp_alloc_dma()
6075 if (fpkt->pkt_data) { in fcp_alloc_dma()
6076 kmem_free(fpkt->pkt_data, fpkt->pkt_datalen); in fcp_alloc_dma()
6081 if (fpkt->pkt_cmd) { in fcp_alloc_dma()
6082 kmem_free(fpkt->pkt_cmd, fpkt->pkt_cmdlen); in fcp_alloc_dma()
6084 if (fpkt->pkt_resp) { in fcp_alloc_dma()
6085 kmem_free(fpkt->pkt_resp, fpkt->pkt_rsplen); in fcp_alloc_dma()
6089 fcp_free_cmd_resp(pptr, fpkt); in fcp_alloc_dma()
6100 fc_packet_t *fpkt = icmd->ipkt_fpkt; in fcp_free_dma() local
6102 if (fpkt->pkt_data_dma) { in fcp_free_dma()
6103 (void) ddi_dma_unbind_handle(fpkt->pkt_data_dma); in fcp_free_dma()
6104 if (fpkt->pkt_data) { in fcp_free_dma()
6105 ddi_dma_mem_free(&fpkt->pkt_data_acc); in fcp_free_dma()
6107 ddi_dma_free_handle(&fpkt->pkt_data_dma); in fcp_free_dma()
6109 if (fpkt->pkt_data) { in fcp_free_dma()
6110 kmem_free(fpkt->pkt_data, fpkt->pkt_datalen); in fcp_free_dma()
6118 if (fpkt->pkt_cmd) { in fcp_free_dma()
6119 kmem_free(fpkt->pkt_cmd, icmd->ipkt_cmdlen); in fcp_free_dma()
6121 if (fpkt->pkt_resp) { in fcp_free_dma()
6122 kmem_free(fpkt->pkt_resp, icmd->ipkt_resplen); in fcp_free_dma()
6125 ASSERT(fpkt->pkt_resp_dma != NULL && fpkt->pkt_cmd_dma != NULL); in fcp_free_dma()
6127 fcp_free_cmd_resp(pptr, fpkt); in fcp_free_dma()
6201 fcp_icmd_callback(fc_packet_t *fpkt) in fcp_icmd_callback() argument
6217 icmd = (struct fcp_ipkt *)fpkt->pkt_ulp_private; in fcp_icmd_callback()
6223 FCP_CP_IN(fpkt->pkt_resp, &resp, fpkt->pkt_resp_acc, sizeof (resp)); in fcp_icmd_callback()
6226 FCP_CP_IN(fpkt->pkt_cmd, &prli_s, fpkt->pkt_cmd_acc, in fcp_icmd_callback()
6234 icmd->ipkt_opcode, fpkt->pkt_state, fpkt->pkt_reason, in fcp_icmd_callback()
6237 if ((fpkt->pkt_state == FC_PKT_SUCCESS) && in fcp_icmd_callback()
6249 ASSERT(fpkt->pkt_pd != NULL); in fcp_icmd_callback()
6250 ptgt->tgt_pd_handle = fpkt->pkt_pd; in fcp_icmd_callback()
6287 FCP_CP_IN(fpkt->pkt_resp, prli, fpkt->pkt_resp_acc, in fcp_icmd_callback()
6426 if (FCP_MUST_RETRY(fpkt)) { in fcp_icmd_callback()
6427 fcp_queue_ipkt(pptr, fpkt); in fcp_icmd_callback()
6434 " reason= %x", ptgt->tgt_d_id, fpkt->pkt_state, in fcp_icmd_callback()
6435 fpkt->pkt_reason); in fcp_icmd_callback()
6449 if (fpkt->pkt_state == FC_PKT_TIMEOUT) { in fcp_icmd_callback()
6450 fpkt->pkt_timeout += in fcp_icmd_callback()
6455 fpkt); in fcp_icmd_callback()
6462 fcp_queue_ipkt(pptr, fpkt); in fcp_icmd_callback()
6482 if (FCP_MUST_RETRY(fpkt)) { in fcp_icmd_callback()
6483 fcp_queue_ipkt(pptr, fpkt); in fcp_icmd_callback()
6489 fpkt->pkt_state != FC_PKT_PORT_OFFLINE) { in fcp_icmd_callback()
6491 fcp_print_error(fpkt); in fcp_icmd_callback()
6526 fc_packet_t *fpkt; in fcp_send_scsi() local
6552 fpkt = icmd->ipkt_fpkt; in fcp_send_scsi()
6553 fpkt->pkt_tran_flags = FC_TRAN_CLASS3 | FC_TRAN_INTR; in fcp_send_scsi()
6559 fcmd = (struct fcp_cmd *)fpkt->pkt_cmd; in fcp_send_scsi()
6565 fpkt->pkt_timeout = FCP_SCSI_CMD_TIMEOUT; in fcp_send_scsi()
6567 hp = &fpkt->pkt_cmd_fhdr; in fcp_send_scsi()
6608 fpkt->pkt_tran_type = FC_PKT_FCP_READ; in fcp_send_scsi()
6609 fpkt->pkt_comp = fcp_scsi_callback; in fcp_send_scsi()
6622 fpkt->pkt_tran_type = FC_PKT_FCP_READ; in fcp_send_scsi()
6623 fpkt->pkt_comp = fcp_scsi_callback; in fcp_send_scsi()
6648 fpkt->pkt_tran_type = FC_PKT_FCP_READ; in fcp_send_scsi()
6649 fpkt->pkt_comp = fcp_scsi_callback; in fcp_send_scsi()
6666 FCP_CP_OUT((uint8_t *)fcmd, fpkt->pkt_cmd, in fcp_send_scsi()
6667 fpkt->pkt_cmd_acc, sizeof (struct fcp_cmd)); in fcp_send_scsi()
6674 if (fcp_transport(pptr->port_fp_handle, fpkt, 1) != in fcp_send_scsi()
6697 fcp_check_reportlun(struct fcp_rsp *rsp, fc_packet_t *fpkt) in fcp_check_reportlun() argument
6703 fpkt->pkt_ulp_private; in fcp_check_reportlun()
6721 FCP_CP_IN(fpkt->pkt_resp, &new_resp, in fcp_check_reportlun()
6722 fpkt->pkt_resp_acc, sizeof (new_resp)); in fcp_check_reportlun()
6728 FCP_CP_OUT(&new_resp, fpkt->pkt_resp, in fcp_check_reportlun()
6729 fpkt->pkt_resp_acc, sizeof (new_resp)); in fcp_check_reportlun()
6732 FCP_CP_OUT(fcp_dummy_lun, fpkt->pkt_data, in fcp_check_reportlun()
6733 fpkt->pkt_data_acc, sizeof (fcp_dummy_lun)); in fcp_check_reportlun()
6760 sense = (struct scsi_extended_sense *)(fpkt->pkt_resp + in fcp_check_reportlun()
6763 FCP_CP_IN(fpkt->pkt_resp + sizeof (struct fcp_rsp) + in fcp_check_reportlun()
6764 rsp->fcp_response_len, sense, fpkt->pkt_resp_acc, in fcp_check_reportlun()
6784 FCP_CP_IN(fpkt->pkt_resp, &new_resp, in fcp_check_reportlun()
6785 fpkt->pkt_resp_acc, sizeof (new_resp)); in fcp_check_reportlun()
6791 FCP_CP_OUT(&new_resp, fpkt->pkt_resp, in fcp_check_reportlun()
6792 fpkt->pkt_resp_acc, sizeof (new_resp)); in fcp_check_reportlun()
6795 FCP_CP_OUT(fcp_dummy_lun, fpkt->pkt_data, in fcp_check_reportlun()
6796 fpkt->pkt_data_acc, sizeof (fcp_dummy_lun)); in fcp_check_reportlun()
6814 FCP_CP_IN(fpkt->pkt_resp, &new_resp, in fcp_check_reportlun()
6815 fpkt->pkt_resp_acc, sizeof (new_resp)); in fcp_check_reportlun()
6821 FCP_CP_OUT(&new_resp, fpkt->pkt_resp, in fcp_check_reportlun()
6822 fpkt->pkt_resp_acc, sizeof (new_resp)); in fcp_check_reportlun()
6825 FCP_CP_OUT(fcp_dummy_lun, fpkt->pkt_data, in fcp_check_reportlun()
6826 fpkt->pkt_data_acc, sizeof (fcp_dummy_lun)); in fcp_check_reportlun()
6881 fpkt->pkt_cmd_fhdr.d_id, sense->es_key, in fcp_check_reportlun()
6900 fcp_scsi_callback(fc_packet_t *fpkt) in fcp_scsi_callback() argument
6903 fpkt->pkt_ulp_private; in fcp_scsi_callback()
6915 rsp = (struct fcp_rsp *)fpkt->pkt_resp; in fcp_scsi_callback()
6918 FCP_CP_IN(fpkt->pkt_resp, rsp, fpkt->pkt_resp_acc, in fcp_scsi_callback()
6926 fpkt->pkt_state, ptgt->tgt_d_id, icmd->ipkt_opcode, in fcp_scsi_callback()
6953 if ((fpkt->pkt_state != FC_PKT_SUCCESS) && in fcp_scsi_callback()
6954 (fpkt->pkt_reason == FC_REASON_OVERRUN) && in fcp_scsi_callback()
6956 fpkt->pkt_state = FC_PKT_SUCCESS; in fcp_scsi_callback()
6959 if (fpkt->pkt_state != FC_PKT_SUCCESS) { in fcp_scsi_callback()
6962 "icmd failed with state=0x%x for %x", fpkt->pkt_state, in fcp_scsi_callback()
6965 if (fpkt->pkt_reason == FC_REASON_CRC_ERROR) { in fcp_scsi_callback()
6971 (void) fcp_handle_page83(fpkt, icmd, 1); in fcp_scsi_callback()
6975 if (fpkt->pkt_state == FC_PKT_TIMEOUT || in fcp_scsi_callback()
6976 FCP_MUST_RETRY(fpkt)) { in fcp_scsi_callback()
6977 fpkt->pkt_timeout += FCP_TIMEOUT_DELTA; in fcp_scsi_callback()
6978 fcp_retry_scsi_cmd(fpkt); in fcp_scsi_callback()
6990 fcp_print_error(fpkt); in fcp_scsi_callback()
7027 bep = (struct fcp_rsp_info *)(fpkt->pkt_resp + in fcp_scsi_callback()
7031 FCP_CP_IN(fpkt->pkt_resp + sizeof (struct fcp_rsp), bep, in fcp_scsi_callback()
7032 fpkt->pkt_resp_acc, sizeof (struct fcp_rsp_info)); in fcp_scsi_callback()
7036 fcp_retry_scsi_cmd(fpkt); in fcp_scsi_callback()
7046 fcp_retry_scsi_cmd(fpkt); in fcp_scsi_callback()
7052 fcp_queue_ipkt(pptr, fpkt); in fcp_scsi_callback()
7088 fpkt->pkt_state = FC_PKT_LOCAL_RJT; in fcp_scsi_callback()
7089 (void) fcp_handle_page83(fpkt, icmd, 1); in fcp_scsi_callback()
7114 rval = fcp_check_reportlun(rsp, fpkt); in fcp_scsi_callback()
7124 FCP_CP_IN(fpkt->pkt_resp, rsp, in fcp_scsi_callback()
7125 fpkt->pkt_resp_acc, in fcp_scsi_callback()
7137 fcp_retry_scsi_cmd(fpkt); in fcp_scsi_callback()
7152 (void) ddi_dma_sync(fpkt->pkt_data_dma, 0, 0, in fcp_scsi_callback()
7159 fcp_handle_inquiry(fpkt, icmd); in fcp_scsi_callback()
7165 fcp_handle_reportlun(fpkt, icmd); in fcp_scsi_callback()
7170 (void) fcp_handle_page83(fpkt, icmd, 0); in fcp_scsi_callback()
7184 fcp_retry_scsi_cmd(fc_packet_t *fpkt) in fcp_retry_scsi_cmd() argument
7187 fpkt->pkt_ulp_private; in fcp_retry_scsi_cmd()
7201 fpkt->pkt_state, fpkt->pkt_reason); in fcp_retry_scsi_cmd()
7203 fcp_queue_ipkt(pptr, fpkt); in fcp_retry_scsi_cmd()
7216 fcp_print_error(fpkt); in fcp_retry_scsi_cmd()
7237 fcp_handle_page83(fc_packet_t *fpkt, struct fcp_ipkt *icmd, in fcp_handle_page83() argument
7249 ASSERT(icmd != NULL && fpkt != NULL); in fcp_handle_page83()
7255 if (fpkt->pkt_state == FC_PKT_SUCCESS) { in fcp_handle_page83()
7258 FCP_CP_IN(fpkt->pkt_data, dev_id_page, fpkt->pkt_data_acc, in fcp_handle_page83()
7352 fcp_retry_scsi_cmd(fpkt); in fcp_handle_page83()
7392 fpkt->pkt_state, fpkt->pkt_reason, in fcp_handle_page83()
7441 fcp_handle_inquiry(fc_packet_t *fpkt, struct fcp_ipkt *icmd) in fcp_handle_inquiry() argument
7450 ASSERT(icmd != NULL && fpkt != NULL); in fcp_handle_inquiry()
7456 FCP_CP_IN(fpkt->pkt_data, &plun->lun_inq, fpkt->pkt_data_acc, in fcp_handle_inquiry()
7575 fcp_handle_reportlun(fc_packet_t *fpkt, struct fcp_ipkt *icmd) in fcp_handle_reportlun() argument
7590 len = fpkt->pkt_datalen; in fcp_handle_reportlun()
7600 FCP_CP_IN(fpkt->pkt_data, report_lun, fpkt->pkt_data_acc, in fcp_handle_reportlun()
7601 fpkt->pkt_datalen); in fcp_handle_reportlun()
7617 nluns_bufmax = (fpkt->pkt_datalen - FCP_LUN_HEADER) / FCP_LUN_SIZE; in fcp_handle_reportlun()
8737 fcp_cmd_callback(fc_packet_t *fpkt) in fcp_cmd_callback() argument
8739 struct fcp_pkt *cmd = (struct fcp_pkt *)fpkt->pkt_ulp_private; in fcp_cmd_callback()
8760 fcp_complete_pkt(fpkt); in fcp_cmd_callback()
8773 fcp_complete_pkt(fc_packet_t *fpkt) in fcp_complete_pkt() argument
8777 fpkt->pkt_ulp_private; in fcp_complete_pkt()
8791 if (fpkt->pkt_state == FC_PKT_SUCCESS) { in fcp_complete_pkt()
8793 FCP_CP_IN(fpkt->pkt_resp, rsp, fpkt->pkt_resp_acc, in fcp_complete_pkt()
8802 if (fpkt->pkt_datalen) { in fcp_complete_pkt()
8804 if (fpkt->pkt_data_resid) { in fcp_complete_pkt()
8868 FCP_CP_IN(fpkt->pkt_resp + in fcp_complete_pkt()
8870 fpkt->pkt_resp_acc, in fcp_complete_pkt()
8908 sense_from = (caddr_t)fpkt->pkt_resp + in fcp_complete_pkt()
8935 fpkt->pkt_resp_acc, rqlen); in fcp_complete_pkt()
9010 switch (fpkt->pkt_state) { in fcp_complete_pkt()
9012 switch (fpkt->pkt_reason) { in fcp_complete_pkt()
9054 if (fpkt->pkt_reason == FC_REASON_LOGIN_REQUIRED) { in fcp_complete_pkt()
9113 if (fpkt->pkt_reason == FC_REASON_ABORT_FAILED) { in fcp_complete_pkt()
9121 switch (fpkt->pkt_reason) { in fcp_complete_pkt()
9180 FCP_CP_IN(fpkt->pkt_resp, rsp, in fcp_complete_pkt()
9181 fpkt->pkt_resp_acc, in fcp_complete_pkt()
9220 fpkt->pkt_state, fpkt->pkt_reason); in fcp_complete_pkt()
9229 " pkt reason=0x%x", cmd, ptgt->tgt_d_id, fpkt->pkt_state, in fcp_complete_pkt()
9230 fpkt->pkt_reason); in fcp_complete_pkt()
9492 fcp_queue_ipkt(struct fcp_port *pptr, fc_packet_t *fpkt) in fcp_queue_ipkt() argument
9494 struct fcp_ipkt *icmd = (struct fcp_ipkt *)fpkt->pkt_ulp_private; in fcp_queue_ipkt()
9550 fcp_transport(opaque_t port_handle, fc_packet_t *fpkt, int internal) in fcp_transport() argument
9554 rval = fc_ulp_transport(port_handle, fpkt); in fcp_transport()
9600 icmd = (struct fcp_ipkt *)fpkt->pkt_ulp_private; in fcp_transport()
9627 cmd = (struct fcp_pkt *)fpkt->pkt_ulp_private; in fcp_transport()
10477 fc_packet_t *fpkt; in fcp_kmem_cache_constructor() local
10485 fpkt = (fc_packet_t *)&cmd->cmd_fc_packet; in fcp_kmem_cache_constructor()
10486 cmd->cmd_fp_pkt = fpkt; in fcp_kmem_cache_constructor()
10493 fpkt->pkt_data_cookie = (ddi_dma_cookie_t *)((caddr_t)cmd + in fcp_kmem_cache_constructor()
10496 fpkt->pkt_cmdlen = sizeof (struct fcp_cmd); in fcp_kmem_cache_constructor()
10497 fpkt->pkt_rsplen = FCP_MAX_RSP_IU_SIZE; in fcp_kmem_cache_constructor()
10508 fpkt->pkt_resp_acc = fpkt->pkt_cmd_acc = NULL; in fcp_kmem_cache_constructor()
10509 fpkt->pkt_cmd = (caddr_t)&cmd->cmd_fcp_cmd; in fcp_kmem_cache_constructor()
10510 fpkt->pkt_resp = cmd->cmd_fcp_rsp; in fcp_kmem_cache_constructor()
10517 if (fcp_alloc_cmd_resp(pptr, fpkt, kmflags) != FC_SUCCESS) { in fcp_kmem_cache_constructor()
10579 fcp_alloc_cmd_resp(struct fcp_port *pptr, fc_packet_t *fpkt, int flags) in fcp_alloc_cmd_resp() argument
10592 cmd_len = fpkt->pkt_cmdlen; in fcp_alloc_cmd_resp()
10593 resp_len = fpkt->pkt_rsplen; in fcp_alloc_cmd_resp()
10595 ASSERT(fpkt->pkt_cmd_dma == NULL); in fcp_alloc_cmd_resp()
10599 cb, NULL, &fpkt->pkt_cmd_dma) != DDI_SUCCESS) { in fcp_alloc_cmd_resp()
10604 rval = ddi_dma_mem_alloc(fpkt->pkt_cmd_dma, cmd_len, in fcp_alloc_cmd_resp()
10606 (caddr_t *)&fpkt->pkt_cmd, &real_len, &fpkt->pkt_cmd_acc); in fcp_alloc_cmd_resp()
10609 ddi_dma_free_handle(&fpkt->pkt_cmd_dma); in fcp_alloc_cmd_resp()
10614 ddi_dma_mem_free(&fpkt->pkt_cmd_acc); in fcp_alloc_cmd_resp()
10615 ddi_dma_free_handle(&fpkt->pkt_cmd_dma); in fcp_alloc_cmd_resp()
10620 rval = ddi_dma_addr_bind_handle(fpkt->pkt_cmd_dma, NULL, in fcp_alloc_cmd_resp()
10621 fpkt->pkt_cmd, real_len, DDI_DMA_WRITE | DDI_DMA_CONSISTENT, in fcp_alloc_cmd_resp()
10622 cb, NULL, &pkt_cookie, &fpkt->pkt_cmd_cookie_cnt); in fcp_alloc_cmd_resp()
10625 ddi_dma_mem_free(&fpkt->pkt_cmd_acc); in fcp_alloc_cmd_resp()
10626 ddi_dma_free_handle(&fpkt->pkt_cmd_dma); in fcp_alloc_cmd_resp()
10630 if (fpkt->pkt_cmd_cookie_cnt > in fcp_alloc_cmd_resp()
10632 (void) ddi_dma_unbind_handle(fpkt->pkt_cmd_dma); in fcp_alloc_cmd_resp()
10633 ddi_dma_mem_free(&fpkt->pkt_cmd_acc); in fcp_alloc_cmd_resp()
10634 ddi_dma_free_handle(&fpkt->pkt_cmd_dma); in fcp_alloc_cmd_resp()
10638 ASSERT(fpkt->pkt_cmd_cookie_cnt != 0); in fcp_alloc_cmd_resp()
10644 cp = fpkt->pkt_cmd_cookie = (ddi_dma_cookie_t *)kmem_alloc( in fcp_alloc_cmd_resp()
10645 fpkt->pkt_cmd_cookie_cnt * sizeof (pkt_cookie), in fcp_alloc_cmd_resp()
10649 (void) ddi_dma_unbind_handle(fpkt->pkt_cmd_dma); in fcp_alloc_cmd_resp()
10650 ddi_dma_mem_free(&fpkt->pkt_cmd_acc); in fcp_alloc_cmd_resp()
10651 ddi_dma_free_handle(&fpkt->pkt_cmd_dma); in fcp_alloc_cmd_resp()
10662 for (cnt = 1; cnt < fpkt->pkt_cmd_cookie_cnt; cnt++, cp++) { in fcp_alloc_cmd_resp()
10663 ddi_dma_nextcookie(fpkt->pkt_cmd_dma, in fcp_alloc_cmd_resp()
10668 ASSERT(fpkt->pkt_resp_dma == NULL); in fcp_alloc_cmd_resp()
10670 cb, NULL, &fpkt->pkt_resp_dma) != DDI_SUCCESS) { in fcp_alloc_cmd_resp()
10671 (void) ddi_dma_unbind_handle(fpkt->pkt_cmd_dma); in fcp_alloc_cmd_resp()
10672 ddi_dma_mem_free(&fpkt->pkt_cmd_acc); in fcp_alloc_cmd_resp()
10673 ddi_dma_free_handle(&fpkt->pkt_cmd_dma); in fcp_alloc_cmd_resp()
10677 rval = ddi_dma_mem_alloc(fpkt->pkt_resp_dma, resp_len, in fcp_alloc_cmd_resp()
10679 (caddr_t *)&fpkt->pkt_resp, &real_len, in fcp_alloc_cmd_resp()
10680 &fpkt->pkt_resp_acc); in fcp_alloc_cmd_resp()
10683 ddi_dma_free_handle(&fpkt->pkt_resp_dma); in fcp_alloc_cmd_resp()
10684 (void) ddi_dma_unbind_handle(fpkt->pkt_cmd_dma); in fcp_alloc_cmd_resp()
10685 ddi_dma_mem_free(&fpkt->pkt_cmd_acc); in fcp_alloc_cmd_resp()
10686 ddi_dma_free_handle(&fpkt->pkt_cmd_dma); in fcp_alloc_cmd_resp()
10687 kmem_free(fpkt->pkt_cmd_cookie, in fcp_alloc_cmd_resp()
10688 fpkt->pkt_cmd_cookie_cnt * sizeof (pkt_cookie)); in fcp_alloc_cmd_resp()
10693 ddi_dma_mem_free(&fpkt->pkt_resp_acc); in fcp_alloc_cmd_resp()
10694 ddi_dma_free_handle(&fpkt->pkt_resp_dma); in fcp_alloc_cmd_resp()
10695 (void) ddi_dma_unbind_handle(fpkt->pkt_cmd_dma); in fcp_alloc_cmd_resp()
10696 ddi_dma_mem_free(&fpkt->pkt_cmd_acc); in fcp_alloc_cmd_resp()
10697 ddi_dma_free_handle(&fpkt->pkt_cmd_dma); in fcp_alloc_cmd_resp()
10698 kmem_free(fpkt->pkt_cmd_cookie, in fcp_alloc_cmd_resp()
10699 fpkt->pkt_cmd_cookie_cnt * sizeof (pkt_cookie)); in fcp_alloc_cmd_resp()
10703 rval = ddi_dma_addr_bind_handle(fpkt->pkt_resp_dma, NULL, in fcp_alloc_cmd_resp()
10704 fpkt->pkt_resp, real_len, DDI_DMA_READ | DDI_DMA_CONSISTENT, in fcp_alloc_cmd_resp()
10705 cb, NULL, &pkt_cookie, &fpkt->pkt_resp_cookie_cnt); in fcp_alloc_cmd_resp()
10708 ddi_dma_mem_free(&fpkt->pkt_resp_acc); in fcp_alloc_cmd_resp()
10709 ddi_dma_free_handle(&fpkt->pkt_resp_dma); in fcp_alloc_cmd_resp()
10710 (void) ddi_dma_unbind_handle(fpkt->pkt_cmd_dma); in fcp_alloc_cmd_resp()
10711 ddi_dma_mem_free(&fpkt->pkt_cmd_acc); in fcp_alloc_cmd_resp()
10712 ddi_dma_free_handle(&fpkt->pkt_cmd_dma); in fcp_alloc_cmd_resp()
10713 kmem_free(fpkt->pkt_cmd_cookie, in fcp_alloc_cmd_resp()
10714 fpkt->pkt_cmd_cookie_cnt * sizeof (pkt_cookie)); in fcp_alloc_cmd_resp()
10718 if (fpkt->pkt_resp_cookie_cnt > in fcp_alloc_cmd_resp()
10720 ddi_dma_mem_free(&fpkt->pkt_resp_acc); in fcp_alloc_cmd_resp()
10721 ddi_dma_free_handle(&fpkt->pkt_resp_dma); in fcp_alloc_cmd_resp()
10722 (void) ddi_dma_unbind_handle(fpkt->pkt_cmd_dma); in fcp_alloc_cmd_resp()
10723 ddi_dma_mem_free(&fpkt->pkt_cmd_acc); in fcp_alloc_cmd_resp()
10724 ddi_dma_free_handle(&fpkt->pkt_cmd_dma); in fcp_alloc_cmd_resp()
10725 kmem_free(fpkt->pkt_cmd_cookie, in fcp_alloc_cmd_resp()
10726 fpkt->pkt_cmd_cookie_cnt * sizeof (pkt_cookie)); in fcp_alloc_cmd_resp()
10730 ASSERT(fpkt->pkt_resp_cookie_cnt != 0); in fcp_alloc_cmd_resp()
10732 cp = fpkt->pkt_resp_cookie = (ddi_dma_cookie_t *)kmem_alloc( in fcp_alloc_cmd_resp()
10733 fpkt->pkt_resp_cookie_cnt * sizeof (pkt_cookie), in fcp_alloc_cmd_resp()
10737 ddi_dma_mem_free(&fpkt->pkt_resp_acc); in fcp_alloc_cmd_resp()
10738 ddi_dma_free_handle(&fpkt->pkt_resp_dma); in fcp_alloc_cmd_resp()
10739 (void) ddi_dma_unbind_handle(fpkt->pkt_cmd_dma); in fcp_alloc_cmd_resp()
10740 ddi_dma_mem_free(&fpkt->pkt_cmd_acc); in fcp_alloc_cmd_resp()
10741 ddi_dma_free_handle(&fpkt->pkt_cmd_dma); in fcp_alloc_cmd_resp()
10742 kmem_free(fpkt->pkt_cmd_cookie, in fcp_alloc_cmd_resp()
10743 fpkt->pkt_cmd_cookie_cnt * sizeof (pkt_cookie)); in fcp_alloc_cmd_resp()
10750 for (cnt = 1; cnt < fpkt->pkt_resp_cookie_cnt; cnt++, cp++) { in fcp_alloc_cmd_resp()
10751 ddi_dma_nextcookie(fpkt->pkt_resp_dma, in fcp_alloc_cmd_resp()
10777 fcp_free_cmd_resp(struct fcp_port *pptr, fc_packet_t *fpkt) in fcp_free_cmd_resp() argument
10779 ASSERT(fpkt->pkt_resp_dma != NULL && fpkt->pkt_cmd_dma != NULL); in fcp_free_cmd_resp()
10781 if (fpkt->pkt_resp_dma) { in fcp_free_cmd_resp()
10782 (void) ddi_dma_unbind_handle(fpkt->pkt_resp_dma); in fcp_free_cmd_resp()
10783 ddi_dma_mem_free(&fpkt->pkt_resp_acc); in fcp_free_cmd_resp()
10784 ddi_dma_free_handle(&fpkt->pkt_resp_dma); in fcp_free_cmd_resp()
10787 if (fpkt->pkt_resp_cookie) { in fcp_free_cmd_resp()
10788 kmem_free(fpkt->pkt_resp_cookie, in fcp_free_cmd_resp()
10789 fpkt->pkt_resp_cookie_cnt * sizeof (ddi_dma_cookie_t)); in fcp_free_cmd_resp()
10790 fpkt->pkt_resp_cookie = NULL; in fcp_free_cmd_resp()
10793 if (fpkt->pkt_cmd_dma) { in fcp_free_cmd_resp()
10794 (void) ddi_dma_unbind_handle(fpkt->pkt_cmd_dma); in fcp_free_cmd_resp()
10795 ddi_dma_mem_free(&fpkt->pkt_cmd_acc); in fcp_free_cmd_resp()
10796 ddi_dma_free_handle(&fpkt->pkt_cmd_dma); in fcp_free_cmd_resp()
10799 if (fpkt->pkt_cmd_cookie) { in fcp_free_cmd_resp()
10800 kmem_free(fpkt->pkt_cmd_cookie, in fcp_free_cmd_resp()
10801 fpkt->pkt_cmd_cookie_cnt * sizeof (ddi_dma_cookie_t)); in fcp_free_cmd_resp()
10802 fpkt->pkt_cmd_cookie = NULL; in fcp_free_cmd_resp()
11384 fc_packet_t *fpkt; in fcp_pkt_setup() local
11392 fpkt = cmd->cmd_fp_pkt; in fcp_pkt_setup()
11417 fpkt = cmd->cmd_fp_pkt; in fcp_pkt_setup()
11418 fpkt->pkt_data_acc = NULL; in fcp_pkt_setup()
11429 fpkt->pkt_pd = ptgt->tgt_pd_handle; in fcp_pkt_setup()
11431 if (fc_ulp_init_packet(pptr->port_fp_handle, fpkt, kf) in fcp_pkt_setup()
11440 hp = &fpkt->pkt_cmd_fhdr; in fcp_pkt_setup()
14153 fc_packet_t *fpkt = cmd->cmd_fp_pkt; in fcp_prepare_pkt() local
14164 fpkt->pkt_tran_type = FC_PKT_FCP_READ; in fcp_prepare_pkt()
14168 fpkt->pkt_tran_type = FC_PKT_FCP_WRITE; in fcp_prepare_pkt()
14171 fpkt->pkt_data_cookie = cmd->cmd_pkt->pkt_cookies; in fcp_prepare_pkt()
14173 fpkt->pkt_data_cookie_cnt = cmd->cmd_pkt->pkt_numcookies; in fcp_prepare_pkt()
14174 ASSERT(fpkt->pkt_data_cookie_cnt <= in fcp_prepare_pkt()
14180 fpkt->pkt_datalen = cmd->cmd_dmacount; in fcp_prepare_pkt()
14185 fpkt->pkt_tran_type = FC_PKT_EXCHANGE; in fcp_prepare_pkt()
14186 fpkt->pkt_datalen = 0; in fcp_prepare_pkt()
14204 FCP_CP_OUT((uint8_t *)fcmd, fpkt->pkt_cmd, in fcp_prepare_pkt()
14205 fpkt->pkt_cmd_acc, sizeof (struct fcp_cmd)); in fcp_prepare_pkt()
14207 ASSERT(fpkt->pkt_cmd_dma == NULL && fpkt->pkt_resp_dma == NULL); in fcp_prepare_pkt()
14218 fpkt->pkt_tran_flags = (FC_TRAN_CLASS3 | FC_TRAN_NO_INTR); in fcp_prepare_pkt()
14219 fpkt->pkt_comp = NULL; in fcp_prepare_pkt()
14221 fpkt->pkt_tran_flags = (FC_TRAN_CLASS3 | FC_TRAN_INTR); in fcp_prepare_pkt()
14223 fpkt->pkt_tran_flags |= FC_TRAN_IMMEDIATE_CB; in fcp_prepare_pkt()
14225 fpkt->pkt_comp = fcp_cmd_callback; in fcp_prepare_pkt()
14230 fpkt->pkt_tran_flags |= FC_TRAN_DUMPING; in fcp_prepare_pkt()
14234 fpkt->pkt_cmd_fhdr.d_id = ptgt->tgt_d_id; in fcp_prepare_pkt()
14235 fpkt->pkt_cmd_fhdr.s_id = pptr->port_id; in fcp_prepare_pkt()
14241 fpkt->pkt_fca_device = ptgt->tgt_fca_dev; in fcp_prepare_pkt()
14483 fc_packet_t *fpkt; in fcp_retransport_cmd() local
14507 fpkt = cmd->cmd_fp_pkt; in fcp_retransport_cmd()
14508 if ((fpkt->pkt_pd == NULL) && (ptgt->tgt_pd_handle != NULL)) { in fcp_retransport_cmd()
14509 fpkt->pkt_pd = ptgt->tgt_pd_handle; in fcp_retransport_cmd()
15218 fcp_print_error(fc_packet_t *fpkt) in fcp_print_error() argument
15221 fpkt->pkt_ulp_private; in fcp_print_error()
15265 if (scsi_cmd && fpkt->pkt_state == FC_PKT_SUCCESS) { in fcp_print_error()
15272 rsp = (struct fcp_rsp *)fpkt->pkt_resp; in fcp_print_error()
15279 FCP_CP_IN(fpkt->pkt_resp, rsp, fpkt->pkt_resp_acc, in fcp_print_error()
15282 FCP_CP_IN(fpkt->pkt_resp + sizeof (struct fcp_rsp), in fcp_print_error()
15283 bep, fpkt->pkt_resp_acc, in fcp_print_error()
15315 ((caddr_t)fpkt->pkt_resp + in fcp_print_error()
15321 FCP_CP_IN(fpkt->pkt_resp + in fcp_print_error()
15324 fpkt->pkt_resp_acc, in fcp_print_error()
15356 (void) fc_ulp_pkt_error(fpkt, &state, &reason, in fcp_print_error()
16248 fc_packet_t *fpkt = cmd->cmd_fp_pkt; in fcp_pseudo_start() local
16251 fpkt->pkt_pd = ptgt->tgt_pd_handle; in fcp_pseudo_start()
16259 fcmd->fcp_data_len = fpkt->pkt_datalen; in fcp_pseudo_start()
16282 fpkt->pkt_timeout = pkt->pkt_time + 2; in fcp_pseudo_start()
16283 fpkt->pkt_cmd_fhdr.d_id = ptgt->tgt_d_id; in fcp_pseudo_start()
16284 fpkt->pkt_cmd_fhdr.s_id = pptr->port_id; in fcp_pseudo_start()
16286 fpkt->pkt_tran_type = FC_PKT_FCP_READ; in fcp_pseudo_start()
16288 fpkt->pkt_tran_type = FC_PKT_FCP_WRITE; in fcp_pseudo_start()
16292 fpkt->pkt_comp = NULL; in fcp_pseudo_start()
16293 fpkt->pkt_tran_flags = (FC_TRAN_CLASS3 | FC_TRAN_NO_INTR); in fcp_pseudo_start()
16295 fpkt->pkt_comp = fcp_cmd_callback; in fcp_pseudo_start()
16296 fpkt->pkt_tran_flags = (FC_TRAN_CLASS3 | FC_TRAN_INTR); in fcp_pseudo_start()
16298 fpkt->pkt_tran_flags |= FC_TRAN_IMMEDIATE_CB; in fcp_pseudo_start()
16319 rval = fcp_transport(pptr->port_fp_handle, fpkt, 0); in fcp_pseudo_start()