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

This section ends with a brief discussion of how VxWorks typically handles the<br />

execution of a SCSI command.<br />

I.3.1 SCSI Manager (scsiMgrLib)<br />

The SCSI manager functions as a task within VxWorks. There is one SCSI manager<br />

per SCSI controller, and it is responsible for managing all SCSI interaction between<br />

VxWorks tasks and the SCSI controller. Any number of VxWorks tasks can request<br />

services from SCSI peripheral devices. The SCSI bus is a shared critical resource<br />

which requires multitasking support and synchronization.<br />

For the sake of performance and efficiency, the SCSI manager controls all the SCSI<br />

traffic within the operating system. SCSI traffic includes requests for SCSI services<br />

by VxWorks tasks. These requests are asynchronous events from the SCSI bus and<br />

include SCSI reconnects, SCSI connection timeouts, and SCSI responses to requests<br />

by VxWorks tasks. This work flow is managed by SCSI threads, which are<br />

SCSI-library-specific abstractions. A SCSI thread is assigned to each unit of SCSI<br />

work. In other words, one SCSI thread is assigned per SCSI request.<br />

Each SCSI thread is created in the context of the calling VxWorks task. The thread<br />

is managed by the SCSI manager, while the calling VxWorks task remains blocked.<br />

When the SCSI thread completes, the VxWorks task is unblocked and the SCSI<br />

thread is deleted.<br />

A SCSI thread has its own context or state variables, which are manipulated by the<br />

SCSI libraries and the controller driver. A maximum of one SCSI thread can be<br />

executing at any one time. In addition to managing the SCSI-thread state<br />

information, the SCSI manager is responsible for scheduling these SCSI threads.<br />

When there are multiple threads in existence, the different threads can be in<br />

various states representing different requirements. A SCSI thread can represent a<br />

new request for service, a connection timeout, a completion of service, or an event<br />

from the SCSI bus. As requests for service are submitted to the SCSI manager by<br />

VxWorks tasks, the associated threads must be processed based on priority or on a<br />

first-come-first-serves basis if their priority is the same.<br />

When multiple threads are eligible for activation, the SCSI manager follows a strict<br />

hierarchy of processing. Asynchronous bus events have the highest priority and<br />

are processed before any other type of SCSI thread. The order of processing is:<br />

events, timeouts, requests, and finally responses. The SCSI manager handles any<br />

race condition that develops between activation of a request and the asynchronous<br />

occurrence of an event from the SCSI bus.<br />

322

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

Saved successfully!

Ooh no, something went wrong!