Skip to contentSkip to conversation

allow building both megaraid and megraid_mbox

PATCH In review Pascal Terjan 2 participants 2 messages Aug 13, 2005 – Aug 15, 2005

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

PATCH 1/1 allow building both megaraid and megraid_mbox

Hello,
here is a small patch that allow building both drivers by removing the devices supported by the new driver from the id_table of the old driver when you want both.
It is usefull for distributions wanting to keep supporting legacy hardware.

What's you opinion about that problem and the fix ?

Thanks in advance,
Pascal

drivers/scsi/megaraid.c +9 -4
@@ -30,6 +30,7 @@
  *
  */
 
+#include <linux/config.h>
 #include <linux/mm.h>
 #include <linux/fs.h>
 #include <linux/blkdev.h>
@@ -5014,22 +5015,26 @@ megaraid_shutdown(struct pci_dev *pdev)
 }
 
 static struct pci_device_id megaraid_pci_tbl[] = {
+#if !defined(CONFIG_MEGARAID_MAILBOX) && !defined(CONFIG_MEGARAID_MAILBOX_MODULE)
+	/* If the new Megaraid driver is built, only support the adapters
+	 * it doesn't support itself */
 	{PCI_VENDOR_ID_DELL, PCI_DEVICE_ID_DISCOVERY,
 		PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
 	{PCI_VENDOR_ID_DELL, PCI_DEVICE_ID_PERC4_DI,
 		PCI_ANY_ID, PCI_ANY_ID, 0, 0, BOARD_64BIT},
 	{PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_PERC4_QC_VERDE,
 		PCI_ANY_ID, PCI_ANY_ID, 0, 0, BOARD_64BIT},
+	{PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_AMI_MEGARAID3,
+		PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
+	{PCI_VENDOR_ID_AMI, PCI_DEVICE_ID_AMI_MEGARAID3,
+		PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
+#endif
 	{PCI_VENDOR_ID_AMI, PCI_DEVICE_ID_AMI_MEGARAID,
 		PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
 	{PCI_VENDOR_ID_AMI, PCI_DEVICE_ID_AMI_MEGARAID2,
 		PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
-	{PCI_VENDOR_ID_AMI, PCI_DEVICE_ID_AMI_MEGARAID3,
-		PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
 	{PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_AMI_MEGARAID3,
 		PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
-	{PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_AMI_MEGARAID3,
-		PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
 	{0,}
 };
 MODULE_DEVICE_TABLE(pci, megaraid_pci_tbl);
drivers/scsi/megaraid/Kconfig.megaraid +0 -2
@@ -64,7 +64,6 @@ config MEGARAID_MAILBOX
 	To compile this driver as a module, choose M here: the
 	module will be called megaraid_mbox
 
-if MEGARAID_NEWGEN=n
 config MEGARAID_LEGACY
 	tristate "LSI Logic Legacy MegaRAID Driver"
 	depends on PCI && SCSI
@@ -75,4 +74,3 @@ config MEGARAID_LEGACY
 
 	To compile this driver as a module, choose M here: the
 	module will be called megaraid
-endif
#1 lore raw
Quoted 8 lines · Pascal Terjan

Hello,
here is a small patch that allow building both drivers by removing the devices supported by the new driver from the id_table of the old driver when you want both.
It is usefull for distributions wanting to keep supporting legacy hardware.

What's you opinion about that problem and the fix ?

Given that the new megaraid_mbox driver works nicely I suggest to:

- remove all but the two PCI ids not support by megaraid_mbox from the old driver
- rename the old module to megaraid_legacy so people don't use it by accident
- remove all code dealing with more recent controllers from the old driver. Unfortunately the checks for different types of hardware are implicit in the driver and not keyed of the PCI IDs. Sreenivas and Seokmann, could you help us with identifying the codepathes only used by recent hardware that we can remove from the legacy driver?