card_if.m revision 59193
153855Simp#
253855Simp# Copyright (c) 1999 M. Warner Losh.
353855Simp# All rights reserved.
453855Simp#
553855Simp# Redistribution and use in source and binary forms, with or without
653855Simp# modification, are permitted provided that the following conditions
753855Simp# are met:
853855Simp# 1. Redistributions of source code must retain the above copyright
953855Simp#    notice, this list of conditions and the following disclaimer.
1053855Simp# 2. Redistributions in binary form must reproduce the above copyright
1153855Simp#    notice, this list of conditions and the following disclaimer in the
1253855Simp#    documentation and/or other materials provided with the distribution.
1353855Simp#
1453855Simp# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1553855Simp# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1653855Simp# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1753855Simp# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
1853855Simp# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1953855Simp# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2053855Simp# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2153855Simp# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2253855Simp# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2353855Simp# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2453855Simp# SUCH DAMAGE.
2553855Simp#
2653855Simp# $FreeBSD: head/sys/dev/pccard/card_if.m 59193 2000-04-13 06:42:58Z imp $
2753855Simp#
2853855Simp
2953855SimpINTERFACE card;
3053855Simp
3153855Simp#
3253855Simp# Companion interface for pccard.  We need to set attributes for memory
3353855Simp# and i/o port mappings (as well as other types of attributes) that have
3453855Simp# a well defined meaning inside the pccard/cardbus system.  The bus
3553855Simp# methods are inadequate for this because this must be done at the time the
3653855Simp# resources are set for the device, which predates their activation.  Also,
3753855Simp# the driver activating the resources doesn't necessarily know or need to know
3853855Simp# these attributes.
3953855Simp#
4059193SimpMETHOD int set_res_flags {
4153855Simp	device_t dev;
4253855Simp	device_t child;
4359193Simp	int	 restype;
4458581Simp	int	 rid;
4559193Simp	u_long	 value;
4653855Simp};
4753855Simp
4859193SimpMETHOD int get_res_flags {
4953855Simp	device_t dev;
5053855Simp	device_t child;
5159193Simp	int	 restype;
5253855Simp	int	 rid;
5359193Simp	u_long	 *value;
5453855Simp};
5559193Simp
5659193SimpMETHOD int set_memory_offset {
5759193Simp	device_t  dev;
5859193Simp	device_t  child;
5959193Simp        int	  rid;
6059193Simp        u_int32_t offset;
6159193Simp}
6259193Simp
6359193Simp# These might be better static
6459193Simp
6559193SimpMETHOD int attach_card {
6659193Simp	device_t  dev;
6759193Simp}
6859193Simp
6959193SimpMETHOD int detach_card {
7059193Simp	device_t  dev;
7159193Simp	int	  flags;
7259193Simp}
7359193Simp
7459193SimpMETHOD int get_type {
7559193Simp	device_t  dev;
7659193Simp	int	  *type;
7759193Simp}
78