VirtualBox

Changeset 49779 in vbox for trunk/src/VBox/HostDrivers


Ignore:
Timestamp:
Dec 4, 2013 5:20:25 PM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
91095
Message:

Mac OS X host: HID LEDs sync: resume built-in kbd before set its LEDs (extended VBoxUSB.kext and USBLib); introduce GUI/HidLedsSync extradata option in order to enable LEDs sync (not set/disabled by default); all Apple kbd devices removed from blacklist; SCROLL LED sync enabled again.

Location:
trunk/src/VBox/HostDrivers/VBoxUSB/darwin
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/VBoxUSB/darwin/USBLib-darwin.cpp

    r44529 r49779  
    55
    66/*
    7  * Copyright (C) 2007-2010 Oracle Corporation
     7 * Copyright (C) 2007-2013 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    190190}
    191191
     192USBLIB_DECL(void) USBLibResumeBuiltInKeyboard(void)
     193{
     194#if MAC_OS_X_VERSION_MIN_REQUIRED < 1050
     195    kern_return_t kr = IOConnectMethodStructureIStructureO(g_Connection,
     196                                                           VBOXUSBMETHOD_RESUME_BUILTIN_KBD,
     197                                                           0,
     198                                                           NULL,
     199                                                           NULL,
     200                                                           NULL);
     201#else  /* 10.5 and later */
     202    kern_return_t kr = IOConnectCallStructMethod(g_Connection,
     203                                                 VBOXUSBMETHOD_RESUME_BUILTIN_KBD,
     204                                                 NULL, 0,
     205                                                 NULL, NULL);
     206#endif /* 10.5 and later */
     207    AssertMsg(kr == kIOReturnSuccess, ("kr=%#x\n", kr));
     208    NOREF(kr);
     209}
  • trunk/src/VBox/HostDrivers/VBoxUSB/darwin/VBoxUSB.cpp

    r44528 r49779  
    99
    1010/*
    11  * Copyright (C) 2006-2010 Oracle Corporation
     11 * Copyright (C) 2006-2013 Oracle Corporation
    1212 *
    1313 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    6060#include <IOKit/usb/IOUSBInterface.h>
    6161#include <IOKit/usb/IOUSBUserClient.h>
     62#include <IOKit/usb/IOUSBHIDDriver.h>
    6263
    6364/* private: */
     
    140141    IOReturn addFilter(PUSBFILTER pFilter, PVBOXUSBADDFILTEROUT pOut, IOByteCount cbFilter, IOByteCount *pcbOut);
    141142    IOReturn removeFilter(uintptr_t *puId, int *prc, IOByteCount cbIn, IOByteCount *pcbOut);
     143    IOReturn resumeBuiltInKbd(void *unused1, void *unused2, IOByteCount unused3, IOByteCount *unused4, void *unused5, void *unused6);
    142144    /** @} */
    143145
     
    788790            sizeof(int)                                             /* count1 - size of the output (rc) */
    789791        },
     792        /* [VBOXUSBMETHOD_RESUME_BUILTIN_KBD] = */
     793        {
     794            (IOService *)0,                                         /* object */
     795            (IOMethod)&org_virtualbox_VBoxUSBClient::resumeBuiltInKbd, /* func */
     796            kIOUCScalarIScalarO,                                    /* flags - scalar input (count0) and scalar output (count1) */
     797            0,                                                      /* count0 - # of input parameters */
     798            0                                                       /* count1 - # of output parameters */
     799        },
    790800    };
    791801
     
    893903}
    894904
     905IOReturn
     906org_virtualbox_VBoxUSBClient::resumeBuiltInKbd(void *unused1, void *unused2, IOByteCount unused3, IOByteCount *unused4, void *unused5, void *unused6)
     907{
     908    (void)unused1;
     909    (void)unused2;
     910    (void)unused3;
     911    (void)unused4;
     912    (void)unused5;
     913    (void)unused6;
     914
     915    OSDictionary *pDictionary;
     916
     917    VBOXUSB_LOCK();
     918
     919    pDictionary = IOService::serviceMatching("AppleUSBTCKeyboard");
     920    if (pDictionary)
     921    {
     922        OSIterator     *pIter;
     923        IOUSBHIDDriver *pDriver;
     924
     925        pIter = IOService::getMatchingServices(pDictionary);
     926        if (pIter)
     927        {
     928            while ((pDriver = (IOUSBHIDDriver *)pIter->getNextObject()))
     929                pDriver->SuspendPort(false, 0);
     930
     931            pIter->release();
     932        }
     933
     934        pDictionary->release();
     935    }
     936
     937    VBOXUSB_UNLOCK();
     938
     939    return kIOReturnSuccess;
     940}
    895941
    896942/**
  • trunk/src/VBox/HostDrivers/VBoxUSB/darwin/VBoxUSBInterface.h

    r44529 r49779  
    55
    66/*
    7  * Copyright (C) 2007-2010 Oracle Corporation
     7 * Copyright (C) 2007-2013 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    3030    /** org_virtualbox_VBoxUSBClient::removeFilter */
    3131    VBOXUSBMETHOD_REMOVE_FILTER,
     32    /** org_virtualbox_VBoxUSBClient::resumeBuiltInKbd */
     33    VBOXUSBMETHOD_RESUME_BUILTIN_KBD,
    3234    /** End/max. */
    3335    VBOXUSBMETHOD_END
Note: See TracChangeset for help on using the changeset viewer.

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