Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
Heiko Carstens | e018ba1 | 2006-02-01 03:06:31 -0800 | [diff] [blame] | 2 | * linux/drivers/s390/net/qeth_eddp.h |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 3 | * |
Heiko Carstens | e018ba1 | 2006-02-01 03:06:31 -0800 | [diff] [blame] | 4 | * Header file for qeth enhanced device driver packing. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 5 | * |
| 6 | * Copyright 2004 IBM Corporation |
| 7 | * |
| 8 | * Author(s): Thomas Spatzier <tspat@de.ibm.com> |
| 9 | * |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 10 | */ |
| 11 | #ifndef __QETH_EDDP_H__ |
| 12 | #define __QETH_EDDP_H__ |
| 13 | |
| 14 | struct qeth_eddp_element { |
| 15 | u32 flags; |
| 16 | u32 length; |
| 17 | void *addr; |
| 18 | }; |
| 19 | |
| 20 | struct qeth_eddp_context { |
| 21 | atomic_t refcnt; |
| 22 | enum qeth_large_send_types type; |
| 23 | int num_pages; /* # of allocated pages */ |
| 24 | u8 **pages; /* pointers to pages */ |
| 25 | int offset; /* offset in ctx during creation */ |
| 26 | int num_elements; /* # of required 'SBALEs' */ |
| 27 | struct qeth_eddp_element *elements; /* array of 'SBALEs' */ |
| 28 | int elements_per_skb; /* # of 'SBALEs' per skb **/ |
| 29 | }; |
| 30 | |
| 31 | struct qeth_eddp_context_reference { |
| 32 | struct list_head list; |
| 33 | struct qeth_eddp_context *ctx; |
| 34 | }; |
| 35 | |
| 36 | extern struct qeth_eddp_context * |
| 37 | qeth_eddp_create_context(struct qeth_card *,struct sk_buff *,struct qeth_hdr *); |
| 38 | |
| 39 | extern void |
| 40 | qeth_eddp_put_context(struct qeth_eddp_context *); |
| 41 | |
| 42 | extern int |
| 43 | qeth_eddp_fill_buffer(struct qeth_qdio_out_q *,struct qeth_eddp_context *,int); |
| 44 | |
| 45 | extern void |
| 46 | qeth_eddp_buf_release_contexts(struct qeth_qdio_out_buffer *); |
| 47 | |
| 48 | extern int |
| 49 | qeth_eddp_check_buffers_for_context(struct qeth_qdio_out_q *, |
| 50 | struct qeth_eddp_context *); |
| 51 | /* |
| 52 | * Data used for fragmenting a IP packet. |
| 53 | */ |
| 54 | struct qeth_eddp_data { |
| 55 | struct qeth_hdr qh; |
| 56 | struct ethhdr mac; |
| 57 | u16 vlan[2]; |
| 58 | union { |
| 59 | struct { |
| 60 | struct iphdr h; |
| 61 | u8 options[40]; |
| 62 | } ip4; |
| 63 | struct { |
| 64 | struct ipv6hdr h; |
| 65 | } ip6; |
| 66 | } nh; |
| 67 | u8 nhl; |
| 68 | void *nh_in_ctx; /* address of nh within the ctx */ |
| 69 | union { |
| 70 | struct { |
| 71 | struct tcphdr h; |
| 72 | u8 options[40]; |
| 73 | } tcp; |
| 74 | } th; |
| 75 | u8 thl; |
| 76 | void *th_in_ctx; /* address of th within the ctx */ |
| 77 | struct sk_buff *skb; |
| 78 | int skb_offset; |
| 79 | int frag; |
| 80 | int frag_offset; |
| 81 | } __attribute__ ((packed)); |
| 82 | |
| 83 | #endif /* __QETH_EDDP_H__ */ |