diff -ru --new-file 2.3.40.clean/drivers/scsi/aha1542.c 2.3.40/drivers/scsi/aha1542.c --- 2.3.40.clean/drivers/scsi/aha1542.c Thu Dec 30 01:00:54 1999 +++ 2.3.40/drivers/scsi/aha1542.c Sun Jan 23 01:07:11 2000 @@ -21,6 +21,8 @@ * Modified by Chris Faulhaber * Added module command-line options * 19-Jul-99 + * Modified by Adam Fritzler + * Added proper detection of the AHA-1640 (MCA version of AHA-1540) */ #include @@ -40,6 +42,9 @@ #include #include #include +#ifdef CONFIG_MCA +#include +#endif #include "scsi.h" #include "hosts.h" @@ -96,7 +101,7 @@ #define MAXBOARDS 4 /* Increase this and the sizes of the arrays below, if you need more.. */ -/* Boards 3,4 slots are reserved for ISAPnP scans */ +/* Boards 3,4 slots are reserved for ISAPnP/MCA scans */ static unsigned int bases[MAXBOARDS] = {0x330, 0x334, 0, 0}; @@ -1043,6 +1048,69 @@ setup_dmaspeed[0] = atbt; } #endif + + /* + * Find MicroChannel cards (AHA1640) + */ +#ifdef CONFIG_MCA + if(MCA_bus) { + int slot = 0; + int pos = 0; + + for (indx = 0; (slot != MCA_NOTFOUND) && + (indx < sizeof(bases)/sizeof(bases[0])); indx++) { + + if (bases[indx]) + continue; + + /* Detect only AHA-1640 cards -- MCA ID 0F1F */ + slot = mca_find_unused_adapter(0x0f1f, slot); + if (slot == MCA_NOTFOUND) + break; + + + /* Found one */ + pos = mca_read_stored_pos(slot, 3); + + /* Decode address */ + if (pos & 0x80) { + if (pos & 0x02) { + if (pos & 0x01) + bases[indx] = 0x334; + else + bases[indx] = 0x234; + } else { + if (pos & 0x01) + bases[indx] = 0x134; + } + } else { + if (pos & 0x02) { + if (pos & 0x01) + bases[indx] = 0x330; + else + bases[indx] = 0x230; + } else { + if (pos & 0x01) + bases[indx] = 0x130; + } + } + + /* No need to decode IRQ and Arb level -- those are + * read off the card later. + */ + printk(KERN_INFO "Found an AHA-1640 in MCA slot %d, I/O 0x%04x\n", slot, bases[indx]); + + mca_set_adapter_name(slot, "Adapter AHA-1640"); + mca_set_adapter_procfn(slot, NULL, NULL); + mca_mark_as_used(slot); + + /* Go on */ + slot++; + } + + } +#endif + /* * Hunt for ISA Plug'n'Pray Adaptecs (AHA1535) */