Exemplo n.º 1
0
//------------------------------------------------------------------------------
//
//  Function:  OALKitlInitRegistry
//
VOID
OALKitlInitRegistry(
    )
{
    DEVICE_LOCATION devLoc;

    // Get KITL device location
    if (!OALKitlGetDevLoc(&devLoc)) goto cleanUp;

    // Depending on device bus
    switch (devLoc.IfcType)
        {
        case Internal:
            switch (devLoc.LogicalLoc)
                {
                case BSP_LAN9115_REGS_PA:
                    // Disable ethernet, enable USB
                    OEMEthernetDriverEnable(FALSE);
                    OEMUsbDriverEnable(TRUE);
                    break;   
                case OMAP_USBHS_REGS_PA:
                    // Disable USB, enable ethernet
                    OEMEthernetDriverEnable(TRUE);
                    OEMUsbDriverEnable(FALSE);
                    break;   
                default:
                    // Enable both USB and ethernet
                    OEMEthernetDriverEnable(TRUE);
                    OEMUsbDriverEnable(TRUE);
                    break;   
                }
            break;
        }

cleanUp:
    return;
}
Exemplo n.º 2
0
VOID OALKitlInitRegistry()
{
    HKEY Key;
    DWORD Status;
    DWORD Disposition;
    DWORD Value;
    DWORD Flags;
    DEVICE_LOCATION devLoc;

    // Get KITL device location
    if (!OALKitlGetDevLoc(&devLoc))
        goto CleanUp;

    if (devLoc.LogicalLoc == S3C6410_BASE_REG_PA_USBOTG_LINK)
    {
        // Disable the UsbFn driver since it is used for KITL
        //

        Status = NKRegCreateKeyEx(HKEY_LOCAL_MACHINE, L"Drivers\\BuiltIn\\SC6410USBFN", 0, NULL, 0, 0, NULL, &Key, &Disposition);

        if (Status == ERROR_SUCCESS)
        {
            Disposition = DEVFLAGS_NOLOAD;
            // Set Flags value to indicate no loading of driver for this device
            Status = NKRegSetValueEx(Key, DEVLOAD_FLAGS_VALNAME, 0, DEVLOAD_FLAGS_VALTYPE, (PBYTE)&Disposition, sizeof(Disposition));
        }

        // Close the registry key.
        NKRegCloseKey(Key);

        if (Status != ERROR_SUCCESS)
        {
            KITL_RETAILMSG(ZONE_INIT, ("OALKitlInitRegistry: failed to set \"no load\" key for Usbfn driver.\r\n"));
            goto CleanUp;
        }

        KITL_RETAILMSG(ZONE_INIT, ("INFO: USB being used for KITL - disabling Usbfn driver...\r\n"));
    }

    if (devLoc.LogicalLoc == BSP_BASE_REG_PA_DM9000A_IOBASE)
    {
        // If KITL is over Ethernet and interrupt is enabled, let the 
        // PowerButton Driver know, so that it can disable the Reset Button 
        // (The Reset button interrupt clashes with the Ethernet KITL interrupt)

        // Get the KITL flags
        if (!OALKitlGetFlags(&Flags))
            goto CleanUp;

        if (!(Flags & OAL_KITL_FLAGS_POLL))
        {
            Status = NKRegCreateKeyEx(HKEY_LOCAL_MACHINE, L"Drivers\\BuiltIn\\PowerButton", 0, NULL, 0, 0, NULL, &Key, &Disposition);

            if (Status == ERROR_SUCCESS)
            {
                Value = 1;
                Status = NKRegSetValueEx(Key, L"EthernetKITLInterruptEnabled", 0, REG_DWORD, (PBYTE)&Value, sizeof(Value));
            }

            // Close the registry key.
            NKRegCloseKey(Key);

            if (Status != ERROR_SUCCESS)
            {
                KITL_RETAILMSG(ZONE_INIT, ("OALKitlInitRegistry: failed to set key to disable reset button.\r\n"));
                goto CleanUp;
            }

            KITL_RETAILMSG(ZONE_INIT, ("INFO: Ethernet KITL Interrupt enabled - disabling reset button in button driver.\r\n"));

        }
    }

CleanUp:
    return;
}