Leonsoft
驱动小牛
驱动小牛
  • 注册日期2003-05-08
  • 最后登录2012-08-11
  • 粉丝1
  • 关注0
  • 积分21分
  • 威望281点
  • 贡献值1点
  • 好评度103点
  • 原创分0分
  • 专家分0分
阅读:1689回复:4

为什么2K和XP下,收到的SCSI IO操作会有区别呢?

楼主#
更多 发布于:2005-02-23 13:07
我的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]
I will do the best with what the God gave me.
zhangshengyu
驱动老牛
驱动老牛
  • 注册日期2003-10-03
  • 最后登录2016-07-26
  • 粉丝0
  • 关注0
  • 积分792分
  • 威望696点
  • 贡献值41点
  • 好评度499点
  • 原创分0分
  • 专家分0分
  • 社区居民
沙发#
发布于:2005-02-23 15:14
scsi 2000和xp下有时确实会不一样
---内核开发合作或提供基础技术服务QQ:22863668 ---
Leonsoft
驱动小牛
驱动小牛
  • 注册日期2003-05-08
  • 最后登录2012-08-11
  • 粉丝1
  • 关注0
  • 积分21分
  • 威望281点
  • 贡献值1点
  • 好评度103点
  • 原创分0分
  • 专家分0分
板凳#
发布于:2005-02-24 13:13
scsi 2000和xp下有时确实会不一样


 喂,这位兄台有什么不一样呢?
I will do the best with what the God gave me.
zhangshengyu
驱动老牛
驱动老牛
  • 注册日期2003-10-03
  • 最后登录2016-07-26
  • 粉丝0
  • 关注0
  • 积分792分
  • 威望696点
  • 贡献值41点
  • 好评度499点
  • 原创分0分
  • 专家分0分
  • 社区居民
地板#
发布于:2005-02-24 15:11
我也想知道,没找到完整的描述
---内核开发合作或提供基础技术服务QQ:22863668 ---
Leonsoft
驱动小牛
驱动小牛
  • 注册日期2003-05-08
  • 最后登录2012-08-11
  • 粉丝1
  • 关注0
  • 积分21分
  • 威望281点
  • 贡献值1点
  • 好评度103点
  • 原创分0分
  • 专家分0分
地下室#
发布于: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;
}
I will do the best with what the God gave me.
游客

返回顶部