2 * linux/drivers/s390/net/qeth_tso.h ($Revision: 1.4 $)
4 * Header file for qeth TCP Segmentation Offload support.
6 * Copyright 2004 IBM Corporation
8 * Author(s): Frank Pavlic <pavlic@de.ibm.com>
10 * $Revision: 1.4 $ $Date: 2005/03/24 09:04:18 $
13 #ifndef __QETH_TSO_H__
14 #define __QETH_TSO_H__
18 qeth_tso_send_packet(struct qeth_card *, struct sk_buff *,
19 struct qeth_qdio_out_q *, int , int);
21 struct qeth_hdr_ext_tso {
32 } __attribute__ ((packed));
35 struct qeth_hdr hdr; /*hdr->hdr.l3.xxx*/
36 struct qeth_hdr_ext_tso ext;
37 } __attribute__ ((packed));
39 /*some helper functions*/
42 qeth_get_elements_no(struct qeth_card *card, void *hdr, struct sk_buff *skb)
44 int elements_needed = 0;
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.");
56 return elements_needed;
58 #endif /* __QETH_TSO_H__ */