]> git.proxmox.com Git - mirror_qemu.git/blame - include/hw/pcmcia.h
dataplane: do not free VirtQueueElement in vring_push()
[mirror_qemu.git] / include / hw / pcmcia.h
CommitLineData
cb9c377f
PB
1#ifndef HW_PCMCIA_H
2#define HW_PCMCIA_H 1
3
87ecb68b
PB
4/* PCMCIA/Cardbus */
5
d1f2c96a 6#include "hw/qdev.h"
376253ec 7
d1f2c96a 8typedef struct PCMCIASocket {
87ecb68b 9 qemu_irq irq;
d1f2c96a 10 bool attached;
87ecb68b
PB
11 const char *slot_string;
12 const char *card_string;
bc24a225 13} PCMCIASocket;
87ecb68b 14
bc24a225
PB
15void pcmcia_socket_register(PCMCIASocket *socket);
16void pcmcia_socket_unregister(PCMCIASocket *socket);
84f2d0ea 17void pcmcia_info(Monitor *mon, const QDict *qdict);
87ecb68b 18
d1f2c96a
AF
19#define TYPE_PCMCIA_CARD "pcmcia-card"
20#define PCMCIA_CARD(obj) \
21 OBJECT_CHECK(PCMCIACardState, (obj), TYPE_PCMCIA_CARD)
22#define PCMCIA_CARD_GET_CLASS(obj) \
23 OBJECT_GET_CLASS(PCMCIACardClass, obj, TYPE_PCMCIA_CARD)
24#define PCMCIA_CARD_CLASS(cls) \
25 OBJECT_CLASS_CHECK(PCMCIACardClass, cls, TYPE_PCMCIA_CARD)
26
bc24a225 27struct PCMCIACardState {
d1f2c96a
AF
28 /*< private >*/
29 DeviceState parent_obj;
30 /*< public >*/
31
bc24a225 32 PCMCIASocket *slot;
d1f2c96a
AF
33};
34
35typedef struct PCMCIACardClass {
36 /*< private >*/
37 DeviceClass parent_class;
38 /*< public >*/
39
40 int (*attach)(PCMCIACardState *state);
41 int (*detach)(PCMCIACardState *state);
42
87ecb68b
PB
43 const uint8_t *cis;
44 int cis_len;
45
46 /* Only valid if attached */
d1f2c96a
AF
47 uint8_t (*attr_read)(PCMCIACardState *card, uint32_t address);
48 void (*attr_write)(PCMCIACardState *card, uint32_t address, uint8_t value);
49 uint16_t (*common_read)(PCMCIACardState *card, uint32_t address);
50 void (*common_write)(PCMCIACardState *card,
51 uint32_t address, uint16_t value);
52 uint16_t (*io_read)(PCMCIACardState *card, uint32_t address);
53 void (*io_write)(PCMCIACardState *card, uint32_t address, uint16_t value);
54} PCMCIACardClass;
87ecb68b
PB
55
56#define CISTPL_DEVICE 0x01 /* 5V Device Information Tuple */
57#define CISTPL_NO_LINK 0x14 /* No Link Tuple */
58#define CISTPL_VERS_1 0x15 /* Level 1 Version Tuple */
59#define CISTPL_JEDEC_C 0x18 /* JEDEC ID Tuple */
60#define CISTPL_JEDEC_A 0x19 /* JEDEC ID Tuple */
61#define CISTPL_CONFIG 0x1a /* Configuration Tuple */
62#define CISTPL_CFTABLE_ENTRY 0x1b /* 16-bit PCCard Configuration */
63#define CISTPL_DEVICE_OC 0x1c /* Additional Device Information */
64#define CISTPL_DEVICE_OA 0x1d /* Additional Device Information */
65#define CISTPL_DEVICE_GEO 0x1e /* Additional Device Information */
66#define CISTPL_DEVICE_GEO_A 0x1f /* Additional Device Information */
67#define CISTPL_MANFID 0x20 /* Manufacture ID Tuple */
68#define CISTPL_FUNCID 0x21 /* Function ID Tuple */
69#define CISTPL_FUNCE 0x22 /* Function Extension Tuple */
70#define CISTPL_END 0xff /* Tuple End */
71#define CISTPL_ENDMARK 0xff
72
73/* dscm1xxxx.c */
f455e98c 74PCMCIACardState *dscm1xxxx_init(DriveInfo *bdrv);
cb9c377f
PB
75
76#endif