VirtualBox

Changeset 50806 in vbox


Ignore:
Timestamp:
Mar 17, 2014 7:41:45 PM (11 years ago)
Author:
vboxsync
Message:

PS2M: ImEx can be enabled any time.

File:
1 edited

Legend:

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

    r49255 r50806  
    4848 * sequence can be used to switch to ImPS/2 or ImEx mode. Three consecutive
    4949 * Set Sampling Rate (0F3h) commands with arguments 200, 100, 80 switch to ImPS/2
    50  * mode. While in ImPS/2 mode, three consecutive Set Sampling Rate commands with
    51  * arguments 200, 200, 80 switch to ImEx mode. The Read ID (0F2h) command will
    52  * report the currently selected protocol.
     50 * mode. While in ImPS/2 or PS/2 mode, three consecutive Set Sampling Rate
     51 * commands with arguments 200, 200, 80 switch to ImEx mode. The Read ID (0F2h)
     52 * command will report the currently selected protocol.
    5353 *
    5454 *
     
    197197typedef enum {
    198198    PS2M_KNOCK_INITIAL,
    199     PS2M_KNOCK_IMPS2_1ST,
     199    PS2M_KNOCK_1ST,
    200200    PS2M_KNOCK_IMPS2_2ND,
    201     PS2M_KNOCK_IMEX_1ST,
    202201    PS2M_KNOCK_IMEX_2ND
    203202} PS2M_KNOCK_STATE;
     
    459458static void ps2mRateProtocolKnock(PPS2M pThis, uint8_t rate)
    460459{
    461     if (pThis->enmProtocol == PS2M_PROTO_PS2STD)
    462     {
    463         switch (pThis->enmKnockState)
     460    switch (pThis->enmKnockState)
     461    {
     462    case PS2M_KNOCK_INITIAL:
     463        if (rate == 200)
     464            pThis->enmKnockState = PS2M_KNOCK_1ST;
     465        break;
     466    case PS2M_KNOCK_1ST:
     467        if (rate == 100)
     468            pThis->enmKnockState = PS2M_KNOCK_IMPS2_2ND;
     469        else if (rate == 200)
     470            pThis->enmKnockState = PS2M_KNOCK_IMEX_2ND;
     471        else
     472            pThis->enmKnockState = PS2M_KNOCK_INITIAL;
     473        break;
     474    case PS2M_KNOCK_IMPS2_2ND:
     475        if (rate == 80)
    464476        {
    465         case PS2M_KNOCK_INITIAL:
    466             if (rate == 200)
    467                 pThis->enmKnockState = PS2M_KNOCK_IMPS2_1ST;
    468             break;
    469         case PS2M_KNOCK_IMPS2_1ST:
    470             if (rate == 100)
    471                 pThis->enmKnockState = PS2M_KNOCK_IMPS2_2ND;
    472             else
    473                 pThis->enmKnockState = PS2M_KNOCK_INITIAL;
    474             break;
    475         case PS2M_KNOCK_IMPS2_2ND:
    476             if (rate == 80)
    477             {
    478                 pThis->enmProtocol = PS2M_PROTO_IMPS2;
    479                 LogRelFlow(("PS2M: Switching mouse to ImPS/2 protocol.\n"));
    480             }
    481         default:
    482             pThis->enmKnockState = PS2M_KNOCK_INITIAL;
     477            pThis->enmProtocol = PS2M_PROTO_IMPS2;
     478            LogRelFlow(("PS2M: Switching mouse to ImPS/2 protocol.\n"));
    483479        }
    484     }
    485     else if (pThis->enmProtocol == PS2M_PROTO_IMPS2)
    486     {
    487         switch (pThis->enmKnockState)
     480        pThis->enmKnockState = PS2M_KNOCK_INITIAL;
     481        break;
     482    case PS2M_KNOCK_IMEX_2ND:
     483        if (rate == 80)
    488484        {
    489         case PS2M_KNOCK_INITIAL:
    490             if (rate == 200)
    491                 pThis->enmKnockState = PS2M_KNOCK_IMEX_1ST;
    492             break;
    493         case PS2M_KNOCK_IMEX_1ST:
    494             if (rate == 200)
    495                 pThis->enmKnockState = PS2M_KNOCK_IMEX_2ND;
    496             else
    497                 pThis->enmKnockState = PS2M_KNOCK_INITIAL;
    498             break;
    499         case PS2M_KNOCK_IMEX_2ND:
    500             if (rate == 80)
    501             {
    502                 pThis->enmProtocol = PS2M_PROTO_IMEX;
    503                 LogRelFlow(("PS2M: Switching mouse to ImEx protocol.\n"));
    504             }
    505         default:
    506             pThis->enmKnockState = PS2M_KNOCK_INITIAL;
     485            pThis->enmProtocol = PS2M_PROTO_IMEX;
     486            LogRelFlow(("PS2M: Switching mouse to ImEx protocol.\n"));
    507487        }
     488        /* Fall through! */
     489    default:
     490        pThis->enmKnockState = PS2M_KNOCK_INITIAL;
    508491    }
    509492}
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