summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorthorpej <thorpej@NetBSD.org>2003-08-29 02:59:20 +0000
committerthorpej <thorpej@NetBSD.org>2003-08-29 02:59:20 +0000
commit20b90609de98d8aab054113ca844e9fae77a42e4 (patch)
tree62935b6cd25f3264040ab895d044bc2858ae1ff1 /sys/dev
parent05e2e8b5b953163888669873a7341d0b32b9cd6e (diff)
Apply the following change from 5/26/2003 21:15:52 made by gibbs to the
FreeBSD ahd driver: Add 7901B support. Sort IDs based on chip type. Remove IROC IDs. We'll switch to using the IROC masks if/when we want to start attaching to IROC controllers. Approved by: RE
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/ahd_pci.c75
1 files changed, 60 insertions, 15 deletions
diff --git a/sys/dev/pci/ahd_pci.c b/sys/dev/pci/ahd_pci.c
index 2fd5f488ac4..681d9129f8d 100644
--- a/sys/dev/pci/ahd_pci.c
+++ b/sys/dev/pci/ahd_pci.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ahd_pci.c,v 1.4 2003/08/29 00:09:59 thorpej Exp $ */
+/* $NetBSD: ahd_pci.c,v 1.5 2003/08/29 02:59:20 thorpej Exp $ */
/*
* Product specific probe and attach routines for:
@@ -40,16 +40,16 @@
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*
- * Id $
+ * Id: //depot/aic7xxx/aic7xxx/aic79xx_pci.c#74 $
*
- * $FreeBSD: src/sys/dev/aic7xxx/aic79xx_pci.c,v 1.10 2003/05/04 00:20:07 gibbs Exp $
+ * $FreeBSD: src/sys/dev/aic7xxx/aic79xx_pci.c,v 1.12 2003/06/06 23:48:18 gibbs Exp $
*/
/*
* Ported from FreeBSD by Pascal Renauld, Network Storage Solutions, Inc. - April 2003
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ahd_pci.c,v 1.4 2003/08/29 00:09:59 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ahd_pci.c,v 1.5 2003/08/29 02:59:20 thorpej Exp $");
#define AHD_PCI_IOADDR PCI_MAPREG_START /* I/O Address */
#define AHD_PCI_MEMADDR (PCI_MAPREG_START + 4) /* Mem I/O Address */
@@ -71,28 +71,29 @@ ahd_compose_id(u_int device, u_int vendor, u_int subdevice, u_int subvendor)
}
#define ID_ALL_MASK 0xFFFFFFFFFFFFFFFFull
+#define ID_ALL_IROC_MASK 0xFFFFFF7FFFFFFFFFull
#define ID_DEV_VENDOR_MASK 0xFFFFFFFF00000000ull
#define ID_9005_GENERIC_MASK 0xFFF0FFFF00000000ull
+#define ID_9005_GENERIC_IROC_MASK 0xFFF0FF7F00000000ull
#define ID_AIC7901 0x800F9005FFFF9005ull
-#define ID_AIC7901A 0x801E9005FFFF9005ull
-#define ID_AIC7901A_IROC 0x809E9005FFFF9005ull
#define ID_AHA_29320A 0x8000900500609005ull
+#define ID_AHA_29320ALP 0x8017900500449005ull
+
+#define ID_AIC7901A 0x801E9005FFFF9005ull
+#define ID_AHA_29320 0x8012900500429005ull
+#define ID_AHA_29320B 0x8013900500439005ull
#define ID_AHA_29320LP 0x8014900500449005ull
-#define ID_AHA_29320LP_IROC 0x8094900500449005ull
#define ID_AIC7902 0x801F9005FFFF9005ull
-#define ID_AIC7902_IROC 0x809F9005FFFF9005ull
#define ID_AIC7902_B 0x801D9005FFFF9005ull
-#define ID_AIC7902_B_IROC 0x809D9005FFFF9005ull
#define ID_AHA_39320 0x8010900500409005ull
+#define ID_AHA_39320_B 0x8015900500409005ull
#define ID_AHA_39320A 0x8016900500409005ull
#define ID_AHA_39320D 0x8011900500419005ull
#define ID_AHA_39320D_B 0x801C900500419005ull
#define ID_AHA_39320D_HP 0x8011900500AC0E11ull
#define ID_AHA_39320D_B_HP 0x801C900500AC0E11ull
-#define ID_AHA_29320 0x8012900500429005ull
-#define ID_AHA_29320B 0x8013900500439005ull
#define ID_AIC7902_PCI_REV_A4 0x3
#define ID_AIC7902_PCI_REV_B0 0x10
#define SUBID_HP 0x0E11
@@ -119,22 +120,42 @@ ahd_compose_id(u_int device, u_int vendor, u_int subdevice, u_int subvendor)
#define SUBID_9005_SEEPTYPE_NONE 0x0
#define SUBID_9005_SEEPTYPE_4K 0x1
+static ahd_device_setup_t ahd_aic7901_setup;
static ahd_device_setup_t ahd_aic7901A_setup;
static ahd_device_setup_t ahd_aic7902_setup;
struct ahd_pci_identity ahd_pci_ident_table [] =
{
+ /* aic7901 based controllers */
+ {
+ ID_AHA_29320A,
+ ID_ALL_MASK,
+ "Adaptec 29320A Ultra320 SCSI adapter",
+ ahd_aic7901_setup
+ },
+ {
+ ID_AHA_29320ALP,
+ ID_ALL_MASK,
+ "Adaptec 29320ALP Ultra320 SCSI adapter",
+ ahd_aic7901_setup
+ },
/* aic7901A based controllers */
{
- ID_AHA_29320LP,
+ ID_AHA_29320,
ID_ALL_MASK,
- "Adaptec 29320LP Ultra320 SCSI adapter",
+ "Adaptec 29320 Ultra320 SCSI adapter",
ahd_aic7901A_setup
},
{
- ID_AHA_29320A,
+ ID_AHA_29320B,
ID_ALL_MASK,
- "Adaptec 29320A Ultra320 SCSI adapter",
+ "Adaptec 29320B Ultra320 SCSI adapter",
+ ahd_aic7901A_setup
+ },
+ {
+ ID_AHA_29320LP,
+ ID_ALL_MASK,
+ "Adaptec 29320LP Ultra320 SCSI adapter",
ahd_aic7901A_setup
},
/* aic7902 based controllers */
@@ -145,6 +166,12 @@ struct ahd_pci_identity ahd_pci_ident_table [] =
ahd_aic7902_setup
},
{
+ ID_AHA_39320_B,
+ ID_ALL_MASK,
+ "Adaptec 39320 Ultra320 SCSI adapter",
+ ahd_aic7902_setup
+ },
+ {
ID_AHA_39320A,
ID_ALL_MASK,
"Adaptec 39320A Ultra320 SCSI adapter",
@@ -188,6 +215,12 @@ struct ahd_pci_identity ahd_pci_ident_table [] =
},
/* Generic chip probes for devices we don't know 'exactly' */
{
+ ID_AIC7901 & ID_DEV_VENDOR_MASK,
+ ID_DEV_VENDOR_MASK,
+ "Adaptec AIC7901 Ultra320 SCSI adapter",
+ ahd_aic7901_setup
+ },
+ {
ID_AIC7901A & ID_DEV_VENDOR_MASK,
ID_DEV_VENDOR_MASK,
"Adaptec AIC7901A Ultra320 SCSI adapter",
@@ -967,6 +1000,18 @@ ahd_pci_split_intr(struct ahd_softc *ahd, u_int intstat)
}
static int
+ahd_aic7901_setup(struct ahd_softc *ahd, struct pci_attach_args *pa)
+{
+ int error;
+
+ error = ahd_aic7902_setup(ahd, pa);
+ if (error != 0)
+ return (error);
+ ahd->chip = AHD_AIC7901;
+ return (0);
+}
+
+static int
ahd_aic7901A_setup(struct ahd_softc *ahd, struct pci_attach_args *pa)
{
int error;