summaryrefslogtreecommitdiffstats
path: root/sys/dev/aic7xxx/aic7xxx.h
diff options
context:
space:
mode:
authorgibbs <gibbs@FreeBSD.org>1998-11-23 01:33:47 +0000
committergibbs <gibbs@FreeBSD.org>1998-11-23 01:33:47 +0000
commitad7080d581f4d14be46b9ce97e1d89ab54565fd9 (patch)
tree7bab1dcb022f080626a0b5a06296e839a6d4c72a /sys/dev/aic7xxx/aic7xxx.h
parent0b3bd2def8c0b1aad4cf5df500e9eb3c3947b7c8 (diff)
downloadFreeBSD-src-ad7080d581f4d14be46b9ce97e1d89ab54565fd9.zip
FreeBSD-src-ad7080d581f4d14be46b9ce97e1d89ab54565fd9.tar.gz
Change the delivery mechanism for incoming target commands. We now
use a 256 entry ring buffer of descriptersfor this purpose. This allows the use of a simple 8bit counter in the sequencer code for tracking start location. Entries in the ring buffer now contain a "cmd_valid" byte at their tail. As an entry is serviced, this byte is cleared by the kernel and set by the sequencer during its dma of a new entry. Since this byte is the last portion of the command touched during a dma, the kernel can use this byte to ensure the command it processes is completely valid. The new command format requires a fixed sized DMA from the controller to deliver which allowed for additional simplification of the sequencer code. The hack that required 1 SCB slot to be stolen for incoming command delivery notification is also gone.
Diffstat (limited to 'sys/dev/aic7xxx/aic7xxx.h')
-rw-r--r--sys/dev/aic7xxx/aic7xxx.h29
1 files changed, 20 insertions, 9 deletions
diff --git a/sys/dev/aic7xxx/aic7xxx.h b/sys/dev/aic7xxx/aic7xxx.h
index 06f7d4a..560cb3f 100644
--- a/sys/dev/aic7xxx/aic7xxx.h
+++ b/sys/dev/aic7xxx/aic7xxx.h
@@ -34,7 +34,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: aic7xxx.h,v 1.40 1997/02/25 03:05:35 gibbs Exp $
+ * $Id: aic7xxx.h,v 1.1 1998/09/15 07:24:16 gibbs Exp $
*/
#ifndef _AIC7XXX_H_
@@ -68,6 +68,12 @@
* aic7850 has only 3.
*/
+#define AHC_TMODE_CMDS 256 /*
+ * Ring Buffer of incoming target commands.
+ * We allocate 256 to simplify the logic
+ * in the sequencer by using the natural
+ * wrap point of an 8bit counter.
+ */
#if defined(__FreeBSD__)
extern u_long ahc_unit;
@@ -247,13 +253,17 @@ struct scb_data {
* Connection desciptor for select-in requests in target mode.
* The first byte is the connecting target, followed by identify
* message and optional tag information, terminated by 0xFF. The
- * remainder is the command to execute.
+ * remainder is the command to execute. The cmd_valid byte is on
+ * an 8 byte boundary to simplify setting it on aic7880 hardware
+ * which only has limited direct access to the DMA FIFO.
*/
struct target_cmd {
- u_int8_t icl; /* Really only holds Initiator ID */
- u_int8_t targ_id; /* Target ID we were selected at */
- u_int8_t identify; /* Identify message */
- u_int8_t bytes[29];
+ u_int8_t initiator_channel;
+ u_int8_t targ_id; /* Target ID we were selected at */
+ u_int8_t identify; /* Identify message */
+ u_int8_t bytes[21];
+ u_int8_t cmd_valid;
+ u_int8_t pad[7];
};
/*
@@ -462,10 +472,11 @@ struct ahc_softc {
int unsolicited_ints;
pcici_t pci_config_id;
- /* Hmmm. */
+ /*
+ * Target incoming command FIFO.
+ */
struct target_cmd *targetcmds;
- int next_targetcmd;
- int num_targetcmds;
+ u_int8_t tqinfifonext;
/*
* Incoming and outgoing message handling.
OpenPOWER on IntegriCloud