[PATCH] bnx2i: Update driver version to 2.7.10.1

2014-07-17 Thread vikas.chaudhary
From: Vikas Chaudhary vikas.chaudh...@qlogic.com

Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
---
 drivers/scsi/bnx2i/bnx2i_init.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/bnx2i/bnx2i_init.c b/drivers/scsi/bnx2i/bnx2i_init.c
index 748ff8e..c8b410c 100644
--- a/drivers/scsi/bnx2i/bnx2i_init.c
+++ b/drivers/scsi/bnx2i/bnx2i_init.c
@@ -20,8 +20,8 @@ static struct list_head adapter_list = 
LIST_HEAD_INIT(adapter_list);
 static u32 adapter_count;
 
 #define DRV_MODULE_NAMEbnx2i
-#define DRV_MODULE_VERSION 2.7.6.2
-#define DRV_MODULE_RELDATE Jun 06, 2013
+#define DRV_MODULE_VERSION 2.7.10.1
+#define DRV_MODULE_RELDATE Jul 16, 2014
 
 static char version[] =
QLogic NetXtreme II iSCSI Driver  DRV_MODULE_NAME \
-- 
1.8.2.GIT

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/3] bnx2fc: Rebranding bnx2fc driver

2014-07-03 Thread vikas.chaudhary
From: Saurav Kashyap saurav.kash...@qlogic.com

QLogic has acquired the NetXtremeII products and drivers from Broadcom.
This patch re-brands bnx2fc driver as a QLogic driver

Signed-off-by: Saurav Kashyap saurav.kash...@qlogic.com
Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
Acked-by: Eddie Wai eddie@broadcom.com
---
 drivers/scsi/bnx2fc/57xx_hsi_bnx2fc.h  | 13 +
 drivers/scsi/bnx2fc/Kconfig|  4 ++--
 drivers/scsi/bnx2fc/bnx2fc.h   |  7 ---
 drivers/scsi/bnx2fc/bnx2fc_constants.h | 13 +
 drivers/scsi/bnx2fc/bnx2fc_debug.c | 13 +
 drivers/scsi/bnx2fc/bnx2fc_debug.h | 13 +
 drivers/scsi/bnx2fc/bnx2fc_els.c   |  3 ++-
 drivers/scsi/bnx2fc/bnx2fc_fcoe.c  | 11 ++-
 drivers/scsi/bnx2fc/bnx2fc_hwi.c   |  3 ++-
 drivers/scsi/bnx2fc/bnx2fc_io.c|  3 ++-
 drivers/scsi/bnx2fc/bnx2fc_tgt.c   |  3 ++-
 11 files changed, 72 insertions(+), 14 deletions(-)

diff --git a/drivers/scsi/bnx2fc/57xx_hsi_bnx2fc.h 
b/drivers/scsi/bnx2fc/57xx_hsi_bnx2fc.h
index e1f1e34..fe2106c 100644
--- a/drivers/scsi/bnx2fc/57xx_hsi_bnx2fc.h
+++ b/drivers/scsi/bnx2fc/57xx_hsi_bnx2fc.h
@@ -1,3 +1,16 @@
+/* 57xx_hsi_bnx2fc.h: QLogic NetXtreme II Linux FCoE offload driver.
+ * Handles operations such as session offload/upload etc, and manages
+ * session resources such as connection id and qp resources.
+ *
+ * Copyright (c) 2008 - 2013 Broadcom Corporation
+ * Copyright (c) 2014, QLogic Corporation
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation.
+ *
+ */
+
 #ifndef __57XX_FCOE_HSI_LINUX_LE__
 #define __57XX_FCOE_HSI_LINUX_LE__
 
diff --git a/drivers/scsi/bnx2fc/Kconfig b/drivers/scsi/bnx2fc/Kconfig
index cfcad8b..f245d54 100644
--- a/drivers/scsi/bnx2fc/Kconfig
+++ b/drivers/scsi/bnx2fc/Kconfig
@@ -1,5 +1,5 @@
 config SCSI_BNX2X_FCOE
-   tristate Broadcom NetXtreme II FCoE support
+   tristate QLogic NetXtreme II FCoE support
depends on PCI
select NETDEVICES
select ETHERNET
@@ -8,5 +8,5 @@ config SCSI_BNX2X_FCOE
select LIBFCOE
select CNIC
---help---
-   This driver supports FCoE offload for the Broadcom NetXtreme II
+   This driver supports FCoE offload for the QLogic NetXtreme II
devices.
diff --git a/drivers/scsi/bnx2fc/bnx2fc.h b/drivers/scsi/bnx2fc/bnx2fc.h
index 6a97665..1346e05 100644
--- a/drivers/scsi/bnx2fc/bnx2fc.h
+++ b/drivers/scsi/bnx2fc/bnx2fc.h
@@ -1,8 +1,7 @@
-#ifndef _BNX2FC_H_
-#define _BNX2FC_H_
-/* bnx2fc.h: Broadcom NetXtreme II Linux FCoE offload driver.
+/* bnx2fc.h: QLogic NetXtreme II Linux FCoE offload driver.
  *
  * Copyright (c) 2008 - 2013 Broadcom Corporation
+ * Copyright (c) 2014, QLogic Corporation
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -11,6 +10,8 @@
  * Written by: Bhanu Prakash Gollapudi (bprak...@broadcom.com)
  */
 
+#ifndef _BNX2FC_H_
+#define _BNX2FC_H_
 #define pr_fmt(fmt) KBUILD_MODNAME :  fmt
 
 #include linux/module.h
diff --git a/drivers/scsi/bnx2fc/bnx2fc_constants.h 
b/drivers/scsi/bnx2fc/bnx2fc_constants.h
index dad9924..e147cc7 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_constants.h
+++ b/drivers/scsi/bnx2fc/bnx2fc_constants.h
@@ -1,3 +1,16 @@
+/* bnx2fc_constants.h: QLogic NetXtreme II Linux FCoE offload driver.
+ * Handles operations such as session offload/upload etc, and manages
+ * session resources such as connection id and qp resources.
+ *
+ * Copyright (c) 2008 - 2013 Broadcom Corporation
+ * Copyright (c) 2014, QLogic Corporation
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation.
+ *
+ */
+
 #ifndef __BNX2FC_CONSTANTS_H_
 #define __BNX2FC_CONSTANTS_H_
 
diff --git a/drivers/scsi/bnx2fc/bnx2fc_debug.c 
b/drivers/scsi/bnx2fc/bnx2fc_debug.c
index 0cbee1b..d055df0 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_debug.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_debug.c
@@ -1,3 +1,16 @@
+/* bnx2fc_debug.c: QLogic NetXtreme II Linux FCoE offload driver.
+ * Handles operations such as session offload/upload etc, and manages
+ * session resources such as connection id and qp resources.
+ *
+ * Copyright (c) 2008 - 2013 Broadcom Corporation
+ * Copyright (c) 2014, QLogic Corporation
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation.
+ *
+ */
+
 #include bnx2fc.h
 
 void BNX2FC_IO_DBG(const struct bnx2fc_cmd *io_req, const char *fmt, ...)
diff --git a/drivers/scsi/bnx2fc/bnx2fc_debug.h 
b/drivers/scsi/bnx2fc/bnx2fc_debug.h
index 4808ff9..2b90067 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_debug.h
+++ 

[PATCH 0/3] bnx2i/bnx2fc: Rebranding changes for bnx2i and bnx2fc driver

2014-07-03 Thread vikas.chaudhary
From: Vikas Chaudhary vikas.chaudh...@qlogic.com

The following set of patches are for rebranding Broadcom bnx2i and bnx2fc 
driver as QLogic drivers.
Please apply the following patches to the scsi tree at your earliest 
convenience.

Saurav Kashyap (1):
  bnx2fc: Rebranding bnx2fc driver

Vikas Chaudhary (2):
  bnx2i: Rebranding bnx2i driver
  MAINTAINERS: Update maintainer list for bnx2i and bnx2fc
--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/3] bnx2i: Rebranding bnx2i driver

2014-07-03 Thread vikas.chaudhary
From: Vikas Chaudhary vikas.chaudh...@qlogic.com

QLogic has acquired the NetXtremeII products and drivers from Broadcom.
This patch re-brands bnx2i driver as a QLogic driver

Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
Acked-by: Eddie Wai eddie@broadcom.com
---
 drivers/scsi/bnx2i/57xx_iscsi_constants.h |  6 --
 drivers/scsi/bnx2i/57xx_iscsi_hsi.h   |  6 --
 drivers/scsi/bnx2i/Kconfig|  4 ++--
 drivers/scsi/bnx2i/bnx2i.h|  6 --
 drivers/scsi/bnx2i/bnx2i_hwi.c|  6 --
 drivers/scsi/bnx2i/bnx2i_init.c   | 10 ++
 drivers/scsi/bnx2i/bnx2i_iscsi.c  |  8 +---
 drivers/scsi/bnx2i/bnx2i_sysfs.c  |  6 --
 8 files changed, 33 insertions(+), 19 deletions(-)

diff --git a/drivers/scsi/bnx2i/57xx_iscsi_constants.h 
b/drivers/scsi/bnx2i/57xx_iscsi_constants.h
index 3d33767..9175341 100644
--- a/drivers/scsi/bnx2i/57xx_iscsi_constants.h
+++ b/drivers/scsi/bnx2i/57xx_iscsi_constants.h
@@ -1,13 +1,15 @@
-/* 57xx_iscsi_constants.h: Broadcom NetXtreme II iSCSI HSI
+/* 57xx_iscsi_constants.h: QLogic NetXtreme II iSCSI HSI
  *
  * Copyright (c) 2006 - 2013 Broadcom Corporation
+ * Copyright (c) 2014, QLogic Corporation
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation.
  *
  * Written by: Anil Veerabhadrappa (ani...@broadcom.com)
- * Maintained by: Eddie Wai (eddie@broadcom.com)
+ * Previously Maintained by: Eddie Wai (eddie@broadcom.com)
+ * Maintained by: qlogic-storage-upstr...@qlogic.com
  */
 #ifndef __57XX_ISCSI_CONSTANTS_H_
 #define __57XX_ISCSI_CONSTANTS_H_
diff --git a/drivers/scsi/bnx2i/57xx_iscsi_hsi.h 
b/drivers/scsi/bnx2i/57xx_iscsi_hsi.h
index 7052a83..19b3a97 100644
--- a/drivers/scsi/bnx2i/57xx_iscsi_hsi.h
+++ b/drivers/scsi/bnx2i/57xx_iscsi_hsi.h
@@ -1,13 +1,15 @@
-/* 57xx_iscsi_hsi.h: Broadcom NetXtreme II iSCSI HSI.
+/* 57xx_iscsi_hsi.h: QLogic NetXtreme II iSCSI HSI.
  *
  * Copyright (c) 2006 - 2013 Broadcom Corporation
+ * Copyright (c) 2014, QLogic Corporation
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation.
  *
  * Written by: Anil Veerabhadrappa (ani...@broadcom.com)
- * Maintained by: Eddie Wai (eddie@broadcom.com)
+ * Previously Maintained by: Eddie Wai (eddie@broadcom.com)
+ * Maintained by: qlogic-storage-upstr...@qlogic.com
  */
 #ifndef __57XX_ISCSI_HSI_LINUX_LE__
 #define __57XX_ISCSI_HSI_LINUX_LE__
diff --git a/drivers/scsi/bnx2i/Kconfig b/drivers/scsi/bnx2i/Kconfig
index 01cff18..44ce54e 100644
--- a/drivers/scsi/bnx2i/Kconfig
+++ b/drivers/scsi/bnx2i/Kconfig
@@ -1,5 +1,5 @@
 config SCSI_BNX2_ISCSI
-   tristate Broadcom NetXtreme II iSCSI support
+   tristate QLogic NetXtreme II iSCSI support
depends on NET
depends on PCI
select SCSI_ISCSI_ATTRS
@@ -8,5 +8,5 @@ config SCSI_BNX2_ISCSI
select NET_VENDOR_BROADCOM
select CNIC
---help---
-   This driver supports iSCSI offload for the Broadcom NetXtreme II
+   This driver supports iSCSI offload for the QLogic NetXtreme II
devices.
diff --git a/drivers/scsi/bnx2i/bnx2i.h b/drivers/scsi/bnx2i/bnx2i.h
index c73bbcb..ed7f322 100644
--- a/drivers/scsi/bnx2i/bnx2i.h
+++ b/drivers/scsi/bnx2i/bnx2i.h
@@ -1,15 +1,17 @@
-/* bnx2i.h: Broadcom NetXtreme II iSCSI driver.
+/* bnx2i.h: QLogic NetXtreme II iSCSI driver.
  *
  * Copyright (c) 2006 - 2013 Broadcom Corporation
  * Copyright (c) 2007, 2008 Red Hat, Inc.  All rights reserved.
  * Copyright (c) 2007, 2008 Mike Christie
+ * Copyright (c) 2014, QLogic Corporation
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation.
  *
  * Written by: Anil Veerabhadrappa (ani...@broadcom.com)
- * Maintained by: Eddie Wai (eddie@broadcom.com)
+ * Previously Maintained by: Eddie Wai (eddie@broadcom.com)
+ * Maintained by: qlogic-storage-upstr...@qlogic.com
  */
 
 #ifndef _BNX2I_H_
diff --git a/drivers/scsi/bnx2i/bnx2i_hwi.c b/drivers/scsi/bnx2i/bnx2i_hwi.c
index b5ffd28..cfb8e90 100644
--- a/drivers/scsi/bnx2i/bnx2i_hwi.c
+++ b/drivers/scsi/bnx2i/bnx2i_hwi.c
@@ -1,15 +1,17 @@
-/* bnx2i_hwi.c: Broadcom NetXtreme II iSCSI driver.
+/* bnx2i_hwi.c: QLogic NetXtreme II iSCSI driver.
  *
  * Copyright (c) 2006 - 2013 Broadcom Corporation
  * Copyright (c) 2007, 2008 Red Hat, Inc.  All rights reserved.
  * Copyright (c) 2007, 2008 Mike Christie
+ * Copyright (c) 2014, QLogic Corporation
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation.
  *
  * Written by: Anil Veerabhadrappa 

[PATCH 3/3] MAINTAINERS: Update maintainer list for bnx2i and bnx2fc

2014-07-03 Thread vikas.chaudhary
From: Vikas Chaudhary vikas.chaudh...@qlogic.com

Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
Acked-by: Eddie Wai eddie@broadcom.com
---
 MAINTAINERS | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 2482eee..dec99fb 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1943,13 +1943,13 @@ S:  Supported
 F: drivers/net/wireless/brcm80211/
 
 BROADCOM BNX2FC 10 GIGABIT FCOE DRIVER
-M: Eddie Wai eddie@broadcom.com
+M: qlogic-storage-upstr...@qlogic.com
 L: linux-scsi@vger.kernel.org
 S: Supported
 F: drivers/scsi/bnx2fc/
 
 BROADCOM BNX2I 1/10 GIGABIT iSCSI DRIVER
-M: Eddie Wai eddie@broadcom.com
+M: qlogic-storage-upstr...@qlogic.com
 L: linux-scsi@vger.kernel.org
 S: Supported
 F: drivers/scsi/bnx2i/
-- 
1.8.2.GIT

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] bnx2i: Make boot_nic entry visible in the sysfs session objects

2014-05-19 Thread vikas.chaudhary
From: Tej Parkash tej.park...@qlogic.com

Signed-off-by: Tej Parkash tej.park...@qlogic.com
Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
---
 drivers/scsi/bnx2i/bnx2i_iscsi.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/scsi/bnx2i/bnx2i_iscsi.c b/drivers/scsi/bnx2i/bnx2i_iscsi.c
index 166543f..cabc8c1 100644
--- a/drivers/scsi/bnx2i/bnx2i_iscsi.c
+++ b/drivers/scsi/bnx2i/bnx2i_iscsi.c
@@ -2234,6 +2234,9 @@ static umode_t bnx2i_attr_is_visible(int param_type, int 
param)
case ISCSI_PARAM_TGT_RESET_TMO:
case ISCSI_PARAM_IFACE_NAME:
case ISCSI_PARAM_INITIATOR_NAME:
+   case ISCSI_PARAM_BOOT_ROOT:
+   case ISCSI_PARAM_BOOT_NIC:
+   case ISCSI_PARAM_BOOT_TARGET:
return S_IRUGO;
default:
return 0;
-- 
1.8.2.GIT

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2] iscsi_ibft: Fix finding Broadcom specific ibft sign

2014-05-13 Thread vikas.chaudhary
From: Vikas Chaudhary vikas.chaudh...@qlogic.com

Search for Broadcom specific ibft sign BIFT
along with other possible values on UEFI

This patch is fix for regression introduced in
“935a9fee51c945b8942be2d7b4bae069167b4886”.
https://lkml.org/lkml/2011/12/16/353

This impacts Broadcom CNA for iSCSI Boot on UEFI platform.

Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
---
 drivers/firmware/iscsi_ibft.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/firmware/iscsi_ibft.c b/drivers/firmware/iscsi_ibft.c
index 3ee852c..071c2c9 100644
--- a/drivers/firmware/iscsi_ibft.c
+++ b/drivers/firmware/iscsi_ibft.c
@@ -756,6 +756,7 @@ static const struct {
 */
{ ACPI_SIG_IBFT },
{ iBFT },
+   { BIFT }, /* Broadcom iSCSI Offload */
 };
 
 static void __init acpi_find_ibft_region(void)
-- 
1.8.2.GIT

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] iscsi_ibft: search for broadcom specific ibft sign

2014-05-07 Thread vikas.chaudhary
From: Vikas Chaudhary vikas.chaudh...@qlogic.com

Broadcom iscsi offload firmware uses a non standard ibft sign of BIFT.
This patch modifies the ibft search code to search for BIFT along
with the other possible values.

Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
Acked-by: Kevin Tran kt...@broadcom.com
Acked-by: Eddie Wai eddie@broadcom.com
---
 drivers/firmware/iscsi_ibft.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/firmware/iscsi_ibft.c b/drivers/firmware/iscsi_ibft.c
index 3ee852c..071c2c9 100644
--- a/drivers/firmware/iscsi_ibft.c
+++ b/drivers/firmware/iscsi_ibft.c
@@ -756,6 +756,7 @@ static const struct {
 */
{ ACPI_SIG_IBFT },
{ iBFT },
+   { BIFT }, /* Broadcom iSCSI Offload */
 };
 
 static void __init acpi_find_ibft_region(void)
-- 
1.8.2.GIT

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/6] qla4xxx: Fix memory leak for ha-saved_acb

2014-04-09 Thread vikas.chaudhary
From: Nilesh Javali nilesh.jav...@qlogic.com

Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
---
 drivers/scsi/qla4xxx/ql4_mbx.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/qla4xxx/ql4_mbx.c b/drivers/scsi/qla4xxx/ql4_mbx.c
index 1345c0e..0a3312c 100644
--- a/drivers/scsi/qla4xxx/ql4_mbx.c
+++ b/drivers/scsi/qla4xxx/ql4_mbx.c
@@ -2395,8 +2395,6 @@ int qla4_84xx_config_acb(struct scsi_qla_host *ha, int 
acb_config)
}
 
memcpy(acb, ha-saved_acb, acb_len);
-   kfree(ha-saved_acb);
-   ha-saved_acb = NULL;
 
rval = qla4xxx_set_acb(ha, mbox_cmd[0], mbox_sts[0], acb_dma);
if (rval != QLA_SUCCESS)
@@ -2412,6 +2410,10 @@ exit_free_acb:
dma_free_coherent(ha-pdev-dev, sizeof(struct addr_ctrl_blk), acb,
  acb_dma);
 exit_config_acb:
+   if ((acb_config == ACB_CONFIG_SET)  ha-saved_acb) {
+   kfree(ha-saved_acb);
+   ha-saved_acb = NULL;
+   }
DEBUG2(ql4_printk(KERN_INFO, ha,
  %s %s\n, __func__,
  rval == QLA_SUCCESS ? SUCCEEDED : FAILED));
-- 
1.8.2.GIT

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 4/6] qla4xxx: Fix smatch warning in func qla4xxx_get_ep_param

2014-04-09 Thread vikas.chaudhary
From: Adheer Chandravanshi adheer.chandravan...@qlogic.com

Fix following smatch warning:-
 drivers/scsi/qla4xxx/ql4_os.c:1752 qla4xxx_get_ep_param() warn: variable 
dereferenced before check 'qla_ep' (see line 1745)

Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
---
 drivers/scsi/qla4xxx/ql4_os.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index 9be829b..592f293 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -1742,6 +1742,9 @@ static int qla4xxx_get_ep_param(struct iscsi_endpoint *ep,
struct sockaddr *dst_addr;
struct scsi_qla_host *ha;
 
+   if (!qla_ep)
+   return -ENOTCONN;
+
ha = to_qla_host(qla_ep-host);
DEBUG2(ql4_printk(KERN_INFO, ha, %s: host: %ld\n, __func__,
  ha-host_no));
@@ -1749,9 +1752,6 @@ static int qla4xxx_get_ep_param(struct iscsi_endpoint *ep,
switch (param) {
case ISCSI_PARAM_CONN_PORT:
case ISCSI_PARAM_CONN_ADDRESS:
-   if (!qla_ep)
-   return -ENOTCONN;
-
dst_addr = (struct sockaddr *)qla_ep-dst_addr;
if (!dst_addr)
return -ENOTCONN;
-- 
1.8.2.GIT

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/6] qla4xxx: Export sysfs DDBs from DPC handler

2014-04-09 Thread vikas.chaudhary
From: Nilesh Javali nilesh.jav...@qlogic.com

Issue:
modprobe qla4xxx is killed by systemd due to timeout.

Solution:
The exporting of sysfs DDBs from qla4xxx_probe_adapter added delay of
approximately 15s due to which system-udevd killed the modprobe of the
driver. Added fix to export the sysfs DDBs from the DPC handler.

Signed-off-by: Nilesh Javali nilesh.jav...@qlogic.com
Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
---
 drivers/scsi/qla4xxx/ql4_def.h  |  1 +
 drivers/scsi/qla4xxx/ql4_glbl.h |  1 +
 drivers/scsi/qla4xxx/ql4_os.c   | 15 +--
 3 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/drivers/scsi/qla4xxx/ql4_def.h b/drivers/scsi/qla4xxx/ql4_def.h
index 73a5022..8f6d0fb 100644
--- a/drivers/scsi/qla4xxx/ql4_def.h
+++ b/drivers/scsi/qla4xxx/ql4_def.h
@@ -601,6 +601,7 @@ struct scsi_qla_host {
 #define DPC_HA_NEED_QUIESCENT  22 /* 0x0040 ISP-82xx only*/
 #define DPC_POST_IDC_ACK   23 /* 0x0080 */
 #define DPC_RESTORE_ACB24 /* 0x0100 */
+#define DPC_SYSFS_DDB_EXPORT   25 /* 0x0200 */
 
struct Scsi_Host *host; /* pointer to host data */
uint32_t tot_ddbs;
diff --git a/drivers/scsi/qla4xxx/ql4_glbl.h b/drivers/scsi/qla4xxx/ql4_glbl.h
index 2035475..5f58b45 100644
--- a/drivers/scsi/qla4xxx/ql4_glbl.h
+++ b/drivers/scsi/qla4xxx/ql4_glbl.h
@@ -281,6 +281,7 @@ int qla4_83xx_get_port_config(struct scsi_qla_host *ha, 
uint32_t *config);
 int qla4_83xx_set_port_config(struct scsi_qla_host *ha, uint32_t *config);
 int qla4_8xxx_check_init_adapter_retry(struct scsi_qla_host *ha);
 int qla4_83xx_is_detached(struct scsi_qla_host *ha);
+int qla4xxx_sysfs_ddb_export(struct scsi_qla_host *ha);
 
 extern int ql4xextended_error_logging;
 extern int ql4xdontresethba;
diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index bb16040..9be829b 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -4565,6 +4565,7 @@ static void qla4xxx_timer(struct scsi_qla_host *ha)
 test_bit(DPC_LINK_CHANGED, ha-dpc_flags) ||
 test_bit(DPC_HA_UNRECOVERABLE, ha-dpc_flags) ||
 test_bit(DPC_HA_NEED_QUIESCENT, ha-dpc_flags) ||
+test_bit(DPC_SYSFS_DDB_EXPORT, ha-dpc_flags) ||
 test_bit(DPC_AEN, ha-dpc_flags)) {
DEBUG2(printk(scsi%ld: %s: scheduling dpc routine
   - dpc flags = 0x%lx\n,
@@ -5429,6 +5430,11 @@ dpc_post_reset_ha:
qla4xxx_relogin_all_devices(ha);
}
}
+   if (test_and_clear_bit(DPC_SYSFS_DDB_EXPORT, ha-dpc_flags)) {
+   if (qla4xxx_sysfs_ddb_export(ha))
+   ql4_printk(KERN_ERR, ha, %s: Error exporting ddb to 
sysfs\n,
+  __func__);
+   }
 }
 
 /**
@@ -8406,7 +8412,7 @@ exit_ddb_del:
  *
  * Export the firmware DDB for all send targets and normal targets to sysfs.
  **/
-static int qla4xxx_sysfs_ddb_export(struct scsi_qla_host *ha)
+int qla4xxx_sysfs_ddb_export(struct scsi_qla_host *ha)
 {
struct dev_db_entry *fw_ddb_entry = NULL;
dma_addr_t fw_ddb_entry_dma;
@@ -8844,11 +8850,8 @@ skip_retry_init:
ql4_printk(KERN_ERR, ha,
   %s: No iSCSI boot target configured\n, __func__);
 
-   if (qla4xxx_sysfs_ddb_export(ha))
-   ql4_printk(KERN_ERR, ha,
-  %s: Error exporting ddb to sysfs\n, __func__);
-
-   /* Perform the build ddb list and login to each */
+   set_bit(DPC_SYSFS_DDB_EXPORT, ha-dpc_flags);
+   /* Perform the build ddb list and login to each */
qla4xxx_build_ddb_list(ha, INIT_ADAPTER);
iscsi_host_for_each_session(ha-host, qla4xxx_login_flash_ddb);
qla4xxx_wait_login_resp_boot_tgt(ha);
-- 
1.8.2.GIT

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 5/6] qla4xxx: Fix smatch warning in func qla4xxx_conn_get_param

2014-04-09 Thread vikas.chaudhary
From: Adheer Chandravanshi adheer.chandravan...@qlogic.com

Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
---
 drivers/scsi/qla4xxx/ql4_os.c | 4 
 1 file changed, 4 deletions(-)

diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index 592f293..9eef7d4 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -2879,7 +2879,6 @@ static int qla4xxx_conn_get_param(struct iscsi_cls_conn 
*cls_conn,
struct iscsi_conn *conn;
struct qla_conn *qla_conn;
struct sockaddr *dst_addr;
-   int len = 0;
 
conn = cls_conn-dd_data;
qla_conn = conn-dd_data;
@@ -2893,9 +2892,6 @@ static int qla4xxx_conn_get_param(struct iscsi_cls_conn 
*cls_conn,
default:
return iscsi_conn_get_param(cls_conn, param, buf);
}
-
-   return len;
-
 }
 
 int qla4xxx_get_ddb_index(struct scsi_qla_host *ha, uint16_t *ddb_index)
-- 
1.8.2.GIT

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 6/6] qla4xxx: Update driver version to 5.04.00-k6

2014-04-09 Thread vikas.chaudhary
From: Vikas Chaudhary vikas.chaudh...@qlogic.com

Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
---
 drivers/scsi/qla4xxx/ql4_version.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/qla4xxx/ql4_version.h 
b/drivers/scsi/qla4xxx/ql4_version.h
index bd78cb3..f11eaa7 100644
--- a/drivers/scsi/qla4xxx/ql4_version.h
+++ b/drivers/scsi/qla4xxx/ql4_version.h
@@ -5,4 +5,4 @@
  * See LICENSE.qla4xxx for copyright and licensing details.
  */
 
-#define QLA4XXX_DRIVER_VERSION 5.04.00-k5
+#define QLA4XXX_DRIVER_VERSION 5.04.00-k6
-- 
1.8.2.GIT

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/6] qla4xxx: 5.04.00-k6: Updates for scsi misc branch

2014-04-09 Thread vikas.chaudhary
From: Vikas Chaudhary vikas.chaudh...@qlogic.com

James,

Please apply the following patches to the scsi tree at your earliest 
convenience.

Adheer Chandravanshi (2):
  qla4xxx: Fix smatch warning in func qla4xxx_get_ep_param
  qla4xxx: Fix smatch warning in func qla4xxx_conn_get_param

Nilesh Javali (2):
  qla4xxx: Export sysfs DDBs from DPC handler
  qla4xxx: Fix memory leak for ha-saved_acb

Tej Parkash (1):
  qla4xxx: Disable INTx interrupt for ISP82XX

Vikas Chaudhary (1):
  qla4xxx: Update driver version to 5.04.00-k6

Thanks,
Vikas.

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/6] qla4xxx: Disable INTx interrupt for ISP82XX

2014-04-09 Thread vikas.chaudhary
From: Tej Parkash tej.park...@qlogic.com

Signed-off-by: Tej Parkash tej.park...@qlogic.com
Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
---
 drivers/scsi/qla4xxx/ql4_isr.c | 12 +---
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/scsi/qla4xxx/ql4_isr.c b/drivers/scsi/qla4xxx/ql4_isr.c
index b1925d1..081b6b7 100644
--- a/drivers/scsi/qla4xxx/ql4_isr.c
+++ b/drivers/scsi/qla4xxx/ql4_isr.c
@@ -1526,7 +1526,7 @@ void qla4xxx_process_aen(struct scsi_qla_host * ha, 
uint8_t process_aen)
 
 int qla4xxx_request_irqs(struct scsi_qla_host *ha)
 {
-   int ret;
+   int ret = 0;
int rval = QLA_ERROR;
 
if (is_qla40XX(ha))
@@ -1580,15 +1580,13 @@ try_msi:
}
}
 
-   /*
-* Prevent interrupts from falling back to INTx mode in cases where
-* interrupts cannot get acquired through MSI-X or MSI mode.
-*/
+try_intx:
if (is_qla8022(ha)) {
-   ql4_printk(KERN_WARNING, ha, IRQ not attached -- %d.\n, ret);
+   ql4_printk(KERN_WARNING, ha, %s: ISP82xx Legacy interrupt not 
supported\n,
+  __func__);
goto irq_not_attached;
}
-try_intx:
+
/* Trying INTx */
ret = request_irq(ha-pdev-irq, ha-isp_ops-intr_handler,
IRQF_SHARED, DRIVER_NAME, ha);
-- 
1.8.2.GIT

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 08/10] qla4xxx: Initialize hardware queue for ISP40XX

2014-02-24 Thread vikas.chaudhary
From: Vikas Chaudhary vikas.chaudh...@qlogic.com

Issue:
System crash while target discovery for ISP40XX

Root cause:
Function qla4xxx_init_rings() is not called for ISP40XX

Fix:
Call function qla4xxx_init_rings() for ISP40XX from
qla4xxx_start_firmware().

Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
---
 drivers/scsi/qla4xxx/ql4_init.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/scsi/qla4xxx/ql4_init.c b/drivers/scsi/qla4xxx/ql4_init.c
index 7dda1a0..6f12f85 100644
--- a/drivers/scsi/qla4xxx/ql4_init.c
+++ b/drivers/scsi/qla4xxx/ql4_init.c
@@ -890,6 +890,8 @@ int qla4xxx_start_firmware(struct scsi_qla_host *ha)
if (status == QLA_SUCCESS) {
if (test_and_clear_bit(AF_GET_CRASH_RECORD, ha-flags))
qla4xxx_get_crash_record(ha);
+
+   qla4xxx_init_rings(ha);
} else {
DEBUG(printk(scsi%ld: %s: Firmware has NOT started\n,
 ha-host_no, __func__));
-- 
1.8.2.GIT

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 02/10] qla4xxx: Change default capture to firmware defined capture mask

2014-02-24 Thread vikas.chaudhary
From: Tej Parkash tej.park...@qlogic.com

Signed-off-by: Tej Parkash tej.park...@qlogic.com
Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
---
 drivers/scsi/qla4xxx/ql4_os.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index 2e95be4..fb90c9d 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -83,11 +83,11 @@ MODULE_PARM_DESC(ql4xsess_recovery_tmo,
 Target Session Recovery Timeout.\n
\t\t  Default: 120 sec.);
 
-int ql4xmdcapmask = 0x1F;
+int ql4xmdcapmask = 0;
 module_param(ql4xmdcapmask, int, S_IRUGO);
 MODULE_PARM_DESC(ql4xmdcapmask,
  Set the Minidump driver capture mask level.\n
-\t\t  Default is 0x1F.\n
+\t\t  Default is 0 (firmware default capture mask)\n
 \t\t  Can be set to 0x3, 0x7, 0xF, 0x1F, 0x3F, 0x7F);
 
 int ql4xenablemd = 1;
-- 
1.8.2.GIT

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 04/10] qla4xxx: Added new opcodes for 84XX Minidump template

2014-02-24 Thread vikas.chaudhary
From: Tej Parkash tej.park...@qlogic.com

Updated driver with new opcode (RDDFE, RDMDIO and POLLWR) which are
added with latest firmware minidump template

Signed-off-by: Tej Parkash tej.park...@qlogic.com
Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
---
 drivers/scsi/qla4xxx/ql4_83xx.h |  44 ++
 drivers/scsi/qla4xxx/ql4_nx.c   | 335 
 drivers/scsi/qla4xxx/ql4_nx.h   |   3 +
 3 files changed, 382 insertions(+)

diff --git a/drivers/scsi/qla4xxx/ql4_83xx.h b/drivers/scsi/qla4xxx/ql4_83xx.h
index a0de6e2..775fdf9 100644
--- a/drivers/scsi/qla4xxx/ql4_83xx.h
+++ b/drivers/scsi/qla4xxx/ql4_83xx.h
@@ -254,6 +254,50 @@ struct qla83xx_minidump_entry_pollrd {
uint32_t rsvd_1;
 };
 
+struct qla8044_minidump_entry_rddfe {
+   struct qla8xxx_minidump_entry_hdr h;
+   uint32_t addr_1;
+   uint32_t value;
+   uint8_t stride;
+   uint8_t stride2;
+   uint16_t count;
+   uint32_t poll;
+   uint32_t mask;
+   uint32_t modify_mask;
+   uint32_t data_size;
+   uint32_t rsvd;
+
+} __packed;
+
+struct qla8044_minidump_entry_rdmdio {
+   struct qla8xxx_minidump_entry_hdr h;
+
+   uint32_t addr_1;
+   uint32_t addr_2;
+   uint32_t value_1;
+   uint8_t stride_1;
+   uint8_t stride_2;
+   uint16_t count;
+   uint32_t poll;
+   uint32_t mask;
+   uint32_t value_2;
+   uint32_t data_size;
+
+} __packed;
+
+struct qla8044_minidump_entry_pollwr {
+   struct qla8xxx_minidump_entry_hdr h;
+   uint32_t addr_1;
+   uint32_t addr_2;
+   uint32_t value_1;
+   uint32_t value_2;
+   uint32_t poll;
+   uint32_t mask;
+   uint32_t data_size;
+   uint32_t rsvd;
+
+} __packed;
+
 /* RDMUX2 Entry */
 struct qla83xx_minidump_entry_rdmux2 {
struct qla8xxx_minidump_entry_hdr h;
diff --git a/drivers/scsi/qla4xxx/ql4_nx.c b/drivers/scsi/qla4xxx/ql4_nx.c
index 63328c8..bdc3b95 100644
--- a/drivers/scsi/qla4xxx/ql4_nx.c
+++ b/drivers/scsi/qla4xxx/ql4_nx.c
@@ -14,6 +14,7 @@
 
 #include asm-generic/io-64-nonatomic-lo-hi.h
 
+#define TIMEOUT_100_MS 100
 #define MASK(n)DMA_BIT_MASK(n)
 #define MN_WIN(addr)   (((addr  0x1fc)  1) | ((addr  25)  0x3ff))
 #define OCM_WIN(addr)  (((addr  0x1ff)  1) | ((addr  25)  0x3ff))
@@ -1714,6 +1715,101 @@ void qla4_82xx_rom_lock_recovery(struct scsi_qla_host 
*ha)
qla4_82xx_rom_unlock(ha);
 }
 
+static uint32_t ql4_84xx_poll_wait_for_ready(struct scsi_qla_host *ha,
+uint32_t addr1, uint32_t mask)
+{
+   unsigned long timeout;
+   uint32_t rval = QLA_SUCCESS;
+   uint32_t temp;
+
+   timeout = jiffies + msecs_to_jiffies(TIMEOUT_100_MS);
+   do {
+   ha-isp_ops-rd_reg_indirect(ha, addr1, temp);
+   if ((temp  mask) != 0)
+   break;
+
+   if (time_after_eq(jiffies, timeout)) {
+   ql4_printk(KERN_INFO, ha, Error in processing rdmdio 
entry\n);
+   return QLA_ERROR;
+   }
+   } while (1);
+
+   return rval;
+}
+
+uint32_t ql4_84xx_ipmdio_rd_reg(struct scsi_qla_host *ha, uint32_t addr1,
+   uint32_t addr3, uint32_t mask, uint32_t addr,
+   uint32_t *data_ptr)
+{
+   int rval = QLA_SUCCESS;
+   uint32_t temp;
+   uint32_t data;
+
+   rval = ql4_84xx_poll_wait_for_ready(ha, addr1, mask);
+   if (rval)
+   goto exit_ipmdio_rd_reg;
+
+   temp = (0x4000 | addr);
+   ha-isp_ops-wr_reg_indirect(ha, addr1, temp);
+
+   rval = ql4_84xx_poll_wait_for_ready(ha, addr1, mask);
+   if (rval)
+   goto exit_ipmdio_rd_reg;
+
+   ha-isp_ops-rd_reg_indirect(ha, addr3, data);
+   *data_ptr = data;
+
+exit_ipmdio_rd_reg:
+   return rval;
+}
+
+
+static uint32_t ql4_84xx_poll_wait_ipmdio_bus_idle(struct scsi_qla_host *ha,
+   uint32_t addr1,
+   uint32_t addr2,
+   uint32_t addr3,
+   uint32_t mask)
+{
+   unsigned long timeout;
+   uint32_t temp;
+   uint32_t rval = QLA_SUCCESS;
+
+   timeout = jiffies + msecs_to_jiffies(TIMEOUT_100_MS);
+   do {
+   ql4_84xx_ipmdio_rd_reg(ha, addr1, addr3, mask, addr2, temp);
+   if ((temp  0x1) != 1)
+   break;
+   if (time_after_eq(jiffies, timeout)) {
+   ql4_printk(KERN_INFO, ha, Error in processing mdiobus 
idle\n);
+   return QLA_ERROR;
+   }
+   } while (1);
+
+   return rval;
+}
+
+static int ql4_84xx_ipmdio_wr_reg(struct scsi_qla_host *ha,
+ uint32_t addr1, uint32_t addr3,
+ uint32_t mask, 

[PATCH 10/10] qla4xxx: Update driver version to 5.04.00-k5

2014-02-24 Thread vikas.chaudhary
From: Vikas Chaudhary vikas.chaudh...@qlogic.com

Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
---
 drivers/scsi/qla4xxx/ql4_version.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/qla4xxx/ql4_version.h 
b/drivers/scsi/qla4xxx/ql4_version.h
index c6ba0a6..bd78cb3 100644
--- a/drivers/scsi/qla4xxx/ql4_version.h
+++ b/drivers/scsi/qla4xxx/ql4_version.h
@@ -5,4 +5,4 @@
  * See LICENSE.qla4xxx for copyright and licensing details.
  */
 
-#define QLA4XXX_DRIVER_VERSION 5.04.00-k4
+#define QLA4XXX_DRIVER_VERSION 5.04.00-k5
-- 
1.8.2.GIT

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 06/10] qla4xxx: qla4xxx: Move qla4_8xxx_ms_mem_write_128b to ql4_nx.c

2014-02-24 Thread vikas.chaudhary
From: Vikas Chaudhary vikas.chaudh...@qlogic.com

Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
---
 drivers/scsi/qla4xxx/ql4_83xx.c | 106 
 drivers/scsi/qla4xxx/ql4_nx.c   | 106 
 2 files changed, 106 insertions(+), 106 deletions(-)

diff --git a/drivers/scsi/qla4xxx/ql4_83xx.c b/drivers/scsi/qla4xxx/ql4_83xx.c
index ffce016..556c152 100644
--- a/drivers/scsi/qla4xxx/ql4_83xx.c
+++ b/drivers/scsi/qla4xxx/ql4_83xx.c
@@ -249,112 +249,6 @@ void qla4_83xx_rom_lock_recovery(struct scsi_qla_host *ha)
qla4_83xx_flash_unlock(ha);
 }
 
-/**
- * qla4_8xxx_ms_mem_write_128b - Writes data to MS/off-chip memory
- * @ha: Pointer to adapter structure
- * @addr: Flash address to write to
- * @data: Data to be written
- * @count: word_count to be written
- *
- * Return: On success return QLA_SUCCESS
- *On error return QLA_ERROR
- **/
-int qla4_8xxx_ms_mem_write_128b(struct scsi_qla_host *ha, uint64_t addr,
-   uint32_t *data, uint32_t count)
-{
-   int i, j;
-   uint32_t agt_ctrl;
-   unsigned long flags;
-   int ret_val = QLA_SUCCESS;
-
-   /* Only 128-bit aligned access */
-   if (addr  0xF) {
-   ret_val = QLA_ERROR;
-   goto exit_ms_mem_write;
-   }
-
-   write_lock_irqsave(ha-hw_lock, flags);
-
-   /* Write address */
-   ret_val = ha-isp_ops-wr_reg_indirect(ha, MD_MIU_TEST_AGT_ADDR_HI, 0);
-   if (ret_val == QLA_ERROR) {
-   ql4_printk(KERN_ERR, ha, %s: write to AGT_ADDR_HI failed\n,
-  __func__);
-   goto exit_ms_mem_write_unlock;
-   }
-
-   for (i = 0; i  count; i++, addr += 16) {
-   if (!((QLA8XXX_ADDR_IN_RANGE(addr, QLA8XXX_ADDR_QDR_NET,
-QLA8XXX_ADDR_QDR_NET_MAX)) ||
- (QLA8XXX_ADDR_IN_RANGE(addr, QLA8XXX_ADDR_DDR_NET,
-QLA8XXX_ADDR_DDR_NET_MAX {
-   ret_val = QLA_ERROR;
-   goto exit_ms_mem_write_unlock;
-   }
-
-   ret_val = ha-isp_ops-wr_reg_indirect(ha,
-  MD_MIU_TEST_AGT_ADDR_LO,
-  addr);
-   /* Write data */
-   ret_val |= ha-isp_ops-wr_reg_indirect(ha,
- MD_MIU_TEST_AGT_WRDATA_LO,
- *data++);
-   ret_val |= ha-isp_ops-wr_reg_indirect(ha,
- MD_MIU_TEST_AGT_WRDATA_HI,
- *data++);
-   ret_val |= ha-isp_ops-wr_reg_indirect(ha,
-MD_MIU_TEST_AGT_WRDATA_ULO,
-*data++);
-   ret_val |= ha-isp_ops-wr_reg_indirect(ha,
-MD_MIU_TEST_AGT_WRDATA_UHI,
-*data++);
-   if (ret_val == QLA_ERROR) {
-   ql4_printk(KERN_ERR, ha, %s: write to AGT_WRDATA 
failed\n,
-  __func__);
-   goto exit_ms_mem_write_unlock;
-   }
-
-   /* Check write status */
-   ret_val = ha-isp_ops-wr_reg_indirect(ha, MD_MIU_TEST_AGT_CTRL,
-  MIU_TA_CTL_WRITE_ENABLE);
-   ret_val |= ha-isp_ops-wr_reg_indirect(ha,
-   MD_MIU_TEST_AGT_CTRL,
-   MIU_TA_CTL_WRITE_START);
-   if (ret_val == QLA_ERROR) {
-   ql4_printk(KERN_ERR, ha, %s: write to AGT_CTRL 
failed\n,
-  __func__);
-   goto exit_ms_mem_write_unlock;
-   }
-
-   for (j = 0; j  MAX_CTL_CHECK; j++) {
-   ret_val = ha-isp_ops-rd_reg_indirect(ha,
- MD_MIU_TEST_AGT_CTRL,
- agt_ctrl);
-   if (ret_val == QLA_ERROR) {
-   ql4_printk(KERN_ERR, ha, %s: failed to read 
MD_MIU_TEST_AGT_CTRL\n,
-  __func__);
-   goto exit_ms_mem_write_unlock;
-   }
-   if ((agt_ctrl  MIU_TA_CTL_BUSY) == 0)
-   break;
-   }
-
-   /* Status check failed */
-   if (j = MAX_CTL_CHECK) {
-   printk_ratelimited(KERN_ERR %s: MS memory write 
failed!\n,
-   

[PATCH 01/10] qla4xxx: Do not wait for IO completion, after issuing stop_firmware

2014-02-24 Thread vikas.chaudhary
From: Tej Parkash tej.park...@qlogic.com

Problem:
iSCSI stop_firmware mailbox command is not completing outstanding IO.

Solution:
Do not wait for IO completion after issuing stop_firmware mailbox
command

Signed-off-by: Tej Parkash tej.park...@qlogic.com
Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
---
 drivers/scsi/qla4xxx/ql4_os.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index 459b9f7..2e95be4 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -4862,9 +4862,6 @@ static int qla4xxx_recover_adapter(struct scsi_qla_host 
*ha)
ha-host_no, __func__));
status = ha-isp_ops-reset_firmware(ha);
if (status == QLA_SUCCESS) {
-   if (!test_bit(AF_FW_RECOVERY, ha-flags))
-   qla4xxx_cmd_wait(ha);
-
ha-isp_ops-disable_intrs(ha);
qla4xxx_process_aen(ha, FLUSH_DDB_CHANGED_AENS);
qla4xxx_abort_active_cmds(ha, DID_RESET  16);
-- 
1.8.2.GIT

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 05/10] qla4xxx: Added PEX DMA Support for ISP8022 Adapter

2014-02-24 Thread vikas.chaudhary
From: Tej Parkash tej.park...@qlogic.com

Signed-off-by: Tej Parkash tej.park...@qlogic.com
Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
---
 drivers/scsi/qla4xxx/ql4_83xx.c | 44 +
 drivers/scsi/qla4xxx/ql4_glbl.h |  2 +-
 drivers/scsi/qla4xxx/ql4_nx.c   | 15 --
 3 files changed, 28 insertions(+), 33 deletions(-)

diff --git a/drivers/scsi/qla4xxx/ql4_83xx.c b/drivers/scsi/qla4xxx/ql4_83xx.c
index 2eba353..ffce016 100644
--- a/drivers/scsi/qla4xxx/ql4_83xx.c
+++ b/drivers/scsi/qla4xxx/ql4_83xx.c
@@ -250,7 +250,7 @@ void qla4_83xx_rom_lock_recovery(struct scsi_qla_host *ha)
 }
 
 /**
- * qla4_83xx_ms_mem_write_128b - Writes data to MS/off-chip memory
+ * qla4_8xxx_ms_mem_write_128b - Writes data to MS/off-chip memory
  * @ha: Pointer to adapter structure
  * @addr: Flash address to write to
  * @data: Data to be written
@@ -259,7 +259,7 @@ void qla4_83xx_rom_lock_recovery(struct scsi_qla_host *ha)
  * Return: On success return QLA_SUCCESS
  *On error return QLA_ERROR
  **/
-int qla4_83xx_ms_mem_write_128b(struct scsi_qla_host *ha, uint64_t addr,
+int qla4_8xxx_ms_mem_write_128b(struct scsi_qla_host *ha, uint64_t addr,
uint32_t *data, uint32_t count)
 {
int i, j;
@@ -276,7 +276,7 @@ int qla4_83xx_ms_mem_write_128b(struct scsi_qla_host *ha, 
uint64_t addr,
write_lock_irqsave(ha-hw_lock, flags);
 
/* Write address */
-   ret_val = qla4_83xx_wr_reg_indirect(ha, MD_MIU_TEST_AGT_ADDR_HI, 0);
+   ret_val = ha-isp_ops-wr_reg_indirect(ha, MD_MIU_TEST_AGT_ADDR_HI, 0);
if (ret_val == QLA_ERROR) {
ql4_printk(KERN_ERR, ha, %s: write to AGT_ADDR_HI failed\n,
   __func__);
@@ -292,19 +292,20 @@ int qla4_83xx_ms_mem_write_128b(struct scsi_qla_host *ha, 
uint64_t addr,
goto exit_ms_mem_write_unlock;
}
 
-   ret_val = qla4_83xx_wr_reg_indirect(ha, MD_MIU_TEST_AGT_ADDR_LO,
-   addr);
+   ret_val = ha-isp_ops-wr_reg_indirect(ha,
+  MD_MIU_TEST_AGT_ADDR_LO,
+  addr);
/* Write data */
-   ret_val |= qla4_83xx_wr_reg_indirect(ha,
-MD_MIU_TEST_AGT_WRDATA_LO,
-*data++);
-   ret_val |= qla4_83xx_wr_reg_indirect(ha,
-MD_MIU_TEST_AGT_WRDATA_HI,
-*data++);
-   ret_val |= qla4_83xx_wr_reg_indirect(ha,
+   ret_val |= ha-isp_ops-wr_reg_indirect(ha,
+ MD_MIU_TEST_AGT_WRDATA_LO,
+ *data++);
+   ret_val |= ha-isp_ops-wr_reg_indirect(ha,
+ MD_MIU_TEST_AGT_WRDATA_HI,
+ *data++);
+   ret_val |= ha-isp_ops-wr_reg_indirect(ha,
 MD_MIU_TEST_AGT_WRDATA_ULO,
 *data++);
-   ret_val |= qla4_83xx_wr_reg_indirect(ha,
+   ret_val |= ha-isp_ops-wr_reg_indirect(ha,
 MD_MIU_TEST_AGT_WRDATA_UHI,
 *data++);
if (ret_val == QLA_ERROR) {
@@ -314,10 +315,11 @@ int qla4_83xx_ms_mem_write_128b(struct scsi_qla_host *ha, 
uint64_t addr,
}
 
/* Check write status */
-   ret_val = qla4_83xx_wr_reg_indirect(ha, MD_MIU_TEST_AGT_CTRL,
-   MIU_TA_CTL_WRITE_ENABLE);
-   ret_val |= qla4_83xx_wr_reg_indirect(ha, MD_MIU_TEST_AGT_CTRL,
-MIU_TA_CTL_WRITE_START);
+   ret_val = ha-isp_ops-wr_reg_indirect(ha, MD_MIU_TEST_AGT_CTRL,
+  MIU_TA_CTL_WRITE_ENABLE);
+   ret_val |= ha-isp_ops-wr_reg_indirect(ha,
+   MD_MIU_TEST_AGT_CTRL,
+   MIU_TA_CTL_WRITE_START);
if (ret_val == QLA_ERROR) {
ql4_printk(KERN_ERR, ha, %s: write to AGT_CTRL 
failed\n,
   __func__);
@@ -325,9 +327,9 @@ int qla4_83xx_ms_mem_write_128b(struct scsi_qla_host *ha, 
uint64_t addr,
}
 
for (j = 0; j  MAX_CTL_CHECK; j++) {
-   ret_val = qla4_83xx_rd_reg_indirect(ha,
-   

[PATCH V1 16/24] qla4xxx: Fix failure of mbox 0x31

2014-01-17 Thread vikas.chaudhary
From: Vikas Chaudhary vikas.chaudh...@qlogic.com

Issue:
While unloading driver MBOX 0x31 fail as DDB logout (MBOX 0x56)
operation is not completed.

Fix:
Wait for DDB Logout completion before MBOX 0x31

Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
---
 drivers/scsi/qla4xxx/ql4_os.c | 56 ---
 1 file changed, 48 insertions(+), 8 deletions(-)

diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index a27da31..7807a13 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -8886,10 +8886,56 @@ static void qla4xxx_prevent_other_port_reinit(struct 
scsi_qla_host *ha)
}
 }
 
+static void qla4xxx_destroy_ddb(struct scsi_qla_host *ha,
+   struct ddb_entry *ddb_entry)
+{
+   struct dev_db_entry *fw_ddb_entry = NULL;
+   dma_addr_t fw_ddb_entry_dma;
+   unsigned long wtime;
+   uint32_t ddb_state;
+   int options;
+   int status;
+
+   options = LOGOUT_OPTION_CLOSE_SESSION;
+   if (qla4xxx_session_logout_ddb(ha, ddb_entry, options) == QLA_ERROR) {
+   ql4_printk(KERN_ERR, ha, %s: Logout failed\n, __func__);
+   goto clear_ddb;
+   }
+
+   fw_ddb_entry = dma_alloc_coherent(ha-pdev-dev, sizeof(*fw_ddb_entry),
+ fw_ddb_entry_dma, GFP_KERNEL);
+   if (!fw_ddb_entry) {
+   ql4_printk(KERN_ERR, ha,
+  %s: Unable to allocate dma buffer\n, __func__);
+   goto clear_ddb;
+   }
+
+   wtime = jiffies + (HZ * LOGOUT_TOV);
+   do {
+   status = qla4xxx_get_fwddb_entry(ha, ddb_entry-fw_ddb_index,
+fw_ddb_entry, fw_ddb_entry_dma,
+NULL, NULL, ddb_state, NULL,
+NULL, NULL);
+   if (status == QLA_ERROR)
+   goto free_ddb;
+
+   if ((ddb_state == DDB_DS_NO_CONNECTION_ACTIVE) ||
+   (ddb_state == DDB_DS_SESSION_FAILED))
+   goto free_ddb;
+
+   schedule_timeout_uninterruptible(HZ);
+   } while ((time_after(wtime, jiffies)));
+
+free_ddb:
+   dma_free_coherent(ha-pdev-dev, sizeof(*fw_ddb_entry),
+ fw_ddb_entry, fw_ddb_entry_dma);
+clear_ddb:
+   qla4xxx_clear_ddb_entry(ha, ddb_entry-fw_ddb_index);
+}
+
 static void qla4xxx_destroy_fw_ddb_session(struct scsi_qla_host *ha)
 {
struct ddb_entry *ddb_entry;
-   int options;
int idx;
 
for (idx = 0; idx  MAX_DDB_ENTRIES; idx++) {
@@ -8898,13 +8944,7 @@ static void qla4xxx_destroy_fw_ddb_session(struct 
scsi_qla_host *ha)
if ((ddb_entry != NULL) 
(ddb_entry-ddb_type == FLASH_DDB)) {
 
-   options = LOGOUT_OPTION_CLOSE_SESSION;
-   if (qla4xxx_session_logout_ddb(ha, ddb_entry, options)
-   == QLA_ERROR)
-   ql4_printk(KERN_ERR, ha, %s: Logout failed\n,
-  __func__);
-
-   qla4xxx_clear_ddb_entry(ha, ddb_entry-fw_ddb_index);
+   qla4xxx_destroy_ddb(ha, ddb_entry);
/*
 * we have decremented the reference count of the driver
 * when we setup the session to have the driver unload
-- 
1.8.2.GIT

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 14/24] qla4xxx: Driver not able to collect minidump for ISP84xx

2013-12-16 Thread vikas.chaudhary
From: Tej Parkash tej.park...@qlogic.com

Issue:
minidump data collection fails as driver reports data mismatch

Fix:
When the driver encounters a new entry type that it cannot process,
it should just skip the entry and adjust the total buffer size by
subtracting the skipped bytes from it. This is to ensure that there
is no data mismatch because of the new entries.

Signed-off-by: Tej Parkash tej.park...@qlogic.com
Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
---
 drivers/scsi/qla4xxx/ql4_def.h | 1 +
 drivers/scsi/qla4xxx/ql4_nx.c  | 8 +++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/qla4xxx/ql4_def.h b/drivers/scsi/qla4xxx/ql4_def.h
index c2deaa0..73a5022 100644
--- a/drivers/scsi/qla4xxx/ql4_def.h
+++ b/drivers/scsi/qla4xxx/ql4_def.h
@@ -769,6 +769,7 @@ struct scsi_qla_host {
uint32_t fw_dump_capture_mask;
void *fw_dump_tmplt_hdr;
uint32_t fw_dump_tmplt_size;
+   uint32_t fw_dump_skip_size;
 
struct completion mbx_intr_comp;
 
diff --git a/drivers/scsi/qla4xxx/ql4_nx.c b/drivers/scsi/qla4xxx/ql4_nx.c
index bcf3e43..d2040b4 100644
--- a/drivers/scsi/qla4xxx/ql4_nx.c
+++ b/drivers/scsi/qla4xxx/ql4_nx.c
@@ -2383,6 +2383,11 @@ static void qla4_8xxx_mark_entry_skipped(struct 
scsi_qla_host *ha,
  scsi(%ld): Skipping entry[%d]: 
ETYPE[0x%x]-ELEVEL[0x%x]\n,
  ha-host_no, index, entry_hdr-entry_type,
  entry_hdr-d_ctrl.entry_capture_mask));
+   /* If driver encounters a new entry type that it cannot process,
+* it should just skip the entry and adjust the total buffer size by
+* from subtracting the skipped bytes from it
+*/
+   ha-fw_dump_skip_size += entry_hdr-entry_capture_size;
 }
 
 /* ISP83xx functions to process new minidump entries... */
@@ -2590,6 +2595,7 @@ static int qla4_8xxx_collect_md_data(struct scsi_qla_host 
*ha)
uint64_t now;
uint32_t timestamp;
 
+   ha-fw_dump_skip_size = 0;
if (!ha-fw_dump) {
ql4_printk(KERN_INFO, ha, %s(%ld) No buffer to dump\n,
   __func__, ha-host_no);
@@ -2761,7 +2767,7 @@ skip_nxt_entry:
 entry_hdr-entry_size);
}
 
-   if (data_collected != ha-fw_dump_size) {
+   if ((data_collected + ha-fw_dump_skip_size) != ha-fw_dump_size) {
ql4_printk(KERN_INFO, ha,
   Dump data mismatch: Data collected: [0x%x], 
total_data_size:[0x%x]\n,
   data_collected, ha-fw_dump_size);
-- 
1.8.2.GIT

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 15/24] qla4xxx: Reduce rom-lock contention during reset recovery.

2013-12-16 Thread vikas.chaudhary
From: Vikas Chaudhary vikas.chaudh...@qlogic.com

Issue:
Driver holds rom-lock for too long during reset recovery.

During adapter reset testing, it was found that the driver
holds the rom-lock for too long, because of which other
drivers fail to acquire the rom-lock, leading to reset
failures.
The primary cause is, in the bootstrap code, while
holding the rom-lock, the driver checks if the peg is
halted, causing a 2 second contention.

Fix:
When a reset recovery starts, the driver deduces the cause, and
sets appropriate flags in watchdog  recover_adapter routines.
This flag should be used to determine if bootstrap is invoked
from probe or reset context, reducing the rom-lock footprint of
the drivers.

Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
---
 drivers/scsi/qla4xxx/ql4_nx.c | 33 -
 1 file changed, 12 insertions(+), 21 deletions(-)

diff --git a/drivers/scsi/qla4xxx/ql4_nx.c b/drivers/scsi/qla4xxx/ql4_nx.c
index d2040b4..63328c8 100644
--- a/drivers/scsi/qla4xxx/ql4_nx.c
+++ b/drivers/scsi/qla4xxx/ql4_nx.c
@@ -2828,37 +2828,28 @@ int qla4_8xxx_device_bootstrap(struct scsi_qla_host *ha)
int rval = QLA_ERROR;
int i;
uint32_t old_count, count;
-   int need_reset = 0, peg_stuck = 1;
+   int need_reset = 0;
 
need_reset = ha-isp_ops-need_reset(ha);
-   old_count = qla4_8xxx_rd_direct(ha, QLA8XXX_PEG_ALIVE_COUNTER);
-
-   for (i = 0; i  10; i++) {
-   msleep(200);
-   count = qla4_8xxx_rd_direct(ha, QLA8XXX_PEG_ALIVE_COUNTER);
-   if (count != old_count)
-   peg_stuck = 0;
-   }
 
if (need_reset) {
/* We are trying to perform a recovery here. */
-   if (peg_stuck)
+   if (test_bit(AF_FW_RECOVERY, ha-flags))
ha-isp_ops-rom_lock_recovery(ha);
-   goto dev_initialize;
} else  {
-   /* Start of day for this ha context. */
-   if (peg_stuck) {
-   /* Either we are the first or recovery in progress. */
-   ha-isp_ops-rom_lock_recovery(ha);
-   goto dev_initialize;
-   } else {
-   /* Firmware already running. */
-   rval = QLA_SUCCESS;
-   goto dev_ready;
+   old_count = qla4_8xxx_rd_direct(ha, QLA8XXX_PEG_ALIVE_COUNTER);
+   for (i = 0; i  10; i++) {
+   msleep(200);
+   count = qla4_8xxx_rd_direct(ha,
+   QLA8XXX_PEG_ALIVE_COUNTER);
+   if (count != old_count) {
+   rval = QLA_SUCCESS;
+   goto dev_ready;
+   }
}
+   ha-isp_ops-rom_lock_recovery(ha);
}
 
-dev_initialize:
/* set to DEV_INITIALIZING */
ql4_printk(KERN_INFO, ha, HW State: INITIALIZING\n);
qla4_8xxx_wr_direct(ha, QLA8XXX_CRB_DEV_STATE,
-- 
1.8.2.GIT

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 11/24] qla4xxx: Fix failure of IDC Time Extend mailbox command

2013-12-16 Thread vikas.chaudhary
From: Vikas Chaudhary vikas.chaudh...@qlogic.com

Issue:
Mailbox command 0x102 (IDC Time Extend) failure seen while applying
changes to iface using iscsiadm

Fix:
Added fix to extend IDC timeout only for ISP84xx when IDC ACK
needs to be posted and disable ACB mailbox command completion
is in intermediate state.

Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
---
 drivers/scsi/qla4xxx/ql4_mbx.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/qla4xxx/ql4_mbx.c b/drivers/scsi/qla4xxx/ql4_mbx.c
index 023f2dd..1d8f485 100644
--- a/drivers/scsi/qla4xxx/ql4_mbx.c
+++ b/drivers/scsi/qla4xxx/ql4_mbx.c
@@ -1922,6 +1922,7 @@ int qla4xxx_disable_acb(struct scsi_qla_host *ha)
  mbox_sts[0], mbox_sts[1], mbox_sts[2]));
} else {
if (is_qla8042(ha) 
+   test_bit(DPC_POST_IDC_ACK, ha-dpc_flags) 
(mbox_sts[0] != MBOX_STS_COMMAND_COMPLETE)) {
/*
 * Disable ACB mailbox command takes time to complete
-- 
1.8.2.GIT

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 13/24] qla4xxx: Fix pending IO completion in reset path before initiating chip reset

2013-12-16 Thread vikas.chaudhary
From: Tej Parkash tej.park...@qlogic.com

Issue:
Pending IO wait does not complete after triggering Graceful reset,
causing ack timeout and call traces.

Fix:
1. Reducing the IO command wait timeout before triggering reset,
   as logically also timeout should be less than reset timeout (10sec).
2. Moving the abort IO after chip reset, because only after
   chip reset, driver owns the IO otherwise it is with firmware and can
   still revert back with response.

Signed-off-by: Tej Parkash tej.park...@qlogic.com
Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
---
 drivers/scsi/qla4xxx/ql4_def.h |  2 +-
 drivers/scsi/qla4xxx/ql4_os.c  | 16 
 2 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/drivers/scsi/qla4xxx/ql4_def.h b/drivers/scsi/qla4xxx/ql4_def.h
index 33eae2e..c2deaa0 100644
--- a/drivers/scsi/qla4xxx/ql4_def.h
+++ b/drivers/scsi/qla4xxx/ql4_def.h
@@ -194,7 +194,7 @@
 #define ADAPTER_INIT_TOV   30
 #define ADAPTER_RESET_TOV  180
 #define EXTEND_CMD_TOV 60
-#define WAIT_CMD_TOV   30
+#define WAIT_CMD_TOV   5
 #define EH_WAIT_CMD_TOV120
 #define FIRMWARE_UP_TOV60
 #define RESET_FIRMWARE_TOV 30
diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index 3fec116..a27da31 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -4561,11 +4561,19 @@ static int qla4xxx_cmd_wait(struct scsi_qla_host *ha)
uint32_t index = 0;
unsigned long flags;
struct scsi_cmnd *cmd;
+   unsigned long wtime;
+   uint32_t wtmo;
 
-   unsigned long wtime = jiffies + (WAIT_CMD_TOV * HZ);
+   if (is_qla40XX(ha))
+   wtmo = WAIT_CMD_TOV;
+   else
+   wtmo = ha-nx_reset_timeout / 2;
 
-   DEBUG2(ql4_printk(KERN_INFO, ha, Wait up to %d seconds for cmds to 
-   complete\n, WAIT_CMD_TOV));
+   wtime = jiffies + (wtmo * HZ);
+
+   DEBUG2(ql4_printk(KERN_INFO, ha,
+ Wait up to %u seconds for cmds to complete\n,
+ wtmo));
 
while (!time_after_eq(jiffies, wtime)) {
spin_lock_irqsave(ha-hardware_lock, flags);
@@ -4868,11 +4876,11 @@ chip_reset:
qla4xxx_cmd_wait(ha);
 
qla4xxx_process_aen(ha, FLUSH_DDB_CHANGED_AENS);
-   qla4xxx_abort_active_cmds(ha, DID_RESET  16);
DEBUG2(ql4_printk(KERN_INFO, ha,
scsi%ld: %s - Performing chip reset..\n,
ha-host_no, __func__));
status = ha-isp_ops-reset_chip(ha);
+   qla4xxx_abort_active_cmds(ha, DID_RESET  16);
}
 
/* Flush any pending ddb changed AENs */
-- 
1.8.2.GIT

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 07/24] qla4xxx: Correctly handle msleep_interruptible

2013-12-16 Thread vikas.chaudhary
From: Vikas Chaudhary vikas.chaudh...@qlogic.com

If waiting for signals was interrupted then the device was put to
FAILED state. Use msleep instead of msleep_interruptible to handle
this correctly.

Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
---
 drivers/scsi/qla4xxx/ql4_nx.c | 10 ++
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/scsi/qla4xxx/ql4_nx.c b/drivers/scsi/qla4xxx/ql4_nx.c
index 0ec07ec..cbc68f9 100644
--- a/drivers/scsi/qla4xxx/ql4_nx.c
+++ b/drivers/scsi/qla4xxx/ql4_nx.c
@@ -2820,7 +2820,7 @@ void qla4_8xxx_get_minidump(struct scsi_qla_host *ha)
 int qla4_8xxx_device_bootstrap(struct scsi_qla_host *ha)
 {
int rval = QLA_ERROR;
-   int i, timeout;
+   int i;
uint32_t old_count, count;
int need_reset = 0, peg_stuck = 1;
 
@@ -2828,13 +2828,7 @@ int qla4_8xxx_device_bootstrap(struct scsi_qla_host *ha)
old_count = qla4_8xxx_rd_direct(ha, QLA8XXX_PEG_ALIVE_COUNTER);
 
for (i = 0; i  10; i++) {
-   timeout = msleep_interruptible(200);
-   if (timeout) {
-   qla4_8xxx_wr_direct(ha, QLA8XXX_CRB_DEV_STATE,
-   QLA8XXX_DEV_FAILED);
-   return rval;
-   }
-
+   msleep(200);
count = qla4_8xxx_rd_direct(ha, QLA8XXX_PEG_ALIVE_COUNTER);
if (count != old_count)
peg_stuck = 0;
-- 
1.8.2.GIT

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 24/24] qla4xxx: Update driver version to 5.04.00-k4

2013-12-16 Thread vikas.chaudhary
From: Vikas Chaudhary vikas.chaudh...@qlogic.com

Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
---
 drivers/scsi/qla4xxx/ql4_version.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/qla4xxx/ql4_version.h 
b/drivers/scsi/qla4xxx/ql4_version.h
index 9b29466..c6ba0a6 100644
--- a/drivers/scsi/qla4xxx/ql4_version.h
+++ b/drivers/scsi/qla4xxx/ql4_version.h
@@ -5,4 +5,4 @@
  * See LICENSE.qla4xxx for copyright and licensing details.
  */
 
-#define QLA4XXX_DRIVER_VERSION 5.04.00-k3
+#define QLA4XXX_DRIVER_VERSION 5.04.00-k4
-- 
1.8.2.GIT

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 09/24] qla4xxx: Return correct error status from func qla4xxx_request_irqs()

2013-12-16 Thread vikas.chaudhary
From: Vikas Chaudhary vikas.chaudh...@qlogic.com

Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
---
 drivers/scsi/qla4xxx/ql4_isr.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/qla4xxx/ql4_isr.c b/drivers/scsi/qla4xxx/ql4_isr.c
index e56c6b4..49032f6 100644
--- a/drivers/scsi/qla4xxx/ql4_isr.c
+++ b/drivers/scsi/qla4xxx/ql4_isr.c
@@ -1488,6 +1488,7 @@ void qla4xxx_process_aen(struct scsi_qla_host * ha, 
uint8_t process_aen)
 int qla4xxx_request_irqs(struct scsi_qla_host *ha)
 {
int ret;
+   int rval = QLA_ERROR;
 
if (is_qla40XX(ha))
goto try_intx;
@@ -1568,9 +1569,10 @@ irq_attached:
set_bit(AF_IRQ_ATTACHED, ha-flags);
ha-host-irq = ha-pdev-irq;
ql4_printk(KERN_INFO, ha, %s: irq %d attached\n,
-   __func__, ha-pdev-irq);
+  __func__, ha-pdev-irq);
+   rval = QLA_SUCCESS;
 irq_not_attached:
-   return ret;
+   return rval;
 }
 
 void qla4xxx_free_irqs(struct scsi_qla_host *ha)
-- 
1.8.2.GIT

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 01/24] qla4xxx: ISP8xxx: Correct retry of adapter initialization

2013-12-16 Thread vikas.chaudhary
From: Nilesh Javali nilesh.jav...@qlogic.com

Issue:
For ISP8xxx, adapter initialization is not retried if qla4xxx_initialize_adapter
fails.

Fix:
If qla4xxx_initialize_adapter fails, first check if failure is due to IRQs not
attached in order to skip retrial, then free the IRQs and then retry 
initializing
the adapter.

Signed-off-by: Nilesh Javali nilesh.jav...@qlogic.com
Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
---
 drivers/scsi/qla4xxx/ql4_glbl.h |  1 +
 drivers/scsi/qla4xxx/ql4_init.c |  7 +--
 drivers/scsi/qla4xxx/ql4_nx.c   | 21 +
 drivers/scsi/qla4xxx/ql4_os.c   | 27 ++-
 4 files changed, 45 insertions(+), 11 deletions(-)

diff --git a/drivers/scsi/qla4xxx/ql4_glbl.h b/drivers/scsi/qla4xxx/ql4_glbl.h
index d67c50e..6d72e1d 100644
--- a/drivers/scsi/qla4xxx/ql4_glbl.h
+++ b/drivers/scsi/qla4xxx/ql4_glbl.h
@@ -279,6 +279,7 @@ int qla4_83xx_ms_mem_write_128b(struct scsi_qla_host *ha,
 uint8_t qla4xxx_set_ipaddr_state(uint8_t fw_ipaddr_state);
 int qla4_83xx_get_port_config(struct scsi_qla_host *ha, uint32_t *config);
 int qla4_83xx_set_port_config(struct scsi_qla_host *ha, uint32_t *config);
+int qla4_8xxx_check_init_adapter_retry(struct scsi_qla_host *ha);
 
 extern int ql4xextended_error_logging;
 extern int ql4xdontresethba;
diff --git a/drivers/scsi/qla4xxx/ql4_init.c b/drivers/scsi/qla4xxx/ql4_init.c
index 7456eeb..28fbece 100644
--- a/drivers/scsi/qla4xxx/ql4_init.c
+++ b/drivers/scsi/qla4xxx/ql4_init.c
@@ -959,13 +959,8 @@ int qla4xxx_initialize_adapter(struct scsi_qla_host *ha, 
int is_reset)
qla4xxx_build_ddb_list(ha, is_reset);
 
set_bit(AF_ONLINE, ha-flags);
-exit_init_hba:
-   if (is_qla80XX(ha)  (status == QLA_ERROR)) {
-   /* Since interrupts are registered in start_firmware for
-* 80XX, release them here if initialize_adapter fails */
-   qla4xxx_free_irqs(ha);
-   }
 
+exit_init_hba:
DEBUG2(printk(scsi%ld: initialize adapter: %s\n, ha-host_no,
status == QLA_ERROR ? FAILED : SUCCEEDED));
return status;
diff --git a/drivers/scsi/qla4xxx/ql4_nx.c b/drivers/scsi/qla4xxx/ql4_nx.c
index d001202..bbe8361 100644
--- a/drivers/scsi/qla4xxx/ql4_nx.c
+++ b/drivers/scsi/qla4xxx/ql4_nx.c
@@ -3836,3 +3836,24 @@ qla4_8xxx_enable_msix(struct scsi_qla_host *ha)
 msix_out:
return ret;
 }
+
+int qla4_8xxx_check_init_adapter_retry(struct scsi_qla_host *ha)
+{
+   int status = QLA_SUCCESS;
+
+   /* Dont retry adapter initialization if IRQ allocation failed */
+   if (!test_bit(AF_IRQ_ATTACHED, ha-flags)) {
+   ql4_printk(KERN_WARNING, ha, %s: Skipping retry of adapter 
initialization as IRQs are not attached\n,
+  __func__);
+   status = QLA_ERROR;
+   goto exit_init_adapter_failure;
+   }
+
+   /* Since interrupts are registered in start_firmware for
+* 8xxx, release them here if initialize_adapter fails
+* and retry adapter initialization */
+   qla4xxx_free_irqs(ha);
+
+exit_init_adapter_failure:
+   return status;
+}
diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index c21adc3..9803c9e 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -4881,8 +4881,21 @@ recover_ha_init_adapter:
ssleep(6);
 
/* NOTE: AF_ONLINE flag set upon successful completion of
-*   qla4xxx_initialize_adapter */
+* qla4xxx_initialize_adapter */
status = qla4xxx_initialize_adapter(ha, RESET_ADAPTER);
+   if (is_qla80XX(ha)  (status == QLA_ERROR)) {
+   status = qla4_8xxx_check_init_adapter_retry(ha);
+   if (status == QLA_ERROR) {
+   ql4_printk(KERN_INFO, ha, scsi%ld: %s: Don't 
retry recover adapter\n,
+  ha-host_no, __func__);
+   qla4xxx_dead_adapter_cleanup(ha);
+   clear_bit(DPC_RETRY_RESET_HA, ha-dpc_flags);
+   clear_bit(DPC_RESET_HA, ha-dpc_flags);
+   clear_bit(DPC_RESET_HA_FW_CONTEXT,
+ ha-dpc_flags);
+   goto exit_recover;
+   }
+   }
}
 
/* Retry failed adapter initialization, if necessary
@@ -8681,11 +8694,8 @@ static int qla4xxx_probe_adapter(struct pci_dev *pdev,
status = qla4xxx_initialize_adapter(ha, INIT_ADAPTER);
 
/* Dont retry adapter initialization if IRQ allocation failed */
-   if (is_qla80XX(ha)  !test_bit(AF_IRQ_ATTACHED, ha-flags)) {
-   ql4_printk(KERN_WARNING, ha, %s: Skipping retry of adapter 
initialization\n,
-  __func__);
+   if (is_qla80XX(ha)  (status == QLA_ERROR))
  

[PATCH 03/24] qla4xxx: Fix comments in code

2013-12-16 Thread vikas.chaudhary
From: Vikas Chaudhary vikas.chaudh...@qlogic.com

Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
---
 drivers/scsi/qla4xxx/ql4_def.h | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/qla4xxx/ql4_def.h b/drivers/scsi/qla4xxx/ql4_def.h
index aa67bb9..e9df4ad 100644
--- a/drivers/scsi/qla4xxx/ql4_def.h
+++ b/drivers/scsi/qla4xxx/ql4_def.h
@@ -595,10 +595,10 @@ struct scsi_qla_host {
 #define DPC_AEN9 /* 0x0200 */
 #define DPC_GET_DHCP_IP_ADDR   15 /* 0x8000 */
 #define DPC_LINK_CHANGED   18 /* 0x0004 */
-#define DPC_RESET_ACTIVE   20 /* 0x0004 */
-#define DPC_HA_UNRECOVERABLE   21 /* 0x0008 ISP-82xx only*/
-#define DPC_HA_NEED_QUIESCENT  22 /* 0x0010 ISP-82xx only*/
-#define DPC_POST_IDC_ACK   23 /* 0x0020 */
+#define DPC_RESET_ACTIVE   20 /* 0x0010 */
+#define DPC_HA_UNRECOVERABLE   21 /* 0x0020 ISP-82xx only*/
+#define DPC_HA_NEED_QUIESCENT  22 /* 0x0040 ISP-82xx only*/
+#define DPC_POST_IDC_ACK   23 /* 0x0080 */
 #define DPC_RESTORE_ACB24 /* 0x0100 */
 
struct Scsi_Host *host; /* pointer to host data */
-- 
1.8.2.GIT

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 23/24] qla4xxx: Fix sparse warnings

2013-12-16 Thread vikas.chaudhary
From: Vikas Chaudhary vikas.chaudh...@qlogic.com

Fix following sparse warnings:-
 drivers/scsi/qla4xxx/ql4_os.c:2109:33: warning: cast truncates bits from 
constant value (7fff becomes 7fff)
 drivers/scsi/qla4xxx/ql4_os.c:2306:33: warning: cast truncates bits from 
constant value (7fff becomes 7fff)

Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
---
 drivers/scsi/qla4xxx/ql4_os.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index e8a8a7d..3c2240c 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -2109,7 +2109,8 @@ static void qla4xxx_set_ipv6(struct scsi_qla_host *ha,
cpu_to_le16(IPV6_TCPOPT_DELAYED_ACK_DISABLE);
else
init_fw_cb-ipv6_tcp_opts =
-   cpu_to_le16(~IPV6_TCPOPT_DELAYED_ACK_DISABLE);
+   cpu_to_le16(~IPV6_TCPOPT_DELAYED_ACK_DISABLE 
+   0x);
break;
case ISCSI_NET_PARAM_TCP_NAGLE_DISABLE:
if (iface_param-iface_num  0x1)
@@ -2306,7 +2307,8 @@ static void qla4xxx_set_ipv4(struct scsi_qla_host *ha,
cpu_to_le16(TCPOPT_DELAYED_ACK_DISABLE);
else
init_fw_cb-ipv4_tcp_opts =
-   cpu_to_le16(~TCPOPT_DELAYED_ACK_DISABLE);
+   cpu_to_le16(~TCPOPT_DELAYED_ACK_DISABLE 
+   0x);
break;
case ISCSI_NET_PARAM_TCP_NAGLE_DISABLE:
if (iface_param-iface_num  0x1)
-- 
1.8.2.GIT

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 18/24] qla4xxx: Updated print for device login, logout path

2013-12-16 Thread vikas.chaudhary
From: Vikas Chaudhary vikas.chaudh...@qlogic.com

Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
---
 drivers/scsi/qla4xxx/ql4_os.c | 59 +++
 1 file changed, 43 insertions(+), 16 deletions(-)

diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index ce20c75..d0a8695 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -1670,16 +1670,13 @@ qla4xxx_ep_connect(struct Scsi_Host *shost, struct 
sockaddr *dst_addr,
struct sockaddr_in *addr;
struct sockaddr_in6 *addr6;
 
-   DEBUG2(printk(KERN_INFO Func: %s\n, __func__));
if (!shost) {
ret = -ENXIO;
-   printk(KERN_ERR %s: shost is NULL\n,
-  __func__);
+   pr_err(%s: shost is NULL\n, __func__);
return ERR_PTR(ret);
}
 
ha = iscsi_host_priv(shost);
-
ep = iscsi_create_endpoint(sizeof(struct qla_endpoint));
if (!ep) {
ret = -ENOMEM;
@@ -1699,6 +1696,9 @@ qla4xxx_ep_connect(struct Scsi_Host *shost, struct 
sockaddr *dst_addr,
addr6 = (struct sockaddr_in6 *)qla_ep-dst_addr;
DEBUG2(ql4_printk(KERN_INFO, ha, %s: %pI6\n, __func__,
  (char *)addr6-sin6_addr));
+   } else {
+   ql4_printk(KERN_WARNING, ha, %s: Invalid endpoint\n,
+  __func__);
}
 
qla_ep-host = shost;
@@ -1712,9 +1712,9 @@ static int qla4xxx_ep_poll(struct iscsi_endpoint *ep, int 
timeout_ms)
struct scsi_qla_host *ha;
int ret = 0;
 
-   DEBUG2(printk(KERN_INFO Func: %s\n, __func__));
qla_ep = ep-dd_data;
ha = to_qla_host(qla_ep-host);
+   DEBUG2(pr_info_ratelimited(%s: host: %ld\n, __func__, ha-host_no));
 
if (adapter_up(ha)  !test_bit(AF_BUILD_DDB_LIST, ha-flags))
ret = 1;
@@ -1724,7 +1724,13 @@ static int qla4xxx_ep_poll(struct iscsi_endpoint *ep, 
int timeout_ms)
 
 static void qla4xxx_ep_disconnect(struct iscsi_endpoint *ep)
 {
-   DEBUG2(printk(KERN_INFO Func: %s\n, __func__));
+   struct qla_endpoint *qla_ep;
+   struct scsi_qla_host *ha;
+
+   qla_ep = ep-dd_data;
+   ha = to_qla_host(qla_ep-host);
+   DEBUG2(ql4_printk(KERN_INFO, ha, %s: host: %ld\n, __func__,
+ ha-host_no));
iscsi_destroy_endpoint(ep);
 }
 
@@ -1734,8 +1740,11 @@ static int qla4xxx_get_ep_param(struct iscsi_endpoint 
*ep,
 {
struct qla_endpoint *qla_ep = ep-dd_data;
struct sockaddr *dst_addr;
+   struct scsi_qla_host *ha;
 
-   DEBUG2(printk(KERN_INFO Func: %s\n, __func__));
+   ha = to_qla_host(qla_ep-host);
+   DEBUG2(ql4_printk(KERN_INFO, ha, %s: host: %ld\n, __func__,
+ ha-host_no));
 
switch (param) {
case ISCSI_PARAM_CONN_PORT:
@@ -1766,13 +1775,13 @@ static void qla4xxx_conn_get_stats(struct 
iscsi_cls_conn *cls_conn,
int ret;
dma_addr_t iscsi_stats_dma;
 
-   DEBUG2(printk(KERN_INFO Func: %s\n, __func__));
-
cls_sess = iscsi_conn_to_session(cls_conn);
sess = cls_sess-dd_data;
ddb_entry = sess-dd_data;
ha = ddb_entry-ha;
 
+   DEBUG2(ql4_printk(KERN_INFO, ha, %s: host: %ld\n, __func__,
+ ha-host_no));
stats_size = PAGE_ALIGN(sizeof(struct ql_iscsi_stats));
/* Allocate memory */
ql_iscsi_stats = dma_alloc_coherent(ha-pdev-dev, stats_size,
@@ -3045,7 +3054,6 @@ qla4xxx_session_create(struct iscsi_endpoint *ep,
struct sockaddr *dst_addr;
int ret;
 
-   DEBUG2(printk(KERN_INFO Func: %s\n, __func__));
if (!ep) {
printk(KERN_ERR qla4xxx: missing ep.\n);
return NULL;
@@ -3054,6 +3062,8 @@ qla4xxx_session_create(struct iscsi_endpoint *ep,
qla_ep = ep-dd_data;
dst_addr = (struct sockaddr *)qla_ep-dst_addr;
ha = to_qla_host(qla_ep-host);
+   DEBUG2(ql4_printk(KERN_INFO, ha, %s: host: %ld\n, __func__,
+ ha-host_no));
 
ret = qla4xxx_get_ddb_index(ha, ddb_index);
if (ret == QLA_ERROR)
@@ -3093,10 +3103,11 @@ static void qla4xxx_session_destroy(struct 
iscsi_cls_session *cls_sess)
uint32_t ddb_state;
int ret;
 
-   DEBUG2(printk(KERN_INFO Func: %s\n, __func__));
sess = cls_sess-dd_data;
ddb_entry = sess-dd_data;
ha = ddb_entry-ha;
+   DEBUG2(ql4_printk(KERN_INFO, ha, %s: host: %ld\n, __func__,
+ ha-host_no));
 
fw_ddb_entry = dma_alloc_coherent(ha-pdev-dev, sizeof(*fw_ddb_entry),
  fw_ddb_entry_dma, GFP_KERNEL);
@@ -3143,17 +3154,23 @@ qla4xxx_conn_create(struct iscsi_cls_session *cls_sess, 
uint32_t conn_idx)
struct iscsi_cls_conn *cls_conn;
struct iscsi_session *sess;
struct ddb_entry *ddb_entry;
+   

[PATCH 16/24] qla4xxx: Fix failure of mbox 0x31

2013-12-16 Thread vikas.chaudhary
From: Vikas Chaudhary vikas.chaudh...@qlogic.com

Issue:
While unloading driver MBOX 0x31 fail as DDB logout (MBOX 0x56)
operation is not completed.

Fix:
Wait for DDB Logout completion before MBOX 0x31

Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
---
 drivers/scsi/qla4xxx/ql4_os.c | 54 ---
 1 file changed, 46 insertions(+), 8 deletions(-)

diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index a27da31..ce20c75 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -8886,10 +8886,54 @@ static void qla4xxx_prevent_other_port_reinit(struct 
scsi_qla_host *ha)
}
 }
 
+static void qla4xxx_destroy_ddb(struct scsi_qla_host *ha,
+   struct ddb_entry *ddb_entry)
+{
+   struct dev_db_entry *fw_ddb_entry = NULL;
+   dma_addr_t fw_ddb_entry_dma;
+   unsigned long wtime;
+   uint32_t ddb_state;
+   int options;
+   int status;
+
+   options = LOGOUT_OPTION_CLOSE_SESSION;
+   if (qla4xxx_session_logout_ddb(ha, ddb_entry, options) == QLA_ERROR) {
+   ql4_printk(KERN_ERR, ha, %s: Logout failed\n, __func__);
+   goto clear_ddb;
+   }
+
+   fw_ddb_entry = dma_alloc_coherent(ha-pdev-dev, sizeof(*fw_ddb_entry),
+ fw_ddb_entry_dma, GFP_KERNEL);
+   if (!fw_ddb_entry) {
+   ql4_printk(KERN_ERR, ha,
+  %s: Unable to allocate dma buffer\n, __func__);
+   goto clear_ddb;
+   }
+
+   wtime = jiffies + (HZ * LOGOUT_TOV);
+   do {
+   status = qla4xxx_get_fwddb_entry(ha, ddb_entry-fw_ddb_index,
+fw_ddb_entry, fw_ddb_entry_dma,
+NULL, NULL, ddb_state, NULL,
+NULL, NULL);
+   if (status == QLA_ERROR)
+   goto clear_ddb;
+
+   if ((ddb_state == DDB_DS_NO_CONNECTION_ACTIVE) ||
+   (ddb_state == DDB_DS_SESSION_FAILED))
+   goto clear_ddb;
+
+   schedule_timeout_uninterruptible(HZ);
+   } while ((time_after(wtime, jiffies)));
+
+clear_ddb:
+   qla4xxx_clear_ddb_entry(ha, ddb_entry-fw_ddb_index);
+   return;
+}
+
 static void qla4xxx_destroy_fw_ddb_session(struct scsi_qla_host *ha)
 {
struct ddb_entry *ddb_entry;
-   int options;
int idx;
 
for (idx = 0; idx  MAX_DDB_ENTRIES; idx++) {
@@ -8898,13 +8942,7 @@ static void qla4xxx_destroy_fw_ddb_session(struct 
scsi_qla_host *ha)
if ((ddb_entry != NULL) 
(ddb_entry-ddb_type == FLASH_DDB)) {
 
-   options = LOGOUT_OPTION_CLOSE_SESSION;
-   if (qla4xxx_session_logout_ddb(ha, ddb_entry, options)
-   == QLA_ERROR)
-   ql4_printk(KERN_ERR, ha, %s: Logout failed\n,
-  __func__);
-
-   qla4xxx_clear_ddb_entry(ha, ddb_entry-fw_ddb_index);
+   qla4xxx_destroy_ddb(ha, ddb_entry);
/*
 * we have decremented the reference count of the driver
 * when we setup the session to have the driver unload
-- 
1.8.2.GIT

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 17/24] qla4xxx: Remove unused code from qla4xxx_set_ifcb()

2013-12-16 Thread vikas.chaudhary
From: Vikas Chaudhary vikas.chaudh...@qlogic.com

Removing unused code as FW does not need any value in mbox-5.

Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
---
 drivers/scsi/qla4xxx/ql4_mbx.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/scsi/qla4xxx/ql4_mbx.c b/drivers/scsi/qla4xxx/ql4_mbx.c
index cc27d7f..782a94586 100644
--- a/drivers/scsi/qla4xxx/ql4_mbx.c
+++ b/drivers/scsi/qla4xxx/ql4_mbx.c
@@ -383,7 +383,6 @@ qla4xxx_set_ifcb(struct scsi_qla_host *ha, uint32_t 
*mbox_cmd,
mbox_cmd[2] = LSDW(init_fw_cb_dma);
mbox_cmd[3] = MSDW(init_fw_cb_dma);
mbox_cmd[4] = sizeof(struct addr_ctrl_blk);
-   mbox_cmd[5] = (IFCB_VER_MAX  8) | IFCB_VER_MIN;
 
if (qla4xxx_mailbox_command(ha, 6, 6, mbox_cmd, mbox_sts) !=
QLA_SUCCESS) {
-- 
1.8.2.GIT

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 04/24] qla4xxx: Use IDC_CTRL bit1 directly instead of AF_83XX_NO_FWDUMP flag.

2013-12-16 Thread vikas.chaudhary
From: Vikas Chaudhary vikas.chaudh...@qlogic.com

Removed AF_83XX_NO_FWDUMP flag and directly checking IDC_CTRL bit1
while taking minidump, to check for graceful reset.

Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
---
 drivers/scsi/qla4xxx/ql4_83xx.c | 16 ++--
 drivers/scsi/qla4xxx/ql4_def.h  |  1 -
 drivers/scsi/qla4xxx/ql4_nx.c   | 15 +--
 3 files changed, 15 insertions(+), 17 deletions(-)

diff --git a/drivers/scsi/qla4xxx/ql4_83xx.c b/drivers/scsi/qla4xxx/ql4_83xx.c
index 43c1688..e80e82f 100644
--- a/drivers/scsi/qla4xxx/ql4_83xx.c
+++ b/drivers/scsi/qla4xxx/ql4_83xx.c
@@ -1304,12 +1304,24 @@ static void qla4_83xx_process_init_seq(struct 
scsi_qla_host *ha)
 static int qla4_83xx_restart(struct scsi_qla_host *ha)
 {
int ret_val = QLA_SUCCESS;
+   uint32_t idc_ctrl;
 
qla4_83xx_process_stop_seq(ha);
 
-   /* Collect minidump*/
-   if (!test_and_clear_bit(AF_83XX_NO_FW_DUMP, ha-flags))
+   /*
+* Collect minidump.
+* If IDC_CTRL BIT1 is set, clear it on going to INIT state and
+* don't collect minidump
+*/
+   idc_ctrl = qla4_83xx_rd_reg(ha, QLA83XX_IDC_DRV_CTRL);
+   if (idc_ctrl  GRACEFUL_RESET_BIT1) {
+   qla4_83xx_wr_reg(ha, QLA83XX_IDC_DRV_CTRL,
+(idc_ctrl  ~GRACEFUL_RESET_BIT1));
+   ql4_printk(KERN_INFO, ha, %s: Graceful RESET: Not collecting 
minidump\n,
+  __func__);
+   } else {
qla4_8xxx_get_minidump(ha);
+   }
 
qla4_83xx_process_init_seq(ha);
 
diff --git a/drivers/scsi/qla4xxx/ql4_def.h b/drivers/scsi/qla4xxx/ql4_def.h
index e9df4ad..5236337 100644
--- a/drivers/scsi/qla4xxx/ql4_def.h
+++ b/drivers/scsi/qla4xxx/ql4_def.h
@@ -580,7 +580,6 @@ struct scsi_qla_host {
 #define AF_82XX_FW_DUMPED  24 /* 0x0100 */
 #define AF_8XXX_RST_OWNER  25 /* 0x0200 */
 #define AF_82XX_DUMP_READING   26 /* 0x0400 */
-#define AF_83XX_NO_FW_DUMP 27 /* 0x0800 */
 #define AF_83XX_IOCB_INTR_ON   28 /* 0x1000 */
 #define AF_83XX_MBOX_INTR_ON   29 /* 0x2000 */
 
diff --git a/drivers/scsi/qla4xxx/ql4_nx.c b/drivers/scsi/qla4xxx/ql4_nx.c
index bbe8361..0ec07ec 100644
--- a/drivers/scsi/qla4xxx/ql4_nx.c
+++ b/drivers/scsi/qla4xxx/ql4_nx.c
@@ -2821,7 +2821,7 @@ int qla4_8xxx_device_bootstrap(struct scsi_qla_host *ha)
 {
int rval = QLA_ERROR;
int i, timeout;
-   uint32_t old_count, count, idc_ctrl;
+   uint32_t old_count, count;
int need_reset = 0, peg_stuck = 1;
 
need_reset = ha-isp_ops-need_reset(ha);
@@ -2864,19 +2864,6 @@ dev_initialize:
qla4_8xxx_wr_direct(ha, QLA8XXX_CRB_DEV_STATE,
QLA8XXX_DEV_INITIALIZING);
 
-   /*
-* For ISP8324 and ISP8042, if IDC_CTRL GRACEFUL_RESET_BIT1 is set,
-* reset it after device goes to INIT state.
-*/
-   if (is_qla8032(ha) || is_qla8042(ha)) {
-   idc_ctrl = qla4_83xx_rd_reg(ha, QLA83XX_IDC_DRV_CTRL);
-   if (idc_ctrl  GRACEFUL_RESET_BIT1) {
-   qla4_83xx_wr_reg(ha, QLA83XX_IDC_DRV_CTRL,
-(idc_ctrl  ~GRACEFUL_RESET_BIT1));
-   set_bit(AF_83XX_NO_FW_DUMP, ha-flags);
-   }
-   }
-
ha-isp_ops-idc_unlock(ha);
 
if (is_qla8022(ha))
-- 
1.8.2.GIT

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 08/24] qla4xxx: Fixed AER reset sequence for ISP83xx/ISP84xx

2013-12-16 Thread vikas.chaudhary
From: Tej Parkash tej.park...@qlogic.com

Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
---
 drivers/scsi/qla4xxx/ql4_def.h |  3 ++-
 drivers/scsi/qla4xxx/ql4_os.c  | 46 +-
 2 files changed, 29 insertions(+), 20 deletions(-)

diff --git a/drivers/scsi/qla4xxx/ql4_def.h b/drivers/scsi/qla4xxx/ql4_def.h
index 5236337..4e11133 100644
--- a/drivers/scsi/qla4xxx/ql4_def.h
+++ b/drivers/scsi/qla4xxx/ql4_def.h
@@ -909,7 +909,8 @@ static inline int is_qla80XX(struct scsi_qla_host *ha)
 static inline int is_aer_supported(struct scsi_qla_host *ha)
 {
return ((ha-pdev-device == PCI_DEVICE_ID_QLOGIC_ISP8022) ||
-   (ha-pdev-device == PCI_DEVICE_ID_QLOGIC_ISP8324));
+   (ha-pdev-device == PCI_DEVICE_ID_QLOGIC_ISP8324) ||
+   (ha-pdev-device == PCI_DEVICE_ID_QLOGIC_ISP8042));
 }
 
 static inline int adapter_up(struct scsi_qla_host *ha)
diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index e6fa19c..a78edc3 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -9579,28 +9579,36 @@ static uint32_t qla4_8xxx_error_recovery(struct 
scsi_qla_host *ha)
}
 
fn = PCI_FUNC(ha-pdev-devfn);
-   while (fn  0) {
-   fn--;
-   ql4_printk(KERN_INFO, ha, scsi%ld: %s: Finding PCI device at 
-   func %x\n, ha-host_no, __func__, fn);
-   /* Get the pci device given the domain, bus,
-* slot/function number */
-   other_pdev =
-   pci_get_domain_bus_and_slot(pci_domain_nr(ha-pdev-bus),
-   ha-pdev-bus-number, PCI_DEVFN(PCI_SLOT(ha-pdev-devfn),
-   fn));
-
-   if (!other_pdev)
-   continue;
+   if (is_qla8022(ha)) {
+   while (fn  0) {
+   fn--;
+   ql4_printk(KERN_INFO, ha, scsi%ld: %s: Finding PCI 
device at func %x\n,
+  ha-host_no, __func__, fn);
+   /* Get the pci device given the domain, bus,
+* slot/function number */
+   other_pdev = pci_get_domain_bus_and_slot(
+  pci_domain_nr(ha-pdev-bus),
+  ha-pdev-bus-number,
+  PCI_DEVFN(PCI_SLOT(ha-pdev-devfn),
+  fn));
+
+   if (!other_pdev)
+   continue;
 
-   if (atomic_read(other_pdev-enable_cnt)) {
-   ql4_printk(KERN_INFO, ha, scsi%ld: %s: Found PCI 
-   func in enabled state%x\n, ha-host_no,
-   __func__, fn);
+   if (atomic_read(other_pdev-enable_cnt)) {
+   ql4_printk(KERN_INFO, ha, scsi%ld: %s: Found 
PCI func in enabled state%x\n,
+  ha-host_no, __func__, fn);
+   pci_dev_put(other_pdev);
+   break;
+   }
pci_dev_put(other_pdev);
-   break;
}
-   pci_dev_put(other_pdev);
+   } else {
+   /* this case is meant for ISP83xx/ISP84xx only */
+   if (qla4_83xx_can_perform_reset(ha)) {
+   /* reset fn as iSCSI is going to perform the reset */
+   fn = 0;
+   }
}
 
/* The first function on the card, the reset owner will
-- 
1.8.2.GIT

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 22/24] qla4xxx: Handle IPv6 AEN notifications

2013-12-16 Thread vikas.chaudhary
From: Nilesh Javali nilesh.jav...@qlogic.com

Signed-off-by: Nilesh Javali nilesh.jav...@qlogic.com
Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
---
 drivers/scsi/qla4xxx/ql4_fw.h  |  6 +++---
 drivers/scsi/qla4xxx/ql4_isr.c | 30 ++
 2 files changed, 33 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/qla4xxx/ql4_fw.h b/drivers/scsi/qla4xxx/ql4_fw.h
index a94593a..209853c 100644
--- a/drivers/scsi/qla4xxx/ql4_fw.h
+++ b/drivers/scsi/qla4xxx/ql4_fw.h
@@ -506,9 +506,9 @@ struct qla_flt_region {
 #define MBOX_ASTS_RESPONSE_QUEUE_FULL  0x8028
 #define MBOX_ASTS_IP_ADDR_STATE_CHANGED0x8029
 #define MBOX_ASTS_IPV6_DEFAULT_ROUTER_CHANGED  0x802A
-#define MBOX_ASTS_IPV6_PREFIX_EXPIRED  0x802B
-#define MBOX_ASTS_IPV6_ND_PREFIX_IGNORED   0x802C
-#define MBOX_ASTS_IPV6_LCL_PREFIX_IGNORED  0x802D
+#define MBOX_ASTS_IPV6_LINK_MTU_CHANGE 0x802B
+#define MBOX_ASTS_IPV6_AUTO_PREFIX_IGNORED 0x802C
+#define MBOX_ASTS_IPV6_ND_LOCAL_PREFIX_IGNORED 0x802D
 #define MBOX_ASTS_ICMPV6_ERROR_MSG_RCVD0x802E
 #define MBOX_ASTS_INITIALIZATION_FAILED0x8031
 #define MBOX_ASTS_SYSTEM_WARNING_EVENT 0x8036
diff --git a/drivers/scsi/qla4xxx/ql4_isr.c b/drivers/scsi/qla4xxx/ql4_isr.c
index df3fd9b..bb34ef8 100644
--- a/drivers/scsi/qla4xxx/ql4_isr.c
+++ b/drivers/scsi/qla4xxx/ql4_isr.c
@@ -635,6 +635,18 @@ static void qla4xxx_update_ipaddr_state(struct 
scsi_qla_host *ha,
}
 }
 
+static void qla4xxx_default_router_changed(struct scsi_qla_host *ha,
+  uint32_t *mbox_sts)
+{
+   memcpy(ha-ip_config.ipv6_default_router_addr.s6_addr32[0],
+  mbox_sts[2], sizeof(uint32_t));
+   memcpy(ha-ip_config.ipv6_default_router_addr.s6_addr32[1],
+  mbox_sts[3], sizeof(uint32_t));
+   memcpy(ha-ip_config.ipv6_default_router_addr.s6_addr32[2],
+  mbox_sts[4], sizeof(uint32_t));
+   memcpy(ha-ip_config.ipv6_default_router_addr.s6_addr32[3],
+  mbox_sts[5], sizeof(uint32_t));
+}
 
 /**
  * qla4xxx_isr_decode_mailbox - decodes mailbox status
@@ -802,6 +814,23 @@ static void qla4xxx_isr_decode_mailbox(struct 
scsi_qla_host * ha,
}
break;
 
+   case MBOX_ASTS_IPV6_LINK_MTU_CHANGE:
+   case MBOX_ASTS_IPV6_AUTO_PREFIX_IGNORED:
+   case MBOX_ASTS_IPV6_ND_LOCAL_PREFIX_IGNORED:
+   /* No action */
+   DEBUG2(ql4_printk(KERN_INFO, ha, scsi%ld: AEN %04x\n,
+ ha-host_no, mbox_status));
+   break;
+
+   case MBOX_ASTS_ICMPV6_ERROR_MSG_RCVD:
+   DEBUG2(ql4_printk(KERN_INFO, ha,
+ scsi%ld: AEN %04x, IPv6 ERROR, 
+ mbox_sts[1]=%08x, mbox_sts[2]=%08x, 
mbox_sts[3}=%08x, mbox_sts[4]=%08x mbox_sts[5]=%08x\n,
+ ha-host_no, mbox_sts[0], mbox_sts[1],
+ mbox_sts[2], mbox_sts[3], mbox_sts[4],
+ mbox_sts[5]));
+   break;
+
case MBOX_ASTS_MAC_ADDRESS_CHANGED:
case MBOX_ASTS_DNS:
/* No action */
@@ -939,6 +968,7 @@ static void qla4xxx_isr_decode_mailbox(struct scsi_qla_host 
* ha,
DEBUG2(ql4_printk(KERN_INFO, ha,
  scsi%ld: AEN %04x Received IPv6 
default router changed notification\n,
  ha-host_no, mbox_sts[0]));
+   qla4xxx_default_router_changed(ha, mbox_sts);
break;
 
case MBOX_ASTS_IDC_TIME_EXTEND_NOTIFICATION:
-- 
1.8.2.GIT

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 05/24] qla4xxx: Improve loopback failure messages

2013-12-16 Thread vikas.chaudhary
From: Nilesh Javali nilesh.jav...@qlogic.com

Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
---
 drivers/scsi/qla4xxx/ql4_bsg.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/qla4xxx/ql4_bsg.c b/drivers/scsi/qla4xxx/ql4_bsg.c
index 04a0027..9f92cbf 100644
--- a/drivers/scsi/qla4xxx/ql4_bsg.c
+++ b/drivers/scsi/qla4xxx/ql4_bsg.c
@@ -517,7 +517,7 @@ static int qla4_83xx_wait_for_loopback_config_comp(struct 
scsi_qla_host *ha,
(ha-idc_extend_tmo * HZ))) {
ha-notify_idc_comp = 0;
ha-notify_link_up_comp = 0;
-   ql4_printk(KERN_WARNING, ha, %s: IDC Complete 
notification not received,
+   ql4_printk(KERN_WARNING, ha, %s: Aborting: IDC 
Complete notification not received,
   __func__);
status = QLA_ERROR;
goto exit_wait;
@@ -538,7 +538,7 @@ static int qla4_83xx_wait_for_loopback_config_comp(struct 
scsi_qla_host *ha,
if (!wait_for_completion_timeout(ha-link_up_comp,
 (IDC_COMP_TOV * HZ))) {
ha-notify_link_up_comp = 0;
-   ql4_printk(KERN_WARNING, ha, %s: LINK UP notification 
not received,
+   ql4_printk(KERN_WARNING, ha, %s: Aborting: LINK UP 
notification not received,
   __func__);
status = QLA_ERROR;
goto exit_wait;
-- 
1.8.2.GIT

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 06/24] qla4xxx: Rename ACB_STATE macros with IP_ADDRSTATE macros

2013-12-16 Thread vikas.chaudhary
From: Nilesh Javali nilesh.jav...@qlogic.com

Signed-off-by: Nilesh Javali nilesh.jav...@qlogic.com
Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
---
 drivers/scsi/qla4xxx/ql4_fw.h  | 24 
 drivers/scsi/qla4xxx/ql4_isr.c | 14 +++---
 2 files changed, 15 insertions(+), 23 deletions(-)

diff --git a/drivers/scsi/qla4xxx/ql4_fw.h b/drivers/scsi/qla4xxx/ql4_fw.h
index 8d4092b..e3242df 100644
--- a/drivers/scsi/qla4xxx/ql4_fw.h
+++ b/drivers/scsi/qla4xxx/ql4_fw.h
@@ -528,14 +528,14 @@ struct qla_flt_region {
 #define ACB_CONFIG_DISABLE 0x00
 #define ACB_CONFIG_SET 0x01
 
-/* ACB State Defines */
-#define ACB_STATE_UNCONFIGURED 0x00
-#define ACB_STATE_INVALID  0x01
-#define ACB_STATE_ACQUIRING0x02
-#define ACB_STATE_TENTATIVE0x03
-#define ACB_STATE_DEPRICATED   0x04
-#define ACB_STATE_VALID0x05
-#define ACB_STATE_DISABLING0x06
+/* ACB/IP Address State Defines */
+#define IP_ADDRSTATE_UNCONFIGURED  0
+#define IP_ADDRSTATE_INVALID   1
+#define IP_ADDRSTATE_ACQUIRING 2
+#define IP_ADDRSTATE_TENTATIVE 3
+#define IP_ADDRSTATE_DEPRICATED4
+#define IP_ADDRSTATE_PREFERRED 5
+#define IP_ADDRSTATE_DISABLING 6
 
 /* FLASH offsets */
 #define FLASH_SEGMENT_IFCB 0x0400
@@ -698,14 +698,6 @@ struct addr_ctrl_blk {
uint8_t ipv6_lnk_lcl_addr_state;/* 222 */
uint8_t ipv6_addr0_state;   /* 223 */
uint8_t ipv6_addr1_state;   /* 224 */
-#define IP_ADDRSTATE_UNCONFIGURED  0
-#define IP_ADDRSTATE_INVALID   1
-#define IP_ADDRSTATE_ACQUIRING 2
-#define IP_ADDRSTATE_TENTATIVE 3
-#define IP_ADDRSTATE_DEPRICATED4
-#define IP_ADDRSTATE_PREFERRED 5
-#define IP_ADDRSTATE_DISABLING 6
-
uint8_t ipv6_dflt_rtr_state;/* 225 */
 #define IPV6_RTRSTATE_UNKNOWN   0
 #define IPV6_RTRSTATE_MANUAL1
diff --git a/drivers/scsi/qla4xxx/ql4_isr.c b/drivers/scsi/qla4xxx/ql4_isr.c
index a3c8bc7..e56c6b4 100644
--- a/drivers/scsi/qla4xxx/ql4_isr.c
+++ b/drivers/scsi/qla4xxx/ql4_isr.c
@@ -781,21 +781,21 @@ static void qla4xxx_isr_decode_mailbox(struct 
scsi_qla_host * ha,
mbox_sts[3]);
/* mbox_sts[2] = Old ACB state
 * mbox_sts[3] = new ACB state */
-   if ((mbox_sts[3] == ACB_STATE_VALID) 
-   ((mbox_sts[2] == ACB_STATE_TENTATIVE) ||
-   (mbox_sts[2] == ACB_STATE_ACQUIRING))) {
+   if ((mbox_sts[3] == IP_ADDRSTATE_PREFERRED) 
+   ((mbox_sts[2] == IP_ADDRSTATE_TENTATIVE) ||
+(mbox_sts[2] == IP_ADDRSTATE_ACQUIRING))) {
set_bit(DPC_GET_DHCP_IP_ADDR, ha-dpc_flags);
-   } else if ((mbox_sts[3] == ACB_STATE_ACQUIRING) 
-  (mbox_sts[2] == ACB_STATE_VALID)) {
+   } else if ((mbox_sts[3] == IP_ADDRSTATE_ACQUIRING) 
+  (mbox_sts[2] == IP_ADDRSTATE_PREFERRED)) {
if (is_qla80XX(ha))
set_bit(DPC_RESET_HA_FW_CONTEXT,
ha-dpc_flags);
else
set_bit(DPC_RESET_HA, ha-dpc_flags);
-   } else if (mbox_sts[3] == ACB_STATE_DISABLING) {
+   } else if (mbox_sts[3] == IP_ADDRSTATE_DISABLING) {
ql4_printk(KERN_INFO, ha, scsi%ld: %s: ACB in 
disabling state\n,
   ha-host_no, __func__);
-   } else if ((mbox_sts[3] == ACB_STATE_UNCONFIGURED)) {
+   } else if (mbox_sts[3] == IP_ADDRSTATE_UNCONFIGURED) {
complete(ha-disable_acb_comp);
ql4_printk(KERN_INFO, ha, scsi%ld: %s: ACB 
state unconfigured\n,
   ha-host_no, __func__);
-- 
1.8.2.GIT

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/24] qla4xxx: 5.04.00-k4: Updates for scsi misc branch

2013-12-16 Thread vikas.chaudhary
From: Vikas Chaudhary vikas.chaudh...@qlogic.com

James,

Please apply the following patches to the scsi tree at your earliest 
convenience.
These patches are on top of other qla4xxx patch posted on list here:
http://marc.info/?l=linux-scsim=138511809612830w=2

Nilesh Javali (5):
  qla4xxx: ISP8xxx: Correct retry of adapter initialization
  qla4xxx: Improve loopback failure messages
  qla4xxx: Rename ACB_STATE macros with IP_ADDRSTATE macros
  qla4xxx: Clear DDB index map upon connection close failure
  qla4xxx: Handle IPv6 AEN notifications

Tej Parkash (4):
  qla4xxx: Fixed AER reset sequence for ISP83xx/ISP84xx
  qla4xxx: Fix processing response queue during probe
  qla4xxx: Fix pending IO completion in reset path before initiating chip 
reset
  qla4xxx: Driver not able to collect minidump for ISP84xx

Vikas Chaudhary (15):
  qla4xxx: Print WARN_ONCE() if iSCSI function presence bit removed
  qla4xxx: Fix comments in code
  qla4xxx: Use IDC_CTRL bit1 directly instead of AF_83XX_NO_FWDUMP flag.
  qla4xxx: Correctly handle msleep_interruptible
  qla4xxx: Return correct error status from func qla4xxx_request_irqs()
  qla4xxx: Fix failure of IDC Time Extend mailbox command
  qla4xxx: Reduce rom-lock contention during reset recovery.
  qla4xxx: Fix failure of mbox 0x31
  qla4xxx: Remove unused code from qla4xxx_set_ifcb()
  qla4xxx: Updated print for device login, logout path
  qla4xxx: Update print statements in qla4xxx_mailbox_command()
  qla4xxx: Update print statements in func qla4xxx_eh_abort()
  qla4xxx: Update print statements in func qla4xxx_do_dpc()
  qla4xxx: Fix sparse warnings
  qla4xxx: Update driver version to 5.04.00-k4

Thanks,
Vikas.
--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 02/24] qla4xxx: Print WARN_ONCE() if iSCSI function presence bit removed

2013-12-16 Thread vikas.chaudhary
From: Vikas Chaudhary vikas.chaudh...@qlogic.com

Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
---
 drivers/scsi/qla4xxx/ql4_83xx.c | 20 
 drivers/scsi/qla4xxx/ql4_glbl.h |  1 +
 drivers/scsi/qla4xxx/ql4_os.c   |  5 +
 3 files changed, 26 insertions(+)

diff --git a/drivers/scsi/qla4xxx/ql4_83xx.c b/drivers/scsi/qla4xxx/ql4_83xx.c
index 8196c2f..43c1688 100644
--- a/drivers/scsi/qla4xxx/ql4_83xx.c
+++ b/drivers/scsi/qla4xxx/ql4_83xx.c
@@ -1664,3 +1664,23 @@ void qla4_83xx_disable_pause(struct scsi_qla_host *ha)
__qla4_83xx_disable_pause(ha);
ha-isp_ops-idc_unlock(ha);
 }
+
+/**
+ * qla4_83xx_is_detached - Check if we are marked invisible.
+ * @ha: Pointer to host adapter structure.
+ **/
+int qla4_83xx_is_detached(struct scsi_qla_host *ha)
+{
+   uint32_t drv_active;
+
+   drv_active = qla4_8xxx_rd_direct(ha, QLA8XXX_CRB_DRV_ACTIVE);
+
+   if (test_bit(AF_INIT_DONE, ha-flags) 
+   !(drv_active  (1  ha-func_num))) {
+   DEBUG2(ql4_printk(KERN_INFO, ha, %s: drv_active = 0x%X\n,
+ __func__, drv_active));
+   return QLA_SUCCESS;
+   }
+
+   return QLA_ERROR;
+}
diff --git a/drivers/scsi/qla4xxx/ql4_glbl.h b/drivers/scsi/qla4xxx/ql4_glbl.h
index 6d72e1d..b1a19cd 100644
--- a/drivers/scsi/qla4xxx/ql4_glbl.h
+++ b/drivers/scsi/qla4xxx/ql4_glbl.h
@@ -280,6 +280,7 @@ uint8_t qla4xxx_set_ipaddr_state(uint8_t fw_ipaddr_state);
 int qla4_83xx_get_port_config(struct scsi_qla_host *ha, uint32_t *config);
 int qla4_83xx_set_port_config(struct scsi_qla_host *ha, uint32_t *config);
 int qla4_8xxx_check_init_adapter_retry(struct scsi_qla_host *ha);
+int qla4_83xx_is_detached(struct scsi_qla_host *ha);
 
 extern int ql4xextended_error_logging;
 extern int ql4xdontresethba;
diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index 9803c9e..e6fa19c 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -4372,6 +4372,11 @@ void qla4_8xxx_watchdog(struct scsi_qla_host *ha)
uint32_t dev_state;
uint32_t idc_ctrl;
 
+   if (is_qla8032(ha) 
+   (qla4_83xx_is_detached(ha) == QLA_SUCCESS))
+   WARN_ONCE(1, %s: iSCSI function %d marked invisible\n,
+ __func__, ha-func_num);
+
/* don't poll if reset is going on */
if (!(test_bit(DPC_RESET_ACTIVE, ha-dpc_flags) ||
test_bit(DPC_RESET_HA, ha-dpc_flags) ||
-- 
1.8.2.GIT

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 10/24] qla4xxx: Clear DDB index map upon connection close failure

2013-12-16 Thread vikas.chaudhary
From: Nilesh Javali nilesh.jav...@qlogic.com

Issue:
qla4xxx Unable to clear DDB indices when logout fails due to
failure of connection close mbox command.

Root cause:
If login to session fail, iscsiadm make call to destroy_session.
qla4xxx driver does not free ddb index map before free_ddb()

Fix:
Clear DDB Index map before free_ddb in destroy_session
in case of connection close mailbox command failure with 4005h.

Signed-off-by: Nilesh Javali nilesh.jav...@qlogic.com
Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
---
 drivers/scsi/qla4xxx/ql4_def.h | 2 ++
 drivers/scsi/qla4xxx/ql4_fw.h  | 1 +
 drivers/scsi/qla4xxx/ql4_mbx.c | 4 
 drivers/scsi/qla4xxx/ql4_os.c  | 4 +++-
 4 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/qla4xxx/ql4_def.h b/drivers/scsi/qla4xxx/ql4_def.h
index 4e11133..33eae2e 100644
--- a/drivers/scsi/qla4xxx/ql4_def.h
+++ b/drivers/scsi/qla4xxx/ql4_def.h
@@ -297,6 +297,8 @@ struct ddb_entry {
 
/* Driver Re-login  */
unsigned long flags;  /* DDB Flags */
+#define DDB_CONN_CLOSE_FAILURE 0 /* 0x0001 */
+
uint16_t default_relogin_timeout; /*  Max time to wait for
   *  relogin to complete */
atomic_t retry_relogin_timer; /* Min Time between relogins
diff --git a/drivers/scsi/qla4xxx/ql4_fw.h b/drivers/scsi/qla4xxx/ql4_fw.h
index e3242df..a94593a 100644
--- a/drivers/scsi/qla4xxx/ql4_fw.h
+++ b/drivers/scsi/qla4xxx/ql4_fw.h
@@ -390,6 +390,7 @@ struct qla_flt_region {
 #define MBOX_CMD_CLEAR_DATABASE_ENTRY  0x0031
 #define MBOX_CMD_CONN_OPEN 0x0074
 #define MBOX_CMD_CONN_CLOSE_SESS_LOGOUT0x0056
+#define DDB_NOT_LOGGED_IN  0x09
 #define LOGOUT_OPTION_CLOSE_SESSION0x0002
 #define LOGOUT_OPTION_RELOGIN  0x0004
 #define LOGOUT_OPTION_FREE_DDB 0x0008
diff --git a/drivers/scsi/qla4xxx/ql4_mbx.c b/drivers/scsi/qla4xxx/ql4_mbx.c
index 7da0646..023f2dd 100644
--- a/drivers/scsi/qla4xxx/ql4_mbx.c
+++ b/drivers/scsi/qla4xxx/ql4_mbx.c
@@ -1002,6 +1002,10 @@ int qla4xxx_session_logout_ddb(struct scsi_qla_host *ha,
  %s: MBOX_CMD_CONN_CLOSE_SESS_LOGOUT 
  failed sts %04X %04X, __func__,
  mbox_sts[0], mbox_sts[1]));
+   if ((mbox_sts[0] == MBOX_STS_COMMAND_ERROR) 
+   (mbox_sts[1] == DDB_NOT_LOGGED_IN)) {
+   set_bit(DDB_CONN_CLOSE_FAILURE, ddb_entry-flags);
+   }
}
 
return status;
diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index a78edc3..3fec116 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -3074,6 +3074,7 @@ qla4xxx_session_create(struct iscsi_endpoint *ep,
ddb_entry-sess = cls_sess;
ddb_entry-unblock_sess = qla4xxx_unblock_ddb;
ddb_entry-ddb_change = qla4xxx_ddb_change;
+   clear_bit(DDB_CONN_CLOSE_FAILURE, ddb_entry-flags);
cls_sess-recovery_tmo = ql4xsess_recovery_tmo;
ha-fw_ddb_index_map[ddb_entry-fw_ddb_index] = ddb_entry;
ha-tot_ddbs++;
@@ -3123,7 +3124,8 @@ static void qla4xxx_session_destroy(struct 
iscsi_cls_session *cls_sess)
 
 destroy_session:
qla4xxx_clear_ddb_entry(ha, ddb_entry-fw_ddb_index);
-
+   if (test_and_clear_bit(DDB_CONN_CLOSE_FAILURE, ddb_entry-flags))
+   clear_bit(ddb_entry-fw_ddb_index, ha-ddb_idx_map);
spin_lock_irqsave(ha-hardware_lock, flags);
qla4xxx_free_ddb(ha, ddb_entry);
spin_unlock_irqrestore(ha-hardware_lock, flags);
-- 
1.8.2.GIT

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 20/24] qla4xxx: Update print statements in func qla4xxx_eh_abort()

2013-12-16 Thread vikas.chaudhary
From: Vikas Chaudhary vikas.chaudh...@qlogic.com

Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
---
 drivers/scsi/qla4xxx/ql4_os.c | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index d0a8695..410fe02 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -9230,14 +9230,15 @@ static int qla4xxx_eh_abort(struct scsi_cmnd *cmd)
int ret = SUCCESS;
int wait = 0;
 
-   ql4_printk(KERN_INFO, ha,
-   scsi%ld:%d:%d: Abort command issued cmd=%p\n,
-   ha-host_no, id, lun, cmd);
+   ql4_printk(KERN_INFO, ha, scsi%ld:%d:%d: Abort command issued cmd=%p, 
cdb=0x%x\n,
+  ha-host_no, id, lun, cmd, cmd-cmnd[0]);
 
spin_lock_irqsave(ha-hardware_lock, flags);
srb = (struct srb *) CMD_SP(cmd);
if (!srb) {
spin_unlock_irqrestore(ha-hardware_lock, flags);
+   ql4_printk(KERN_INFO, ha, scsi%ld:%d:%d: Specified command has 
already completed.\n,
+  ha-host_no, id, lun);
return SUCCESS;
}
kref_get(srb-srb_ref);
-- 
1.8.2.GIT

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 19/24] qla4xxx: Update print statements in qla4xxx_mailbox_command()

2013-12-16 Thread vikas.chaudhary
From: Vikas Chaudhary vikas.chaudh...@qlogic.com

Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
---
 drivers/scsi/qla4xxx/ql4_mbx.c | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/scsi/qla4xxx/ql4_mbx.c b/drivers/scsi/qla4xxx/ql4_mbx.c
index 782a94586..1345c0e 100644
--- a/drivers/scsi/qla4xxx/ql4_mbx.c
+++ b/drivers/scsi/qla4xxx/ql4_mbx.c
@@ -212,9 +212,8 @@ int qla4xxx_mailbox_command(struct scsi_qla_host *ha, 
uint8_t inCount,
ha-host_no, __func__));
goto mbox_exit;
}
-   DEBUG2(printk(scsi%ld: Mailbox Cmd 0x%08X timed out ...,
-  Scheduling Adapter Reset\n, ha-host_no,
- mbx_cmd[0]));
+   ql4_printk(KERN_WARNING, ha, scsi%ld: Mailbox Cmd 0x%08X timed 
out, Scheduling Adapter Reset\n,
+  ha-host_no, mbx_cmd[0]);
ha-mailbox_timeout_count++;
mbx_sts[0] = (-1);
set_bit(DPC_RESET_HA, ha-dpc_flags);
@@ -251,15 +250,16 @@ int qla4xxx_mailbox_command(struct scsi_qla_host *ha, 
uint8_t inCount,
break;
 
case MBOX_STS_BUSY:
-   DEBUG2( printk(scsi%ld: %s: Cmd = %08X, ISP BUSY\n,
-  ha-host_no, __func__, mbx_cmd[0]));
+   ql4_printk(KERN_WARNING, ha, scsi%ld: %s: Cmd = %08X, ISP 
BUSY\n,
+  ha-host_no, __func__, mbx_cmd[0]);
ha-mailbox_timeout_count++;
break;
 
default:
-   DEBUG2(printk(scsi%ld: %s:  FAILED, cmd = %08X, 
- sts = %08X \n, ha-host_no, __func__,
- mbx_cmd[0], mbx_sts[0]));
+   ql4_printk(KERN_WARNING, ha, scsi%ld: %s: FAILED, MBOX CMD = 
%08X, MBOX STS = %08X %08X %08X %08X %08X %08X %08X %08X\n,
+  ha-host_no, __func__, mbx_cmd[0], mbx_sts[0],
+  mbx_sts[1], mbx_sts[2], mbx_sts[3], mbx_sts[4],
+  mbx_sts[5], mbx_sts[6], mbx_sts[7]);
break;
}
spin_unlock_irqrestore(ha-hardware_lock, flags);
-- 
1.8.2.GIT

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 12/24] qla4xxx: Fix processing response queue during probe

2013-12-16 Thread vikas.chaudhary
From: Tej Parkash tej.park...@qlogic.com

Issue:
While booting with kdump kernel, driver receive IOCB interrupts
for which it is not ready which results in processing them
before init_firmware during driver probe

Fix:
Two steps solution
1. Make driver ready to process the interrupt before interupts
   handlers is registered.
2. Stop driver processing iocb interrupts if not generated as per
   firmware protocol i.e R2H bit set

Signed-off-by: Tej Parkash tej.park...@qlogic.com
Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
---
 drivers/scsi/qla4xxx/ql4_isr.c | 15 ---
 drivers/scsi/qla4xxx/ql4_mbx.c |  3 ---
 drivers/scsi/qla4xxx/ql4_nx.c  |  4 
 3 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/drivers/scsi/qla4xxx/ql4_isr.c b/drivers/scsi/qla4xxx/ql4_isr.c
index 49032f6..df3fd9b 100644
--- a/drivers/scsi/qla4xxx/ql4_isr.c
+++ b/drivers/scsi/qla4xxx/ql4_isr.c
@@ -1022,7 +1022,8 @@ void qla4_82xx_interrupt_service_routine(struct 
scsi_qla_host *ha,
 uint32_t intr_status)
 {
/* Process response queue interrupt. */
-   if (intr_status  HSRX_RISC_IOCB_INT)
+   if ((intr_status  HSRX_RISC_IOCB_INT) 
+   test_bit(AF_INIT_DONE, ha-flags))
qla4xxx_process_response_queue(ha);
 
/* Process mailbox/asynch event interrupt.*/
@@ -1399,6 +1400,7 @@ qla4_8xxx_msix_rsp_q(int irq, void *dev_id)
 {
struct scsi_qla_host *ha = dev_id;
unsigned long flags;
+   int intr_status;
uint32_t ival = 0;
 
spin_lock_irqsave(ha-hardware_lock, flags);
@@ -1412,8 +1414,15 @@ qla4_8xxx_msix_rsp_q(int irq, void *dev_id)
qla4xxx_process_response_queue(ha);
writel(0, ha-qla4_83xx_reg-iocb_int_mask);
} else {
-   qla4xxx_process_response_queue(ha);
-   writel(0, ha-qla4_82xx_reg-host_int);
+   intr_status = readl(ha-qla4_82xx_reg-host_status);
+   if (intr_status  HSRX_RISC_IOCB_INT) {
+   qla4xxx_process_response_queue(ha);
+   writel(0, ha-qla4_82xx_reg-host_int);
+   } else {
+   ql4_printk(KERN_INFO, ha, %s: spurious iocb 
interrupt...\n,
+  __func__);
+   goto exit_msix_rsp_q;
+   }
}
ha-isr_count++;
 exit_msix_rsp_q:
diff --git a/drivers/scsi/qla4xxx/ql4_mbx.c b/drivers/scsi/qla4xxx/ql4_mbx.c
index 1d8f485..cc27d7f 100644
--- a/drivers/scsi/qla4xxx/ql4_mbx.c
+++ b/drivers/scsi/qla4xxx/ql4_mbx.c
@@ -648,9 +648,6 @@ int qla4xxx_initialize_fw_cb(struct scsi_qla_host * ha)
goto exit_init_fw_cb;
}
 
-   /* Initialize request and response queues. */
-   qla4xxx_init_rings(ha);
-
/* Fill in the request and response queue information. */
init_fw_cb-rqq_consumer_idx = cpu_to_le16(ha-request_out);
init_fw_cb-compq_producer_idx = cpu_to_le16(ha-response_in);
diff --git a/drivers/scsi/qla4xxx/ql4_nx.c b/drivers/scsi/qla4xxx/ql4_nx.c
index cbc68f9..bcf3e43 100644
--- a/drivers/scsi/qla4xxx/ql4_nx.c
+++ b/drivers/scsi/qla4xxx/ql4_nx.c
@@ -3190,6 +3190,10 @@ int qla4_8xxx_load_risc(struct scsi_qla_host *ha)
 
retval = qla4_8xxx_device_state_handler(ha);
 
+   /* Initialize request and response queues. */
+   if (retval == QLA_SUCCESS)
+   qla4xxx_init_rings(ha);
+
if (retval == QLA_SUCCESS  !test_bit(AF_IRQ_ATTACHED, ha-flags))
retval = qla4xxx_request_irqs(ha);
 
-- 
1.8.2.GIT

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 21/24] qla4xxx: Update print statements in func qla4xxx_do_dpc()

2013-12-16 Thread vikas.chaudhary
From: Vikas Chaudhary vikas.chaudh...@qlogic.com

Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
---
 drivers/scsi/qla4xxx/ql4_os.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index 410fe02..e8a8a7d 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -5283,9 +5283,9 @@ static void qla4xxx_do_dpc(struct work_struct *work)
container_of(work, struct scsi_qla_host, dpc_work);
int status = QLA_ERROR;
 
-   DEBUG2(printk(scsi%ld: %s: DPC handler waking up.
-   flags = 0x%08lx, dpc_flags = 0x%08lx\n,
-   ha-host_no, __func__, ha-flags, ha-dpc_flags))
+   DEBUG2(ql4_printk(KERN_INFO, ha,
+ scsi%ld: %s: DPC handler waking up. flags = 0x%08lx, 
dpc_flags = 0x%08lx\n,
+ ha-host_no, __func__, ha-flags, ha-dpc_flags));
 
/* Initialization not yet finished. Don't do anything yet. */
if (!test_bit(AF_INIT_DONE, ha-flags))
-- 
1.8.2.GIT

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 5/8] libiscsi: Add local_ipaddr parameter in iscsi_conn struct

2013-11-22 Thread vikas.chaudhary
From: Adheer Chandravanshi adheer.chandravan...@qlogic.com

Add local_ipaddr param and support get/set operations on it.

Signed-off-by: Adheer Chandravanshi adheer.chandravan...@qlogic.com
Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
---
 drivers/scsi/libiscsi.c | 6 ++
 include/scsi/libiscsi.h | 1 +
 2 files changed, 7 insertions(+)

diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
index e399561..4046241 100644
--- a/drivers/scsi/libiscsi.c
+++ b/drivers/scsi/libiscsi.c
@@ -2945,6 +2945,7 @@ void iscsi_conn_teardown(struct iscsi_cls_conn *cls_conn)
free_pages((unsigned long) conn-data,
   get_order(ISCSI_DEF_MAX_RECV_SEG_LEN));
kfree(conn-persistent_address);
+   kfree(conn-local_ipaddr);
kfifo_in(session-cmdpool.queue, (void*)conn-login_task,
sizeof(void*));
if (session-leadconn == conn)
@@ -3269,6 +3270,8 @@ int iscsi_set_param(struct iscsi_cls_conn *cls_conn,
sscanf(buf, %d, val);
session-discovery_sess = !!val;
break;
+   case ISCSI_PARAM_LOCAL_IPADDR:
+   return iscsi_switch_str_param(conn-local_ipaddr, buf);
default:
return -ENOSYS;
}
@@ -3542,6 +3545,9 @@ int iscsi_conn_get_param(struct iscsi_cls_conn *cls_conn,
case ISCSI_PARAM_TCP_RECV_WSF:
len = sprintf(buf, %u\n, conn-tcp_recv_wsf);
break;
+   case ISCSI_PARAM_LOCAL_IPADDR:
+   len = sprintf(buf, %s\n, conn-local_ipaddr);
+   break;
default:
return -ENOSYS;
}
diff --git a/include/scsi/libiscsi.h b/include/scsi/libiscsi.h
index 6ac9e17a..309f513 100644
--- a/include/scsi/libiscsi.h
+++ b/include/scsi/libiscsi.h
@@ -231,6 +231,7 @@ struct iscsi_conn {
uint8_t ipv6_traffic_class;
uint8_t ipv6_flow_label;
uint8_t is_fw_assigned_ipv6;
+   char*local_ipaddr;
 
/* MIB-statistics */
uint64_ttxdata_octets;
-- 
1.8.2.GIT

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 8/8] qla4xxx: Update driver version to 5.04.00-k3

2013-11-22 Thread vikas.chaudhary
From: Vikas Chaudhary vikas.chaudh...@qlogic.com

Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
---
 drivers/scsi/qla4xxx/ql4_version.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/qla4xxx/ql4_version.h 
b/drivers/scsi/qla4xxx/ql4_version.h
index 7427d94..9b29466 100644
--- a/drivers/scsi/qla4xxx/ql4_version.h
+++ b/drivers/scsi/qla4xxx/ql4_version.h
@@ -5,4 +5,4 @@
  * See LICENSE.qla4xxx for copyright and licensing details.
  */
 
-#define QLA4XXX_DRIVER_VERSION 5.04.00-k2
+#define QLA4XXX_DRIVER_VERSION 5.04.00-k3
-- 
1.8.2.GIT

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/8] qla4xxx: Add host statistics support

2013-11-22 Thread vikas.chaudhary
From: Lalit Chandivade lalit.chandiv...@qlogic.com

The statistics include MAC, TCP/IP  iSCSI statistics.

Signed-off-by: Lalit Chandivade lalit.chandiv...@qlogic.com
Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
---
 drivers/scsi/qla4xxx/ql4_fw.h |  83 -
 drivers/scsi/qla4xxx/ql4_os.c | 205 ++
 2 files changed, 287 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/qla4xxx/ql4_fw.h b/drivers/scsi/qla4xxx/ql4_fw.h
index fef311d..8d4092b 100644
--- a/drivers/scsi/qla4xxx/ql4_fw.h
+++ b/drivers/scsi/qla4xxx/ql4_fw.h
@@ -1297,7 +1297,88 @@ struct response {
 };
 
 struct ql_iscsi_stats {
-   uint8_t reserved1[656]; /* -028F */
+   uint64_t mac_tx_frames; /* –0007 */
+   uint64_t mac_tx_bytes; /* 0008–000F */
+   uint64_t mac_tx_multicast_frames; /* 0010–0017 */
+   uint64_t mac_tx_broadcast_frames; /* 0018–001F */
+   uint64_t mac_tx_pause_frames; /* 0020–0027 */
+   uint64_t mac_tx_control_frames; /* 0028–002F */
+   uint64_t mac_tx_deferral; /* 0030–0037 */
+   uint64_t mac_tx_excess_deferral; /* 0038–003F */
+   uint64_t mac_tx_late_collision; /* 0040–0047 */
+   uint64_t mac_tx_abort; /* 0048–004F */
+   uint64_t mac_tx_single_collision; /* 0050–0057 */
+   uint64_t mac_tx_multiple_collision; /* 0058–005F */
+   uint64_t mac_tx_collision; /* 0060–0067 */
+   uint64_t mac_tx_frames_dropped; /* 0068–006F */
+   uint64_t mac_tx_jumbo_frames; /* 0070–0077 */
+   uint64_t mac_rx_frames; /* 0078–007F */
+   uint64_t mac_rx_bytes; /* 0080–0087 */
+   uint64_t mac_rx_unknown_control_frames; /* 0088–008F */
+   uint64_t mac_rx_pause_frames; /* 0090–0097 */
+   uint64_t mac_rx_control_frames; /* 0098–009F */
+   uint64_t mac_rx_dribble; /* 00A0–00A7 */
+   uint64_t mac_rx_frame_length_error; /* 00A8–00AF */
+   uint64_t mac_rx_jabber; /* 00B0–00B7 */
+   uint64_t mac_rx_carrier_sense_error; /* 00B8–00BF */
+   uint64_t mac_rx_frame_discarded; /* 00C0–00C7 */
+   uint64_t mac_rx_frames_dropped; /* 00C8–00CF */
+   uint64_t mac_crc_error; /* 00D0–00D7 */
+   uint64_t mac_encoding_error; /* 00D8–00DF */
+   uint64_t mac_rx_length_error_large; /* 00E0–00E7 */
+   uint64_t mac_rx_length_error_small; /* 00E8–00EF */
+   uint64_t mac_rx_multicast_frames; /* 00F0–00F7 */
+   uint64_t mac_rx_broadcast_frames; /* 00F8–00FF */
+   uint64_t ip_tx_packets; /* 0100–0107 */
+   uint64_t ip_tx_bytes; /* 0108–010F */
+   uint64_t ip_tx_fragments; /* 0110–0117 */
+   uint64_t ip_rx_packets; /* 0118–011F */
+   uint64_t ip_rx_bytes; /* 0120–0127 */
+   uint64_t ip_rx_fragments; /* 0128–012F */
+   uint64_t ip_datagram_reassembly; /* 0130–0137 */
+   uint64_t ip_invalid_address_error; /* 0138–013F */
+   uint64_t ip_error_packets; /* 0140–0147 */
+   uint64_t ip_fragrx_overlap; /* 0148–014F */
+   uint64_t ip_fragrx_outoforder; /* 0150–0157 */
+   uint64_t ip_datagram_reassembly_timeout; /* 0158–015F */
+   uint64_t ipv6_tx_packets; /* 0160–0167 */
+   uint64_t ipv6_tx_bytes; /* 0168–016F */
+   uint64_t ipv6_tx_fragments; /* 0170–0177 */
+   uint64_t ipv6_rx_packets; /* 0178–017F */
+   uint64_t ipv6_rx_bytes; /* 0180–0187 */
+   uint64_t ipv6_rx_fragments; /* 0188–018F */
+   uint64_t ipv6_datagram_reassembly; /* 0190–0197 */
+   uint64_t ipv6_invalid_address_error; /* 0198–019F */
+   uint64_t ipv6_error_packets; /* 01A0–01A7 */
+   uint64_t ipv6_fragrx_overlap; /* 01A8–01AF */
+   uint64_t ipv6_fragrx_outoforder; /* 01B0–01B7 */
+   uint64_t ipv6_datagram_reassembly_timeout; /* 01B8–01BF */
+   uint64_t tcp_tx_segments; /* 01C0–01C7 */
+   uint64_t tcp_tx_bytes; /* 01C8–01CF */
+   uint64_t tcp_rx_segments; /* 01D0–01D7 */
+   uint64_t tcp_rx_byte; /* 01D8–01DF */
+   uint64_t tcp_duplicate_ack_retx; /* 01E0–01E7 */
+   uint64_t tcp_retx_timer_expired; /* 01E8–01EF */
+   uint64_t tcp_rx_duplicate_ack; /* 01F0–01F7 */
+   uint64_t tcp_rx_pure_ackr; /* 01F8–01FF */
+   uint64_t tcp_tx_delayed_ack; /* 0200–0207 */
+   uint64_t tcp_tx_pure_ack; /* 0208–020F */
+   uint64_t tcp_rx_segment_error; /* 0210–0217 */
+   uint64_t tcp_rx_segment_outoforder; /* 0218–021F */
+   uint64_t tcp_rx_window_probe; /* 0220–0227 */
+   uint64_t tcp_rx_window_update; /* 0228–022F */
+   uint64_t tcp_tx_window_probe_persist; /* 0230–0237 */
+   uint64_t ecc_error_correction; /* 0238–023F */
+   uint64_t iscsi_pdu_tx; /* 0240-0247 */
+   uint64_t iscsi_data_bytes_tx; /* 0248-024F */
+   uint64_t iscsi_pdu_rx; /* 0250-0257 */
+   uint64_t iscsi_data_bytes_rx; /* 0258-025F */
+   uint64_t iscsi_io_completed; /* 0260-0267 */
+   uint64_t iscsi_unexpected_io_rx; /* 0268-026F */
+   uint64_t iscsi_format_error; /* 0270-0277 */
+   uint64_t 

[PATCH 4/8] scsi_transport_iscsi: Export ISCSI_PARAM_LOCAL_IPADDR attr for iscsi_connection

2013-11-22 Thread vikas.chaudhary
From: Adheer Chandravanshi adheer.chandravan...@qlogic.com

This attribute specifies the local IP address used to establish connection.

Signed-off-by: Adheer Chandravanshi adheer.chandravan...@qlogic.com
Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
---
 drivers/scsi/scsi_transport_iscsi.c | 4 
 include/scsi/iscsi_if.h | 1 +
 2 files changed, 5 insertions(+)

diff --git a/drivers/scsi/scsi_transport_iscsi.c 
b/drivers/scsi/scsi_transport_iscsi.c
index 4cf918a..fd8ffe6 100644
--- a/drivers/scsi/scsi_transport_iscsi.c
+++ b/drivers/scsi/scsi_transport_iscsi.c
@@ -3772,6 +3772,7 @@ iscsi_conn_attr(ipv6_flow_label, 
ISCSI_PARAM_IPV6_FLOW_LABEL);
 iscsi_conn_attr(is_fw_assigned_ipv6, ISCSI_PARAM_IS_FW_ASSIGNED_IPV6);
 iscsi_conn_attr(tcp_xmit_wsf, ISCSI_PARAM_TCP_XMIT_WSF);
 iscsi_conn_attr(tcp_recv_wsf, ISCSI_PARAM_TCP_RECV_WSF);
+iscsi_conn_attr(local_ipaddr, ISCSI_PARAM_LOCAL_IPADDR);
 
 
 #define iscsi_conn_ep_attr_show(param) \
@@ -3841,6 +3842,7 @@ static struct attribute *iscsi_conn_attrs[] = {
dev_attr_conn_is_fw_assigned_ipv6.attr,
dev_attr_conn_tcp_xmit_wsf.attr,
dev_attr_conn_tcp_recv_wsf.attr,
+   dev_attr_conn_local_ipaddr.attr,
NULL,
 };
 
@@ -3910,6 +3912,8 @@ static umode_t iscsi_conn_attr_is_visible(struct kobject 
*kobj,
param = ISCSI_PARAM_TCP_XMIT_WSF;
else if (attr == dev_attr_conn_tcp_recv_wsf.attr)
param = ISCSI_PARAM_TCP_RECV_WSF;
+   else if (attr == dev_attr_conn_local_ipaddr.attr)
+   param = ISCSI_PARAM_LOCAL_IPADDR;
else {
WARN_ONCE(1, Invalid conn attr);
return 0;
diff --git a/include/scsi/iscsi_if.h b/include/scsi/iscsi_if.h
index 3851a73..fd0421c 100644
--- a/include/scsi/iscsi_if.h
+++ b/include/scsi/iscsi_if.h
@@ -618,6 +618,7 @@ enum iscsi_param {
 
ISCSI_PARAM_DISCOVERY_PARENT_IDX,
ISCSI_PARAM_DISCOVERY_PARENT_TYPE,
+   ISCSI_PARAM_LOCAL_IPADDR,
/* must always be last */
ISCSI_PARAM_MAX,
 };
-- 
1.8.2.GIT

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/8] qla4xxx: 5.04.00-k3: Updates for scsi misc branch

2013-11-22 Thread vikas.chaudhary
From: Vikas Chaudhary vikas.chaudh...@qlogic.com

James,

Please apply the following patches to the scsi tree at your earliest 
convenience.

These patches are on top of other qla4xxx patch posted on list here:
http://marc.info/?l=linux-scsim=138210321629250w=2

Adheer Chandravanshi (4):
  scsi_transport_iscsi: Export ISCSI_PARAM_LOCAL_IPADDR attr for 
iscsi_connection
  libiscsi: Add local_ipaddr parameter in iscsi_conn struct
  qla4xxx: Add support for ISCSI_PARAM_LOCAL_IPADDR sysfs attr
  qla4xxx: Recreate chap data list during get chap operation

Lalit Chandivade (2):
  scsi_transport_iscsi: Add host statistics support
  qla4xxx: Add host statistics support

Vikas Chaudhary (2):
  qla4xxx: Added support for Diagnostics MBOX command
  qla4xxx: Update driver version to 5.04.00-k3

Thanks,
Vikas.
--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/8] qla4xxx: Added support for Diagnostics MBOX command

2013-11-22 Thread vikas.chaudhary
From: Vikas Chaudhary vikas.chaudh...@qlogic.com

Added support for Diagnostics MBOX command via BSG Vendor
HST_VENDOR interface.
This command provides various tests for validating hardware
functionality.

Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
---
 drivers/scsi/qla4xxx/ql4_bsg.c  | 360 
 drivers/scsi/qla4xxx/ql4_bsg.h  |  13 ++
 drivers/scsi/qla4xxx/ql4_def.h  |   8 +
 drivers/scsi/qla4xxx/ql4_fw.h   |  14 +-
 drivers/scsi/qla4xxx/ql4_glbl.h |   2 +
 drivers/scsi/qla4xxx/ql4_isr.c  |  19 ++-
 drivers/scsi/qla4xxx/ql4_mbx.c  |  43 +
 drivers/scsi/qla4xxx/ql4_os.c   |   3 +
 8 files changed, 455 insertions(+), 7 deletions(-)

diff --git a/drivers/scsi/qla4xxx/ql4_bsg.c b/drivers/scsi/qla4xxx/ql4_bsg.c
index cf8fdf1..04a0027 100644
--- a/drivers/scsi/qla4xxx/ql4_bsg.c
+++ b/drivers/scsi/qla4xxx/ql4_bsg.c
@@ -446,6 +446,363 @@ leave:
return rval;
 }
 
+static void ql4xxx_execute_diag_cmd(struct bsg_job *bsg_job)
+{
+   struct Scsi_Host *host = iscsi_job_to_shost(bsg_job);
+   struct scsi_qla_host *ha = to_qla_host(host);
+   struct iscsi_bsg_request *bsg_req = bsg_job-request;
+   struct iscsi_bsg_reply *bsg_reply = bsg_job-reply;
+   uint8_t *rsp_ptr = NULL;
+   uint32_t mbox_cmd[MBOX_REG_COUNT];
+   uint32_t mbox_sts[MBOX_REG_COUNT];
+   int status = QLA_ERROR;
+
+   DEBUG2(ql4_printk(KERN_INFO, ha, %s: in\n, __func__));
+
+   if (test_bit(DPC_RESET_HA, ha-dpc_flags)) {
+   ql4_printk(KERN_INFO, ha, %s: Adapter reset in progress. 
Invalid Request\n,
+  __func__);
+   bsg_reply-result = DID_ERROR  16;
+   goto exit_diag_mem_test;
+   }
+
+   bsg_reply-reply_payload_rcv_len = 0;
+   memcpy(mbox_cmd, bsg_req-rqst_data.h_vendor.vendor_cmd[1],
+  sizeof(uint32_t) * MBOX_REG_COUNT);
+
+   DEBUG2(ql4_printk(KERN_INFO, ha,
+ %s: mbox_cmd: %08X %08X %08X %08X %08X %08X %08X 
%08X\n,
+ __func__, mbox_cmd[0], mbox_cmd[1], mbox_cmd[2],
+ mbox_cmd[3], mbox_cmd[4], mbox_cmd[5], mbox_cmd[6],
+ mbox_cmd[7]));
+
+   status = qla4xxx_mailbox_command(ha, MBOX_REG_COUNT, 8, mbox_cmd[0],
+mbox_sts[0]);
+
+   DEBUG2(ql4_printk(KERN_INFO, ha,
+ %s: mbox_sts: %08X %08X %08X %08X %08X %08X %08X 
%08X\n,
+ __func__, mbox_sts[0], mbox_sts[1], mbox_sts[2],
+ mbox_sts[3], mbox_sts[4], mbox_sts[5], mbox_sts[6],
+ mbox_sts[7]));
+
+   if (status == QLA_SUCCESS)
+   bsg_reply-result = DID_OK  16;
+   else
+   bsg_reply-result = DID_ERROR  16;
+
+   /* Send mbox_sts to application */
+   bsg_job-reply_len = sizeof(struct iscsi_bsg_reply) + sizeof(mbox_sts);
+   rsp_ptr = ((uint8_t *)bsg_reply) + sizeof(struct iscsi_bsg_reply);
+   memcpy(rsp_ptr, mbox_sts, sizeof(mbox_sts));
+
+exit_diag_mem_test:
+   DEBUG2(ql4_printk(KERN_INFO, ha,
+ %s: bsg_reply-result = x%x, status = %s\n,
+ __func__, bsg_reply-result, STATUS(status)));
+
+   bsg_job_done(bsg_job, bsg_reply-result,
+bsg_reply-reply_payload_rcv_len);
+}
+
+static int qla4_83xx_wait_for_loopback_config_comp(struct scsi_qla_host *ha,
+  int wait_for_link)
+{
+   int status = QLA_SUCCESS;
+
+   if (!wait_for_completion_timeout(ha-idc_comp, (IDC_COMP_TOV * HZ))) {
+   ql4_printk(KERN_INFO, ha, %s: IDC Complete notification not 
received, Waiting for another %d timeout,
+  __func__, ha-idc_extend_tmo);
+   if (ha-idc_extend_tmo) {
+   if (!wait_for_completion_timeout(ha-idc_comp,
+   (ha-idc_extend_tmo * HZ))) {
+   ha-notify_idc_comp = 0;
+   ha-notify_link_up_comp = 0;
+   ql4_printk(KERN_WARNING, ha, %s: IDC Complete 
notification not received,
+  __func__);
+   status = QLA_ERROR;
+   goto exit_wait;
+   } else {
+   DEBUG2(ql4_printk(KERN_INFO, ha,
+ %s: IDC Complete 
notification received\n,
+ __func__));
+   }
+   }
+   } else {
+   DEBUG2(ql4_printk(KERN_INFO, ha,
+ %s: IDC Complete notification received\n,
+ __func__));
+   }
+   ha-notify_idc_comp = 0;
+
+   if (wait_for_link) {
+   if 

[PATCH 7/8] qla4xxx: Recreate chap data list during get chap operation

2013-11-22 Thread vikas.chaudhary
From: Adheer Chandravanshi adheer.chandravan...@qlogic.com

Recreate the chap data list during the get chap operation in
qla4xxx_get_chap_list().

Signed-off-by: Adheer Chandravanshi adheer.chandravan...@qlogic.com
Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
---
 drivers/scsi/qla4xxx/ql4_os.c | 119 ++
 1 file changed, 61 insertions(+), 58 deletions(-)

diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index 4181758..1c05f84 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -573,6 +573,65 @@ static umode_t qla4_attr_is_visible(int param_type, int 
param)
return 0;
 }
 
+/**
+ * qla4xxx_create chap_list - Create CHAP list from FLASH
+ * @ha: pointer to adapter structure
+ *
+ * Read flash and make a list of CHAP entries, during login when a CHAP entry
+ * is received, it will be checked in this list. If entry exist then the CHAP
+ * entry index is set in the DDB. If CHAP entry does not exist in this list
+ * then a new entry is added in FLASH in CHAP table and the index obtained is
+ * used in the DDB.
+ **/
+static void qla4xxx_create_chap_list(struct scsi_qla_host *ha)
+{
+   int rval = 0;
+   uint8_t *chap_flash_data = NULL;
+   uint32_t offset;
+   dma_addr_t chap_dma;
+   uint32_t chap_size = 0;
+
+   if (is_qla40XX(ha))
+   chap_size = MAX_CHAP_ENTRIES_40XX *
+   sizeof(struct ql4_chap_table);
+   else/* Single region contains CHAP info for both
+* ports which is divided into half for each port.
+*/
+   chap_size = ha-hw.flt_chap_size / 2;
+
+   chap_flash_data = dma_alloc_coherent(ha-pdev-dev, chap_size,
+chap_dma, GFP_KERNEL);
+   if (!chap_flash_data) {
+   ql4_printk(KERN_ERR, ha, No memory for chap_flash_data\n);
+   return;
+   }
+
+   if (is_qla40XX(ha)) {
+   offset = FLASH_CHAP_OFFSET;
+   } else {
+   offset = FLASH_RAW_ACCESS_ADDR + (ha-hw.flt_region_chap  2);
+   if (ha-port_num == 1)
+   offset += chap_size;
+   }
+
+   rval = qla4xxx_get_flash(ha, chap_dma, offset, chap_size);
+   if (rval != QLA_SUCCESS)
+   goto exit_chap_list;
+
+   if (ha-chap_list == NULL)
+   ha-chap_list = vmalloc(chap_size);
+   if (ha-chap_list == NULL) {
+   ql4_printk(KERN_ERR, ha, No memory for ha-chap_list\n);
+   goto exit_chap_list;
+   }
+
+   memset(ha-chap_list, 0, chap_size);
+   memcpy(ha-chap_list, chap_flash_data, chap_size);
+
+exit_chap_list:
+   dma_free_coherent(ha-pdev-dev, chap_size, chap_flash_data, chap_dma);
+}
+
 static int qla4xxx_get_chap_by_index(struct scsi_qla_host *ha,
 int16_t chap_index,
 struct ql4_chap_table **chap_entry)
@@ -686,6 +745,8 @@ static int qla4xxx_get_chap_list(struct Scsi_Host *shost, 
uint16_t chap_tbl_idx,
goto exit_get_chap_list;
}
 
+   qla4xxx_create_chap_list(ha);
+
chap_rec = (struct iscsi_chap_rec *) buf;
mutex_lock(ha-chap_sem);
for (i = chap_tbl_idx; i  max_chap_entries; i++) {
@@ -6121,64 +6182,6 @@ kset_free:
 }
 
 
-/**
- * qla4xxx_create chap_list - Create CHAP list from FLASH
- * @ha: pointer to adapter structure
- *
- * Read flash and make a list of CHAP entries, during login when a CHAP entry
- * is received, it will be checked in this list. If entry exist then the CHAP
- * entry index is set in the DDB. If CHAP entry does not exist in this list
- * then a new entry is added in FLASH in CHAP table and the index obtained is
- * used in the DDB.
- **/
-static void qla4xxx_create_chap_list(struct scsi_qla_host *ha)
-{
-   int rval = 0;
-   uint8_t *chap_flash_data = NULL;
-   uint32_t offset;
-   dma_addr_t chap_dma;
-   uint32_t chap_size = 0;
-
-   if (is_qla40XX(ha))
-   chap_size = MAX_CHAP_ENTRIES_40XX  *
-   sizeof(struct ql4_chap_table);
-   else/* Single region contains CHAP info for both
-* ports which is divided into half for each port.
-*/
-   chap_size = ha-hw.flt_chap_size / 2;
-
-   chap_flash_data = dma_alloc_coherent(ha-pdev-dev, chap_size,
- chap_dma, GFP_KERNEL);
-   if (!chap_flash_data) {
-   ql4_printk(KERN_ERR, ha, No memory for chap_flash_data\n);
-   return;
-   }
-   if (is_qla40XX(ha))
-   offset = FLASH_CHAP_OFFSET;
-   else {
-   offset = FLASH_RAW_ACCESS_ADDR + (ha-hw.flt_region_chap  2);
-   if (ha-port_num == 1)
-   offset += chap_size;
-   }
-
-   rval = qla4xxx_get_flash(ha, 

[PATCH 6/8] qla4xxx: Add support for ISCSI_PARAM_LOCAL_IPADDR sysfs attr

2013-11-22 Thread vikas.chaudhary
From: Adheer Chandravanshi adheer.chandravan...@qlogic.com

Signed-off-by: Adheer Chandravanshi adheer.chandravan...@qlogic.com
Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
---
 drivers/scsi/qla4xxx/ql4_os.c | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index aa438f2..4181758 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -421,6 +421,7 @@ static umode_t qla4_attr_is_visible(int param_type, int 
param)
case ISCSI_PARAM_EXP_STATSN:
case ISCSI_PARAM_DISCOVERY_PARENT_IDX:
case ISCSI_PARAM_DISCOVERY_PARENT_TYPE:
+   case ISCSI_PARAM_LOCAL_IPADDR:
return S_IRUGO;
default:
return 0;
@@ -3619,6 +3620,7 @@ static void qla4xxx_copy_to_sess_conn_params(struct 
iscsi_conn *conn,
unsigned long options = 0;
uint16_t ddb_link;
uint16_t disc_parent;
+   char ip_addr[DDB_IPADDR_LEN];
 
options = le16_to_cpu(fw_ddb_entry-options);
conn-is_fw_assigned_ipv6 = test_bit(OPT_IS_FW_ASSIGNED_IPV6, options);
@@ -3700,6 +3702,14 @@ static void qla4xxx_copy_to_sess_conn_params(struct 
iscsi_conn *conn,
 
iscsi_set_param(conn-cls_conn, ISCSI_PARAM_TARGET_ALIAS,
(char *)fw_ddb_entry-iscsi_alias, 0);
+
+   options = le16_to_cpu(fw_ddb_entry-options);
+   if (options  DDB_OPT_IPV6_DEVICE) {
+   memset(ip_addr, 0, sizeof(ip_addr));
+   sprintf(ip_addr, %pI6, fw_ddb_entry-link_local_ipv6_addr);
+   iscsi_set_param(conn-cls_conn, ISCSI_PARAM_LOCAL_IPADDR,
+   (char *)ip_addr, 0);
+   }
 }
 
 static void qla4xxx_copy_fwddb_param(struct scsi_qla_host *ha,
-- 
1.8.2.GIT

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/8] scsi_transport_iscsi: Add host statistics support

2013-11-22 Thread vikas.chaudhary
From: Lalit Chandivade lalit.chandiv...@qlogic.com

Add transport_iscsi hooks to get aggregate host statistics.
The statistics include MAC, TCP/IP  iSCSI statistics.

Signed-off-by: Lalit Chandivade lalit.chandiv...@qlogic.com
Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
---
 drivers/scsi/scsi_transport_iscsi.c |  70 ++
 include/scsi/iscsi_if.h | 112 
 include/scsi/scsi_transport_iscsi.h |   1 +
 3 files changed, 183 insertions(+)

diff --git a/drivers/scsi/scsi_transport_iscsi.c 
b/drivers/scsi/scsi_transport_iscsi.c
index 9477f84..4cf918a 100644
--- a/drivers/scsi/scsi_transport_iscsi.c
+++ b/drivers/scsi/scsi_transport_iscsi.c
@@ -3416,6 +3416,73 @@ exit_logout_sid:
 }
 
 static int
+iscsi_get_host_stats(struct iscsi_transport *transport, struct nlmsghdr *nlh)
+{
+   struct iscsi_uevent *ev = nlmsg_data(nlh);
+   struct Scsi_Host *shost = NULL;
+   struct iscsi_internal *priv;
+   struct sk_buff *skbhost_stats;
+   struct nlmsghdr *nlhhost_stats;
+   struct iscsi_uevent *evhost_stats;
+   int host_stats_size = 0;
+   int len, err = 0;
+   char *buf;
+
+   if (!transport-get_host_stats)
+   return -EINVAL;
+
+   priv = iscsi_if_transport_lookup(transport);
+   if (!priv)
+   return -EINVAL;
+
+   host_stats_size = sizeof(struct iscsi_offload_host_stats);
+   len = nlmsg_total_size(sizeof(*ev) + host_stats_size);
+
+   shost = scsi_host_lookup(ev-u.get_host_stats.host_no);
+   if (!shost) {
+   pr_err(%s: failed. Cound not find host no %u\n,
+  __func__, ev-u.get_host_stats.host_no);
+   return -ENODEV;
+   }
+
+   do {
+   int actual_size;
+
+   skbhost_stats = alloc_skb(len, GFP_KERNEL);
+   if (!skbhost_stats) {
+   pr_err(cannot deliver host stats: OOM\n);
+   err = -ENOMEM;
+   goto exit_host_stats;
+   }
+
+   nlhhost_stats = __nlmsg_put(skbhost_stats, 0, 0, 0,
+ (len - sizeof(*nlhhost_stats)), 0);
+   evhost_stats = nlmsg_data(nlhhost_stats);
+   memset(evhost_stats, 0, sizeof(*evhost_stats));
+   evhost_stats-transport_handle = iscsi_handle(transport);
+   evhost_stats-type = nlh-nlmsg_type;
+   evhost_stats-u.get_host_stats.host_no =
+   ev-u.get_host_stats.host_no;
+   buf = (char *)((char *)evhost_stats + sizeof(*evhost_stats));
+   memset(buf, 0, host_stats_size);
+
+   err = transport-get_host_stats(shost, buf, host_stats_size);
+
+   actual_size = nlmsg_total_size(sizeof(*ev) + host_stats_size);
+   skb_trim(skbhost_stats, NLMSG_ALIGN(actual_size));
+   nlhhost_stats-nlmsg_len = actual_size;
+
+   err = iscsi_multicast_skb(skbhost_stats, ISCSI_NL_GRP_ISCSID,
+ GFP_KERNEL);
+   } while (err  0  err != -ECONNREFUSED);
+
+exit_host_stats:
+   scsi_host_put(shost);
+   return err;
+}
+
+
+static int
 iscsi_if_recv_msg(struct sk_buff *skb, struct nlmsghdr *nlh, uint32_t *group)
 {
int err = 0;
@@ -3594,6 +3661,9 @@ iscsi_if_recv_msg(struct sk_buff *skb, struct nlmsghdr 
*nlh, uint32_t *group)
err = iscsi_set_chap(transport, ev,
 nlmsg_attrlen(nlh, sizeof(*ev)));
break;
+   case ISCSI_UEVENT_GET_HOST_STATS:
+   err = iscsi_get_host_stats(transport, nlh);
+   break;
default:
err = -ENOSYS;
break;
diff --git a/include/scsi/iscsi_if.h b/include/scsi/iscsi_if.h
index a572083..3851a73 100644
--- a/include/scsi/iscsi_if.h
+++ b/include/scsi/iscsi_if.h
@@ -70,6 +70,7 @@ enum iscsi_uevent_e {
ISCSI_UEVENT_LOGOUT_FLASHNODE   = UEVENT_BASE + 29,
ISCSI_UEVENT_LOGOUT_FLASHNODE_SID   = UEVENT_BASE + 30,
ISCSI_UEVENT_SET_CHAP   = UEVENT_BASE + 31,
+   ISCSI_UEVENT_GET_HOST_STATS = UEVENT_BASE + 32,
 
/* up events */
ISCSI_KEVENT_RECV_PDU   = KEVENT_BASE + 1,
@@ -242,6 +243,9 @@ struct iscsi_uevent {
uint32_thost_no;
uint32_tsid;
} logout_flashnode_sid;
+   struct msg_get_host_stats {
+   uint32_t host_no;
+   } get_host_stats;
} u;
union {
/* messages k - u */
@@ -845,4 +849,112 @@ struct iscsi_chap_rec {
uint8_t password_length;
 };
 
+#define ISCSI_HOST_STATS_CUSTOM_MAX 32
+#define ISCSI_HOST_STATS_CUSTOM_DESC_MAX64
+struct iscsi_host_stats_custom {
+   char desc[ISCSI_HOST_STATS_CUSTOM_DESC_MAX];
+   uint64_t 

[PATCH] qla4xxx: Fix memory leak in func qla4_84xx_config_acb()

2013-10-15 Thread vikas.chaudhary
From: Vikas Chaudhary vikas.chaudh...@qlogic.com

Use correct goto statement to free dma memory in case of
failure in function qla4_84xx_config_acb()

Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
---
 drivers/scsi/qla4xxx/ql4_mbx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/qla4xxx/ql4_mbx.c b/drivers/scsi/qla4xxx/ql4_mbx.c
index 22cbd00..1bb3fde 100644
--- a/drivers/scsi/qla4xxx/ql4_mbx.c
+++ b/drivers/scsi/qla4xxx/ql4_mbx.c
@@ -2281,7 +2281,7 @@ int qla4_84xx_config_acb(struct scsi_qla_host *ha, int 
acb_config)
ql4_printk(KERN_ERR, ha, %s: Unable to alloc acb\n,
   __func__);
rval = QLA_ERROR;
-   goto exit_config_acb;
+   goto exit_free_acb;
}
memcpy(ha-saved_acb, acb, acb_len);
break;
-- 
1.8.2.GIT

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] qla4xxx: correctly update session discovery_parent_idx.

2013-09-17 Thread vikas.chaudhary
From: Manish Rangankar manish.rangan...@qlogic.com

Earlier logic for driver created iscsi_session-discovery_parent_idx
was to store ram index of a sendtarget entry, but driver frees
sendtarget ram index as soon as firmware is done with discovery,
which is available for further use. So changing the logic to point
iscsi_session-discovery_parent_idx to store sendtarget flashnode index.

Signed-off-by: Manish Rangankar manish.rangan...@qlogic.com
Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
---
 drivers/scsi/qla4xxx/ql4_def.h |   1 +
 drivers/scsi/qla4xxx/ql4_os.c  | 199 +
 2 files changed, 181 insertions(+), 19 deletions(-)

diff --git a/drivers/scsi/qla4xxx/ql4_def.h b/drivers/scsi/qla4xxx/ql4_def.h
index 41327d4..084d1fd 100644
--- a/drivers/scsi/qla4xxx/ql4_def.h
+++ b/drivers/scsi/qla4xxx/ql4_def.h
@@ -306,6 +306,7 @@ struct ddb_entry {
 struct qla_ddb_index {
struct list_head list;
uint16_t fw_ddb_idx;
+   uint16_t flash_ddb_idx;
struct dev_db_entry fw_ddb;
uint8_t flash_isid[6];
 };
diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index f8a0a26..a8847a3 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -2373,11 +2373,6 @@ static void qla4xxx_copy_to_sess_conn_params(struct 
iscsi_conn *conn,
COPY_ISID(sess-isid, fw_ddb_entry-isid);
 
ddb_link = le16_to_cpu(fw_ddb_entry-ddb_link);
-   if (ddb_link  MAX_DDB_ENTRIES)
-   sess-discovery_parent_idx = ddb_link;
-   else
-   sess-discovery_parent_idx = DDB_NO_LINK;
-
if (ddb_link == DDB_ISNS)
disc_parent = ISCSI_DISC_PARENT_ISNS;
else if (ddb_link == DDB_NO_LINK)
@@ -4937,7 +4932,8 @@ static int qla4xxx_compare_tuple_ddb(struct scsi_qla_host 
*ha,
 }
 
 static int qla4xxx_is_session_exists(struct scsi_qla_host *ha,
-struct dev_db_entry *fw_ddb_entry)
+struct dev_db_entry *fw_ddb_entry,
+uint32_t *index)
 {
struct ddb_entry *ddb_entry;
struct ql4_tuple_ddb *fw_tddb = NULL;
@@ -4971,6 +4967,8 @@ static int qla4xxx_is_session_exists(struct scsi_qla_host 
*ha,
qla4xxx_get_param_ddb(ddb_entry, tmp_tddb);
if (!qla4xxx_compare_tuple_ddb(ha, fw_tddb, tmp_tddb, false)) {
ret = QLA_SUCCESS; /* found */
+   if (index != NULL)
+   *index = idx;
goto exit_check;
}
}
@@ -5267,6 +5265,87 @@ static void qla4xxx_wait_for_ip_configuration(struct 
scsi_qla_host *ha)
} while (time_after(wtime, jiffies));
 }
 
+static int qla4xxx_cmp_fw_stentry(struct dev_db_entry *fw_ddb_entry,
+ struct dev_db_entry *flash_ddb_entry)
+{
+   uint16_t options = 0;
+   size_t ip_len = IP_ADDR_LEN;
+
+   options = le16_to_cpu(fw_ddb_entry-options);
+   if (options  DDB_OPT_IPV6_DEVICE)
+   ip_len = IPv6_ADDR_LEN;
+
+   if (memcmp(fw_ddb_entry-ip_addr, flash_ddb_entry-ip_addr, ip_len))
+   return QLA_ERROR;
+
+   if (memcmp(fw_ddb_entry-isid[0], flash_ddb_entry-isid[0],
+  sizeof(fw_ddb_entry-isid)))
+   return QLA_ERROR;
+
+   if (memcmp(fw_ddb_entry-port, flash_ddb_entry-port,
+  sizeof(fw_ddb_entry-port)))
+   return QLA_ERROR;
+
+   return QLA_SUCCESS;
+}
+
+static int qla4xxx_find_flash_st_idx(struct scsi_qla_host *ha,
+struct dev_db_entry *fw_ddb_entry,
+uint32_t fw_idx, uint32_t *flash_index)
+{
+   struct dev_db_entry *flash_ddb_entry;
+   dma_addr_t flash_ddb_entry_dma;
+   uint32_t idx = 0;
+   int max_ddbs;
+   int ret = QLA_ERROR, status;
+
+   max_ddbs =  is_qla40XX(ha) ? MAX_DEV_DB_ENTRIES_40XX :
+MAX_DEV_DB_ENTRIES;
+
+   flash_ddb_entry = dma_pool_alloc(ha-fw_ddb_dma_pool, GFP_KERNEL,
+flash_ddb_entry_dma);
+   if (flash_ddb_entry == NULL || fw_ddb_entry == NULL) {
+   ql4_printk(KERN_ERR, ha, Out of memory\n);
+   goto exit_find_st_idx;
+   }
+
+   status = qla4xxx_flashdb_by_index(ha, flash_ddb_entry,
+ flash_ddb_entry_dma, fw_idx);
+   if (status == QLA_SUCCESS) {
+   status = qla4xxx_cmp_fw_stentry(fw_ddb_entry, flash_ddb_entry);
+   if (status == QLA_SUCCESS) {
+   *flash_index = fw_idx;
+   ret = QLA_SUCCESS;
+   goto exit_find_st_idx;
+   }
+   }
+
+   for (idx = 0; idx  max_ddbs; idx++) {
+   status = qla4xxx_flashdb_by_index(ha, flash_ddb_entry,
+  

[PATCH 1/4] qla4xxx: Add pex-dma support for capturing minidump

2013-08-23 Thread vikas.chaudhary
From: Santosh Vernekar santosh.verne...@qlogic.com

Add pex-dma support for ISP8324 and ISP8042 to improve
the minidump capture time.

Signed-off-by: Santosh Vernekar santosh.verne...@qlogic.com
Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
---
 drivers/scsi/qla4xxx/ql4_83xx.c |   4 +-
 drivers/scsi/qla4xxx/ql4_83xx.h |  34 ++
 drivers/scsi/qla4xxx/ql4_glbl.h |   2 +
 drivers/scsi/qla4xxx/ql4_nx.c   | 226 +++-
 4 files changed, 263 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/qla4xxx/ql4_83xx.c b/drivers/scsi/qla4xxx/ql4_83xx.c
index 9be4f8f..8196c2f 100644
--- a/drivers/scsi/qla4xxx/ql4_83xx.c
+++ b/drivers/scsi/qla4xxx/ql4_83xx.c
@@ -259,8 +259,8 @@ void qla4_83xx_rom_lock_recovery(struct scsi_qla_host *ha)
  * Return: On success return QLA_SUCCESS
  *On error return QLA_ERROR
  **/
-static int qla4_83xx_ms_mem_write_128b(struct scsi_qla_host *ha, uint64_t addr,
-  uint32_t *data, uint32_t count)
+int qla4_83xx_ms_mem_write_128b(struct scsi_qla_host *ha, uint64_t addr,
+   uint32_t *data, uint32_t count)
 {
int i, j;
uint32_t agt_ctrl;
diff --git a/drivers/scsi/qla4xxx/ql4_83xx.h b/drivers/scsi/qla4xxx/ql4_83xx.h
index 1b8c544..a0de6e2 100644
--- a/drivers/scsi/qla4xxx/ql4_83xx.h
+++ b/drivers/scsi/qla4xxx/ql4_83xx.h
@@ -290,4 +290,38 @@ struct qla4_83xx_idc_information {
uint32_t info3; /* IDC additional info */
 };
 
+#define QLA83XX_PEX_DMA_ENGINE_INDEX   8
+#define QLA83XX_PEX_DMA_BASE_ADDRESS   0x7732
+#define QLA83XX_PEX_DMA_NUM_OFFSET 0x1
+#define QLA83XX_PEX_DMA_CMD_ADDR_LOW   0x0
+#define QLA83XX_PEX_DMA_CMD_ADDR_HIGH  0x04
+#define QLA83XX_PEX_DMA_CMD_STS_AND_CNTRL  0x08
+
+#define QLA83XX_PEX_DMA_READ_SIZE  (16 * 1024)
+#define QLA83XX_PEX_DMA_MAX_WAIT   (100 * 100) /* Max wait of 100 msecs */
+
+/* Read Memory: For Pex-DMA */
+struct qla4_83xx_minidump_entry_rdmem_pex_dma {
+   struct qla8xxx_minidump_entry_hdr h;
+   uint32_t desc_card_addr;
+   uint16_t dma_desc_cmd;
+   uint8_t rsvd[2];
+   uint32_t start_dma_cmd;
+   uint8_t rsvd2[12];
+   uint32_t read_addr;
+   uint32_t read_data_size;
+};
+
+struct qla4_83xx_pex_dma_descriptor {
+   struct {
+   uint32_t read_data_size; /* 0-23: size, 24-31: rsvd */
+   uint8_t rsvd[2];
+   uint16_t dma_desc_cmd;
+   } cmd;
+   uint64_t src_addr;
+   uint64_t dma_bus_addr; /* 0-3: desc-cmd, 4-7: pci-func,
+   * 8-15: desc-cmd */
+   uint8_t rsvd[24];
+} __packed;
+
 #endif
diff --git a/drivers/scsi/qla4xxx/ql4_glbl.h b/drivers/scsi/qla4xxx/ql4_glbl.h
index cec80b6..e6f2a26 100644
--- a/drivers/scsi/qla4xxx/ql4_glbl.h
+++ b/drivers/scsi/qla4xxx/ql4_glbl.h
@@ -272,6 +272,8 @@ int qla4xxx_set_acb(struct scsi_qla_host *ha, uint32_t 
*mbox_cmd,
 int qla4xxx_get_acb(struct scsi_qla_host *ha, dma_addr_t acb_dma,
uint32_t acb_type, uint32_t len);
 int qla4_84xx_config_acb(struct scsi_qla_host *ha, int acb_config);
+int qla4_83xx_ms_mem_write_128b(struct scsi_qla_host *ha,
+   uint64_t addr, uint32_t *data, uint32_t count);
 
 extern int ql4xextended_error_logging;
 extern int ql4xdontresethba;
diff --git a/drivers/scsi/qla4xxx/ql4_nx.c b/drivers/scsi/qla4xxx/ql4_nx.c
index 67831aa..c41362c 100644
--- a/drivers/scsi/qla4xxx/ql4_nx.c
+++ b/drivers/scsi/qla4xxx/ql4_nx.c
@@ -1737,6 +1737,208 @@ static void qla4_8xxx_minidump_process_rdcrb(struct 
scsi_qla_host *ha,
*d_ptr = data_ptr;
 }
 
+static int qla4_83xx_check_dma_engine_state(struct scsi_qla_host *ha)
+{
+   int rval = QLA_SUCCESS;
+   uint32_t dma_eng_num = 0, cmd_sts_and_cntrl = 0;
+   uint64_t dma_base_addr = 0;
+   struct qla4_8xxx_minidump_template_hdr *tmplt_hdr = NULL;
+
+   tmplt_hdr = (struct qla4_8xxx_minidump_template_hdr *)
+   ha-fw_dump_tmplt_hdr;
+   dma_eng_num =
+   tmplt_hdr-saved_state_array[QLA83XX_PEX_DMA_ENGINE_INDEX];
+   dma_base_addr = QLA83XX_PEX_DMA_BASE_ADDRESS +
+   (dma_eng_num * QLA83XX_PEX_DMA_NUM_OFFSET);
+
+   /* Read the pex-dma's command-status-and-control register. */
+   rval = ha-isp_ops-rd_reg_indirect(ha,
+   (dma_base_addr + QLA83XX_PEX_DMA_CMD_STS_AND_CNTRL),
+   cmd_sts_and_cntrl);
+
+   if (rval)
+   return QLA_ERROR;
+
+   /* Check if requested pex-dma engine is available. */
+   if (cmd_sts_and_cntrl  BIT_31)
+   return QLA_SUCCESS;
+   else
+   return QLA_ERROR;
+}
+
+static int qla4_83xx_start_pex_dma(struct scsi_qla_host *ha,
+  struct qla4_83xx_minidump_entry_rdmem_pex_dma *m_hdr)
+{
+   int rval = QLA_SUCCESS, wait = 0;
+   

[PATCH 4/4] qla4xxx: Update driver version to 5.04.00-k1

2013-08-23 Thread vikas.chaudhary
From: Vikas Chaudhary vikas.chaudh...@qlogic.com

Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
---
 drivers/scsi/qla4xxx/ql4_version.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/qla4xxx/ql4_version.h 
b/drivers/scsi/qla4xxx/ql4_version.h
index 7bce207..f4fef72 100644
--- a/drivers/scsi/qla4xxx/ql4_version.h
+++ b/drivers/scsi/qla4xxx/ql4_version.h
@@ -5,4 +5,4 @@
  * See LICENSE.qla4xxx for copyright and licensing details.
  */
 
-#define QLA4XXX_DRIVER_VERSION 5.04.00-k0
+#define QLA4XXX_DRIVER_VERSION 5.04.00-k1
-- 
1.8.2.GIT

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] MAINTAINERS: Update for qla4xxx

2013-07-11 Thread vikas.chaudhary
From: Vikas Chaudhary vikas.chaudh...@qlogic.com

Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
---
 MAINTAINERS |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 9aef120..e9c7df1 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -6568,11 +6568,11 @@ F:  Documentation/scsi/LICENSE.qla2xxx
 F: drivers/scsi/qla2xxx/
 
 QLOGIC QLA4XXX iSCSI DRIVER
-M: Ravi Anand ravi.an...@qlogic.com
 M: Vikas Chaudhary vikas.chaudh...@qlogic.com
 M: iscsi-dri...@qlogic.com
 L: linux-scsi@vger.kernel.org
 S: Supported
+F: Documentation/scsi/LICENSE.qla4xxx
 F: drivers/scsi/qla4xxx/
 
 QLOGIC QLA3XXX NETWORK DRIVER
-- 
1.7.1


--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH V2 4/4] qla4xxx: Update driver version to 5.03.00-k10

2013-07-01 Thread vikas.chaudhary
From: Vikas Chaudhary vikas.chaudh...@qlogic.com

Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
---
 drivers/scsi/qla4xxx/ql4_version.h |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/qla4xxx/ql4_version.h 
b/drivers/scsi/qla4xxx/ql4_version.h
index fe873cf..c5edd0d 100644
--- a/drivers/scsi/qla4xxx/ql4_version.h
+++ b/drivers/scsi/qla4xxx/ql4_version.h
@@ -5,4 +5,4 @@
  * See LICENSE.qla4xxx for copyright and licensing details.
  */
 
-#define QLA4XXX_DRIVER_VERSION 5.03.00-k9
+#define QLA4XXX_DRIVER_VERSION 5.03.00-k10
-- 
1.7.1


--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH V2 2/4] libiscsi: Exporting new attrs for iscsi session and connection in sysfs

2013-07-01 Thread vikas.chaudhary
From: Adheer Chandravanshi adheer.chandravan...@qlogic.com

Signed-off-by: Adheer Chandravanshi adheer.chandravan...@qlogic.com
Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
---
 drivers/scsi/libiscsi.c |   97 +++
 include/scsi/libiscsi.h |   31 +++
 2 files changed, 128 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
index ae69dfc..86153e0 100644
--- a/drivers/scsi/libiscsi.c
+++ b/drivers/scsi/libiscsi.c
@@ -2812,6 +2812,8 @@ void iscsi_session_teardown(struct iscsi_cls_session 
*cls_session)
kfree(session-boot_nic);
kfree(session-boot_target);
kfree(session-ifacename);
+   kfree(session-portal_type);
+   kfree(session-discovery_parent_type);
 
iscsi_destroy_session(cls_session);
iscsi_host_dec_session_cnt(shost);
@@ -3257,6 +3259,11 @@ int iscsi_set_param(struct iscsi_cls_conn *cls_conn,
return iscsi_switch_str_param(session-boot_nic, buf);
case ISCSI_PARAM_BOOT_TARGET:
return iscsi_switch_str_param(session-boot_target, buf);
+   case ISCSI_PARAM_PORTAL_TYPE:
+   return iscsi_switch_str_param(session-portal_type, buf);
+   case ISCSI_PARAM_DISCOVERY_PARENT_TYPE:
+   return iscsi_switch_str_param(session-discovery_parent_type,
+ buf);
default:
return -ENOSYS;
}
@@ -3343,6 +3350,51 @@ int iscsi_session_get_param(struct iscsi_cls_session 
*cls_session,
break;
case ISCSI_PARAM_BOOT_TARGET:
len = sprintf(buf, %s\n, session-boot_target);
+   case ISCSI_PARAM_AUTO_SND_TGT_DISABLE:
+   len = sprintf(buf, %u\n, session-auto_snd_tgt_disable);
+   break;
+   case ISCSI_PARAM_DISCOVERY_SESS:
+   len = sprintf(buf, %u\n, session-discovery_sess);
+   break;
+   case ISCSI_PARAM_PORTAL_TYPE:
+   len = sprintf(buf, %s\n, session-portal_type);
+   break;
+   case ISCSI_PARAM_CHAP_AUTH_EN:
+   len = sprintf(buf, %u\n, session-chap_auth_en);
+   break;
+   case ISCSI_PARAM_DISCOVERY_LOGOUT_EN:
+   len = sprintf(buf, %u\n, session-discovery_logout_en);
+   break;
+   case ISCSI_PARAM_BIDI_CHAP_EN:
+   len = sprintf(buf, %u\n, session-bidi_chap_en);
+   break;
+   case ISCSI_PARAM_DISCOVERY_AUTH_OPTIONAL:
+   len = sprintf(buf, %u\n, session-discovery_auth_optional);
+   break;
+   case ISCSI_PARAM_DEF_TIME2WAIT:
+   len = sprintf(buf, %d\n, session-time2wait);
+   break;
+   case ISCSI_PARAM_DEF_TIME2RETAIN:
+   len = sprintf(buf, %d\n, session-time2retain);
+   break;
+   case ISCSI_PARAM_TSID:
+   len = sprintf(buf, %u\n, session-tsid);
+   break;
+   case ISCSI_PARAM_ISID:
+   len = sprintf(buf, %02x%02x%02x%02x%02x%02x\n,
+ session-isid[0], session-isid[1],
+ session-isid[2], session-isid[3],
+ session-isid[4], session-isid[5]);
+   break;
+   case ISCSI_PARAM_DISCOVERY_PARENT_IDX:
+   len = sprintf(buf, %u\n, session-discovery_parent_idx);
+   break;
+   case ISCSI_PARAM_DISCOVERY_PARENT_TYPE:
+   if (session-discovery_parent_type)
+   len = sprintf(buf, %s\n,
+ session-discovery_parent_type);
+   else
+   len = sprintf(buf, \n);
break;
default:
return -ENOSYS;
@@ -3433,6 +3485,51 @@ int iscsi_conn_get_param(struct iscsi_cls_conn *cls_conn,
case ISCSI_PARAM_PERSISTENT_ADDRESS:
len = sprintf(buf, %s\n, conn-persistent_address);
break;
+   case ISCSI_PARAM_STATSN:
+   len = sprintf(buf, %u\n, conn-statsn);
+   break;
+   case ISCSI_PARAM_MAX_SEGMENT_SIZE:
+   len = sprintf(buf, %u\n, conn-max_segment_size);
+   break;
+   case ISCSI_PARAM_KEEPALIVE_TMO:
+   len = sprintf(buf, %u\n, conn-keepalive_tmo);
+   break;
+   case ISCSI_PARAM_LOCAL_PORT:
+   len = sprintf(buf, %u\n, conn-local_port);
+   break;
+   case ISCSI_PARAM_TCP_TIMESTAMP_STAT:
+   len = sprintf(buf, %u\n, conn-tcp_timestamp_stat);
+   break;
+   case ISCSI_PARAM_TCP_NAGLE_DISABLE:
+   len = sprintf(buf, %u\n, conn-tcp_nagle_disable);
+   break;
+   case ISCSI_PARAM_TCP_WSF_DISABLE:
+   len = sprintf(buf, %u\n, conn-tcp_wsf_disable);
+   break;
+   case ISCSI_PARAM_TCP_TIMER_SCALE:
+   len = sprintf(buf, %u\n, 

[PATCH V2 3/4] qla4xxx: Exporting new attrs for iscsi session and connection in sysfs

2013-07-01 Thread vikas.chaudhary
From: Adheer Chandravanshi adheer.chandravan...@qlogic.com

Signed-off-by: Adheer Chandravanshi adheer.chandravan...@qlogic.com
Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
---
 drivers/scsi/qla4xxx/ql4_os.c |  203 +
 1 files changed, 146 insertions(+), 57 deletions(-)

diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index 4d231c1..84d9361 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -378,6 +378,44 @@ static umode_t qla4_attr_is_visible(int param_type, int 
param)
case ISCSI_PARAM_PASSWORD:
case ISCSI_PARAM_USERNAME_IN:
case ISCSI_PARAM_PASSWORD_IN:
+   case ISCSI_PARAM_AUTO_SND_TGT_DISABLE:
+   case ISCSI_PARAM_DISCOVERY_SESS:
+   case ISCSI_PARAM_PORTAL_TYPE:
+   case ISCSI_PARAM_CHAP_AUTH_EN:
+   case ISCSI_PARAM_DISCOVERY_LOGOUT_EN:
+   case ISCSI_PARAM_BIDI_CHAP_EN:
+   case ISCSI_PARAM_DISCOVERY_AUTH_OPTIONAL:
+   case ISCSI_PARAM_DEF_TIME2WAIT:
+   case ISCSI_PARAM_DEF_TIME2RETAIN:
+   case ISCSI_PARAM_HDRDGST_EN:
+   case ISCSI_PARAM_DATADGST_EN:
+   case ISCSI_PARAM_INITIAL_R2T_EN:
+   case ISCSI_PARAM_IMM_DATA_EN:
+   case ISCSI_PARAM_PDU_INORDER_EN:
+   case ISCSI_PARAM_DATASEQ_INORDER_EN:
+   case ISCSI_PARAM_MAX_SEGMENT_SIZE:
+   case ISCSI_PARAM_TCP_TIMESTAMP_STAT:
+   case ISCSI_PARAM_TCP_WSF_DISABLE:
+   case ISCSI_PARAM_TCP_NAGLE_DISABLE:
+   case ISCSI_PARAM_TCP_TIMER_SCALE:
+   case ISCSI_PARAM_TCP_TIMESTAMP_EN:
+   case ISCSI_PARAM_TCP_XMIT_WSF:
+   case ISCSI_PARAM_TCP_RECV_WSF:
+   case ISCSI_PARAM_IP_FRAGMENT_DISABLE:
+   case ISCSI_PARAM_IPV4_TOS:
+   case ISCSI_PARAM_IPV6_TC:
+   case ISCSI_PARAM_IPV6_FLOW_LABEL:
+   case ISCSI_PARAM_IS_FW_ASSIGNED_IPV6:
+   case ISCSI_PARAM_KEEPALIVE_TMO:
+   case ISCSI_PARAM_LOCAL_PORT:
+   case ISCSI_PARAM_ISID:
+   case ISCSI_PARAM_TSID:
+   case ISCSI_PARAM_DEF_TASKMGMT_TMO:
+   case ISCSI_PARAM_ERL:
+   case ISCSI_PARAM_STATSN:
+   case ISCSI_PARAM_EXP_STATSN:
+   case ISCSI_PARAM_DISCOVERY_PARENT_IDX:
+   case ISCSI_PARAM_DISCOVERY_PARENT_TYPE:
return S_IRUGO;
default:
return 0;
@@ -2257,6 +2295,101 @@ static int qla4xxx_copy_to_fwddb_param(struct 
iscsi_bus_flash_session *sess,
return rc;
 }
 
+static void qla4xxx_copy_to_sess_conn_params(struct iscsi_conn *conn,
+struct iscsi_session *sess,
+struct dev_db_entry *fw_ddb_entry)
+{
+   unsigned long options = 0;
+   uint16_t ddb_link;
+   uint16_t disc_parent;
+
+   options = le16_to_cpu(fw_ddb_entry-options);
+   conn-is_fw_assigned_ipv6 = test_bit(OPT_IS_FW_ASSIGNED_IPV6, options);
+   sess-auto_snd_tgt_disable = test_bit(OPT_AUTO_SENDTGTS_DISABLE,
+ options);
+   sess-discovery_sess = test_bit(OPT_DISC_SESSION, options);
+
+   options = le16_to_cpu(fw_ddb_entry-iscsi_options);
+   conn-hdrdgst_en = test_bit(ISCSIOPT_HEADER_DIGEST_EN, options);
+   conn-datadgst_en = test_bit(ISCSIOPT_DATA_DIGEST_EN, options);
+   sess-imm_data_en = test_bit(ISCSIOPT_IMMEDIATE_DATA_EN, options);
+   sess-initial_r2t_en = test_bit(ISCSIOPT_INITIAL_R2T_EN, options);
+   sess-dataseq_inorder_en = test_bit(ISCSIOPT_DATA_SEQ_IN_ORDER,
+   options);
+   sess-pdu_inorder_en = test_bit(ISCSIOPT_DATA_PDU_IN_ORDER, options);
+   sess-chap_auth_en = test_bit(ISCSIOPT_CHAP_AUTH_EN, options);
+   sess-discovery_logout_en = test_bit(ISCSIOPT_DISCOVERY_LOGOUT_EN,
+options);
+   sess-bidi_chap_en = test_bit(ISCSIOPT_BIDI_CHAP_EN, options);
+   sess-discovery_auth_optional =
+   test_bit(ISCSIOPT_DISCOVERY_AUTH_OPTIONAL, options);
+   if (test_bit(ISCSIOPT_ERL1, options))
+   sess-erl |= BIT_1;
+   if (test_bit(ISCSIOPT_ERL0, options))
+   sess-erl |= BIT_0;
+
+   options = le16_to_cpu(fw_ddb_entry-tcp_options);
+   conn-tcp_timestamp_stat = test_bit(TCPOPT_TIMESTAMP_STAT, options);
+   conn-tcp_nagle_disable = test_bit(TCPOPT_NAGLE_DISABLE, options);
+   conn-tcp_wsf_disable = test_bit(TCPOPT_WSF_DISABLE, options);
+   if (test_bit(TCPOPT_TIMER_SCALE3, options))
+   conn-tcp_timer_scale |= BIT_3;
+   if (test_bit(TCPOPT_TIMER_SCALE2, options))
+   

[PATCH V2 1/4] scsi_transport_iscsi: Exporting new attrs for iscsi session and connection in sysfs

2013-07-01 Thread vikas.chaudhary
From: Adheer Chandravanshi adheer.chandravan...@qlogic.com

Exporting new iSCSI Session and Connection parameters to sysfs

Signed-off-by: Adheer Chandravanshi adheer.chandravan...@qlogic.com
Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
---
 drivers/scsi/scsi_transport_iscsi.c |  123 ++-
 include/scsi/iscsi_if.h |   32 +
 2 files changed, 154 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/scsi_transport_iscsi.c 
b/drivers/scsi/scsi_transport_iscsi.c
index abf7c40..e4a989f 100644
--- a/drivers/scsi/scsi_transport_iscsi.c
+++ b/drivers/scsi/scsi_transport_iscsi.c
@@ -25,7 +25,6 @@
 #include linux/slab.h
 #include linux/bsg-lib.h
 #include linux/idr.h
-#include linux/list.h
 #include net/tcp.h
 #include scsi/scsi.h
 #include scsi/scsi_host.h
@@ -3327,6 +3326,23 @@ iscsi_conn_attr(exp_statsn, ISCSI_PARAM_EXP_STATSN);
 iscsi_conn_attr(persistent_address, ISCSI_PARAM_PERSISTENT_ADDRESS);
 iscsi_conn_attr(ping_tmo, ISCSI_PARAM_PING_TMO);
 iscsi_conn_attr(recv_tmo, ISCSI_PARAM_RECV_TMO);
+iscsi_conn_attr(local_port, ISCSI_PARAM_LOCAL_PORT);
+iscsi_conn_attr(statsn, ISCSI_PARAM_STATSN);
+iscsi_conn_attr(keepalive_tmo, ISCSI_PARAM_KEEPALIVE_TMO);
+iscsi_conn_attr(max_segment_size, ISCSI_PARAM_MAX_SEGMENT_SIZE);
+iscsi_conn_attr(tcp_timestamp_stat, ISCSI_PARAM_TCP_TIMESTAMP_STAT);
+iscsi_conn_attr(tcp_wsf_disable, ISCSI_PARAM_TCP_WSF_DISABLE);
+iscsi_conn_attr(tcp_nagle_disable, ISCSI_PARAM_TCP_NAGLE_DISABLE);
+iscsi_conn_attr(tcp_timer_scale, ISCSI_PARAM_TCP_TIMER_SCALE);
+iscsi_conn_attr(tcp_timestamp_enable, ISCSI_PARAM_TCP_TIMESTAMP_EN);
+iscsi_conn_attr(fragment_disable, ISCSI_PARAM_IP_FRAGMENT_DISABLE);
+iscsi_conn_attr(ipv4_tos, ISCSI_PARAM_IPV4_TOS);
+iscsi_conn_attr(ipv6_traffic_class, ISCSI_PARAM_IPV6_TC);
+iscsi_conn_attr(ipv6_flow_label, ISCSI_PARAM_IPV6_FLOW_LABEL);
+iscsi_conn_attr(is_fw_assigned_ipv6, ISCSI_PARAM_IS_FW_ASSIGNED_IPV6);
+iscsi_conn_attr(tcp_xmit_wsf, ISCSI_PARAM_TCP_XMIT_WSF);
+iscsi_conn_attr(tcp_recv_wsf, ISCSI_PARAM_TCP_RECV_WSF);
+
 
 #define iscsi_conn_ep_attr_show(param) \
 static ssize_t show_conn_ep_param_##param(struct device *dev,  \
@@ -3379,6 +3395,22 @@ static struct attribute *iscsi_conn_attrs[] = {
dev_attr_conn_persistent_port.attr,
dev_attr_conn_ping_tmo.attr,
dev_attr_conn_recv_tmo.attr,
+   dev_attr_conn_local_port.attr,
+   dev_attr_conn_statsn.attr,
+   dev_attr_conn_keepalive_tmo.attr,
+   dev_attr_conn_max_segment_size.attr,
+   dev_attr_conn_tcp_timestamp_stat.attr,
+   dev_attr_conn_tcp_wsf_disable.attr,
+   dev_attr_conn_tcp_nagle_disable.attr,
+   dev_attr_conn_tcp_timer_scale.attr,
+   dev_attr_conn_tcp_timestamp_enable.attr,
+   dev_attr_conn_fragment_disable.attr,
+   dev_attr_conn_ipv4_tos.attr,
+   dev_attr_conn_ipv6_traffic_class.attr,
+   dev_attr_conn_ipv6_flow_label.attr,
+   dev_attr_conn_is_fw_assigned_ipv6.attr,
+   dev_attr_conn_tcp_xmit_wsf.attr,
+   dev_attr_conn_tcp_recv_wsf.attr,
NULL,
 };
 
@@ -3416,6 +3448,38 @@ static umode_t iscsi_conn_attr_is_visible(struct kobject 
*kobj,
param = ISCSI_PARAM_PING_TMO;
else if (attr == dev_attr_conn_recv_tmo.attr)
param = ISCSI_PARAM_RECV_TMO;
+   else if (attr == dev_attr_conn_local_port.attr)
+   param = ISCSI_PARAM_LOCAL_PORT;
+   else if (attr == dev_attr_conn_statsn.attr)
+   param = ISCSI_PARAM_STATSN;
+   else if (attr == dev_attr_conn_keepalive_tmo.attr)
+   param = ISCSI_PARAM_KEEPALIVE_TMO;
+   else if (attr == dev_attr_conn_max_segment_size.attr)
+   param = ISCSI_PARAM_MAX_SEGMENT_SIZE;
+   else if (attr == dev_attr_conn_tcp_timestamp_stat.attr)
+   param = ISCSI_PARAM_TCP_TIMESTAMP_STAT;
+   else if (attr == dev_attr_conn_tcp_wsf_disable.attr)
+   param = ISCSI_PARAM_TCP_WSF_DISABLE;
+   else if (attr == dev_attr_conn_tcp_nagle_disable.attr)
+   param = ISCSI_PARAM_TCP_NAGLE_DISABLE;
+   else if (attr == dev_attr_conn_tcp_timer_scale.attr)
+   param = ISCSI_PARAM_TCP_TIMER_SCALE;
+   else if (attr == dev_attr_conn_tcp_timestamp_enable.attr)
+   param = ISCSI_PARAM_TCP_TIMESTAMP_EN;
+   else if (attr == dev_attr_conn_fragment_disable.attr)
+   param = ISCSI_PARAM_IP_FRAGMENT_DISABLE;
+   else if (attr == dev_attr_conn_ipv4_tos.attr)
+   param = ISCSI_PARAM_IPV4_TOS;
+   else if (attr == dev_attr_conn_ipv6_traffic_class.attr)
+   param = ISCSI_PARAM_IPV6_TC;
+   else if (attr == dev_attr_conn_ipv6_flow_label.attr)
+   param = ISCSI_PARAM_IPV6_FLOW_LABEL;
+   else if (attr == dev_attr_conn_is_fw_assigned_ipv6.attr)
+   param = ISCSI_PARAM_IS_FW_ASSIGNED_IPV6;
+   else if (attr == dev_attr_conn_tcp_xmit_wsf.attr)
+ 

[PATCH V1 2/4] libiscsi: Exporting new attrs for iscsi session and connection in sysfs

2013-06-26 Thread vikas.chaudhary
From: Adheer Chandravanshi adheer.chandravan...@qlogic.com

Signed-off-by: Adheer Chandravanshi adheer.chandravan...@qlogic.com
Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
---
 drivers/scsi/libiscsi.c | 98 +
 include/scsi/libiscsi.h | 32 
 2 files changed, 130 insertions(+)

diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
index 5de9469..12aca69 100644
--- a/drivers/scsi/libiscsi.c
+++ b/drivers/scsi/libiscsi.c
@@ -2809,6 +2809,8 @@ void iscsi_session_teardown(struct iscsi_cls_session 
*cls_session)
kfree(session-targetalias);
kfree(session-initiatorname);
kfree(session-ifacename);
+   kfree(session-portal_type);
+   kfree(session-discovery_parent_type);
 
iscsi_destroy_session(cls_session);
iscsi_host_dec_session_cnt(shost);
@@ -3248,6 +3250,11 @@ int iscsi_set_param(struct iscsi_cls_conn *cls_conn,
return iscsi_switch_str_param(session-ifacename, buf);
case ISCSI_PARAM_INITIATOR_NAME:
return iscsi_switch_str_param(session-initiatorname, buf);
+   case ISCSI_PARAM_PORTAL_TYPE:
+   return iscsi_switch_str_param(session-portal_type, buf);
+   case ISCSI_PARAM_DISCOVERY_PARENT_TYPE:
+   return iscsi_switch_str_param(session-discovery_parent_type,
+ buf);
default:
return -ENOSYS;
}
@@ -3326,6 +,52 @@ int iscsi_session_get_param(struct iscsi_cls_session 
*cls_session,
case ISCSI_PARAM_INITIATOR_NAME:
len = sprintf(buf, %s\n, session-initiatorname);
break;
+   case ISCSI_PARAM_AUTO_SND_TGT_DISABLE:
+   len = sprintf(buf, %u\n, session-auto_snd_tgt_disable);
+   break;
+   case ISCSI_PARAM_DISCOVERY_SESS:
+   len = sprintf(buf, %u\n, session-discovery_sess);
+   break;
+   case ISCSI_PARAM_PORTAL_TYPE:
+   len = sprintf(buf, %s\n, session-portal_type);
+   break;
+   case ISCSI_PARAM_CHAP_AUTH_EN:
+   len = sprintf(buf, %u\n, session-chap_auth_en);
+   break;
+   case ISCSI_PARAM_DISCOVERY_LOGOUT_EN:
+   len = sprintf(buf, %u\n, session-discovery_logout_en);
+   break;
+   case ISCSI_PARAM_BIDI_CHAP_EN:
+   len = sprintf(buf, %u\n, session-bidi_chap_en);
+   break;
+   case ISCSI_PARAM_DISCOVERY_AUTH_OPTIONAL:
+   len = sprintf(buf, %u\n, session-discovery_auth_optional);
+   break;
+   case ISCSI_PARAM_DEF_TIME2WAIT:
+   len = sprintf(buf, %d\n, session-time2wait);
+   break;
+   case ISCSI_PARAM_DEF_TIME2RETAIN:
+   len = sprintf(buf, %d\n, session-time2retain);
+   break;
+   case ISCSI_PARAM_TSID:
+   len = sprintf(buf, %u\n, session-tsid);
+   break;
+   case ISCSI_PARAM_ISID:
+   len = sprintf(buf, %02x%02x%02x%02x%02x%02x\n,
+ session-isid[0], session-isid[1],
+ session-isid[2], session-isid[3],
+ session-isid[4], session-isid[5]);
+   break;
+   case ISCSI_PARAM_DISCOVERY_PARENT_IDX:
+   len = sprintf(buf, %u\n, session-discovery_parent_idx);
+   break;
+   case ISCSI_PARAM_DISCOVERY_PARENT_TYPE:
+   if (session-discovery_parent_type)
+   len = sprintf(buf, %s\n,
+ session-discovery_parent_type);
+   else
+   len = sprintf(buf, \n);
+   break;
default:
return -ENOSYS;
}
@@ -3415,6 +3468,51 @@ int iscsi_conn_get_param(struct iscsi_cls_conn *cls_conn,
case ISCSI_PARAM_PERSISTENT_ADDRESS:
len = sprintf(buf, %s\n, conn-persistent_address);
break;
+   case ISCSI_PARAM_STATSN:
+   len = sprintf(buf, %u\n, conn-statsn);
+   break;
+   case ISCSI_PARAM_MAX_SEGMENT_SIZE:
+   len = sprintf(buf, %u\n, conn-max_segment_size);
+   break;
+   case ISCSI_PARAM_KEEPALIVE_TMO:
+   len = sprintf(buf, %u\n, conn-keepalive_tmo);
+   break;
+   case ISCSI_PARAM_LOCAL_PORT:
+   len = sprintf(buf, %u\n, conn-local_port);
+   break;
+   case ISCSI_PARAM_TCP_TIMESTAMP_STAT:
+   len = sprintf(buf, %u\n, conn-tcp_timestamp_stat);
+   break;
+   case ISCSI_PARAM_TCP_NAGLE_DISABLE:
+   len = sprintf(buf, %u\n, conn-tcp_nagle_disable);
+   break;
+   case ISCSI_PARAM_TCP_WSF_DISABLE:
+   len = sprintf(buf, %u\n, conn-tcp_wsf_disable);
+   break;
+   case ISCSI_PARAM_TCP_TIMER_SCALE:
+   len = 

[PATCH V1 3/4] qla4xxx: Exporting new attrs for iscsi session and connection in sysfs

2013-06-26 Thread vikas.chaudhary
From: Adheer Chandravanshi adheer.chandravan...@qlogic.com

Signed-off-by: Adheer Chandravanshi adheer.chandravan...@qlogic.com
Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
---
 drivers/scsi/qla4xxx/ql4_os.c | 203 ++
 1 file changed, 146 insertions(+), 57 deletions(-)

diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index 4d231c1..84d9361 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -378,6 +378,44 @@ static umode_t qla4_attr_is_visible(int param_type, int 
param)
case ISCSI_PARAM_PASSWORD:
case ISCSI_PARAM_USERNAME_IN:
case ISCSI_PARAM_PASSWORD_IN:
+   case ISCSI_PARAM_AUTO_SND_TGT_DISABLE:
+   case ISCSI_PARAM_DISCOVERY_SESS:
+   case ISCSI_PARAM_PORTAL_TYPE:
+   case ISCSI_PARAM_CHAP_AUTH_EN:
+   case ISCSI_PARAM_DISCOVERY_LOGOUT_EN:
+   case ISCSI_PARAM_BIDI_CHAP_EN:
+   case ISCSI_PARAM_DISCOVERY_AUTH_OPTIONAL:
+   case ISCSI_PARAM_DEF_TIME2WAIT:
+   case ISCSI_PARAM_DEF_TIME2RETAIN:
+   case ISCSI_PARAM_HDRDGST_EN:
+   case ISCSI_PARAM_DATADGST_EN:
+   case ISCSI_PARAM_INITIAL_R2T_EN:
+   case ISCSI_PARAM_IMM_DATA_EN:
+   case ISCSI_PARAM_PDU_INORDER_EN:
+   case ISCSI_PARAM_DATASEQ_INORDER_EN:
+   case ISCSI_PARAM_MAX_SEGMENT_SIZE:
+   case ISCSI_PARAM_TCP_TIMESTAMP_STAT:
+   case ISCSI_PARAM_TCP_WSF_DISABLE:
+   case ISCSI_PARAM_TCP_NAGLE_DISABLE:
+   case ISCSI_PARAM_TCP_TIMER_SCALE:
+   case ISCSI_PARAM_TCP_TIMESTAMP_EN:
+   case ISCSI_PARAM_TCP_XMIT_WSF:
+   case ISCSI_PARAM_TCP_RECV_WSF:
+   case ISCSI_PARAM_IP_FRAGMENT_DISABLE:
+   case ISCSI_PARAM_IPV4_TOS:
+   case ISCSI_PARAM_IPV6_TC:
+   case ISCSI_PARAM_IPV6_FLOW_LABEL:
+   case ISCSI_PARAM_IS_FW_ASSIGNED_IPV6:
+   case ISCSI_PARAM_KEEPALIVE_TMO:
+   case ISCSI_PARAM_LOCAL_PORT:
+   case ISCSI_PARAM_ISID:
+   case ISCSI_PARAM_TSID:
+   case ISCSI_PARAM_DEF_TASKMGMT_TMO:
+   case ISCSI_PARAM_ERL:
+   case ISCSI_PARAM_STATSN:
+   case ISCSI_PARAM_EXP_STATSN:
+   case ISCSI_PARAM_DISCOVERY_PARENT_IDX:
+   case ISCSI_PARAM_DISCOVERY_PARENT_TYPE:
return S_IRUGO;
default:
return 0;
@@ -2257,6 +2295,101 @@ static int qla4xxx_copy_to_fwddb_param(struct 
iscsi_bus_flash_session *sess,
return rc;
 }
 
+static void qla4xxx_copy_to_sess_conn_params(struct iscsi_conn *conn,
+struct iscsi_session *sess,
+struct dev_db_entry *fw_ddb_entry)
+{
+   unsigned long options = 0;
+   uint16_t ddb_link;
+   uint16_t disc_parent;
+
+   options = le16_to_cpu(fw_ddb_entry-options);
+   conn-is_fw_assigned_ipv6 = test_bit(OPT_IS_FW_ASSIGNED_IPV6, options);
+   sess-auto_snd_tgt_disable = test_bit(OPT_AUTO_SENDTGTS_DISABLE,
+ options);
+   sess-discovery_sess = test_bit(OPT_DISC_SESSION, options);
+
+   options = le16_to_cpu(fw_ddb_entry-iscsi_options);
+   conn-hdrdgst_en = test_bit(ISCSIOPT_HEADER_DIGEST_EN, options);
+   conn-datadgst_en = test_bit(ISCSIOPT_DATA_DIGEST_EN, options);
+   sess-imm_data_en = test_bit(ISCSIOPT_IMMEDIATE_DATA_EN, options);
+   sess-initial_r2t_en = test_bit(ISCSIOPT_INITIAL_R2T_EN, options);
+   sess-dataseq_inorder_en = test_bit(ISCSIOPT_DATA_SEQ_IN_ORDER,
+   options);
+   sess-pdu_inorder_en = test_bit(ISCSIOPT_DATA_PDU_IN_ORDER, options);
+   sess-chap_auth_en = test_bit(ISCSIOPT_CHAP_AUTH_EN, options);
+   sess-discovery_logout_en = test_bit(ISCSIOPT_DISCOVERY_LOGOUT_EN,
+options);
+   sess-bidi_chap_en = test_bit(ISCSIOPT_BIDI_CHAP_EN, options);
+   sess-discovery_auth_optional =
+   test_bit(ISCSIOPT_DISCOVERY_AUTH_OPTIONAL, options);
+   if (test_bit(ISCSIOPT_ERL1, options))
+   sess-erl |= BIT_1;
+   if (test_bit(ISCSIOPT_ERL0, options))
+   sess-erl |= BIT_0;
+
+   options = le16_to_cpu(fw_ddb_entry-tcp_options);
+   conn-tcp_timestamp_stat = test_bit(TCPOPT_TIMESTAMP_STAT, options);
+   conn-tcp_nagle_disable = test_bit(TCPOPT_NAGLE_DISABLE, options);
+   conn-tcp_wsf_disable = test_bit(TCPOPT_WSF_DISABLE, options);
+   if (test_bit(TCPOPT_TIMER_SCALE3, options))
+   conn-tcp_timer_scale |= BIT_3;
+   if (test_bit(TCPOPT_TIMER_SCALE2, options))
+   

[PATCH 1/8] iscsi_transport: Remove net param enum numbers

2013-05-09 Thread vikas.chaudhary
From: Harish Zunjarrao harish.zunjar...@qlogic.com

Signed-off-by: Harish Zunjarrao harish.zunjar...@qlogic.com
Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
---
 include/scsi/iscsi_if.h | 38 +++---
 1 file changed, 19 insertions(+), 19 deletions(-)

diff --git a/include/scsi/iscsi_if.h b/include/scsi/iscsi_if.h
index fe7f06c..2bc5d1c 100644
--- a/include/scsi/iscsi_if.h
+++ b/include/scsi/iscsi_if.h
@@ -377,25 +377,25 @@ struct iscsi_path {
 /* iSCSI network params */
 enum iscsi_net_param {
ISCSI_NET_PARAM_IPV4_ADDR   = 1,
-   ISCSI_NET_PARAM_IPV4_SUBNET = 2,
-   ISCSI_NET_PARAM_IPV4_GW = 3,
-   ISCSI_NET_PARAM_IPV4_BOOTPROTO  = 4,
-   ISCSI_NET_PARAM_MAC = 5,
-   ISCSI_NET_PARAM_IPV6_LINKLOCAL  = 6,
-   ISCSI_NET_PARAM_IPV6_ADDR   = 7,
-   ISCSI_NET_PARAM_IPV6_ROUTER = 8,
-   ISCSI_NET_PARAM_IPV6_ADDR_AUTOCFG   = 9,
-   ISCSI_NET_PARAM_IPV6_LINKLOCAL_AUTOCFG  = 10,
-   ISCSI_NET_PARAM_IPV6_ROUTER_AUTOCFG = 11,
-   ISCSI_NET_PARAM_IFACE_ENABLE= 12,
-   ISCSI_NET_PARAM_VLAN_ID = 13,
-   ISCSI_NET_PARAM_VLAN_PRIORITY   = 14,
-   ISCSI_NET_PARAM_VLAN_ENABLED= 15,
-   ISCSI_NET_PARAM_VLAN_TAG= 16,
-   ISCSI_NET_PARAM_IFACE_TYPE  = 17,
-   ISCSI_NET_PARAM_IFACE_NAME  = 18,
-   ISCSI_NET_PARAM_MTU = 19,
-   ISCSI_NET_PARAM_PORT= 20,
+   ISCSI_NET_PARAM_IPV4_SUBNET,
+   ISCSI_NET_PARAM_IPV4_GW,
+   ISCSI_NET_PARAM_IPV4_BOOTPROTO,
+   ISCSI_NET_PARAM_MAC,
+   ISCSI_NET_PARAM_IPV6_LINKLOCAL,
+   ISCSI_NET_PARAM_IPV6_ADDR,
+   ISCSI_NET_PARAM_IPV6_ROUTER,
+   ISCSI_NET_PARAM_IPV6_ADDR_AUTOCFG,
+   ISCSI_NET_PARAM_IPV6_LINKLOCAL_AUTOCFG,
+   ISCSI_NET_PARAM_IPV6_ROUTER_AUTOCFG,
+   ISCSI_NET_PARAM_IFACE_ENABLE,
+   ISCSI_NET_PARAM_VLAN_ID,
+   ISCSI_NET_PARAM_VLAN_PRIORITY,
+   ISCSI_NET_PARAM_VLAN_ENABLED,
+   ISCSI_NET_PARAM_VLAN_TAG,
+   ISCSI_NET_PARAM_IFACE_TYPE,
+   ISCSI_NET_PARAM_IFACE_NAME,
+   ISCSI_NET_PARAM_MTU,
+   ISCSI_NET_PARAM_PORT,
 };
 
 enum iscsi_conn_state {
-- 
1.8.2.GIT


--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 4/8] scsi_transport_iscsi: Exporting new attrs for iscsi session and connection in sysfs

2013-05-09 Thread vikas.chaudhary
From: Adheer Chandravanshi adheer.chandravan...@qlogic.com

Exporting new iSCSI Session and Connection parameters to sysfs

Signed-off-by: Adheer Chandravanshi adheer.chandravan...@qlogic.com
Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
---
 drivers/scsi/scsi_transport_iscsi.c | 135 +++-
 include/scsi/iscsi_if.h |  36 ++
 2 files changed, 170 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/scsi_transport_iscsi.c 
b/drivers/scsi/scsi_transport_iscsi.c
index 315c8b6..bfaeaf3 100644
--- a/drivers/scsi/scsi_transport_iscsi.c
+++ b/drivers/scsi/scsi_transport_iscsi.c
@@ -25,7 +25,6 @@
 #include linux/slab.h
 #include linux/bsg-lib.h
 #include linux/idr.h
-#include linux/list.h
 #include net/tcp.h
 #include scsi/scsi.h
 #include scsi/scsi_host.h
@@ -3656,6 +3655,26 @@ iscsi_conn_attr(exp_statsn, ISCSI_PARAM_EXP_STATSN);
 iscsi_conn_attr(persistent_address, ISCSI_PARAM_PERSISTENT_ADDRESS);
 iscsi_conn_attr(ping_tmo, ISCSI_PARAM_PING_TMO);
 iscsi_conn_attr(recv_tmo, ISCSI_PARAM_RECV_TMO);
+iscsi_conn_attr(local_port, ISCSI_PARAM_LOCAL_PORT);
+iscsi_conn_attr(redirect_ipaddr, ISCSI_PARAM_REDIRECT_IPADDR);
+iscsi_conn_attr(statsn, ISCSI_PARAM_STATSN);
+iscsi_conn_attr(keepalive_tmo, ISCSI_PARAM_KEEPALIVE_TMO);
+iscsi_conn_attr(max_segment_size, ISCSI_PARAM_MAX_SEGMENT_SIZE);
+iscsi_conn_attr(snack_req, ISCSI_PARAM_SNACK_REQ_EN);
+iscsi_conn_attr(tcp_timestamp_stat, ISCSI_PARAM_TCP_TIMESTAMP_STAT);
+iscsi_conn_attr(tcp_wsf_disable, ISCSI_PARAM_TCP_WSF_DISABLE);
+iscsi_conn_attr(tcp_nagle_disable, ISCSI_PARAM_TCP_NAGLE_DISABLE);
+iscsi_conn_attr(tcp_timer_scale, ISCSI_PARAM_TCP_TIMER_SCALE);
+iscsi_conn_attr(tcp_timestamp_enable, ISCSI_PARAM_TCP_TIMESTAMP_EN);
+iscsi_conn_attr(fragment_disable, ISCSI_PARAM_IP_FRAGMENT_DISABLE);
+iscsi_conn_attr(ipv4_tos, ISCSI_PARAM_IPV4_TOS);
+iscsi_conn_attr(ipv6_traffic_class, ISCSI_PARAM_IPV6_TC);
+iscsi_conn_attr(ipv6_flow_label, ISCSI_PARAM_IPV6_FLOW_LABEL);
+iscsi_conn_attr(is_fw_assigned_ipv6, ISCSI_PARAM_IS_FW_ASSIGNED_IPV6);
+iscsi_conn_attr(link_local_ipv6, ISCSI_PARAM_LINK_LOCAL_IPV6);
+iscsi_conn_attr(tcp_xmit_wsf, ISCSI_PARAM_TCP_XMIT_WSF);
+iscsi_conn_attr(tcp_recv_wsf, ISCSI_PARAM_TCP_RECV_WSF);
+
 
 #define iscsi_conn_ep_attr_show(param) \
 static ssize_t show_conn_ep_param_##param(struct device *dev,  \
@@ -3708,6 +3727,25 @@ static struct attribute *iscsi_conn_attrs[] = {
dev_attr_conn_persistent_port.attr,
dev_attr_conn_ping_tmo.attr,
dev_attr_conn_recv_tmo.attr,
+   dev_attr_conn_local_port.attr,
+   dev_attr_conn_redirect_ipaddr.attr,
+   dev_attr_conn_statsn.attr,
+   dev_attr_conn_keepalive_tmo.attr,
+   dev_attr_conn_max_segment_size.attr,
+   dev_attr_conn_snack_req.attr,
+   dev_attr_conn_tcp_timestamp_stat.attr,
+   dev_attr_conn_tcp_wsf_disable.attr,
+   dev_attr_conn_tcp_nagle_disable.attr,
+   dev_attr_conn_tcp_timer_scale.attr,
+   dev_attr_conn_tcp_timestamp_enable.attr,
+   dev_attr_conn_fragment_disable.attr,
+   dev_attr_conn_ipv4_tos.attr,
+   dev_attr_conn_ipv6_traffic_class.attr,
+   dev_attr_conn_ipv6_flow_label.attr,
+   dev_attr_conn_is_fw_assigned_ipv6.attr,
+   dev_attr_conn_link_local_ipv6.attr,
+   dev_attr_conn_tcp_xmit_wsf.attr,
+   dev_attr_conn_tcp_recv_wsf.attr,
NULL,
 };
 
@@ -3745,6 +3783,44 @@ static umode_t iscsi_conn_attr_is_visible(struct kobject 
*kobj,
param = ISCSI_PARAM_PING_TMO;
else if (attr == dev_attr_conn_recv_tmo.attr)
param = ISCSI_PARAM_RECV_TMO;
+   else if (attr == dev_attr_conn_local_port.attr)
+   param = ISCSI_PARAM_LOCAL_PORT;
+   else if (attr == dev_attr_conn_redirect_ipaddr.attr)
+   param = ISCSI_PARAM_REDIRECT_IPADDR;
+   else if (attr == dev_attr_conn_statsn.attr)
+   param = ISCSI_PARAM_STATSN;
+   else if (attr == dev_attr_conn_keepalive_tmo.attr)
+   param = ISCSI_PARAM_KEEPALIVE_TMO;
+   else if (attr == dev_attr_conn_max_segment_size.attr)
+   param = ISCSI_PARAM_MAX_SEGMENT_SIZE;
+   else if (attr == dev_attr_conn_snack_req.attr)
+   param = ISCSI_PARAM_SNACK_REQ_EN;
+   else if (attr == dev_attr_conn_tcp_timestamp_stat.attr)
+   param = ISCSI_PARAM_TCP_TIMESTAMP_STAT;
+   else if (attr == dev_attr_conn_tcp_wsf_disable.attr)
+   param = ISCSI_PARAM_TCP_WSF_DISABLE;
+   else if (attr == dev_attr_conn_tcp_nagle_disable.attr)
+   param = ISCSI_PARAM_TCP_NAGLE_DISABLE;
+   else if (attr == dev_attr_conn_tcp_timer_scale.attr)
+   param = ISCSI_PARAM_TCP_TIMER_SCALE;
+   else if (attr == dev_attr_conn_tcp_timestamp_enable.attr)
+   param = ISCSI_PARAM_TCP_TIMESTAMP_EN;
+   else if (attr == dev_attr_conn_fragment_disable.attr)
+   param = 

[PATCH 0/8] qla4xxx: Updates for scsi misc branch

2013-05-09 Thread vikas.chaudhary
From: Vikas Chaudhary vikas.chaudh...@qlogic.com

James,

Following patches are to display additional iSCSI connection and session
parameters to sysfs as well allow setting and display of additional Network
parameter for iSCSI interface.

Please apply these patches to the scsi tree misc branch at your
earliest convenience.

Adheer Chandravanshi (3):
  scsi_transport_iscsi: Exporting new attrs for iscsi session and 
connection in sysfs
  libiscsi: Exporting new attrs for iscsi session and connection in sysfs
  qla4xxx: Exporting new attrs for iscsi session and connection in sysfs

Harish Zunjarrao (3):
  iscsi_transport: Remove net param enum numbers
  iscsi_transport: Additional parameters for net settings
  qla4xxx: Additional parameters for net settings

Manish Rangankar (1):
  qla4xxx: Add support to allow flashnode multi-session login.

Vikas Chaudhary (1):
  qla4xxx: Update driver version to 5.03.00-k10

Thanks,
Vikas.

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/8] iscsi_transport: Additional parameters for net settings

2013-05-09 Thread vikas.chaudhary
From: Harish Zunjarrao harish.zunjar...@qlogic.com

Added support to display and update additional network parameters
through iscsiadm

Signed-off-by: Harish Zunjarrao harish.zunjar...@qlogic.com
Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
---
 drivers/scsi/scsi_transport_iscsi.c | 331 +++-
 include/scsi/iscsi_if.h |  78 +
 include/scsi/scsi_transport_iscsi.h |   3 +
 3 files changed, 411 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/scsi_transport_iscsi.c 
b/drivers/scsi/scsi_transport_iscsi.c
index 133926b..315c8b6 100644
--- a/drivers/scsi/scsi_transport_iscsi.c
+++ b/drivers/scsi/scsi_transport_iscsi.c
@@ -306,11 +306,38 @@ show_##type##_##name(struct device *dev, struct 
device_attribute *attr,   \
iscsi_iface_attr_show(type, name, ISCSI_NET_PARAM, param)   \
 static ISCSI_IFACE_ATTR(type, name, S_IRUGO, show_##type##_##name, NULL);
 
-/* generic read only ipvi4 attribute */
+/* generic read only ipv4 attribute */
 iscsi_iface_net_attr(ipv4_iface, ipaddress, ISCSI_NET_PARAM_IPV4_ADDR);
 iscsi_iface_net_attr(ipv4_iface, gateway, ISCSI_NET_PARAM_IPV4_GW);
 iscsi_iface_net_attr(ipv4_iface, subnet, ISCSI_NET_PARAM_IPV4_SUBNET);
 iscsi_iface_net_attr(ipv4_iface, bootproto, ISCSI_NET_PARAM_IPV4_BOOTPROTO);
+iscsi_iface_net_attr(ipv4_iface, dhcp_dns_address_enabled,
+ISCSI_NET_PARAM_IPV4_DHCP_DNS_ADDR_EN);
+iscsi_iface_net_attr(ipv4_iface, dhcp_slp_da_info_enabled,
+ISCSI_NET_PARAM_IPV4_DHCP_SLP_DA_EN);
+iscsi_iface_net_attr(ipv4_iface, dhcp_req_isns_info_enabled,
+ISCSI_NET_PARAM_IPV4_DHCP_REQ_ISNS_INFO_EN);
+iscsi_iface_net_attr(ipv4_iface, tos_enabled, ISCSI_NET_PARAM_IPV4_TOS_EN);
+iscsi_iface_net_attr(ipv4_iface, tos, ISCSI_NET_PARAM_IPV4_TOS);
+iscsi_iface_net_attr(ipv4_iface, grat_arp_enabled,
+ISCSI_NET_PARAM_IPV4_GRAT_ARP_EN);
+iscsi_iface_net_attr(ipv4_iface, dhcp_alt_client_id_enabled,
+ISCSI_NET_PARAM_IPV4_DHCP_ALT_CLIENT_ID_EN);
+iscsi_iface_net_attr(ipv4_iface, dhcp_alt_client_id,
+ISCSI_NET_PARAM_IPV4_DHCP_ALT_CLIENT_ID);
+iscsi_iface_net_attr(ipv4_iface, dhcp_req_vendor_id_enabled,
+ISCSI_NET_PARAM_IPV4_DHCP_REQ_VENDOR_ID_EN);
+iscsi_iface_net_attr(ipv4_iface, dhcp_use_vendor_id_enabled,
+ISCSI_NET_PARAM_IPV4_DHCP_USE_VENDOR_ID_EN);
+iscsi_iface_net_attr(ipv4_iface, dhcp_vendor_id,
+ISCSI_NET_PARAM_IPV4_DHCP_VENDOR_ID);
+iscsi_iface_net_attr(ipv4_iface, dhcp_learn_iqn_enabled,
+ISCSI_NET_PARAM_IPV4_DHCP_LEARN_IQN_EN);
+iscsi_iface_net_attr(ipv4_iface, fragmentation_enabled,
+ISCSI_NET_PARAM_IPV4_FRAGMENT_EN);
+iscsi_iface_net_attr(ipv4_iface, incoming_forwarding_enabled,
+ISCSI_NET_PARAM_IPV4_IN_FORWARD_EN);
+iscsi_iface_net_attr(ipv4_iface, ttl, ISCSI_NET_PARAM_IPV4_TTL);
 
 /* generic read only ipv6 attribute */
 iscsi_iface_net_attr(ipv6_iface, ipaddress, ISCSI_NET_PARAM_IPV6_ADDR);
@@ -320,6 +347,27 @@ iscsi_iface_net_attr(ipv6_iface, ipaddr_autocfg,
 ISCSI_NET_PARAM_IPV6_ADDR_AUTOCFG);
 iscsi_iface_net_attr(ipv6_iface, link_local_autocfg,
 ISCSI_NET_PARAM_IPV6_LINKLOCAL_AUTOCFG);
+iscsi_iface_net_attr(ipv6_iface, link_local_state,
+ISCSI_NET_PARAM_IPV6_LINKLOCAL_STATE);
+iscsi_iface_net_attr(ipv6_iface, router_state,
+ISCSI_NET_PARAM_IPV6_ROUTER_STATE);
+iscsi_iface_net_attr(ipv6_iface, grat_neighbor_adv_enabled,
+ISCSI_NET_PARAM_IPV6_GRAT_NEIGHBOR_ADV_EN);
+iscsi_iface_net_attr(ipv6_iface, mld_enabled, ISCSI_NET_PARAM_IPV6_MLD_EN);
+iscsi_iface_net_attr(ipv6_iface, flow_label, ISCSI_NET_PARAM_IPV6_FLOW_LABEL);
+iscsi_iface_net_attr(ipv6_iface, traffic_class,
+ISCSI_NET_PARAM_IPV6_TRAFFIC_CLASS);
+iscsi_iface_net_attr(ipv6_iface, hop_limit, ISCSI_NET_PARAM_IPV6_HOP_LIMIT);
+iscsi_iface_net_attr(ipv6_iface, nd_reachable_tmo,
+ISCSI_NET_PARAM_IPV6_ND_REACHABLE_TMO);
+iscsi_iface_net_attr(ipv6_iface, nd_rexmit_time,
+ISCSI_NET_PARAM_IPV6_ND_REXMIT_TIME);
+iscsi_iface_net_attr(ipv6_iface, nd_stale_tmo,
+ISCSI_NET_PARAM_IPV6_ND_STALE_TMO);
+iscsi_iface_net_attr(ipv6_iface, dup_addr_det_cnt,
+ISCSI_NET_PARAM_IPV6_DUP_ADDR_DET_CNT);
+iscsi_iface_net_attr(ipv6_iface, router_adv_link_mtu,
+ISCSI_NET_PARAM_IPV6_RTR_ADV_LINK_MTU);
 
 /* common read only iface attribute */
 iscsi_iface_net_attr(iface, enabled, ISCSI_NET_PARAM_IFACE_ENABLE);
@@ -328,6 +376,51 @@ iscsi_iface_net_attr(iface, vlan_priority, 
ISCSI_NET_PARAM_VLAN_PRIORITY);
 iscsi_iface_net_attr(iface, vlan_enabled, ISCSI_NET_PARAM_VLAN_ENABLED);
 iscsi_iface_net_attr(iface, mtu, ISCSI_NET_PARAM_MTU);
 iscsi_iface_net_attr(iface, port, ISCSI_NET_PARAM_PORT);
+iscsi_iface_net_attr(iface, 

[PATCH 3/8] qla4xxx: Additional parameters for net settings

2013-05-09 Thread vikas.chaudhary
From: Harish Zunjarrao harish.zunjar...@qlogic.com

Signed-off-by: Harish Zunjarrao harish.zunjar...@qlogic.com
Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
---
 drivers/scsi/qla4xxx/ql4_def.h  |   31 ++
 drivers/scsi/qla4xxx/ql4_fw.h   |   53 +-
 drivers/scsi/qla4xxx/ql4_glbl.h |1 +
 drivers/scsi/qla4xxx/ql4_isr.c  |   32 ++
 drivers/scsi/qla4xxx/ql4_mbx.c  |  119 -
 drivers/scsi/qla4xxx/ql4_os.c   | 1057 +++
 6 files changed, 1283 insertions(+), 10 deletions(-)

diff --git a/drivers/scsi/qla4xxx/ql4_def.h b/drivers/scsi/qla4xxx/ql4_def.h
index ddf16a8..fcd4110 100644
--- a/drivers/scsi/qla4xxx/ql4_def.h
+++ b/drivers/scsi/qla4xxx/ql4_def.h
@@ -469,6 +469,37 @@ struct ipaddress_config {
uint16_t eth_mtu_size;
uint16_t ipv4_port;
uint16_t ipv6_port;
+   uint8_t control;
+   uint16_t ipv6_tcp_options;
+   uint8_t isns_addr[IP_ADDR_LEN];
+   uint16_t isns_port;
+   struct in6_addr ipv6_isns_addr;
+   uint8_t tcp_wsf;
+   uint8_t ipv6_tcp_wsf;
+   uint8_t ipv4_tos;
+   uint8_t ipv4_cache_id;
+   uint8_t ipv6_cache_id;
+   uint8_t ipv4_alt_cid_len;
+   uint8_t ipv4_alt_cid[11];
+   uint8_t ipv4_vid_len;
+   uint8_t ipv4_vid[11];
+   uint8_t ipv4_ttl;
+   uint16_t ipv6_flow_lbl;
+   uint8_t ipv6_traffic_class;
+   uint8_t ipv6_hop_limit;
+   uint32_t ipv6_nd_reach_time;
+   uint32_t ipv6_nd_rexmit_timer;
+   uint32_t ipv6_nd_stale_timeout;
+   uint8_t ipv6_dup_addr_detect_count;
+   uint32_t ipv6_gw_advrt_mtu;
+   uint16_t def_timeout;
+   uint8_t abort_timer;
+   uint16_t iscsi_options;
+   uint16_t iscsi_max_pdu_size;
+   uint16_t iscsi_fburst_len;
+   uint16_t iscsi_max_outstnd_r2t;
+   uint16_t iscsi_max_burst_len;
+   uint8_t iscsi_name[224];
 };
 
 #define QL4_CHAP_MAX_NAME_LEN 256
diff --git a/drivers/scsi/qla4xxx/ql4_fw.h b/drivers/scsi/qla4xxx/ql4_fw.h
index c7b8892..79c53eb 100644
--- a/drivers/scsi/qla4xxx/ql4_fw.h
+++ b/drivers/scsi/qla4xxx/ql4_fw.h
@@ -541,6 +541,7 @@ struct addr_ctrl_blk {
 #define  IFCB_VER_MIN  0x01
 #define  IFCB_VER_MAX  0x02
uint8_t control;/* 01 */
+#define CTRLOPT_NEW_CONN_DISABLE   0x0002
 
uint16_t fw_options;/* 02-03 */
 #define FWOPT_HEARTBEAT_ENABLE   0x1000
@@ -572,11 +573,42 @@ struct addr_ctrl_blk {
uint32_t shdwreg_addr_hi;   /* 2C-2F */
 
uint16_t iscsi_opts;/* 30-31 */
+#define ISCSIOPT_HEADER_DIGEST_ENABLE  0x2000
+#define ISCSIOPT_DATA_DIGEST_ENABLE0x1000
+#define ISCSIOPT_IMMEDIATE_DATA_ENABLE 0x0800
+#define ISCSIOPT_INITIAL_R2T_ENABLE0x0400
+#define ISCSIOPT_DATA_SEQ_INORDER_ENABLE   0x0200
+#define ISCSIOPT_DATA_PDU_INORDER_ENABLE   0x0100
+#define ISCSIOPT_CHAP_AUTH_ENABLE  0x0080
+#define ISCSIOPT_SNACK_ENABLE  0x0040
+#define ISCSIOPT_DISCOVERY_LOGOUT_ENABLE   0x0020
+#define ISCSIOPT_BIDI_CHAP_ENABLE  0x0010
+#define ISCSIOPT_DISCOVERY_AUTH_ENABLE 0x0008
+#define ISCSIOPT_STRICT_LOGIN_COMP_ENABLE  0x0004
+#define ISCSIOPT_ERR_RECOVERY_LEVEL_MASK   0x0003
uint16_t ipv4_tcp_opts; /* 32-33 */
+#define TCPOPT_DELAYED_ACK_DISABLE 0x8000
+#define TCPOPT_ISNS_ENABLE 0x4000
 #define TCPOPT_DHCP_ENABLE 0x0200
+#define TCPOPT_DNS_SERVER_IP_ENABLE0x0100
+#define TCPOPT_SLP_DA_INFO_ENABLE  0x0080
+#define TCPOPT_ISNS_INFO_ENABLE0x0040
+#define TCPOPT_NAGLE_ALGO_DISABLE  0x0020
+#define TCPOPT_WINDOW_SCALE_DISABLE0x0010
+#define TCPOPT_TIMER_SCALE 0x000E
+#define TCPOPT_TIMESTAMP_ENABLE0x0001
uint16_t ipv4_ip_opts;  /* 34-35 */
 #define IPOPT_IPV4_PROTOCOL_ENABLE 0x8000
+#define IPOPT_IPV4_TOS_ENABLE  0x4000
 #define IPOPT_VLAN_TAGGING_ENABLE  0x2000
+#define IPOPT_GRAT_ARP_ENABLE  0x1000
+#define IPOPT_ALT_CID_ENABLE   0x0800
+#define IPOPT_REQ_VID_ENABLE   0x0400
+#define IPOPT_USE_VID_ENABLE   0x0200
+#define IPOPT_LEARN_IQN_ENABLE 0x0100
+#define IPOPT_FRAGMENTATION_DISABLE0x0010
+#define IPOPT_INCOM_FORWARD_ENABLE 0x0008
+#define IPOPT_ARP_REDIRECT_ENABLE  0x0004
 
uint16_t iscsi_max_pdu_size;/* 36-37 */
uint8_t ipv4_tos;   /* 38 */
@@ -619,7 +651,9 @@ struct addr_ctrl_blk {
uint8_t ipv4_sec_ip_addr[4];/* D0-D3 */
uint8_t ipv4_dhcp_vid_len;  /* D4 */
uint8_t ipv4_dhcp_vid[11];  /* D5-DF */
-   uint8_t res11[20];  /* E0-F3 */
+   uint8_t ipv4_isns_addr[4];  /* E0-E3 */
+   uint16_t ipv4_isns_port;/* E4-E5 */
+   uint8_t res11[14];  /* E6-F3 */
uint8_t ipv4_dhcp_alt_cid_len;  /* F4 */
uint8_t ipv4_dhcp_alt_cid[11];  /* F5-FF */
uint8_t 

[PATCH 8/8] qla4xxx: Update driver version to 5.03.00-k10

2013-05-09 Thread vikas.chaudhary
From: Vikas Chaudhary vikas.chaudh...@qlogic.com

Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
---
 drivers/scsi/qla4xxx/ql4_version.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/qla4xxx/ql4_version.h 
b/drivers/scsi/qla4xxx/ql4_version.h
index fe873cf..c5edd0d 100644
--- a/drivers/scsi/qla4xxx/ql4_version.h
+++ b/drivers/scsi/qla4xxx/ql4_version.h
@@ -5,4 +5,4 @@
  * See LICENSE.qla4xxx for copyright and licensing details.
  */
 
-#define QLA4XXX_DRIVER_VERSION 5.03.00-k9
+#define QLA4XXX_DRIVER_VERSION 5.03.00-k10
-- 
1.8.2.GIT


--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 5/8] libiscsi: Exporting new attrs for iscsi session and connection in sysfs

2013-05-09 Thread vikas.chaudhary
From: Adheer Chandravanshi adheer.chandravan...@qlogic.com

Signed-off-by: Adheer Chandravanshi adheer.chandravan...@qlogic.com
Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
---
 drivers/scsi/libiscsi.c | 113 
 include/scsi/libiscsi.h |  35 +++
 2 files changed, 148 insertions(+)

diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
index 5de9469..dc8bbb8 100644
--- a/drivers/scsi/libiscsi.c
+++ b/drivers/scsi/libiscsi.c
@@ -2809,6 +2809,8 @@ void iscsi_session_teardown(struct iscsi_cls_session 
*cls_session)
kfree(session-targetalias);
kfree(session-initiatorname);
kfree(session-ifacename);
+   kfree(session-portal_type);
+   kfree(session-discovery_parent_type);
 
iscsi_destroy_session(cls_session);
iscsi_host_dec_session_cnt(shost);
@@ -2940,6 +2942,8 @@ void iscsi_conn_teardown(struct iscsi_cls_conn *cls_conn)
free_pages((unsigned long) conn-data,
   get_order(ISCSI_DEF_MAX_RECV_SEG_LEN));
kfree(conn-persistent_address);
+   kfree(conn-link_local_ipv6);
+   kfree(conn-redirect_ipaddr);
kfifo_in(session-cmdpool.queue, (void*)conn-login_task,
sizeof(void*));
if (session-leadconn == conn)
@@ -3244,10 +3248,19 @@ int iscsi_set_param(struct iscsi_cls_conn *cls_conn,
break;
case ISCSI_PARAM_PERSISTENT_ADDRESS:
return iscsi_switch_str_param(conn-persistent_address, buf);
+   case ISCSI_PARAM_LINK_LOCAL_IPV6:
+   return iscsi_switch_str_param(conn-link_local_ipv6, buf);
+   case ISCSI_PARAM_REDIRECT_IPADDR:
+   return iscsi_switch_str_param(conn-redirect_ipaddr, buf);
case ISCSI_PARAM_IFACE_NAME:
return iscsi_switch_str_param(session-ifacename, buf);
case ISCSI_PARAM_INITIATOR_NAME:
return iscsi_switch_str_param(session-initiatorname, buf);
+   case ISCSI_PARAM_PORTAL_TYPE:
+   return iscsi_switch_str_param(session-portal_type, buf);
+   case ISCSI_PARAM_DISCOVERY_PARENT_TYPE:
+   return iscsi_switch_str_param(session-discovery_parent_type,
+ buf);
default:
return -ENOSYS;
}
@@ -3326,6 +3339,52 @@ int iscsi_session_get_param(struct iscsi_cls_session 
*cls_session,
case ISCSI_PARAM_INITIATOR_NAME:
len = sprintf(buf, %s\n, session-initiatorname);
break;
+   case ISCSI_PARAM_AUTO_SND_TGT_DISABLE:
+   len = sprintf(buf, %u\n, session-auto_snd_tgt_disable);
+   break;
+   case ISCSI_PARAM_DISCOVERY_SESS:
+   len = sprintf(buf, %u\n, session-discovery_sess);
+   break;
+   case ISCSI_PARAM_PORTAL_TYPE:
+   len = sprintf(buf, %s\n, session-portal_type);
+   break;
+   case ISCSI_PARAM_CHAP_AUTH_EN:
+   len = sprintf(buf, %u\n, session-chap_auth_en);
+   break;
+   case ISCSI_PARAM_DISCOVERY_LOGOUT_EN:
+   len = sprintf(buf, %u\n, session-discovery_logout_en);
+   break;
+   case ISCSI_PARAM_BIDI_CHAP_EN:
+   len = sprintf(buf, %u\n, session-bidi_chap_en);
+   break;
+   case ISCSI_PARAM_DISCOVERY_AUTH_OPTIONAL:
+   len = sprintf(buf, %u\n, session-discovery_auth_optional);
+   break;
+   case ISCSI_PARAM_DEF_TIME2WAIT:
+   len = sprintf(buf, %d\n, session-time2wait);
+   break;
+   case ISCSI_PARAM_DEF_TIME2RETAIN:
+   len = sprintf(buf, %d\n, session-time2retain);
+   break;
+   case ISCSI_PARAM_TSID:
+   len = sprintf(buf, %u\n, session-tsid);
+   break;
+   case ISCSI_PARAM_ISID:
+   len = sprintf(buf, %02x%02x%02x%02x%02x%02x\n,
+ session-isid[0], session-isid[1],
+ session-isid[2], session-isid[3],
+ session-isid[4], session-isid[5]);
+   break;
+   case ISCSI_PARAM_DISCOVERY_PARENT_IDX:
+   len = sprintf(buf, %u\n, session-discovery_parent_idx);
+   break;
+   case ISCSI_PARAM_DISCOVERY_PARENT_TYPE:
+   if (session-discovery_parent_type)
+   len = sprintf(buf, %s\n,
+ session-discovery_parent_type);
+   else
+   len = sprintf(buf, \n);
+   break;
default:
return -ENOSYS;
}
@@ -3415,6 +3474,60 @@ int iscsi_conn_get_param(struct iscsi_cls_conn *cls_conn,
case ISCSI_PARAM_PERSISTENT_ADDRESS:
len = sprintf(buf, %s\n, conn-persistent_address);
break;
+   case ISCSI_PARAM_STATSN:
+   len = sprintf(buf, %u\n, conn-statsn);
+   

[PATCH 6/8] qla4xxx: Exporting new attrs for iscsi session and connection in sysfs

2013-05-09 Thread vikas.chaudhary
From: Adheer Chandravanshi adheer.chandravan...@qlogic.com

Signed-off-by: Adheer Chandravanshi adheer.chandravan...@qlogic.com
Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
---
 drivers/scsi/qla4xxx/ql4_os.c | 222 +++---
 1 file changed, 165 insertions(+), 57 deletions(-)

diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index 3313358..171c0e4 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -378,6 +378,47 @@ static umode_t qla4_attr_is_visible(int param_type, int 
param)
case ISCSI_PARAM_PASSWORD:
case ISCSI_PARAM_USERNAME_IN:
case ISCSI_PARAM_PASSWORD_IN:
+   case ISCSI_PARAM_AUTO_SND_TGT_DISABLE:
+   case ISCSI_PARAM_DISCOVERY_SESS:
+   case ISCSI_PARAM_PORTAL_TYPE:
+   case ISCSI_PARAM_CHAP_AUTH_EN:
+   case ISCSI_PARAM_DISCOVERY_LOGOUT_EN:
+   case ISCSI_PARAM_BIDI_CHAP_EN:
+   case ISCSI_PARAM_DISCOVERY_AUTH_OPTIONAL:
+   case ISCSI_PARAM_DEF_TIME2WAIT:
+   case ISCSI_PARAM_DEF_TIME2RETAIN:
+   case ISCSI_PARAM_HDRDGST_EN:
+   case ISCSI_PARAM_DATADGST_EN:
+   case ISCSI_PARAM_INITIAL_R2T_EN:
+   case ISCSI_PARAM_IMM_DATA_EN:
+   case ISCSI_PARAM_PDU_INORDER_EN:
+   case ISCSI_PARAM_DATASEQ_INORDER_EN:
+   case ISCSI_PARAM_SNACK_REQ_EN:
+   case ISCSI_PARAM_MAX_SEGMENT_SIZE:
+   case ISCSI_PARAM_TCP_TIMESTAMP_STAT:
+   case ISCSI_PARAM_TCP_WSF_DISABLE:
+   case ISCSI_PARAM_TCP_NAGLE_DISABLE:
+   case ISCSI_PARAM_TCP_TIMER_SCALE:
+   case ISCSI_PARAM_TCP_TIMESTAMP_EN:
+   case ISCSI_PARAM_TCP_XMIT_WSF:
+   case ISCSI_PARAM_TCP_RECV_WSF:
+   case ISCSI_PARAM_IP_FRAGMENT_DISABLE:
+   case ISCSI_PARAM_IPV4_TOS:
+   case ISCSI_PARAM_IPV6_TC:
+   case ISCSI_PARAM_IPV6_FLOW_LABEL:
+   case ISCSI_PARAM_IS_FW_ASSIGNED_IPV6:
+   case ISCSI_PARAM_LINK_LOCAL_IPV6:
+   case ISCSI_PARAM_REDIRECT_IPADDR:
+   case ISCSI_PARAM_KEEPALIVE_TMO:
+   case ISCSI_PARAM_LOCAL_PORT:
+   case ISCSI_PARAM_ISID:
+   case ISCSI_PARAM_TSID:
+   case ISCSI_PARAM_DEF_TASKMGMT_TMO:
+   case ISCSI_PARAM_ERL:
+   case ISCSI_PARAM_STATSN:
+   case ISCSI_PARAM_EXP_STATSN:
+   case ISCSI_PARAM_DISCOVERY_PARENT_IDX:
+   case ISCSI_PARAM_DISCOVERY_PARENT_TYPE:
return S_IRUGO;
default:
return 0;
@@ -3314,6 +3355,113 @@ static int qla4xxx_copy_to_fwddb_param(struct 
iscsi_bus_flash_session *sess,
return rc;
 }
 
+static void qla4xxx_copy_to_sess_conn_params(struct iscsi_conn *conn,
+struct iscsi_session *sess,
+struct dev_db_entry *fw_ddb_entry)
+{
+   unsigned long options = 0;
+   uint16_t ddb_link;
+   uint16_t disc_parent;
+   char ip_addr[DDB_IPADDR_LEN];
+
+   options = le16_to_cpu(fw_ddb_entry-options);
+   conn-is_fw_assigned_ipv6 = test_bit(OPT_IS_FW_ASSIGNED_IPV6, options);
+   sess-auto_snd_tgt_disable = test_bit(OPT_AUTO_SENDTGTS_DISABLE,
+ options);
+   sess-discovery_sess = test_bit(OPT_DISC_SESSION, options);
+
+   options = le16_to_cpu(fw_ddb_entry-iscsi_options);
+   conn-hdrdgst_en = test_bit(ISCSIOPT_HEADER_DIGEST_EN, options);
+   conn-datadgst_en = test_bit(ISCSIOPT_DATA_DIGEST_EN, options);
+   sess-imm_data_en = test_bit(ISCSIOPT_IMMEDIATE_DATA_EN, options);
+   sess-initial_r2t_en = test_bit(ISCSIOPT_INITIAL_R2T_EN, options);
+   sess-dataseq_inorder_en = test_bit(ISCSIOPT_DATA_SEQ_IN_ORDER,
+   options);
+   sess-pdu_inorder_en = test_bit(ISCSIOPT_DATA_PDU_IN_ORDER, options);
+   sess-chap_auth_en = test_bit(ISCSIOPT_CHAP_AUTH_EN, options);
+   conn-snack_req_en = test_bit(ISCSIOPT_SNACK_REQ_EN, options);
+   sess-discovery_logout_en = test_bit(ISCSIOPT_DISCOVERY_LOGOUT_EN,
+options);
+   sess-bidi_chap_en = test_bit(ISCSIOPT_BIDI_CHAP_EN, options);
+   sess-discovery_auth_optional =
+   test_bit(ISCSIOPT_DISCOVERY_AUTH_OPTIONAL, options);
+   if (test_bit(ISCSIOPT_ERL1, options))
+   sess-erl |= BIT_1;
+   if (test_bit(ISCSIOPT_ERL0, options))
+   sess-erl |= BIT_0;
+
+   options = le16_to_cpu(fw_ddb_entry-tcp_options);
+   conn-tcp_timestamp_stat = test_bit(TCPOPT_TIMESTAMP_STAT, options);
+   conn-tcp_nagle_disable = test_bit(TCPOPT_NAGLE_DISABLE, 

[PATCH 7/8] qla4xxx: Add support to allow flashnode multi-session login.

2013-05-09 Thread vikas.chaudhary
From: Manish Rangankar manish.rangan...@qlogic.com

Signed-off-by: Manish Rangankar manish.rangan...@qlogic.com
Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
---
 drivers/scsi/qla4xxx/ql4_os.c | 69 ++-
 1 file changed, 62 insertions(+), 7 deletions(-)

diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index 171c0e4..5271807 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -6977,17 +6977,72 @@ exit_login_st_clr_bit:
 }
 
 static int qla4xxx_ddb_login_nt(struct scsi_qla_host *ha,
-   struct dev_db_entry *fw_ddb_entry,
+   struct dev_db_entry *sfw_ddb_entry,
uint16_t idx)
 {
-   int ret = QLA_ERROR;
+   struct ql4_tuple_ddb *temp_tddb = NULL;
+   struct ql4_tuple_ddb *src_tddb = NULL;
+   struct ddb_entry *ddb_entry = NULL;
+   struct iscsi_session *session = NULL;
+   uint8_t is_isid_compare;
+   int ret = QLA_ERROR, status;
+   int i, max_ddbs;
 
-   ret = qla4xxx_is_session_exists(ha, fw_ddb_entry);
-   if (ret != QLA_SUCCESS)
-   ret = qla4xxx_sess_conn_setup(ha, fw_ddb_entry, RESET_ADAPTER,
+   max_ddbs =  is_qla40XX(ha) ? MAX_DEV_DB_ENTRIES_40XX :
+MAX_DEV_DB_ENTRIES;
+
+   src_tddb = vzalloc(sizeof(*src_tddb));
+   if (!src_tddb) {
+   ql4_printk(KERN_WARNING, ha, %s:Memory allocation failed\n,
+  __func__);
+   ret = -ENOMEM;
+   goto exit_ddb_login;
+   }
+
+   temp_tddb = vzalloc(sizeof(*temp_tddb));
+   if (!temp_tddb) {
+   ql4_printk(KERN_WARNING, ha, %s:Memory allocation failed\n,
+  __func__);
+   ret = -ENOMEM;
+   goto exit_ddb_login;
+   }
+
+   qla4xxx_convert_param_ddb(sfw_ddb_entry, src_tddb, NULL);
+
+   for (i = 0; i  max_ddbs; i++) {
+   ddb_entry = qla4xxx_lookup_ddb_by_fw_index(ha, i);
+   if (ddb_entry == NULL)
+   continue;
+
+   memset(temp_tddb, 0, sizeof(*temp_tddb));
+   qla4xxx_get_param_ddb(ddb_entry, temp_tddb);
+
+   if (ddb_entry-ddb_type != FLASH_DDB) {
+   is_isid_compare = false;
+   } else {
+   session = ddb_entry-sess-dd_data;
+   COPY_ISID(temp_tddb-isid, session-isid);
+   is_isid_compare = true;
+   }
+
+   status = qla4xxx_compare_tuple_ddb(ha, src_tddb, temp_tddb,
+  is_isid_compare);
+   if (status == QLA_SUCCESS) {
+   ret = -EEXIST;
+   goto exit_ddb_login;
+   } else {
+   continue;
+   }
+   }
+
+   if (i == max_ddbs)
+   ret = qla4xxx_sess_conn_setup(ha, sfw_ddb_entry, RESET_ADAPTER,
  idx);
-   else
-   ret = -EPERM;
+exit_ddb_login:
+   if (src_tddb)
+   vfree(src_tddb);
+   if (temp_tddb)
+   vfree(temp_tddb);
 
return ret;
 }
-- 
1.8.2.GIT


--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] qla4xxx: Fix iocb_cnt calculation in qla4xxx_send_mbox_iocb()

2013-05-02 Thread vikas.chaudhary
From: Vikas Chaudhary vikas.chaudh...@qlogic.com

Increment 'ha-iocb_cnt' before adding mbox_iocb to iocb queue.

Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
---
 drivers/scsi/qla4xxx/ql4_iocb.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/qla4xxx/ql4_iocb.c b/drivers/scsi/qla4xxx/ql4_iocb.c
index 14fec97..fad71ed 100644
--- a/drivers/scsi/qla4xxx/ql4_iocb.c
+++ b/drivers/scsi/qla4xxx/ql4_iocb.c
@@ -507,6 +507,7 @@ static int qla4xxx_send_mbox_iocb(struct scsi_qla_host *ha, 
struct mrb *mrb,
mrb-mbox_cmd = in_mbox[0];
wmb();
 
+   ha-iocb_cnt += mrb-iocb_cnt;
ha-isp_ops-queue_iocb(ha);
 exit_mbox_iocb:
spin_unlock_irqrestore(ha-hardware_lock, flags);
-- 
1.8.2.GIT


--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html