User guide
MOTOROLA MPC184/MPC185 Security Co-Processor Software User’s Guide 5
PRELIMINARY—SUBJECT TO CHANGE WITHOUT NOTICE
Device Driver Components
• Initialize the driver internal variables
• Initialize the ChannelAssignments table
— The device driver will maintain this structure with state information for each channel and user
request. A Mutex semaphore protects this structure so multiple tasks are prevented from
interfering with each other.
• Initialize the internal queue
— A queue that holds requests to be dispatched when channels are available. The queue will hold
up to 16 requests. The driver will reject requests when the queue is full.
• ProcessingComplete is spawned and pends on the IsrMsgQId which serves as the interface between
the interrupt service routine and this deferred task.
2.3 Request Dispatch Routine
The request dispatch routine provides the ioctl interface to the device driver. It uses the I/O control code
to identify what function is to be called and dispatches the appropriate routine to process the request.
The
ioctl function runs under the context of the end-user application. The ioctl function invokes the
driver code. The driver performs a number of tasks that include tracking requests, queuing requests when
the requested channel is unavailable, preparing descriptors, and writing the descriptor’s address to the
appropriate channel; in effect giving the security co-processor the GO command to begin processing the
request. The
ioctl function returns to the end-user application without waiting for the co-processor to
complete.
2.4 Process Request Routine
The process request routine translates the request into a sequence of one or more data packet descriptors
(DPD) and starts the operation. Dynamic requests will be queued if no channels are available. Static requests
will fail and return an error if the requested channel is not available or busy.
2.5 Interrupt Service Routine
When processing is completed in the security co-processor an interrupt is generated. The interrupt service
routine handles the interrupt and queues the result of the operation in the IsrMsgQId queue to be processed
by the ProcessingComplete task.
2.6 ProcessingComplete Task
The ProcessingComplete task completes the request outside of the interrupt service routine as a separate task
at a lower priority. This task depends on the IsrMsgQId queue and processes messages put into the queue
by the interrupt service routine. This task will determine which request is complete and notify the
corresponding calling task. It will then check the process request queue and schedule any queued requests.










