/* * SCSI driver phases
*/ typedefenum {
PHASE_IDLE, /* we're not planning on doing anything */
PHASE_CONNECTING, /* connecting to a target */
PHASE_CONNECTED, /* connected to a target */
PHASE_MSGOUT, /* message out to device */
PHASE_RECONNECTED, /* reconnected */
PHASE_COMMANDPAUSED, /* command partly sent */
PHASE_COMMAND, /* command all sent */
PHASE_DATAOUT, /* data out to device */
PHASE_DATAIN, /* data in from device */
PHASE_STATUSIN, /* status in from device */
PHASE_MSGIN, /* message in from device */
PHASE_DONE, /* finished */
PHASE_ABORTED, /* aborted */
PHASE_DISCONNECT, /* disconnecting */
} phase_t;
/* * After interrupt, what to do now
*/ typedefenum {
INTR_IDLE, /* not expecting another IRQ */
INTR_NEXT_COMMAND, /* start next command */
INTR_PROCESSING, /* interrupt routine still processing */
} intr_ret_t;
/* * DMA direction
*/ typedefenum {
DMA_OUT, /* DMA from memory to chip */
DMA_IN /* DMA from chip to memory */
} dmadir_t;
/* * Synchronous transfer state
*/ typedefenum { /* Synchronous transfer state */
SYNC_ASYNCHRONOUS, /* don't negotiate synchronous transfers*/
SYNC_NEGOCIATE, /* start negotiation */
SYNC_SENT_REQUEST, /* sent SDTR message */
SYNC_COMPLETED, /* received SDTR reply */
} syncxfer_t;
/* * Data phase direction
*/ typedefenum { /* Data direction */
DATADIR_IN, /* Data in phase expected */
DATADIR_OUT /* Data out phase expected */
} datadir_t;
#include"queue.h" #include"msgqueue.h"
#define STATUS_BUFFER_SIZE 32 /* * This is used to dump the previous states of the SBIC
*/ struct status_entry { unsignedlong when; unsignedchar ssr; unsignedchar ph; unsignedchar irq; unsignedchar unused;
};
/* per-device info */ struct { unsignedchar sync_xfer; /* synchronous transfer (SBIC value) */
syncxfer_t sync_state; /* sync xfer negotiation state */ unsignedchar disconnect_ok:1; /* device can disconnect */
} device[8]; unsignedlong busyluns[64 / sizeof(unsignedlong)];/* array of bits indicating LUNs busy */
/* DMA info */ struct { unsignedint free_addr; /* next free address */ unsignedint start_addr; /* start address of current transfer */
dmadir_t direction; /* dma direction */ unsignedint transferred; /* number of bytes transferred */ unsignedint xfer_start; /* scheduled DMA transfer start */ unsignedint xfer_length; /* scheduled DMA transfer length */ char *xfer_ptr; /* pointer to area */ unsignedchar xfer_required:1; /* set if we need to transfer something */ unsignedchar xfer_setup:1; /* set if DMA is setup */ unsignedchar xfer_done:1; /* set if DMA reached end of BH list */
} dma;
/* card info */ struct { unsignedchar page_reg; /* current setting of page reg */
} card;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.