]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/blob - drivers/s390/net/qeth_tso.h
Linux-2.6.12-rc2
[sojka/nv-tegra/linux-3.10.git] / drivers / s390 / net / qeth_tso.h
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
17 extern int
18 qeth_tso_send_packet(struct qeth_card *, struct sk_buff *,
19                      struct qeth_qdio_out_q *, int , int);
20
21 struct 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
34 struct 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
41 static inline int
42 qeth_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__ */