02.03.2014 Views

BSP Developer's Guide

BSP Developer's Guide

BSP Developer's Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

I<br />

Writing a SCSI-2 Device Driver<br />

* into the DSP register. If not in single-step mode, start the script.<br />

*<br />

* NOTE: should always be called with SCSI controller's interrupts locked.<br />

*<br />

* RETURNS: N/A<br />

*/<br />

LOCAL void xxxScriptStart<br />

(<br />

SIOP *pSiop, /* pointer to SCSI controller info */<br />

XXX_THREAD *pThread, /* ncr thread info */<br />

XXX_SCRIPT_ENTRY entryId /* routine address entry point */<br />

)<br />

{<br />

static ULONG * xxxScriptEntry [] =<br />

{<br />

xxxWait, /* wait for re-select or host cmd */<br />

xxxInitStart, /* start an initiator thread */<br />

xxxInitContinue, /* continue an initiator thread */<br />

xxxTgtDisconnect, /* disconnect a target thread */<br />

};<br />

/* Restore the SCSI controller register context for this thread. */<br />

/*<br />

* Set the shared data address, load the script start address,<br />

* then start the SCSI controller.<br />

*/<br />

}<br />

/***************************************************************************<br />

*<br />

* xxxXferParamsQuery - get (synchronous) transfer parameters<br />

*<br />

* Updates the synchronous transfer parameters suggested in the call to match<br />

* the XXX SCSI controller's capabilities. Transfer period is in SCSI units<br />

* (multiples * of 4 ns).<br />

*<br />

* RETURNS: OK<br />

*/<br />

I<br />

LOCAL STATUS xxxXferParamsQuery<br />

(<br />

SCSI_CTRL *pScsiCtrl, /* ptr to controller info */<br />

UINT8 *pOffset, /* max REQ/ACK offset [in/out] */<br />

UINT8 *pPeriod /* min transfer period [in/out] */<br />

)<br />

{<br />

return (OK);<br />

}<br />

349

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!