Lines Matching refs:hw

8  * @hw: pointer to the HW struct
12 ice_pkg_get_supported_vlan_mode(struct ice_hw *hw, bool *dvm)
22 bld = ice_pkg_buf_alloc_single_section(hw,
32 status = ice_aq_upload_section(hw,
50 ice_pkg_buf_free(hw, bld);
57 * @hw: pointer to the HW structure
63 ice_aq_get_vlan_mode(struct ice_hw *hw,
74 return ice_aq_send_cmd(hw, &desc, get_params, sizeof(*get_params),
80 * @hw: pointer to the HW structure
89 static bool ice_aq_is_dvm_ena(struct ice_hw *hw)
94 status = ice_aq_get_vlan_mode(hw, &get_params);
96 ice_debug(hw, ICE_DBG_AQ, "Failed to get VLAN mode, status %d\n",
106 * @hw: pointer to the HW structure
113 bool ice_is_dvm_ena(struct ice_hw *hw)
115 return hw->dvm_ena;
120 * @hw: pointer to the HW structure
126 static void ice_cache_vlan_mode(struct ice_hw *hw)
128 hw->dvm_ena = ice_aq_is_dvm_ena(hw) ? true : false;
133 * @hw: pointer to the HW structure
135 static bool ice_pkg_supports_dvm(struct ice_hw *hw)
140 status = ice_pkg_get_supported_vlan_mode(hw, &pkg_supports_dvm);
142 ice_debug(hw, ICE_DBG_PKG, "Failed to get supported VLAN mode, status %d\n",
152 * @hw: pointer to the HW structure
154 static bool ice_fw_supports_dvm(struct ice_hw *hw)
162 status = ice_aq_get_vlan_mode(hw, &get_vlan_mode);
164 ice_debug(hw, ICE_DBG_NVM, "Failed to get VLAN mode, status %d\n",
174 * @hw: pointer to the hardware structure
182 static bool ice_is_dvm_supported(struct ice_hw *hw)
184 if (!ice_pkg_supports_dvm(hw)) {
185 ice_debug(hw, ICE_DBG_PKG, "DDP doesn't support DVM\n");
189 if (!ice_fw_supports_dvm(hw)) {
190 ice_debug(hw, ICE_DBG_PKG, "FW doesn't support DVM\n");
241 * @hw: hardware structure used to update the recipes
243 static int ice_dvm_update_dflt_recipes(struct ice_hw *hw)
253 status = ice_update_recipe_lkup_idx(hw, params);
255 ice_debug(hw, ICE_DBG_INIT, "Failed to update RID %d lkup_idx %d fv_idx %d mask_valid %s mask 0x%04x\n",
268 * @hw: pointer to the HW structure
274 ice_aq_set_vlan_mode(struct ice_hw *hw,
300 return ice_aq_send_cmd(hw, &desc, set_params, sizeof(*set_params),
306 * @hw: pointer to the hardware structure
308 static int ice_set_dvm(struct ice_hw *hw)
317 status = ice_aq_set_vlan_mode(hw, &params);
319 ice_debug(hw, ICE_DBG_INIT, "Failed to set double VLAN mode parameters, status %d\n",
324 status = ice_dvm_update_dflt_recipes(hw);
326 ice_debug(hw, ICE_DBG_INIT, "Failed to update default recipes for double VLAN mode, status %d\n",
331 status = ice_aq_set_port_params(hw->port_info, true, NULL);
333 ice_debug(hw, ICE_DBG_INIT, "Failed to set port in double VLAN mode, status %d\n",
338 status = ice_set_dvm_boost_entries(hw);
340 ice_debug(hw, ICE_DBG_INIT, "Failed to set boost TCAM entries for double VLAN mode, status %d\n",
350 * @hw: pointer to the HW structure
352 static int ice_set_svm(struct ice_hw *hw)
357 status = ice_aq_set_port_params(hw->port_info, false, NULL);
359 ice_debug(hw, ICE_DBG_INIT, "Failed to set port parameters for single VLAN mode\n");
363 set_params = devm_kzalloc(ice_hw_to_dev(hw), sizeof(*set_params),
373 status = ice_aq_set_vlan_mode(hw, set_params);
375 ice_debug(hw, ICE_DBG_INIT, "Failed to configure port in single VLAN mode\n");
377 devm_kfree(ice_hw_to_dev(hw), set_params);
383 * @hw: pointer to the HW structure
385 int ice_set_vlan_mode(struct ice_hw *hw)
387 if (!ice_is_dvm_supported(hw))
390 if (!ice_set_dvm(hw))
393 return ice_set_svm(hw);
398 * @hw: pointer to the HW structure
404 static void ice_print_dvm_not_supported(struct ice_hw *hw)
406 bool pkg_supports_dvm = ice_pkg_supports_dvm(hw);
407 bool fw_supports_dvm = ice_fw_supports_dvm(hw);
410 dev_info(ice_hw_to_dev(hw), "QinQ functionality cannot be enabled on this device. Update your DDP package and NVM to versions that support QinQ.\n");
412 dev_info(ice_hw_to_dev(hw), "QinQ functionality cannot be enabled on this device. Update your DDP package to a version that supports QinQ.\n");
414 dev_info(ice_hw_to_dev(hw), "QinQ functionality cannot be enabled on this device. Update your NVM to a version that supports QinQ.\n");
419 * @hw: pointer to the HW structure
430 void ice_post_pkg_dwnld_vlan_mode_cfg(struct ice_hw *hw)
432 ice_cache_vlan_mode(hw);
434 if (ice_is_dvm_ena(hw))
437 ice_print_dvm_not_supported(hw);