1 /* SPDX-License-Identifier: GPL-2.0 */
5 #include <linux/spinlock.h>
6 #include <linux/types.h>
10 #define UTIL_STR_LEN 16
13 * Do not use the first word of the DMB bits to ensure 8 byte aligned access.
15 #define ISM_DMB_WORD_OFFSET 1
16 #define ISM_DMB_BIT_OFFSET (ISM_DMB_WORD_OFFSET * 32)
17 #define ISM_NR_DMBS 1920
19 #define ISM_REG_SBA 0x1
20 #define ISM_REG_IEQ 0x2
21 #define ISM_READ_GID 0x3
22 #define ISM_ADD_VLAN_ID 0x4
23 #define ISM_DEL_VLAN_ID 0x5
24 #define ISM_SET_VLAN 0x6
25 #define ISM_RESET_VLAN 0x7
26 #define ISM_QUERY_INFO 0x8
27 #define ISM_QUERY_RGID 0x9
28 #define ISM_REG_DMB 0xA
29 #define ISM_UNREG_DMB 0xB
30 #define ISM_SIGNAL_IEQ 0xE
31 #define ISM_UNREG_SBA 0x11
32 #define ISM_UNREG_IEQ 0x12
34 #define ISM_ERROR 0xFFFF
50 struct ism_req_hdr hdr
;
54 struct ism_resp_hdr hdr
;
60 struct ism_req_hdr hdr
;
65 struct ism_resp_hdr hdr
;
71 struct ism_req_hdr hdr
;
74 struct ism_resp_hdr hdr
;
81 struct ism_req_hdr hdr
;
84 struct ism_resp_hdr hdr
;
101 union ism_query_rgid
{
103 struct ism_req_hdr hdr
;
109 struct ism_resp_hdr hdr
;
115 struct ism_req_hdr hdr
;
124 struct ism_resp_hdr hdr
;
131 struct ism_req_hdr hdr
;
138 struct ism_resp_hdr hdr
;
142 union ism_unreg_dmb
{
144 struct ism_req_hdr hdr
;
148 struct ism_resp_hdr hdr
;
152 union ism_cmd_simple
{
154 struct ism_req_hdr hdr
;
157 struct ism_resp_hdr hdr
;
161 union ism_set_vlan_id
{
163 struct ism_req_hdr hdr
;
167 struct ism_resp_hdr hdr
;
171 struct ism_eq_header
{
179 struct ism_eq_header header
;
180 struct smcd_event entry
[15];
184 u32 s
: 1; /* summary bit */
185 u32 e
: 1; /* event bit */
187 u32 dmb_bits
[ISM_NR_DMBS
/ 32];
189 u16 dmbe_mask
[ISM_NR_DMBS
];
194 struct pci_dev
*pdev
;
195 struct smcd_dev
*smcd
;
200 dma_addr_t sba_dma_addr
;
201 DECLARE_BITMAP(sba_bitmap
, ISM_NR_DMBS
);
204 dma_addr_t ieq_dma_addr
;
209 #define ISM_CREATE_REQ(dmb, idx, sf, offset) \
210 ((dmb) | (idx) << 24 | (sf) << 23 | (offset))
212 static inline int __ism_move(struct ism_dev
*ism
, u64 dmb_req
, void *data
,
215 struct zpci_dev
*zdev
= to_zpci(ism
->pdev
);
216 u64 req
= ZPCI_CREATE_REQ(zdev
->fh
, 0, size
);
218 return zpci_write_block(req
, data
, dmb_req
);
221 #endif /* S390_ISM_H */