Skip to contentSkip to conversation

mpt fusion: Add support for ATTO 4LD: Rebranded LSI 53C1030

PATCH In review Eric Moore 2 participants 4 messages Aug 14, 2007 – Aug 18, 2007

Subsystems (2)
lore
Share & tools
lore

Eric Moore

author
#0 lore raw

PATCH 1/6 mpt fusion: Add support for ATTO 4LD: Rebranded LSI 53C1030

Per request from Matthew Wilcox - using PCI_VENDOR_ATTO.

Add support for ATTO UL4D, they are rebranded 53C1030.
The changes are
1. Adding a new PCI vendor ID in pci table
2. The spi_port_page_2 is in different format than that of LSI generic spi_port_page_2 and hence mapping code is added.

drivers/message/fusion/Kconfig +1 -0
diff -uarpN b/drivers/message/fusion/Kconfig a/drivers/message/fusion/Kconfig
@@ -20,6 +20,7 @@ config FUSION_SPI
 	  LSI53C1020A
 	  LSI53C1030
 	  LSI53C1035
+	  ATTO UL4D
 
 config FUSION_FC
 	tristate "Fusion MPT ScsiHost drivers for FC"
drivers/message/fusion/mptbase.c +32 -0
diff -uarpN b/drivers/message/fusion/mptbase.c a/drivers/message/fusion/mptbase.c
@@ -4888,6 +4888,38 @@ mpt_GetScsiPortSettings(MPT_ADAPTER *ioc
 				/* Nvram data is left with INVALID mark
 				 */
 				rc = 1;
+			} else if (ioc->pcidev->vendor == PCI_VENDOR_ID_ATTO) {
+
+				/* This is an ATTO adapter, read Page2 accordingly
+				*/
+				ATTO_SCSIPortPage2_t *pPP2 = (ATTO_SCSIPortPage2_t  *) pbuf;
+				ATTODeviceInfo_t *pdevice = NULL;
+				u16 ATTOFlags;
+
+				/* Save the Port Page 2 data
+				 * (reformat into a 32bit quantity)
+				 */
+				for (ii=0; ii < MPT_MAX_SCSI_DEVICES; ii++) {
+				  pdevice = &pPP2->DeviceSettings[ii];
+				  ATTOFlags = le16_to_cpu(pdevice->ATTOFlags);
+				  data = 0;
+
+				  /* Translate ATTO device flags to LSI format
+				   */
+				  if (ATTOFlags & ATTOFLAG_DISC)
+				    data |= (MPI_SCSIPORTPAGE2_DEVICE_DISCONNECT_ENABLE);
+				  if (ATTOFlags & ATTOFLAG_ID_ENB)
+				    data |= (MPI_SCSIPORTPAGE2_DEVICE_ID_SCAN_ENABLE);
+				  if (ATTOFlags & ATTOFLAG_LUN_ENB)
+				    data |= (MPI_SCSIPORTPAGE2_DEVICE_LUN_SCAN_ENABLE);
+				  if (ATTOFlags & ATTOFLAG_TAGGED)
+				    data |= (MPI_SCSIPORTPAGE2_DEVICE_TAG_QUEUE_ENABLE);
+				  if (!(ATTOFlags & ATTOFLAG_WIDE_ENB))
+				    data |= (MPI_SCSIPORTPAGE2_DEVICE_WIDE_DISABLE);
+
+				  data = (data << 16) | (pdevice->Period << 8) | 10;
+				  ioc->spi_data.nvram[ii] = data;
+				}
 			} else {
 				SCSIPortPage2_t *pPP2 = (SCSIPortPage2_t  *) pbuf;
 				MpiDeviceInfo_t	*pdevice = NULL;
drivers/message/fusion/mptbase.h +29 -0
diff -uarpN b/drivers/message/fusion/mptbase.h a/drivers/message/fusion/mptbase.h
@@ -194,6 +194,35 @@
 
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 /*
+ *  ATTO UL4D associated structures and defines
+ */
+#define ATTOFLAG_DISC     0x0001
+#define ATTOFLAG_TAGGED   0x0002
+#define ATTOFLAG_WIDE_ENB 0x0008
+#define ATTOFLAG_ID_ENB   0x0010
+#define ATTOFLAG_LUN_ENB  0x0060
+
+typedef struct _ATTO_DEVICE_INFO
+{
+	u8	Offset;					/* 00h */
+	u8	Period;					/* 01h */
+	u16	ATTOFlags;				/* 02h */
+} ATTO_DEVICE_INFO, MPI_POINTER PTR_ATTO_DEVICE_INFO,
+  ATTODeviceInfo_t, MPI_POINTER pATTODeviceInfo_t;
+
+typedef struct _ATTO_CONFIG_PAGE_SCSI_PORT_2
+{
+	CONFIG_PAGE_HEADER	Header;			/* 00h */
+	u16			PortFlags;		/* 04h */
+	u16			Unused1;		/* 06h */
+	u32			Unused2;		/* 08h */
+	ATTO_DEVICE_INFO	DeviceSettings[16];	/* 0Ch */
+} fATTO_CONFIG_PAGE_SCSI_PORT_2, MPI_POINTER PTR_ATTO_CONFIG_PAGE_SCSI_PORT_2,
+  ATTO_SCSIPortPage2_t, MPI_POINTER pATTO_SCSIPortPage2_t;
+
+
+/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
+/*
  *  MPT protocol driver defs...
  */
 typedef enum {
drivers/message/fusion/mptspi.c +2 -0
diff -uarpN b/drivers/message/fusion/mptspi.c a/drivers/message/fusion/mptspi.c
@@ -1190,6 +1190,8 @@ static struct spi_function_template mpts
 static struct pci_device_id mptspi_pci_table[] = {
 	{ PCI_VENDOR_ID_LSI_LOGIC, MPI_MANUFACTPAGE_DEVID_53C1030,
 		PCI_ANY_ID, PCI_ANY_ID },
+	{ PCI_VENDOR_ID_ATTO, MPI_MANUFACTPAGE_DEVID_53C1030,
+		PCI_ANY_ID, PCI_ANY_ID },
 	{ PCI_VENDOR_ID_LSI_LOGIC, MPI_MANUFACTPAGE_DEVID_53C1035,
 		PCI_ANY_ID, PCI_ANY_ID },
 	{0}	/* Terminating entry */
#1 lore raw

Hello Eric ,

Quoted 7 lines · Eric Moore

Per request from Matthew Wilcox - using PCI_VENDOR_ATTO.

Add support for ATTO UL4D, they are rebranded 53C1030.
The changes are
1. Adding a new PCI vendor ID in pci table
2. The spi_port_page_2 is in different format than that of LSI generic spi_port_page_2 and hence mapping code is added.

Having a ul4d I decided to try out the patch you provided . But ...

root@(none):/usr/src/linux-2.6.22.1-iop1 # patch -p1 < ~/atto-ul4d-mptfusion.patch
patching file drivers/message/fusion/Kconfig
patching file drivers/message/fusion/mptbase.c
Hunk #1 succeeded at 4653 (offset -235 lines).
patching file drivers/message/fusion/mptbase.h
Hunk #1 succeeded at 193 (offset -1 lines).
patching file drivers/message/fusion/mptspi.c
Hunk #1 succeeded at 1189 (offset -1 lines).

root@(none):/usr/src/linux-2.6.22.1-iop1 # ( time make V=1 KBUILD_VERBOSE=1 INSTALL_PATH=/boot clean all install modules_install ) 2>&1 | tee ../linux-2.6.22.1c-reiser-xfs-lmsensors-EMMENSE-DEBUGGING_minus-I_oat-W_iop-patches-atto-ul4d-patch.log
...snip...
make -f scripts/Makefile.build obj=drivers/message
make -f scripts/Makefile.build obj=drivers/message/fusion
gcc -m32 -Wp,-MD,drivers/message/fusion/.mptbase.o.d -nostdinc -isystem
/usr/lib/gcc/i486-slackware-linux/3.4.6/include -D__KERNEL__ -Iinclude -include include/linux/autoconf.h -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -O2 -pipe -msoft-float -mregparm=3 -freg-struct-return -mpreferred-stack-boundary=2 -fno-unit-at-a-time -march=i686 -ffreestanding -maccumulate-outgoing-args -DCONFIG_AS_CFI=1 -Iinclude/asm-i386/mach-default -fno-omit-frame-pointer -fno-optimize-sibling-calls -g -Wdeclaration-after-statement -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(mptbase)" -D"KBUILD_MODNAME=KBUILD_STR(mptbase)" -c -o drivers/message/fusion/mptbase.o drivers/message/fusion/mptbase.c drivers/message/fusion/mptbase.c: In function `mpt_GetScsiPortSettings':
drivers/message/fusion/mptbase.c:4656: error: `PCI_VENDOR_ID_ATTO' undeclared (first use in this function)
drivers/message/fusion/mptbase.c:4656: error: (Each undeclared identifier is reported only once
drivers/message/fusion/mptbase.c:4656: error: for each function it appears in.)
make[3]: *** [drivers/message/fusion/mptbase.o] Error 1
make[2]: *** [drivers/message/fusion] Error 2
make[1]: *** [drivers/message] Error 2
make: *** [drivers] Error 2

root@(none):/usr/src/linux # scripts/ver_linux
If some fields are empty or look unusual you may have an old version. Compare to the current minimal requirements in Documentation/Changes.

Linux (none) 2.6.21.5 #3 SMP Thu Jul 26 03:58:54 UTC 2007 i686 pentium4 i386 GNU/Linux

Gnu C                  3.4.6
Gnu make               3.81
binutils               2.15.92.0.2
util-linux             2.12r
mount                  2.12r
module-init-tools      3.2.2
e2fsprogs              1.38
jfsutils               1.1.11
reiserfsprogs          3.6.19
xfsprogs               2.8.10
pcmciautils            014
pcmcia-cs              3.2.8
quota-tools            3.13.
PPP                    2.4.4
Linux C Library        2.3.6
Dynamic linker (ldd)   2.3.6
Linux C++ Library      6.0.3
Procps                 3.2.7
Net-tools              1.60
Kbd                    1.12
oprofile               0.9.1
Sh-utils               5.97
udev                   097

Modules Loaded

Signature · 5 lines
+-----------------------------------------------------------------+
| James   W.   Laferriere | System   Techniques | Give me VMS     |
| Network        Engineer | 663  Beaumont  Blvd |  Give me Linux  |
| [email protected] | Pacifica, CA. 94044 |   only  on  AXP |
+-----------------------------------------------------------------+
#2 lore raw
Quoted 11 lines · Mr. James W. Laferriere

drivers/message/fusion/mptbase.c:4656: error:
`PCI_VENDOR_ID_ATTO' undeclared (first use in this function) drivers/message/fusion/mptbase.c:4656: error: (Each undeclared identifier is reported only once drivers/message/fusion/mptbase.c:4656: error: for each function it appears in.)
make[3]: *** [drivers/message/fusion/mptbase.o] Error 1 make[2]: *** [drivers/message/fusion] Error 2 make[1]: *** [drivers/message] Error 2
make: *** [drivers] Error 2

Why aren't you not doing a pull on the scsi-misc git tree? Your missing another patch I posted which updated the include/linux/pci_ids.h, having the PCI_VENDOR_ID_ATTO declared.

#3 lore raw

Hello Eric ,

Quoted 13 lines · Eric
Quoted 11 lines · Mr. James W. Laferriere

drivers/message/fusion/mptbase.c:4656: error:
`PCI_VENDOR_ID_ATTO' undeclared (first use in this function) drivers/message/fusion/mptbase.c:4656: error: (Each undeclared identifier is reported only once drivers/message/fusion/mptbase.c:4656: error: for each function it appears in.)
make[3]: *** [drivers/message/fusion/mptbase.o] Error 1 make[2]: *** [drivers/message/fusion] Error 2 make[1]: *** [drivers/message] Error 2
make: *** [drivers] Error 2

Quoted 1 line

Why aren't you not doing a pull on the scsi-misc git tree?

Because there is never (that I've found) a mention of the git tree in
any (not just yours) patches submitted . I really do wish that patches pull/push-ed from/to a particular git/svn/cvs tree included the location of the tree when posted to a community list . This would (imo) really cut down on the , 'Where is this at' ?'s . It appears that most maintainers ass-u-me that everyone reading a list knows everything s/he knows & does leaves out alot of assume'd data that a casual reader may have to do a great deal of digging to find .

Quoted 3 lines

Your missing
another patch I posted which updated the include/linux/pci_ids.h, having the PCI_VENDOR_ID_ATTO declared.

Cool , I'll do a pull for this .
Tnx , JimL

Signature · 5 lines
+-----------------------------------------------------------------+
| James   W.   Laferriere | System   Techniques | Give me VMS     |
| Network        Engineer | 663  Beaumont  Blvd |  Give me Linux  |
| [email protected] | Pacifica, CA. 94044 |   only  on  AXP |
+-----------------------------------------------------------------+