VxWorks BSP Reference : solaris

unixSio [solaris]

NAME

unixSio [solaris] - unix serial driver

ROUTINES

unixDevInit( ) - initialize a UNIX_DUSART
unixDevInit2( ) - enable interrupts
unixIntRcv( ) - handle a channel's receive-character interrupt
dummyCallback( ) - dummy callback routine

DESCRIPTION

This is the driver for the UNIX stdin/stdio-base simulated serial port.

USAGE

A UNIX_CHAN structure is used to describe each channel available.

The BSP's sysHwInit( ) routine typically calls sysSerial.c:sysSerialHwInit( ), which opens unix tty/pty devices for serial lines & initializes the UNIX_CHAN u_fd & u_pid fields before calling unixDevInit( ).

The BSP sysSerialHwInit2( ) calls unixDevInit2( ) to enable interrupts.

i.e.

#include "unixSio.h"

UNIX_CHAN myChan [NUM_TTY];
SIO_CHAN * sysSioChans[NUM_TTY];

sysSerialHwInit (void)
    {
    ...
    for (ix = 0; ix < NUM_TTY; ix++)
        {        
        if (ix > 0)     // dev 0 is unix sdtin/out/err //
            {
            UNIX_CHAN * pChan = &myChan[ix];
            sysSioChans[ix] = (SIO_CHAN *) pChan;
            pChan->u_fd = ptyXtermOpen (ptyName, &pChan->u_pid, 0);
            }
        ...
        unixDevInit (&myChan);
        }
    }

sysSerialHwInit2 (void)
    {
    ...
    for (i = 0; i < NUM_TTY; i++)
        intConnect (FD_TO_IVEC(myChan[i]->u_fd), unixInt, (int)&myChan[i]);
    ...
    }

INCLUDE FILES

unixSio.h sioLib.h


solaris : Routines

unixDevInit( )

NAME

unixDevInit( ) - initialize a UNIX_DUSART

SYNOPSIS

void unixDevInit
    (
    UNIX_CHAN * pChan
    )

DESCRIPTION

This routine initializes the driver function pointers and then resets to a quiescent state. The BSP must have already opened all the file descriptors in the structure before passing it to this routine.

RETURNS

N/A

SEE ALSO

unixSio


solaris : Routines

unixDevInit2( )

NAME

unixDevInit2( ) - enable interrupts

SYNOPSIS

void unixDevInit2
    (
    UNIX_CHAN * pChan
    )

DESCRIPTION

If called at sysHwInit2 time, this routine will enable the device to operate in interrupt mode. If this routine is not called, the device will be limited to polled mode only.

RETURNS

N/A

SEE ALSO

unixSio


solaris : Routines

unixIntRcv( )

NAME

unixIntRcv( ) - handle a channel's receive-character interrupt

SYNOPSIS

void unixIntRcv
    (
    UNIX_CHAN * pChan         /* channel generating the interrupt */
    )

DESCRIPTION

This is the receive interrupt service routine.

RETURNS

N/A

SEE ALSO

unixSio


solaris : Routines

dummyCallback( )

NAME

dummyCallback( ) - dummy callback routine

SYNOPSIS

STATUS dummyCallback (void)

DESCRIPTION

RETURNS

Returns ERROR always.

SEE ALSO

unixSio