Skip to contentSkip to conversation

PATCH [7/15] qla2xxx: Misc. updates with FO resync

PATCH Andrew Vasquez 1 participant 1 message Mar 14, 2004

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

ChangeSet
1.1663 04/03/01 14:21:11 [email protected] +5 -0 Misc. updates due to resync with non-embedded (failover-aware) driver.

o Add ancillary support definitions.
o Remove extraneous *_IOCTL #ifs.
o Make qla2x00_cmd_timeout() and its support routines visible to the non-embedded driver.

 drivers/scsi/qla2xxx/qla_def.h    |   24 +++++--
 drivers/scsi/qla2xxx/qla_gbl.h    |   10 ---
 drivers/scsi/qla2xxx/qla_init.c   |    9 +-
 drivers/scsi/qla2xxx/qla_inline.h |   49 +++++++++++++++
 drivers/scsi/qla2xxx/qla_os.c     |  117 ++------------------------------------
 5 files changed, 82 insertions(+), 127 deletions(-)

ftp://ftp.qlogic.com/outgoing/linux/patches/8.x/8.00.00b11k/16_misc_updates.patch

drivers/scsi/qla2xxx/qla_def.h +17 -7
diff -Nru a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
@@ -1526,7 +1526,7 @@
 /*
  * Inquiry command structure.
  */
-#define INQ_DATA_SIZE	8
+#define INQ_DATA_SIZE	36
 
 /*
  * Inquiry mailbox IOCB packet definition.
@@ -1580,7 +1580,7 @@
 typedef struct os_tgt {
 	struct os_lun *olun[MAX_LUNS]; /* LUN context pointer. */
 	struct fc_port *fcport;
-	uint32_t flags;
+	unsigned long flags;
 	uint8_t port_down_retry_count;
     	uint32_t down_timer;
 	struct scsi_qla_host *ha;
@@ -1594,10 +1594,9 @@
 /*
  * SCSI Target Queue flags
  */
-#define TQF_QUEUE_SUSPENDED	BIT_0		/* Queue suspended. */
-#define TQF_BOOT_DEVICE		BIT_1		/* Boot device. */
-#define TQF_ONLINE		BIT_2		/* Device online to OS. */
-#define TQF_TGT_RST_NEEDED	BIT_3
+#define TQF_ONLINE		0		/* Device online to OS. */
+#define TQF_SUSPENDED		1
+#define TQF_RETRY_CMDS		2
 
 /*
  * SCSI LUN Queue structure
@@ -1723,6 +1722,12 @@
 #define FCF_RLC_SUPPORT		BIT_14
 #define FCF_CONFIG		BIT_15	/* Needed? */
 #define FCF_RESCAN_NEEDED	BIT_16
+#define FCF_XP_DEVICE		BIT_17
+#define FCF_MSA_DEVICE		BIT_18
+#define FCF_EVA_DEVICE		BIT_19
+#define FCF_MSA_PORT_ACTIVE	BIT_20
+#define FCF_FAILBACK_DISABLE	BIT_21
+#define FCF_FAILOVER_DISABLE	BIT_22
 
 /* No loop ID flag. */
 #define FC_NO_LOOP_ID		0x1000
@@ -1738,9 +1743,13 @@
 	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
@@ -2079,6 +2088,7 @@
 #define ISP_ABORT_RETRY         20      /* ISP aborted. */
 #define FCPORT_RESCAN_NEEDED	21      /* IO descriptor processing needed */
 #define IODESC_PROCESS_NEEDED	22      /* IO descriptor processing needed */
+#define IOCTL_ERROR_RECOVERY	23      
 
 	uint32_t	device_flags;
 #define DFLG_LOCAL_DEVICES		BIT_0
@@ -2295,6 +2305,7 @@
 	uint32_t failback_delay;
 	unsigned long   cfg_flags;
 #define	CFG_ACTIVE	0	/* CFG during a failover, event update, or ioctl */
+#define	CFG_FAILOVER	1	/* CFG during path change */
 
 	uint32_t	binding_type;
 #define BIND_BY_PORT_NAME	0
@@ -2327,7 +2338,6 @@
 #define BINZERO		"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
 	char		*model_desc;
 
-/* following are new and needed for IOCTL support */
 	uint8_t     node_name[WWN_SIZE];
 	uint8_t     nvram_version; 
 	uint8_t     optrom_major; 
drivers/scsi/qla2xxx/qla_gbl.h +2 -8
diff -Nru a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h
@@ -78,6 +78,8 @@
 
 extern char *qla2x00_get_fw_version_str(struct scsi_qla_host *, char *);
 
+extern void qla2x00_cmd_timeout(srb_t *);
+
 extern int qla2x00_queuecommand(struct scsi_cmnd *,
     void (*)(struct scsi_cmnd *));
 
@@ -295,16 +297,8 @@
 /*
  * Global Function Prototypes in qla_xioctl.c source file.
  */
-#ifdef CONFIG_SCSI_QLA2XXX_IOCTL
-extern void qla2x00_enqueue_aen(scsi_qla_host_t *, uint16_t, void *);
-extern int qla2x00_alloc_ioctl_mem(scsi_qla_host_t *);
-extern void qla2x00_free_ioctl_mem(scsi_qla_host_t *);
-extern int qla2x00_get_ioctl_scrap_mem(scsi_qla_host_t *, void **, uint32_t);
-extern void qla2x00_free_ioctl_scrap_mem(scsi_qla_host_t *);
-#else
 #define qla2x00_enqueue_aen(ha, cmd, mode)	do { } while (0)
 #define qla2x00_alloc_ioctl_mem(ha)		(0)
 #define qla2x00_free_ioctl_mem(ha)		do { } while (0)
-#endif
 
 #endif /* _QLA_GBL_H */
drivers/scsi/qla2xxx/qla_init.c +5 -4
diff -Nru a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
@@ -2103,6 +2103,7 @@
 	case TYPE_MEDIUM_CHANGER:
 	case TYPE_ENCLOSURE:
 	case 0x20:
+	case 0x0C:
 		break;
 	case TYPE_TAPE:
 		fcport->flags |= FCF_TAPE_PRESENT;
@@ -3175,7 +3176,6 @@
 		qla2x00_done(ha);
 }
 
-//FIXME - Document
 void
 qla2x00_rescan_fcports(scsi_qla_host_t *ha)
 {
@@ -3194,8 +3194,9 @@
 	}
 
 	/* Update OS target and lun structures if necessary. */
-	if (rescan_done)
+	if (rescan_done) {
 		qla2x00_config_os(ha);
+	}
 }
 
 
@@ -3222,7 +3223,7 @@
 		if ((tq = TGT_Q(ha, tgt)) == NULL)
 			continue;
 
-		tq->flags &= ~TQF_ONLINE;
+		clear_bit(TQF_ONLINE, &tq->flags);
 	}
 
 	list_for_each_entry(fcport, &ha->fcports, list) {
@@ -3324,7 +3325,7 @@
 		fcport->tgt_queue = tq;
 		fcport->flags |= FCF_PERSISTENT_BOUND;
 		tq->fcport = fcport;
-		tq->flags |= TQF_ONLINE;
+		set_bit(TQF_ONLINE, &tq->flags);
 		tq->port_down_retry_count = ha->port_down_retry_count;
 
 #if 0
drivers/scsi/qla2xxx/qla_inline.h +49 -0

52 lines not on this page · raw message

drivers/scsi/qla2xxx/qla_os.c +9 -108

160 lines not on this page · raw message