qdio.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584
  1. #ifndef _CIO_QDIO_H
  2. #define _CIO_QDIO_H
  3. #include <asm/page.h>
  4. #include "schid.h"
  5. #ifdef CONFIG_QDIO_DEBUG
  6. #define QDIO_VERBOSE_LEVEL 9
  7. #else /* CONFIG_QDIO_DEBUG */
  8. #define QDIO_VERBOSE_LEVEL 5
  9. #endif /* CONFIG_QDIO_DEBUG */
  10. #define QDIO_USE_PROCESSING_STATE
  11. #define QDIO_MINIMAL_BH_RELIEF_TIME 16
  12. #define QDIO_TIMER_POLL_VALUE 1
  13. #define IQDIO_TIMER_POLL_VALUE 1
  14. /*
  15. * unfortunately this can't be (QDIO_MAX_BUFFERS_PER_Q*4/3) or so -- as
  16. * we never know, whether we'll get initiative again, e.g. to give the
  17. * transmit skb's back to the stack, however the stack may be waiting for
  18. * them... therefore we define 4 as threshold to start polling (which
  19. * will stop as soon as the asynchronous queue catches up)
  20. * btw, this only applies to the asynchronous HiperSockets queue
  21. */
  22. #define IQDIO_FILL_LEVEL_TO_POLL 4
  23. #define TIQDIO_THININT_ISC 3
  24. #define TIQDIO_DELAY_TARGET 0
  25. #define QDIO_BUSY_BIT_PATIENCE 100 /* in microsecs */
  26. #define QDIO_BUSY_BIT_GIVE_UP 10000000 /* 10 seconds */
  27. #define IQDIO_GLOBAL_LAPS 2 /* GLOBAL_LAPS are not used as we */
  28. #define IQDIO_GLOBAL_LAPS_INT 1 /* don't global summary */
  29. #define IQDIO_LOCAL_LAPS 4
  30. #define IQDIO_LOCAL_LAPS_INT 1
  31. #define IQDIO_GLOBAL_SUMMARY_CC_MASK 2
  32. /*#define IQDIO_IQDC_INT_PARM 0x1234*/
  33. #define QDIO_Q_LAPS 5
  34. #define QDIO_STORAGE_KEY PAGE_DEFAULT_KEY
  35. #define L2_CACHELINE_SIZE 256
  36. #define INDICATORS_PER_CACHELINE (L2_CACHELINE_SIZE/sizeof(__u32))
  37. #define QDIO_PERF "qdio_perf"
  38. /* must be a power of 2 */
  39. /*#define QDIO_STATS_NUMBER 4
  40. #define QDIO_STATS_CLASSES 2
  41. #define QDIO_STATS_COUNT_NEEDED 2*/
  42. #define QDIO_NO_USE_COUNT_TIMEOUT (1*HZ) /* wait for 1 sec on each q before
  43. exiting without having use_count
  44. of the queue to 0 */
  45. #define QDIO_ESTABLISH_TIMEOUT (1*HZ)
  46. #define QDIO_ACTIVATE_TIMEOUT ((5*HZ)>>10)
  47. #define QDIO_CLEANUP_CLEAR_TIMEOUT (20*HZ)
  48. #define QDIO_CLEANUP_HALT_TIMEOUT (10*HZ)
  49. enum qdio_irq_states {
  50. QDIO_IRQ_STATE_INACTIVE,
  51. QDIO_IRQ_STATE_ESTABLISHED,
  52. QDIO_IRQ_STATE_ACTIVE,
  53. QDIO_IRQ_STATE_STOPPED,
  54. QDIO_IRQ_STATE_CLEANUP,
  55. QDIO_IRQ_STATE_ERR,
  56. NR_QDIO_IRQ_STATES,
  57. };
  58. /* used as intparm in do_IO: */
  59. #define QDIO_DOING_SENSEID 0
  60. #define QDIO_DOING_ESTABLISH 1
  61. #define QDIO_DOING_ACTIVATE 2
  62. #define QDIO_DOING_CLEANUP 3
  63. /************************* DEBUG FACILITY STUFF *********************/
  64. #define QDIO_DBF_HEX(ex,name,level,addr,len) \
  65. do { \
  66. if (ex) \
  67. debug_exception(qdio_dbf_##name,level,(void*)(addr),len); \
  68. else \
  69. debug_event(qdio_dbf_##name,level,(void*)(addr),len); \
  70. } while (0)
  71. #define QDIO_DBF_TEXT(ex,name,level,text) \
  72. do { \
  73. if (ex) \
  74. debug_text_exception(qdio_dbf_##name,level,text); \
  75. else \
  76. debug_text_event(qdio_dbf_##name,level,text); \
  77. } while (0)
  78. #define QDIO_DBF_HEX0(ex,name,addr,len) QDIO_DBF_HEX(ex,name,0,addr,len)
  79. #define QDIO_DBF_HEX1(ex,name,addr,len) QDIO_DBF_HEX(ex,name,1,addr,len)
  80. #define QDIO_DBF_HEX2(ex,name,addr,len) QDIO_DBF_HEX(ex,name,2,addr,len)
  81. #ifdef CONFIG_QDIO_DEBUG
  82. #define QDIO_DBF_HEX3(ex,name,addr,len) QDIO_DBF_HEX(ex,name,3,addr,len)
  83. #define QDIO_DBF_HEX4(ex,name,addr,len) QDIO_DBF_HEX(ex,name,4,addr,len)
  84. #define QDIO_DBF_HEX5(ex,name,addr,len) QDIO_DBF_HEX(ex,name,5,addr,len)
  85. #define QDIO_DBF_HEX6(ex,name,addr,len) QDIO_DBF_HEX(ex,name,6,addr,len)
  86. #else /* CONFIG_QDIO_DEBUG */
  87. #define QDIO_DBF_HEX3(ex,name,addr,len) do {} while (0)
  88. #define QDIO_DBF_HEX4(ex,name,addr,len) do {} while (0)
  89. #define QDIO_DBF_HEX5(ex,name,addr,len) do {} while (0)
  90. #define QDIO_DBF_HEX6(ex,name,addr,len) do {} while (0)
  91. #endif /* CONFIG_QDIO_DEBUG */
  92. #define QDIO_DBF_TEXT0(ex,name,text) QDIO_DBF_TEXT(ex,name,0,text)
  93. #define QDIO_DBF_TEXT1(ex,name,text) QDIO_DBF_TEXT(ex,name,1,text)
  94. #define QDIO_DBF_TEXT2(ex,name,text) QDIO_DBF_TEXT(ex,name,2,text)
  95. #ifdef CONFIG_QDIO_DEBUG
  96. #define QDIO_DBF_TEXT3(ex,name,text) QDIO_DBF_TEXT(ex,name,3,text)
  97. #define QDIO_DBF_TEXT4(ex,name,text) QDIO_DBF_TEXT(ex,name,4,text)
  98. #define QDIO_DBF_TEXT5(ex,name,text) QDIO_DBF_TEXT(ex,name,5,text)
  99. #define QDIO_DBF_TEXT6(ex,name,text) QDIO_DBF_TEXT(ex,name,6,text)
  100. #else /* CONFIG_QDIO_DEBUG */
  101. #define QDIO_DBF_TEXT3(ex,name,text) do {} while (0)
  102. #define QDIO_DBF_TEXT4(ex,name,text) do {} while (0)
  103. #define QDIO_DBF_TEXT5(ex,name,text) do {} while (0)
  104. #define QDIO_DBF_TEXT6(ex,name,text) do {} while (0)
  105. #endif /* CONFIG_QDIO_DEBUG */
  106. #define QDIO_DBF_SETUP_NAME "qdio_setup"
  107. #define QDIO_DBF_SETUP_LEN 8
  108. #define QDIO_DBF_SETUP_PAGES 4
  109. #define QDIO_DBF_SETUP_NR_AREAS 1
  110. #ifdef CONFIG_QDIO_DEBUG
  111. #define QDIO_DBF_SETUP_LEVEL 6
  112. #else /* CONFIG_QDIO_DEBUG */
  113. #define QDIO_DBF_SETUP_LEVEL 2
  114. #endif /* CONFIG_QDIO_DEBUG */
  115. #define QDIO_DBF_SBAL_NAME "qdio_labs" /* sbal */
  116. #define QDIO_DBF_SBAL_LEN 256
  117. #define QDIO_DBF_SBAL_PAGES 4
  118. #define QDIO_DBF_SBAL_NR_AREAS 2
  119. #ifdef CONFIG_QDIO_DEBUG
  120. #define QDIO_DBF_SBAL_LEVEL 6
  121. #else /* CONFIG_QDIO_DEBUG */
  122. #define QDIO_DBF_SBAL_LEVEL 2
  123. #endif /* CONFIG_QDIO_DEBUG */
  124. #define QDIO_DBF_TRACE_NAME "qdio_trace"
  125. #define QDIO_DBF_TRACE_LEN 8
  126. #define QDIO_DBF_TRACE_NR_AREAS 2
  127. #ifdef CONFIG_QDIO_DEBUG
  128. #define QDIO_DBF_TRACE_PAGES 16
  129. #define QDIO_DBF_TRACE_LEVEL 4 /* -------- could be even more verbose here */
  130. #else /* CONFIG_QDIO_DEBUG */
  131. #define QDIO_DBF_TRACE_PAGES 4
  132. #define QDIO_DBF_TRACE_LEVEL 2
  133. #endif /* CONFIG_QDIO_DEBUG */
  134. #define QDIO_DBF_SENSE_NAME "qdio_sense"
  135. #define QDIO_DBF_SENSE_LEN 64
  136. #define QDIO_DBF_SENSE_PAGES 2
  137. #define QDIO_DBF_SENSE_NR_AREAS 1
  138. #ifdef CONFIG_QDIO_DEBUG
  139. #define QDIO_DBF_SENSE_LEVEL 6
  140. #else /* CONFIG_QDIO_DEBUG */
  141. #define QDIO_DBF_SENSE_LEVEL 2
  142. #endif /* CONFIG_QDIO_DEBUG */
  143. #ifdef CONFIG_QDIO_DEBUG
  144. #define QDIO_TRACE_QTYPE QDIO_ZFCP_QFMT
  145. #define QDIO_DBF_SLSB_OUT_NAME "qdio_slsb_out"
  146. #define QDIO_DBF_SLSB_OUT_LEN QDIO_MAX_BUFFERS_PER_Q
  147. #define QDIO_DBF_SLSB_OUT_PAGES 256
  148. #define QDIO_DBF_SLSB_OUT_NR_AREAS 1
  149. #define QDIO_DBF_SLSB_OUT_LEVEL 6
  150. #define QDIO_DBF_SLSB_IN_NAME "qdio_slsb_in"
  151. #define QDIO_DBF_SLSB_IN_LEN QDIO_MAX_BUFFERS_PER_Q
  152. #define QDIO_DBF_SLSB_IN_PAGES 256
  153. #define QDIO_DBF_SLSB_IN_NR_AREAS 1
  154. #define QDIO_DBF_SLSB_IN_LEVEL 6
  155. #endif /* CONFIG_QDIO_DEBUG */
  156. #define QDIO_PRINTK_HEADER QDIO_NAME ": "
  157. #if QDIO_VERBOSE_LEVEL>8
  158. #define QDIO_PRINT_STUPID(x...) printk( KERN_DEBUG QDIO_PRINTK_HEADER x)
  159. #else
  160. #define QDIO_PRINT_STUPID(x...) do { } while (0)
  161. #endif
  162. #if QDIO_VERBOSE_LEVEL>7
  163. #define QDIO_PRINT_ALL(x...) printk( QDIO_PRINTK_HEADER x)
  164. #else
  165. #define QDIO_PRINT_ALL(x...) do { } while (0)
  166. #endif
  167. #if QDIO_VERBOSE_LEVEL>6
  168. #define QDIO_PRINT_INFO(x...) printk( QDIO_PRINTK_HEADER x)
  169. #else
  170. #define QDIO_PRINT_INFO(x...) do { } while (0)
  171. #endif
  172. #if QDIO_VERBOSE_LEVEL>5
  173. #define QDIO_PRINT_WARN(x...) printk( QDIO_PRINTK_HEADER x)
  174. #else
  175. #define QDIO_PRINT_WARN(x...) do { } while (0)
  176. #endif
  177. #if QDIO_VERBOSE_LEVEL>4
  178. #define QDIO_PRINT_ERR(x...) printk( QDIO_PRINTK_HEADER x)
  179. #else
  180. #define QDIO_PRINT_ERR(x...) do { } while (0)
  181. #endif
  182. #if QDIO_VERBOSE_LEVEL>3
  183. #define QDIO_PRINT_CRIT(x...) printk( QDIO_PRINTK_HEADER x)
  184. #else
  185. #define QDIO_PRINT_CRIT(x...) do { } while (0)
  186. #endif
  187. #if QDIO_VERBOSE_LEVEL>2
  188. #define QDIO_PRINT_ALERT(x...) printk( QDIO_PRINTK_HEADER x)
  189. #else
  190. #define QDIO_PRINT_ALERT(x...) do { } while (0)
  191. #endif
  192. #if QDIO_VERBOSE_LEVEL>1
  193. #define QDIO_PRINT_EMERG(x...) printk( QDIO_PRINTK_HEADER x)
  194. #else
  195. #define QDIO_PRINT_EMERG(x...) do { } while (0)
  196. #endif
  197. #define QDIO_HEXDUMP16(importance,header,ptr) \
  198. QDIO_PRINT_##importance(header "%02x %02x %02x %02x " \
  199. "%02x %02x %02x %02x %02x %02x %02x %02x " \
  200. "%02x %02x %02x %02x\n",*(((char*)ptr)), \
  201. *(((char*)ptr)+1),*(((char*)ptr)+2), \
  202. *(((char*)ptr)+3),*(((char*)ptr)+4), \
  203. *(((char*)ptr)+5),*(((char*)ptr)+6), \
  204. *(((char*)ptr)+7),*(((char*)ptr)+8), \
  205. *(((char*)ptr)+9),*(((char*)ptr)+10), \
  206. *(((char*)ptr)+11),*(((char*)ptr)+12), \
  207. *(((char*)ptr)+13),*(((char*)ptr)+14), \
  208. *(((char*)ptr)+15)); \
  209. QDIO_PRINT_##importance(header "%02x %02x %02x %02x %02x %02x %02x %02x " \
  210. "%02x %02x %02x %02x %02x %02x %02x %02x\n", \
  211. *(((char*)ptr)+16),*(((char*)ptr)+17), \
  212. *(((char*)ptr)+18),*(((char*)ptr)+19), \
  213. *(((char*)ptr)+20),*(((char*)ptr)+21), \
  214. *(((char*)ptr)+22),*(((char*)ptr)+23), \
  215. *(((char*)ptr)+24),*(((char*)ptr)+25), \
  216. *(((char*)ptr)+26),*(((char*)ptr)+27), \
  217. *(((char*)ptr)+28),*(((char*)ptr)+29), \
  218. *(((char*)ptr)+30),*(((char*)ptr)+31));
  219. /****************** END OF DEBUG FACILITY STUFF *********************/
  220. /*
  221. * Some instructions as assembly
  222. */
  223. static inline int
  224. do_sqbs(unsigned long sch, unsigned char state, int queue,
  225. unsigned int *start, unsigned int *count)
  226. {
  227. #ifdef CONFIG_64BIT
  228. register unsigned long _ccq asm ("0") = *count;
  229. register unsigned long _sch asm ("1") = sch;
  230. unsigned long _queuestart = ((unsigned long)queue << 32) | *start;
  231. asm volatile(
  232. " .insn rsy,0xeb000000008A,%1,0,0(%2)"
  233. : "+d" (_ccq), "+d" (_queuestart)
  234. : "d" ((unsigned long)state), "d" (_sch)
  235. : "memory", "cc");
  236. *count = _ccq & 0xff;
  237. *start = _queuestart & 0xff;
  238. return (_ccq >> 32) & 0xff;
  239. #else
  240. return 0;
  241. #endif
  242. }
  243. static inline int
  244. do_eqbs(unsigned long sch, unsigned char *state, int queue,
  245. unsigned int *start, unsigned int *count)
  246. {
  247. #ifdef CONFIG_64BIT
  248. register unsigned long _ccq asm ("0") = *count;
  249. register unsigned long _sch asm ("1") = sch;
  250. unsigned long _queuestart = ((unsigned long)queue << 32) | *start;
  251. unsigned long _state = 0;
  252. asm volatile(
  253. " .insn rrf,0xB99c0000,%1,%2,0,0"
  254. : "+d" (_ccq), "+d" (_queuestart), "+d" (_state)
  255. : "d" (_sch)
  256. : "memory", "cc" );
  257. *count = _ccq & 0xff;
  258. *start = _queuestart & 0xff;
  259. *state = _state & 0xff;
  260. return (_ccq >> 32) & 0xff;
  261. #else
  262. return 0;
  263. #endif
  264. }
  265. static inline int
  266. do_siga_sync(struct subchannel_id schid, unsigned int mask1, unsigned int mask2)
  267. {
  268. register unsigned long reg0 asm ("0") = 2;
  269. register struct subchannel_id reg1 asm ("1") = schid;
  270. register unsigned long reg2 asm ("2") = mask1;
  271. register unsigned long reg3 asm ("3") = mask2;
  272. int cc;
  273. asm volatile(
  274. " siga 0\n"
  275. " ipm %0\n"
  276. " srl %0,28\n"
  277. : "=d" (cc)
  278. : "d" (reg0), "d" (reg1), "d" (reg2), "d" (reg3) : "cc");
  279. return cc;
  280. }
  281. static inline int
  282. do_siga_input(struct subchannel_id schid, unsigned int mask)
  283. {
  284. register unsigned long reg0 asm ("0") = 1;
  285. register struct subchannel_id reg1 asm ("1") = schid;
  286. register unsigned long reg2 asm ("2") = mask;
  287. int cc;
  288. asm volatile(
  289. " siga 0\n"
  290. " ipm %0\n"
  291. " srl %0,28\n"
  292. : "=d" (cc)
  293. : "d" (reg0), "d" (reg1), "d" (reg2) : "cc", "memory");
  294. return cc;
  295. }
  296. static inline int
  297. do_siga_output(unsigned long schid, unsigned long mask, __u32 *bb,
  298. unsigned int fc)
  299. {
  300. register unsigned long __fc asm("0") = fc;
  301. register unsigned long __schid asm("1") = schid;
  302. register unsigned long __mask asm("2") = mask;
  303. int cc;
  304. asm volatile(
  305. " siga 0\n"
  306. "0: ipm %0\n"
  307. " srl %0,28\n"
  308. "1:\n"
  309. EX_TABLE(0b,1b)
  310. : "=d" (cc), "+d" (__fc), "+d" (__schid), "+d" (__mask)
  311. : "0" (QDIO_SIGA_ERROR_ACCESS_EXCEPTION)
  312. : "cc", "memory");
  313. (*bb) = ((unsigned int) __fc) >> 31;
  314. return cc;
  315. }
  316. static inline unsigned long
  317. do_clear_global_summary(void)
  318. {
  319. register unsigned long __fn asm("1") = 3;
  320. register unsigned long __tmp asm("2");
  321. register unsigned long __time asm("3");
  322. asm volatile(
  323. " .insn rre,0xb2650000,2,0"
  324. : "+d" (__fn), "=d" (__tmp), "=d" (__time));
  325. return __time;
  326. }
  327. /*
  328. * QDIO device commands returned by extended Sense-ID
  329. */
  330. #define DEFAULT_ESTABLISH_QS_CMD 0x1b
  331. #define DEFAULT_ESTABLISH_QS_COUNT 0x1000
  332. #define DEFAULT_ACTIVATE_QS_CMD 0x1f
  333. #define DEFAULT_ACTIVATE_QS_COUNT 0
  334. /*
  335. * additional CIWs returned by extended Sense-ID
  336. */
  337. #define CIW_TYPE_EQUEUE 0x3 /* establish QDIO queues */
  338. #define CIW_TYPE_AQUEUE 0x4 /* activate QDIO queues */
  339. #define QDIO_CHSC_RESPONSE_CODE_OK 1
  340. /* flags for st qdio sch data */
  341. #define CHSC_FLAG_QDIO_CAPABILITY 0x80
  342. #define CHSC_FLAG_VALIDITY 0x40
  343. #define CHSC_FLAG_SIGA_INPUT_NECESSARY 0x40
  344. #define CHSC_FLAG_SIGA_OUTPUT_NECESSARY 0x20
  345. #define CHSC_FLAG_SIGA_SYNC_NECESSARY 0x10
  346. #define CHSC_FLAG_SIGA_SYNC_DONE_ON_THININTS 0x08
  347. #define CHSC_FLAG_SIGA_SYNC_DONE_ON_OUTB_PCIS 0x04
  348. struct qdio_perf_stats {
  349. unsigned long tl_runs;
  350. unsigned long siga_outs;
  351. unsigned long siga_ins;
  352. unsigned long siga_syncs;
  353. unsigned long pcis;
  354. unsigned long thinints;
  355. unsigned long fast_reqs;
  356. __u64 start_time_outbound;
  357. unsigned long outbound_cnt;
  358. unsigned long outbound_time;
  359. __u64 start_time_inbound;
  360. unsigned long inbound_cnt;
  361. unsigned long inbound_time;
  362. };
  363. /* unlikely as the later the better */
  364. #define SYNC_MEMORY if (unlikely(q->siga_sync)) qdio_siga_sync_q(q)
  365. #define SYNC_MEMORY_ALL if (unlikely(q->siga_sync)) \
  366. qdio_siga_sync(q,~0U,~0U)
  367. #define SYNC_MEMORY_ALL_OUTB if (unlikely(q->siga_sync)) \
  368. qdio_siga_sync(q,~0U,0)
  369. #define NOW qdio_get_micros()
  370. #define SAVE_TIMESTAMP(q) q->timing.last_transfer_time=NOW
  371. #define GET_SAVED_TIMESTAMP(q) (q->timing.last_transfer_time)
  372. #define SAVE_FRONTIER(q,val) q->last_move_ftc=val
  373. #define GET_SAVED_FRONTIER(q) (q->last_move_ftc)
  374. #define MY_MODULE_STRING(x) #x
  375. #ifdef CONFIG_64BIT
  376. #define QDIO_GET_ADDR(x) ((__u32)(unsigned long)x)
  377. #else /* CONFIG_64BIT */
  378. #define QDIO_GET_ADDR(x) ((__u32)(long)x)
  379. #endif /* CONFIG_64BIT */
  380. struct qdio_q {
  381. volatile struct slsb slsb;
  382. char unused[QDIO_MAX_BUFFERS_PER_Q];
  383. __u32 * dev_st_chg_ind;
  384. int is_input_q;
  385. struct subchannel_id schid;
  386. struct ccw_device *cdev;
  387. unsigned int is_iqdio_q;
  388. unsigned int is_thinint_q;
  389. /* bit 0 means queue 0, bit 1 means queue 1, ... */
  390. unsigned int mask;
  391. unsigned int q_no;
  392. qdio_handler_t (*handler);
  393. /* points to the next buffer to be checked for having
  394. * been processed by the card (outbound)
  395. * or to the next buffer the program should check for (inbound) */
  396. volatile int first_to_check;
  397. /* and the last time it was: */
  398. volatile int last_move_ftc;
  399. atomic_t number_of_buffers_used;
  400. atomic_t polling;
  401. unsigned int siga_in;
  402. unsigned int siga_out;
  403. unsigned int siga_sync;
  404. unsigned int siga_sync_done_on_thinints;
  405. unsigned int siga_sync_done_on_outb_tis;
  406. unsigned int hydra_gives_outbound_pcis;
  407. /* used to save beginning position when calling dd_handlers */
  408. int first_element_to_kick;
  409. atomic_t use_count;
  410. atomic_t is_in_shutdown;
  411. void *irq_ptr;
  412. #ifdef QDIO_USE_TIMERS_FOR_POLLING
  413. struct timer_list timer;
  414. atomic_t timer_already_set;
  415. spinlock_t timer_lock;
  416. #else /* QDIO_USE_TIMERS_FOR_POLLING */
  417. struct tasklet_struct tasklet;
  418. #endif /* QDIO_USE_TIMERS_FOR_POLLING */
  419. enum qdio_irq_states state;
  420. /* used to store the error condition during a data transfer */
  421. unsigned int qdio_error;
  422. unsigned int siga_error;
  423. unsigned int error_status_flags;
  424. /* list of interesting queues */
  425. volatile struct qdio_q *list_next;
  426. volatile struct qdio_q *list_prev;
  427. struct sl *sl;
  428. volatile struct sbal *sbal[QDIO_MAX_BUFFERS_PER_Q];
  429. struct qdio_buffer *qdio_buffers[QDIO_MAX_BUFFERS_PER_Q];
  430. unsigned long int_parm;
  431. /*struct {
  432. int in_bh_check_limit;
  433. int threshold;
  434. } threshold_classes[QDIO_STATS_CLASSES];*/
  435. struct {
  436. /* inbound: the time to stop polling
  437. outbound: the time to kick peer */
  438. int threshold; /* the real value */
  439. /* outbound: last time of do_QDIO
  440. inbound: last time of noticing incoming data */
  441. /*__u64 last_transfer_times[QDIO_STATS_NUMBER];
  442. int last_transfer_index; */
  443. __u64 last_transfer_time;
  444. __u64 busy_start;
  445. } timing;
  446. atomic_t busy_siga_counter;
  447. unsigned int queue_type;
  448. /* leave this member at the end. won't be cleared in qdio_fill_qs */
  449. struct slib *slib; /* a page is allocated under this pointer,
  450. sl points into this page, offset PAGE_SIZE/2
  451. (after slib) */
  452. } __attribute__ ((aligned(256)));
  453. struct qdio_irq {
  454. __u32 * volatile dev_st_chg_ind;
  455. unsigned long int_parm;
  456. struct subchannel_id schid;
  457. unsigned int is_iqdio_irq;
  458. unsigned int is_thinint_irq;
  459. unsigned int hydra_gives_outbound_pcis;
  460. unsigned int sync_done_on_outb_pcis;
  461. /* QEBSM facility */
  462. unsigned int is_qebsm;
  463. unsigned long sch_token;
  464. enum qdio_irq_states state;
  465. unsigned int no_input_qs;
  466. unsigned int no_output_qs;
  467. unsigned char qdioac;
  468. struct ccw1 ccw;
  469. struct ciw equeue;
  470. struct ciw aqueue;
  471. struct qib qib;
  472. void (*original_int_handler) (struct ccw_device *,
  473. unsigned long, struct irb *);
  474. /* leave these four members together at the end. won't be cleared in qdio_fill_irq */
  475. struct qdr *qdr;
  476. struct qdio_q *input_qs[QDIO_MAX_QUEUES_PER_IRQ];
  477. struct qdio_q *output_qs[QDIO_MAX_QUEUES_PER_IRQ];
  478. struct semaphore setting_up_sema;
  479. };
  480. #endif