Skip to contentSkip to conversation

MegaRAID driver: remove kernel 2.0 and 2.2 code

PATCH In review Adrian Bunk 3 participants 5 messages Jan 18, 2003 – Jan 22, 2003

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

PATCH 1/1 MegaRAID driver: remove kernel 2.0 and 2.2 code

The patch below removes obsolete #if'd code for kernel 2.0 and 2.2 from drivers/scsi/megaraid.{h,c} (this includes the expansion of some #define's that were definded differently for different kernel versions).

I've tested the compilation with 2.5.59.

Please apply
Adrian

drivers/scsi/megaraid.h renamed from drivers/scsi/megaraid.h.old +1 -56
@@ -1,10 +1,6 @@
 #ifndef __MEGARAID_H__
 #define __MEGARAID_H__
 
-#ifndef LINUX_VERSION_CODE
-#include <linux/version.h>
-#endif
-
 /*
  * For state flag. Do not use LSB(8 bits) which are
  * reserved for storing info about channels.
@@ -180,31 +176,6 @@
 #define AMI_SIGNATURE_471	  	0xCCCC
 #define AMI_64BIT_SIGNATURE		0x0299
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,0)	/*0x20100 */
-#define MEGARAID \
-  { NULL,			      	/* Next				*/\
-    NULL,			        /* Usage Count Pointer		*/\
-    NULL,			       	/* proc Directory Entry		*/\
-    megaraid_proc_info,		 	/* proc Info Function		*/\
-    "MegaRAID",			 	/* Driver Name			*/\
-    megaraid_detect,		    	/* Detect Host Adapter		*/\
-    megaraid_release,		   	/* Release Host Adapter		*/\
-    megaraid_info,		      	/* Driver Info Function		*/\
-    megaraid_command,		   	/* Command Function		*/\
-    megaraid_queue,		     	/* Queue Command Function	*/\
-    megaraid_abort,		     	/* Abort Command Function	*/\
-    megaraid_reset,		     	/* Reset Command Function	*/\
-    NULL,			       	/* Slave Attach Function	*/\
-    megaraid_biosparam,		 	/* Disk BIOS Parameters		*/\
-    MAX_COMMANDS,		       	/* # of cmds that can be\
-					outstanding at any time		*/\
-    7,				  	/* HBA Target ID		*/\
-    MAX_SGLIST,			 	/* Scatter/Gather Table Size	*/\
-    MAX_CMD_PER_LUN,		    	/* SCSI Commands per LUN	*/\
-    0,				  	/* Present			*/\
-    0,				  	/* Default Unchecked ISA DMA	*/\
-    ENABLE_CLUSTERING }			/* Enable Clustering		*/
-#else
 #define MEGARAID \
   {\
     .name	    	= "MegaRAID",		/* Driver Name			*/\
@@ -224,7 +195,6 @@
     .use_clustering   	= ENABLE_CLUSTERING,  	/* Enable Clustering		*/\
 	.highmem_io		= 1,													\
   }
-#endif
 
 /***********************************************************************
  * Structure Declarations for the Firmware supporting 40 Logical Drives
@@ -470,14 +440,13 @@
 #define ENQ_FCLOOP_ACTIVE	1
 #define ENQ_FCLOOP_TRANSIENT	2
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
 #define M_RD_DMA_TYPE_NONE	      	0xFFFF
 #define M_RD_PTHRU_WITH_BULK_DATA   	0x0001
 #define M_RD_PTHRU_WITH_SGLIST	  	0x0002
 #define M_RD_BULK_DATA_ONLY	     	0x0004
 #define M_RD_SGLIST_ONLY		0x0008
 #define M_RD_EPTHRU_WITH_BULK_DATA   	0x0010
-#endif
+
 /********************************************
  * ENQUIRY3
  ********************************************/
@@ -663,7 +632,6 @@
 	u32 state;
 	u32 isrcount;
 	u8 mboxData[16];
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
 	u32 dma_type;
 	dma_addr_t dma_h_bulkdata;	/*Dma handle for bulk data transfter */
 	u32 dma_direction;	/*Dma direction */
@@ -675,16 +643,8 @@
 	dma_addr_t dma_ext_passthruhandle64;
 	dma_addr_t dma_bounce_buffer;
 	u8 *bounce_buffer;
-#endif
-
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
 	mega_passthru *pthru;
 	mega_ext_passthru *epthru;
-#else
-	mega_passthru pthru;
-	mega_ext_passthru epthru;
-#endif
-
 	Scsi_Cmnd *SCpnt;
 	mega_sglist *sgList;
 	mega_64sglist *sg64List;
@@ -713,10 +673,8 @@
 	u32 base;
 #endif
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
 	dma_addr_t dma_handle64, adjdmahandle64;
 	struct pci_dev *dev;
-#endif
 
 	mega_scb *qFreeH;
 	mega_scb *qFreeT;
@@ -748,12 +706,8 @@
 	volatile mega_mailbox64 *mbox64;	/* ptr to beginning of 64-bit mailbox */
 	volatile mega_mailbox *mbox;	/* ptr to beginning of standard mailbox */
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
 /* ptr to beginning of standard mailbox */
 	volatile mega_mailbox64 *mailbox64ptr;
-#else
-	volatile mega_mailbox64 mailbox64;
-#endif
 
 	volatile u8 mega_buffer[2 * 1024L];
 	volatile megaRaidProductInfo productInfo;
@@ -880,10 +834,6 @@
 #define MKADAP(adapno)	  	(MEGAIOC_MAGIC << 8 | (adapno) )
 #define GETADAP(mkadap)	 	( (mkadap) ^ MEGAIOC_MAGIC << 8 )
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0)	/*0x20300 */
-extern struct proc_dir_entry proc_scsi_megaraid;
-#endif
-
 /* For Host Re-Ordering */
 #define MAX_CONTROLLERS	32
 
@@ -968,11 +918,6 @@
 
 static int megaraid_reboot_notify (struct notifier_block *,
 				   unsigned long, void *);
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0)  
-static mega_scb *mega_ioctl (mega_host_config * megaCfg, Scsi_Cmnd * SCpnt);
-static void mega_build_kernel_sg (char *barea, ulong xfersize, mega_scb * pScb,
-			   mega_ioctl_mbox * mbox);
-#endif
 
 static int megadev_ioctl_entry (struct inode *, struct file *,
 				unsigned int, unsigned long);
drivers/scsi/megaraid.c renamed from drivers/scsi/megaraid.c.old +28 -878

1,669 lines not on this page · raw message

#1 lore raw
Quoted 5 lines · Adrian Bunk

The patch below removes obsolete #if'd code for kernel 2.0 and 2.2 from drivers/scsi/megaraid.{h,c} (this includes the expansion of some #define's that were definded differently for different kernel versions).

I've tested the compilation with 2.5.59.

AMI still issue 2.2 versions of this driver so its probably excessive (AMI ? -- LSI now I guess)

#2 lore raw
Quoted 9 lines · Alan
Quoted 5 lines · Adrian Bunk

The patch below removes obsolete #if'd code for kernel 2.0 and 2.2 from drivers/scsi/megaraid.{h,c} (this includes the expansion of some #define's that were definded differently for different kernel versions).

I've tested the compilation with 2.5.59.

AMI still issue 2.2 versions of this driver so its probably excessive (AMI ? -- LSI now I guess)

In megaraid.c IO_LOCK_IRQ and IO_UNLOCK_IRQ are only defined for >= 2.4 (they are present since 2.5.1-pre2) and the since Al Viro's kdev_t -> block_device * conversion you get a compile error when trying to use megaraid.{c,h} in 2.2.23.

If it's intended that this file is still used in kernels < 2.4 some changes are needed.

cu
Adrian

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed
#3 lore raw
Quoted 10 lines
Quoted 2 lines

AMI still issue 2.2 versions of this driver so its probably excessive (AMI ? -- LSI now I guess)

In megaraid.c IO_LOCK_IRQ and IO_UNLOCK_IRQ are only defined for >= 2.4 (they are present since 2.5.1-pre2) and the since Al Viro's kdev_t -> block_device * conversion you get a compile error when trying to use megaraid.{c,h} in 2.2.23.

If it's intended that this file is still used in kernels < 2.4 some changes are needed.

There are several branches of the megaraid driver available. (Un)fortunately, it's not one common source file anymore.

For 2.4.x, the driver in BK now (1.18g) is fine. This has the backward-compatability stuff for 2.2.x that isn't quite right, but patches on linux-megaraid-devel exist to make it sufficient. See January 2 archives at http://lists.us.dell.com.

For 2.5.x, the driver in BK now (1.18 + 2.5-specific fixes) should be superceeded by v2.00.2 at some point. This replaces the existing driver, and doesn't have backward compatability cruft. -ac and the OSDL patch set have this now (-ac has 2.00.1, minor update for really old iomapped controllers is needed). Since 2.00.2's release around the holidays I haven't heard of any problems with the driver - eventually someone needs to pull the trigger and submit the switch.

There's also a v2.00.2 specifically for kernel 2.4.x available that drops in alongside the existing megaraid, new one is 'megaraid2', to maintain stability.

Patches: http://domsch.com/linux/megaraid
BK: http://mdomsch.bkbits.net

Thanks,
Matt

Signature · 4 lines
Matt Domsch
Sr. Software Engineer, Lead Engineer, Architect
Dell Linux Solutions www.dell.com/linux
Linux on Dell mailing lists @ http://lists.us.dell.com
#4 lore raw
Quoted 1 line · Matt Domsch

For 2.4.x, the driver in BK now (1.18g) is fine.

Typo, that should be 1.18f is in BK and is fine.

-Matt

Signature · 4 lines
Matt Domsch
Sr. Software Engineer, Lead Engineer, Architect
Dell Linux Solutions www.dell.com/linux
Linux on Dell mailing lists @ http://lists.us.dell.com