1*4bb7efa7SGarrett D'Amore /*
2*4bb7efa7SGarrett D'Amore  * CDDL HEADER START
3*4bb7efa7SGarrett D'Amore  *
4*4bb7efa7SGarrett D'Amore  * The contents of this file are subject to the terms of the
5*4bb7efa7SGarrett D'Amore  * Common Development and Distribution License (the "License").
6*4bb7efa7SGarrett D'Amore  * You may not use this file except in compliance with the License.
7*4bb7efa7SGarrett D'Amore  *
8*4bb7efa7SGarrett D'Amore  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*4bb7efa7SGarrett D'Amore  * or http://www.opensolaris.org/os/licensing.
10*4bb7efa7SGarrett D'Amore  * See the License for the specific language governing permissions
11*4bb7efa7SGarrett D'Amore  * and limitations under the License.
12*4bb7efa7SGarrett D'Amore  *
13*4bb7efa7SGarrett D'Amore  * When distributing Covered Code, include this CDDL HEADER in each
14*4bb7efa7SGarrett D'Amore  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*4bb7efa7SGarrett D'Amore  * If applicable, add the following below this CDDL HEADER, with the
16*4bb7efa7SGarrett D'Amore  * fields enclosed by brackets "[]" replaced with your own identifying
17*4bb7efa7SGarrett D'Amore  * information: Portions Copyright [yyyy] [name of copyright owner]
18*4bb7efa7SGarrett D'Amore  *
19*4bb7efa7SGarrett D'Amore  * CDDL HEADER END
20*4bb7efa7SGarrett D'Amore  */
21*4bb7efa7SGarrett D'Amore /*
22*4bb7efa7SGarrett D'Amore  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
23*4bb7efa7SGarrett D'Amore  * Use is subject to license terms.
24*4bb7efa7SGarrett D'Amore  */
25*4bb7efa7SGarrett D'Amore 
26*4bb7efa7SGarrett D'Amore #ifndef	_SYS_SDCARD_SDA_IOCTL_H
27*4bb7efa7SGarrett D'Amore #define	_SYS_SDCARD_SDA_IOCTL_H
28*4bb7efa7SGarrett D'Amore 
29*4bb7efa7SGarrett D'Amore #include <sys/types.h>
30*4bb7efa7SGarrett D'Amore 
31*4bb7efa7SGarrett D'Amore #ifdef	__cplusplus
32*4bb7efa7SGarrett D'Amore extern "C" {
33*4bb7efa7SGarrett D'Amore #endif
34*4bb7efa7SGarrett D'Amore 
35*4bb7efa7SGarrett D'Amore /*
36*4bb7efa7SGarrett D'Amore  * These IOCTLs are private between the sdcard cfgadm plugin, and the sda
37*4bb7efa7SGarrett D'Amore  * framework.
38*4bb7efa7SGarrett D'Amore  */
39*4bb7efa7SGarrett D'Amore 
40*4bb7efa7SGarrett D'Amore typedef enum {
41*4bb7efa7SGarrett D'Amore 	SDA_CT_UNKNOWN,
42*4bb7efa7SGarrett D'Amore 	SDA_CT_MMC,
43*4bb7efa7SGarrett D'Amore 	SDA_CT_SDMEM,
44*4bb7efa7SGarrett D'Amore 	SDA_CT_SDHC,
45*4bb7efa7SGarrett D'Amore 	SDA_CT_SDCOMBO,
46*4bb7efa7SGarrett D'Amore 	SDA_CT_SDIO	/* expand on this later */
47*4bb7efa7SGarrett D'Amore } sda_card_type_t;
48*4bb7efa7SGarrett D'Amore 
49*4bb7efa7SGarrett D'Amore typedef struct {
50*4bb7efa7SGarrett D'Amore 
51*4bb7efa7SGarrett D'Amore 	sda_card_type_t	ci_type;
52*4bb7efa7SGarrett D'Amore 
53*4bb7efa7SGarrett D'Amore 	/* these are only valid for memory cards */
54*4bb7efa7SGarrett D'Amore 	uint32_t	ci_mfg;
55*4bb7efa7SGarrett D'Amore 	char		ci_oem[16];	/* mfg id */
56*4bb7efa7SGarrett D'Amore 	char		ci_pid[16];	/* ASCIIZ product */
57*4bb7efa7SGarrett D'Amore 	uint32_t	ci_serial;
58*4bb7efa7SGarrett D'Amore 	uint8_t		ci_month;
59*4bb7efa7SGarrett D'Amore 	uint8_t		ci_year;
60*4bb7efa7SGarrett D'Amore 	uint8_t		ci_major;
61*4bb7efa7SGarrett D'Amore 	uint8_t		ci_minor;
62*4bb7efa7SGarrett D'Amore } sda_card_info_t;
63*4bb7efa7SGarrett D'Amore 
64*4bb7efa7SGarrett D'Amore struct sda_ap_control {
65*4bb7efa7SGarrett D'Amore 	unsigned	cmd;
66*4bb7efa7SGarrett D'Amore 	size_t		size;
67*4bb7efa7SGarrett D'Amore 	void		*data;
68*4bb7efa7SGarrett D'Amore };
69*4bb7efa7SGarrett D'Amore 
70*4bb7efa7SGarrett D'Amore #ifdef	_KERNEL
71*4bb7efa7SGarrett D'Amore struct sda_ap_control32 {
72*4bb7efa7SGarrett D'Amore 	unsigned	cmd;
73*4bb7efa7SGarrett D'Amore 	size32_t	size;
74*4bb7efa7SGarrett D'Amore 	caddr32_t	data;
75*4bb7efa7SGarrett D'Amore };
76*4bb7efa7SGarrett D'Amore #endif
77*4bb7efa7SGarrett D'Amore 
78*4bb7efa7SGarrett D'Amore /* AP_CONTROL commands */
79*4bb7efa7SGarrett D'Amore #define	SDA_CFGA_GET_CARD_INFO		1
80*4bb7efa7SGarrett D'Amore #define	SDA_CFGA_GET_DEVICE_PATH	2
81*4bb7efa7SGarrett D'Amore #define	SDA_CFGA_RESET_SLOT		3
82*4bb7efa7SGarrett D'Amore 
83*4bb7efa7SGarrett D'Amore #ifdef	__cplusplus
84*4bb7efa7SGarrett D'Amore }
85*4bb7efa7SGarrett D'Amore #endif
86*4bb7efa7SGarrett D'Amore 
87*4bb7efa7SGarrett D'Amore #endif	/* _SYS_SDCARD_SDA_IOCTL_H */