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

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

?? sddevinf.cpp

?? 6410BSP3
?? CPP
?? 第 1 頁 / 共 4 頁
字號:
//
// 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;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩中文字幕区一区有砖一区| 一区二区在线电影| 国产精品白丝av| 国产精品欧美综合在线| www.日韩av| 一区二区三区视频在线看| 日韩亚洲欧美在线观看| 国产精品1区2区| 激情欧美一区二区三区在线观看| 亚洲视频1区2区| 91精品国产综合久久久久久漫画 | 国产精品情趣视频| 国产三级精品视频| 欧美日本在线播放| 国产福利一区二区三区视频| 亚洲h在线观看| 国产三级精品三级| 中文字幕免费观看一区| 91精品国产综合久久精品性色 | 亚洲另类在线一区| 一区二区高清免费观看影视大全| 洋洋成人永久网站入口| 亚洲午夜一区二区| 国产精品女上位| 日韩毛片精品高清免费| 亚洲成av人综合在线观看| 日本美女视频一区二区| 亚洲私人黄色宅男| 一区二区欧美视频| 日韩不卡一区二区| 韩国视频一区二区| 99久久精品99国产精品| 99久久综合99久久综合网站| 91精彩视频在线| av亚洲精华国产精华精| 在线观看视频一区| 91香蕉视频污| av资源站一区| 欧美手机在线视频| 欧美日韩国产综合一区二区| 精品少妇一区二区三区日产乱码| 欧美中文字幕一区| 2023国产精华国产精品| 日韩一区二区三区高清免费看看| 2020国产精品自拍| 亚洲综合网站在线观看| 亚洲精品中文字幕乱码三区| 日韩不卡一区二区三区| 春色校园综合激情亚洲| 国产成人综合网| 在线精品视频免费观看| 久久一区二区视频| 亚洲一二三四在线| 国产在线精品不卡| 国产suv精品一区二区883| 丰满放荡岳乱妇91ww| 欧美三级电影在线看| 欧美日韩国产三级| 中文字幕av不卡| 日韩综合一区二区| 99久久精品国产毛片| 精品国产乱码久久久久久夜甘婷婷 | 欧美性色黄大片| 国产亚洲一区二区在线观看| 久久看人人爽人人| 国产精品全国免费观看高清| 蜜桃一区二区三区四区| 另类综合日韩欧美亚洲| 国产精品自拍毛片| 欧美三级午夜理伦三级中视频| 国产亚洲欧洲一区高清在线观看| 性感美女极品91精品| jvid福利写真一区二区三区| 日韩三级中文字幕| 亚洲一卡二卡三卡四卡无卡久久| 国产成人自拍高清视频在线免费播放| 欧美日韩国产另类一区| 自拍偷拍亚洲激情| 国产成人在线看| 精品久久久影院| 午夜成人免费电影| 国产一区二区h| 日韩欧美视频一区| 成人免费小视频| 亚洲一本大道在线| 97久久精品人人澡人人爽| 国产亚洲一二三区| 精品一区二区综合| 91原创在线视频| 欧美国产国产综合| 国产精品资源在线| 欧美成人伊人久久综合网| 亚洲3atv精品一区二区三区| 色哟哟一区二区三区| 欧美一区二区在线播放| 日本一区二区成人在线| 国内精品在线播放| 精品成人一区二区三区| 免费av成人在线| 色婷婷综合久久久中文字幕| 国产精品美女一区二区三区| 国产成人夜色高潮福利影视| 欧美精品一区二区久久婷婷| 蜜桃视频在线观看一区| 日韩欧美在线观看一区二区三区| 天天影视色香欲综合网老头| 欧美日本在线观看| 日本中文字幕一区二区视频| 91精品国产黑色紧身裤美女| 一区二区高清在线| 欧美亚洲免费在线一区| 亚洲在线视频网站| 欧美最猛黑人xxxxx猛交| 亚洲视频你懂的| 欧美性受xxxx| 日韩av在线播放中文字幕| 精品日韩一区二区三区免费视频| 男人的天堂久久精品| 日韩欧美的一区二区| 国产在线国偷精品免费看| 国产女人aaa级久久久级| av激情综合网| 亚洲精品国久久99热| 欧美日本在线看| 久久草av在线| 亚洲国产激情av| 在线视频综合导航| 爽好多水快深点欧美视频| 日韩精品一区二区三区三区免费| 国产真实乱对白精彩久久| 国产婷婷一区二区| 91视频观看视频| 亚洲成人av在线电影| 欧美成人官网二区| eeuss鲁一区二区三区| 亚洲在线免费播放| 91精品国产91热久久久做人人| 狠狠色综合色综合网络| 中文字幕中文字幕在线一区 | 国产真实精品久久二三区| 国产欧美日韩在线视频| 91视频在线看| 人人狠狠综合久久亚洲| 国产日韩精品视频一区| 色婷婷久久综合| 美女精品自拍一二三四| 国产精品久线观看视频| 欧美男生操女生| 高清不卡一区二区| 亚洲一区二区在线观看视频| 欧美大片在线观看| 972aa.com艺术欧美| 日韩在线播放一区二区| 国产亚洲一区二区三区| 欧美日韩一区国产| 国产精品18久久久久久久久久久久 | 国产激情视频一区二区三区欧美 | 日韩成人dvd| 成人欧美一区二区三区小说| 日韩午夜中文字幕| 91亚洲精品乱码久久久久久蜜桃| 青青草91视频| 亚洲免费伊人电影| 91国产成人在线| 国产精品一区二区在线播放| 亚洲第一在线综合网站| 日本一区二区综合亚洲| 91精品国产品国语在线不卡| aaa亚洲精品| 精品一区二区三区的国产在线播放| 亚洲人成亚洲人成在线观看图片| 欧美videos中文字幕| 色妞www精品视频| 韩国av一区二区三区四区| 亚洲午夜一二三区视频| 国产精品久久777777| 精品国产一区二区三区不卡 | 波多野结衣视频一区| 免费av成人在线| 亚瑟在线精品视频| 国产精品污www在线观看| 日韩一区二区三区在线| 欧美视频在线不卡| 97精品视频在线观看自产线路二| 久久99国产精品久久99果冻传媒 | 日本韩国一区二区三区视频| 成人午夜碰碰视频| 热久久一区二区| 亚洲国产精品人人做人人爽| 亚洲欧美综合在线精品| 国产清纯白嫩初高生在线观看91 | 国产精品99久久久久久久女警 | 亚洲丰满少妇videoshd| 亚洲色图视频网| 国产人成亚洲第一网站在线播放| 日韩精品一区二区三区视频 | 7777精品伊人久久久大香线蕉超级流畅 | 成人av资源网站| 亚洲综合一区二区精品导航| 国产精品全国免费观看高清|