DataBuffer question

Hi,

I am writing a scsi miniport driver. Actually , there is no real hba.
The driver is developed for windows 2000 (2195).

After loading the driver, the first command received by my startio fn is
INQUIRY command. The response to this srb has to be sent using the
DataBuffer pointer.

srb contains the following values:
srb->Function = SRB_FUNCTION_EXECUTE_SCSI
CDBLength = 6
DataBuffer != NULL
DataTransferLength = 36.

(I made the adapterinterface type as Isa to make the driver non-pnp)

Now the problem comes with DataBuffer.

First I typecasted the srb->DataBuffer to INQUIRYDATA pointer and assign
values using this ptr. But I got a PAGE_FAULT_IN_NONPAGED_AREA BSOD.

Then I used ScsiPortConvertPhysicalAddressToUlong,
ScsiPortGetPhysicalAddress fns to convert the address of databuffer to
physical address and tried to assign values using this pointer.
This time also I got page_fault error.

This poses me the following questions:

  1. To respond to scsi request, the miniport has to use the databuffer
    passed by miniport driver. Is it correct?.

  2. How to manipulate the databuffer member of scsi_request_block without
    getting page_fault error?.

  3. Also the startio fn is called some 8 times ,then scsiportininitialise
    returns to driverentry with success. Is it due to the no of targets/luns?.

  4. Once the miniport driver is ready, the next question is how to create a
    symbolic link name like f: so that users could access the virtual drive?.

Expecting your help on this.

Thanks
Kas

you need to set MapBuffers in the initialization data so that scsiport
gives you data buffers which are mapped into system VA space.

-p

-----Original Message-----
From: kas [mailto:xxxxx@yahoo.com]
Sent: Monday, December 02, 2002 6:32 AM
To: NT Developers Interest List
Subject: [ntdev] DataBuffer question

Hi,

I am writing a scsi miniport driver. Actually , there is no real hba.
The driver is developed for windows 2000 (2195).

After loading the driver, the first command received by my startio fn is
INQUIRY command. The response to this srb has to be sent using the
DataBuffer pointer.

srb contains the following values:
srb->Function = SRB_FUNCTION_EXECUTE_SCSI
CDBLength = 6
DataBuffer != NULL
DataTransferLength = 36.

(I made the adapterinterface type as Isa to make the driver non-pnp)

Now the problem comes with DataBuffer.

First I typecasted the srb->DataBuffer to INQUIRYDATA pointer and assign
values using this ptr. But I got a PAGE_FAULT_IN_NONPAGED_AREA BSOD.

Then I used ScsiPortConvertPhysicalAddressToUlong,
ScsiPortGetPhysicalAddress fns to convert the address of databuffer to
physical address and tried to assign values using this pointer. This
time also I got page_fault error.

This poses me the following questions:

  1. To respond to scsi request, the miniport has to use the databuffer
    passed by miniport driver. Is it correct?.

  2. How to manipulate the databuffer member of scsi_request_block without
    getting page_fault error?.

  3. Also the startio fn is called some 8 times ,then scsiportininitialise
    returns to driverentry with success. Is it due to the no of
    targets/luns?.

  4. Once the miniport driver is ready, the next question is how to create
    a symbolic link name like f: so that users could access the virtual
    drive?.

Expecting your help on this.

Thanks
Kas


You are currently subscribed to ntdev as: xxxxx@microsoft.com To
unsubscribe send a blank email to %%email.unsub%%

> 2. How to manipulate the databuffer member of scsi_request_block
without

getting page_fault error?.

Set the MapBuffers flag in PORT_CONFIGURATION_INFORMATION to TRUE.
Otherwise, DataBuffer is not a valid pointer.

Max