Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

crypto: qat - relocate and rename bank state structure definition

The `bank_state` structure represents the state of a bank of rings.
As part of recent refactoring, the functions that interact with this
structure have been moved to a new unit, adf_bank_state.c.

To align with this reorganization, rename `struct bank_state` to
`struct adf_bank_state` and move its definition to adf_bank_state.h.
Also relocate the associated `struct ring_config` to the same header
to consolidate related definitions.

Update all references to use the new structure name.

This does not introduce any functional change.

Signed-off-by: Suman Kumar Chakraborty <suman.kumar.chakraborty@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Suman Kumar Chakraborty and committed by
Herbert Xu
a47dc5d1 e9eec291

+47 -45
+3 -35
drivers/crypto/intel/qat/qat_common/adf_accel_devices.h
··· 157 157 u32 mailbox_offset; 158 158 }; 159 159 160 - struct ring_config { 161 - u64 base; 162 - u32 config; 163 - u32 head; 164 - u32 tail; 165 - u32 reserved0; 166 - }; 167 - 168 - struct bank_state { 169 - u32 ringstat0; 170 - u32 ringstat1; 171 - u32 ringuostat; 172 - u32 ringestat; 173 - u32 ringnestat; 174 - u32 ringnfstat; 175 - u32 ringfstat; 176 - u32 ringcstat0; 177 - u32 ringcstat1; 178 - u32 ringcstat2; 179 - u32 ringcstat3; 180 - u32 iaintflagen; 181 - u32 iaintflagreg; 182 - u32 iaintflagsrcsel0; 183 - u32 iaintflagsrcsel1; 184 - u32 iaintcolen; 185 - u32 iaintcolctl; 186 - u32 iaintflagandcolen; 187 - u32 ringexpstat; 188 - u32 ringexpintenable; 189 - u32 ringsrvarben; 190 - u32 reserved0; 191 - struct ring_config rings[ADF_ETR_MAX_RINGS_PER_BANK]; 192 - }; 160 + struct adf_bank_state; 193 161 194 162 struct adf_hw_csr_ops { 195 163 u64 (*build_csr_ring_base_addr)(dma_addr_t addr, u32 size); ··· 306 338 void (*set_ssm_wdtimer)(struct adf_accel_dev *accel_dev); 307 339 int (*ring_pair_reset)(struct adf_accel_dev *accel_dev, u32 bank_nr); 308 340 int (*bank_state_save)(struct adf_accel_dev *accel_dev, u32 bank_number, 309 - struct bank_state *state); 341 + struct adf_bank_state *state); 310 342 int (*bank_state_restore)(struct adf_accel_dev *accel_dev, 311 - u32 bank_number, struct bank_state *state); 343 + u32 bank_number, struct adf_bank_state *state); 312 344 void (*reset_device)(struct adf_accel_dev *accel_dev); 313 345 void (*set_msix_rttable)(struct adf_accel_dev *accel_dev); 314 346 const char *(*uof_get_name)(struct adf_accel_dev *accel_dev, u32 obj_num);
+4 -4
drivers/crypto/intel/qat/qat_common/adf_bank_state.c
··· 30 30 } 31 31 32 32 static void bank_state_save(struct adf_hw_csr_ops *ops, void __iomem *base, 33 - u32 bank, struct bank_state *state, u32 num_rings) 33 + u32 bank, struct adf_bank_state *state, u32 num_rings) 34 34 { 35 35 u32 i; 36 36 ··· 60 60 } 61 61 62 62 static int bank_state_restore(struct adf_hw_csr_ops *ops, void __iomem *base, 63 - u32 bank, struct bank_state *state, u32 num_rings, 63 + u32 bank, struct adf_bank_state *state, u32 num_rings, 64 64 int tx_rx_gap) 65 65 { 66 66 u32 val, tmp_val, i; ··· 185 185 * Returns 0 on success, error code otherwise 186 186 */ 187 187 int adf_bank_state_save(struct adf_accel_dev *accel_dev, u32 bank_number, 188 - struct bank_state *state) 188 + struct adf_bank_state *state) 189 189 { 190 190 struct adf_hw_device_data *hw_data = GET_HW_DATA(accel_dev); 191 191 struct adf_hw_csr_ops *csr_ops = GET_CSR_OPS(accel_dev); ··· 215 215 * Returns 0 on success, error code otherwise 216 216 */ 217 217 int adf_bank_state_restore(struct adf_accel_dev *accel_dev, u32 bank_number, 218 - struct bank_state *state) 218 + struct adf_bank_state *state) 219 219 { 220 220 struct adf_hw_device_data *hw_data = GET_HW_DATA(accel_dev); 221 221 struct adf_hw_csr_ops *csr_ops = GET_CSR_OPS(accel_dev);
+36 -3
drivers/crypto/intel/qat/qat_common/adf_bank_state.h
··· 6 6 #include <linux/types.h> 7 7 8 8 struct adf_accel_dev; 9 - struct bank_state; 9 + 10 + struct ring_config { 11 + u64 base; 12 + u32 config; 13 + u32 head; 14 + u32 tail; 15 + u32 reserved0; 16 + }; 17 + 18 + struct adf_bank_state { 19 + u32 ringstat0; 20 + u32 ringstat1; 21 + u32 ringuostat; 22 + u32 ringestat; 23 + u32 ringnestat; 24 + u32 ringnfstat; 25 + u32 ringfstat; 26 + u32 ringcstat0; 27 + u32 ringcstat1; 28 + u32 ringcstat2; 29 + u32 ringcstat3; 30 + u32 iaintflagen; 31 + u32 iaintflagreg; 32 + u32 iaintflagsrcsel0; 33 + u32 iaintflagsrcsel1; 34 + u32 iaintcolen; 35 + u32 iaintcolctl; 36 + u32 iaintflagandcolen; 37 + u32 ringexpstat; 38 + u32 ringexpintenable; 39 + u32 ringsrvarben; 40 + u32 reserved0; 41 + struct ring_config rings[ADF_ETR_MAX_RINGS_PER_BANK]; 42 + }; 10 43 11 44 int adf_bank_state_restore(struct adf_accel_dev *accel_dev, u32 bank_number, 12 - struct bank_state *state); 45 + struct adf_bank_state *state); 13 46 int adf_bank_state_save(struct adf_accel_dev *accel_dev, u32 bank_number, 14 - struct bank_state *state); 47 + struct adf_bank_state *state); 15 48 16 49 #endif
+4 -3
drivers/crypto/intel/qat/qat_common/adf_gen4_vf_mig.c
··· 9 9 #include <asm/errno.h> 10 10 11 11 #include "adf_accel_devices.h" 12 + #include "adf_bank_state.h" 12 13 #include "adf_common_drv.h" 13 14 #include "adf_gen4_hw_data.h" 14 15 #include "adf_gen4_pfvf.h" ··· 359 358 360 359 pf_bank_nr = vf_bank_info->bank_nr + vf_bank_info->vf_nr * hw_data->num_banks_per_vf; 361 360 ret = hw_data->bank_state_restore(accel_dev, pf_bank_nr, 362 - (struct bank_state *)state); 361 + (struct adf_bank_state *)state); 363 362 if (ret) { 364 363 dev_err(&GET_DEV(accel_dev), 365 364 "Failed to load regs for vf%d bank%d\n", ··· 586 585 pf_bank_nr += vf_bank_info->vf_nr * hw_data->num_banks_per_vf; 587 586 588 587 ret = hw_data->bank_state_save(accel_dev, pf_bank_nr, 589 - (struct bank_state *)state); 588 + (struct adf_bank_state *)state); 590 589 if (ret) { 591 590 dev_err(&GET_DEV(accel_dev), 592 591 "Failed to save regs for vf%d bank%d\n", ··· 594 593 return ret; 595 594 } 596 595 597 - return sizeof(struct bank_state); 596 + return sizeof(struct adf_bank_state); 598 597 } 599 598 600 599 static int adf_gen4_vfmig_save_etr_bank(struct adf_accel_dev *accel_dev,