1 // SPDX-License-Identifier: GPL-2.0 2 /* Copyright (C) 2019-2021, Intel Corporation. */ 3 4 #include "ice_vsi_vlan_ops.h" 5 #include "ice_vsi_vlan_lib.h" 6 #include "ice_vlan_mode.h" 7 #include "ice.h" 8 #include "ice_pf_vsi_vlan_ops.h" 9 ice_pf_vsi_init_vlan_ops(struct ice_vsi * vsi)10void ice_pf_vsi_init_vlan_ops(struct ice_vsi *vsi) 11 { 12 struct ice_vsi_vlan_ops *vlan_ops; 13 14 if (ice_is_dvm_ena(&vsi->back->hw)) { 15 vlan_ops = &vsi->outer_vlan_ops; 16 17 vlan_ops->add_vlan = ice_vsi_add_vlan; 18 vlan_ops->del_vlan = ice_vsi_del_vlan; 19 vlan_ops->ena_stripping = ice_vsi_ena_outer_stripping; 20 vlan_ops->dis_stripping = ice_vsi_dis_outer_stripping; 21 vlan_ops->ena_insertion = ice_vsi_ena_outer_insertion; 22 vlan_ops->dis_insertion = ice_vsi_dis_outer_insertion; 23 vlan_ops->ena_rx_filtering = ice_vsi_ena_rx_vlan_filtering; 24 vlan_ops->dis_rx_filtering = ice_vsi_dis_rx_vlan_filtering; 25 } else { 26 vlan_ops = &vsi->inner_vlan_ops; 27 28 vlan_ops->add_vlan = ice_vsi_add_vlan; 29 vlan_ops->del_vlan = ice_vsi_del_vlan; 30 vlan_ops->ena_stripping = ice_vsi_ena_inner_stripping; 31 vlan_ops->dis_stripping = ice_vsi_dis_inner_stripping; 32 vlan_ops->ena_insertion = ice_vsi_ena_inner_insertion; 33 vlan_ops->dis_insertion = ice_vsi_dis_inner_insertion; 34 vlan_ops->ena_rx_filtering = ice_vsi_ena_rx_vlan_filtering; 35 vlan_ops->dis_rx_filtering = ice_vsi_dis_rx_vlan_filtering; 36 } 37 } 38 39