Deleted Added
full compact
if_pcn.c (142398) if_pcn.c (142407)
1/*-
2 * Copyright (c) 2000 Berkeley Software Design, Inc.
3 * Copyright (c) 1997, 1998, 1999, 2000
4 * Bill Paul <wpaul@osd.bsdi.com>. All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

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

27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
31 * THE POSSIBILITY OF SUCH DAMAGE.
32 */
33
34#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2000 Berkeley Software Design, Inc.
3 * Copyright (c) 1997, 1998, 1999, 2000
4 * Bill Paul <wpaul@osd.bsdi.com>. All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

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

27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
31 * THE POSSIBILITY OF SUCH DAMAGE.
32 */
33
34#include <sys/cdefs.h>
35__FBSDID("$FreeBSD: head/sys/pci/if_pcn.c 142398 2005-02-24 21:32:56Z imp $");
35__FBSDID("$FreeBSD: head/sys/pci/if_pcn.c 142407 2005-02-24 22:33:05Z imp $");
36
37/*
38 * AMD Am79c972 fast ethernet PCI NIC driver. Datasheets are available
39 * from http://www.amd.com.
40 *
41 * The AMD PCnet/PCI controllers are more advanced and functional
42 * versions of the venerable 7990 LANCE. The PCnet/PCI chips retain
43 * backwards compatibility with the LANCE and thus can be made

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

118 { Am79C972, "Am79C972" },
119 { Am79C973, "Am79C973" },
120 { Am79C978, "Am79C978" },
121 { Am79C975, "Am79C975" },
122 { Am79C976, "Am79C976" },
123 { 0, NULL },
124};
125
36
37/*
38 * AMD Am79c972 fast ethernet PCI NIC driver. Datasheets are available
39 * from http://www.amd.com.
40 *
41 * The AMD PCnet/PCI controllers are more advanced and functional
42 * versions of the venerable 7990 LANCE. The PCnet/PCI chips retain
43 * backwards compatibility with the LANCE and thus can be made

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

118 { Am79C972, "Am79C972" },
119 { Am79C973, "Am79C973" },
120 { Am79C978, "Am79C978" },
121 { Am79C975, "Am79C975" },
122 { Am79C976, "Am79C976" },
123 { 0, NULL },
124};
125
126static char * pcn_chipid_name(u_int32_t);
127static u_int32_t pcn_chip_id (device_t);
126static char * pcn_chipid_name(u_int32_t);
127static u_int32_t pcn_chip_id(device_t);
128
128
129static u_int32_t pcn_csr_read (struct pcn_softc *, int);
130static u_int16_t pcn_csr_read16 (struct pcn_softc *, int);
131static u_int16_t pcn_bcr_read16 (struct pcn_softc *, int);
132static void pcn_csr_write (struct pcn_softc *, int, int);
133static u_int32_t pcn_bcr_read (struct pcn_softc *, int);
134static void pcn_bcr_write (struct pcn_softc *, int, int);
129static u_int32_t pcn_csr_read(struct pcn_softc *, int);
130static u_int16_t pcn_csr_read16(struct pcn_softc *, int);
131static u_int16_t pcn_bcr_read16(struct pcn_softc *, int);
132static void pcn_csr_write(struct pcn_softc *, int, int);
133static u_int32_t pcn_bcr_read(struct pcn_softc *, int);
134static void pcn_bcr_write(struct pcn_softc *, int, int);
135
135
136static int pcn_probe (device_t);
137static int pcn_attach (device_t);
138static int pcn_detach (device_t);
136static int pcn_probe(device_t);
137static int pcn_attach(device_t);
138static int pcn_detach(device_t);
139
139
140static int pcn_newbuf (struct pcn_softc *, int, struct mbuf *);
141static int pcn_encap (struct pcn_softc *,
142 struct mbuf *, u_int32_t *);
143static void pcn_rxeof (struct pcn_softc *);
144static void pcn_txeof (struct pcn_softc *);
145static void pcn_intr (void *);
146static void pcn_tick (void *);
147static void pcn_start (struct ifnet *);
148static int pcn_ioctl (struct ifnet *, u_long, caddr_t);
149static void pcn_init (void *);
150static void pcn_stop (struct pcn_softc *);
151static void pcn_watchdog (struct ifnet *);
152static void pcn_shutdown (device_t);
153static int pcn_ifmedia_upd (struct ifnet *);
154static void pcn_ifmedia_sts (struct ifnet *, struct ifmediareq *);
140static int pcn_newbuf(struct pcn_softc *, int, struct mbuf *);
141static int pcn_encap(struct pcn_softc *, struct mbuf *, u_int32_t *);
142static void pcn_rxeof(struct pcn_softc *);
143static void pcn_txeof(struct pcn_softc *);
144static void pcn_intr(void *);
145static void pcn_tick(void *);
146static void pcn_start(struct ifnet *);
147static int pcn_ioctl(struct ifnet *, u_long, caddr_t);
148static void pcn_init(void *);
149static void pcn_stop(struct pcn_softc *);
150static void pcn_watchdog(struct ifnet *);
151static void pcn_shutdown(device_t);
152static int pcn_ifmedia_upd(struct ifnet *);
153static void pcn_ifmedia_sts(struct ifnet *, struct ifmediareq *);
155
154
156static int pcn_miibus_readreg (device_t, int, int);
157static int pcn_miibus_writereg (device_t, int, int, int);
158static void pcn_miibus_statchg (device_t);
155static int pcn_miibus_readreg(device_t, int, int);
156static int pcn_miibus_writereg(device_t, int, int, int);
157static void pcn_miibus_statchg(device_t);
159
158
160static void pcn_setfilt (struct ifnet *);
161static void pcn_setmulti (struct pcn_softc *);
162static void pcn_reset (struct pcn_softc *);
163static int pcn_list_rx_init (struct pcn_softc *);
164static int pcn_list_tx_init (struct pcn_softc *);
159static void pcn_setfilt(struct ifnet *);
160static void pcn_setmulti(struct pcn_softc *);
161static void pcn_reset(struct pcn_softc *);
162static int pcn_list_rx_init(struct pcn_softc *);
163static int pcn_list_tx_init(struct pcn_softc *);
165
166#ifdef PCN_USEIOSPACE
167#define PCN_RES SYS_RES_IOPORT
168#define PCN_RID PCN_PCI_LOIO
169#else
170#define PCN_RES SYS_RES_MEMORY
171#define PCN_RID PCN_PCI_LOMEM
172#endif

--- 1273 unchanged lines hidden ---
164
165#ifdef PCN_USEIOSPACE
166#define PCN_RES SYS_RES_IOPORT
167#define PCN_RID PCN_PCI_LOIO
168#else
169#define PCN_RES SYS_RES_MEMORY
170#define PCN_RID PCN_PCI_LOMEM
171#endif

--- 1273 unchanged lines hidden ---