Date:2011-04-10 15:55:49 (12 years 11 months ago)
Author:Werner Almesberger
Commit:4190aded8ce59215ba791dacbfd77a5b7e9c82e3
Message:tools/lib/: added mechanism to remove USB restrictions (enabling multiple sessions)

- usbopen.h (usb_unrestrict), usbusb.c (usb_unrestrict): drop ID and
path restrictions
- atusb.c (atusb_open): call usb_unrestrict to remove restrictions
Files: tools/lib/atusb.c (1 diff)
tools/lib/usbopen.c (1 diff)
tools/lib/usbopen.h (1 diff)

Change Details

tools/lib/atusb.c
5454{
5555    usb_dev_handle *dev;
5656
57    usb_unrestrict();
5758    if (arg)
5859        restrict_usb_path(arg);
5960    dev = open_usb(USB_VENDOR, USB_PRODUCT);
tools/lib/usbopen.c
228228    else
229229        restrict_usb_by_port(path);
230230}
231
232
233void usb_unrestrict(void)
234{
235    vendor = 0;
236    product = 0;
237    restricted_path = NULL;
238}
tools/lib/usbopen.h
2121usb_dev_handle *open_usb(uint16_t default_vendor, uint16_t default_product);
2222void parse_usb_id(const char *id);
2323void restrict_usb_path(const char *path);
24void usb_unrestrict(void);
2425
2526#endif /* !USB_OPEN_H */

Archive Download the corresponding diff file



interactive