diff options
author | James Smart <james.smart@emulex.com> | 2010-09-29 11:19:00 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-10-07 18:29:54 -0400 |
commit | 515e0aa21ec399ddcf783140a596312e83d20a80 (patch) | |
tree | 57d13e23e2458a66cdf5443c6f2180cd6bf512a1 /drivers/scsi/lpfc | |
parent | dcf2a4e0792e837d6133506444a033a95cbc9616 (diff) |
[SCSI] lpfc 8.3.17: BSG fixes
- Add support for bsg MBX_SLI4_CONFIG.
- Multiply linkup timeout in loopback test code by 100.
- Set iocb_stat to 0 in the lpfcdiag_loop_get_xri function.
Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/lpfc')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_bsg.c | 68 |
1 files changed, 66 insertions, 2 deletions
diff --git a/drivers/scsi/lpfc/lpfc_bsg.c b/drivers/scsi/lpfc/lpfc_bsg.c index 10cfc64782ad..f5d60b55f53a 100644 --- a/drivers/scsi/lpfc/lpfc_bsg.c +++ b/drivers/scsi/lpfc/lpfc_bsg.c | |||
@@ -1518,7 +1518,7 @@ lpfc_bsg_diag_mode(struct fc_bsg_job *job) | |||
1518 | loopback_mode = (struct diag_mode_set *) | 1518 | loopback_mode = (struct diag_mode_set *) |
1519 | job->request->rqst_data.h_vendor.vendor_cmd; | 1519 | job->request->rqst_data.h_vendor.vendor_cmd; |
1520 | link_flags = loopback_mode->type; | 1520 | link_flags = loopback_mode->type; |
1521 | timeout = loopback_mode->timeout; | 1521 | timeout = loopback_mode->timeout * 100; |
1522 | 1522 | ||
1523 | if ((phba->link_state == LPFC_HBA_ERROR) || | 1523 | if ((phba->link_state == LPFC_HBA_ERROR) || |
1524 | (psli->sli_flag & LPFC_BLOCK_MGMT_IO) || | 1524 | (psli->sli_flag & LPFC_BLOCK_MGMT_IO) || |
@@ -1732,7 +1732,7 @@ static int lpfcdiag_loop_get_xri(struct lpfc_hba *phba, uint16_t rpi, | |||
1732 | struct lpfc_sli_ct_request *ctreq = NULL; | 1732 | struct lpfc_sli_ct_request *ctreq = NULL; |
1733 | int ret_val = 0; | 1733 | int ret_val = 0; |
1734 | int time_left; | 1734 | int time_left; |
1735 | int iocb_stat; | 1735 | int iocb_stat = 0; |
1736 | unsigned long flags; | 1736 | unsigned long flags; |
1737 | 1737 | ||
1738 | *txxri = 0; | 1738 | *txxri = 0; |
@@ -2473,6 +2473,17 @@ lpfc_bsg_wake_mbox_wait(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmboxq) | |||
2473 | to += sizeof(MAILBOX_t); | 2473 | to += sizeof(MAILBOX_t); |
2474 | size = pmboxq->u.mb.un.varWords[5]; | 2474 | size = pmboxq->u.mb.un.varWords[5]; |
2475 | memcpy(to, from, size); | 2475 | memcpy(to, from, size); |
2476 | } else if ((phba->sli_rev == LPFC_SLI_REV4) && | ||
2477 | (pmboxq->u.mb.mbxCommand == MBX_SLI4_CONFIG)) { | ||
2478 | struct lpfc_mbx_nembed_cmd *nembed_sge = | ||
2479 | (struct lpfc_mbx_nembed_cmd *) | ||
2480 | &pmboxq->u.mb.un.varWords[0]; | ||
2481 | |||
2482 | from = (uint8_t *)dd_data->context_un.mbox.dmp->dma. | ||
2483 | virt; | ||
2484 | to += sizeof(MAILBOX_t); | ||
2485 | size = nembed_sge->sge[0].length; | ||
2486 | memcpy(to, from, size); | ||
2476 | } else if (pmboxq->u.mb.mbxCommand == MBX_READ_EVENT_LOG) { | 2487 | } else if (pmboxq->u.mb.mbxCommand == MBX_READ_EVENT_LOG) { |
2477 | from = (uint8_t *)dd_data->context_un. | 2488 | from = (uint8_t *)dd_data->context_un. |
2478 | mbox.dmp->dma.virt; | 2489 | mbox.dmp->dma.virt; |
@@ -2914,6 +2925,59 @@ lpfc_bsg_issue_mbox(struct lpfc_hba *phba, struct fc_bsg_job *job, | |||
2914 | from += sizeof(MAILBOX_t); | 2925 | from += sizeof(MAILBOX_t); |
2915 | memcpy((uint8_t *)dmp->dma.virt, from, | 2926 | memcpy((uint8_t *)dmp->dma.virt, from, |
2916 | bde->tus.f.bdeSize); | 2927 | bde->tus.f.bdeSize); |
2928 | } else if (pmb->mbxCommand == MBX_SLI4_CONFIG) { | ||
2929 | struct lpfc_mbx_nembed_cmd *nembed_sge; | ||
2930 | struct mbox_header *header; | ||
2931 | uint32_t receive_length; | ||
2932 | |||
2933 | /* rebuild the command for sli4 using our own buffers | ||
2934 | * like we do for biu diags | ||
2935 | */ | ||
2936 | header = (struct mbox_header *)&pmb->un.varWords[0]; | ||
2937 | nembed_sge = (struct lpfc_mbx_nembed_cmd *) | ||
2938 | &pmb->un.varWords[0]; | ||
2939 | receive_length = nembed_sge->sge[0].length; | ||
2940 | |||
2941 | /* receive length cannot be greater than mailbox | ||
2942 | * extension size | ||
2943 | */ | ||
2944 | if ((receive_length == 0) || | ||
2945 | (receive_length > MAILBOX_EXT_SIZE)) { | ||
2946 | rc = -ERANGE; | ||
2947 | goto job_done; | ||
2948 | } | ||
2949 | |||
2950 | rxbmp = kmalloc(sizeof(struct lpfc_dmabuf), GFP_KERNEL); | ||
2951 | if (!rxbmp) { | ||
2952 | rc = -ENOMEM; | ||
2953 | goto job_done; | ||
2954 | } | ||
2955 | |||
2956 | rxbmp->virt = lpfc_mbuf_alloc(phba, 0, &rxbmp->phys); | ||
2957 | if (!rxbmp->virt) { | ||
2958 | rc = -ENOMEM; | ||
2959 | goto job_done; | ||
2960 | } | ||
2961 | |||
2962 | INIT_LIST_HEAD(&rxbmp->list); | ||
2963 | rxbpl = (struct ulp_bde64 *) rxbmp->virt; | ||
2964 | dmp = diag_cmd_data_alloc(phba, rxbpl, receive_length, | ||
2965 | 0); | ||
2966 | if (!dmp) { | ||
2967 | rc = -ENOMEM; | ||
2968 | goto job_done; | ||
2969 | } | ||
2970 | |||
2971 | INIT_LIST_HEAD(&dmp->dma.list); | ||
2972 | nembed_sge->sge[0].pa_hi = putPaddrHigh(dmp->dma.phys); | ||
2973 | nembed_sge->sge[0].pa_lo = putPaddrLow(dmp->dma.phys); | ||
2974 | /* copy the transmit data found in the mailbox | ||
2975 | * extension area | ||
2976 | */ | ||
2977 | from = (uint8_t *)mb; | ||
2978 | from += sizeof(MAILBOX_t); | ||
2979 | memcpy((uint8_t *)dmp->dma.virt, from, | ||
2980 | header->cfg_mhdr.payload_length); | ||
2917 | } | 2981 | } |
2918 | } | 2982 | } |
2919 | 2983 | ||