VirtualBox

Ignore:
Timestamp:
Dec 5, 2013 11:26:00 AM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
91106
Message:

OS X host: HID LEDs sync: move built-in keyboard resume code from VBoxUSB.kext to VBoxDrv.kext.

Location:
trunk/src/VBox/HostDrivers/Support
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/Support/SUPDrv.c

    r49786 r49787  
    139139                                                  RTCPUID idCpu, uint8_t idApic, uint64_t iTick);
    140140static void                 supdrvGipInitCpu(PSUPGLOBALINFOPAGE pGip, PSUPGIPCPU pCpu, uint64_t u64NanoTS);
     141static int                  supdrvIOCtl_ResumeBuiltinKbd(void);
    141142
    142143
     
    19041905        }
    19051906
     1907        case SUP_CTL_CODE_NO_SIZE(SUP_IOCTL_RESUME_BUILTIN_KBD):
     1908        {
     1909            /* validate */
     1910            REQ_CHECK_SIZES(SUP_IOCTL_RESUME_BUILTIN_KBD);
     1911
     1912            pReqHdr->rc = supdrvIOCtl_ResumeBuiltinKbd();
     1913            return 0;
     1914        }
    19061915
    19071916        default:
     
    61406149}
    61416150
     6151/**
     6152 * Resume built-in keyboard on MacBook Air and Pro hosts.
     6153 * If there is no built-in keyboard device, return success anyway.
     6154 *
     6155 * @returns 0 on Mac OS X platform, VERR_NOT_IMPLEMENTED on the other ones.
     6156 */
     6157static int supdrvIOCtl_ResumeBuiltinKbd(void)
     6158{
     6159#if defined(RT_OS_DARWIN)
     6160    return supdrvDarwinResumeBuiltinKbd();
     6161#else
     6162    return VERR_NOT_IMPLEMENTED;
     6163#endif
     6164}
     6165
  • trunk/src/VBox/HostDrivers/Support/SUPDrvIOC.h

    r49634 r49787  
    194194 *          - Remove RTSpinlockReleaseNoInts.
    195195 */
    196 #define SUPDRV_IOC_VERSION                              0x001a0006
     196#define SUPDRV_IOC_VERSION                              0x001a0007
    197197
    198198/** SUP_IOCTL_COOKIE. */
     
    14381438/** @} */
    14391439
     1440/** @name SUP_IOCTL_RESUME_BUILTIN_KBD
     1441 * Resume built-in keyboard (make sense on MacBook Air/Pro hosts only).
     1442 *
     1443 * @{
     1444 */
     1445#define SUP_IOCTL_RESUME_BUILTIN_KBD                    SUP_CTL_CODE_SIZE(35, SUP_IOCTL_RESUME_BUILTIN_KBD_SIZE)
     1446#define SUP_IOCTL_RESUME_BUILTIN_KBD_SIZE               sizeof(SUPREQHDR)
     1447#define SUP_IOCTL_RESUME_BUILTIN_KBD_SIZE_IN            sizeof(SUPREQHDR)
     1448#define SUP_IOCTL_RESUME_BUILTIN_KBD_SIZE_OUT           sizeof(SUPREQHDR)
     1449/** @} */
     1450
    14401451
    14411452#pragma pack()                          /* paranoia */
  • trunk/src/VBox/HostDrivers/Support/SUPDrvInternal.h

    r49634 r49787  
    749749#endif /* SUPDRV_WITH_MSR_PROBER */
    750750
     751#if defined(RT_OS_DARWIN)
     752int VBOXCALL    supdrvDarwinResumeBuiltinKbd(void);
     753#endif
    751754
    752755/*******************************************************************************
  • trunk/src/VBox/HostDrivers/Support/SUPLib.cpp

    r49634 r49787  
    21332133}
    21342134
     2135
     2136SUPR3DECL(int) SUPR3ResumeBuiltinKeyboard(void)
     2137{
     2138#ifdef RT_OS_DARWIN
     2139    /*
     2140     * Issue IOCtl to the SUPDRV kernel module.
     2141     */
     2142    SUPREQHDR Req;
     2143    Req.u32Cookie       = g_u32Cookie;
     2144    Req.u32SessionCookie= g_u32SessionCookie;
     2145    Req.cbIn            = SUP_IOCTL_RESUME_BUILTIN_KBD_SIZE_IN;
     2146    Req.cbOut           = SUP_IOCTL_RESUME_BUILTIN_KBD_SIZE_OUT;
     2147    Req.fFlags          = SUPREQHDR_FLAGS_DEFAULT;
     2148    Req.rc              = VERR_INTERNAL_ERROR;
     2149    int rc = suplibOsIOCtl(&g_supLibData, SUP_IOCTL_RESUME_BUILTIN_KBD, &Req, SUP_IOCTL_RESUME_BUILTIN_KBD_SIZE);
     2150    if (RT_SUCCESS(rc))
     2151        rc = Req.rc;
     2152    return rc;
     2153#else /* !RT_OS_DARWIN */
     2154    return VERR_NOT_SUPPORTED;
     2155#endif
     2156}
     2157
  • trunk/src/VBox/HostDrivers/Support/darwin/SUPDrv-darwin.cpp

    r49767 r49787  
    6767#include <IOKit/pwr_mgt/RootDomain.h>
    6868#include <IOKit/IODeviceTreeSupport.h>
     69#include <IOKit/usb/IOUSBHIDDriver.h>
    6970
    7071#ifdef VBOX_WITH_HOST_VMX
     
    11431144
    11441145
     1146/**
     1147 * Resume built-in keyboard on MacBook Air and Pro hosts.
     1148 * If there is no built-in keyboard device, return success anyway.
     1149 */
     1150int VBOXCALL    supdrvDarwinResumeBuiltinKbd(void)
     1151{
     1152    /*
     1153     * AppleUSBTCKeyboard KEXT is responsible for built-in keyboard management.
     1154     * We resume keyboard by accessing to its IOService. */
     1155    OSDictionary *pDictionary = IOService::serviceMatching("AppleUSBTCKeyboard");
     1156    if (pDictionary)
     1157    {
     1158        OSIterator     *pIter;
     1159        IOUSBHIDDriver *pDriver;
     1160
     1161        pIter = IOService::getMatchingServices(pDictionary);
     1162        if (pIter)
     1163        {
     1164            while ((pDriver = (IOUSBHIDDriver *)pIter->getNextObject()))
     1165                pDriver->SuspendPort(false, 0);
     1166
     1167            pIter->release();
     1168        }
     1169        pDictionary->release();
     1170    }
     1171
     1172    return 0;
     1173}
     1174
     1175
    11451176
    11461177/**
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