📄 smnetlib.html
字号:
<html><head><!-- /vobs/wpwr/docs/vxworks/ref/smNetLib.html - generated by refgen from smNetLib.c --> <title> smNetLib </title></head><body bgcolor="#FFFFFF"> <hr><a name="top"></a><p align=right><a href="libIndex.html"><i>VxWorks Reference Manual : Libraries</i></a></p></blockquote><h1>smNetLib</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>smNetLib</strong> - VxWorks interface to the shared memory network (backplane) driver </p></blockquote><h4>ROUTINES</h4><blockquote><p><p><b><i><a href="./smNetLib.html#smNetInit">smNetInit</a></i>( )</b> - initialize the shared memory network driver<br><b><i><a href="./smNetLib.html#smNetAttach">smNetAttach</a></i>( )</b> - attach the shared memory network interface<br><b><i><a href="./smNetLib.html#smNetInetGet">smNetInetGet</a></i>( )</b> - get an address associated with a shared memory network interface<br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p>This library implements the VxWorks-specific portions of the shared memorynetwork interface driver. It provides the interface between VxWorks andthe network driver modules (e.g., how the OS initializes and attachesthe driver, interrupt handling, etc.), as well as VxWorks-dependentsystem calls. <p>There are three user-callable routines: <b><i><a href="./smNetLib.html#smNetInit">smNetInit</a></i>( )</b>, <b><i><a href="./smNetLib.html#smNetAttach">smNetAttach</a></i>( )</b>, and <b><i><a href="./smNetLib.html#smNetInetGet">smNetInetGet</a></i>( )</b>.<p>The backplane master initializes the backplane shared memory and networkstructures by first calling <b><i><a href="./smNetLib.html#smNetInit">smNetInit</a></i>( )</b>. Once the backplane has beeninitialized, all processors can be attached to the shared memory network viathe <b><i><a href="./smNetLib.html#smNetAttach">smNetAttach</a></i>( )</b> routine. Both <b><i><a href="./smNetLib.html#smNetInit">smNetInit</a></i>( )</b> and <b><i><a href="./smNetLib.html#smNetAttach">smNetAttach</a></i>( )</b> are calledautomatically in <b>usrConfig.c</b> when backplane parameters are specified in theboot line.<p>The <b><i><a href="./smNetLib.html#smNetInetGet">smNetInetGet</a></i>( )</b> routine gets the Internet address associated with abackplane interface.<p></blockquote><h4>INCLUDE FILES</h4><blockquote><p><b>smPktLib.h</b>, <b>smUtilLib.h</b><p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./smNetLib.html#top">smNetLib</a></b>, <b><a href="./ifLib.html#top">ifLib</a></b>, if_sm, <i>VxWorks Programmer's Guide: Network</i><hr><a name="smNetInit"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>smNetInit</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>smNetInit</i>( )</strong> - initialize the shared memory network driver</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS smNetInit ( SM_ANCHOR * pAnchor, /* local addr of anchor */ char * pMem, /* local addr of shared memory */ int memSize, /* size of shared memory */ BOOL tasType, /* TRUE = hardware supports TAS */ int cpuMax, /* max numbers of cpus */ int maxPktBytes, /* size of data packets */ u_long startAddr /* beginning address */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine is called once by the backplane master. It sets up and initializes the shared memory region of the shared memory network and starts the shared memory heartbeat. <p>The <i>pAnchor</i> parameter is the local memory address by which the masterCPU accesses the shared memory anchor. <i>pMem</i> contains either the localaddress of shared memory or the value NONE (-1), which implies that sharedmemory is to be allocated dynamically. <i>memSize</i> is the size, in bytes,of the shared memory region.<p>The <i>tasType</i> parameter specifies the test-and-set operation to be used toobtain exclusive access to the shared data structures. It is preferableto use a genuine test-and-set instruction, if the hardware permits it. Inthis case, <i>tasType</i> should be <b>SM_TAS_HARD</b>. If any of the CPUs on thebackplane network do not support the test-and-set instruction, <i>tasType</i>should be <b>SM_TAS_SOFT</b>.<p>The <i>maxCpus</i> parameter specifies the maximum number of CPUs that mayuse the shared memory region.<p>The <i>maxPktBytes</i> parameter specifies the size, in bytes, of the databuffer in shared memory packets. This is the largest amount of datathat may be sent in a single packet. If this value is not an exactmultiple of 4 bytes, it will be rounded up to the next multiple of 4.<p>The <i>startAddr</i> parameter is only applicable if sequential addressing isdesired. If <i>startAddr</i> is non-zero, it specifies the starting address touse for sequential addressing on the backplane. If <i>startAddr</i> is zero,sequential addressing is disabled.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if the shared memory network cannot be initialized.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./smNetLib.html#top">smNetLib</a></b><hr><a name="smNetAttach"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>smNetAttach</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>smNetAttach</i>( )</strong> - attach the shared memory network interface</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS smNetAttach ( int unit, /* interface unit number */ SM_ANCHOR * pAnchor, /* addr of anchor */ int maxInputPkts, /* max queued packets */ int intType, /* interrupt method */ int intArg1, /* interrupt argument #1 */ int intArg2, /* interrupt argument #2 */ int intArg3 /* interrupt argument #3 */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine attaches the shared memory interface to the network. It iscalled once by each CPU on the shared memory network. The <i>unit</i> parameterspecifies the backplane unit number.<p>The <i>pAnchor</i> parameter is the local address by which the local CPU mayaccess the shared memory anchor.<p>The <i>maxInputPkts</i> parameter specifies the maximum number of incomingshared memory packets which may be queued to this CPU at one time.<p>The <i>intType</i>, <i>intArg1</i>, <i>intArg2</i>, and <i>intArg3</i> parameters allow aCPU to announce the method by which it is to be notified of input packetswhich have been queued to it.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if the shared memory interface cannot be attached.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./smNetLib.html#top">smNetLib</a></b><hr><a name="smNetInetGet"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>smNetInetGet</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>smNetInetGet</i>( )</strong> - get an address associated with a shared memory network interface</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS smNetInetGet ( char * smName, /* device name */ char * smInet, /* return inet */ int cpuNum /* cpu number */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine returns the Internet address in <i>smInet</i> for the CPUspecified by <i>cpuNum</i> on the shared memory network specified by <i>smName</i>.If <i>cpuNum</i> is NONE (-1), this routine returns information about the local(calling) CPU.<p>This routine can only be called after a call to <b><i><a href="./smNetLib.html#smNetAttach">smNetAttach</a></i>( )</b>. It willblock if the shared memory region has not yet been initialized.<p>This routine is only applicable if sequential addressing is being usedover the backplane.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if the Internet address cannot be found.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./smNetLib.html#top">smNetLib</a></b></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -