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

Example I-2<br />

Template: Advanced Controller Driver<br />

/* xxxLib.c - XXX SCSI I/O Processor (SIOP) library */<br />

/* Copyright 1989-1996 Wind River Systems, Inc. */<br />

#include "copyright_wrs.h"<br />

/*<br />

modification history<br />

--------------------<br />

01g,19aug96,dds written<br />

*/<br />

/*<br />

DESCRIPTION<br />

This is the I/O driver for the XXX SCSI I/O Processor (SIOP).<br />

It is designed to work with scsiLib and scsi2Lib. This driver<br />

runs in conjunction with a script program for the XXX controller.<br />

These scripts use DMA transfers for all data, messages and status.<br />

This driver supports cache functions through scsi2Lib.<br />

USER-CALLABLE ROUTINES<br />

Most of the routines in this driver are accessible only through the I/O<br />

system. The following routines must be called directly: xxxCtrlCreate()<br />

to create a controller structure, and xxxCtrlInit() to initialize it.<br />

The XXX SCSI Controller's hardware registers need to be configured according<br />

to the hardware implementation. If the default configuration is not proper,<br />

the routine xxxSetHwRegister() should be used to properly configure<br />

the registers.<br />

INTERNAL<br />

This driver supports multiple initiators, disconnect/reconnect, tagged<br />

command queueing, synchronous data transfer and wide data transfer protocols.<br />

In general, the SCSI system and this driver automatically choose the<br />

best combination of these features to suit the target devices used.<br />

However, the default choices may be over-ridden by using the function<br />

"scsiTargetOptionsSet()" (see scsi2Lib).<br />

There are debug variables to trace events in the driver.<br />

scsiLib debug variable, trace event in scsiLib, xxxScsiPhase(),<br />

and xxxTransact().<br />

prints interrupt informations.<br />

INCLUDE FILES<br />

xxx.h, xxxScript.h and scsiLib.h<br />

*/<br />

#define INCLUDE_SCSI2<br />

#include "vxWorks.h"<br />

#include "memLib.h"<br />

#include "ctype.h"<br />

#include "stdlib.h"<br />

#include "string.h"<br />

#include "stdio.h"<br />

#include "logLib.h"<br />

338

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

Saved successfully!

Ooh no, something went wrong!