]> CyberLeo.Net >> Repos - FreeBSD/releng/8.1.git/blob - sys/dev/cxgb/t3cdev.h
Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.
[FreeBSD/releng/8.1.git] / sys / dev / cxgb / t3cdev.h
1 /*-
2  * Copyright (c) 2007-2008, 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  * $FreeBSD$
28  */
29 #ifndef _T3CDEV_H_
30 #define _T3CDEV_H_
31
32 #define T3CNAMSIZ 16
33
34 /* Get the t3cdev associated with an ifnet */
35 #define T3CDEV(ifp) (&(((struct port_info *)(ifp)->if_softc))->adapter->tdev)
36
37 struct cxgb3_client;
38
39 enum t3ctype {
40         T3A = 0,
41         T3B,
42         T3C
43 };
44
45 struct t3cdev {
46         char name[T3CNAMSIZ];               /* T3C device name */
47         enum t3ctype type;
48         TAILQ_ENTRY(t3cdev) entry;  /* for list linking */
49         struct ifnet *lldev;     /* LL dev associated with T3C messages */
50         struct adapter *adapter;                            
51         int (*send)(struct t3cdev *dev, struct mbuf *m);
52         int (*recv)(struct t3cdev *dev, struct mbuf **m, int n);
53         int (*ctl)(struct t3cdev *dev, unsigned int req, void *data);
54         void (*arp_update)(struct t3cdev *dev, struct rtentry *neigh, uint8_t *enaddr, struct sockaddr *sa);
55         void *priv;                         /* driver private data */
56         void *l2opt;                        /* optional layer 2 data */
57         void *l3opt;                        /* optional layer 3 data */
58         void *l4opt;                        /* optional layer 4 data */
59         void *ulp;                          /* ulp stuff */
60 };
61
62 #endif /* _T3CDEV_H_ */