idxd.h (47c16ac27d4cb664cee53ee0b9b7e2f907923fb3) idxd.h (7c5dd23e57c14cf7177b8a5e0fd08916e0c60005)
1/* SPDX-License-Identifier: GPL-2.0 */
2/* Copyright(c) 2019 Intel Corporation. All rights rsvd. */
3#ifndef _IDXD_H_
4#define _IDXD_H_
5
6#include <linux/sbitmap.h>
7#include <linux/dmaengine.h>
8#include <linux/percpu-rwsem.h>

--- 180 unchanged lines hidden (view full) ---

189 u8 cmd_status;
190
191 struct pci_dev *pdev;
192 void __iomem *reg_base;
193
194 spinlock_t dev_lock; /* spinlock for device */
195 struct completion *cmd_done;
196 struct idxd_group *groups;
1/* SPDX-License-Identifier: GPL-2.0 */
2/* Copyright(c) 2019 Intel Corporation. All rights rsvd. */
3#ifndef _IDXD_H_
4#define _IDXD_H_
5
6#include <linux/sbitmap.h>
7#include <linux/dmaengine.h>
8#include <linux/percpu-rwsem.h>

--- 180 unchanged lines hidden (view full) ---

189 u8 cmd_status;
190
191 struct pci_dev *pdev;
192 void __iomem *reg_base;
193
194 spinlock_t dev_lock; /* spinlock for device */
195 struct completion *cmd_done;
196 struct idxd_group *groups;
197 struct idxd_wq *wqs;
197 struct idxd_wq **wqs;
198 struct idxd_engine *engines;
199
200 struct iommu_sva *sva;
201 unsigned int pasid;
202
203 int num_groups;
204
205 u32 msix_perm_offset;

--- 47 unchanged lines hidden (view full) ---

253#define confdev_to_wq(dev) container_of(dev, struct idxd_wq, conf_dev)
254
255extern struct bus_type dsa_bus_type;
256extern struct bus_type iax_bus_type;
257
258extern bool support_enqcmd;
259extern struct device_type dsa_device_type;
260extern struct device_type iax_device_type;
198 struct idxd_engine *engines;
199
200 struct iommu_sva *sva;
201 unsigned int pasid;
202
203 int num_groups;
204
205 u32 msix_perm_offset;

--- 47 unchanged lines hidden (view full) ---

253#define confdev_to_wq(dev) container_of(dev, struct idxd_wq, conf_dev)
254
255extern struct bus_type dsa_bus_type;
256extern struct bus_type iax_bus_type;
257
258extern bool support_enqcmd;
259extern struct device_type dsa_device_type;
260extern struct device_type iax_device_type;
261extern struct device_type idxd_wq_device_type;
261
262static inline bool is_dsa_dev(struct device *dev)
263{
264 return dev->type == &dsa_device_type;
265}
266
267static inline bool is_iax_dev(struct device *dev)
268{
269 return dev->type == &iax_device_type;
270}
271
272static inline bool is_idxd_dev(struct device *dev)
273{
274 return is_dsa_dev(dev) || is_iax_dev(dev);
275}
276
262
263static inline bool is_dsa_dev(struct device *dev)
264{
265 return dev->type == &dsa_device_type;
266}
267
268static inline bool is_iax_dev(struct device *dev)
269{
270 return dev->type == &iax_device_type;
271}
272
273static inline bool is_idxd_dev(struct device *dev)
274{
275 return is_dsa_dev(dev) || is_iax_dev(dev);
276}
277
278static inline bool is_idxd_wq_dev(struct device *dev)
279{
280 return dev->type == &idxd_wq_device_type;
281}
282
283static inline bool is_idxd_wq_dmaengine(struct idxd_wq *wq)
284{
285 if (wq->type == IDXD_WQT_KERNEL && strcmp(wq->name, "dmaengine") == 0)
286 return true;
287 return false;
288}
289
290static inline bool is_idxd_wq_cdev(struct idxd_wq *wq)
291{
292 return wq->type == IDXD_WQT_USER;
293}
294
277static inline bool wq_dedicated(struct idxd_wq *wq)
278{
279 return test_bit(WQ_FLAG_DEDICATED, &wq->flags);
280}
281
282static inline bool wq_shared(struct idxd_wq *wq)
283{
284 return !test_bit(WQ_FLAG_DEDICATED, &wq->flags);

--- 111 unchanged lines hidden ---
295static inline bool wq_dedicated(struct idxd_wq *wq)
296{
297 return test_bit(WQ_FLAG_DEDICATED, &wq->flags);
298}
299
300static inline bool wq_shared(struct idxd_wq *wq)
301{
302 return !test_bit(WQ_FLAG_DEDICATED, &wq->flags);

--- 111 unchanged lines hidden ---