VirtualBox

Changeset 82213 in vbox for trunk/src


Ignore:
Timestamp:
Nov 26, 2019 2:08:48 AM (5 years ago)
Author:
vboxsync
Message:

doxygen fixes. bugref:9218

Location:
trunk/src/VBox
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Input/DevPS2.cpp

    r82208 r82213  
    735735 * @param   pQHdr       The queue header.
    736736 * @param   cElements   The queue size.
    737  * @param   abElements  The queue element array.
     737 * @param   pbElements  The queue element array.
    738738 * @param   bValue      The byte to store.
    739739 */
     
    771771 * @param   pQHdr       The queue header.
    772772 * @param   cElements   The queue size.
    773  * @param   abElements  The queue element array.
     773 * @param   pbElements  The queue element array.
    774774 * @param   pbValue     Where to return the byte on success.
    775775 *
     
    817817 * @param   pQHdr       The queue header.
    818818 * @param   cElements   The queue size.
    819  * @param   abElements  The queue element array.
     819 * @param   pbElements  The queue element array.
    820820 */
    821821void PS2CmnR3SaveQueue(PCPDMDEVHLPR3 pHlp, PSSMHANDLE pSSM, PPS2QHDR pQHdr, size_t cElements, uint8_t const *pbElements)
     
    842842 * @param   pQHdr       The queue header.
    843843 * @param   cElements   The queue size.
    844  * @param   abElements  The queue element array.
     844 * @param   pbElements  The queue element array.
    845845 *
    846846 * @returns VBox status/error code.
  • trunk/src/VBox/Devices/Input/DevPS2K.cpp

    r82208 r82213  
    914914
    915915/**
    916  * @callback_function_impl{FNTMTIMERDEV}
     916 * @callback_method_impl{FNTMTIMERDEV}
    917917 *
    918918 * Throttling timer to emulate the finite keyboard communication speed. A PS/2 keyboard is
     
    950950
    951951/**
    952  * @callback_function_impl{FNTMTIMERDEV,
     952 * @callback_method_impl{FNTMTIMERDEV,
    953953 * Timer handler for emulating typematic keys.}
    954954 *
     
    978978
    979979/**
    980  * @callback_function_impl{FNTMTIMERDEV}
     980 * @callback_method_impl{FNTMTIMERDEV}
    981981 *
    982982 * The keyboard BAT is specified to take several hundred milliseconds. We need
     
    10561056 * @param   pDevIns     The device instance.
    10571057 * @param   pThis       The PS2 keyboard instance data.
    1058  * @param   u32Usage    USB HID usage code with key press/release flag.
    1059  */
    1060 static int ps2kR3PutEventWorker(PPDMDEVINS pDevIns, PPS2K pThis, uint32_t u32Usage)
     1058 * @param   idUsage     USB HID usage code with key press/release flag.
     1059 */
     1060static int ps2kR3PutEventWorker(PPDMDEVINS pDevIns, PPS2K pThis, uint32_t idUsage)
    10611061{
    10621062    uint32_t        u32HidCode;
     
    10681068
    10691069    /* Extract the usage page and ID and ensure it's valid. */
    1070     fKeyDown   = !(u32Usage & 0x80000000);
    1071     u32HidCode = u32Usage & 0xFFFFFF;
    1072     u8HidPage  = RT_LOBYTE(RT_HIWORD(u32Usage));
    1073     u8KeyCode  = RT_LOBYTE(u32Usage);
     1070    fKeyDown   = !(idUsage & UINT32_C(0x80000000));
     1071    u32HidCode = idUsage & 0xFFFFFF;
     1072    u8HidPage  = RT_LOBYTE(RT_HIWORD(idUsage));
     1073    u8KeyCode  = RT_LOBYTE(idUsage);
    10741074    if (u8HidPage == USB_HID_KB_PAGE)
    10751075        AssertReturn(u8KeyCode <= VBOX_USB_MAX_USAGE_CODE, VERR_INTERNAL_ERROR);
     
    11071107 * @interface_method_impl{PDMIKEYBOARDPORT,pfnPutEventHid}
    11081108 */
    1109 static DECLCALLBACK(int) ps2kR3KeyboardPort_PutEventHid(PPDMIKEYBOARDPORT pInterface, uint32_t u32UsageCode)
     1109static DECLCALLBACK(int) ps2kR3KeyboardPort_PutEventHid(PPDMIKEYBOARDPORT pInterface, uint32_t idUsage)
    11101110{
    11111111    PPS2KR3     pThisCC = RT_FROM_MEMBER(pInterface, PS2KR3, Keyboard.IPort);
     
    11141114    int         rc;
    11151115
    1116     LogRelFlowFunc(("key code %08X\n", u32UsageCode));
     1116    LogRelFlowFunc(("key code %08X\n", idUsage));
    11171117
    11181118    rc = PDMDevHlpCritSectEnter(pDevIns, pDevIns->pCritSectRoR3, VERR_SEM_BUSY);
     
    11221122     * key is allowed to use this scancode.
    11231123     */
    1124     if (RT_LIKELY(u32UsageCode != KRSP_BAT_FAIL))
    1125         ps2kR3PutEventWorker(pDevIns, pThis, u32UsageCode);
     1124    if (RT_LIKELY(idUsage != KRSP_BAT_FAIL))
     1125        ps2kR3PutEventWorker(pDevIns, pThis, idUsage);
    11261126    else
    11271127        ps2kR3ReleaseKeys(pDevIns, pThis);
  • trunk/src/VBox/Devices/Input/DevPS2M.cpp

    r82208 r82213  
    416416 *
    417417 * @param   pDevIns The device instance.
    418  * @param   pThis   The PS/2 auxiliary device instance data.
     418 * @param   pThis   The PS/2 auxiliary device shared instance data.
    419419 * @param   cmd     The command (or data) byte.
    420420 */
     
    638638 *
    639639 * @returns VINF_SUCCESS or VINF_TRY_AGAIN.
    640  * @param   pThis               The PS/2 auxiliary device instance data.
    641  * @param   pb                  Where to return the byte we've read.
     640 * @param   pThis   The PS/2 auxiliary device shared instance data.
     641 * @param   pb      Where to return the byte we've read.
    642642 * @remarks Caller must have entered the device critical section.
    643643 */
     
    673673
    674674/**
    675  * @callback_function_impl{FNTMTIMERDEV,
     675 * @callback_method_impl{FNTMTIMERDEV,
    676676 * Event rate throttling timer to emulate the auxiliary device sampling rate.}
    677677 */
     
    704704
    705705/**
    706  * @callback_function_impl{FNTMTIMERDEV}
     706 * @callback_method_impl{FNTMTIMERDEV}
    707707 *
    708708 * The auxiliary device reset is specified to take up to about 500 milliseconds.
     
    768768 * @returns VBox status code.
    769769 * @param   pDevIns     The device instance.
    770  * @param   pThis       The PS/2 auxiliary device instance data.
     770 * @param   pThis       The PS/2 auxiliary device shared instance data.
    771771 * @param   dx          X direction movement delta.
    772772 * @param   dy          Y direction movement delta.
     
    883883 *
    884884 * @returns VBox status code.
    885  * @param   pThis       The PS/2 auxiliary device instance data.
    886885 * @param   pDevIns     The device instance.
     886 * @param   pThisCC     The PS/2 auxiliary device instance data for ring-3.
    887887 * @param   iLUN        The logical unit which is being detached.
    888888 * @param   fFlags      Flags, combination of the PDMDEVATT_FLAGS_* \#defines.
  • trunk/src/VBox/Devices/Input/DrvKeyboardQueue.cpp

    r81214 r82213  
    8383    PDMQUEUEITEMCORE    Core;
    8484    /** The keycode. */
    85     uint32_t            u32UsageCode;
     85    uint32_t            idUsage;
    8686} DRVKBDQUEUEITEM, *PDRVKBDQUEUEITEM;
    8787
     
    212212
    213213/**
    214  * Queues a scancode-based keyboard event.
     214 * @interface_method_impl{PDMIKEYBOARDPORT,pfnPutEventScan}
     215 *
    215216 * Because of the event queueing the EMT context requirement is lifted.
    216  *
    217  * @returns VBox status code.
    218  * @param   pInterface          Pointer to this interface structure.
    219  * @param   u8ScanCode          The scan code to translate/queue.
    220217 * @thread  Any thread.
    221218 */
     
    227224        return VINF_SUCCESS;
    228225
    229     uint32_t    u32Usage = 0;
    230     pDrv->XlatState = ScancodeToHidUsage(pDrv->XlatState, u8ScanCode, &u32Usage);
    231 
    232     if (pDrv->XlatState == SS_IDLE) {
     226    uint32_t idUsage = 0;
     227    pDrv->XlatState = ScancodeToHidUsage(pDrv->XlatState, u8ScanCode, &idUsage);
     228
     229    if (pDrv->XlatState == SS_IDLE)
     230    {
    233231        PDRVKBDQUEUEITEM pItem = (PDRVKBDQUEUEITEM)PDMQueueAlloc(pDrv->pQueue);
    234232        if (pItem)
     
    239237             * key up into a key up/key down sequence.
    240238             */
    241             if (u32Usage == 0x80000090 || u32Usage == 0x80000091)
     239            if (idUsage == UINT32_C(0x80000090) || idUsage == UINT32_C(0x80000091))
    242240            {
    243241                PDRVKBDQUEUEITEM pItem2 = (PDRVKBDQUEUEITEM)PDMQueueAlloc(pDrv->pQueue);
     
    249247                {
    250248                    /* Manufacture a key down event. */
    251                     pItem2->u32UsageCode = u32Usage & ~0x80000000;
     249                    pItem2->idUsage = idUsage & ~UINT32_C(0x80000000);
    252250                    PDMQueueInsert(pDrv->pQueue, &pItem2->Core);
    253251                }
    254252            }
    255253
    256             pItem->u32UsageCode = u32Usage;
     254            pItem->idUsage = idUsage;
    257255            PDMQueueInsert(pDrv->pQueue, &pItem->Core);
    258256
     
    269267
    270268/**
    271  * Queues a HID-usage-based keyboard event.
     269 * @interface_method_impl{PDMIKEYBOARDPORT,pfnPutEventHid}
     270 *
    272271 * Because of the event queueing the EMT context requirement is lifted.
    273  *
    274  * @returns VBox status code.
    275  * @param   pInterface          Pointer to this interface structure.
    276  * @param   u32UsageCode        The HID usage code to queue.
    277272 * @thread  Any thread.
    278273 */
    279 static DECLCALLBACK(int) drvKbdQueuePutEventHid(PPDMIKEYBOARDPORT pInterface, uint32_t u32UsageCode)
     274static DECLCALLBACK(int) drvKbdQueuePutEventHid(PPDMIKEYBOARDPORT pInterface, uint32_t idUsage)
    280275{
    281276    PDRVKBDQUEUE pDrv = IKEYBOARDPORT_2_DRVKBDQUEUE(pInterface);
     
    287282    if (pItem)
    288283    {
    289         pItem->u32UsageCode = u32UsageCode;
     284        pItem->idUsage = idUsage;
    290285        PDMQueueInsert(pDrv->pQueue, &pItem->Core);
    291286
     
    357352    PDRVKBDQUEUE        pThis = PDMINS_2_DATA(pDrvIns, PDRVKBDQUEUE);
    358353    PDRVKBDQUEUEITEM    pItem = (PDRVKBDQUEUEITEM)pItemCore;
    359     int rc = pThis->pUpPort->pfnPutEventHid(pThis->pUpPort, pItem->u32UsageCode);
     354    int rc = pThis->pUpPort->pfnPutEventHid(pThis->pUpPort, pItem->idUsage);
    360355    return RT_SUCCESS(rc);
    361356}
  • trunk/src/VBox/Devices/Input/UsbKbd.cpp

    r76553 r82213  
    700700
    701701/**
    702  * Keyboard event handler.
    703  *
    704  * @returns VBox status code.
    705  * @param   pInterface      Pointer to the keyboard port interface (KBDState::Keyboard.IPort).
    706  * @param   u32UsageCode    The key usage ID.
    707  */
    708 static DECLCALLBACK(int) usbHidKeyboardPutEvent(PPDMIKEYBOARDPORT pInterface, uint32_t u32UsageCode)
     702 * @interface_method_impl{PDMIKEYBOARDPORT,pfnPutEventHid}
     703 */
     704static DECLCALLBACK(int) usbHidKeyboardPutEvent(PPDMIKEYBOARDPORT pInterface, uint32_t idUsage)
    709705{
    710706    PUSBHID pThis = RT_FROM_MEMBER(pInterface, USBHID, Lun0.IPort);
     
    714710    int         rc = VINF_SUCCESS;
    715711
     712    /* Let's see what we got... */
     713    fKeyDown  = !(idUsage & UINT32_C(0x80000000));
     714    u8HidCode = idUsage & 0xFF;
     715    AssertReturn(u8HidCode <= VBOX_USB_MAX_USAGE_CODE, VERR_INTERNAL_ERROR);
     716
    716717    RTCritSectEnter(&pThis->CritSect);
    717 
    718     /* Let's see what we got... */
    719     fKeyDown  = !(u32UsageCode & 0x80000000);
    720     u8HidCode = u32UsageCode & 0xFF;
    721     AssertReturn(u8HidCode <= VBOX_USB_MAX_USAGE_CODE, VERR_INTERNAL_ERROR);
    722718
    723719    LogFlowFunc(("key %s: 0x%x\n", fKeyDown ? "down" : "up", u8HidCode));
     
    737733    else if (fHaveEvent)
    738734    {
    739         if (RT_UNLIKELY(u32UsageCode == KRSP_BAT_FAIL))
    740         {
    741             /* Clear all currently depressed and unreported keys. */
    742             RT_ZERO(pThis->abDepressedKeys);
    743         }
    744         else
     735        if (RT_LIKELY(idUsage != KRSP_BAT_FAIL))
    745736        {
    746737            /* Regular key event - update keyboard state. */
     
    749740            else
    750741                pThis->abDepressedKeys[u8HidCode] = 0;
     742        }
     743        else
     744        {
     745            /* Clear all currently depressed and unreported keys. */
     746            RT_ZERO(pThis->abDepressedKeys);
    751747        }
    752748
  • trunk/src/VBox/Main/src-client/KeyboardImpl.cpp

    r81369 r82213  
    255255        return S_OK;
    256256
    257     int vrc = VINF_SUCCESS;
    258     uint32_t u32Usage;
    259     u32Usage = (uint16_t)aUsageCode | ((uint32_t)(uint8_t)aUsagePage << 16) | (fKeyRelease ? 0x80000000 : 0);
    260     vrc = pUpPort->pfnPutEventHid(pUpPort, u32Usage);
     257    uint32_t idUsage = (uint16_t)aUsageCode | ((uint32_t)(uint8_t)aUsagePage << 16) | (fKeyRelease ? UINT32_C(0x80000000) : 0);
     258    int vrc = pUpPort->pfnPutEventHid(pUpPort, idUsage);
    261259    if (RT_FAILURE(vrc))
    262260        return setErrorBoth(VBOX_E_IPRT_ERROR, vrc,
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