aboutsummaryrefslogtreecommitdiff
path: root/vl.c
diff options
context:
space:
mode:
authorbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2008-07-17 20:47:13 +0000
committerbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2008-07-17 20:47:13 +0000
commit6c9f886ceae5b998dc2b9af2bf77666941689bce (patch)
tree7f5c868d14c279b10390720b67ade84dcf0c6b2a /vl.c
parente6bf7d70b5a459f96f0b2cbc677926eebe685c84 (diff)
Add CDC-Ethernet usb NIC (original patch from Thomas Sailer).
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4884 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'vl.c')
-rw-r--r--vl.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/vl.c b/vl.c
index c8db57983b..043e484f11 100644
--- a/vl.c
+++ b/vl.c
@@ -5475,6 +5475,12 @@ static int usb_device_add(const char *devname)
} else if (!strcmp(devname, "braille")) {
dev = usb_baum_init();
#endif
+ } else if (strstart(devname, "net:", &p)) {
+ int nicidx = strtoul(p, NULL, 0);
+
+ if (nicidx >= nb_nics || strcmp(nd_table[nicidx].model, "usb"))
+ return -1;
+ dev = usb_net_init(&nd_table[nicidx]);
} else {
return -1;
}