阅读:1511回复:9
救命,DS产生的read函数问题,请帮助
救命!救命!!我的DS产生的驱动出问题了。情况是这样的,驱动能正常工作,而且应用程序可以对USB进行写操作,但进行读时出了问题,即读时死机。我看了看驱动程序的读函数Read(KIrp I) ,在其最后调用函数m_Endpoint1IN.SubmitUrb(I, pUrb, LinkTo(ReadComplete), pCompInfo, 0);这函数的最后一参数是时间参数(如果将此参数进行调整,重新安装驱动后,进行读操作第一次可以读出,尔后不能读出,但不死机),请问是不是这儿出了问题,时间参数应该是多少比较适合??请帮助解决,谢谢
|
|
最新喜欢:![]()
|
沙发#
发布于:2002-06-05 08:42
NTSTATUS WwDevice::Read(KIrp I)
{ t << \"Entering WwDevice::Read, \" << I << EOL; // TODO: Check the incoming request. Replace \"FALSE\" in the following // line with a check that returns TRUE if the request is not valid. if (FALSE) // If (Request is invalid) { // Invalid parameter in the Read request I.Information() = 0; return I.PnpComplete(this, STATUS_INVALID_PARAMETER); } // Always ok to read 0 elements. if (I.ReadSize() == 0) { I.Information() = 0; return I.PnpComplete(this, STATUS_SUCCESS); } // Declare a memory object KMemory Mem(I.Mdl()); ULONG dwTotalSize = I.ReadSize(CURRENT); ULONG dwMaxSize = m_Endpoint5IN.MaximumTransferSize(); // If the total requested read size is greater than the Maximum Transfer // Size for the Pipe, request to read only the Maximum Transfer Size since // the bus driver will fail an URB with a TransferBufferLength of greater // than the Maximum Transfer Size. if (dwTotalSize > dwMaxSize) { ASSERT(dwMaxSize); dwTotalSize = dwMaxSize; } // Allocate a new context structure for Irp completion USB_COMPLETION_INFO* pCompInfo = new (NonPagedPool) USB_COMPLETION_INFO; if (pCompInfo == NULL) { I.Information() = 0; return I.PnpComplete(this, STATUS_INSUFFICIENT_RESOURCES); } // TODO: Select the correct pipe to read from // Create an URB to do actual Bulk read from the pipe PURB pUrb = m_Endpoint5IN.BuildBulkTransfer( Mem, // Where is data coming from? dwTotalSize, // How much data to read? TRUE, // direction (TRUE = IN) NULL // Link to next URB // TRUE // Allow a short transfer ); if (pUrb == NULL) { delete pCompInfo; I.Information() = 0; return I.PnpComplete(this, STATUS_INSUFFICIENT_RESOURCES); } // Initialize context structure pCompInfo->m_pClass = this; pCompInfo->m_pUrb = pUrb; // Submit the URB to our USB device NTSTATUS status; status = m_Endpoint5IN.SubmitUrb(I, pUrb, LinkTo(ReadComplete), pCompInfo, 0); return status; } |
|
|
板凳#
发布于:2002-06-05 09:22
跟我遇到的问题完全一样。但是先运行一下windriver把USB设置打开一次,再用DS的驱动就正常了。
怎么是EndPoint5IN呀????? |
|
|
地板#
发布于:2002-06-05 11:37
takaya,你的问题解决了吗?我用的是端点5
|
|
|
地下室#
发布于:2002-06-05 11:45
请高人们帮助解决,谢谢
|
|
|
5楼#
发布于:2003-02-19 09:12
请高手速解决此问题,急!!!
|
|
|
6楼#
发布于:2003-02-19 09:19
UP!
|
|
7楼#
发布于:2003-02-19 09:57
jfory 老兄:
你是指运行windriver吗? 难道正式产品发布时也让用户运行它? |
|
|
8楼#
发布于:2003-02-19 14:19
各位高手没人遇见这个问题么?
是DS问题还是端点配置问题呢??? |
|
|
9楼#
发布于:2003-02-19 14:21
调试跟踪FIRMWARE没收到READ的中断,这说明了什吗问题呢?晕!
|
|
|