scsi miniport

NT gurus,

I have been given the task of writting SCSI miniport for ATA/IDE controller.
Is there sample source code available to start with.

Thanks,
Shakeel.

The DDK has several sample miniports, although they are for SCSI
adapters. You have to yank out the irrelevant parts first.

-----Original Message-----
From: shakeel [mailto:xxxxx@yahoo.com]
Sent: Wednesday, January 14, 2004 2:27 PM
Subject: scsi miniport

NT gurus,

I have been given the task of writting SCSI miniport for ATA/IDE
controller.
Is there sample source code available to start with.

Thanks,
Shakeel.

With a little luck and perseverance you might find the NT4 DDK. I t contains
about the only example of writing a SCSI mini-port for an ATA HBA. However,
as stated in another forum, it does not do DMA, so you will have to add it.


Gary G. Little
Seagate Technologies, LLC

“Jeffrey Goldner” wrote in message
news:xxxxx@ntdev…
The DDK has several sample miniports, although they are for SCSI
adapters. You have to yank out the irrelevant parts first.

-----Original Message-----
From: shakeel [mailto:xxxxx@yahoo.com]
Sent: Wednesday, January 14, 2004 2:27 PM
Subject: scsi miniport

NT gurus,

I have been given the task of writting SCSI miniport for ATA/IDE
controller.
Is there sample source code available to start with.

Thanks,
Shakeel.

“Gary G. Little” wrote in message
news:xxxxx@ntdev…
> With a little luck and perseverance you might find the NT4 DDK. I t
contains
> about the only example of writing a SCSI mini-port for an ATA HBA.
However,
> as stated in another forum, it does not do DMA, so you will have to add
it.
>
> –
> Gary G. Little
> Seagate Technologies, LLC
>

Do I understand correctly that :
On WinNT 4.0 I can not use the DMA for SCSI disks unless I write my own
driver to the disk ?
If this is true, is it solved on 2000/XP ?

Thanks
Maurice

> On WinNT 4.0 I can not use the DMA for SCSI disks unless I write my own

driver to the disk ?

Not to the disk, but to the SCSI controller, and yes, they need drivers in all
OSes I know.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

Mr Little’s point was (I think) that you can use the atapi sample driver in
NT4 as a basis for development, but you will have to add DMA support as it
is not present in the NT4 sample code. What you do get is a good idea about
how to translate from SCSI requests to atapi requests.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Maxim
S. Shatskih
Sent: Sunday, January 18, 2004 8:41 AM
To: Windows System Software Devs Interest List
Subject: Re: Re:[ntdev] scsi miniport

> On WinNT 4.0 I can not use the DMA for SCSI disks unless I write my
> own driver to the disk ?

Not to the disk, but to the SCSI controller, and yes, they
need drivers in all OSes I know.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as:
xxxxx@hollistech.com To unsubscribe send a blank email to
xxxxx@lists.osr.com

Also SPTI does not use DMA, I think. Especially if it is really a ATA
device.

“Mark Roddy” wrote in message news:xxxxx@ntdev…
> Mr Little’s point was (I think) that you can use the atapi sample
driver in
> NT4 as a basis for development, but you will have to add DMA support
as it
> is not present in the NT4 sample code. What you do get is a good idea
about
> how to translate from SCSI requests to atapi requests.
>
> > -----Original Message-----
> > From: xxxxx@lists.osr.com
> > [mailto:xxxxx@lists.osr.com] On Behalf Of Maxim
> > S. Shatskih
> > Sent: Sunday, January 18, 2004 8:41 AM
> > To: Windows System Software Devs Interest List
> > Subject: Re: Re:[ntdev] scsi miniport
> >
> > > On WinNT 4.0 I can not use the DMA for SCSI disks unless I write
my
> > > own driver to the disk ?
> >
> > Not to the disk, but to the SCSI controller, and yes, they
> > need drivers in all OSes I know.
> >
> > Maxim Shatskih, Windows DDK MVP
> > StorageCraft Corporation
> > xxxxx@storagecraft.com
> > http://www.storagecraft.com
> >
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as:
> > xxxxx@hollistech.com To unsubscribe send a blank email to
> > xxxxx@lists.osr.com
> >
>
>

Thanks Gary and Jeffrey,

As I understand from the discussion, there are two approaches to develop
SCSI miniport for the ATA/IDE controllers,

  1. Use ATPI sample from the NT4 DDK convert that into W2K/WXP driver and add
    support for DMA, PNP, Power management.

  2. Use SCSI Miniport sample from the W2K/WXP DDK and yank out the
    irrelevant parts first and convert that into miniport for ATA/IDE
    controller.

Would you please recomend which one of these is easier to implement?

Thanks in for your help,
Shakeel

“Gary G. Little” wrote in message
news:xxxxx@ntdev…
> With a little luck and perseverance you might find the NT4 DDK. I t
contains
> about the only example of writing a SCSI mini-port for an ATA HBA.
However,
> as stated in another forum, it does not do DMA, so you will have to add
it.
>
> –
> Gary G. Little
> Seagate Technologies, LLC
>
> “Jeffrey Goldner” wrote in message
> news:xxxxx@ntdev…
> The DDK has several sample miniports, although they are for SCSI
> adapters. You have to yank out the irrelevant parts first.
>
> -----Original Message-----
> From: shakeel [mailto:xxxxx@yahoo.com]
> Sent: Wednesday, January 14, 2004 2:27 PM
> Subject: scsi miniport
>
> NT gurus,
>
> I have been given the task of writting SCSI miniport for ATA/IDE
> controller.
> Is there sample source code available to start with.
>
> Thanks,
> Shakeel.
>
>
>
>
>

I would take the second path, but more than “yank out” you are going to be
converting SRB’s received by the mini-port to
TFR’s used by the ATA HBA.


Gary G. Little
Seagate Technologies, LLC

“shakeel” wrote in message news:xxxxx@ntdev…
> Thanks Gary and Jeffrey,
>
> As I understand from the discussion, there are two approaches to develop
> SCSI miniport for the ATA/IDE controllers,
>
> 1. Use ATPI sample from the NT4 DDK convert that into W2K/WXP driver and
add
> support for DMA, PNP, Power management.
>
> 2. Use SCSI Miniport sample from the W2K/WXP DDK and yank out the
> irrelevant parts first and convert that into miniport for ATA/IDE
> controller.
>
> Would you please recomend which one of these is easier to implement?
>
> Thanks in for your help,
> Shakeel
>
> “Gary G. Little” wrote in message
> news:xxxxx@ntdev…
> > With a little luck and perseverance you might find the NT4 DDK. I t
> contains
> > about the only example of writing a SCSI mini-port for an ATA HBA.
> However,
> > as stated in another forum, it does not do DMA, so you will have to add
> it.
> >
> > –
> > Gary G. Little
> > Seagate Technologies, LLC
> >
> > “Jeffrey Goldner” wrote in message
> > news:xxxxx@ntdev…
> > The DDK has several sample miniports, although they are for SCSI
> > adapters. You have to yank out the irrelevant parts first.
> >
> > -----Original Message-----
> > From: shakeel [mailto:xxxxx@yahoo.com]
> > Sent: Wednesday, January 14, 2004 2:27 PM
> > Subject: scsi miniport
> >
> > NT gurus,
> >
> > I have been given the task of writting SCSI miniport for ATA/IDE
> > controller.
> > Is there sample source code available to start with.
> >
> > Thanks,
> > Shakeel.
> >
> >
> >
> >
> >
>
>
>

“Maurice Zmau” wrote in message news:xxxxx@ntdev…
>
> Do I understand correctly that :
> On WinNT 4.0 I can not use the DMA for SCSI disks unless I write my own
> driver to the disk ?

No.

Hi,

I developed SCSI Miniport for ATA HBA using the NT4 atapi sample code.

Added support for plug and play, I am able to install and load the drive
successfully.

I have connected four drives ( 2 per channel), but I can see only three
drives. for some reason the drive 0 on Primary is not showing up.

by stepping through, I found out that the SCSIPort driver is calling the
HwScsiStartIo() routine with SRB->TargetId starting 1 ( 1, then, 2, then 3).

It is not calling with TargetId Zero. and Hence that drive is not getting
reported.

What is that I am missing in the initialization that causing the SCSIPORT
drive to skip the TargetId Zero (Drive 0 of Primary channel).

Thanks in advance for your help.
Shakeel

“Gary G. Little” wrote in message
news:xxxxx@ntdev…
> With a little luck and perseverance you might find the NT4 DDK. I t
contains
> about the only example of writing a SCSI mini-port for an ATA HBA.
However,
> as stated in another forum, it does not do DMA, so you will have to add
it.
>
> –
> Gary G. Little
> Seagate Technologies, LLC
>
> “Jeffrey Goldner” wrote in message
> news:xxxxx@ntdev…
> The DDK has several sample miniports, although they are for SCSI
> adapters. You have to yank out the irrelevant parts first.
>
> -----Original Message-----
> From: shakeel [mailto:xxxxx@yahoo.com]
> Sent: Wednesday, January 14, 2004 2:27 PM
> Subject: scsi miniport
>
> NT gurus,
>
> I have been given the task of writting SCSI miniport for ATA/IDE
> controller.
> Is there sample source code available to start with.
>
> Thanks,
> Shakeel.
>
>
>
>
>

I foundout what the problem was in HwScsiFindAdapter(). I was initializing
the InitiatorBusId[0] =0, Now I use the value assigned by scsiport driver.
Thanks.

The next thing working on is to add DMA transfer support(Currently the
driver does PIO only). In HwScsiFindAdapter() routine initializing the
PORT_CONFIGURATION_INFORMATION with the following

// Indicate maximum transfer length is 64k.
//
ConfigInfo->MaximumTransferLength = 0x10000; //MAX_TRANSFER_SIZE

ConfigInfo->ScatterGather = TRUE;
ConfigInfo->Master = TRUE;
ConfigInfo->NeedPhysicalAddresses = TRUE;
ConfigInfo->Dma32BitAddresses = TRUE;

ConfigInfo->TaggedQueuing = FALSE;

ConfigInfo->AlignmentMask = 0x1;

Our HBA is Bus Master PCIIDE. Who creates the PRD Table? Is scsiport does
this? Please help, what do I need to do to add DMA transfer support to the
driver.

Thanks in advance,
Shakeel.

“shakeel” wrote in message news:xxxxx@ntdev…
> Hi,
>
> I developed SCSI Miniport for ATA HBA using the NT4 atapi sample code.
>
> Added support for plug and play, I am able to install and load the drive
> successfully.
>
> I have connected four drives ( 2 per channel), but I can see only three
> drives. for some reason the drive 0 on Primary is not showing up.
>
> by stepping through, I found out that the SCSIPort driver is calling the
> HwScsiStartIo() routine with SRB->TargetId starting 1 ( 1, then, 2, then
3).
>
> It is not calling with TargetId Zero. and Hence that drive is not getting
> reported.
>
> What is that I am missing in the initialization that causing the SCSIPORT
> drive to skip the TargetId Zero (Drive 0 of Primary channel).
>
> Thanks in advance for your help.
> Shakeel
>
>
> “Gary G. Little” wrote in message
> news:xxxxx@ntdev…
> > With a little luck and perseverance you might find the NT4 DDK. I t
> contains
> > about the only example of writing a SCSI mini-port for an ATA HBA.
> However,
> > as stated in another forum, it does not do DMA, so you will have to add
> it.
> >
> > –
> > Gary G. Little
> > Seagate Technologies, LLC
> >
> > “Jeffrey Goldner” wrote in message
> > news:xxxxx@ntdev…
> > The DDK has several sample miniports, although they are for SCSI
> > adapters. You have to yank out the irrelevant parts first.
> >
> > -----Original Message-----
> > From: shakeel [mailto:xxxxx@yahoo.com]
> > Sent: Wednesday, January 14, 2004 2:27 PM
> > Subject: scsi miniport
> >
> > NT gurus,
> >
> > I have been given the task of writting SCSI miniport for ATA/IDE
> > controller.
> > Is there sample source code available to start with.
> >
> > Thanks,
> > Shakeel.
> >
> >
> >
> >
> >
>
>
>

as a scsi miniport you need to do anything related setting up DMA
yourself. Nobody does this for you.

Why are you developing your own SCSI miniport for the controller? Do
you need to run on NT4? If not you should consider using the system
supplied atapi driver (which in 2k and beyond is not a miniport) and
providing a channel driver to do any custom DMA setup that your
controller requires.

-p

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of shakeel
Sent: Wednesday, February 11, 2004 1:54 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] scsi miniport

I foundout what the problem was in HwScsiFindAdapter(). I was
initializing the InitiatorBusId[0] =0, Now I use the value assigned by
scsiport driver.
Thanks.

The next thing working on is to add DMA transfer support(Currently the
driver does PIO only). In HwScsiFindAdapter() routine initializing the
PORT_CONFIGURATION_INFORMATION with the following

// Indicate maximum transfer length is 64k.
//
ConfigInfo->MaximumTransferLength = 0x10000; //MAX_TRANSFER_SIZE

ConfigInfo->ScatterGather = TRUE;
ConfigInfo->Master = TRUE;
ConfigInfo->NeedPhysicalAddresses = TRUE;
ConfigInfo->Dma32BitAddresses = TRUE;

ConfigInfo->TaggedQueuing = FALSE;

ConfigInfo->AlignmentMask = 0x1;

Our HBA is Bus Master PCIIDE. Who creates the PRD Table? Is scsiport
does this? Please help, what do I need to do to add DMA transfer support
to the driver.

Thanks in advance,
Shakeel.

“shakeel” wrote in message news:xxxxx@ntdev…
> Hi,
>
> I developed SCSI Miniport for ATA HBA using the NT4 atapi sample code.
>
> Added support for plug and play, I am able to install and load the
> drive successfully.
>
> I have connected four drives ( 2 per channel), but I can see only
> three drives. for some reason the drive 0 on Primary is not showing
up.
>
> by stepping through, I found out that the SCSIPort driver is calling
> the
> HwScsiStartIo() routine with SRB->TargetId starting 1 ( 1, then, 2,
> then
3).
>
> It is not calling with TargetId Zero. and Hence that drive is not
> getting reported.
>
> What is that I am missing in the initialization that causing the
> SCSIPORT drive to skip the TargetId Zero (Drive 0 of Primary channel).
>
> Thanks in advance for your help.
> Shakeel
>
>
> “Gary G. Little” wrote in message
> news:xxxxx@ntdev…
> > With a little luck and perseverance you might find the NT4 DDK. I t
> contains
> > about the only example of writing a SCSI mini-port for an ATA HBA.
> However,
> > as stated in another forum, it does not do DMA, so you will have to
> > add
> it.
> >
> > –
> > Gary G. Little
> > Seagate Technologies, LLC
> >
> > “Jeffrey Goldner” wrote in message
> > news:xxxxx@ntdev…
> > The DDK has several sample miniports, although they are for SCSI
> > adapters. You have to yank out the irrelevant parts first.
> >
> > -----Original Message-----
> > From: shakeel [mailto:xxxxx@yahoo.com]
> > Sent: Wednesday, January 14, 2004 2:27 PM
> > Subject: scsi miniport
> >
> > NT gurus,
> >
> > I have been given the task of writting SCSI miniport for ATA/IDE
> > controller.
> > Is there sample source code available to start with.
> >
> > Thanks,
> > Shakeel.
> >
> >
> >
> >
> >
>
>
>


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Peter,

We are ATA/IDE RAID chip vender. Because of the Performance and flexibility
issues with ATAPI, have to adopt SCSI port/miniport driver model.
I took the atapi sample from NT4 DDK and added Plug and Play support to make
it work for Win2k/XP.

Now I am working on to add BusMaster DMA support. Isn’t that most of it done
by the SCSIPORT driver?

So, I have initialized PORT_CONFIGURATION_INFORMATION in
HwScsiFindAdapter() with the following

// Indicate maximum transfer length is 64k.
//
ConfigInfo->MaximumTransferLength = 0x10000; //MAX_TRANSFER_SIZE

ConfigInfo->ScatterGather = TRUE;
ConfigInfo->Master = TRUE;
ConfigInfo->NeedPhysicalAddresses = TRUE;
ConfigInfo->Dma32BitAddresses = TRUE;

ConfigInfo->TaggedQueuing = FALSE;

ConfigInfo->AlignmentMask = 0x1;

My question was what else is needed to be done at the scsi miniport to do
Bus Master DMA? I am new to this, I am stuck here. please help OR guide me
to source of information that I can read.

Thanks,

“Peter Wieland” wrote in message
news:xxxxx@ntdev…
as a scsi miniport you need to do anything related setting up DMA
yourself. Nobody does this for you.

Why are you developing your own SCSI miniport for the controller? Do
you need to run on NT4? If not you should consider using the system
supplied atapi driver (which in 2k and beyond is not a miniport) and
providing a channel driver to do any custom DMA setup that your
controller requires.

-p

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of shakeel
Sent: Wednesday, February 11, 2004 1:54 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] scsi miniport

I foundout what the problem was in HwScsiFindAdapter(). I was
initializing the InitiatorBusId[0] =0, Now I use the value assigned by
scsiport driver.
Thanks.

The next thing working on is to add DMA transfer support(Currently the
driver does PIO only). In HwScsiFindAdapter() routine initializing the
PORT_CONFIGURATION_INFORMATION with the following

// Indicate maximum transfer length is 64k.
//
ConfigInfo->MaximumTransferLength = 0x10000; //MAX_TRANSFER_SIZE

ConfigInfo->ScatterGather = TRUE;
ConfigInfo->Master = TRUE;
ConfigInfo->NeedPhysicalAddresses = TRUE;
ConfigInfo->Dma32BitAddresses = TRUE;

ConfigInfo->TaggedQueuing = FALSE;

ConfigInfo->AlignmentMask = 0x1;

Our HBA is Bus Master PCIIDE. Who creates the PRD Table? Is scsiport
does this? Please help, what do I need to do to add DMA transfer support
to the driver.

Thanks in advance,
Shakeel.

“shakeel” wrote in message news:xxxxx@ntdev…
> Hi,
>
> I developed SCSI Miniport for ATA HBA using the NT4 atapi sample code.
>
> Added support for plug and play, I am able to install and load the
> drive successfully.
>
> I have connected four drives ( 2 per channel), but I can see only
> three drives. for some reason the drive 0 on Primary is not showing
up.
>
> by stepping through, I found out that the SCSIPort driver is calling
> the
> HwScsiStartIo() routine with SRB->TargetId starting 1 ( 1, then, 2,
> then
3).
>
> It is not calling with TargetId Zero. and Hence that drive is not
> getting reported.
>
> What is that I am missing in the initialization that causing the
> SCSIPORT drive to skip the TargetId Zero (Drive 0 of Primary channel).
>
> Thanks in advance for your help.
> Shakeel
>
>
> “Gary G. Little” wrote in message
> news:xxxxx@ntdev…
> > With a little luck and perseverance you might find the NT4 DDK. I t
> contains
> > about the only example of writing a SCSI mini-port for an ATA HBA.
> However,
> > as stated in another forum, it does not do DMA, so you will have to
> > add
> it.
> >
> > –
> > Gary G. Little
> > Seagate Technologies, LLC
> >
> > “Jeffrey Goldner” wrote in message
> > news:xxxxx@ntdev…
> > The DDK has several sample miniports, although they are for SCSI
> > adapters. You have to yank out the irrelevant parts first.
> >
> > -----Original Message-----
> > From: shakeel [mailto:xxxxx@yahoo.com]
> > Sent: Wednesday, January 14, 2004 2:27 PM
> > Subject: scsi miniport
> >
> > NT gurus,
> >
> > I have been given the task of writting SCSI miniport for ATA/IDE
> > controller.
> > Is there sample source code available to start with.
> >
> > Thanks,
> > Shakeel.
> >
> >
> >
> >
> >
>
>
>


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Hello:

Try the following loop to build your PRD table.
All you have to is use ScsiPortGetPhysicalAddress to obtain the data buffer
logical address (or physical address in X86), then convert it into a 32bits
value (That is what ScsiPortConvertPhysicalAddresstoUlong does) to program
into your PRD entry. After you set up your PRD table, just start the DMA
transfer using your controller specific command.
The SGList in the following example represent the PRD table entry.

i = 0;
if (srb->DataTransferLength > 0) {
scbp->BufLen = srb->DataTransferLength;
virtualAddress = srb->DataBuffer;
xferLength = srb->DataTransferLength;
remainLength = xferLength;
/* Build scatter gather list */
do {
scbp->SGList[i].Ptr =
(ulong)ScsiPortConvertPhysicalAddressToUlong(
ScsiPortGetPhysicalAddress(HwDeviceExtension,
srb,
virtualAddress,
&length));
if ( length > remainLength )
length = remainLength;
scbp->SGList[i].Len = length;
virtualAddress = (PUCHAR) virtualAddress + length;
if (length >= remainLength)
remainLength = 0;
else
remainLength -= length;
i++;
} while ( remainLength > 0);

B.R

Nike
----- Original Message -----
From: “shakeel”
Newsgroups: ntdev
To: “Windows System Software Devs Interest List”
Sent: Thursday, February 12, 2004 9:55 AM
Subject: Re:[ntdev] scsi miniport

> Peter,
>
> We are ATA/IDE RAID chip vender. Because of the Performance and
flexibility
> issues with ATAPI, have to adopt SCSI port/miniport driver model.
> I took the atapi sample from NT4 DDK and added Plug and Play support to
make
> it work for Win2k/XP.
>
> Now I am working on to add BusMaster DMA support. Isn’t that most of it
done
> by the SCSIPORT driver?
>
> So, I have initialized PORT_CONFIGURATION_INFORMATION in
> HwScsiFindAdapter() with the following
>
>
> // Indicate maximum transfer length is 64k.
> //
> ConfigInfo->MaximumTransferLength = 0x10000; //MAX_TRANSFER_SIZE
>
> ConfigInfo->ScatterGather = TRUE;
> ConfigInfo->Master = TRUE;
> ConfigInfo->NeedPhysicalAddresses = TRUE;
> ConfigInfo->Dma32BitAddresses = TRUE;
>
> ConfigInfo->TaggedQueuing = FALSE;
>
> ConfigInfo->AlignmentMask = 0x1;
>
>
> My question was what else is needed to be done at the scsi miniport to do
> Bus Master DMA? I am new to this, I am stuck here. please help OR guide me
> to source of information that I can read.
>
> Thanks,
>
> “Peter Wieland” wrote in message
> news:xxxxx@ntdev…
> as a scsi miniport you need to do anything related setting up DMA
> yourself. Nobody does this for you.
>
> Why are you developing your own SCSI miniport for the controller? Do
> you need to run on NT4? If not you should consider using the system
> supplied atapi driver (which in 2k and beyond is not a miniport) and
> providing a channel driver to do any custom DMA setup that your
> controller requires.
>
> -p
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of shakeel
> Sent: Wednesday, February 11, 2004 1:54 PM
> To: Windows System Software Devs Interest List
> Subject: Re:[ntdev] scsi miniport
>
> I foundout what the problem was in HwScsiFindAdapter(). I was
> initializing the InitiatorBusId[0] =0, Now I use the value assigned by
> scsiport driver.
> Thanks.
>
> The next thing working on is to add DMA transfer support(Currently the
> driver does PIO only). In HwScsiFindAdapter() routine initializing the
> PORT_CONFIGURATION_INFORMATION with the following
>
>
> // Indicate maximum transfer length is 64k.
> //
> ConfigInfo->MaximumTransferLength = 0x10000; //MAX_TRANSFER_SIZE
>
> ConfigInfo->ScatterGather = TRUE;
> ConfigInfo->Master = TRUE;
> ConfigInfo->NeedPhysicalAddresses = TRUE;
> ConfigInfo->Dma32BitAddresses = TRUE;
>
> ConfigInfo->TaggedQueuing = FALSE;
>
> ConfigInfo->AlignmentMask = 0x1;
>
> Our HBA is Bus Master PCIIDE. Who creates the PRD Table? Is scsiport
> does this? Please help, what do I need to do to add DMA transfer support
> to the driver.
>
> Thanks in advance,
> Shakeel.
>
> “shakeel” wrote in message news:xxxxx@ntdev…
> > Hi,
> >
> > I developed SCSI Miniport for ATA HBA using the NT4 atapi sample code.
> >
> > Added support for plug and play, I am able to install and load the
> > drive successfully.
> >
> > I have connected four drives ( 2 per channel), but I can see only
> > three drives. for some reason the drive 0 on Primary is not showing
> up.
> >
> > by stepping through, I found out that the SCSIPort driver is calling
> > the
> > HwScsiStartIo() routine with SRB->TargetId starting 1 ( 1, then, 2,
> > then
> 3).
> >
> > It is not calling with TargetId Zero. and Hence that drive is not
> > getting reported.
> >
> > What is that I am missing in the initialization that causing the
> > SCSIPORT drive to skip the TargetId Zero (Drive 0 of Primary channel).
> >
> > Thanks in advance for your help.
> > Shakeel
> >
> >
> > “Gary G. Little” wrote in message
> > news:xxxxx@ntdev…
> > > With a little luck and perseverance you might find the NT4 DDK. I t
> > contains
> > > about the only example of writing a SCSI mini-port for an ATA HBA.
> > However,
> > > as stated in another forum, it does not do DMA, so you will have to
> > > add
> > it.
> > >
> > > –
> > > Gary G. Little
> > > Seagate Technologies, LLC
> > >
> > > “Jeffrey Goldner” wrote in message
> > > news:xxxxx@ntdev…
> > > The DDK has several sample miniports, although they are for SCSI
> > > adapters. You have to yank out the irrelevant parts first.
> > >
> > > -----Original Message-----
> > > From: shakeel [mailto:xxxxx@yahoo.com]
> > > Sent: Wednesday, January 14, 2004 2:27 PM
> > > Subject: scsi miniport
> > >
> > > NT gurus,
> > >
> > > I have been given the task of writting SCSI miniport for ATA/IDE
> > > controller.
> > > Is there sample source code available to start with.
> > >
> > > Thanks,
> > > Shakeel.
> > >
> > >
> > >
> > >
> > >
> >
> >
> >
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@iei.com.tw
> To unsubscribe send a blank email to xxxxx@lists.osr.com

you should set the number of physical breaks to indicate the maximum
number of entries in your controller’s scatter gather lists. If the
number is unbounded then there’s a way you can find out from scsiport
how many breaks the admin has configured you to support (read the DDK).
The storage drivers assume that buffers are maximally fragmented (since
the cost of actually determining the number of breaks is high) so the
disk driver will split up any request which spans more than
NumberOfPhysicalBreaks+1 virtual pages - 17 breaks would allow you
handle any 64k transfer (which can span up to 68k worth of pages if it’s
not page aligned)

You call ScsiPortGetPhysicalAddress during request processing in order
to build the scatter-gather list. You then program your card to perform
the transfer to those physical addresses. When it’s done you complete
the request.

the programming of the controller is up to you.

the best sample for you is probably (assuming it’s still in the DDK) the
aha154x miniport. It’s very simple and does busmastering DMA.

-p

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of shakeel
Sent: Wednesday, February 11, 2004 5:56 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] scsi miniport

Peter,

We are ATA/IDE RAID chip vender. Because of the Performance and
flexibility issues with ATAPI, have to adopt SCSI port/miniport driver
model.
I took the atapi sample from NT4 DDK and added Plug and Play support to
make it work for Win2k/XP.

Now I am working on to add BusMaster DMA support. Isn’t that most of it
done by the SCSIPORT driver?

So, I have initialized PORT_CONFIGURATION_INFORMATION in
HwScsiFindAdapter() with the following

// Indicate maximum transfer length is 64k.
//
ConfigInfo->MaximumTransferLength = 0x10000; //MAX_TRANSFER_SIZE

ConfigInfo->ScatterGather = TRUE;
ConfigInfo->Master = TRUE;
ConfigInfo->NeedPhysicalAddresses = TRUE;
ConfigInfo->Dma32BitAddresses = TRUE;

ConfigInfo->TaggedQueuing = FALSE;

ConfigInfo->AlignmentMask = 0x1;

My question was what else is needed to be done at the scsi miniport to
do Bus Master DMA? I am new to this, I am stuck here. please help OR
guide me to source of information that I can read.

Thanks,

“Peter Wieland” wrote in message
news:xxxxx@ntdev…
as a scsi miniport you need to do anything related setting up DMA
yourself. Nobody does this for you.

Why are you developing your own SCSI miniport for the controller? Do
you need to run on NT4? If not you should consider using the system
supplied atapi driver (which in 2k and beyond is not a miniport) and
providing a channel driver to do any custom DMA setup that your
controller requires.

-p

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of shakeel
Sent: Wednesday, February 11, 2004 1:54 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] scsi miniport

I foundout what the problem was in HwScsiFindAdapter(). I was
initializing the InitiatorBusId[0] =0, Now I use the value assigned by
scsiport driver.
Thanks.

The next thing working on is to add DMA transfer support(Currently the
driver does PIO only). In HwScsiFindAdapter() routine initializing the
PORT_CONFIGURATION_INFORMATION with the following

// Indicate maximum transfer length is 64k.
//
ConfigInfo->MaximumTransferLength = 0x10000; //MAX_TRANSFER_SIZE

ConfigInfo->ScatterGather = TRUE;
ConfigInfo->Master = TRUE;
ConfigInfo->NeedPhysicalAddresses = TRUE;
ConfigInfo->Dma32BitAddresses = TRUE;

ConfigInfo->TaggedQueuing = FALSE;

ConfigInfo->AlignmentMask = 0x1;

Our HBA is Bus Master PCIIDE. Who creates the PRD Table? Is scsiport
does this? Please help, what do I need to do to add DMA transfer support
to the driver.

Thanks in advance,
Shakeel.

“shakeel” wrote in message news:xxxxx@ntdev…
> Hi,
>
> I developed SCSI Miniport for ATA HBA using the NT4 atapi sample code.
>
> Added support for plug and play, I am able to install and load the
> drive successfully.
>
> I have connected four drives ( 2 per channel), but I can see only
> three drives. for some reason the drive 0 on Primary is not showing
up.
>
> by stepping through, I found out that the SCSIPort driver is calling
> the
> HwScsiStartIo() routine with SRB->TargetId starting 1 ( 1, then, 2,
> then
3).
>
> It is not calling with TargetId Zero. and Hence that drive is not
> getting reported.
>
> What is that I am missing in the initialization that causing the
> SCSIPORT drive to skip the TargetId Zero (Drive 0 of Primary channel).
>
> Thanks in advance for your help.
> Shakeel
>
>
> “Gary G. Little” wrote in message
> news:xxxxx@ntdev…
> > With a little luck and perseverance you might find the NT4 DDK. I t
> contains
> > about the only example of writing a SCSI mini-port for an ATA HBA.
> However,
> > as stated in another forum, it does not do DMA, so you will have to
> > add
> it.
> >
> > –
> > Gary G. Little
> > Seagate Technologies, LLC
> >
> > “Jeffrey Goldner” wrote in message
> > news:xxxxx@ntdev…
> > The DDK has several sample miniports, although they are for SCSI
> > adapters. You have to yank out the irrelevant parts first.
> >
> > -----Original Message-----
> > From: shakeel [mailto:xxxxx@yahoo.com]
> > Sent: Wednesday, January 14, 2004 2:27 PM
> > Subject: scsi miniport
> >
> > NT gurus,
> >
> > I have been given the task of writting SCSI miniport for ATA/IDE
> > controller.
> > Is there sample source code available to start with.
> >
> > Thanks,
> > Shakeel.
> >
> >
> >
> >
> >
>
>
>


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Thanks Peter and Nike for your help.
Shakeel.
“Peter Wieland” wrote in message
news:xxxxx@ntdev…
you should set the number of physical breaks to indicate the maximum
number of entries in your controller’s scatter gather lists. If the
number is unbounded then there’s a way you can find out from scsiport
how many breaks the admin has configured you to support (read the DDK).
The storage drivers assume that buffers are maximally fragmented (since
the cost of actually determining the number of breaks is high) so the
disk driver will split up any request which spans more than
NumberOfPhysicalBreaks+1 virtual pages - 17 breaks would allow you
handle any 64k transfer (which can span up to 68k worth of pages if it’s
not page aligned)

You call ScsiPortGetPhysicalAddress during request processing in order
to build the scatter-gather list. You then program your card to perform
the transfer to those physical addresses. When it’s done you complete
the request.

the programming of the controller is up to you.

the best sample for you is probably (assuming it’s still in the DDK) the
aha154x miniport. It’s very simple and does busmastering DMA.

-p

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of shakeel
Sent: Wednesday, February 11, 2004 5:56 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] scsi miniport

Peter,

We are ATA/IDE RAID chip vender. Because of the Performance and
flexibility issues with ATAPI, have to adopt SCSI port/miniport driver
model.
I took the atapi sample from NT4 DDK and added Plug and Play support to
make it work for Win2k/XP.

Now I am working on to add BusMaster DMA support. Isn’t that most of it
done by the SCSIPORT driver?

So, I have initialized PORT_CONFIGURATION_INFORMATION in
HwScsiFindAdapter() with the following

// Indicate maximum transfer length is 64k.
//
ConfigInfo->MaximumTransferLength = 0x10000; //MAX_TRANSFER_SIZE

ConfigInfo->ScatterGather = TRUE;
ConfigInfo->Master = TRUE;
ConfigInfo->NeedPhysicalAddresses = TRUE;
ConfigInfo->Dma32BitAddresses = TRUE;

ConfigInfo->TaggedQueuing = FALSE;

ConfigInfo->AlignmentMask = 0x1;

My question was what else is needed to be done at the scsi miniport to
do Bus Master DMA? I am new to this, I am stuck here. please help OR
guide me to source of information that I can read.

Thanks,

“Peter Wieland” wrote in message
news:xxxxx@ntdev…
as a scsi miniport you need to do anything related setting up DMA
yourself. Nobody does this for you.

Why are you developing your own SCSI miniport for the controller? Do
you need to run on NT4? If not you should consider using the system
supplied atapi driver (which in 2k and beyond is not a miniport) and
providing a channel driver to do any custom DMA setup that your
controller requires.

-p

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of shakeel
Sent: Wednesday, February 11, 2004 1:54 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] scsi miniport

I foundout what the problem was in HwScsiFindAdapter(). I was
initializing the InitiatorBusId[0] =0, Now I use the value assigned by
scsiport driver.
Thanks.

The next thing working on is to add DMA transfer support(Currently the
driver does PIO only). In HwScsiFindAdapter() routine initializing the
PORT_CONFIGURATION_INFORMATION with the following

// Indicate maximum transfer length is 64k.
//
ConfigInfo->MaximumTransferLength = 0x10000; //MAX_TRANSFER_SIZE

ConfigInfo->ScatterGather = TRUE;
ConfigInfo->Master = TRUE;
ConfigInfo->NeedPhysicalAddresses = TRUE;
ConfigInfo->Dma32BitAddresses = TRUE;

ConfigInfo->TaggedQueuing = FALSE;

ConfigInfo->AlignmentMask = 0x1;

Our HBA is Bus Master PCIIDE. Who creates the PRD Table? Is scsiport
does this? Please help, what do I need to do to add DMA transfer support
to the driver.

Thanks in advance,
Shakeel.

“shakeel” wrote in message news:xxxxx@ntdev…
> Hi,
>
> I developed SCSI Miniport for ATA HBA using the NT4 atapi sample code.
>
> Added support for plug and play, I am able to install and load the
> drive successfully.
>
> I have connected four drives ( 2 per channel), but I can see only
> three drives. for some reason the drive 0 on Primary is not showing
up.
>
> by stepping through, I found out that the SCSIPort driver is calling
> the
> HwScsiStartIo() routine with SRB->TargetId starting 1 ( 1, then, 2,
> then
3).
>
> It is not calling with TargetId Zero. and Hence that drive is not
> getting reported.
>
> What is that I am missing in the initialization that causing the
> SCSIPORT drive to skip the TargetId Zero (Drive 0 of Primary channel).
>
> Thanks in advance for your help.
> Shakeel
>
>
> “Gary G. Little” wrote in message
> news:xxxxx@ntdev…
> > With a little luck and perseverance you might find the NT4 DDK. I t
> contains
> > about the only example of writing a SCSI mini-port for an ATA HBA.
> However,
> > as stated in another forum, it does not do DMA, so you will have to
> > add
> it.
> >
> > –
> > Gary G. Little
> > Seagate Technologies, LLC
> >
> > “Jeffrey Goldner” wrote in message
> > news:xxxxx@ntdev…
> > The DDK has several sample miniports, although they are for SCSI
> > adapters. You have to yank out the irrelevant parts first.
> >
> > -----Original Message-----
> > From: shakeel [mailto:xxxxx@yahoo.com]
> > Sent: Wednesday, January 14, 2004 2:27 PM
> > Subject: scsi miniport
> >
> > NT gurus,
> >
> > I have been given the task of writting SCSI miniport for ATA/IDE
> > controller.
> > Is there sample source code available to start with.
> >
> > Thanks,
> > Shakeel.
> >
> >
> >
> >
> >
>
>
>


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Check the InitiatorBusId value.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

----- Original Message -----
From: “shakeel”
Newsgroups: ntdev
To: “Windows System Software Devs Interest List”
Sent: Wednesday, February 11, 2004 2:13 AM
Subject: Re:[ntdev] scsi miniport

> Hi,
>
> I developed SCSI Miniport for ATA HBA using the NT4 atapi sample code.
>
> Added support for plug and play, I am able to install and load the drive
> successfully.
>
> I have connected four drives ( 2 per channel), but I can see only three
> drives. for some reason the drive 0 on Primary is not showing up.
>
> by stepping through, I found out that the SCSIPort driver is calling the
> HwScsiStartIo() routine with SRB->TargetId starting 1 ( 1, then, 2, then 3).
>
> It is not calling with TargetId Zero. and Hence that drive is not getting
> reported.
>
> What is that I am missing in the initialization that causing the SCSIPORT
> drive to skip the TargetId Zero (Drive 0 of Primary channel).
>
> Thanks in advance for your help.
> Shakeel
>
>
> “Gary G. Little” wrote in message
> news:xxxxx@ntdev…
> > With a little luck and perseverance you might find the NT4 DDK. I t
> contains
> > about the only example of writing a SCSI mini-port for an ATA HBA.
> However,
> > as stated in another forum, it does not do DMA, so you will have to add
> it.
> >
> > –
> > Gary G. Little
> > Seagate Technologies, LLC
> >
> > “Jeffrey Goldner” wrote in message
> > news:xxxxx@ntdev…
> > The DDK has several sample miniports, although they are for SCSI
> > adapters. You have to yank out the irrelevant parts first.
> >
> > -----Original Message-----
> > From: shakeel [mailto:xxxxx@yahoo.com]
> > Sent: Wednesday, January 14, 2004 2:27 PM
> > Subject: scsi miniport
> >
> > NT gurus,
> >
> > I have been given the task of writting SCSI miniport for ATA/IDE
> > controller.
> > Is there sample source code available to start with.
> >
> > Thanks,
> > Shakeel.
> >
> >
> >
> >
> >
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com