drivers/net/ethernet/intel/ixgbe/ixgbe_fw_update.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/intel/ixgbe/ixgbe_fw_update.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/intel/ixgbe/ixgbe_fw_update.c- Extension
.c- Size
- 21097 bytes
- Lines
- 708
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/crc32.hlinux/pldmfw.hlinux/uuid.hixgbe.hixgbe_fw_update.h
Detected Declarations
struct ixgbe_fwu_privfunction ixgbe_send_package_datafunction ixgbe_check_component_responsefunction ixgbe_send_component_tablefunction ixgbe_write_one_nvm_blockfunction ixgbe_write_nvm_modulefunction ixgbe_erase_nvm_modulefunction ixgbe_switch_flash_banksfunction ixgbe_flash_componentfunction ixgbe_finalize_updatefunction ixgbe_get_pending_updatesfunction ixgbe_cancel_pending_updatefunction ixgbe_flash_pldm_image
Annotated Snippet
struct ixgbe_fwu_priv {
struct pldmfw context;
struct ixgbe_adapter *adapter;
struct netlink_ext_ack *extack;
/* Track which NVM banks to activate at the end of the update */
u8 activate_flags;
bool emp_reset_available;
};
/**
* ixgbe_send_package_data - Send record package data to firmware
* @context: PLDM fw update structure
* @data: pointer to the package data
* @length: length of the package data
*
* Send a copy of the package data associated with the PLDM record matching
* this device to the firmware.
*
* Note that this function sends an AdminQ command that will fail unless the
* NVM resource has been acquired.
*
* Return: zero on success, or a negative error code on failure.
*/
static int ixgbe_send_package_data(struct pldmfw *context,
const u8 *data, u16 length)
{
struct ixgbe_fwu_priv *priv = container_of(context,
struct ixgbe_fwu_priv,
context);
struct ixgbe_adapter *adapter = priv->adapter;
struct ixgbe_hw *hw = &adapter->hw;
u8 *package_data;
int err;
package_data = kmemdup(data, length, GFP_KERNEL);
if (!package_data)
return -ENOMEM;
err = ixgbe_nvm_set_pkg_data(hw, false, package_data, length);
kfree(package_data);
return err;
}
/**
* ixgbe_check_component_response - Report firmware response to a component
* @adapter: device private data structure
* @response: indicates whether this component can be updated
* @code: code indicating reason for response
* @extack: netlink extended ACK structure
*
* Check whether firmware indicates if this component can be updated. Report
* a suitable error message over the netlink extended ACK if the component
* cannot be updated.
*
* Return: 0 if the component can be updated, or -ECANCELED if the
* firmware indicates the component cannot be updated.
*/
static int ixgbe_check_component_response(struct ixgbe_adapter *adapter,
u8 response, u8 code,
struct netlink_ext_ack *extack)
{
struct ixgbe_hw *hw = &adapter->hw;
switch (response) {
case IXGBE_ACI_NVM_PASS_COMP_CAN_BE_UPDATED:
/* Firmware indicated this update is good to proceed. */
return 0;
case IXGBE_ACI_NVM_PASS_COMP_CAN_MAY_BE_UPDATEABLE:
NL_SET_ERR_MSG_MOD(extack,
"Firmware recommends not updating, as it may result in a downgrade. Continuing anyways");
return 0;
case IXGBE_ACI_NVM_PASS_COMP_CAN_NOT_BE_UPDATED:
NL_SET_ERR_MSG_MOD(extack, "Firmware has rejected updating.");
break;
case IXGBE_ACI_NVM_PASS_COMP_PARTIAL_CHECK:
if (hw->mac.ops.fw_recovery_mode &&
hw->mac.ops.fw_recovery_mode(hw))
return 0;
break;
}
switch (code) {
case IXGBE_ACI_NVM_PASS_COMP_STAMP_IDENTICAL_CODE:
NL_SET_ERR_MSG_MOD(extack,
"Component comparison stamp is identical to running image");
break;
Annotation
- Immediate include surface: `linux/crc32.h`, `linux/pldmfw.h`, `linux/uuid.h`, `ixgbe.h`, `ixgbe_fw_update.h`.
- Detected declarations: `struct ixgbe_fwu_priv`, `function ixgbe_send_package_data`, `function ixgbe_check_component_response`, `function ixgbe_send_component_table`, `function ixgbe_write_one_nvm_block`, `function ixgbe_write_nvm_module`, `function ixgbe_erase_nvm_module`, `function ixgbe_switch_flash_banks`, `function ixgbe_flash_component`, `function ixgbe_finalize_update`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.