i40e/base: add OEM post update
authorJingjing Wu <jingjing.wu@intel.com>
Sun, 6 Sep 2015 07:11:29 +0000 (15:11 +0800)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Thu, 1 Oct 2015 23:35:22 +0000 (01:35 +0200)
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
drivers/net/i40e/base/i40e_adminq_cmd.h
drivers/net/i40e/base/i40e_common.c
drivers/net/i40e/base/i40e_prototype.h

index aaf9f22..6365e55 100644 (file)
@@ -234,6 +234,7 @@ enum i40e_admin_queue_opc {
        i40e_aqc_opc_nvm_update                 = 0x0703,
        i40e_aqc_opc_nvm_config_read            = 0x0704,
        i40e_aqc_opc_nvm_config_write           = 0x0705,
+       i40e_aqc_opc_oem_post_update            = 0x0720,
 
        /* virtualization commands */
        i40e_aqc_opc_send_msg_to_pf             = 0x0801,
@@ -1886,6 +1887,26 @@ struct i40e_aqc_nvm_config_data_immediate_field {
 
 I40E_CHECK_STRUCT_LEN(0xc, i40e_aqc_nvm_config_data_immediate_field);
 
+/* OEM Post Update (indirect 0x0720)
+ * no command data struct used
+ */
+ struct i40e_aqc_nvm_oem_post_update {
+#define I40E_AQ_NVM_OEM_POST_UPDATE_EXTERNAL_DATA      0x01
+       u8 sel_data;
+       u8 reserved[7];
+};
+
+I40E_CHECK_STRUCT_LEN(0x8, i40e_aqc_nvm_oem_post_update);
+
+struct i40e_aqc_nvm_oem_post_update_buffer {
+       u8 str_len;
+       u8 dev_addr;
+       __le16 eeprom_addr;
+       u8 data[36];
+};
+
+I40E_CHECK_STRUCT_LEN(0x28, i40e_aqc_nvm_oem_post_update_buffer);
+
 /* Send to PF command (indirect 0x0801) id is only used by PF
  * Send to VF command (indirect 0x0802) id is only used by PF
  * Send to Peer PF command (indirect 0x0803)
index d476274..20bbce1 100644 (file)
@@ -3060,6 +3060,28 @@ enum i40e_status_code i40e_aq_write_nvm_config(struct i40e_hw *hw,
        return status;
 }
 
+/**
+ * i40e_aq_oem_post_update - triggers an OEM specific flow after update
+ * @hw: pointer to the hw struct
+ * @cmd_details: pointer to command details structure or NULL
+ **/
+enum i40e_status_code i40e_aq_oem_post_update(struct i40e_hw *hw,
+                               void *buff, u16 buff_size,
+                               struct i40e_asq_cmd_details *cmd_details)
+{
+       struct i40e_aq_desc desc;
+       enum i40e_status_code status;
+
+       UNREFERENCED_2PARAMETER(buff, buff_size);
+
+       i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_oem_post_update);
+       status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details);
+       if (status && LE16_TO_CPU(desc.retval) == I40E_AQ_RC_ESRCH)
+               status = I40E_ERR_NOT_IMPLEMENTED;
+
+       return status;
+}
+
 /**
  * i40e_aq_erase_nvm
  * @hw: pointer to the hw struct
index 2f992da..f4f21c8 100644 (file)
@@ -214,6 +214,9 @@ enum i40e_status_code i40e_aq_write_nvm_config(struct i40e_hw *hw,
                                u8 cmd_flags, void *data, u16 buf_size,
                                u16 element_count,
                                struct i40e_asq_cmd_details *cmd_details);
+enum i40e_status_code i40e_aq_oem_post_update(struct i40e_hw *hw,
+                               void *buff, u16 buff_size,
+                               struct i40e_asq_cmd_details *cmd_details);
 enum i40e_status_code i40e_aq_discover_capabilities(struct i40e_hw *hw,
                                void *buff, u16 buff_size, u16 *data_size,
                                enum i40e_admin_queue_opc list_type_opc,