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 />

int xxxXferDoneSemOptions = SEM_Q_PRIORITY;<br />

char *xxxScsiTaskName = SCSI_DEF_TASK_NAME;<br />

IMPORT SCSI_CTRL *pSysScsiCtrl;<br />

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

*<br />

* xxxCtrlCreate - create and partially initialize a SCSI controller structure<br />

*<br />

* This routine creates a SCSI controller data structure and must be called<br />

* before using a SCSI controller chip. It should be called once and only<br />

* once for a specified SCSI controller. Since it allocates memory for a<br />

* structure needed by all routines in xxxLib, it must be called before<br />

* any other routines in the library.<br />

* After calling this routine, at least one call to xxxCtrlInit() should<br />

* be made before any SCSI transaction is initiated using the SCSI controller.<br />

*<br />

* RETURNS: A pointer to the SCSI controller structure, or NULL if memory is<br />

* insufficient or parameters are invalid.<br />

*/<br />

XXX_SCSI_CTRL *xxxCtrlCreate<br />

(<br />

FAST UINT8 *sbicBaseAdrs, /* base address of the SBIC */<br />

int regOffset, /* address offset between SBIC registers */<br />

UINT clkPeriod, /* period of the SBIC clock (nsec) */<br />

FUNCPTR sysScsiBusReset, /* function to reset SCSI bus */<br />

int sysScsiResetArg, /* argument to pass to above function */<br />

UINT sysScsiDmaMaxBytes, /* maximum byte count using DMA */<br />

FUNCPTR sysScsiDmaStart, /* function to start SCSI DMA transfer */<br />

FUNCPTR sysScsiDmaAbort, /* function to abort SCSI DMA transfer */<br />

int sysScsiDmaArg /* argument to pass to above functions */<br />

)<br />

{<br />

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

/* calloc the controller info structure; return NULL if unable */<br />

pSbic = (SBIC *) calloc (1, sizeof (SBIC))<br />

/*<br />

* Set up sizes of event and thread structures. Must be done before<br />

* calling "scsiCtrlInit()".<br />

*/<br />

/* fill in driver-specific routines for scsiLib interface */<br />

pSbic->scsiCtrl.scsiDevSelect = xxxDevSelect;<br />

pSbic->scsiCtrl.scsiInfoXfer = xxxInfoXfer;<br />

pSbic->scsiCtrl.scsiXferParamsQuery = xxxXferParamsQuery;<br />

pSbic->scsiCtrl.scsiXferParamsSet = (FUNCPTR)xxxXferParamsSet;<br />

/* Fill in driver specific variables for scsiLib interface */<br />

pSbic->scsiCtrl.maxBytesPerXfer = sysScsiDmaMaxBytes;<br />

328

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

Saved successfully!

Ooh no, something went wrong!