diff --git a/sdhc.c b/sdhc.c index 5a2d1c8..a103971 100644 --- a/sdhc.c +++ b/sdhc.c @@ -974,7 +974,7 @@ void sdhc_exit(void) #ifdef CAN_HAZ_IRQ irq_disable(IRQ_SDHC); #endif - sdhc_shutdown(&__softc); + sdhc_shutdown(); } #ifdef CAN_HAZ_IPC diff --git a/sdhc.h b/sdhc.h index f78c310..d44c344 100644 --- a/sdhc.h +++ b/sdhc.h @@ -43,18 +43,13 @@ struct sdhc_host { int data_command; }; -struct sdhc_softc { - struct sdhc_host sc_host[SDHC_MAX_HOSTS]; - int sc_nhosts; -}; - +extern struct sdhc_host sc_host; /* Host controller functions called by the attachment driver. */ -int sdhc_host_found(struct sdhc_softc *, bus_space_tag_t, - bus_space_handle_t, int); +int sdhc_host_found(bus_space_tag_t, bus_space_handle_t, int); void sdhc_power(int, void *); -void sdhc_shutdown(void *); -int sdhc_intr(void *); +void sdhc_shutdown(void); +int sdhc_intr(void); void sdhc_init(void); void sdhc_exit(void); void sdhc_irq(void); @@ -216,14 +211,14 @@ void sdhc_ipc(volatile ipc_request *req); //typedef void *sdmmc_chipset_handle_t; struct sdmmc_command; -int sdhc_host_reset(sdmmc_chipset_handle_t); -u_int32_t sdhc_host_ocr(sdmmc_chipset_handle_t); -int sdhc_host_maxblklen(sdmmc_chipset_handle_t); -int sdhc_card_detect(sdmmc_chipset_handle_t); -int sdhc_bus_power(sdmmc_chipset_handle_t, u_int32_t); -int sdhc_bus_clock(sdmmc_chipset_handle_t, int); -void sdhc_card_intr_mask(sdmmc_chipset_handle_t, int); -void sdhc_card_intr_ack(sdmmc_chipset_handle_t); -void sdhc_exec_command(sdmmc_chipset_handle_t, struct sdmmc_command *); +int sdhc_host_reset(struct sdhc_host *hp); +u_int32_t sdhc_host_ocr(struct sdhc_host *hp); +int sdhc_host_maxblklen(struct sdhc_host *hp); +int sdhc_card_detect(struct sdhc_host *hp); +int sdhc_bus_power(struct sdhc_host *hp, u_int32_t); +int sdhc_bus_clock(struct sdhc_host *hp, int); +void sdhc_card_intr_mask(struct sdhc_host *hp, int); +void sdhc_card_intr_ack(struct sdhc_host *hp); +void sdhc_exec_command(struct sdhc_host *hp, struct sdmmc_command *); #endif diff --git a/sdmmc.h b/sdmmc.h index 7d47984..fbac277 100644 --- a/sdmmc.h +++ b/sdmmc.h @@ -23,16 +23,6 @@ typedef void *sdmmc_chipset_handle_t; #define SDMMC_SDCLK_400KHZ 400 #define SDMMC_SDCLK_25MHZ 25000 -struct sdmmcbus_attach_args { - const char *saa_busname; - sdmmc_chipset_tag_t sct; - sdmmc_chipset_handle_t sch; - int flags; - long max_xfer; -}; - -void sdmmc_delay(u_int); - struct sdmmc_csd { int csdver; /* CSD structure format */ int mmcver; /* MMC version (for CID format) */ @@ -138,7 +128,6 @@ struct sdmmc_cis { */ struct sdmmc_function { /* common members */ - struct sdmmc_softc *sc; /* card slot softc */ u_int16_t rca; /* relative card address */ int flags; #define SFF_ERROR 0x0001 /* function is poo; ignore it */ @@ -152,39 +141,6 @@ struct sdmmc_function { sdmmc_response raw_cid; /* temp. storage for decoding */ }; -/* - * Structure describing a single SD/MMC/SDIO card slot. - */ -struct sdmmc_softc { - sdmmc_chipset_tag_t sct; /* host controller chipset tag */ - sdmmc_chipset_handle_t sch; /* host controller chipset handle */ -#define SMF_SD_MODE 0x0001 /* host in SD mode (MMC otherwise) */ -#define SMF_IO_MODE 0x0002 /* host in I/O mode (SD mode only) */ -#define SMF_MEM_MODE 0x0004 /* host in memory mode (SD or MMC) */ -#define SMF_CARD_PRESENT 0x0010 /* card presence noticed */ -#define SMF_CARD_ATTACHED 0x0020 /* card driver(s) attached */ -#define SMF_STOP_AFTER_MULTIPLE 0x0040 /* send a stop after a multiple cmd */ - int sc_function_count; /* number of I/O functions (SDIO) */ - struct sdmmc_function *sc_card; /* selected card */ - struct sdmmc_function *sc_fn0; /* function 0, the card itself */ - int sc_dying; /* bus driver is shutting down */ - struct proc *sc_task_thread; /* asynchronous tasks */ - struct sdmmc_task sc_discover_task; /* card attach/detach task */ - struct sdmmc_task sc_intr_task; /* card interrupt task */ - void *sc_scsibus; /* SCSI bus emulation softc */ - long sc_max_xfer; /* maximum transfer size */ -}; - -/* - * Attach devices at the sdmmc bus. - */ -struct sdmmc_attach_args { - struct scsi_link *scsi_link; /* XXX */ - struct sdmmc_function *sf; -}; - -#define IPL_SDMMC IPL_BIO - #define SDMMC_LOCK(sc) lockmgr(&(sc)->sc_lock, LK_EXCLUSIVE, NULL) #define SDMMC_UNLOCK(sc) lockmgr(&(sc)->sc_lock, LK_RELEASE, NULL) #define SDMMC_ASSERT_LOCKED(sc) \