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