Reflective Memory
Reflective Memory
Reflective Memory
Operators Reference
Common RFM2g* Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g* Drivers
Document History Operators Reference Manual Document Number: 523-000447-000 Rev. F March 25, 2010 Waste Electrical and Electronic Equipment (WEEE) Returns
GE is registered with an approved Producer Compliance Scheme (PCS) and, subject to suitable contractual arrangements being in place, will ensure WEEE is processed in accordance with the requirements of the WEEE Directive. GE will evaluate requests to take back products purchased by our customers before August 13, 2005 on a case by case basis. A WEEE management fee may apply.
Table of Contents
List of Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 1 Application Program Interface (API) Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.1 Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11 1.2 Using the Application Program Interface. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12 1.2.1 Opening the RFM2g Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12 1.2.2 Routine Code for Use with API Function Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12 1.3 RFM2g Error Codes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .14 1.4 RFM2g API Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .16 1.5 RFM2g Opening and Closing API Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .18 1.5.1 RFM2gOpen() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .18 1.5.2 RFM2gClose() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .20 1.6 RFM2g Configuration API Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .21 1.6.1 RFM2gGetConfig() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .22 1.6.2 RFM2gUserMemory() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .23 1.6.3 RFM2gUnMapUserMemory() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .25 1.6.4 RFM2gUserMemoryBytes() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .26 1.6.5 RFM2gUnMapUserMemoryBytes() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .28 1.6.6 RFM2gNodeID() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .30 1.6.7 RFM2gBoardID() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .31 1.6.8 RFM2gSize() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .32 1.6.9 RFM2gFirst() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .33 1.6.10 RFM2gDeviceName() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .34 1.6.11 RFM2gDllVersion() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .35 1.6.12 RFM2gDriverVersion() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .36 1.6.13 RFM2gGetDMAThreshold() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .37 1.6.14 RFM2gSetDMAThreshold() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .38 1.6.15 RFM2gGetDMAByteSwap() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .40 1.6.16 RFM2gSetDMAByteSwap() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .41 1.6.17 RFM2gGetPIOByteSwap() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .42 1.6.18 RFM2gSetPIOByteSwap() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .43 1.7 RFM2g Data Transfer API Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .44 1.7.1 Data Transfer Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .44 Big Endian and Little Endian Data Conversions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .44 Using Direct Memory Access (DMA) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .45 1.7.2 RFM2gRead() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .46 1.7.3 RFM2gWrite() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .48 1.7.4 RFM2gPeek8(), RFM2gPeek16(), RFM2gPeek32() and RFM2gPeek64() . . . . . . . . . . . . . . . . . . . . . . . . . .50 1.7.5 RFM2gPoke8(), RFM2gPoke16(), RFM2gPoke32() and RFM2gPoke64() . . . . . . . . . . . . . . . . . . . . . . . . .52 1.8 RFM2g Interrupt Event API Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .54 1.8.1 RFM2gEnableEvent() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .55
Table of Contents 3
1.8.2 RFM2gDisableEvent() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .57 1.8.3 RFM2gSendEvent() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .59 1.8.4 RFM2gWaitForEvent() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .61 1.8.5 RFM2gEnableEventCallback() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .64 1.8.6 RFM2gDisableEventCallback() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .66 1.8.7 RFM2gClearEvent() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .68 1.8.8 RFM2gCancelWaitForEvent() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .70 1.8.9 RFM2gClearEventCount() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .72 1.8.10 RFM2gGetEventCount() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .74 1.9 RFM2g Utility API Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .76 1.9.1 RFM2gErrorMsg() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .77 1.9.2 RFM2gGetLed() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .78 1.9.3 RFM2gSetLed() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .79 1.9.4 RFM2gCheckRingCont() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .80 1.9.5 RFM2gGetDebugFlags() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .81 1.9.6 RFM2g SetDebugFlags() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .83 1.9.7 RFM2gGetDarkOnDark() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .85 1.9.8 RFM2gSetDarkOnDark() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .86 1.9.9 RFM2gClearOwnData() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .87 1.9.10 RFM2gGetTransmit() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .88 1.9.11 RFM2gSetTransmit() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .89 1.9.12 RFM2gGetLoopback() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .90 1.9.13 RFM2gSetLoopback() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .91 1.9.14 RFM2gGetParityEnable() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .92 1.9.15 RFM2gSetParityEnable() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .93 1.9.16 RFM2gGetMemoryOffset() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .94 1.9.17 RFM2gSetMemoryOffset() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .95 1.9.18 RFM2gGetSlidingWindow() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .96 1.9.19 RFM2gSetSlidingWindow() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .97
2.3.8 devname . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.9 disableevent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.10 disablecallback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.11 dllversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.12 driverversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.13 drvspecific . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.14 dump . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.15 enableevent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.16 enablecallback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.17 errormsg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.18 exit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.19 first . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.20 getdarkondark . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.21 getdebug . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.22 getdmabyteswap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.23 geteventcount . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.24 getled . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.25 getmemoryoffset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.26 getloopback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.27 getparityenable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.28 getpiobyteswap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.29 getslidingwindow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.30 getthreshold . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.31 gettransmit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.32 help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.33 mapuser . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.34 mapuserbytes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.35 memop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.36 nodeid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.37 peek8, peek16, peek32 and peek64 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.38 performancetest . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.39 poke8, poke16, poke32 and poke64 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.40 quit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.41 read . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.42 repeat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.43 return . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.44 send . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.45 setdarkondark . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.46 setdebug . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.47 setdmabyteswap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.48 setled . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.49 setloopback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.50 setmemoryoffset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.51 setparityenable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
106 107 108 108 109 109 110 111 112 113 113 113 114 114 114 115 115 116 116 116 116 117 117 117 118 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 135 136 136 137
Table of Contents 5
2.3.52 setpiobyteswap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.53 setslidingwindow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.54 setthreshold . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.55 settransmit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.56 size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.57 unmapuser . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.58 unmapuserbytes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.59 wait . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.60 write . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.4 Troubleshooting the rfm2g_util.c Command Line Interpreter. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.4.1 Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.1 3.2 3.3 3.4 3.5 rfm2g_sender.c. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . rfm2g_receiver.c. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . rfm2g_map.c. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . rfm2g_sender.c and rfm2g_receiver.c Example Workflow. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . rfm2g_map.c Example Workflow. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
137 138 138 139 139 140 140 141 142 143 143 144 144 145 145 147
Maintenance. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .148
6 Common RFM2g Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g Drivers
List of Tables
Table 1-1 Common RFM2g Error Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .15 Table 1-2 RFM2g API Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .16 Table 1-3 RFM2g Opening and Closing API Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .18 Table 1-4 RFM2g Configuration API Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .21 Table 1-5 RFM2g Data Transfer API Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .44 Table 1-6 RFM2g Interrupt Event API Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .54 Table 1-7 RFM2gEnableEvent() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .55 Table 1-8 RFM2gDisableEvent() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .57 Table 1-9 RFM2gWaitForEvent() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .61 Table 1-10 RFM2gEnableEventCallback() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .64 Table 1-11 RFM2gDisableEventCallback() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .66 Table 1-12 RFM2g Utility API Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .76 Table 2-1 RFM2g Driver Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
List of Tables 7
Overview
Thismanualprovidesinformationonthecommoncomponentsincludedinthe RFM2g*drivers,whichenablesyoutoaccessthefeaturesofavarietyofPCIand PMCRFM2ghardware.
Features
TheRFM2gdriverprovidesallofthenecessaryfiles,scriptsandprogramsforyou toinstall,testanduseanyofthesupportedReflectiveMemory(RFM)Interface cardsinyoursystem. TheRFM2gdriverprovidesthefollowingcommonfeatures: ApplicationProgramInterface(API)LibraryApplicationprogramsmayuse theservicesprovidedbytheRFM2gApplicationProgramInterface(API) librarytoaccessthefeaturesoftheRFM2gdevicesinaportableway.Using theAPIlibrarymakesiteasytouseadifferentmodelofRFMinterface,orto rehostyourapplicationprogramonadifferentsupportedhostplatform. SeeChapter1ApplicationProgramInterface(API)Library,page11. CommandLineInterpreterTherfm2g_util.cprogramisacommandline interpreterthatenablesausertoexercisevariousRFM2gAPIcommandsby enteringcommandsatthekeyboard.Touserfm2g_util.c,followthedirec tionsinyourdriverspecificmanual.Youcanenterhelptodisplayalistof commands.SeeChapter2rfm2g_util.cUtilityProgram,page98formore information. ExampleProgramsTheRFM2gdrivercontainstherfm2g_sender.c, rfm2g_receiver.candrfm2g_map.csampleprograms,whichprovideexam plesonhowtousethedriverandAPIwithyourapplication.SeeChapter3 RFM2gSampleApplications,page144.
8 Common RFM2g Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g Drivers
References
NOTE
For a list of the files distributed with your RFM2g driver, see your driver-specific manual.
ThefollowingisalistofreferencedocumentationrelatedtoRFM2gdrivers: VMIPCI5565*UltrahighSpeedFiberOpticReflectiveMemorywithInterrupts ProductManual,GEDocumentNumber500855565000 VMIPMC5565*UltrahighSpeedFiberOpticReflectiveMemorywithInterrupts ProductManual,GEDocumentNumber500755565000 VMIPCI5565PIORC*UltrahighSpeedFiberOpticReflectiveMemorywith InterruptsProductManual,GEDocumentNumber5009367855565000 VMIPMC5565PIORC*UltrahighSpeedFiberOpticReflectiveMemorywith InterruptsProductManual,GEDocumentNumber5009367755565000 VMIACC5595*,2Gb/sReflectiveMemoryHubAssembly,GEDocumentNum ber522805595000 VMISFTRFM2g*Specification,NetworkandSharedMemoryDriver, GEDocumentNumber820000447000 PleasecallyourGEsalesrepresentativeformoreinformation.
Overview 9
Organization
Thismanualiscomposedofthefollowingchapters: OverviewprovidesageneraldescriptionoftheRFM2g. Chapter1:ApplicationProgramInterface(API)LibrarydescribestheAPIthat comeswiththeRFM2gdevicedriverthatprovidestheapplicationdeveloperwith acommonAPIfordevelopingportableRFM2gapplicationsthatareplatform independent. Chapter2:rfm2g_util.cUtilityProgramdescribesthecommandlineinterpreter (rfm2g_util.c)thatenablestheusertoexercisevariousRFM2gcommandsby enteringcommandsatthestandardinput(usuallytheconsolekeyboard). Chapter3:RFM2gSampleApplicationscontainsinformationonthethreesample applicationprogramsdeliveredwiththeRFM2gdriverintherfm2g/samples folder. MaintenanceprovidesGEscontactinformationrelativetothecareand maintenanceoftheunit.
10 Common RFM2g Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g Drivers
NOTE
The operating system does not perform memory bounds checking if the indirect method is used. Data corruption of system memory is likely to occur if a user application increments a pointer beyond the end of valid Reflective Memory.
12 Common RFM2g Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g Drivers
withthecodeprovidedintheAPIfunctionexample.
#define DEVICE /* Place OS specific device name in quotes before this comment */ RFM2G_STATUS rfm2gTestApiCommand(void) { RFM2GHANDLE Handle; RFM2G_STATUS result; /* Open the Reflective Memory device */ result = RFM2gOpen( DEVICE, &Handle ); if( result != RFM2G_SUCCESS ) { printf( "ERROR: RFM2gOpen() failed.\n" ); printf( "ERROR MSG: %s\n", RFM2gErrorMsg(result)); return(-1); } { /* Place API command example here */ } if( result != RFM2G_SUCCESS ) { printf( "ERROR: API command returned error.\n" ); printf( "ERROR MSG: %s\n", RFM2gErrorMsg(result)); } /* Close the Reflective Memory device */ RFM2gClose( &Handle ); return(result); }
NOTE
Three sample application programs (rfm2g_sender.c, rfm2g_receiver.c and rfm2g_map.c) are delivered with the RFM2g driver that show how to use the driver and API with your application. See Chapter 3 RFM2g Sample Applications, page 144 for more information.
NOTE
Error code values are driver-specific. Use the error code name instead of the value in user applications.
14 Common RFM2g Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g Drivers
16 Common RFM2g Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g Drivers
1.5.1 RFM2gOpen()
TheRFM2gOpen()functionconnectstheapplicationprogramtotheRFM2g devicedriverandAPIlibrary.TheAPIlibrarywillopenthespecifiedRFM2g deviceandreturnahandlewhichtheprogrammustuseinallfurtherreferences totheRFM2gdevice. SeveralprogramsandexecutionthreadsmayhavethesameRFM2ginterface openatanygiventime.ThedriverandtheAPIlibraryarethreadsafe;however,it istheresponsibilityoftheapplicationprogramtoperformwhateveraccess synchronizationisneededforanydatastructuresmanagedbytheprograminthe RFM2garea.
NOTE
Because RFM2g interface device names are dynamically assigned, users who have multiple RFM2g devices in a chassis should exercise care when replacing RFM2g boards. Removing an RFM2g interface may cause the name assigned to other RFM2g boards to be changed.
Parameters
DevicePath
rh
18 Common RFM2g Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g Drivers
inthedriver.
RFM2G_LOW_MEMORY Systemrefusedrequest. RFM2G_NO_RFM2G_BOARD NoRFM2gdevicefound. RFM2G_BAD_RFM2G_BOARD_ID RFM2gdevicehasbadboard
1.5.2 RFM2gClose()
TheRFM2gClose()functionallowsanapplicationprogramtoterminateits connectionwiththeRFM2gservices.OncetheRFM2ghandleisclosed,allofthe facilitiesusingthathandlearenolongeraccessible,includingthelocalRFM2g memory,whichmaybemappedintotheapplicationprogramsvirtualmemory space. Syntax
STDRFM2GCALL RFM2gClose( RFM2GHANDLE *rh );
Parameters
rh
InitializedpreviouslywithacalltoRFM2gOpen()(I).
driver.
RFM2G_NOT_OPENDeviceisnotopen.
20 Common RFM2g Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g Drivers
1.6.1 RFM2gGetConfig()
TheRFM2gGetConfig()functionallowsanapplicationprogramtoobtainacopy oftheRFM2GCONFIGhardwareconfigurationstructurecreatedbythedevice driverduringitsinitialization. TheRFM2GCONFIGstructureisdriverspecific.Refertoyourdrivers installationmanualforstructuredefinitioninformation. Syntax
STDRFM2GCALL RFM2gGetConfig( RFM2GHANDLE rh, RFM2GCONFIG *Config );
Parameters
rh Config
HandletoopenRFM2gdevice(I). PointertoRFM2GCONFIGstructuretobefilled(O).
driver.
RFM2G_BAD_PARAMETER_2ConfigisNULL.
22 Common RFM2g Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g Drivers
1.6.2 RFM2gUserMemory()
TheRFM2gUserMemory()functionmapstheReflectiveMemoryaddressspaceto auserlevelpointer,allowingdirectaccesstoRFMmemoryviapointer dereferencing.AlltransfersusingthispointerwillusePIOandwillnotuse DMA. Syntax
STDRFM2GCALL RFM2gUserMemory( RFM2GHANDLE rh, volatile void **UserMemoryPtr, RFM2G_UINT64 Offset, RFM2G_UINT32 Pages );
Parameters
rh UserMemoryPtr
HandletoopenRFM2gdevice(I). WheretoputthepointertomappedRFM2gspace(IO).
NOTE
Offset Pages
BasebyteoffsetofRFM2gmemorytomap(I). Numberofpagestomap(I).
NOTE
Page size is system-dependent. Refer to your driver-specific manual for information on using this parameter.
inthedriver.
RFM2G_BAD_PARAMETER_2 UserMemoryPtrisNULL. RFM2G_BAD_PARAMETER_4 Pagesis0. RFM2G_MEM_NOT_MAPPED Systemmemorymapcallfailed. RFM2G_OUT_OF_RANGE Mappingwouldgobeyondendof
RFM2gmemory.
RelatedCommands RFM2gUnMapUserMemory()
24 Common RFM2g Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g Drivers
1.6.3 RFM2gUnMapUserMemory()
TheRFM2gUnMapUserMemory()functionunmapsamemoryspacemappedby RFM2gUserMemory(). Syntax
STDRFM2GCALL RFM2gUnMapUserMemory( RFM2GHANDLE rh, volatile void **UserMemoryPtr, RFM2G_UINT32 Pages );
Parameters
rh UserMemoryPtr
HandletoopenRFM2gdevice(I). PointertomappedRFM2gspace(IO).
NOTE
Pages
inthedriver.
RFM2G_BAD_PARAMETER_2 UserMemoryPtrisNULL. RFM2G_BAD_PARAMETER_3Pagesis0. RFM2G_OUT_OF_RANGE Mappingwouldgobeyondendof
/* Must be volatile */
result = RFM2gMapUserMemory(Handle, (volatile void **)&pUser, Offset, Pages); if (result == RFM2G_SUCCESS) { result = RFM2gUnMapUserMemory(Handle, (volatile void **)&pUser, Pages); } }
RelatedCommands RFM2gUserMemory()
Application Program Interface (API) Library 25
1.6.4 RFM2gUserMemoryBytes()
TheRFM2gUserMemoryBytes()functionmapstheReflectiveMemoryaddress spacetoauserlevelpointer,allowingdirectaccesstoRFMmemoryviapointer dereferencing.AlltransfersusingthispointerwillusePIOandwillnotuse DMA.ThisfunctionissimilartotheRFM2gUserMemory()exceptthatittakesthe numberforbytesinsteadofthenumberforpages.Userapplicationshould choosethisfunctionoverRFM2gUserMemory()forportabilityacrossplatforms withdifferentpagesizes. Syntax
STDRFM2GCALL RFM2gMapUserBytes( RFM2GHANDLE rh, volatile void **UserBytePtr, RFM2G_UINT64 Offset, RFM2G_UINT32 Bytes );
Parameters
rh UserMemoryPtr
HandletoopenRFM2gdevice(I). WheretoputthepointertomappedRFM2gspace(IO).
NOTE
Offset Bytes
BasebyteoffsetofRFM2gmemorytomap(I). Numberofbytestomap(I).
inthedriver.
RFM2G_BAD_PARAMETER_2 UserBytePtrisNULL. RFM2G_BAD_PARAMETER_4Bytesis0. RFM2G_MAP_NOT_ALLOWED InvalidmapOffsetandBytes
(BytessizebeyondsizeofmemoryonRFM2gdevice).
RFM2G_OUT_OF_RANGEMappingwouldgobeyondendof
RFM2gmemory.
26 Common RFM2g Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g Drivers
RelatedCommands RFM2gUnMapUserMemoryBytes()
1.6.5 RFM2gUnMapUserMemoryBytes()
TheRFM2gUnMapUserMemoryBytes()functionunmapsamemorybytespace mappedbyRFM2gUserMemoryBytes(). Syntax
STDRFM2GCALL RFM2gUnMapUserMemoryBytes( RFM2GHANDLE rh, volatile void **UserMemoryPtr, RFM2G_UINT32 Bytes );
Parameters
rh UserMemoryPtr
HandletoopenRFM2gdevice(I). PointertomappedRFM2gspace(IO).
NOTE
Bytes
inthedriver.
RFM2G_BAD_PARAMETER_2 UserMemoryPtrisNULL. RFM2G_BAD_PARAMETER_3Bytesis0. RFM2G_OUT_OF_RANGE Mappingwouldgobeyondendof
RFM2gmemory.
28 Common RFM2g Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g Drivers
RelatedCommands RFM2gUserMemoryBytes()
1.6.6 RFM2gNodeID()
TheRFM2gNodeID()functionreturnsthevalueoftheRFM2gdevicenodeID. EachRFM2gdeviceonanRFM2gnetworkisuniquelyidentifiedbyitsnodeID, whichismanuallysetbyjumpersonthedevicewhentheRFM2gnetworkis installed.ThedriverdeterminesthenodeIDwhenthedeviceisinitialized. Syntax
STDRFM2GCALL RFM2gNodeID( RFM2GHANDLE rh, RFM2G_NODE *NodeIdPtr );
Parameters
rh NodeIdPtr
HandletocurrentlyopenedRFM2gdevice(I). NodeIDofthecurrentlyopenedRFM2gdevice(O).
inthedriver.
RFM2G_BAD_PARAMETER_2NodeIdPtrisNULL.
30 Common RFM2g Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g Drivers
1.6.7 RFM2gBoardID()
TheRFM2gBoardID()functionreturnstheRFM2ginterfacemodeltype.Each RFM2gmodeltypeisuniquelyidentifiedbyanumericvalueassignedby GEandrecordedasafixedconstantinanRFM2ghardwareregister.Thedriver andsupportlibraryreadthisvaluewhenthedeviceisopened.Theapplication programusestheRFM2gBoardID()numbertoobtainthatvalue. Syntax
STDRFM2GCALL RFM2gBoardID( RFM2GHANDLE rh, RFM2G_UINT8*BoardIdPtr );
Parameters
rh BoardIdPtr
HandletocurrentlyopenedRFM2gdevice(I). BoardIDofthecurrentlyopenedRFM2gdevice(O).
inthedriver.
RFM2G_BAD_PARAMETER_2BoardIdPtrisNULL.
1.6.8 RFM2gSize()
TheRFM2gSize()functionreturnsthetotalamountofmemoryspaceavailableon theRFM2gdevice.TheapplicationprogrammayaccessRFM2gspacebetween offsetRFM2gFirst()andRFM2gSize()1. RFM2gboardsmaybeconfiguredwithavarietyofmemorysizes.Thedevice driverandAPIlibrarydeterminetheamountofmemorycontainedonanRFM2g deviceasitisopened.AnapplicationprogrammaythenuseRFM2gSize()to obtainthenumberofbytesontheboard. Syntax
STDRFM2GCALL RFM2gSize( RFM2GHANDLE rh, RFM2g_UINT32 *SizePtr );
Parameters
rh SizePtr
HandletoopenRFM2gdevice(I). PointertovariablethatisfilledwiththeRFM2gsizevalue(O).
inthedriver.
RFM2G_BAD_PARAMETER_2SizePtrisNULL.
32 Common RFM2g Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g Drivers
1.6.9 RFM2gFirst()
TheRFM2gFirst()functionreturnsthefirstRFM2goffsetavailableforusebyan applicationprogram.TheentirememoryspaceoftheRFM2gdeviceismapped intothevirtualaddressspaceoftheapplicationprogram. Syntax
STDRFM2GCALL RFM2gFirst( RFM2GHANDLE rh, RFM2G_UINT32 *FirstPtr );
Parameters
rh FirstPtr
inthedriver.
RFM2G_BAD_PARAMETER_2FirstPtrisNULL.
1.6.10 RFM2gDeviceName()
TheRFM2gDeviceName()functionreturnsanullterminatedstringcontaining thefirst64charactersofthedevicefilenameassociatedwiththegivenRFM2gfile handle. Syntax
STDRFM2GCALL RFM2gDeviceName( RFM2GHANDLE rh, char *NamePtr );
Parameters
rh NamePtr
inthedriver.
RFM2G_BAD_PARAMETER_2NamePtrisNULL.
RelatedCommands RFM2gGetConfig()
34 Common RFM2g Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g Drivers
1.6.11 RFM2gDllVersion()
TheRFM2gDllVersion()functionreturnsanASCIIstringwithwhichan applicationprogramcandeterminetheversionoftheDLLorAPIlibrary.This stringcontainstheproductionreleaselevelofthelibraryandisuniquebetween differentversionsoftheAPIlibrary. Syntax
STDRFM2GCALL RFM2gDllVersion( RFM2GHANDLE rh, char *VersionPtr );
Parameters
rh VersionPtr
inthedriver.
RFM2G_BAD_PARAMETER_2VersionPtrisNULL.
1.6.12 RFM2gDriverVersion()
TheRFM2gDriverVersion()functionreturnsanASCIIstringwithwhichan applicationprogramcandeterminetheGEproductionreleaseversionofthe underlyingRFM2gdevicedriver. Syntax
STDRFM2GCALL RFM2gDriverVersion( RFM2GHANDLE rh, char *VersionPtr );
Parameters
rh VersionPtr
inthedriver.
RFM2G_BAD_PARAMETER_2 VersionPtrisNULL.
36 Common RFM2g Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g Drivers
1.6.13 RFM2gGetDMAThreshold()
TheRFM2gGetDMAThreshold()functionreturnsthelengthofthecurrent minimumDMAI/Orequestofthedevicedriver.TheRFM2gdevicedriverwill usethebusmasterDMAfeaturepresentonsomeRFM2gdevicesifanI/Orequest qualifies(i.e.ifthesizeislargerthanorequaltotheThreshold).Oneofthe criteriaforperformingtheDMAisthattheI/Otransferbelongenoughthatthe timesavedbyperformingtheDMAoffsetstheoverheadprocessinginvolved withinitializingtheDMAitself.ThedefaultDMAthresholdisdriverdependent. RefertoyourdriverspecificmanualforthedefaultDMAthresholdvalue. Thiscommandisusefulsincetheamountofthisoverheadcanvarybetweenhost computerconfigurations.Theapplicationprogramcansetanewthresholdusing theRFM2gGetDMAThreshold()function. Syntax
STDRFM2GCALL RFM2gGetDMAThreshold( RFM2GHANDLE rh, RFM2G_UINT32 *Threshold );
Parameters
rh Threshold
inthedriver.
RFM2G_BAD_PARAMETER_2ThresholdisNULL.
1.6.14 RFM2gSetDMAThreshold()
TheRFM2gSetDMAThreshold()functionsetsthetransfersizeatwhichreadsand writeswilluseDMAtotransferdata.IfRFM2gRead()orRFM2gWrite()iscalled, DMAwillbeusedifthesizeofthedataislargerthanorequaltotheThreshold. Athresholdcanbesetperdevice. TheamountofcyclestakentosetupaDMAtransfercanincreasethetransfer timeforsmalltransfersizes.ThetransfersizeforwhichDMAsaremoreefficient thanstandardtransfersvaries,dependingonthesystem. DMAisgenerallypreferredoverthePIOmethodfortransferringdata.PIO operationsrequiretheusageoftheCPUtoprocessthetransfer,whileDMA enablestheReflectiveMemorycontrollertoaccesssystemmemorywhileleaving theCPUsresourcesunaffected.However,thebestvaluetouse(i.e.PIOvs.DMA) issystemdependent.TheRFM2gdriverperformsapproximatelyfivePCI accessestosetupandprocessaDMArequestandgeneratesaninterrupton completionoftheDMAoperation.Ingeneral,DMAisthepreferredmethodifa PIOtransferrequiresmorethansixtotenPCIcyclestocomplete. AThresholdvalueof0xFFFFFFFFspecifiesthatDMAswillneverbeusedfor datatransfer.
NOTE
The default value for the DMA Threshold is driver-dependent and should be changed only if recommended by the drivers documentation. Refer to your driver-specific manual for more information, including the default value.
Syntax
STDRFM2GCALL RFM2gSetDMAThreshold( RFM2GHANDLE rh, RFM2G_UINT32 Threshold );
Parameters
rh Threshold
HandletocurrentlyopenedRFM2gdevice(I). NewDMAthresholdvalue(I).
inthedriver.
38 Common RFM2g Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g Drivers
1.6.15 RFM2gGetDMAByteSwap()
TheRFM2gGetDMAByteSwap()functionreturnsthestateofDMAbyte swappinghardware,whichisspecifiedbytheRFM2gSetDMAByteSwap() function. Syntax
STDRFM2GCALL RFM2gGetDMAByteSwap( RFM2GHANDLE rh, RFM2G_BOOL *byteSwap )
Parameters
rh byteSwap
inthedriver.
RFM2G_BAD_PARAMETER_2byteSwapisNULL.
40 Common RFM2g Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g Drivers
1.6.16 RFM2gSetDMAByteSwap()
TheRFM2gSetDMAByteSwap()functionenablesordisablesbyteswappingDMA transferstoorfromanRFM2gdevice.Thisfunctionprovides4byteswapsonly (i.e.byteswappingbasedonsizeisnotperformedbytheRFM2gdevice).
NOTE
Syntax
DMA byte swapping may be enabled by default when the driver has been built for use on big endian systems. Refer to your driver-specific manual for the default setting of DMA byte swapping.
Parameters
rh byteSwap
1.6.17 RFM2gGetPIOByteSwap()
TheRFM2gGetPIOByteSwap()functionreturnsthestateofPIObyteswapping, whichisspecifiedusingtheRFM2gSetPIOByteSwap()function. Refertosection1.7.1 DataTransferConsiderations,page44forinformationon byteswappingandPIO. Syntax
STDRFM2GCALL RFM2gGetPIOByteSwap( RFM2GHANDLE rh, RFM2G_BOOL *byteSwap )
Parameters
rh byteSwap
inthedriver.
RFM2G_BAD_PARAMETER_2byteSwapisNULL.
42 Common RFM2g Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g Drivers
1.6.18 RFM2gSetPIOByteSwap()
TheRFM2gSetPIOByteSwap()functionenablesordisablesbyteswappingofPIO transferstoorfromanRFM2gdevice.Thisfunctionprovides4byteswaps(i.e. byteswappingbasedonsizeisnotperformedbytheRFM2gdevice). Refertosection1.7.1 DataTransferConsiderations,page44forinformationon byteswappingandPIO.
NOTE
Syntax
PIO byte swapping is enabled by default when the driver has been built for use on big endian systems. Refer to your driver-specific manual for the default setting of PIO byte swapping.
Parameters
rh byteSwap
44 Common RFM2g Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g Drivers
1.7.2 RFM2gRead()
TheRFM2gRead()functionisusedtotransferoneormorebytesfromRFM2g memorytosystemmemory. TheRFM2gdriverattemptstofulfilltheRFM2gRead()requestusingthebus masterDMAfeatureavailableontheRFM2gdevice.Thedriverwillmovethe datausingtheDMAfeatureifthelengthoftheI/Orequestisatleastaslongasthe minimumDMAthreshold.
NOTE
See section Big Endian and Little Endian Data Conversions, page 44 for information on the big endian/little endian byte-reordering process used by the RFM2g driver when accessing multibyte data. The DMA feature can be used as an alternative method for transferring data. See section Using Direct Memory Access (DMA), page 45 for more information. If byte swapping is enabled on the RFM2g device, the Offset and Length must be width aligned.
CAUTION
Syntax
An application program must not attempt to access the RFM2g contents at an offset less than that returned by the RFM2gFirst() function.
STDRFM2GCALL RFM2gRead( RFM2GHANDLE rh, RFM2G_UINT32 Offset, void *Buffer, RFM2G_UINT32 Length );
Parameters
rh Offset
Buffer Length
46 Common RFM2g Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g Drivers
inthedriver.
RFM2G_BAD_PARAMETER_3 BufferisNULL. RFM2G_BAD_PARAMETER_4Lengthisnotalignedtodata
width.
RFM2G_OUT_OF_RANGEOffsetandLengthisbeyondthe
endofmemoryonRFM2Gdevice.
RFM2G_DMA_FAILEDDMAfailed. RFM2G_UNALIGNED_OFFSETOffsetnotalignedwithdata
size.
RFM2G_READ_ERRORDatanotalignedand/orsystemerror. RFM2G_LSEEK_ERROR Failureoflseek(2)command. RFM2G_UNALIGNED_ADDRESSBufferisnotalignedtodata
1.7.3 RFM2gWrite()
TheRFM2gWrite()functiontransfersoneormoreI/Odatabuffersfromthe applicationprogramtotheRFM2gnodebeginningatthespecifiedaligned memoryoffset. IftheRFM2ginterfacesupportsthebusmasterDMAfeatureandtheI/Orequest meetscertainconstraints,theRFM2gdevicedriverwilluseDMAtoperformthe I/Otransfer.SeethediscussionfortheRFM2gRead()functionforadescriptionof theconstraintsfortheDMAtransfersupport. TheRFM2gWrite()writesoneormorebytesstartingatanoffsetinReflective Memory(i.e.allowsanapplicationprogramtooutput(write)arbitrarysizedI/O buffers).ThedriverwillmovethedatausingtheDMAfeatureifthelengthofthe I/OrequestisatleastaslongastheminimumDMAthreshold.
NOTE
See section Big Endian and Little Endian Data Conversions, page 44 for information on the big endian/little endian byte-reordering process used by the RFM2g driver when accessing multibyte data. The DMA feature can be used as an alternative method for transferring data. See section Using Direct Memory Access (DMA), page 45 for more information. If byte swapping is enabled on the RFM2g device, the Offset and Length must be width aligned.
Syntax
STDRFM2GCALL RFM2gWrite( RFM2GHANDLE rh, RFM2G_UINT32 Offset, void *Buffer, RFM2G_UINT32 Length );
Parameters
rh Offset
Buffer Length
48 Common RFM2g Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g Drivers
inthedriver.
RFM2G_BAD_PARAMETER_3BufferisNULL. RFM2G_BAD_PARAMETER_4 Lengthisnotalignedtodata
width.
RFM2G_OUT_OF_RANGEOffsetandLengthisbeyondthe
endofmemoryonRFM2Gdevice.
RFM2G_DMA_FAILED DMAfailed. RFM2G_UNALIGNED_OFFSETOffsetnotalignedwithdata
size.
RFM2G_WRITE_ERRORDatanotalignedand/orsystemerror. RFM2G_READ_ERRORDatanotalignedand/orsystemerror. RFM2G_LSEEK_ERRORFailureoflseek(2)command. RFM2G_UNALIGNED_ADDRESS Bufferisnotalignedtodata
NOTE
See section Big Endian and Little Endian Data Conversions, page 44 for information on the big endian/little endian byte-reordering process used by the RFM2g driver when accessing multibyte data.
Parameters
rh Offset Value
ReturnValues Success
RFM2G_SUCCESS
50 Common RFM2g Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g Drivers
Failure
inthedriver.
RFM2G_BAD_PARAMETER_3ValueisNULL. RFM2G_OUT_OF_RANGEOffsetisbeyondtheendofRFM2G
memory.
RFM2G_UNALIGNED_OFFSETOffsetnotalignedwithdata
NOTE
See section Big Endian and Little Endian Data Conversions, page 44 for information on the big endian/little endian byte-reordering process used by the RFM2g driver when accessing multibyte data.
Syntax
STDRFM2GCALL RFM2gPoke8( RFM2GHANDLE rh, RFM2G_UINT32 Offset, RFM2G_UINT8 Value ); STDRFM2GCALL RFM2gPoke16( RFM2GHANDLE rh, RFM2G_UINT32 Offset, RFM2G_UINT16 Value ); STDRFM2GCALL RFM2gPoke32( RFM2GHANDLE rh, RFM2G_UINT32 Offset, RFM2G_UINT32 Value ); STDRFM2GCALL RFM2gPoke64( RFM2GHANDLE rh, RFM2G_UINT32 Offset, RFM2G_UINT64 Value );
Parameters
rh Offset Value
inthedriver.
RFM2G_UNALIGNED_OFFSETOffsetnotalignedwithdata
size.
52 Common RFM2g Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g Drivers
54 Common RFM2g Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g Drivers
1.8.1 RFM2gEnableEvent()
RFM2gnetworkinterruptsarenotenabledbydefault.TheRFM2gEnableEvent() functionenablesaneventsoaninterruptcanbegeneratedonthereceivingnode. OnlyRFM2ginterrupteventslistedintheEventTypeparameterdescription(see theParametersectionbelow)maybecontrolledinthisway.Userapplicationsare notifiedofreceivedeventsbyusingtheRFM2gWaitForEvent()or RFM2gEnableEventCallback()function. ThebehaviorofRFM2gEnableEvent()varies,dependingonthefollowing scenariosregardingRFM2gEnableEvent():
Table 1-7 RFM2gEnableEvent()
Existing Condition(s) The event is disabled. The event is enabled. RFM2gEnableEvent() Behavior RFM2G_SUCCESS RFM2G_SUCCESS
Syntax
STDRFM2GCALL RFM2gEnableEvent( RFM2GHANDLE rh, RFM2GEVENTTYPE EventType );
Parameters
rh EventType
Event
EventID
RFM2GEVENT_RESET RFM2GEVENT_INTR1 RFM2GEVENT_INTR2 RFM2GEVENT_INTR3 RFM2GEVENT_INTR4 RFM2GEVENT_BAD_DATA RFM2GEVENT_RXFIFO_FULL RFM2GEVENT_ROGUE_PKT RFM2GEVENT_RXFIFO_AFULL RFM2GEVENT_SYNC_LOSS RFM2GEVENT_MEM_ WRITE_INHIBITED RFM2GEVENT_LOCAL_ MEM_PARITY_ERR
inthedriver.
RFM2G_BAD_PARAMETER_2EventTypeisinvalid. RFM2G_DRIVER_ERRORInternaldrivererror. RFM2G_ALREADY_ENABLED Thespecifiedeventisalready
56 Common RFM2g Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g Drivers
1.8.2 RFM2gDisableEvent()
TheRFM2gDisableEvent()functiondisablesthegenerationofaCPUinterrupt whenanRFM2geventisreceivedonthecurrentnode. ThebehaviorofRFM2gDisableEvent()varies,dependingonthefollowing scenariosregardingRFM2gEnableEvent(),RFM2gEnableEventCallback()and RFM2gWaitForEvent():
Table 1-8 RFM2gDisableEvent()
Existing Condition(s) The event is not enabled. The event is enabled without a pending callback or RFM2gWaitForEvent(). The event is enabled and a callback is registered. The event is enabled with a pending RFM2gWaitForEvent(). RFM2gDisableEvent() Behavior RFM2G_SUCCESS RFM2G_SUCCESS RFM2G_SUCCESS The callback is not affected. The callback will not occur until the event is enabled and received. RFM2G_SUCCESS RFM2gWaitForEvent() remains pending.
NOTE
RFM2gDisableEvent() will disable an event only if it was enabled using the same handle.
Parameters
rh EventType
EventID
RFM2GEVENT_RESET RFM2GEVENT_INTR1 RFM2GEVENT_INTR2 RFM2GEVENT_INTR3 RFM2GEVENT_INTR4 RFM2GEVENT_BAD_DATA RFM2GEVENT_RXFIFO_FULL RFM2GEVENT_ROGUE_PKT RFM2GEVENT_RXFIFO_AFULL RFM2GEVENT_SYNC_LOSS RFM2GEVENT_MEM _WRITE_INHIBITED RFM2GEVENT_LOCAL _MEM_PARITY_ERR
inthedriver.
RFM2G_BAD_PARAMETER_2EventTypeisinvalid. RFM2G_DRIVER_ERROR Internaldrivererror.
58 Common RFM2g Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g Drivers
1.8.3 RFM2gSendEvent()
TheRFM2gSendEvent()functionsendsaninterrupteventanda32bitlongword valuetoanothernode.FiveRFM2ginterrupteventtypesareavailableforan applicationprogramtouseinsignalingeventstootherRFM2gnodes. Syntax
RFM2G_STATUS RFM2gSendEvent( RFM2GHANDLE rh, RFM2G_NODE ToNode, RFM2GEVENTTYPE EventType, RFM2G_UINT32 ExtendedData );
Parameters
rh ToNode
NOTE
EventType
EventID
RFM2GEVENT_RESET RFM2GEVENT_INTR1 RFM2GEVENT_INTR2 RFM2GEVENT_INTR3 RFM2GEVENT_INTR4
ExtendedData
Userdefineddata(I).
inthedriver.
RFM2G_BAD_PARAMETER_2InvalidToNode. RFM2G_BAD_PARAMETER_3 InvalidEventType. RFM2G_DRIVER_ERRORInternaldrivererror. RFM2G_NOT_OPENDeviceisnotopen. RFM2G_NODE_ID_SELFCannotsendeventtoself.
60 Common RFM2g Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g Drivers
1.8.4 RFM2gWaitForEvent()
TheRFM2gWaitForEvent()functionallowsanapplicationprogramtodetermine thatanRFM2ginterrupteventhasbeenreceived.TheRFM2gWaitForEvent() functionblocksuntilthenextRFM2ginterrupteventoftherequestedtypehas beenreceived,thenreturns. Thespecifiedeventisdisabledifoneofthefollowingerroreventsoccurs,andthe
RFM2gEnableEvent()mustbecalledtoreenabletheinterrupt:
NOTE
RFM2gCancelWaitForEvent() is called for the event. RFM2G_SUCCESS Event received RFM2G_TIMED_OUT Event not received before timeout RFM2G_WAIT_EVENT_CANCELED User called RFM2gCancelWaitForEvent() The event is enabled and a callback is registered. RFM2G_EVENT_IN_USE
Syntax
RFM2G_STATUS RFM2gWaitForEvent( RFM2GHANDLE rh, RFM2GEVENTINFO *EventInfo );
Parameters
rh EventInfo
Thefollowingistherfm2gEventInfostructureusedbytheEventInfoparameter ofRFM2gWaitForEvent():
typedef struct rfm2gEventInfo { RFM2G_UINT32 ExtendedInfo; RFM2G_NODE NodeId; RFM2GEVENTTYPE Event; RFM2G_UINT32 Timeout; void * pDrvSpec; } RFM2GEVENTINFO;
/* /* /* /* /*
Data passed with event Source Node Event type timeout value to wait for event mSec Driver specific
*/ */ */ */ */
Therfm2gEventInfostructureparametersare:
ExtendedInfo NodeId Event
EventID
RFM2GEVENT_RESET RFM2GEVENT_INTR1 RFM2GEVENT_INTR2 RFM2GEVENT_INTR3 RFM2GEVENT_INTR4 RFM2GEVENT_BAD_DATA RFM2GEVENT_RXFIFO_FULL RFM2GEVENT_ROGUE_PKT RFM2GEVENT_RXFIFO_AFULL RFM2GEVENT_SYNC_LOSS RFM2GEVENT_MEM _WRITE_INHIBITED RFM2GEVENT_LOCAL _MEM_PARITY_ERR
Timeout
Description
Waitforeverforeventtooccur Donotwaitforeventtooccur. Numberofmillisecondsto waitforeventtooccur.
pDrvSpec
Driverspecificdatathataccompaniesanevent(I).Referto yourdriverspecificmanualformoreinformation.
62 Common RFM2g Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g Drivers
inthedriver.
RFM2G_BAD_PARAMETER_2 EventInfoisNULLor EventInfoeventhasinvalideventtype. RFM2G_EVENT_IN_USEEventisalreadybeingwaitedon. RFM2G_TIMED_OUT Timedoutwaitingforevent. RFM2G_WAIT_EVENT_CANCELED RFM2gCancelWaitForEvent()calledforthisevent. RFM2G_DRIVER_ERROR Internaldrivererror.
1.8.5 RFM2gEnableEventCallback()
TheRFM2gEnableEventCallback()functionenablestheinterruptnotificationfor oneeventononeboard. Thespecifiedeventisdisabledifoneofthefollowingerroreventsoccurs,andthe RFM2gEnableEvent()mustbecalledtoreenabletheinterrupt: ErrorEventID
RFM2GEVENT_BAD_DATA RFM2GEVENT_SYNC_LOSS
Description
BadDataInterrupt SyncLossOccurredInterrupt
NOTE
ThebehaviorofRFM2gEnableEventCallback()varies,dependingonthefollowing scenariosregardingRFM2gEnableEvent()andRFM2gWaitForEvent():
Table 1-10 RFM2gEnableEventCallback()
Existing Condition(s) The event is enabled and a callback is registered. The event is enabled without an enabled callback. The event is enabled with a pending RFM2gWaitForEvent(). RFM2gDisableEvent() Behavior RFM2G_EVENT_IN_USE RFM2G_SUCCESS RFM2G_EVENT_IN_USE
Syntax
STDRFM2GCALL RFM2gEnableEventCallback ( RFM2GHANDLE rh, RFM2GEVENTTYPE EventType, RFM2G_EVENT_FUNCPTR pEventFunc ); void rfmSampleFunc( RFM2GHANDLE rh, RFM2GEVENTINFO EventInfo )
Parameters
rh EventType
EventID
RFM2GEVENT_RESET RFM2GEVENT_INTR1 RFM2GEVENT_INTR2 RFM2GEVENT_INTR3 RFM2GEVENT_INTR4 RFM2GEVENT_BAD_DATA RFM2GEVENT_RXFIFO_FULL RFM2GEVENT_ROGUE_PKT RFM2GEVENT_RXFIFO _AFULL RFM2GEVENT_SYNC_LOSS RFM2GEVENT_MEM _WRITE_INHIBITED RFM2GEVENT_LOCAL _MEM_PARITY_ERR
pEventFunc
Theaddressofthefunctiontobecalledwhentheeventoccurs(I).
64 Common RFM2g Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g Drivers
inthedriver.
RFM2G_BAD_PARAMETER_2 InvalidEventType. RFM2G_BAD_PARAMETER_3pEventFuncisNULL. RFM2G_EVENT_IN_USE Eventisalreadybeingwaitedon. RFM2G_DRIVER_ERROR Internaldrivererror. RFM2G_WAIT_EVENT_CANCELEDWaitforeventcanceled.
1.8.6 RFM2gDisableEventCallback()
TheRFM2gDisableEventCallback()functiondisablesinterruptnotificationfor oneeventbythishandle. Thespecifiedeventisdisabledifoneofthefollowingerroreventsoccurs,andthe RFM2gEnableEvent()mustbecalledtoreenabletheinterrupt: ErrorEventID
RFM2GEVENT_BAD_DATA RFM2GEVENT_SYNC_LOSS
Description
BadDataInterrupt SyncLossOccurred Interrupt
NOTE
Syntax
STDRFM2GCALL RFM2gDisableEventCallback( RFM2GHANDLE rh, RFM2GEVENTTYPE EventType );
Parameters
rh EventType
EventID
RFM2GEVENT_RESET RFM2GEVENT_INTR1 RFM2GEVENT_INTR2 RFM2GEVENT_INTR3 RFM2GEVENT_INTR4 RFM2GEVENT_BAD_DATA RFM2GEVENT _RXFIFO_FULL RFM2GEVENT_ROGUE_PKT RFM2GEVENT_RXFIFO_AFULL RFM2GEVENT_SYNC_LOSS RFM2GEVENT_MEM _WRITE_INHIBITED RFM2GEVENT_LOCAL _MEM_PARITY_ERR
66 Common RFM2g Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g Drivers
inthedriver.
RFM2G_BAD_PARAMETER_2 InvalidEventType. RFM2G_EVENT_NOT_IN_USE Eventnotregisteredfor
callback.
RFM2G_EVENT_NOT_IN_USENocallbackwassetupforthe
1.8.7 RFM2gClearEvent()
TheRFM2gClearEvent()functionclearsanyorallpendinginterrupteventsfora specifiedevent. Syntax
STDRFM2GCALL RFM2gClearEvent( RFM2GHANDLE rh, RFM2GEVENTTYPE EventType );
Parameters
rh EventType
EventID
RFM2GEVENT_RESET RFM2GEVENT_INTR1 RFM2GEVENT_INTR2 RFM2GEVENT_INTR3 RFM2GEVENT_INTR4 RFM2GEVENT_BAD_DATA RFM2GEVENT_RXFIFO_FULL RFM2GEVENT_ROGUE_PKT
inthedriver.
RFM2G_BAD_PARAMETER_2InvalidEventType. RFM2G_DRIVER_ERROR Internaldrivererror.
68 Common RFM2g Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g Drivers
1.8.8 RFM2gCancelWaitForEvent()
TheRFM2gCancelWaitForEvent()functioncancelsanypending RFM2gWaitForEvent()callsonaneventbythishandle.Ifacallbackhasbeen registeredtothespecifiedevent,thecallbackwillbecanceled.
NOTE
Syntax
Parameters
rh EventType
Interrupt
ResetInterrupt NetworkInterrupt1 NetworkInterrupt2 NetworkInterrupt3 NetworkInterrupt4 (InitInterrupt) BadDataInterrupt RXFIFOFull Interrupt RoguePacket DetectedandRemoved Interrupt RXFIFOAlmostFull Interrupt SyncLossOccurred Interrupt MemoryWriteInhibited MemoryParityError
EventID
RFM2GEVENT_RESET RFM2GEVENT_INTR1 RFM2GEVENT_INTR2 RFM2GEVENT_INTR3 RFM2GEVENT_INTR4 RFM2GEVENT_BAD_DATA RFM2GEVENT_RXFIFO_FULL RFM2GEVENT_ROGUE_PKT
70 Common RFM2g Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g Drivers
inthedriver.
RFM2G_EVENT_NOT_IN_USENowaitispendingfortheevent. RFM2G_BAD_PARAMETER_2InvalidEventType.
1.8.9 RFM2gClearEventCount()
TheRFM2gClearEventCount()functionclearseventcountsforaspecifiedevent orallevents. Syntax
STDRFM2GCALL RFM2gClearEvent( RFM2GHANDLE rh, RFM2GEVENTTYPE EventType );
Parameters
rh EventType
Interrupt
ResetInterrupt NetworkInterrupt1 NetworkInterrupt2 NetworkInterrupt3 NetworkInterrupt4 (InitInterrupt) BadDataInterrupt RXFIFOFull Interrupt RoguePacket DetectedandRemoved Interrupt RXFIFOAlmostFull Interrupt SyncLossOccurred Interrupt MemoryWriteInhibited MemoryParityError Allinterrupts
EventID
RFM2GEVENT_RESET RFM2GEVENT_INTR1 RFM2GEVENT_INTR2 RFM2GEVENT_INTR3 RFM2GEVENT_INTR4 RFM2GEVENT_BAD_DATA RFM2GEVENT_RXFIFO_FULL RFM2GEVENT_ROGUE_PKT
inthedriver.
RFM2G_BAD_PARAMETER_2InvalidEventType. RFM2G_DRIVER_ERRORInternaldrivererror.
72 Common RFM2g Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g Drivers
1.8.10 RFM2gGetEventCount()
TheRFM2gGetEventCount()functionreturnstheeventcountforaspecified event. Syntax
STDRFM2GCALL RFM2gGetEventCount(RFM2GHANDLE rh, RFM2GEVENTTYPE EventType), RFM2G_UINT32 *Count);
Example:
RFM2G_UINT32 Count; result = RFM2gClearEvent(Handle, RFM2GEVENT_INTR1, &Count);
Parameters:
rh EventType
EventID
RFM2GEVENT_RESET RFM2GEVENT_INTR1 RFM2GEVENT_INTR2 RFM2GEVENT_INTR3 RFM2GEVENT_INTR4 RFM2GEVENT_BAD_DATA RFM2GEVENT_RXFIFO_FULL RFM2GEVENT_ROGUE_PKT
Count
Pointertowheretheeventcountofthespecifiedeventis written(O).
74 Common RFM2g Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g Drivers
inthedriver.
RFM2G_BAD_PARAMETER_2InvalidEventType. RFM2G_DRIVER_ERRORInternaldrivererror.
76 Common RFM2g Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g Drivers
1.9.1 RFM2gErrorMsg()
TheRFM2gErrorMsg()functionreturnsapointertoatextstringdescribinga runtimeerror. RuntimeerrorsaredetectedbytheAPI.Atextdescriptionoftheerrorisoutputto thescreenifdebugmodeisenabledandreturnsthestringthroughthereturn pointer. Syntax
char* RFM2gErrorMsg( RFM2G_STATUS ErrorCode );
Parameters
ErrorCode
ReturncodefromanAPIfunction(I).
Failure Example
ANULLpointer.
1.9.2 RFM2gGetLed()
TheRFM2gGetLed()functionretrievesthecurrentON/OFFstateoftheReflective MemoryboardsSTATUSLED. Syntax
STDRFM2GCALL RFM2gGetLed( RFM2GHANDLE rh, RFM2G_BOOL *Led );
Parameters
rh Led
inthedriver.
RFM2G_BAD_PARAMETER_2LedisNULL.
RelatedCommands RFM2gSetLed()
78 Common RFM2g Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g Drivers
1.9.3 RFM2gSetLed()
TheRFM2gSetLed()functionsetsthecurrentON/OFFstateoftheReflective MemoryboardsSTATUSLED. Syntax
STDRFM2GCALL RFM2gSetLed( RFM2GHANDLE rh, RFM2G_BOOL Led );
Parameters
rh Led
RelatedCommands RFM2gGetLed()
1.9.4 RFM2gCheckRingCont()
TheRFM2gCheckRingCont()functionisadiagnosticaidthatshowswhetheror notthefiberringiscontinuousthroughallnodesinthering.Nodataiswrittento theReflectiveMemorylocations. Syntax
STDRFM2GCALL RFM2gCheckRingCont( RFM2GHANDLE rh );
Parameters
rh
HandletocurrentlyopenedRFM2gdevice(I).
inthedriver.
RFM2G_LINK_TEST_FAILLinkisopen. RFM2G_DRIVER_ERRORInternaldrivererror.
80 Common RFM2g Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g Drivers
Parameters
rh Flags
Description
Reportcriticalerrors Tracedeviceprobingandsearch Traceinterruptservice Traceioctl(2)systemcalls Tracemmap(2)systemcalls Traceopen(2)systemcalls Traceclose(2)systemcalls Traceread(2)systemcalls Tracewrite(2)systemcalls Tracepeeks Tracepokes Traceread/writestrategy Traceintervaltimer Tracesubroutineentry/exit Tracesynchronizationand locking TracenonRFMinterruptservice Letsyslogdgetthemessage Traceminphyslimits
Application Program Interface (API) Library 81
inthedriver.
RFM2G_BAD_PARAMETER_2 FlagsisNULL.
RelatedCommands RFM2gSetDebugFlags()
82 Common RFM2g Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g Drivers
EachpossibleRFM2gdevicedriverdebugoutputmessageisassignedtoadebug messageclass.Thedevicedriverwillgeneratemessagesofthatclassifthe correspondingflagbitissetinthecontrolword.TheRFM2gSetDebugFlags() functionallowsanapplicationprogramtosetthatcontrolword(i.e.this commandsetsthedriversdebugflags). Applicationprogramsdonotnormallyneedtoalterthesettingofthedebug messageoutputcontrolword.Insomecases,enablingdebugflagscanseverely impacttheperformanceofthehostsystem. Operation TheRFM2gSetDebugFlags()functionspecifiesthenewdebugmessagecontrol word.Thechangeiseffectiveimmediately. Syntax
STDRFM2GCALL RFM2gSetDebugFlags( RFM2GHANDLE rh, RFM2G_UNIT32 Flags );
Parameters
rh Flags
HandletocurrentlyopenedRFM2gdevice(I). Debugflags(I).Thefollowingarepossibledebugflagstoset:
DebugFlag RFM2G_DBERROR RFM2G_DBINIT RFM2G_DBINTR RFM2G_DBIOCTL RFM2G_DBMMAP RFM2G_DBOPEN RFM2G_DBCLOSE RFM2G_DBREAD RFM2G_DBWRITE RFM2G_DBPEEK RFM2G_DBPOKE RFM2G_DBSTRAT RFM2G_DBTIMER RFM2G_DBTRACE RFM2G_DBMUTEX RFM2G_DBINTR_NOT RFM2G_DBSLOW
Description Reportcriticalerrors Tracedeviceprobingandsearch Traceinterruptservice Traceioctl(2)systemcalls Tracemmap(2)systemcalls Traceopen(2)systemcalls Traceclose(2)systemcalls Traceread(2)systemcalls Tracewrite(2)systemcalls Tracepeeks Tracepokes Traceread/writestrategy Traceintervaltimer Tracesubroutineentry/exit Tracesynchronizationand locking TracenonRFMinterruptservice Letsyslogdgetthemessage
inthedriver.
84 Common RFM2g Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g Drivers
RelatedCommands RFM2gGetDebugFlags()
1.9.7 RFM2gGetDarkOnDark()
TheRFM2gGetDarkOnDark()functionretrievesthecurrentON/OFFstateofthe ReflectiveMemoryboardsDarkOnDarkfeature. Syntax
STDRFM2GCALL RFM2gGetDarkOnDark( RFM2GHANDLE rh, RFM2G_BOOL *state );
Parameters
rh state
inthedriver.
RFM2G_BAD_PARAMETER_2StateisNULL.
RelatedCommands RFM2gSetDarkOnDark()
1.9.8 RFM2gSetDarkOnDark()
TheRFM2gSetDarkOnDark()functionsetsthecurrentON/OFFstateofthe ReflectiveMemoryboardsDarkOnDarkfeature. Syntax
STDRFM2GCALL RFM2gSetDarkOnDark( RFM2GHANDLE rh, RFM2G_BOOL state );
Parameters
rh state
RelatedCommands RFM2gGetDarkOnDark()
86 Common RFM2g Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g Drivers
1.9.9 RFM2gClearOwnData()
TheRFM2gClearOwnData()functionretrievesthecurrentON/OFFstateofthe ReflectiveMemoryboardsOwnDatabitandresetsthestateifset.Callingthis functionwillturnOFFtheOwnDataLEDifON. Syntax
STDRFM2GCALL RFM2gClearOwnData( RFM2GHANDLE rh, RFM2G_BOOL *state );
Parameters
rh state
1.9.10 RFM2gGetTransmit()
TheRFM2gGetTransmit()functionretrievesthecurrentON/OFFstateofthe ReflectiveMemoryboardsTransmitter. Syntax
STDRFM2GCALL RFM2gGetTranmit( RFM2GHANDLE rh, RFM2G_BOOL *state);
Parameters
rh state
inthedriver.
RFM2G_BAD_PARAMETER_2 StateisNULL.
RelatedCommands RFM2gSetTransmit()
88 Common RFM2g Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g Drivers
1.9.11 RFM2gSetTransmit()
TheRFM2gSetTransmit()functionsetsthecurrentON/OFFstateoftheReflective MemoryboardsTransmitter. Syntax
STDRFM2GCALL RFM2gSetTransmit( RFM2GHANDLE rh, RFM2G_BOOL state);
Parameters
rh state
RelatedCommands RFM2gGetTransmit()
1.9.12 RFM2gGetLoopback()
TheRFM2gGetLoopback()functionretrievesthecurrentON/OFFstateofthe ReflectiveMemoryboardsloopbackofthetransmitsignaltothereceivercircuit internally. Syntax
STDRFM2GCALL RFM2gGetLoopback( RFM2GHANDLE rh, RFM2G_BOOL *state );
Parameters
rh state
inthedriver.
RFM2G_BAD_PARAMETER_2StateisNULL.
RelatedCommands RFM2gSetLoopback()
90 Common RFM2g Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g Drivers
1.9.13 RFM2gSetLoopback()
TheRFM2gSetLoopback()functionsetsthecurrentON/OFFstateoftheReflective Memoryboardsloopbackofthetransmitsignaltothereceivercircuitinternally. Syntax
STDRFM2GCALL RFM2gSetLoopback( RFM2GHANDLE rh, RFM2G_BOOL state );
Parameters
rh state
RelatedCommands RFM2gSetLoopback()
1.9.14 RFM2gGetParityEnable()
TheRFM2gGetParityEnable()functionretrievesthecurrentON/OFFstateofthe ReflectiveMemoryboardsparitycheckingonallonboardmemoryaccesses. Syntax
STDRFM2GCALL RFM2gGetParityEnable( RFM2GHANDLE rh, RFM2G_BOOL *state );
Parameters
rh state
inthedriver.
RFM2G_BAD_PARAMETER_2StateisNULL.
RelatedCommands RFM2gSetParityEnable()
92 Common RFM2g Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g Drivers
1.9.15 RFM2gSetParityEnable()
TheRFM2gSetParityEnable()functionsetsthecurrentON/OFFstateofthe ReflectiveMemoryboardsparitycheckingonallonboardmemoryaccesses. Syntax
STDRFM2GCALL RFM2gSetParityEnable( RFM2GHANDLE rh, RFM2G_BOOL state );
Parameters
rh state
RelatedCommands RFM2gGetParityEnable()
1.9.16 RFM2gGetMemoryOffset()
TheRFM2gGetMemoryOffset()functionretrievestheReflectiveMemoryboards memorywindow. Syntax
STDRFM2GCALL RFM2gGetMemoryOffset( RFM2GHANDLE rh, RFM2G_MEM_OFFSETTYPE *Offset);
Parameters
rh Offset
RelatedCommands RFM2gSetMemoryOffset()
94 Common RFM2g Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g Drivers
1.9.17 RFM2gSetMemoryOffset()
TheRFM2gSetMemoryOffset()functionsetstheReflectiveMemoryboards memorywindow. Syntax
STDRFM2GCALL RFM2gSetMemoryOffset( RFM2GHANDLE rh, RFM2G_MEM_OFFSETTYPE offset);
Parameters
rh Offset
HandletoopenRFM2gdevice(I) Theoffsettothenetworkaddress(I) ValidOffsets RFM2G_MEM_OFFSET0 RFM2G_MEM_OFFSET1 RFM2G_MEM_OFFSET2 RFM2G_MEM_OFFSET3 Description 1st64MegabyteMemoryOffset 2nd64MegabyteMemoryOffset 3rd64MegabyteMemoryOffset 4th64MegabyteMemoryOffset
RelatedCommands RFM2gGetMemoryOffset()
1.9.18 RFM2gGetSlidingWindow()
TheRFM2gGetSlidingWindow()functionretrievesthebaseReflectiveMemory offsetandsizeofthecurrentslidingmemorywindow. Syntax
STDRFM2GCALL RFM2gGetSlidingWindow(RFM2GHANDLE rh, RFM2G_UINT32 *offset, RFM2G_UINT32 *size);
Parameters
rh offset size
featureisnotsupportedbytheReflectiveMemoryboards firmware.
RFM2G_BAD_PARAMETER_1ifthehandleisNULL RFM2G_BAD_PARAMETER_2iftheoffsetisNULL RFM2G_OS_ERRORifregisteraccessesfail
RelatedCommands RFM2gSetSlidingWindow()
96 Common RFM2g Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g Drivers
1.9.19 RFM2gSetSlidingWindow()
TheRFM2gSetSlidingWindow()functionsetsthebaseReflectiveMemoryoffset oftheslidingmemorywindow.Thesizeoftheslidingwindowissetwith switchesorjumpersontheReflectiveMemoryboard.Theavailablewindowsizes are2MByte,16MByte,64MByte,andthetotalmemorysize.Theoffsetofthe slidingwindowmustbeamultipleofthesizeoftheslidingwindow. Syntax
STDRFM2GCALL RFM2gSetSlidingWindow(RFM2GHANDLE rh, RFM2G_UINT32 offset);
Parameters
rh offset
HandletoopenRFM2gdevice(I) Offsetoftheslidingmemorywindow(I)
windowsize.
RFM2G_OUT_OF_RANGEiftheoffsetandwindowsizeexceed
theReflectiveMemoryboardsmemorysize.
RFM2G_OS_ERRORifregisteraccessesfail RFM2G_DRIVER_ERRORifthedriverreturnsaninvalidwindow
RelatedCommands RFM2gGetSlidingWindow()
onlythefirsttwolettersneedstobetyped:
de
98 Common RFM2g Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g Drivers
producesthismessage:
d Ambiguous command 'd'. This could be devname disableevent disablecallback dllversion driverversion
2. TypeanRFM2gdevicenumberandpress<ENTER>.
NOTE
Refer to your driver-specific manual for the correct RFM2g device number to use.
Apromptdisplaysthatincludesthedevicenumber.Forexample,ifyou entered0:
UTIL0 >
3. ViewthecontentsofRFM2gmemoryatoffset0x0byentering:
peek8 0x0
4. Observetheoutput. 5. Exitthecommandlineinterpreterprogrambyentering:
quit
Thefollowingpromptdisplays:
Exit? (y/n):
6. Enterytoconfirm.
100 Common RFM2g Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g Drivers
102 Common RFM2g Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g Drivers
2.3.1 boardid
TheboardidcommandreturnstheRFM2ginterfacemodeltype.EachRFM2g interfacemodeltypeisuniquelyidentifiedbyanumericvalueassignedby GEandrecordedasafixedconstantinanRFM2ghardwareregister.Thedriver andsupportlibraryreadthisvaluewhenthedeviceisopened.Theutilitycalls RFM2gBoardID() toobtaintheRFM2gboardID. Syntax
boardid
Example
UTIL0 > boardid Board ID UTIL0 > 0x65 (VMIPCI-5565)
2.3.2 cancelwait
Thecancelwaitcommandcancelsanypendingcallsonanevent.Ifacallbackhas beenregisteredtothespecifiedevent,thecallbackwillbecanceled.Theutility calls RFM2gCancelWaitForEvent() tocancelthependingcalls. Syntax
cancelwait event
Parameters
event
EventID
0 1 2 3 4 5 6 7 8 9 10 11 12
Example
UTIL0 > cancelwait 1 RFM2gWaitForEvent has been canceled for the "NETWORK INT 1" event. UTIL0 >
2.3.3 checkring
Thecheckringcommandisadiagnosticaidthatshowswhetherornotthefiber ringiscontinuousthroughallnodesinthering.Nodataiswrittentothe ReflectiveMemorylocations.TheutilitycallsRFM2gCheckRingCont()toobtain theRFM2gringstatus. Syntax
checkring
Example
UTIL0 > checkring The Reflective Memory link is intact UTIL0 >
2.3.4 clearevent
Thecleareventcommandclearsallpendinginterrupteventsforaspecifiedevent. TheutilitycallsRFM2gClearEvent()function. Syntax
clearevent event
Parameters
event
TheeventFIFOtoclear(I),whichisoneofthefollowing: NumberEventtoClear
0RESET 1NETWORKINT1 2NETWORKINT2 3NETWORKINT3 4NETWORKINT4 5BADDATA 6FIFOFULL 7ROGUEPACKET 8RXFIFOALMOSTFULL 9SYNCLOSS 10MEMWRITEINHIBITED 11LOCALMEMPARITYERROR 12ALLEVENTS
Example
UTIL0 > clearevent 0 The "RESET" interrupt event was flushed. UTIL0 >
104 Common RFM2g Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g Drivers
2.3.5 cleareventcount
Thecleareventcountcommandclearseventcountsforaspecifiedeventorall events.Theutilitycalls RFM2gClearEventCount()function. Syntax
cleareventcount event
Parameters
event
Whereeventisoneofthefollowinginterruptsevents[012]: NumberEventtoClear
0RESET 1NETWORKINT1 2NETWORKINT2 3NETWORKINT3 4NETWORKINT4 5BADDATA 6RXFIFOFULL 7ROGUEPACKET 8RXFIFOALMOSTFULL 9SYNCLOSS 10MEMWRITEINHIBITED 11LOCALMEMPARITYERROR 12ALLEVENTS
Example
Please enter device Number: 0 UTIL0 > cleareventcount 0 The "RESET" interrupt event count cleared. UTIL0 >
2.3.6 clearowndata
TheclearowndatacommandturnstheReflectiveMemoryboardsOwnDataLED OFF.TheutilitycallsRFM2gClearOwnData() function. Syntax
clearowndata
Example
UTIL0 > cleareventcount The Reflective Memory boards Own Data LED was turned off. UTIL0 >
2.3.7 config
TheconfigcommandwilldisplaythevaluesofmembersintheRFM2GCONFIG structure.Theutilitycalls RFM2gGetConfig() toobtaintheRFM2GCONFIG structure. Syntax
config
Example
UTIL0 > config Driver Part Number Driver Version Device Name Board Instance Board ID Node ID Installed Memory Board Revision PLX Revision UTIL0 > "VMISFT-RFM2G-ABC-037" "RELEASE 2.00" "RFM2G_0" 0 0x65 0x01 134217728d (0x08000000) 0x04 0xAD
2.3.8 devname
Thedevnamecommanddisplaysastringcontainingthefirst64charactersofthe devicenameassociatedwithaRFM2gfilehandle.Theutilitycalls RFM2gDeviceName() toobtaintheRFM2gdevicename. Syntax
devname
Example
UTIL0 > devname Device Name: UTIL0 > "rfm2g_0
106 Common RFM2g Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g Drivers
2.3.9 disableevent
ThedisableeventcommanddisablesthereceptionofanRFM2gevent.Theutility callsRFM2gDisableEvent()todisabletheevent. Syntax
disableevent event
Parameters
event
EventID
0 1 2 3 4 5 6 7 8 9 10 11
Example
UTIL0 > disableevent 0 Interrupt event "RESET" is disabled. UTIL0 >
2.3.10 disablecallback
Thedisablecallbackcommanddisableseventnotificationforaspecifiedevent. TheutilitycallsRFM2gDisableEventCallback()todisableeventnotification. Syntax
disablecallback event
Parameters
event
EventID
0 1 2 3 4 5 6 7 8 9 10 11
Example
UTIL0 > disableevent 1 Interrupt event "NETWORK INT 1" is disabled. UTIL0 >
2.3.11 dllversion
ThedllversioncommanddisplaysanASCIIstringshowingtheversionofthe DLLorAPIlibrary.Thisstringcontainstheproductionreleaselevelofthelibrary andisuniquebetweendifferentversionsoftheAPIlibrary.Theutilitycalls RFM2gDllVersion() toreturnthelibraryversion. Syntax
dllversion
Example
UTIL0 > dllversion Dll Version: UTIL0 > "R01.00"
108 Common RFM2g Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g Drivers
2.3.12 driverversion
ThedriverversioncommanddisplaysanASCIIstringshowingtheGE productionreleaseversionoftheunderlyingRFM2gdevicedriver.Theutility callsRFM2gDriverVersion() toreturnthedriverversion. Syntax
driverversion
Example
UTIL0 > driverversion Driver Version: UTIL0 > "R01.00"
2.3.13 drvspecific
Thedrvspecificcommandenablestheuseofthedriverspecificsubmenu commandsprovidedinadditiontothecommoncommandsdiscussedinthis chapter.Refertoyourdriverspecificmanualforinformationoncommands specifictoyourRFM2gdriver. Syntax
drvspecific
Examples Toaccessdriverspecificcommands:
UTIL0 > drvspecific Welcome to the driver specific menu UTILDRVSPEC0 >
Todisplayalistofdriverspecificcommands:
UTILDRVSPEC0 > help COMMAND PARAMETERS --------------------------------------------------help [command] repeat [-p] count cmd [arg...] return UTILDRVSPEC0 >
Toexitthedriverspecificcommands:
UTILDRVSPEC0 > return Welcome to the main menu UTIL0 >
2.3.14 dump
ThedumpcommandenablestheusertopeekanddisplayanareaofReflective Memory.Thisutilitycalls RFM2gPeek8(), RFM2gPeek16(), RFM2gPeek32()or RFM2gPeek64().
NOTE
See section Big Endian and Little Endian Data Conversions, page 44 for information on the big endian/little endian byte-reordering process used by the RFM2g driver when accessing multibyte data.
Syntax
dump offset width length
Parameters
offset
WidthalignedoffsetinReflectiveMemoryatwhichtobegin thepeekanddisplay(I).Validoffsetvaluesare0x0to 0x3FFFFFFfor64MBcards,0x0to0x7FFFFFFfor128MBcards or0x0to0x0FFFFFFfor256MBcards. Indicatesaccesswidthinbits,whichisoneofthefollowing(I): Value 1 2 4 8 Description 8bitbyte 16bitword 32bitlongword 64bitlongword
width
length
Numberofwidthunitstopeekanddisplay(I),whichis determinedusingtheformula[buffersize]/width.For example,thelengthofabuffersizeof1024in32bitlongwords is256(1024/4=256). WidthBit bytes words 32bitlongword 64bitlong MaximumLength(Dec/Hex) for128MBCards 134217728(0x8000000) 67108864(0x4000000) 33554432(0x2000000) 16777216(0x1000000)
Example
UTIL0 > dump 0 8 4 0 1 0x00000000:0123456789ABCDEF 0123456789ABCDEF|.#Eg.#Eg ........| 0x00000010:0123456789ABCDEF 0123456789ABCDEF|.#Eg.#Eg ........| UTIL0 >
110 Common RFM2g Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g Drivers
2.3.15 enableevent
RFM2geventinterruptsarenotenabledbydefault.Theenableeventcommand enablesaspecificRFMeventsoasysteminterruptcanbegeneratedonthe receivingnode.TheutilitycallsRFM2gEnableEvent()toenabletheRFMevent. Syntax
enableevent event
Parameters
event
EventID
0 1 2 3 4 5 6 7 8 9 10 11
Example
UTIL0 > enableevent 0 Interrupt event "RESET" is enabled. UTIL0 >
2.3.16 enablecallback
Theenablecallbackcommandenablestheinterruptnotificationforoneeventon oneboard. Amessageisreturnedtotheconsolewindoweachtimeaneventcallsuccessfully occursusingthiscommand.Forexample,iffourcallbackshavebeenpreviously performedandanewcallbackismadefromRFM2GEVENT_INTR3,the followingdisplaysintheconsolewindow:
EventCallback: Counter = 5 node 2 Received RFM2GEVENT_INTR3 interrupt from node 0
Extendedinformationforavaluecanalsobedisplayed.Forexample:
Asynchronous Event Notification has been enabled for the "NETWORK INT 1" event.
Parameters
event
Specifieswhichinterruptnotificationtoenable(I).Interrupts correlatetothefollowingeventIDs:
Interrupt
ResetInterrupt NetworkInterrupt1 NetworkInterrupt2 NetworkInterrupt3 NetworkInterrupt4(InitInterrupt) BadDataInterrupt RXFIFOFullInterrupt RoguePacketDetectedandRemoved RXRIFOAlmostFull SYNCLoss MemWriteInhibited LocalMemParityError
EventID
0 1 2 3 4 5 6 7 8 9 10 11
Example
UTIL0 > enablecallback 1 Asynchronous Event Notification has been enabled for the "NETWORK INT 1" event. UTIL0 >
112 Common RFM2g Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g Drivers
2.3.17 errormsg
Theerrormsgcommandprintsatextstringdescribingaruntimeerror. RuntimeerrorsarereturnedbytheAPIfunctions.Theutilitycalls
RFM2gErrorMsg()toobtaintheerrorcodepointer.
Syntax
errormsg ErrorCode
Parameters
ErrorCode
ReturncodefromanAPIfunction(I).
Example
UTIL0 > errormsg 0 ErrorCode = 0, Msg = No current error UTIL0 >
2.3.18 exit
Theexitcommandterminatesthecommandlineinterpreterprogram. Syntax
exit
Example
UTIL0 > exit Exit? (y/n):y
2.3.19 first
ThefirstcommanddisplaysthefirstRFM2goffsetavailableforusebyan applicationprogram.TheutilitycallsRFM2gFirst() toreturnthefirstavailable RFM2goffset. Syntax
first
Example
UTIL0 > first First 0x00000000
2.3.20 getdarkondark
ThegetdarkondarkcommandreturnsthestateoftheRFM2gDarkonDark feature.TheutilitycallsRFM2gGetDarkOnDark()toretrievethestateoftheDark onDarkfeature. Syntax
getdarkondark
Example
Please enter device number: 0 UTIL0 > getdarkondark The Reflective Memory boards Dark On Dark feature is turned OFF. UTIL0 >
Example
UTIL0 > getdebug Current Debug Flags: 0x00000000 UTIL0 >
2.3.22 getdmabyteswap
ThegetdmabyteswapcommandreturnsthestateoftheDMAbyteswapping hardware.TheutilitycallsRFM2gGetDMAByteSwap()toreturntheDMAbyte swappingstate. Syntax
getdmabyteswap
Example
UTIL0 > getdmabyteswap The Reflective Memory board's DMA Byte Swap is ON. UTIL0 >
114 Common RFM2g Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g Drivers
2.3.23 geteventcount
Thegeteventcountcommanddisplaysthecurrenteventcountforthespecified eventorallevents.TheutilitycallsRFM2gGetEventCount()toretrieveevent countforthespecifiedeventorallevents. Syntax
geteventcount
Parameters
event
Whereeventisoneofthefollowinginterruptevents[012]:
Interrupt
Reset NetworkInterrupt1 NetworkInterrupt2 NetworkInterrupt3 NetworkInterrupt4(InitInterrupt) BadDataInterrupt RXFIFOFullInterrupt RoguePacketDetectedandRemoved RXRIFOAlmostFull SYNCLoss MemWriteInhibited LocalMemParityError AllEvents
EventID
0 1 2 3 4 5 6 7 8 9 10 11 12
Example
UTIL0 > geteventcount 1 The event count for Network INT 1 is 0 UTIL0 >
2.3.24 getled
ThegetledcommanddisplaysthecurrentON/OFFstateoftheReflectiveMemory boardsSTATUSLED.TheutilitycallsRFM2gGetLed() toretrievetheSTATUS LEDstate. EveryRFM2ginterfaceboardhasaSTATUSLEDwhichisturnedONwhenever theRFM2gdeviceisresetandturnedOFFbytheRFM2gdevicedriverduring initialization.WhentheRFM2gdevicedriverisunloaded,theSTATUSLEDis turnedONagain. Syntax
getled
Example
UTIL0 > getled The Reflective Memory board's Status LED is OFF. UTIL0 >
2.3.25 getmemoryoffset
Thegetmemoryoffsetcommanddisplaysthenetworkmemoryoffsetofthe ReflectiveMemoryboard.TheutilitycallsRFM2gGetMemoryOffset()toretrieve thenetworkmemoryoffset. Syntax
getmemoryoffset
Example
UTIL0 > getmemoryoffset The Reflective Memory board's memory offset is 0x00000000. UTIL0 >
2.3.26 getloopback
ThegetloopbackcommanddisplaysthestateoftheRFM2Gtransmitloopback hardware.TheutilitycallsRFM2gGetLoopback()toreturnthetransmitloopback state. Syntax
getloopback
Example
UTIL0 > getloopback The Reflective Memory boards transmit loopback is Off. UTIL0 >
2.3.27 getparityenable
ThegetparityenablecommanddisplaysthestateoftheRFM2gsparityenable. TheutilitycallsRFM2gGetParityEnable()todisplaytheparityenablestate. Syntax
getparityenable
Example
UTIL0 > getparityenable The Reflective Memory boards parity enable is Off. UTIL0 >
2.3.28 getpiobyteswap
ThegetpiobyteswapcommanddisplaysthestateofPIObyteswapping hardware.Theutilitycalls RFM2gGetPIOByteSwap()toreturnthePIObyte swappingstate. Syntax
getpiobyteswap
Example
UTIL0 > getpiobyteswap The Reflective Memory board's PIO Byte Swap is ON. UTIL0 >
116 Common RFM2g Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g Drivers
2.3.29 getslidingwindow
Thegetslidingwindowcommanddisplaystheoffsetandsizeofthecurrent slidingmemorywindow.TheutilitycallsRFM2gGetSlidingWindow()toretrieve theinformation. Syntax
getslidingwindow
Example
UTIL0 > getslidingwindow The 2 MByte Sliding Window begins at offset 0x00400000. UTIL0 >
2.3.30 getthreshold
ThegetthresholdcommanddisplaysthevalueofthecurrentDMAthreshold.The RFM2gdevicedriverwillusethebusmasterDMAfeaturepresentonsome RFM2gdevicesifanI/Orequestqualifies(i.e.ifthesizeislargerthanorequalto theThreshold).OneofthecriteriaforperformingtheDMAisthattheI/O transferbelongenoughthatthetimesavedbyperformingtheDMAoffsetsthe overheadprocessinginvolvedwiththeDMAitself.ThedefaultDMAthresholdis driverdependent.RefertoyourdriverspecificmanualforthedefaultDMA thresholdvalue. Thiscommandisusefulsincetheamountofthisoverheadcanvarybetweenhost computerconfigurations.Theusercansetanewthresholdusingthesetthreshold command.TheutilitycallsRFM2gGetDMAThreshold() toreturnthecurrent DMAthresholdvalue. Syntax
getthreshold
Example
UTIL0 > getthreshold Current DMA Threshold: "32" UTIL0 >
2.3.31 gettransmit
ThegettransmitcommanddisplaysstatusoftheReflectiveMemoryboards transmitter.TheutilitycallsRFM2gGetTransmit()todisplaythestateofthe ReflectiveMemoryboardstransmitter. Syntax
gettransmit
Example
UTIL0 > gettransmit The Reflective Memory boards Transmitter is ON UTIL0 >
2.3.32 help
Thehelpcommandliststhenameofeachdefinedcommandandashort descriptionofit.Thiscommandcanalsobeusedtoshowdetailedusage informationforaspecificrfm2g_util.ccommand. Syntax
help command
Parameters
command
118 Common RFM2g Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g Drivers
Examples
UTIL0 > help setled setled: Set the current ON/OFF state of the Reflective Memory board's Status LED Usage: setled state "state" is one of the following (0-1): 0 for OFF 1 for ON UTIL0 > help COMMAND PARAMETERS --------------------------------------------------boardid cancelwait event checkring clearevent event cleareventcount event clearowndata config devname disableevent event disablecallback event dllversion driverversion drvspecific dump offset width length enableevent event enablecallback event
Press ENTER for more commands ... COMMAND PARAMETERS --------------------------------------------------errormsg ErrorCode exit first getdarkondark getdebug getdmabyteswap geteventcount event getled getmemoryoffset getloopback getparityenable getpiobyteswap getthreshold gettransmit help [command] mapuser offset pages
Press ENTER for more commands ... COMMAND PARAMETERS --------------------------------------------------mapuserbytes offset bytes memop pattern offset width length verify float patterntype nodeid peek8 offset peek16 offset peek32 offset peek64 offset performancetest poke8 value offset poke16 value offset poke32 value offset poke64 value offset quit read offset width length display repeat [-p] count cmd [arg...] send event tonode [ext_data] Press ENTER for more commands ... COMMAND PARAMETERS --------------------------------------------------setdarkondark state setdebug flag setdmabyteswap state setled state setloopback state setmemoryoffset offset setparityenable state setpiobyteswap state setthreshold value settransmit state size unmapuser UserMemoryPtr pages unmapuserbytes UserMemoryPtr bytes wait event timeout write value offset width length UTIL0 >
120 Common RFM2g Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g Drivers
2.3.33 mapuser
ThemapusercommandallowstheusertomapRFMmemorypagestotheuser space. TheutilitycallsRFM2gUserMemory() tomapRFM2gmemory.Refertodriver specificmanualforadditionalfunctionality.
NOTE
Syntax
When using the RFM2g-DRV-LNX Linux version of the driver, the mapped area must be reserved by booting Linux with the Linux mem command.
Parameters
offset
pages
Examples Thefollowingexampledisplaysthevaluesofthemappedregion:
UTIL0 > mapuser mapuser: Get Set the User buffer offset and pages Usage: mapuser offset pages "offset" is the beginning offset to map. "pages" is the number of pages of memory to map. UTIL0 >
Thefollowingexamplemapsabufferthatbeginsatoffset0andis100system pageslongandLinuxwasbootedwiththememsettingmem=63M:
UTIL0 > mapuser 0 100 RFM2gUserMemory assigned UserMemoryPtr = 0x50000000 UTIL0 >
2.3.34 mapuserbytes
ThemapuserbytescommandallowstheusertomapRFMmemorytotheuser space. Theutilitycalls RFM2gMapUserBytes()tomapRFM2gmemorybytes.Referto driverspecificmanualforadditionalfunctionality. Syntax
mapuserbytes offset bytes
Parameters
offset
bytes
Examples Thefollowingexampledisplaysthevaluesofthemappedregion:
UTIL0 > mapuserbytes mapuserbytes: Get Set the User buffer offset and pages Usage: mapuserbytes offset bytes "offset" is the beginning offset to map. "bytes" is the number of bytes of memory to map. UTIL0 >
Thefollowingexamplemapsabufferthatbeginsatoffset0andis100system passeslongandLinuxwasbootedwiththememsettingmem=63M:
UTIL0 > mapuserbytes 0 0x64000 RFM2gUserMemoryByte assigned UserMemoryPtr = 0x50000000 UTIL0 >
122 Common RFM2g Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g Drivers
2.3.35 memop
ThememopcommandallowstheusertofillorverifyanareaofReflective Memory.ThisutilitycallsRFM2gPoke8(), RFM2gPoke16(), RFM2gPoke32() or RFM2gPoke64()tofillthememory. Syntax
memop pattern offset width length verify float patterntype
Parameters
pattern offset
width
Value 1 2 4 8
length
Numberofwidthunitstowriteorverify(I),whichis determinedusingtheformula[buffersize]/width.For example,thelengthofabuffersizeof1024in32bitlongwords is256(1024/4=256). WidthBit bytes words 32bitlongword 64bitlong MaximumLength(Dec/Hex) for128MBCards 134217728(0x8000000) 67108864(0x4000000) 33554432(0x2000000) 16777216(0x1000000)
verify float
Writes(0)orverifies(1)thepatterninReflectiveMemory. Specifieswhetherthepatternis(1)orisnot(0)afloatingpoint value. Specifiesthepatterntype,whichisoneofthefollowing(I): Type 0 1 2 3 Description Patternforfixeddata Patternforincrementingaddress Patternforincrementingtransferscount Patternforinvertedincrementing address
patterntype
2.3.36 nodeid
ThenodeidcommanddisplaysthevalueoftheRFM2gdevicenodeID.Each RFM2gdeviceonaRFM2gnetworkisuniquelyidentifiedbyitsnodeID,whichis manuallysetbyswitchesonthedevicewhentheRFM2gnetworkisinstalled.The utilitycallsRFM2gNodeID()toreturntheRFM2gdevicenodeID. Syntax
nodeid
Example
UTIL0 > nodeId Node ID UTIL0 > 0x01
124 Common RFM2g Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g Drivers
NOTE
See the section Big Endian and Little Endian Data Conversions, page 44 for information on the big endian/little endian byte-reordering process used by the RFM2g driver when accessing multibyte data.
Syntax
peek8 offset peek16 offset peek32 offset peek64 offset
Parameters
offset
OffsetinReflectiveMemoryfromwhichtoread(I).
Example(peek8)
UTIL0 > peek8 0 Data: 0x78 Read from Offset: 0x00000000 UTIL0 >
Example(peek16)
UTIL0 > peek16 0 Data: 0x5678 Read from Offset: 0x00000000 UTIL0 >
Example(peek32)
UTIL0 > peek32 0 Data: 0x12345678 UTIL0 > Read from Offset: 0x00000000
Example(peek64)
UTIL0 > peek64 0 Data: 0x123456789ABCDEF UTIL0 > Read from Offset: 0x00000000
2.3.38 performancetest
Theperformancetestcommandusesthe RFM2gRead() andRFM2gWrite()API functionstodisplaythespeedofreadsandwritesperformedonyoursystem. Syntax
performancetest
Example
NOTE
The numbers in the following example are for illustration purposes only. Your actual system performance will vary.
UTIL0 > performancetest GE RFM2g Performance Test (DMA Threshold is 32) --------------------------------------------------Bytes Read IOps Read MBps Write IOps 4 277760 1.1 900823 8 456448 3.5 1254411 12 343536 3.9 1197772 16 275421 4.2 900820 20 229826 4.4 724569 [...] 1048576 245 245.5 142 1310720 196 245.6 113 1572864 163 245.3 94 1835008 140 245.9 81 2097152 122 245.0 71 UTIL0 >
Write MBps 3.4 9.6 13.7 13.7 13.8 142.0 141.9 141.8 141.8 142.0
126 Common RFM2g Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g Drivers
NOTE
See section Big Endian and Little Endian Data Conversions, page 44 for information on the big endian/little endian byte-reordering process used by the RFM2g driver when accessing multibyte data.
Syntax
poke8 value offset poke16 value offset poke32 value offset poke64 value offset
Parameters
value offset
Valuewrittentooffset(I).
Example(poke8)
UTIL0 > poke8 255 0 Data: 0xFF Written to Offset: 0x00000000 UTIL0 >
Example(poke16)
UTIL0 > poke16 65535 0 Data: 0xFFFF Written to Offset: 0x00000000 UTIL0 >
Example(poke32)
UTIL0 > poke32 4294967295 0 Data: 0xFFFFFFFF Written to Offset: 0x00000000 UTIL0 >
Example(poke64)
UTIL0 > poke64 0x123456789ABCDEF 0 Data: 0x123456789ABCDEF Written to Offset: 0x00000000 UTIL0 >
2.3.40 quit
Thequitcommandterminatesthecommandlineinterpreter. Syntax
quit
Example
UTIL0 > quit Exit? (y/n): UTIL0 > y C: >
128 Common RFM2g Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g Drivers
2.3.41 read
ThereadcommandreadsdatafromtheRFM2gnodetosystemmemory.Once transferred,thedataisdisplayed.TheutilitycallsRFM2gRead()toreaddata buffers.IfDMAthresholdandotherconditionsaremet,DMAwillbeused; otherwise,PIOwillbeused.
NOTE
See section Big Endian and Little Endian Data Conversions, page 44 for information on the big endian/little endian byte-reordering process used by the RFM2g driver when accessing multibyte data. If byte swapping is enabled on the RFM2g device, offset and length must be width aligned.
Syntax
read offset width length display
Parameters
offset
OffsetinReflectiveMemoryatwhichtobegintheread(I). Validoffsetvaluesare0x0to0x3FFFFFFfor64MBcards,and 0x0to0x7FFFFFFfor128MBcards. Indicatesaccesswidthinbits,whichisoneofthefollowing(I): Value 1 2 4 8 Description 8bitbyte 16bitword 32bitlongword 64bitlongword
width
length
Numberofwidthunitstodisplay(I),whichisdetermined usingtheformula[buffersize]/width.Forexample,thelength ofabuffersizeof1024in32bitlongwordsis256(1024/4= 256). WidthBit bytes words 32bitlongword 64bitlong MaximumLength(Dec/Hex) for128MBCards 134217728(0x8000000) 67108864(0x4000000) 33554432(0x2000000) 16777216(0x1000000)
display
Displayreaddatatotheoutputdevice(0=donotdisplay; 1=displayinformation(default)).
Example
UTIL0 >read 0 1 0x40 0 0x00000000: 00 0x00000010: 00 0x00000020: 00 0x00000030: 00 1 00 00 00 00 2 00 00 00 00 3 00 00 00 00 4 00 00 00 00 5 00 00 00 00 6 00 00 00 00 7 00 00 00 00 8 00 00 00 00 9 00 00 00 00 A 00 00 00 00 B 00 00 00 00 C 00 00 00 00 D 00 00 00 00 E 00 00 00 00 F 00 00 00 00
2.3.42 repeat
Therepeatcommandisusedtoexecuteanotherutilitycommandaspecified numberoftimes,asrapidlyaspossible.Thecommandtobeexecutedissupplied asanargumenttotherepeatcommand. The-pswitchmaybeusefultomarktheprogressofcommandswithlarge repetitioncounts.Iftheswitchisused,thecurrentpassnumberisoutputtothe screen,followedbyaTABcharacter.Iftheswitchisomitted,noindicationofthe repeatcommandsprogressisgiven. Therepeatcommandimmediatelystopsifanerrorisreportedwhilethe commandisexecuting. Syntax
repeat [-p] count cmd [arg...]
Parameters
-p
Example
UTIL0 > Network Network Network Network UTIL0 > repeat 4 send 1 Int 1 interrupt Int 1 interrupt Int 1 interrupt Int 1 interrupt 0XFF event event event event was was was was sent sent sent sent to to to to node node node node 255. 255. 255. 255.
130 Common RFM2g Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g Drivers
2.3.43 return
Thereturncommandisusedtoexitadriverspecificsubmenuofcommands (accessedusingthedrvspecificcommand)sothatyoucanusecommon rfm2g_util.ccommands. Refertoyourdriverspecificmanualforinformationoncommandsspecificto yourRFM2gdriver. Syntax
return
Examples Toaccessdriverspecificcommands:
UTIL0 > drvspecific Welcome to the driver specific menu UTILDRVSPEC >
Todisplayalistofdriverspecificcommands:
UTILDRVSPEC > help COMMAND PARAMETERS --------------------------------------------------help [command] repeat [-p] count cmd [arg...] return UTILDRVSPEC >
Toexitthedriverspecificcommands:
UTILDRVSPEC > return Welcome to the main menu UTIL0 >
2.3.44 send
Usethesendcommandtotransmitaninterrupteventandabinaryvalueto anothernode.RFM2ginterrupteventtypesareavailableforanapplication programtouseinsignalingeventstootherRFM2gnodes. IfthedestinationRFM2gnodenumberisgivenas-1,theeventwillbebroadcast toallotherRFM2gnodesonthenetwork.Theext_dataparameterisauser defined,32bitvaluetosendwiththeinterruptevent.Theutilitycalls RFM2gSendEvent()tosendtheRFM2ginterruptevent. Syntax
send event tonode [ext_data]
Parameters
event
EventID
0 1 2 3 4
tonode
Whowillreceivetheinterruptevent(I)(1sendstheeventto allnodes).
NOTE
ext_data
Userdefined32bitextendeddatatosend(I).
Example
UTIL0 > send 0 0 "RESET" interrupt event was sent to node 0. UTIL0 >
132 Common RFM2g Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g Drivers
2.3.45 setdarkondark
ThesetdarkondarkcommandsetsthestateoftheRFM2gDarkonDarkfeature. TheutilityRFM2gSetDarkOnDark()setsthestateoftheDarkonDarkfeature. Syntax
setdarkondark state
Parameters
state
Example
EachpossibleRFM2gdevicedriverdebugoutputmessageisassignedtoadebug messageclass.Thedevicedriverwillgeneratemessagesofthatclassifthe correspondingflagbitissetinthecontrolword.Thesetdebugcommandallows anapplicationprogramtosetthatcontrolword(i.e.thiscommandsetsthe driversdebugflags).Thechangeiseffectiveimmediately. Applicationprogramsdonotnormallyneedtoalterthesettingofthedebug messageoutputcontrolword.TheutilitycallsRFM2gSetDebugFlags() toturn debugflagsONorOFF. Syntax
setdebug [-] flag
Parameters
flag
Clearsinsteadofsettingtheflag. Newdebugflags(I).Validstringsare:
String allflags close dma error init intr ioctl minphys mmap mutex not_intr open peek poke read slow strat timer trace write Description TurnsalldebugflagsON Traceclose(2)systemcalls TraceDMAcalls Reportcriticalerrors Tracedeviceprobingandsearch Traceinterruptservice Traceioctl(2)systemcalls Traceminphyslimits Tracemmap(2)systemcalls Tracesynchronizationandlocking TracenonRFMinterruptservice Traceopen(2)systemcalls Tracepeeks Tracepokes Traceread(2)systemcalls Letsyslogdgetthemessage Traceread/writestrategy Traceintervaltimer Tracesubroutineentry/exit Tracewrite(2)systemcalls
Example
UTIL0 > setdebug error Debug Flag error was set. UTIL0 >
134 Common RFM2g Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g Drivers
2.3.47 setdmabyteswap
ThesetdmabyteswapcommandenablesordisablesbyteswappingDMA transferstoorfromanRFM2gdevice.Thiscommandprovides4byteswapsonly (i.e.byteswappingbasedonsizeisnotperformedbytheRFM2gdevice).The utilitycallsRFM2gSetDMAByteSwap() toturnDMAbyteswappingONorOFF.
NOTE
Syntax
DMA byte swapping may be enabled by default when the driver has been built for use on big endian systems. Refer to your driver-specific manual for the default setting of DMA byte swapping.
setdmabyteswap
state
Parameters
state
Example
UTIL0 > setdmabyteswap 1 The Reflective Memory board's DMA Byte Swap is ON. UTIL0 >
2.3.48 setled
ThesetledcommandsetsthecurrentON/OFFstateoftheReflectiveMemory boardsSTATUSLED.Theutilitycalls RFM2gSetLed()toturntheSTATUSLED ONorOFF. Syntax
setled state
Parameters
state
ThestateoftheSTATUSLED:0=>OFF,1=>ON(O).
Example
UTIL0 > setled 1 The Reflective Memory boards status LED is ON UTIL0 >
2.3.49 setloopback
ThesetloopbackcommandsetsthestateoftheRFM2Gtransmitloopback hardware.TheutilitycallsRFM2gSetLoopback() tosetthetransmitloopback state. Syntax
setloopback state
Parameters
state
Example
UTIL0 > setloopback 0 The Reflective Memory boards transmit loopback is OFF. UTIL0 >
2.3.50 setmemoryoffset
ThesetmemoryoffsetcommandsetsthememoryoffsetstatusoftheReflective Memoryboard.Theutilitycalls RFM2gSetMemoryOffset()tosetthememory offset. Syntax
setmemoryoffset offset
Parameters
offset
0 1 2 3 Example
UTIL0 > setmemoryoffset 1 The Reflective Memory board's memory offset is 0x40000000. UTIL0 >
136 Common RFM2g Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g Drivers
2.3.51 setparityenable
ThesetparityenablecommandsetsthestateoftheRFM2gsparityenable.The utilityRFM2gSetParityEnable()setsthestateoftheparityenable. Syntax
setparityenable state
Parameters
state
Example
UTIL0 > setparityenable 0 The Reflective Memory boards parity enable is OFF. UTIL0 >
2.3.52 setpiobyteswap
ThesetpiobyteswapcommandenablesordisablesbyteswappingPIOtransfers toorfromanRFM2gdevice.Thisfunctionprovides4byteswapsonly(i.e.byte swappingbasedonsizeisnotperformedbytheRFM2gdevice).Theutilitycalls RFM2gSetPIOByteSwap()toturnPIObyteswappingONorOFF.
NOTE
Syntax
PIO byte swapping may be enabled by default when the driver has been built for use on big endian systems. Refer to your driver-specific manual for the default setting of PIO byte swapping.
setpiobyteswap state
Parameters
state
Example
UTIL0 > setpiobyteswap 1 The Reflective Memory board's PIO Byte Swap is ON. UTIL0 >
2.3.53 setslidingwindow
ThesetslidingwindowcommandsetsthebaseReflectiveMemoryoffsetofthe slidingmemorywindow.Thesizeoftheslidingwindowissetwithswitchesor jumpersontheReflectiveMemoryboard.Theavailablewindowsizesare 2MByte,16MByte,64MByte,andthetotalmemorysize.Theoffsetofthesliding windowmustbeamultipleofthesizeoftheslidingwindow.Theutilitycalls RFM2gGetSlidingWindow()togetthewindowsize,and RFM2gSetSlidingWindow()tosettheoffset. Syntax
setslidingwindow offset
Example
UTIL0 > setslidingwindow 0x00400000 The 2 MByte Sliding Window begins at offset 0x00400000. UTIL0 >
2.3.54 setthreshold
Thesetthresholdcommandsetsthetransfersizeatwhichreadsandwriteswill useDMAtotransferdata.Ifthereadorwritecommandisused,DMAwillbe usedifthesizeofthedataislargerthanorequaltothethresholdvalue.A thresholdcanbesetforeachhandlecreatedbyacallto RFM2gOpen(). TheamountofcyclestakentosetupaDMAtransfercanincreasethetransfer timeforsmalltransfersizes.ThetransfersizeforwhichDMAsaremoreefficient thanstandardtransfersvaries,dependingonthesystem. DMAisgenerallypreferredoverthePIOmethodfortransferringdata.PIO operationsrequiretheusageoftheCPUtoprocessthetransfer,whileDMA enablestheReflectiveMemorycontrollertoaccesssystemmemorywhileleaving theCPUsresourcesunaffected.However,thebestvaluetouse(i.e.PIOvs.DMA) issystemdependent.TheRFM2gdriverperformsapproximatelyfivePCI accessestosetupandprocessaDMArequestandgeneratesaninterrupton completionoftheDMAoperation.Ingeneral,DMAisthepreferredmethodifa PIOtransferrequiresmorethansixtotenPCIcyclestocomplete. Avalueof0xFFFFFFFFspecifiesthatDMAswillneverbeusedfordatatransfer. TheutilitycallsRFM2gSetDMAThreshold()tosettheDMAthresholdsize.
NOTE
The default DMA threshold value is driver-dependent and should be changed only if recommended by the drivers documentation. Refer to your driver-specific manual for more information, including the default value.
Syntax
setthreshold value
Parameters
value
NewDMAthresholdvalue(I).
Example
UTIL0 > setthreshold 128 UTIL0 >
138 Common RFM2g Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g Drivers
2.3.55 settransmit
ThesettransmitcommandsetsthestateoftheRFM2gstransmitter.Theutility RFM2gSetTransmit()setsthestateoftheReflectiveMemoryboardstransmitter. Syntax
settransmit state
Parameters
state
Example
UTIL0 > settransmit 1 The Reflective Memory boards Transmitter is ON. UTIL0 >
2.3.56 size
Thesizecommanddisplaysthevalueofthetotalamountofvirtualmemory spaceavailableontheRFM2gdevice.TheusermayaccessRFM2gspacebetween offset0andRFM2gSize(rh)-1. RFM2gboardsmaybeconfiguredwithavarietyofmemorysizes.Thedevice driverandAPIlibrarydeterminetheamountofmemorycontainedonaRFM2g deviceasitisinitialized.Ausermaythenusesizetoobtainthenumberofbytes ontheboard.TheutilitycallsRFM2gSize() toreturntheRFM2gdevicestotal availablememoryspace. Syntax
size
Example
UTIL0 > size Size UTIL0 > 134217728 (0x08000000)
2.3.57 unmapuser
TheunmapusercommandunmapstheRFM2gmemorybufferfromusermemory space.TheutilitycallsRFM2gUnMapUserMemory()tounmaptheRFM2gmemory buffer. Syntax
unmapuser UserMemoryPtr pages
Parameters
UserMemoryPtr Pages
Pointerreturnedbythemapusercommand(O). Thenumberofpagesmappedbythemapusercommand(O).
Example
UTIL0 > unmapuser 0x50000000 100 UTIL0 >
2.3.58 unmapuserbytes
TheunmapuserbytescommandunmapstheRFM2gmemorybufferfromuser memoryspace.TheutilitycallsRFM2gUnMapUserBytes()tounmaptheRFM2g memorybytesbuffer. Syntax
unmapuserbytes UserMemoryPtr bytes
Parameters
UserMemoryPtr Pages
Example
UTIL0 > unmapuserbytes 0x50000000 100 UTIL0 >
140 Common RFM2g Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g Drivers
2.3.59 wait
ThewaitcommandallowstheusertowaitforanRFM2ginterruptevent.The utilityprogramblocksuntilthenextRFM2ginterrupteventoftherequestedtype hasbeenreceived,orthetimeoutperiodexpires.Theeventmustbeenabledby thisapplicationbeforeitcanbereceived;otherwise,atimeoutwilloccur.The utilitycallsRFM2gWaitForEvent()towaitfortheRFM2gevent. Syntax
wait event timeout
Parameters
event
EventID
0 1 2 3 4 5 6 7 8 9 10 11
timeout
Indicatesthetime,inmilliseconds,towaitfortheeventbefore returning.
Example
UTIL0 > wait 1 1000 Waiting for event... Received Network INT 1 event from node 5. This events extended data is 0X12345678. UTIL0 > wait 0 0 Waiting for event ... Notification for this event has already been requested. UTIL0 > wait 0 10000 Waiting for event ... Notification for this event has already been requested. UTIL0 > wait 1 0 Waiting for event ... Timed out. UTIL0 > wait 1 10000 Waiting for event ... Timed out. UTIL0 >
2.3.60 write
ThewritecommandwritesoneormorebytesstartingatanoffsetinReflective Memory(i.e.allowstheusertofillmemoryareawithabyte,wordorlongword). TheutilitycallsRFM2gWrite() towritedatabuffers.IfDMAthresholdandother conditionsaremet,DMAwillbeused;otherwise,PIOwillbeused.
NOTE
See section Big Endian and Little Endian Data Conversions, page 44 for information on the big endian/little endian byte-reordering process used by the RFM2g driver when accessing multibyte data. If byte swapping is enabled on the RFM2g device, offset and length must be width aligned.
Syntax
write value offset width length
Parameters
value
Byte,wordorlongwordvaluetowritetotherangespecifiedby offset,lengthandwidth(I). WidthalignedoffsetinReflectiveMemoryatwhichtobegin thewrite(I).Validoffsetvaluesare0x0to0x3FFFFFFfor64MB cards,and0x0to0x7FFFFFFfor128MBcards. Indicatesaccesswidthinbits,whichisoneofthefollowing(I): Value 1 2 4 8 Description 8bitbyte 16bitword 32bitlongword 64bitlongword
offset
width
length
Numberofwidthunitstowrite(I),whichisdeterminedusing theformula[buffersize]/width.Forexample,thelengthofa buffersizeof1024in32bitlongwordsis256(1024/4=256). WidthBit bytes words 32bitlongword 64bitlong MaximumLength(Dec/Hex) for128MBCards 134217728(0x8000000) 67108864(0x4000000) 33554432(0x2000000) 16777216(0x1000000)
Example
UTIL0 Write Write UTIL0 > write 0 0 1 16 1000 used DMA. completed. >
142 Common RFM2g Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g Drivers
2.4.1 Errors
Usethefollowingmethodtoperformdriverbuildtroubleshooting. Ifthecompileroutputsthefollowingerror,theoperatingsystemforwhichthefile istobecompiledhasnotbeendefinedinthebuildspecification.
C:\RFM2g\PCI\VxWorks\rfm2g_util.c:59: #error Please define DEVICE_PREFIX for your driver.
Toresolvethiserror,definetheoperatingsysteminthebuildoptionsasfollows: OperatingSystem VxWorks Solaris Linux Windows BuildOptionDefinition DRFM2G_VXWORKS DRFM2G_SOLARIS DRFM2G_LINUX None
3.1 rfm2g_sender.c
Therfm2g_sender.cprogramrunsonsystem1anddoesthefollowing: 1. WritesasmallbufferofdatatoReflectiveMemory 2. Sendsaninterrupteventtosystemnumber2 3. Waitstoreceiveaninterrupteventfromsystemnumber2 4. Readsabufferofdata(writtenbysystemnumber2)fromadifferentReflec tiveMemorylocation 5. ClosestheRFM2gdriver.
3.2 rfm2g_receiver.c
Therfm2g_receiver.cprogramrunsonsystem2anddoesthefollowing: 1. OpenstheRFM2gdriver 2. Waitstoreceiveaninterrupteventfromsystemnumber1 3. Readsthebufferofdata(writtenbysystemnumber1)fromReflectiveMem ory 4. WritesthebufferofdatatoadifferentReflectiveMemorylocation 5. Sendsaninterrupteventtosystemnumber1 6. ClosestheRFM2gdriver.
144 Common RFM2g Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g Drivers
3.3 rfm2g_map.c
Therfm2g_map.cprogramdemonstratestheusageoftheRFM2gUserMemory() function,whichenablesyoutoobtainapointerfordirectlyaccessingthememory oftheRFM2gdevice.
2. TypetheRFM2ghostsdevicenumber(0,1,etc.)andpress<ENTER>. Thefollowingisdisplayedinthehostsconsolewindow:
Do you wish for sender to loop continuously? (Y/N):
5. TypetheRFM2gtargetsdevicenumber(0,1,etc.)andpress<ENTER>. Thefollowingisdisplayedinthehostsconsolewindow:
Start the "RFM2G_receiver" program on the other computer. Press RETURN to continue ...
7. TypetheRFM2gtargetsdevicenumber(0,1,etc.)andpress<ENTER>. Thefollowingisdisplayedinthetargetsconsolewindow:
Do you wish for receiver to loop continuously? (Y/N):
Waiting 60 seconds for an interrupt from Node 3 ... Received the interrupt from Node 3. Success!
146 Common RFM2g Application Program Interface (API) and Command Line Interpreter for VMISFT/RFM2g Drivers
2. TypetheRFM2gdevicesnumber(0,1,etc.)andpress<ENTER>. Thefollowingisdisplayedinthehostsconsolewindow:
Wrote: Wrote: Wrote: Wrote: A5A50000, A5A50001, A5A50002, A5A50003, Read: Read: Read: Read: A5A50000 A5A50001 A5A50002 A5A50003
Success!
Maintenance
IfaGEproductmalfunctions,pleaseverifythefollowing: 1. Softwareversionresidentontheproduct 2. Systemconfiguration 3. Electricalconnections 4. Jumperorconfigurationoptions 5. Boardsarefullyinsertedintotheirproperconnectorlocation 6. Connectorpinsarecleanandfreefromcontamination 7. Nocomponentsoradjacentboardsweredisturbedwheninsertingorremov ingtheboardfromthechassis 8. QualityofcablesandI/Oconnections Ifproductsmustbereturned,contactGEforaReturnMaterialAuthorization (RMA)Number.ThisRMANumbermustbeobtainedpriortoanyreturnfrom CustomerCare. GECustomerCareisavailableat:18004332682inNorthAmerica, or+17804017700forinternationalcalls.Or,visitourwebsitewww.geip.com.
Maintenance Prints
Userlevelrepairsarenotrecommended.Thedrawingsanddiagramsinthis manualareforreferencepurposesonly.
Maintenance 148
2010 GE Intelligent Platforms Embedded Systems, Inc. All rights reserved. * indicates a trademark of GE Intelligent Platforms, Inc. and/or its affiliates. All other trademarks are the property of their respective owners. Confidential Information - This document contains Confidential/Proprietary Information of GE Intelligent Platforms, Inc. and/or its suppliers or vendors. Distribution or reproduction prohibited without permission. THIS DOCUMENT AND ITS CONTENTS ARE PROVIDED "AS IS", WITH NO REPRESENTATIONS OR WARRANTIES OF ANY KIND, WHETHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTIES OF DESIGN, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. ALL OTHER LIABILITY ARISING FROM RELIANCE UPON ANY INFORMATION CONTAINED HEREIN IS EXPRESSLY DISCLAIMED.
Additional Resources
For more information, please visit the GE Intelligent Platforms Embedded Systems web site at:
www.ge-ip.com