]> CyberLeo.Net >> Repos - FreeBSD/releng/7.2.git/blob - sys/dev/usb/if_cdcereg.h
Create releng/7.2 from stable/7 in preparation for 7.2-RELEASE.
[FreeBSD/releng/7.2.git] / sys / dev / usb / if_cdcereg.h
1 /*
2  * Copyright (c) 2003-2005 Craig Boston
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
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  *    notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  *    notice, this list of conditions and the following disclaimer in the
12  *    documentation and/or other materials provided with the distribution.
13  * 3. All advertising materials mentioning features or use of this software
14  *    must display the following acknowledgement:
15  *      This product includes software developed by Bill Paul.
16  * 4. Neither the name of the author nor the names of any co-contributors
17  *    may be used to endorse or promote products derived from this software
18  *    without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
21  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23  * ARE DISCLAIMED.  IN NO EVENT SHALL Bill Paul, THE VOICES IN HIS HEAD OR
24  * THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
30  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  *
32  * $FreeBSD$
33  */
34
35 #ifndef _USB_IF_CDCEREG_H_
36 #define _USB_IF_CDCEREG_H_
37
38 struct cdce_type {
39         struct usb_devno         cdce_dev;
40         u_int16_t                cdce_flags;
41 #define CDCE_ZAURUS     1
42 #define CDCE_NO_UNION   2
43 };
44
45 struct cdce_softc {
46         struct ifnet             *cdce_ifp;
47 #define GET_IFP(sc) ((sc)->cdce_ifp)
48         struct ifmedia           cdce_ifmedia;
49
50         usbd_device_handle       cdce_udev;
51         usbd_interface_handle    cdce_data_iface;
52         int                      cdce_bulkin_no;
53         usbd_pipe_handle         cdce_bulkin_pipe;
54         int                      cdce_bulkout_no;
55         usbd_pipe_handle         cdce_bulkout_pipe;
56         char                     cdce_dying;
57         device_t                 cdce_dev;
58
59         struct ue_cdata          cdce_cdata;
60         struct timeval           cdce_rx_notice;
61         int                      cdce_rxeof_errors;
62
63         u_int16_t                cdce_flags;
64
65         struct mtx               cdce_mtx;
66
67         struct usb_qdat          q;
68 };
69
70 /* We are still under Giant */
71 #if 0
72 #define CDCE_LOCK(_sc)           mtx_lock(&(_sc)->cdce_mtx)
73 #define CDCE_UNLOCK(_sc)         mtx_unlock(&(_sc)->cdce_mtx)
74 #else
75 #define CDCE_LOCK(_sc)
76 #define CDCE_UNLOCK(_sc)
77 #endif
78
79 #endif /* _USB_IF_CDCEREG_H_ */