summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/intel/i40e/i40e_ddp.c
diff options
context:
space:
mode:
authorIvan Vecera <ivecera@redhat.com>2023-09-27 11:31:35 +0300
committerTony Nguyen <anthony.l.nguyen@intel.com>2023-10-05 19:18:15 +0300
commit190c3ad68f389ef06e82c3a08c1d0bea57379d93 (patch)
tree10b6880046b150c555fec725a4cac64ce01cca7f /drivers/net/ethernet/intel/i40e/i40e_ddp.c
parent56df345917c09ffc00b7834f88990a7a7c338b5c (diff)
downloadlinux-190c3ad68f389ef06e82c3a08c1d0bea57379d93.tar.xz
i40e: Move DDP specific macros and structures to i40e_ddp.c
Move several DDP related macros and structures from i40e.h header to i40e_ddp.c where are privately used. Make static i40e_ddp_load() function that is also used only in i40e_ddp and move declaration of i40e_ddp_flash() used by i40e_ethtool.c to i40e_prototype.h Signed-off-by: Ivan Vecera <ivecera@redhat.com> Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com> Reviewed-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com> Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com> (A Contingent worker at Intel) Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/i40e/i40e_ddp.c')
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_ddp.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e_ddp.c b/drivers/net/ethernet/intel/i40e/i40e_ddp.c
index 21b3518c4096..6b68b6575a1d 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_ddp.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_ddp.c
@@ -4,6 +4,24 @@
#include <linux/firmware.h>
#include "i40e.h"
+#define I40_DDP_FLASH_REGION 100
+#define I40E_PROFILE_INFO_SIZE 48
+#define I40E_MAX_PROFILE_NUM 16
+#define I40E_PROFILE_LIST_SIZE \
+ (I40E_PROFILE_INFO_SIZE * I40E_MAX_PROFILE_NUM + 4)
+#define I40E_DDP_PROFILE_PATH "intel/i40e/ddp/"
+#define I40E_DDP_PROFILE_NAME_MAX 64
+
+struct i40e_ddp_profile_list {
+ u32 p_count;
+ struct i40e_profile_info p_info[];
+};
+
+struct i40e_ddp_old_profile_list {
+ struct list_head list;
+ size_t old_ddp_size;
+ u8 old_ddp_buf[];
+};
/**
* i40e_ddp_profiles_eq - checks if DDP profiles are the equivalent
@@ -261,8 +279,8 @@ static bool i40e_ddp_is_pkg_hdr_valid(struct net_device *netdev,
* Checks correctness and loads DDP profile to the NIC. The function is
* also used for rolling back previously loaded profile.
**/
-int i40e_ddp_load(struct net_device *netdev, const u8 *data, size_t size,
- bool is_add)
+static int i40e_ddp_load(struct net_device *netdev, const u8 *data, size_t size,
+ bool is_add)
{
u8 profile_info_sec[sizeof(struct i40e_profile_section_header) +
sizeof(struct i40e_profile_info)];