02.03.2014 Views

BSP Developer's Guide

BSP Developer's Guide

BSP Developer's Guide

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

VxWorks 5.5<br />

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

When muxDevLoad( ) loads your driver, it calls muxDevStart( ), which then calls<br />

your driver’s endStart( ) entry point.<br />

H.2.2 Your ISR Puts Work on the Network Job Queue<br />

Upon arrival of an interrupt on the network device, VxWorks invokes your<br />

driver’s previously registered interrupt service routine. Your interrupt service<br />

routine should do the minimum amount of work necessary to get the packet off the<br />

local hardware. To minimize interrupt lock-out time, your interrupt service routine<br />

should handle only those tasks that require minimal execution time, such as error<br />

or status change. Your interrupt service routine should queue all time-consuming<br />

work for processing at the task level.<br />

To queue packet-reception work for processing at the task level, your interrupt<br />

service routine must call netJobAdd( ). As input, this routine accepts a function<br />

pointer and up to five additional arguments (parameters to the function referenced<br />

by the function pointer).<br />

STATUS netJobAdd<br />

(<br />

FUNCPTR routine, /* routine to add to netTask work queue */<br />

int param1, /* first arg to added routine */<br />

int param2, /* second arg to added routine */<br />

int param3, /* third arg to added routine */<br />

int param4, /* fourth arg to added routine */<br />

int param5 /* fifth arg to added routine */<br />

)<br />

In your call to netJobAdd( ), you should specify your driver’s entry point for<br />

processing packets at the task level. The netJobAdd( ) routine then puts the<br />

function call (and arguments) on tNetTask’s work queue. VxWorks uses tNetTask<br />

to handle task-level network processing.<br />

NOTE: You can use netJobAdd( ) to queue up work other than processing for<br />

received packets.<br />

! CAUTION: Use netJobAdd( ) sparingly. The netJobRing is a finite resource that is<br />

also used by the network stack. If it overflows, this implies a general network stack<br />

corruption.<br />

272

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

Saved successfully!

Ooh no, something went wrong!