⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sddisk.h

📁 YLP270的Windows CE5.0 bsp源码。
💻 H
字号:
/*++
Copyright (c) 1999-2000 SanDisk Corporation

Module Name:
    sddisk.h

Abstract:
    This module contains the function prototypes and constant, type,
    global data and structure definitions for the WINCE Secured Digital
    and Multimedia card driver.

--*/


#define DEBUG 1


#ifndef _SDDISK_H_
#define _SDDISK_H_

#ifdef __cplusplus
extern "C" {
#endif



#define DISK_IO_TIME_OUT 10000
#define REQUEST_TIME_OUT 30000
#define BYTES_PER_SECTOR 512


// (The other registers are defined in atapi.h)

#define STATE_INITING 1
#define STATE_CLOSED  2
#define STATE_OPENED  3
#define STATE_DEAD    4    // Power down
#define STATE_REMOVED 5    // Power down



//
// Structure to keep track of a disk
//
typedef struct _DISK {
    struct _DISK * d_next;
    CRITICAL_SECTION d_DiskCardCrit;// guard access to global state and card
    DWORD d_DrvNo;    
    DWORD d_DiskCardState;
    DISK_INFO d_DiskInfo;    // for DISK_IOCTL_GET/SETINFOs
    BOOL  d_fLBAMode;        // TRUE => logical block addressing supported
    DWORD d_OpenCount;       // open ref count
    PUSHORT d_AlignBuf;       // 16 bit aligned sector buffer 
    LPWSTR d_ActivePath;     // Active key registry path
} DISK, * PDISK; 


//
// Global Variables
//
extern DWORD v_MemGran;                // memory granularity (usually 1)
extern CRITICAL_SECTION v_DiskCrit;    // guard access to disk structure list
extern PDISK v_DiskList;

//
// Global functions
//
extern void  CloseDisk(PDISK pDisk);
extern DWORD DoDiskIO(PDISK pDisk, DWORD Opcode, PSG_REQ pSG);
extern DWORD GetDiskInfo(PDISK pDisk, PDISK_INFO pInfo);
extern DWORD SetDiskInfo(PDISK pDisk, PDISK_INFO pInfo);
extern DWORD InitDisk(PDISK pDisk);
extern BOOL IsValidDisk(PDISK pDisk);
extern DWORD GetDiskStateError(DWORD DiskState);

#ifdef DEBUG
//
// Debug zones
//
#define ZONE_ERROR      DEBUGZONE(0)
#define ZONE_WARNING    DEBUGZONE(1)
#define ZONE_FUNCTION   DEBUGZONE(2)
#define ZONE_INIT       DEBUGZONE(3)
#define ZONE_IO         DEBUGZONE(5)

#endif  // DEBUG

#ifdef __cplusplus
}
#endif

#endif // _SDDISK_H_

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -