Deleted Added
full compact
if_cdcereg.h (187378) if_cdcereg.h (188412)
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

--- 15 unchanged lines hidden (view full) ---

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 *
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

--- 15 unchanged lines hidden (view full) ---

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: head/sys/dev/usb2/ethernet/if_cdcereg.h 187378 2009-01-18 05:35:58Z thompsa $
32 * $FreeBSD: head/sys/dev/usb2/ethernet/if_cdcereg.h 188412 2009-02-09 22:02:38Z thompsa $
33 */
34
35#ifndef _USB_IF_CDCEREG_H_
36#define _USB_IF_CDCEREG_H_
37
33 */
34
35#ifndef _USB_IF_CDCEREG_H_
36#define _USB_IF_CDCEREG_H_
37
38#define CDCE_IND_SIZE_MAX 32 /* bytes */
39#define CDCE_512X4_IFQ_MAXLEN MAX((2*CDCE_512X4_FRAMES_MAX), IFQ_MAXLEN)
38#define CDCE_FRAMES_MAX 8 /* units */
39#define CDCE_IND_SIZE_MAX 32 /* bytes */
40
40
41union cdce_eth_rx { /* multiframe header */
42 struct usb2_cdc_mf_eth_512x4_header hdr;
43 uint8_t data[MCLBYTES];
44} __aligned(USB_HOST_ALIGN);
45
46union cdce_eth_tx { /* multiframe header */
47 struct usb2_cdc_mf_eth_512x4_header hdr;
48} __aligned(USB_HOST_ALIGN);
49
50struct cdce_mq { /* mini-queue */
51 struct mbuf *ifq_head;
52 struct mbuf *ifq_tail;
53 uint16_t ifq_len;
54};
55
56enum {
57 CDCE_BULK_A,
58 CDCE_BULK_B,
59 CDCE_INTR,
41enum {
42 CDCE_BULK_A,
43 CDCE_BULK_B,
44 CDCE_INTR,
60 CDCE_N_TRANSFER = 3,
45 CDCE_N_TRANSFER,
61};
62
63struct cdce_softc {
46};
47
48struct cdce_softc {
64 struct ifnet *sc_ifp;
49 struct usb2_ether sc_ue;
50 struct mtx sc_mtx;
51 struct usb2_xfer *sc_xfer[CDCE_N_TRANSFER];
52 struct mbuf *sc_rx_buf[CDCE_FRAMES_MAX];
53 struct mbuf *sc_tx_buf[CDCE_FRAMES_MAX];
65
54
66 union cdce_eth_tx sc_tx;
67 union cdce_eth_rx sc_rx;
68 struct ifmedia sc_ifmedia;
69 struct mtx sc_mtx;
70 struct cdce_mq sc_rx_mq;
71 struct cdce_mq sc_tx_mq;
72
73 struct usb2_xfer *sc_xfer[CDCE_N_TRANSFER];
74 struct usb2_device *sc_udev;
75 device_t sc_dev;
76
77 uint32_t sc_unit;
78
79 uint16_t sc_flags;
55 int sc_flags;
80#define CDCE_FLAG_ZAURUS 0x0001
81#define CDCE_FLAG_NO_UNION 0x0002
56#define CDCE_FLAG_ZAURUS 0x0001
57#define CDCE_FLAG_NO_UNION 0x0002
82#define CDCE_FLAG_LL_READY 0x0004
83#define CDCE_FLAG_HL_READY 0x0008
84#define CDCE_FLAG_RX_DATA 0x0010
85
58#define CDCE_FLAG_RX_DATA 0x0010
59
86 uint8_t sc_name[16];
60 uint8_t sc_eaddr_str_index;
87 uint8_t sc_data_iface_no;
88 uint8_t sc_ifaces_index[2];
61 uint8_t sc_data_iface_no;
62 uint8_t sc_ifaces_index[2];
89 uint8_t sc_iface_protocol;
90};
91
63};
64
65#define CDCE_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx)
66#define CDCE_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx)
67#define CDCE_LOCK_ASSERT(_sc, t) mtx_assert(&(_sc)->sc_mtx, t)
92#endif /* _USB_IF_CDCEREG_H_ */
68#endif /* _USB_IF_CDCEREG_H_ */