mirror of
https://github.com/reactos/reactos.git
synced 2025-06-27 08:19:44 +00:00
[SCSIPORT]: Fixes:
- In SpiScanAdapter(), after an SCSI INQUIRY command has succeeded and we are setting up a LUN extension structure, cache in its InquiryData member the inquiry data retrieved from the INQUIRY command (alternatively we might just cache a pointer to a valid "LunInfo" since the latter are also cached elsewhere). - This allows SpiBuildDeviceMap(), which is called just after SpiScanAdapter(), to correctly report in the registry SCSI tree the correct Identifier and DeviceType values for the enumerated logical units. - Use ExFreePoolWithTag in SpiScanAdapter(). svn path=/trunk/; revision=74597
This commit is contained in:
parent
2e3ea31302
commit
48d95feba1
1 changed files with 11 additions and 3 deletions
|
@ -101,7 +101,7 @@ SpiSendInquiry(IN PDEVICE_OBJECT DeviceObject,
|
||||||
IN OUT PSCSI_LUN_INFO LunInfo);
|
IN OUT PSCSI_LUN_INFO LunInfo);
|
||||||
|
|
||||||
static VOID
|
static VOID
|
||||||
SpiScanAdapter (IN PSCSI_PORT_DEVICE_EXTENSION DeviceExtension);
|
SpiScanAdapter(IN PSCSI_PORT_DEVICE_EXTENSION DeviceExtension);
|
||||||
|
|
||||||
static NTSTATUS
|
static NTSTATUS
|
||||||
SpiGetInquiryData (IN PSCSI_PORT_DEVICE_EXTENSION DeviceExtension,
|
SpiGetInquiryData (IN PSCSI_PORT_DEVICE_EXTENSION DeviceExtension,
|
||||||
|
@ -3911,6 +3911,14 @@ SpiScanAdapter(IN PSCSI_PORT_DEVICE_EXTENSION DeviceExtension)
|
||||||
DPRINT("SpiScanAdapter(): Found device of type %d at bus %d tid %d lun %d\n",
|
DPRINT("SpiScanAdapter(): Found device of type %d at bus %d tid %d lun %d\n",
|
||||||
InquiryData->DeviceType, Bus, Target, Lun);
|
InquiryData->DeviceType, Bus, Target, Lun);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Cache the inquiry data into the LUN extension (or alternatively
|
||||||
|
* we could save a pointer to LunInfo within the LunExtension?)
|
||||||
|
*/
|
||||||
|
RtlCopyMemory(&LunExtension->InquiryData,
|
||||||
|
InquiryData,
|
||||||
|
INQUIRYDATABUFFERSIZE);
|
||||||
|
|
||||||
/* Add this info to the linked list */
|
/* Add this info to the linked list */
|
||||||
LunInfo->Next = NULL;
|
LunInfo->Next = NULL;
|
||||||
if (LastLunInfo)
|
if (LastLunInfo)
|
||||||
|
@ -3956,10 +3964,10 @@ SpiScanAdapter(IN PSCSI_PORT_DEVICE_EXTENSION DeviceExtension)
|
||||||
|
|
||||||
/* Free allocated buffers */
|
/* Free allocated buffers */
|
||||||
if (LunExtension)
|
if (LunExtension)
|
||||||
ExFreePool(LunExtension);
|
ExFreePoolWithTag(LunExtension, TAG_SCSIPORT);
|
||||||
|
|
||||||
if (LunInfo)
|
if (LunInfo)
|
||||||
ExFreePool(LunInfo);
|
ExFreePoolWithTag(LunInfo, TAG_SCSIPORT);
|
||||||
|
|
||||||
/* Sum what we found */
|
/* Sum what we found */
|
||||||
BusScanInfo->LogicalUnitsCount += (UCHAR)DevicesFound;
|
BusScanInfo->LogicalUnitsCount += (UCHAR)DevicesFound;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue