From 2d4c4b345148916e3bf6a79b8e28db0f123c8ef8 Mon Sep 17 00:00:00 2001 From: Jonathan Gray Date: Sat, 27 Mar 2010 21:40:14 +0000 Subject: Give cardbus the pci_chipset_tag_t from pccbb and push it out through cardbus_attach_args so we can switch to using proper pci config space functions instead of callback based wrappers. ok oga@ krw@ kettenis@ --- sys/dev/cardbus/if_atw_cardbus.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'sys/dev/cardbus/if_atw_cardbus.c') diff --git a/sys/dev/cardbus/if_atw_cardbus.c b/sys/dev/cardbus/if_atw_cardbus.c index 7c9d6ccbcc9..f1d587b7b88 100644 --- a/sys/dev/cardbus/if_atw_cardbus.c +++ b/sys/dev/cardbus/if_atw_cardbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_atw_cardbus.c,v 1.17 2010/03/27 20:04:03 jsg Exp $ */ +/* $OpenBSD: if_atw_cardbus.c,v 1.18 2010/03/27 21:40:13 jsg Exp $ */ /* $NetBSD: if_atw_cardbus.c,v 1.9 2004/07/23 07:07:55 dyoung Exp $ */ /*- @@ -102,6 +102,7 @@ struct atw_cardbus_softc { pcireg_t sc_bar_val; /* value of the BAR */ int sc_intrline; /* interrupt line */ + pci_chipset_tag_t sc_pc; }; int atw_cardbus_match(struct device *, void *, void *); @@ -144,6 +145,7 @@ atw_cardbus_attach(struct device *parent, struct device *self, void *aux) sc->sc_dmat = ca->ca_dmat; csc->sc_ct = ct; csc->sc_tag = ca->ca_tag; + csc->sc_pc = ca->ca_pc; /* * Power management hooks. @@ -157,7 +159,7 @@ atw_cardbus_attach(struct device *parent, struct device *self, void *aux) #if 0 printf(": signature %08x\n%s", - cardbus_conf_read(ct->ct_cc, ct->ct_cf, csc->sc_tag, 0x80), + pci_conf_read(ca->ca_pc, csc->sc_tag, 0x80), sc->sc_dev.dv_xname); #endif @@ -322,7 +324,7 @@ atw_cardbus_setup(struct atw_cardbus_softc *csc) #endif cardbus_devfunc_t ct = csc->sc_ct; cardbus_chipset_tag_t cc = ct->ct_cc; - cardbus_function_tag_t cf = ct->ct_cf; + pci_chipset_tag_t pc = csc->sc_pc; pcireg_t reg; #ifdef notyet @@ -331,7 +333,7 @@ atw_cardbus_setup(struct atw_cardbus_softc *csc) #endif /* Program the BAR. */ - cardbus_conf_write(cc, cf, csc->sc_tag, csc->sc_bar_reg, + pci_conf_write(pc, csc->sc_tag, csc->sc_bar_reg, csc->sc_bar_val); /* Make sure the right access type is on the CardBus bridge. */ @@ -339,21 +341,21 @@ atw_cardbus_setup(struct atw_cardbus_softc *csc) (*ct->ct_cf->cardbus_ctrl)(cc, CARDBUS_BM_ENABLE); /* Enable the appropriate bits in the PCI CSR. */ - reg = cardbus_conf_read(cc, cf, csc->sc_tag, + reg = pci_conf_read(pc, csc->sc_tag, PCI_COMMAND_STATUS_REG); reg &= ~(PCI_COMMAND_IO_ENABLE|PCI_COMMAND_MEM_ENABLE); reg |= csc->sc_csr; - cardbus_conf_write(cc, cf, csc->sc_tag, PCI_COMMAND_STATUS_REG, + pci_conf_write(pc, csc->sc_tag, PCI_COMMAND_STATUS_REG, reg); /* * Make sure the latency timer is set to some reasonable * value. */ - reg = cardbus_conf_read(cc, cf, csc->sc_tag, PCI_BHLC_REG); + reg = pci_conf_read(pc, csc->sc_tag, PCI_BHLC_REG); if (PCI_LATTIMER(reg) < 0x20) { reg &= ~(PCI_LATTIMER_MASK << PCI_LATTIMER_SHIFT); reg |= (0x20 << PCI_LATTIMER_SHIFT); - cardbus_conf_write(cc, cf, csc->sc_tag, PCI_BHLC_REG, reg); + pci_conf_write(pc, csc->sc_tag, PCI_BHLC_REG, reg); } } -- cgit v1.2.3