diff options
4 files changed, 42 insertions, 0 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h b/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h index 7d888e05f96f..80e3eec6134e 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h +++ b/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h | |||
@@ -2247,6 +2247,8 @@ I40E_CHECK_CMD_LENGTH(i40e_aqc_phy_register_access); | |||
2247 | struct i40e_aqc_nvm_update { | 2247 | struct i40e_aqc_nvm_update { |
2248 | u8 command_flags; | 2248 | u8 command_flags; |
2249 | #define I40E_AQ_NVM_LAST_CMD 0x01 | 2249 | #define I40E_AQ_NVM_LAST_CMD 0x01 |
2250 | #define I40E_AQ_NVM_REARRANGE_TO_FLAT 0x20 | ||
2251 | #define I40E_AQ_NVM_REARRANGE_TO_STRUCT 0x40 | ||
2250 | #define I40E_AQ_NVM_FLASH_ONLY 0x80 | 2252 | #define I40E_AQ_NVM_FLASH_ONLY 0x80 |
2251 | #define I40E_AQ_NVM_PRESERVATION_FLAGS_SHIFT 1 | 2253 | #define I40E_AQ_NVM_PRESERVATION_FLAGS_SHIFT 1 |
2252 | #define I40E_AQ_NVM_PRESERVATION_FLAGS_MASK 0x03 | 2254 | #define I40E_AQ_NVM_PRESERVATION_FLAGS_MASK 0x03 |
diff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c b/drivers/net/ethernet/intel/i40e/i40e_common.c index eb2d1530d331..85f75b5978fc 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_common.c +++ b/drivers/net/ethernet/intel/i40e/i40e_common.c | |||
@@ -3541,6 +3541,41 @@ i40e_aq_update_nvm_exit: | |||
3541 | } | 3541 | } |
3542 | 3542 | ||
3543 | /** | 3543 | /** |
3544 | * i40e_aq_rearrange_nvm | ||
3545 | * @hw: pointer to the hw struct | ||
3546 | * @rearrange_nvm: defines direction of rearrangement | ||
3547 | * @cmd_details: pointer to command details structure or NULL | ||
3548 | * | ||
3549 | * Rearrange NVM structure, available only for transition FW | ||
3550 | **/ | ||
3551 | i40e_status i40e_aq_rearrange_nvm(struct i40e_hw *hw, | ||
3552 | u8 rearrange_nvm, | ||
3553 | struct i40e_asq_cmd_details *cmd_details) | ||
3554 | { | ||
3555 | struct i40e_aqc_nvm_update *cmd; | ||
3556 | i40e_status status; | ||
3557 | struct i40e_aq_desc desc; | ||
3558 | |||
3559 | cmd = (struct i40e_aqc_nvm_update *)&desc.params.raw; | ||
3560 | |||
3561 | i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_nvm_update); | ||
3562 | |||
3563 | rearrange_nvm &= (I40E_AQ_NVM_REARRANGE_TO_FLAT | | ||
3564 | I40E_AQ_NVM_REARRANGE_TO_STRUCT); | ||
3565 | |||
3566 | if (!rearrange_nvm) { | ||
3567 | status = I40E_ERR_PARAM; | ||
3568 | goto i40e_aq_rearrange_nvm_exit; | ||
3569 | } | ||
3570 | |||
3571 | cmd->command_flags |= rearrange_nvm; | ||
3572 | status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details); | ||
3573 | |||
3574 | i40e_aq_rearrange_nvm_exit: | ||
3575 | return status; | ||
3576 | } | ||
3577 | |||
3578 | /** | ||
3544 | * i40e_aq_get_lldp_mib | 3579 | * i40e_aq_get_lldp_mib |
3545 | * @hw: pointer to the hw struct | 3580 | * @hw: pointer to the hw struct |
3546 | * @bridge_type: type of bridge requested | 3581 | * @bridge_type: type of bridge requested |
diff --git a/drivers/net/ethernet/intel/i40e/i40e_prototype.h b/drivers/net/ethernet/intel/i40e/i40e_prototype.h index 3170655cdeb9..e08d754824b1 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_prototype.h +++ b/drivers/net/ethernet/intel/i40e/i40e_prototype.h | |||
@@ -193,6 +193,9 @@ i40e_status i40e_aq_update_nvm(struct i40e_hw *hw, u8 module_pointer, | |||
193 | u32 offset, u16 length, void *data, | 193 | u32 offset, u16 length, void *data, |
194 | bool last_command, u8 preservation_flags, | 194 | bool last_command, u8 preservation_flags, |
195 | struct i40e_asq_cmd_details *cmd_details); | 195 | struct i40e_asq_cmd_details *cmd_details); |
196 | i40e_status i40e_aq_rearrange_nvm(struct i40e_hw *hw, | ||
197 | u8 rearrange_nvm, | ||
198 | struct i40e_asq_cmd_details *cmd_details); | ||
196 | i40e_status i40e_aq_get_lldp_mib(struct i40e_hw *hw, u8 bridge_type, | 199 | i40e_status i40e_aq_get_lldp_mib(struct i40e_hw *hw, u8 bridge_type, |
197 | u8 mib_type, void *buff, u16 buff_size, | 200 | u8 mib_type, void *buff, u16 buff_size, |
198 | u16 *local_len, u16 *remote_len, | 201 | u16 *local_len, u16 *remote_len, |
diff --git a/drivers/net/ethernet/intel/i40evf/i40e_adminq_cmd.h b/drivers/net/ethernet/intel/i40evf/i40e_adminq_cmd.h index aa81e87cd471..5fd8529465d4 100644 --- a/drivers/net/ethernet/intel/i40evf/i40e_adminq_cmd.h +++ b/drivers/net/ethernet/intel/i40evf/i40e_adminq_cmd.h | |||
@@ -2175,6 +2175,8 @@ I40E_CHECK_CMD_LENGTH(i40e_aqc_phy_register_access); | |||
2175 | struct i40e_aqc_nvm_update { | 2175 | struct i40e_aqc_nvm_update { |
2176 | u8 command_flags; | 2176 | u8 command_flags; |
2177 | #define I40E_AQ_NVM_LAST_CMD 0x01 | 2177 | #define I40E_AQ_NVM_LAST_CMD 0x01 |
2178 | #define I40E_AQ_NVM_REARRANGE_TO_FLAT 0x20 | ||
2179 | #define I40E_AQ_NVM_REARRANGE_TO_STRUCT 0x40 | ||
2178 | #define I40E_AQ_NVM_FLASH_ONLY 0x80 | 2180 | #define I40E_AQ_NVM_FLASH_ONLY 0x80 |
2179 | #define I40E_AQ_NVM_PRESERVATION_FLAGS_SHIFT 1 | 2181 | #define I40E_AQ_NVM_PRESERVATION_FLAGS_SHIFT 1 |
2180 | #define I40E_AQ_NVM_PRESERVATION_FLAGS_MASK 0x03 | 2182 | #define I40E_AQ_NVM_PRESERVATION_FLAGS_MASK 0x03 |