diff options
author | David Greenman <dg@FreeBSD.org> | 1997-09-29 11:27:43 +0000 |
---|---|---|
committer | David Greenman <dg@FreeBSD.org> | 1997-09-29 11:27:43 +0000 |
commit | 397f9dfe268ef6b629892dafe65fadc30c89cc00 (patch) | |
tree | f66312dc69ba6521c78b6826fd87d5d006df3b41 /sys/dev/fxp/if_fxpreg.h | |
parent | 1f38a58f2708008867044b3ecb045a2e3d195819 (diff) | |
download | src-397f9dfe268ef6b629892dafe65fadc30c89cc00.tar.gz src-397f9dfe268ef6b629892dafe65fadc30c89cc00.zip |
Work around a bug in the 82557 NIC where the receiver will lock up
if it is in 10Mbps mode and gets certain types of garbage prior to
the packet header. The work-around involves reprogramming the
multicast filter if nothing is received in some number of seconds
(currently set at 15). As a side effect, implemented complete support
for multicasting rather than the previous 'receive all multicasts'
hack, since we now have the ability to program the filter table.
Fixed a serious bug which crept in with the timeout() changes;
the cookie was only saved on the first timeout() call in fxp_init()
and wasn't updated in the most common place in fxp_stats_update()
when the timeout was rescheduled. This bug would have resulted in
an eventual panic if fxp_stop() was called (which happens when any
interface flags are changed, for example).
Fixed a bug in Alpha support that would have caused the TxCB
descriptor chain to span a page boundry, causing serious problems
if the pages didn't happen to be contiguous.
Removed some gratuitous bit masking that was left over from an
older implementation.
Fixed a bug where too much was copied from the configuration
template, spilling over into memory that followed it.
Fixed handling of if_timer...it was cleared too early in some cases.
Notes
Notes:
svn path=/head/; revision=29974
Diffstat (limited to 'sys/dev/fxp/if_fxpreg.h')
-rw-r--r-- | sys/dev/fxp/if_fxpreg.h | 40 |
1 files changed, 33 insertions, 7 deletions
diff --git a/sys/dev/fxp/if_fxpreg.h b/sys/dev/fxp/if_fxpreg.h index e2835cae25a4..58971bd4f958 100644 --- a/sys/dev/fxp/if_fxpreg.h +++ b/sys/dev/fxp/if_fxpreg.h @@ -24,7 +24,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ + * $Id: if_fxpreg.h,v 1.10 1997/09/05 10:23:56 davidg Exp $ */ #define FXP_VENDORID_INTEL 0x8086 @@ -78,7 +78,6 @@ #define FXP_SCB_STATACK_FR 0x40 #define FXP_SCB_STATACK_CXTNO 0x80 -#define FXP_SCB_COMMAND_MASK 0xff #define FXP_SCB_COMMAND_CU_NOP 0x00 #define FXP_SCB_COMMAND_CU_START 0x10 #define FXP_SCB_COMMAND_CU_RESUME 0x20 @@ -99,11 +98,13 @@ * Command block definitions */ struct fxp_cb_nop { + void *fill[2]; volatile u_int16_t cb_status; volatile u_int16_t cb_command; volatile u_int32_t link_addr; }; struct fxp_cb_ias { + void *fill[2]; volatile u_int16_t cb_status; volatile u_int16_t cb_command; volatile u_int32_t link_addr; @@ -111,6 +112,7 @@ struct fxp_cb_ias { }; /* I hate bit-fields :-( */ struct fxp_cb_config { + void *fill[2]; volatile u_int16_t cb_status; volatile u_int16_t cb_command; volatile u_int32_t link_addr; @@ -168,12 +170,38 @@ struct fxp_cb_config { mc_all:1, :4; }; + +#define MAXMCADDR 80 +struct fxp_cb_mcs { + struct fxp_cb_tx *next; + struct mbuf *mb_head; + volatile u_int16_t cb_status; + volatile u_int16_t cb_command; + volatile u_int32_t link_addr; + volatile u_int16_t mc_cnt; + volatile u_int8_t mc_addr[MAXMCADDR][6]; +}; + +/* + * Number of DMA segments in a TxCB. Note that this is carefully + * chosen to make the total struct size an even power of two. It's + * critical that no TxCB be split across a page boundry since + * no attempt is made to allocate physically contiguous memory. + * + */ +#ifdef __alpha__ /* XXX - should be conditional on pointer size */ +#define FXP_NTXSEG 28 +#else +#define FXP_NTXSEG 29 +#endif + struct fxp_tbd { volatile u_int32_t tb_addr; volatile u_int32_t tb_size; }; - struct fxp_cb_tx { + struct fxp_cb_tx *next; + struct mbuf *mb_head; volatile u_int16_t cb_status; volatile u_int16_t cb_command; volatile u_int32_t link_addr; @@ -184,9 +212,7 @@ struct fxp_cb_tx { /* * The following isn't actually part of the TxCB. */ - volatile struct fxp_tbd tbd[29]; - struct mbuf *mb_head; - struct fxp_cb_tx *next; + volatile struct fxp_tbd tbd[FXP_NTXSEG]; }; /* @@ -200,7 +226,7 @@ struct fxp_cb_tx { #define FXP_CB_COMMAND_NOP 0x0 #define FXP_CB_COMMAND_IAS 0x1 #define FXP_CB_COMMAND_CONFIG 0x2 -#define FXP_CB_COMMAND_MAS 0x3 +#define FXP_CB_COMMAND_MCAS 0x3 #define FXP_CB_COMMAND_XMIT 0x4 #define FXP_CB_COMMAND_RESRV 0x5 #define FXP_CB_COMMAND_DUMP 0x6 |