Re: [PATCH 09/11] qla2xxx: Added interface to send ELS commands from driver.

2015-07-07 Thread James Bottomley
On Fri, 2015-07-03 at 09:14 -0700, Christoph Hellwig wrote:
 Why is this a binary attribute?  Needs an interface specific in
 Documentation/ABI/ to start with, and a Ccto stable seems very
 aggressive.

Right, adding an interface isn't a bug fix.

Can you separate this into patches which are essential bug fixes, which
can go immediately and those which are enhancements which wait for the
merge window?

Thanks,

James


--
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


Re: [PATCH 09/11] qla2xxx: Added interface to send ELS commands from driver.

2015-07-03 Thread Christoph Hellwig
Why is this a binary attribute?  Needs an interface specific in
Documentation/ABI/ to start with, and a Ccto stable seems very
aggressive.

--
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/11] qla2xxx: Added interface to send ELS commands from driver.

2015-06-25 Thread Himanshu Madhani
Cc: sta...@vger.kernel.org
Signed-off-by: Himanshu Madhani himanshu.madh...@qlogic.com
Signed-off-by: Giridhar Malavali giridhar.malav...@qlogic.com
---
 drivers/scsi/qla2xxx/qla_attr.c   |   36 +++
 drivers/scsi/qla2xxx/qla_dbg.c|5 +-
 drivers/scsi/qla2xxx/qla_def.h|   19 -
 drivers/scsi/qla2xxx/qla_gbl.h|2 +
 drivers/scsi/qla2xxx/qla_inline.h |2 +
 drivers/scsi/qla2xxx/qla_iocb.c   |  189 +
 drivers/scsi/qla2xxx/qla_isr.c|6 +
 7 files changed, 255 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c
index 437254e..129b266 100644
--- a/drivers/scsi/qla2xxx/qla_attr.c
+++ b/drivers/scsi/qla2xxx/qla_attr.c
@@ -824,6 +824,41 @@ static struct bin_attribute sysfs_reset_attr = {
 };
 
 static ssize_t
+qla2x00_issue_logo(struct file *filp, struct kobject *kobj,
+   struct bin_attribute *bin_attr,
+   char *buf, loff_t off, size_t count)
+{
+   struct scsi_qla_host *vha = shost_priv(dev_to_shost(container_of(kobj,
+   struct device, kobj)));
+   int type;
+   int rval = 0;
+   port_id_t did;
+
+   type = simple_strtol(buf, NULL, 10);
+
+   did.b.domain = (type  0x00ff)  16;
+   did.b.area = (type  0xff00)  8;
+   did.b.al_pa = (type  0x00ff);
+
+   ql_log(ql_log_info, vha, 0x70e3, portid=%02x%02x%02x done\n,
+   did.b.domain, did.b.area, did.b.al_pa);
+
+   ql_log(ql_log_info, vha, 0x70e4, %s: %d\n, __func__, type);
+
+   rval = qla24xx_els_dcmd_iocb(vha, ELS_DCMD_LOGO, did);
+   return count;
+}
+
+static struct bin_attribute sysfs_issue_logo_attr = {
+   .attr = {
+   .name = issue_logo,
+   .mode = S_IWUSR,
+   },
+   .size = 0,
+   .write = qla2x00_issue_logo,
+};
+
+static ssize_t
 qla2x00_sysfs_read_xgmac_stats(struct file *filp, struct kobject *kobj,
   struct bin_attribute *bin_attr,
   char *buf, loff_t off, size_t count)
@@ -939,6 +974,7 @@ static struct sysfs_entry {
{ vpd, sysfs_vpd_attr, 1 },
{ sfp, sysfs_sfp_attr, 1 },
{ reset, sysfs_reset_attr, },
+   { issue_logo, sysfs_issue_logo_attr, },
{ xgmac_stats, sysfs_xgmac_stats_attr, 3 },
{ dcbx_tlv, sysfs_dcbx_tlv_attr, 3 },
{ NULL },
diff --git a/drivers/scsi/qla2xxx/qla_dbg.c b/drivers/scsi/qla2xxx/qla_dbg.c
index 8b011ae..d242fdf 100644
--- a/drivers/scsi/qla2xxx/qla_dbg.c
+++ b/drivers/scsi/qla2xxx/qla_dbg.c
@@ -19,7 +19,7 @@
  * | Device Discovery |   0x2016   | 0x2020-0x2022, |
  * |  || 0x2011-0x2012, |
  * |  || 0x2099-0x20a4  |
- * | Queue Command and IO tracing |   0x3059   | 0x300b |
+ * | Queue Command and IO tracing |   0x3074   | 0x300b |
  * |  || 0x3027-0x3028  |
  * |  || 0x303d-0x3041  |
  * |  || 0x302d,0x3033  |
@@ -27,12 +27,11 @@
  * |  || 0x303a
|
  * | DPC Thread   |   0x4023   | 0x4002,0x4013  |
  * | Async Events |   0x5087   | 0x502b-0x502f  |
- * |  || 0x5047
|
  * |  || 0x5084,0x5075 |
  * |  || 0x503d,0x5044  |
  * |  || 0x507b,0x505f |
  * | Timer Routines   |   0x6012   ||
- * | User Space Interactions  |   0x70e2   | 0x7018,0x702e  |
+ * | User Space Interactions  |   0x70e65  | 0x7018,0x702e  |
  * | || 0x7020,0x7024  |
  * |  || 0x7039,0x7045  |
  * |  || 0x7073-0x7075  |
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
index 4a7aadc..12a78b9 100644
--- a/drivers/scsi/qla2xxx/qla_def.h
+++ b/drivers/scsi/qla2xxx/qla_def.h
@@ -309,6 +309,14 @@ struct srb_cmd {
 /* To identify if a srb is of T10-CRC type. @sp = srb_t pointer */
 #define IS_PROT_IO(sp) (sp-flags  SRB_CRC_CTX_DSD_VALID)
 
+struct els_logo_payload {
+   uint8_t opcode;
+   uint8_t rsvd[3];
+   uint8_t s_id[3];
+   uint8_t rsvd1[1];
+   uint8_t wwpn[WWN_SIZE];
+};
+
 /*
  * SRB extensions.
  */
@@ -322,6 +330,15 @@ struct srb_iocb {
uint16_t data[2];
} logio;
struct {
+#define ELS_DCMD_TIMEOUT 20
+#define ELS_DCMD_LOGO 0x5
+   uint32_t flags;
+