From d4099d65e38e27949374fdd204d76a7e3b648d90 Mon Sep 17 00:00:00 2001 From: Marcus Glocker Date: Sun, 21 Oct 2007 09:53:27 +0000 Subject: Replace Cardbus_conf_* calls by cardbus_conf_* ones. This solves the panic 'trap type 300` seen on macppc and makes my Linksys WPC54G Ver 3 cardbus device work entirely on my PowerBook G4. --- sys/dev/cardbus/if_bwi_cardbus.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'sys/dev') diff --git a/sys/dev/cardbus/if_bwi_cardbus.c b/sys/dev/cardbus/if_bwi_cardbus.c index d1f0e37b5d9..1c093f61e87 100644 --- a/sys/dev/cardbus/if_bwi_cardbus.c +++ b/sys/dev/cardbus/if_bwi_cardbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bwi_cardbus.c,v 1.6 2007/09/27 22:10:25 mglocker Exp $ */ +/* $OpenBSD: if_bwi_cardbus.c,v 1.7 2007/10/21 09:53:26 mglocker Exp $ */ /* * Copyright (c) 2007 Marcus Glocker @@ -100,8 +100,6 @@ bwi_cardbus_attach(struct device *parent, struct device *self, void *aux) struct cardbus_attach_args *ca = aux; struct bwi_softc *sc = &csc->csc_bwi; cardbus_devfunc_t ct = ca->ca_ct; - cardbus_chipset_tag_t cc = ct->ct_cc; - cardbus_function_tag_t cf = ct->ct_cf; cardbusreg_t reg; bus_addr_t base; int error; @@ -135,7 +133,7 @@ bwi_cardbus_attach(struct device *parent, struct device *self, void *aux) sc->sc_conf_read = bwi_cardbus_conf_read; sc->sc_conf_write = bwi_cardbus_conf_write; - reg = cardbus_conf_read(cc, cf, ca->ca_tag, PCI_SUBSYS_ID_REG); + reg = (sc->sc_conf_read)(sc, PCI_SUBSYS_ID_REG); sc->sc_pci_revid = PCI_REVISION(ca->ca_class); sc->sc_pci_did = PCI_PRODUCT(ca->ca_id); @@ -247,14 +245,20 @@ void bwi_cardbus_conf_write(void *self, uint32_t reg, uint32_t val) { struct bwi_cardbus_softc *csc = (struct bwi_cardbus_softc *)self; + cardbus_devfunc_t ct = csc->csc_ct; + cardbus_chipset_tag_t cc = ct->ct_cc; + cardbus_function_tag_t cf = ct->ct_cf; - Cardbus_conf_write(csc->csc_ct, csc->csc_tag, reg, val); + cardbus_conf_write(cc, cf, csc->csc_tag, reg, val); } uint32_t bwi_cardbus_conf_read(void *self, uint32_t reg) { struct bwi_cardbus_softc *csc = (struct bwi_cardbus_softc *)self; + cardbus_devfunc_t ct = csc->csc_ct; + cardbus_chipset_tag_t cc = ct->ct_cc; + cardbus_function_tag_t cf = ct->ct_cf; - return (Cardbus_conf_read(csc->csc_ct, csc->csc_tag, reg)); + return (cardbus_conf_read(cc, cf, csc->csc_tag, reg)); } -- cgit v1.2.3