| 196 |
|
|
| 197 |
typedef void IOReadHandler(void *opaque, const uint8_t *buf, int size); |
typedef void IOReadHandler(void *opaque, const uint8_t *buf, int size); |
| 198 |
typedef int IOCanRWHandler(void *opaque); |
typedef int IOCanRWHandler(void *opaque); |
| 199 |
|
typedef void IOHandler(void *opaque); |
| 200 |
|
|
| 201 |
int qemu_add_fd_read_handler(int fd, IOCanRWHandler *fd_can_read, |
int qemu_set_fd_handler2(int fd, |
| 202 |
IOReadHandler *fd_read, void *opaque); |
IOCanRWHandler *fd_read_poll, |
| 203 |
void qemu_del_fd_read_handler(int fd); |
IOHandler *fd_read, |
| 204 |
|
IOHandler *fd_write, |
| 205 |
|
void *opaque); |
| 206 |
|
int qemu_set_fd_handler(int fd, |
| 207 |
|
IOHandler *fd_read, |
| 208 |
|
IOHandler *fd_write, |
| 209 |
|
void *opaque); |
| 210 |
|
|
| 211 |
/* character device */ |
/* character device */ |
| 212 |
|
|
| 277 |
|
|
| 278 |
extern CharDriverState *parallel_hds[MAX_PARALLEL_PORTS]; |
extern CharDriverState *parallel_hds[MAX_PARALLEL_PORTS]; |
| 279 |
|
|
| 280 |
/* network redirectors support */ |
/* VLANs support */ |
| 281 |
|
|
| 282 |
|
typedef struct VLANClientState VLANClientState; |
| 283 |
|
|
| 284 |
|
struct VLANClientState { |
| 285 |
|
IOReadHandler *fd_read; |
| 286 |
|
void *opaque; |
| 287 |
|
struct VLANClientState *next; |
| 288 |
|
struct VLANState *vlan; |
| 289 |
|
char info_str[256]; |
| 290 |
|
}; |
| 291 |
|
|
| 292 |
|
typedef struct VLANState { |
| 293 |
|
int id; |
| 294 |
|
VLANClientState *first_client; |
| 295 |
|
struct VLANState *next; |
| 296 |
|
} VLANState; |
| 297 |
|
|
| 298 |
|
VLANState *qemu_find_vlan(int id); |
| 299 |
|
VLANClientState *qemu_new_vlan_client(VLANState *vlan, |
| 300 |
|
IOReadHandler *fd_read, void *opaque); |
| 301 |
|
void qemu_send_packet(VLANClientState *vc, const uint8_t *buf, int size); |
| 302 |
|
|
| 303 |
|
void do_info_network(void); |
| 304 |
|
|
| 305 |
|
/* NIC info */ |
| 306 |
|
|
| 307 |
#define MAX_NICS 8 |
#define MAX_NICS 8 |
| 308 |
|
|
| 309 |
typedef struct NetDriverState { |
typedef struct NICInfo { |
|
int index; /* index number in QEMU */ |
|
| 310 |
uint8_t macaddr[6]; |
uint8_t macaddr[6]; |
| 311 |
char ifname[16]; |
VLANState *vlan; |
| 312 |
void (*send_packet)(struct NetDriverState *nd, |
} NICInfo; |
|
const uint8_t *buf, int size); |
|
|
void (*add_read_packet)(struct NetDriverState *nd, |
|
|
IOCanRWHandler *fd_can_read, |
|
|
IOReadHandler *fd_read, void *opaque); |
|
|
/* tun specific data */ |
|
|
int fd; |
|
|
/* slirp specific data */ |
|
|
} NetDriverState; |
|
| 313 |
|
|
| 314 |
extern int nb_nics; |
extern int nb_nics; |
| 315 |
extern NetDriverState nd_table[MAX_NICS]; |
extern NICInfo nd_table[MAX_NICS]; |
|
|
|
|
void qemu_send_packet(NetDriverState *nd, const uint8_t *buf, int size); |
|
|
void qemu_add_read_packet(NetDriverState *nd, IOCanRWHandler *fd_can_read, |
|
|
IOReadHandler *fd_read, void *opaque); |
|
| 316 |
|
|
| 317 |
/* timers */ |
/* timers */ |
| 318 |
|
|
| 711 |
|
|
| 712 |
/* ne2000.c */ |
/* ne2000.c */ |
| 713 |
|
|
| 714 |
void isa_ne2000_init(int base, int irq, NetDriverState *nd); |
void isa_ne2000_init(int base, int irq, NICInfo *nd); |
| 715 |
void pci_ne2000_init(PCIBus *bus, NetDriverState *nd); |
void pci_ne2000_init(PCIBus *bus, NICInfo *nd); |
| 716 |
|
|
| 717 |
/* pckbd.c */ |
/* pckbd.c */ |
| 718 |
|
|
| 800 |
uint32_t iommu_translate_local(void *opaque, uint32_t addr); |
uint32_t iommu_translate_local(void *opaque, uint32_t addr); |
| 801 |
|
|
| 802 |
/* lance.c */ |
/* lance.c */ |
| 803 |
void lance_init(NetDriverState *nd, int irq, uint32_t leaddr, uint32_t ledaddr); |
void lance_init(NICInfo *nd, int irq, uint32_t leaddr, uint32_t ledaddr); |
| 804 |
|
|
| 805 |
/* tcx.c */ |
/* tcx.c */ |
| 806 |
void *tcx_init(DisplayState *ds, uint32_t addr, uint8_t *vram_base, |
void *tcx_init(DisplayState *ds, uint32_t addr, uint8_t *vram_base, |