VirtualBox

Changeset 28741 in vbox


Ignore:
Timestamp:
Apr 26, 2010 10:50:36 AM (15 years ago)
Author:
vboxsync
Message:

Main/HostHardwareLinux: introduce an ifdef for building USB with raw sysfs and FAM support

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Config.kmk

    r28739 r28741  
    383383ifeq ($(KBUILD_TARGET),linux)
    384384 VBOX_USB_WITH_SYSFS=1
     385 VBOX_USB_WITH_FAM=1
    385386endif
    386387# Use the new VBI module on Solaris.
  • trunk/src/VBox/Main/Makefile.kmk

    r28555 r28741  
    224224        $(if $(VBOX_WITH_DBUS),VBOX_WITH_DBUS,) \
    225225        $(if $(VBOX_USB_WITH_SYSFS),VBOX_USB_WITH_SYSFS,) \
     226        $(if $(VBOX_USB_WITH_FAM),VBOX_USB_WITH_FAM,) \
    226227        $(if $(VBOX_WITH_LIVE_MIGRATION),VBOX_WITH_LIVE_MIGRATION,) \
    227228        $(if $(VBOX_WITH_VUSB),VBOX_WITH_VUSB,)
     
    277278 VBoxSVC_LIBS.solaris += \
    278279        devinfo
    279  ifdef VBOX_USB_WITH_SYSFS
     280 ifdef VBOX_USB_WITH_FAM
    280281  VBoxSVC_LIBS.linux += \
    281282        fam
  • trunk/src/VBox/Main/linux/HostHardwareLinux.cpp

    r28682 r28741  
    5858
    5959#ifdef VBOX_USB_WITH_SYSFS
    60 # include <fam.h>
     60# ifdef VBOX_USB_WITH_FAM
     61#  include <fam.h>
     62# endif
    6163#endif
    6264
     
    9597                                 bool *pfSuccess);
    9698#ifdef VBOX_USB_WITH_SYSFS
     99# ifdef VBOX_USB_WITH_FAM
    97100static int getUSBDeviceInfoFromSysfs(USBDeviceInfoList *pList, bool *pfSuccess);
     101# endif
    98102# ifdef VBOX_WITH_DBUS
    99103/* These must be extern to be usable in the RTMemAutoPtr template */
     
    10431047            success = halSuccess;
    10441048# endif /* VBOX_WITH_DBUS */
     1049# ifdef VBOX_USB_WITH_FAM
    10451050        if (   RT_SUCCESS(rc)
    10461051            && (!success || testing()))
    10471052            rc = getUSBDeviceInfoFromSysfs(&mDeviceList, &success);
     1053# endif
    10481054#else /* !VBOX_USB_WITH_SYSFS */
    10491055        NOREF(success);
     
    11821188
    11831189#ifdef VBOX_USB_WITH_SYSFS
    1184 
    1185 #define SYSFS_USB_DEVICE_PATH "/dev/bus/usb"
    1186 #define SYSFS_WAKEUP_STRING "Wake up!"
     1190# ifdef VBOX_USB_WITH_FAM
     1191
     1192# define SYSFS_USB_DEVICE_PATH "/dev/bus/usb"
     1193# define SYSFS_WAKEUP_STRING "Wake up!"
    11871194
    11881195class hotplugSysfsFAMImpl : public VBoxMainHotplugWaiterImpl
     
    13331340    mfWaiting(0), mStatus(VERR_WRONG_ORDER)
    13341341{
    1335 #ifdef DEBUG
     1342#  ifdef DEBUG
    13361343    /* Excercise the code path (term() on a not-fully-initialised object) as
    13371344     * well as we can.  On an uninitialised object this method is a sematic
     
    13421349    if (!testing())
    13431350    {
    1344 #ifndef VBOX_USB_WITH_SYSFS_BY_DEFAULT
     1351#   ifndef VBOX_USB_WITH_SYSFS_BY_DEFAULT
    13451352        Assert(!RTFileExists("/proc/bus/usb/devices"));
    1346 #endif
    1347 #ifdef VBOX_WITH_DBUS
     1353#   endif
     1354#   ifdef VBOX_WITH_DBUS
    13481355        Assert(!hotplugDBusImpl::HalAvailable());
    1349 #endif
    1350     }
    1351 #endif
     1356#   endif
     1357    }
     1358#  endif
    13521359    int rc;
    13531360    do {
     
    13561363        if (RT_FAILURE(rc = initConnection()))
    13571364            break;
    1358 #ifdef DEBUG
     1365#  ifdef DEBUG
    13591366        /** Other tests */
    13601367        testMonitorDirectoryFAM();
    13611368        testNextEventFAM();
    13621369        testCheckConnection();
    1363 #endif
     1370#  endif
    13641371    } while(0);
    13651372    mStatus = rc;
     
    14921499}
    14931500
     1501# endif /* VBOX_USB_WITH_FAM */
    14941502#endif  /* VBOX_USB_WTH_SYSFS */
    14951503
     
    15041512    }
    15051513# endif  /* VBOX_WITH_DBUS */
     1514# ifdef VBOX_USB_WITH_FAM
    15061515    if (hotplugSysfsFAMImpl::SysfsAvailable())
    15071516    {
     
    15091518        return;
    15101519    }
     1520# endif /* VBOX_USB_WITH_FAM */
    15111521#endif  /* VBOX_USB_WITH_SYSFS */
    15121522    mImpl = new hotplugNullImpl;
     
    15141524
    15151525#ifdef VBOX_USB_WITH_SYSFS
     1526# ifdef VBOX_USB_WITH_FAM
    15161527class sysfsPathHandler
    15171528{
     
    17241735    return rc;
    17251736}
     1737# endif /* VBOX_USB_WITH_FAM */
    17261738#endif /* VBOX_USB_WITH_SYSFS */
    17271739
  • trunk/src/VBox/Main/testcase/Makefile.kmk

    r28553 r28741  
    133133        $(if $(VBOX_WITH_LINUX_COMPILER_H),VBOX_WITH_LINUX_COMPILER_H,) \
    134134        $(if $(VBOX_WITH_DBUS),VBOX_WITH_DBUS,) \
    135         $(if $(VBOX_USB_WITH_SYSFS),VBOX_USB_WITH_SYSFS,)
     135        $(if $(VBOX_USB_WITH_SYSFS),VBOX_USB_WITH_SYSFS,) \
     136        $(if $(VBOX_USB_WITH_FAM),VBOX_USB_WITH_FAM,)
    136137tstHostHardwareLinux_LIBS     += \
    137138        $(PATH_OUT)/lib/USBLib.a \
    138         $(if $(VBOX_USB_WITH_SYSFS),fam,)
     139        $(if $(VBOX_USB_WITH_FAM),fam,)
    139140
    140141
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