aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/bnx2fc
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/bnx2fc')
-rw-r--r--drivers/scsi/bnx2fc/bnx2fc.h4
-rw-r--r--drivers/scsi/bnx2fc/bnx2fc_fcoe.c61
-rw-r--r--drivers/scsi/bnx2fc/bnx2fc_hwi.c3
-rw-r--r--drivers/scsi/bnx2fc/bnx2fc_io.c6
4 files changed, 54 insertions, 20 deletions
diff --git a/drivers/scsi/bnx2fc/bnx2fc.h b/drivers/scsi/bnx2fc/bnx2fc.h
index 08b22a901c25..1ebf3fb683e6 100644
--- a/drivers/scsi/bnx2fc/bnx2fc.h
+++ b/drivers/scsi/bnx2fc/bnx2fc.h
@@ -64,7 +64,7 @@
64#include "bnx2fc_constants.h" 64#include "bnx2fc_constants.h"
65 65
66#define BNX2FC_NAME "bnx2fc" 66#define BNX2FC_NAME "bnx2fc"
67#define BNX2FC_VERSION "1.0.14" 67#define BNX2FC_VERSION "2.4.1"
68 68
69#define PFX "bnx2fc: " 69#define PFX "bnx2fc: "
70 70
@@ -105,7 +105,7 @@
105#define BNX2FC_RQ_WQE_SIZE (BNX2FC_RQ_BUF_SZ) 105#define BNX2FC_RQ_WQE_SIZE (BNX2FC_RQ_BUF_SZ)
106#define BNX2FC_XFERQ_WQE_SIZE (sizeof(struct fcoe_xfrqe)) 106#define BNX2FC_XFERQ_WQE_SIZE (sizeof(struct fcoe_xfrqe))
107#define BNX2FC_CONFQ_WQE_SIZE (sizeof(struct fcoe_confqe)) 107#define BNX2FC_CONFQ_WQE_SIZE (sizeof(struct fcoe_confqe))
108#define BNX2FC_5771X_DB_PAGE_SIZE 128 108#define BNX2X_DB_SHIFT 3
109 109
110#define BNX2FC_TASK_SIZE 128 110#define BNX2FC_TASK_SIZE 128
111#define BNX2FC_TASKS_PER_PAGE (PAGE_SIZE/BNX2FC_TASK_SIZE) 111#define BNX2FC_TASKS_PER_PAGE (PAGE_SIZE/BNX2FC_TASK_SIZE)
diff --git a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
index 23f6eea3fa7a..9b948505d118 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
@@ -22,7 +22,7 @@ DEFINE_PER_CPU(struct bnx2fc_percpu_s, bnx2fc_percpu);
22 22
23#define DRV_MODULE_NAME "bnx2fc" 23#define DRV_MODULE_NAME "bnx2fc"
24#define DRV_MODULE_VERSION BNX2FC_VERSION 24#define DRV_MODULE_VERSION BNX2FC_VERSION
25#define DRV_MODULE_RELDATE "Mar 08, 2013" 25#define DRV_MODULE_RELDATE "Sep 17, 2013"
26 26
27 27
28static char version[] = 28static char version[] =
@@ -2004,6 +2004,24 @@ static void bnx2fc_ulp_init(struct cnic_dev *dev)
2004 set_bit(BNX2FC_CNIC_REGISTERED, &hba->reg_with_cnic); 2004 set_bit(BNX2FC_CNIC_REGISTERED, &hba->reg_with_cnic);
2005} 2005}
2006 2006
2007/* Assumes rtnl_lock and the bnx2fc_dev_lock are already taken */
2008static int __bnx2fc_disable(struct fcoe_ctlr *ctlr)
2009{
2010 struct bnx2fc_interface *interface = fcoe_ctlr_priv(ctlr);
2011
2012 if (interface->enabled == true) {
2013 if (!ctlr->lp) {
2014 pr_err(PFX "__bnx2fc_disable: lport not found\n");
2015 return -ENODEV;
2016 } else {
2017 interface->enabled = false;
2018 fcoe_ctlr_link_down(ctlr);
2019 fcoe_clean_pending_queue(ctlr->lp);
2020 }
2021 }
2022 return 0;
2023}
2024
2007/** 2025/**
2008 * Deperecated: Use bnx2fc_enabled() 2026 * Deperecated: Use bnx2fc_enabled()
2009 */ 2027 */
@@ -2018,20 +2036,34 @@ static int bnx2fc_disable(struct net_device *netdev)
2018 2036
2019 interface = bnx2fc_interface_lookup(netdev); 2037 interface = bnx2fc_interface_lookup(netdev);
2020 ctlr = bnx2fc_to_ctlr(interface); 2038 ctlr = bnx2fc_to_ctlr(interface);
2021 if (!interface || !ctlr->lp) { 2039
2040 if (!interface) {
2022 rc = -ENODEV; 2041 rc = -ENODEV;
2023 printk(KERN_ERR PFX "bnx2fc_disable: interface or lport not found\n"); 2042 pr_err(PFX "bnx2fc_disable: interface not found\n");
2024 } else { 2043 } else {
2025 interface->enabled = false; 2044 rc = __bnx2fc_disable(ctlr);
2026 fcoe_ctlr_link_down(ctlr);
2027 fcoe_clean_pending_queue(ctlr->lp);
2028 } 2045 }
2029
2030 mutex_unlock(&bnx2fc_dev_lock); 2046 mutex_unlock(&bnx2fc_dev_lock);
2031 rtnl_unlock(); 2047 rtnl_unlock();
2032 return rc; 2048 return rc;
2033} 2049}
2034 2050
2051static int __bnx2fc_enable(struct fcoe_ctlr *ctlr)
2052{
2053 struct bnx2fc_interface *interface = fcoe_ctlr_priv(ctlr);
2054
2055 if (interface->enabled == false) {
2056 if (!ctlr->lp) {
2057 pr_err(PFX "__bnx2fc_enable: lport not found\n");
2058 return -ENODEV;
2059 } else if (!bnx2fc_link_ok(ctlr->lp)) {
2060 fcoe_ctlr_link_up(ctlr);
2061 interface->enabled = true;
2062 }
2063 }
2064 return 0;
2065}
2066
2035/** 2067/**
2036 * Deprecated: Use bnx2fc_enabled() 2068 * Deprecated: Use bnx2fc_enabled()
2037 */ 2069 */
@@ -2046,12 +2078,11 @@ static int bnx2fc_enable(struct net_device *netdev)
2046 2078
2047 interface = bnx2fc_interface_lookup(netdev); 2079 interface = bnx2fc_interface_lookup(netdev);
2048 ctlr = bnx2fc_to_ctlr(interface); 2080 ctlr = bnx2fc_to_ctlr(interface);
2049 if (!interface || !ctlr->lp) { 2081 if (!interface) {
2050 rc = -ENODEV; 2082 rc = -ENODEV;
2051 printk(KERN_ERR PFX "bnx2fc_enable: interface or lport not found\n"); 2083 pr_err(PFX "bnx2fc_enable: interface not found\n");
2052 } else if (!bnx2fc_link_ok(ctlr->lp)) { 2084 } else {
2053 fcoe_ctlr_link_up(ctlr); 2085 rc = __bnx2fc_enable(ctlr);
2054 interface->enabled = true;
2055 } 2086 }
2056 2087
2057 mutex_unlock(&bnx2fc_dev_lock); 2088 mutex_unlock(&bnx2fc_dev_lock);
@@ -2072,14 +2103,12 @@ static int bnx2fc_enable(struct net_device *netdev)
2072static int bnx2fc_ctlr_enabled(struct fcoe_ctlr_device *cdev) 2103static int bnx2fc_ctlr_enabled(struct fcoe_ctlr_device *cdev)
2073{ 2104{
2074 struct fcoe_ctlr *ctlr = fcoe_ctlr_device_priv(cdev); 2105 struct fcoe_ctlr *ctlr = fcoe_ctlr_device_priv(cdev);
2075 struct fc_lport *lport = ctlr->lp;
2076 struct net_device *netdev = bnx2fc_netdev(lport);
2077 2106
2078 switch (cdev->enabled) { 2107 switch (cdev->enabled) {
2079 case FCOE_CTLR_ENABLED: 2108 case FCOE_CTLR_ENABLED:
2080 return bnx2fc_enable(netdev); 2109 return __bnx2fc_enable(ctlr);
2081 case FCOE_CTLR_DISABLED: 2110 case FCOE_CTLR_DISABLED:
2082 return bnx2fc_disable(netdev); 2111 return __bnx2fc_disable(ctlr);
2083 case FCOE_CTLR_UNUSED: 2112 case FCOE_CTLR_UNUSED:
2084 default: 2113 default:
2085 return -ENOTSUPP; 2114 return -ENOTSUPP;
diff --git a/drivers/scsi/bnx2fc/bnx2fc_hwi.c b/drivers/scsi/bnx2fc/bnx2fc_hwi.c
index c0d035a8f8f9..46a37657307f 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_hwi.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_hwi.c
@@ -1421,8 +1421,7 @@ int bnx2fc_map_doorbell(struct bnx2fc_rport *tgt)
1421 1421
1422 reg_base = pci_resource_start(hba->pcidev, 1422 reg_base = pci_resource_start(hba->pcidev,
1423 BNX2X_DOORBELL_PCI_BAR); 1423 BNX2X_DOORBELL_PCI_BAR);
1424 reg_off = BNX2FC_5771X_DB_PAGE_SIZE * 1424 reg_off = (1 << BNX2X_DB_SHIFT) * (context_id & 0x1FFFF);
1425 (context_id & 0x1FFFF) + DPM_TRIGER_TYPE;
1426 tgt->ctx_base = ioremap_nocache(reg_base + reg_off, 4); 1425 tgt->ctx_base = ioremap_nocache(reg_base + reg_off, 4);
1427 if (!tgt->ctx_base) 1426 if (!tgt->ctx_base)
1428 return -ENOMEM; 1427 return -ENOMEM;
diff --git a/drivers/scsi/bnx2fc/bnx2fc_io.c b/drivers/scsi/bnx2fc/bnx2fc_io.c
index 575142e92d9c..ed880891cb7c 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_io.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_io.c
@@ -1246,6 +1246,12 @@ int bnx2fc_eh_abort(struct scsi_cmnd *sc_cmd)
1246 kref_put(&io_req->refcount, 1246 kref_put(&io_req->refcount,
1247 bnx2fc_cmd_release); /* drop timer hold */ 1247 bnx2fc_cmd_release); /* drop timer hold */
1248 rc = bnx2fc_expl_logo(lport, io_req); 1248 rc = bnx2fc_expl_logo(lport, io_req);
1249 /* This only occurs when an task abort was requested while ABTS
1250 is in progress. Setting the IO_CLEANUP flag will skip the
1251 RRQ process in the case when the fw generated SCSI_CMD cmpl
1252 was a result from the ABTS request rather than the CLEANUP
1253 request */
1254 set_bit(BNX2FC_FLAG_IO_CLEANUP, &io_req->req_flags);
1249 goto out; 1255 goto out;
1250 } 1256 }
1251 1257