Deleted Added
full compact
if_kuereg.h (187378) if_kuereg.h (188412)
1/*-
2 * Copyright (c) 1997, 1998, 1999, 2000
3 * Bill Paul <wpaul@ee.columbia.edu>. 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 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
30 * THE POSSIBILITY OF SUCH DAMAGE.
31 *
1/*-
2 * Copyright (c) 1997, 1998, 1999, 2000
3 * Bill Paul <wpaul@ee.columbia.edu>. 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 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
30 * THE POSSIBILITY OF SUCH DAMAGE.
31 *
32 * $FreeBSD: head/sys/dev/usb2/ethernet/if_kuereg.h 187378 2009-01-18 05:35:58Z thompsa $
32 * $FreeBSD: head/sys/dev/usb2/ethernet/if_kuereg.h 188412 2009-02-09 22:02:38Z thompsa $
33 */
34
35/*
36 * Definitions for the KLSI KL5KUSB101B USB to ethernet controller.
37 * The KLSI part is controlled via vendor control requests, the structure
38 * of which depend a bit on the firmware running on the internal
39 * microcontroller. The one exception is the 'send scan data' command,
40 * which is used to load the firmware.

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

62 uint8_t kue_maxseg[2];
63 uint8_t kue_mcastfilt[2];
64 uint8_t kue_rsvd2;
65} __packed;
66
67#define KUE_ETHERSTATS(x) UGETDW((x)->sc_desc.kue_etherstats)
68#define KUE_MAXSEG(x) UGETW((x)->sc_desc.kue_maxseg)
69#define KUE_MCFILTCNT(x) (UGETW((x)->sc_desc.kue_mcastfilt) & 0x7FFF)
33 */
34
35/*
36 * Definitions for the KLSI KL5KUSB101B USB to ethernet controller.
37 * The KLSI part is controlled via vendor control requests, the structure
38 * of which depend a bit on the firmware running on the internal
39 * microcontroller. The one exception is the 'send scan data' command,
40 * which is used to load the firmware.

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

62 uint8_t kue_maxseg[2];
63 uint8_t kue_mcastfilt[2];
64 uint8_t kue_rsvd2;
65} __packed;
66
67#define KUE_ETHERSTATS(x) UGETDW((x)->sc_desc.kue_etherstats)
68#define KUE_MAXSEG(x) UGETW((x)->sc_desc.kue_maxseg)
69#define KUE_MCFILTCNT(x) (UGETW((x)->sc_desc.kue_mcastfilt) & 0x7FFF)
70#define KUE_MCFILT_MAX (USB_ETHER_HASH_MAX / ETHER_ADDR_LEN)
70#define KUE_MCFILT(x, y) \
71 (char *)&(sc->sc_mcfilters[y * ETHER_ADDR_LEN])
71
72#define KUE_STAT_TX_OK 0x00000001
73#define KUE_STAT_RX_OK 0x00000002
74#define KUE_STAT_TX_ERR 0x00000004
75#define KUE_STAT_RX_ERR 0x00000008
76#define KUE_STAT_RX_NOBUF 0x00000010
77#define KUE_STAT_TX_UCAST_BYTES 0x00000020
78#define KUE_STAT_TX_UCAST_FRAMES 0x00000040

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

114#define KUE_CONFIG_IDX 0 /* config number 1 */
115#define KUE_IFACE_IDX 0
116
117/* The interrupt endpoint is currently unused by the KLSI part. */
118#define KUE_ENDPT_MAX 4
119enum {
120 KUE_BULK_DT_WR,
121 KUE_BULK_DT_RD,
72
73#define KUE_STAT_TX_OK 0x00000001
74#define KUE_STAT_RX_OK 0x00000002
75#define KUE_STAT_TX_ERR 0x00000004
76#define KUE_STAT_RX_ERR 0x00000008
77#define KUE_STAT_RX_NOBUF 0x00000010
78#define KUE_STAT_TX_UCAST_BYTES 0x00000020
79#define KUE_STAT_TX_UCAST_FRAMES 0x00000040

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

115#define KUE_CONFIG_IDX 0 /* config number 1 */
116#define KUE_IFACE_IDX 0
117
118/* The interrupt endpoint is currently unused by the KLSI part. */
119#define KUE_ENDPT_MAX 4
120enum {
121 KUE_BULK_DT_WR,
122 KUE_BULK_DT_RD,
122 KUE_BULK_CS_WR,
123 KUE_BULK_CS_RD,
124 KUE_N_TRANSFER = 4,
123 KUE_N_TRANSFER,
125};
126
127struct kue_softc {
124};
125
126struct kue_softc {
128 struct ifnet *sc_ifp;
127 struct usb2_ether sc_ue;
128 struct mtx sc_mtx;
129 struct kue_ether_desc sc_desc;
130 struct usb2_xfer *sc_xfer[KUE_N_TRANSFER];
131 uint8_t *sc_mcfilters;
129
132
130 struct usb2_config_td sc_config_td;
131 struct usb2_callout sc_watchdog;
132 struct mtx sc_mtx;
133 struct kue_ether_desc sc_desc;
133 int sc_flags;
134#define KUE_FLAG_LINK 0x0001
134
135
135 device_t sc_dev;
136 struct usb2_device *sc_udev;
137 struct usb2_xfer *sc_xfer[KUE_N_TRANSFER];
138
139 uint32_t sc_unit;
140
141 uint16_t sc_mcfilt_max;
142 uint16_t sc_flags;
143#define KUE_FLAG_READ_STALL 0x0010 /* wait for clearing of stall */
144#define KUE_FLAG_WRITE_STALL 0x0020 /* wait for clearing of stall */
145#define KUE_FLAG_LL_READY 0x0040 /* Lower Layer Ready */
146#define KUE_FLAG_HL_READY 0x0080 /* Higher Layer Ready */
147#define KUE_FLAG_INTR_STALL 0x0100 /* wait for clearing of stall */
136 uint16_t sc_rxfilt;
148};
137};
138
139#define KUE_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx)
140#define KUE_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx)
141#define KUE_LOCK_ASSERT(_sc, t) mtx_assert(&(_sc)->sc_mtx, t)