Skip to contentSkip to conversation

Sync up drivers/scsi/aic7xxx

PATCH In review Luben Tuikov 1 participant 1 message Sep 28, 2004 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH 20/28 Sync up drivers/scsi/aic7xxx

Sync up drivers/scsi/aic7xxx/. (2660-2666)

==== //depot/aic7xxx/aic7xxx/aic79xx.h#104 - /home/luben/projects/linux/2.6/linux-2.5/drivers/scsi/aic7xxx/aic79xx.h ====

home/luben/projects/linux/2.6/linux-2.5/drivers/scsi/aic7xxx/aic79xx.h renamed from tmp/tmp.27079.0 +7 -3
@@ -37,7 +37,7 @@
  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGES.
  *
- * $Id: //depot/aic7xxx/aic7xxx/aic79xx.h#104 $
+ * $Id: //depot/aic7xxx/aic7xxx/aic79xx.h#105 $
  *
  * $FreeBSD$
  */
@@ -201,6 +201,8 @@
 #define AHD_BUSRESET_DELAY	25
 
 /******************* Chip Characteristics/Operating Settings  *****************/
+extern int ahd_attach_to_HostRAID_controllers;
+
 /*
  * Chip Type
  * The chip order is from least sophisticated to most sophisticated.
@@ -375,7 +377,8 @@
 	AHD_UPDATE_PEND_CMDS  = 0x400000,
 	AHD_RUNNING_QOUTFIFO  = 0x800000,
 	AHD_HAD_FIRST_SEL     = 0x1000000,
-	AHD_SHUTDOWN_RECOVERY = 0x2000000 /* Terminate recovery thread. */
+	AHD_SHUTDOWN_RECOVERY = 0x2000000, /* Terminate recovery thread. */
+	AHD_HOSTRAID_BOARD    = 0x4000000
 } ahd_flag;
 
 /************************* Hardware  SCB Definition ***************************/
@@ -1061,7 +1064,8 @@
 struct ahd_completion
 {
 	uint16_t	tag;
-	uint8_t		pad[5];
+	uint8_t		sg_status;
+	uint8_t		pad[4];
 	uint8_t		valid_tag;
 };
 

==== //depot/aic7xxx/aic7xxx/aic79xx.seq#116 - /home/luben/projects/linux/2.6/linux-2.5/drivers/scsi/aic7xxx/aic79xx.seq ====

home/luben/projects/linux/2.6/linux-2.5/drivers/scsi/aic7xxx/aic79xx.seq renamed from tmp/tmp.27079.1 +3 -2
@@ -40,7 +40,7 @@
  * $FreeBSD$
  */
 
-VERSION = "$Id: //depot/aic7xxx/aic7xxx/aic79xx.seq#116 $"
+VERSION = "$Id: //depot/aic7xxx/aic7xxx/aic79xx.seq#117 $"
 PATCH_ARG_LIST = "struct ahd_softc *ahd"
 PREFIX = "ahd_"
 
@@ -367,7 +367,8 @@
 	bmov	SCBPTR, COMPLETE_SCB_HEAD, 2;
 fill_qoutfifo_loop:
 	bmov	CCSCBRAM, SCBPTR, 2;
-	bmov	CCSCBRAM, ALLZEROS, 5;
+	mov	CCSCBRAM, SCB_SGPTR[0];
+	bmov	CCSCBRAM, ALLZEROS, 4;
 	mov	CCSCBRAM, QOUTFIFO_ENTRY_VALID_TAG;
 	mov	NONE, SDSCB_QOFF;
 	inc	INT_COALESCING_CMDCOUNT;

==== //depot/aic7xxx/aic7xxx/aic79xx.c#232 - /home/luben/projects/linux/2.6/linux-2.5/drivers/scsi/aic7xxx/aic79xx_core.c ====

home/luben/projects/linux/2.6/linux-2.5/drivers/scsi/aic7xxx/aic79xx_core.c renamed from tmp/tmp.27079.2 +21 -7
@@ -37,7 +37,7 @@
  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGES.
  *
- * $Id: //depot/aic7xxx/aic7xxx/aic79xx.c#232 $
+ * $Id: //depot/aic7xxx/aic7xxx/aic79xx.c#236 $
  */
 
 #ifdef __linux__
@@ -54,6 +54,7 @@
 
 /******************************** Globals *************************************/
 struct ahd_softc_tailq ahd_tailq = TAILQ_HEAD_INITIALIZER(ahd_tailq);
+int ahd_attach_to_HostRAID_controllers = 1;
 
 /***************************** Lookup Tables **********************************/
 char *ahd_chip_names[] =
@@ -826,6 +827,16 @@
 	}
 }
 
+/*
+ * Look for entries in the QoutFIFO that have completed.
+ * The valid_tag completion field indicates the validity
+ * of the entry - the valid value toggles each time through
+ * the queue. We use the sg_status field in the completion
+ * entry to avoid referencing the hscb if the completion
+ * occurred with no errors and no residual.  sg_status is
+ * a copy of the first byte (little endian) of the sgptr
+ * hscb field.
+ */
 void
 ahd_run_qoutfifo(struct ahd_softc *ahd)
 {
@@ -851,8 +862,11 @@
 			       ahd_name(ahd), scb_index,
 			       ahd->qoutfifonext);
 			ahd_dump_card_state(ahd);
-		} else
-			ahd_complete_scb(ahd, scb);
+		} else if ((completion->sg_status & SG_STATUS_VALID) != 0) {
+			ahd_handle_scb_status(ahd, scb);
+		} else {
+			ahd_done(ahd, scb);
+		}
 
 		ahd->qoutfifonext = (ahd->qoutfifonext+1) & (AHD_QOUT_SIZE-1);
 		if (ahd->qoutfifonext == 0)
@@ -6296,7 +6310,7 @@
 	ahd->qoutfifo = (struct ahd_completion *)ahd->shared_data_map.vaddr;
 	next_vaddr = (uint8_t *)&ahd->qoutfifo[AHD_QOUT_SIZE];
 	next_baddr = ahd->shared_data_map.busaddr
-		   + AHD_QOUT_SIZE*sizeof(uint16_t);
+		   + AHD_QOUT_SIZE*sizeof(struct ahd_completion);
 	if ((ahd->features & AHD_TARGETMODE) != 0) {
 		ahd->targetcmds = (struct target_cmd *)next_vaddr;
 		next_vaddr += AHD_TMODE_CMDS * sizeof(struct target_cmd);
@@ -7491,7 +7505,7 @@
 	u_int	prev;
 	int	found;
 
-	AHD_ASSERT_MODES(ahd, AHD_MODE_CCHAN_MSK, AHD_MODE_CCHAN_MSK);
+	AHD_ASSERT_MODES(ahd, AHD_MODE_SCSI_MSK, AHD_MODE_SCSI_MSK);
 	found = 0;
 	prev = SCB_LIST_NULL;
 	next = *list_head;
@@ -7558,7 +7572,7 @@
 ahd_stitch_tid_list(struct ahd_softc *ahd, u_int tid_prev,
 		    u_int tid_cur, u_int tid_next)
 {
-	AHD_ASSERT_MODES(ahd, AHD_MODE_CCHAN_MSK, AHD_MODE_CCHAN_MSK);
+	AHD_ASSERT_MODES(ahd, AHD_MODE_SCSI_MSK, AHD_MODE_SCSI_MSK);
 
 	if (SCBID_IS_NULL(tid_cur)) {
 
@@ -7598,7 +7612,7 @@
 {
 	u_int tail_offset;
 
-	AHD_ASSERT_MODES(ahd, AHD_MODE_CCHAN_MSK, AHD_MODE_CCHAN_MSK);
+	AHD_ASSERT_MODES(ahd, AHD_MODE_SCSI_MSK, AHD_MODE_SCSI_MSK);
 	if (!SCBID_IS_NULL(prev)) {
 		ahd_set_scbptr(ahd, prev);
 		ahd_outw(ahd, SCB_NEXT, next);

==== //depot/aic7xxx/aic7xxx/aic79xx_pci.c#84 - /home/luben/projects/linux/2.6/linux-2.5/drivers/scsi/aic7xxx/aic79xx_pci.c ====

home/luben/projects/linux/2.6/linux-2.5/drivers/scsi/aic7xxx/aic79xx_pci.c renamed from tmp/tmp.27079.3 +20 -2
@@ -38,7 +38,7 @@
  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGES.
  *
- * $Id: //depot/aic7xxx/aic7xxx/aic79xx_pci.c#84 $
+ * $Id: //depot/aic7xxx/aic7xxx/aic79xx_pci.c#85 $
  */
 
 #ifdef __linux__
@@ -92,10 +92,11 @@
 #define ID_AIC7902_PCI_REV_B0		0x10
 #define SUBID_HP			0x0E11
 
+#define DEVID_9005_HOSTRAID(id) ((id) & 0x80)
+
 #define DEVID_9005_TYPE(id) ((id) & 0xF)
 #define		DEVID_9005_TYPE_HBA		0x0	/* Standard Card */
 #define		DEVID_9005_TYPE_HBA_2EXT	0x1	/* 2 External Ports */
-#define		DEVID_9005_TYPE_IROC		0x8	/* Raid(0,1,10) Card */
 #define		DEVID_9005_TYPE_MB		0xF	/* On Motherboard */
 
 #define DEVID_9005_MFUNC(id) ((id) & 0x10)
@@ -282,6 +283,14 @@
 				 subdevice,
 				 subvendor);
 
+	/*
+	 * If we are configured to attach to HostRAID
+	 * controllers, mask out the IROC/HostRAID bit
+	 * in the
+	 */
+	if (ahd_attach_to_HostRAID_controllers)
+		full_id &= ID_ALL_IROC_MASK;
+
 	for (i = 0; i < ahd_num_pci_devs; i++) {
 		entry = &ahd_pci_ident_table[i];
 		if (entry->full_id == (full_id & entry->id_mask)) {
@@ -301,12 +310,21 @@
 	u_long		 l;
 	u_int		 command;
 	uint32_t	 devconfig;
+	uint16_t	 device;
 	uint16_t	 subvendor;
 	int		 error;
 
 	shared_scb_data = NULL;
 	ahd->description = entry->name;
 	/*
+	 * Record if this is a HostRAID board.
+	 */
+	device = aic_pci_read_config(ahd->dev_softc,
+				     PCIR_DEVICE, /*bytes*/2);
+	if (DEVID_9005_HOSTRAID(device))
+		ahd->flags |= AHD_HOSTRAID_BOARD;
+
+	/*
 	 * Record if this is an HP board.
 	 */
 	subvendor = aic_pci_read_config(ahd->dev_softc,

==== //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic79xx_reg.h#82 - /home/luben/projects/linux/2.6/linux-2.5/drivers/scsi/aic7xxx/aic79xx_reg.h_shipped ====

home/luben/projects/linux/2.6/linux-2.5/drivers/scsi/aic7xxx/aic79xx_reg.h_shipped renamed from tmp/tmp.27079.4 +3 -3
@@ -2,7 +2,7 @@
  * DO NOT EDIT - This file is automatically generated
  *		 from the following source files:
  *
- * $Id: //depot/aic7xxx/aic7xxx/aic79xx.seq#114 $
+ * $Id: //depot/aic7xxx/aic7xxx/aic79xx.seq#117 $
  * $Id: //depot/aic7xxx/aic7xxx/aic79xx.reg#75 $
  */
 typedef int (ahd_reg_print_t)(u_int, u_int *, u_int);
@@ -3799,5 +3799,5 @@
 
 
 /* Exported Labels */
-#define	LABEL_seq_isr 	0x281
-#define	LABEL_timer_isr	0x27d
+#define	LABEL_seq_isr 	0x282
+#define	LABEL_timer_isr	0x27e

==== //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic79xx_reg_print.c#63 - /home/luben/projects/linux/2.6/linux-2.5/drivers/scsi/aic7xxx/aic79xx_reg_print.c_shipped ====

home/luben/projects/linux/2.6/linux-2.5/drivers/scsi/aic7xxx/aic79xx_reg_print.c_shipped renamed from tmp/tmp.27079.5 +1 -1
@@ -2,7 +2,7 @@
  * DO NOT EDIT - This file is automatically generated
  *		 from the following source files:
  *
- * $Id: //depot/aic7xxx/aic7xxx/aic79xx.seq#114 $
+ * $Id: //depot/aic7xxx/aic7xxx/aic79xx.seq#117 $
  * $Id: //depot/aic7xxx/aic7xxx/aic79xx.reg#75 $
  */
 

==== //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic79xx_seq.h#83 - /home/luben/projects/linux/2.6/linux-2.5/drivers/scsi/aic7xxx/aic79xx_seq.h_shipped ====

home/luben/projects/linux/2.6/linux-2.5/drivers/scsi/aic7xxx/aic79xx_seq.h_shipped renamed from tmp/tmp.27079.6 +428 -428

1,228 lines not on this page · raw message