installing miniport driver...

Hi all,

I wrote a scsi miniport driver which talks to
virtual HBA on WIN 2K, the driver is working fine. The
Driver is a legacy driver, which is loaded at the boot
time.
The problem now is, I want to send all the CDB’s
over the TCP/IP, If i load the driver at the boot time
the ENQUIRY Commands are sent to the XXXXStartIo of
the Driver before the TCP/IP stack comes up and i
can’t send the packets at that time.
If i make the driver PnP Enabled the drivers is
loaded and How to tell the PnP manager as an HBA has
been added ones the windows has come up fully?? so
that the PnP manager can invoke xxxFindAdapter and
xxxHwInitialize and sends the ENQUIRY commands to
xxxStartIo, so that i can Pack it and send over
TCP/IP.

thanks and regards,
Murali.

PS : For using the TDI Interfaces in Miniport driver,
Do i have to take some special care such as
changing IRP level etc… Even can i call the TDI

Interfaces in all the routines of the miniport
driver such as xxxFindAdapter and xxxHwInitalize.


Do You Yahoo!?
Great stuff seeking new owners in Yahoo! Auctions!
http://auctions.yahoo.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

> If i make the driver PnP Enabled the drivers is

loaded and How to tell the PnP manager as an HBA has
been added ones the windows has come up fully?? so
that the PnP manager can invoke xxxFindAdapter and
xxxHwInitialize and sends the ENQUIRY commands to
xxxStartIo, so that i can Pack it and send over
TCP/IP.

I can suggest you somewhat different aproach - make your HBA
always visible but before the TCP connection is up, return
SRB_STATUS_SELECTION_TIMEOUT on all i/o requests to
your driver. It will make SCSIPORT think that
you have no devices on your virtual SCSI bus.
Then, when the TCP connection is established, call
ScsiPortNotification( BusChangeDetected,… ) so SCSIPORT
will rescan your bus and send INQUIRY requests again.

PS : For using the TDI Interfaces in Miniport driver,
Do i have to take some special care such as
changing IRP level etc… Even can i call the TDI
Interfaces in all the routines of the miniport
driver such as xxxFindAdapter and xxxHwInitalize.

I think you should run a thread and make all your TDI calls
from that thread. Remember that you cannot make any
ScsiPort… calls from that thread.
The problem is that you cannot call ScsiPortNotification(RequestComplete,…).
This problem was discussed many times in this
list and I think some quite good solution was found.
Search the list or send me a message and I’ll send you
code fragments.

PS. Making miniport talking to TDI is a bad idea. In first,
it’s against the rools. In second, resulting code is tricky
and not completely reliable. Implement your driver as
a full port driver.


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

You will encounter problems in the StartIo. SRB requests are sent to the
miniport driver at a raised IRQL and with spinlocks held. Calling into
another driver can be dangerous unless it si an synchronous call.

With async calls, there is another problem. Your completion routine is
not called in the SCSIPORT context. There are tricks to getting the call
back into the SCSIPORT context; including, but not limited to scheduling
a timer callback; which has a 10ms delay associated with it.

The Microsoft SCSI minport interface is not designed to all the calling
of functions not defined in the miniport.h header; i.e. no DDK calls.
There are ways to call DDK functions, but you must be careful as many
will fail, BSOD and lcok up the machine.

The solution is to write a full-blown SCSI port driver that runs in
tandem with the Microsoft SCSI port based drivers. This is a big task.
There are too many gotchas and undocumented interfaces to make it work
properly.

Jamey

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Murali S
Sent: Saturday, January 26, 2002 5:06 AM
To: NT Developers Interest List
Subject: [ntdev] installing miniport driver…

Hi all,

I wrote a scsi miniport driver which talks to
virtual HBA on WIN 2K, the driver is working fine. The
Driver is a legacy driver, which is loaded at the boot
time.
The problem now is, I want to send all the CDB’s
over the TCP/IP, If i load the driver at the boot time
the ENQUIRY Commands are sent to the XXXXStartIo of
the Driver before the TCP/IP stack comes up and i
can’t send the packets at that time.
If i make the driver PnP Enabled the drivers is
loaded and How to tell the PnP manager as an HBA has
been added ones the windows has come up fully?? so
that the PnP manager can invoke xxxFindAdapter and xxxHwInitialize and
sends the ENQUIRY commands to xxxStartIo, so that i can Pack it and send
over TCP/IP.

thanks and regards,
Murali.

PS : For using the TDI Interfaces in Miniport driver,
Do i have to take some special care such as
changing IRP level etc… Even can i call the TDI

Interfaces in all the routines of the miniport
driver such as xxxFindAdapter and xxxHwInitalize.


Do You Yahoo!?
Great stuff seeking new owners in Yahoo! Auctions!
http://auctions.yahoo.com


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