hc
2023-12-11 6778948f9de86c3cfaf36725a7c87dcff9ba247f
kernel/drivers/net/ethernet/intel/i40e/i40e_lan_hmc.c
....@@ -1,6 +1,7 @@
11 // SPDX-License-Identifier: GPL-2.0
22 /* Copyright(c) 2013 - 2018 Intel Corporation. */
33
4
+#include "i40e.h"
45 #include "i40e_osdep.h"
56 #include "i40e_register.h"
67 #include "i40e_type.h"
....@@ -658,7 +659,7 @@
658659
659660 #define I40E_HMC_STORE(_struct, _ele) \
660661 offsetof(struct _struct, _ele), \
661
- FIELD_SIZEOF(struct _struct, _ele)
662
+ sizeof_field(struct _struct, _ele)
662663
663664 struct i40e_context_ele {
664665 u16 offset;
....@@ -963,7 +964,7 @@
963964
964965 /**
965966 * i40e_hmc_get_object_va - retrieves an object's virtual address
966
- * @hmc_info: pointer to i40e_hmc_info struct
967
+ * @hw: the hardware struct, from which we obtain the i40e_hmc_info pointer
967968 * @object_base: pointer to u64 to get the va
968969 * @rsrc_type: the hmc resource type
969970 * @obj_idx: hmc object index
....@@ -972,16 +973,16 @@
972973 * base pointer. This function is used for LAN Queue contexts.
973974 **/
974975 static
975
-i40e_status i40e_hmc_get_object_va(struct i40e_hmc_info *hmc_info,
976
- u8 **object_base,
977
- enum i40e_hmc_lan_rsrc_type rsrc_type,
978
- u32 obj_idx)
976
+i40e_status i40e_hmc_get_object_va(struct i40e_hw *hw, u8 **object_base,
977
+ enum i40e_hmc_lan_rsrc_type rsrc_type,
978
+ u32 obj_idx)
979979 {
980
+ struct i40e_hmc_info *hmc_info = &hw->hmc;
980981 u32 obj_offset_in_sd, obj_offset_in_pd;
981
- i40e_status ret_code = 0;
982982 struct i40e_hmc_sd_entry *sd_entry;
983983 struct i40e_hmc_pd_entry *pd_entry;
984984 u32 pd_idx, pd_lmt, rel_pd_idx;
985
+ i40e_status ret_code = 0;
985986 u64 obj_offset_in_fpm;
986987 u32 sd_idx, sd_lmt;
987988
....@@ -1047,7 +1048,7 @@
10471048 i40e_status err;
10481049 u8 *context_bytes;
10491050
1050
- err = i40e_hmc_get_object_va(&hw->hmc, &context_bytes,
1051
+ err = i40e_hmc_get_object_va(hw, &context_bytes,
10511052 I40E_HMC_LAN_TX, queue);
10521053 if (err < 0)
10531054 return err;
....@@ -1068,7 +1069,7 @@
10681069 i40e_status err;
10691070 u8 *context_bytes;
10701071
1071
- err = i40e_hmc_get_object_va(&hw->hmc, &context_bytes,
1072
+ err = i40e_hmc_get_object_va(hw, &context_bytes,
10721073 I40E_HMC_LAN_TX, queue);
10731074 if (err < 0)
10741075 return err;
....@@ -1088,7 +1089,7 @@
10881089 i40e_status err;
10891090 u8 *context_bytes;
10901091
1091
- err = i40e_hmc_get_object_va(&hw->hmc, &context_bytes,
1092
+ err = i40e_hmc_get_object_va(hw, &context_bytes,
10921093 I40E_HMC_LAN_RX, queue);
10931094 if (err < 0)
10941095 return err;
....@@ -1109,7 +1110,7 @@
11091110 i40e_status err;
11101111 u8 *context_bytes;
11111112
1112
- err = i40e_hmc_get_object_va(&hw->hmc, &context_bytes,
1113
+ err = i40e_hmc_get_object_va(hw, &context_bytes,
11131114 I40E_HMC_LAN_RX, queue);
11141115 if (err < 0)
11151116 return err;