summaryrefslogtreecommitdiffstats
path: root/sys/dev/pccard/pccardvar.h
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2005-07-01 03:40:28 +0000
committerimp <imp@FreeBSD.org>2005-07-01 03:40:28 +0000
commit64e8045b622170b7380ae17279553b6f6a2391bb (patch)
tree7f174dcb39ef156e093c310bb088dfea512e45b5 /sys/dev/pccard/pccardvar.h
parent3cade8d074f10ed4002c26e30494d70bb274b767 (diff)
downloadFreeBSD-src-64e8045b622170b7380ae17279553b6f6a2391bb.zip
FreeBSD-src-64e8045b622170b7380ae17279553b6f6a2391bb.tar.gz
Add a much-requested feature: The ability for pccard attachments to
scan the CIS for interesting tuples. 95% of what can be obtained from the CIS is harvested by the pccard layer and presented to the user in standard function calls. However, there are special needs at times where the standard stuff doesn't suffice. This is for those special cases. CARD_SCAN_CIS(device_get_parent(dev), function, argp) scans the CIS of the card, passing each tuple to function with the tuple and argp as its arguments. Returning 0 continues the scan, while returning 1 terminates the scan. The value of the last invocation of function is returned from this function. int (*pccard_scan_t)(struct pccard_tuple *tuple, void *argp) function called for each tuple. Elements of the CIS tuple can be read with pccard_tuple_read_{1,2,3,4,n}(). You are reading the actual tuple memory each time, in case your card has registers in the CIS. # I suppose these things should be documented in pccard(4) or something like # that. # I plan on unifying cardbus CIS support in a similar way. Approved by: re (scottl)
Diffstat (limited to 'sys/dev/pccard/pccardvar.h')
-rw-r--r--sys/dev/pccard/pccardvar.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/dev/pccard/pccardvar.h b/sys/dev/pccard/pccardvar.h
index c4bd0e3..3df9fcc 100644
--- a/sys/dev/pccard/pccardvar.h
+++ b/sys/dev/pccard/pccardvar.h
@@ -221,6 +221,8 @@ struct pccard_tuple {
bus_space_handle_t memh;
};
+typedef int (*pccard_scan_t)(struct pccard_tuple *, void *);
+
struct pccard_product {
const char *pp_name; /* NULL if end of table */
#define PCCARD_VENDOR_ANY (0xffffffff)
@@ -250,8 +252,7 @@ pccard_product_lookup(device_t dev, const struct pccard_product *tab,
void pccard_read_cis(struct pccard_softc *);
void pccard_check_cis_quirks(device_t);
void pccard_print_cis(device_t);
-int pccard_scan_cis(device_t,
- int (*) (struct pccard_tuple *, void *), void *);
+int pccard_scan_cis(device_t, pccard_scan_t, void *);
#define pccard_cis_read_1(tuple, idx0) \
(bus_space_read_1((tuple)->memt, (tuple)->memh, (tuple)->mult*(idx0)))
OpenPOWER on IntegriCloud