[1269] in linux-scsi channel archive
Adaptec AHA-152x device driver help
daemon@ATHENA.MIT.EDU (Randy Scott)
Wed Jan 15 15:06:56 1997
From: Randy Scott <scottr@belle.bork.com>
To: fischer@et-inf.fho-emden.de
Date: Wed, 15 Jan 1997 13:44:35 -0600 (CST)
Cc: ericy@cais.com, faith@cs.unc.edu, johnsonm@sunsite.unc.edu,
drew@cs.colorado.edu, linux-scsi@vger.rutgers.edu
I am currently implementing a network/SCSI high-level device driver
that performs IP encapsulation in SCSI. I have a couple questions
to ask, if thats alright with you. I'm sorry if this gets
a little long..
Questions:
1. Since other host adapters on the SCSI bus are not detected by
the scan_scsis() function, I am creating by hand a struct
Scsi_Device with most of the important information filled in for
all of the "SCSI IDs" that we might want to send a packet to.
Then, to actually send a "packet," I am creating, by hand again,
a Scsi_Cmnd with the important information filled in, and then
calling scsi_do_cmd() with that Scsi_Cmnd, the actual SCSI
command (a SEND_MESSAGE(10) in this case), and the packet data.
Anyway, using the Adaptec 152x driver as the transmitter, I
am able to correctly send the packet over the SCSI bus where I
can successfully recover it on an AM53C974-based host adapter.
To implement broadcast, I create a Scsi_Cmnd structure and call
scsi_do_cmd() for each ID on the bus that we wish to send to
(basically everything but our own ID and the IDs of any disks
on the bus). The data associated with the command (transfered
in the DATA OUT phase) is sometimes getting destroyed (same
pointer, different data) when we attempt to send the packet to
a non-existing device before sending to the only target on the
bus (the AM53C974). I was unable to find anything in the code
(the driver or the mid-level SCSI driver) where the data might
have been altered. Do you have any suggestions?
2. The AM53C974 driver seems to put itself into "target mode"
automatically when it is selected by another host adapter on
the SCSI bus. Once this happens, we execute the commands
necessary to complete the SEND MESSAGE command.
Do you have any idea how to make the AHA-152x do this? I was
thinking something along these lines:
When the card is idle (no queued commands), have the card
be in target mode (?) by setting the TEMODEO flag
in the SCSISEQ register.
However, this does not appear to have any effect. Without
the documentation for this controller chip, I am at a loss. I
was thinking that it might be necessary make the card interrupt
when it was being selected (SELINGI in SSTAT0?).
I would really appriciate any help/suggestions you could give me. Thanks.
--
Randy Scott <scottr@belle.bork.com>