VxWorks Reference Manual : Libraries
if_sm - shared memory backplane network interface driver
smIfAttach( ) - publish the sm interface and initialize the driver and device
This module implements the VxWorks shared memory backplane network interface driver.
This driver is designed to be moderately generic, operating unmodified across the range of hosts and targets supported by VxWorks. To achieve this, the driver must be given several target-specific parameters, and some external support routines must be provided. These parameters are detailed below.
The only user-callable routine is smIfAttach( ), which publishes the sm interface and initializes the driver and device.
This driver is layered between the shared memory packet library and the network modules. The backplane driver gives CPUs residing on a common backplane the ability to communicate using IP (via shared memory).
This driver is used both under VxWorks and other host operating systems, e.g., SunOs.
This device is "software only." There is no jumpering diagram required.
- local address of anchor
- This parameter is passed to the driver by smIfAttach( ). It is the local address by which the local CPU accesses the shared memory anchor.
- maximum number of input packets
- This parameter is passed to the driver by smIfAttach( ). It specifies the maximum number of incoming shared memory packets that can be queued to this CPU at one time.
- method of notification
- These parameters are passed to the driver by smIfAttach( ). Four parameters can be used to allow a CPU to announce the method by which it is to be notified of input packets that have been queued to it.
- heartbeat frequency
- This parameter is passed to the driver by smIfAttach( ). It specifies the frequency of the shared memory anchor's heartbeat, which is expressed in terms of the number of CPU ticks on the local CPU corresponding to one heartbeat period.
- number of buffers to loan
- This parameter is passed to the driver by smIfAttach( ). When the value is non-zero, this parameter specifies the number of shared memory packets available to be loaned out.
smIfAttach( ) - publish the sm interface and initialize the driver and device
STATUS smIfAttach ( int unit, /* interface unit number */ SM_ANCHOR * pAnchor, /* local addr of anchor */ int maxInputPkts, /* max no. of input pkts */ int intType, /* method of notif. */ int intArg1, /* interrupt argument #1 */ int intArg2, /* interrupt argument #2 */ int intArg3, /* interrupt argument #3 */ int ticksPerBeat, /* heartbeat freq. */ int numLoan /* no. of buffers to loan */ )
This routine attaches an sm Ethernet interface to the network, if the interface exists. This routine makes the interface available by filling in the network interface record. The system will initialize the interface when it is ready to accept packets.
The shared memory region must have been initialized, via smPktSetup( ), prior to calling this routine (typically by an OS-specific initialization routine). The smIfAttach( ) routine can be called only once per unit number.
The pAnchor parameter is the local address by which the local CPU may access the shared memory anchor.
The maxInputPkts parameter specifies the maximum number of incoming shared memory packets which may be queued to this CPU at one time.
The intType, intArg1, intArg2, and intArg3 parameters allow a CPU to announce the method by which it is to be notified of input packets which have been queued to it.
The ticksPerBeat parameter specifies the frequency of the shared memory anchor's heartbeat. The frequency is expressed in terms of the number of CPU ticks on the local CPU corresponding to one heartbeat period.
If numLoan is non-zero, it specifies the number of shared memory packets available to be loaned out.
OK or ERROR.