[PATCH] Domex 3192U PCI SCSI support and minor ini9100u.c clean-up...

Brian Macy (bmacy@sunshinecomputing.com)
Tue, 19 Jan 1999 11:19:08 -0800


This is a multi-part message in MIME format.

------=_NextPart_000_0037_01BE439D.890C3E40
Content-Type: text/plain;
charset="Windows-1252"
Content-Transfer-Encoding: 7bit

Here's the patch as an attachment (hopefully no one minds the attachment).
Anyways the detection loops being copied was annoying me as I went to copy
another 14lines of code to add support for Vendor 0x134a and Device Id
0x0002. So I added a table. Anyways, this driver is still a mess but at
least this gets rid of a few lines of code :)

Brian Macy

------=_NextPart_000_0037_01BE439D.890C3E40
Content-Type: application/octet-stream;
name="ini9100u.pat"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="ini9100u.pat"

--- orig/ini9100u.c Tue Jan 19 10:37:21 1999=0A=
+++ ini9100u.c Tue Jan 19 11:10:46 1999=0A=
@@ -247,6 +247,19 @@=0A=
/* ---- EXTERNAL VARIABLES ---- */=0A=
extern HCS tul_hcs[];=0A=
=0A=
+struct id {=0A=
+ int vendor_id;=0A=
+ int device_id;=0A=
+};=0A=
+=0A=
+const struct id id_table[] =3D {=0A=
+ { INI_VENDOR_ID, I950_DEVICE_ID },=0A=
+ { INI_VENDOR_ID, I940_DEVICE_ID },=0A=
+ { INI_VENDOR_ID, I935_DEVICE_ID },=0A=
+ { INI_VENDOR_ID, 0x0002 },=0A=
+ { DMX_VENDOR_ID, 0x0002 },=0A=
+};=0A=
+=0A=
/*=0A=
* queue services:=0A=
*/=0A=
@@ -338,64 +351,27 @@=0A=
int iAdapters =3D 0;=0A=
long dRegValue;=0A=
WORD wBIOS;=0A=
+ const int iNumIdEntries =3D sizeof(id_table)/sizeof(id_table[0]);=0A=
+ int i =3D 0;=0A=
=0A=
init_i91uAdapter_table();=0A=
=0A=
- while ((pDev =3D pci_find_device(INI_VENDOR_ID, I950_DEVICE_ID, pDev)) =
!=3D NULL) {=0A=
- pci_read_config_dword(pDev, 0x44, (u32 *) & dRegValue);=0A=
- wBIOS =3D (UWORD) (dRegValue & 0xFF);=0A=
- if (((dRegValue & 0xFF00) >> 8) =3D=3D 0xFF)=0A=
- dRegValue =3D 0;=0A=
- wBIOS =3D (wBIOS << 8) + ((UWORD) ((dRegValue & 0xFF00) >> 8));=0A=
- if (Addi91u_into_Adapter_table(wBIOS,=0A=
- (pDev->base_address[0] & 0xFFFE),=0A=
- pDev->irq,=0A=
- pDev->bus->number,=0A=
- (pDev->devfn >> 3)=0A=
- ) =3D=3D 0)=0A=
- iAdapters++;=0A=
- }=0A=
- while ((pDev =3D pci_find_device(INI_VENDOR_ID, I940_DEVICE_ID, pDev)) =
!=3D NULL) {=0A=
- pci_read_config_dword(pDev, 0x44, (u32 *) & dRegValue);=0A=
- wBIOS =3D (UWORD) (dRegValue & 0xFF);=0A=
- if (((dRegValue & 0xFF00) >> 8) =3D=3D 0xFF)=0A=
- dRegValue =3D 0;=0A=
- wBIOS =3D (wBIOS << 8) + ((UWORD) ((dRegValue & 0xFF00) >> 8));=0A=
- if (Addi91u_into_Adapter_table(wBIOS,=0A=
- (pDev->base_address[0] & 0xFFFE),=0A=
- pDev->irq,=0A=
- pDev->bus->number,=0A=
- (pDev->devfn >> 3)=0A=
- ) =3D=3D 0)=0A=
- iAdapters++;=0A=
- }=0A=
- while ((pDev =3D pci_find_device(INI_VENDOR_ID, I935_DEVICE_ID, pDev)) =
!=3D NULL) {=0A=
- pci_read_config_dword(pDev, 0x44, (u32 *) & dRegValue);=0A=
- wBIOS =3D (UWORD) (dRegValue & 0xFF);=0A=
- if (((dRegValue & 0xFF00) >> 8) =3D=3D 0xFF)=0A=
- dRegValue =3D 0;=0A=
- wBIOS =3D (wBIOS << 8) + ((UWORD) ((dRegValue & 0xFF00) >> 8));=0A=
- if (Addi91u_into_Adapter_table(wBIOS,=0A=
- (pDev->base_address[0] & 0xFFFE),=0A=
- pDev->irq,=0A=
- pDev->bus->number,=0A=
- (pDev->devfn >> 3)=0A=
- ) =3D=3D 0)=0A=
- iAdapters++;=0A=
- }=0A=
- while ((pDev =3D pci_find_device(INI_VENDOR_ID, 0x0002, pDev)) !=3D =
NULL) {=0A=
- pci_read_config_dword(pDev, 0x44, (u32 *) & dRegValue);=0A=
- wBIOS =3D (UWORD) (dRegValue & 0xFF);=0A=
- if (((dRegValue & 0xFF00) >> 8) =3D=3D 0xFF)=0A=
- dRegValue =3D 0;=0A=
- wBIOS =3D (wBIOS << 8) + ((UWORD) ((dRegValue & 0xFF00) >> 8));=0A=
- if (Addi91u_into_Adapter_table(wBIOS,=0A=
- (pDev->base_address[0] & 0xFFFE),=0A=
- pDev->irq,=0A=
- pDev->bus->number,=0A=
- (pDev->devfn >> 3)=0A=
- ) =3D=3D 0)=0A=
- iAdapters++;=0A=
+ for (i=3D0; i < iNumIdEntries; i++) {=0A=
+ struct id curId =3D id_table[i];=0A=
+ while ((pDev =3D pci_find_device(curId.vendor_id, curId.device_id, =
pDev)) !=3D NULL) {=0A=
+ pci_read_config_dword(pDev, 0x44, (u32 *) & dRegValue);=0A=
+ wBIOS =3D (UWORD) (dRegValue & 0xFF);=0A=
+ if (((dRegValue & 0xFF00) >> 8) =3D=3D 0xFF)=0A=
+ dRegValue =3D 0;=0A=
+ wBIOS =3D (wBIOS << 8) + ((UWORD) ((dRegValue & 0xFF00) >> 8));=0A=
+ if (Addi91u_into_Adapter_table(wBIOS,=0A=
+ (pDev->base_address[0] & 0xFFFE),=0A=
+ pDev->irq,=0A=
+ pDev->bus->number,=0A=
+ (pDev->devfn >> 3)=0A=
+ ) =3D=3D 0)=0A=
+ iAdapters++;=0A=
+ }=0A=
}=0A=
=0A=
return (iAdapters);=0A=
--- orig/ini9100u.h Tue Jan 19 10:37:21 1999=0A=
+++ ini9100u.h Tue Jan 19 10:49:51 1999=0A=
@@ -207,6 +207,7 @@=0A=
#define SENSE_SIZE 14=0A=
=0A=
#define INI_VENDOR_ID 0x1101 /* Initio's PCI vendor ID */=0A=
+#define DMX_VENDOR_ID 0x134a /* Domex's PCI vendor ID */=0A=
#define I950_DEVICE_ID 0x9500 /* Initio's inic-950 product ID */=0A=
#define I940_DEVICE_ID 0x9400 /* Initio's inic-940 product ID */=0A=
#define I935_DEVICE_ID 0x9401 /* Initio's inic-935 product ID */=0A=

------=_NextPart_000_0037_01BE439D.890C3E40--

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/