forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-02-20 ea08eeccae9297f7aabd2ef7f0c2517ac4549acc
kernel/drivers/s390/net/qeth_core.h
....@@ -10,6 +10,8 @@
1010 #ifndef __QETH_CORE_H__
1111 #define __QETH_CORE_H__
1212
13
+#include <linux/completion.h>
14
+#include <linux/debugfs.h>
1315 #include <linux/if.h>
1416 #include <linux/if_arp.h>
1517 #include <linux/etherdevice.h>
....@@ -18,21 +20,31 @@
1820 #include <linux/in6.h>
1921 #include <linux/bitops.h>
2022 #include <linux/seq_file.h>
21
-#include <linux/ethtool.h>
2223 #include <linux/hashtable.h>
2324 #include <linux/ip.h>
25
+#include <linux/rcupdate.h>
2426 #include <linux/refcount.h>
27
+#include <linux/timer.h>
28
+#include <linux/types.h>
29
+#include <linux/wait.h>
2530 #include <linux/workqueue.h>
2631
32
+#include <net/dst.h>
33
+#include <net/ip6_fib.h>
2734 #include <net/ipv6.h>
2835 #include <net/if_inet6.h>
2936 #include <net/addrconf.h>
37
+#include <net/route.h>
38
+#include <net/sch_generic.h>
39
+#include <net/tcp.h>
3040
3141 #include <asm/debug.h>
3242 #include <asm/qdio.h>
3343 #include <asm/ccwdev.h>
3444 #include <asm/ccwgroup.h>
3545 #include <asm/sysinfo.h>
46
+
47
+#include <uapi/linux/if_link.h>
3648
3749 #include "qeth_core_mpc.h"
3850
....@@ -56,7 +68,7 @@
5668 debug_info_t *id;
5769 };
5870
59
-#define QETH_DBF_CTRL_LEN 256
71
+#define QETH_DBF_CTRL_LEN 256U
6072
6173 #define QETH_DBF_TEXT(name, level, text) \
6274 debug_text_event(qeth_dbf[QETH_DBF_##name].id, level, text)
....@@ -87,6 +99,18 @@
8799 #define SENSE_RESETTING_EVENT_BYTE 1
88100 #define SENSE_RESETTING_EVENT_FLAG 0x80
89101
102
+static inline u32 qeth_get_device_id(struct ccw_device *cdev)
103
+{
104
+ struct ccw_dev_id dev_id;
105
+ u32 id;
106
+
107
+ ccw_device_get_id(cdev, &dev_id);
108
+ id = dev_id.devno;
109
+ id |= (u32) (dev_id.ssid << 16);
110
+
111
+ return id;
112
+}
113
+
90114 /*
91115 * Common IO related definitions
92116 */
....@@ -97,70 +121,12 @@
97121 #define CARD_RDEV_ID(card) dev_name(&card->read.ccwdev->dev)
98122 #define CARD_WDEV_ID(card) dev_name(&card->write.ccwdev->dev)
99123 #define CARD_DDEV_ID(card) dev_name(&card->data.ccwdev->dev)
100
-#define CHANNEL_ID(channel) dev_name(&channel->ccwdev->dev)
101
-
102
-/**
103
- * card stuff
104
- */
105
-struct qeth_perf_stats {
106
- unsigned int bufs_rec;
107
- unsigned int bufs_sent;
108
- unsigned int buf_elements_sent;
109
-
110
- unsigned int skbs_sent_pack;
111
- unsigned int bufs_sent_pack;
112
-
113
- unsigned int sc_dp_p;
114
- unsigned int sc_p_dp;
115
- /* qdio_cq_handler: number of times called, time spent in */
116
- __u64 cq_start_time;
117
- unsigned int cq_cnt;
118
- unsigned int cq_time;
119
- /* qdio_input_handler: number of times called, time spent in */
120
- __u64 inbound_start_time;
121
- unsigned int inbound_cnt;
122
- unsigned int inbound_time;
123
- /* qeth_send_packet: number of times called, time spent in */
124
- __u64 outbound_start_time;
125
- unsigned int outbound_cnt;
126
- unsigned int outbound_time;
127
- /* qdio_output_handler: number of times called, time spent in */
128
- __u64 outbound_handler_start_time;
129
- unsigned int outbound_handler_cnt;
130
- unsigned int outbound_handler_time;
131
- /* number of calls to and time spent in do_QDIO for inbound queue */
132
- __u64 inbound_do_qdio_start_time;
133
- unsigned int inbound_do_qdio_cnt;
134
- unsigned int inbound_do_qdio_time;
135
- /* number of calls to and time spent in do_QDIO for outbound queues */
136
- __u64 outbound_do_qdio_start_time;
137
- unsigned int outbound_do_qdio_cnt;
138
- unsigned int outbound_do_qdio_time;
139
- unsigned int large_send_bytes;
140
- unsigned int large_send_cnt;
141
- unsigned int sg_skbs_sent;
142
- /* initial values when measuring starts */
143
- unsigned long initial_rx_packets;
144
- unsigned long initial_tx_packets;
145
- /* inbound scatter gather data */
146
- unsigned int sg_skbs_rx;
147
- unsigned int sg_frags_rx;
148
- unsigned int sg_alloc_page_rx;
149
- unsigned int tx_csum;
150
- unsigned int tx_lin;
151
- unsigned int tx_linfail;
152
- unsigned int rx_csum;
153
-};
124
+#define CCW_DEVID(cdev) (qeth_get_device_id(cdev))
125
+#define CARD_DEVID(card) (CCW_DEVID(CARD_RDEV(card)))
154126
155127 /* Routing stuff */
156128 struct qeth_routing_info {
157129 enum qeth_routing_types type;
158
-};
159
-
160
-/* IPA stuff */
161
-struct qeth_ipa_info {
162
- __u32 supported_funcs;
163
- __u32 enabled_funcs;
164130 };
165131
166132 /* SETBRIDGEPORT stuff */
....@@ -201,41 +167,6 @@
201167 bool rx_bcast_enabled;
202168 };
203169
204
-static inline int qeth_is_adp_supported(struct qeth_ipa_info *ipa,
205
- enum qeth_ipa_setadp_cmd func)
206
-{
207
- return (ipa->supported_funcs & func);
208
-}
209
-
210
-static inline int qeth_is_ipa_supported(struct qeth_ipa_info *ipa,
211
- enum qeth_ipa_funcs func)
212
-{
213
- return (ipa->supported_funcs & func);
214
-}
215
-
216
-static inline int qeth_is_ipa_enabled(struct qeth_ipa_info *ipa,
217
- enum qeth_ipa_funcs func)
218
-{
219
- return (ipa->supported_funcs & ipa->enabled_funcs & func);
220
-}
221
-
222
-#define qeth_adp_supported(c, f) \
223
- qeth_is_adp_supported(&c->options.adp, f)
224
-#define qeth_is_supported(c, f) \
225
- qeth_is_ipa_supported(&c->options.ipa4, f)
226
-#define qeth_is_enabled(c, f) \
227
- qeth_is_ipa_enabled(&c->options.ipa4, f)
228
-#define qeth_is_supported6(c, f) \
229
- qeth_is_ipa_supported(&c->options.ipa6, f)
230
-#define qeth_is_enabled6(c, f) \
231
- qeth_is_ipa_enabled(&c->options.ipa6, f)
232
-#define qeth_is_ipafunc_supported(c, prot, f) \
233
- ((prot == QETH_PROT_IPV6) ? \
234
- qeth_is_supported6(c, f) : qeth_is_supported(c, f))
235
-#define qeth_is_ipafunc_enabled(c, prot, f) \
236
- ((prot == QETH_PROT_IPV6) ? \
237
- qeth_is_enabled6(c, f) : qeth_is_enabled(c, f))
238
-
239170 #define QETH_IDX_FUNC_LEVEL_OSD 0x0101
240171 #define QETH_IDX_FUNC_LEVEL_IQD 0x4108
241172
....@@ -246,24 +177,26 @@
246177 /**
247178 * some more defs
248179 */
249
-#define QETH_TX_TIMEOUT 100 * HZ
250
-#define QETH_RCD_TIMEOUT 60 * HZ
180
+#define QETH_TX_TIMEOUT (100 * HZ)
181
+#define QETH_RCD_TIMEOUT (60 * HZ)
251182 #define QETH_RECLAIM_WORK_TIME HZ
252183 #define QETH_MAX_PORTNO 15
253
-
254
-/*IPv6 address autoconfiguration stuff*/
255
-#define UNIQUE_ID_IF_CREATE_ADDR_FAILED 0xfffe
256
-#define UNIQUE_ID_NOT_BY_CARD 0x10000
257184
258185 /*****************************************************************************/
259186 /* QDIO queue and buffer handling */
260187 /*****************************************************************************/
261
-#define QETH_MAX_QUEUES 4
188
+#define QETH_MAX_OUT_QUEUES 4
189
+#define QETH_IQD_MIN_TXQ 2 /* One for ucast, one for mcast. */
190
+#define QETH_IQD_MCAST_TXQ 0
191
+#define QETH_IQD_MIN_UCAST_TXQ 1
192
+
193
+#define QETH_MAX_IN_QUEUES 2
194
+#define QETH_RX_COPYBREAK (PAGE_SIZE >> 1)
262195 #define QETH_IN_BUF_SIZE_DEFAULT 65536
263196 #define QETH_IN_BUF_COUNT_DEFAULT 64
264197 #define QETH_IN_BUF_COUNT_HSDEFAULT 128
265
-#define QETH_IN_BUF_COUNT_MIN 8
266
-#define QETH_IN_BUF_COUNT_MAX 128
198
+#define QETH_IN_BUF_COUNT_MIN 8U
199
+#define QETH_IN_BUF_COUNT_MAX 128U
267200 #define QETH_MAX_BUFFER_ELEMENTS(card) ((card)->qdio.in_buf_size >> 12)
268201 #define QETH_IN_BUF_REQUEUE_THRESHOLD(card) \
269202 ((card)->qdio.in_buf_pool.buf_count / 2)
....@@ -283,15 +216,12 @@
283216 #define QETH_PRIO_Q_ING_TOS 2
284217 #define QETH_PRIO_Q_ING_SKB 3
285218 #define QETH_PRIO_Q_ING_VLAN 4
219
+#define QETH_PRIO_Q_ING_FIXED 5
286220
287221 /* Packing */
288222 #define QETH_LOW_WATERMARK_PACK 2
289223 #define QETH_HIGH_WATERMARK_PACK 5
290224 #define QETH_WATERMARK_PACK_FUZZ 1
291
-
292
-/* large receive scatter gather copy break */
293
-#define QETH_RX_SG_CB (PAGE_SIZE >> 1)
294
-#define QETH_RX_PULL_LEN 256
295225
296226 struct qeth_hdr_layer3 {
297227 __u8 id;
....@@ -305,11 +235,7 @@
305235 __u16 frame_offset;
306236 union {
307237 /* TX: */
308
- u8 ipv6_addr[16];
309
- struct ipv4 {
310
- u8 res[12];
311
- u32 addr;
312
- } ipv4;
238
+ struct in6_addr addr;
313239 /* RX: */
314240 struct rx {
315241 u8 res1[2];
....@@ -351,6 +277,26 @@
351277 struct qeth_hdr_osn osn;
352278 } hdr;
353279 } __attribute__ ((packed));
280
+
281
+#define QETH_QIB_PQUE_ORDER_RR 0
282
+#define QETH_QIB_PQUE_UNITS_SBAL 2
283
+#define QETH_QIB_PQUE_PRIO_DEFAULT 4
284
+
285
+struct qeth_qib_parms {
286
+ char pcit_magic[4];
287
+ u32 pcit_a;
288
+ u32 pcit_b;
289
+ u32 pcit_c;
290
+ char blkt_magic[4];
291
+ u32 blkt_total;
292
+ u32 blkt_inter_packet;
293
+ u32 blkt_inter_packet_jumbo;
294
+ char pque_magic[4];
295
+ u8 pque_order;
296
+ u8 pque_units;
297
+ u16 reserved;
298
+ u32 pque_priority[4];
299
+};
354300
355301 /*TCP Segmentation Offload header*/
356302 struct qeth_hdr_ext_tso {
....@@ -394,8 +340,10 @@
394340 enum qeth_header_ids {
395341 QETH_HEADER_TYPE_LAYER3 = 0x01,
396342 QETH_HEADER_TYPE_LAYER2 = 0x02,
397
- QETH_HEADER_TYPE_TSO = 0x03,
343
+ QETH_HEADER_TYPE_L3_TSO = 0x03,
398344 QETH_HEADER_TYPE_OSN = 0x04,
345
+ QETH_HEADER_TYPE_L2_TSO = 0x06,
346
+ QETH_HEADER_MASK_INVAL = 0x80,
399347 };
400348 /* flags for qeth_hdr.ext_flags */
401349 #define QETH_HDR_EXT_VLAN_FRAME 0x01
....@@ -406,32 +354,31 @@
406354 #define QETH_HDR_EXT_CSUM_TRANSP_REQ 0x20
407355 #define QETH_HDR_EXT_UDP 0x40 /*bit off for TCP*/
408356
409
-enum qeth_qdio_buffer_states {
410
- /*
411
- * inbound: read out by driver; owned by hardware in order to be filled
412
- * outbound: owned by driver in order to be filled
413
- */
414
- QETH_QDIO_BUF_EMPTY,
415
- /*
416
- * inbound: filled by hardware; owned by driver in order to be read out
417
- * outbound: filled by driver; owned by hardware in order to be sent
418
- */
419
- QETH_QDIO_BUF_PRIMED,
420
- /*
421
- * inbound: not applicable
422
- * outbound: identified to be pending in TPQ
423
- */
424
- QETH_QDIO_BUF_PENDING,
425
- /*
426
- * inbound: not applicable
427
- * outbound: found in completion queue
428
- */
429
- QETH_QDIO_BUF_IN_CQ,
430
- /*
431
- * inbound: not applicable
432
- * outbound: handled via transfer pending / completion queue
433
- */
434
- QETH_QDIO_BUF_HANDLED_DELAYED,
357
+static inline bool qeth_l2_same_vlan(struct qeth_hdr_layer2 *h1,
358
+ struct qeth_hdr_layer2 *h2)
359
+{
360
+ return !((h1->flags[2] ^ h2->flags[2]) & QETH_LAYER2_FLAG_VLAN) &&
361
+ h1->vlan_id == h2->vlan_id;
362
+}
363
+
364
+static inline bool qeth_l3_iqd_same_vlan(struct qeth_hdr_layer3 *h1,
365
+ struct qeth_hdr_layer3 *h2)
366
+{
367
+ return !((h1->ext_flags ^ h2->ext_flags) & QETH_HDR_EXT_VLAN_FRAME) &&
368
+ h1->vlan_id == h2->vlan_id;
369
+}
370
+
371
+static inline bool qeth_l3_same_next_hop(struct qeth_hdr_layer3 *h1,
372
+ struct qeth_hdr_layer3 *h2)
373
+{
374
+ return !((h1->flags ^ h2->flags) & QETH_HDR_IPV6) &&
375
+ ipv6_addr_equal(&h1->next_hop.addr, &h2->next_hop.addr);
376
+}
377
+
378
+struct qeth_local_addr {
379
+ struct hlist_node hnode;
380
+ struct rcu_head rcu;
381
+ struct in6_addr addr;
435382 };
436383
437384 enum qeth_qdio_info_states {
....@@ -444,7 +391,7 @@
444391 struct qeth_buffer_pool_entry {
445392 struct list_head list;
446393 struct list_head init_list;
447
- void *elements[QDIO_MAX_ELEMENTS_PER_BUFFER];
394
+ struct page *elements[QDIO_MAX_ELEMENTS_PER_BUFFER];
448395 };
449396
450397 struct qeth_qdio_buffer_pool {
....@@ -465,37 +412,103 @@
465412 int next_buf_to_init;
466413 };
467414
415
+enum qeth_qdio_out_buffer_state {
416
+ /* Owned by driver, in order to be filled. */
417
+ QETH_QDIO_BUF_EMPTY,
418
+ /* Filled by driver; owned by hardware in order to be sent. */
419
+ QETH_QDIO_BUF_PRIMED,
420
+ /* Discovered by the TX completion code: */
421
+ QETH_QDIO_BUF_PENDING,
422
+ /* Finished by the TX completion code: */
423
+ QETH_QDIO_BUF_NEED_QAOB,
424
+ /* Received QAOB notification on CQ: */
425
+ QETH_QDIO_BUF_QAOB_OK,
426
+ QETH_QDIO_BUF_QAOB_ERROR,
427
+};
428
+
468429 struct qeth_qdio_out_buffer {
469430 struct qdio_buffer *buffer;
470431 atomic_t state;
471432 int next_element_to_fill;
433
+ unsigned int frames;
434
+ unsigned int bytes;
472435 struct sk_buff_head skb_list;
473436 int is_header[QDIO_MAX_ELEMENTS_PER_BUFFER];
474437
475438 struct qeth_qdio_out_q *q;
476
- struct qeth_qdio_out_buffer *next_pending;
439
+ struct list_head list_entry;
477440 };
478441
479442 struct qeth_card;
480443
481
-enum qeth_out_q_states {
482
- QETH_OUT_Q_UNLOCKED,
483
- QETH_OUT_Q_LOCKED,
484
- QETH_OUT_Q_LOCKED_FLUSH,
444
+#define QETH_CARD_STAT_ADD(_c, _stat, _val) ((_c)->stats._stat += (_val))
445
+#define QETH_CARD_STAT_INC(_c, _stat) QETH_CARD_STAT_ADD(_c, _stat, 1)
446
+
447
+#define QETH_TXQ_STAT_ADD(_q, _stat, _val) ((_q)->stats._stat += (_val))
448
+#define QETH_TXQ_STAT_INC(_q, _stat) QETH_TXQ_STAT_ADD(_q, _stat, 1)
449
+
450
+struct qeth_card_stats {
451
+ u64 rx_bufs;
452
+ u64 rx_skb_csum;
453
+ u64 rx_sg_skbs;
454
+ u64 rx_sg_frags;
455
+ u64 rx_sg_alloc_page;
456
+
457
+ u64 rx_dropped_nomem;
458
+ u64 rx_dropped_notsupp;
459
+ u64 rx_dropped_runt;
460
+
461
+ /* rtnl_link_stats64 */
462
+ u64 rx_packets;
463
+ u64 rx_bytes;
464
+ u64 rx_multicast;
465
+ u64 rx_length_errors;
466
+ u64 rx_frame_errors;
467
+ u64 rx_fifo_errors;
485468 };
469
+
470
+struct qeth_out_q_stats {
471
+ u64 bufs;
472
+ u64 bufs_pack;
473
+ u64 buf_elements;
474
+ u64 skbs_pack;
475
+ u64 skbs_sg;
476
+ u64 skbs_csum;
477
+ u64 skbs_tso;
478
+ u64 skbs_linearized;
479
+ u64 skbs_linearized_fail;
480
+ u64 tso_bytes;
481
+ u64 packing_mode_switch;
482
+ u64 stopped;
483
+ u64 doorbell;
484
+ u64 coal_frames;
485
+ u64 completion_yield;
486
+ u64 completion_timer;
487
+
488
+ /* rtnl_link_stats64 */
489
+ u64 tx_packets;
490
+ u64 tx_bytes;
491
+ u64 tx_errors;
492
+ u64 tx_dropped;
493
+};
494
+
495
+#define QETH_TX_MAX_COALESCED_FRAMES 1
496
+#define QETH_TX_COALESCE_USECS 25
497
+#define QETH_TX_TIMER_USECS 500
486498
487499 struct qeth_qdio_out_q {
488500 struct qdio_buffer *qdio_bufs[QDIO_MAX_BUFFERS_PER_Q];
489501 struct qeth_qdio_out_buffer *bufs[QDIO_MAX_BUFFERS_PER_Q];
490502 struct qdio_outbuf_state *bufstates; /* convenience pointer */
491
- int queue_no;
503
+ struct list_head pending_bufs;
504
+ struct qeth_out_q_stats stats;
505
+ spinlock_t lock;
506
+ unsigned int priority;
507
+ u8 next_buf_to_fill;
508
+ u8 max_elements;
509
+ u8 queue_no;
510
+ u8 do_pack;
492511 struct qeth_card *card;
493
- atomic_t state;
494
- int do_pack;
495
- /*
496
- * index of buffer to be filled by driver; state EMPTY or PACKING
497
- */
498
- int next_buf_to_fill;
499512 /*
500513 * number of buffers that are currently filled (PRIMED)
501514 * -> these buffers are hardware-owned
....@@ -503,7 +516,39 @@
503516 atomic_t used_buffers;
504517 /* indicates whether PCI flag must be set (or if one is outstanding) */
505518 atomic_t set_pci_flags_count;
519
+ struct napi_struct napi;
520
+ struct timer_list timer;
521
+ struct qeth_hdr *prev_hdr;
522
+ unsigned int coalesced_frames;
523
+ u8 bulk_start;
524
+ u8 bulk_count;
525
+ u8 bulk_max;
526
+
527
+ unsigned int coalesce_usecs;
528
+ unsigned int max_coalesced_frames;
506529 };
530
+
531
+#define qeth_for_each_output_queue(card, q, i) \
532
+ for (i = 0; i < card->qdio.no_out_queues && \
533
+ (q = card->qdio.out_qs[i]); i++)
534
+
535
+#define qeth_napi_to_out_queue(n) container_of(n, struct qeth_qdio_out_q, napi)
536
+
537
+static inline void qeth_tx_arm_timer(struct qeth_qdio_out_q *queue,
538
+ unsigned long usecs)
539
+{
540
+ timer_reduce(&queue->timer, usecs_to_jiffies(usecs) + jiffies);
541
+}
542
+
543
+static inline bool qeth_out_queue_is_full(struct qeth_qdio_out_q *queue)
544
+{
545
+ return atomic_read(&queue->used_buffers) >= QDIO_MAX_BUFFERS_PER_Q;
546
+}
547
+
548
+static inline bool qeth_out_queue_is_empty(struct qeth_qdio_out_q *queue)
549
+{
550
+ return atomic_read(&queue->used_buffers) == 0;
551
+}
507552
508553 struct qeth_qdio_info {
509554 atomic_t state;
....@@ -516,8 +561,8 @@
516561 int in_buf_size;
517562
518563 /* output */
519
- int no_out_queues;
520
- struct qeth_qdio_out_q **out_qs;
564
+ unsigned int no_out_queues;
565
+ struct qeth_qdio_out_q *out_qs[QETH_MAX_OUT_QUEUES];
521566 struct qdio_outbuf_state *out_bufstates;
522567
523568 /* priority queueing */
....@@ -526,44 +571,29 @@
526571 };
527572
528573 /**
529
- * buffer stuff for read channel
530
- */
531
-#define QETH_CMD_BUFFER_NO 8
532
-
533
-/**
534574 * channel state machine
535575 */
536576 enum qeth_channel_states {
537577 CH_STATE_UP,
538578 CH_STATE_DOWN,
539
- CH_STATE_ACTIVATING,
540579 CH_STATE_HALTED,
541580 CH_STATE_STOPPED,
542
- CH_STATE_RCD,
543
- CH_STATE_RCD_DONE,
544581 };
545582 /**
546583 * card state machine
547584 */
548585 enum qeth_card_states {
549586 CARD_STATE_DOWN,
550
- CARD_STATE_HARDSETUP,
551587 CARD_STATE_SOFTSETUP,
552
- CARD_STATE_UP,
553
- CARD_STATE_RECOVER,
554588 };
555589
556590 /**
557591 * Protocol versions
558592 */
559593 enum qeth_prot_versions {
594
+ QETH_PROT_NONE = 0x0000,
560595 QETH_PROT_IPV4 = 0x0004,
561596 QETH_PROT_IPV6 = 0x0006,
562
-};
563
-
564
-enum qeth_cmd_buffer_state {
565
- BUF_STATE_FREE,
566
- BUF_STATE_LOCKED,
567597 };
568598
569599 enum qeth_cq {
....@@ -579,35 +609,64 @@
579609 struct list_head entries;
580610 };
581611
582
-struct qeth_channel;
612
+struct qeth_channel {
613
+ struct ccw_device *ccwdev;
614
+ struct qeth_cmd_buffer *active_cmd;
615
+ enum qeth_channel_states state;
616
+ atomic_t irq_pending;
617
+};
618
+
619
+struct qeth_reply {
620
+ int (*callback)(struct qeth_card *card, struct qeth_reply *reply,
621
+ unsigned long data);
622
+ void *param;
623
+};
583624
584625 struct qeth_cmd_buffer {
585
- enum qeth_cmd_buffer_state state;
626
+ struct list_head list;
627
+ struct completion done;
628
+ spinlock_t lock;
629
+ unsigned int length;
630
+ refcount_t ref_count;
586631 struct qeth_channel *channel;
632
+ struct qeth_reply reply;
633
+ long timeout;
587634 unsigned char *data;
635
+ void (*finalize)(struct qeth_card *card, struct qeth_cmd_buffer *iob);
636
+ bool (*match)(struct qeth_cmd_buffer *iob,
637
+ struct qeth_cmd_buffer *reply);
638
+ void (*callback)(struct qeth_card *card, struct qeth_cmd_buffer *iob,
639
+ unsigned int data_length);
588640 int rc;
589
- void (*callback) (struct qeth_channel *, struct qeth_cmd_buffer *);
590641 };
642
+
643
+static inline void qeth_get_cmd(struct qeth_cmd_buffer *iob)
644
+{
645
+ refcount_inc(&iob->ref_count);
646
+}
647
+
648
+static inline struct qeth_ipa_cmd *__ipa_reply(struct qeth_cmd_buffer *iob)
649
+{
650
+ if (!IS_IPA(iob->data))
651
+ return NULL;
652
+
653
+ return (struct qeth_ipa_cmd *) PDU_ENCAPSULATION(iob->data);
654
+}
591655
592656 static inline struct qeth_ipa_cmd *__ipa_cmd(struct qeth_cmd_buffer *iob)
593657 {
594658 return (struct qeth_ipa_cmd *)(iob->data + IPA_PDU_HEADER_SIZE);
595659 }
596660
597
-/**
598
- * definition of a qeth channel, used for read and write
599
- */
600
-struct qeth_channel {
601
- enum qeth_channel_states state;
602
- struct ccw1 *ccw;
603
- spinlock_t iob_lock;
604
- wait_queue_head_t wait_q;
605
- struct ccw_device *ccwdev;
606
-/*command buffer for control data*/
607
- struct qeth_cmd_buffer iob[QETH_CMD_BUFFER_NO];
608
- atomic_t irq_pending;
609
- int io_buf_no;
610
-};
661
+static inline struct ccw1 *__ccw_from_cmd(struct qeth_cmd_buffer *iob)
662
+{
663
+ return (struct ccw1 *)(iob->data + ALIGN(iob->length, 8));
664
+}
665
+
666
+static inline bool qeth_trylock_channel(struct qeth_channel *channel)
667
+{
668
+ return atomic_cmpxchg(&channel->irq_pending, 0, 1) == 0;
669
+}
611670
612671 /**
613672 * OSA card related definitions
....@@ -630,21 +689,6 @@
630689 __u32 pdu_hdr;
631690 __u32 pdu_hdr_ack;
632691 __u16 ipa;
633
- __u32 pkt_seqno;
634
-};
635
-
636
-struct qeth_reply {
637
- struct list_head list;
638
- wait_queue_head_t wait_q;
639
- int (*callback)(struct qeth_card *, struct qeth_reply *,
640
- unsigned long);
641
- u32 seqno;
642
- unsigned long offset;
643
- atomic_t received;
644
- int rc;
645
- void *param;
646
- struct qeth_card *card;
647
- refcount_t refcnt;
648692 };
649693
650694 struct qeth_card_blkt {
....@@ -653,47 +697,67 @@
653697 int inter_packet_jumbo;
654698 };
655699
700
+enum qeth_pnso_mode {
701
+ QETH_PNSO_NONE,
702
+ QETH_PNSO_BRIDGEPORT,
703
+ QETH_PNSO_ADDR_INFO,
704
+};
705
+
656706 #define QETH_BROADCAST_WITH_ECHO 0x01
657707 #define QETH_BROADCAST_WITHOUT_ECHO 0x02
658
-#define QETH_LAYER2_MAC_READ 0x01
659
-#define QETH_LAYER2_MAC_REGISTERED 0x02
660708 struct qeth_card_info {
661709 unsigned short unit_addr2;
662710 unsigned short cula;
663
- unsigned short chpid;
664711 __u16 func_level;
665712 char mcl_level[QETH_MCL_LENGTH + 1];
666
- int guestlan;
667
- int mac_bits;
713
+ /* doubleword below corresponds to net_if_token */
714
+ u16 ddev_devno;
715
+ u8 cssid;
716
+ u8 iid;
717
+ u8 ssid;
718
+ u8 chpid;
719
+ u16 chid;
720
+ u8 ids_valid:1; /* cssid,iid,chid */
721
+ u8 dev_addr_is_registered:1;
722
+ u8 promisc_mode:1;
723
+ u8 use_v1_blkt:1;
724
+ u8 is_vm_nic:1;
725
+ /* no bitfield, we take a pointer on these two: */
726
+ u8 has_lp2lp_cso_v6;
727
+ u8 has_lp2lp_cso_v4;
728
+ enum qeth_pnso_mode pnso_mode;
668729 enum qeth_card_types type;
669730 enum qeth_link_types link_type;
670731 int broadcast_capable;
671
- int unique_id;
672732 bool layer_enforced;
673733 struct qeth_card_blkt blkt;
674
- enum qeth_ipa_promisc_modes promisc_mode;
675734 __u32 diagass_support;
676735 __u32 hwtrap;
677736 };
678737
738
+enum qeth_discipline_id {
739
+ QETH_DISCIPLINE_UNDETERMINED = -1,
740
+ QETH_DISCIPLINE_LAYER3 = 0,
741
+ QETH_DISCIPLINE_LAYER2 = 1,
742
+};
743
+
679744 struct qeth_card_options {
745
+ struct qeth_ipa_caps ipa4;
746
+ struct qeth_ipa_caps ipa6;
680747 struct qeth_routing_info route4;
681
- struct qeth_ipa_info ipa4;
682
- struct qeth_ipa_info adp; /*Adapter parameters*/
683748 struct qeth_routing_info route6;
684
- struct qeth_ipa_info ipa6;
749
+ struct qeth_ipa_caps adp; /* Adapter parameters */
685750 struct qeth_sbp_info sbp; /* SETBRIDGEPORT options */
686751 struct qeth_vnicc_info vnicc; /* VNICC options */
687
- int fake_broadcast;
688
- int layer2;
689
- int performance_stats;
690
- int rx_sg_cb;
752
+ enum qeth_discipline_id layer;
691753 enum qeth_ipa_isolation_modes isolation;
692
- enum qeth_ipa_isolation_modes prev_isolation;
693754 int sniffer;
694755 enum qeth_cq cq;
695756 char hsuid[9];
696757 };
758
+
759
+#define IS_LAYER2(card) ((card)->options.layer == QETH_DISCIPLINE_LAYER2)
760
+#define IS_LAYER3(card) ((card)->options.layer == QETH_DISCIPLINE_LAYER3)
697761
698762 /*
699763 * thread bits for qeth_card thread masks
....@@ -707,31 +771,15 @@
707771 int (*data_cb)(struct sk_buff *skb);
708772 };
709773
710
-enum qeth_discipline_id {
711
- QETH_DISCIPLINE_UNDETERMINED = -1,
712
- QETH_DISCIPLINE_LAYER3 = 0,
713
- QETH_DISCIPLINE_LAYER2 = 1,
714
-};
715
-
716774 struct qeth_discipline {
717775 const struct device_type *devtype;
718
- int (*process_rx_buffer)(struct qeth_card *card, int budget, int *done);
719
- int (*recover)(void *ptr);
720776 int (*setup) (struct ccwgroup_device *);
721777 void (*remove) (struct ccwgroup_device *);
722
- int (*set_online) (struct ccwgroup_device *);
723
- int (*set_offline) (struct ccwgroup_device *);
724
- int (*freeze)(struct ccwgroup_device *);
725
- int (*thaw) (struct ccwgroup_device *);
726
- int (*restore)(struct ccwgroup_device *);
778
+ int (*set_online)(struct qeth_card *card, bool carrier_ok);
779
+ void (*set_offline)(struct qeth_card *card);
727780 int (*do_ioctl)(struct net_device *dev, struct ifreq *rq, int cmd);
728781 int (*control_event_handler)(struct qeth_card *card,
729782 struct qeth_ipa_cmd *cmd);
730
-};
731
-
732
-struct qeth_vlan_vid {
733
- struct list_head list;
734
- unsigned short vid;
735783 };
736784
737785 enum qeth_addr_disposition {
....@@ -743,9 +791,10 @@
743791 struct qeth_rx {
744792 int b_count;
745793 int b_index;
746
- struct qdio_buffer_element *b_element;
794
+ u8 buf_element;
747795 int e_offset;
748796 int qdio_err;
797
+ u8 bufs_refill;
749798 };
750799
751800 struct carrier_info {
....@@ -759,66 +808,82 @@
759808 __u32 settings;
760809 };
761810
811
+struct qeth_priv {
812
+ unsigned int rx_copybreak;
813
+ unsigned int tx_wanted_queues;
814
+ u32 brport_hw_features;
815
+ u32 brport_features;
816
+};
817
+
762818 #define QETH_NAPI_WEIGHT NAPI_POLL_WEIGHT
763819
764820 struct qeth_card {
765
- struct list_head list;
766821 enum qeth_card_states state;
767
- int lan_online;
768822 spinlock_t lock;
769823 struct ccwgroup_device *gdev;
824
+ struct qeth_cmd_buffer *read_cmd;
770825 struct qeth_channel read;
771826 struct qeth_channel write;
772827 struct qeth_channel data;
773828
774829 struct net_device *dev;
775
- struct net_device_stats stats;
776
-
830
+ struct dentry *debugfs;
831
+ struct qeth_card_stats stats;
777832 struct qeth_card_info info;
778833 struct qeth_token token;
779834 struct qeth_seqno seqno;
780835 struct qeth_card_options options;
781836
837
+ struct workqueue_struct *event_wq;
838
+ struct workqueue_struct *cmd_wq;
782839 wait_queue_head_t wait_q;
783
- spinlock_t mclock;
784
- unsigned long active_vlans[BITS_TO_LONGS(VLAN_N_VID)];
785
- struct mutex vid_list_mutex; /* vid_list */
786
- struct list_head vid_list;
787
- DECLARE_HASHTABLE(mac_htable, 4);
840
+
841
+ struct mutex ip_lock;
842
+ /* protected by ip_lock: */
788843 DECLARE_HASHTABLE(ip_htable, 4);
789
- DECLARE_HASHTABLE(ip_mc_htable, 4);
844
+ struct qeth_ipato ipato;
845
+
846
+ DECLARE_HASHTABLE(local_addrs4, 4);
847
+ DECLARE_HASHTABLE(local_addrs6, 4);
848
+ spinlock_t local_addrs4_lock;
849
+ spinlock_t local_addrs6_lock;
850
+ DECLARE_HASHTABLE(rx_mode_addrs, 4);
851
+ struct work_struct rx_mode_work;
790852 struct work_struct kernel_thread_starter;
791853 spinlock_t thread_mask_lock;
792854 unsigned long thread_start_mask;
793855 unsigned long thread_allowed_mask;
794856 unsigned long thread_running_mask;
795
- struct task_struct *recovery_task;
796
- spinlock_t ip_lock;
797
- struct qeth_ipato ipato;
798857 struct list_head cmd_waiter_list;
799858 /* QDIO buffer handling */
800859 struct qeth_qdio_info qdio;
801
- struct qeth_perf_stats perf_stats;
802860 int read_or_write_problem;
803861 struct qeth_osn_info osn_info;
804
- struct qeth_discipline *discipline;
862
+ const struct qeth_discipline *discipline;
805863 atomic_t force_alloc_skb;
806864 struct service_level qeth_service_level;
807865 struct qdio_ssqd_desc ssqd;
808866 debug_info_t *debug;
867
+ struct mutex sbp_lock;
809868 struct mutex conf_mutex;
810869 struct mutex discipline_mutex;
811870 struct napi_struct napi;
812871 struct qeth_rx rx;
813872 struct delayed_work buffer_reclaim_work;
814
- int reclaim_index;
815873 struct work_struct close_dev_work;
816874 };
817875
818
-struct qeth_card_list_struct {
819
- struct list_head list;
820
- rwlock_t rwlock;
821
-};
876
+static inline bool qeth_card_hw_is_reachable(struct qeth_card *card)
877
+{
878
+ return card->state == CARD_STATE_SOFTSETUP;
879
+}
880
+
881
+static inline void qeth_unlock_channel(struct qeth_card *card,
882
+ struct qeth_channel *channel)
883
+{
884
+ atomic_set(&channel->irq_pending, 0);
885
+ wake_up(&card->wait_q);
886
+}
822887
823888 struct qeth_trap_id {
824889 __u16 lparnr;
....@@ -828,12 +893,35 @@
828893 __u16 devno;
829894 } __packed;
830895
831
-/*some helper functions*/
832
-#define QETH_CARD_IFNAME(card) (((card)->dev)? (card)->dev->name : "")
833
-
834
-static inline bool qeth_netdev_is_registered(struct net_device *dev)
896
+static inline bool qeth_uses_tx_prio_queueing(struct qeth_card *card)
835897 {
836
- return dev->netdev_ops != NULL;
898
+ return card->qdio.do_prio_queueing != QETH_NO_PRIO_QUEUEING;
899
+}
900
+
901
+static inline unsigned int qeth_tx_actual_queues(struct qeth_card *card)
902
+{
903
+ struct qeth_priv *priv = netdev_priv(card->dev);
904
+
905
+ if (qeth_uses_tx_prio_queueing(card))
906
+ return min(card->dev->num_tx_queues, card->qdio.no_out_queues);
907
+
908
+ return min(priv->tx_wanted_queues, card->qdio.no_out_queues);
909
+}
910
+
911
+static inline u16 qeth_iqd_translate_txq(struct net_device *dev, u16 txq)
912
+{
913
+ if (txq == QETH_IQD_MCAST_TXQ)
914
+ return dev->num_tx_queues - 1;
915
+ if (txq == dev->num_tx_queues - 1)
916
+ return QETH_IQD_MCAST_TXQ;
917
+ return txq;
918
+}
919
+
920
+static inline bool qeth_iqd_is_mcast_queue(struct qeth_card *card,
921
+ struct qeth_qdio_out_q *queue)
922
+{
923
+ return qeth_iqd_translate_txq(card->dev, queue->queue_no) ==
924
+ QETH_IQD_MCAST_TXQ;
837925 }
838926
839927 static inline void qeth_scrub_qdio_buffer(struct qdio_buffer *buf,
....@@ -860,11 +948,6 @@
860948 return PFN_UP(end) - PFN_DOWN(start);
861949 }
862950
863
-static inline int qeth_get_micros(void)
864
-{
865
- return (int) (get_tod_clock() >> 12);
866
-}
867
-
868951 static inline int qeth_get_ip_version(struct sk_buff *skb)
869952 {
870953 struct vlan_ethhdr *veth = vlan_eth_hdr(skb);
....@@ -883,17 +966,44 @@
883966 }
884967 }
885968
886
-static inline void qeth_rx_csum(struct qeth_card *card, struct sk_buff *skb,
887
- u8 flags)
969
+static inline int qeth_get_ether_cast_type(struct sk_buff *skb)
888970 {
889
- if ((card->dev->features & NETIF_F_RXCSUM) &&
890
- (flags & QETH_HDR_EXT_CSUM_TRANSP_REQ)) {
891
- skb->ip_summed = CHECKSUM_UNNECESSARY;
892
- if (card->options.performance_stats)
893
- card->perf_stats.rx_csum++;
894
- } else {
895
- skb->ip_summed = CHECKSUM_NONE;
896
- }
971
+ u8 *addr = eth_hdr(skb)->h_dest;
972
+
973
+ if (is_multicast_ether_addr(addr))
974
+ return is_broadcast_ether_addr(addr) ? RTN_BROADCAST :
975
+ RTN_MULTICAST;
976
+ return RTN_UNICAST;
977
+}
978
+
979
+static inline struct dst_entry *qeth_dst_check_rcu(struct sk_buff *skb, int ipv)
980
+{
981
+ struct dst_entry *dst = skb_dst(skb);
982
+ struct rt6_info *rt;
983
+
984
+ rt = (struct rt6_info *) dst;
985
+ if (dst)
986
+ dst = dst_check(dst, (ipv == 6) ? rt6_get_cookie(rt) : 0);
987
+ return dst;
988
+}
989
+
990
+static inline __be32 qeth_next_hop_v4_rcu(struct sk_buff *skb,
991
+ struct dst_entry *dst)
992
+{
993
+ struct rtable *rt = (struct rtable *) dst;
994
+
995
+ return (rt) ? rt_nexthop(rt, ip_hdr(skb)->daddr) : ip_hdr(skb)->daddr;
996
+}
997
+
998
+static inline struct in6_addr *qeth_next_hop_v6_rcu(struct sk_buff *skb,
999
+ struct dst_entry *dst)
1000
+{
1001
+ struct rt6_info *rt = (struct rt6_info *) dst;
1002
+
1003
+ if (rt && !ipv6_addr_any(&rt->rt6i_gateway))
1004
+ return &rt->rt6i_gateway;
1005
+ else
1006
+ return &ipv6_hdr(skb)->daddr;
8971007 }
8981008
8991009 static inline void qeth_tx_csum(struct sk_buff *skb, u8 *flags, int ipv)
....@@ -902,11 +1012,6 @@
9021012 if ((ipv == 4 && ip_hdr(skb)->protocol == IPPROTO_UDP) ||
9031013 (ipv == 6 && ipv6_hdr(skb)->nexthdr == IPPROTO_UDP))
9041014 *flags |= QETH_HDR_EXT_UDP;
905
- if (ipv == 4) {
906
- /* some HW requires combined L3+L4 csum offload: */
907
- *flags |= QETH_HDR_EXT_CSUM_HDR_REQ;
908
- ip_hdr(skb)->check = 0;
909
- }
9101015 }
9111016
9121017 static inline void qeth_put_buffer_pool_entry(struct qeth_card *card,
....@@ -923,12 +1028,12 @@
9231028
9241029 int qeth_send_simple_setassparms_prot(struct qeth_card *card,
9251030 enum qeth_ipa_funcs ipa_func,
926
- u16 cmd_code, long data,
1031
+ u16 cmd_code, u32 *data,
9271032 enum qeth_prot_versions prot);
9281033 /* IPv4 variant */
9291034 static inline int qeth_send_simple_setassparms(struct qeth_card *card,
9301035 enum qeth_ipa_funcs ipa_func,
931
- u16 cmd_code, long data)
1036
+ u16 cmd_code, u32 *data)
9321037 {
9331038 return qeth_send_simple_setassparms_prot(card, ipa_func, cmd_code,
9341039 data, QETH_PROT_IPV4);
....@@ -936,132 +1041,108 @@
9361041
9371042 static inline int qeth_send_simple_setassparms_v6(struct qeth_card *card,
9381043 enum qeth_ipa_funcs ipa_func,
939
- u16 cmd_code, long data)
1044
+ u16 cmd_code, u32 *data)
9401045 {
9411046 return qeth_send_simple_setassparms_prot(card, ipa_func, cmd_code,
9421047 data, QETH_PROT_IPV6);
9431048 }
9441049
945
-int qeth_get_priority_queue(struct qeth_card *card, struct sk_buff *skb,
946
- int ipv);
947
-static inline struct qeth_qdio_out_q *qeth_get_tx_queue(struct qeth_card *card,
948
- struct sk_buff *skb,
949
- int ipv, int cast_type)
950
-{
951
- if (IS_IQD(card) && cast_type != RTN_UNICAST)
952
- return card->qdio.out_qs[card->qdio.no_out_queues - 1];
953
- if (!card->qdio.do_prio_queueing)
954
- return card->qdio.out_qs[card->qdio.default_out_queue];
955
- return card->qdio.out_qs[qeth_get_priority_queue(card, skb, ipv)];
956
-}
1050
+int qeth_get_priority_queue(struct qeth_card *card, struct sk_buff *skb);
9571051
958
-extern struct qeth_discipline qeth_l2_discipline;
959
-extern struct qeth_discipline qeth_l3_discipline;
1052
+extern const struct qeth_discipline qeth_l2_discipline;
1053
+extern const struct qeth_discipline qeth_l3_discipline;
1054
+extern const struct ethtool_ops qeth_ethtool_ops;
1055
+extern const struct ethtool_ops qeth_osn_ethtool_ops;
9601056 extern const struct attribute_group *qeth_generic_attr_groups[];
9611057 extern const struct attribute_group *qeth_osn_attr_groups[];
9621058 extern const struct attribute_group qeth_device_attr_group;
9631059 extern const struct attribute_group qeth_device_blkt_group;
9641060 extern const struct device_type qeth_generic_devtype;
965
-extern struct workqueue_struct *qeth_wq;
9661061
967
-int qeth_card_hw_is_reachable(struct qeth_card *);
9681062 const char *qeth_get_cardname_short(struct qeth_card *);
969
-int qeth_realloc_buffer_pool(struct qeth_card *, int);
1063
+int qeth_resize_buffer_pool(struct qeth_card *card, unsigned int count);
9701064 int qeth_core_load_discipline(struct qeth_card *, enum qeth_discipline_id);
9711065 void qeth_core_free_discipline(struct qeth_card *);
9721066
9731067 /* exports for qeth discipline device drivers */
974
-extern struct qeth_card_list_struct qeth_core_card_list;
9751068 extern struct kmem_cache *qeth_core_header_cache;
9761069 extern struct qeth_dbf_info qeth_dbf[QETH_DBF_INFOS];
9771070
9781071 struct net_device *qeth_clone_netdev(struct net_device *orig);
979
-void qeth_set_recovery_task(struct qeth_card *);
980
-void qeth_clear_recovery_task(struct qeth_card *);
981
-void qeth_set_allowed_threads(struct qeth_card *, unsigned long , int);
1072
+struct qeth_card *qeth_get_card_by_busid(char *bus_id);
1073
+void qeth_set_allowed_threads(struct qeth_card *card, unsigned long threads,
1074
+ int clear_start_mask);
9821075 int qeth_threads_running(struct qeth_card *, unsigned long);
983
-int qeth_wait_for_threads(struct qeth_card *, unsigned long);
984
-int qeth_do_run_thread(struct qeth_card *, unsigned long);
985
-void qeth_clear_thread_start_bit(struct qeth_card *, unsigned long);
986
-void qeth_clear_thread_running_bit(struct qeth_card *, unsigned long);
987
-int qeth_core_hardsetup_card(struct qeth_card *);
988
-void qeth_print_status_message(struct qeth_card *);
989
-int qeth_init_qdio_queues(struct qeth_card *);
1076
+int qeth_set_offline(struct qeth_card *card, const struct qeth_discipline *disc,
1077
+ bool resetting);
1078
+
9901079 int qeth_send_ipa_cmd(struct qeth_card *, struct qeth_cmd_buffer *,
9911080 int (*reply_cb)
9921081 (struct qeth_card *, struct qeth_reply *, unsigned long),
9931082 void *);
994
-struct qeth_cmd_buffer *qeth_get_ipacmd_buffer(struct qeth_card *,
995
- enum qeth_ipa_cmds, enum qeth_prot_versions);
996
-struct sk_buff *qeth_core_get_next_skb(struct qeth_card *,
997
- struct qeth_qdio_buffer *, struct qdio_buffer_element **, int *,
998
- struct qeth_hdr **);
999
-void qeth_schedule_recovery(struct qeth_card *);
1083
+struct qeth_cmd_buffer *qeth_ipa_alloc_cmd(struct qeth_card *card,
1084
+ enum qeth_ipa_cmds cmd_code,
1085
+ enum qeth_prot_versions prot,
1086
+ unsigned int data_length);
1087
+struct qeth_cmd_buffer *qeth_alloc_cmd(struct qeth_channel *channel,
1088
+ unsigned int length, unsigned int ccws,
1089
+ long timeout);
1090
+struct qeth_cmd_buffer *qeth_get_setassparms_cmd(struct qeth_card *card,
1091
+ enum qeth_ipa_funcs ipa_func,
1092
+ u16 cmd_code,
1093
+ unsigned int data_length,
1094
+ enum qeth_prot_versions prot);
1095
+struct qeth_cmd_buffer *qeth_get_diag_cmd(struct qeth_card *card,
1096
+ enum qeth_diags_cmds sub_cmd,
1097
+ unsigned int data_length);
1098
+void qeth_notify_cmd(struct qeth_cmd_buffer *iob, int reason);
1099
+void qeth_put_cmd(struct qeth_cmd_buffer *iob);
1100
+
1101
+int qeth_schedule_recovery(struct qeth_card *card);
10001102 int qeth_poll(struct napi_struct *napi, int budget);
1001
-void qeth_clear_ipacmd_list(struct qeth_card *);
1002
-int qeth_qdio_clear_card(struct qeth_card *, int);
1003
-void qeth_clear_working_pool_list(struct qeth_card *);
1004
-void qeth_clear_cmd_buffers(struct qeth_channel *);
1005
-void qeth_clear_qdio_buffers(struct qeth_card *);
1006
-void qeth_setadp_promisc_mode(struct qeth_card *);
1007
-struct net_device_stats *qeth_get_stats(struct net_device *);
1103
+void qeth_setadp_promisc_mode(struct qeth_card *card, bool enable);
10081104 int qeth_setadpparms_change_macaddr(struct qeth_card *);
1009
-void qeth_tx_timeout(struct net_device *);
1010
-void qeth_prepare_control_data(struct qeth_card *, int,
1011
- struct qeth_cmd_buffer *);
1012
-void qeth_release_buffer(struct qeth_channel *, struct qeth_cmd_buffer *);
1013
-void qeth_prepare_ipa_cmd(struct qeth_card *card, struct qeth_cmd_buffer *iob);
1014
-struct qeth_cmd_buffer *qeth_wait_for_buffer(struct qeth_channel *);
1105
+void qeth_tx_timeout(struct net_device *, unsigned int txqueue);
1106
+void qeth_prepare_ipa_cmd(struct qeth_card *card, struct qeth_cmd_buffer *iob,
1107
+ u16 cmd_length,
1108
+ bool (*match)(struct qeth_cmd_buffer *iob,
1109
+ struct qeth_cmd_buffer *reply));
10151110 int qeth_query_switch_attributes(struct qeth_card *card,
10161111 struct qeth_switch_info *sw_info);
1017
-int qeth_send_control_data(struct qeth_card *, int, struct qeth_cmd_buffer *,
1018
- int (*reply_cb)(struct qeth_card *, struct qeth_reply*, unsigned long),
1019
- void *reply_param);
1020
-int qeth_get_elements_no(struct qeth_card *card, struct sk_buff *skb,
1021
- int extra_elems, int data_offset);
1022
-int qeth_get_elements_for_frags(struct sk_buff *);
1023
-int qeth_do_send_packet_fast(struct qeth_qdio_out_q *queue, struct sk_buff *skb,
1024
- struct qeth_hdr *hdr, unsigned int offset,
1025
- unsigned int hd_len);
1112
+int qeth_query_card_info(struct qeth_card *card,
1113
+ struct carrier_info *carrier_info);
1114
+int qeth_setadpparms_set_access_ctrl(struct qeth_card *card,
1115
+ enum qeth_ipa_isolation_modes mode);
1116
+
1117
+unsigned int qeth_count_elements(struct sk_buff *skb, unsigned int data_offset);
10261118 int qeth_do_send_packet(struct qeth_card *card, struct qeth_qdio_out_q *queue,
10271119 struct sk_buff *skb, struct qeth_hdr *hdr,
10281120 unsigned int offset, unsigned int hd_len,
10291121 int elements_needed);
10301122 int qeth_do_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
1031
-int qeth_core_get_sset_count(struct net_device *, int);
1032
-void qeth_core_get_ethtool_stats(struct net_device *,
1033
- struct ethtool_stats *, u64 *);
1034
-void qeth_core_get_strings(struct net_device *, u32, u8 *);
1035
-void qeth_core_get_drvinfo(struct net_device *, struct ethtool_drvinfo *);
10361123 void qeth_dbf_longtext(debug_info_t *id, int level, char *text, ...);
1037
-int qeth_core_ethtool_get_link_ksettings(struct net_device *netdev,
1038
- struct ethtool_link_ksettings *cmd);
1039
-int qeth_set_access_ctrl_online(struct qeth_card *card, int fallback);
1040
-int qeth_hdr_chk_and_bounce(struct sk_buff *, struct qeth_hdr **, int);
10411124 int qeth_configure_cq(struct qeth_card *, enum qeth_cq);
10421125 int qeth_hw_trap(struct qeth_card *, enum qeth_diags_trap_action);
1043
-void qeth_trace_features(struct qeth_card *);
1044
-void qeth_close_dev(struct qeth_card *);
1045
-int qeth_send_setassparms(struct qeth_card *, struct qeth_cmd_buffer *, __u16,
1046
- long,
1047
- int (*reply_cb)(struct qeth_card *,
1048
- struct qeth_reply *, unsigned long),
1049
- void *);
10501126 int qeth_setassparms_cb(struct qeth_card *, struct qeth_reply *, unsigned long);
1051
-struct qeth_cmd_buffer *qeth_get_setassparms_cmd(struct qeth_card *,
1052
- enum qeth_ipa_funcs,
1053
- __u16, __u16,
1054
- enum qeth_prot_versions);
10551127 int qeth_set_features(struct net_device *, netdev_features_t);
10561128 void qeth_enable_hw_features(struct net_device *dev);
10571129 netdev_features_t qeth_fix_features(struct net_device *, netdev_features_t);
10581130 netdev_features_t qeth_features_check(struct sk_buff *skb,
10591131 struct net_device *dev,
10601132 netdev_features_t features);
1133
+void qeth_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats);
1134
+int qeth_set_real_num_tx_queues(struct qeth_card *card, unsigned int count);
1135
+u16 qeth_iqd_select_queue(struct net_device *dev, struct sk_buff *skb,
1136
+ u8 cast_type, struct net_device *sb_dev);
1137
+int qeth_open(struct net_device *dev);
1138
+int qeth_stop(struct net_device *dev);
1139
+
10611140 int qeth_vm_request_mac(struct qeth_card *card);
1062
-int qeth_add_hw_header(struct qeth_card *card, struct sk_buff *skb,
1063
- struct qeth_hdr **hdr, unsigned int hdr_len,
1064
- unsigned int proto_len, unsigned int *elements);
1141
+int qeth_xmit(struct qeth_card *card, struct sk_buff *skb,
1142
+ struct qeth_qdio_out_q *queue, int ipv,
1143
+ void (*fill_header)(struct qeth_qdio_out_q *queue,
1144
+ struct qeth_hdr *hdr, struct sk_buff *skb,
1145
+ int ipv, unsigned int data_len));
10651146
10661147 /* exports for OSN */
10671148 int qeth_osn_assist(struct net_device *, void *, int);