summaryrefslogtreecommitdiff
path: root/sys/dev/cardbus/if_re_cardbus.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/cardbus/if_re_cardbus.c')
-rw-r--r--sys/dev/cardbus/if_re_cardbus.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/sys/dev/cardbus/if_re_cardbus.c b/sys/dev/cardbus/if_re_cardbus.c
index 1e107aeec17..be842b33aa1 100644
--- a/sys/dev/cardbus/if_re_cardbus.c
+++ b/sys/dev/cardbus/if_re_cardbus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_re_cardbus.c,v 1.16 2009/08/20 18:47:03 martynas Exp $ */
+/* $OpenBSD: if_re_cardbus.c,v 1.17 2010/03/22 22:28:27 jsg Exp $ */
/*
* Copyright (c) 2005 Peter Valchev <pvalchev@openbsd.org>
@@ -60,7 +60,7 @@ struct re_cardbus_softc {
/* Cardbus-specific data */
void *sc_ih;
cardbus_devfunc_t ct;
- cardbustag_t sc_tag;
+ pcitag_t sc_tag;
int sc_csr;
int sc_cben;
int sc_bar_reg;
@@ -87,7 +87,7 @@ struct cfattach re_cardbus_ca = {
re_cardbus_detach
};
-const struct cardbus_matchid re_cardbus_devices[] = {
+const struct pci_matchid re_cardbus_devices[] = {
{ PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_RT8169 },
};
@@ -115,7 +115,7 @@ re_cardbus_attach(struct device *parent, struct device *self, void *aux)
struct cardbus_attach_args *ca = aux;
struct cardbus_softc *psc =
(struct cardbus_softc *)sc->sc_dev.dv_parent;
- cardbus_chipset_tag_t cc = psc->sc_cc;
+ pci_chipset_tag_t cc = psc->sc_cc;
cardbus_function_tag_t cf = psc->sc_cf;
cardbus_devfunc_t ct = ca->ca_ct;
bus_addr_t adr;
@@ -129,12 +129,12 @@ re_cardbus_attach(struct device *parent, struct device *self, void *aux)
/*
* Map control/status registers.
*/
- if (Cardbus_mapreg_map(ct, RL_PCI_LOMEM, CARDBUS_MAPREG_TYPE_MEM, 0,
+ if (Cardbus_mapreg_map(ct, RL_PCI_LOMEM, PCI_MAPREG_TYPE_MEM, 0,
&sc->rl_btag, &sc->rl_bhandle, &adr, &csc->sc_mapsize) == 0) {
csc->sc_cben = CARDBUS_MEM_ENABLE;
- csc->sc_csr |= CARDBUS_COMMAND_MEM_ENABLE;
+ csc->sc_csr |= PCI_COMMAND_MEM_ENABLE;
csc->sc_bar_reg = RL_PCI_LOMEM;
- csc->sc_bar_val = adr | CARDBUS_MAPREG_TYPE_MEM;
+ csc->sc_bar_val = adr | PCI_MAPREG_TYPE_MEM;
} else {
printf(": can't map mem space\n");
return;
@@ -178,7 +178,7 @@ re_cardbus_setup(struct rl_softc *sc)
{
struct re_cardbus_softc *csc = (struct re_cardbus_softc *)sc;
cardbus_devfunc_t ct = csc->ct;
- cardbus_chipset_tag_t cc = ct->ct_cc;
+ pci_chipset_tag_t cc = ct->ct_cc;
cardbus_function_tag_t cf = ct->ct_cf;
pcireg_t reg, command;
int pmreg;
@@ -220,17 +220,17 @@ re_cardbus_setup(struct rl_softc *sc)
cardbus_conf_write(cc, cf, csc->sc_tag, csc->sc_bar_reg, csc->sc_bar_val);
/* Enable proper bits in CARDBUS CSR */
- reg = cardbus_conf_read(cc, cf, csc->sc_tag, CARDBUS_COMMAND_STATUS_REG);
- reg &= ~(CARDBUS_COMMAND_IO_ENABLE|CARDBUS_COMMAND_MEM_ENABLE);
+ reg = cardbus_conf_read(cc, cf, 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, CARDBUS_COMMAND_STATUS_REG, reg);
+ cardbus_conf_write(cc, cf, 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, CARDBUS_BHLC_REG);
- if (CARDBUS_LATTIMER(reg) < 0x20) {
- reg &= ~(CARDBUS_LATTIMER_MASK << CARDBUS_LATTIMER_SHIFT);
- reg |= (0x20 << CARDBUS_LATTIMER_SHIFT);
- cardbus_conf_write(cc, cf, csc->sc_tag, CARDBUS_BHLC_REG, reg);
+ reg = cardbus_conf_read(cc, cf, 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);
}
}