aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/net/qeth_tso.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /drivers/s390/net/qeth_tso.h
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'drivers/s390/net/qeth_tso.h')
-rw-r--r--drivers/s390/net/qeth_tso.h58
1 files changed, 58 insertions, 0 deletions
diff --git a/drivers/s390/net/qeth_tso.h b/drivers/s390/net/qeth_tso.h
new file mode 100644
index 000000000000..83504dee3f57
--- /dev/null
+++ b/drivers/s390/net/qeth_tso.h
@@ -0,0 +1,58 @@
1/*
2 * linux/drivers/s390/net/qeth_tso.h ($Revision: 1.4 $)
3 *
4 * Header file for qeth TCP Segmentation Offload support.
5 *
6 * Copyright 2004 IBM Corporation
7 *
8 * Author(s): Frank Pavlic <pavlic@de.ibm.com>
9 *
10 * $Revision: 1.4 $ $Date: 2005/03/24 09:04:18 $
11 *
12 */
13#ifndef __QETH_TSO_H__
14#define __QETH_TSO_H__
15
16
17extern int
18qeth_tso_send_packet(struct qeth_card *, struct sk_buff *,
19 struct qeth_qdio_out_q *, int , int);
20
21struct qeth_hdr_ext_tso {
22 __u16 hdr_tot_len;
23 __u8 imb_hdr_no;
24 __u8 reserved;
25 __u8 hdr_type;
26 __u8 hdr_version;
27 __u16 hdr_len;
28 __u32 payload_len;
29 __u16 mss;
30 __u16 dg_hdr_len;
31 __u8 padding[16];
32} __attribute__ ((packed));
33
34struct qeth_hdr_tso {
35 struct qeth_hdr hdr; /*hdr->hdr.l3.xxx*/
36 struct qeth_hdr_ext_tso ext;
37} __attribute__ ((packed));
38
39/*some helper functions*/
40
41static inline int
42qeth_get_elements_no(struct qeth_card *card, void *hdr, struct sk_buff *skb)
43{
44 int elements_needed = 0;
45
46 if (skb_shinfo(skb)->nr_frags > 0)
47 elements_needed = (skb_shinfo(skb)->nr_frags + 1);
48 if (elements_needed == 0 )
49 elements_needed = 1 + (((((unsigned long) hdr) % PAGE_SIZE)
50 + skb->len) >> PAGE_SHIFT);
51 if (elements_needed > QETH_MAX_BUFFER_ELEMENTS(card)){
52 PRINT_ERR("qeth_do_send_packet: invalid size of "
53 "IP packet. Discarded.");
54 return 0;
55 }
56 return elements_needed;
57}
58#endif /* __QETH_TSO_H__ */