sda_impl.h revision 3f7d54a6b84904c8f4d8daa4c7b577bede7df8b9
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
*/
#ifndef _SYS_SDCARD_SDA_IMPL_H
#define _SYS_SDCARD_SDA_IMPL_H
#ifdef __cplusplus
extern "C" {
#endif
/*
* Type and structure definitions.
*/
typedef struct sda_slot sda_slot_t;
/*
* Per slot state.
*/
struct sda_slot {
void *s_prv; /* bus private data */
int s_slot_num;
/* these are protected by the evlock */
#define SLOTF_WRITABLE 0x0004
#define SLOTF_4BITS 0x0008
#define SLOTF_IFCOND 0x0010
#define SLOTF_MMC 0x0020
#define SLOTF_SDMEM 0x0040
#define SLOTF_SDIO 0x0080
#define SLOTF_SDHC 0x0100
#define SLOT_CAP_NOPIO 0x0002
#define SLOT_CAP_HISPEED 0x0004
#define SLOT_CAP_4BITS 0x0008
/*
* Slot operations. Slot local copy for performance.
*/
/*
* Recursive locking of slot.
*/
/*
* Event notification/thread wakeup.
*/
/*
* Asynch. threads.
*/
/*
* Timestamping for cfgadm benefit.
*/
/*
* Memory card-specific.
*/
/* Other CID and CSD values */
};
/*
* Per host state. One per devinfo node. There could be multiple
* slots per devinfo node.
*/
struct sda_host {
int h_nslot;
};
/*
* Useful function-like macros.
*/
/*
*/
void sda_cmd_init(void);
void sda_cmd_fini(void);
void sda_cmd_list_init(list_t *);
void sda_cmd_list_fini(list_t *);
void *, int);
void *, int);
void sda_cmd_free(sda_cmd_t *);
void *sda_cmd_data(sda_cmd_t *);
/*
*/
/*
*/
void sda_mem_init(struct modlinkage *);
void sda_mem_fini(struct modlinkage *);
int sda_mem_parse_cid_csd(sda_slot_t *);
int sda_mem_bd_read(void *, bd_xfer_t *);
int sda_mem_bd_write(void *, bd_xfer_t *);
void sda_mem_bd_driveinfo(void *, bd_drive_t *);
int sda_mem_bd_mediainfo(void *, bd_media_t *);
/*
*/
void sda_nexus_init(void);
void sda_nexus_fini(void);
void sda_nexus_register(sda_host_t *);
void sda_nexus_unregister(sda_host_t *);
void *);
void sda_nexus_remove(sda_slot_t *);
void sda_nexus_insert(sda_slot_t *);
void sda_nexus_reap(void *);
/*
*/
void sda_slot_init(sda_slot_t *);
void sda_slot_fini(sda_slot_t *);
void sda_slot_enter(sda_slot_t *);
void sda_slot_exit(sda_slot_t *);
void sda_slot_attach(sda_slot_t *);
void sda_slot_detach(sda_slot_t *);
void sda_slot_suspend(sda_slot_t *);
void sda_slot_resume(sda_slot_t *);
void sda_slot_reset(sda_slot_t *);
void sda_slot_wakeup(sda_slot_t *);
void sda_slot_detect(sda_slot_t *);
int sda_slot_power_on(sda_slot_t *);
void sda_slot_power_off(sda_slot_t *);
void sda_slot_reset(sda_slot_t *);
void sda_slot_shutdown(sda_slot_t *);
/*PRINTFLIKE2*/
void sda_slot_err(sda_slot_t *, const char *, ...);
/*PRINTFLIKE2*/
void sda_slot_log(sda_slot_t *, const char *, ...);
#ifdef DEBUG
#else
#define sda_slot_debug(...)
#endif
#ifdef __cplusplus
}
#endif
#endif /* _SYS_SDCARD_SDA_IMPL_H */