summaryrefslogtreecommitdiff
path: root/sys/dev/cardbus/uhci_cardbus.c
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2010-03-22 22:28:28 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2010-03-22 22:28:28 +0000
commit69a26e66b13a7c4261ca3d797c32ad0c9de955b7 (patch)
tree21f4e2c96d7785a8ae79ba3da3cbf18122fd3ad1 /sys/dev/cardbus/uhci_cardbus.c
parent15c19a9373d03a7892e33c480376958899e0a94d (diff)
Remove some cardbus defines and types which are identical to
their pci counterparts, similar to recent changes in NetBSD. ok oga@ deraadt@ jasper@
Diffstat (limited to 'sys/dev/cardbus/uhci_cardbus.c')
-rw-r--r--sys/dev/cardbus/uhci_cardbus.c29
1 files changed, 14 insertions, 15 deletions
diff --git a/sys/dev/cardbus/uhci_cardbus.c b/sys/dev/cardbus/uhci_cardbus.c
index a04f131d14a..57084c5398a 100644
--- a/sys/dev/cardbus/uhci_cardbus.c
+++ b/sys/dev/cardbus/uhci_cardbus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uhci_cardbus.c,v 1.8 2009/08/20 18:47:03 martynas Exp $ */
+/* $OpenBSD: uhci_cardbus.c,v 1.9 2010/03/22 22:28:27 jsg Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -55,7 +55,7 @@ int uhci_cardbus_detach(struct device *, int);
struct uhci_cardbus_softc {
uhci_softc_t sc;
- cardbus_chipset_tag_t sc_cc;
+ pci_chipset_tag_t sc_cc;
cardbus_function_tag_t sc_cf;
cardbus_devfunc_t sc_ct;
void *sc_ih; /* interrupt vectoring */
@@ -66,7 +66,6 @@ struct cfattach uhci_cardbus_ca = {
uhci_cardbus_attach, uhci_cardbus_detach, uhci_activate
};
-#define CARDBUS_INTERFACE_UHCI PCI_INTERFACE_UHCI
#define cardbus_findvendor pci_findvendor
int
@@ -74,9 +73,9 @@ uhci_cardbus_match(struct device *parent, void *match, void *aux)
{
struct cardbus_attach_args *ca = (struct cardbus_attach_args *)aux;
- if (CARDBUS_CLASS(ca->ca_class) == CARDBUS_CLASS_SERIALBUS &&
- CARDBUS_SUBCLASS(ca->ca_class) == CARDBUS_SUBCLASS_SERIALBUS_USB &&
- CARDBUS_INTERFACE(ca->ca_class) == CARDBUS_INTERFACE_UHCI)
+ if (PCI_CLASS(ca->ca_class) == PCI_CLASS_SERIALBUS &&
+ PCI_SUBCLASS(ca->ca_class) == PCI_SUBCLASS_SERIALBUS_USB &&
+ PCI_INTERFACE(ca->ca_class) == PCI_INTERFACE_UHCI)
return (1);
return (0);
@@ -88,15 +87,15 @@ uhci_cardbus_attach(struct device *parent, struct device *self, void *aux)
struct uhci_cardbus_softc *sc = (struct uhci_cardbus_softc *)self;
struct cardbus_attach_args *ca = aux;
cardbus_devfunc_t ct = ca->ca_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;
- cardbusreg_t csr;
+ pcireg_t csr;
usbd_status r;
const char *vendor;
const char *devname = sc->sc.sc_bus.bdev.dv_xname;
/* Map I/O registers */
- if (Cardbus_mapreg_map(ct, PCI_CBIO, CARDBUS_MAPREG_TYPE_IO, 0,
+ if (Cardbus_mapreg_map(ct, PCI_CBIO, PCI_MAPREG_TYPE_IO, 0,
&sc->sc.iot, &sc->sc.ioh, NULL, &sc->sc.sc_size)) {
printf(": can't map io space\n");
return;
@@ -115,10 +114,10 @@ uhci_cardbus_attach(struct device *parent, struct device *self, void *aux)
/* Enable the device. */
csr = cardbus_conf_read(cc, cf, ca->ca_tag,
- CARDBUS_COMMAND_STATUS_REG);
- cardbus_conf_write(cc, cf, ca->ca_tag, CARDBUS_COMMAND_STATUS_REG,
- csr | CARDBUS_COMMAND_MASTER_ENABLE
- | CARDBUS_COMMAND_IO_ENABLE);
+ PCI_COMMAND_STATUS_REG);
+ cardbus_conf_write(cc, cf, ca->ca_tag, PCI_COMMAND_STATUS_REG,
+ csr | PCI_COMMAND_MASTER_ENABLE
+ | PCI_COMMAND_IO_ENABLE);
sc->sc_ih = cardbus_intr_establish(cc, cf, ca->ca_intrline,
IPL_USB, uhci_intr, sc, devname);
@@ -155,12 +154,12 @@ uhci_cardbus_attach(struct device *parent, struct device *self, void *aux)
/* Figure out vendor for root hub descriptor. */
vendor = cardbus_findvendor(ca->ca_id);
- sc->sc.sc_id_vendor = CARDBUS_VENDOR(ca->ca_id);
+ sc->sc.sc_id_vendor = PCI_VENDOR(ca->ca_id);
if (vendor)
strlcpy(sc->sc.sc_vendor, vendor, sizeof (sc->sc.sc_vendor));
else
snprintf(sc->sc.sc_vendor, sizeof(sc->sc.sc_vendor),
- "vendor 0x%04x", CARDBUS_VENDOR(ca->ca_id));
+ "vendor 0x%04x", PCI_VENDOR(ca->ca_id));
r = uhci_init(&sc->sc);
if (r != USBD_NORMAL_COMPLETION) {