~ubuntu-branches/ubuntu/quantal/linux-linaro-mx51/quantal

« back to all changes in this revision

Viewing changes to drivers/scsi/lpfc/lpfc_scsi.c

  • Committer: Package Import Robot
  • Author(s): John Rigby, John Rigby
  • Date: 2011-09-26 10:44:23 UTC
  • Revision ID: package-import@ubuntu.com-20110926104423-3o58a3c1bj7x00rs
Tags: 3.0.0-1007.9
[ John Rigby ]

Enable crypto modules and remove crypto-modules from
exclude-module files
LP: #826021

Show diffs side-by-side

added added

removed removed

Lines of Context:
743
743
                if (bcnt == 0)
744
744
                        continue;
745
745
                /* Now, post the SCSI buffer list sgls as a block */
746
 
                status = lpfc_sli4_post_scsi_sgl_block(phba, &sblist, bcnt);
 
746
                if (!phba->sli4_hba.extents_in_use)
 
747
                        status = lpfc_sli4_post_scsi_sgl_block(phba,
 
748
                                                        &sblist,
 
749
                                                        bcnt);
 
750
                else
 
751
                        status = lpfc_sli4_post_scsi_sgl_blk_ext(phba,
 
752
                                                        &sblist,
 
753
                                                        bcnt);
747
754
                /* Reset SCSI buffer count for next round of posting */
748
755
                bcnt = 0;
749
756
                while (!list_empty(&sblist)) {
787
794
        dma_addr_t pdma_phys_fcp_cmd;
788
795
        dma_addr_t pdma_phys_fcp_rsp;
789
796
        dma_addr_t pdma_phys_bpl, pdma_phys_bpl1;
790
 
        uint16_t iotag, last_xritag = NO_XRI;
 
797
        uint16_t iotag, last_xritag = NO_XRI, lxri = 0;
791
798
        int status = 0, index;
792
799
        int bcnt;
793
800
        int non_sequential_xri = 0;
823
830
                        break;
824
831
                }
825
832
 
826
 
                psb->cur_iocbq.sli4_xritag = lpfc_sli4_next_xritag(phba);
827
 
                if (psb->cur_iocbq.sli4_xritag == NO_XRI) {
 
833
                lxri = lpfc_sli4_next_xritag(phba);
 
834
                if (lxri == NO_XRI) {
828
835
                        pci_pool_free(phba->lpfc_scsi_dma_buf_pool,
829
836
                              psb->data, psb->dma_handle);
830
837
                        kfree(psb);
831
838
                        break;
832
839
                }
 
840
                psb->cur_iocbq.sli4_lxritag = lxri;
 
841
                psb->cur_iocbq.sli4_xritag = phba->sli4_hba.xri_ids[lxri];
833
842
                if (last_xritag != NO_XRI
834
843
                        && psb->cur_iocbq.sli4_xritag != (last_xritag+1)) {
835
844
                        non_sequential_xri = 1;
861
870
                 */
862
871
                sgl->addr_hi = cpu_to_le32(putPaddrHigh(pdma_phys_fcp_cmd));
863
872
                sgl->addr_lo = cpu_to_le32(putPaddrLow(pdma_phys_fcp_cmd));
 
873
                sgl->word2 = le32_to_cpu(sgl->word2);
864
874
                bf_set(lpfc_sli4_sge_last, sgl, 0);
865
875
                sgl->word2 = cpu_to_le32(sgl->word2);
866
876
                sgl->sge_len = cpu_to_le32(sizeof(struct fcp_cmnd));
869
879
                /* Setup the physical region for the FCP RSP */
870
880
                sgl->addr_hi = cpu_to_le32(putPaddrHigh(pdma_phys_fcp_rsp));
871
881
                sgl->addr_lo = cpu_to_le32(putPaddrLow(pdma_phys_fcp_rsp));
 
882
                sgl->word2 = le32_to_cpu(sgl->word2);
872
883
                bf_set(lpfc_sli4_sge_last, sgl, 1);
873
884
                sgl->word2 = cpu_to_le32(sgl->word2);
874
885
                sgl->sge_len = cpu_to_le32(sizeof(struct fcp_rsp));
914
925
                }
915
926
        }
916
927
        if (bcnt) {
917
 
                status = lpfc_sli4_post_scsi_sgl_block(phba, &sblist, bcnt);
 
928
                if (!phba->sli4_hba.extents_in_use)
 
929
                        status = lpfc_sli4_post_scsi_sgl_block(phba,
 
930
                                                                &sblist,
 
931
                                                                bcnt);
 
932
                else
 
933
                        status = lpfc_sli4_post_scsi_sgl_blk_ext(phba,
 
934
                                                                &sblist,
 
935
                                                                bcnt);
 
936
 
 
937
                if (status) {
 
938
                        lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI,
 
939
                                        "3021 SCSI SGL post error %d\n",
 
940
                                        status);
 
941
                        bcnt = 0;
 
942
                }
918
943
                /* Reset SCSI buffer count for next round of posting */
919
944
                while (!list_empty(&sblist)) {
920
945
                        list_remove_head(&sblist, psb, struct lpfc_scsi_buf,
2081
2106
                        dma_len = sg_dma_len(sgel);
2082
2107
                        sgl->addr_lo = cpu_to_le32(putPaddrLow(physaddr));
2083
2108
                        sgl->addr_hi = cpu_to_le32(putPaddrHigh(physaddr));
 
2109
                        sgl->word2 = le32_to_cpu(sgl->word2);
2084
2110
                        if ((num_bde + 1) == nseg)
2085
2111
                                bf_set(lpfc_sli4_sge_last, sgl, 1);
2086
2112
                        else
2794
2820
         * of the scsi_cmnd request_buffer
2795
2821
         */
2796
2822
        piocbq->iocb.ulpContext = pnode->nlp_rpi;
 
2823
        if (phba->sli_rev == LPFC_SLI_REV4)
 
2824
                piocbq->iocb.ulpContext =
 
2825
                  phba->sli4_hba.rpi_ids[pnode->nlp_rpi];
2797
2826
        if (pnode->nlp_fcp_info & NLP_FCP_2_DEVICE)
2798
2827
                piocbq->iocb.ulpFCP2Rcvy = 1;
2799
2828
        else
2807
2836
}
2808
2837
 
2809
2838
/**
2810
 
 * lpfc_scsi_prep_task_mgmt_cmnd - Convert SLI3 scsi TM cmd to FCP info unit
 
2839
 * lpfc_scsi_prep_task_mgmt_cmd - Convert SLI3 scsi TM cmd to FCP info unit
2811
2840
 * @vport: The virtual port for which this call is being executed.
2812
2841
 * @lpfc_cmd: Pointer to lpfc_scsi_buf data structure.
2813
2842
 * @lun: Logical unit number.
2851
2880
                lpfc_fcpcmd_to_iocb(piocb->unsli3.fcp_ext.icd, fcp_cmnd);
2852
2881
        piocb->ulpCommand = CMD_FCP_ICMND64_CR;
2853
2882
        piocb->ulpContext = ndlp->nlp_rpi;
 
2883
        if (vport->phba->sli_rev == LPFC_SLI_REV4) {
 
2884
                piocb->ulpContext =
 
2885
                  vport->phba->sli4_hba.rpi_ids[ndlp->nlp_rpi];
 
2886
        }
2854
2887
        if (ndlp->nlp_fcp_info & NLP_FCP_2_DEVICE) {
2855
2888
                piocb->ulpFCP2Rcvy = 1;
2856
2889
        }
3238
3271
        if (!lpfc_cmd) {
3239
3272
                lpfc_printf_vlog(vport, KERN_WARNING, LOG_FCP,
3240
3273
                         "2873 SCSI Layer I/O Abort Request IO CMPL Status "
3241
 
                         "x%x ID %d "
3242
 
                         "LUN %d snum %#lx\n", ret, cmnd->device->id,
3243
 
                         cmnd->device->lun, cmnd->serial_number);
 
3274
                         "x%x ID %d LUN %d\n",
 
3275
                         ret, cmnd->device->id, cmnd->device->lun);
3244
3276
                return SUCCESS;
3245
3277
        }
3246
3278
 
3318
3350
                lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP,
3319
3351
                                 "0748 abort handler timed out waiting "
3320
3352
                                 "for abort to complete: ret %#x, ID %d, "
3321
 
                                 "LUN %d, snum %#lx\n",
3322
 
                                 ret, cmnd->device->id, cmnd->device->lun,
3323
 
                                 cmnd->serial_number);
 
3353
                                 "LUN %d\n",
 
3354
                                 ret, cmnd->device->id, cmnd->device->lun);
3324
3355
        }
3325
3356
 
3326
3357
 out:
3327
3358
        lpfc_printf_vlog(vport, KERN_WARNING, LOG_FCP,
3328
3359
                         "0749 SCSI Layer I/O Abort Request Status x%x ID %d "
3329
 
                         "LUN %d snum %#lx\n", ret, cmnd->device->id,
3330
 
                         cmnd->device->lun, cmnd->serial_number);
 
3360
                         "LUN %d\n", ret, cmnd->device->id,
 
3361
                         cmnd->device->lun);
3331
3362
        return ret;
3332
3363
}
3333
3364
 
3407
3438
 
3408
3439
        lpfc_printf_vlog(vport, KERN_INFO, LOG_FCP,
3409
3440
                         "0702 Issue %s to TGT %d LUN %d "
3410
 
                         "rpi x%x nlp_flag x%x\n",
 
3441
                         "rpi x%x nlp_flag x%x Data: x%x x%x\n",
3411
3442
                         lpfc_taskmgmt_name(task_mgmt_cmd), tgt_id, lun_id,
3412
 
                         pnode->nlp_rpi, pnode->nlp_flag);
 
3443
                         pnode->nlp_rpi, pnode->nlp_flag, iocbq->sli4_xritag,
 
3444
                         iocbq->iocb_flag);
3413
3445
 
3414
3446
        status = lpfc_sli_issue_iocb_wait(phba, LPFC_FCP_RING,
3415
3447
                                          iocbq, iocbqrsp, lpfc_cmd->timeout);
3421
3453
                        ret = FAILED;
3422
3454
                lpfc_cmd->status = IOSTAT_DRIVER_REJECT;
3423
3455
                lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP,
3424
 
                         "0727 TMF %s to TGT %d LUN %d failed (%d, %d)\n",
 
3456
                         "0727 TMF %s to TGT %d LUN %d failed (%d, %d) "
 
3457
                         "iocb_flag x%x\n",
3425
3458
                         lpfc_taskmgmt_name(task_mgmt_cmd),
3426
3459
                         tgt_id, lun_id, iocbqrsp->iocb.ulpStatus,
3427
 
                         iocbqrsp->iocb.un.ulpWord[4]);
 
3460
                         iocbqrsp->iocb.un.ulpWord[4],
 
3461
                         iocbq->iocb_flag);
3428
3462
        } else if (status == IOCB_BUSY)
3429
3463
                ret = FAILED;
3430
3464
        else