Lines Matching +full:supported +full:- +full:hw

1 /* SPDX-License-Identifier: BSD-3-Clause */
36 * ice_pkg_get_supported_vlan_mode - chk if DDP supports Double VLAN mode (DVM)
37 * @hw: pointer to the HW struct
41 ice_pkg_get_supported_vlan_mode(struct ice_hw *hw, bool *dvm)
51 bld = ice_pkg_buf_alloc_single_section(hw,
58 sect->count = CPU_TO_LE16(1);
59 sect->offset = CPU_TO_LE16(ICE_META_VLAN_MODE_ENTRY);
61 status = ice_aq_upload_section(hw,
71 arr[i] = LE32_TO_CPU(sect->entry[0].bm[i]);
75 /* check if DVM is supported */
79 ice_pkg_buf_free(hw, bld);
85 * ice_aq_get_vlan_mode - get the VLAN mode of the device
86 * @hw: pointer to the HW structure
92 ice_aq_get_vlan_mode(struct ice_hw *hw,
103 return ice_aq_send_cmd(hw, &desc, get_params, sizeof(*get_params),
108 * ice_aq_is_dvm_ena - query FW to check if double VLAN mode is enabled
109 * @hw: pointer to the HW structure
118 static bool ice_aq_is_dvm_ena(struct ice_hw *hw)
123 status = ice_aq_get_vlan_mode(hw, &get_params);
125 ice_debug(hw, ICE_DBG_AQ, "Failed to get VLAN mode, status %d\n",
134 * ice_is_dvm_ena - check if double VLAN mode is enabled
135 * @hw: pointer to the HW structure
142 bool ice_is_dvm_ena(struct ice_hw *hw)
144 return hw->dvm_ena;
148 * ice_cache_vlan_mode - cache VLAN mode after DDP is downloaded
149 * @hw: pointer to the HW structure
155 static void ice_cache_vlan_mode(struct ice_hw *hw)
157 hw->dvm_ena = ice_aq_is_dvm_ena(hw) ? true : false;
161 * ice_pkg_supports_dvm - find out if DDP supports DVM
162 * @hw: pointer to the HW structure
164 static bool ice_pkg_supports_dvm(struct ice_hw *hw)
169 status = ice_pkg_get_supported_vlan_mode(hw, &pkg_supports_dvm);
171 ice_debug(hw, ICE_DBG_PKG, "Failed to get supported VLAN mode, status %d\n",
180 * ice_fw_supports_dvm - find out if FW supports DVM
181 * @hw: pointer to the HW structure
183 static bool ice_fw_supports_dvm(struct ice_hw *hw)
191 status = ice_aq_get_vlan_mode(hw, &get_vlan_mode);
193 ice_debug(hw, ICE_DBG_NVM, "Failed to get VLAN mode, status %d\n",
202 * ice_is_dvm_supported - check if Double VLAN Mode is supported
203 * @hw: pointer to the hardware structure
205 * Returns true if Double VLAN Mode (DVM) is supported and false if only Single
206 * VLAN Mode (SVM) is supported. In order for DVM to be supported the DDP and
207 * firmware must support it, otherwise only SVM is supported. This function
211 static bool ice_is_dvm_supported(struct ice_hw *hw)
213 if (!ice_pkg_supports_dvm(hw)) {
214 ice_debug(hw, ICE_DBG_PKG, "DDP doesn't support DVM\n");
218 if (!ice_fw_supports_dvm(hw)) {
219 ice_debug(hw, ICE_DBG_PKG, "FW doesn't support DVM\n");
227 * ice_aq_set_vlan_mode - set the VLAN mode of the device
228 * @hw: pointer to the HW structure
234 ice_aq_set_vlan_mode(struct ice_hw *hw,
243 if (set_params->l2tag_prio_tagging > ICE_AQ_VLAN_PRIO_TAG_MAX)
246 rdma_packet = set_params->rdma_packet;
251 mng_vlan_prot_id = set_params->mng_vlan_prot_id;
260 return ice_aq_send_cmd(hw, &desc, set_params, sizeof(*set_params),
265 * ice_set_svm - set single VLAN mode
266 * @hw: pointer to the HW structure
268 static int ice_set_svm(struct ice_hw *hw)
273 status = ice_aq_set_port_params(hw->port_info, 0, false, false, false, NULL);
275 ice_debug(hw, ICE_DBG_INIT, "Failed to set port parameters for single VLAN mode\n");
280 ice_malloc(hw, sizeof(*set_params));
285 set_params->l2tag_prio_tagging = ICE_AQ_VLAN_PRIO_TAG_INNER_CTAG;
286 set_params->rdma_packet = ICE_AQ_SVM_VLAN_RDMA_PKT_FLAG_SETTING;
287 set_params->mng_vlan_prot_id = ICE_AQ_VLAN_MNG_PROTOCOL_ID_INNER;
289 status = ice_aq_set_vlan_mode(hw, set_params);
291 ice_debug(hw, ICE_DBG_INIT, "Failed to configure port in single VLAN mode\n");
293 ice_free(hw, set_params);
299 * @hw: pointer to the HW structure
301 int ice_set_vlan_mode(struct ice_hw *hw)
303 if (!ice_is_dvm_supported(hw))
306 return ice_set_svm(hw);
310 * ice_post_pkg_dwnld_vlan_mode_cfg - configure VLAN mode after DDP download
311 * @hw: pointer to the HW structure
322 void ice_post_pkg_dwnld_vlan_mode_cfg(struct ice_hw *hw)
324 ice_cache_vlan_mode(hw);