blob: 9148ed5fe4e734d83226b13570f40200037ac981 [file] [log] [blame]
Christopher Ferris05d08e92016-02-04 13:16:38 -08001/****************************************************************************
2 ****************************************************************************
3 ***
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
9 ***
10 *** To edit the content of this header, modify the corresponding
11 *** source file (e.g. under external/kernel-headers/original/) then
12 *** run bionic/libc/kernel/tools/update_all.py
13 ***
14 *** Any manual change here will be lost the next time this script will
15 *** be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
19#ifndef _LINUX__HFI1_USER_H
20#define _LINUX__HFI1_USER_H
21#include <linux/types.h>
Christopher Ferris525ce912017-07-26 13:12:53 -070022#include <rdma/rdma_user_ioctl.h>
Christopher Ferris106b3a82016-08-24 12:15:38 -070023#define HFI1_USER_SWMAJOR 6
Christopher Ferris48af7cb2017-02-21 12:35:09 -080024#define HFI1_USER_SWMINOR 3
Christopher Ferris106b3a82016-08-24 12:15:38 -070025#define HFI1_SWMAJOR_SHIFT 16
Christopher Ferris05d08e92016-02-04 13:16:38 -080026#define HFI1_CAP_DMA_RTAIL (1UL << 0)
27#define HFI1_CAP_SDMA (1UL << 1)
Christopher Ferris106b3a82016-08-24 12:15:38 -070028#define HFI1_CAP_SDMA_AHG (1UL << 2)
Christopher Ferris05d08e92016-02-04 13:16:38 -080029#define HFI1_CAP_EXTENDED_PSN (1UL << 3)
30#define HFI1_CAP_HDRSUPP (1UL << 4)
31#define HFI1_CAP_USE_SDMA_HEAD (1UL << 6)
Christopher Ferris106b3a82016-08-24 12:15:38 -070032#define HFI1_CAP_MULTI_PKT_EGR (1UL << 7)
Christopher Ferris05d08e92016-02-04 13:16:38 -080033#define HFI1_CAP_NODROP_RHQ_FULL (1UL << 8)
34#define HFI1_CAP_NODROP_EGR_FULL (1UL << 9)
35#define HFI1_CAP_TID_UNMAP (1UL << 10)
Christopher Ferris106b3a82016-08-24 12:15:38 -070036#define HFI1_CAP_PRINT_UNIMPL (1UL << 11)
Christopher Ferris05d08e92016-02-04 13:16:38 -080037#define HFI1_CAP_ALLOW_PERM_JKEY (1UL << 12)
38#define HFI1_CAP_NO_INTEGRITY (1UL << 13)
39#define HFI1_CAP_PKEY_CHECK (1UL << 14)
Christopher Ferris106b3a82016-08-24 12:15:38 -070040#define HFI1_CAP_STATIC_RATE_CTRL (1UL << 15)
Christopher Ferris05d08e92016-02-04 13:16:38 -080041#define HFI1_CAP_SDMA_HEAD_CHECK (1UL << 17)
42#define HFI1_CAP_EARLY_CREDIT_RETURN (1UL << 18)
43#define HFI1_RCVHDR_ENTSIZE_2 (1UL << 0)
44#define HFI1_RCVHDR_ENTSIZE_16 (1UL << 1)
Christopher Ferris05d08e92016-02-04 13:16:38 -080045#define HFI1_RCVDHR_ENTSIZE_32 (1UL << 2)
Christopher Ferris05d08e92016-02-04 13:16:38 -080046#define _HFI1_EVENT_FROZEN_BIT 0
47#define _HFI1_EVENT_LINKDOWN_BIT 1
48#define _HFI1_EVENT_LID_CHANGE_BIT 2
49#define _HFI1_EVENT_LMC_CHANGE_BIT 3
Christopher Ferris05d08e92016-02-04 13:16:38 -080050#define _HFI1_EVENT_SL2VL_CHANGE_BIT 4
Christopher Ferris106b3a82016-08-24 12:15:38 -070051#define _HFI1_EVENT_TID_MMU_NOTIFY_BIT 5
52#define _HFI1_MAX_EVENT_BIT _HFI1_EVENT_TID_MMU_NOTIFY_BIT
Christopher Ferris05d08e92016-02-04 13:16:38 -080053#define HFI1_EVENT_FROZEN (1UL << _HFI1_EVENT_FROZEN_BIT)
Christopher Ferris106b3a82016-08-24 12:15:38 -070054#define HFI1_EVENT_LINKDOWN (1UL << _HFI1_EVENT_LINKDOWN_BIT)
Christopher Ferris106b3a82016-08-24 12:15:38 -070055#define HFI1_EVENT_LID_CHANGE (1UL << _HFI1_EVENT_LID_CHANGE_BIT)
56#define HFI1_EVENT_LMC_CHANGE (1UL << _HFI1_EVENT_LMC_CHANGE_BIT)
57#define HFI1_EVENT_SL2VL_CHANGE (1UL << _HFI1_EVENT_SL2VL_CHANGE_BIT)
58#define HFI1_EVENT_TID_MMU_NOTIFY (1UL << _HFI1_EVENT_TID_MMU_NOTIFY_BIT)
Christopher Ferris05d08e92016-02-04 13:16:38 -080059#define HFI1_STATUS_INITTED 0x1
Christopher Ferris05d08e92016-02-04 13:16:38 -080060#define HFI1_STATUS_CHIP_PRESENT 0x20
61#define HFI1_STATUS_IB_READY 0x40
62#define HFI1_STATUS_IB_CONF 0x80
Christopher Ferris106b3a82016-08-24 12:15:38 -070063#define HFI1_STATUS_HWERROR 0x200
Christopher Ferris05d08e92016-02-04 13:16:38 -080064#define HFI1_MAX_SHARED_CTXTS 8
65#define HFI1_POLL_TYPE_ANYRCV 0x0
66#define HFI1_POLL_TYPE_URGENT 0x1
Christopher Ferris05d08e92016-02-04 13:16:38 -080067enum hfi1_sdma_comp_state {
68 FREE = 0,
69 QUEUED,
70 COMPLETE,
Christopher Ferris05d08e92016-02-04 13:16:38 -080071 ERROR
72};
73struct hfi1_sdma_comp_entry {
74 __u32 status;
Christopher Ferris05d08e92016-02-04 13:16:38 -080075 __u32 errcode;
76};
77struct hfi1_status {
Christopher Ferris76a1d452018-06-27 14:12:29 -070078 __aligned_u64 dev;
79 __aligned_u64 port;
Christopher Ferris05d08e92016-02-04 13:16:38 -080080 char freezemsg[0];
81};
Christopher Ferris05d08e92016-02-04 13:16:38 -080082enum sdma_req_opcode {
Christopher Ferris05d08e92016-02-04 13:16:38 -080083 EXPECTED = 0,
84 EAGER
85};
86#define HFI1_SDMA_REQ_VERSION_MASK 0xF
Christopher Ferris05d08e92016-02-04 13:16:38 -080087#define HFI1_SDMA_REQ_VERSION_SHIFT 0x0
88#define HFI1_SDMA_REQ_OPCODE_MASK 0xF
89#define HFI1_SDMA_REQ_OPCODE_SHIFT 0x4
90#define HFI1_SDMA_REQ_IOVCNT_MASK 0xFF
Christopher Ferris05d08e92016-02-04 13:16:38 -080091#define HFI1_SDMA_REQ_IOVCNT_SHIFT 0x8
92struct sdma_req_info {
93 __u16 ctrl;
94 __u16 npkts;
Christopher Ferris05d08e92016-02-04 13:16:38 -080095 __u16 fragsize;
96 __u16 comp_idx;
Christopher Ferris76a1d452018-06-27 14:12:29 -070097} __attribute__((__packed__));
Christopher Ferris05d08e92016-02-04 13:16:38 -080098struct hfi1_kdeth_header {
Christopher Ferris05d08e92016-02-04 13:16:38 -080099 __le32 ver_tid_offset;
100 __le16 jkey;
101 __le16 hcrc;
102 __le32 swdata[7];
Christopher Ferris76a1d452018-06-27 14:12:29 -0700103} __attribute__((__packed__));
Christopher Ferris05d08e92016-02-04 13:16:38 -0800104struct hfi1_pkt_header {
105 __le16 pbc[4];
106 __be16 lrh[4];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800107 __be32 bth[3];
108 struct hfi1_kdeth_header kdeth;
Christopher Ferris76a1d452018-06-27 14:12:29 -0700109} __attribute__((__packed__));
Christopher Ferris05d08e92016-02-04 13:16:38 -0800110enum hfi1_ureg {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800111 ur_rcvhdrtail = 0,
112 ur_rcvhdrhead = 1,
113 ur_rcvegrindextail = 2,
114 ur_rcvegrindexhead = 3,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800115 ur_rcvegroffsettail = 4,
116 ur_maxreg,
117 ur_rcvtidflowtable = 256
118};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800119#endif