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

? 歡迎來(lái)到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? sddevinf.cpp

?? 6410BSP3
?? CPP
?? 第 1 頁(yè) / 共 4 頁(yè)
字號(hào):
//
// Copyright (c) Microsoft Corporation.  All rights reserved.
//
//
// Use of this sample source code is subject to the terms of the Microsoft
// license agreement under which you licensed this sample source code. If
// you did not accept the terms of the license agreement, you are not
// authorized to use this sample source code. For the terms of the license,
// please see the license agreement between you and Microsoft or, if applicable,
// see the LICENSE.RTF on your install media or the root of your tools installation.
// THE SAMPLE SOURCE CODE IS PROVIDED "AS IS", WITH NO WARRANTIES OR INDEMNITIES.
//

//
// Copyright (c) Microsoft Corporation.  All rights reserved.
//
//
// This source code is licensed under Microsoft Shared Source License
// Version 1.0 for Windows CE.
// For a copy of the license visit http://go.microsoft.com/fwlink/?LinkId=3223.
//
//
/*++
THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
PARTICULAR PURPOSE.

Module Name:  
    SDDevInfo.cpp
Abstract:
    SDBus Implementation.

Notes: 
--*/
#include <windows.h>
#include <types.h>
#include <safeint.hxx>

#include "../HSMMCCh1/s3c6410_hsmmc_lib/sdhcd.h"

#include "sdbus.hpp"
#include "sdslot.hpp"
#include "sdbusreq.hpp"
#include "sddevice.hpp"

BOOL  CSDDevice::IsHighCapacitySDMemory()
{
    if (m_DeviceType == Device_SD_Memory || m_DeviceType == Device_MMC || m_DeviceType == Device_SD_Combo ) {
        return ( (m_CachedRegisters.OCR[3] & 0x40)!=0) ; // OCR Bit 30 is Card Capacity Status bit.
    }
    else 
        return FALSE;
}

///////////////////////////////////////////////////////////////////////////////
//  SDGetTuple__X  - Get tuple data from CIS
//  Input:  hDevice     - SD bus device handle
//          TupleCode   - Tuple code
//          pBufferSize - size of buffer to store Tuple Data
//          CommonCIS   - flag indicating common or function CIS
//  Output: pBuffer     - Tuple data is copied here (optional)
//          pBufferSize - if pBuffer is NULL, this will store the size of the
//                        tuple
//  Return: SD_API_STATUS code
//          
//  Notes: The caller should initially call this function with a NULL buffer
//         to determine the size of the tuple.  The variable pBufferSize points
//         to the caller supplied storage for this result.   If no bus errors occurs
//         the function returns SD_API_STATUS_SUCCESS.   The caller must check 
//         the value of the buffer size returned.  If the value is non-zero, the
//         tuple exists and can be fetched by calling this function again with a
//         non-zero buffer.
///////////////////////////////////////////////////////////////////////////////
SD_API_STATUS CSDDevice::SDGetTuple_I(UCHAR TupleCode,PUCHAR pBuffer,PULONG pBufferSize,BOOL CommonCIS)
{
    SD_API_STATUS status = SD_API_STATUS_SUCCESS;  // intermediate status
    UCHAR                  tCode;                  // tuple code we've read so far
    UCHAR                  tupleLink;              // tuple link offset
    ULONG                  currentOffset;          // current offset

    DEBUGMSG(SDCARD_ZONE_FUNC, (TEXT("SDCard: +SDGetTuple\n")));


    if (NULL == pBufferSize) {
        DEBUGMSG(SDCARD_ZONE_ERROR, (TEXT("SDGetTuple: NULL buffer size \n")));
        return SD_API_STATUS_INVALID_PARAMETER;
    }

    if (pBuffer == NULL) {
        // Initialize pBufferSize to zero to indicate that the tuple 
        // was not found
        *pBufferSize = 0; 
    }
    
    currentOffset = 0;
    // walk through the CIS
    while (TRUE) {

        // get 1 byte at the current position
        status = SDGetTupleBytes(currentOffset,  &tCode, 1, CommonCIS);

        if (!SD_API_SUCCESS(status)) {
            break;
        }
        // add the tCode
        currentOffset += 1;

        if(SD_CISTPL_END == tCode) {
            // this is the End of chain Tuple
            // break out of while loop
            break;

        } else  {

            // get the tuple link offset in the next byte, we always need this
            // value, so we fetch it before we compare the tuple code
            status = SDGetTupleBytes(currentOffset, &tupleLink, 1, CommonCIS);

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

            // add the link
            currentOffset += 1;

            // check for the end link flag, this is the alternative method to stop
            // tuple scanning
            if (SD_TUPLE_LINK_END == tupleLink) {
                // we reached an end of chain
                break;
            }
            // go back and check the tuple code
            if (tCode == TupleCode) {
                // found it

                // check to see if the caller is interested in the data
                if (NULL != pBuffer) {

                    // if the user passed a buffer, they must pass the buffer size, double check the length
                    if (*pBufferSize < tupleLink) {
                        DEBUGMSG(SDCARD_ZONE_ERROR, (TEXT("SDCard: SDGetTuple, caller supplied buffer of size: %d bytes but tuple body (code=0x%02X) reports size of %d bytes\n"),
                            *pBufferSize, tCode, tupleLink));    
                        status = SD_API_STATUS_INVALID_PARAMETER;
                        break;
                    }

                    // fetch the tuple body
                    status = SDGetTupleBytes(currentOffset, 
                        pBuffer, 
                        tupleLink, 
                        CommonCIS);

                } else {

                    // return the size of the tuple body we just found, no need to fetch
                    *pBufferSize = tupleLink;
                }
                // break out of the while loop 
                break;

            } else {

                // add the value of the link
                currentOffset += tupleLink;
            }

        } 

    }

    DEBUGMSG(SDCARD_ZONE_FUNC, (TEXT("SDCard: -SDGetTuple\n")));
    return status;
}
///////////////////////////////////////////////////////////////////////////////
//  SDGetTupleBytes - Gets tuple bytes at the current tuple offset
//  Input:  hDevice       - SD bus device handle
//          Offset        - offset from the CIS pointer
//          NumberOfBytes - number of bytes to fetch
//          CommonCIS     - flag indicating that this is fetched from the common CIS
//  Output: pBuffer       - Tuple data is copied here (optional)

//  Return: SD_API_STATUS code
//          
//  Notes:
//         If the Buffer pointer is NULL, the function does not fetch the bytes
///////////////////////////////////////////////////////////////////////////////
SD_API_STATUS CSDDevice::SDGetTupleBytes(DWORD Offset,PUCHAR pBuffer,ULONG NumberOfBytes,BOOL CommonCIS)
{
    SD_API_STATUS          status;          // intermediate status
    DWORD                  tupleAddress;    // calculated tuple address


    status = SD_API_STATUS_INVALID_PARAMETER;

    if (m_DeviceType == Device_SD_IO || m_DeviceType == Device_SD_Combo ) {
        if (CommonCIS) {
            if (m_FuncionIndex!=0) {
                CSDDevice * psdDevice0 = m_sdSlot.GetFunctionDevice(0);
                if (psdDevice0) {
                    status = psdDevice0->SDGetTupleBytes(Offset,pBuffer,NumberOfBytes, CommonCIS);
                    psdDevice0->DeRef();
                }
                return status;
            }
            else {
                DEBUGCHK(NULL != m_SDCardInfo.SDIOInformation.pCommonInformation);
                DEBUGCHK(0 != m_SDCardInfo.SDIOInformation.pCommonInformation->CommonCISPointer);
                // the tuple starting address is at the common CIS pointer
                tupleAddress = m_SDCardInfo.SDIOInformation.pCommonInformation->CommonCISPointer;
            }
        } else { 
            DEBUGCHK(0 != m_SDCardInfo.SDIOInformation.CISPointer);
            // the tuple starting address is at the function CIS pointer
            tupleAddress = m_SDCardInfo.SDIOInformation.CISPointer;
        }

        // add the desired offset
        tupleAddress += Offset;

        if (NULL != pBuffer) {
            CSDDevice * psdDevice0 = m_sdSlot.GetFunctionDevice(0);
            if (psdDevice0) {
                status = psdDevice0->SDReadWriteRegistersDirect_I( SD_IO_READ,tupleAddress,FALSE,pBuffer,NumberOfBytes); 
                psdDevice0->DeRef();
            }

        }
    }
    ASSERT(SD_API_SUCCESS(status));
    return status;
}

//Structure definiton of SDIO Version 1.0 term
typedef struct _SDIO_TPLFID_FUNC17_V10 {
    UCHAR   ExtendedDataType;
    UCHAR   FunctionInfo;
    UCHAR   StandardRev;
    USHORT  CardPSN;
    USHORT  CSASize;
    UCHAR   CSAProperty;
    USHORT  MaxBlockSize;
    USHORT  OCR;
    UCHAR   OpMinPwr;
    UCHAR   OpAvgPwr;
    UCHAR   OpMaxPwr;
    UCHAR   StbyMinPwr;
    UCHAR   StbyAvgPwr;
    UCHAR   StbyMaxPwr;
    USHORT  MinBandwidth;
    USHORT  OptimalBandwidth;
}SDIO_TPLFID_FUNC17_V10, *P_SDIO_TPLFID_FUNC17_V10;

//Structure definiton of SDIO Version 1.10 added term
typedef struct _SDIO_TPLFID_FUNC17_V11 {
    USHORT  EnableTimoutVal;
    USHORT  SpAvePwr33V;
    USHORT  SpMaxPwr33V;
    USHORT  HpAvePwr33V;
    USHORT  HpMaxPwr33V;
    USHORT  LpAvePwr33V;
    USHORT  LpMaxPwr33V;
}SDIO_TPLFID_FUNC17_V11, *P_SDIO_TPLFID_FUNC17_V11;

///////////////////////////////////////////////////////////////////////////////
//  SDGetFunctionPowerControlTuples - Get SDIO Power control Tuples for an SDIO device function
//  Input:  pDevice         - the device context
//  Output: pPowerDrawData  - Data about function's power draw
//  Return: SD_API_STATUS code
//  Notes:  
//         This function collects pwer draw data for a SD function 
//         via the tuple CITPL_FUNCE (extended 0x01).
//         
///////////////////////////////////////////////////////////////////////////////
SD_API_STATUS CSDDevice::SDGetFunctionPowerControlTuples() 
{
    SD_API_STATUS               status;             // intermediate status
    ULONG                       length;             // tuple length
    UCHAR                       buffer[SD_CISTPLE_MAX_BODY_SIZE]; //tupple info
    P_SDIO_TPLFID_FUNC17_V10    pV1FunctionTuple;   // SDIO V1.0 Function Tuple
    P_SDIO_TPLFID_FUNC17_V11    pV11FunctionTupleExt;// SDIO V1.1 Extentions to Function Tuple
    PSD_FUNCTION_POWER_DRAW     pPowerDrawData = &m_SDCardInfo.SDIOInformation.PowerDrawData;

    length = 0;

        // get the FUNCE tuple
    status = SDGetTuple_I( SD_CISTPL_FUNCE, NULL, &length, FALSE);

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

    if (0 == length) {
        DbgPrintZo(SDCARD_ZONE_ERROR, 
            (TEXT("SDBusDriver: Card does not have FUNCE tuple! \n")));
           return SD_API_STATUS_DEVICE_UNSUPPORTED;
    } else {

        if (length < sizeof(SDIO_TPLFID_FUNC17_V10)) {
             DbgPrintZo(SDCARD_ZONE_ERROR, 
                (TEXT("SDBusDriver: Function tuple reports size of %d , expecting %d or greater\n"),
                length, sizeof(SDIO_TPLFID_FUNC17_V10)));
            return SD_API_STATUS_DEVICE_UNSUPPORTED;   
        }

            // get the tplIDfunction tuple 
        status = SDGetTuple_I(SD_CISTPL_FUNCE,(PUCHAR)buffer,&length,FALSE);

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

        if (buffer[0] != 0x01) {
             DbgPrintZo(SDCARD_ZONE_ERROR, 
                (TEXT("SDBusDriver: Tuple is not Extended Data type: %d \n"),
                buffer[0]));
            return SD_API_STATUS_DEVICE_UNSUPPORTED;   
        }

        pV1FunctionTuple = (P_SDIO_TPLFID_FUNC17_V10)buffer;

        pPowerDrawData->OpMinPower = pV1FunctionTuple->OpMinPwr;
        pPowerDrawData->OpAvePower = pV1FunctionTuple->OpAvgPwr;
        pPowerDrawData->OpMaxPower = pV1FunctionTuple->OpMaxPwr;


        if (length < (sizeof(SDIO_TPLFID_FUNC17_V10) + sizeof(SDIO_TPLFID_FUNC17_V11))) {
            pPowerDrawData->SpAvePower33 = 0;
            pPowerDrawData->SpMaxPower33 = 0;

            pPowerDrawData->HpAvePower33 = 0;
            pPowerDrawData->HpMaxPower33 = 0;

            pPowerDrawData->LpAvePower33 = 0;
            pPowerDrawData->LpMaxPower33 = 0;
        }
        else
        {
            pV11FunctionTupleExt = (P_SDIO_TPLFID_FUNC17_V11)(&buffer[sizeof(SDIO_TPLFID_FUNC17_V10)]);

            pPowerDrawData->SpAvePower33 = pV11FunctionTupleExt->SpAvePwr33V;
            pPowerDrawData->SpMaxPower33 = pV11FunctionTupleExt->SpMaxPwr33V;

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品亚洲成a人| 国产高清在线精品| 久久精品欧美一区二区三区不卡| 粉嫩高潮美女一区二区三区| 一区二区三区四区激情| 欧美电影免费观看高清完整版在| 成人午夜免费av| 精品夜夜嗨av一区二区三区| 亚洲综合在线观看视频| 久久综合色综合88| 精品污污网站免费看| 成人av一区二区三区| 美女网站色91| 亚洲二区视频在线| 国产欧美日韩麻豆91| 欧美一区二区三区不卡| 欧美影片第一页| 99麻豆久久久国产精品免费优播| 久久精品国产一区二区| 亚洲成人av电影| 亚洲欧美国产77777| 国产精品久久久久aaaa樱花| 精品粉嫩超白一线天av| 欧美裸体bbwbbwbbw| 91电影在线观看| 91在线视频播放| 成人国产精品免费观看| 国内成人精品2018免费看| 免费在线看成人av| 首页国产丝袜综合| 亚洲成人免费影院| 亚洲午夜久久久久| 亚洲综合色婷婷| 亚洲综合区在线| 亚洲国产精品视频| 欧美成人a视频| 在线一区二区三区| 久久精品国产一区二区三| 欧美另类z0zxhd电影| 色婷婷一区二区三区四区| 成人99免费视频| 成人网在线免费视频| 成人一区二区视频| 成人永久aaa| 成人激情小说乱人伦| 成人久久久精品乱码一区二区三区| 国产精品一区二区三区99| 国产在线视频精品一区| 极品尤物av久久免费看| 国产一区啦啦啦在线观看| 久久99在线观看| 国产一区二区主播在线| 激情成人综合网| 国产主播一区二区三区| 国产成都精品91一区二区三| 成人听书哪个软件好| av在线这里只有精品| 日本韩国欧美一区| 555www色欧美视频| 精品国产乱码久久久久久牛牛 | 欧美精品一区二区不卡 | 久久日韩粉嫩一区二区三区| 久久久久久一级片| 中文字幕一区二区三区四区不卡| 亚洲欧洲精品天堂一级| 亚洲影视在线播放| 久久精品999| av在线不卡网| 精品视频资源站| 久久久久久久久久看片| 国产精品久久久99| 天天av天天翘天天综合网色鬼国产 | 成人av资源在线观看| 欧美亚洲高清一区| 精品美女被调教视频大全网站| 国产欧美日韩在线看| 亚洲最大的成人av| 狠狠狠色丁香婷婷综合激情| 成人avav在线| 在线综合视频播放| 国产精品欧美一级免费| 天天操天天色综合| 不卡影院免费观看| 制服.丝袜.亚洲.中文.综合| 亚洲国产电影在线观看| 日本视频一区二区三区| 成人av网址在线观看| 在线观看91av| 综合久久久久久久| 国产麻豆欧美日韩一区| 欧美综合视频在线观看| 久久影院午夜片一区| 亚洲线精品一区二区三区八戒| 国产精品一区二区三区99| 欧美伦理视频网站| 亚洲天堂中文字幕| 韩日欧美一区二区三区| 欧美日韩成人综合| 国产精品麻豆99久久久久久| 久久国产尿小便嘘嘘尿| 在线观看日韩一区| 国产亚洲精品aa午夜观看| 视频一区二区国产| 一本到三区不卡视频| 中文字幕av在线一区二区三区| 喷白浆一区二区| 欧美性色综合网| 中文字幕一区二区三区蜜月| 国产一区二区h| 欧美一区二区三区视频在线| 一区二区三区在线视频观看58| 国产成人在线影院| 日韩精品一区二区三区在线播放| 一区二区高清视频在线观看| 懂色av一区二区三区免费观看| 日韩欧美一二三四区| 亚洲国产精品一区二区久久 | 欧美精选在线播放| 亚洲免费三区一区二区| 成人毛片老司机大片| xf在线a精品一区二区视频网站| 秋霞影院一区二区| 欧美日韩国产综合一区二区| 亚洲猫色日本管| av网站免费线看精品| 国产欧美精品日韩区二区麻豆天美| 九色porny丨国产精品| 欧美一区二区三区的| 奇米在线7777在线精品| 欧美日韩一区在线观看| 亚洲国产成人高清精品| 欧美天堂亚洲电影院在线播放| 亚洲综合视频在线观看| 91福利视频网站| 一级做a爱片久久| 日本福利一区二区| 亚洲精品免费播放| 91黄色激情网站| 亚洲一区二区三区中文字幕在线| 91国产福利在线| 午夜精品福利一区二区三区av| 欧美裸体一区二区三区| 麻豆精品国产传媒mv男同| 欧美成人性福生活免费看| 精品亚洲成a人| 国产午夜精品一区二区三区嫩草 | 91蜜桃网址入口| 亚洲精品欧美在线| 欧美在线观看视频一区二区 | 粉嫩av一区二区三区| 欧美高清在线视频| 色综合天天综合网国产成人综合天 | 91精品国产色综合久久久蜜香臀| 日韩极品在线观看| 日韩精品一区二区三区三区免费| 国产乱人伦偷精品视频不卡| 欧美经典一区二区| 97精品国产露脸对白| 午夜日韩在线电影| 久久久美女毛片| 99国产精品久久| 亚洲va欧美va国产va天堂影院| 欧美一区二区三区在线| 国产精品系列在线播放| 亚洲人快播电影网| 666欧美在线视频| 大胆欧美人体老妇| 亚洲一二三四久久| 亚洲精品一区二区三区香蕉| 国产精品2024| 亚洲午夜成aⅴ人片| 欧美mv和日韩mv的网站| 99精品视频一区二区三区| 亚洲国产精品视频| 欧美激情中文不卡| 欧美色网一区二区| 国产精品综合一区二区三区| 亚洲欧美激情插| 欧美mv日韩mv国产| 在线影院国内精品| 激情文学综合丁香| 亚洲一区免费观看| 国产香蕉久久精品综合网| 在线观看亚洲精品| 国产在线视频不卡二| 亚洲成人在线观看视频| 国产欧美日韩精品在线| 欧美一二三在线| 91婷婷韩国欧美一区二区| 精品一区二区日韩| 亚洲女性喷水在线观看一区| 欧美精品一区二区三区一线天视频 | 一本色道综合亚洲| 国产毛片精品视频| 亚洲成人av免费| 自拍视频在线观看一区二区| 精品欧美乱码久久久久久1区2区| 色一情一乱一乱一91av| 国产精品一线二线三线精华| 午夜电影久久久|