if_vr.c (142398) | if_vr.c (142407) |
---|---|
1/*- 2 * Copyright (c) 1997, 1998 3 * Bill Paul <wpaul@ctr.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 --- 17 unchanged lines hidden (view full) --- 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 33#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1997, 1998 3 * Bill Paul <wpaul@ctr.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 --- 17 unchanged lines hidden (view full) --- 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 33#include <sys/cdefs.h> |
34__FBSDID("$FreeBSD: head/sys/dev/vr/if_vr.c 142398 2005-02-24 21:32:56Z imp $"); | 34__FBSDID("$FreeBSD: head/sys/dev/vr/if_vr.c 142407 2005-02-24 22:33:05Z imp $"); |
35 36/* 37 * VIA Rhine fast ethernet PCI NIC driver 38 * 39 * Supports various network adapters based on the VIA Rhine 40 * and Rhine II PCI controllers, including the D-Link DFE530TX. 41 * Datasheets are available at http://www.via.com.tw. 42 * --- 78 unchanged lines hidden (view full) --- 121 "VIA VT6105M Rhine III 10/100BaseTX" }, 122 { DELTA_VENDORID, DELTA_DEVICEID_RHINE_II, 123 "Delta Electronics Rhine II 10/100BaseTX" }, 124 { ADDTRON_VENDORID, ADDTRON_DEVICEID_RHINE_II, 125 "Addtron Technology Rhine II 10/100BaseTX" }, 126 { 0, 0, NULL } 127}; 128 | 35 36/* 37 * VIA Rhine fast ethernet PCI NIC driver 38 * 39 * Supports various network adapters based on the VIA Rhine 40 * and Rhine II PCI controllers, including the D-Link DFE530TX. 41 * Datasheets are available at http://www.via.com.tw. 42 * --- 78 unchanged lines hidden (view full) --- 121 "VIA VT6105M Rhine III 10/100BaseTX" }, 122 { DELTA_VENDORID, DELTA_DEVICEID_RHINE_II, 123 "Delta Electronics Rhine II 10/100BaseTX" }, 124 { ADDTRON_VENDORID, ADDTRON_DEVICEID_RHINE_II, 125 "Addtron Technology Rhine II 10/100BaseTX" }, 126 { 0, 0, NULL } 127}; 128 |
129static int vr_probe (device_t); 130static int vr_attach (device_t); 131static int vr_detach (device_t); | 129static int vr_probe(device_t); 130static int vr_attach(device_t); 131static int vr_detach(device_t); |
132 | 132 |
133static int vr_newbuf (struct vr_softc *, 134 struct vr_chain_onefrag *, 135 struct mbuf *); 136static int vr_encap (struct vr_softc *, struct vr_chain *, 137 struct mbuf * ); | 133static int vr_newbuf(struct vr_softc *, struct vr_chain_onefrag *, 134 struct mbuf *); 135static int vr_encap(struct vr_softc *, struct vr_chain *, struct mbuf * ); |
138 | 136 |
139static void vr_rxeof (struct vr_softc *); 140static void vr_rxeoc (struct vr_softc *); 141static void vr_txeof (struct vr_softc *); 142static void vr_tick (void *); 143static void vr_intr (void *); 144static void vr_start (struct ifnet *); 145static void vr_start_locked (struct ifnet *); 146static int vr_ioctl (struct ifnet *, u_long, caddr_t); 147static void vr_init (void *); 148static void vr_init_locked (struct vr_softc *); 149static void vr_stop (struct vr_softc *); 150static void vr_watchdog (struct ifnet *); 151static void vr_shutdown (device_t); 152static int vr_ifmedia_upd (struct ifnet *); 153static void vr_ifmedia_sts (struct ifnet *, struct ifmediareq *); | 137static void vr_rxeof(struct vr_softc *); 138static void vr_rxeoc(struct vr_softc *); 139static void vr_txeof(struct vr_softc *); 140static void vr_tick(void *); 141static void vr_intr(void *); 142static void vr_start(struct ifnet *); 143static void vr_start_locked(struct ifnet *); 144static int vr_ioctl(struct ifnet *, u_long, caddr_t); 145static void vr_init(void *); 146static void vr_init_locked(struct vr_softc *); 147static void vr_stop(struct vr_softc *); 148static void vr_watchdog(struct ifnet *); 149static void vr_shutdown(device_t); 150static int vr_ifmedia_upd(struct ifnet *); 151static void vr_ifmedia_sts(struct ifnet *, struct ifmediareq *); |
154 155#ifdef VR_USESWSHIFT | 152 153#ifdef VR_USESWSHIFT |
156static void vr_mii_sync (struct vr_softc *); 157static void vr_mii_send (struct vr_softc *, uint32_t, int); | 154static void vr_mii_sync(struct vr_softc *); 155static void vr_mii_send(struct vr_softc *, uint32_t, int); |
158#endif | 156#endif |
159static int vr_mii_readreg (struct vr_softc *, struct vr_mii_frame *); 160static int vr_mii_writereg (struct vr_softc *, struct vr_mii_frame *); 161static int vr_miibus_readreg (device_t, uint16_t, uint16_t); 162static int vr_miibus_writereg (device_t, uint16_t, uint16_t, uint16_t); 163static void vr_miibus_statchg (device_t); | 157static int vr_mii_readreg(struct vr_softc *, struct vr_mii_frame *); 158static int vr_mii_writereg(struct vr_softc *, struct vr_mii_frame *); 159static int vr_miibus_readreg(device_t, uint16_t, uint16_t); 160static int vr_miibus_writereg(device_t, uint16_t, uint16_t, uint16_t); 161static void vr_miibus_statchg(device_t); |
164 | 162 |
165static void vr_setcfg (struct vr_softc *, int); 166static void vr_setmulti (struct vr_softc *); 167static void vr_reset (struct vr_softc *); 168static int vr_list_rx_init (struct vr_softc *); 169static int vr_list_tx_init (struct vr_softc *); | 163static void vr_setcfg(struct vr_softc *, int); 164static void vr_setmulti(struct vr_softc *); 165static void vr_reset(struct vr_softc *); 166static int vr_list_rx_init(struct vr_softc *); 167static int vr_list_tx_init(struct vr_softc *); |
170 171#ifdef VR_USEIOSPACE 172#define VR_RES SYS_RES_IOPORT 173#define VR_RID VR_PCI_LOIO 174#else 175#define VR_RES SYS_RES_MEMORY 176#define VR_RID VR_PCI_LOMEM 177#endif --- 1527 unchanged lines hidden --- | 168 169#ifdef VR_USEIOSPACE 170#define VR_RES SYS_RES_IOPORT 171#define VR_RID VR_PCI_LOIO 172#else 173#define VR_RES SYS_RES_MEMORY 174#define VR_RID VR_PCI_LOMEM 175#endif --- 1527 unchanged lines hidden --- |