Deleted Added
full compact
if_ti.c (90548) if_ti.c (92739)
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

--- 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, 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

--- 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 * $FreeBSD: head/sys/dev/ti/if_ti.c 90548 2002-02-11 23:38:30Z silby $
32 * $FreeBSD: head/sys/dev/ti/if_ti.c 92739 2002-03-20 02:08:01Z alfred $
33 */
34
35/*
36 * Alteon Networks Tigon PCI gigabit ethernet driver for FreeBSD.
37 * Manuals, sample driver and firmware source kits are available
38 * from http://www.alteon.com/support/openkits.
39 *
40 * Written by Bill Paul <wpaul@ctr.columbia.edu>

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

115#include <pci/if_tireg.h>
116#include <pci/ti_fw.h>
117#include <pci/ti_fw2.h>
118
119#define TI_CSUM_FEATURES (CSUM_IP | CSUM_TCP | CSUM_UDP | CSUM_IP_FRAGS)
120
121#if !defined(lint)
122static const char rcsid[] =
33 */
34
35/*
36 * Alteon Networks Tigon PCI gigabit ethernet driver for FreeBSD.
37 * Manuals, sample driver and firmware source kits are available
38 * from http://www.alteon.com/support/openkits.
39 *
40 * Written by Bill Paul <wpaul@ctr.columbia.edu>

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

115#include <pci/if_tireg.h>
116#include <pci/ti_fw.h>
117#include <pci/ti_fw2.h>
118
119#define TI_CSUM_FEATURES (CSUM_IP | CSUM_TCP | CSUM_UDP | CSUM_IP_FRAGS)
120
121#if !defined(lint)
122static const char rcsid[] =
123 "$FreeBSD: head/sys/dev/ti/if_ti.c 90548 2002-02-11 23:38:30Z silby $";
123 "$FreeBSD: head/sys/dev/ti/if_ti.c 92739 2002-03-20 02:08:01Z alfred $";
124#endif
125
126/*
127 * Various supported device vendors/types and their names.
128 */
129
130static struct ti_type ti_devs[] = {
131 { ALT_VENDORID, ALT_DEVICEID_ACENIC,

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

140 "Netgear GA620 1000baseT Gigabit Ethernet" },
141 { SGI_VENDORID, SGI_DEVICEID_TIGON,
142 "Silicon Graphics Gigabit Ethernet" },
143 { DEC_VENDORID, DEC_DEVICEID_FARALLON_PN9000SX,
144 "Farallon PN9000SX Gigabit Ethernet" },
145 { 0, 0, NULL }
146};
147
124#endif
125
126/*
127 * Various supported device vendors/types and their names.
128 */
129
130static struct ti_type ti_devs[] = {
131 { ALT_VENDORID, ALT_DEVICEID_ACENIC,

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

140 "Netgear GA620 1000baseT Gigabit Ethernet" },
141 { SGI_VENDORID, SGI_DEVICEID_TIGON,
142 "Silicon Graphics Gigabit Ethernet" },
143 { DEC_VENDORID, DEC_DEVICEID_FARALLON_PN9000SX,
144 "Farallon PN9000SX Gigabit Ethernet" },
145 { 0, 0, NULL }
146};
147
148static int ti_probe __P((device_t));
149static int ti_attach __P((device_t));
150static int ti_detach __P((device_t));
151static void ti_txeof __P((struct ti_softc *));
152static void ti_rxeof __P((struct ti_softc *));
148static int ti_probe (device_t);
149static int ti_attach (device_t);
150static int ti_detach (device_t);
151static void ti_txeof (struct ti_softc *);
152static void ti_rxeof (struct ti_softc *);
153
153
154static void ti_stats_update __P((struct ti_softc *));
155static int ti_encap __P((struct ti_softc *, struct mbuf *,
156 u_int32_t *));
154static void ti_stats_update (struct ti_softc *);
155static int ti_encap (struct ti_softc *, struct mbuf *, u_int32_t *);
157
156
158static void ti_intr __P((void *));
159static void ti_start __P((struct ifnet *));
160static int ti_ioctl __P((struct ifnet *, u_long, caddr_t));
161static void ti_init __P((void *));
162static void ti_init2 __P((struct ti_softc *));
163static void ti_stop __P((struct ti_softc *));
164static void ti_watchdog __P((struct ifnet *));
165static void ti_shutdown __P((device_t));
166static int ti_ifmedia_upd __P((struct ifnet *));
167static void ti_ifmedia_sts __P((struct ifnet *, struct ifmediareq *));
157static void ti_intr (void *);
158static void ti_start (struct ifnet *);
159static int ti_ioctl (struct ifnet *, u_long, caddr_t);
160static void ti_init (void *);
161static void ti_init2 (struct ti_softc *);
162static void ti_stop (struct ti_softc *);
163static void ti_watchdog (struct ifnet *);
164static void ti_shutdown (device_t);
165static int ti_ifmedia_upd (struct ifnet *);
166static void ti_ifmedia_sts (struct ifnet *, struct ifmediareq *);
168
167
169static u_int32_t ti_eeprom_putbyte __P((struct ti_softc *, int));
170static u_int8_t ti_eeprom_getbyte __P((struct ti_softc *,
171 int, u_int8_t *));
172static int ti_read_eeprom __P((struct ti_softc *, caddr_t, int, int));
168static u_int32_t ti_eeprom_putbyte (struct ti_softc *, int);
169static u_int8_t ti_eeprom_getbyte (struct ti_softc *, int, u_int8_t *);
170static int ti_read_eeprom (struct ti_softc *, caddr_t, int, int);
173
171
174static void ti_add_mcast __P((struct ti_softc *, struct ether_addr *));
175static void ti_del_mcast __P((struct ti_softc *, struct ether_addr *));
176static void ti_setmulti __P((struct ti_softc *));
172static void ti_add_mcast (struct ti_softc *, struct ether_addr *);
173static void ti_del_mcast (struct ti_softc *, struct ether_addr *);
174static void ti_setmulti (struct ti_softc *);
177
175
178static void ti_mem __P((struct ti_softc *, u_int32_t,
179 u_int32_t, caddr_t));
180static void ti_loadfw __P((struct ti_softc *));
181static void ti_cmd __P((struct ti_softc *, struct ti_cmd_desc *));
182static void ti_cmd_ext __P((struct ti_softc *, struct ti_cmd_desc *,
183 caddr_t, int));
184static void ti_handle_events __P((struct ti_softc *));
185static int ti_alloc_jumbo_mem __P((struct ti_softc *));
186static void *ti_jalloc __P((struct ti_softc *));
187static void ti_jfree __P((caddr_t, void *));
188static int ti_newbuf_std __P((struct ti_softc *, int, struct mbuf *));
189static int ti_newbuf_mini __P((struct ti_softc *, int, struct mbuf *));
190static int ti_newbuf_jumbo __P((struct ti_softc *, int, struct mbuf *));
191static int ti_init_rx_ring_std __P((struct ti_softc *));
192static void ti_free_rx_ring_std __P((struct ti_softc *));
193static int ti_init_rx_ring_jumbo __P((struct ti_softc *));
194static void ti_free_rx_ring_jumbo __P((struct ti_softc *));
195static int ti_init_rx_ring_mini __P((struct ti_softc *));
196static void ti_free_rx_ring_mini __P((struct ti_softc *));
197static void ti_free_tx_ring __P((struct ti_softc *));
198static int ti_init_tx_ring __P((struct ti_softc *));
176static void ti_mem (struct ti_softc *, u_int32_t,
177 u_int32_t, caddr_t);
178static void ti_loadfw (struct ti_softc *);
179static void ti_cmd (struct ti_softc *, struct ti_cmd_desc *);
180static void ti_cmd_ext (struct ti_softc *, struct ti_cmd_desc *,
181 caddr_t, int);
182static void ti_handle_events (struct ti_softc *);
183static int ti_alloc_jumbo_mem (struct ti_softc *);
184static void *ti_jalloc (struct ti_softc *);
185static void ti_jfree (caddr_t, void *);
186static int ti_newbuf_std (struct ti_softc *, int, struct mbuf *);
187static int ti_newbuf_mini (struct ti_softc *, int, struct mbuf *);
188static int ti_newbuf_jumbo (struct ti_softc *, int, struct mbuf *);
189static int ti_init_rx_ring_std (struct ti_softc *);
190static void ti_free_rx_ring_std (struct ti_softc *);
191static int ti_init_rx_ring_jumbo (struct ti_softc *);
192static void ti_free_rx_ring_jumbo (struct ti_softc *);
193static int ti_init_rx_ring_mini (struct ti_softc *);
194static void ti_free_rx_ring_mini (struct ti_softc *);
195static void ti_free_tx_ring (struct ti_softc *);
196static int ti_init_tx_ring (struct ti_softc *);
199
197
200static int ti_64bitslot_war __P((struct ti_softc *));
201static int ti_chipinit __P((struct ti_softc *));
202static int ti_gibinit __P((struct ti_softc *));
198static int ti_64bitslot_war (struct ti_softc *);
199static int ti_chipinit (struct ti_softc *);
200static int ti_gibinit (struct ti_softc *);
203
204static device_method_t ti_methods[] = {
205 /* Device interface */
206 DEVMETHOD(device_probe, ti_probe),
207 DEVMETHOD(device_attach, ti_attach),
208 DEVMETHOD(device_detach, ti_detach),
209 DEVMETHOD(device_shutdown, ti_shutdown),
210 { 0, 0 }

--- 2281 unchanged lines hidden ---
201
202static device_method_t ti_methods[] = {
203 /* Device interface */
204 DEVMETHOD(device_probe, ti_probe),
205 DEVMETHOD(device_attach, ti_attach),
206 DEVMETHOD(device_detach, ti_detach),
207 DEVMETHOD(device_shutdown, ti_shutdown),
208 { 0, 0 }

--- 2281 unchanged lines hidden ---