summaryrefslogtreecommitdiffstats
path: root/sys/dev/aic7xxx/aic79xx_pci.c
diff options
context:
space:
mode:
authorgibbs <gibbs@FreeBSD.org>2003-06-28 04:39:49 +0000
committergibbs <gibbs@FreeBSD.org>2003-06-28 04:39:49 +0000
commit165f44a353f4f05a717eeae25842d4b983e85dbe (patch)
treecfd17cd9ea8f274250a5e5313666ae9131235d4a /sys/dev/aic7xxx/aic79xx_pci.c
parentb851e366194152263134f490aa9e914c5544d021 (diff)
downloadFreeBSD-src-165f44a353f4f05a717eeae25842d4b983e85dbe.zip
FreeBSD-src-165f44a353f4f05a717eeae25842d4b983e85dbe.tar.gz
aic79xx.h:
Add a 7901A specific feature definition. aic79xx_pci.c: Split out the general aic790X setup into it's own setup handler that works on single and dual controllers. Adjust all other PCI setup handlers to initialize the chips basic features and type before calling the generic handler. Turn off a few Rev B workarounds that are not required on the 7901B.
Diffstat (limited to 'sys/dev/aic7xxx/aic79xx_pci.c')
-rw-r--r--sys/dev/aic7xxx/aic79xx_pci.c36
1 files changed, 21 insertions, 15 deletions
diff --git a/sys/dev/aic7xxx/aic79xx_pci.c b/sys/dev/aic7xxx/aic79xx_pci.c
index 80d8e75..e01a47a 100644
--- a/sys/dev/aic7xxx/aic79xx_pci.c
+++ b/sys/dev/aic7xxx/aic79xx_pci.c
@@ -38,7 +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#75 $
+ * $Id: //depot/aic7xxx/aic7xxx/aic79xx_pci.c#76 $
*
* $FreeBSD$
*/
@@ -117,6 +117,7 @@ ahd_compose_id(u_int device, u_int vendor, u_int subdevice, u_int subvendor)
static ahd_device_setup_t ahd_aic7901_setup;
static ahd_device_setup_t ahd_aic7901A_setup;
static ahd_device_setup_t ahd_aic7902_setup;
+static ahd_device_setup_t ahd_aic790X_setup;
struct ahd_pci_identity ahd_pci_ident_table [] =
{
@@ -914,30 +915,32 @@ ahd_pci_split_intr(struct ahd_softc *ahd, u_int intstat)
static int
ahd_aic7901_setup(struct ahd_softc *ahd)
{
- int error;
- error = ahd_aic7902_setup(ahd);
- if (error != 0)
- return (error);
ahd->chip = AHD_AIC7901;
- return (0);
+ ahd->features = AHD_AIC7901_FE;
+ return (ahd_aic790X_setup(ahd));
}
static int
ahd_aic7901A_setup(struct ahd_softc *ahd)
{
- int error;
- error = ahd_aic7902_setup(ahd);
- if (error != 0)
- return (error);
ahd->chip = AHD_AIC7901A;
- return (0);
+ ahd->features = AHD_AIC7901A_FE;
+ return (ahd_aic790X_setup(ahd));
}
static int
ahd_aic7902_setup(struct ahd_softc *ahd)
{
+ ahd->chip = AHD_AIC7902;
+ ahd->features = AHD_AIC7902_FE;
+ return (ahd_aic790X_setup(ahd));
+}
+
+static int
+ahd_aic790X_setup(struct ahd_softc *ahd)
+{
ahd_dev_softc_t pci;
u_int rev;
@@ -950,8 +953,6 @@ ahd_aic7902_setup(struct ahd_softc *ahd)
return (ENXIO);
}
ahd->channel = ahd_get_pci_function(pci) + 'A';
- ahd->chip = AHD_AIC7902;
- ahd->features = AHD_AIC7902_FE;
if (rev < ID_AIC7902_PCI_REV_B0) {
/*
* Enable A series workarounds.
@@ -980,8 +981,13 @@ ahd_aic7902_setup(struct ahd_softc *ahd)
ahd->features |= AHD_RTI|AHD_NEW_IOCELL_OPTS
| AHD_NEW_DFCNTRL_OPTS;
- ahd->bugs |= AHD_LQOOVERRUN_BUG|AHD_ABORT_LQI_BUG
- | AHD_INTCOLLISION_BUG|AHD_EARLY_REQ_BUG;
+ ahd->bugs |= AHD_LQOOVERRUN_BUG|AHD_EARLY_REQ_BUG;
+
+ /*
+ * Some issues have been resolved in the 7901B.
+ */
+ if ((ahd->features & AHD_MULTI_FUNC) != 0)
+ ahd->bugs |= AHD_INTCOLLISION_BUG|AHD_ABORT_LQI_BUG;
/*
* IO Cell paramter setup.
OpenPOWER on IntegriCloud