阅读:1688回复:4
为什么2K和XP下,收到的SCSI IO操作会有区别呢?
我的driver是把读卡器设备看作一个虚拟的SCSI port , 当插入卡后,
在XP下收到的SCSI io 是正常的,但是在2K下,插入卡的时候,会收到SCSIOP_WRITE command,我觉得不正常,插入卡的时候, 不应该收到write的操作码阿,而且把一个写保护的SD插入后,在2K下访问不了,但在XP下是正常的。 各位大虾,是不是Windows 2000和XP在处理SCSI commands有什么不一样的啊?还是我的driver有问题呢? 谢谢了。 [编辑 - 2/23/05 by Leonsoft] |
|
|
驱动老牛
![]() |
沙发#
发布于:2005-02-23 15:14
scsi 2000和xp下有时确实会不一样
|
|
板凳#
发布于:2005-02-24 13:13
scsi 2000和xp下有时确实会不一样 喂,这位兄台有什么不一样呢? |
|
|
驱动老牛
![]() |
地板#
发布于:2005-02-24 15:11
我也想知道,没找到完整的描述
|
|
地下室#
发布于:2005-02-25 15:01
是不是在SCSIFindAdapter处理port初始化的时候,Windows2k和XP要区别对待?我初始化如下:请大虾看看是不是在Win2K有问题?谢谢了。
STATIC ULONG SCIFindAdapter ( IN PVOID DeviceExtension, IN PVOID HwContext, IN PVOID BusInformation, IN PCHAR ArgumentString, IN OUT PPORT_CONFIGURATION_INFORMATION ConfigInfo, OUT PBOOLEAN Again ) { PDEVICE_EXTENSION deviceExtension = (PDEVICE_EXTENSION)DeviceExtension; ///---------------------------------------------------- //PHCS hcsp = &(deviceExtension->hcs); PACCESS_RANGE accessRange; ULONG_PTR pciAddress; char NumPort = 0; ULONG result = SP_RETURN_FOUND; ///---------------------------------------------------- DbgMsg((DRIVERNAME \" - Enter SCIFindAdapter\\n\")); ///==================================================== // Set initiator ID. //if (ConfigInfo->InitiatorBusId[0] == -1) // ConfigInfo->InitiatorBusId[0] = (SCSI_MAXIMUM_TARGETS - 1); ///---------------------------------------------------- ///New for linking with H/W accessing accessRange = &((*(ConfigInfo->AccessRanges))[0]); if ( ScsiPortValidateRange( deviceExtension, ConfigInfo->AdapterInterfaceType, // ConfigInfo->SystemIoBusNumber, // Bus number accessRange->RangeStart, // Device address accessRange->RangeLength, // Size in byte FALSE) // It\'s NOT in I/O space ) { DbgMsg((DRIVERNAME \" - RangeStart = %xh\\n\", ScsiPortConvertPhysicalAddressToUlong(accessRange->RangeStart) )); DbgMsg((DRIVERNAME \" - RangeLength = %xh\\n\", (ULONG)accessRange->RangeLength)); // // Get the system physical address for this IO range. // pciAddress = (ULONG_PTR) ScsiPortGetDeviceBase(deviceExtension, ConfigInfo->AdapterInterfaceType, ConfigInfo->SystemIoBusNumber, accessRange->RangeStart, accessRange->RangeLength, FALSE); // FALSE: Not an I/O space deviceExtension->membase = pciAddress; deviceExtension->Intr = (UCHAR)ConfigInfo->BusInterruptLevel; NumPort++; //Thread Solution for Read/Write deviceExtension->thread = GetThreadExtension(); ThreadInitial(deviceExtension); } if (NumPort == 0) { DbgMsg((DRIVERNAME \" - Can\'t find any MBX devices\\n\")); result = SP_RETURN_NOT_FOUND; goto funcFinal; } ///---------------------------------------------------- // Set to one bus for this example. ConfigInfo->NumberOfBuses = 1; // No need to impose this. ConfigInfo->AdapterScansDown = FALSE; // Lets set this to a page. ConfigInfo->MaximumTransferLength = MAX_TRANSFER_BLOCKS * 512; ConfigInfo->NumberOfPhysicalBreaks = MAX_TRANSFER_BLOCKS; ConfigInfo->ScatterGather = TRUE; // No need. ConfigInfo->ScatterGather = FALSE; // Not in this example. If you were talking to real hardware // it would be advisable to set this to TRUE. ConfigInfo->BufferAccessScsiPortControlled = FALSE; // Sure, why not :) ConfigInfo->Dma32BitAddresses = TRUE; // Set the limit to that of SCSI-II //ConfigInfo->MaximumNumberOfTargets = SCSI_MAXIMUM_TARGETS; ConfigInfo->MaximumNumberOfTargets = 1; // Set Interrupt Mode ConfigInfo->InterruptMode = LevelSensitive; // Save our initiator ID in the device extension. deviceExtension->OwnId = ConfigInfo->InitiatorBusId[0]; // OK to look for other adapters. *Again = TRUE; //Set interrupt // ConfigInfo->InterruptMode = LevelSensitive; //===================================================== ///WMI Support (for IRP_MJ_SYSTEM_CONTROL //ConfigInfo->WmiDataProvider = TRUE; //WmiInitialize(deviceExtension); //===================================================== funcFinal: // Return success. DbgMsg((DRIVERNAME \" - Exit SCIFindAdapter. Result = %s\\n\", scsiFindDevStrn(result))); return result; } |
|
|