亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? sdhceventhandlers.cpp

?? S3C2443 WINCE6.0 BSP
?? CPP
?? 第 1 頁 / 共 5 頁
字號:
        } else {
            // the VER_1 tuple is optional, so if we could not find it, we
            // allocate the string identifying it as unknown
            found = FALSE;
            length = UNKNOWN_PRODUCT_INFO_STRING_LENGTH;
        }
        // allocate the string (include NULL) even if no tuple
        pDevice->SDCardInfo.SDIOInformation.pCommonInformation->pProductInformation = 
            (PWCHAR)SDAllocateMemoryWithTag((sizeof(WCHAR)) * (length + 1),
            SD_BUS_DRIVER_TAG);

        if (NULL == pDevice->SDCardInfo.SDIOInformation.pCommonInformation->pProductInformation) {
            DEBUGMSG(SDCARD_ZONE_ERROR, (TEXT("SDBusDriver:  Failed to allocate product information string \n")));
            return SD_API_STATUS_INSUFFICIENT_RESOURCES;
        }

        if (found) {

            pVersionBuffer = (PCHAR)SDAllocateMemoryWithTag((sizeof(CHAR)) * (length + 1),
                SD_BUS_DRIVER_TAG);

            if (NULL == pVersionBuffer) {
                DEBUGMSG(SDCARD_ZONE_ERROR, (TEXT("SDBusDriver:  Failed to allocate product information string \n")));            
                return SD_API_STATUS_INSUFFICIENT_RESOURCES;
            }

            // retrieve the tuple from the common CIS
            status = SDGetTuple__X((SD_DEVICE_HANDLE)pDevice,
                SD_CISTPL_VERS_1,
                (PUCHAR)pVersionBuffer,
                &length,
                TRUE);   


            if (!SD_API_SUCCESS(status)) {
                SDFreeMemory(pVersionBuffer);
                return status;
            }

            // make sure the string is null terminated
            pVersionBuffer[length] = NULL;

            // bump past the binary version info,
            // and format the string to wide char
            FormatProductString(&pVersionBuffer[2],  
                pDevice->SDCardInfo.SDIOInformation.pCommonInformation->pProductInformation);
            // free the version buffer
            SDFreeMemory(pVersionBuffer);

        } else {
            // form the product name based on the required MANF and CARDID instead of the
            // ver1 string
            swprintf( pDevice->SDCardInfo.SDIOInformation.pCommonInformation->pProductInformation,
                TEXT("Manufacturer ID:0x%04X, Card ID:0x%04X"),
                pDevice->SDCardInfo.SDIOInformation.pCommonInformation->ManufacturerID,
                pDevice->SDCardInfo.SDIOInformation.pCommonInformation->CardID);

        }  
    }

    // function 0 is a fictitious function 
    DEBUGCHK(0 != pDevice->SDCardInfo.SDIOInformation.Function);


    // calculate the FBR offset
    FBROffset = SD_IO_FBR_1_OFFSET + (pDevice->SDCardInfo.SDIOInformation.Function - 1) *
        SD_IO_FBR_LENGTH;

    // fetch the device code
    status = SDReadWriteRegistersDirect__X((SD_DEVICE_HANDLE)pDevice,
        SD_IO_READ,          
        0,          // all from function 0
        FBROffset + SD_IO_FBR_DEVICE_CODE,
        FALSE,
        regValue,
        1); 
    if (!SD_API_SUCCESS(status)) {
        return status;   
    }

    // save the device code, 1.0 style
    pDevice->SDCardInfo.SDIOInformation.DeviceCode = 
        (regValue[0] & SDIO_DEV_CODE_MASK);  

    // check to see if we are using the special device code extension token
    if (SDIO_DEV_CODE_USES_EXTENSION == 
        pDevice->SDCardInfo.SDIOInformation.DeviceCode) {

            // check the CCCR revision for 1.1
            if ((pDevice->SDCardInfo.SDIOInformation.pCommonInformation->CCCRRev 
                & SDIO_CCCR_SPEC_REV_MASK) == SDIO_CCCR_SPEC_REV_1_1) {

                    // fetch the device code extension
                    status = SDReadWriteRegistersDirect__X((SD_DEVICE_HANDLE)pDevice,
                        SD_IO_READ,          
                        0,         
                        FBROffset + SD_IO_FBR_DEVICE_CODE_EXT,
                        FALSE,
                        regValue,
                        1); 

                    if (!SD_API_SUCCESS(status)) {
                        return status;   
                    }   

                    // now 0x10-0xFF are available as device code extensions    
                    pDevice->SDCardInfo.SDIOInformation.DeviceCode = regValue[0];

                }
        }


        // get the CIS and CSA pointers, we do a multi-byte read here
        status = SDReadWriteRegistersDirect__X((SD_DEVICE_HANDLE)pDevice,
            SD_IO_READ,          
            0,      // all from function 0
            FBROffset + SD_IO_FBR_CISP_BYTE_0,
            FALSE,
            CSA_CISBuffer,
            CIS_CSA_BYTES); 
        if (!SD_API_SUCCESS(status)) {
            return status;   
        }

        pDevice->SDCardInfo.SDIOInformation.CISPointer = CSA_CISBuffer[CIS_OFFSET_BYTE_0] | 
            (CSA_CISBuffer[CIS_OFFSET_BYTE_1] << 8) |
            (CSA_CISBuffer[CIS_OFFSET_BYTE_2] << 16);

        pDevice->SDCardInfo.SDIOInformation.CSAPointer = CSA_CISBuffer[CSA_OFFSET_BYTE_0] | 
            (CSA_CISBuffer[CSA_OFFSET_BYTE_1] << 8) |
            (CSA_CISBuffer[CSA_OFFSET_BYTE_2] << 16);

        // allocate a product information tuple and fill it will some sort of
        // friendly name string
        pDevice->SDCardInfo.SDIOInformation.pFunctionInformation = 
            (PWCHAR)SDAllocateMemoryWithTag((sizeof(CHAR)) * (UNKNOWN_PRODUCT_INFO_STRING_LENGTH + 1),
            SD_BUS_DRIVER_TAG);

        if (NULL == pDevice->SDCardInfo.SDIOInformation.pFunctionInformation) {
            DEBUGMSG(SDCARD_ZONE_ERROR, (TEXT("SDBusDriver:  Failed to allocate product information string \n")));
            status = SD_API_STATUS_INSUFFICIENT_RESOURCES;
            return status;
        }

        // form the product name using the device class
        swprintf(pDevice->SDCardInfo.SDIOInformation.pFunctionInformation,
            TEXT("Device of Class Type: %d"),
            pDevice->SDCardInfo.SDIOInformation.DeviceCode);


        DEBUGMSG(SDBUS_ZONE_DEVICE, (TEXT("SDBusDriver: Device 0x%08X , Function String: %s \n"),
            pDevice,
            pDevice->SDCardInfo.SDIOInformation.pFunctionInformation));

        DEBUGMSG(SDBUS_ZONE_DEVICE, (TEXT("SDBusDriver: Common Product String: %s \n"),
            pDevice->pParentDevice->SDCardInfo.SDIOInformation.pCommonInformation->pProductInformation));


        return status;
}

///////////////////////////////////////////////////////////////////////////////
//  SDIOSupportsWakeup - Look at CISTPL_FUNCE for the function to see if
//                       wakeup is supported
//  Input:  pDevice - the device
//          
//  Return: TRUE if wakeup is supported
///////////////////////////////////////////////////////////////////////////////
static
BOOL SDIOSupportsWakeup(PSDCARD_DEVICE_CONTEXT pDevice)
{
    PREFAST_DEBUGCHK(pDevice);

    BOOL fRet = FALSE;
    BYTE rgbFunce[SD_CISTPLE_MAX_BODY_SIZE];
    PSD_CISTPL_FUNCE_FUNCTION pFunce = (PSD_CISTPL_FUNCE_FUNCTION) rgbFunce;
    DWORD cbTuple;
    
    SD_API_STATUS status = SDGetTuple__X((SD_DEVICE_HANDLE)pDevice,
        SD_CISTPL_FUNCE, NULL, &cbTuple, FALSE);

    if ( SD_API_SUCCESS(status) && (cbTuple <= sizeof(rgbFunce)) ) {
        status = SDGetTuple__X((SD_DEVICE_HANDLE)pDevice,
            SD_CISTPL_FUNCE, rgbFunce, &cbTuple, FALSE);
        if ( SD_API_SUCCESS(status) && (pFunce->bType == SD_CISTPL_FUNCE_FUNCTION_TYPE) ) {
            // Valid FUNCE tuple. Check the wake up support bit.
            if (pFunce->FN_WUS) {
                fRet = TRUE;
            }
        }
    }

    return fRet;
}

///////////////////////////////////////////////////////////////////////////////
//  SDCreateChildDevice - create a child device for a multifunction parent device
//  Input:  pParent - the parent device
//          DeviceType - the device type
//          FunctionNumber - function number
//          
//  Output: ppChildDevice - the new child device
//  Return: SD_API_STATUS code
//  Notes:  
//         This function adds a child device to a parent device.  This
//         allows us to keep track of multifunction devices.
///////////////////////////////////////////////////////////////////////////////
SD_API_STATUS SDCreateChildDevice(PSDCARD_DEVICE_CONTEXT pParent, 
                                  SDCARD_DEVICE_TYPE     DeviceType,
                                  UCHAR                  FunctionNumber,
                                  PSDCARD_DEVICE_CONTEXT *ppChildDevice)
{
    PSDCARD_DEVICE_CONTEXT pNewDevice;

    // allocate a device
    pNewDevice = ((CSDBusDriver *)pParent->pSystemContext)->AllocateDeviceContext();

    if (NULL == pNewDevice) {
        DEBUGMSG(SDCARD_ZONE_ERROR, (TEXT("SDBusDriver: SDCreateChildDevice- , Failed to create device.  \n")));
        return SD_API_STATUS_INSUFFICIENT_RESOURCES;
    }

    // copy some parameters inherited from the parent device
    pNewDevice->pSlot = pParent->pSlot;
    pNewDevice->RelativeAddress = pParent->RelativeAddress;
    pNewDevice->OperatingVoltage = pParent->OperatingVoltage;

    if (Device_SD_IO == DeviceType) {
        pNewDevice->SDCardInfo.SDIOInformation.Function = FunctionNumber;
    }

    // set the parent device
    pNewDevice->pParentDevice = pParent;

    // set new device type
    pNewDevice->DeviceType = DeviceType;

    if (Device_SD_IO == DeviceType) {
        // copy the I/O Ocr
        memcpy(&pNewDevice->CachedRegisters.IO_OCR,
            &pParent->CachedRegisters.IO_OCR, 
            sizeof(pParent->CachedRegisters.IO_OCR)); 

    } else if (Device_SD_Memory == DeviceType) {
        // copy all the shadowed registers from the parent
        memcpy(&pNewDevice->CachedRegisters,
            &pParent->CachedRegisters, 
            sizeof(pParent->CachedRegisters)); 

    } else {
        DEBUGCHK(FALSE);
        SDFreeMemory(pNewDevice);
        return SD_API_STATUS_INVALID_PARAMETER;
    }

    // insert the device into the list
    if (NULL == pParent->pNext) {
        pNewDevice->pNext = NULL;
        pParent->pNext = pNewDevice;
    } else {
        // insert at the head of the list
        pNewDevice->pNext = pParent->pNext;
        pParent->pNext = pNewDevice;
    }

    // return the device
    *ppChildDevice = pNewDevice;

    return SD_API_STATUS_SUCCESS;
}

///////////////////////////////////////////////////////////////////////////////
//  SDGetOperationalVoltageRange - Get the operation voltage range
//  Input:  OcrValue - OCR bit mask to determine the voltage range
//          pSlot - the slot
//          
//  Output:
//  Return: DWORD bit mask for optimal operational voltage
//  Notes:  
//         This function compares the OcrValue against the desired
//         voltage range of the slot and the capabilities of the slot
//         the operational value (also encoded as an OCR value) is returned
//         A value of zero indicates no usable voltage range.
///////////////////////////////////////////////////////////////////////////////
DWORD SDGetOperationalVoltageRange(DWORD OcrValue, PSDBUS_HC_SLOT_CONTEXT pSlot)
{
    ULONG i;            // loop variable 

    // check to see if the voltages can be supported
    if (OcrValue & pSlot->VoltageWindowMask) {
        // check to see if the voltage meets the desired voltage range
        if (OcrValue & pSlot->DesiredVoltageMask) {
            DEBUGMSG(SDBUS_ZONE_DEVICE, (TEXT("SDBusDriver: Device Power Range:0x%08X matches HC desired power: 0x%08X \n"), 
                OcrValue, pSlot->DesiredVoltageMask)); 
            // returned desired voltage range suggested by host controller 
            return pSlot->DesiredVoltageMask;
        } else {
            // walk through the voltage mask starting at the low end looking for
            // a voltage that will work with the OCR value
            for (i = 0; i < 32; i++) {
                if (OcrValue & pSlot->VoltageWindowMask & (1 << i)) {
                    DEBUGMSG(SDBUS_ZONE_DEVICE, (TEXT("SDBusDriver: Device Power Range:0x%08X does not match HC desired power 0x%08X \n"),
                        OcrValue, pSlot->DesiredVoltageMask));
                    DEBUGMSG(SDBUS_ZONE_DEVICE, (TEXT("Using negotiated power range: 0x%08X \n"), 
                        (1 << i))); 
                    // found a match
                    return (1 << i);
                }
            }
            // this should never happen, 
            DEBUGCHK(FALSE);
            return 0;
        }

    } else {
        return 0;
    }
}


///////////////////////////////////////////////////////////////////////////////
//  SendSDAppCmd - send an SD App Command synchronously (sends CMD55 followed by command)
//  Input:  hDevice - device handle
//          Command - command to send
//          Argument - argument for command
//          TransferClass - transfer class
//          ResponseType - expected response
//          NumberOfBlocks - number of blocks 
//          BlockSize  - number of blocks
//          pBlockBuffer - buffer size
//  Output: 
//          pResponse - response buffer
//  Return: SD_API_STATUS code
//  Notes:  
//        
///////////////////////////////////////////////////////////////////////////////
SD_API_STATUS SendSDAppCmd(SD_DEVICE_HANDLE     hDevice, 
                           UCHAR                Command,

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
天天色综合成人网| 亚洲国产欧美在线| 欧美日韩久久一区二区| 美女视频黄免费的久久 | 日韩成人免费电影| 国产精品拍天天在线| 日韩美女在线视频| 欧美理论电影在线| 99久久er热在这里只有精品66| 久久国产日韩欧美精品| 亚洲图片欧美综合| 亚洲人吸女人奶水| 中文字幕欧美激情一区| 精品国产网站在线观看| 欧美视频三区在线播放| caoporm超碰国产精品| 国产在线精品一区二区夜色| 亚洲超丰满肉感bbw| 综合精品久久久| 国产精品欧美一区喷水| 国产色91在线| 欧美成人精精品一区二区频| 欧美日韩国产电影| 欧美视频一区二区三区四区| 91视频www| 91免费看片在线观看| 成人国产在线观看| 岛国精品在线观看| 成人一区二区三区在线观看| 国产精品一级片| 国产真实乱子伦精品视频| 麻豆久久久久久久| 久久精品国产一区二区| 蜜桃视频在线观看一区二区| 男女男精品网站| 久久国产麻豆精品| 韩日av一区二区| 国产成人免费av在线| 国产精品18久久久久久久久久久久| 精品一区二区三区的国产在线播放 | 在线观看日韩一区| 91福利社在线观看| 欧美午夜宅男影院| 91麻豆精品国产91久久久久久久久 | 欧美mv日韩mv国产网站app| 欧美一区国产二区| 精品av久久707| 国产日韩视频一区二区三区| 97国产精品videossex| 亚洲一区二区在线观看视频| 亚洲综合小说图片| 午夜日韩在线观看| 久久精品理论片| 国产不卡在线播放| 成人av网站在线观看免费| 99久久伊人久久99| 在线观看亚洲成人| 8x8x8国产精品| 久久久久久夜精品精品免费| 中文字幕在线观看不卡| 一区二区高清免费观看影视大全| 亚欧色一区w666天堂| 国模冰冰炮一区二区| 99久久久精品| 3d动漫精品啪啪1区2区免费| 久久久久免费观看| 夜夜嗨av一区二区三区网页| 久久国产乱子精品免费女| 成人av电影免费观看| 欧美日韩国产精选| 国产亚洲一二三区| 亚洲精品综合在线| 久久国产乱子精品免费女| 成人国产精品免费观看| 欧美亚洲国产怡红院影院| 精品国产乱码久久久久久蜜臀| 国产精品狼人久久影院观看方式| 一二三区精品视频| 国产一区美女在线| 欧美特级限制片免费在线观看| 欧美videofree性高清杂交| 国产精品久久国产精麻豆99网站 | 亚洲国产精品久久久久秋霞影院| 美国毛片一区二区| 色婷婷av久久久久久久| 精品久久久久久久久久久久包黑料 | 天天亚洲美女在线视频| 成人免费看视频| 69p69国产精品| 亚洲欧美日本在线| 国精品**一区二区三区在线蜜桃| 在线精品亚洲一区二区不卡| 精品精品国产高清a毛片牛牛 | 欧美一二三四区在线| 中文字幕中文字幕一区| 久久福利资源站| 欧美色图一区二区三区| 日本一区二区三区四区在线视频| 日精品一区二区| 91麻豆高清视频| 国产性色一区二区| 久久国产精品72免费观看| 欧美亚洲免费在线一区| 国产精品久久久久aaaa| 国产在线播放一区| 91精品国产综合久久久久久久 | 日韩欧美视频在线| 亚洲国产日韩在线一区模特| 暴力调教一区二区三区| 国产午夜精品久久| 韩国av一区二区三区在线观看| 欧美浪妇xxxx高跟鞋交| 日韩三级在线免费观看| 亚洲精品在线网站| 青青草国产精品亚洲专区无| 在线视频综合导航| 亚洲欧美福利一区二区| 丁香婷婷综合网| 久久久久久久国产精品影院| 久久99这里只有精品| 日韩亚洲欧美成人一区| 天堂va蜜桃一区二区三区 | 久久福利视频一区二区| 91精品国产综合久久精品图片 | 欧美激情一区二区三区| 国产在线精品一区二区不卡了| 日韩一区二区电影在线| 免费成人在线网站| 91精品国产综合久久精品麻豆 | 日韩不卡免费视频| 欧美丰满高潮xxxx喷水动漫| 天堂va蜜桃一区二区三区| 678五月天丁香亚洲综合网| 偷偷要91色婷婷| 911精品国产一区二区在线| 日韩成人dvd| 日韩一区二区三区视频在线| 日韩不卡一区二区三区| 欧美sm极限捆绑bd| 国产激情偷乱视频一区二区三区| 国产欧美一区二区精品忘忧草| 国产成人亚洲综合a∨猫咪| 中文字幕欧美激情| 色香蕉久久蜜桃| 婷婷综合久久一区二区三区| 欧美一区二区三区人| 激情综合色综合久久| 中文一区二区在线观看| 色综合天天天天做夜夜夜夜做| 一区二区三区日本| 日韩一区二区三区av| 国产综合久久久久久久久久久久| 中文字幕不卡在线| 欧美在线观看一区二区| 青娱乐精品视频在线| 久久嫩草精品久久久精品| 99久久精品免费看| 视频一区视频二区中文| 久久色.com| 一本大道av一区二区在线播放| 天天av天天翘天天综合网| 精品裸体舞一区二区三区| 国产精品中文字幕欧美| 亚洲码国产岛国毛片在线| 91精品欧美综合在线观看最新| 国产精品白丝av| 亚洲综合一二区| 久久综合国产精品| 欧美在线你懂得| 国产精品自拍一区| 亚洲国产视频在线| 欧美激情综合网| 69av一区二区三区| 9l国产精品久久久久麻豆| 日本vs亚洲vs韩国一区三区二区| 国产无人区一区二区三区| 91国偷自产一区二区三区成为亚洲经典 | 7777精品伊人久久久大香线蕉| 国产精品综合二区| 亚洲福中文字幕伊人影院| 欧美日韩一区二区三区四区| 中文字幕在线免费不卡| 在线成人高清不卡| www.欧美.com| 精品午夜久久福利影院| 亚洲美女精品一区| 久久久久久毛片| 欧美美女激情18p| 成人国产精品免费| 麻豆国产精品777777在线| 一区二区三区四区在线免费观看| 精品国产伦一区二区三区观看体验| 91美女片黄在线| 国产成人免费视频精品含羞草妖精| 日韩成人伦理电影在线观看| 亚洲欧美日韩久久| 欧美高清在线一区| 2021国产精品久久精品| 欧美日韩国产一区二区三区地区| 成人免费高清在线观看|