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

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

?? usbcom.h

?? NXP產(chǎn)品LPC23XX的開(kāi)發(fā)板的源文件
?? H
?? 第 1 頁(yè) / 共 4 頁(yè)
字號(hào):
/*++

Module Name:

    USBCOM.H

Abstract:

	Kernel mode definitions and function prototypes

Environment:

    Kernel mode

Notes:

  Copyright (c) 1997-2000 Maverick Corporation.  All Rights Reserved.

Revision History:

    04/26/00 : created

--*/
#ifndef USBCOM_INCD
#define USBCOM_INCD


#include "ntddser.h"
#include "BusbDbg.h"
#include "serial.h"
#include "wmidata.h"
#include "wmilib.h"

// the size of the transfer buffer on your test board or device
#define UsbCom_TEST_BOARD_TRANSFER_BUFFER_SIZE (64 *1024 )
#define THREAD_DELAY_VALUE            (ULONG)(-1 * 1 * 1000)     // 0.5 ms
//
// Default xon/xoff characters.
//
#define SERIAL_DEF_XON 0x11
#define SERIAL_DEF_XOFF 0x13

#define THREAD_NOTIFIED 0
#define DATA_REQUEST_EVENT   1
#define BULK_REQUEST_COMPLETED 2
#define WRITE_DATA_EVENT   1
#define WRITE_COMPLETE_NOTIFY 2

//Flags values
#define IO_FLAGS_DATA_IN 1
#define IO_FLAGS_DATA_OUT 2
#define IO_FLAGS_SCATTER_GATHER 4

#define READ_REQUEST		0 
#define	WRITE_REQUEST		1

#define SYMBOLIC_NAME_LENGTH        128
#define DEVICE_OBJECT_NAME_LENGTH   128
#define UsbCom_MAX_TRANSFER_SIZE	256
#define SERIAL_DEVICE_MAP           L"SERIALCOMM"
//#define DEFAULT_DIRECTORY			L"DosDevices"

#define MIN(a,b) ((a) < (b) ? (a) :(b))
#define max(a, b)  (((a) > (b)) ? (a) : (b))

// used to track driver-generated io irps for staged read/write processing
typedef struct _UsbCom_RW_CONTEXT {
    PURB Urb;
    PDEVICE_OBJECT DeviceObject;
    PIRP  Irp;
    PMDL  Mdl;
} UsbCom_RW_CONTEXT, *PUsbCom_RW_CONTEXT;

typedef struct _IOPACKET
{
        ULONG   Fdo;
        PVOID   Iop;
        UCHAR*  Cdb;
        UCHAR   CdbLength ;
        PUCHAR   DataBuffer;
        ULONG   DataLength;
        ULONG   BlockSize;
        ULONG   Flags;
        ULONG   Status;
        ULONG   BytesXmitOrRecv;
        ULONG   RequestType;
        ULONG   VxdSerObjContext;
        ULONG   VxdSerIOPacketContext;
        ULONG   WdmSerialContext;
        UCHAR   DummyBuffer[2048];
} IOPACKET, *PIOPACKET;

typedef struct _pack_2_pointers
{
   PVOID pointer1;
   PVOID pointer2;
}  PACK_TWO_POINTERS, * P_PACK_TWO_POINTERS;

// used to track information on pipes in use;
//  currently just to flag if opened or closed
typedef struct UsbCom_PIPEINFO {

    BOOLEAN fPipeOpened;

} UsbCom_PIPEINFO, *PUsbCom_PIPEINFO;


extern ULONG GlobalPdaCount;

#define OutPipeMaxSize	16

//
// A structure representing the instance information associated with
// this particular device.
//
typedef struct _DEVICE_EXTENSION {

    // Device object we call when submitting Urbs
    PDEVICE_OBJECT TopOfStackDeviceObject;

	// The bus driver object
    PDEVICE_OBJECT PhysicalDeviceObject;

    //
    // This points to the symbolic link name that will be
    // linked to the actual nt device name.
    //
    UNICODE_STRING SymbolicLinkName;

    //
    // We keep a pointer around to our device name for dumps
    // and for creating "external" symbolic links to this
    // device.
    //
    UNICODE_STRING DeviceName;

    //
    // Points to the device object that contains
    // this device extension.
    //
    PDEVICE_OBJECT DeviceObject;

	ULONG VxdSerObjContext;  

	// In data bulk pipe
	ULONG DataInPipe;

	// Out data bulk pipe
	ULONG DataOutPipe;

	// Status interrupt pipe
	ULONG InterruptPipe;

	// IRP used to poll for interrupts
	PIRP PollingIrp;

	// URB used to poll for interrupts
	PURB PollingUrb;
	
	BOOLEAN pollpending;					// polling irp is pending (interrupt pipe)

	// interrupt data
	UCHAR intdata[4];

	// IRP used to read
	PIRP ReadingIrp;

	// URB used to read
	PURB ReadingUrb;
	
	// Read data
	UCHAR ReadData[64];

	BOOLEAN readpending;					// reading irp is pending (IN BULK pipe)

	// IRP used to write
	PIRP WritingIrp;

	// URB used to write
	PURB WritingUrb;
	
	// Read data
	UCHAR WriteData[16];

	// Indicates number of bytes in array, WriteData to transfer.
	ULONG WriteSize;

	BOOLEAN writepending;					// writing irp is pending (OUT BULK pipe)

	ULONG CurrentSGD;
  
	PIO_WORKITEM WorkItem;
	
 	KDPC IoCtrlTimerDpc;

	KTIMER IoCtrlTimer;

	// use mutex to guard somethings.
	// Since there is a single I/O completion handler we need to make
	// sure that it is not pre-empted or called twice
	KMUTEX  CompleteRequestMutex;

	PIRP ReadIrp;
	PIRP WriteIrp;
	PIRP IoCtrlIrp;

    DEVICE_POWER_STATE CurrentDevicePowerState;

    // USB configuration handle and ptr for the configuration the
    // device is currently in
    USBD_CONFIGURATION_HANDLE UsbConfigurationHandle;
	PUSB_CONFIGURATION_DESCRIPTOR UsbConfigurationDescriptor;


    // ptr to the USB device descriptor
    // for this device
    PUSB_DEVICE_DESCRIPTOR UsbDeviceDescriptor;

    // we support one interface
    // this is a copy of the info structure
    // returned from select_configuration or
    // select_interface
    PUSBD_INTERFACE_INFORMATION UsbInterface;

	//Bus drivers set the appropriate values in this structure in response
	//to an IRP_MN_QUERY_CAPABILITIES IRP. Function and filter drivers might
	//alter the capabilities set by the bus driver.
    DEVICE_CAPABILITIES DeviceCapabilities;

	// used to save the currently-being-handled system-requested power irp request
    PIRP PowerIrp;

	// used to save base Irp ( user-originated via IOCTL ) of staged read/write request
	PIRP BaseIrp;

	// used to save  URB of short, non-staged read/write requests
	PURB BaseUrb;

	// count of self-staged irps pending
    ULONG StagedPendingIrpCount;

	// count of self-staged bytes read or written so far
    ULONG StagedBytesTransferred;

	// set when PendingIoCount goes to 0; flags device can be removed
    KEVENT RemoveEvent;

	// set when PendingIoCount goes to 1 ( 1st increment was on add device )
	// this indicates no IO requests outstanding, either user, system, or self-staged
    KEVENT NoPendingIoEvent;

	// set to signal driver-generated power request is finished
    KEVENT SelfRequestedPowerIrpEvent;

	// spinlock used to protect inc/dec iocount logic
	KSPIN_LOCK	IoCountSpinLock;

	// incremented when device is added and any IO request is received;
	// decremented when any io request is completed or passed on, and when device is removed
    ULONG PendingIoCount;

	// count of open pipes
	ULONG OpenPipeCount;

    // ptr to array of structs to track pipeinfo;
    //  in this basic sample it's only used to track if open/closed;
    PUsbCom_PIPEINFO PipeInfo;

	// save ptr to array of info on self-generated IRPS for staged read/writes;
	//  will allocate this separately
	PUsbCom_RW_CONTEXT PendingIoIrps;

	UNICODE_STRING	DeviceNameLink;

    // Name buffer for our named Functional device object link
	// The name is generated based on the driver's class GUID
    WCHAR DeviceLinkNameBuffer[ MAXIMUM_FILENAME_LENGTH ];  // MAXIMUM_FILENAME_LENGTH defined in wdm.h
	
	//flag set when processing IRP_MN_REMOVE_DEVICE
    BOOLEAN DeviceRemoved;

 	// flag set when driver has answered success to IRP_MN_QUERY_REMOVE_DEVICE
    BOOLEAN RemoveDeviceRequested;

	// flag set when driver has answered success to IRP_MN_QUERY_STOP_DEVICE
    BOOLEAN StopDeviceRequested;

	// flag set when device has been successfully started
	BOOLEAN DeviceStarted;

    // flag set when IRP_MN_WAIT_WAKE is received and we're in a power state
    // where we can signal a wait
    BOOLEAN EnabledForWakeup;

	// used to flag that we're currently handling a self-generated power request
    BOOLEAN SelfPowerIrp;

	// default power state to power down to on self-suspend 
	ULONG PowerDownLevel; 

	// default maximum transfer per staged irp size		
	ULONG MaximumTransferSize;  

	// Henry's modifications start here. 31/7/2000

    //
    // This list head is used to contain the time ordered list
    // of read requests.  Access to this list is protected by
    // the global cancel spinlock.
    //
    LIST_ENTRY ReadQueue;

    //
    // This list head is used to contain the time ordered list
    // of write requests.  Access to this list is protected by
    // the global cancel spinlock.
    //
    LIST_ENTRY WriteQueue;

    //
    // This list head is used to contain the time ordered list
    // of set and wait mask requests.  Access to this list is protected by
    // the global cancel spinlock.
    //
    LIST_ENTRY MaskQueue;

    //
    // Holds the serialized list of purge requests.
    //
    LIST_ENTRY PurgeQueue;

    //
    // This points to the irp that is currently being processed
    // for the read queue.  This field is initialized by the open to
    // NULL.
    //
    // This value is only set at dispatch level.  It may be
    // read at interrupt level.
    //
    PIRP CurrentReadIrp;

    //
    // This points to the irp that is currently being processed
    // for the write queue.
    //
    // This value is only set at dispatch level.  It may be
    // read at interrupt level.
    //
    PIRP CurrentWriteIrp;

    //
    // Points to the irp that is currently being processed to
    // affect the wait mask operations.
    //
    PIRP CurrentMaskIrp;

    //
    // Points to the irp that is currently being processed to
    // purge the read/write queues and buffers.
    //
    PIRP CurrentPurgeIrp;

    //
    // Points to the current irp that is waiting on a comm event.
    //
    PIRP CurrentWaitIrp;

    //
    // Points to the irp that is being used to send an immediate
    // character.
    //
    PIRP CurrentImmediateIrp;

    //
    // Points to the irp that is being used to count the number
    // of characters received after an xoff (as currently defined
    // by the IOCTL_SERIAL_XOFF_COUNTER ioctl) is sent.
    //
    PIRP CurrentXoffIrp;

    //
    // Holds the number of bytes remaining in the current write
    // irp.
    //
    // This location is only accessed while at interrupt level.
    //
    ULONG WriteLength;

    //
    // Holds a pointer to the current character to be sent in
    // the current write.
    //
    // This location is only accessed while at interrupt level.
    //
    PUCHAR WriteCurrentChar;

    //
    // This is a buffer for the read processing.
    //
    // The buffer works as a ring.  When the character is read from
    // the device it will be place at the end of the ring.
    //
    // Characters are only placed in this buffer at interrupt level
    // although character may be read at any level. The pointers
    // that manage this buffer may not be updated except at interrupt
    // level.
    //
    PUCHAR InterruptReadBuffer;

    //
    // This is a pointer to the first character of the buffer into
    // which the interrupt service routine is copying characters.
    //
    PUCHAR ReadBufferBase;

    //
    // This is a count of the number of characters in the interrupt
    // buffer.  This value is set and read at interrupt level.  Note
    // that this value is only *incremented* at interrupt level so
    // it is safe to read it at any level.  When characters are
    // copied out of the read buffer, this count is decremented by
    // a routine that synchronizes with the ISR.
    //
    ULONG CharsInInterruptBuffer;

    //
    // Points to the first available position for a newly received
    // character.  This variable is only accessed at interrupt level and
    // buffer initialization code.
    //
    PUCHAR CurrentCharSlot;

    //
    // This variable is used to contain the last available position
    // in the read buffer.  It is updated at open and at interrupt
    // level when switching between the users buffer and the interrupt
    // buffer.
    //
    PUCHAR LastCharSlot;

    //
    // This marks the first character that is available to satisfy
    // a read request.  Note that while this always points to valid
    // memory, it may not point to a character that can be sent to
    // the user.  This can occur when the buffer is empty.
    //
    PUCHAR FirstReadableChar;

    //
    // Pointer to the lock variable returned for this extension when
    // locking down the driver
    //
    PVOID LockPtr;


    //
    // This variable holds the size of whatever buffer we are currently
    // using.
    //
    ULONG BufferSize;

    //
    // This variable holds .8 of BufferSize. We don't want to recalculate
    // this real often - It's needed when so that an application can be
    // "notified" that the buffer is getting full.
    //
    ULONG BufferSizePt8;

	BOOLEAN ToSubmitReadUrb;

	// This flag is to indicate that there is currently no read urb in the USBD stack.
	// Although there should always be a read urb waiting for data from dongle, it is
	// stopped because the interrupt buffer is getting full (80%).
	BOOLEAN NoReadUrb;

    //
    // This value holds the number of characters desired for a
    // particular read.  It is initially set by read length in the
    // IRP.  It is decremented each time more characters are placed
    // into the "users" buffer buy the code that reads characters
    // out of the typeahead buffer into the users buffer.  If the
    // typeahead buffer is exhausted by the read, and the reads buffer
    // is given to the isr to fill, this value is becomes meaningless.
    //
    ULONG NumberNeededForRead;

    //
    // This mask will hold the bitmask sent down via the set mask
    // ioctl.  It is used by the interrupt service routine to determine
    // if the occurence of "events" (in the serial drivers understanding
    // of the concept of an event) should be noted.
    //
    ULONG IsrWaitMask;

    //
    // This mask will always be a subset of the IsrWaitMask.  While
    // at device level, if an event occurs that is "marked" as interesting
    // in the IsrWaitMask, the driver will turn on that bit in this
    // history mask.  The driver will then look to see if there is a
    // request waiting for an event to occur.  If there is one, it
    // will copy the value of the history mask into the wait irp, zero
    // the history mask, and complete the wait irp.  If there is no
    // waiting request, the driver will be satisfied with just recording
    // that the event occured.  If a wait request should be queued,
    // the driver will look to see if the history mask is non-zero.  If
    // it is non-zero, the driver will copy the history mask into the
    // irp, zero the history mask, and then complete the irp.
    //
    ULONG HistoryMask;

    //
    // This is a pointer to the where the history mask should be
    // placed when completing a wait.  It is only accessed at
    // device level.
    //
    // We have a pointer here to assist us to synchronize completing a wait.
    // If this is non-zero, then we have wait outstanding, and the isr still
    // knows about it.  We make this pointer null so that the isr won't
    // attempt to complete the wait.
    //
    // We still keep a pointer around to the wait irp, since the actual
    // pointer to the wait irp will be used for the "common" irp completion
    // path.
    //
    ULONG *IrpMaskLocation;

    //
    // This mask holds all of the reason that transmission
    // is not proceeding.  Normal transmission can not occur
    // if this is non-zero.
    //
    // This is only written from interrupt level.
    // This could be (but is not) read at any level.
    //
    ULONG TXHolding;

    //
    // This mask holds all of the reason that reception
    // is not proceeding.  Normal reception can not occur
    // if this is non-zero.
    //
    // This is only written from interrupt level.
    // This could be (but is not) read at any level.
    //
    ULONG RXHolding;

    //
    // This holds the reasons that the driver thinks it is in
    // an error state.
    //
    // This is only written from interrupt level.
    // This could be (but is not) read at any level.
    //
    ULONG ErrorWord;

    //
    // This keeps a total of the number of characters that
    // are in all of the "write" irps that the driver knows
    // about.  It is only accessed with the cancel spinlock
    // held.
    //
    ULONG TotalCharsQueued;

    //
    // This holds a count of the number of characters read
    // the last time the interval timer dpc fired.  It
    // is a long (rather than a ulong) since the other read
    // completion routines use negative values to indicate
    // to the interval timer that it should complete the read
    // if the interval timer DPC was lurking in some DPC queue when
    // some other way to complete occurs.
    //
    LONG CountOnLastRead;

    //
    // This is a count of the number of characters read by the
    // isr routine.  It is *ONLY* written at isr level.  We can
    // read it at dispatch level.
    //
    ULONG ReadByIsr;

    //
    // This holds the current baud rate for the device.
    //
    ULONG CurrentBaud;

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91麻豆swag| 精品一区二区精品| 日本va欧美va精品发布| 久久精品国产99国产精品| 麻豆极品一区二区三区| 国产成人综合自拍| 色综合久久综合网97色综合| 欧美日韩精品系列| 亚洲精品在线电影| 国产精品成人在线观看| 亚洲午夜免费福利视频| 另类小说图片综合网| 成人高清视频在线| 欧美日韩情趣电影| 久久九九久久九九| 怡红院av一区二区三区| 麻豆免费看一区二区三区| eeuss国产一区二区三区| 欧美高清hd18日本| 欧美激情资源网| 午夜精品福利久久久| 国产91丝袜在线18| 在线不卡免费欧美| 国产精品国产三级国产普通话三级| 亚洲综合区在线| 国产美女精品在线| 欧美午夜视频网站| 国产精品萝li| 青青草成人在线观看| av中文一区二区三区| 日韩视频在线你懂得| 亚洲精品成a人| 国产精品99久久久| 欧美一激情一区二区三区| 国产精品丝袜在线| 久久精品国产亚洲一区二区三区 | 国产日本欧美一区二区| 婷婷一区二区三区| 91蜜桃在线观看| 99热99精品| 日韩精品在线看片z| 亚洲成人一区二区| 色乱码一区二区三区88| 国产精品天干天干在线综合| 久久99精品久久久久久国产越南| 在线观看区一区二| 亚洲欧洲在线观看av| 国产一区二区免费视频| 91精品国产免费| 亚洲国产日韩av| 91日韩一区二区三区| 欧美激情在线看| 国产一区 二区| 精品国产精品网麻豆系列| 日韩电影在线一区二区| 欧美日韩精品欧美日韩精品一综合| 亚洲色图一区二区三区| 成人午夜看片网址| 国产午夜亚洲精品午夜鲁丝片| 美日韩一区二区| 黄色资源网久久资源365| 日韩一级视频免费观看在线| 日韩中文字幕av电影| 91国内精品野花午夜精品| 自拍偷拍亚洲综合| 91网站最新网址| 亚洲天堂久久久久久久| 成人av免费在线播放| 国产亚洲精品7777| 国产福利一区二区三区视频在线| 欧美成人vps| 极品少妇xxxx偷拍精品少妇| 精品国产精品网麻豆系列| 精品一区二区免费在线观看| 欧美tk丨vk视频| 精品亚洲aⅴ乱码一区二区三区| 日韩一卡二卡三卡四卡| 久久精品国产精品亚洲精品| 精品久久免费看| 国产乱码精品一区二区三区忘忧草| 精品国产制服丝袜高跟| 国产一区二区不卡| 国产精品污网站| 91免费观看视频| 亚洲国产成人av网| 69堂精品视频| 蜜臀久久99精品久久久久宅男| 91麻豆精品国产91久久久久| 麻豆精品在线观看| 久久欧美中文字幕| 成人自拍视频在线| 亚洲乱码精品一二三四区日韩在线| 91网站最新地址| 日韩综合在线视频| 欧美xxxxxxxx| 国产超碰在线一区| 最新高清无码专区| 欧美日韩日日夜夜| 老司机精品视频一区二区三区| 久久色视频免费观看| av在线不卡观看免费观看| ...av二区三区久久精品| 色素色在线综合| 日韩高清在线电影| 久久午夜羞羞影院免费观看| www.av亚洲| 天天亚洲美女在线视频| 久久久亚洲综合| 91麻豆国产福利在线观看| 午夜精品一区二区三区免费视频| 精品少妇一区二区三区在线播放| 成人影视亚洲图片在线| 一区二区成人在线| 欧美videos中文字幕| 成人免费av在线| 亚洲国产另类精品专区| 久久综合九色综合97婷婷| www.亚洲免费av| 亚洲成人动漫精品| 久久夜色精品国产欧美乱极品| 99r精品视频| 视频一区视频二区中文| 国产日产欧美一区| 欧美日韩三级视频| 国产成人免费在线观看| 一区二区成人在线观看| 26uuu国产电影一区二区| 在线亚洲精品福利网址导航| 另类成人小视频在线| 亚洲人成伊人成综合网小说| 欧美一区二区精品| 色综合久久久久综合体桃花网| 蜜桃视频一区二区三区在线观看| 国产精品久99| 欧美mv和日韩mv的网站| 在线看国产一区| 国产91高潮流白浆在线麻豆| 午夜精品福利在线| 中文字幕中文字幕中文字幕亚洲无线| 欧美福利一区二区| 91免费在线播放| 成人深夜福利app| 亚洲第一激情av| 国产精品视频第一区| 日韩精品专区在线影院观看| 欧美专区亚洲专区| 国产成人久久精品77777最新版本| 午夜精品久久久久久久久| 国产精品二三区| 精品国产一区二区三区av性色| 色狠狠综合天天综合综合| 国产成人啪免费观看软件| 日本成人超碰在线观看| 亚洲一区二区三区在线看| 国产精品免费视频观看| 337p粉嫩大胆噜噜噜噜噜91av| 色婷婷精品大在线视频 | 日本一区二区三区久久久久久久久不| 欧美狂野另类xxxxoooo| 色偷偷久久一区二区三区| 国产91高潮流白浆在线麻豆 | 日韩欧美一区电影| 欧美视频自拍偷拍| av午夜精品一区二区三区| 国内不卡的二区三区中文字幕| 天堂一区二区在线免费观看| 亚洲无人区一区| 一区二区三区四区精品在线视频| 国产欧美日韩在线看| 精品少妇一区二区三区免费观看 | 日韩美女啊v在线免费观看| 久久综合色鬼综合色| 日韩欧美一二区| 欧美精品日日鲁夜夜添| 欧美日韩精品综合在线| 在线观看免费视频综合| 色婷婷狠狠综合| 色视频一区二区| 91精品福利在线| 在线亚洲一区二区| 一本大道av一区二区在线播放| 成人午夜电影网站| 成人午夜激情在线| 成人精品高清在线| zzijzzij亚洲日本少妇熟睡| 成人午夜电影久久影院| 成人高清av在线| 99精品国产视频| 日本久久精品电影| 欧美视频你懂的| 欧美日韩综合不卡| 欧美日韩一区二区欧美激情| 欧美精品三级日韩久久| 欧美一区欧美二区| 欧美大白屁股肥臀xxxxxx| 日韩精品一区二区三区三区免费| 久久综合丝袜日本网| 国产午夜精品在线观看| 国产喂奶挤奶一区二区三区| 国产精品免费视频网站|