📄 rclanmtl.h
字号:
** RCSetRavlinIPandMask() ** ** Set the Ravlin 45/PCI cards IP address and network mask. ** ** IP address and mask must be in network byte order. ** For example, IP address 1.2.3.4 and mask 255.255.255.0 would be ** 0x04030201 and 0x00FFFFFF on a little endian machine. ** */RC_RETURN RCSetRavlinIPandMask(U16 AdapterID, U32 ipAddr, U32 netMask);/*** =========================================================================** RCGetRavlinIPandMask()**** get the IP address and MASK from the card** ** =========================================================================*/RC_RETURNRCGetRavlinIPandMask(U16 AdapterID, PU32 pIpAddr, PU32 pNetMask, PFNWAITCALLBACK WaitCallback); /* ** RCProcI2OMsgQ() ** ** Called from user's polling loop or Interrupt Service Routine for a PCI ** interrupt from the RedCreek PCI adapter. User responsible for determining ** and hooking the PCI interrupt. This function will call the registered ** callback functions, TransmitCallbackFunction or ReceiveCallbackFunction, ** if a TX or RX transaction has completed. */void RCProcI2OMsgQ(U16 AdapterID); /* ** Disable and Enable I2O interrupts. I2O interrupts are enabled at Init time ** but can be disabled and re-enabled through these two function calls. ** Packets will still be put into any posted recieved buffers and packets will ** be sent through RCI2OSendPacket() functions. Disabling I2O interrupts ** will prevent hardware interrupt to host even though the outbound I2O msg ** queue is not emtpy. */RC_RETURN RCEnableI2OInterrupts(U16 adapterID);RC_RETURN RCDisableI2OInterrupts(U16 AdapterID); /* ** RCPostRecvBuffers() ** ** Post user's page locked buffers for use by the PCI adapter to ** return ethernet packets received from the LAN. Transaction Control Block, ** provided by user, contains buffer descriptor(s) which includes a buffer ** context number along with buffer size and physical address. See TCB above. ** The buffer context and actual packet length are returned to the ** ReceiveCallbackFunction when packets have been received. Buffers posted ** to the RedCreek adapter are considered owned by the adapter until the ** context is return to user through the ReceiveCallbackFunction. */RC_RETURN RCPostRecvBuffers(U16 AdapterID, PRCTCB pTransactionCtrlBlock);#define MAX_NMBR_POST_BUFFERS_PER_MSG 32 /* ** RCI2OSendPacket() ** ** Send user's ethernet packet from a locked page buffer. ** Packet must have full MAC header, however without a CRC. ** Initiator context is a user provided value that is returned ** to the TransmitCallbackFunction when packet buffer is free. ** Transmit buffer are considered owned by the adapter until context's ** returned to user through the TransmitCallbackFunction. */RC_RETURN RCI2OSendPacket(U16 AdapterID, U32 context, PRCTCB pTransactionCtrlBlock); /* Ethernet Link Statistics structure */typedef struct tag_RC_link_stats{ U32 TX_good; /* good transmit frames */ U32 TX_maxcol; /* frames not TX due to MAX collisions */ U32 TX_latecol; /* frames not TX due to late collisions */ U32 TX_urun; /* frames not TX due to DMA underrun */ U32 TX_crs; /* frames TX with lost carrier sense */ U32 TX_def; /* frames deferred due to activity on link */ U32 TX_singlecol; /* frames TX with one and only on collision */ U32 TX_multcol; /* frames TX with more than one collision */ U32 TX_totcol; /* total collisions detected during TX */ U32 Rcv_good; /* good frames received */ U32 Rcv_CRCerr; /* frames RX and discarded with CRC errors */ U32 Rcv_alignerr; /* frames RX with alignment and CRC errors */ U32 Rcv_reserr; /* good frames discarded due to no RX buffer */ U32 Rcv_orun; /* RX frames lost due to FIFO overrun */ U32 Rcv_cdt; /* RX frames with collision during RX */ U32 Rcv_runt; /* RX frames shorter than 64 bytes */} RCLINKSTATS, *P_RCLINKSTATS; /* ** RCGetLinkStatistics() ** ** Returns link statistics in user's structure at address StatsReturnAddr ** If given, not NULL, the function WaitCallback is called during the wait ** loop while waiting for the adapter to respond. */RC_RETURN RCGetLinkStatistics(U16 AdapterID, P_RCLINKSTATS StatsReturnAddr, PFNWAITCALLBACK WaitCallback); /* ** RCGetLinkStatus() ** ** Return link status, up or down, to user's location addressed by ReturnAddr. ** If given, not NULL, the function WaitCallback is called during the wait ** loop while waiting for the adapter to respond. */RC_RETURN RCGetLinkStatus(U16 AdapterID, PU32 pReturnStatus, PFNWAITCALLBACK WaitCallback); /* Link Status defines - value returned in pReturnStatus */#define RC_LAN_LINK_STATUS_DOWN 0#define RC_LAN_LINK_STATUS_UP 1 /* ** RCGetMAC() ** ** Get the current MAC address assigned to user. RedCreek Ravlin 45/PCI ** has two MAC addresses. One which is private to the PCI Card, and ** another MAC which is given to the user as its link layer MAC address. The ** adapter runs in promiscous mode because of the dual address requirement. ** The MAC address is returned to the unsigned char array pointer to by mac. */RC_RETURN RCGetMAC(U16 AdapterID, PU8 mac, PFNWAITCALLBACK WaitCallback); /* ** RCSetMAC() ** ** Set a new user port MAC address. This address will be returned on ** subsequent RCGetMAC() calls. */RC_RETURN RCSetMAC(U16 AdapterID, PU8 mac); /* ** RCSetLinkSpeed() ** ** set adapter's link speed based on given input code. */RC_RETURN RCSetLinkSpeed(U16 AdapterID, U16 LinkSpeedCode); /* Set link speed codes */#define LNK_SPD_AUTO_NEG_NWAY 0#define LNK_SPD_100MB_FULL 1#define LNK_SPD_100MB_HALF 2#define LNK_SPD_10MB_FULL 3#define LNK_SPD_10MB_HALF 4 /* ** RCGetLinkSpeed() ** ** Return link speed code. */ /* Return link speed codes */#define LNK_SPD_UNKNOWN 0#define LNK_SPD_100MB_FULL 1#define LNK_SPD_100MB_HALF 2#define LNK_SPD_10MB_FULL 3#define LNK_SPD_10MB_HALF 4RC_RETURNRCGetLinkSpeed(U16 AdapterID, PU32 pLinkSpeedCode, PFNWAITCALLBACK WaitCallback);/*** =========================================================================** RCSetPromiscuousMode(U16 AdapterID, U16 Mode)**** Defined values for Mode:** 0 - turn off promiscuous mode** 1 - turn on promiscuous mode**** =========================================================================*/#define PROMISCUOUS_MODE_OFF 0#define PROMISCUOUS_MODE_ON 1RC_RETURNRCSetPromiscuousMode(U16 AdapterID, U16 Mode);/*** =========================================================================** RCGetPromiscuousMode(U16 AdapterID, PU32 pMode, PFNWAITCALLBACK WaitCallback)**** get promiscuous mode setting**** Possible return values placed in pMode:** 0 = promisuous mode not set** 1 = promisuous mode is set**** =========================================================================*/RC_RETURNRCGetPromiscuousMode(U16 AdapterID, PU32 pMode, PFNWAITCALLBACK WaitCallback);/*** =========================================================================** RCSetBroadcastMode(U16 AdapterID, U16 Mode)**** Defined values for Mode:** 0 - turn off promiscuous mode** 1 - turn on promiscuous mode**** =========================================================================*/#define BROADCAST_MODE_OFF 0#define BROADCAST_MODE_ON 1RC_RETURNRCSetBroadcastMode(U16 AdapterID, U16 Mode);/*** =========================================================================** RCGetBroadcastMode(U16 AdapterID, PU32 pMode, PFNWAITCALLBACK WaitCallback)**** get broadcast mode setting**** Possible return values placed in pMode:** 0 = broadcast mode not set** 1 = broadcast mode is set**** =========================================================================*/RC_RETURNRCGetBroadcastMode(U16 AdapterID, PU32 pMode, PFNWAITCALLBACK WaitCallback);/*** =========================================================================** RCReportDriverCapability(U16 AdapterID, U32 capability)**** Currently defined bits:** WARM_REBOOT_CAPABLE 0x01**** =========================================================================*/RC_RETURNRCReportDriverCapability(U16 AdapterID, U32 capability);/*** RCGetFirmwareVer()**** Return firmware version in the form "SoftwareVersion : Bt BootVersion"**** WARNING: user's space pointed to by pFirmString should be at least 60 bytes.*/RC_RETURNRCGetFirmwareVer(U16 AdapterID, PU8 pFirmString, PFNWAITCALLBACK WaitCallback);/*** ----------------------------------------------** LAN adapter Reset and Shutdown functions** ----------------------------------------------*/ /* resource flag bit assignments for RCResetLANCard() & RCShutdownLANCard() */#define RC_RESOURCE_RETURN_POSTED_RX_BUCKETS 0x0001 #define RC_RESOURCE_RETURN_PEND_TX_BUFFERS 0x0002 /* ** RCResetLANCard() ** ** Reset LAN card operation. Causes a software reset of the ethernet ** controller and restarts the command and receive units. Depending on ** the ResourceFlags given, the buffers are either returned to the ** host with reply status of I2O_REPLY_STATUS_ABORT_NO_DATA_TRANSFER and ** detailed status of I2O_LAN_DSC_CANCELED (new receive buffers must be ** posted after issuing this) OR the buffers are kept and reused by ** the ethernet controller. If CallbackFunction is not NULL, the function ** will be called when the reset is complete. If the CallbackFunction is ** NULL,a 1 will be put into the ReturnAddr after waiting for the reset ** to complete (please disable I2O interrupts during this method). ** Any outstanding transmit or receive buffers that are complete will be ** returned via the normal reply messages before the requested resource ** buffers are returned. ** A call to RCPostRecvBuffers() is needed to return the ethernet to full ** operation if the receive buffers were returned during LANReset. ** Note: The IOP status is not affected by a LAN reset. */RC_RETURN RCResetLANCard(U16 AdapterID, U16 ResourceFlags, PU32 ReturnAddr, PFNCALLBACK CallbackFunction); /* ** RCShutdownLANCard() ** ** Shutdown LAN card operation and put into an idle (suspended) state. ** The LAN card is restarted with RCResetLANCard() function. ** Depending on the ResourceFlags given, the buffers are either returned ** to the host with reply status of I2O_REPLY_STATUS_ABORT_NO_DATA_TRANSFER ** and detailed status of I2O_LAN_DSC_CANCELED (new receive buffers must be ** posted after issuing this) OR the buffers are kept and reused by ** the ethernet controller. If CallbackFunction is not NULL, the function ** will be called when the reset is complete. If the CallbackFunction is ** NULL,a 1 will be put into the ReturnAddr after waiting for the reset ** to complete (please disable I2O interrupts during this method). ** Any outstanding transmit or receive buffers that are complete will be ** returned via the normal reply messages before the requested resource ** buffers are returned. ** Note: The IOP status is not affected by a LAN shutdown. */ RC_RETURN RCShutdownLANCard(U16 AdapterID, U16 ResourceFlags, PU32 ReturnAddr, PFNCALLBACK CallbackFunction); /* ** RCResetIOP(); ** Initializes IOPState to I2O_IOP_STATE_RESET. ** Stops access to outbound message Q. ** Discards any outstanding transmit or posted receive buffers. ** Clears outbound message Q. */RC_RETURN RCResetIOP(U16 AdapterID);#endif /* RCLANMTL_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -