if_cdcereg.h revision 1.1.2.2 1 1.1.2.2 skrll /* $NetBSD: if_cdcereg.h,v 1.1.2.2 2004/11/02 07:53:02 skrll Exp $ */
2 1.1.2.2 skrll
3 1.1.2.2 skrll /*
4 1.1.2.2 skrll * Copyright (c) 1997, 1998, 1999, 2000-2003 Bill Paul <wpaul (at) windriver.com>
5 1.1.2.2 skrll * Copyright (c) 2003 Craig Boston
6 1.1.2.2 skrll * Copyright (c) 2004 Daniel Hartmeier
7 1.1.2.2 skrll * All rights reserved.
8 1.1.2.2 skrll *
9 1.1.2.2 skrll * Redistribution and use in source and binary forms, with or without
10 1.1.2.2 skrll * modification, are permitted provided that the following conditions
11 1.1.2.2 skrll * are met:
12 1.1.2.2 skrll * 1. Redistributions of source code must retain the above copyright
13 1.1.2.2 skrll * notice, this list of conditions and the following disclaimer.
14 1.1.2.2 skrll * 2. Redistributions in binary form must reproduce the above copyright
15 1.1.2.2 skrll * notice, this list of conditions and the following disclaimer in the
16 1.1.2.2 skrll * documentation and/or other materials provided with the distribution.
17 1.1.2.2 skrll * 3. All advertising materials mentioning features or use of this software
18 1.1.2.2 skrll * must display the following acknowledgement:
19 1.1.2.2 skrll * This product includes software developed by Bill Paul.
20 1.1.2.2 skrll * 4. Neither the name of the author nor the names of any co-contributors
21 1.1.2.2 skrll * may be used to endorse or promote products derived from this software
22 1.1.2.2 skrll * without specific prior written permission.
23 1.1.2.2 skrll *
24 1.1.2.2 skrll * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
25 1.1.2.2 skrll * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 1.1.2.2 skrll * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 1.1.2.2 skrll * ARE DISCLAIMED. IN NO EVENT SHALL Bill Paul, THE VOICES IN HIS HEAD OR
28 1.1.2.2 skrll * THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
29 1.1.2.2 skrll * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
30 1.1.2.2 skrll * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
31 1.1.2.2 skrll * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
32 1.1.2.2 skrll * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
33 1.1.2.2 skrll * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
34 1.1.2.2 skrll * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 1.1.2.2 skrll */
36 1.1.2.2 skrll
37 1.1.2.2 skrll #define CDCE_RX_LIST_CNT 1
38 1.1.2.2 skrll #define CDCE_TX_LIST_CNT 1
39 1.1.2.2 skrll #define CDCE_BUFSZ 1542
40 1.1.2.2 skrll
41 1.1.2.2 skrll struct cdce_type {
42 1.1.2.2 skrll struct usb_devno cdce_dev;
43 1.1.2.2 skrll u_int16_t cdce_flags;
44 1.1.2.2 skrll #define CDCE_ZAURUS 1
45 1.1.2.2 skrll #define CDCE_NO_UNION 2
46 1.1.2.2 skrll };
47 1.1.2.2 skrll
48 1.1.2.2 skrll struct cdce_softc;
49 1.1.2.2 skrll
50 1.1.2.2 skrll struct cdce_chain {
51 1.1.2.2 skrll struct cdce_softc *cdce_sc;
52 1.1.2.2 skrll usbd_xfer_handle cdce_xfer;
53 1.1.2.2 skrll char *cdce_buf;
54 1.1.2.2 skrll struct mbuf *cdce_mbuf;
55 1.1.2.2 skrll int cdce_accum;
56 1.1.2.2 skrll int cdce_idx;
57 1.1.2.2 skrll };
58 1.1.2.2 skrll
59 1.1.2.2 skrll struct cdce_cdata {
60 1.1.2.2 skrll struct cdce_chain cdce_rx_chain[CDCE_RX_LIST_CNT];
61 1.1.2.2 skrll struct cdce_chain cdce_tx_chain[CDCE_TX_LIST_CNT];
62 1.1.2.2 skrll int cdce_tx_prod;
63 1.1.2.2 skrll int cdce_tx_cons;
64 1.1.2.2 skrll int cdce_tx_cnt;
65 1.1.2.2 skrll int cdce_rx_prod;
66 1.1.2.2 skrll };
67 1.1.2.2 skrll
68 1.1.2.2 skrll struct cdce_softc {
69 1.1.2.2 skrll USBBASEDEVICE cdce_dev;
70 1.1.2.2 skrll #if defined(__FreeBSD__)
71 1.1.2.2 skrll struct arpcom arpcom;
72 1.1.2.2 skrll #define GET_IFP(sc) (&(sc)->arpcom.ac_if)
73 1.1.2.2 skrll #elif defined(__NetBSD__)
74 1.1.2.2 skrll struct ethercom cdce_ec;
75 1.1.2.2 skrll #if NRND > 0
76 1.1.2.2 skrll rndsource_element_t rnd_source;
77 1.1.2.2 skrll #endif
78 1.1.2.2 skrll #define GET_IFP(sc) (&(sc)->cdce_ec.ec_if)
79 1.1.2.2 skrll #elif defined(__OpenBSD__)
80 1.1.2.2 skrll struct arpcom arpcom;
81 1.1.2.2 skrll #if NRND > 0
82 1.1.2.2 skrll rndsource_element_t rnd_source;
83 1.1.2.2 skrll #endif
84 1.1.2.2 skrll #define GET_IFP(sc) (&(sc)->arpcom.ac_if)
85 1.1.2.2 skrll #endif
86 1.1.2.2 skrll usbd_device_handle cdce_udev;
87 1.1.2.2 skrll usbd_interface_handle cdce_ctl_iface;
88 1.1.2.2 skrll usbd_interface_handle cdce_data_iface;
89 1.1.2.2 skrll int cdce_bulkin_no;
90 1.1.2.2 skrll usbd_pipe_handle cdce_bulkin_pipe;
91 1.1.2.2 skrll int cdce_bulkout_no;
92 1.1.2.2 skrll usbd_pipe_handle cdce_bulkout_pipe;
93 1.1.2.2 skrll char cdce_dying;
94 1.1.2.2 skrll int cdce_unit;
95 1.1.2.2 skrll struct cdce_cdata cdce_cdata;
96 1.1.2.2 skrll int cdce_rxeof_errors;
97 1.1.2.2 skrll u_int16_t cdce_flags;
98 1.1.2.2 skrll char cdce_attached;
99 1.1.2.2 skrll };
100