hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/drivers/crypto/qat/qat_common/adf_accel_devices.h
....@@ -1,49 +1,5 @@
1
-/*
2
- This file is provided under a dual BSD/GPLv2 license. When using or
3
- redistributing this file, you may do so under either license.
4
-
5
- GPL LICENSE SUMMARY
6
- Copyright(c) 2014 Intel Corporation.
7
- This program is free software; you can redistribute it and/or modify
8
- it under the terms of version 2 of the GNU General Public License as
9
- published by the Free Software Foundation.
10
-
11
- This program is distributed in the hope that it will be useful, but
12
- WITHOUT ANY WARRANTY; without even the implied warranty of
13
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
- General Public License for more details.
15
-
16
- Contact Information:
17
- qat-linux@intel.com
18
-
19
- BSD LICENSE
20
- Copyright(c) 2014 Intel Corporation.
21
- Redistribution and use in source and binary forms, with or without
22
- modification, are permitted provided that the following conditions
23
- are met:
24
-
25
- * Redistributions of source code must retain the above copyright
26
- notice, this list of conditions and the following disclaimer.
27
- * Redistributions in binary form must reproduce the above copyright
28
- notice, this list of conditions and the following disclaimer in
29
- the documentation and/or other materials provided with the
30
- distribution.
31
- * Neither the name of Intel Corporation nor the names of its
32
- contributors may be used to endorse or promote products derived
33
- from this software without specific prior written permission.
34
-
35
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
36
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
37
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
38
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
39
- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
40
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
41
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
42
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
43
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
44
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
45
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
46
-*/
1
+/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0-only) */
2
+/* Copyright(c) 2014 - 2020 Intel Corporation */
473 #ifndef ADF_ACCEL_DEVICES_H_
484 #define ADF_ACCEL_DEVICES_H_
495 #include <linux/interrupt.h>
....@@ -59,12 +15,6 @@
5915 #define ADF_C62XVF_DEVICE_NAME "c6xxvf"
6016 #define ADF_C3XXX_DEVICE_NAME "c3xxx"
6117 #define ADF_C3XXXVF_DEVICE_NAME "c3xxxvf"
62
-#define ADF_DH895XCC_PCI_DEVICE_ID 0x435
63
-#define ADF_DH895XCCIOV_PCI_DEVICE_ID 0x443
64
-#define ADF_C62X_PCI_DEVICE_ID 0x37c8
65
-#define ADF_C62XIOV_PCI_DEVICE_ID 0x37c9
66
-#define ADF_C3XXX_PCI_DEVICE_ID 0x19e2
67
-#define ADF_C3XXXIOV_PCI_DEVICE_ID 0x19e3
6818 #define ADF_ERRSOU3 (0x3A000 + 0x0C)
6919 #define ADF_ERRSOU5 (0x3A000 + 0xD8)
7020 #define ADF_DEVICE_FUSECTL_OFFSET 0x40
....@@ -103,8 +53,8 @@
10353 struct pci_dev *pci_dev;
10454 struct adf_accel_msix msix_entries;
10555 struct adf_bar pci_bars[ADF_PCI_MAX_BARS];
106
- uint8_t revid;
107
- uint8_t sku;
56
+ u8 revid;
57
+ u8 sku;
10858 } __packed;
10959
11060 enum dev_state {
....@@ -144,7 +94,7 @@
14494 struct adf_hw_device_class {
14595 const char *name;
14696 const enum adf_device_type type;
147
- uint32_t instances;
97
+ u32 instances;
14898 } __packed;
14999
150100 struct adf_cfg_device_data;
....@@ -154,15 +104,15 @@
154104
155105 struct adf_hw_device_data {
156106 struct adf_hw_device_class *dev_class;
157
- uint32_t (*get_accel_mask)(uint32_t fuse);
158
- uint32_t (*get_ae_mask)(uint32_t fuse);
159
- uint32_t (*get_sram_bar_id)(struct adf_hw_device_data *self);
160
- uint32_t (*get_misc_bar_id)(struct adf_hw_device_data *self);
161
- uint32_t (*get_etr_bar_id)(struct adf_hw_device_data *self);
162
- uint32_t (*get_num_aes)(struct adf_hw_device_data *self);
163
- uint32_t (*get_num_accels)(struct adf_hw_device_data *self);
164
- uint32_t (*get_pf2vf_offset)(uint32_t i);
165
- uint32_t (*get_vintmsk_offset)(uint32_t i);
107
+ u32 (*get_accel_mask)(u32 fuse);
108
+ u32 (*get_ae_mask)(u32 fuse);
109
+ u32 (*get_sram_bar_id)(struct adf_hw_device_data *self);
110
+ u32 (*get_misc_bar_id)(struct adf_hw_device_data *self);
111
+ u32 (*get_etr_bar_id)(struct adf_hw_device_data *self);
112
+ u32 (*get_num_aes)(struct adf_hw_device_data *self);
113
+ u32 (*get_num_accels)(struct adf_hw_device_data *self);
114
+ u32 (*get_pf2vf_offset)(u32 i);
115
+ u32 (*get_vintmsk_offset)(u32 i);
166116 enum dev_sku_info (*get_sku)(struct adf_hw_device_data *self);
167117 int (*alloc_irq)(struct adf_accel_dev *accel_dev);
168118 void (*free_irq)(struct adf_accel_dev *accel_dev);
....@@ -173,25 +123,25 @@
173123 int (*init_arb)(struct adf_accel_dev *accel_dev);
174124 void (*exit_arb)(struct adf_accel_dev *accel_dev);
175125 void (*get_arb_mapping)(struct adf_accel_dev *accel_dev,
176
- const uint32_t **cfg);
126
+ const u32 **cfg);
177127 void (*disable_iov)(struct adf_accel_dev *accel_dev);
178128 void (*enable_ints)(struct adf_accel_dev *accel_dev);
179129 int (*enable_vf2pf_comms)(struct adf_accel_dev *accel_dev);
180130 void (*reset_device)(struct adf_accel_dev *accel_dev);
181131 const char *fw_name;
182132 const char *fw_mmp_name;
183
- uint32_t fuses;
184
- uint32_t accel_capabilities_mask;
185
- uint32_t instance_id;
186
- uint16_t accel_mask;
187
- uint16_t ae_mask;
188
- uint16_t tx_rings_mask;
189
- uint8_t tx_rx_gap;
190
- uint8_t num_banks;
191
- uint8_t num_accel;
192
- uint8_t num_logical_accel;
193
- uint8_t num_engines;
194
- uint8_t min_iov_compat_ver;
133
+ u32 fuses;
134
+ u32 accel_capabilities_mask;
135
+ u32 instance_id;
136
+ u16 accel_mask;
137
+ u16 ae_mask;
138
+ u16 tx_rings_mask;
139
+ u8 tx_rx_gap;
140
+ u8 num_banks;
141
+ u8 num_accel;
142
+ u8 num_logical_accel;
143
+ u8 num_engines;
144
+ u8 min_iov_compat_ver;
195145 } __packed;
196146
197147 /* CSR write macro */
....@@ -248,8 +198,8 @@
248198 struct tasklet_struct pf2vf_bh_tasklet;
249199 struct mutex vf2pf_lock; /* protect CSR access */
250200 struct completion iov_msg_completion;
251
- uint8_t compatible;
252
- uint8_t pf_version;
201
+ u8 compatible;
202
+ u8 pf_version;
253203 } vf;
254204 };
255205 bool is_vf;