📄 i82586reg.h
字号:
/* $NetBSD: i82586reg.h,v 1.7 1998/02/28 01:07:45 pk Exp $ *//*- * Copyright (c) 1998 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation * by Paul Kranenburg. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the NetBSD * Foundation, Inc. and its contributors. * 4. Neither the name of The NetBSD Foundation nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. *//*- * Copyright (c) 1992, University of Vermont and State Agricultural College. * Copyright (c) 1992, Garrett A. Wollman. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * Vermont and State Agricultural College and Garrett A. Wollman. * 4. Neither the name of the University nor the name of the author * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY OR AUTHOR BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. *//* * Intel 82586 Ethernet chip * Register, bit, and structure definitions. * * Written by GAW with reference to the Clarkson Packet Driver code for this * chip written by Russ Nelson and others. *//* * NOTE, the structure definitions in here are for reference only. * We use integer offsets exclusively to access the i82586 data structures. *//* * This is the master configuration block. * It tells the hardware where all the rest of the stuff is. *-struct __ie_sys_conf_ptr { u_int16_t mbz; // must be zero u_int8_t ie_bus_use; // true if 8-bit only u_int8_t mbz2[5]; // must be zero u_int32_t ie_iscp_ptr; // 24-bit physaddr of ISCP}; */#define IE_SCP_SZ 12#define IE_SCP_BUS_USE(base) ((base) + 2)#define IE_SCP_ISCP(base) ((base) + 8)/* * Note that this is wired in hardware; the SCP is always located here, no * matter what. */#define IE_SCP_ADDR 0xfffff4/* * The tells the hardware where all the rest of the stuff is, too. * FIXME: some of these should be re-commented after we figure out their * REAL function. *-struct __ie_int_sys_conf_ptr { u_int8_t ie_busy; // zeroed after init u_int8_t mbz; u_int16_t ie_scb_offset; // 16-bit physaddr of next struct caddr_t ie_base; // 24-bit physaddr for all 16-bit vars}; */#define IE_ISCP_SZ 8#define IE_ISCP_BUSY(base) ((base) + 0)#define IE_ISCP_SCB(base) ((base) + 2)#define IE_ISCP_BASE(base) ((base) + 4)/* * This FINALLY tells the hardware what to do and where to put it. *-struct __ie_sys_ctl_block { u_int16_t ie_status; // status word u_int16_t ie_command; // command word u_int16_t ie_command_list; // 16-pointer to command block list u_int16_t ie_recv_list; // 16-pointer to receive frame list u_int16_t ie_err_crc; // CRC errors u_int16_t ie_err_align; // Alignment errors u_int16_t ie_err_resource; // Resource errors u_int16_t ie_err_overrun; // Overrun errors}; */#define IE_SCB_SZ 16#define IE_SCB_STATUS(base) ((base) + 0)#define IE_SCB_CMD(base) ((base) + 2)#define IE_SCB_CMDLST(base) ((base) + 4)#define IE_SCB_RCVLST(base) ((base) + 6)#define IE_SCB_ERRCRC(base) ((base) + 8)#define IE_SCB_ERRALN(base) ((base) + 10)#define IE_SCB_ERRRES(base) ((base) + 12)#define IE_SCB_ERROVR(base) ((base) + 14)/* Command values */#define IE_RUC_MASK 0x0070 /* mask for RU command */#define IE_RUC_NOP 0 /* for completeness */#define IE_RUC_START 0x0010 /* start receive unit command */#define IE_RUC_RESUME 0x0020 /* resume a suspended receiver command */#define IE_RUC_SUSPEND 0x0030 /* suspend receiver command */#define IE_RUC_ABORT 0x0040 /* abort current receive operation */#define IE_CUC_MASK 0x0700 /* mask for CU command */#define IE_CUC_NOP 0 /* included for completeness */#define IE_CUC_START 0x0100 /* do-command command */#define IE_CUC_RESUME 0x0200 /* resume a suspended cmd list */#define IE_CUC_SUSPEND 0x0300 /* suspend current command */#define IE_CUC_ABORT 0x0400 /* abort current command */#define IE_ACK_COMMAND 0xf000 /* mask for ACK command */#define IE_ACK_CX 0x8000 /* ack IE_ST_CX */#define IE_ACK_FR 0x4000 /* ack IE_ST_FR */#define IE_ACK_CNA 0x2000 /* ack IE_ST_CNA */#define IE_ACK_RNR 0x1000 /* ack IE_ST_RNR */#define IE_ACTION_COMMAND(x) (((x) & IE_CUC_MASK) == IE_CUC_START) /* is this command an action command? *//* Status values */#define IE_ST_WHENCE 0xf000 /* mask for cause of interrupt */#define IE_ST_CX 0x8000 /* command with I bit completed */#define IE_ST_FR 0x4000 /* frame received */#define IE_ST_CNA 0x2000 /* all commands completed */#define IE_ST_RNR 0x1000 /* receive not ready */#define IE_CUS_MASK 0x0700 /* mask for command unit status */#define IE_CUS_ACTIVE 0x0200 /* command unit is active */#define IE_CUS_SUSPEND 0x0100 /* command unit is suspended */#define IE_RUS_MASK 0x0070 /* mask for receiver unit status */#define IE_RUS_SUSPEND 0x0010 /* receiver is suspended */#define IE_RUS_NOSPACE 0x0020 /* receiver has no resources */#define IE_RUS_READY 0x0040 /* receiver is ready *//* * This is filled in partially by the chip, partially by us. *-struct __ie_recv_frame_desc { u_int16_t ie_fd_status; // status for this frame u_int16_t ie_fd_last; // end of frame list flag u_int16_t ie_fd_next; // 16-pointer to next RFD u_int16_t ie_fd_buf_desc; // 16-pointer to list of buffer descs struct __ie_en_addr dest; // destination ether struct __ie_en_addr src; // source ether u_int16_t ie_length; // 802 length/Ether type u_short mbz; // must be zero}; */#define IE_RFRAME_SZ 24#define IE_RFRAME_ADDR(base,i) ((base) + (i) * IE_RFRAME_SZ)#define IE_RFRAME_STATUS(b,i) (IE_RFRAME_ADDR(b,i) + 0)#define IE_RFRAME_LAST(b,i) (IE_RFRAME_ADDR(b,i) + 2)#define IE_RFRAME_NEXT(b,i) (IE_RFRAME_ADDR(b,i) + 4)#define IE_RFRAME_BUFDESC(b,i) (IE_RFRAME_ADDR(b,i) + 6)#define IE_RFRAME_EDST(b,i) (IE_RFRAME_ADDR(b,i) + 8)#define IE_RFRAME_ESRC(b,i) (IE_RFRAME_ADDR(b,i) + 14)#define IE_RFRAME_ELEN(b,i) (IE_RFRAME_ADDR(b,i) + 20)/* "last" bits */#define IE_FD_EOL 0x8000 /* last rfd in list */#define IE_FD_SUSP 0x4000 /* suspend RU after receipt *//* status field bits */#define IE_FD_COMPLETE 0x8000 /* frame is complete */#define IE_FD_BUSY 0x4000 /* frame is busy */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -