2012-12-06 15:15:58 +04:00
|
|
|
#ifndef HW_PCMCIA_H
|
2016-06-29 16:29:06 +03:00
|
|
|
#define HW_PCMCIA_H
|
2012-12-06 15:15:58 +04:00
|
|
|
|
2007-11-17 20:14:51 +03:00
|
|
|
/* PCMCIA/Cardbus */
|
|
|
|
|
2019-08-12 08:23:51 +03:00
|
|
|
#include "hw/qdev-core.h"
|
2020-09-03 23:43:22 +03:00
|
|
|
#include "qom/object.h"
|
2009-03-06 02:01:23 +03:00
|
|
|
|
2013-07-17 21:46:16 +04:00
|
|
|
typedef struct PCMCIASocket {
|
2007-11-17 20:14:51 +03:00
|
|
|
qemu_irq irq;
|
2013-07-17 21:46:16 +04:00
|
|
|
bool attached;
|
2009-05-10 04:44:56 +04:00
|
|
|
} PCMCIASocket;
|
2007-11-17 20:14:51 +03:00
|
|
|
|
2013-07-17 21:46:16 +04:00
|
|
|
#define TYPE_PCMCIA_CARD "pcmcia-card"
|
2020-09-16 21:25:18 +03:00
|
|
|
OBJECT_DECLARE_TYPE(PCMCIACardState, PCMCIACardClass, PCMCIA_CARD)
|
2013-07-17 21:46:16 +04:00
|
|
|
|
2020-09-03 23:43:22 +03:00
|
|
|
struct PCMCIACardState {
|
2013-07-17 21:46:16 +04:00
|
|
|
/*< private >*/
|
|
|
|
DeviceState parent_obj;
|
|
|
|
/*< public >*/
|
|
|
|
|
2009-05-10 04:44:56 +04:00
|
|
|
PCMCIASocket *slot;
|
2020-09-03 23:43:22 +03:00
|
|
|
};
|
2013-07-17 21:46:16 +04:00
|
|
|
|
2020-09-03 23:43:22 +03:00
|
|
|
struct PCMCIACardClass {
|
2013-07-17 21:46:16 +04:00
|
|
|
/*< private >*/
|
|
|
|
DeviceClass parent_class;
|
|
|
|
/*< public >*/
|
|
|
|
|
|
|
|
int (*attach)(PCMCIACardState *state);
|
|
|
|
int (*detach)(PCMCIACardState *state);
|
|
|
|
|
2007-11-17 20:14:51 +03:00
|
|
|
const uint8_t *cis;
|
|
|
|
int cis_len;
|
|
|
|
|
|
|
|
/* Only valid if attached */
|
2013-07-17 21:46:16 +04:00
|
|
|
uint8_t (*attr_read)(PCMCIACardState *card, uint32_t address);
|
|
|
|
void (*attr_write)(PCMCIACardState *card, uint32_t address, uint8_t value);
|
|
|
|
uint16_t (*common_read)(PCMCIACardState *card, uint32_t address);
|
|
|
|
void (*common_write)(PCMCIACardState *card,
|
|
|
|
uint32_t address, uint16_t value);
|
|
|
|
uint16_t (*io_read)(PCMCIACardState *card, uint32_t address);
|
|
|
|
void (*io_write)(PCMCIACardState *card, uint32_t address, uint16_t value);
|
2020-09-03 23:43:22 +03:00
|
|
|
};
|
2007-11-17 20:14:51 +03:00
|
|
|
|
|
|
|
#define CISTPL_DEVICE 0x01 /* 5V Device Information Tuple */
|
|
|
|
#define CISTPL_NO_LINK 0x14 /* No Link Tuple */
|
|
|
|
#define CISTPL_VERS_1 0x15 /* Level 1 Version Tuple */
|
|
|
|
#define CISTPL_JEDEC_C 0x18 /* JEDEC ID Tuple */
|
|
|
|
#define CISTPL_JEDEC_A 0x19 /* JEDEC ID Tuple */
|
|
|
|
#define CISTPL_CONFIG 0x1a /* Configuration Tuple */
|
|
|
|
#define CISTPL_CFTABLE_ENTRY 0x1b /* 16-bit PCCard Configuration */
|
|
|
|
#define CISTPL_DEVICE_OC 0x1c /* Additional Device Information */
|
|
|
|
#define CISTPL_DEVICE_OA 0x1d /* Additional Device Information */
|
|
|
|
#define CISTPL_DEVICE_GEO 0x1e /* Additional Device Information */
|
|
|
|
#define CISTPL_DEVICE_GEO_A 0x1f /* Additional Device Information */
|
|
|
|
#define CISTPL_MANFID 0x20 /* Manufacture ID Tuple */
|
|
|
|
#define CISTPL_FUNCID 0x21 /* Function ID Tuple */
|
|
|
|
#define CISTPL_FUNCE 0x22 /* Function Extension Tuple */
|
|
|
|
#define CISTPL_END 0xff /* Tuple End */
|
|
|
|
#define CISTPL_ENDMARK 0xff
|
|
|
|
|
|
|
|
/* dscm1xxxx.c */
|
2009-08-28 17:47:03 +04:00
|
|
|
PCMCIACardState *dscm1xxxx_init(DriveInfo *bdrv);
|
2012-12-06 15:15:58 +04:00
|
|
|
|
|
|
|
#endif
|