| .. | .. |
|---|
| 1 | 1 | // SPDX-License-Identifier: GPL-2.0 |
|---|
| 2 | 2 | /* Copyright(c) 2013 - 2018 Intel Corporation. */ |
|---|
| 3 | 3 | |
|---|
| 4 | +#include "i40e.h" |
|---|
| 4 | 5 | #include "i40e_osdep.h" |
|---|
| 5 | 6 | #include "i40e_register.h" |
|---|
| 6 | 7 | #include "i40e_type.h" |
|---|
| .. | .. |
|---|
| 658 | 659 | |
|---|
| 659 | 660 | #define I40E_HMC_STORE(_struct, _ele) \ |
|---|
| 660 | 661 | offsetof(struct _struct, _ele), \ |
|---|
| 661 | | - FIELD_SIZEOF(struct _struct, _ele) |
|---|
| 662 | + sizeof_field(struct _struct, _ele) |
|---|
| 662 | 663 | |
|---|
| 663 | 664 | struct i40e_context_ele { |
|---|
| 664 | 665 | u16 offset; |
|---|
| .. | .. |
|---|
| 963 | 964 | |
|---|
| 964 | 965 | /** |
|---|
| 965 | 966 | * 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 |
|---|
| 967 | 968 | * @object_base: pointer to u64 to get the va |
|---|
| 968 | 969 | * @rsrc_type: the hmc resource type |
|---|
| 969 | 970 | * @obj_idx: hmc object index |
|---|
| .. | .. |
|---|
| 972 | 973 | * base pointer. This function is used for LAN Queue contexts. |
|---|
| 973 | 974 | **/ |
|---|
| 974 | 975 | 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) |
|---|
| 979 | 979 | { |
|---|
| 980 | + struct i40e_hmc_info *hmc_info = &hw->hmc; |
|---|
| 980 | 981 | u32 obj_offset_in_sd, obj_offset_in_pd; |
|---|
| 981 | | - i40e_status ret_code = 0; |
|---|
| 982 | 982 | struct i40e_hmc_sd_entry *sd_entry; |
|---|
| 983 | 983 | struct i40e_hmc_pd_entry *pd_entry; |
|---|
| 984 | 984 | u32 pd_idx, pd_lmt, rel_pd_idx; |
|---|
| 985 | + i40e_status ret_code = 0; |
|---|
| 985 | 986 | u64 obj_offset_in_fpm; |
|---|
| 986 | 987 | u32 sd_idx, sd_lmt; |
|---|
| 987 | 988 | |
|---|
| .. | .. |
|---|
| 1047 | 1048 | i40e_status err; |
|---|
| 1048 | 1049 | u8 *context_bytes; |
|---|
| 1049 | 1050 | |
|---|
| 1050 | | - err = i40e_hmc_get_object_va(&hw->hmc, &context_bytes, |
|---|
| 1051 | + err = i40e_hmc_get_object_va(hw, &context_bytes, |
|---|
| 1051 | 1052 | I40E_HMC_LAN_TX, queue); |
|---|
| 1052 | 1053 | if (err < 0) |
|---|
| 1053 | 1054 | return err; |
|---|
| .. | .. |
|---|
| 1068 | 1069 | i40e_status err; |
|---|
| 1069 | 1070 | u8 *context_bytes; |
|---|
| 1070 | 1071 | |
|---|
| 1071 | | - err = i40e_hmc_get_object_va(&hw->hmc, &context_bytes, |
|---|
| 1072 | + err = i40e_hmc_get_object_va(hw, &context_bytes, |
|---|
| 1072 | 1073 | I40E_HMC_LAN_TX, queue); |
|---|
| 1073 | 1074 | if (err < 0) |
|---|
| 1074 | 1075 | return err; |
|---|
| .. | .. |
|---|
| 1088 | 1089 | i40e_status err; |
|---|
| 1089 | 1090 | u8 *context_bytes; |
|---|
| 1090 | 1091 | |
|---|
| 1091 | | - err = i40e_hmc_get_object_va(&hw->hmc, &context_bytes, |
|---|
| 1092 | + err = i40e_hmc_get_object_va(hw, &context_bytes, |
|---|
| 1092 | 1093 | I40E_HMC_LAN_RX, queue); |
|---|
| 1093 | 1094 | if (err < 0) |
|---|
| 1094 | 1095 | return err; |
|---|
| .. | .. |
|---|
| 1109 | 1110 | i40e_status err; |
|---|
| 1110 | 1111 | u8 *context_bytes; |
|---|
| 1111 | 1112 | |
|---|
| 1112 | | - err = i40e_hmc_get_object_va(&hw->hmc, &context_bytes, |
|---|
| 1113 | + err = i40e_hmc_get_object_va(hw, &context_bytes, |
|---|
| 1113 | 1114 | I40E_HMC_LAN_RX, queue); |
|---|
| 1114 | 1115 | if (err < 0) |
|---|
| 1115 | 1116 | return err; |
|---|