Revision a5d2f727 hw/usb.h
b/hw/usb.h | ||
---|---|---|
24 | 24 |
|
25 | 25 |
#include "block.h" |
26 | 26 |
#include "qdev.h" |
27 |
#include "sys-queue.h" |
|
27 | 28 |
|
28 | 29 |
#define USB_TOKEN_SETUP 0x2d |
29 | 30 |
#define USB_TOKEN_IN 0x69 /* device -> host */ |
... | ... | |
132 | 133 |
int speed; |
133 | 134 |
uint8_t addr; |
134 | 135 |
char devname[32]; |
136 |
int attached; |
|
135 | 137 |
|
136 | 138 |
int state; |
137 | 139 |
uint8_t setup_buf[8]; |
... | ... | |
191 | 193 |
usb_attachfn attach; |
192 | 194 |
void *opaque; |
193 | 195 |
int index; /* internal port index, may be used with the opaque */ |
194 |
struct USBPort *next; /* Used internally by qemu. */
|
|
196 |
TAILQ_ENTRY(USBPort) next;
|
|
195 | 197 |
}; |
196 | 198 |
|
197 | 199 |
typedef void USBCallback(USBPacket * packet, void *opaque); |
... | ... | |
236 | 238 |
p->cancel_cb(p, p->cancel_opaque); |
237 | 239 |
} |
238 | 240 |
|
239 |
int usb_device_add_dev(USBDevice *dev); |
|
240 |
int usb_device_del_addr(int bus_num, int addr); |
|
241 | 241 |
void usb_attach(USBPort *port, USBDevice *dev); |
242 | 242 |
int usb_generic_handle_packet(USBDevice *s, USBPacket *p); |
243 | 243 |
int set_usb_string(uint8_t *buf, const char *str); |
244 | 244 |
void usb_send_msg(USBDevice *dev, int msg); |
245 | 245 |
|
246 |
/* usb hub */ |
|
247 |
USBDevice *usb_hub_init(int nb_ports); |
|
248 |
|
|
249 | 246 |
/* usb-linux.c */ |
250 | 247 |
USBDevice *usb_host_device_open(const char *devname); |
251 | 248 |
int usb_host_device_close(const char *devname); |
252 | 249 |
void usb_host_info(Monitor *mon); |
253 | 250 |
|
254 | 251 |
/* usb-hid.c */ |
255 |
USBDevice *usb_mouse_init(void); |
|
256 |
USBDevice *usb_tablet_init(void); |
|
257 |
USBDevice *usb_keyboard_init(void); |
|
258 | 252 |
void usb_hid_datain_cb(USBDevice *dev, void *opaque, void (*datain)(void *)); |
259 | 253 |
|
260 | 254 |
/* usb-msd.c */ |
... | ... | |
267 | 261 |
/* usb-bt.c */ |
268 | 262 |
USBDevice *usb_bt_init(HCIInfo *hci); |
269 | 263 |
|
270 |
/* usb-wacom.c */ |
|
271 |
USBDevice *usb_wacom_init(void); |
|
272 |
|
|
273 | 264 |
/* usb-serial.c */ |
274 | 265 |
USBDevice *usb_serial_init(const char *filename); |
275 | 266 |
|
276 | 267 |
/* usb ports of the VM */ |
277 | 268 |
|
278 |
void qemu_register_usb_port(USBPort *port, void *opaque, int index, |
|
279 |
usb_attachfn attach); |
|
280 |
|
|
281 | 269 |
#define VM_USB_HUB_SIZE 8 |
282 | 270 |
|
283 | 271 |
/* usb-musb.c */ |
... | ... | |
319 | 307 |
USBBus *usb_bus_find(int busnr); |
320 | 308 |
void usb_qdev_register(USBDeviceInfo *info); |
321 | 309 |
void usb_qdev_register_many(USBDeviceInfo *info); |
310 |
USBDevice *usb_create(USBBus *bus, const char *name); |
|
322 | 311 |
USBDevice *usb_create_simple(USBBus *bus, const char *name); |
312 |
void usb_register_port(USBBus *bus, USBPort *port, void *opaque, int index, |
|
313 |
usb_attachfn attach); |
|
314 |
int usb_device_attach(USBDevice *dev); |
|
315 |
int usb_device_delete_addr(int busnr, int addr); |
|
316 |
|
|
317 |
static inline USBBus *usb_bus_from_device(USBDevice *d) |
|
318 |
{ |
|
319 |
return DO_UPCAST(USBBus, qbus, d->qdev.parent_bus); |
|
320 |
} |
Also available in: Unified diff