1*0d09e41aSPaolo Bonzini #ifndef HW_PCMCIA_H 2*0d09e41aSPaolo Bonzini #define HW_PCMCIA_H 1 3*0d09e41aSPaolo Bonzini 4*0d09e41aSPaolo Bonzini /* PCMCIA/Cardbus */ 5*0d09e41aSPaolo Bonzini 6*0d09e41aSPaolo Bonzini #include "qemu-common.h" 7*0d09e41aSPaolo Bonzini 8*0d09e41aSPaolo Bonzini typedef struct { 9*0d09e41aSPaolo Bonzini qemu_irq irq; 10*0d09e41aSPaolo Bonzini int attached; 11*0d09e41aSPaolo Bonzini const char *slot_string; 12*0d09e41aSPaolo Bonzini const char *card_string; 13*0d09e41aSPaolo Bonzini } PCMCIASocket; 14*0d09e41aSPaolo Bonzini 15*0d09e41aSPaolo Bonzini void pcmcia_socket_register(PCMCIASocket *socket); 16*0d09e41aSPaolo Bonzini void pcmcia_socket_unregister(PCMCIASocket *socket); 17*0d09e41aSPaolo Bonzini void pcmcia_info(Monitor *mon, const QDict *qdict); 18*0d09e41aSPaolo Bonzini 19*0d09e41aSPaolo Bonzini struct PCMCIACardState { 20*0d09e41aSPaolo Bonzini void *state; 21*0d09e41aSPaolo Bonzini PCMCIASocket *slot; 22*0d09e41aSPaolo Bonzini int (*attach)(void *state); 23*0d09e41aSPaolo Bonzini int (*detach)(void *state); 24*0d09e41aSPaolo Bonzini const uint8_t *cis; 25*0d09e41aSPaolo Bonzini int cis_len; 26*0d09e41aSPaolo Bonzini 27*0d09e41aSPaolo Bonzini /* Only valid if attached */ 28*0d09e41aSPaolo Bonzini uint8_t (*attr_read)(void *state, uint32_t address); 29*0d09e41aSPaolo Bonzini void (*attr_write)(void *state, uint32_t address, uint8_t value); 30*0d09e41aSPaolo Bonzini uint16_t (*common_read)(void *state, uint32_t address); 31*0d09e41aSPaolo Bonzini void (*common_write)(void *state, uint32_t address, uint16_t value); 32*0d09e41aSPaolo Bonzini uint16_t (*io_read)(void *state, uint32_t address); 33*0d09e41aSPaolo Bonzini void (*io_write)(void *state, uint32_t address, uint16_t value); 34*0d09e41aSPaolo Bonzini }; 35*0d09e41aSPaolo Bonzini 36*0d09e41aSPaolo Bonzini #define CISTPL_DEVICE 0x01 /* 5V Device Information Tuple */ 37*0d09e41aSPaolo Bonzini #define CISTPL_NO_LINK 0x14 /* No Link Tuple */ 38*0d09e41aSPaolo Bonzini #define CISTPL_VERS_1 0x15 /* Level 1 Version Tuple */ 39*0d09e41aSPaolo Bonzini #define CISTPL_JEDEC_C 0x18 /* JEDEC ID Tuple */ 40*0d09e41aSPaolo Bonzini #define CISTPL_JEDEC_A 0x19 /* JEDEC ID Tuple */ 41*0d09e41aSPaolo Bonzini #define CISTPL_CONFIG 0x1a /* Configuration Tuple */ 42*0d09e41aSPaolo Bonzini #define CISTPL_CFTABLE_ENTRY 0x1b /* 16-bit PCCard Configuration */ 43*0d09e41aSPaolo Bonzini #define CISTPL_DEVICE_OC 0x1c /* Additional Device Information */ 44*0d09e41aSPaolo Bonzini #define CISTPL_DEVICE_OA 0x1d /* Additional Device Information */ 45*0d09e41aSPaolo Bonzini #define CISTPL_DEVICE_GEO 0x1e /* Additional Device Information */ 46*0d09e41aSPaolo Bonzini #define CISTPL_DEVICE_GEO_A 0x1f /* Additional Device Information */ 47*0d09e41aSPaolo Bonzini #define CISTPL_MANFID 0x20 /* Manufacture ID Tuple */ 48*0d09e41aSPaolo Bonzini #define CISTPL_FUNCID 0x21 /* Function ID Tuple */ 49*0d09e41aSPaolo Bonzini #define CISTPL_FUNCE 0x22 /* Function Extension Tuple */ 50*0d09e41aSPaolo Bonzini #define CISTPL_END 0xff /* Tuple End */ 51*0d09e41aSPaolo Bonzini #define CISTPL_ENDMARK 0xff 52*0d09e41aSPaolo Bonzini 53*0d09e41aSPaolo Bonzini /* dscm1xxxx.c */ 54*0d09e41aSPaolo Bonzini PCMCIACardState *dscm1xxxx_init(DriveInfo *bdrv); 55*0d09e41aSPaolo Bonzini 56*0d09e41aSPaolo Bonzini #endif 57