net/dpaa2: add support for VLAN filter and offload
[dpdk.git] / drivers / net / dpaa2 / mc / fsl_dpni.h
index 8783af6..2f69526 100644 (file)
@@ -797,6 +797,33 @@ int dpni_get_max_frame_length(struct fsl_mc_io     *mc_io,
                              uint16_t          token,
                              uint16_t          *max_frame_length);
 
+/**
+ * dpni_set_multicast_promisc() - Enable/disable multicast promiscuous mode
+ * @mc_io:     Pointer to MC portal's I/O object
+ * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
+ * @token:     Token of DPNI object
+ * @en:                Set to '1' to enable; '0' to disable
+ *
+ * Return:     '0' on Success; Error code otherwise.
+ */
+int dpni_set_multicast_promisc(struct fsl_mc_io        *mc_io,
+                              uint32_t         cmd_flags,
+                              uint16_t         token,
+                              int              en);
+
+/**
+ * dpni_get_multicast_promisc() - Get multicast promiscuous mode
+ * @mc_io:     Pointer to MC portal's I/O object
+ * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
+ * @token:     Token of DPNI object
+ * @en:                Returns '1' if enabled; '0' otherwise
+ *
+ * Return:     '0' on Success; Error code otherwise.
+ */
+int dpni_get_multicast_promisc(struct fsl_mc_io        *mc_io,
+                              uint32_t         cmd_flags,
+                              uint16_t         token,
+                              int              *en);
 
 /**
  * dpni_set_unicast_promisc() - Enable/disable unicast promiscuous mode
@@ -854,6 +881,51 @@ int dpni_get_primary_mac_addr(struct fsl_mc_io     *mc_io,
                              uint16_t          token,
                              uint8_t           mac_addr[6]);
 
+/**
+ * dpni_add_mac_addr() - Add MAC address filter
+ * @mc_io:     Pointer to MC portal's I/O object
+ * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
+ * @token:     Token of DPNI object
+ * @mac_addr:  MAC address to add
+ *
+ * Return:     '0' on Success; Error code otherwise.
+ */
+int dpni_add_mac_addr(struct fsl_mc_io *mc_io,
+                     uint32_t          cmd_flags,
+                     uint16_t          token,
+                     const uint8_t     mac_addr[6]);
+
+/**
+ * dpni_remove_mac_addr() - Remove MAC address filter
+ * @mc_io:     Pointer to MC portal's I/O object
+ * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
+ * @token:     Token of DPNI object
+ * @mac_addr:  MAC address to remove
+ *
+ * Return:     '0' on Success; Error code otherwise.
+ */
+int dpni_remove_mac_addr(struct fsl_mc_io      *mc_io,
+                        uint32_t               cmd_flags,
+                        uint16_t               token,
+                        const uint8_t          mac_addr[6]);
+
+/**
+ * dpni_clear_mac_filters() - Clear all unicast and/or multicast MAC filters
+ * @mc_io:     Pointer to MC portal's I/O object
+ * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
+ * @token:     Token of DPNI object
+ * @unicast:   Set to '1' to clear unicast addresses
+ * @multicast: Set to '1' to clear multicast addresses
+ *
+ * The primary MAC address is not cleared by this operation.
+ *
+ * Return:     '0' on Success; Error code otherwise.
+ */
+int dpni_clear_mac_filters(struct fsl_mc_io    *mc_io,
+                          uint32_t             cmd_flags,
+                          uint16_t             token,
+                          int                  unicast,
+                          int                  multicast);
 
 /**
  * dpni_get_port_mac_addr() - Retrieve MAC address associated to the physical
@@ -872,6 +944,60 @@ int dpni_get_port_mac_addr(struct fsl_mc_io        *mc_io,
                           uint16_t             token,
                           uint8_t              mac_addr[6]);
 
+/**
+ * dpni_enable_vlan_filter() - Enable/disable VLAN filtering mode
+ * @mc_io:     Pointer to MC portal's I/O object
+ * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
+ * @token:     Token of DPNI object
+ * @en:                Set to '1' to enable; '0' to disable
+ *
+ * Return:     '0' on Success; Error code otherwise.
+ */
+int dpni_enable_vlan_filter(struct fsl_mc_io   *mc_io,
+                           uint32_t            cmd_flags,
+                           uint16_t            token,
+                           int                 en);
+
+/**
+ * dpni_add_vlan_id() - Add VLAN ID filter
+ * @mc_io:     Pointer to MC portal's I/O object
+ * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
+ * @token:     Token of DPNI object
+ * @vlan_id:   VLAN ID to add
+ *
+ * Return:     '0' on Success; Error code otherwise.
+ */
+int dpni_add_vlan_id(struct fsl_mc_io  *mc_io,
+                    uint32_t           cmd_flags,
+                    uint16_t           token,
+                    uint16_t           vlan_id);
+
+/**
+ * dpni_remove_vlan_id() - Remove VLAN ID filter
+ * @mc_io:     Pointer to MC portal's I/O object
+ * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
+ * @token:     Token of DPNI object
+ * @vlan_id:   VLAN ID to remove
+ *
+ * Return:     '0' on Success; Error code otherwise.
+ */
+int dpni_remove_vlan_id(struct fsl_mc_io       *mc_io,
+                       uint32_t                cmd_flags,
+                       uint16_t                token,
+                       uint16_t                vlan_id);
+
+/**
+ * dpni_clear_vlan_filters() - Clear all VLAN filters
+ * @mc_io:     Pointer to MC portal's I/O object
+ * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
+ * @token:     Token of DPNI object
+ *
+ * Return:     '0' on Success; Error code otherwise.
+ */
+int dpni_clear_vlan_filters(struct fsl_mc_io   *mc_io,
+                           uint32_t            cmd_flags,
+                           uint16_t            token);
+
 /**
  * enum dpni_dist_mode - DPNI distribution mode
  * @DPNI_DIST_MODE_NONE: No distribution