1#ifndef HW_PCMCIA_H
2#define HW_PCMCIA_H
3
4
5
6#include "hw/qdev-core.h"
7#include "qom/object.h"
8
9typedef struct PCMCIASocket {
10 qemu_irq irq;
11 bool attached;
12} PCMCIASocket;
13
14#define TYPE_PCMCIA_CARD "pcmcia-card"
15OBJECT_DECLARE_TYPE(PCMCIACardState, PCMCIACardClass, PCMCIA_CARD)
16
17struct PCMCIACardState {
18
19 DeviceState parent_obj;
20
21
22 PCMCIASocket *slot;
23};
24
25struct PCMCIACardClass {
26
27 DeviceClass parent_class;
28
29
30 int (*attach)(PCMCIACardState *state);
31 int (*detach)(PCMCIACardState *state);
32
33 const uint8_t *cis;
34 int cis_len;
35
36
37 uint8_t (*attr_read)(PCMCIACardState *card, uint32_t address);
38 void (*attr_write)(PCMCIACardState *card, uint32_t address, uint8_t value);
39 uint16_t (*common_read)(PCMCIACardState *card, uint32_t address);
40 void (*common_write)(PCMCIACardState *card,
41 uint32_t address, uint16_t value);
42 uint16_t (*io_read)(PCMCIACardState *card, uint32_t address);
43 void (*io_write)(PCMCIACardState *card, uint32_t address, uint16_t value);
44};
45
46#define CISTPL_DEVICE 0x01
47#define CISTPL_NO_LINK 0x14
48#define CISTPL_VERS_1 0x15
49#define CISTPL_JEDEC_C 0x18
50#define CISTPL_JEDEC_A 0x19
51#define CISTPL_CONFIG 0x1a
52#define CISTPL_CFTABLE_ENTRY 0x1b
53#define CISTPL_DEVICE_OC 0x1c
54#define CISTPL_DEVICE_OA 0x1d
55#define CISTPL_DEVICE_GEO 0x1e
56#define CISTPL_DEVICE_GEO_A 0x1f
57#define CISTPL_MANFID 0x20
58#define CISTPL_FUNCID 0x21
59#define CISTPL_FUNCE 0x22
60#define CISTPL_END 0xff
61#define CISTPL_ENDMARK 0xff
62
63
64PCMCIACardState *dscm1xxxx_init(DriveInfo *bdrv);
65
66#endif
67