| .. | .. |
|---|
| 10 | 10 | #ifndef __QETH_CORE_H__ |
|---|
| 11 | 11 | #define __QETH_CORE_H__ |
|---|
| 12 | 12 | |
|---|
| 13 | +#include <linux/completion.h> |
|---|
| 14 | +#include <linux/debugfs.h> |
|---|
| 13 | 15 | #include <linux/if.h> |
|---|
| 14 | 16 | #include <linux/if_arp.h> |
|---|
| 15 | 17 | #include <linux/etherdevice.h> |
|---|
| .. | .. |
|---|
| 18 | 20 | #include <linux/in6.h> |
|---|
| 19 | 21 | #include <linux/bitops.h> |
|---|
| 20 | 22 | #include <linux/seq_file.h> |
|---|
| 21 | | -#include <linux/ethtool.h> |
|---|
| 22 | 23 | #include <linux/hashtable.h> |
|---|
| 23 | 24 | #include <linux/ip.h> |
|---|
| 25 | +#include <linux/rcupdate.h> |
|---|
| 24 | 26 | #include <linux/refcount.h> |
|---|
| 27 | +#include <linux/timer.h> |
|---|
| 28 | +#include <linux/types.h> |
|---|
| 29 | +#include <linux/wait.h> |
|---|
| 25 | 30 | #include <linux/workqueue.h> |
|---|
| 26 | 31 | |
|---|
| 32 | +#include <net/dst.h> |
|---|
| 33 | +#include <net/ip6_fib.h> |
|---|
| 27 | 34 | #include <net/ipv6.h> |
|---|
| 28 | 35 | #include <net/if_inet6.h> |
|---|
| 29 | 36 | #include <net/addrconf.h> |
|---|
| 37 | +#include <net/route.h> |
|---|
| 38 | +#include <net/sch_generic.h> |
|---|
| 39 | +#include <net/tcp.h> |
|---|
| 30 | 40 | |
|---|
| 31 | 41 | #include <asm/debug.h> |
|---|
| 32 | 42 | #include <asm/qdio.h> |
|---|
| 33 | 43 | #include <asm/ccwdev.h> |
|---|
| 34 | 44 | #include <asm/ccwgroup.h> |
|---|
| 35 | 45 | #include <asm/sysinfo.h> |
|---|
| 46 | + |
|---|
| 47 | +#include <uapi/linux/if_link.h> |
|---|
| 36 | 48 | |
|---|
| 37 | 49 | #include "qeth_core_mpc.h" |
|---|
| 38 | 50 | |
|---|
| .. | .. |
|---|
| 56 | 68 | debug_info_t *id; |
|---|
| 57 | 69 | }; |
|---|
| 58 | 70 | |
|---|
| 59 | | -#define QETH_DBF_CTRL_LEN 256 |
|---|
| 71 | +#define QETH_DBF_CTRL_LEN 256U |
|---|
| 60 | 72 | |
|---|
| 61 | 73 | #define QETH_DBF_TEXT(name, level, text) \ |
|---|
| 62 | 74 | debug_text_event(qeth_dbf[QETH_DBF_##name].id, level, text) |
|---|
| .. | .. |
|---|
| 87 | 99 | #define SENSE_RESETTING_EVENT_BYTE 1 |
|---|
| 88 | 100 | #define SENSE_RESETTING_EVENT_FLAG 0x80 |
|---|
| 89 | 101 | |
|---|
| 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 | + |
|---|
| 90 | 114 | /* |
|---|
| 91 | 115 | * Common IO related definitions |
|---|
| 92 | 116 | */ |
|---|
| .. | .. |
|---|
| 97 | 121 | #define CARD_RDEV_ID(card) dev_name(&card->read.ccwdev->dev) |
|---|
| 98 | 122 | #define CARD_WDEV_ID(card) dev_name(&card->write.ccwdev->dev) |
|---|
| 99 | 123 | #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))) |
|---|
| 154 | 126 | |
|---|
| 155 | 127 | /* Routing stuff */ |
|---|
| 156 | 128 | struct qeth_routing_info { |
|---|
| 157 | 129 | enum qeth_routing_types type; |
|---|
| 158 | | -}; |
|---|
| 159 | | - |
|---|
| 160 | | -/* IPA stuff */ |
|---|
| 161 | | -struct qeth_ipa_info { |
|---|
| 162 | | - __u32 supported_funcs; |
|---|
| 163 | | - __u32 enabled_funcs; |
|---|
| 164 | 130 | }; |
|---|
| 165 | 131 | |
|---|
| 166 | 132 | /* SETBRIDGEPORT stuff */ |
|---|
| .. | .. |
|---|
| 201 | 167 | bool rx_bcast_enabled; |
|---|
| 202 | 168 | }; |
|---|
| 203 | 169 | |
|---|
| 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 | | - |
|---|
| 239 | 170 | #define QETH_IDX_FUNC_LEVEL_OSD 0x0101 |
|---|
| 240 | 171 | #define QETH_IDX_FUNC_LEVEL_IQD 0x4108 |
|---|
| 241 | 172 | |
|---|
| .. | .. |
|---|
| 246 | 177 | /** |
|---|
| 247 | 178 | * some more defs |
|---|
| 248 | 179 | */ |
|---|
| 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) |
|---|
| 251 | 182 | #define QETH_RECLAIM_WORK_TIME HZ |
|---|
| 252 | 183 | #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 |
|---|
| 257 | 184 | |
|---|
| 258 | 185 | /*****************************************************************************/ |
|---|
| 259 | 186 | /* QDIO queue and buffer handling */ |
|---|
| 260 | 187 | /*****************************************************************************/ |
|---|
| 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) |
|---|
| 262 | 195 | #define QETH_IN_BUF_SIZE_DEFAULT 65536 |
|---|
| 263 | 196 | #define QETH_IN_BUF_COUNT_DEFAULT 64 |
|---|
| 264 | 197 | #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 |
|---|
| 267 | 200 | #define QETH_MAX_BUFFER_ELEMENTS(card) ((card)->qdio.in_buf_size >> 12) |
|---|
| 268 | 201 | #define QETH_IN_BUF_REQUEUE_THRESHOLD(card) \ |
|---|
| 269 | 202 | ((card)->qdio.in_buf_pool.buf_count / 2) |
|---|
| .. | .. |
|---|
| 283 | 216 | #define QETH_PRIO_Q_ING_TOS 2 |
|---|
| 284 | 217 | #define QETH_PRIO_Q_ING_SKB 3 |
|---|
| 285 | 218 | #define QETH_PRIO_Q_ING_VLAN 4 |
|---|
| 219 | +#define QETH_PRIO_Q_ING_FIXED 5 |
|---|
| 286 | 220 | |
|---|
| 287 | 221 | /* Packing */ |
|---|
| 288 | 222 | #define QETH_LOW_WATERMARK_PACK 2 |
|---|
| 289 | 223 | #define QETH_HIGH_WATERMARK_PACK 5 |
|---|
| 290 | 224 | #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 |
|---|
| 295 | 225 | |
|---|
| 296 | 226 | struct qeth_hdr_layer3 { |
|---|
| 297 | 227 | __u8 id; |
|---|
| .. | .. |
|---|
| 305 | 235 | __u16 frame_offset; |
|---|
| 306 | 236 | union { |
|---|
| 307 | 237 | /* TX: */ |
|---|
| 308 | | - u8 ipv6_addr[16]; |
|---|
| 309 | | - struct ipv4 { |
|---|
| 310 | | - u8 res[12]; |
|---|
| 311 | | - u32 addr; |
|---|
| 312 | | - } ipv4; |
|---|
| 238 | + struct in6_addr addr; |
|---|
| 313 | 239 | /* RX: */ |
|---|
| 314 | 240 | struct rx { |
|---|
| 315 | 241 | u8 res1[2]; |
|---|
| .. | .. |
|---|
| 351 | 277 | struct qeth_hdr_osn osn; |
|---|
| 352 | 278 | } hdr; |
|---|
| 353 | 279 | } __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 | +}; |
|---|
| 354 | 300 | |
|---|
| 355 | 301 | /*TCP Segmentation Offload header*/ |
|---|
| 356 | 302 | struct qeth_hdr_ext_tso { |
|---|
| .. | .. |
|---|
| 394 | 340 | enum qeth_header_ids { |
|---|
| 395 | 341 | QETH_HEADER_TYPE_LAYER3 = 0x01, |
|---|
| 396 | 342 | QETH_HEADER_TYPE_LAYER2 = 0x02, |
|---|
| 397 | | - QETH_HEADER_TYPE_TSO = 0x03, |
|---|
| 343 | + QETH_HEADER_TYPE_L3_TSO = 0x03, |
|---|
| 398 | 344 | QETH_HEADER_TYPE_OSN = 0x04, |
|---|
| 345 | + QETH_HEADER_TYPE_L2_TSO = 0x06, |
|---|
| 346 | + QETH_HEADER_MASK_INVAL = 0x80, |
|---|
| 399 | 347 | }; |
|---|
| 400 | 348 | /* flags for qeth_hdr.ext_flags */ |
|---|
| 401 | 349 | #define QETH_HDR_EXT_VLAN_FRAME 0x01 |
|---|
| .. | .. |
|---|
| 406 | 354 | #define QETH_HDR_EXT_CSUM_TRANSP_REQ 0x20 |
|---|
| 407 | 355 | #define QETH_HDR_EXT_UDP 0x40 /*bit off for TCP*/ |
|---|
| 408 | 356 | |
|---|
| 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; |
|---|
| 435 | 382 | }; |
|---|
| 436 | 383 | |
|---|
| 437 | 384 | enum qeth_qdio_info_states { |
|---|
| .. | .. |
|---|
| 444 | 391 | struct qeth_buffer_pool_entry { |
|---|
| 445 | 392 | struct list_head list; |
|---|
| 446 | 393 | struct list_head init_list; |
|---|
| 447 | | - void *elements[QDIO_MAX_ELEMENTS_PER_BUFFER]; |
|---|
| 394 | + struct page *elements[QDIO_MAX_ELEMENTS_PER_BUFFER]; |
|---|
| 448 | 395 | }; |
|---|
| 449 | 396 | |
|---|
| 450 | 397 | struct qeth_qdio_buffer_pool { |
|---|
| .. | .. |
|---|
| 465 | 412 | int next_buf_to_init; |
|---|
| 466 | 413 | }; |
|---|
| 467 | 414 | |
|---|
| 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 | + |
|---|
| 468 | 429 | struct qeth_qdio_out_buffer { |
|---|
| 469 | 430 | struct qdio_buffer *buffer; |
|---|
| 470 | 431 | atomic_t state; |
|---|
| 471 | 432 | int next_element_to_fill; |
|---|
| 433 | + unsigned int frames; |
|---|
| 434 | + unsigned int bytes; |
|---|
| 472 | 435 | struct sk_buff_head skb_list; |
|---|
| 473 | 436 | int is_header[QDIO_MAX_ELEMENTS_PER_BUFFER]; |
|---|
| 474 | 437 | |
|---|
| 475 | 438 | struct qeth_qdio_out_q *q; |
|---|
| 476 | | - struct qeth_qdio_out_buffer *next_pending; |
|---|
| 439 | + struct list_head list_entry; |
|---|
| 477 | 440 | }; |
|---|
| 478 | 441 | |
|---|
| 479 | 442 | struct qeth_card; |
|---|
| 480 | 443 | |
|---|
| 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; |
|---|
| 485 | 468 | }; |
|---|
| 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 |
|---|
| 486 | 498 | |
|---|
| 487 | 499 | struct qeth_qdio_out_q { |
|---|
| 488 | 500 | struct qdio_buffer *qdio_bufs[QDIO_MAX_BUFFERS_PER_Q]; |
|---|
| 489 | 501 | struct qeth_qdio_out_buffer *bufs[QDIO_MAX_BUFFERS_PER_Q]; |
|---|
| 490 | 502 | 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; |
|---|
| 492 | 511 | 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; |
|---|
| 499 | 512 | /* |
|---|
| 500 | 513 | * number of buffers that are currently filled (PRIMED) |
|---|
| 501 | 514 | * -> these buffers are hardware-owned |
|---|
| .. | .. |
|---|
| 503 | 516 | atomic_t used_buffers; |
|---|
| 504 | 517 | /* indicates whether PCI flag must be set (or if one is outstanding) */ |
|---|
| 505 | 518 | 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; |
|---|
| 506 | 529 | }; |
|---|
| 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 | +} |
|---|
| 507 | 552 | |
|---|
| 508 | 553 | struct qeth_qdio_info { |
|---|
| 509 | 554 | atomic_t state; |
|---|
| .. | .. |
|---|
| 516 | 561 | int in_buf_size; |
|---|
| 517 | 562 | |
|---|
| 518 | 563 | /* 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]; |
|---|
| 521 | 566 | struct qdio_outbuf_state *out_bufstates; |
|---|
| 522 | 567 | |
|---|
| 523 | 568 | /* priority queueing */ |
|---|
| .. | .. |
|---|
| 526 | 571 | }; |
|---|
| 527 | 572 | |
|---|
| 528 | 573 | /** |
|---|
| 529 | | - * buffer stuff for read channel |
|---|
| 530 | | - */ |
|---|
| 531 | | -#define QETH_CMD_BUFFER_NO 8 |
|---|
| 532 | | - |
|---|
| 533 | | -/** |
|---|
| 534 | 574 | * channel state machine |
|---|
| 535 | 575 | */ |
|---|
| 536 | 576 | enum qeth_channel_states { |
|---|
| 537 | 577 | CH_STATE_UP, |
|---|
| 538 | 578 | CH_STATE_DOWN, |
|---|
| 539 | | - CH_STATE_ACTIVATING, |
|---|
| 540 | 579 | CH_STATE_HALTED, |
|---|
| 541 | 580 | CH_STATE_STOPPED, |
|---|
| 542 | | - CH_STATE_RCD, |
|---|
| 543 | | - CH_STATE_RCD_DONE, |
|---|
| 544 | 581 | }; |
|---|
| 545 | 582 | /** |
|---|
| 546 | 583 | * card state machine |
|---|
| 547 | 584 | */ |
|---|
| 548 | 585 | enum qeth_card_states { |
|---|
| 549 | 586 | CARD_STATE_DOWN, |
|---|
| 550 | | - CARD_STATE_HARDSETUP, |
|---|
| 551 | 587 | CARD_STATE_SOFTSETUP, |
|---|
| 552 | | - CARD_STATE_UP, |
|---|
| 553 | | - CARD_STATE_RECOVER, |
|---|
| 554 | 588 | }; |
|---|
| 555 | 589 | |
|---|
| 556 | 590 | /** |
|---|
| 557 | 591 | * Protocol versions |
|---|
| 558 | 592 | */ |
|---|
| 559 | 593 | enum qeth_prot_versions { |
|---|
| 594 | + QETH_PROT_NONE = 0x0000, |
|---|
| 560 | 595 | QETH_PROT_IPV4 = 0x0004, |
|---|
| 561 | 596 | QETH_PROT_IPV6 = 0x0006, |
|---|
| 562 | | -}; |
|---|
| 563 | | - |
|---|
| 564 | | -enum qeth_cmd_buffer_state { |
|---|
| 565 | | - BUF_STATE_FREE, |
|---|
| 566 | | - BUF_STATE_LOCKED, |
|---|
| 567 | 597 | }; |
|---|
| 568 | 598 | |
|---|
| 569 | 599 | enum qeth_cq { |
|---|
| .. | .. |
|---|
| 579 | 609 | struct list_head entries; |
|---|
| 580 | 610 | }; |
|---|
| 581 | 611 | |
|---|
| 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 | +}; |
|---|
| 583 | 624 | |
|---|
| 584 | 625 | 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; |
|---|
| 586 | 631 | struct qeth_channel *channel; |
|---|
| 632 | + struct qeth_reply reply; |
|---|
| 633 | + long timeout; |
|---|
| 587 | 634 | 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); |
|---|
| 588 | 640 | int rc; |
|---|
| 589 | | - void (*callback) (struct qeth_channel *, struct qeth_cmd_buffer *); |
|---|
| 590 | 641 | }; |
|---|
| 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 | +} |
|---|
| 591 | 655 | |
|---|
| 592 | 656 | static inline struct qeth_ipa_cmd *__ipa_cmd(struct qeth_cmd_buffer *iob) |
|---|
| 593 | 657 | { |
|---|
| 594 | 658 | return (struct qeth_ipa_cmd *)(iob->data + IPA_PDU_HEADER_SIZE); |
|---|
| 595 | 659 | } |
|---|
| 596 | 660 | |
|---|
| 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 | +} |
|---|
| 611 | 670 | |
|---|
| 612 | 671 | /** |
|---|
| 613 | 672 | * OSA card related definitions |
|---|
| .. | .. |
|---|
| 630 | 689 | __u32 pdu_hdr; |
|---|
| 631 | 690 | __u32 pdu_hdr_ack; |
|---|
| 632 | 691 | __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; |
|---|
| 648 | 692 | }; |
|---|
| 649 | 693 | |
|---|
| 650 | 694 | struct qeth_card_blkt { |
|---|
| .. | .. |
|---|
| 653 | 697 | int inter_packet_jumbo; |
|---|
| 654 | 698 | }; |
|---|
| 655 | 699 | |
|---|
| 700 | +enum qeth_pnso_mode { |
|---|
| 701 | + QETH_PNSO_NONE, |
|---|
| 702 | + QETH_PNSO_BRIDGEPORT, |
|---|
| 703 | + QETH_PNSO_ADDR_INFO, |
|---|
| 704 | +}; |
|---|
| 705 | + |
|---|
| 656 | 706 | #define QETH_BROADCAST_WITH_ECHO 0x01 |
|---|
| 657 | 707 | #define QETH_BROADCAST_WITHOUT_ECHO 0x02 |
|---|
| 658 | | -#define QETH_LAYER2_MAC_READ 0x01 |
|---|
| 659 | | -#define QETH_LAYER2_MAC_REGISTERED 0x02 |
|---|
| 660 | 708 | struct qeth_card_info { |
|---|
| 661 | 709 | unsigned short unit_addr2; |
|---|
| 662 | 710 | unsigned short cula; |
|---|
| 663 | | - unsigned short chpid; |
|---|
| 664 | 711 | __u16 func_level; |
|---|
| 665 | 712 | 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; |
|---|
| 668 | 729 | enum qeth_card_types type; |
|---|
| 669 | 730 | enum qeth_link_types link_type; |
|---|
| 670 | 731 | int broadcast_capable; |
|---|
| 671 | | - int unique_id; |
|---|
| 672 | 732 | bool layer_enforced; |
|---|
| 673 | 733 | struct qeth_card_blkt blkt; |
|---|
| 674 | | - enum qeth_ipa_promisc_modes promisc_mode; |
|---|
| 675 | 734 | __u32 diagass_support; |
|---|
| 676 | 735 | __u32 hwtrap; |
|---|
| 677 | 736 | }; |
|---|
| 678 | 737 | |
|---|
| 738 | +enum qeth_discipline_id { |
|---|
| 739 | + QETH_DISCIPLINE_UNDETERMINED = -1, |
|---|
| 740 | + QETH_DISCIPLINE_LAYER3 = 0, |
|---|
| 741 | + QETH_DISCIPLINE_LAYER2 = 1, |
|---|
| 742 | +}; |
|---|
| 743 | + |
|---|
| 679 | 744 | struct qeth_card_options { |
|---|
| 745 | + struct qeth_ipa_caps ipa4; |
|---|
| 746 | + struct qeth_ipa_caps ipa6; |
|---|
| 680 | 747 | struct qeth_routing_info route4; |
|---|
| 681 | | - struct qeth_ipa_info ipa4; |
|---|
| 682 | | - struct qeth_ipa_info adp; /*Adapter parameters*/ |
|---|
| 683 | 748 | struct qeth_routing_info route6; |
|---|
| 684 | | - struct qeth_ipa_info ipa6; |
|---|
| 749 | + struct qeth_ipa_caps adp; /* Adapter parameters */ |
|---|
| 685 | 750 | struct qeth_sbp_info sbp; /* SETBRIDGEPORT options */ |
|---|
| 686 | 751 | 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; |
|---|
| 691 | 753 | enum qeth_ipa_isolation_modes isolation; |
|---|
| 692 | | - enum qeth_ipa_isolation_modes prev_isolation; |
|---|
| 693 | 754 | int sniffer; |
|---|
| 694 | 755 | enum qeth_cq cq; |
|---|
| 695 | 756 | char hsuid[9]; |
|---|
| 696 | 757 | }; |
|---|
| 758 | + |
|---|
| 759 | +#define IS_LAYER2(card) ((card)->options.layer == QETH_DISCIPLINE_LAYER2) |
|---|
| 760 | +#define IS_LAYER3(card) ((card)->options.layer == QETH_DISCIPLINE_LAYER3) |
|---|
| 697 | 761 | |
|---|
| 698 | 762 | /* |
|---|
| 699 | 763 | * thread bits for qeth_card thread masks |
|---|
| .. | .. |
|---|
| 707 | 771 | int (*data_cb)(struct sk_buff *skb); |
|---|
| 708 | 772 | }; |
|---|
| 709 | 773 | |
|---|
| 710 | | -enum qeth_discipline_id { |
|---|
| 711 | | - QETH_DISCIPLINE_UNDETERMINED = -1, |
|---|
| 712 | | - QETH_DISCIPLINE_LAYER3 = 0, |
|---|
| 713 | | - QETH_DISCIPLINE_LAYER2 = 1, |
|---|
| 714 | | -}; |
|---|
| 715 | | - |
|---|
| 716 | 774 | struct qeth_discipline { |
|---|
| 717 | 775 | const struct device_type *devtype; |
|---|
| 718 | | - int (*process_rx_buffer)(struct qeth_card *card, int budget, int *done); |
|---|
| 719 | | - int (*recover)(void *ptr); |
|---|
| 720 | 776 | int (*setup) (struct ccwgroup_device *); |
|---|
| 721 | 777 | 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); |
|---|
| 727 | 780 | int (*do_ioctl)(struct net_device *dev, struct ifreq *rq, int cmd); |
|---|
| 728 | 781 | int (*control_event_handler)(struct qeth_card *card, |
|---|
| 729 | 782 | struct qeth_ipa_cmd *cmd); |
|---|
| 730 | | -}; |
|---|
| 731 | | - |
|---|
| 732 | | -struct qeth_vlan_vid { |
|---|
| 733 | | - struct list_head list; |
|---|
| 734 | | - unsigned short vid; |
|---|
| 735 | 783 | }; |
|---|
| 736 | 784 | |
|---|
| 737 | 785 | enum qeth_addr_disposition { |
|---|
| .. | .. |
|---|
| 743 | 791 | struct qeth_rx { |
|---|
| 744 | 792 | int b_count; |
|---|
| 745 | 793 | int b_index; |
|---|
| 746 | | - struct qdio_buffer_element *b_element; |
|---|
| 794 | + u8 buf_element; |
|---|
| 747 | 795 | int e_offset; |
|---|
| 748 | 796 | int qdio_err; |
|---|
| 797 | + u8 bufs_refill; |
|---|
| 749 | 798 | }; |
|---|
| 750 | 799 | |
|---|
| 751 | 800 | struct carrier_info { |
|---|
| .. | .. |
|---|
| 759 | 808 | __u32 settings; |
|---|
| 760 | 809 | }; |
|---|
| 761 | 810 | |
|---|
| 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 | + |
|---|
| 762 | 818 | #define QETH_NAPI_WEIGHT NAPI_POLL_WEIGHT |
|---|
| 763 | 819 | |
|---|
| 764 | 820 | struct qeth_card { |
|---|
| 765 | | - struct list_head list; |
|---|
| 766 | 821 | enum qeth_card_states state; |
|---|
| 767 | | - int lan_online; |
|---|
| 768 | 822 | spinlock_t lock; |
|---|
| 769 | 823 | struct ccwgroup_device *gdev; |
|---|
| 824 | + struct qeth_cmd_buffer *read_cmd; |
|---|
| 770 | 825 | struct qeth_channel read; |
|---|
| 771 | 826 | struct qeth_channel write; |
|---|
| 772 | 827 | struct qeth_channel data; |
|---|
| 773 | 828 | |
|---|
| 774 | 829 | struct net_device *dev; |
|---|
| 775 | | - struct net_device_stats stats; |
|---|
| 776 | | - |
|---|
| 830 | + struct dentry *debugfs; |
|---|
| 831 | + struct qeth_card_stats stats; |
|---|
| 777 | 832 | struct qeth_card_info info; |
|---|
| 778 | 833 | struct qeth_token token; |
|---|
| 779 | 834 | struct qeth_seqno seqno; |
|---|
| 780 | 835 | struct qeth_card_options options; |
|---|
| 781 | 836 | |
|---|
| 837 | + struct workqueue_struct *event_wq; |
|---|
| 838 | + struct workqueue_struct *cmd_wq; |
|---|
| 782 | 839 | 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: */ |
|---|
| 788 | 843 | 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; |
|---|
| 790 | 852 | struct work_struct kernel_thread_starter; |
|---|
| 791 | 853 | spinlock_t thread_mask_lock; |
|---|
| 792 | 854 | unsigned long thread_start_mask; |
|---|
| 793 | 855 | unsigned long thread_allowed_mask; |
|---|
| 794 | 856 | unsigned long thread_running_mask; |
|---|
| 795 | | - struct task_struct *recovery_task; |
|---|
| 796 | | - spinlock_t ip_lock; |
|---|
| 797 | | - struct qeth_ipato ipato; |
|---|
| 798 | 857 | struct list_head cmd_waiter_list; |
|---|
| 799 | 858 | /* QDIO buffer handling */ |
|---|
| 800 | 859 | struct qeth_qdio_info qdio; |
|---|
| 801 | | - struct qeth_perf_stats perf_stats; |
|---|
| 802 | 860 | int read_or_write_problem; |
|---|
| 803 | 861 | struct qeth_osn_info osn_info; |
|---|
| 804 | | - struct qeth_discipline *discipline; |
|---|
| 862 | + const struct qeth_discipline *discipline; |
|---|
| 805 | 863 | atomic_t force_alloc_skb; |
|---|
| 806 | 864 | struct service_level qeth_service_level; |
|---|
| 807 | 865 | struct qdio_ssqd_desc ssqd; |
|---|
| 808 | 866 | debug_info_t *debug; |
|---|
| 867 | + struct mutex sbp_lock; |
|---|
| 809 | 868 | struct mutex conf_mutex; |
|---|
| 810 | 869 | struct mutex discipline_mutex; |
|---|
| 811 | 870 | struct napi_struct napi; |
|---|
| 812 | 871 | struct qeth_rx rx; |
|---|
| 813 | 872 | struct delayed_work buffer_reclaim_work; |
|---|
| 814 | | - int reclaim_index; |
|---|
| 815 | 873 | struct work_struct close_dev_work; |
|---|
| 816 | 874 | }; |
|---|
| 817 | 875 | |
|---|
| 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 | +} |
|---|
| 822 | 887 | |
|---|
| 823 | 888 | struct qeth_trap_id { |
|---|
| 824 | 889 | __u16 lparnr; |
|---|
| .. | .. |
|---|
| 828 | 893 | __u16 devno; |
|---|
| 829 | 894 | } __packed; |
|---|
| 830 | 895 | |
|---|
| 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) |
|---|
| 835 | 897 | { |
|---|
| 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; |
|---|
| 837 | 925 | } |
|---|
| 838 | 926 | |
|---|
| 839 | 927 | static inline void qeth_scrub_qdio_buffer(struct qdio_buffer *buf, |
|---|
| .. | .. |
|---|
| 860 | 948 | return PFN_UP(end) - PFN_DOWN(start); |
|---|
| 861 | 949 | } |
|---|
| 862 | 950 | |
|---|
| 863 | | -static inline int qeth_get_micros(void) |
|---|
| 864 | | -{ |
|---|
| 865 | | - return (int) (get_tod_clock() >> 12); |
|---|
| 866 | | -} |
|---|
| 867 | | - |
|---|
| 868 | 951 | static inline int qeth_get_ip_version(struct sk_buff *skb) |
|---|
| 869 | 952 | { |
|---|
| 870 | 953 | struct vlan_ethhdr *veth = vlan_eth_hdr(skb); |
|---|
| .. | .. |
|---|
| 883 | 966 | } |
|---|
| 884 | 967 | } |
|---|
| 885 | 968 | |
|---|
| 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) |
|---|
| 888 | 970 | { |
|---|
| 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; |
|---|
| 897 | 1007 | } |
|---|
| 898 | 1008 | |
|---|
| 899 | 1009 | static inline void qeth_tx_csum(struct sk_buff *skb, u8 *flags, int ipv) |
|---|
| .. | .. |
|---|
| 902 | 1012 | if ((ipv == 4 && ip_hdr(skb)->protocol == IPPROTO_UDP) || |
|---|
| 903 | 1013 | (ipv == 6 && ipv6_hdr(skb)->nexthdr == IPPROTO_UDP)) |
|---|
| 904 | 1014 | *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 | | - } |
|---|
| 910 | 1015 | } |
|---|
| 911 | 1016 | |
|---|
| 912 | 1017 | static inline void qeth_put_buffer_pool_entry(struct qeth_card *card, |
|---|
| .. | .. |
|---|
| 923 | 1028 | |
|---|
| 924 | 1029 | int qeth_send_simple_setassparms_prot(struct qeth_card *card, |
|---|
| 925 | 1030 | enum qeth_ipa_funcs ipa_func, |
|---|
| 926 | | - u16 cmd_code, long data, |
|---|
| 1031 | + u16 cmd_code, u32 *data, |
|---|
| 927 | 1032 | enum qeth_prot_versions prot); |
|---|
| 928 | 1033 | /* IPv4 variant */ |
|---|
| 929 | 1034 | static inline int qeth_send_simple_setassparms(struct qeth_card *card, |
|---|
| 930 | 1035 | enum qeth_ipa_funcs ipa_func, |
|---|
| 931 | | - u16 cmd_code, long data) |
|---|
| 1036 | + u16 cmd_code, u32 *data) |
|---|
| 932 | 1037 | { |
|---|
| 933 | 1038 | return qeth_send_simple_setassparms_prot(card, ipa_func, cmd_code, |
|---|
| 934 | 1039 | data, QETH_PROT_IPV4); |
|---|
| .. | .. |
|---|
| 936 | 1041 | |
|---|
| 937 | 1042 | static inline int qeth_send_simple_setassparms_v6(struct qeth_card *card, |
|---|
| 938 | 1043 | enum qeth_ipa_funcs ipa_func, |
|---|
| 939 | | - u16 cmd_code, long data) |
|---|
| 1044 | + u16 cmd_code, u32 *data) |
|---|
| 940 | 1045 | { |
|---|
| 941 | 1046 | return qeth_send_simple_setassparms_prot(card, ipa_func, cmd_code, |
|---|
| 942 | 1047 | data, QETH_PROT_IPV6); |
|---|
| 943 | 1048 | } |
|---|
| 944 | 1049 | |
|---|
| 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); |
|---|
| 957 | 1051 | |
|---|
| 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; |
|---|
| 960 | 1056 | extern const struct attribute_group *qeth_generic_attr_groups[]; |
|---|
| 961 | 1057 | extern const struct attribute_group *qeth_osn_attr_groups[]; |
|---|
| 962 | 1058 | extern const struct attribute_group qeth_device_attr_group; |
|---|
| 963 | 1059 | extern const struct attribute_group qeth_device_blkt_group; |
|---|
| 964 | 1060 | extern const struct device_type qeth_generic_devtype; |
|---|
| 965 | | -extern struct workqueue_struct *qeth_wq; |
|---|
| 966 | 1061 | |
|---|
| 967 | | -int qeth_card_hw_is_reachable(struct qeth_card *); |
|---|
| 968 | 1062 | 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); |
|---|
| 970 | 1064 | int qeth_core_load_discipline(struct qeth_card *, enum qeth_discipline_id); |
|---|
| 971 | 1065 | void qeth_core_free_discipline(struct qeth_card *); |
|---|
| 972 | 1066 | |
|---|
| 973 | 1067 | /* exports for qeth discipline device drivers */ |
|---|
| 974 | | -extern struct qeth_card_list_struct qeth_core_card_list; |
|---|
| 975 | 1068 | extern struct kmem_cache *qeth_core_header_cache; |
|---|
| 976 | 1069 | extern struct qeth_dbf_info qeth_dbf[QETH_DBF_INFOS]; |
|---|
| 977 | 1070 | |
|---|
| 978 | 1071 | 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); |
|---|
| 982 | 1075 | 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 | + |
|---|
| 990 | 1079 | int qeth_send_ipa_cmd(struct qeth_card *, struct qeth_cmd_buffer *, |
|---|
| 991 | 1080 | int (*reply_cb) |
|---|
| 992 | 1081 | (struct qeth_card *, struct qeth_reply *, unsigned long), |
|---|
| 993 | 1082 | 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); |
|---|
| 1000 | 1102 | 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); |
|---|
| 1008 | 1104 | 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)); |
|---|
| 1015 | 1110 | int qeth_query_switch_attributes(struct qeth_card *card, |
|---|
| 1016 | 1111 | 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); |
|---|
| 1026 | 1118 | int qeth_do_send_packet(struct qeth_card *card, struct qeth_qdio_out_q *queue, |
|---|
| 1027 | 1119 | struct sk_buff *skb, struct qeth_hdr *hdr, |
|---|
| 1028 | 1120 | unsigned int offset, unsigned int hd_len, |
|---|
| 1029 | 1121 | int elements_needed); |
|---|
| 1030 | 1122 | 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 *); |
|---|
| 1036 | 1123 | 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); |
|---|
| 1041 | 1124 | int qeth_configure_cq(struct qeth_card *, enum qeth_cq); |
|---|
| 1042 | 1125 | 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 *); |
|---|
| 1050 | 1126 | 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); |
|---|
| 1055 | 1127 | int qeth_set_features(struct net_device *, netdev_features_t); |
|---|
| 1056 | 1128 | void qeth_enable_hw_features(struct net_device *dev); |
|---|
| 1057 | 1129 | netdev_features_t qeth_fix_features(struct net_device *, netdev_features_t); |
|---|
| 1058 | 1130 | netdev_features_t qeth_features_check(struct sk_buff *skb, |
|---|
| 1059 | 1131 | struct net_device *dev, |
|---|
| 1060 | 1132 | 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 | + |
|---|
| 1061 | 1140 | 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)); |
|---|
| 1065 | 1146 | |
|---|
| 1066 | 1147 | /* exports for OSN */ |
|---|
| 1067 | 1148 | int qeth_osn_assist(struct net_device *, void *, int); |
|---|