4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore/*
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore * CDDL HEADER START
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore *
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore * The contents of this file are subject to the terms of the
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore * Common Development and Distribution License (the "License").
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore * You may not use this file except in compliance with the License.
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore *
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore * or http://www.opensolaris.org/os/licensing.
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore * See the License for the specific language governing permissions
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore * and limitations under the License.
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore *
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore * When distributing Covered Code, include this CDDL HEADER in each
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore * If applicable, add the following below this CDDL HEADER, with the
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore * fields enclosed by brackets "[]" replaced with your own identifying
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore * information: Portions Copyright [yyyy] [name of copyright owner]
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore *
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore * CDDL HEADER END
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore */
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore/*
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore * Use is subject to license terms.
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore */
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore#ifndef _SYS_SDCARD_SDA_IOCTL_H
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore#define _SYS_SDCARD_SDA_IOCTL_H
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore#include <sys/types.h>
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore#ifdef __cplusplus
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amoreextern "C" {
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore#endif
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore/*
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore * These IOCTLs are private between the sdcard cfgadm plugin, and the sda
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore * framework.
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore */
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amoretypedef enum {
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore SDA_CT_UNKNOWN,
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore SDA_CT_MMC,
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore SDA_CT_SDMEM,
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore SDA_CT_SDHC,
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore SDA_CT_SDCOMBO,
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore SDA_CT_SDIO /* expand on this later */
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore} sda_card_type_t;
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amoretypedef struct {
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore sda_card_type_t ci_type;
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore /* these are only valid for memory cards */
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore uint32_t ci_mfg;
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore char ci_oem[16]; /* mfg id */
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore char ci_pid[16]; /* ASCIIZ product */
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore uint32_t ci_serial;
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore uint8_t ci_month;
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore uint8_t ci_year;
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore uint8_t ci_major;
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore uint8_t ci_minor;
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore} sda_card_info_t;
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amorestruct sda_ap_control {
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore unsigned cmd;
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore size_t size;
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore void *data;
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore};
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore#ifdef _KERNEL
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amorestruct sda_ap_control32 {
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore unsigned cmd;
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore size32_t size;
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore caddr32_t data;
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore};
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore#endif
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore/* AP_CONTROL commands */
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore#define SDA_CFGA_GET_CARD_INFO 1
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore#define SDA_CFGA_GET_DEVICE_PATH 2
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore#define SDA_CFGA_RESET_SLOT 3
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore#ifdef __cplusplus
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore}
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore#endif
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore#endif /* _SYS_SDCARD_SDA_IOCTL_H */