20
20
#ifndef _SDMMCVAR_H_
21
21
#define _SDMMCVAR_H_
22
22
23
- #if 0
24
- #include <sys/queue.h>
25
- #include <sys/lock.h>
26
-
27
- #include <scsi/scsi_all.h>
28
- #include <scsi/scsiconf.h>
29
-
30
- #include <dev/sdmmc/sdmmcchip.h>
31
- #include <dev/sdmmc/sdmmcreg.h>
32
- #endif
33
-
34
23
struct sdmmc_csd {
35
24
int csdver ; /* CSD structure format */
36
25
int mmcver ; /* MMC version (for CID format) */
@@ -58,9 +47,6 @@ struct sdmmc_task {
58
47
void * arg ;
59
48
int onqueue ;
60
49
struct sdmmc_softc * sc ;
61
- #if 0
62
- TAILQ_ENTRY (sdmmc_task ) next ;
63
- #endif
64
50
};
65
51
66
52
#define sdmmc_init_task (xtask , xfunc , xarg ) do { \
@@ -142,9 +128,6 @@ struct sdmmc_function {
142
128
int flags ;
143
129
#define SFF_ERROR 0x0001 /* function is poo; ignore it */
144
130
#define SFF_SDHC 0x0002 /* SD High Capacity card */
145
- #if 0
146
- SIMPLEQ_ENTRY (sdmmc_function ) sf_list ;
147
- #endif
148
131
/* SD card I/O function members */
149
132
int number ; /* I/O function number or -1 */
150
133
struct device * child ; /* function driver */
@@ -173,23 +156,11 @@ struct sdmmc_softc {
173
156
int sc_function_count ; /* number of I/O functions (SDIO) */
174
157
struct sdmmc_function * sc_card ; /* selected card */
175
158
struct sdmmc_function * sc_fn0 ; /* function 0, the card itself */
176
- #if 0
177
- SIMPLEQ_HEAD (, sdmmc_function ) sf_head ; /* list of card functions */
178
- #endif
179
159
int sc_dying ; /* bus driver is shutting down */
180
160
struct proc * sc_task_thread ; /* asynchronous tasks */
181
- #if 0
182
- TAILQ_HEAD (, sdmmc_task ) sc_tskq ; /* task thread work queue */
183
- #endif
184
161
struct sdmmc_task sc_discover_task ; /* card attach/detach task */
185
162
struct sdmmc_task sc_intr_task ; /* card interrupt task */
186
- #if 0
187
- struct lock sc_lock ; /* lock around host controller */
188
- #endif
189
163
void * sc_scsibus ; /* SCSI bus emulation softc */
190
- #if 0
191
- TAILQ_HEAD (, sdmmc_intr_handler ) sc_intrq ; /* interrupt handlers */
192
- #endif
193
164
long sc_max_xfer ; /* maximum transfer size */
194
165
};
195
166
@@ -202,79 +173,10 @@ struct sdmmc_attach_args {
202
173
};
203
174
204
175
#define IPL_SDMMC IPL_BIO
205
- #define splsdmmc () splbio()
206
176
207
177
#define SDMMC_LOCK (sc ) lockmgr(&(sc)->sc_lock, LK_EXCLUSIVE, NULL)
208
178
#define SDMMC_UNLOCK (sc ) lockmgr(&(sc)->sc_lock, LK_RELEASE, NULL)
209
179
#define SDMMC_ASSERT_LOCKED (sc ) \
210
180
KASSERT(lockstatus(&((sc))->sc_lock) == LK_EXCLUSIVE)
211
181
212
- #if 0
213
- void sdmmc_add_task (struct sdmmc_softc * , struct sdmmc_task * );
214
- void sdmmc_del_task (struct sdmmc_task * );
215
-
216
- struct sdmmc_function * sdmmc_function_alloc (struct sdmmc_softc * );
217
- void sdmmc_function_free (struct sdmmc_function * );
218
- int sdmmc_set_bus_power (struct sdmmc_softc * , u_int32_t , u_int32_t );
219
- int sdmmc_mmc_command (struct sdmmc_softc * , struct sdmmc_command * );
220
- int sdmmc_app_command (struct sdmmc_softc * , struct sdmmc_command * );
221
- void sdmmc_go_idle_state (struct sdmmc_softc * );
222
- int sdmmc_select_card (struct sdmmc_softc * , struct sdmmc_function * );
223
- int sdmmc_set_relative_addr (struct sdmmc_softc * ,
224
- struct sdmmc_function * );
225
- int sdmmc_send_if_cond (struct sdmmc_softc * , uint32_t );
226
-
227
- void sdmmc_intr_enable (struct sdmmc_function * );
228
- void sdmmc_intr_disable (struct sdmmc_function * );
229
- void * sdmmc_intr_establish (struct device * , int (* )(void * ),
230
- void * , const char * );
231
- void sdmmc_intr_disestablish (void * );
232
- void sdmmc_intr_task (void * );
233
-
234
- int sdmmc_io_enable (struct sdmmc_softc * );
235
- void sdmmc_io_scan (struct sdmmc_softc * );
236
- int sdmmc_io_init (struct sdmmc_softc * , struct sdmmc_function * );
237
- void sdmmc_io_attach (struct sdmmc_softc * );
238
- void sdmmc_io_detach (struct sdmmc_softc * );
239
- u_int8_t sdmmc_io_read_1 (struct sdmmc_function * , int );
240
- u_int16_t sdmmc_io_read_2 (struct sdmmc_function * , int );
241
- u_int32_t sdmmc_io_read_4 (struct sdmmc_function * , int );
242
- int sdmmc_io_read_multi_1 (struct sdmmc_function * , int , u_char * , int );
243
- void sdmmc_io_write_1 (struct sdmmc_function * , int , u_int8_t );
244
- void sdmmc_io_write_2 (struct sdmmc_function * , int , u_int16_t );
245
- void sdmmc_io_write_4 (struct sdmmc_function * , int , u_int32_t );
246
- int sdmmc_io_write_multi_1 (struct sdmmc_function * , int , u_char * , int );
247
- int sdmmc_io_function_ready (struct sdmmc_function * );
248
- int sdmmc_io_function_enable (struct sdmmc_function * );
249
- void sdmmc_io_function_disable (struct sdmmc_function * );
250
-
251
- int sdmmc_read_cis (struct sdmmc_function * , struct sdmmc_cis * );
252
- void sdmmc_print_cis (struct sdmmc_function * );
253
- void sdmmc_check_cis_quirks (struct sdmmc_function * );
254
-
255
- int sdmmc_mem_enable (struct sdmmc_softc * );
256
- void sdmmc_mem_scan (struct sdmmc_softc * );
257
- int sdmmc_mem_init (struct sdmmc_softc * , struct sdmmc_function * );
258
- int sdmmc_mem_read_block (struct sdmmc_function * , int , u_char * , size_t );
259
- int sdmmc_mem_write_block (struct sdmmc_function * , int , u_char * , size_t );
260
-
261
- /* ioctls */
262
-
263
- #include <sys/ioccom.h>
264
-
265
- struct bio_sdmmc_command {
266
- void * cookie ;
267
- struct sdmmc_command cmd ;
268
- };
269
-
270
- struct bio_sdmmc_debug {
271
- void * cookie ;
272
- int debug ;
273
- };
274
-
275
- #define SDIOCEXECMMC _IOWR('S',0, struct bio_sdmmc_command)
276
- #define SDIOCEXECAPP _IOWR('S',1, struct bio_sdmmc_command)
277
- #define SDIOCSETDEBUG _IOWR('S',2, struct bio_sdmmc_debug)
278
- #endif
279
-
280
182
#endif
0 commit comments