It’s me again. I’m upto Examining the Disk during txtmode installation. I
think this question one is a easy question so here goes.
In the struct,
typedef struct _SCSI_ADDRESS {
ULONG Length;
UCHAR PortNumber;
UCHAR PathId;
UCHAR TargetId;
UCHAR Lun;
}SCSI_ADDRESS, *PSCSI_ADDRESS;
I know what the LUN, TargetId, and PortNumber should be set to. I do not
know what the PathId is used for and what to set it too.
My environment.
IDE/Atapi = ScsiPort0
My Virtual ScsiPort = ScsiPort1
For my Virtual ScsiPort driver I set the disk that I find accordingly.
PortNumber = 1;
PathId = ???;
TargetId = 2;
Lun = 0;
What should I set the PathId too?
Thanks In Advance,
Joe
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
Each ‘adapter’ can support multiple independent scsi bus segments. The
PathId is an index that is used to identify each segment on the adapter. In
your case I think you want to indicate that you support a single path, and
therefore PathId will always be zero.
-----Original Message-----
From: Joe Moriarty [mailto:xxxxx@east.sun.com]
Sent: Wednesday, October 03, 2001 10:53 AM
To: NT Developers Interest List
Subject: [ntdev] SCSIPORT question
It’s me again. I’m upto Examining the Disk during txtmode installation. I
think this question one is a easy question so here goes.
In the struct,
typedef struct _SCSI_ADDRESS {
ULONG Length;
UCHAR PortNumber;
UCHAR PathId;
UCHAR TargetId;
UCHAR Lun;
}SCSI_ADDRESS, *PSCSI_ADDRESS;
I know what the LUN, TargetId, and PortNumber should be set to. I do not
know what the PathId is used for and what to set it too.
My environment.
IDE/Atapi = ScsiPort0
My Virtual ScsiPort = ScsiPort1
For my Virtual ScsiPort driver I set the disk that I find accordingly.
PortNumber = 1;
PathId = ???;
TargetId = 2;
Lun = 0;
What should I set the PathId too?
Thanks In Advance,
Joe
You are currently subscribed to ntdev as: xxxxx@stratus.com To
unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
PathID is the bus number
Jamey
xxxxx@storagecraft.com
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Joe Moriarty
Sent: Wednesday, October 03, 2001 7:53 AM
To: NT Developers Interest List
Subject: [ntdev] SCSIPORT question
It’s me again. I’m upto Examining the Disk during txtmode installation.
I think this question one is a easy question so here goes.
In the struct,
typedef struct _SCSI_ADDRESS {
ULONG Length;
UCHAR PortNumber;
UCHAR PathId;
UCHAR TargetId;
UCHAR Lun;
}SCSI_ADDRESS, *PSCSI_ADDRESS;
I know what the LUN, TargetId, and PortNumber should be set to. I do
not know what the PathId is used for and what to set it too.
My environment.
IDE/Atapi = ScsiPort0
My Virtual ScsiPort = ScsiPort1
For my Virtual ScsiPort driver I set the disk that I find accordingly.
PortNumber = 1;
PathId = ???;
TargetId = 2;
Lun = 0;
What should I set the PathId too?
Thanks In Advance,
Joe
You are currently subscribed to ntdev as: xxxxx@storagecraft.com To
unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
Next question.
I see in the ClassSendSrbSynchronous routine in the disk driver that it
creates a MDL address and then Probes and Locks down the pages for access by
the port driver to use. The port driver gets that address from
pSrb->DataBuffer.
but…
For Read/Write request I do not see this Probe/Lock happening. I believe
the FS driver above the disk driver is Probe/Lock the MDL for the lower
level drivers to use. Now here’s my problem. When the disk driver is doing
split READ/WRITE requests. He modifies the pSrb->DataBuffer field to point
to the beginning offset for the SCSIPORT driver to use. That
pSrb->DataBuffer address is most of the time located in USER space (address
< 0x40000000). What I have been doing for non split request is to use
the following piece of code to get my DataBuffer to use.
pEmDiskCntrlExt->pucCurrentBuffer =
MmGetSystemAddressForMdlSafe(pIrp->MdlAddress, HighPagePriority);
That works fine for non-split request. But not for split requests. The
above line of code is not modified to the offset address for each split
request. It only stays at the beginning of the buffer. The disk driver
does modify the pSrb->DataBuffer to point to the beginning address offset
for each split request. Can I just use this address? Or do I have to do
something else here?
Thanks,
Joe
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
The answer is:
pVirtualBaseAddr = MmGetMdlVirtualAddress(pIrp->MdlAddress);
pEmDiskCntrlExt->pucCurrentBuffer =
(PUCHAR)((ULONGLONG)MmGetSystemAddressForMdlSafe(pIrp->MdlAddress,
HighPagePriority) +
((ULONGLONG)pSrb->DataBuffer - (ULONGLONG)pVirtualBaseAddr));
The base address of the calling client is stored in the MDL. Subtract the
base address from the offset calculated in the disk driver for split I/O
request. Take the difference and add it to your system virtual address
given from the call to MmGetSystemAddressForMdlSafe(). The offset in your
system virtual address is now pointing to the same offset location in user
space.
WinXp is installed. Excellent. Thanks for everyone who gave me hints and
pointers on how to write a SCSIPORT driver. Still have to fix up the rough
edges.
Joe
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Joe Moriarty
Sent: Thursday, October 04, 2001 9:52 AM
To: NT Developers Interest List
Subject: [ntdev] SCSIPORT question
Next question.
I see in the ClassSendSrbSynchronous routine in the disk driver that it
creates a MDL address and then Probes and Locks down the pages
for access by
the port driver to use. The port driver gets that address from
pSrb->DataBuffer.
but…
For Read/Write request I do not see this Probe/Lock happening. I believe
the FS driver above the disk driver is Probe/Lock the MDL for the lower
level drivers to use. Now here’s my problem. When the disk
driver is doing
split READ/WRITE requests. He modifies the pSrb->DataBuffer
field to point
to the beginning offset for the SCSIPORT driver to use. That
pSrb->DataBuffer address is most of the time located in USER
space (address
< 0x40000000). What I have been doing for non split request is to use
the following piece of code to get my DataBuffer to use.
pEmDiskCntrlExt->pucCurrentBuffer =
MmGetSystemAddressForMdlSafe(pIrp->MdlAddress, HighPagePriority);
That works fine for non-split request. But not for split requests. The
above line of code is not modified to the offset address for each split
request. It only stays at the beginning of the buffer. The disk driver
does modify the pSrb->DataBuffer to point to the beginning address offset
for each split request. Can I just use this address? Or do I have to do
something else here?
Thanks,
Joe
You are currently subscribed to ntdev as: xxxxx@east.sun.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com