⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mplclient.h

📁 NATIONAL公司DP83816芯片Linux下驱动
💻 H
📖 第 1 页 / 共 4 页
字号:
//
//*****************************************************************************
MPL_STATUS
   MplInterruptCheckTransmit (
      IN NS_VOID   *pMplHandle
      );


//*****************************************************************************
//   MplInterruptCheckReceive
//      Checks for the presence of receive engine related interrupt events.
//
//   Parameters
//      pMplHandle
//         MPL device handle returned following a call to MplInitialize.
//
//   Return Value
//      NS_STATUS_SUCCESS
//         Pending receive related events exist on the device
//      NS_STATUS_FAILURE
//         No receive related events detected.
//
//*****************************************************************************
MPL_STATUS
   MplInterruptCheckReceive (
      IN NS_VOID   *pMplHandle
      );


//*****************************************************************************
//   MplInterruptCheckInternal
//      Checks for the presence of MAC/PHY internal (non data transfer related)
//       interrupt events.
//   Parameters
//      pMplHandle
//         MPL device handle returned following a call to MplInitialize.
//   Return Value
//      NS_STATUS_SUCCESS
//         Pending internal events exist on the device
//      NS_STATUS_FAILURE
//         No internal events detected.
//
//*****************************************************************************
MPL_STATUS
   MplInterruptCheckInternal (
      IN NS_VOID   *pMplHandle
      );


//*****************************************************************************
//   MplInterruptDoneInternal
//      Processes device’s internal (non data-type) interrupts.
//   Parameters
//      pMplHandle
//         MPL device handle returned following a call to MplInitialize
//      maxEvents
//         The maximum internal events (e.g. link change) that MPL should 
//          process before returning back to the caller.
//   Return Value
//      NS_STATUS_SUCCESS
//         The internal event was successfully handled.
//      NS_STATUS_ABORTED
//         The processing was aborted since the maximum event count specified 
//          was met.
//
//*****************************************************************************
MPL_STATUS
   MplInterruptDoneInternal (
      IN NS_VOID   *pMplHandle,
      IN NS_UINT    maxEvents
      );


//+++++ Link Management APIs
//###########################


//*****************************************************************************
//   MplLinkCfg
//      Configures the network media speed (10/100), duplex (half/full), 
//       negotiation (Auto/Forced) and network PAUSE parameters.
//      When configuring auto mode, the speed and duplex setting passed should
//       reflect the best case scenario i.e most desired speed and duplex
//
//   Parameters
//      pMplHandle
//         MPL device handle returned following a call to MplInitialize
//      pLinkCfg
//         Points to a MPL_LINK_CFG structure with the desired link 
//          configuration.
//
//   Return Value
//      NS_STATUS_SUCCESS
//         Link configured and the link is UP.
//      NS_STATUS_ASYNCH_COMPLETION
//         Link is currently being configured or being negotiated.
//      NS_STATUS_INVALID_PARM
//         An invalid parameter was detected in the configuration structure.
//      NS_STATUS_HARDWARE_FAILURE
//         An expected failure occured while setting the link config
//
//*****************************************************************************
MPL_STATUS
   MplLinkCfg (
      IN NS_VOID        *pMplHandle,
      IN MPL_LINK_CFG   *pLinkCfg
      );


//*****************************************************************************
//   MplLinkGetCfg
//      Returns the current link configuration on the device.
//
//   Parameters
//      pMplHandle
//         MPL device handle returned following a call to MplInitialize
//      pLinkCfg
//         Pointer to a caller allocated MPL_LINK_CFG structure in which the 
//          current link configuration is returned.
//
//   Return Value
//      NS_STATUS_SUCCESS
//         The link configuration was successfully returned.
//      NS_STATUS_FAILURE
//         The link is not configured (yet).
//
//*****************************************************************************
MPL_STATUS
   MplLinkGetCfg (
      IN NS_VOID        *pMplHandle,
      OUT MPL_LINK_CFG  *pLinkCfg
      );

//*****************************************************************************
//   MplLinkGetStatus
//      Returns the link status reported on the device.
//
//   Parameters
//      pMplHandle
//         MPL device handle returned following a call to MplInitialize
//
//   Return Value
//      MPL_LINK_STATUS_NONE
//         An unexpected hardware error occurred while processing this request
//          and the link state was not retrieved.
//      MPL_LINK_STATUS_DOWN
//         The link is down.
//      MPL_LINK_STATUS_ACTIVE
//         The link is currently being configured or negotiated.
//      MPL_LINK_STATUS_UP
//         The link is up
//
//*****************************************************************************
MPL_LINK_STATUS
   MplLinkGetStatus (
      IN NS_VOID   *pMplHandle
      );


//*****************************************************************************
//   MplLinkProcessChange
//      Handles the link change event
//
//   Parameters
//      pMplHandle
//         MPL device handle returned following a call to MplInitialize
//
//   Return Value
//      MPL_LINK_STATUS_NONE
//         An unexpected hardware error occurred while processing this request
//          and the link state was not retrieved.
//      MPL_LINK_STATUS_DOWN
//         The link is down.
//      MPL_LINK_STATUS_ACTIVE
//         The link is currently being configured or negotiated.
//      MPL_LINK_STATUS_UP
//         The link is up.
//
//*****************************************************************************
MPL_LINK_STATUS
   MplLinkProcessChange (
      IN NS_VOID   *pMplHandle
      );


//*****************************************************************************
//   MplLinkUpComplete
//      Completes the configuration of the device following the 
//       auto-negotiation process.
//
//   Parameters
//      pMplHandle
//         MPL device handle returned following a call to MplInitialize
//
//   Return Value
//      NS_STATUS_SUCCESS
//         The link configuration is complete.
//      NS_STATUS_FAILURE
//         The link state is not UP.
//
//*****************************************************************************
MPL_STATUS
   MplLinkUpComplete (
      IN NS_VOID      *pMplHandle
      );

//*****************************************************************************
//   MplLinkInterrupt
//      Processes an incoming link related interrupt
//      At this time this is an MPL internal function (called from
//       MplIntteruptDoneInternal) 
//
//   Parameters
//      pMplHandle
//         MPL device handle returned following a call to MplInitialize
//
//   Return Value
//      NS_STATUS_SUCCESS
//         The interrupt was successfully fielded.
//
//*****************************************************************************
MPL_STATUS
   MplLinkInterrupt(
      IN NS_VOID   *pMplHandle
      );

//+++++ PHY Management APIs
//###################################

//*****************************************************************************
//   MplPhyDetect
//      Detect the presence of a MacPhyter device on the system.
//
//   Parameters
//      pMplHandle
//         MPL device handle
//
//   Return Value
//      NS_STATUS_SUCCESS
//         A MacPhyter device was successfully probed
//      NS_STATUS_HARDWARE_FAILURE
//         Could not find a MacPhyter device
//
//*****************************************************************************
MPL_STATUS
   MplPhyDetect(
      IN NS_VOID   *pMplHandle
      );

//*****************************************************************************
//   MplPhyReset
//      Reset the PHY device
//      
//
//   Parameters
//      pMplHandle
//         MPL device handle
//
//   Return Value
//      NS_STATUS_SUCCESS
//         A MacPhyter device was successfully probed
//      NS_STATUS_HARDWARE_FAILURE
//         Could not find a MacPhyter device
//
//*****************************************************************************
MPL_STATUS
   MplPhyReset(
      IN NS_VOID       *pMplHandle
      );


//*****************************************************************************
//   MplPhyLinkSetup
//      Setup the link on the PHY with the requested settings
//
//   Parameters
//      pMplHandle
//         MPL device handle
//
//   Return Value
//      NS_STATUS_SUCCESS
//         The link was set on the PHY device
//      NS_STATUS_INVALID_PARM
//         An invalid link configuration was detected
//      NS_STATUS_HARDWARE_FAILURE
//         Unexpected hardware error
//
//*****************************************************************************
MPL_STATUS
   MplPhyLinkSetup (
      IN NS_VOID   *pMplHandle
      );


//*****************************************************************************
//   MplPhyGetLinkStatus
//      Returns the status of the link
//
//   Parameters
//      pMplHandle
//         MPL device handle
//
//   Return Value
//      MPL_LINK_STATUS_NONE
//         An unexpected hardware error occurred while processing this request
//          and the link state was not retrieved.
//      MPL_LINK_STATUS_DOWN
//         The link is down.
//      MPL_LINK_STATUS_ACTIVE
//         The link is currently being configured or negotiated.
//      MPL_LINK_STATUS_UP
//         The link is up
//
//*****************************************************************************
MPL_LINK_STATUS
   MplPhyGetLinkStatus (
      IN NS_VOID   *pMplHandle
      );

//*****************************************************************************
//   MplPhyGetLinkSpeed
//      Returns current link speed. 
//      NOTE: SHOULD be called only after determing that the link is UP - 
//            i.e MplPhyGetLinkStatus has returned MPL_LINK_STATUS_UP
//
//   Parameters
//      pMplHandle
//         MPL device handle
//
//   Return Value
//      MPL_LINK_SPEED_TENMBPS 
//         The current link speed is 10Mbps
//      MPL_LINK_SPEED_HUNDREDMBPS
//         The current link speed is 100Mbps
//
//*****************************************************************************
MPL_LINK_SPEED 
   MplPhyGetLinkSpeed(
      IN NS_VOID   *pMplHandle
      );


//*****************************************************************************
//   MplPhyGetLinkDuplex
//      Returns current link duplex mode. 
//      NOTE: SHOULD be called only after determing that the link is UP - 
//            i.e MplPhyGetLinkStatus has returned MPL_LINK_STATUS_UP
//
//   Parameters
//      pMplHandle
//         MPL device handle
//
//   Return Value
//      MPL_LINK_DUPLEX_HALF
//         The current duplex mode is half
//      MPL_LINK_DUPLEX_FULL
//         The current duplex mode is full
//
//*****************************************************************************
MPL_LINK_DUPLEX
   MplPhyGetLinkDuplex(
      IN NS_VOID   *pMplHandle
      );


//*****************************************************************************
//   MplPhyAutoNegDone
//      Returns if Auto Neg process is completed. 
//      NOTE: SHOULD be called only after determing that the link is UP - 
//            i.e MplPhyGetLinkStatus has returned MPL_LINK_STATUS_UP
//
//   Parameters
//      pMplHandle
//         MPL device handle
//
//   Return Value
//      NS_TRUE
//         The link was setup following a Auto-Neg process
//      NS_FALSE
//         The link was setup in forced mode
//
//*****************************************************************************
NS_BOOLEAN
   MplPhyAutoNegDone(
      IN NS_VOID   *pMplHandle
      );


//*****************************************************************************
//   MplPhyLinkSetupComplete
//
//   Parameters
//      pMplHandle
//         MPL device handle
//
//   Return Value
//      NS_TRUE
//         The link was sucessfully setup
//      NS_FALSE
//         The link is not up (Assert - should not happen)
//      
//
//*****************************************************************************
NS_BOOLEAN
   MplPhyLinkSetupComplete(
      IN NS_VOID   *pMplHandle
      );

//*****************************************************************************
//   MplPhyRequiresPatch
//
//   Parameters
//      pMplHandle
//         MPL device handle
//
//   Return Value
//      NS_TRUE
//         The PHY requires patches to be applied
//      NS_FALSE
//         No Patch work required
//
//*****************************************************************************
NS_BOOLEAN
   MplPhyRequiresPatch(
      IN NS_VOID   *pMplHandle
      );

//*****************************************************************************
//   MplPhyGetDeviceAddr
//      Return the Phy device address
//
//   Parameters
//      pMplHandle
//         MPL device handle
//
//   Return Value
//     Phy device addr
//
//*****************************************************************************
NS_UINT
   MplPhyGetDeviceAddr (
      IN NS_VOID   *pMplHandle
      );

//*****************************************************************************
//   MplPhyMdioRead
//      Read Phy register
//
//   Parameters
//      pMplHandle
//         MPL device handle
//      phyDevAddr
//         Device addr of the Phy
//      regIndex
//         Register to read (in terms of MII offset e.g. BMCR = 0x0, BMSR = 0x1)
//
//   Return Value
//     Reg data
//
//*****************************************************************************
NS_UINT32
   MplPhyMdioRead(
      IN NS_VOID   *pMplHandle,
      IN NS_UINT    phyDevAddr,
      IN NS_UINT    regIndex
      );

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -