.. | .. |
---|
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 */ |
---|
47 | 3 | #include <linux/kernel.h> |
---|
48 | 4 | #include <linux/module.h> |
---|
49 | 5 | #include <linux/pci.h> |
---|
.. | .. |
---|
62 | 18 | #include <adf_cfg.h> |
---|
63 | 19 | #include "adf_c62x_hw_data.h" |
---|
64 | 20 | |
---|
65 | | -#define ADF_SYSTEM_DEVICE(device_id) \ |
---|
66 | | - {PCI_DEVICE(PCI_VENDOR_ID_INTEL, device_id)} |
---|
67 | | - |
---|
68 | 21 | static const struct pci_device_id adf_pci_tbl[] = { |
---|
69 | | - ADF_SYSTEM_DEVICE(ADF_C62X_PCI_DEVICE_ID), |
---|
70 | | - {0,} |
---|
| 22 | + { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_QAT_C62X), }, |
---|
| 23 | + { } |
---|
71 | 24 | }; |
---|
72 | 25 | MODULE_DEVICE_TABLE(pci, adf_pci_tbl); |
---|
73 | 26 | |
---|
.. | .. |
---|
102 | 55 | |
---|
103 | 56 | if (accel_dev->hw_device) { |
---|
104 | 57 | switch (accel_pci_dev->pci_dev->device) { |
---|
105 | | - case ADF_C62X_PCI_DEVICE_ID: |
---|
| 58 | + case PCI_DEVICE_ID_INTEL_QAT_C62X: |
---|
106 | 59 | adf_clean_hw_data_c62x(accel_dev->hw_device); |
---|
107 | 60 | break; |
---|
108 | 61 | default: |
---|
.. | .. |
---|
127 | 80 | int ret; |
---|
128 | 81 | |
---|
129 | 82 | switch (ent->device) { |
---|
130 | | - case ADF_C62X_PCI_DEVICE_ID: |
---|
| 83 | + case PCI_DEVICE_ID_INTEL_QAT_C62X: |
---|
131 | 84 | break; |
---|
132 | 85 | default: |
---|
133 | 86 | dev_err(&pdev->dev, "Invalid device 0x%x.\n", ent->device); |
---|
.. | .. |
---|
187 | 140 | } |
---|
188 | 141 | |
---|
189 | 142 | /* Create dev top level debugfs entry */ |
---|
190 | | - snprintf(name, sizeof(name), "%s%s_%02x:%02d.%d", |
---|
191 | | - ADF_DEVICE_NAME_PREFIX, hw_data->dev_class->name, |
---|
192 | | - pdev->bus->number, PCI_SLOT(pdev->devfn), |
---|
193 | | - PCI_FUNC(pdev->devfn)); |
---|
| 143 | + snprintf(name, sizeof(name), "%s%s_%s", ADF_DEVICE_NAME_PREFIX, |
---|
| 144 | + hw_data->dev_class->name, pci_name(pdev)); |
---|
194 | 145 | |
---|
195 | 146 | accel_dev->debugfs_dir = debugfs_create_dir(name, NULL); |
---|
196 | | - if (!accel_dev->debugfs_dir) { |
---|
197 | | - dev_err(&pdev->dev, "Could not create debugfs dir %s\n", name); |
---|
198 | | - ret = -EINVAL; |
---|
199 | | - goto out_err; |
---|
200 | | - } |
---|
201 | 147 | |
---|
202 | 148 | /* Create device configuration table */ |
---|
203 | 149 | ret = adf_cfg_dev_add(accel_dev); |
---|
.. | .. |
---|
252 | 198 | } |
---|
253 | 199 | pci_set_master(pdev); |
---|
254 | 200 | |
---|
255 | | - if (adf_enable_aer(accel_dev, &adf_driver)) { |
---|
| 201 | + if (adf_enable_aer(accel_dev)) { |
---|
256 | 202 | dev_err(&pdev->dev, "Failed to enable aer\n"); |
---|
257 | 203 | ret = -EFAULT; |
---|
258 | 204 | goto out_err_free_reg; |
---|