summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/intel/i40e/i40e_type.h
diff options
context:
space:
mode:
authorIvan Vecera <ivecera@redhat.com>2023-10-13 20:07:54 +0300
committerDavid S. Miller <davem@davemloft.net>2023-10-15 16:33:41 +0300
commitdf19ea696644bea14dc2b804066a6b91aa4aaf43 (patch)
treeb4b725f1a913913b1b1ec16157b4a59b686a0cb7 /drivers/net/ethernet/intel/i40e/i40e_type.h
parent5a423552e0d9bb882f22cb0bf85f520ca2692706 (diff)
downloadlinux-df19ea696644bea14dc2b804066a6b91aa4aaf43.tar.xz
i40e: Refactor and rename i40e_read_pba_string()
Function i40e_read_pba_string() is currently unused but will be used by subsequent patch to provide board ID via devlink device info. The function reads PBA block from NVM so it cannot be called during adapter reset and as we would like to provide PBA ID via devlink info it is better to read the PBA ID during i40e_probe() and cache it in i40e_hw structure to avoid a waiting for potential adapter reset in devlink info callback. So... - Remove pba_num and pba_num_size arguments from the function, allocate resource managed buffer to store PBA ID string and save resulting pointer to i40e_hw->pba_id field - Make the function void as the PBA ID can be missing and in this case (or in case of NVM reading failure) the i40e_hw->pba_id will be NULL - Rename the function to i40e_get_pba_string() to align with other functions like i40e_get_oem_version() i40e_get_port_mac_addr()... - Call this function on init during i40e_probe() Signed-off-by: Ivan Vecera <ivecera@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/intel/i40e/i40e_type.h')
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_type.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e_type.h b/drivers/net/ethernet/intel/i40e/i40e_type.h
index dc7cd16ad8fb..aff6dc6afbe2 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_type.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_type.h
@@ -493,6 +493,9 @@ struct i40e_hw {
struct i40e_nvm_info nvm;
struct i40e_fc_info fc;
+ /* PBA ID */
+ const char *pba_id;
+
/* pci info */
u16 device_id;
u16 vendor_id;