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.

H<br />

Implementing a MUX-Based Network Interface Driver<br />

Within your code for the stackError( ) routine, you must have appropriate<br />

responses to the flags stored in the errCode member. Wind River reserves the<br />

lower 16 bits of errCode for its own error messages, which are as follows:<br />

END_ERR_INFO<br />

END_ERR_WARN<br />

END_ERR_RESET<br />

END_ERR_DOWN<br />

END_ERR_UP<br />

This error is information only.<br />

A non-fatal error has occurred.<br />

An error occurred that forced the device to reset<br />

itself, but the device has recovered.<br />

A fatal error occurred that forced the device to go<br />

down. The device can no longer send or receive<br />

packets.<br />

The device was down but is now up again and can<br />

receive and send packets.<br />

The upper 16 bits of the errCode member are available to user applications.<br />

Use these bits to encode whatever error messages you need to pass between<br />

drivers and protocols.<br />

pSpare<br />

Expects pointer to protocol-specific data. Originally, the protocol passed this<br />

data to the MUX when it called muxBind( ). This data is optional and<br />

protocol-specific.<br />

Shutting Down a Protocol: stackShutdownRtn( )<br />

The MUX uses stackShutdownRtn( ) to shut down a protocol. Within this routine,<br />

you must do everything necessary to shut down your protocol in an orderly<br />

manner. Your stackShutdownRtn( ) must take the following form:<br />

H<br />

void stackShutdownRtn<br />

(<br />

void* pCookie /* Returned by muxBind() call. */<br />

void* pSpare /* a void* that can be used by the protocol to get<br />

/* info on receive. This was passed to muxBind().*/<br />

)<br />

You must declare your stackShutdownRtn( ) as returning void. Thus, there is no<br />

returned function value for this routine.<br />

The parameters are:<br />

pCookie<br />

Expects the pointer returned as the function value of the muxBind( ) for this<br />

protocol. This pointer identifies the device to which the MUX has bound this<br />

protocol.<br />

309

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

Saved successfully!

Ooh no, something went wrong!