00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef LIBSDIO_INTERNAL_H
00010 #define LIBSDIO_INTERNAL_H
00011
00012 #include <windows.h>
00013 #include <winioctl.h>
00014
00015 typedef UINT32 uint32_t;
00016 typedef INT32 int32_t;
00017 typedef UINT16 uint16_t;
00018 typedef UINT8 uint8_t;
00019
00020 #include <sdioemb/windows/uif.h>
00021 #include <sdioemb/sdio.h>
00022 #include <sdioemb/libsdio.h>
00023
00024 struct cmd_queue_elem {
00025 struct cmd_queue_elem *next;
00026 sdio_io_callback_t callback;
00027 void *arg;
00028 struct sdioemb_uif_cmd cmd;
00029 uint8_t write8_data;
00030 };
00031
00032 struct cmd_queue {
00033 struct cmd_queue_elem *head;
00034 struct cmd_queue_elem *tail;
00035 };
00036
00037 struct sdio_uif {
00038 void (*int_handler)(struct sdio_uif *, void *);
00039 void *arg;
00040
00041 HANDLE handle;
00042 HANDLE int_thread;
00043 HANDLE int_thread_stop_event;
00044 HANDLE int_unmasked_event;
00045
00046 struct sdioemb_uif_card_info card_info;
00047 struct sdioemb_uif_func_info func_info[SDIO_MAX_FUNCTIONS];
00048
00049 struct cmd_queue cmd_queue;
00050 HANDLE cmd_queue_sem;
00051 HANDLE cmd_queue_stop_event;
00052 CRITICAL_SECTION cmd_queue_mutex;
00053 HANDLE async_thread;
00054 };
00055
00056 int uif_ioctl(sdio_uif_t uif, DWORD ioctl, struct sdioemb_uif_input *input,
00057 struct sdioemb_uif_output *output);
00058
00059 int async_thread_start(sdio_uif_t uif);
00060 void async_thread_stop(sdio_uif_t uif);
00061
00062 #endif