Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / drivers / scsi / aic7xxx / aic7xxx_pci.c
index 7ddcc97..3adecef 100644 (file)
@@ -39,9 +39,7 @@
  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGES.
  *
- * $Id: //depot/aic7xxx/aic7xxx/aic7xxx_pci.c#69 $
- *
- * $FreeBSD$
+ * $Id: //depot/aic7xxx/aic7xxx/aic7xxx_pci.c#79 $
  */
 
 #ifdef __linux__
@@ -393,6 +391,12 @@ struct ahc_pci_identity ahc_pci_ident_table [] =
                "Adaptec aic7892 Ultra160 SCSI adapter (ARO)",
                ahc_aic7892_setup
        },
+       {
+               ID_AHA_2915_30LP,
+               ID_ALL_MASK,
+               "Adaptec 2915/30LP Ultra160 SCSI adapter",
+               ahc_aic7892_setup
+       },
        /* aic7895 based controllers */ 
        {
                ID_AHA_2940U_DUAL,
@@ -704,7 +708,6 @@ ahc_find_pci_device(ahc_dev_softc_t pci)
 int
 ahc_pci_config(struct ahc_softc *ahc, struct ahc_pci_identity *entry)
 {
-       u_long   l;
        u_int    command;
        u_int    our_id;
        u_int    sxfrctl1;
@@ -964,12 +967,7 @@ ahc_pci_config(struct ahc_softc *ahc, struct ahc_pci_identity *entry)
        if (error != 0)
                return (error);
 
-       ahc_list_lock(&l);
-       /*
-        * Link this softc in with all other ahc instances.
-        */
-       ahc_softc_insert(ahc);
-       ahc_list_unlock(&l);
+       ahc->init_level++;
        return (0);
 }
 
@@ -1199,9 +1197,19 @@ ahc_pci_test_register_access(struct ahc_softc *ahc)
         * use for this test.
         */
        hcntrl = ahc_inb(ahc, HCNTRL);
+
        if (hcntrl == 0xFF)
                goto fail;
 
+       if ((hcntrl & CHIPRST) != 0) {
+               /*
+                * The chip has not been initialized since
+                * PCI/EISA/VLB bus reset.  Don't trust
+                * "left over BIOS data".
+                */
+               ahc->flags |= AHC_NO_BIOS_INIT;
+       }
+
        /*
         * Next create a situation where write combining
         * or read prefetching could be initiated by the
@@ -1313,6 +1321,10 @@ check_extport(struct ahc_softc *ahc, u_int *sxfrctl1)
                        sd.sd_chip = C56_66;
                }
                ahc_release_seeprom(&sd);
+
+               /* Remember the SEEPROM type for later */
+               if (sd.sd_chip == C56_66)
+                       ahc->flags |= AHC_LARGE_SEEPROM;
        }
 
        if (!have_seeprom) {
@@ -2024,12 +2036,12 @@ ahc_pci_resume(struct ahc_softc *ahc)
         * that the OS doesn't know about and rely on our chip
         * reset handler to handle the rest.
         */
-       ahc_pci_write_config(ahc->dev_softc, DEVCONFIG, /*bytes*/4,
-                            ahc->bus_softc.pci_softc.devconfig);
-       ahc_pci_write_config(ahc->dev_softc, PCIR_COMMAND, /*bytes*/1,
-                            ahc->bus_softc.pci_softc.command);
-       ahc_pci_write_config(ahc->dev_softc, CSIZE_LATTIME, /*bytes*/1,
-                            ahc->bus_softc.pci_softc.csize_lattime);
+       ahc_pci_write_config(ahc->dev_softc, DEVCONFIG,
+                            ahc->bus_softc.pci_softc.devconfig, /*bytes*/4);
+       ahc_pci_write_config(ahc->dev_softc, PCIR_COMMAND,
+                            ahc->bus_softc.pci_softc.command, /*bytes*/1);
+       ahc_pci_write_config(ahc->dev_softc, CSIZE_LATTIME,
+                            ahc->bus_softc.pci_softc.csize_lattime, /*bytes*/1);
        if ((ahc->flags & AHC_HAS_TERM_LOGIC) != 0) {
                struct  seeprom_descriptor sd;
                u_int   sxfrctl1;