Commit 201a51fc authored by balrog's avatar balrog

PCMCIA bus support. Parts of CF-ATA command set. Hitachi DSCM microdrive emulation.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2748 c046a42c-6fe2-441c-8c8c-71466251a162
parent 01179c38
This diff is collapsed.
......@@ -1316,6 +1316,8 @@ static term_cmd_t info_cmds[] = {
"", "show capture information" },
{ "snapshots", "", do_info_snapshots,
"", "show the currently saved VM snapshots" },
{ "pcmcia", "", pcmcia_info,
"", "show guest PCMCIA status" },
{ "mice", "", do_info_mice,
"", "show which guest mouse is receiving events" },
{ "vnc", "", do_info_vnc,
......
......@@ -4411,6 +4411,48 @@ void usb_info(void)
}
}
/***********************************************************/
/* PCMCIA/Cardbus */
static struct pcmcia_socket_entry_s {
struct pcmcia_socket_s *socket;
struct pcmcia_socket_entry_s *next;
} *pcmcia_sockets = 0;
void pcmcia_socket_register(struct pcmcia_socket_s *socket)
{
struct pcmcia_socket_entry_s *entry;
entry = qemu_malloc(sizeof(struct pcmcia_socket_entry_s));
entry->socket = socket;
entry->next = pcmcia_sockets;
pcmcia_sockets = entry;
}
void pcmcia_socket_unregister(struct pcmcia_socket_s *socket)
{
struct pcmcia_socket_entry_s *entry, **ptr;
ptr = &pcmcia_sockets;
for (entry = *ptr; entry; ptr = &entry->next, entry = *ptr)
if (entry->socket == socket) {
*ptr = entry->next;
qemu_free(entry);
}
}
void pcmcia_info(void)
{
struct pcmcia_socket_entry_s *iter;
if (!pcmcia_sockets)
term_printf("No PCMCIA sockets\n");
for (iter = pcmcia_sockets; iter; iter = iter->next)
term_printf("%s: %s\n", iter->socket->slot_string,
iter->socket->attached ? iter->socket->card_string :
"Empty");
}
/***********************************************************/
/* dumb display */
......
......@@ -1475,6 +1475,56 @@ pflash_t *pflash_register (target_ulong base, ram_addr_t off,
uint16_t id0, uint16_t id1,
uint16_t id2, uint16_t id3);
/* PCMCIA/Cardbus */
struct pcmcia_socket_s {
qemu_irq irq;
int attached;
const char *slot_string;
const char *card_string;
};
void pcmcia_socket_register(struct pcmcia_socket_s *socket);
void pcmcia_socket_unregister(struct pcmcia_socket_s *socket);
void pcmcia_info(void);
struct pcmcia_card_s {
void *state;
struct pcmcia_socket_s *slot;
int (*attach)(void *state);
int (*detach)(void *state);
const uint8_t *cis;
int cis_len;
/* Only valid if attached */
uint8_t (*attr_read)(void *state, uint16_t address);
void (*attr_write)(void *state, uint16_t address, uint8_t value);
uint16_t (*common_read)(void *state, uint16_t address);
void (*common_write)(void *state, uint16_t address, uint16_t value);
uint16_t (*io_read)(void *state, uint16_t address);
void (*io_write)(void *state, uint16_t address, uint16_t value);
};
#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 */
struct pcmcia_card_s *dscm1xxxx_init(BlockDriverState *bdrv);
#include "gdbstub.h"
#endif /* defined(QEMU_TOOL) */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment