diff options
Diffstat (limited to 'sys/dev/pccard/card_if.m')
-rw-r--r-- | sys/dev/pccard/card_if.m | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/sys/dev/pccard/card_if.m b/sys/dev/pccard/card_if.m index 621a041..9abb579 100644 --- a/sys/dev/pccard/card_if.m +++ b/sys/dev/pccard/card_if.m @@ -30,6 +30,9 @@ INTERFACE card; +# WARNING: THIS FILE IS USED BY BOTH OLDCARD AND NEWCARD. MAKE SURE +# YOU TEST BOTH KERNELS IF CHANGING THIS FILE. + # # Companion interface for pccard. We need to set attributes for memory # and i/o port mappings (as well as other types of attributes) that have @@ -149,6 +152,10 @@ METHOD int deactivate_function { # # Drivers wishing to not retain OLDCARD compatibility needn't do this. # +# The compat_do_* versions are so that we can make the pccard_compat_probe +# and _attach static lines and have the bus system pick the right version +# to use so we don't enshrine pccard_* symbols in the driver's module. +# METHOD int compat_probe { device_t dev; } @@ -157,6 +164,28 @@ METHOD int compat_attach { device_t dev; } +CODE { + static int null_do_probe(device_t bus, device_t dev) + { + return (CARD_COMPAT_DO_PROBE(device_get_parent(bus), dev)); + } + + static int null_do_attach(device_t bus, device_t dev) + { + return (CARD_COMPAT_DO_ATTACH(device_get_parent(bus), dev)); + } +} + +METHOD int compat_do_probe { + device_t bus; + device_t dev; +} DEFAULT null_do_attach; + +METHOD int compat_do_attach { + device_t bus; + device_t dev; +} DEFAULT null_do_attach; + # # Helper method for the above. When a compatibility driver is converted, # one must write a match routine. This routine is unused on OLDCARD but |