if_rl.c (49001) | if_rl.c (50107) |
---|---|
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 --- 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 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 --- 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 * $Id: if_rl.c,v 1.19 1999/07/06 19:23:28 des Exp $ | 32 * $Id: if_rl.c,v 1.20 1999/07/22 20:56:49 wpaul Exp $ |
33 */ 34 35/* 36 * RealTek 8129/8139 PCI NIC driver 37 * 38 * Supports several extremely cheap PCI 10/100 adapters based on 39 * the RealTek chipset. Datasheets can be obtained from 40 * www.realtek.com.tw. --- 81 unchanged lines hidden (view full) --- 122 * uniprocessor systems though. 123 */ 124#define RL_USEIOSPACE 125 126#include <pci/if_rlreg.h> 127 128#ifndef lint 129static const char rcsid[] = | 33 */ 34 35/* 36 * RealTek 8129/8139 PCI NIC driver 37 * 38 * Supports several extremely cheap PCI 10/100 adapters based on 39 * the RealTek chipset. Datasheets can be obtained from 40 * www.realtek.com.tw. --- 81 unchanged lines hidden (view full) --- 122 * uniprocessor systems though. 123 */ 124#define RL_USEIOSPACE 125 126#include <pci/if_rlreg.h> 127 128#ifndef lint 129static const char rcsid[] = |
130 "$Id: if_rl.c,v 1.19 1999/07/06 19:23:28 des Exp $"; | 130 "$Id: if_rl.c,v 1.20 1999/07/22 20:56:49 wpaul Exp $"; |
131#endif 132 133/* 134 * Various supported device vendors/types and their names. 135 */ 136static struct rl_type rl_devs[] = { 137 { RT_VENDORID, RT_DEVICEID_8129, 138 "RealTek 8129 10/100BaseTX" }, --- 33 unchanged lines hidden (view full) --- 172static void rl_rxeof __P((struct rl_softc *)); 173static void rl_txeof __P((struct rl_softc *)); 174static void rl_intr __P((void *)); 175static void rl_start __P((struct ifnet *)); 176static int rl_ioctl __P((struct ifnet *, u_long, caddr_t)); 177static void rl_init __P((void *)); 178static void rl_stop __P((struct rl_softc *)); 179static void rl_watchdog __P((struct ifnet *)); | 131#endif 132 133/* 134 * Various supported device vendors/types and their names. 135 */ 136static struct rl_type rl_devs[] = { 137 { RT_VENDORID, RT_DEVICEID_8129, 138 "RealTek 8129 10/100BaseTX" }, --- 33 unchanged lines hidden (view full) --- 172static void rl_rxeof __P((struct rl_softc *)); 173static void rl_txeof __P((struct rl_softc *)); 174static void rl_intr __P((void *)); 175static void rl_start __P((struct ifnet *)); 176static int rl_ioctl __P((struct ifnet *, u_long, caddr_t)); 177static void rl_init __P((void *)); 178static void rl_stop __P((struct rl_softc *)); 179static void rl_watchdog __P((struct ifnet *)); |
180static void rl_shutdown __P((int, void *)); | 180static void rl_shutdown __P((void *, int)); |
181static int rl_ifmedia_upd __P((struct ifnet *)); 182static void rl_ifmedia_sts __P((struct ifnet *, struct ifmediareq *)); 183 184static void rl_eeprom_putbyte __P((struct rl_softc *, int)); 185static void rl_eeprom_getword __P((struct rl_softc *, int, u_int16_t *)); 186static void rl_read_eeprom __P((struct rl_softc *, caddr_t, 187 int, int, int)); 188static void rl_mii_sync __P((struct rl_softc *)); --- 1040 unchanged lines hidden (view full) --- 1229 * Call MI attach routines. 1230 */ 1231 if_attach(ifp); 1232 ether_ifattach(ifp); 1233 1234#if NBPF > 0 1235 bpfattach(ifp, DLT_EN10MB, sizeof(struct ether_header)); 1236#endif | 181static int rl_ifmedia_upd __P((struct ifnet *)); 182static void rl_ifmedia_sts __P((struct ifnet *, struct ifmediareq *)); 183 184static void rl_eeprom_putbyte __P((struct rl_softc *, int)); 185static void rl_eeprom_getword __P((struct rl_softc *, int, u_int16_t *)); 186static void rl_read_eeprom __P((struct rl_softc *, caddr_t, 187 int, int, int)); 188static void rl_mii_sync __P((struct rl_softc *)); --- 1040 unchanged lines hidden (view full) --- 1229 * Call MI attach routines. 1230 */ 1231 if_attach(ifp); 1232 ether_ifattach(ifp); 1233 1234#if NBPF > 0 1235 bpfattach(ifp, DLT_EN10MB, sizeof(struct ether_header)); 1236#endif |
1237 at_shutdown(rl_shutdown, sc, SHUTDOWN_POST_SYNC); | 1237 EVENTHANDLER_REGISTER(shutdown_post_sync, rl_shutdown, sc, 1238 SHUTDOWN_PRI_DEFAULT); |
1238 1239fail: 1240 splx(s); 1241 return; 1242} 1243 1244/* 1245 * Initialize the transmit descriptors. --- 674 unchanged lines hidden (view full) --- 1920 1921 return; 1922} 1923 1924/* 1925 * Stop all chip I/O so that the kernel's probe routines don't 1926 * get confused by errant DMAs when rebooting. 1927 */ | 1239 1240fail: 1241 splx(s); 1242 return; 1243} 1244 1245/* 1246 * Initialize the transmit descriptors. --- 674 unchanged lines hidden (view full) --- 1921 1922 return; 1923} 1924 1925/* 1926 * Stop all chip I/O so that the kernel's probe routines don't 1927 * get confused by errant DMAs when rebooting. 1928 */ |
1928static void rl_shutdown(howto, arg) 1929 int howto; | 1929static void rl_shutdown(arg, howto) |
1930 void *arg; | 1930 void *arg; |
1931 int howto; |
|
1931{ 1932 struct rl_softc *sc = (struct rl_softc *)arg; 1933 1934 rl_stop(sc); 1935 1936 return; 1937} 1938 1939 1940static struct pci_device rl_device = { 1941 "rl", 1942 rl_probe, 1943 rl_attach, 1944 &rl_count, 1945 NULL 1946}; 1947COMPAT_PCI_DRIVER(rl, rl_device); | 1932{ 1933 struct rl_softc *sc = (struct rl_softc *)arg; 1934 1935 rl_stop(sc); 1936 1937 return; 1938} 1939 1940 1941static struct pci_device rl_device = { 1942 "rl", 1943 rl_probe, 1944 rl_attach, 1945 &rl_count, 1946 NULL 1947}; 1948COMPAT_PCI_DRIVER(rl, rl_device); |