阅读:1603回复:9
掉卡现象
比如说,放置一断时间不用,就发现不能与USB卡正常读写数据。
或者在使用的过程当中,偶尔发现USB卡不能正确的读写数据, 也就是说,卡不能用了,就像掉了一样。 |
|
沙发#
发布于:2002-04-19 11:07
而且掉卡的现象出现机率不定。
有时候几天,有时候几个小时。 重新拔插一遍,就肯定又好了。 Why? |
|
板凳#
发布于:2002-04-19 11:37
你的卡有无自动省电模式?
|
|
|
地板#
发布于:2002-04-19 11:45
没有。而且不需要主机USB线供电。自带电源。
|
|
地下室#
发布于:2002-04-19 11:50
这就不好说,你首先得找出规律才行.否者只能懵了?!
|
|
|
5楼#
发布于:2002-04-19 11:56
开饭了。
我可以好好找一找。 吃完可以再发。 |
|
6楼#
发布于:2002-04-19 12:35
我可以找到规律。
当我将设备的电源置为DOWN,使用PowerDownDevice时,设备就找不到了。 当再使用PowerUpDevice时,发现卡已经找不到了。这个命令不会成功。所以卡就不能用了。 我 NTSTATUS PowerDownDevice( IN PDEVICE_OBJECT fdo) { PUSBKBD_DEVICE_EXTENSION dx = (PUSBKBD_DEVICE_EXTENSION)fdo->DeviceExtension; DebugPrintMsg(\"Power DOWN!!!!!!!!!!!\"); DebugPrint(\"Now PowerState is %d\", dx->PowerState); // If need be, increase power if( dx->PowerState<PowerDeviceD3) { NTSTATUS status = SendDeviceSetPower( dx, PowerDeviceD3); if (!NT_SUCCESS(status)) return status; } DebugPrintMsg(\"Power DOWN OK!!!!!!!!!!!\"); // Zero our idle counter if( dx->PowerIdleCounter) PoSetDeviceBusy(dx->PowerIdleCounter); return STATUS_SUCCESS; } NTSTATUS PowerUpDevice( IN PDEVICE_OBJECT fdo) { PUSBKBD_DEVICE_EXTENSION dx = (PUSBKBD_DEVICE_EXTENSION)fdo->DeviceExtension; // If need be, increase power DebugPrintMsg(\"Power UP!!!!!!!!!!!\"); DebugPrint(\"Now PowerState is %d\", dx->PowerState); // if( dx->PowerState>PowerDeviceD0) { NTSTATUS status = SendDeviceSetPower( dx, PowerDeviceD0); if (!NT_SUCCESS(status)) return status; } DebugPrintMsg(\"Power UP OK!!!!!!!!!!!\"); // Zero our idle counter if( dx->PowerIdleCounter) PoSetDeviceBusy(dx->PowerIdleCounter); return STATUS_SUCCESS; } NTSTATUS SendDeviceSetPower( IN PUSBKBD_DEVICE_EXTENSION dx, IN DEVICE_POWER_STATE NewDevicePowerState) { DebugPrint(\"SendDeviceSetPower to %d\", NewDevicePowerState); POWER_STATE NewState; NewState.DeviceState = NewDevicePowerState; SDSP sdsp; KeInitializeEvent( &sdsp.event, NotificationEvent, FALSE); sdsp.Status = STATUS_SUCCESS; NTSTATUS status = PoRequestPowerIrp( dx->pdo, IRP_MN_SET_POWER, NewState, OnCompleteDeviceSetPower, &sdsp, NULL); if( status==STATUS_PENDING) { KeWaitForSingleObject( &sdsp.event, Executive, KernelMode, FALSE, NULL); status = sdsp.Status; } // Cope with W98 not passing power irp to us if( NT_SUCCESS(status) && dx->PowerState!=NewDevicePowerState) { DebugPrintMsg(\"SendDeviceSetPower: Device state not set properly by us. Setting again\"); SetPowerState(dx,NewDevicePowerState); } return status; } |
|
7楼#
发布于:2002-04-19 12:48
代码没问题,是不是你的硬件有问题?
|
|
|
8楼#
发布于:2002-04-19 13:17
我想确定的是:使用PowerDown后,USB设备是不是非要拔插一遍才可以接收新命令?PowerUp命令为什么设备会没有回应?
|
|
9楼#
发布于:2002-04-19 13:55
斑竹呢?
|
|