blob: cd9e61cc23bbe8f62d4b1be557b73028f4782a55 [file] [log] [blame]
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -08001/* PCMCIA/Cardbus */
2
David 'Digit' Turner5d8f37a2009-09-14 14:32:27 -07003#ifndef _HW_PCMCIA_H
4#define _HW_PCMCIA_H
5
6#include "qemu-common.h"
7
8typedef struct {
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -08009 qemu_irq irq;
10 int attached;
11 const char *slot_string;
12 const char *card_string;
David 'Digit' Turner5d8f37a2009-09-14 14:32:27 -070013} PCMCIASocket;
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -080014
David 'Digit' Turner5d8f37a2009-09-14 14:32:27 -070015void pcmcia_socket_register(PCMCIASocket *socket);
16void pcmcia_socket_unregister(PCMCIASocket *socket);
17void pcmcia_info(Monitor *mon);
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -080018
David 'Digit' Turner5d8f37a2009-09-14 14:32:27 -070019struct PCMCIACardState {
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -080020 void *state;
David 'Digit' Turner5d8f37a2009-09-14 14:32:27 -070021 PCMCIASocket *slot;
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -080022 int (*attach)(void *state);
23 int (*detach)(void *state);
24 const uint8_t *cis;
25 int cis_len;
26
27 /* Only valid if attached */
28 uint8_t (*attr_read)(void *state, uint32_t address);
29 void (*attr_write)(void *state, uint32_t address, uint8_t value);
30 uint16_t (*common_read)(void *state, uint32_t address);
31 void (*common_write)(void *state, uint32_t address, uint16_t value);
32 uint16_t (*io_read)(void *state, uint32_t address);
33 void (*io_write)(void *state, uint32_t address, uint16_t value);
34};
35
36#define CISTPL_DEVICE 0x01 /* 5V Device Information Tuple */
37#define CISTPL_NO_LINK 0x14 /* No Link Tuple */
38#define CISTPL_VERS_1 0x15 /* Level 1 Version Tuple */
39#define CISTPL_JEDEC_C 0x18 /* JEDEC ID Tuple */
40#define CISTPL_JEDEC_A 0x19 /* JEDEC ID Tuple */
41#define CISTPL_CONFIG 0x1a /* Configuration Tuple */
42#define CISTPL_CFTABLE_ENTRY 0x1b /* 16-bit PCCard Configuration */
43#define CISTPL_DEVICE_OC 0x1c /* Additional Device Information */
44#define CISTPL_DEVICE_OA 0x1d /* Additional Device Information */
45#define CISTPL_DEVICE_GEO 0x1e /* Additional Device Information */
46#define CISTPL_DEVICE_GEO_A 0x1f /* Additional Device Information */
47#define CISTPL_MANFID 0x20 /* Manufacture ID Tuple */
48#define CISTPL_FUNCID 0x21 /* Function ID Tuple */
49#define CISTPL_FUNCE 0x22 /* Function Extension Tuple */
50#define CISTPL_END 0xff /* Tuple End */
51#define CISTPL_ENDMARK 0xff
52
53/* dscm1xxxx.c */
David 'Digit' Turner5d8f37a2009-09-14 14:32:27 -070054PCMCIACardState *dscm1xxxx_init(BlockDriverState *bdrv);
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -080055
David 'Digit' Turner5d8f37a2009-09-14 14:32:27 -070056#endif /* _HW_PCMCIA_H */