diff --git a/sys/arch/alpha/pci/apecs_pci.c b/sys/arch/alpha/pci/apecs_pci.c index c4c399ef1985..8ea72f20d0bc 100644 --- a/sys/arch/alpha/pci/apecs_pci.c +++ b/sys/arch/alpha/pci/apecs_pci.c @@ -1,4 +1,4 @@ -/* $NetBSD: apecs_pci.c,v 1.14 1997/05/31 05:46:03 cgd Exp $ */ +/* $NetBSD: apecs_pci.c,v 1.15 1997/07/19 09:49:48 cgd Exp $ */ /* * Copyright (c) 1995, 1996 Carnegie-Mellon University. @@ -30,7 +30,7 @@ #include /* Config options headers */ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: apecs_pci.c,v 1.14 1997/05/31 05:46:03 cgd Exp $"); +__KERNEL_RCSID(0, "$NetBSD: apecs_pci.c,v 1.15 1997/07/19 09:49:48 cgd Exp $"); #include #include @@ -122,7 +122,7 @@ apecs_conf_read(cpv, tag, offset) old_haxr2 = 0; /* XXX gcc -Wuninitialized */ /* secondary if bus # != 0 */ - pci_decompose_tag(&acp->ac_pc, tag, &secondary, 0, 0); + alpha_pci_decompose_tag(&acp->ac_pc, tag, &secondary, 0, 0); if (secondary) { s = splhigh(); old_haxr2 = REGVAL(EPIC_HAXR2); @@ -171,7 +171,7 @@ apecs_conf_write(cpv, tag, offset, data) old_haxr2 = 0; /* XXX gcc -Wuninitialized */ /* secondary if bus # != 0 */ - pci_decompose_tag(&acp->ac_pc, tag, &secondary, 0, 0); + alpha_pci_decompose_tag(&acp->ac_pc, tag, &secondary, 0, 0); if (secondary) { s = splhigh(); old_haxr2 = REGVAL(EPIC_HAXR2); diff --git a/sys/arch/alpha/pci/lca_pci.c b/sys/arch/alpha/pci/lca_pci.c index 2a0b8b843ef3..743250819b2a 100644 --- a/sys/arch/alpha/pci/lca_pci.c +++ b/sys/arch/alpha/pci/lca_pci.c @@ -1,4 +1,4 @@ -/* $NetBSD: lca_pci.c,v 1.11 1997/05/31 05:46:05 cgd Exp $ */ +/* $NetBSD: lca_pci.c,v 1.12 1997/07/19 09:49:51 cgd Exp $ */ /* * Copyright (c) 1995, 1996 Carnegie-Mellon University. @@ -30,7 +30,7 @@ #include /* Config options headers */ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: lca_pci.c,v 1.11 1997/05/31 05:46:05 cgd Exp $"); +__KERNEL_RCSID(0, "$NetBSD: lca_pci.c,v 1.12 1997/07/19 09:49:51 cgd Exp $"); #include #include @@ -123,7 +123,7 @@ lca_conf_read(cpv, tag, offset) s = 0; /* XXX gcc -Wuninitialized */ /* secondary if bus # != 0 */ - pci_decompose_tag(&lcp->lc_pc, tag, &secondary, &device, 0); + alpha_pci_decompose_tag(&lcp->lc_pc, tag, &secondary, &device, 0); if (secondary) { s = splhigh(); alpha_mb(); @@ -177,7 +177,7 @@ lca_conf_write(cpv, tag, offset, data) s = 0; /* XXX gcc -Wuninitialized */ /* secondary if bus # != 0 */ - pci_decompose_tag(&lcp->lc_pc, tag, &secondary, &device, 0); + alpha_pci_decompose_tag(&lcp->lc_pc, tag, &secondary, &device, 0); if (secondary) { s = splhigh(); alpha_mb(); diff --git a/sys/arch/alpha/pci/pci_2100_a50.c b/sys/arch/alpha/pci/pci_2100_a50.c index adb92228cfae..48635f41affa 100644 --- a/sys/arch/alpha/pci/pci_2100_a50.c +++ b/sys/arch/alpha/pci/pci_2100_a50.c @@ -1,4 +1,4 @@ -/* $NetBSD: pci_2100_a50.c,v 1.15 1997/05/31 05:46:06 cgd Exp $ */ +/* $NetBSD: pci_2100_a50.c,v 1.16 1997/07/19 09:49:52 cgd Exp $ */ /* * Copyright (c) 1995, 1996 Carnegie-Mellon University. @@ -30,7 +30,7 @@ #include /* Config options headers */ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: pci_2100_a50.c,v 1.15 1997/05/31 05:46:06 cgd Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pci_2100_a50.c,v 1.16 1997/07/19 09:49:52 cgd Exp $"); #include #include @@ -122,7 +122,7 @@ dec_2100_a50_intr_map(acv, bustag, buspin, line, ihp) return 1; } - pci_decompose_tag(pc, bustag, NULL, &device, NULL); + alpha_pci_decompose_tag(pc, bustag, NULL, &device, NULL); switch (device) { case 6: /* NCR SCSI */ diff --git a/sys/arch/alpha/pci/pci_axppci_33.c b/sys/arch/alpha/pci/pci_axppci_33.c index 9a9178baec48..7e9888f7ae89 100644 --- a/sys/arch/alpha/pci/pci_axppci_33.c +++ b/sys/arch/alpha/pci/pci_axppci_33.c @@ -1,4 +1,4 @@ -/* $NetBSD: pci_axppci_33.c,v 1.13 1997/05/31 05:46:07 cgd Exp $ */ +/* $NetBSD: pci_axppci_33.c,v 1.14 1997/07/19 09:49:53 cgd Exp $ */ /* * Copyright (c) 1995, 1996 Carnegie-Mellon University. @@ -30,7 +30,7 @@ #include /* Config options headers */ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: pci_axppci_33.c,v 1.13 1997/05/31 05:46:07 cgd Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pci_axppci_33.c,v 1.14 1997/07/19 09:49:53 cgd Exp $"); #include #include @@ -122,7 +122,7 @@ dec_axppci_33_intr_map(lcv, bustag, buspin, line, ihp) return 1; } - pci_decompose_tag(pc, bustag, NULL, &device, NULL); + alpha_pci_decompose_tag(pc, bustag, NULL, &device, NULL); switch (device) { case 6: /* NCR SCSI */ diff --git a/sys/arch/alpha/pci/pci_eb164.c b/sys/arch/alpha/pci/pci_eb164.c index d39d1f752867..fe2d129ba514 100644 --- a/sys/arch/alpha/pci/pci_eb164.c +++ b/sys/arch/alpha/pci/pci_eb164.c @@ -1,4 +1,4 @@ -/* $NetBSD: pci_eb164.c,v 1.7 1997/05/31 05:46:08 cgd Exp $ */ +/* $NetBSD: pci_eb164.c,v 1.8 1997/07/19 09:49:55 cgd Exp $ */ /* * Copyright (c) 1995, 1996 Carnegie-Mellon University. @@ -30,7 +30,7 @@ #include /* Config options headers */ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: pci_eb164.c,v 1.7 1997/05/31 05:46:08 cgd Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pci_eb164.c,v 1.8 1997/07/19 09:49:55 cgd Exp $"); #include #include @@ -144,7 +144,7 @@ dec_eb164_intr_map(ccv, bustag, buspin, line, ihp) return 1; } - pci_decompose_tag(pc, bustag, NULL, &device, NULL); + alpha_pci_decompose_tag(pc, bustag, NULL, &device, NULL); switch (device) { #if 0 /* THIS CODE SHOULD NEVER BE CALLED FOR THE SIO */ case 8: /* SIO */ diff --git a/sys/arch/alpha/pci/pci_kn20aa.c b/sys/arch/alpha/pci/pci_kn20aa.c index f1555752979b..471fd629ce2b 100644 --- a/sys/arch/alpha/pci/pci_kn20aa.c +++ b/sys/arch/alpha/pci/pci_kn20aa.c @@ -1,4 +1,4 @@ -/* $NetBSD: pci_kn20aa.c,v 1.23 1997/04/07 23:40:43 cgd Exp $ */ +/* $NetBSD: pci_kn20aa.c,v 1.24 1997/07/19 09:49:57 cgd Exp $ */ /* * Copyright (c) 1995, 1996 Carnegie-Mellon University. @@ -30,7 +30,7 @@ #include /* Config options headers */ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: pci_kn20aa.c,v 1.23 1997/04/07 23:40:43 cgd Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pci_kn20aa.c,v 1.24 1997/07/19 09:49:57 cgd Exp $"); #include #include @@ -137,7 +137,7 @@ dec_kn20aa_intr_map(ccv, bustag, buspin, line, ihp) * The DEC engineers who did this hardware obviously engaged * in random drug testing. */ - pci_decompose_tag(pc, bustag, NULL, &device, NULL); + alpha_pci_decompose_tag(pc, bustag, NULL, &device, NULL); switch (device) { case 11: case 12: diff --git a/sys/arch/alpha/pci/pci_kn8ae.c b/sys/arch/alpha/pci/pci_kn8ae.c index e565427dd6fb..d02793a90708 100644 --- a/sys/arch/alpha/pci/pci_kn8ae.c +++ b/sys/arch/alpha/pci/pci_kn8ae.c @@ -1,4 +1,4 @@ -/* $NetBSD: pci_kn8ae.c,v 1.5 1997/06/24 18:08:59 mjacob Exp $ */ +/* $NetBSD: pci_kn8ae.c,v 1.6 1997/07/19 09:50:00 cgd Exp $ */ /* * Copyright (c) 1997 by Matthew Jacob @@ -33,7 +33,7 @@ #include /* Config options headers */ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: pci_kn8ae.c,v 1.5 1997/06/24 18:08:59 mjacob Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pci_kn8ae.c,v 1.6 1997/07/19 09:50:00 cgd Exp $"); #include #include @@ -140,7 +140,7 @@ dec_kn8ae_intr_map(ccv, bustag, buspin, line, ihp) printf("pci_map_int: bad interrupt pin %d\n", buspin); return 1; } - pci_decompose_tag(pc, bustag, NULL, &device, NULL); + alpha_pci_decompose_tag(pc, bustag, NULL, &device, NULL); ionode = ccp->cc_sc->dwlpx_node - 4; hose = ccp->cc_sc->dwlpx_hosenum; diff --git a/sys/arch/alpha/pci/pci_machdep.h b/sys/arch/alpha/pci/pci_machdep.h index 5be2d220fe7f..2a75f06e64b5 100644 --- a/sys/arch/alpha/pci/pci_machdep.h +++ b/sys/arch/alpha/pci/pci_machdep.h @@ -1,4 +1,4 @@ -/* $NetBSD: pci_machdep.h,v 1.7 1997/04/07 02:00:06 cgd Exp $ */ +/* $NetBSD: pci_machdep.h,v 1.8 1997/07/19 09:50:02 cgd Exp $ */ /* * Copyright (c) 1996 Carnegie-Mellon University. @@ -48,8 +48,6 @@ struct alpha_pci_chipset { struct device *, struct pcibus_attach_args *)); int (*pc_bus_maxdevs) __P((void *, int)); pcitag_t (*pc_make_tag) __P((void *, int, int, int)); - void (*pc_decompose_tag) __P((void *, pcitag_t, int *, - int *, int *)); pcireg_t (*pc_conf_read) __P((void *, pcitag_t, int)); void (*pc_conf_write) __P((void *, pcitag_t, int, pcireg_t)); @@ -60,6 +58,10 @@ struct alpha_pci_chipset { void *(*pc_intr_establish) __P((void *, pci_intr_handle_t, int, int (*)(void *), void *)); void (*pc_intr_disestablish) __P((void *, void *)); + + /* alpha-specific */ + void (*pc_decompose_tag) __P((void *, pcitag_t, int *, + int *, int *)); }; /* @@ -71,8 +73,6 @@ struct alpha_pci_chipset { (*(c)->pc_bus_maxdevs)((c)->pc_conf_v, (b)) #define pci_make_tag(c, b, d, f) \ (*(c)->pc_make_tag)((c)->pc_conf_v, (b), (d), (f)) -#define pci_decompose_tag(c, t, bp, dp, fp) \ - (*(c)->pc_decompose_tag)((c)->pc_conf_v, (t), (bp), (dp), (fp)) #define pci_conf_read(c, t, r) \ (*(c)->pc_conf_read)((c)->pc_conf_v, (t), (r)) #define pci_conf_write(c, t, r, v) \ @@ -92,3 +92,5 @@ struct alpha_pci_chipset { */ void pci_display_console __P((bus_space_tag_t, bus_space_tag_t, pci_chipset_tag_t, int, int, int)); +#define alpha_pci_decompose_tag(c, t, bp, dp, fp) \ + (*(c)->pc_decompose_tag)((c)->pc_conf_v, (t), (bp), (dp), (fp)) diff --git a/sys/dev/pci/if_de.c b/sys/dev/pci/if_de.c index 5d898c5a6aba..2a2d291ee9de 100644 --- a/sys/dev/pci/if_de.c +++ b/sys/dev/pci/if_de.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_de.c,v 1.45 1997/06/09 00:34:18 thorpej Exp $ */ +/* $NetBSD: if_de.c,v 1.46 1997/07/19 09:49:39 cgd Exp $ */ /*- * Copyright (c) 1994-1997 Matt Thomas (matt@3am-software.com) @@ -4799,10 +4799,8 @@ tulip_pci_attach( #define PCI_CONF_WRITE(r, v) pci_conf_write(pa->pa_pc, pa->pa_tag, (r), (v)) #define PCI_CONF_READ(r) pci_conf_read(pa->pa_pc, pa->pa_tag, (r)) #define PCI_GETBUSDEVINFO(sc) do { \ - int busno, devno, funcno; \ - pci_decompose_tag(pa->pa_pc, pa->pa_tag, &busno, &devno, &funcno); \ - (sc)->tulip_pci_busno = busno; \ - (sc)->tulip_pci_devno = devno; \ + (sc)->tulip_pci_busno = parent; \ + (sc)->tulip_pci_devno = pa->pa_device; \ } while (0) #endif /* __NetBSD__ */ int retval, idx; diff --git a/sys/dev/pci/if_devar.h b/sys/dev/pci/if_devar.h index f7eb8ea50f5f..b2de0894e146 100644 --- a/sys/dev/pci/if_devar.h +++ b/sys/dev/pci/if_devar.h @@ -1,4 +1,4 @@ -/* $NetBSD: if_devar.h,v 1.13 1997/06/08 18:46:36 thorpej Exp $ */ +/* $NetBSD: if_devar.h,v 1.14 1997/07/19 09:49:45 cgd Exp $ */ /*- * Copyright (c) 1994-1997 Matt Thomas (matt@3am-software.com) @@ -620,7 +620,11 @@ struct _tulip_softc_t { u_int32_t tulip_setupdata[192/sizeof(u_int32_t)]; char tulip_boardid[16]; /* buffer for board ID */ u_int8_t tulip_rombuf[128]; +#ifndef __NetBSD__ u_int8_t tulip_pci_busno; /* needed for multiport boards */ +#else + struct device *tulip_pci_busno; /* in NetBSD each pci bus is a dev */ +#endif u_int8_t tulip_pci_devno; /* needed for multiport boards */ u_int8_t tulip_connidx; tulip_srom_connection_t tulip_conntype;