Deleted Added
full compact
if_ste.c (142398) if_ste.c (142407)
1/*-
2 * Copyright (c) 1997, 1998, 1999
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, 1999
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/pci/if_ste.c 142398 2005-02-24 21:32:56Z imp $");
34__FBSDID("$FreeBSD: head/sys/pci/if_ste.c 142407 2005-02-24 22:33:05Z imp $");
35
36#include <sys/param.h>
37#include <sys/systm.h>
38#include <sys/sockio.h>
39#include <sys/mbuf.h>
40#include <sys/malloc.h>
41#include <sys/kernel.h>
42#include <sys/module.h>

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

82 * Various supported device vendors/types and their names.
83 */
84static struct ste_type ste_devs[] = {
85 { ST_VENDORID, ST_DEVICEID_ST201, "Sundance ST201 10/100BaseTX" },
86 { DL_VENDORID, DL_DEVICEID_DL10050, "D-Link DL10050 10/100BaseTX" },
87 { 0, 0, NULL }
88};
89
35
36#include <sys/param.h>
37#include <sys/systm.h>
38#include <sys/sockio.h>
39#include <sys/mbuf.h>
40#include <sys/malloc.h>
41#include <sys/kernel.h>
42#include <sys/module.h>

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

82 * Various supported device vendors/types and their names.
83 */
84static struct ste_type ste_devs[] = {
85 { ST_VENDORID, ST_DEVICEID_ST201, "Sundance ST201 10/100BaseTX" },
86 { DL_VENDORID, DL_DEVICEID_DL10050, "D-Link DL10050 10/100BaseTX" },
87 { 0, 0, NULL }
88};
89
90static int ste_probe (device_t);
91static int ste_attach (device_t);
92static int ste_detach (device_t);
93static void ste_init (void *);
94static void ste_intr (void *);
95static void ste_rxeoc (struct ste_softc *);
96static void ste_rxeof (struct ste_softc *);
97static void ste_txeoc (struct ste_softc *);
98static void ste_txeof (struct ste_softc *);
99static void ste_stats_update (void *);
100static void ste_stop (struct ste_softc *);
101static void ste_reset (struct ste_softc *);
102static int ste_ioctl (struct ifnet *, u_long, caddr_t);
103static int ste_encap (struct ste_softc *, struct ste_chain *,
104 struct mbuf *);
105static void ste_start (struct ifnet *);
106static void ste_watchdog (struct ifnet *);
107static void ste_shutdown (device_t);
108static int ste_newbuf (struct ste_softc *,
109 struct ste_chain_onefrag *,
110 struct mbuf *);
111static int ste_ifmedia_upd (struct ifnet *);
112static void ste_ifmedia_sts (struct ifnet *, struct ifmediareq *);
90static int ste_probe(device_t);
91static int ste_attach(device_t);
92static int ste_detach(device_t);
93static void ste_init(void *);
94static void ste_intr(void *);
95static void ste_rxeoc(struct ste_softc *);
96static void ste_rxeof(struct ste_softc *);
97static void ste_txeoc(struct ste_softc *);
98static void ste_txeof(struct ste_softc *);
99static void ste_stats_update(void *);
100static void ste_stop(struct ste_softc *);
101static void ste_reset(struct ste_softc *);
102static int ste_ioctl(struct ifnet *, u_long, caddr_t);
103static int ste_encap(struct ste_softc *, struct ste_chain *, struct mbuf *);
104static void ste_start(struct ifnet *);
105static void ste_watchdog(struct ifnet *);
106static void ste_shutdown(device_t);
107static int ste_newbuf(struct ste_softc *, struct ste_chain_onefrag *,
108 struct mbuf *);
109static int ste_ifmedia_upd(struct ifnet *);
110static void ste_ifmedia_sts(struct ifnet *, struct ifmediareq *);
113
111
114static void ste_mii_sync (struct ste_softc *);
115static void ste_mii_send (struct ste_softc *, u_int32_t, int);
116static int ste_mii_readreg (struct ste_softc *, struct ste_mii_frame *);
117static int ste_mii_writereg (struct ste_softc *, struct ste_mii_frame *);
118static int ste_miibus_readreg (device_t, int, int);
119static int ste_miibus_writereg (device_t, int, int, int);
120static void ste_miibus_statchg (device_t);
112static void ste_mii_sync(struct ste_softc *);
113static void ste_mii_send(struct ste_softc *, u_int32_t, int);
114static int ste_mii_readreg(struct ste_softc *, struct ste_mii_frame *);
115static int ste_mii_writereg(struct ste_softc *, struct ste_mii_frame *);
116static int ste_miibus_readreg(device_t, int, int);
117static int ste_miibus_writereg(device_t, int, int, int);
118static void ste_miibus_statchg(device_t);
121
119
122static int ste_eeprom_wait (struct ste_softc *);
123static int ste_read_eeprom (struct ste_softc *, caddr_t, int, int, int);
124static void ste_wait (struct ste_softc *);
125static void ste_setmulti (struct ste_softc *);
126static int ste_init_rx_list (struct ste_softc *);
127static void ste_init_tx_list (struct ste_softc *);
120static int ste_eeprom_wait(struct ste_softc *);
121static int ste_read_eeprom(struct ste_softc *, caddr_t, int, int, int);
122static void ste_wait(struct ste_softc *);
123static void ste_setmulti(struct ste_softc *);
124static int ste_init_rx_list(struct ste_softc *);
125static void ste_init_tx_list(struct ste_softc *);
128
129#ifdef STE_USEIOSPACE
130#define STE_RES SYS_RES_IOPORT
131#define STE_RID STE_PCI_LOIO
132#else
133#define STE_RES SYS_RES_MEMORY
134#define STE_RID STE_PCI_LOMEM
135#endif

--- 1558 unchanged lines hidden ---
126
127#ifdef STE_USEIOSPACE
128#define STE_RES SYS_RES_IOPORT
129#define STE_RID STE_PCI_LOIO
130#else
131#define STE_RES SYS_RES_MEMORY
132#define STE_RID STE_PCI_LOMEM
133#endif

--- 1558 unchanged lines hidden ---