tluck / OS-X-Voodoo-PS2-Controller

Contains updated Voodoo PS/2 Controller, improved Keyboard & Synaptics TouchPad
Other
19 stars 5 forks source link

Passthru Not Always Enabled #14

Closed jcsnider closed 6 years ago

jcsnider commented 6 years ago

Sorry for the delay @tluck, I wanted to make sure I was correct before bothering you with code changes.

As I mentioned here (https://github.com/RehabMan/OS-X-Voodoo-PS2-Controller/issues/149#issue-313241864) you have one slight oversight that is causing passthru to not always be enabled.

Prior to this block of code running you are setting skipassthru=1 and passthru=1.

    if (!skippassthru)
    {
        UInt8 passthru2 = buf3[2] >> 7;
        // see if guest device for pass through is present
        UInt8 passthru1 = 0;
        if (getTouchPadData(0x1, buf3))
        {
            // first byte, bit 0 indicates guest present
            passthru1 = buf3[0] & 0x01;
        }
        // trackpad must have both guest present and pass through capability
        passthru = passthru1 & passthru2;
#ifdef SIMULATE_PASSTHRU
        passthru = true;
#endif
        DEBUG_LOG("VoodooPS2Trackpad: passthru1=%d, passthru2=%d, passthru=%d\n", passthru1, passthru2, passthru);
    }

The problem is that there is another function overriding the skippassthru variable, so that block of code runs anyways. See function setParamPropertiesGated in the VoodooPS2SynapticsTouchPad.cpp. This line specifically is what is overriding your skippassthru value from one of the plists I believe:

        {"SkipPassThrough",                 &skippassthru},

Anyways, my personal "quick fix" was to do the following.

Add:

skippassthru = 1;
passthru = 1;

Above:

if (!skippassthru)

I delayed posting this until I had confirmation from another Thinkpad user of the fix working. (https://www.tonymacx86.com/threads/guide-lenovo-thinkpad-t440s.244798/page-3#post-1727481)

A more appropriate fix would be to find SkipPassThrough in whichever plist file and setting the value to true. A even better fix would be to correct the passthru support detection code -- I'm working on that side of things now in Rehabman's original repo.

Hope this helps! -JC

jcsnider commented 6 years ago

This should hopefully wrap up any remaining questions with #5, #9, and #11

tluck commented 6 years ago

got it - thanks!

i think just setting SkipPassThru in the Info.plist will do it too. i already set this as default in code: skippassthru = 1; passthru = 1;

but yes setting explicitly right before the if ensures it!

jcsnider commented 6 years ago

Absolutely! It was 6am and I was very tired when I found the problem, adding those two lines were the quickest and easiest way for me to test. There are definitely better fixes available, that's what I'm working on now :)

Cheers!

tluck commented 6 years ago

crap. i just realized there were some (local mods) that i never pushed to the repo. i had synced with 1.18.29 (built the kexts which are included in the T420 builds but never pushed it out here. i added SkipPassThru in the Info.plist for LENOVO

joshuaseltzer commented 6 years ago

@tluck - I noticed you pushed some changes to this repo, including the SkipPassThru in the plist file as mentioned above. I will attempt to compile and run this kext on my T440s.