]> CyberLeo.Net >> Repos - FreeBSD/releng/8.1.git/blob - sys/dev/cxgb/ulp/tom/cxgb_tcp_offload.c
Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.
[FreeBSD/releng/8.1.git] / sys / dev / cxgb / ulp / tom / cxgb_tcp_offload.c
1 /*-
2  * Copyright (c) 2007, Chelsio Inc.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * 1. Redistributions of source code must retain the above copyright notice,
9  *    this list of conditions and the following disclaimer.
10  *
11  * 2. Neither the name of the Chelsio Corporation nor the names of its
12  *    contributors may be used to endorse or promote products derived from
13  *    this software without specific prior written permission.
14  *
15  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
19  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25  * POSSIBILITY OF SUCH DAMAGE.
26  */
27
28 #include <sys/cdefs.h>
29 __FBSDID("$FreeBSD$");
30
31 /*
32  * grab bag of accessor routines that will either be moved to netinet
33  * or removed
34  */
35
36
37 #include <sys/param.h>
38 #include <sys/systm.h>
39 #include <sys/types.h>
40 #include <sys/malloc.h>
41 #include <sys/kernel.h>
42 #include <sys/sysctl.h>
43 #include <sys/mbuf.h>
44 #include <sys/sockopt.h>
45 #include <sys/sockbuf.h>
46
47 #include <sys/socket.h>
48
49 #include <net/if.h>
50 #include <net/if_types.h>
51 #include <net/if_var.h>
52
53 #include <netinet/in.h>
54 #include <netinet/in_systm.h>
55 #include <netinet/in_pcb.h>
56 #include <netinet/tcp.h>
57 #include <netinet/tcp_var.h>
58 #include <netinet/tcp_offload.h>
59 #include <netinet/tcp_syncache.h>
60 #include <netinet/toedev.h>
61
62 #include <ulp/tom/cxgb_tcp_offload.h>
63
64
65 /*
66  * This file contains code as a short-term staging area before it is moved in 
67  * to sys/netinet/tcp_offload.c
68  */
69
70 void
71 sockbuf_lock(struct sockbuf *sb)
72 {
73
74         SOCKBUF_LOCK(sb);
75 }
76
77 void
78 sockbuf_lock_assert(struct sockbuf *sb)
79 {
80
81         SOCKBUF_LOCK_ASSERT(sb);
82 }
83
84 void
85 sockbuf_unlock(struct sockbuf *sb)
86 {
87
88         SOCKBUF_UNLOCK(sb);
89 }
90
91 int
92 sockbuf_sbspace(struct sockbuf *sb)
93 {
94
95         return (sbspace(sb));
96 }
97