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.

VxWorks 5.5<br />

<strong>BSP</strong> Developer’s <strong>Guide</strong><br />

pSbic = (SBIC *) pScsiCtrl;<br />

/* Handle phase changes */<br />

/* Start DMA, if used, or programmed i/o loop to transfer data */<br />

/* Wait for transfer to complete: find out how many bytes transferred */<br />

semTake (&pSbic->xferDoneSem, WAIT_FOREVER);<br />

/*<br />

* If there are bytes left to be transferred return ERROR<br />

* If DMA is used for tranfer do a SCSI DMA Abort<br />

*/<br />

xxxXferCountGet (pSbic, &bytesLeft);<br />

return (bufLength - bytesLeft);<br />

}<br />

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

*<br />

* xxxXferCountSet - load the SCSI controller transfer counter with count.<br />

*<br />

* RETURNS: OK if count is in range 0 - 0xffffff, otherwise ERROR.<br />

*<br />

*/<br />

LOCAL STATUS xxxXferCountSet<br />

(<br />

FAST SBIC *pSbic, /* ptr to SBIC info */<br />

FAST UINT count /* count value to load */<br />

)<br />

{<br />

/* set the appropriate SCSI controller registers */<br />

}<br />

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

*<br />

* xxxXferCountGet - fetch the SCSI controller transfer count<br />

*<br />

* The value of the transfer counter is copied to *pCount.<br />

*<br />

*/<br />

LOCAL void xxxXferCountGet<br />

(<br />

FAST SBIC *pSbic, /* ptr to SBIC info */<br />

FAST UINT *pCount /* ptr to returned value */<br />

)<br />

{<br />

/* read the appropriate SCSI controller registers */<br />

}<br />

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

*<br />

332

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

Saved successfully!

Ooh no, something went wrong!