treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / drivers / misc / habanalabs / include / qman_if.h
blob0fdb49188ed7cda05f766e1247c21e03de8b828a
1 /* SPDX-License-Identifier: GPL-2.0
3 * Copyright 2016-2018 HabanaLabs, Ltd.
4 * All Rights Reserved.
6 */
8 #ifndef QMAN_IF_H
9 #define QMAN_IF_H
11 #include <linux/types.h>
14 * PRIMARY QUEUE
17 struct hl_bd {
18 __le64 ptr;
19 __le32 len;
20 __le32 ctl;
23 #define HL_BD_SIZE sizeof(struct hl_bd)
26 * S/W CTL FIELDS.
28 * BD_CTL_REPEAT_VALID tells the CP whether the repeat field in the BD CTL is
29 * valid. 1 means the repeat field is valid, 0 means not-valid,
30 * i.e. repeat == 1
32 #define BD_CTL_REPEAT_VALID_SHIFT 24
33 #define BD_CTL_REPEAT_VALID_MASK 0x01000000
35 #define BD_CTL_SHADOW_INDEX_SHIFT 0
36 #define BD_CTL_SHADOW_INDEX_MASK 0x00000FFF
39 * H/W CTL FIELDS
42 #define BD_CTL_COMP_OFFSET_SHIFT 16
43 #define BD_CTL_COMP_OFFSET_MASK 0x00FF0000
45 #define BD_CTL_COMP_DATA_SHIFT 0
46 #define BD_CTL_COMP_DATA_MASK 0x0000FFFF
49 * COMPLETION QUEUE
52 struct hl_cq_entry {
53 __le32 data;
56 #define HL_CQ_ENTRY_SIZE sizeof(struct hl_cq_entry)
58 #define CQ_ENTRY_READY_SHIFT 31
59 #define CQ_ENTRY_READY_MASK 0x80000000
61 #define CQ_ENTRY_SHADOW_INDEX_VALID_SHIFT 30
62 #define CQ_ENTRY_SHADOW_INDEX_VALID_MASK 0x40000000
64 #define CQ_ENTRY_SHADOW_INDEX_SHIFT BD_CTL_SHADOW_INDEX_SHIFT
65 #define CQ_ENTRY_SHADOW_INDEX_MASK BD_CTL_SHADOW_INDEX_MASK
68 #endif /* QMAN_IF_H */