From fb38d30359ababb8082c15745ebaa0f3414af0db Mon Sep 17 00:00:00 2001 From: imp Date: Sun, 26 Mar 2000 07:01:52 +0000 Subject: [PATCH] Minor changes to some of the interfaces. Remove RF_PCCARD_ATTR in anticipation of removing it from sys/rman.h Add interface for setting "attributes" of pccard/cardbus devices. Minor formatting nits. --- sys/dev/pccard/card_if.m | 6 +----- sys/dev/pccard/pccard.c | 3 ++- sys/dev/pccard/pccard_cis.c | 2 +- sys/dev/pccard/pccardvar.h | 13 ++++++++++++- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/sys/dev/pccard/card_if.m b/sys/dev/pccard/card_if.m index 256ec7e3ee64..51b3bcba93a0 100644 --- a/sys/dev/pccard/card_if.m +++ b/sys/dev/pccard/card_if.m @@ -37,14 +37,10 @@ INTERFACE card; # the driver activating the resources doesn't necessarily know or need to know # these attributes. # -# XXX A nagging doubt in the back of my mind suggests that these sorts of -# XXX things might be able to be done with ivars. This nagging doubt doesn't -# XXX offer a good way to actually do this, but remains nonetheless. -# METHOD int set_resource_attribute { device_t dev; device_t child; - int *rid; + int rid; u_int flags; }; diff --git a/sys/dev/pccard/pccard.c b/sys/dev/pccard/pccard.c index fd351260bafd..ee95cd0b102e 100644 --- a/sys/dev/pccard/pccard.c +++ b/sys/dev/pccard/pccard.c @@ -334,7 +334,8 @@ pccard_function_enable(struct pccard_function *pf) pf->ccr_rid = 0; pf->ccr_res = bus_alloc_resource(dev, SYS_RES_MEMORY, &pf->ccr_rid, pf->ccr_base, pf->ccr_base + PCCARD_CCR_SIZE, - PCCARD_CCR_SIZE, RF_ACTIVE | RF_PCCARD_ATTR); + PCCARD_CCR_SIZE, RF_ACTIVE); + /* XXX SET MEM_ATTR */ if (!pf->ccr_res) goto bad; pf->pf_ccrt = rman_get_bustag(pf->ccr_res); diff --git a/sys/dev/pccard/pccard_cis.c b/sys/dev/pccard/pccard_cis.c index 5d61269ee448..779763d16497 100644 --- a/sys/dev/pccard/pccard_cis.c +++ b/sys/dev/pccard/pccard_cis.c @@ -121,7 +121,7 @@ pccard_scan_cis(device_t dev, int (*fct)(struct pccard_tuple *, void *), rid = 0; res = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, 0, ~0, - PCCARD_CIS_SIZE, RF_ACTIVE | RF_PCCARD_ATTR); + PCCARD_CIS_SIZE, RF_ACTIVE /* | RF_PCCARD_ATTR */); if (res == NULL) { #ifdef DIAGNOSTIC device_printf(dev, "can't alloc memory to read attributes\n"); diff --git a/sys/dev/pccard/pccardvar.h b/sys/dev/pccard/pccardvar.h index ed26e3f83f5e..dbf2825607cd 100644 --- a/sys/dev/pccard/pccardvar.h +++ b/sys/dev/pccard/pccardvar.h @@ -280,5 +280,16 @@ __inline static int pccard_get_ether(device_t dev, u_char *enaddr) { return BUS_READ_IVAR(device_get_parent(dev), dev, - PCCARD_IVAR_ETHADDR, (uintptr_t *)enaddr); + PCCARD_IVAR_ETHADDR, (uintptr_t *)enaddr); +} + +enum { + PCCARD_A_MEM_ATTR +}; + +/* Set the */ + +static __inline__ void +pccard_set_attribute(device_t dev, struct resource *r, int rid, int flags) +{ }