card_if.m revision 59193
176082Sbmah#
276082Sbmah# Copyright (c) 1999 M. Warner Losh.
376082Sbmah# All rights reserved.
476082Sbmah#
576082Sbmah# Redistribution and use in source and binary forms, with or without
676082Sbmah# modification, are permitted provided that the following conditions
776082Sbmah# are met:
876082Sbmah# 1. Redistributions of source code must retain the above copyright
976082Sbmah#    notice, this list of conditions and the following disclaimer.
1076082Sbmah# 2. Redistributions in binary form must reproduce the above copyright
1176082Sbmah#    notice, this list of conditions and the following disclaimer in the
1276082Sbmah#    documentation and/or other materials provided with the distribution.
1376082Sbmah#
1476082Sbmah# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1576082Sbmah# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1676082Sbmah# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1776082Sbmah# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
1876082Sbmah# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1976082Sbmah# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2076082Sbmah# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2176082Sbmah# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2276082Sbmah# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2376560Sbmah# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2476560Sbmah# SUCH DAMAGE.
2576560Sbmah#
2676560Sbmah# $FreeBSD: head/sys/dev/pccard/card_if.m 59193 2000-04-13 06:42:58Z imp $
2776560Sbmah#
2876560Sbmah
2976560SbmahINTERFACE card;
3076560Sbmah
3176082Sbmah#
3276082Sbmah# Companion interface for pccard.  We need to set attributes for memory
3376082Sbmah# and i/o port mappings (as well as other types of attributes) that have
3476082Sbmah# a well defined meaning inside the pccard/cardbus system.  The bus
3576082Sbmah# methods are inadequate for this because this must be done at the time the
3676082Sbmah# resources are set for the device, which predates their activation.  Also,
3776082Sbmah# the driver activating the resources doesn't necessarily know or need to know
3876082Sbmah# these attributes.
3976082Sbmah#
4076082SbmahMETHOD int set_res_flags {
4176082Sbmah	device_t dev;
4276082Sbmah	device_t child;
4376560Sbmah	int	 restype;
4476560Sbmah	int	 rid;
4576560Sbmah	u_long	 value;
4676560Sbmah};
4776082Sbmah
4876082SbmahMETHOD int get_res_flags {
4976082Sbmah	device_t dev;
5076082Sbmah	device_t child;
5176082Sbmah	int	 restype;
5276082Sbmah	int	 rid;
5376082Sbmah	u_long	 *value;
5476082Sbmah};
5576082Sbmah
5676082SbmahMETHOD int set_memory_offset {
5776082Sbmah	device_t  dev;
5876082Sbmah	device_t  child;
5976082Sbmah        int	  rid;
6076082Sbmah        u_int32_t offset;
6176082Sbmah}
6276082Sbmah
6376082Sbmah# These might be better static
6476082Sbmah
6576082SbmahMETHOD int attach_card {
6676082Sbmah	device_t  dev;
6776082Sbmah}
6876082Sbmah
6976082SbmahMETHOD int detach_card {
7076082Sbmah	device_t  dev;
7176082Sbmah	int	  flags;
7276082Sbmah}
7376082Sbmah
7476082SbmahMETHOD int get_type {
7576082Sbmah	device_t  dev;
7676082Sbmah	int	  *type;
7776082Sbmah}
7876082Sbmah