aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJames Smart <james.smart@emulex.com>2012-01-18 16:23:48 -0500
committerJames Bottomley <JBottomley@Parallels.com>2012-02-19 09:08:52 -0500
commit3ef6d24cd9f473518dd7941e86cc2a5f8992eed0 (patch)
tree0ba650da57b6187e7d635a89d849e064ef58f885 /drivers
parent5954d7380f627371c4d8d7c59c08f9596aa2c674 (diff)
[SCSI] lpfc 8.3.29: BSG and User interface fixes
BSG and User interface fixes: - Fix driver processing an els command using 16Gb FC Adapter (126345) - Change SLI4 FC port internal loopback to inner internal (126409) - Fix bug with driver dump command type 4 using 16Gb FC Adapter (126406) - Create character device to take a reference on the driver (126082) Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com> Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/lpfc/lpfc_bsg.c14
-rw-r--r--drivers/scsi/lpfc/lpfc_hw.h4
-rw-r--r--drivers/scsi/lpfc/lpfc_init.c48
-rw-r--r--drivers/scsi/lpfc/lpfc_sli.c2
4 files changed, 63 insertions, 5 deletions
diff --git a/drivers/scsi/lpfc/lpfc_bsg.c b/drivers/scsi/lpfc/lpfc_bsg.c
index 56a86baece5b..6cb360d47ba3 100644
--- a/drivers/scsi/lpfc/lpfc_bsg.c
+++ b/drivers/scsi/lpfc/lpfc_bsg.c
@@ -589,7 +589,10 @@ lpfc_bsg_rport_els(struct fc_bsg_job *job)
589 } 589 }
590 cmdiocbq->iocb.un.elsreq64.bdl.bdeSize = 590 cmdiocbq->iocb.un.elsreq64.bdl.bdeSize =
591 (request_nseg + reply_nseg) * sizeof(struct ulp_bde64); 591 (request_nseg + reply_nseg) * sizeof(struct ulp_bde64);
592 cmdiocbq->iocb.ulpContext = rpi; 592 if (phba->sli_rev == LPFC_SLI_REV4)
593 cmdiocbq->iocb.ulpContext = phba->sli4_hba.rpi_ids[rpi];
594 else
595 cmdiocbq->iocb.ulpContext = rpi;
593 cmdiocbq->iocb_flag |= LPFC_IO_LIBDFC; 596 cmdiocbq->iocb_flag |= LPFC_IO_LIBDFC;
594 cmdiocbq->context1 = NULL; 597 cmdiocbq->context1 = NULL;
595 cmdiocbq->context2 = NULL; 598 cmdiocbq->context2 = NULL;
@@ -1768,7 +1771,7 @@ lpfc_sli4_bsg_set_internal_loopback(struct lpfc_hba *phba)
1768 bf_set(lpfc_mbx_set_diag_state_link_type, 1771 bf_set(lpfc_mbx_set_diag_state_link_type,
1769 &link_diag_loopback->u.req, phba->sli4_hba.lnk_info.lnk_tp); 1772 &link_diag_loopback->u.req, phba->sli4_hba.lnk_info.lnk_tp);
1770 bf_set(lpfc_mbx_set_diag_lpbk_type, &link_diag_loopback->u.req, 1773 bf_set(lpfc_mbx_set_diag_lpbk_type, &link_diag_loopback->u.req,
1771 LPFC_DIAG_LOOPBACK_TYPE_SERDES); 1774 LPFC_DIAG_LOOPBACK_TYPE_INTERNAL);
1772 1775
1773 mbxstatus = lpfc_sli_issue_mbox_wait(phba, pmboxq, LPFC_MBOX_TMO); 1776 mbxstatus = lpfc_sli_issue_mbox_wait(phba, pmboxq, LPFC_MBOX_TMO);
1774 if ((mbxstatus != MBX_SUCCESS) || (pmboxq->u.mb.mbxStatus)) { 1777 if ((mbxstatus != MBX_SUCCESS) || (pmboxq->u.mb.mbxStatus)) {
@@ -4556,7 +4559,12 @@ lpfc_bsg_issue_mbox(struct lpfc_hba *phba, struct fc_bsg_job *job,
4556 + sizeof(MAILBOX_t)); 4559 + sizeof(MAILBOX_t));
4557 } 4560 }
4558 } else if (phba->sli_rev == LPFC_SLI_REV4) { 4561 } else if (phba->sli_rev == LPFC_SLI_REV4) {
4559 if (pmb->mbxCommand == MBX_DUMP_MEMORY) { 4562 /* Let type 4 (well known data) through because the data is
4563 * returned in varwords[4-8]
4564 * otherwise check the recieve length and fetch the buffer addr
4565 */
4566 if ((pmb->mbxCommand == MBX_DUMP_MEMORY) &&
4567 (pmb->un.varDmp.type != DMP_WELL_KNOWN)) {
4560 /* rebuild the command for sli4 using our own buffers 4568 /* rebuild the command for sli4 using our own buffers
4561 * like we do for biu diags 4569 * like we do for biu diags
4562 */ 4570 */
diff --git a/drivers/scsi/lpfc/lpfc_hw.h b/drivers/scsi/lpfc/lpfc_hw.h
index 7245bead3755..7b3dbf316bb3 100644
--- a/drivers/scsi/lpfc/lpfc_hw.h
+++ b/drivers/scsi/lpfc/lpfc_hw.h
@@ -1,7 +1,7 @@
1/******************************************************************* 1/*******************************************************************
2 * This file is part of the Emulex Linux Device Driver for * 2 * This file is part of the Emulex Linux Device Driver for *
3 * Fibre Channel Host Bus Adapters. * 3 * Fibre Channel Host Bus Adapters. *
4 * Copyright (C) 2004-2010 Emulex. All rights reserved. * 4 * Copyright (C) 2004-2011 Emulex. All rights reserved. *
5 * EMULEX and SLI are trademarks of Emulex. * 5 * EMULEX and SLI are trademarks of Emulex. *
6 * www.emulex.com * 6 * www.emulex.com *
7 * * 7 * *
@@ -2567,6 +2567,8 @@ typedef struct {
2567 2567
2568#define DMP_MEM_REG 0x1 2568#define DMP_MEM_REG 0x1
2569#define DMP_NV_PARAMS 0x2 2569#define DMP_NV_PARAMS 0x2
2570#define DMP_LMSD 0x3 /* Link Module Serial Data */
2571#define DMP_WELL_KNOWN 0x4
2570 2572
2571#define DMP_REGION_VPD 0xe 2573#define DMP_REGION_VPD 0xe
2572#define DMP_VPD_SIZE 0x400 /* maximum amount of VPD */ 2574#define DMP_VPD_SIZE 0x400 /* maximum amount of VPD */
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index dfea2dada02c..d670b1c410ec 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -32,6 +32,7 @@
32#include <linux/aer.h> 32#include <linux/aer.h>
33#include <linux/slab.h> 33#include <linux/slab.h>
34#include <linux/firmware.h> 34#include <linux/firmware.h>
35#include <linux/miscdevice.h>
35 36
36#include <scsi/scsi.h> 37#include <scsi/scsi.h>
37#include <scsi/scsi_device.h> 38#include <scsi/scsi_device.h>
@@ -10012,6 +10013,36 @@ lpfc_io_resume(struct pci_dev *pdev)
10012 return; 10013 return;
10013} 10014}
10014 10015
10016/**
10017 * lpfc_mgmt_open - method called when 'lpfcmgmt' is opened from userspace
10018 * @inode: pointer to the inode representing the lpfcmgmt device
10019 * @filep: pointer to the file representing the open lpfcmgmt device
10020 *
10021 * This routine puts a reference count on the lpfc module whenever the
10022 * character device is opened
10023 **/
10024static int
10025lpfc_mgmt_open(struct inode *inode, struct file *filep)
10026{
10027 try_module_get(THIS_MODULE);
10028 return 0;
10029}
10030
10031/**
10032 * lpfc_mgmt_release - method called when 'lpfcmgmt' is closed in userspace
10033 * @inode: pointer to the inode representing the lpfcmgmt device
10034 * @filep: pointer to the file representing the open lpfcmgmt device
10035 *
10036 * This routine removes a reference count from the lpfc module when the
10037 * character device is closed
10038 **/
10039static int
10040lpfc_mgmt_release(struct inode *inode, struct file *filep)
10041{
10042 module_put(THIS_MODULE);
10043 return 0;
10044}
10045
10015static struct pci_device_id lpfc_id_table[] = { 10046static struct pci_device_id lpfc_id_table[] = {
10016 {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_VIPER, 10047 {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_VIPER,
10017 PCI_ANY_ID, PCI_ANY_ID, }, 10048 PCI_ANY_ID, PCI_ANY_ID, },
@@ -10124,6 +10155,17 @@ static struct pci_driver lpfc_driver = {
10124 .err_handler = &lpfc_err_handler, 10155 .err_handler = &lpfc_err_handler,
10125}; 10156};
10126 10157
10158static const struct file_operations lpfc_mgmt_fop = {
10159 .open = lpfc_mgmt_open,
10160 .release = lpfc_mgmt_release,
10161};
10162
10163static struct miscdevice lpfc_mgmt_dev = {
10164 .minor = MISC_DYNAMIC_MINOR,
10165 .name = "lpfcmgmt",
10166 .fops = &lpfc_mgmt_fop,
10167};
10168
10127/** 10169/**
10128 * lpfc_init - lpfc module initialization routine 10170 * lpfc_init - lpfc module initialization routine
10129 * 10171 *
@@ -10144,6 +10186,11 @@ lpfc_init(void)
10144 printk(LPFC_MODULE_DESC "\n"); 10186 printk(LPFC_MODULE_DESC "\n");
10145 printk(LPFC_COPYRIGHT "\n"); 10187 printk(LPFC_COPYRIGHT "\n");
10146 10188
10189 error = misc_register(&lpfc_mgmt_dev);
10190 if (error)
10191 printk(KERN_ERR "Could not register lpfcmgmt device, "
10192 "misc_register returned with status %d", error);
10193
10147 if (lpfc_enable_npiv) { 10194 if (lpfc_enable_npiv) {
10148 lpfc_transport_functions.vport_create = lpfc_vport_create; 10195 lpfc_transport_functions.vport_create = lpfc_vport_create;
10149 lpfc_transport_functions.vport_delete = lpfc_vport_delete; 10196 lpfc_transport_functions.vport_delete = lpfc_vport_delete;
@@ -10180,6 +10227,7 @@ lpfc_init(void)
10180static void __exit 10227static void __exit
10181lpfc_exit(void) 10228lpfc_exit(void)
10182{ 10229{
10230 misc_deregister(&lpfc_mgmt_dev);
10183 pci_unregister_driver(&lpfc_driver); 10231 pci_unregister_driver(&lpfc_driver);
10184 fc_release_transport(lpfc_transport_template); 10232 fc_release_transport(lpfc_transport_template);
10185 if (lpfc_enable_npiv) 10233 if (lpfc_enable_npiv)
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index 23a27592388c..42ea367ddba7 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -7763,7 +7763,7 @@ lpfc_sli4_iocb2wqe(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq,
7763 bf_set(wqe_ct, &wqe->els_req.wqe_com, 1); 7763 bf_set(wqe_ct, &wqe->els_req.wqe_com, 1);
7764 bf_set(wqe_ctxt_tag, &wqe->els_req.wqe_com, 7764 bf_set(wqe_ctxt_tag, &wqe->els_req.wqe_com,
7765 phba->vpi_ids[phba->pport->vpi]); 7765 phba->vpi_ids[phba->pport->vpi]);
7766 } else if (iocbq->context1) { 7766 } else if (pcmd && iocbq->context1) {
7767 bf_set(wqe_ct, &wqe->els_req.wqe_com, 0); 7767 bf_set(wqe_ct, &wqe->els_req.wqe_com, 0);
7768 bf_set(wqe_ctxt_tag, &wqe->els_req.wqe_com, 7768 bf_set(wqe_ctxt_tag, &wqe->els_req.wqe_com,
7769 phba->sli4_hba.rpi_ids[ndlp->nlp_rpi]); 7769 phba->sli4_hba.rpi_ids[ndlp->nlp_rpi]);