2 * Linux host USB redirector
4 * Copyright (c) 2005 Fabrice Bellard
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights
9 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 * copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24 #include "qemu-common.h"
28 #if defined(__linux__)
32 #include <sys/ioctl.h>
33 #include <linux/usbdevice_fs.h>
34 #include <linux/version.h>
37 /* We redefine it to avoid version problems */
38 struct usb_ctrltransfer
{
48 typedef int USBScanFunc(void *opaque
, int bus_num
, int addr
, int class_id
,
49 int vendor_id
, int product_id
,
50 const char *product_name
, int speed
);
51 static int usb_host_find_device(int *pbus_num
, int *paddr
,
52 char *product_name
, int product_name_size
,
59 #define USBDEVFS_PATH "/proc/bus/usb"
60 #define PRODUCT_NAME_SZ 32
61 #define SIG_ISOCOMPLETE (SIGRTMIN+7)
62 #define MAX_ENDPOINTS 16
64 struct sigaction sigact
;
66 /* endpoint association data */
71 /* FIXME: move USBPacket to PendingURB */
72 typedef struct USBHostDevice
{
77 struct endp_data endp_table
[MAX_ENDPOINTS
];
84 typedef struct PendingURB
{
85 struct usbdevfs_urb
*urb
;
87 struct PendingURB
*next
;
90 static PendingURB
*pending_urbs
= NULL
;
92 static int add_pending_urb(struct usbdevfs_urb
*urb
)
94 PendingURB
*purb
= qemu_mallocz(sizeof(PendingURB
));
98 purb
->next
= pending_urbs
;
105 static int del_pending_urb(struct usbdevfs_urb
*urb
)
107 PendingURB
*purb
= pending_urbs
;
108 PendingURB
*prev
= NULL
;
110 while (purb
&& purb
->urb
!= urb
) {
115 if (purb
&& purb
->urb
== urb
) {
117 prev
->next
= purb
->next
;
119 pending_urbs
= purb
->next
;
128 static PendingURB
*get_pending_urb(struct usbdevfs_urb
*urb
)
130 PendingURB
*purb
= pending_urbs
;
132 while (purb
&& purb
->urb
!= urb
) {
136 if (purb
&& purb
->urb
== urb
) {
143 static int usb_host_update_interfaces(USBHostDevice
*dev
, int configuration
)
145 int dev_descr_len
, config_descr_len
;
146 int interface
, nb_interfaces
, nb_configurations
;
149 if (configuration
== 0) /* address state - ignore */
153 dev_descr_len
= dev
->descr
[0];
154 if (dev_descr_len
> dev
->descr_len
)
156 nb_configurations
= dev
->descr
[17];
159 while (i
< dev
->descr_len
) {
161 printf("i is %d, descr_len is %d, dl %d, dt %d\n", i
, dev
->descr_len
,
162 dev
->descr
[i
], dev
->descr
[i
+1]);
164 if (dev
->descr
[i
+1] != USB_DT_CONFIG
) {
168 config_descr_len
= dev
->descr
[i
];
170 if (configuration
== dev
->descr
[i
+ 5])
173 i
+= config_descr_len
;
176 if (i
>= dev
->descr_len
) {
177 printf("usb_host: error - device has no matching configuration\n");
180 nb_interfaces
= dev
->descr
[i
+ 4];
182 #ifdef USBDEVFS_DISCONNECT
183 /* earlier Linux 2.4 do not support that */
185 struct usbdevfs_ioctl ctrl
;
186 for (interface
= 0; interface
< nb_interfaces
; interface
++) {
187 ctrl
.ioctl_code
= USBDEVFS_DISCONNECT
;
188 ctrl
.ifno
= interface
;
189 ret
= ioctl(dev
->fd
, USBDEVFS_IOCTL
, &ctrl
);
190 if (ret
< 0 && errno
!= ENODATA
) {
191 perror("USBDEVFS_DISCONNECT");
198 /* XXX: only grab if all interfaces are free */
199 for (interface
= 0; interface
< nb_interfaces
; interface
++) {
200 ret
= ioctl(dev
->fd
, USBDEVFS_CLAIMINTERFACE
, &interface
);
202 if (errno
== EBUSY
) {
204 "usb_host: warning - device already grabbed\n");
206 perror("USBDEVFS_CLAIMINTERFACE");
214 printf("usb_host: %d interfaces claimed for configuration %d\n",
215 nb_interfaces
, configuration
);
221 static void usb_host_handle_reset(USBDevice
*dev
)
224 USBHostDevice
*s
= (USBHostDevice
*)dev
;
225 /* USBDEVFS_RESET, but not the first time as it has already be
226 done by the host OS */
227 ioctl(s
->fd
, USBDEVFS_RESET
);
231 static void usb_host_handle_destroy(USBDevice
*dev
)
233 USBHostDevice
*s
= (USBHostDevice
*)dev
;
240 static int usb_linux_update_endp_table(USBHostDevice
*s
);
242 static int usb_host_handle_control(USBDevice
*dev
,
249 USBHostDevice
*s
= (USBHostDevice
*)dev
;
250 struct usb_ctrltransfer ct
;
251 struct usbdevfs_setinterface si
;
252 int intf_update_required
= 0;
255 if (request
== (DeviceOutRequest
| USB_REQ_SET_ADDRESS
)) {
256 /* specific SET_ADDRESS support */
259 } else if (request
== ((USB_RECIP_INTERFACE
<< 8) |
260 USB_REQ_SET_INTERFACE
)) {
261 /* set alternate setting for the interface */
262 si
.interface
= index
;
263 si
.altsetting
= value
;
264 ret
= ioctl(s
->fd
, USBDEVFS_SETINTERFACE
, &si
);
265 usb_linux_update_endp_table(s
);
266 } else if (request
== (DeviceOutRequest
| USB_REQ_SET_CONFIGURATION
)) {
268 printf("usb_host_handle_control: SET_CONFIGURATION request - "
269 "config %d\n", value
& 0xff);
271 if (s
->configuration
!= (value
& 0xff)) {
272 s
->configuration
= (value
& 0xff);
273 intf_update_required
= 1;
278 ct
.bRequestType
= request
>> 8;
279 ct
.bRequest
= request
;
285 ret
= ioctl(s
->fd
, USBDEVFS_CONTROL
, &ct
);
293 return USB_RET_STALL
;
296 if (intf_update_required
) {
298 printf("usb_host_handle_control: updating interfaces\n");
300 usb_host_update_interfaces(s
, value
& 0xff);
306 static int usb_host_handle_isoch(USBDevice
*dev
, USBPacket
*p
);
308 static int usb_host_handle_data(USBDevice
*dev
, USBPacket
*p
)
310 USBHostDevice
*s
= (USBHostDevice
*)dev
;
311 struct usbdevfs_bulktransfer bt
;
313 uint8_t devep
= p
->devep
;
315 if (s
->endp_table
[p
->devep
- 1].type
== USBDEVFS_URB_TYPE_ISO
) {
316 return usb_host_handle_isoch(dev
, p
);
319 /* XXX: optimize and handle all data types by looking at the
321 if (p
->pid
== USB_TOKEN_IN
)
327 ret
= ioctl(s
->fd
, USBDEVFS_BULK
, &bt
);
335 printf("handle_data: errno=%d\n", errno
);
337 return USB_RET_STALL
;
345 static void urb_completion_pipe_read(void *opaque
)
347 USBHostDevice
*s
= opaque
;
348 USBPacket
*p
= s
->packet
;
349 PendingURB
*pending_urb
= NULL
;
350 struct usbdevfs_urb
*purb
= NULL
;
353 len
= read(s
->pipe_fds
[0], &pending_urb
, sizeof(pending_urb
));
354 if (len
!= sizeof(pending_urb
)) {
355 printf("urb_completion: error reading pending_urb, len=%d\n", len
);
359 /* FIXME: handle pending_urb->status */
360 del_pending_urb(pending_urb
->urb
);
367 ret
= ioctl(s
->fd
, USBDEVFS_REAPURBNDELAY
, &purb
);
369 printf("urb_completion: REAPURBNDELAY ioctl=%d errno=%d\n",
375 if (purb
== pending_urb
->urb
) {
376 printf("urb_completion: urb mismatch reaped=%p pending=%p\n",
381 p
->len
= purb
->actual_length
;
382 usb_packet_complete(p
);
387 static void isoch_done(int signum
, siginfo_t
*info
, void *context
)
389 struct usbdevfs_urb
*urb
= (struct usbdevfs_urb
*)info
->si_addr
;
390 USBHostDevice
*s
= (USBHostDevice
*)urb
->usercontext
;
393 if (info
->si_code
!= SI_ASYNCIO
||
394 info
->si_signo
!= SIG_ISOCOMPLETE
) {
398 purb
= get_pending_urb(urb
);
400 purb
->status
= info
->si_errno
;
401 write(s
->pipe_fds
[1], &purb
, sizeof(purb
));
406 static int usb_host_handle_isoch(USBDevice
*dev
, USBPacket
*p
)
408 USBHostDevice
*s
= (USBHostDevice
*)dev
;
409 struct usbdevfs_urb
*urb
, *purb
= NULL
;
411 uint8_t devep
= p
->devep
;
413 if (p
->pid
== USB_TOKEN_IN
)
416 urb
= qemu_mallocz(sizeof(struct usbdevfs_urb
) +
417 sizeof(struct usbdevfs_iso_packet_desc
));
419 printf("usb_host_handle_isoch: malloc failed\n");
423 urb
->type
= USBDEVFS_URB_TYPE_ISO
;
424 urb
->endpoint
= devep
;
426 urb
->flags
= USBDEVFS_URB_ISO_ASAP
;
427 urb
->buffer
= p
->data
;
428 urb
->buffer_length
= p
->len
;
429 urb
->actual_length
= 0;
430 urb
->start_frame
= 0;
431 urb
->error_count
= 0;
433 urb
->signr
= SIG_ISOCOMPLETE
;
437 urb
->usercontext
= s
;
438 urb
->number_of_packets
= 1;
439 urb
->iso_frame_desc
[0].length
= p
->len
;
440 urb
->iso_frame_desc
[0].actual_length
= 0;
441 urb
->iso_frame_desc
[0].status
= 0;
442 ret
= ioctl(s
->fd
, USBDEVFS_SUBMITURB
, urb
);
444 if (!add_pending_urb(urb
)) {
445 printf("usb_host_handle_isoch: add_pending_urb failed %p\n", urb
);
448 printf("usb_host_handle_isoch: SUBMITURB ioctl=%d errno=%d\n",
456 return USB_RET_STALL
;
460 /* FIXME: handle urbs_ready together with sync io
461 * workaround for injecting the signaled urbs into current frame */
462 if (s
->urbs_ready
> 0) {
463 ret
= ioctl(s
->fd
, USBDEVFS_REAPURBNDELAY
, &purb
);
465 ret
= purb
->actual_length
;
472 return USB_RET_ASYNC
;
474 ret
= ioctl(s
->fd
, USBDEVFS_REAPURBNDELAY
, &purb
);
476 if (del_pending_urb(purb
)) {
477 ret
= purb
->actual_length
;
480 printf("usb_host_handle_isoch: del_pending_urb failed %p\n", purb
);
484 printf("usb_host_handle_isoch: REAPURBNDELAY ioctl=%d errno=%d\n",
492 /* returns 1 on problem encountered or 0 for success */
493 static int usb_linux_update_endp_table(USBHostDevice
*s
)
495 uint8_t *descriptors
;
496 uint8_t devep
, type
, configuration
, alt_interface
;
497 struct usb_ctrltransfer ct
;
498 int interface
, ret
, length
, i
;
500 ct
.bRequestType
= USB_DIR_IN
;
501 ct
.bRequest
= USB_REQ_GET_CONFIGURATION
;
505 ct
.data
= &configuration
;
508 ret
= ioctl(s
->fd
, USBDEVFS_CONTROL
, &ct
);
510 perror("usb_linux_update_endp_table");
514 /* in address state */
515 if (configuration
== 0)
518 /* get the desired configuration, interface, and endpoint descriptors
519 * from device description */
520 descriptors
= &s
->descr
[18];
521 length
= s
->descr_len
- 18;
524 if (descriptors
[i
+ 1] != USB_DT_CONFIG
||
525 descriptors
[i
+ 5] != configuration
) {
526 printf("invalid descriptor data - configuration\n");
532 if (descriptors
[i
+ 1] != USB_DT_INTERFACE
||
533 (descriptors
[i
+ 1] == USB_DT_INTERFACE
&&
534 descriptors
[i
+ 4] == 0)) {
539 interface
= descriptors
[i
+ 2];
541 ct
.bRequestType
= USB_DIR_IN
| USB_RECIP_INTERFACE
;
542 ct
.bRequest
= USB_REQ_GET_INTERFACE
;
544 ct
.wIndex
= interface
;
546 ct
.data
= &alt_interface
;
549 ret
= ioctl(s
->fd
, USBDEVFS_CONTROL
, &ct
);
551 perror("usb_linux_update_endp_table");
555 /* the current interface descriptor is the active interface
556 * and has endpoints */
557 if (descriptors
[i
+ 3] != alt_interface
) {
562 /* advance to the endpoints */
563 while (i
< length
&& descriptors
[i
+1] != USB_DT_ENDPOINT
)
570 if (descriptors
[i
+ 1] != USB_DT_ENDPOINT
)
573 devep
= descriptors
[i
+ 2];
574 switch (descriptors
[i
+ 3] & 0x3) {
576 type
= USBDEVFS_URB_TYPE_CONTROL
;
579 type
= USBDEVFS_URB_TYPE_ISO
;
582 type
= USBDEVFS_URB_TYPE_BULK
;
585 type
= USBDEVFS_URB_TYPE_INTERRUPT
;
588 printf("usb_host: malformed endpoint type\n");
589 type
= USBDEVFS_URB_TYPE_BULK
;
591 s
->endp_table
[(devep
& 0xf) - 1].type
= type
;
599 /* XXX: exclude high speed devices or implement EHCI */
600 USBDevice
*usb_host_device_open(const char *devname
)
603 USBHostDevice
*dev
= NULL
;
604 struct usbdevfs_connectinfo ci
;
607 char product_name
[PRODUCT_NAME_SZ
];
609 dev
= qemu_mallocz(sizeof(USBHostDevice
));
614 printf("usb_host_device_open %s\n", devname
);
616 if (usb_host_find_device(&bus_num
, &addr
,
617 product_name
, sizeof(product_name
),
621 snprintf(buf
, sizeof(buf
), USBDEVFS_PATH
"/%03d/%03d",
623 fd
= open(buf
, O_RDWR
| O_NONBLOCK
);
629 /* read the device description */
630 dev
->descr_len
= read(fd
, dev
->descr
, sizeof(dev
->descr
));
631 if (dev
->descr_len
<= 0) {
632 perror("usb_host_device_open: reading device data failed");
639 printf("=== begin dumping device descriptor data ===\n");
640 for (x
= 0; x
< dev
->descr_len
; x
++)
641 printf("%02x ", dev
->descr
[x
]);
642 printf("\n=== end dumping device descriptor data ===\n");
647 dev
->configuration
= 1;
649 /* XXX - do something about initial configuration */
650 if (!usb_host_update_interfaces(dev
, 1))
653 ret
= ioctl(fd
, USBDEVFS_CONNECTINFO
, &ci
);
655 perror("usb_host_device_open: USBDEVFS_CONNECTINFO");
660 printf("host USB device %d.%d grabbed\n", bus_num
, addr
);
663 ret
= usb_linux_update_endp_table(dev
);
668 dev
->dev
.speed
= USB_SPEED_LOW
;
670 dev
->dev
.speed
= USB_SPEED_HIGH
;
671 dev
->dev
.handle_packet
= usb_generic_handle_packet
;
673 dev
->dev
.handle_reset
= usb_host_handle_reset
;
674 dev
->dev
.handle_control
= usb_host_handle_control
;
675 dev
->dev
.handle_data
= usb_host_handle_data
;
676 dev
->dev
.handle_destroy
= usb_host_handle_destroy
;
678 if (product_name
[0] == '\0')
679 snprintf(dev
->dev
.devname
, sizeof(dev
->dev
.devname
),
682 pstrcpy(dev
->dev
.devname
, sizeof(dev
->dev
.devname
),
686 /* set up the signal handlers */
687 sigemptyset(&sigact
.sa_mask
);
688 sigact
.sa_sigaction
= isoch_done
;
689 sigact
.sa_flags
= SA_SIGINFO
;
690 sigact
.sa_restorer
= 0;
691 ret
= sigaction(SIG_ISOCOMPLETE
, &sigact
, NULL
);
693 perror("usb_host_device_open: sigaction failed");
697 if (pipe(dev
->pipe_fds
) < 0) {
698 perror("usb_host_device_open: pipe creation failed");
701 fcntl(dev
->pipe_fds
[0], F_SETFL
, O_NONBLOCK
| O_ASYNC
);
702 fcntl(dev
->pipe_fds
[1], F_SETFL
, O_NONBLOCK
);
703 qemu_set_fd_handler(dev
->pipe_fds
[0], urb_completion_pipe_read
, NULL
, dev
);
706 return (USBDevice
*)dev
;
714 static int get_tag_value(char *buf
, int buf_size
,
715 const char *str
, const char *tag
,
716 const char *stopchars
)
720 p
= strstr(str
, tag
);
727 while (*p
!= '\0' && !strchr(stopchars
, *p
)) {
728 if ((q
- buf
) < (buf_size
- 1))
736 static int usb_host_scan(void *opaque
, USBScanFunc
*func
)
741 int bus_num
, addr
, speed
, device_count
, class_id
, product_id
, vendor_id
;
743 char product_name
[512];
745 f
= fopen(USBDEVFS_PATH
"/devices", "r");
747 term_printf("Could not open %s\n", USBDEVFS_PATH
"/devices");
751 bus_num
= addr
= speed
= class_id
= product_id
= vendor_id
= 0;
754 if (fgets(line
, sizeof(line
), f
) == NULL
)
756 if (strlen(line
) > 0)
757 line
[strlen(line
) - 1] = '\0';
758 if (line
[0] == 'T' && line
[1] == ':') {
759 if (device_count
&& (vendor_id
|| product_id
)) {
760 /* New device. Add the previously discovered device. */
761 ret
= func(opaque
, bus_num
, addr
, class_id
, vendor_id
,
762 product_id
, product_name
, speed
);
766 if (get_tag_value(buf
, sizeof(buf
), line
, "Bus=", " ") < 0)
769 if (get_tag_value(buf
, sizeof(buf
), line
, "Dev#=", " ") < 0)
772 if (get_tag_value(buf
, sizeof(buf
), line
, "Spd=", " ") < 0)
774 if (!strcmp(buf
, "480"))
775 speed
= USB_SPEED_HIGH
;
776 else if (!strcmp(buf
, "1.5"))
777 speed
= USB_SPEED_LOW
;
779 speed
= USB_SPEED_FULL
;
780 product_name
[0] = '\0';
785 } else if (line
[0] == 'P' && line
[1] == ':') {
786 if (get_tag_value(buf
, sizeof(buf
), line
, "Vendor=", " ") < 0)
788 vendor_id
= strtoul(buf
, NULL
, 16);
789 if (get_tag_value(buf
, sizeof(buf
), line
, "ProdID=", " ") < 0)
791 product_id
= strtoul(buf
, NULL
, 16);
792 } else if (line
[0] == 'S' && line
[1] == ':') {
793 if (get_tag_value(buf
, sizeof(buf
), line
, "Product=", "") < 0)
795 pstrcpy(product_name
, sizeof(product_name
), buf
);
796 } else if (line
[0] == 'D' && line
[1] == ':') {
797 if (get_tag_value(buf
, sizeof(buf
), line
, "Cls=", " (") < 0)
799 class_id
= strtoul(buf
, NULL
, 16);
803 if (device_count
&& (vendor_id
|| product_id
)) {
804 /* Add the last device. */
805 ret
= func(opaque
, bus_num
, addr
, class_id
, vendor_id
,
806 product_id
, product_name
, speed
);
813 typedef struct FindDeviceState
{
818 char product_name
[PRODUCT_NAME_SZ
];
821 static int usb_host_find_device_scan(void *opaque
, int bus_num
, int addr
,
823 int vendor_id
, int product_id
,
824 const char *product_name
, int speed
)
826 FindDeviceState
*s
= opaque
;
827 if ((vendor_id
== s
->vendor_id
&&
828 product_id
== s
->product_id
) ||
829 (bus_num
== s
->bus_num
&&
831 pstrcpy(s
->product_name
, PRODUCT_NAME_SZ
, product_name
);
832 s
->bus_num
= bus_num
;
841 'bus.addr' (decimal numbers) or
842 'vendor_id:product_id' (hexa numbers) */
843 static int usb_host_find_device(int *pbus_num
, int *paddr
,
844 char *product_name
, int product_name_size
,
851 p
= strchr(devname
, '.');
853 *pbus_num
= strtoul(devname
, NULL
, 0);
854 *paddr
= strtoul(p
+ 1, NULL
, 0);
855 fs
.bus_num
= *pbus_num
;
857 ret
= usb_host_scan(&fs
, usb_host_find_device_scan
);
859 pstrcpy(product_name
, product_name_size
, fs
.product_name
);
862 p
= strchr(devname
, ':');
864 fs
.vendor_id
= strtoul(devname
, NULL
, 16);
865 fs
.product_id
= strtoul(p
+ 1, NULL
, 16);
866 ret
= usb_host_scan(&fs
, usb_host_find_device_scan
);
868 *pbus_num
= fs
.bus_num
;
870 pstrcpy(product_name
, product_name_size
, fs
.product_name
);
877 /**********************/
878 /* USB host device info */
880 struct usb_class_info
{
882 const char *class_name
;
885 static const struct usb_class_info usb_class_info
[] = {
886 { USB_CLASS_AUDIO
, "Audio"},
887 { USB_CLASS_COMM
, "Communication"},
888 { USB_CLASS_HID
, "HID"},
889 { USB_CLASS_HUB
, "Hub" },
890 { USB_CLASS_PHYSICAL
, "Physical" },
891 { USB_CLASS_PRINTER
, "Printer" },
892 { USB_CLASS_MASS_STORAGE
, "Storage" },
893 { USB_CLASS_CDC_DATA
, "Data" },
894 { USB_CLASS_APP_SPEC
, "Application Specific" },
895 { USB_CLASS_VENDOR_SPEC
, "Vendor Specific" },
896 { USB_CLASS_STILL_IMAGE
, "Still Image" },
897 { USB_CLASS_CSCID
, "Smart Card" },
898 { USB_CLASS_CONTENT_SEC
, "Content Security" },
902 static const char *usb_class_str(uint8_t class)
904 const struct usb_class_info
*p
;
905 for(p
= usb_class_info
; p
->class != -1; p
++) {
906 if (p
->class == class)
909 return p
->class_name
;
912 static void usb_info_device(int bus_num
, int addr
, int class_id
,
913 int vendor_id
, int product_id
,
914 const char *product_name
,
917 const char *class_str
, *speed_str
;
934 term_printf(" Device %d.%d, speed %s Mb/s\n",
935 bus_num
, addr
, speed_str
);
936 class_str
= usb_class_str(class_id
);
938 term_printf(" %s:", class_str
);
940 term_printf(" Class %02x:", class_id
);
941 term_printf(" USB device %04x:%04x", vendor_id
, product_id
);
942 if (product_name
[0] != '\0')
943 term_printf(", %s", product_name
);
947 static int usb_host_info_device(void *opaque
, int bus_num
, int addr
,
949 int vendor_id
, int product_id
,
950 const char *product_name
,
953 usb_info_device(bus_num
, addr
, class_id
, vendor_id
, product_id
,
954 product_name
, speed
);
958 void usb_host_info(void)
960 usb_host_scan(NULL
, usb_host_info_device
);
965 void usb_host_info(void)
967 term_printf("USB host devices not supported\n");
970 /* XXX: modify configure to compile the right host driver */
971 USBDevice
*usb_host_device_open(const char *devname
)