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