qeth.h 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245
  1. #ifndef __QETH_H__
  2. #define __QETH_H__
  3. #include <linux/if.h>
  4. #include <linux/if_arp.h>
  5. #include <linux/if_tr.h>
  6. #include <linux/trdevice.h>
  7. #include <linux/etherdevice.h>
  8. #include <linux/if_vlan.h>
  9. #include <linux/ctype.h>
  10. #include <net/ipv6.h>
  11. #include <linux/in6.h>
  12. #include <net/if_inet6.h>
  13. #include <net/addrconf.h>
  14. #include <linux/bitops.h>
  15. #include <asm/debug.h>
  16. #include <asm/qdio.h>
  17. #include <asm/ccwdev.h>
  18. #include <asm/ccwgroup.h>
  19. #include "qeth_mpc.h"
  20. #ifdef CONFIG_QETH_IPV6
  21. #define QETH_VERSION_IPV6 ":IPv6"
  22. #else
  23. #define QETH_VERSION_IPV6 ""
  24. #endif
  25. #ifdef CONFIG_QETH_VLAN
  26. #define QETH_VERSION_VLAN ":VLAN"
  27. #else
  28. #define QETH_VERSION_VLAN ""
  29. #endif
  30. /**
  31. * Debug Facility stuff
  32. */
  33. #define QETH_DBF_SETUP_NAME "qeth_setup"
  34. #define QETH_DBF_SETUP_LEN 8
  35. #define QETH_DBF_SETUP_PAGES 8
  36. #define QETH_DBF_SETUP_NR_AREAS 1
  37. #define QETH_DBF_SETUP_LEVEL 5
  38. #define QETH_DBF_MISC_NAME "qeth_misc"
  39. #define QETH_DBF_MISC_LEN 128
  40. #define QETH_DBF_MISC_PAGES 2
  41. #define QETH_DBF_MISC_NR_AREAS 1
  42. #define QETH_DBF_MISC_LEVEL 2
  43. #define QETH_DBF_DATA_NAME "qeth_data"
  44. #define QETH_DBF_DATA_LEN 96
  45. #define QETH_DBF_DATA_PAGES 8
  46. #define QETH_DBF_DATA_NR_AREAS 1
  47. #define QETH_DBF_DATA_LEVEL 2
  48. #define QETH_DBF_CONTROL_NAME "qeth_control"
  49. #define QETH_DBF_CONTROL_LEN 256
  50. #define QETH_DBF_CONTROL_PAGES 8
  51. #define QETH_DBF_CONTROL_NR_AREAS 2
  52. #define QETH_DBF_CONTROL_LEVEL 5
  53. #define QETH_DBF_TRACE_NAME "qeth_trace"
  54. #define QETH_DBF_TRACE_LEN 8
  55. #define QETH_DBF_TRACE_PAGES 4
  56. #define QETH_DBF_TRACE_NR_AREAS 2
  57. #define QETH_DBF_TRACE_LEVEL 3
  58. extern debug_info_t *qeth_dbf_trace;
  59. #define QETH_DBF_SENSE_NAME "qeth_sense"
  60. #define QETH_DBF_SENSE_LEN 64
  61. #define QETH_DBF_SENSE_PAGES 2
  62. #define QETH_DBF_SENSE_NR_AREAS 1
  63. #define QETH_DBF_SENSE_LEVEL 2
  64. #define QETH_DBF_QERR_NAME "qeth_qerr"
  65. #define QETH_DBF_QERR_LEN 8
  66. #define QETH_DBF_QERR_PAGES 2
  67. #define QETH_DBF_QERR_NR_AREAS 2
  68. #define QETH_DBF_QERR_LEVEL 2
  69. #define QETH_DBF_TEXT(name,level,text) \
  70. do { \
  71. debug_text_event(qeth_dbf_##name,level,text); \
  72. } while (0)
  73. #define QETH_DBF_HEX(name,level,addr,len) \
  74. do { \
  75. debug_event(qeth_dbf_##name,level,(void*)(addr),len); \
  76. } while (0)
  77. DECLARE_PER_CPU(char[256], qeth_dbf_txt_buf);
  78. #define QETH_DBF_TEXT_(name,level,text...) \
  79. do { \
  80. char* dbf_txt_buf = get_cpu_var(qeth_dbf_txt_buf); \
  81. sprintf(dbf_txt_buf, text); \
  82. debug_text_event(qeth_dbf_##name,level,dbf_txt_buf); \
  83. put_cpu_var(qeth_dbf_txt_buf); \
  84. } while (0)
  85. #define QETH_DBF_SPRINTF(name,level,text...) \
  86. do { \
  87. debug_sprintf_event(qeth_dbf_trace, level, ##text ); \
  88. debug_sprintf_event(qeth_dbf_trace, level, text ); \
  89. } while (0)
  90. /**
  91. * some more debug stuff
  92. */
  93. #define PRINTK_HEADER "qeth: "
  94. #define HEXDUMP16(importance,header,ptr) \
  95. PRINT_##importance(header "%02x %02x %02x %02x %02x %02x %02x %02x " \
  96. "%02x %02x %02x %02x %02x %02x %02x %02x\n", \
  97. *(((char*)ptr)),*(((char*)ptr)+1),*(((char*)ptr)+2), \
  98. *(((char*)ptr)+3),*(((char*)ptr)+4),*(((char*)ptr)+5), \
  99. *(((char*)ptr)+6),*(((char*)ptr)+7),*(((char*)ptr)+8), \
  100. *(((char*)ptr)+9),*(((char*)ptr)+10),*(((char*)ptr)+11), \
  101. *(((char*)ptr)+12),*(((char*)ptr)+13), \
  102. *(((char*)ptr)+14),*(((char*)ptr)+15)); \
  103. PRINT_##importance(header "%02x %02x %02x %02x %02x %02x %02x %02x " \
  104. "%02x %02x %02x %02x %02x %02x %02x %02x\n", \
  105. *(((char*)ptr)+16),*(((char*)ptr)+17), \
  106. *(((char*)ptr)+18),*(((char*)ptr)+19), \
  107. *(((char*)ptr)+20),*(((char*)ptr)+21), \
  108. *(((char*)ptr)+22),*(((char*)ptr)+23), \
  109. *(((char*)ptr)+24),*(((char*)ptr)+25), \
  110. *(((char*)ptr)+26),*(((char*)ptr)+27), \
  111. *(((char*)ptr)+28),*(((char*)ptr)+29), \
  112. *(((char*)ptr)+30),*(((char*)ptr)+31));
  113. static inline void
  114. qeth_hex_dump(unsigned char *buf, size_t len)
  115. {
  116. size_t i;
  117. for (i = 0; i < len; i++) {
  118. if (i && !(i % 16))
  119. printk("\n");
  120. printk("%02x ", *(buf + i));
  121. }
  122. printk("\n");
  123. }
  124. #define SENSE_COMMAND_REJECT_BYTE 0
  125. #define SENSE_COMMAND_REJECT_FLAG 0x80
  126. #define SENSE_RESETTING_EVENT_BYTE 1
  127. #define SENSE_RESETTING_EVENT_FLAG 0x80
  128. #define atomic_swap(a,b) xchg((int *)a.counter, b)
  129. /*
  130. * Common IO related definitions
  131. */
  132. extern struct device *qeth_root_dev;
  133. extern struct ccw_driver qeth_ccw_driver;
  134. extern struct ccwgroup_driver qeth_ccwgroup_driver;
  135. #define CARD_RDEV(card) card->read.ccwdev
  136. #define CARD_WDEV(card) card->write.ccwdev
  137. #define CARD_DDEV(card) card->data.ccwdev
  138. #define CARD_BUS_ID(card) card->gdev->dev.bus_id
  139. #define CARD_RDEV_ID(card) card->read.ccwdev->dev.bus_id
  140. #define CARD_WDEV_ID(card) card->write.ccwdev->dev.bus_id
  141. #define CARD_DDEV_ID(card) card->data.ccwdev->dev.bus_id
  142. #define CHANNEL_ID(channel) channel->ccwdev->dev.bus_id
  143. #define CARD_FROM_CDEV(cdev) (struct qeth_card *) \
  144. ((struct ccwgroup_device *)cdev->dev.driver_data)\
  145. ->dev.driver_data;
  146. /**
  147. * card stuff
  148. */
  149. #ifdef CONFIG_QETH_PERF_STATS
  150. struct qeth_perf_stats {
  151. unsigned int bufs_rec;
  152. unsigned int bufs_sent;
  153. unsigned int skbs_sent_pack;
  154. unsigned int bufs_sent_pack;
  155. unsigned int sc_dp_p;
  156. unsigned int sc_p_dp;
  157. /* qdio_input_handler: number of times called, time spent in */
  158. __u64 inbound_start_time;
  159. unsigned int inbound_cnt;
  160. unsigned int inbound_time;
  161. /* qeth_send_packet: number of times called, time spent in */
  162. __u64 outbound_start_time;
  163. unsigned int outbound_cnt;
  164. unsigned int outbound_time;
  165. /* qdio_output_handler: number of times called, time spent in */
  166. __u64 outbound_handler_start_time;
  167. unsigned int outbound_handler_cnt;
  168. unsigned int outbound_handler_time;
  169. /* number of calls to and time spent in do_QDIO for inbound queue */
  170. __u64 inbound_do_qdio_start_time;
  171. unsigned int inbound_do_qdio_cnt;
  172. unsigned int inbound_do_qdio_time;
  173. /* number of calls to and time spent in do_QDIO for outbound queues */
  174. __u64 outbound_do_qdio_start_time;
  175. unsigned int outbound_do_qdio_cnt;
  176. unsigned int outbound_do_qdio_time;
  177. /* eddp data */
  178. unsigned int large_send_bytes;
  179. unsigned int large_send_cnt;
  180. unsigned int sg_skbs_sent;
  181. unsigned int sg_frags_sent;
  182. };
  183. #endif /* CONFIG_QETH_PERF_STATS */
  184. /* Routing stuff */
  185. struct qeth_routing_info {
  186. enum qeth_routing_types type;
  187. };
  188. /* IPA stuff */
  189. struct qeth_ipa_info {
  190. __u32 supported_funcs;
  191. __u32 enabled_funcs;
  192. };
  193. static inline int
  194. qeth_is_ipa_supported(struct qeth_ipa_info *ipa, enum qeth_ipa_funcs func)
  195. {
  196. return (ipa->supported_funcs & func);
  197. }
  198. static inline int
  199. qeth_is_ipa_enabled(struct qeth_ipa_info *ipa, enum qeth_ipa_funcs func)
  200. {
  201. return (ipa->supported_funcs & ipa->enabled_funcs & func);
  202. }
  203. #define qeth_adp_supported(c,f) \
  204. qeth_is_ipa_supported(&c->options.adp, f)
  205. #define qeth_adp_enabled(c,f) \
  206. qeth_is_ipa_enabled(&c->options.adp, f)
  207. #define qeth_is_supported(c,f) \
  208. qeth_is_ipa_supported(&c->options.ipa4, f)
  209. #define qeth_is_enabled(c,f) \
  210. qeth_is_ipa_enabled(&c->options.ipa4, f)
  211. #ifdef CONFIG_QETH_IPV6
  212. #define qeth_is_supported6(c,f) \
  213. qeth_is_ipa_supported(&c->options.ipa6, f)
  214. #define qeth_is_enabled6(c,f) \
  215. qeth_is_ipa_enabled(&c->options.ipa6, f)
  216. #else /* CONFIG_QETH_IPV6 */
  217. #define qeth_is_supported6(c,f) 0
  218. #define qeth_is_enabled6(c,f) 0
  219. #endif /* CONFIG_QETH_IPV6 */
  220. #define qeth_is_ipafunc_supported(c,prot,f) \
  221. (prot==QETH_PROT_IPV6)? qeth_is_supported6(c,f):qeth_is_supported(c,f)
  222. #define qeth_is_ipafunc_enabled(c,prot,f) \
  223. (prot==QETH_PROT_IPV6)? qeth_is_enabled6(c,f):qeth_is_enabled(c,f)
  224. #define QETH_IDX_FUNC_LEVEL_OSAE_ENA_IPAT 0x0101
  225. #define QETH_IDX_FUNC_LEVEL_OSAE_DIS_IPAT 0x0101
  226. #define QETH_IDX_FUNC_LEVEL_IQD_ENA_IPAT 0x4108
  227. #define QETH_IDX_FUNC_LEVEL_IQD_DIS_IPAT 0x5108
  228. #define QETH_MODELLIST_ARRAY \
  229. {{0x1731,0x01,0x1732,0x01,QETH_CARD_TYPE_OSAE,1, \
  230. QETH_IDX_FUNC_LEVEL_OSAE_ENA_IPAT, \
  231. QETH_IDX_FUNC_LEVEL_OSAE_DIS_IPAT, \
  232. QETH_MAX_QUEUES,0}, \
  233. {0x1731,0x05,0x1732,0x05,QETH_CARD_TYPE_IQD,0, \
  234. QETH_IDX_FUNC_LEVEL_IQD_ENA_IPAT, \
  235. QETH_IDX_FUNC_LEVEL_IQD_DIS_IPAT, \
  236. QETH_MAX_QUEUES,0x103}, \
  237. {0x1731,0x06,0x1732,0x06,QETH_CARD_TYPE_OSN,0, \
  238. QETH_IDX_FUNC_LEVEL_OSAE_ENA_IPAT, \
  239. QETH_IDX_FUNC_LEVEL_OSAE_DIS_IPAT, \
  240. QETH_MAX_QUEUES,0}, \
  241. {0,0,0,0,0,0,0,0,0}}
  242. #define QETH_REAL_CARD 1
  243. #define QETH_VLAN_CARD 2
  244. #define QETH_BUFSIZE 4096
  245. /**
  246. * some more defs
  247. */
  248. #define IF_NAME_LEN 16
  249. #define QETH_TX_TIMEOUT 100 * HZ
  250. #define QETH_HEADER_SIZE 32
  251. #define MAX_PORTNO 15
  252. #define QETH_FAKE_LL_LEN_ETH ETH_HLEN
  253. #define QETH_FAKE_LL_LEN_TR (sizeof(struct trh_hdr)-TR_MAXRIFLEN+sizeof(struct trllc))
  254. #define QETH_FAKE_LL_V6_ADDR_POS 24
  255. /*IPv6 address autoconfiguration stuff*/
  256. #define UNIQUE_ID_IF_CREATE_ADDR_FAILED 0xfffe
  257. #define UNIQUE_ID_NOT_BY_CARD 0x10000
  258. /*****************************************************************************/
  259. /* QDIO queue and buffer handling */
  260. /*****************************************************************************/
  261. #define QETH_MAX_QUEUES 4
  262. #define QETH_IN_BUF_SIZE_DEFAULT 65536
  263. #define QETH_IN_BUF_COUNT_DEFAULT 16
  264. #define QETH_IN_BUF_COUNT_MIN 8
  265. #define QETH_IN_BUF_COUNT_MAX 128
  266. #define QETH_MAX_BUFFER_ELEMENTS(card) ((card)->qdio.in_buf_size >> 12)
  267. #define QETH_IN_BUF_REQUEUE_THRESHOLD(card) \
  268. ((card)->qdio.in_buf_pool.buf_count / 2)
  269. /* buffers we have to be behind before we get a PCI */
  270. #define QETH_PCI_THRESHOLD_A(card) ((card)->qdio.in_buf_pool.buf_count+1)
  271. /*enqueued free buffers left before we get a PCI*/
  272. #define QETH_PCI_THRESHOLD_B(card) 0
  273. /*not used unless the microcode gets patched*/
  274. #define QETH_PCI_TIMER_VALUE(card) 3
  275. #define QETH_MIN_INPUT_THRESHOLD 1
  276. #define QETH_MAX_INPUT_THRESHOLD 500
  277. #define QETH_MIN_OUTPUT_THRESHOLD 1
  278. #define QETH_MAX_OUTPUT_THRESHOLD 300
  279. /* priority queing */
  280. #define QETH_PRIOQ_DEFAULT QETH_NO_PRIO_QUEUEING
  281. #define QETH_DEFAULT_QUEUE 2
  282. #define QETH_NO_PRIO_QUEUEING 0
  283. #define QETH_PRIO_Q_ING_PREC 1
  284. #define QETH_PRIO_Q_ING_TOS 2
  285. #define IP_TOS_LOWDELAY 0x10
  286. #define IP_TOS_HIGHTHROUGHPUT 0x08
  287. #define IP_TOS_HIGHRELIABILITY 0x04
  288. #define IP_TOS_NOTIMPORTANT 0x02
  289. /* Packing */
  290. #define QETH_LOW_WATERMARK_PACK 2
  291. #define QETH_HIGH_WATERMARK_PACK 5
  292. #define QETH_WATERMARK_PACK_FUZZ 1
  293. #define QETH_IP_HEADER_SIZE 40
  294. struct qeth_hdr_layer3 {
  295. __u8 id;
  296. __u8 flags;
  297. __u16 inbound_checksum; /*TSO:__u16 seqno */
  298. __u32 token; /*TSO: __u32 reserved */
  299. __u16 length;
  300. __u8 vlan_prio;
  301. __u8 ext_flags;
  302. __u16 vlan_id;
  303. __u16 frame_offset;
  304. __u8 dest_addr[16];
  305. } __attribute__ ((packed));
  306. struct qeth_hdr_layer2 {
  307. __u8 id;
  308. __u8 flags[3];
  309. __u8 port_no;
  310. __u8 hdr_length;
  311. __u16 pkt_length;
  312. __u16 seq_no;
  313. __u16 vlan_id;
  314. __u32 reserved;
  315. __u8 reserved2[16];
  316. } __attribute__ ((packed));
  317. struct qeth_hdr_osn {
  318. __u8 id;
  319. __u8 reserved;
  320. __u16 seq_no;
  321. __u16 reserved2;
  322. __u16 control_flags;
  323. __u16 pdu_length;
  324. __u8 reserved3[18];
  325. __u32 ccid;
  326. } __attribute__ ((packed));
  327. struct qeth_hdr {
  328. union {
  329. struct qeth_hdr_layer2 l2;
  330. struct qeth_hdr_layer3 l3;
  331. struct qeth_hdr_osn osn;
  332. } hdr;
  333. } __attribute__ ((packed));
  334. /*TCP Segmentation Offload header*/
  335. struct qeth_hdr_ext_tso {
  336. __u16 hdr_tot_len;
  337. __u8 imb_hdr_no;
  338. __u8 reserved;
  339. __u8 hdr_type;
  340. __u8 hdr_version;
  341. __u16 hdr_len;
  342. __u32 payload_len;
  343. __u16 mss;
  344. __u16 dg_hdr_len;
  345. __u8 padding[16];
  346. } __attribute__ ((packed));
  347. struct qeth_hdr_tso {
  348. struct qeth_hdr hdr; /*hdr->hdr.l3.xxx*/
  349. struct qeth_hdr_ext_tso ext;
  350. } __attribute__ ((packed));
  351. /* flags for qeth_hdr.flags */
  352. #define QETH_HDR_PASSTHRU 0x10
  353. #define QETH_HDR_IPV6 0x80
  354. #define QETH_HDR_CAST_MASK 0x07
  355. enum qeth_cast_flags {
  356. QETH_CAST_UNICAST = 0x06,
  357. QETH_CAST_MULTICAST = 0x04,
  358. QETH_CAST_BROADCAST = 0x05,
  359. QETH_CAST_ANYCAST = 0x07,
  360. QETH_CAST_NOCAST = 0x00,
  361. };
  362. enum qeth_layer2_frame_flags {
  363. QETH_LAYER2_FLAG_MULTICAST = 0x01,
  364. QETH_LAYER2_FLAG_BROADCAST = 0x02,
  365. QETH_LAYER2_FLAG_UNICAST = 0x04,
  366. QETH_LAYER2_FLAG_VLAN = 0x10,
  367. };
  368. enum qeth_header_ids {
  369. QETH_HEADER_TYPE_LAYER3 = 0x01,
  370. QETH_HEADER_TYPE_LAYER2 = 0x02,
  371. QETH_HEADER_TYPE_TSO = 0x03,
  372. QETH_HEADER_TYPE_OSN = 0x04,
  373. };
  374. /* flags for qeth_hdr.ext_flags */
  375. #define QETH_HDR_EXT_VLAN_FRAME 0x01
  376. #define QETH_HDR_EXT_TOKEN_ID 0x02
  377. #define QETH_HDR_EXT_INCLUDE_VLAN_TAG 0x04
  378. #define QETH_HDR_EXT_SRC_MAC_ADDR 0x08
  379. #define QETH_HDR_EXT_CSUM_HDR_REQ 0x10
  380. #define QETH_HDR_EXT_CSUM_TRANSP_REQ 0x20
  381. #define QETH_HDR_EXT_UDP_TSO 0x40 /*bit off for TCP*/
  382. static inline int
  383. qeth_is_last_sbale(struct qdio_buffer_element *sbale)
  384. {
  385. return (sbale->flags & SBAL_FLAGS_LAST_ENTRY);
  386. }
  387. enum qeth_qdio_buffer_states {
  388. /*
  389. * inbound: read out by driver; owned by hardware in order to be filled
  390. * outbound: owned by driver in order to be filled
  391. */
  392. QETH_QDIO_BUF_EMPTY,
  393. /*
  394. * inbound: filled by hardware; owned by driver in order to be read out
  395. * outbound: filled by driver; owned by hardware in order to be sent
  396. */
  397. QETH_QDIO_BUF_PRIMED,
  398. };
  399. enum qeth_qdio_info_states {
  400. QETH_QDIO_UNINITIALIZED,
  401. QETH_QDIO_ALLOCATED,
  402. QETH_QDIO_ESTABLISHED,
  403. };
  404. struct qeth_buffer_pool_entry {
  405. struct list_head list;
  406. struct list_head init_list;
  407. void *elements[QDIO_MAX_ELEMENTS_PER_BUFFER];
  408. };
  409. struct qeth_qdio_buffer_pool {
  410. struct list_head entry_list;
  411. int buf_count;
  412. };
  413. struct qeth_qdio_buffer {
  414. struct qdio_buffer *buffer;
  415. volatile enum qeth_qdio_buffer_states state;
  416. /* the buffer pool entry currently associated to this buffer */
  417. struct qeth_buffer_pool_entry *pool_entry;
  418. };
  419. struct qeth_qdio_q {
  420. struct qdio_buffer qdio_bufs[QDIO_MAX_BUFFERS_PER_Q];
  421. struct qeth_qdio_buffer bufs[QDIO_MAX_BUFFERS_PER_Q];
  422. /*
  423. * buf_to_init means "buffer must be initialized by driver and must
  424. * be made available for hardware" -> state is set to EMPTY
  425. */
  426. volatile int next_buf_to_init;
  427. } __attribute__ ((aligned(256)));
  428. /* possible types of qeth large_send support */
  429. enum qeth_large_send_types {
  430. QETH_LARGE_SEND_NO,
  431. QETH_LARGE_SEND_EDDP,
  432. QETH_LARGE_SEND_TSO,
  433. };
  434. struct qeth_qdio_out_buffer {
  435. struct qdio_buffer *buffer;
  436. atomic_t state;
  437. volatile int next_element_to_fill;
  438. struct sk_buff_head skb_list;
  439. struct list_head ctx_list;
  440. };
  441. struct qeth_card;
  442. enum qeth_out_q_states {
  443. QETH_OUT_Q_UNLOCKED,
  444. QETH_OUT_Q_LOCKED,
  445. QETH_OUT_Q_LOCKED_FLUSH,
  446. };
  447. struct qeth_qdio_out_q {
  448. struct qdio_buffer qdio_bufs[QDIO_MAX_BUFFERS_PER_Q];
  449. struct qeth_qdio_out_buffer bufs[QDIO_MAX_BUFFERS_PER_Q];
  450. int queue_no;
  451. struct qeth_card *card;
  452. atomic_t state;
  453. volatile int do_pack;
  454. /*
  455. * index of buffer to be filled by driver; state EMPTY or PACKING
  456. */
  457. volatile int next_buf_to_fill;
  458. /*
  459. * number of buffers that are currently filled (PRIMED)
  460. * -> these buffers are hardware-owned
  461. */
  462. atomic_t used_buffers;
  463. /* indicates whether PCI flag must be set (or if one is outstanding) */
  464. atomic_t set_pci_flags_count;
  465. } __attribute__ ((aligned(256)));
  466. struct qeth_qdio_info {
  467. volatile enum qeth_qdio_info_states state;
  468. /* input */
  469. struct qeth_qdio_q *in_q;
  470. struct qeth_qdio_buffer_pool in_buf_pool;
  471. struct qeth_qdio_buffer_pool init_pool;
  472. int in_buf_size;
  473. /* output */
  474. int no_out_queues;
  475. struct qeth_qdio_out_q **out_qs;
  476. /* priority queueing */
  477. int do_prio_queueing;
  478. int default_out_queue;
  479. };
  480. enum qeth_send_errors {
  481. QETH_SEND_ERROR_NONE,
  482. QETH_SEND_ERROR_LINK_FAILURE,
  483. QETH_SEND_ERROR_RETRY,
  484. QETH_SEND_ERROR_KICK_IT,
  485. };
  486. #define QETH_ETH_MAC_V4 0x0100 /* like v4 */
  487. #define QETH_ETH_MAC_V6 0x3333 /* like v6 */
  488. /* tr mc mac is longer, but that will be enough to detect mc frames */
  489. #define QETH_TR_MAC_NC 0xc000 /* non-canonical */
  490. #define QETH_TR_MAC_C 0x0300 /* canonical */
  491. #define DEFAULT_ADD_HHLEN 0
  492. #define MAX_ADD_HHLEN 1024
  493. /**
  494. * buffer stuff for read channel
  495. */
  496. #define QETH_CMD_BUFFER_NO 8
  497. /**
  498. * channel state machine
  499. */
  500. enum qeth_channel_states {
  501. CH_STATE_UP,
  502. CH_STATE_DOWN,
  503. CH_STATE_ACTIVATING,
  504. CH_STATE_HALTED,
  505. CH_STATE_STOPPED,
  506. };
  507. /**
  508. * card state machine
  509. */
  510. enum qeth_card_states {
  511. CARD_STATE_DOWN,
  512. CARD_STATE_HARDSETUP,
  513. CARD_STATE_SOFTSETUP,
  514. CARD_STATE_UP,
  515. CARD_STATE_RECOVER,
  516. };
  517. /**
  518. * Protocol versions
  519. */
  520. enum qeth_prot_versions {
  521. QETH_PROT_IPV4 = 0x0004,
  522. QETH_PROT_IPV6 = 0x0006,
  523. };
  524. enum qeth_ip_types {
  525. QETH_IP_TYPE_NORMAL,
  526. QETH_IP_TYPE_VIPA,
  527. QETH_IP_TYPE_RXIP,
  528. QETH_IP_TYPE_DEL_ALL_MC,
  529. };
  530. enum qeth_cmd_buffer_state {
  531. BUF_STATE_FREE,
  532. BUF_STATE_LOCKED,
  533. BUF_STATE_PROCESSED,
  534. };
  535. /**
  536. * IP address and multicast list
  537. */
  538. struct qeth_ipaddr {
  539. struct list_head entry;
  540. enum qeth_ip_types type;
  541. enum qeth_ipa_setdelip_flags set_flags;
  542. enum qeth_ipa_setdelip_flags del_flags;
  543. int is_multicast;
  544. volatile int users;
  545. enum qeth_prot_versions proto;
  546. unsigned char mac[OSA_ADDR_LEN];
  547. union {
  548. struct {
  549. unsigned int addr;
  550. unsigned int mask;
  551. } a4;
  552. struct {
  553. struct in6_addr addr;
  554. unsigned int pfxlen;
  555. } a6;
  556. } u;
  557. };
  558. struct qeth_ipato_entry {
  559. struct list_head entry;
  560. enum qeth_prot_versions proto;
  561. char addr[16];
  562. int mask_bits;
  563. };
  564. struct qeth_ipato {
  565. int enabled;
  566. int invert4;
  567. int invert6;
  568. struct list_head entries;
  569. };
  570. struct qeth_channel;
  571. struct qeth_cmd_buffer {
  572. enum qeth_cmd_buffer_state state;
  573. struct qeth_channel *channel;
  574. unsigned char *data;
  575. int rc;
  576. void (*callback) (struct qeth_channel *, struct qeth_cmd_buffer *);
  577. };
  578. /**
  579. * definition of a qeth channel, used for read and write
  580. */
  581. struct qeth_channel {
  582. enum qeth_channel_states state;
  583. struct ccw1 ccw;
  584. spinlock_t iob_lock;
  585. wait_queue_head_t wait_q;
  586. struct tasklet_struct irq_tasklet;
  587. struct ccw_device *ccwdev;
  588. /*command buffer for control data*/
  589. struct qeth_cmd_buffer iob[QETH_CMD_BUFFER_NO];
  590. atomic_t irq_pending;
  591. volatile int io_buf_no;
  592. volatile int buf_no;
  593. };
  594. /**
  595. * OSA card related definitions
  596. */
  597. struct qeth_token {
  598. __u32 issuer_rm_w;
  599. __u32 issuer_rm_r;
  600. __u32 cm_filter_w;
  601. __u32 cm_filter_r;
  602. __u32 cm_connection_w;
  603. __u32 cm_connection_r;
  604. __u32 ulp_filter_w;
  605. __u32 ulp_filter_r;
  606. __u32 ulp_connection_w;
  607. __u32 ulp_connection_r;
  608. };
  609. struct qeth_seqno {
  610. __u32 trans_hdr;
  611. __u32 pdu_hdr;
  612. __u32 pdu_hdr_ack;
  613. __u16 ipa;
  614. __u32 pkt_seqno;
  615. };
  616. struct qeth_reply {
  617. struct list_head list;
  618. wait_queue_head_t wait_q;
  619. int (*callback)(struct qeth_card *,struct qeth_reply *,unsigned long);
  620. u32 seqno;
  621. unsigned long offset;
  622. int received;
  623. int rc;
  624. void *param;
  625. struct qeth_card *card;
  626. atomic_t refcnt;
  627. };
  628. struct qeth_card_blkt {
  629. int time_total;
  630. int inter_packet;
  631. int inter_packet_jumbo;
  632. };
  633. #define QETH_BROADCAST_WITH_ECHO 0x01
  634. #define QETH_BROADCAST_WITHOUT_ECHO 0x02
  635. #define QETH_LAYER2_MAC_READ 0x01
  636. #define QETH_LAYER2_MAC_REGISTERED 0x02
  637. struct qeth_card_info {
  638. unsigned short unit_addr2;
  639. unsigned short cula;
  640. unsigned short chpid;
  641. __u16 func_level;
  642. char mcl_level[QETH_MCL_LENGTH + 1];
  643. int guestlan;
  644. int mac_bits;
  645. int portname_required;
  646. int portno;
  647. char portname[9];
  648. enum qeth_card_types type;
  649. enum qeth_link_types link_type;
  650. int is_multicast_different;
  651. int initial_mtu;
  652. int max_mtu;
  653. int broadcast_capable;
  654. int unique_id;
  655. struct qeth_card_blkt blkt;
  656. __u32 csum_mask;
  657. enum qeth_ipa_promisc_modes promisc_mode;
  658. };
  659. struct qeth_card_options {
  660. struct qeth_routing_info route4;
  661. struct qeth_ipa_info ipa4;
  662. struct qeth_ipa_info adp; /*Adapter parameters*/
  663. #ifdef CONFIG_QETH_IPV6
  664. struct qeth_routing_info route6;
  665. struct qeth_ipa_info ipa6;
  666. #endif /* QETH_IPV6 */
  667. enum qeth_checksum_types checksum_type;
  668. int broadcast_mode;
  669. int macaddr_mode;
  670. int fake_broadcast;
  671. int add_hhlen;
  672. int fake_ll;
  673. int layer2;
  674. enum qeth_large_send_types large_send;
  675. };
  676. /*
  677. * thread bits for qeth_card thread masks
  678. */
  679. enum qeth_threads {
  680. QETH_SET_IP_THREAD = 1,
  681. QETH_RECOVER_THREAD = 2,
  682. QETH_SET_PROMISC_MODE_THREAD = 4,
  683. };
  684. struct qeth_osn_info {
  685. int (*assist_cb)(struct net_device *dev, void *data);
  686. int (*data_cb)(struct sk_buff *skb);
  687. };
  688. struct qeth_card {
  689. struct list_head list;
  690. enum qeth_card_states state;
  691. int lan_online;
  692. spinlock_t lock;
  693. /*hardware and sysfs stuff*/
  694. struct ccwgroup_device *gdev;
  695. struct qeth_channel read;
  696. struct qeth_channel write;
  697. struct qeth_channel data;
  698. struct net_device *dev;
  699. struct net_device_stats stats;
  700. struct qeth_card_info info;
  701. struct qeth_token token;
  702. struct qeth_seqno seqno;
  703. struct qeth_card_options options;
  704. wait_queue_head_t wait_q;
  705. #ifdef CONFIG_QETH_VLAN
  706. spinlock_t vlanlock;
  707. struct vlan_group *vlangrp;
  708. #endif
  709. struct work_struct kernel_thread_starter;
  710. spinlock_t thread_mask_lock;
  711. volatile unsigned long thread_start_mask;
  712. volatile unsigned long thread_allowed_mask;
  713. volatile unsigned long thread_running_mask;
  714. spinlock_t ip_lock;
  715. struct list_head ip_list;
  716. struct list_head *ip_tbd_list;
  717. struct qeth_ipato ipato;
  718. struct list_head cmd_waiter_list;
  719. /* QDIO buffer handling */
  720. struct qeth_qdio_info qdio;
  721. #ifdef CONFIG_QETH_PERF_STATS
  722. struct qeth_perf_stats perf_stats;
  723. #endif /* CONFIG_QETH_PERF_STATS */
  724. int use_hard_stop;
  725. int (*orig_hard_header)(struct sk_buff *,struct net_device *,
  726. unsigned short,void *,void *,unsigned);
  727. struct qeth_osn_info osn_info;
  728. };
  729. struct qeth_card_list_struct {
  730. struct list_head list;
  731. rwlock_t rwlock;
  732. };
  733. extern struct qeth_card_list_struct qeth_card_list;
  734. /*notifier list */
  735. struct qeth_notify_list_struct {
  736. struct list_head list;
  737. struct task_struct *task;
  738. int signum;
  739. };
  740. extern spinlock_t qeth_notify_lock;
  741. extern struct list_head qeth_notify_list;
  742. /*some helper functions*/
  743. #define QETH_CARD_IFNAME(card) (((card)->dev)? (card)->dev->name : "")
  744. static inline __u8
  745. qeth_get_ipa_adp_type(enum qeth_link_types link_type)
  746. {
  747. switch (link_type) {
  748. case QETH_LINK_TYPE_HSTR:
  749. return 2;
  750. default:
  751. return 1;
  752. }
  753. }
  754. static inline int
  755. qeth_realloc_headroom(struct qeth_card *card, struct sk_buff **skb, int size)
  756. {
  757. struct sk_buff *new_skb = NULL;
  758. if (skb_headroom(*skb) < size){
  759. new_skb = skb_realloc_headroom(*skb, size);
  760. if (!new_skb) {
  761. PRINT_ERR("qeth_prepare_skb: could "
  762. "not realloc headroom for qeth_hdr "
  763. "on interface %s", QETH_CARD_IFNAME(card));
  764. return -ENOMEM;
  765. }
  766. kfree_skb(*skb);
  767. *skb = new_skb;
  768. }
  769. return 0;
  770. }
  771. static inline struct sk_buff *
  772. qeth_pskb_unshare(struct sk_buff *skb, int pri)
  773. {
  774. struct sk_buff *nskb;
  775. if (!skb_cloned(skb))
  776. return skb;
  777. nskb = skb_copy(skb, pri);
  778. kfree_skb(skb); /* free our shared copy */
  779. return nskb;
  780. }
  781. static inline void *
  782. qeth_push_skb(struct qeth_card *card, struct sk_buff **skb, int size)
  783. {
  784. void *hdr;
  785. hdr = (void *) skb_push(*skb, size);
  786. /*
  787. * sanity check, the Linux memory allocation scheme should
  788. * never present us cases like this one (the qdio header size plus
  789. * the first 40 bytes of the paket cross a 4k boundary)
  790. */
  791. if ((((unsigned long) hdr) & (~(PAGE_SIZE - 1))) !=
  792. (((unsigned long) hdr + size +
  793. QETH_IP_HEADER_SIZE) & (~(PAGE_SIZE - 1)))) {
  794. PRINT_ERR("qeth_prepare_skb: misaligned "
  795. "packet on interface %s. Discarded.",
  796. QETH_CARD_IFNAME(card));
  797. return NULL;
  798. }
  799. return hdr;
  800. }
  801. static inline int
  802. qeth_get_hlen(__u8 link_type)
  803. {
  804. #ifdef CONFIG_QETH_IPV6
  805. switch (link_type) {
  806. case QETH_LINK_TYPE_HSTR:
  807. case QETH_LINK_TYPE_LANE_TR:
  808. return sizeof(struct qeth_hdr_tso) + TR_HLEN;
  809. default:
  810. #ifdef CONFIG_QETH_VLAN
  811. return sizeof(struct qeth_hdr_tso) + VLAN_ETH_HLEN;
  812. #else
  813. return sizeof(struct qeth_hdr_tso) + ETH_HLEN;
  814. #endif
  815. }
  816. #else /* CONFIG_QETH_IPV6 */
  817. #ifdef CONFIG_QETH_VLAN
  818. return sizeof(struct qeth_hdr_tso) + VLAN_HLEN;
  819. #else
  820. return sizeof(struct qeth_hdr_tso);
  821. #endif
  822. #endif /* CONFIG_QETH_IPV6 */
  823. }
  824. static inline unsigned short
  825. qeth_get_netdev_flags(struct qeth_card *card)
  826. {
  827. if (card->options.layer2 &&
  828. (card->info.type == QETH_CARD_TYPE_OSAE))
  829. return 0;
  830. switch (card->info.type) {
  831. case QETH_CARD_TYPE_IQD:
  832. case QETH_CARD_TYPE_OSN:
  833. return IFF_NOARP;
  834. #ifdef CONFIG_QETH_IPV6
  835. default:
  836. return 0;
  837. #else
  838. default:
  839. return IFF_NOARP;
  840. #endif
  841. }
  842. }
  843. static inline int
  844. qeth_get_initial_mtu_for_card(struct qeth_card * card)
  845. {
  846. switch (card->info.type) {
  847. case QETH_CARD_TYPE_UNKNOWN:
  848. return 1500;
  849. case QETH_CARD_TYPE_IQD:
  850. return card->info.max_mtu;
  851. case QETH_CARD_TYPE_OSAE:
  852. switch (card->info.link_type) {
  853. case QETH_LINK_TYPE_HSTR:
  854. case QETH_LINK_TYPE_LANE_TR:
  855. return 2000;
  856. default:
  857. return 1492;
  858. }
  859. default:
  860. return 1500;
  861. }
  862. }
  863. static inline int
  864. qeth_get_max_mtu_for_card(int cardtype)
  865. {
  866. switch (cardtype) {
  867. case QETH_CARD_TYPE_UNKNOWN:
  868. case QETH_CARD_TYPE_OSAE:
  869. case QETH_CARD_TYPE_OSN:
  870. return 61440;
  871. case QETH_CARD_TYPE_IQD:
  872. return 57344;
  873. default:
  874. return 1500;
  875. }
  876. }
  877. static inline int
  878. qeth_get_mtu_out_of_mpc(int cardtype)
  879. {
  880. switch (cardtype) {
  881. case QETH_CARD_TYPE_IQD:
  882. return 1;
  883. default:
  884. return 0;
  885. }
  886. }
  887. static inline int
  888. qeth_get_mtu_outof_framesize(int framesize)
  889. {
  890. switch (framesize) {
  891. case 0x4000:
  892. return 8192;
  893. case 0x6000:
  894. return 16384;
  895. case 0xa000:
  896. return 32768;
  897. case 0xffff:
  898. return 57344;
  899. default:
  900. return 0;
  901. }
  902. }
  903. static inline int
  904. qeth_mtu_is_valid(struct qeth_card * card, int mtu)
  905. {
  906. switch (card->info.type) {
  907. case QETH_CARD_TYPE_OSAE:
  908. return ((mtu >= 576) && (mtu <= 61440));
  909. case QETH_CARD_TYPE_IQD:
  910. return ((mtu >= 576) &&
  911. (mtu <= card->info.max_mtu + 4096 - 32));
  912. case QETH_CARD_TYPE_OSN:
  913. case QETH_CARD_TYPE_UNKNOWN:
  914. default:
  915. return 1;
  916. }
  917. }
  918. static inline int
  919. qeth_get_arphdr_type(int cardtype, int linktype)
  920. {
  921. switch (cardtype) {
  922. case QETH_CARD_TYPE_OSAE:
  923. case QETH_CARD_TYPE_OSN:
  924. switch (linktype) {
  925. case QETH_LINK_TYPE_LANE_TR:
  926. case QETH_LINK_TYPE_HSTR:
  927. return ARPHRD_IEEE802_TR;
  928. default:
  929. return ARPHRD_ETHER;
  930. }
  931. case QETH_CARD_TYPE_IQD:
  932. default:
  933. return ARPHRD_ETHER;
  934. }
  935. }
  936. #ifdef CONFIG_QETH_PERF_STATS
  937. static inline int
  938. qeth_get_micros(void)
  939. {
  940. return (int) (get_clock() >> 12);
  941. }
  942. #endif
  943. static inline int
  944. qeth_get_qdio_q_format(struct qeth_card *card)
  945. {
  946. switch (card->info.type) {
  947. case QETH_CARD_TYPE_IQD:
  948. return 2;
  949. default:
  950. return 0;
  951. }
  952. }
  953. static inline int
  954. qeth_isxdigit(char * buf)
  955. {
  956. while (*buf) {
  957. if (!isxdigit(*buf++))
  958. return 0;
  959. }
  960. return 1;
  961. }
  962. static inline void
  963. qeth_ipaddr4_to_string(const __u8 *addr, char *buf)
  964. {
  965. sprintf(buf, "%i.%i.%i.%i", addr[0], addr[1], addr[2], addr[3]);
  966. }
  967. static inline int
  968. qeth_string_to_ipaddr4(const char *buf, __u8 *addr)
  969. {
  970. int count = 0, rc = 0;
  971. int in[4];
  972. rc = sscanf(buf, "%d.%d.%d.%d%n",
  973. &in[0], &in[1], &in[2], &in[3], &count);
  974. if (rc != 4 || count)
  975. return -EINVAL;
  976. for (count = 0; count < 4; count++) {
  977. if (in[count] > 255)
  978. return -EINVAL;
  979. addr[count] = in[count];
  980. }
  981. return 0;
  982. }
  983. static inline void
  984. qeth_ipaddr6_to_string(const __u8 *addr, char *buf)
  985. {
  986. sprintf(buf, "%02x%02x:%02x%02x:%02x%02x:%02x%02x"
  987. ":%02x%02x:%02x%02x:%02x%02x:%02x%02x",
  988. addr[0], addr[1], addr[2], addr[3],
  989. addr[4], addr[5], addr[6], addr[7],
  990. addr[8], addr[9], addr[10], addr[11],
  991. addr[12], addr[13], addr[14], addr[15]);
  992. }
  993. static inline int
  994. qeth_string_to_ipaddr6(const char *buf, __u8 *addr)
  995. {
  996. char *end, *start;
  997. __u16 *in;
  998. char num[5];
  999. int num2, cnt, out, found, save_cnt;
  1000. unsigned short in_tmp[8] = {0, };
  1001. cnt = out = found = save_cnt = num2 = 0;
  1002. end = start = (char *) buf;
  1003. in = (__u16 *) addr;
  1004. memset(in, 0, 16);
  1005. while (end) {
  1006. end = strchr(end,':');
  1007. if (end == NULL) {
  1008. end = (char *)buf + (strlen(buf));
  1009. out = 1;
  1010. }
  1011. if ((end - start)) {
  1012. memset(num, 0, 5);
  1013. memcpy(num, start, end - start);
  1014. if (!qeth_isxdigit(num))
  1015. return -EINVAL;
  1016. sscanf(start, "%x", &num2);
  1017. if (found)
  1018. in_tmp[save_cnt++] = num2;
  1019. else
  1020. in[cnt++] = num2;
  1021. if (out)
  1022. break;
  1023. } else {
  1024. if (found)
  1025. return -EINVAL;
  1026. found = 1;
  1027. }
  1028. start = ++end;
  1029. }
  1030. cnt = 7;
  1031. while (save_cnt)
  1032. in[cnt--] = in_tmp[--save_cnt];
  1033. return 0;
  1034. }
  1035. static inline void
  1036. qeth_ipaddr_to_string(enum qeth_prot_versions proto, const __u8 *addr,
  1037. char *buf)
  1038. {
  1039. if (proto == QETH_PROT_IPV4)
  1040. return qeth_ipaddr4_to_string(addr, buf);
  1041. else if (proto == QETH_PROT_IPV6)
  1042. return qeth_ipaddr6_to_string(addr, buf);
  1043. }
  1044. static inline int
  1045. qeth_string_to_ipaddr(const char *buf, enum qeth_prot_versions proto,
  1046. __u8 *addr)
  1047. {
  1048. if (proto == QETH_PROT_IPV4)
  1049. return qeth_string_to_ipaddr4(buf, addr);
  1050. else if (proto == QETH_PROT_IPV6)
  1051. return qeth_string_to_ipaddr6(buf, addr);
  1052. else
  1053. return -EINVAL;
  1054. }
  1055. extern int
  1056. qeth_setrouting_v4(struct qeth_card *);
  1057. extern int
  1058. qeth_setrouting_v6(struct qeth_card *);
  1059. extern int
  1060. qeth_add_ipato_entry(struct qeth_card *, struct qeth_ipato_entry *);
  1061. extern void
  1062. qeth_del_ipato_entry(struct qeth_card *, enum qeth_prot_versions, u8 *, int);
  1063. extern int
  1064. qeth_add_vipa(struct qeth_card *, enum qeth_prot_versions, const u8 *);
  1065. extern void
  1066. qeth_del_vipa(struct qeth_card *, enum qeth_prot_versions, const u8 *);
  1067. extern int
  1068. qeth_add_rxip(struct qeth_card *, enum qeth_prot_versions, const u8 *);
  1069. extern void
  1070. qeth_del_rxip(struct qeth_card *, enum qeth_prot_versions, const u8 *);
  1071. extern int
  1072. qeth_notifier_register(struct task_struct *, int );
  1073. extern int
  1074. qeth_notifier_unregister(struct task_struct * );
  1075. extern void
  1076. qeth_schedule_recovery(struct qeth_card *);
  1077. extern int
  1078. qeth_realloc_buffer_pool(struct qeth_card *, int);
  1079. extern int
  1080. qeth_set_large_send(struct qeth_card *, enum qeth_large_send_types);
  1081. extern void
  1082. qeth_fill_header(struct qeth_card *, struct qeth_hdr *,
  1083. struct sk_buff *, int, int);
  1084. extern void
  1085. qeth_flush_buffers(struct qeth_qdio_out_q *, int, int, int);
  1086. extern int
  1087. qeth_osn_assist(struct net_device *, void *, int);
  1088. extern int
  1089. qeth_osn_register(unsigned char *read_dev_no,
  1090. struct net_device **,
  1091. int (*assist_cb)(struct net_device *, void *),
  1092. int (*data_cb)(struct sk_buff *));
  1093. extern void
  1094. qeth_osn_deregister(struct net_device *);
  1095. #endif /* __QETH_H__ */