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 / aic79xx_pci.c
index 4c3bb7b..757242e 100644 (file)
@@ -38,9 +38,7 @@
  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGES.
  *
- * $Id: //depot/aic7xxx/aic7xxx/aic79xx_pci.c#77 $
- *
- * $FreeBSD$
+ * $Id: //depot/aic7xxx/aic7xxx/aic79xx_pci.c#92 $
  */
 
 #ifdef __linux__
@@ -114,6 +112,13 @@ struct ahd_pci_identity ahd_pci_ident_table [] =
                "Adaptec 29320ALP Ultra320 SCSI adapter",
                ahd_aic7901_setup
        },
+       /* aic7901A based controllers */
+       {
+               ID_AHA_29320LP,
+               ID_ALL_MASK,
+               "Adaptec 29320LP Ultra320 SCSI adapter",
+               ahd_aic7901A_setup
+       },
        /* aic7902 based controllers */ 
        {
                ID_AHA_29320,
@@ -127,12 +132,6 @@ struct ahd_pci_identity ahd_pci_ident_table [] =
                "Adaptec 29320B Ultra320 SCSI adapter",
                ahd_aic7902_setup
        },
-       {
-               ID_AHA_29320LP,
-               ID_ALL_MASK,
-               "Adaptec 29320LP Ultra320 SCSI adapter",
-               ahd_aic7901A_setup
-       },
        {
                ID_AHA_39320,
                ID_ALL_MASK,
@@ -145,6 +144,12 @@ struct ahd_pci_identity ahd_pci_ident_table [] =
                "Adaptec 39320 Ultra320 SCSI adapter",
                ahd_aic7902_setup
        },
+       {
+               ID_AHA_39320_B_DELL,
+               ID_ALL_MASK,
+               "Adaptec (Dell OEM) 39320 Ultra320 SCSI adapter",
+               ahd_aic7902_setup
+       },
        {
                ID_AHA_39320A,
                ID_ALL_MASK,
@@ -283,7 +288,6 @@ int
 ahd_pci_config(struct ahd_softc *ahd, struct ahd_pci_identity *entry)
 {
        struct scb_data *shared_scb_data;
-       u_long           l;
        u_int            command;
        uint32_t         devconfig;
        uint16_t         subvendor; 
@@ -373,16 +377,9 @@ ahd_pci_config(struct ahd_softc *ahd, struct ahd_pci_identity *entry)
         * Allow interrupts now that we are completely setup.
         */
        error = ahd_pci_map_int(ahd);
-       if (error != 0)
-               return (error);
-
-       ahd_list_lock(&l);
-       /*
-        * Link this softc in with all other ahd instances.
-        */
-       ahd_softc_insert(ahd);
-       ahd_list_unlock(&l);
-       return (0);
+       if (!error)
+               ahd->init_level++;
+       return error;
 }
 
 /*
@@ -582,7 +579,7 @@ ahd_check_extport(struct ahd_softc *ahd)
                }
        }
 
-#if AHD_DEBUG
+#ifdef AHD_DEBUG
        if (have_seeprom != 0
         && (ahd_debug & AHD_DUMP_SEEPROM) != 0) {
                uint16_t *sc_data;
@@ -676,6 +673,7 @@ ahd_configure_termination(struct ahd_softc *ahd, u_int adapter_control)
         * Now set the termination based on what we found.
         */
        sxfrctl1 = ahd_inb(ahd, SXFRCTL1) & ~STPWEN;
+       ahd->flags &= ~AHD_TERM_ENB_A;
        if ((termctl & FLX_TERMCTL_ENPRILOW) != 0) {
                ahd->flags |= AHD_TERM_ENB_A;
                sxfrctl1 |= STPWEN;
@@ -952,12 +950,19 @@ ahd_aic790X_setup(struct ahd_softc *ahd)
                if ((ahd->flags & AHD_HP_BOARD) == 0)
                        AHD_SET_SLEWRATE(ahd, AHD_SLEWRATE_DEF_REVA);
        } else {
+               /* This is revision B and newer. */
+               extern uint32_t aic79xx_slowcrc;
                u_int devconfig1;
 
                ahd->features |= AHD_RTI|AHD_NEW_IOCELL_OPTS
-                             |  AHD_NEW_DFCNTRL_OPTS|AHD_FAST_CDB_DELIVERY;
+                             |  AHD_NEW_DFCNTRL_OPTS|AHD_FAST_CDB_DELIVERY
+                             |  AHD_BUSFREEREV_BUG;
                ahd->bugs |= AHD_LQOOVERRUN_BUG|AHD_EARLY_REQ_BUG;
 
+               /* If the user requested the the SLOWCRC bit to be set. */
+               if (aic79xx_slowcrc)
+                       ahd->features |= AHD_AIC79XXB_SLOWCRC;
+
                /*
                 * Some issues have been resolved in the 7901B.
                 */