mirror of
https://github.com/fail0verflow/mini.git
synced 2024-11-16 16:39:25 +01:00
hackity hack
This commit is contained in:
parent
d7e80776a2
commit
661a30fc21
2
sdhc.c
2
sdhc.c
@ -974,7 +974,7 @@ void sdhc_exit(void)
|
|||||||
#ifdef CAN_HAZ_IRQ
|
#ifdef CAN_HAZ_IRQ
|
||||||
irq_disable(IRQ_SDHC);
|
irq_disable(IRQ_SDHC);
|
||||||
#endif
|
#endif
|
||||||
sdhc_shutdown(&__softc);
|
sdhc_shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CAN_HAZ_IPC
|
#ifdef CAN_HAZ_IPC
|
||||||
|
31
sdhc.h
31
sdhc.h
@ -43,18 +43,13 @@ struct sdhc_host {
|
|||||||
int data_command;
|
int data_command;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct sdhc_softc {
|
extern struct sdhc_host sc_host;
|
||||||
struct sdhc_host sc_host[SDHC_MAX_HOSTS];
|
|
||||||
int sc_nhosts;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/* Host controller functions called by the attachment driver. */
|
/* Host controller functions called by the attachment driver. */
|
||||||
int sdhc_host_found(struct sdhc_softc *, bus_space_tag_t,
|
int sdhc_host_found(bus_space_tag_t, bus_space_handle_t, int);
|
||||||
bus_space_handle_t, int);
|
|
||||||
void sdhc_power(int, void *);
|
void sdhc_power(int, void *);
|
||||||
void sdhc_shutdown(void *);
|
void sdhc_shutdown(void);
|
||||||
int sdhc_intr(void *);
|
int sdhc_intr(void);
|
||||||
void sdhc_init(void);
|
void sdhc_init(void);
|
||||||
void sdhc_exit(void);
|
void sdhc_exit(void);
|
||||||
void sdhc_irq(void);
|
void sdhc_irq(void);
|
||||||
@ -216,14 +211,14 @@ void sdhc_ipc(volatile ipc_request *req);
|
|||||||
//typedef void *sdmmc_chipset_handle_t;
|
//typedef void *sdmmc_chipset_handle_t;
|
||||||
struct sdmmc_command;
|
struct sdmmc_command;
|
||||||
|
|
||||||
int sdhc_host_reset(sdmmc_chipset_handle_t);
|
int sdhc_host_reset(struct sdhc_host *hp);
|
||||||
u_int32_t sdhc_host_ocr(sdmmc_chipset_handle_t);
|
u_int32_t sdhc_host_ocr(struct sdhc_host *hp);
|
||||||
int sdhc_host_maxblklen(sdmmc_chipset_handle_t);
|
int sdhc_host_maxblklen(struct sdhc_host *hp);
|
||||||
int sdhc_card_detect(sdmmc_chipset_handle_t);
|
int sdhc_card_detect(struct sdhc_host *hp);
|
||||||
int sdhc_bus_power(sdmmc_chipset_handle_t, u_int32_t);
|
int sdhc_bus_power(struct sdhc_host *hp, u_int32_t);
|
||||||
int sdhc_bus_clock(sdmmc_chipset_handle_t, int);
|
int sdhc_bus_clock(struct sdhc_host *hp, int);
|
||||||
void sdhc_card_intr_mask(sdmmc_chipset_handle_t, int);
|
void sdhc_card_intr_mask(struct sdhc_host *hp, int);
|
||||||
void sdhc_card_intr_ack(sdmmc_chipset_handle_t);
|
void sdhc_card_intr_ack(struct sdhc_host *hp);
|
||||||
void sdhc_exec_command(sdmmc_chipset_handle_t, struct sdmmc_command *);
|
void sdhc_exec_command(struct sdhc_host *hp, struct sdmmc_command *);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
44
sdmmc.h
44
sdmmc.h
@ -23,16 +23,6 @@ typedef void *sdmmc_chipset_handle_t;
|
|||||||
#define SDMMC_SDCLK_400KHZ 400
|
#define SDMMC_SDCLK_400KHZ 400
|
||||||
#define SDMMC_SDCLK_25MHZ 25000
|
#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 {
|
struct sdmmc_csd {
|
||||||
int csdver; /* CSD structure format */
|
int csdver; /* CSD structure format */
|
||||||
int mmcver; /* MMC version (for CID format) */
|
int mmcver; /* MMC version (for CID format) */
|
||||||
@ -138,7 +128,6 @@ struct sdmmc_cis {
|
|||||||
*/
|
*/
|
||||||
struct sdmmc_function {
|
struct sdmmc_function {
|
||||||
/* common members */
|
/* common members */
|
||||||
struct sdmmc_softc *sc; /* card slot softc */
|
|
||||||
u_int16_t rca; /* relative card address */
|
u_int16_t rca; /* relative card address */
|
||||||
int flags;
|
int flags;
|
||||||
#define SFF_ERROR 0x0001 /* function is poo; ignore it */
|
#define SFF_ERROR 0x0001 /* function is poo; ignore it */
|
||||||
@ -152,39 +141,6 @@ struct sdmmc_function {
|
|||||||
sdmmc_response raw_cid; /* temp. storage for decoding */
|
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_LOCK(sc) lockmgr(&(sc)->sc_lock, LK_EXCLUSIVE, NULL)
|
||||||
#define SDMMC_UNLOCK(sc) lockmgr(&(sc)->sc_lock, LK_RELEASE, NULL)
|
#define SDMMC_UNLOCK(sc) lockmgr(&(sc)->sc_lock, LK_RELEASE, NULL)
|
||||||
#define SDMMC_ASSERT_LOCKED(sc) \
|
#define SDMMC_ASSERT_LOCKED(sc) \
|
||||||
|
Loading…
Reference in New Issue
Block a user