All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] allow building both megaraid and megraid_mbox
@ 2005-08-13 12:03 Pascal Terjan
  2005-08-15 10:15 ` Christoph Hellwig
  0 siblings, 1 reply; 2+ messages in thread
From: Pascal Terjan @ 2005-08-13 12:03 UTC (permalink / raw)
  To: linux-scsi

[-- Attachment #1: Type: text/plain, Size: 326 bytes --]

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

[-- Attachment #2: megaraid-common_ids.patch --]
[-- Type: text/x-patch, Size: 2114 bytes --]

diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c
--- a/drivers/scsi/megaraid.c
+++ b/drivers/scsi/megaraid.c
@@ -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);
diff --git a/drivers/scsi/megaraid/Kconfig.megaraid b/drivers/scsi/megaraid/Kconfig.megaraid
--- a/drivers/scsi/megaraid/Kconfig.megaraid
+++ b/drivers/scsi/megaraid/Kconfig.megaraid
@@ -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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] allow building both megaraid and megraid_mbox
  2005-08-13 12:03 [PATCH] allow building both megaraid and megraid_mbox Pascal Terjan
@ 2005-08-15 10:15 ` Christoph Hellwig
  0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2005-08-15 10:15 UTC (permalink / raw)
  To: Pascal Terjan; +Cc: linux-scsi, sreenib, sju

On Sat, Aug 13, 2005 at 02:03:01PM +0200, Pascal Terjan wrote:
> 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?

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-08-15 10:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-13 12:03 [PATCH] allow building both megaraid and megraid_mbox Pascal Terjan
2005-08-15 10:15 ` Christoph Hellwig

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.