Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6eb54715 authored by Himanshu Madhani's avatar Himanshu Madhani Committed by Nicholas Bellinger
Browse files

qla2xxx: Added interface to send explicit LOGO.



This patch adds interface to send explicit LOGO
explicit LOGO using using ELS commands from driver.

Signed-off-by: default avatarHimanshu Madhani <himanshu.madhani@qlogic.com>
Signed-off-by: default avatarGiridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
parent 03e8c680
Loading
Loading
Loading
Loading
+36 −0
Original line number Diff line number Diff line
@@ -823,6 +823,41 @@ static struct bin_attribute sysfs_reset_attr = {
	.write = qla2x00_sysfs_write_reset,
};

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 & 0x00ff0000) >> 16;
	did.b.area = (type & 0x0000ff00) >> 8;
	did.b.al_pa = (type & 0x000000ff);

	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,
@@ -937,6 +972,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 },
+2 −3
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@
 * | Device Discovery             |       0x2016       | 0x2020-0x2022, |
 * |                              |                    | 0x2011-0x2012, |
 * |                              |                    | 0x2099-0x20a4  |
 * | Queue Command and IO tracing |       0x3075       | 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                 |       0x508a       | 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  |
+18 −1
Original line number Diff line number Diff line
@@ -310,6 +310,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.
 */
@@ -323,6 +331,15 @@ struct srb_iocb {
			uint16_t data[2];
		} logio;
		struct {
#define ELS_DCMD_TIMEOUT 20
#define ELS_DCMD_LOGO 0x5
			uint32_t flags;
			uint32_t els_cmd;
			struct completion comp;
			struct els_logo_payload *els_logo_pyld;
			dma_addr_t els_logo_pyld_dma;
		} els_logo;
		struct {
			/*
			 * Values for flags field below are as
			 * defined in tsk_mgmt_entry struct
@@ -383,7 +400,7 @@ struct srb_iocb {
#define SRB_FXIOCB_DCMD	10
#define SRB_FXIOCB_BCMD	11
#define SRB_ABT_CMD	12

#define SRB_ELS_DCMD	13

typedef struct srb {
	atomic_t ref_count;
+2 −0
Original line number Diff line number Diff line
@@ -44,6 +44,8 @@ extern int qla2x00_find_new_loop_id(scsi_qla_host_t *, fc_port_t *);
extern int qla2x00_fabric_login(scsi_qla_host_t *, fc_port_t *, uint16_t *);
extern int qla2x00_local_device_login(scsi_qla_host_t *, fc_port_t *);

extern int qla24xx_els_dcmd_iocb(scsi_qla_host_t *, int, port_id_t);

extern void qla2x00_update_fcports(scsi_qla_host_t *);

extern int qla2x00_abort_isp(scsi_qla_host_t *);
+2 −0
Original line number Diff line number Diff line
@@ -258,6 +258,8 @@ qla2x00_init_timer(srb_t *sp, unsigned long tmo)
	if ((IS_QLAFX00(sp->fcport->vha->hw)) &&
	    (sp->type == SRB_FXIOCB_DCMD))
		init_completion(&sp->u.iocb_cmd.u.fxiocb.fxiocb_comp);
	if (sp->type == SRB_ELS_DCMD)
		init_completion(&sp->u.iocb_cmd.u.els_logo.comp);
}

static inline int
Loading