card_if.m revision 59272
1224090Sdougb# 2262706Serwin# Copyright (c) 1999 M. Warner Losh. 3224090Sdougb# All rights reserved. 4224090Sdougb# 5224090Sdougb# Redistribution and use in source and binary forms, with or without 6224090Sdougb# modification, are permitted provided that the following conditions 7224090Sdougb# are met: 8224090Sdougb# 1. Redistributions of source code must retain the above copyright 9224090Sdougb# notice, this list of conditions and the following disclaimer. 10224090Sdougb# 2. Redistributions in binary form must reproduce the above copyright 11224090Sdougb# notice, this list of conditions and the following disclaimer in the 12224090Sdougb# documentation and/or other materials provided with the distribution. 13224090Sdougb# 14224090Sdougb# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15224090Sdougb# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16224090Sdougb# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17234010Sdougb# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18224090Sdougb# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19224090Sdougb# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20224090Sdougb# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21224090Sdougb# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22224090Sdougb# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23224090Sdougb# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24224090Sdougb# SUCH DAMAGE. 25224090Sdougb# 26224090Sdougb# $FreeBSD: head/sys/dev/pccard/card_if.m 59272 2000-04-16 06:04:13Z imp $ 27224090Sdougb# 28224090Sdougb 29224090Sdougb#include <sys/bus.h> 30224090Sdougb 31224090SdougbINTERFACE card; 32224090Sdougb 33224090Sdougb# 34224090Sdougb# Companion interface for pccard. We need to set attributes for memory 35224090Sdougb# and i/o port mappings (as well as other types of attributes) that have 36224090Sdougb# a well defined meaning inside the pccard/cardbus system. The bus 37224090Sdougb# methods are inadequate for this because this must be done at the time the 38224090Sdougb# resources are set for the device, which predates their activation. Also, 39224090Sdougb# the driver activating the resources doesn't necessarily know or need to know 40224090Sdougb# these attributes. 41224090Sdougb# 42224090SdougbMETHOD int set_res_flags { 43224090Sdougb device_t dev; 44224090Sdougb device_t child; 45224090Sdougb int restype; 46224090Sdougb int rid; 47224090Sdougb u_long value; 48224090Sdougb}; 49262706Serwin 50262706SerwinMETHOD int get_res_flags { 51262706Serwin device_t dev; 52224090Sdougb device_t child; 53262706Serwin int restype; 54262706Serwin int rid; 55262706Serwin u_long *value; 56224090Sdougb}; 57224090Sdougb 58224090SdougbMETHOD int set_memory_offset { 59224090Sdougb device_t dev; 60224090Sdougb device_t child; 61224090Sdougb int rid; 62224090Sdougb u_int32_t offset; 63262706Serwin} 64262706Serwin 65262706Serwin# These might be better static 66262706Serwin 67262706SerwinMETHOD int attach_card { 68224090Sdougb device_t dev; 69224090Sdougb} 70224090Sdougb 71224090SdougbMETHOD int detach_card { 72224090Sdougb device_t dev; 73224090Sdougb int flags; 74224090Sdougb} 75224090Sdougb 76224090SdougbMETHOD int get_type { 77224090Sdougb device_t dev; 78224090Sdougb int *type; 79224090Sdougb} 80224090Sdougb