VirtualBox

Changeset 34341 in vbox for trunk/src/VBox/RDP/client


Ignore:
Timestamp:
Nov 24, 2010 8:14:36 PM (14 years ago)
Author:
vboxsync
Message:

Main/linux/USB and RDP/client/vrdp: clean up the handling of the USB device tree path and get rid of data duplication

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/RDP/client/vrdp/rdpusb.c

    r32472 r34341  
    6363};
    6464
    65 /** Location at which the Linux Usbfs filesystem was found.  NULL means not
    66  * found, in which case USB devices will be accessed through /dev and sysfs. */
    67 static const char *g_pcszUsbfsRoot = NULL;
     65/** Location at which the USB device tree was found.  NULL means not
     66 * found. */
     67static const char *g_pcszDevicesRoot = NULL;
     68static bool g_fUseSysfs = false;
    6869
    6970static PUSBDEVICE g_pUsbDevices = NULL;
     
    252253    if (g_pUsbDevices)
    253254        deviceListFree(&g_pUsbDevices);
    254     g_pUsbDevices = USBProxyLinuxGetDevices(g_pcszUsbfsRoot);
     255    g_pUsbDevices = USBProxyLinuxGetDevices(g_pcszDevicesRoot, g_fUseSysfs);
    255256    if (!g_pUsbDevices)
    256257        return NULL;
     
    852853
    853854
    854 /** Check for the Linux Usbfs filesystem in a couple of common locations. */
    855 static void checkUsbfsRoot(void)
    856 {
    857     unsigned i;
    858     for (i = 0; i < RT_ELEMENTS(g_usbfsPaths); ++i)
    859         if (RT_SUCCESS(USBProxyLinuxCheckForUsbfs(g_usbfsPaths[i].pcszDevices)))
    860         {
    861             g_pcszUsbfsRoot = g_usbfsPaths[i].pcszRoot;
    862             break;
    863         }
    864 }
    865 
    866 
    867855RD_BOOL
    868856rdpusb_init(void)
    869857{
    870         checkUsbfsRoot();
     858        PCUSBDEVTREELOCATION pcLocation = USBProxyLinuxGetDeviceRoot(false);
     859        g_fUseSysfs       = pcLocation->fUseSysfs;
     860        g_pcszDevicesRoot = pcLocation->szDevicesRoot;
    871861        rdpusb_channel =
    872862                channel_register("vrdpusb", CHANNEL_OPTION_INITIALIZED | CHANNEL_OPTION_ENCRYPT_RDP,
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette