i82586.h (6875d25465631b7563f1b90e6b05e2640dc81f4e) i82586.h (c1087c13240442926a34afa825b4dd3993868549)
1/*-
2 * Copyright (c) 1992, University of Vermont and State Agricultural College.
3 * Copyright (c) 1992, Garrett A. Wollman.
4 * 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:

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

26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE.
33 *
1/*-
2 * Copyright (c) 1992, University of Vermont and State Agricultural College.
3 * Copyright (c) 1992, Garrett A. Wollman.
4 * 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:

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

26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE.
33 *
34 * $Id$
34 * $Id: i82586.h,v 1.5 1997/02/22 09:38:02 peter Exp $
35 */
36
37/*
38 * Intel 82586 Ethernet chip
39 * Register, bit, and structure definitions.
40 *
41 * Written by GAW with reference to the Clarkson Packet Driver code for this
42 * chip written by Russ Nelson and others.

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

287 u_char ie_junk; /* stuff for 82596 (0xff) */
288};
289
290/*
291 * Here are a few useful functions. We could have done these as macros,
292 * but since we have the inline facility, it makes sense to use that
293 * instead.
294 */
35 */
36
37/*
38 * Intel 82586 Ethernet chip
39 * Register, bit, and structure definitions.
40 *
41 * Written by GAW with reference to the Clarkson Packet Driver code for this
42 * chip written by Russ Nelson and others.

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

287 u_char ie_junk; /* stuff for 82596 (0xff) */
288};
289
290/*
291 * Here are a few useful functions. We could have done these as macros,
292 * but since we have the inline facility, it makes sense to use that
293 * instead.
294 */
295static inline void
295static __inline void
296ie_setup_config(volatile struct ie_config_cmd *cmd,
297 int promiscuous, int manchester) {
298 cmd->ie_config_count = 0x0c;
299 cmd->ie_fifo = 8;
300 cmd->ie_save_bad = 0x40;
301 cmd->ie_addr_len = 0x2e;
302 cmd->ie_priority = 0;
303 cmd->ie_ifs = 0x60;
304 cmd->ie_slot_low = 0;
305 cmd->ie_slot_high = 0xf2;
306 cmd->ie_promisc = !!promiscuous | manchester << 2;
307 cmd->ie_crs_cdt = 0;
308 cmd->ie_min_len = 64;
309 cmd->ie_junk = 0xff;
310}
311
296ie_setup_config(volatile struct ie_config_cmd *cmd,
297 int promiscuous, int manchester) {
298 cmd->ie_config_count = 0x0c;
299 cmd->ie_fifo = 8;
300 cmd->ie_save_bad = 0x40;
301 cmd->ie_addr_len = 0x2e;
302 cmd->ie_priority = 0;
303 cmd->ie_ifs = 0x60;
304 cmd->ie_slot_low = 0;
305 cmd->ie_slot_high = 0xf2;
306 cmd->ie_promisc = !!promiscuous | manchester << 2;
307 cmd->ie_crs_cdt = 0;
308 cmd->ie_min_len = 64;
309 cmd->ie_junk = 0xff;
310}
311
312static inline caddr_t
312static __inline caddr_t
313Align(caddr_t ptr) {
314 unsigned long l = (unsigned long)ptr;
315 l = (l + 3) & ~3L;
316 return (caddr_t)l;
317}
318
313Align(caddr_t ptr) {
314 unsigned long l = (unsigned long)ptr;
315 l = (l + 3) & ~3L;
316 return (caddr_t)l;
317}
318
319static inline void
319static __inline void
320ie_ack(volatile struct ie_sys_ctl_block *scb,
321 u_int mask, int unit,
322 void (*ca)(int)) {
323 scb->ie_command = scb->ie_status & mask;
324 (*ca)(unit);
325}
320ie_ack(volatile struct ie_sys_ctl_block *scb,
321 u_int mask, int unit,
322 void (*ca)(int)) {
323 scb->ie_command = scb->ie_status & mask;
324 (*ca)(unit);
325}