sda_host.c revision 4bb7efa72ed531c10f097919636e67724ec4c25a
/*
* 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
*/
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* SD card host support. This is the API that host drivers access.
*/
/*
* Static Variables.
*/
static struct bus_ops sda_host_bus_ops = {
BUSO_REV, /* busops_rev */
nullbusmap, /* bus_map */
NULL, /* bus_get_intrspec (OBSOLETE) */
NULL, /* bus_add_intrspec (OBSOLETE) */
NULL, /* bus_remove_intrspec (OBSOLETE) */
i_ddi_map_fault, /* bus_map_fault */
ddi_dma_map, /* bus_dma_map */
ddi_dma_allochdl, /* bus_dma_allochdl */
ddi_dma_freehdl, /* bus_dma_freehdl */
ddi_dma_bindhdl, /* bus_dma_bindhdl */
ddi_dma_unbindhdl, /* bus_dma_unbindhdl */
ddi_dma_flush, /* bus_dma_flush */
ddi_dma_win, /* bus_dma_win */
ddi_dma_mctl, /* bus_dma_ctl */
sda_nexus_bus_ctl, /* bus_ctl */
ddi_bus_prop_op, /* bus_prop_op */
NULL, /* bus_get_eventcookie */
NULL, /* bus_add_eventcall */
NULL, /* bus_remove_eventcall */
NULL, /* bus_post_event */
NULL, /* bus_intr_ctl (OBSOLETE) */
NULL, /* bus_fm_init */
NULL, /* bus_fm_fini */
NULL, /* bus_fm_access_enter */
NULL, /* bus_fm_access_exit */
NULL, /* bus_power */
NULL, /* bus_intr_op */
};
static struct cb_ops sda_host_cb_ops = {
sda_nexus_open, /* cb_open */
sda_nexus_close, /* cb_close */
nodev, /* cb_strategy */
nodev, /* cb_print */
nodev, /* cb_dump */
nodev, /* cb_read */
nodev, /* cb_write */
sda_nexus_ioctl, /* cb_ioctl */
nodev, /* cb_devmap */
nodev, /* cb_mmap */
nodev, /* cb_segmap */
nochpoll, /* cb_poll */
ddi_prop_op, /* cb_prop_op */
NULL, /* cb_str */
D_MP, /* cb_flag */
CB_REV, /* cb_rev */
nodev, /* cb_aread */
nodev, /* cb_awrite */
};
/*
* Implementation.
*/
void
{
}
void
{
}
{
sda_host_t *h;
int i;
return (NULL);
}
h = kmem_zalloc(sizeof (*h), KM_SLEEP);
/* initialize each slot */
for (i = 0; i < nslot; i++) {
slot->s_slot_num = i;
}
return (h);
}
void
{
int i;
for (i = 0; i < h->h_nslot; i++) {
sda_slot_fini(&h->h_slots[i]);
}
kmem_free(h, sizeof (*h));
}
void
{
}
int
{
int i;
/*
* Attach slots.
*/
for (i = 0; i < h->h_nslot; i++) {
sda_slot_attach(&h->h_slots[i]);
/*
* Initiate card detection.
*/
sda_host_detect(h, i);
}
/*
* Register (create) nexus minor nodes.
*/
return (DDI_SUCCESS);
}
void
{
int i;
/*
* Unregister nexus minor nodes.
*/
/*
* Detach slots.
*/
for (i = 0; i < h->h_nslot; i++) {
sda_slot_detach(&h->h_slots[i]);
}
}
void
{
}
void
{
}
void
{
}
void
{
if (h != NULL) {
} else {
}
}