Revision 3bc36349 usb-redir.c
b/usb-redir.c | ||
---|---|---|
1315 | 1315 |
} |
1316 | 1316 |
} |
1317 | 1317 |
|
1318 |
static Property usbredir_properties[] = { |
|
1319 |
DEFINE_PROP_CHR("chardev", USBRedirDevice, cs), |
|
1320 |
DEFINE_PROP_UINT8("debug", USBRedirDevice, debug, 0), |
|
1321 |
DEFINE_PROP_END_OF_LIST(), |
|
1322 |
}; |
|
1323 |
|
|
1318 | 1324 |
static void usbredir_class_initfn(ObjectClass *klass, void *data) |
1319 | 1325 |
{ |
1320 | 1326 |
USBDeviceClass *uc = USB_DEVICE_CLASS(klass); |
1327 |
DeviceClass *dc = DEVICE_CLASS(klass); |
|
1321 | 1328 |
|
1322 | 1329 |
uc->init = usbredir_initfn; |
1323 | 1330 |
uc->product_desc = "USB Redirection Device"; |
... | ... | |
1327 | 1334 |
uc->handle_reset = usbredir_handle_reset; |
1328 | 1335 |
uc->handle_data = usbredir_handle_data; |
1329 | 1336 |
uc->handle_control = usbredir_handle_control; |
1337 |
dc->props = usbredir_properties; |
|
1330 | 1338 |
} |
1331 | 1339 |
|
1332 |
static struct DeviceInfo usbredir_dev_info = { |
|
1333 |
.name = "usb-redir", |
|
1334 |
.size = sizeof(USBRedirDevice), |
|
1335 |
.class_init= usbredir_class_initfn, |
|
1336 |
.props = (Property[]) { |
|
1337 |
DEFINE_PROP_CHR("chardev", USBRedirDevice, cs), |
|
1338 |
DEFINE_PROP_UINT8("debug", USBRedirDevice, debug, 0), |
|
1339 |
DEFINE_PROP_END_OF_LIST(), |
|
1340 |
}, |
|
1340 |
static TypeInfo usbredir_dev_info = { |
|
1341 |
.name = "usb-redir", |
|
1342 |
.parent = TYPE_USB_DEVICE, |
|
1343 |
.instance_size = sizeof(USBRedirDevice), |
|
1344 |
.class_init = usbredir_class_initfn, |
|
1341 | 1345 |
}; |
1342 | 1346 |
|
1343 | 1347 |
static void usbredir_register_devices(void) |
1344 | 1348 |
{ |
1345 |
usb_qdev_register(&usbredir_dev_info, NULL, NULL);
|
|
1349 |
type_register_static(&usbredir_dev_info);
|
|
1346 | 1350 |
} |
1347 | 1351 |
device_init(usbredir_register_devices); |
Also available in: Unified diff