net/sfc/base: update autogenerated headers from firmwaresrc
[dpdk.git] / drivers / net / i40e / base / i40e_common.c
index 4db79a9..e0a5be1 100644 (file)
@@ -310,6 +310,8 @@ const char *i40e_stat_str(struct i40e_hw *hw, enum i40e_status_code stat_err)
                return "I40E_NOT_SUPPORTED";
        case I40E_ERR_FIRMWARE_API_VERSION:
                return "I40E_ERR_FIRMWARE_API_VERSION";
+       case I40E_ERR_ADMIN_QUEUE_CRITICAL_ERROR:
+               return "I40E_ERR_ADMIN_QUEUE_CRITICAL_ERROR";
        }
 
        snprintf(hw->err_str, sizeof(hw->err_str), "%d", stat_err);
@@ -1586,6 +1588,7 @@ u32 i40e_led_get(struct i40e_hw *hw)
                case I40E_COMBINED_ACTIVITY:
                case I40E_FILTER_ACTIVITY:
                case I40E_MAC_ACTIVITY:
+               case I40E_LINK_ACTIVITY:
                        continue;
                default:
                        break;
@@ -1634,6 +1637,7 @@ void i40e_led_set(struct i40e_hw *hw, u32 mode, bool blink)
                case I40E_COMBINED_ACTIVITY:
                case I40E_FILTER_ACTIVITY:
                case I40E_MAC_ACTIVITY:
+               case I40E_LINK_ACTIVITY:
                        continue;
                default:
                        break;
@@ -1644,9 +1648,6 @@ void i40e_led_set(struct i40e_hw *hw, u32 mode, bool blink)
                gpio_val |= ((mode << I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT) &
                             I40E_GLGEN_GPIO_CTL_LED_MODE_MASK);
 
-               if (mode == I40E_LINK_ACTIVITY)
-                       blink = false;
-
                if (blink)
                        gpio_val |= BIT(I40E_GLGEN_GPIO_CTL_LED_BLINK_SHIFT);
                else
@@ -2024,7 +2025,11 @@ enum i40e_status_code i40e_aq_get_link_info(struct i40e_hw *hw,
 
        if (hw->aq.api_maj_ver == I40E_FW_API_VERSION_MAJOR &&
            hw->aq.api_min_ver >= 7) {
-               hw->phy.phy_types = LE32_TO_CPU(*(__le32 *)resp->link_type);
+               __le32 tmp;
+
+               i40e_memcpy(&tmp, resp->link_type, sizeof(tmp),
+                           I40E_NONDMA_TO_NONDMA);
+               hw->phy.phy_types = LE32_TO_CPU(tmp);
                hw->phy.phy_types |= ((u64)resp->link_type_ext << 32);
        }
 
@@ -4074,13 +4079,14 @@ exit:
  * @length: length of the section to be written (in bytes from the offset)
  * @data: command buffer (size [bytes] = length)
  * @last_command: tells if this is the last command in a series
+ * @preservation_flags: Preservation mode flags
  * @cmd_details: pointer to command details structure or NULL
  *
  * Update the NVM using the admin queue commands
  **/
 enum i40e_status_code i40e_aq_update_nvm(struct i40e_hw *hw, u8 module_pointer,
                                u32 offset, u16 length, void *data,
-                               bool last_command,
+                               bool last_command, u8 preservation_flags,
                                struct i40e_asq_cmd_details *cmd_details)
 {
        struct i40e_aq_desc desc;
@@ -4101,6 +4107,16 @@ enum i40e_status_code i40e_aq_update_nvm(struct i40e_hw *hw, u8 module_pointer,
        /* If this is the last command in a series, set the proper flag. */
        if (last_command)
                cmd->command_flags |= I40E_AQ_NVM_LAST_CMD;
+       if (hw->mac.type == I40E_MAC_X722) {
+               if (preservation_flags == I40E_NVM_PRESERVATION_FLAGS_SELECTED)
+                       cmd->command_flags |=
+                               (I40E_AQ_NVM_PRESERVATION_FLAGS_SELECTED <<
+                                I40E_AQ_NVM_PRESERVATION_FLAGS_SHIFT);
+               else if (preservation_flags == I40E_NVM_PRESERVATION_FLAGS_ALL)
+                       cmd->command_flags |=
+                               (I40E_AQ_NVM_PRESERVATION_FLAGS_ALL <<
+                                I40E_AQ_NVM_PRESERVATION_FLAGS_SHIFT);
+       }
        cmd->module_pointer = module_pointer;
        cmd->offset = CPU_TO_LE32(offset);
        cmd->length = CPU_TO_LE16(length);
@@ -4115,6 +4131,28 @@ i40e_aq_update_nvm_exit:
        return status;
 }
 
+/**
+ * i40e_aq_nvm_progress
+ * @hw: pointer to the hw struct
+ * @progress: pointer to progress returned from AQ
+ * @cmd_details: pointer to command details structure or NULL
+ *
+ * Gets progress of flash rearrangement process
+ **/
+enum i40e_status_code i40e_aq_nvm_progress(struct i40e_hw *hw, u8 *progress,
+                               struct i40e_asq_cmd_details *cmd_details)
+{
+       enum i40e_status_code status;
+       struct i40e_aq_desc desc;
+
+       DEBUGFUNC("i40e_aq_nvm_progress");
+
+       i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_nvm_progress);
+       status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details);
+       *progress = desc.params.raw[0];
+       return status;
+}
+
 /**
  * i40e_aq_get_lldp_mib
  * @hw: pointer to the hw struct
@@ -7133,9 +7171,9 @@ void i40e_vf_parse_hw_config(struct i40e_hw *hw,
        hw->dev_caps.num_rx_qp = msg->num_queue_pairs;
        hw->dev_caps.num_tx_qp = msg->num_queue_pairs;
        hw->dev_caps.num_msix_vectors_vf = msg->max_vectors;
-       hw->dev_caps.dcb = msg->vf_offload_flags &
+       hw->dev_caps.dcb = msg->vf_cap_flags &
                           VIRTCHNL_VF_OFFLOAD_L2;
-       hw->dev_caps.iwarp = (msg->vf_offload_flags &
+       hw->dev_caps.iwarp = (msg->vf_cap_flags &
                              VIRTCHNL_VF_OFFLOAD_IWARP) ? 1 : 0;
        for (i = 0; i < msg->num_vsis; i++) {
                if (vsi_res->vsi_type == VIRTCHNL_VSI_SRIOV) {