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

addresses, and so on. The information stored in the control structure is typically<br />

essential to just about every driver entry point. The DEV_OBJ structure is defined<br />

in end.h as follows:<br />

typedef struct dev_obj<br />

{<br />

char name[END_NAME_MAX]; /* device name */<br />

int unit; /* to support multiple units */<br />

char description[END_DESC_MAX]; /* text description */<br />

void* pDevice; /* pointer back to the device data. */<br />

} DEV_OBJ;<br />

name<br />

A pointer to a string of up to eight characters. This string specifies the name for<br />

this network device.<br />

pDevice<br />

A pointer to your driver’s internal control structure. To preserve the<br />

separation of the protocol and data link layers, the MUX treats the pDevice<br />

pointer as opaque. Thus, the MUX never needs know anything about your<br />

control structure. However, when calling your driver’s entry points, the MUX<br />

passes in a cookie (in all calls except the endLoad( ) call). This cookie is a<br />

pointer to the END_OBJ that you allocated in endLoad( ). Through this cookie,<br />

your entry point can get to its device control structure in<br />

pCookie.devObject.pDevice.<br />

unit<br />

This is the unit number for the particular named device. Unit numbers start at<br />

0 and increase for every device controlled by the same driver. For example, if<br />

a system has two Lance Ethernet devices (named ln) then the first one is ln0<br />

and the second is ln1. If the same system also has a DEC 21x40 Ethernet then<br />

that device (whose name is dc) is dc0.<br />

description<br />

This is a text description of the device driver. For example, the Lance Ethernet<br />

driver puts the string, “AMD 7990 Lance Ethernet Enhanced Network Driver”<br />

into this location. This string is displayed if muxShow( ) is called.<br />

Identifying the Entry Points into Your Network Driver: NET_FUNCS<br />

The MUX uses the NET_FUNCS structure to maintain a table of entry points into<br />

your END. The NET_FUNCS structure is defined as follows:<br />

286

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

Saved successfully!

Ooh no, something went wrong!