1*72dec079SMarius Strobl /*- 2*72dec079SMarius Strobl * Copyright (c) 2006 Bernd Walter. All rights reserved. 3*72dec079SMarius Strobl * Copyright (c) 2006 M. Warner Losh. All rights reserved. 4*72dec079SMarius Strobl * 5*72dec079SMarius Strobl * Redistribution and use in source and binary forms, with or without 6*72dec079SMarius Strobl * modification, are permitted provided that the following conditions 7*72dec079SMarius Strobl * are met: 8*72dec079SMarius Strobl * 1. Redistributions of source code must retain the above copyright 9*72dec079SMarius Strobl * notice, this list of conditions and the following disclaimer. 10*72dec079SMarius Strobl * 2. Redistributions in binary form must reproduce the above copyright 11*72dec079SMarius Strobl * notice, this list of conditions and the following disclaimer in the 12*72dec079SMarius Strobl * documentation and/or other materials provided with the distribution. 13*72dec079SMarius Strobl * 14*72dec079SMarius Strobl * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 15*72dec079SMarius Strobl * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 16*72dec079SMarius Strobl * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 17*72dec079SMarius Strobl * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 18*72dec079SMarius Strobl * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 19*72dec079SMarius Strobl * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 20*72dec079SMarius Strobl * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 21*72dec079SMarius Strobl * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22*72dec079SMarius Strobl * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 23*72dec079SMarius Strobl * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24*72dec079SMarius Strobl * 25*72dec079SMarius Strobl * Portions of this software may have been developed with reference to 26*72dec079SMarius Strobl * the SD Simplified Specification. The following disclaimer may apply: 27*72dec079SMarius Strobl * 28*72dec079SMarius Strobl * The following conditions apply to the release of the simplified 29*72dec079SMarius Strobl * specification ("Simplified Specification") by the SD Card Association and 30*72dec079SMarius Strobl * the SD Group. The Simplified Specification is a subset of the complete SD 31*72dec079SMarius Strobl * Specification which is owned by the SD Card Association and the SD 32*72dec079SMarius Strobl * Group. This Simplified Specification is provided on a non-confidential 33*72dec079SMarius Strobl * basis subject to the disclaimers below. Any implementation of the 34*72dec079SMarius Strobl * Simplified Specification may require a license from the SD Card 35*72dec079SMarius Strobl * Association, SD Group, SD-3C LLC or other third parties. 36*72dec079SMarius Strobl * 37*72dec079SMarius Strobl * Disclaimers: 38*72dec079SMarius Strobl * 39*72dec079SMarius Strobl * The information contained in the Simplified Specification is presented only 40*72dec079SMarius Strobl * as a standard specification for SD Cards and SD Host/Ancillary products and 41*72dec079SMarius Strobl * is provided "AS-IS" without any representations or warranties of any 42*72dec079SMarius Strobl * kind. No responsibility is assumed by the SD Group, SD-3C LLC or the SD 43*72dec079SMarius Strobl * Card Association for any damages, any infringements of patents or other 44*72dec079SMarius Strobl * right of the SD Group, SD-3C LLC, the SD Card Association or any third 45*72dec079SMarius Strobl * parties, which may result from its use. No license is granted by 46*72dec079SMarius Strobl * implication, estoppel or otherwise under any patent or other rights of the 47*72dec079SMarius Strobl * SD Group, SD-3C LLC, the SD Card Association or any third party. Nothing 48*72dec079SMarius Strobl * herein shall be construed as an obligation by the SD Group, the SD-3C LLC 49*72dec079SMarius Strobl * or the SD Card Association to disclose or distribute any technical 50*72dec079SMarius Strobl * information, know-how or other confidential information to any third party. 51*72dec079SMarius Strobl * 52*72dec079SMarius Strobl * $FreeBSD$ 53*72dec079SMarius Strobl */ 54*72dec079SMarius Strobl 55*72dec079SMarius Strobl #ifndef DEV_MMC_SUBR_H 56*72dec079SMarius Strobl #define DEV_MMC_SUBR_H 57*72dec079SMarius Strobl 58*72dec079SMarius Strobl struct mmc_command; 59*72dec079SMarius Strobl 60*72dec079SMarius Strobl int mmc_send_ext_csd(device_t brdev, device_t reqdev, uint8_t *rawextcsd); 61*72dec079SMarius Strobl int mmc_send_status(device_t brdev, device_t reqdev, uint16_t rca, 62*72dec079SMarius Strobl uint32_t *status); 63*72dec079SMarius Strobl int mmc_switch(device_t brdev, device_t reqdev, uint16_t rca, uint8_t set, 64*72dec079SMarius Strobl uint8_t index, uint8_t value, u_int timeout, bool send_status); 65*72dec079SMarius Strobl int mmc_switch_status(device_t brdev, device_t reqdev, uint16_t rca, 66*72dec079SMarius Strobl u_int timeout); 67*72dec079SMarius Strobl int mmc_wait_for_app_cmd(device_t brdev, device_t reqdev, uint16_t rca, 68*72dec079SMarius Strobl struct mmc_command *cmd, int retries); 69*72dec079SMarius Strobl int mmc_wait_for_cmd(device_t brdev, device_t reqdev, struct mmc_command *cmd, 70*72dec079SMarius Strobl int retries); 71*72dec079SMarius Strobl 72*72dec079SMarius Strobl #endif /* DEV_MMC_SUBR_H */ 73