if_ruereg.h (187378) | if_ruereg.h (188412) |
---|---|
1/*- 2 * Copyright (c) 2001-2003, Shunsuke Akiyama <akiyama@FreeBSD.org>. 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 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * | 1/*- 2 * Copyright (c) 2001-2003, Shunsuke Akiyama <akiyama@FreeBSD.org>. 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 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * |
26 * $FreeBSD: head/sys/dev/usb2/ethernet/if_ruereg.h 187378 2009-01-18 05:35:58Z thompsa $ | 26 * $FreeBSD: head/sys/dev/usb2/ethernet/if_ruereg.h 188412 2009-02-09 22:02:38Z thompsa $ |
27 */ 28 29#define RUE_CONFIG_IDX 0 /* config number 1 */ 30#define RUE_IFACE_IDX 0 31 32#define RUE_INTR_PKTLEN 0x8 33 34#define RUE_TIMEOUT 50 --- 104 unchanged lines hidden (view full) --- 139#define RUE_EEPROM_IDR5 (RUE_EEPROM_BASE + 0x03) 140#define RUE_EEPROM_INTERVAL (RUE_EEPROM_BASE + 0x17) 141 142#define RUE_RXSTAT_VALID (0x01 << 12) 143#define RUE_RXSTAT_RUNT (0x02 << 12) 144#define RUE_RXSTAT_PMATCH (0x04 << 12) 145#define RUE_RXSTAT_MCAST (0x08 << 12) 146 | 27 */ 28 29#define RUE_CONFIG_IDX 0 /* config number 1 */ 30#define RUE_IFACE_IDX 0 31 32#define RUE_INTR_PKTLEN 0x8 33 34#define RUE_TIMEOUT 50 --- 104 unchanged lines hidden (view full) --- 139#define RUE_EEPROM_IDR5 (RUE_EEPROM_BASE + 0x03) 140#define RUE_EEPROM_INTERVAL (RUE_EEPROM_BASE + 0x17) 141 142#define RUE_RXSTAT_VALID (0x01 << 12) 143#define RUE_RXSTAT_RUNT (0x02 << 12) 144#define RUE_RXSTAT_PMATCH (0x04 << 12) 145#define RUE_RXSTAT_MCAST (0x08 << 12) 146 |
147#define GET_MII(sc) ((sc)->sc_miibus ? \ 148 device_get_softc((sc)->sc_miibus) : NULL) | 147#define GET_MII(sc) usb2_ether_getmii(&(sc)->sc_ue) |
149 150struct rue_intrpkt { 151 uint8_t rue_tsr; 152 uint8_t rue_rsr; 153 uint8_t rue_gep_msr; 154 uint8_t rue_waksr; 155 uint8_t rue_txok_cnt; 156 uint8_t rue_rxlost_cnt; --- 4 unchanged lines hidden (view full) --- 161struct rue_type { 162 uint16_t rue_vid; 163 uint16_t rue_did; 164}; 165 166enum { 167 RUE_BULK_DT_WR, 168 RUE_BULK_DT_RD, | 148 149struct rue_intrpkt { 150 uint8_t rue_tsr; 151 uint8_t rue_rsr; 152 uint8_t rue_gep_msr; 153 uint8_t rue_waksr; 154 uint8_t rue_txok_cnt; 155 uint8_t rue_rxlost_cnt; --- 4 unchanged lines hidden (view full) --- 160struct rue_type { 161 uint16_t rue_vid; 162 uint16_t rue_did; 163}; 164 165enum { 166 RUE_BULK_DT_WR, 167 RUE_BULK_DT_RD, |
169 RUE_BULK_CS_WR, 170 RUE_BULK_CS_RD, | |
171 RUE_INTR_DT_RD, | 168 RUE_INTR_DT_RD, |
172 RUE_INTR_CS_RD, 173 RUE_N_TRANSFER = 6, | 169 RUE_N_TRANSFER, |
174}; 175 176struct rue_softc { | 170}; 171 172struct rue_softc { |
177 struct ifnet *sc_ifp; | 173 struct usb2_ether sc_ue; 174 struct mtx sc_mtx; 175 struct usb2_xfer *sc_xfer[RUE_N_TRANSFER]; |
178 | 176 |
179 struct usb2_config_td sc_config_td; 180 struct usb2_callout sc_watchdog; 181 struct mtx sc_mtx; 182 183 struct usb2_device *sc_udev; 184 struct usb2_xfer *sc_xfer[RUE_N_TRANSFER]; 185 device_t sc_miibus; 186 device_t sc_dev; 187 188 uint32_t sc_unit; 189 uint32_t sc_media_active; 190 uint32_t sc_media_status; 191 192 uint16_t sc_flags; 193#define RUE_FLAG_WAIT_LINK 0x0001 194#define RUE_FLAG_INTR_STALL 0x0002 195#define RUE_FLAG_READ_STALL 0x0004 196#define RUE_FLAG_WRITE_STALL 0x0008 197#define RUE_FLAG_LL_READY 0x0010 198#define RUE_FLAG_HL_READY 0x0020 199 200 uint8_t sc_name[16]; | 177 int sc_flags; 178#define RUE_FLAG_LINK 0x0001 |
201}; | 179}; |
180 181#define RUE_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) 182#define RUE_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) 183#define RUE_LOCK_ASSERT(_sc, t) mtx_assert(&(_sc)->sc_mtx, t) |
|