Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
Uwe Zeisberger | f30c226 | 2006-10-03 23:01:26 +0200 | [diff] [blame] | 2 | * linux/include/asm-s390/qdio.h |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 3 | * |
Jan Glauber | 779e6e1 | 2008-07-17 17:16:48 +0200 | [diff] [blame] | 4 | * Copyright 2000,2008 IBM Corp. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 5 | * Author(s): Utz Bacher <utz.bacher@de.ibm.com> |
Jan Glauber | 779e6e1 | 2008-07-17 17:16:48 +0200 | [diff] [blame] | 6 | * Jan Glauber <jang@linux.vnet.ibm.com> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 7 | * |
| 8 | */ |
| 9 | #ifndef __QDIO_H__ |
| 10 | #define __QDIO_H__ |
| 11 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 12 | #include <linux/interrupt.h> |
| 13 | #include <asm/cio.h> |
| 14 | #include <asm/ccwdev.h> |
| 15 | |
Jan Glauber | 432ac5e | 2010-02-26 22:37:37 +0100 | [diff] [blame] | 16 | /* only use 4 queues to save some cachelines */ |
| 17 | #define QDIO_MAX_QUEUES_PER_IRQ 4 |
Jan Glauber | 779e6e1 | 2008-07-17 17:16:48 +0200 | [diff] [blame] | 18 | #define QDIO_MAX_BUFFERS_PER_Q 128 |
| 19 | #define QDIO_MAX_BUFFERS_MASK (QDIO_MAX_BUFFERS_PER_Q - 1) |
| 20 | #define QDIO_MAX_ELEMENTS_PER_BUFFER 16 |
| 21 | #define QDIO_SBAL_SIZE 256 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 22 | |
Jan Glauber | 779e6e1 | 2008-07-17 17:16:48 +0200 | [diff] [blame] | 23 | #define QDIO_QETH_QFMT 0 |
| 24 | #define QDIO_ZFCP_QFMT 1 |
| 25 | #define QDIO_IQDIO_QFMT 2 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 26 | |
Jan Glauber | 779e6e1 | 2008-07-17 17:16:48 +0200 | [diff] [blame] | 27 | /** |
| 28 | * struct qdesfmt0 - queue descriptor, format 0 |
| 29 | * @sliba: storage list information block address |
| 30 | * @sla: storage list address |
| 31 | * @slsba: storage list state block address |
| 32 | * @akey: access key for DLIB |
| 33 | * @bkey: access key for SL |
| 34 | * @ckey: access key for SBALs |
| 35 | * @dkey: access key for SLSB |
| 36 | */ |
| 37 | struct qdesfmt0 { |
| 38 | u64 sliba; |
| 39 | u64 sla; |
| 40 | u64 slsba; |
| 41 | u32 : 32; |
| 42 | u32 akey : 4; |
| 43 | u32 bkey : 4; |
| 44 | u32 ckey : 4; |
| 45 | u32 dkey : 4; |
| 46 | u32 : 16; |
| 47 | } __attribute__ ((packed)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 48 | |
Swen Schillig | dfe5bb5 | 2011-08-15 14:40:31 +0200 | [diff] [blame] | 49 | #define QDR_AC_MULTI_BUFFER_ENABLE 0x01 |
| 50 | |
Jan Glauber | 779e6e1 | 2008-07-17 17:16:48 +0200 | [diff] [blame] | 51 | /** |
| 52 | * struct qdr - queue description record (QDR) |
| 53 | * @qfmt: queue format |
| 54 | * @pfmt: implementation dependent parameter format |
| 55 | * @ac: adapter characteristics |
| 56 | * @iqdcnt: input queue descriptor count |
| 57 | * @oqdcnt: output queue descriptor count |
| 58 | * @iqdsz: inpout queue descriptor size |
| 59 | * @oqdsz: output queue descriptor size |
| 60 | * @qiba: queue information block address |
| 61 | * @qkey: queue information block key |
| 62 | * @qdf0: queue descriptions |
| 63 | */ |
| 64 | struct qdr { |
| 65 | u32 qfmt : 8; |
| 66 | u32 pfmt : 8; |
| 67 | u32 : 8; |
| 68 | u32 ac : 8; |
| 69 | u32 : 8; |
| 70 | u32 iqdcnt : 8; |
| 71 | u32 : 8; |
| 72 | u32 oqdcnt : 8; |
| 73 | u32 : 8; |
| 74 | u32 iqdsz : 8; |
| 75 | u32 : 8; |
| 76 | u32 oqdsz : 8; |
| 77 | /* private: */ |
| 78 | u32 res[9]; |
| 79 | /* public: */ |
| 80 | u64 qiba; |
| 81 | u32 : 32; |
| 82 | u32 qkey : 4; |
| 83 | u32 : 28; |
| 84 | struct qdesfmt0 qdf0[126]; |
| 85 | } __attribute__ ((packed, aligned(4096))); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 86 | |
Jan Glauber | 779e6e1 | 2008-07-17 17:16:48 +0200 | [diff] [blame] | 87 | #define QIB_AC_OUTBOUND_PCI_SUPPORTED 0x40 |
| 88 | #define QIB_RFLAGS_ENABLE_QEBSM 0x80 |
Christof Schmitt | dcc18f4 | 2010-07-16 15:37:41 +0200 | [diff] [blame] | 89 | #define QIB_RFLAGS_ENABLE_DATA_DIV 0x02 |
Jan Glauber | 779e6e1 | 2008-07-17 17:16:48 +0200 | [diff] [blame] | 90 | |
| 91 | /** |
| 92 | * struct qib - queue information block (QIB) |
| 93 | * @qfmt: queue format |
| 94 | * @pfmt: implementation dependent parameter format |
| 95 | * @rflags: QEBSM |
| 96 | * @ac: adapter characteristics |
| 97 | * @isliba: absolute address of first input SLIB |
| 98 | * @osliba: absolute address of first output SLIB |
| 99 | * @ebcnam: adapter identifier in EBCDIC |
| 100 | * @parm: implementation dependent parameters |
| 101 | */ |
| 102 | struct qib { |
| 103 | u32 qfmt : 8; |
| 104 | u32 pfmt : 8; |
| 105 | u32 rflags : 8; |
| 106 | u32 ac : 8; |
| 107 | u32 : 32; |
| 108 | u64 isliba; |
| 109 | u64 osliba; |
| 110 | u32 : 32; |
| 111 | u32 : 32; |
| 112 | u8 ebcnam[8]; |
| 113 | /* private: */ |
| 114 | u8 res[88]; |
| 115 | /* public: */ |
| 116 | u8 parm[QDIO_MAX_BUFFERS_PER_Q]; |
| 117 | } __attribute__ ((packed, aligned(256))); |
| 118 | |
| 119 | /** |
| 120 | * struct slibe - storage list information block element (SLIBE) |
| 121 | * @parms: implementation dependent parameters |
| 122 | */ |
| 123 | struct slibe { |
| 124 | u64 parms; |
| 125 | }; |
| 126 | |
| 127 | /** |
frank.blaschka@de.ibm.com | 104ea55 | 2011-08-08 01:33:55 +0000 | [diff] [blame] | 128 | * struct qaob - queue asynchronous operation block |
| 129 | * @res0: reserved parameters |
| 130 | * @res1: reserved parameter |
| 131 | * @res2: reserved parameter |
| 132 | * @res3: reserved parameter |
| 133 | * @aorc: asynchronous operation return code |
| 134 | * @flags: internal flags |
| 135 | * @cbtbs: control block type |
| 136 | * @sb_count: number of storage blocks |
| 137 | * @sba: storage block element addresses |
| 138 | * @dcount: size of storage block elements |
| 139 | * @user0: user defineable value |
| 140 | * @res4: reserved paramater |
| 141 | * @user1: user defineable value |
| 142 | * @user2: user defineable value |
| 143 | */ |
| 144 | struct qaob { |
| 145 | u64 res0[6]; |
| 146 | u8 res1; |
| 147 | u8 res2; |
| 148 | u8 res3; |
| 149 | u8 aorc; |
| 150 | u8 flags; |
| 151 | u16 cbtbs; |
| 152 | u8 sb_count; |
| 153 | u64 sba[QDIO_MAX_ELEMENTS_PER_BUFFER]; |
| 154 | u16 dcount[QDIO_MAX_ELEMENTS_PER_BUFFER]; |
| 155 | u64 user0; |
| 156 | u64 res4[2]; |
| 157 | u64 user1; |
| 158 | u64 user2; |
| 159 | } __attribute__ ((packed, aligned(256))); |
| 160 | |
| 161 | /** |
Jan Glauber | 779e6e1 | 2008-07-17 17:16:48 +0200 | [diff] [blame] | 162 | * struct slib - storage list information block (SLIB) |
| 163 | * @nsliba: next SLIB address (if any) |
| 164 | * @sla: SL address |
| 165 | * @slsba: SLSB address |
| 166 | * @slibe: SLIB elements |
| 167 | */ |
| 168 | struct slib { |
| 169 | u64 nsliba; |
| 170 | u64 sla; |
| 171 | u64 slsba; |
| 172 | /* private: */ |
| 173 | u8 res[1000]; |
| 174 | /* public: */ |
| 175 | struct slibe slibe[QDIO_MAX_BUFFERS_PER_Q]; |
| 176 | } __attribute__ ((packed, aligned(2048))); |
| 177 | |
Jan Glauber | 3ec9087 | 2011-06-06 14:14:40 +0200 | [diff] [blame] | 178 | #define SBAL_EFLAGS_LAST_ENTRY 0x40 |
| 179 | #define SBAL_EFLAGS_CONTIGUOUS 0x20 |
| 180 | #define SBAL_EFLAGS_FIRST_FRAG 0x04 |
| 181 | #define SBAL_EFLAGS_MIDDLE_FRAG 0x08 |
| 182 | #define SBAL_EFLAGS_LAST_FRAG 0x0c |
| 183 | #define SBAL_EFLAGS_MASK 0x6f |
Jan Glauber | 779e6e1 | 2008-07-17 17:16:48 +0200 | [diff] [blame] | 184 | |
Jan Glauber | 3ec9087 | 2011-06-06 14:14:40 +0200 | [diff] [blame] | 185 | #define SBAL_SFLAGS0_PCI_REQ 0x40 |
| 186 | #define SBAL_SFLAGS0_DATA_CONTINUATION 0x20 |
Jan Glauber | 779e6e1 | 2008-07-17 17:16:48 +0200 | [diff] [blame] | 187 | |
| 188 | /* Awesome OpenFCP extensions */ |
Jan Glauber | 3ec9087 | 2011-06-06 14:14:40 +0200 | [diff] [blame] | 189 | #define SBAL_SFLAGS0_TYPE_STATUS 0x00 |
| 190 | #define SBAL_SFLAGS0_TYPE_WRITE 0x08 |
| 191 | #define SBAL_SFLAGS0_TYPE_READ 0x10 |
| 192 | #define SBAL_SFLAGS0_TYPE_WRITE_READ 0x18 |
| 193 | #define SBAL_SFLAGS0_MORE_SBALS 0x04 |
| 194 | #define SBAL_SFLAGS0_COMMAND 0x02 |
| 195 | #define SBAL_SFLAGS0_LAST_SBAL 0x00 |
| 196 | #define SBAL_SFLAGS0_ONLY_SBAL SBAL_SFLAGS0_COMMAND |
| 197 | #define SBAL_SFLAGS0_MIDDLE_SBAL SBAL_SFLAGS0_MORE_SBALS |
| 198 | #define SBAL_SFLAGS0_FIRST_SBAL (SBAL_SFLAGS0_MORE_SBALS | SBAL_SFLAGS0_COMMAND) |
Jan Glauber | 779e6e1 | 2008-07-17 17:16:48 +0200 | [diff] [blame] | 199 | |
| 200 | /** |
| 201 | * struct qdio_buffer_element - SBAL entry |
Jan Glauber | 3ec9087 | 2011-06-06 14:14:40 +0200 | [diff] [blame] | 202 | * @eflags: SBAL entry flags |
| 203 | * @scount: SBAL count |
| 204 | * @sflags: whole SBAL flags |
Jan Glauber | 779e6e1 | 2008-07-17 17:16:48 +0200 | [diff] [blame] | 205 | * @length: length |
| 206 | * @addr: address |
| 207 | */ |
| 208 | struct qdio_buffer_element { |
Jan Glauber | 3ec9087 | 2011-06-06 14:14:40 +0200 | [diff] [blame] | 209 | u8 eflags; |
| 210 | /* private: */ |
| 211 | u8 res1; |
| 212 | /* public: */ |
| 213 | u8 scount; |
| 214 | u8 sflags; |
Jan Glauber | 779e6e1 | 2008-07-17 17:16:48 +0200 | [diff] [blame] | 215 | u32 length; |
| 216 | #ifdef CONFIG_32BIT |
| 217 | /* private: */ |
Jan Glauber | 3ec9087 | 2011-06-06 14:14:40 +0200 | [diff] [blame] | 218 | void *res2; |
Jan Glauber | 779e6e1 | 2008-07-17 17:16:48 +0200 | [diff] [blame] | 219 | /* public: */ |
| 220 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 221 | void *addr; |
Jan Glauber | 779e6e1 | 2008-07-17 17:16:48 +0200 | [diff] [blame] | 222 | } __attribute__ ((packed, aligned(16))); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 223 | |
Jan Glauber | 779e6e1 | 2008-07-17 17:16:48 +0200 | [diff] [blame] | 224 | /** |
| 225 | * struct qdio_buffer - storage block address list (SBAL) |
| 226 | * @element: SBAL entries |
| 227 | */ |
| 228 | struct qdio_buffer { |
| 229 | struct qdio_buffer_element element[QDIO_MAX_ELEMENTS_PER_BUFFER]; |
| 230 | } __attribute__ ((packed, aligned(256))); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 231 | |
Jan Glauber | 779e6e1 | 2008-07-17 17:16:48 +0200 | [diff] [blame] | 232 | /** |
| 233 | * struct sl_element - storage list entry |
| 234 | * @sbal: absolute SBAL address |
| 235 | */ |
| 236 | struct sl_element { |
| 237 | #ifdef CONFIG_32BIT |
| 238 | /* private: */ |
| 239 | unsigned long reserved; |
| 240 | /* public: */ |
| 241 | #endif |
| 242 | unsigned long sbal; |
| 243 | } __attribute__ ((packed)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 244 | |
Jan Glauber | 779e6e1 | 2008-07-17 17:16:48 +0200 | [diff] [blame] | 245 | /** |
| 246 | * struct sl - storage list (SL) |
| 247 | * @element: SL entries |
| 248 | */ |
| 249 | struct sl { |
| 250 | struct sl_element element[QDIO_MAX_BUFFERS_PER_Q]; |
| 251 | } __attribute__ ((packed, aligned(1024))); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 252 | |
Jan Glauber | 779e6e1 | 2008-07-17 17:16:48 +0200 | [diff] [blame] | 253 | /** |
| 254 | * struct slsb - storage list state block (SLSB) |
| 255 | * @val: state per buffer |
| 256 | */ |
| 257 | struct slsb { |
| 258 | u8 val[QDIO_MAX_BUFFERS_PER_Q]; |
| 259 | } __attribute__ ((packed, aligned(256))); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 260 | |
Swen Schillig | dfe5bb5 | 2011-08-15 14:40:31 +0200 | [diff] [blame] | 261 | #define CHSC_AC2_MULTI_BUFFER_AVAILABLE 0x0080 |
| 262 | #define CHSC_AC2_MULTI_BUFFER_ENABLED 0x0040 |
Christof Schmitt | dcc18f4 | 2010-07-16 15:37:41 +0200 | [diff] [blame] | 263 | #define CHSC_AC2_DATA_DIV_AVAILABLE 0x0010 |
| 264 | #define CHSC_AC2_DATA_DIV_ENABLED 0x0002 |
| 265 | |
frank.blaschka@de.ibm.com | 104ea55 | 2011-08-08 01:33:55 +0000 | [diff] [blame] | 266 | /** |
| 267 | * struct qdio_outbuf_state - SBAL related asynchronous operation information |
| 268 | * (for communication with upper layer programs) |
| 269 | * (only required for use with completion queues) |
| 270 | * @flags: flags indicating state of buffer |
| 271 | * @aob: pointer to QAOB used for the particular SBAL |
| 272 | * @user: pointer to upper layer program's state information related to SBAL |
| 273 | * (stored in user1 data of QAOB) |
| 274 | */ |
| 275 | struct qdio_outbuf_state { |
| 276 | u8 flags; |
| 277 | struct qaob *aob; |
| 278 | void *user; |
| 279 | }; |
| 280 | |
| 281 | #define QDIO_OUTBUF_STATE_FLAG_NONE 0x00 |
| 282 | #define QDIO_OUTBUF_STATE_FLAG_PENDING 0x01 |
| 283 | |
| 284 | #define CHSC_AC1_INITIATE_INPUTQ 0x80 |
| 285 | |
frank.blaschka@de.ibm.com | 9cb7284 | 2011-08-08 01:33:56 +0000 | [diff] [blame] | 286 | |
| 287 | /* qdio adapter-characteristics-1 flag */ |
| 288 | #define AC1_SIGA_INPUT_NEEDED 0x40 /* process input queues */ |
| 289 | #define AC1_SIGA_OUTPUT_NEEDED 0x20 /* process output queues */ |
| 290 | #define AC1_SIGA_SYNC_NEEDED 0x10 /* ask hypervisor to sync */ |
| 291 | #define AC1_AUTOMATIC_SYNC_ON_THININT 0x08 /* set by hypervisor */ |
| 292 | #define AC1_AUTOMATIC_SYNC_ON_OUT_PCI 0x04 /* set by hypervisor */ |
| 293 | #define AC1_SC_QEBSM_AVAILABLE 0x02 /* available for subchannel */ |
| 294 | #define AC1_SC_QEBSM_ENABLED 0x01 /* enabled for subchannel */ |
| 295 | |
frank.blaschka@de.ibm.com | 104ea55 | 2011-08-08 01:33:55 +0000 | [diff] [blame] | 296 | #define CHSC_AC2_DATA_DIV_AVAILABLE 0x0010 |
| 297 | #define CHSC_AC2_DATA_DIV_ENABLED 0x0002 |
| 298 | |
| 299 | #define CHSC_AC3_FORMAT2_CQ_AVAILABLE 0x8000 |
| 300 | |
Jan Glauber | 779e6e1 | 2008-07-17 17:16:48 +0200 | [diff] [blame] | 301 | struct qdio_ssqd_desc { |
| 302 | u8 flags; |
| 303 | u8:8; |
| 304 | u16 sch; |
| 305 | u8 qfmt; |
| 306 | u8 parm; |
| 307 | u8 qdioac1; |
| 308 | u8 sch_class; |
| 309 | u8 pcnt; |
| 310 | u8 icnt; |
| 311 | u8:8; |
| 312 | u8 ocnt; |
| 313 | u8:8; |
| 314 | u8 mbccnt; |
| 315 | u16 qdioac2; |
| 316 | u64 sch_token; |
Klaus-Dieter Wacker | 7a0f475 | 2008-10-10 21:33:18 +0200 | [diff] [blame] | 317 | u8 mro; |
| 318 | u8 mri; |
frank.blaschka@de.ibm.com | 104ea55 | 2011-08-08 01:33:55 +0000 | [diff] [blame] | 319 | u16 qdioac3; |
Klaus-Dieter Wacker | 7a0f475 | 2008-10-10 21:33:18 +0200 | [diff] [blame] | 320 | u16:16; |
| 321 | u8:8; |
| 322 | u8 mmwc; |
Jan Glauber | 779e6e1 | 2008-07-17 17:16:48 +0200 | [diff] [blame] | 323 | } __attribute__ ((packed)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 324 | |
Jan Glauber | 779e6e1 | 2008-07-17 17:16:48 +0200 | [diff] [blame] | 325 | /* params are: ccw_device, qdio_error, queue_number, |
| 326 | first element processed, number of elements processed, int_parm */ |
| 327 | typedef void qdio_handler_t(struct ccw_device *, unsigned int, int, |
| 328 | int, int, unsigned long); |
| 329 | |
| 330 | /* qdio errors reported to the upper-layer program */ |
Jan Glauber | d303b6f | 2009-03-26 15:24:31 +0100 | [diff] [blame] | 331 | #define QDIO_ERROR_SIGA_TARGET 0x02 |
Jan Glauber | 779e6e1 | 2008-07-17 17:16:48 +0200 | [diff] [blame] | 332 | #define QDIO_ERROR_SIGA_ACCESS_EXCEPTION 0x10 |
| 333 | #define QDIO_ERROR_SIGA_BUSY 0x20 |
| 334 | #define QDIO_ERROR_ACTIVATE_CHECK_CONDITION 0x40 |
| 335 | #define QDIO_ERROR_SLSB_STATE 0x80 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 336 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 337 | /* for qdio_cleanup */ |
Jan Glauber | 779e6e1 | 2008-07-17 17:16:48 +0200 | [diff] [blame] | 338 | #define QDIO_FLAG_CLEANUP_USING_CLEAR 0x01 |
| 339 | #define QDIO_FLAG_CLEANUP_USING_HALT 0x02 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 340 | |
Jan Glauber | 779e6e1 | 2008-07-17 17:16:48 +0200 | [diff] [blame] | 341 | /** |
| 342 | * struct qdio_initialize - qdio initalization data |
| 343 | * @cdev: associated ccw device |
| 344 | * @q_format: queue format |
| 345 | * @adapter_name: name for the adapter |
| 346 | * @qib_param_field_format: format for qib_parm_field |
| 347 | * @qib_param_field: pointer to 128 bytes or NULL, if no param field |
Christof Schmitt | dcc18f4 | 2010-07-16 15:37:41 +0200 | [diff] [blame] | 348 | * @qib_rflags: rflags to set |
Jan Glauber | 779e6e1 | 2008-07-17 17:16:48 +0200 | [diff] [blame] | 349 | * @input_slib_elements: pointer to no_input_qs * 128 words of data or NULL |
| 350 | * @output_slib_elements: pointer to no_output_qs * 128 words of data or NULL |
| 351 | * @no_input_qs: number of input queues |
| 352 | * @no_output_qs: number of output queues |
| 353 | * @input_handler: handler to be called for input queues |
| 354 | * @output_handler: handler to be called for output queues |
frank.blaschka@de.ibm.com | 104ea55 | 2011-08-08 01:33:55 +0000 | [diff] [blame] | 355 | * @queue_start_poll: polling handlers (one per input queue or NULL) |
Jan Glauber | 779e6e1 | 2008-07-17 17:16:48 +0200 | [diff] [blame] | 356 | * @int_parm: interruption parameter |
Jan Glauber | 779e6e1 | 2008-07-17 17:16:48 +0200 | [diff] [blame] | 357 | * @input_sbal_addr_array: address of no_input_qs * 128 pointers |
| 358 | * @output_sbal_addr_array: address of no_output_qs * 128 pointers |
frank.blaschka@de.ibm.com | 104ea55 | 2011-08-08 01:33:55 +0000 | [diff] [blame] | 359 | * @output_sbal_state_array: no_output_qs * 128 state info (for CQ or NULL) |
Jan Glauber | 779e6e1 | 2008-07-17 17:16:48 +0200 | [diff] [blame] | 360 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 361 | struct qdio_initialize { |
| 362 | struct ccw_device *cdev; |
| 363 | unsigned char q_format; |
Swen Schillig | dfe5bb5 | 2011-08-15 14:40:31 +0200 | [diff] [blame] | 364 | unsigned char qdr_ac; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 365 | unsigned char adapter_name[8]; |
Jan Glauber | 779e6e1 | 2008-07-17 17:16:48 +0200 | [diff] [blame] | 366 | unsigned int qib_param_field_format; |
| 367 | unsigned char *qib_param_field; |
Christof Schmitt | dcc18f4 | 2010-07-16 15:37:41 +0200 | [diff] [blame] | 368 | unsigned char qib_rflags; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 369 | unsigned long *input_slib_elements; |
| 370 | unsigned long *output_slib_elements; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 371 | unsigned int no_input_qs; |
| 372 | unsigned int no_output_qs; |
| 373 | qdio_handler_t *input_handler; |
| 374 | qdio_handler_t *output_handler; |
frank.blaschka@de.ibm.com | 104ea55 | 2011-08-08 01:33:55 +0000 | [diff] [blame] | 375 | void (**queue_start_poll) (struct ccw_device *, int, unsigned long); |
Jan Glauber | 3d6c76f | 2011-01-05 12:47:50 +0100 | [diff] [blame] | 376 | int scan_threshold; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 377 | unsigned long int_parm; |
Jan Glauber | 779e6e1 | 2008-07-17 17:16:48 +0200 | [diff] [blame] | 378 | void **input_sbal_addr_array; |
| 379 | void **output_sbal_addr_array; |
frank.blaschka@de.ibm.com | 104ea55 | 2011-08-08 01:33:55 +0000 | [diff] [blame] | 380 | struct qdio_outbuf_state *output_sbal_state_array; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 381 | }; |
| 382 | |
Jan Glauber | 779e6e1 | 2008-07-17 17:16:48 +0200 | [diff] [blame] | 383 | #define QDIO_STATE_INACTIVE 0x00000002 /* after qdio_cleanup */ |
| 384 | #define QDIO_STATE_ESTABLISHED 0x00000004 /* after qdio_establish */ |
| 385 | #define QDIO_STATE_ACTIVE 0x00000008 /* after qdio_activate */ |
| 386 | #define QDIO_STATE_STOPPED 0x00000010 /* after queues went down */ |
| 387 | |
| 388 | #define QDIO_FLAG_SYNC_INPUT 0x01 |
| 389 | #define QDIO_FLAG_SYNC_OUTPUT 0x02 |
| 390 | #define QDIO_FLAG_PCI_OUT 0x10 |
| 391 | |
Jan Glauber | bbd50e1 | 2008-12-25 13:38:43 +0100 | [diff] [blame] | 392 | extern int qdio_allocate(struct qdio_initialize *); |
| 393 | extern int qdio_establish(struct qdio_initialize *); |
Jan Glauber | 779e6e1 | 2008-07-17 17:16:48 +0200 | [diff] [blame] | 394 | extern int qdio_activate(struct ccw_device *); |
frank.blaschka@de.ibm.com | 104ea55 | 2011-08-08 01:33:55 +0000 | [diff] [blame] | 395 | extern void qdio_release_aob(struct qaob *); |
Jan Glauber | d36deae | 2010-09-07 21:14:39 +0000 | [diff] [blame] | 396 | extern int do_QDIO(struct ccw_device *, unsigned int, int, unsigned int, |
| 397 | unsigned int); |
| 398 | extern int qdio_start_irq(struct ccw_device *, int); |
| 399 | extern int qdio_stop_irq(struct ccw_device *, int); |
| 400 | extern int qdio_get_next_buffers(struct ccw_device *, int, int *, int *); |
| 401 | extern int qdio_shutdown(struct ccw_device *, int); |
Jan Glauber | 779e6e1 | 2008-07-17 17:16:48 +0200 | [diff] [blame] | 402 | extern int qdio_free(struct ccw_device *); |
Jan Glauber | d36deae | 2010-09-07 21:14:39 +0000 | [diff] [blame] | 403 | extern int qdio_get_ssqd_desc(struct ccw_device *, struct qdio_ssqd_desc *); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 404 | |
| 405 | #endif /* __QDIO_H__ */ |