Author: fireball Date: Thu Sep 27 14:04:56 2007 New Revision: 29241
URL: http://svn.reactos.org/svn/reactos?rev=29241&view=rev Log: - Handle NextLuRequest and ResetDetected in ScsiPortNotification() API - Add UNIMPLEMENTED into ScsiPortGetBusData() when it's called with Length = 0. Does not happen so far, when tested with BusLogic.sys in our tree.
Modified: trunk/reactos/drivers/storage/scsiport/scsiport.c
Modified: trunk/reactos/drivers/storage/scsiport/scsiport.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/scsiport/sc... ============================================================================== --- trunk/reactos/drivers/storage/scsiport/scsiport.c (original) +++ trunk/reactos/drivers/storage/scsiport/scsiport.c Thu Sep 27 14:04:56 2007 @@ -384,11 +384,20 @@ IN PVOID Buffer, IN ULONG Length) { - return(HalGetBusData(BusDataType, - SystemIoBusNumber, - SlotNumber, - Buffer, - Length)); + if (Length) + { + /* If Length is non-zero, just forward the call to + HalGetBusData() function */ + return HalGetBusData(BusDataType, + SystemIoBusNumber, + SlotNumber, + Buffer, + Length); + } + + /* We have a more complex case here */ + UNIMPLEMENTED; + return 0; }
@@ -1812,40 +1821,56 @@ DeviceExtension->InterruptData.Flags |= SCSI_PORT_NEXT_REQUEST_READY; break;
- case NextLuRequest: - { - UCHAR PathId; - UCHAR TargetId; - UCHAR Lun; - - PathId = (UCHAR) va_arg (ap, int); - TargetId = (UCHAR) va_arg (ap, int); - Lun = (UCHAR) va_arg (ap, int); - - DPRINT1 ("Notify: NextLuRequest(PathId %u TargetId %u Lun %u)\n", - PathId, TargetId, Lun); - /* FIXME: Implement it! */ - ASSERT(FALSE); - -// DeviceExtension->IrpFlags |= IRP_FLAG_NEXT; -// DeviceExtension->IrpFlags |= IRP_FLAG_NEXT_LU; - - /* Hack! */ -// DeviceExtension->IrpFlags |= IRP_FLAG_NEXT; - } - break; + case NextLuRequest: + { + UCHAR PathId; + UCHAR TargetId; + UCHAR Lun; + PSCSI_PORT_LUN_EXTENSION LunExtension; + + PathId = (UCHAR) va_arg (ap, int); + TargetId = (UCHAR) va_arg (ap, int); + Lun = (UCHAR) va_arg (ap, int); + + DPRINT("Notify: NextLuRequest(PathId %u TargetId %u Lun %u)\n", + PathId, TargetId, Lun); + + /* Mark it in the flags field */ + DeviceExtension->InterruptData.Flags |= SCSI_PORT_NEXT_REQUEST_READY; + + /* Get the LUN extension */ + LunExtension = SpiGetLunExtension(DeviceExtension, + PathId, + TargetId, + Lun); + + /* This request should not be processed if */ + if ((LunExtension && LunExtension->ReadyLun) || + (LunExtension && LunExtension->SrbInfo.Srb)) + { + /* Nothing to do here */ + break; + } + + /* Add this LUN to the list */ + LunExtension->ReadyLun = DeviceExtension->InterruptData.ReadyLun; + DeviceExtension->InterruptData.ReadyLun = LunExtension; + } + break;
case ResetDetected: - DPRINT1("Notify: ResetDetected\n"); - /* FIXME: ??? */ - break; + DPRINT("Notify: ResetDetected\n"); + /* Add RESET flags */ + DeviceExtension->InterruptData.Flags |= + SCSI_PORT_RESET | SCSI_PORT_RESET_REPORTED; + break;
default: DPRINT1 ("Unsupported notification %lu\n", NotificationType); break; }
- va_end(ap); + va_end(ap);
/* Request a DPC after we're done with the interrupt */ DeviceExtension->InterruptData.Flags |= SCSI_PORT_NOTIFICATION_NEEDED;