1163516Simp#-
2163516Simp# Copyright (c) 2006 M. Warner Losh
3163516Simp# All rights reserved.
4163516Simp#
5163516Simp# Redistribution and use in source and binary forms, with or without
6163516Simp# modification, are permitted provided that the following conditions
7163516Simp# are met:
8163516Simp# 1. Redistributions of source code must retain the above copyright
9163516Simp#    notice, this list of conditions and the following disclaimer.
10163516Simp# 2. Redistributions in binary form must reproduce the above copyright
11163516Simp#    notice, this list of conditions and the following disclaimer in the
12163516Simp#    documentation and/or other materials provided with the distribution.
13163516Simp#
14163516Simp# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15163516Simp# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16163516Simp# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17163516Simp# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18163516Simp# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19163516Simp# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20163516Simp# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21163516Simp# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22163516Simp# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23163516Simp# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24163516Simp# SUCH DAMAGE.
25163516Simp#
26170002Simp# Portions of this software may have been developed with reference to
27170002Simp# the SD Simplified Specification.  The following disclaimer may apply:
28170002Simp#
29170002Simp# The following conditions apply to the release of the simplified
30170002Simp# specification ("Simplified Specification") by the SD Card Association and
31170002Simp# the SD Group. The Simplified Specification is a subset of the complete SD
32170002Simp# Specification which is owned by the SD Card Association and the SD
33170002Simp# Group. This Simplified Specification is provided on a non-confidential
34170002Simp# basis subject to the disclaimers below. Any implementation of the
35170002Simp# Simplified Specification may require a license from the SD Card
36170002Simp# Association, SD Group, SD-3C LLC or other third parties.
37170002Simp#
38170002Simp# Disclaimers:
39170002Simp#
40170002Simp# The information contained in the Simplified Specification is presented only
41170002Simp# as a standard specification for SD Cards and SD Host/Ancillary products and
42170002Simp# is provided "AS-IS" without any representations or warranties of any
43170002Simp# kind. No responsibility is assumed by the SD Group, SD-3C LLC or the SD
44170002Simp# Card Association for any damages, any infringements of patents or other
45170002Simp# right of the SD Group, SD-3C LLC, the SD Card Association or any third
46170002Simp# parties, which may result from its use. No license is granted by
47170002Simp# implication, estoppel or otherwise under any patent or other rights of the
48170002Simp# SD Group, SD-3C LLC, the SD Card Association or any third party. Nothing
49170002Simp# herein shall be construed as an obligation by the SD Group, the SD-3C LLC
50170002Simp# or the SD Card Association to disclose or distribute any technical
51170002Simp# information, know-how or other confidential information to any third party.
52170002Simp#
53163516Simp# $FreeBSD: releng/10.3/sys/dev/mmc/mmcbus_if.m 170002 2007-05-26 05:23:36Z imp $
54163516Simp#
55163516Simp
56163516Simp#include <dev/mmc/mmcreg.h>
57163516Simp#include <dev/mmc/bridge.h>
58163516Simp
59163516Simp#
60163516Simp# This is the set of callbacks that mmc bridges call into the bus, or
61163516Simp# that mmc/sd card drivers call to make requests.
62163516Simp#
63163516Simp
64163516SimpINTERFACE mmcbus;
65163516Simp
66163516Simp#
67163516Simp# Queue and wait for a request.
68163516Simp#
69163516SimpMETHOD int wait_for_request {
70163516Simp	device_t	brdev;
71163516Simp	device_t	reqdev;
72163516Simp	struct mmc_request *req;
73163516Simp};
74163516Simp
75163516Simp#
76163516Simp# Claim the current bridge, blocking the current thread until the host
77163516Simp# is no longer busy.
78163516Simp#
79163516SimpMETHOD int acquire_bus {
80163516Simp	device_t	brdev;
81163516Simp	device_t	reqdev;
82163516Simp}
83163516Simp
84163516Simp#
85163516Simp# Release the current bridge.
86163516Simp#
87163516SimpMETHOD int release_bus {
88163516Simp	device_t	brdev;
89163516Simp	device_t	reqdev;
90163516Simp}
91