qeth.h 29 KB

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