Skip to contentSkip to conversation

scsi: Update Aic94xx SAS/SATA Linux open source device driver to add new PCI ID for HBA ASC58300.

PATCH New Gilbert Wu 2 participants 5 messages Aug 31, 2007 SCSI

lore
Share & tools
lore

Gilbert Wu

author
#0 lore raw

PATCH 1/1 scsi: Update Aic94xx SAS/SATA Linux open source device driver to add new PCI ID for HBA ASC58300.

Subject: [PATCH] scsi: Update Aic94xx SAS/SATA Linux open source device driver to add new PCI ID for HBA ASC58300.

Contribution:
Gilbert Wu <[email protected]>

Patch: apply to aic94xx-sas-2.6.git development tree

Change Log:

1. Add new HBA PCI ID for ASC58300 which has eight port SAS and SATA PCI-X 133MHz low profile host bus adapter with two mini SAS 4x external connectors.

diff -urN old/drivers/scsi/aic94xx/aic94xx_hwi.h
new/drivers/scsi/aic94xx/aic94xx_hwi.h

drivers/scsi/aic94xx/aic94xx_hwi.h +1 -0
@@ -45,6 +45,7 @@
  */
 #define PCI_DEVICE_ID_ADAPTEC2_RAZOR10 0x410
 #define PCI_DEVICE_ID_ADAPTEC2_RAZOR12 0x412
+#define PCI_DEVICE_ID_ADAPTEC2_RAZOR16 0x416
 #define PCI_DEVICE_ID_ADAPTEC2_RAZOR1E 0x41E
 #define PCI_DEVICE_ID_ADAPTEC2_RAZOR1F 0x41F
 #define PCI_DEVICE_ID_ADAPTEC2_RAZOR30 0x430
drivers/scsi/aic94xx/aic94xx_init.c +2 -0
diff -urN old/drivers/scsi/aic94xx/aic94xx_init.c new/drivers/scsi/aic94xx/aic94xx_init.c
@@ -835,6 +835,8 @@
 	 0, 0, 1},
 	{PCI_DEVICE(PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_RAZOR12),
 	 0, 0, 1},
+	{PCI_DEVICE(PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_RAZOR16),
+	 0, 0, 1},
 	{PCI_DEVICE(PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_RAZOR1E),
 	 0, 0, 1},
 	{PCI_DEVICE(PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_RAZOR1F),
#1 lore raw

PATCH 1/1 aic94xx: clean up PCI ID table per modern practice

Quoted 35 lines · Gilbert Wu

Subject: [PATCH] scsi: Update Aic94xx SAS/SATA Linux open source device driver to add new PCI ID for HBA ASC58300.

Contribution:
Gilbert Wu <[email protected]>

Patch: apply to aic94xx-sas-2.6.git development tree

Change Log:

1. Add new HBA PCI ID for ASC58300 which has eight port SAS and SATA PCI-X 133MHz low profile host bus adapter with two mini SAS 4x external connectors.

diff -urN old/drivers/scsi/aic94xx/aic94xx_hwi.h
new/drivers/scsi/aic94xx/aic94xx_hwi.h

drivers/scsi/aic94xx/aic94xx_hwi.h +1 -0
@@ -45,6 +45,7 @@
  */
 #define PCI_DEVICE_ID_ADAPTEC2_RAZOR10 0x410
 #define PCI_DEVICE_ID_ADAPTEC2_RAZOR12 0x412
+#define PCI_DEVICE_ID_ADAPTEC2_RAZOR16 0x416
 #define PCI_DEVICE_ID_ADAPTEC2_RAZOR1E 0x41E
 #define PCI_DEVICE_ID_ADAPTEC2_RAZOR1F 0x41F
 #define PCI_DEVICE_ID_ADAPTEC2_RAZOR30 0x430

diff -urN old/drivers/scsi/aic94xx/aic94xx_init.c new/drivers/scsi/aic94xx/aic94xx_init.c

drivers/scsi/aic94xx/aic94xx_init.c line 842

Quoted 8 lines
drivers/scsi/aic94xx/aic94xx_init.c +2 -0
@@ -835,6 +835,8 @@
 	 0, 0, 1},
 	{PCI_DEVICE(PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_RAZOR12),
 	 0, 0, 1},
+	{PCI_DEVICE(PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_RAZOR16),
+	 0, 0, 1},
 	{PCI_DEVICE(PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_RAZOR1E),
 	 0, 0, 1},
 	{PCI_DEVICE(PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_RAZOR1F),

ACK, but, really we need to delete all of PCI_DEVICE_ID_ADAPTEC2_* and replace them with the numeric (hex) constants, since they are only used in a single location.

The PCI device table in aic94xx_init should really look like... (see attached)

Much shorter, more maintainable, doesn't require patching the heavily-patched include/linux/pci_ids.h for single-use constants.

Jeff

drivers/scsi/aic94xx/aic94xx_hwi.h +0 -12
index c6c3d18..491e5d8 100644
@@ -40,18 +40,6 @@
 #define ASD_MAX_PHYS       8
 #define ASD_PCBA_SN_SIZE   12
 
-/* Those are to be further named properly, the "RAZORx" part, and
- * subsequently included in include/linux/pci_ids.h.
- */
-#define PCI_DEVICE_ID_ADAPTEC2_RAZOR10 0x410
-#define PCI_DEVICE_ID_ADAPTEC2_RAZOR12 0x412
-#define PCI_DEVICE_ID_ADAPTEC2_RAZOR1E 0x41E
-#define PCI_DEVICE_ID_ADAPTEC2_RAZOR1F 0x41F
-#define PCI_DEVICE_ID_ADAPTEC2_RAZOR30 0x430
-#define PCI_DEVICE_ID_ADAPTEC2_RAZOR32 0x432
-#define PCI_DEVICE_ID_ADAPTEC2_RAZOR3E 0x43E
-#define PCI_DEVICE_ID_ADAPTEC2_RAZOR3F 0x43F
-
 struct asd_ha_addrspace {
 	void __iomem  *addr;
 	unsigned long  start;       /* pci resource start */
drivers/scsi/aic94xx/aic94xx_init.c +10 -17
index 63bcde2..56ed89c 100644
@@ -829,23 +829,16 @@ static struct sas_domain_function_template aic94xx_transport_functions = {
 };
 
 static const struct pci_device_id aic94xx_pci_table[] __devinitdata = {
-	{PCI_DEVICE(PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_RAZOR10),
-	 0, 0, 1},
-	{PCI_DEVICE(PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_RAZOR12),
-	 0, 0, 1},
-	{PCI_DEVICE(PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_RAZOR1E),
-	 0, 0, 1},
-	{PCI_DEVICE(PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_RAZOR1F),
-	 0, 0, 1},
-	{PCI_DEVICE(PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_RAZOR30),
-	 0, 0, 2},
-	{PCI_DEVICE(PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_RAZOR32),
-	 0, 0, 2},
-	{PCI_DEVICE(PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_RAZOR3E),
-	 0, 0, 2},
-	{PCI_DEVICE(PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_RAZOR3F),
-	 0, 0, 2},
-	{}
+	{ PCI_VDEVICE(ADAPTEC2, 0x410), 1 },
+	{ PCI_VDEVICE(ADAPTEC2, 0x412), 1 },
+	{ PCI_VDEVICE(ADAPTEC2, 0x41E), 1 },
+	{ PCI_VDEVICE(ADAPTEC2, 0x41F), 1 },
+	{ PCI_VDEVICE(ADAPTEC2, 0x430), 2 },
+	{ PCI_VDEVICE(ADAPTEC2, 0x432), 2 },
+	{ PCI_VDEVICE(ADAPTEC2, 0x43E), 2 },
+	{ PCI_VDEVICE(ADAPTEC2, 0x43F), 2 },
+
+	{ }	/* terminate list */
 };
 
 MODULE_DEVICE_TABLE(pci, aic94xx_pci_table);
author
#2 lore raw

Re: [PATCH] aic94xx: clean up PCI ID table per modern practice

Quoted 49 lines · Jeff Garzik
Quoted 35 lines · Gilbert Wu

Subject: [PATCH] scsi: Update Aic94xx SAS/SATA Linux open source device driver to add new PCI ID for HBA ASC58300.

Contribution:
Gilbert Wu <[email protected]>

Patch: apply to aic94xx-sas-2.6.git development tree

Change Log:

1. Add new HBA PCI ID for ASC58300 which has eight port SAS and SATA PCI-X 133MHz low profile host bus adapter with two mini SAS 4x external connectors.

diff -urN old/drivers/scsi/aic94xx/aic94xx_hwi.h
new/drivers/scsi/aic94xx/aic94xx_hwi.h

drivers/scsi/aic94xx/aic94xx_hwi.h +1 -0
@@ -45,6 +45,7 @@
  */
 #define PCI_DEVICE_ID_ADAPTEC2_RAZOR10 0x410
 #define PCI_DEVICE_ID_ADAPTEC2_RAZOR12 0x412
+#define PCI_DEVICE_ID_ADAPTEC2_RAZOR16 0x416
 #define PCI_DEVICE_ID_ADAPTEC2_RAZOR1E 0x41E
 #define PCI_DEVICE_ID_ADAPTEC2_RAZOR1F 0x41F
 #define PCI_DEVICE_ID_ADAPTEC2_RAZOR30 0x430

diff -urN old/drivers/scsi/aic94xx/aic94xx_init.c new/drivers/scsi/aic94xx/aic94xx_init.c

drivers/scsi/aic94xx/aic94xx_init.c line 842

Quoted 8 lines
drivers/scsi/aic94xx/aic94xx_init.c +2 -0
@@ -835,6 +835,8 @@
 	 0, 0, 1},
 	{PCI_DEVICE(PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_RAZOR12),
 	 0, 0, 1},
+	{PCI_DEVICE(PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_RAZOR16),
+	 0, 0, 1},
 	{PCI_DEVICE(PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_RAZOR1E),
 	 0, 0, 1},
 	{PCI_DEVICE(PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_RAZOR1F),

ACK, but, really we need to delete all of PCI_DEVICE_ID_ADAPTEC2_* and replace them with the numeric (hex) constants, since they are only used in a single location.

Quoted 10 lines

The PCI device table in aic94xx_init should really look like... (see attached)

Much shorter, more maintainable, doesn't require patching the heavily-patched include/linux/pci_ids.h for single-use constants.

Jeff

Hi Jeff,

I don't think we will add new PCI id for aic94xx in the future. Even
the ASC58300 is introduced two years ago. We should move those ID into include/linux/pci_ids.h. We can change it next time.

Thanks!
Gilbert

#3 lore raw

Re: [PATCH] aic94xx: clean up PCI ID table per modern practice

Quoted 57 lines · Gilbert Wu
Quoted 46 lines · Jeff Garzik
Quoted 35 lines · Gilbert Wu

Subject: [PATCH] scsi: Update Aic94xx SAS/SATA Linux open source device driver to add new PCI ID for HBA ASC58300.

Contribution:
Gilbert Wu <[email protected]>

Patch: apply to aic94xx-sas-2.6.git development tree

Change Log:

1. Add new HBA PCI ID for ASC58300 which has eight port SAS and SATA PCI-X 133MHz low profile host bus adapter with two mini SAS 4x external connectors.

diff -urN old/drivers/scsi/aic94xx/aic94xx_hwi.h
new/drivers/scsi/aic94xx/aic94xx_hwi.h

drivers/scsi/aic94xx/aic94xx_hwi.h +1 -0
@@ -45,6 +45,7 @@
  */
 #define PCI_DEVICE_ID_ADAPTEC2_RAZOR10 0x410
 #define PCI_DEVICE_ID_ADAPTEC2_RAZOR12 0x412
+#define PCI_DEVICE_ID_ADAPTEC2_RAZOR16 0x416
 #define PCI_DEVICE_ID_ADAPTEC2_RAZOR1E 0x41E
 #define PCI_DEVICE_ID_ADAPTEC2_RAZOR1F 0x41F
 #define PCI_DEVICE_ID_ADAPTEC2_RAZOR30 0x430

diff -urN old/drivers/scsi/aic94xx/aic94xx_init.c new/drivers/scsi/aic94xx/aic94xx_init.c

drivers/scsi/aic94xx/aic94xx_init.c line 842

Quoted 8 lines
drivers/scsi/aic94xx/aic94xx_init.c +2 -0
@@ -835,6 +835,8 @@
 	 0, 0, 1},
 	{PCI_DEVICE(PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_RAZOR12),
 	 0, 0, 1},
+	{PCI_DEVICE(PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_RAZOR16),
+	 0, 0, 1},
 	{PCI_DEVICE(PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_RAZOR1E),
 	 0, 0, 1},
 	{PCI_DEVICE(PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_RAZOR1F),

ACK, but, really we need to delete all of PCI_DEVICE_ID_ADAPTEC2_* and replace them with the numeric (hex) constants, since they are only used in a single location.

Quoted 8 lines

The PCI device table in aic94xx_init should really look like... (see attached)

Much shorter, more maintainable, doesn't require patching the heavily-patched include/linux/pci_ids.h for single-use constants.

Jeff

Quoted 5 lines

Hi Jeff,

I don't think we will add new PCI id for aic94xx in the future. Even
the ASC58300 is introduced two years ago. We should move those ID into include/linux/pci_ids.h. We can change it next time.

This is standard kernel driver policy for many drivers. There's no need for the constants to exist at all, since they are only used in one place, and add no value at all over the numeric constants.

This is self-evident because the constants themselves are named based on the numeric values:

	..._RAZOR12	== 0x412
	..._RAZOR16	== 0x416
	etc.

Regards,

Jeff

author
#4 lore raw

Re: [PATCH] aic94xx: clean up PCI ID table per modern practice

Quoted 74 lines · Jeff Garzik
Quoted 61 lines · Gilbert Wu
Quoted 48 lines · Jeff Garzik
Quoted 35 lines · Gilbert Wu

Subject: [PATCH] scsi: Update Aic94xx SAS/SATA Linux open source device driver to add new PCI ID for HBA ASC58300.

Contribution:
Gilbert Wu <[email protected]>

Patch: apply to aic94xx-sas-2.6.git development tree

Change Log:

1. Add new HBA PCI ID for ASC58300 which has eight port SAS and SATA PCI-X 133MHz low profile host bus adapter with two mini SAS 4x external connectors.

diff -urN old/drivers/scsi/aic94xx/aic94xx_hwi.h
new/drivers/scsi/aic94xx/aic94xx_hwi.h

drivers/scsi/aic94xx/aic94xx_hwi.h +1 -0
@@ -45,6 +45,7 @@
  */
 #define PCI_DEVICE_ID_ADAPTEC2_RAZOR10 0x410
 #define PCI_DEVICE_ID_ADAPTEC2_RAZOR12 0x412
+#define PCI_DEVICE_ID_ADAPTEC2_RAZOR16 0x416
 #define PCI_DEVICE_ID_ADAPTEC2_RAZOR1E 0x41E
 #define PCI_DEVICE_ID_ADAPTEC2_RAZOR1F 0x41F
 #define PCI_DEVICE_ID_ADAPTEC2_RAZOR30 0x430

diff -urN old/drivers/scsi/aic94xx/aic94xx_init.c new/drivers/scsi/aic94xx/aic94xx_init.c

drivers/scsi/aic94xx/aic94xx_init.c line 842

Quoted 8 lines
drivers/scsi/aic94xx/aic94xx_init.c +2 -0
@@ -835,6 +835,8 @@
 	 0, 0, 1},
 	{PCI_DEVICE(PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_RAZOR12),
 	 0, 0, 1},
+	{PCI_DEVICE(PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_RAZOR16),
+	 0, 0, 1},
 	{PCI_DEVICE(PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_RAZOR1E),
 	 0, 0, 1},
 	{PCI_DEVICE(PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_RAZOR1F),

ACK, but, really we need to delete all of PCI_DEVICE_ID_ADAPTEC2_* and replace them with the numeric (hex) constants, since they are only used in a single location.

Quoted 10 lines

The PCI device table in aic94xx_init should really look like... (see attached)

Much shorter, more maintainable, doesn't require patching the heavily-patched include/linux/pci_ids.h for single-use constants.

Jeff

Quoted 5 lines

Hi Jeff,

I don't think we will add new PCI id for aic94xx in the future. Even
the ASC58300 is introduced two years ago. We should move those ID into include/linux/pci_ids.h. We can change it next time.

This is standard kernel driver policy for many drivers. There's no need for the constants to exist at all, since they are only used in one place, and add no value at all over the numeric constants.

This is self-evident because the constants themselves are named based on the numeric values:

Quoted 10 lines
	..._RAZOR12	== 0x412
	..._RAZOR16	== 0x416
	etc.

Regards,

Jeff

I understand it now.

Thanks!
Gilbert