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

📄 mpltaskvlan.h

📁 NATIONAL公司DP83816芯片Linux下驱动
💻 H
字号:

//******************************************************************************
//
//  MPLTASKVLAN.H
//
//  Copyright (c) 2004 National Semiconductor Corporation.
//  All Rights Reserved
//
//  MPL VLAN Offload Task Module definitions and exports
//
//  MPL clients should not include this file directly, instead include 
//  mplclient.h
//******************************************************************************

#ifndef _MPLTASKVLAN_H_
#define _MPLTASKVLAN_H_

#if defined(__cplusplus)
extern "C"
{
#endif

// Forward refs for compilation
struct _MPL_PKT;

//*****************************************************************************
//   MplTaskVlanCfg
//      Enable/Disable and configure the VLAN module
//
//   Parameters
//      pMplHandle
//         MPL device handle returned following a call to MplInitialize
//      enableFlag
//         Set to NS_TRUE to enable the VLAN tag insertion and removal process,
//          NS_FALSE to disable.
//      cfg
//         Bit map of configuration options for the VLAN task offload module.
//            MPL_TASK_VLAN_DETECT_TAGS - Detect VLAN tags in incoming pkts
//             and include tag data in OOB field of MPL_PKT
//            MPL_TASK_VLAN_REMOVE_TAGS - Specifies the MPL should remove VLAN
//             tags from receive packets indicated to the NSM.
//            MPL_TASK_VLAN_DISCARD_TAGGED – Enables discard of frames *with* 
//              a VLAN tag.
//            MPL_TASK_VLAN_DISCARD_UNTAGGED – Enables discard of frames
//              *without* a VLAN tag.
//            MPL_TASK_VLAN_FILTER - Enables MPL’s VLAN ID receive filter. 
//            MPL_TASK_VLAN_PERPACKET - Include VLAN tag on a per pkt basis
//               - For Tx only (See Global insertion in MplTaskVlanAddTxTag)
//
//   Return Value
//      NS_STATUS_SUCCESS
//         The task offload was successfully enabled or disabled.
//      NS_STATUS_NOT_SUPPORTED
//         This offload task or selected configuration option is not supported 
//          by MPL.
//
//*****************************************************************************
MPL_STATUS
   MplTaskVlanCfg (
      IN NS_VOID     *pMplHandle,
      IN NS_BOOLEAN   enableFlag,
      IN NS_UINT      cfg
      );

//*****************************************************************************
//   MplTaskVlanAddTxTag
//      Add a new VLAN tag to used globally for all Tx pkts
//
//   Parameters
//      pMplHandle
//         MPL device handle returned following a call to MplInitialize
//      vlanId
//         VLAN identifier to be inserted globally for all transmits packets.
//      vlanPriority
//         VLAN priority to be inserted globally for all transmits packets.
//
//   Return Value
//      NS_STATUS_SUCCESS
//         The VLAN tag was successfully added.
//      NS_STATUS_FAILURE
//         This offload feature is disabled
//      NS_STATUS_INVALID_PARM
//         The VLAN id or priority value was not in the valid range.
//
//*****************************************************************************
MPL_STATUS
   MplTaskVlanAddTxTag (
      IN NS_VOID    *pMplHandle,
      IN NS_UINT16   vlanId,
      IN NS_UINT8    vlanPriority
      );

//*****************************************************************************
//   MplTaskVlanAddRxTag
//      Add a new VLAN tag to the Rx filter list
//
//   Parameters
//      pMplHandle
//         MPL device handle returned following a call to MplInitialize
//      vlanId
//         VLAN identifier to be inserted in the receive filter for incoming
//          receive packets.
//
//   Return Value
//      NS_STATUS_SUCCESS
//         The VLAN tag was successfully added.
//      NS_STATUS_FAILURE
//         This offload feature is disabled
//      NS_STATUS_INVALID_PARM
//         The VLAN id or priority value was not in the valid range.
//      NS_STATUS_RESOURCES
//         The maximum filter list size was reached.
//
//*****************************************************************************
MPL_STATUS
   MplTaskVlanAddRxTag (
      IN NS_VOID    *pMplHandle,
      IN NS_UINT16   vlanId
      );

//*****************************************************************************
//   MplTaskVlanDeleteRxTag
//      Delete a VLAN tag from the Rx filter list
//
//   Parameters
//      pMplHandle
//         MPL device handle returned following a call to MplInitialize
//      vlanId
//         VLAN identifier to be removed from the receive filter list.
//
//   Return Value
//      NS_STATUS_SUCCESS
//         The VLAN tag was successfully deleted.
//      NS_STATUS_FAILURE
//         This offload feature is disabled
//      NS_STATUS_FAILURE
//         The VLAN id was not found in the filter list.
//
//*****************************************************************************
MPL_STATUS
   MplTaskVlanDeleteRxTag (
      IN NS_VOID    *pMplHandle,
      IN NS_UINT16   vlanId
      );


//*****************************************************************************
//   MplTaskVlanClearRxTag
//      Clear the Rx VLAN  filter list
//
//   Parameters
//      pMplHandle
//         MPL device handle returned following a call to MplInitialize
//
//   Return Value
//      NS_STATUS_SUCCESS
//         The VLAN tags were successfully cleared.
//      NS_STATUS_FAILURE
//         This offload feature is disabled
//
//*****************************************************************************
MPL_STATUS
   MplTaskVlanClearRxTag (
      IN NS_VOID *pMplHandle
      );

//*****************************************************************************
//   MplSetPacketVlanTag
//     Set a given VLAN tag to the outgoing pkt (per packet mode)     
//
//   Parameters
//      pMplHandle
//         MPL device handle returned following a call to MplInitialize
//      pPacket
//         Pointer to the MPL_PKT structure that describes the frame to be
//          transmitted
//      vlanId
//         The VLAN id (0 to 4095 inclusive) to be used to transmit this packet
//      vlanPriority
//         The VLAN priority (0 to 7 inclusive) to be used to transmit this
//          packet
//
//   Return Value
//      NS_STATUS_SUCCESS
//         The VLAN id was successfully set for the packet.
//      NS_STATUS_FAILURE
//         This offload feature is disabled
//      NS_STATUS_INVALID_PARM
//         The VLAN id or priority value was not in the valid range.
//
//*****************************************************************************
MPL_STATUS
   MplSetPacketVlanTag (
      IN NS_VOID           *pMplHandle,
      IN struct _MPL_PKT   *pPacket,
      IN NS_UINT16  vlandId,
      IN NS_UINT8   vlanPriority
      );

//*****************************************************************************
//  MplQueryPacketVlanTag 
//      Retrieve the VLAN tag in a given Rx packet
//
//   Parameters
//      pMplHandle
//         MPL device handle returned following a call to MplInitialize
//      pPacket
//         Pointer to the MPL_PKT structure that describes the frame just
//          received
//      pVlanId
//         Pointer to a caller provided variable in which the VLAN id (0 to
//          4095 inclusive) is returned.
//      pVlanPriority
//         Caller allocated variable in which this function returns the VLAN
//          priority (0 to 7 inclusive) on the received frame.
//
//   Return Value
//      NS_STATUS_SUCCESS
//         The VLAN tag was successfully retrieved for the packet.
//      NS_STATUS_INVALID_PARM
//         The packet is not a VLAN tagged packet.
//      NS_STATUS_FAILURE
//         This offload feature is disabled
//
//****************************************************************************
MPL_STATUS
   MplQueryPacketVlanId (
      IN NS_VOID            *pMplHandle,
      IN struct _MPL_PKT    *pPacket,
      IN NS_UINT16  *pVlandId,
      IN NS_UINT8   *pVlanPriority
      );

#if defined(__cplusplus)
}
#endif 

#endif // _MPLTASKVLAN_H_

⌨️ 快捷键说明

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