mmcvar.h revision 183763
1139823Simp/*-
2130933Sbrooks * Copyright (c) 2006 Bernd Walter.  All rights reserved.
3130933Sbrooks * Copyright (c) 2006 M. Warner Losh.  All rights reserved.
4130933Sbrooks *
5130933Sbrooks * Redistribution and use in source and binary forms, with or without
6130933Sbrooks * modification, are permitted provided that the following conditions
7130933Sbrooks * are met:
8130933Sbrooks * 1. Redistributions of source code must retain the above copyright
9130933Sbrooks *    notice, this list of conditions and the following disclaimer.
10130933Sbrooks * 2. Redistributions in binary form must reproduce the above copyright
11130933Sbrooks *    notice, this list of conditions and the following disclaimer in the
12130933Sbrooks *    documentation and/or other materials provided with the distribution.
13130933Sbrooks *
14130933Sbrooks * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
15130933Sbrooks * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
16130933Sbrooks * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
17130933Sbrooks * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
18130933Sbrooks * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19130933Sbrooks * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20130933Sbrooks * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21130933Sbrooks * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22130933Sbrooks * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23130933Sbrooks * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24130933Sbrooks *
25130933Sbrooks * Portions of this software may have been developed with reference to
26130933Sbrooks * the SD Simplified Specification.  The following disclaimer may apply:
27130933Sbrooks *
28130933Sbrooks * The following conditions apply to the release of the simplified
29130933Sbrooks * specification ("Simplified Specification") by the SD Card Association and
30130933Sbrooks * the SD Group. The Simplified Specification is a subset of the complete SD
31130933Sbrooks * Specification which is owned by the SD Card Association and the SD
32130933Sbrooks * Group. This Simplified Specification is provided on a non-confidential
33130933Sbrooks * basis subject to the disclaimers below. Any implementation of the
34130933Sbrooks * Simplified Specification may require a license from the SD Card
35152779Sru * Association, SD Group, SD-3C LLC or other third parties.
36130933Sbrooks *
37130933Sbrooks * Disclaimers:
38130933Sbrooks *
39130933Sbrooks * The information contained in the Simplified Specification is presented only
40130933Sbrooks * as a standard specification for SD Cards and SD Host/Ancillary products and
41130933Sbrooks * is provided "AS-IS" without any representations or warranties of any
42130933Sbrooks * kind. No responsibility is assumed by the SD Group, SD-3C LLC or the SD
43130933Sbrooks * Card Association for any damages, any infringements of patents or other
44130933Sbrooks * right of the SD Group, SD-3C LLC, the SD Card Association or any third
45130933Sbrooks * parties, which may result from its use. No license is granted by
46130933Sbrooks * implication, estoppel or otherwise under any patent or other rights of the
47130933Sbrooks * SD Group, SD-3C LLC, the SD Card Association or any third party. Nothing
48130933Sbrooks * herein shall be construed as an obligation by the SD Group, the SD-3C LLC
49130933Sbrooks * or the SD Card Association to disclose or distribute any technical
50130933Sbrooks * information, know-how or other confidential information to any third party.
51130933Sbrooks *
52130933Sbrooks * "$FreeBSD: head/sys/dev/mmc/mmcvar.h 183763 2008-10-11 13:05:13Z mav $"
53152209Sthompsa */
54160195Ssam
55160195Ssam#ifndef DEV_MMC_MMCVAR_H
56130933Sbrooks#define DEV_MMC_MMCVAR_H
57130933Sbrooks
58130933Sbrooks#include <dev/mmc/bridge.h>
59130933Sbrooks
60130933Sbrooksenum mmc_device_ivars {
61130933Sbrooks    MMC_IVAR_DSR_IMP,
62130933Sbrooks    MMC_IVAR_MEDIA_SIZE,
63130933Sbrooks    MMC_IVAR_RCA,
64130933Sbrooks    MMC_IVAR_SECTOR_SIZE,
65130933Sbrooks    MMC_IVAR_TRAN_SPEED,
66130933Sbrooks    MMC_IVAR_READ_ONLY,
67130933Sbrooks    MMC_IVAR_HIGH_CAP,
68130933Sbrooks    MMC_IVAR_CARD_TYPE,
69130933Sbrooks    MMC_IVAR_BUS_WIDTH,
70130933Sbrooks//    MMC_IVAR_,
71130933Sbrooks};
72130933Sbrooks
73130933Sbrooks/*
74130933Sbrooks * Simplified accessors for pci devices
75130933Sbrooks */
76130933Sbrooks#define MMC_ACCESSOR(var, ivar, type)					\
77130933Sbrooks	__BUS_ACCESSOR(mmc, var, MMC, ivar, type)
78130933Sbrooks
79130933SbrooksMMC_ACCESSOR(dsr_imp, DSR_IMP, int)
80130933SbrooksMMC_ACCESSOR(media_size, MEDIA_SIZE, off_t)
81130933SbrooksMMC_ACCESSOR(rca, RCA, int)
82130933SbrooksMMC_ACCESSOR(sector_size, SECTOR_SIZE, int)
83130933SbrooksMMC_ACCESSOR(tran_speed, TRAN_SPEED, int)
84130933SbrooksMMC_ACCESSOR(read_only, READ_ONLY, int)
85130933SbrooksMMC_ACCESSOR(high_cap, HIGH_CAP, int)
86130933SbrooksMMC_ACCESSOR(card_type, CARD_TYPE, int)
87130933SbrooksMMC_ACCESSOR(bus_width, BUS_WIDTH, int)
88130933Sbrooks
89130933Sbrooks#endif /* DEV_MMC_MMCVAR_H */
90130933Sbrooks