From 179a5ad3650635bf5d0cfaf2f6ba732850dcb9b5 Mon Sep 17 00:00:00 2001 From: dg Date: Mon, 29 Sep 1997 11:27:43 +0000 Subject: 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. --- sys/pci/if_fxpreg.h | 40 +++++++++++++++++++++++++++++++++------- 1 file changed, 33 insertions(+), 7 deletions(-) (limited to 'sys/pci/if_fxpreg.h') diff --git a/sys/pci/if_fxpreg.h b/sys/pci/if_fxpreg.h index e2835ca..58971bd 100644 --- a/sys/pci/if_fxpreg.h +++ b/sys/pci/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 -- cgit v1.1