2 * drivers/s390/net/qeth_core.h
4 * Copyright IBM Corp. 2007
5 * Author(s): Utz Bacher <utz.bacher@de.ibm.com>,
6 * Frank Pavlic <fpavlic@de.ibm.com>,
7 * Thomas Spatzier <tspat@de.ibm.com>,
8 * Frank Blaschka <frank.blaschka@de.ibm.com>
11 #ifndef __QETH_CORE_H__
12 #define __QETH_CORE_H__
15 #include <linux/if_arp.h>
16 #include <linux/if_tr.h>
17 #include <linux/trdevice.h>
18 #include <linux/etherdevice.h>
19 #include <linux/if_vlan.h>
20 #include <linux/ctype.h>
21 #include <linux/in6.h>
22 #include <linux/bitops.h>
23 #include <linux/seq_file.h>
24 #include <linux/ethtool.h>
27 #include <net/if_inet6.h>
28 #include <net/addrconf.h>
30 #include <asm/debug.h>
32 #include <asm/ccwdev.h>
33 #include <asm/ccwgroup.h>
35 #include "qeth_core_mpc.h"
38 * Debug Facility stuff
40 #define QETH_DBF_SETUP_NAME "qeth_setup"
41 #define QETH_DBF_SETUP_LEN 8
42 #define QETH_DBF_SETUP_PAGES 8
43 #define QETH_DBF_SETUP_NR_AREAS 1
44 #define QETH_DBF_SETUP_LEVEL 5
46 #define QETH_DBF_MISC_NAME "qeth_misc"
47 #define QETH_DBF_MISC_LEN 128
48 #define QETH_DBF_MISC_PAGES 2
49 #define QETH_DBF_MISC_NR_AREAS 1
50 #define QETH_DBF_MISC_LEVEL 2
52 #define QETH_DBF_DATA_NAME "qeth_data"
53 #define QETH_DBF_DATA_LEN 96
54 #define QETH_DBF_DATA_PAGES 8
55 #define QETH_DBF_DATA_NR_AREAS 1
56 #define QETH_DBF_DATA_LEVEL 2
58 #define QETH_DBF_CONTROL_NAME "qeth_control"
59 #define QETH_DBF_CONTROL_LEN 256
60 #define QETH_DBF_CONTROL_PAGES 8
61 #define QETH_DBF_CONTROL_NR_AREAS 1
62 #define QETH_DBF_CONTROL_LEVEL 5
64 #define QETH_DBF_TRACE_NAME "qeth_trace"
65 #define QETH_DBF_TRACE_LEN 8
66 #define QETH_DBF_TRACE_PAGES 4
67 #define QETH_DBF_TRACE_NR_AREAS 1
68 #define QETH_DBF_TRACE_LEVEL 3
70 #define QETH_DBF_SENSE_NAME "qeth_sense"
71 #define QETH_DBF_SENSE_LEN 64
72 #define QETH_DBF_SENSE_PAGES 2
73 #define QETH_DBF_SENSE_NR_AREAS 1
74 #define QETH_DBF_SENSE_LEVEL 2
76 #define QETH_DBF_QERR_NAME "qeth_qerr"
77 #define QETH_DBF_QERR_LEN 8
78 #define QETH_DBF_QERR_PAGES 2
79 #define QETH_DBF_QERR_NR_AREAS 1
80 #define QETH_DBF_QERR_LEVEL 2
82 #define QETH_DBF_TEXT(name, level, text) \
84 debug_text_event(qeth_dbf_##name, level, text); \
87 #define QETH_DBF_HEX(name, level, addr, len) \
89 debug_event(qeth_dbf_##name, level, (void *)(addr), len); \
92 /* Allow to sort out low debug levels early to avoid wasted sprints */
93 static inline int qeth_dbf_passes(debug_info_t *dbf_grp, int level)
95 return (level <= dbf_grp->level);
99 * some more debug stuff
101 #define PRINTK_HEADER "qeth: "
103 #define SENSE_COMMAND_REJECT_BYTE 0
104 #define SENSE_COMMAND_REJECT_FLAG 0x80
105 #define SENSE_RESETTING_EVENT_BYTE 1
106 #define SENSE_RESETTING_EVENT_FLAG 0x80
109 * Common IO related definitions
111 #define CARD_RDEV(card) card->read.ccwdev
112 #define CARD_WDEV(card) card->write.ccwdev
113 #define CARD_DDEV(card) card->data.ccwdev
114 #define CARD_BUS_ID(card) card->gdev->dev.bus_id
115 #define CARD_RDEV_ID(card) card->read.ccwdev->dev.bus_id
116 #define CARD_WDEV_ID(card) card->write.ccwdev->dev.bus_id
117 #define CARD_DDEV_ID(card) card->data.ccwdev->dev.bus_id
118 #define CHANNEL_ID(channel) channel->ccwdev->dev.bus_id
123 struct qeth_perf_stats {
124 unsigned int bufs_rec;
125 unsigned int bufs_sent;
127 unsigned int skbs_sent_pack;
128 unsigned int bufs_sent_pack;
130 unsigned int sc_dp_p;
131 unsigned int sc_p_dp;
132 /* qdio_input_handler: number of times called, time spent in */
133 __u64 inbound_start_time;
134 unsigned int inbound_cnt;
135 unsigned int inbound_time;
136 /* qeth_send_packet: number of times called, time spent in */
137 __u64 outbound_start_time;
138 unsigned int outbound_cnt;
139 unsigned int outbound_time;
140 /* qdio_output_handler: number of times called, time spent in */
141 __u64 outbound_handler_start_time;
142 unsigned int outbound_handler_cnt;
143 unsigned int outbound_handler_time;
144 /* number of calls to and time spent in do_QDIO for inbound queue */
145 __u64 inbound_do_qdio_start_time;
146 unsigned int inbound_do_qdio_cnt;
147 unsigned int inbound_do_qdio_time;
148 /* number of calls to and time spent in do_QDIO for outbound queues */
149 __u64 outbound_do_qdio_start_time;
150 unsigned int outbound_do_qdio_cnt;
151 unsigned int outbound_do_qdio_time;
153 unsigned int large_send_bytes;
154 unsigned int large_send_cnt;
155 unsigned int sg_skbs_sent;
156 unsigned int sg_frags_sent;
157 /* initial values when measuring starts */
158 unsigned long initial_rx_packets;
159 unsigned long initial_tx_packets;
160 /* inbound scatter gather data */
161 unsigned int sg_skbs_rx;
162 unsigned int sg_frags_rx;
163 unsigned int sg_alloc_page_rx;
167 struct qeth_routing_info {
168 enum qeth_routing_types type;
172 struct qeth_ipa_info {
173 __u32 supported_funcs;
177 static inline int qeth_is_ipa_supported(struct qeth_ipa_info *ipa,
178 enum qeth_ipa_funcs func)
180 return (ipa->supported_funcs & func);
183 static inline int qeth_is_ipa_enabled(struct qeth_ipa_info *ipa,
184 enum qeth_ipa_funcs func)
186 return (ipa->supported_funcs & ipa->enabled_funcs & func);
189 #define qeth_adp_supported(c, f) \
190 qeth_is_ipa_supported(&c->options.adp, f)
191 #define qeth_adp_enabled(c, f) \
192 qeth_is_ipa_enabled(&c->options.adp, f)
193 #define qeth_is_supported(c, f) \
194 qeth_is_ipa_supported(&c->options.ipa4, f)
195 #define qeth_is_enabled(c, f) \
196 qeth_is_ipa_enabled(&c->options.ipa4, f)
197 #define qeth_is_supported6(c, f) \
198 qeth_is_ipa_supported(&c->options.ipa6, f)
199 #define qeth_is_enabled6(c, f) \
200 qeth_is_ipa_enabled(&c->options.ipa6, f)
201 #define qeth_is_ipafunc_supported(c, prot, f) \
202 ((prot == QETH_PROT_IPV6) ? \
203 qeth_is_supported6(c, f) : qeth_is_supported(c, f))
204 #define qeth_is_ipafunc_enabled(c, prot, f) \
205 ((prot == QETH_PROT_IPV6) ? \
206 qeth_is_enabled6(c, f) : qeth_is_enabled(c, f))
208 #define QETH_IDX_FUNC_LEVEL_OSAE_ENA_IPAT 0x0101
209 #define QETH_IDX_FUNC_LEVEL_OSAE_DIS_IPAT 0x0101
210 #define QETH_IDX_FUNC_LEVEL_IQD_ENA_IPAT 0x4108
211 #define QETH_IDX_FUNC_LEVEL_IQD_DIS_IPAT 0x5108
213 #define QETH_MODELLIST_ARRAY \
214 {{0x1731, 0x01, 0x1732, 0x01, QETH_CARD_TYPE_OSAE, 1, \
215 QETH_IDX_FUNC_LEVEL_OSAE_ENA_IPAT, \
216 QETH_IDX_FUNC_LEVEL_OSAE_DIS_IPAT, \
217 QETH_MAX_QUEUES, 0}, \
218 {0x1731, 0x05, 0x1732, 0x05, QETH_CARD_TYPE_IQD, 0, \
219 QETH_IDX_FUNC_LEVEL_IQD_ENA_IPAT, \
220 QETH_IDX_FUNC_LEVEL_IQD_DIS_IPAT, \
221 QETH_MAX_QUEUES, 0x103}, \
222 {0x1731, 0x06, 0x1732, 0x06, QETH_CARD_TYPE_OSN, 0, \
223 QETH_IDX_FUNC_LEVEL_OSAE_ENA_IPAT, \
224 QETH_IDX_FUNC_LEVEL_OSAE_DIS_IPAT, \
225 QETH_MAX_QUEUES, 0}, \
226 {0, 0, 0, 0, 0, 0, 0, 0, 0} }
228 #define QETH_REAL_CARD 1
229 #define QETH_VLAN_CARD 2
230 #define QETH_BUFSIZE 4096
235 #define QETH_TX_TIMEOUT 100 * HZ
236 #define QETH_RCD_TIMEOUT 60 * HZ
237 #define QETH_HEADER_SIZE 32
238 #define QETH_MAX_PORTNO 15
240 /*IPv6 address autoconfiguration stuff*/
241 #define UNIQUE_ID_IF_CREATE_ADDR_FAILED 0xfffe
242 #define UNIQUE_ID_NOT_BY_CARD 0x10000
244 /*****************************************************************************/
245 /* QDIO queue and buffer handling */
246 /*****************************************************************************/
247 #define QETH_MAX_QUEUES 4
248 #define QETH_IN_BUF_SIZE_DEFAULT 65536
249 #define QETH_IN_BUF_COUNT_DEFAULT 16
250 #define QETH_IN_BUF_COUNT_MIN 8
251 #define QETH_IN_BUF_COUNT_MAX 128
252 #define QETH_MAX_BUFFER_ELEMENTS(card) ((card)->qdio.in_buf_size >> 12)
253 #define QETH_IN_BUF_REQUEUE_THRESHOLD(card) \
254 ((card)->qdio.in_buf_pool.buf_count / 2)
256 /* buffers we have to be behind before we get a PCI */
257 #define QETH_PCI_THRESHOLD_A(card) ((card)->qdio.in_buf_pool.buf_count+1)
258 /*enqueued free buffers left before we get a PCI*/
259 #define QETH_PCI_THRESHOLD_B(card) 0
260 /*not used unless the microcode gets patched*/
261 #define QETH_PCI_TIMER_VALUE(card) 3
263 #define QETH_MIN_INPUT_THRESHOLD 1
264 #define QETH_MAX_INPUT_THRESHOLD 500
265 #define QETH_MIN_OUTPUT_THRESHOLD 1
266 #define QETH_MAX_OUTPUT_THRESHOLD 300
268 /* priority queing */
269 #define QETH_PRIOQ_DEFAULT QETH_NO_PRIO_QUEUEING
270 #define QETH_DEFAULT_QUEUE 2
271 #define QETH_NO_PRIO_QUEUEING 0
272 #define QETH_PRIO_Q_ING_PREC 1
273 #define QETH_PRIO_Q_ING_TOS 2
274 #define IP_TOS_LOWDELAY 0x10
275 #define IP_TOS_HIGHTHROUGHPUT 0x08
276 #define IP_TOS_HIGHRELIABILITY 0x04
277 #define IP_TOS_NOTIMPORTANT 0x02
280 #define QETH_LOW_WATERMARK_PACK 2
281 #define QETH_HIGH_WATERMARK_PACK 5
282 #define QETH_WATERMARK_PACK_FUZZ 1
284 #define QETH_IP_HEADER_SIZE 40
286 /* large receive scatter gather copy break */
287 #define QETH_RX_SG_CB (PAGE_SIZE >> 1)
289 struct qeth_hdr_layer3 {
292 __u16 inbound_checksum; /*TSO:__u16 seqno */
293 __u32 token; /*TSO: __u32 reserved */
300 } __attribute__ ((packed));
302 struct qeth_hdr_layer2 {
312 } __attribute__ ((packed));
314 struct qeth_hdr_osn {
323 } __attribute__ ((packed));
327 struct qeth_hdr_layer2 l2;
328 struct qeth_hdr_layer3 l3;
329 struct qeth_hdr_osn osn;
331 } __attribute__ ((packed));
333 /*TCP Segmentation Offload header*/
334 struct qeth_hdr_ext_tso {
345 } __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));
353 /* flags for qeth_hdr.flags */
354 #define QETH_HDR_PASSTHRU 0x10
355 #define QETH_HDR_IPV6 0x80
356 #define QETH_HDR_CAST_MASK 0x07
357 enum qeth_cast_flags {
358 QETH_CAST_UNICAST = 0x06,
359 QETH_CAST_MULTICAST = 0x04,
360 QETH_CAST_BROADCAST = 0x05,
361 QETH_CAST_ANYCAST = 0x07,
362 QETH_CAST_NOCAST = 0x00,
365 enum qeth_layer2_frame_flags {
366 QETH_LAYER2_FLAG_MULTICAST = 0x01,
367 QETH_LAYER2_FLAG_BROADCAST = 0x02,
368 QETH_LAYER2_FLAG_UNICAST = 0x04,
369 QETH_LAYER2_FLAG_VLAN = 0x10,
372 enum qeth_header_ids {
373 QETH_HEADER_TYPE_LAYER3 = 0x01,
374 QETH_HEADER_TYPE_LAYER2 = 0x02,
375 QETH_HEADER_TYPE_TSO = 0x03,
376 QETH_HEADER_TYPE_OSN = 0x04,
378 /* flags for qeth_hdr.ext_flags */
379 #define QETH_HDR_EXT_VLAN_FRAME 0x01
380 #define QETH_HDR_EXT_TOKEN_ID 0x02
381 #define QETH_HDR_EXT_INCLUDE_VLAN_TAG 0x04
382 #define QETH_HDR_EXT_SRC_MAC_ADDR 0x08
383 #define QETH_HDR_EXT_CSUM_HDR_REQ 0x10
384 #define QETH_HDR_EXT_CSUM_TRANSP_REQ 0x20
385 #define QETH_HDR_EXT_UDP_TSO 0x40 /*bit off for TCP*/
387 static inline int qeth_is_last_sbale(struct qdio_buffer_element *sbale)
389 return (sbale->flags & SBAL_FLAGS_LAST_ENTRY);
392 enum qeth_qdio_buffer_states {
394 * inbound: read out by driver; owned by hardware in order to be filled
395 * outbound: owned by driver in order to be filled
399 * inbound: filled by hardware; owned by driver in order to be read out
400 * outbound: filled by driver; owned by hardware in order to be sent
402 QETH_QDIO_BUF_PRIMED,
405 enum qeth_qdio_info_states {
406 QETH_QDIO_UNINITIALIZED,
408 QETH_QDIO_ESTABLISHED,
412 struct qeth_buffer_pool_entry {
413 struct list_head list;
414 struct list_head init_list;
415 void *elements[QDIO_MAX_ELEMENTS_PER_BUFFER];
418 struct qeth_qdio_buffer_pool {
419 struct list_head entry_list;
423 struct qeth_qdio_buffer {
424 struct qdio_buffer *buffer;
425 /* the buffer pool entry currently associated to this buffer */
426 struct qeth_buffer_pool_entry *pool_entry;
430 struct qdio_buffer qdio_bufs[QDIO_MAX_BUFFERS_PER_Q];
431 struct qeth_qdio_buffer bufs[QDIO_MAX_BUFFERS_PER_Q];
432 int next_buf_to_init;
433 } __attribute__ ((aligned(256)));
435 /* possible types of qeth large_send support */
436 enum qeth_large_send_types {
438 QETH_LARGE_SEND_EDDP,
442 struct qeth_qdio_out_buffer {
443 struct qdio_buffer *buffer;
445 int next_element_to_fill;
446 struct sk_buff_head skb_list;
447 struct list_head ctx_list;
452 enum qeth_out_q_states {
455 QETH_OUT_Q_LOCKED_FLUSH,
458 struct qeth_qdio_out_q {
459 struct qdio_buffer qdio_bufs[QDIO_MAX_BUFFERS_PER_Q];
460 struct qeth_qdio_out_buffer bufs[QDIO_MAX_BUFFERS_PER_Q];
462 struct qeth_card *card;
466 * index of buffer to be filled by driver; state EMPTY or PACKING
468 int next_buf_to_fill;
470 * number of buffers that are currently filled (PRIMED)
471 * -> these buffers are hardware-owned
473 atomic_t used_buffers;
474 /* indicates whether PCI flag must be set (or if one is outstanding) */
475 atomic_t set_pci_flags_count;
476 } __attribute__ ((aligned(256)));
478 struct qeth_qdio_info {
481 struct qeth_qdio_q *in_q;
482 struct qeth_qdio_buffer_pool in_buf_pool;
483 struct qeth_qdio_buffer_pool init_pool;
488 struct qeth_qdio_out_q **out_qs;
490 /* priority queueing */
491 int do_prio_queueing;
492 int default_out_queue;
495 enum qeth_send_errors {
496 QETH_SEND_ERROR_NONE,
497 QETH_SEND_ERROR_LINK_FAILURE,
498 QETH_SEND_ERROR_RETRY,
499 QETH_SEND_ERROR_KICK_IT,
502 #define QETH_ETH_MAC_V4 0x0100 /* like v4 */
503 #define QETH_ETH_MAC_V6 0x3333 /* like v6 */
504 /* tr mc mac is longer, but that will be enough to detect mc frames */
505 #define QETH_TR_MAC_NC 0xc000 /* non-canonical */
506 #define QETH_TR_MAC_C 0x0300 /* canonical */
508 #define DEFAULT_ADD_HHLEN 0
509 #define MAX_ADD_HHLEN 1024
512 * buffer stuff for read channel
514 #define QETH_CMD_BUFFER_NO 8
517 * channel state machine
519 enum qeth_channel_states {
531 enum qeth_card_states {
533 CARD_STATE_HARDSETUP,
534 CARD_STATE_SOFTSETUP,
542 enum qeth_prot_versions {
543 QETH_PROT_IPV4 = 0x0004,
544 QETH_PROT_IPV6 = 0x0006,
551 QETH_IP_TYPE_DEL_ALL_MC,
554 enum qeth_cmd_buffer_state {
564 struct list_head entries;
569 struct qeth_cmd_buffer {
570 enum qeth_cmd_buffer_state state;
571 struct qeth_channel *channel;
574 void (*callback) (struct qeth_channel *, struct qeth_cmd_buffer *);
578 * definition of a qeth channel, used for read and write
580 struct qeth_channel {
581 enum qeth_channel_states state;
584 wait_queue_head_t wait_q;
585 struct tasklet_struct irq_tasklet;
586 struct ccw_device *ccwdev;
587 /*command buffer for control data*/
588 struct qeth_cmd_buffer iob[QETH_CMD_BUFFER_NO];
589 atomic_t irq_pending;
595 * OSA card related definitions
602 __u32 cm_connection_w;
603 __u32 cm_connection_r;
606 __u32 ulp_connection_w;
607 __u32 ulp_connection_r;
619 struct list_head list;
620 wait_queue_head_t wait_q;
621 int (*callback)(struct qeth_card *, struct qeth_reply *,
624 unsigned long offset;
628 struct qeth_card *card;
633 struct qeth_card_blkt {
636 int inter_packet_jumbo;
639 #define QETH_BROADCAST_WITH_ECHO 0x01
640 #define QETH_BROADCAST_WITHOUT_ECHO 0x02
641 #define QETH_LAYER2_MAC_READ 0x01
642 #define QETH_LAYER2_MAC_REGISTERED 0x02
643 struct qeth_card_info {
644 unsigned short unit_addr2;
646 unsigned short chpid;
648 char mcl_level[QETH_MCL_LENGTH + 1];
651 int portname_required;
654 enum qeth_card_types type;
655 enum qeth_link_types link_type;
656 int is_multicast_different;
659 int broadcast_capable;
661 struct qeth_card_blkt blkt;
663 enum qeth_ipa_promisc_modes promisc_mode;
666 struct qeth_card_options {
667 struct qeth_routing_info route4;
668 struct qeth_ipa_info ipa4;
669 struct qeth_ipa_info adp; /*Adapter parameters*/
670 struct qeth_routing_info route6;
671 struct qeth_ipa_info ipa6;
672 enum qeth_checksum_types checksum_type;
679 enum qeth_large_send_types large_send;
680 int performance_stats;
685 * thread bits for qeth_card thread masks
688 QETH_RECOVER_THREAD = 1,
691 struct qeth_osn_info {
692 int (*assist_cb)(struct net_device *dev, void *data);
693 int (*data_cb)(struct sk_buff *skb);
696 enum qeth_discipline_id {
697 QETH_DISCIPLINE_LAYER3 = 0,
698 QETH_DISCIPLINE_LAYER2 = 1,
701 struct qeth_discipline {
702 qdio_handler_t *input_handler;
703 qdio_handler_t *output_handler;
704 int (*recover)(void *ptr);
705 struct ccwgroup_driver *ccwgdriver;
708 struct qeth_vlan_vid {
709 struct list_head list;
714 struct list_head list;
715 __u8 mc_addr[MAX_ADDR_LEN];
716 unsigned char mc_addrlen;
720 struct list_head list;
721 enum qeth_card_states state;
724 struct ccwgroup_device *gdev;
725 struct qeth_channel read;
726 struct qeth_channel write;
727 struct qeth_channel data;
729 struct net_device *dev;
730 struct net_device_stats stats;
732 struct qeth_card_info info;
733 struct qeth_token token;
734 struct qeth_seqno seqno;
735 struct qeth_card_options options;
737 wait_queue_head_t wait_q;
740 struct vlan_group *vlangrp;
741 struct list_head vid_list;
742 struct list_head mc_list;
743 struct work_struct kernel_thread_starter;
744 spinlock_t thread_mask_lock;
745 unsigned long thread_start_mask;
746 unsigned long thread_allowed_mask;
747 unsigned long thread_running_mask;
749 struct list_head ip_list;
750 struct list_head *ip_tbd_list;
751 struct qeth_ipato ipato;
752 struct list_head cmd_waiter_list;
753 /* QDIO buffer handling */
754 struct qeth_qdio_info qdio;
755 struct qeth_perf_stats perf_stats;
757 struct qeth_osn_info osn_info;
758 struct qeth_discipline discipline;
759 atomic_t force_alloc_skb;
762 struct qeth_card_list_struct {
763 struct list_head list;
767 /*some helper functions*/
768 #define QETH_CARD_IFNAME(card) (((card)->dev)? (card)->dev->name : "")
770 static inline struct qeth_card *CARD_FROM_CDEV(struct ccw_device *cdev)
772 struct qeth_card *card = dev_get_drvdata(&((struct ccwgroup_device *)
773 dev_get_drvdata(&cdev->dev))->dev);
777 static inline int qeth_get_micros(void)
779 return (int) (get_clock() >> 12);
782 static inline void *qeth_push_skb(struct qeth_card *card, struct sk_buff *skb,
787 hdr = (void *) skb_push(skb, size);
789 * sanity check, the Linux memory allocation scheme should
790 * never present us cases like this one (the qdio header size plus
791 * the first 40 bytes of the paket cross a 4k boundary)
793 if ((((unsigned long) hdr) & (~(PAGE_SIZE - 1))) !=
794 (((unsigned long) hdr + size +
795 QETH_IP_HEADER_SIZE) & (~(PAGE_SIZE - 1)))) {
796 PRINT_ERR("Misaligned packet on interface %s. Discarded.",
797 QETH_CARD_IFNAME(card));
803 static inline int qeth_get_ip_version(struct sk_buff *skb)
805 switch (skb->protocol) {
815 struct qeth_eddp_context;
816 extern struct ccwgroup_driver qeth_l2_ccwgroup_driver;
817 extern struct ccwgroup_driver qeth_l3_ccwgroup_driver;
818 const char *qeth_get_cardname_short(struct qeth_card *);
819 int qeth_realloc_buffer_pool(struct qeth_card *, int);
820 int qeth_core_load_discipline(struct qeth_card *, enum qeth_discipline_id);
821 void qeth_core_free_discipline(struct qeth_card *);
822 int qeth_core_create_device_attributes(struct device *);
823 void qeth_core_remove_device_attributes(struct device *);
824 int qeth_core_create_osn_attributes(struct device *);
825 void qeth_core_remove_osn_attributes(struct device *);
827 /* exports for qeth discipline device drivers */
828 extern struct qeth_card_list_struct qeth_core_card_list;
829 extern debug_info_t *qeth_dbf_setup;
830 extern debug_info_t *qeth_dbf_data;
831 extern debug_info_t *qeth_dbf_misc;
832 extern debug_info_t *qeth_dbf_control;
833 extern debug_info_t *qeth_dbf_trace;
834 extern debug_info_t *qeth_dbf_sense;
835 extern debug_info_t *qeth_dbf_qerr;
837 void qeth_set_allowed_threads(struct qeth_card *, unsigned long , int);
838 int qeth_threads_running(struct qeth_card *, unsigned long);
839 int qeth_wait_for_threads(struct qeth_card *, unsigned long);
840 int qeth_do_run_thread(struct qeth_card *, unsigned long);
841 void qeth_clear_thread_start_bit(struct qeth_card *, unsigned long);
842 void qeth_clear_thread_running_bit(struct qeth_card *, unsigned long);
843 int qeth_core_hardsetup_card(struct qeth_card *);
844 void qeth_print_status_message(struct qeth_card *);
845 int qeth_init_qdio_queues(struct qeth_card *);
846 int qeth_send_startlan(struct qeth_card *);
847 int qeth_send_stoplan(struct qeth_card *);
848 int qeth_send_ipa_cmd(struct qeth_card *, struct qeth_cmd_buffer *,
850 (struct qeth_card *, struct qeth_reply *, unsigned long),
852 struct qeth_cmd_buffer *qeth_get_ipacmd_buffer(struct qeth_card *,
853 enum qeth_ipa_cmds, enum qeth_prot_versions);
854 int qeth_query_setadapterparms(struct qeth_card *);
855 int qeth_check_qdio_errors(struct qdio_buffer *, unsigned int,
856 unsigned int, const char *);
857 void qeth_put_buffer_pool_entry(struct qeth_card *,
858 struct qeth_buffer_pool_entry *);
859 void qeth_queue_input_buffer(struct qeth_card *, int);
860 struct sk_buff *qeth_core_get_next_skb(struct qeth_card *,
861 struct qdio_buffer *, struct qdio_buffer_element **, int *,
863 void qeth_schedule_recovery(struct qeth_card *);
864 void qeth_qdio_output_handler(struct ccw_device *, unsigned int,
865 unsigned int, unsigned int,
866 unsigned int, int, int,
868 void qeth_clear_ipacmd_list(struct qeth_card *);
869 int qeth_qdio_clear_card(struct qeth_card *, int);
870 void qeth_clear_working_pool_list(struct qeth_card *);
871 void qeth_clear_cmd_buffers(struct qeth_channel *);
872 void qeth_clear_qdio_buffers(struct qeth_card *);
873 void qeth_setadp_promisc_mode(struct qeth_card *);
874 struct net_device_stats *qeth_get_stats(struct net_device *);
875 int qeth_change_mtu(struct net_device *, int);
876 int qeth_setadpparms_change_macaddr(struct qeth_card *);
877 void qeth_tx_timeout(struct net_device *);
878 void qeth_prepare_control_data(struct qeth_card *, int,
879 struct qeth_cmd_buffer *);
880 void qeth_release_buffer(struct qeth_channel *, struct qeth_cmd_buffer *);
881 void qeth_prepare_ipa_cmd(struct qeth_card *, struct qeth_cmd_buffer *, char);
882 struct qeth_cmd_buffer *qeth_wait_for_buffer(struct qeth_channel *);
883 int qeth_mdio_read(struct net_device *, int, int);
884 int qeth_snmp_command(struct qeth_card *, char __user *);
885 int qeth_set_large_send(struct qeth_card *, enum qeth_large_send_types);
886 struct qeth_cmd_buffer *qeth_get_adapter_cmd(struct qeth_card *, __u32, __u32);
887 int qeth_default_setadapterparms_cb(struct qeth_card *, struct qeth_reply *,
889 int qeth_send_control_data(struct qeth_card *, int, struct qeth_cmd_buffer *,
890 int (*reply_cb)(struct qeth_card *, struct qeth_reply*, unsigned long),
892 int qeth_get_cast_type(struct qeth_card *, struct sk_buff *);
893 int qeth_get_priority_queue(struct qeth_card *, struct sk_buff *, int, int);
894 struct sk_buff *qeth_prepare_skb(struct qeth_card *, struct sk_buff *,
896 int qeth_get_elements_no(struct qeth_card *, void *, struct sk_buff *, int);
897 int qeth_do_send_packet_fast(struct qeth_card *, struct qeth_qdio_out_q *,
898 struct sk_buff *, struct qeth_hdr *, int,
899 struct qeth_eddp_context *);
900 int qeth_do_send_packet(struct qeth_card *, struct qeth_qdio_out_q *,
901 struct sk_buff *, struct qeth_hdr *,
902 int, struct qeth_eddp_context *);
903 int qeth_core_get_stats_count(struct net_device *);
904 void qeth_core_get_ethtool_stats(struct net_device *,
905 struct ethtool_stats *, u64 *);
906 void qeth_core_get_strings(struct net_device *, u32, u8 *);
907 void qeth_core_get_drvinfo(struct net_device *, struct ethtool_drvinfo *);
909 /* exports for OSN */
910 int qeth_osn_assist(struct net_device *, void *, int);
911 int qeth_osn_register(unsigned char *read_dev_no, struct net_device **,
912 int (*assist_cb)(struct net_device *, void *),
913 int (*data_cb)(struct sk_buff *));
914 void qeth_osn_deregister(struct net_device *);
916 #endif /* __QETH_CORE_H__ */