Update to 3.4-final.
[linux-flexiantxendom0-3.2.10.git] / drivers / xen / sfc_netfront / accel_tso.h
1 /****************************************************************************
2  * Solarflare driver for Xen network acceleration
3  *
4  * Copyright 2006-2008: Solarflare Communications Inc,
5  *                      9501 Jeronimo Road, Suite 250,
6  *                      Irvine, CA 92618, USA
7  *
8  * Maintained by Solarflare Communications <linux-xen-drivers@solarflare.com>
9  *
10  * This program is free software; you can redistribute it and/or modify it
11  * under the terms of the GNU General Public License version 2 as published
12  * by the Free Software Foundation, incorporated herein by reference.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
22  ****************************************************************************
23  */
24
25 #ifndef NETFRONT_ACCEL_TSO_H
26 #define NETFRONT_ACCEL_TSO_H
27
28 #include "accel_bufs.h"
29
30 /* Track the buffers used in each output packet */
31 struct netfront_accel_tso_buffer {
32         struct netfront_accel_tso_buffer *next;
33         struct netfront_accel_pkt_desc *buf;
34         unsigned length;
35 };
36
37 /* Track the output packets formed from each input packet */
38 struct netfront_accel_tso_output_packet {
39         struct netfront_accel_tso_output_packet *next;
40         struct netfront_accel_tso_buffer *tso_bufs;
41         unsigned tso_bufs_len;
42 };
43
44
45 /*
46  * Max available space in a buffer for data once meta-data has taken
47  * its place 
48  */
49 #define NETFRONT_ACCEL_TSO_BUF_LENGTH                                   \
50         ((PAGE_SIZE / NETFRONT_ACCEL_BUFS_PER_PAGE)                     \
51          - sizeof(struct netfront_accel_tso_buffer)                     \
52          - sizeof(struct netfront_accel_tso_output_packet))
53
54 int netfront_accel_enqueue_skb_tso(netfront_accel_vnic *vnic,
55                                    struct sk_buff *skb);
56
57 #endif /* NETFRONT_ACCEL_TSO_H */