Commit bdf79621 authored by 's avatar Committed by James Bottomley
Browse files

[PATCH] qla2xxx: remove lun discovery codes...



Remove internal lun discovery routines and support
structures.

Signed-off-by: default avatarAndrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 8482e118
Loading
Loading
Loading
Loading
+33 −18
Original line number Original line Diff line number Diff line
@@ -227,12 +227,17 @@ qla2x00_get_starget_node_name(struct scsi_target *starget)
{
{
	struct Scsi_Host *host = dev_to_shost(starget->dev.parent);
	struct Scsi_Host *host = dev_to_shost(starget->dev.parent);
	scsi_qla_host_t *ha = to_qla_host(host);
	scsi_qla_host_t *ha = to_qla_host(host);
        os_tgt_t *tq = (os_tgt_t *) TGT_Q(ha, starget->id);
	fc_port_t *fcport;
	uint64_t node_name = 0;
	uint64_t node_name = 0;


	if (tq->fcport)
	list_for_each_entry(fcport, &ha->fcports, list) {
		node_name = be64_to_cpu(*(uint64_t *)tq->fcport->node_name);
		if (starget->id == fcport->os_target_id) {
	fc_starget_node_name(starget) = node_name;
			node_name = *(uint64_t *)fcport->node_name;
			break;
		}
	}

	fc_starget_node_name(starget) = be64_to_cpu(node_name);
}
}


static void
static void
@@ -240,12 +245,17 @@ qla2x00_get_starget_port_name(struct scsi_target *starget)
{
{
	struct Scsi_Host *host = dev_to_shost(starget->dev.parent);
	struct Scsi_Host *host = dev_to_shost(starget->dev.parent);
	scsi_qla_host_t *ha = to_qla_host(host);
	scsi_qla_host_t *ha = to_qla_host(host);
        os_tgt_t *tq = (os_tgt_t *) TGT_Q(ha, starget->id);
	fc_port_t *fcport;
	uint64_t port_name = 0;
	uint64_t port_name = 0;


	if (tq->fcport)
	list_for_each_entry(fcport, &ha->fcports, list) {
		port_name = be64_to_cpu(*(uint64_t *)tq->fcport->port_name);
		if (starget->id == fcport->os_target_id) {
	fc_starget_port_name(starget) = port_name;
			port_name = *(uint64_t *)fcport->port_name;
			break;
		}
	}

	fc_starget_port_name(starget) = be64_to_cpu(port_name);
}
}


static void
static void
@@ -253,20 +263,25 @@ qla2x00_get_starget_port_id(struct scsi_target *starget)
{
{
	struct Scsi_Host *host = dev_to_shost(starget->dev.parent);
	struct Scsi_Host *host = dev_to_shost(starget->dev.parent);
	scsi_qla_host_t *ha = to_qla_host(host);
	scsi_qla_host_t *ha = to_qla_host(host);
        os_tgt_t *tq = (os_tgt_t *) TGT_Q(ha, starget->id);
	fc_port_t *fcport;
	uint32_t port_id = 0;
	uint32_t port_id = ~0U;

	list_for_each_entry(fcport, &ha->fcports, list) {
		if (starget->id == fcport->os_target_id) {
			port_id = fcport->d_id.b.domain << 16 |
			    fcport->d_id.b.area << 8 | fcport->d_id.b.al_pa;
			break;
		}
	}


	if (tq->fcport)
		port_id = tq->fcport->d_id.b.domain << 16 |
		    tq->fcport->d_id.b.area << 8 | tq->fcport->d_id.b.al_pa;
	fc_starget_port_id(starget) = port_id;
	fc_starget_port_id(starget) = port_id;
}
}


static void
static void
qla2x00_get_rport_loss_tmo(struct fc_rport *rport)
qla2x00_get_rport_loss_tmo(struct fc_rport *rport)
{
{
	os_tgt_t *tq = rport->dd_data;
	struct Scsi_Host *host = rport_to_shost(rport);
	scsi_qla_host_t *ha = tq->ha;
	scsi_qla_host_t *ha = to_qla_host(host);


	rport->dev_loss_tmo = ha->port_down_retry_count + 5;
	rport->dev_loss_tmo = ha->port_down_retry_count + 5;
}
}
@@ -274,8 +289,8 @@ qla2x00_get_rport_loss_tmo(struct fc_rport *rport)
static void
static void
qla2x00_set_rport_loss_tmo(struct fc_rport *rport, uint32_t timeout)
qla2x00_set_rport_loss_tmo(struct fc_rport *rport, uint32_t timeout)
{
{
	os_tgt_t *tq = rport->dd_data;
	struct Scsi_Host *host = rport_to_shost(rport);
	scsi_qla_host_t *ha = tq->ha;
	scsi_qla_host_t *ha = to_qla_host(host);


	if (timeout)
	if (timeout)
		ha->port_down_retry_count = timeout;
		ha->port_down_retry_count = timeout;
@@ -292,7 +307,7 @@ static struct fc_function_template qla2xxx_transport_functions = {
	.get_host_port_id = qla2x00_get_host_port_id,
	.get_host_port_id = qla2x00_get_host_port_id,
	.show_host_port_id = 1,
	.show_host_port_id = 1,


	.dd_fcrport_size = sizeof(os_tgt_t *),
	.dd_fcrport_size = sizeof(struct fc_port *),


	.get_starget_node_name = qla2x00_get_starget_node_name,
	.get_starget_node_name = qla2x00_get_starget_node_name,
	.show_starget_node_name = 1,
	.show_starget_node_name = 1,
+0 −5
Original line number Original line Diff line number Diff line
@@ -1065,11 +1065,6 @@ qla2x00_print_scsi_cmd(struct scsi_cmnd * cmd)
	printk("  sp flags=0x%x\n", sp->flags);
	printk("  sp flags=0x%x\n", sp->flags);
	printk("  r_start=0x%lx, u_start=0x%lx, f_start=0x%lx, state=%d\n",
	printk("  r_start=0x%lx, u_start=0x%lx, f_start=0x%lx, state=%d\n",
	    sp->r_start, sp->u_start, sp->f_start, sp->state);
	    sp->r_start, sp->u_start, sp->f_start, sp->state);

	printk(" e_start= 0x%lx, ext_history=%d, fo retry=%d, loopid=%x, "
	    "port path=%d\n", sp->e_start, sp->ext_history, sp->fo_retry_cnt,
	    sp->lun_queue->fclun->fcport->loop_id,
	    sp->lun_queue->fclun->fcport->cur_path);
}
}


#if defined(QL_DEBUG_ROUTINES)
#if defined(QL_DEBUG_ROUTINES)
+2 −101
Original line number Original line Diff line number Diff line
@@ -241,6 +241,7 @@ typedef struct srb {
	struct list_head list;
	struct list_head list;


	struct scsi_qla_host *ha;	/* HA the SP is queued on */
	struct scsi_qla_host *ha;	/* HA the SP is queued on */
	struct fc_port *fcport;


	struct scsi_cmnd *cmd;		/* Linux SCSI command pkt */
	struct scsi_cmnd *cmd;		/* Linux SCSI command pkt */


@@ -251,11 +252,6 @@ typedef struct srb {
	/* Request state */
	/* Request state */
	uint16_t state;
	uint16_t state;


	/* Target/LUN queue pointers. */
	struct os_tgt *tgt_queue;	/* ptr to visible ha's target */
	struct os_lun *lun_queue;	/* ptr to visible ha's lun */
	struct fc_lun *fclun;		/* FC LUN context pointer. */

	/* Timing counts. */
	/* Timing counts. */
	unsigned long e_start;		/* Start of extend timeout */
	unsigned long e_start;		/* Start of extend timeout */
	unsigned long r_start;		/* Start of request */
	unsigned long r_start;		/* Start of request */
@@ -1602,73 +1598,6 @@ typedef struct {
	rpt_lun_lst_t list;
	rpt_lun_lst_t list;
} rpt_lun_cmd_rsp_t;
} rpt_lun_cmd_rsp_t;


/*
 * SCSI Target Queue structure
 */
typedef struct os_tgt {
	struct os_lun *olun[MAX_LUNS]; /* LUN context pointer. */
	struct fc_port *fcport;
	unsigned long flags;
	uint8_t port_down_retry_count;
    	uint32_t down_timer;
	struct scsi_qla_host *ha;

	/* Persistent binding information */
	port_id_t d_id;
	uint8_t node_name[WWN_SIZE];
	uint8_t port_name[WWN_SIZE];
} os_tgt_t;

/*
 * SCSI Target Queue flags
 */
#define TQF_ONLINE		0		/* Device online to OS. */
#define TQF_SUSPENDED		1
#define TQF_RETRY_CMDS		2

/*
 * SCSI LUN Queue structure
 */
typedef struct os_lun {
	struct fc_lun *fclun;		/* FC LUN context pointer. */
    	spinlock_t q_lock;		/* Lun Lock */

	unsigned long q_flag;
#define LUN_MPIO_RESET_CNTS	1	/* Lun */
#define LUN_MPIO_BUSY		2	/* Lun is changing paths  */
#define LUN_EXEC_DELAYED	7	/* Lun execution is delayed */

	u_long q_timeout;		/* total command timeouts */
	atomic_t q_timer;		/* suspend timer */
	uint32_t q_count;		/* current count */
	uint32_t q_max;			/* maxmum count lun can be suspended */
	uint8_t q_state;		/* lun State */
#define LUN_STATE_READY		1	/* lun is ready for i/o */
#define LUN_STATE_RUN		2	/* lun has a timer running */
#define LUN_STATE_WAIT		3	/* lun is suspended */
#define LUN_STATE_TIMEOUT	4	/* lun has timed out */

	u_long io_cnt;			/* total xfer count since boot */
	u_long out_cnt;			/* total outstanding IO count */
	u_long w_cnt;			/* total writes */
	u_long r_cnt;			/* total reads */
	u_long avg_time;		/*  */
} os_lun_t;


/* LUN BitMask structure definition, array of 32bit words,
 * 1 bit per lun.  When bit == 1, the lun is masked.
 * Most significant bit of mask[0] is lun 0, bit 24 is lun 7.
 */
typedef struct lun_bit_mask {
	/* Must allocate at least enough bits to accomodate all LUNs */
#if ((MAX_FIBRE_LUNS & 0x7) == 0)
	uint8_t mask[MAX_FIBRE_LUNS >> 3];
#else
	uint8_t mask[(MAX_FIBRE_LUNS + 8) >> 3];
#endif
} lun_bit_mask_t;

/*
/*
 * Fibre channel port type.
 * Fibre channel port type.
 */
 */
@@ -1686,8 +1615,6 @@ typedef struct lun_bit_mask {
 */
 */
typedef struct fc_port {
typedef struct fc_port {
	struct list_head list;
	struct list_head list;
	struct list_head fcluns;

	struct scsi_qla_host *ha;
	struct scsi_qla_host *ha;
	struct scsi_qla_host *vis_ha;	/* only used when suspending lun */
	struct scsi_qla_host *vis_ha;	/* only used when suspending lun */


@@ -1702,8 +1629,7 @@ typedef struct fc_port {
	atomic_t state;
	atomic_t state;
	uint32_t flags;
	uint32_t flags;


	os_tgt_t *tgt_queue;
	unsigned int os_target_id;
	uint16_t os_target_id;


	uint16_t iodesc_idx_sent;
	uint16_t iodesc_idx_sent;


@@ -1717,7 +1643,6 @@ typedef struct fc_port {
	uint8_t mp_byte;		/* multi-path byte (not used) */
	uint8_t mp_byte;		/* multi-path byte (not used) */
    	uint8_t cur_path;		/* current path id */
    	uint8_t cur_path;		/* current path id */


	lun_bit_mask_t lun_mask;
	struct fc_rport *rport;
	struct fc_rport *rport;
} fc_port_t;
} fc_port_t;


@@ -1764,25 +1689,6 @@ typedef struct fc_port {
/* No loop ID flag. */
/* No loop ID flag. */
#define FC_NO_LOOP_ID		0x1000
#define FC_NO_LOOP_ID		0x1000


/*
 * Fibre channel LUN structure.
 */
typedef struct fc_lun {
        struct list_head list;

	fc_port_t *fcport;
	fc_port_t *o_fcport;
	uint16_t lun;
	atomic_t state;
	uint8_t device_type;

	uint8_t max_path_retries;
	uint32_t flags;
} fc_lun_t;

#define	FLF_VISIBLE_LUN		BIT_0
#define	FLF_ACTIVE_LUN		BIT_1

/*
/*
 * FC-CT interface
 * FC-CT interface
 *
 *
@@ -2253,9 +2159,6 @@ typedef struct scsi_qla_host {
	struct io_descriptor	io_descriptors[MAX_IO_DESCRIPTORS];
	struct io_descriptor	io_descriptors[MAX_IO_DESCRIPTORS];
	uint16_t		iodesc_signature;
	uint16_t		iodesc_signature;


	/* OS target queue pointers. */
	os_tgt_t		*otgt[MAX_FIBRE_DEVICES];

	/* RSCN queue. */
	/* RSCN queue. */
	uint32_t rscn_queue[MAX_RSCN_COUNT];
	uint32_t rscn_queue[MAX_RSCN_COUNT];
	uint8_t rscn_in_ptr;
	uint8_t rscn_in_ptr;
@@ -2400,8 +2303,6 @@ typedef struct scsi_qla_host {
#define LOOP_RDY(ha)	(!LOOP_NOT_READY(ha))
#define LOOP_RDY(ha)	(!LOOP_NOT_READY(ha))


#define TGT_Q(ha, t) (ha->otgt[t])
#define TGT_Q(ha, t) (ha->otgt[t])
#define LUN_Q(ha, t, l)	(TGT_Q(ha, t)->olun[l])
#define GET_LU_Q(ha, t, l) ((TGT_Q(ha,t) != NULL)? TGT_Q(ha, t)->olun[l] : NULL)


#define to_qla_host(x)		((scsi_qla_host_t *) (x)->hostdata)
#define to_qla_host(x)		((scsi_qla_host_t *) (x)->hostdata)


+1 −9
Original line number Original line Diff line number Diff line
@@ -45,8 +45,6 @@ extern void qla2x00_restart_queues(scsi_qla_host_t *, uint8_t);


extern void qla2x00_rescan_fcports(scsi_qla_host_t *);
extern void qla2x00_rescan_fcports(scsi_qla_host_t *);


extern void qla2x00_tgt_free(scsi_qla_host_t *ha, uint16_t t);

extern int qla2x00_abort_isp(scsi_qla_host_t *);
extern int qla2x00_abort_isp(scsi_qla_host_t *);


extern void qla2x00_reg_remote_port(scsi_qla_host_t *, fc_port_t *);
extern void qla2x00_reg_remote_port(scsi_qla_host_t *, fc_port_t *);
@@ -83,12 +81,6 @@ extern char *qla2x00_get_fw_version_str(struct scsi_qla_host *, char *);


extern void qla2x00_cmd_timeout(srb_t *);
extern void qla2x00_cmd_timeout(srb_t *);


extern int __qla2x00_suspend_lun(scsi_qla_host_t *, os_lun_t *, int, int, int);

extern void qla2x00_done(scsi_qla_host_t *);
extern void qla2x00_flush_failover_q(scsi_qla_host_t *, os_lun_t *);
extern void qla2x00_reset_lun_fo_counts(scsi_qla_host_t *, os_lun_t *);

extern void qla2x00_mark_device_lost(scsi_qla_host_t *, fc_port_t *, int);
extern void qla2x00_mark_device_lost(scsi_qla_host_t *, fc_port_t *, int);
extern void qla2x00_mark_all_devices_lost(scsi_qla_host_t *);
extern void qla2x00_mark_all_devices_lost(scsi_qla_host_t *);


@@ -149,7 +141,7 @@ qla2x00_abort_target(fc_port_t *fcport);
#endif
#endif


extern int
extern int
qla2x00_target_reset(scsi_qla_host_t *, uint16_t, uint16_t);
qla2x00_target_reset(scsi_qla_host_t *, struct fc_port *);


extern int
extern int
qla2x00_get_adapter_id(scsi_qla_host_t *, uint16_t *, uint8_t *, uint8_t *,
qla2x00_get_adapter_id(scsi_qla_host_t *, uint16_t *, uint8_t *, uint8_t *,
+16 −848

File changed.

Preview size limit exceeded, changes collapsed.

Loading