~vcs-imports/qemu/git

« back to all changes in this revision

Viewing changes to hw/usb.h

  • Committer: pbrook
  • Date: 2006-10-22 00:18:54 UTC
  • Revision ID: git-v1:e6e5906b6e0a81718066ca43aef57515026c6624
ColdFire target.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2196 c046a42c-6fe2-441c-8c8c-71466251a162

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * QEMU USB API
3
 
 *
 
3
 * 
4
4
 * Copyright (c) 2005 Fabrice Bellard
5
 
 *
 
5
 * 
6
6
 * Permission is hereby granted, free of charge, to any person obtaining a copy
7
7
 * of this software and associated documentation files (the "Software"), to deal
8
8
 * in the Software without restriction, including without limitation the rights
30
30
#define USB_MSG_DETACH   0x101
31
31
#define USB_MSG_RESET    0x102
32
32
 
33
 
#define USB_RET_NODEV  (-1)
 
33
#define USB_RET_NODEV  (-1) 
34
34
#define USB_RET_NAK    (-2)
35
35
#define USB_RET_STALL  (-3)
36
36
#define USB_RET_BABBLE (-4)
108
108
#define USB_DT_INTERFACE                0x04
109
109
#define USB_DT_ENDPOINT                 0x05
110
110
 
111
 
#define USB_ENDPOINT_XFER_CONTROL       0
112
 
#define USB_ENDPOINT_XFER_ISOC          1
113
 
#define USB_ENDPOINT_XFER_BULK          2
114
 
#define USB_ENDPOINT_XFER_INT           3
115
 
 
116
111
typedef struct USBPort USBPort;
117
112
typedef struct USBDevice USBDevice;
118
113
typedef struct USBPacket USBPacket;
124
119
    void (*handle_destroy)(USBDevice *dev);
125
120
 
126
121
    int speed;
127
 
 
 
122
    
128
123
    /* The following fields are used by the generic USB device
129
124
       layer. They are here just to avoid creating a new structure for
130
125
       them. */
134
129
    int (*handle_data)(USBDevice *dev, USBPacket *p);
135
130
    uint8_t addr;
136
131
    char devname[32];
137
 
 
 
132
    
138
133
    int state;
139
134
    uint8_t setup_buf[8];
140
135
    uint8_t data_buf[1024];
169
164
    USBCallback *complete_cb;
170
165
    void *complete_opaque;
171
166
    USBCallback *cancel_cb;
172
 
    void *cancel_opaque;
 
167
    void * *cancel_opaque;
173
168
};
174
169
 
175
170
/* Defer completion of a USB packet.  The hadle_packet routine should then
207
202
/* usb hub */
208
203
USBDevice *usb_hub_init(int nb_ports);
209
204
 
 
205
/* usb-uhci.c */
 
206
void usb_uhci_init(PCIBus *bus, int devfn);
 
207
 
 
208
/* usb-ohci.c */
 
209
void usb_ohci_init(struct PCIBus *bus, int num_ports, int devfn);
 
210
 
210
211
/* usb-linux.c */
211
212
USBDevice *usb_host_device_open(const char *devname);
212
213
void usb_host_info(void);
214
215
/* usb-hid.c */
215
216
USBDevice *usb_mouse_init(void);
216
217
USBDevice *usb_tablet_init(void);
217
 
USBDevice *usb_keyboard_init(void);
218
218
 
219
219
/* usb-msd.c */
220
220
USBDevice *usb_msd_init(const char *filename);
221
 
 
222
 
/* usb-wacom.c */
223
 
USBDevice *usb_wacom_init(void);
224
 
 
225
 
/* usb-serial.c */
226
 
USBDevice *usb_serial_init(const char *filename);
227
 
 
228
 
/* usb ports of the VM */
229
 
 
230
 
void qemu_register_usb_port(USBPort *port, void *opaque, int index,
231
 
                            usb_attachfn attach);
232
 
 
233
 
#define VM_USB_HUB_SIZE 8
234
 
 
235
 
/* usb-musb.c */
236
 
enum musb_irq_source_e {
237
 
    musb_irq_suspend = 0,
238
 
    musb_irq_resume,
239
 
    musb_irq_rst_babble,
240
 
    musb_irq_sof,
241
 
    musb_irq_connect,
242
 
    musb_irq_disconnect,
243
 
    musb_irq_vbus_request,
244
 
    musb_irq_vbus_error,
245
 
    musb_irq_rx,
246
 
    musb_irq_tx,
247
 
    musb_set_vbus,
248
 
    musb_set_session,
249
 
    __musb_irq_max,
250
 
};
251
 
 
252
 
struct musb_s;
253
 
struct musb_s *musb_init(qemu_irq *irqs);
254
 
uint32_t musb_core_intr_get(struct musb_s *s);
255
 
void musb_core_intr_clear(struct musb_s *s, uint32_t mask);
256
 
void musb_set_size(struct musb_s *s, int epnum, int size, int is_tx);