Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 25 Jan 1997 20:22:58 -0800 (PST)
From:      Jon Moldenhauer <jpm@almond.elite.net>
To:        freebsd-hackers@freebsd.org
Subject:   Intel EtherExpress Pro 10B PCI
Message-ID:  <199701260422.UAA15008@almond.elite.net>

next in thread | raw e-mail | index | archive | help
A superior of mine bought an Intel EtherExpress Pro 10B PCI card
hoping that FreeBSD would support it.  After much twisting of
the arm, I had pretty much given up, especially after seeing the
various discussions about the Pro 10B and Pro 100B cards in the
newsgroups and mailing-lists.

Up till now, I hadn't seen anyone say they had gotten the 10B
card to work.  Well, I did get it to work.  Basically, the 10B
uses the same chip as the 100B (the i82557) and so the fxp
driver recognizes the card when FreeBSD boots.  Unfortunately,
the fxp driver assumes the card is a 100B card which may not
always be the case.  To remedy this, I hacked up the fxp
driver so it is possible to use the link0 and link1 flags to
ifconfig to tell the driver how to configure the card.  For
users of the 100B card, nothing changes.  For users of the 10B
card, you add 'link0 link1' to the ifconfig line for the card.

The reason for two flags is this: link0 controls whether the
card is set up in nibble-wide (100Mbit) or bit-wide (10Mbit)
mode, and link1 controls whether the card is willing to do
full-duplex or will refuse to do full-duplex.  Again, the
default settings of ifconfig are to work the way the driver
did before so you have to explicitly give the link0 flag to
put the card into bit-wide mode and explicitly give the link1
flag to tell the card to refuse full-duplex mode.

Anyway, thats probably more than anyone wants to know and
there must be a better way to tell the driver whether the
card is a 10B or 100B but since I don't have a 100B card I
couldn't figure out a reliable way (ethernet addresses
might work, but I would need to see some 100B ethernet
addresses to be sure).

The patch below is against the -current version of if_fxp.c
but my original patch was against 2.1.5 sources and I haven't
had an opportunity to test the -current version.  Additionally,
I only had the measly documentation on the 82557 from Intel's
web site to work from and so I may have made some really bad
assumptions (like, that other than the two bits I flip all
other parameters stay the same) which might cause your network
to destroy data, blow up, or generally cease functioning.

Hope this helps those who need it.

Jonathon
Elite.Net System Administrator


*** /usr/sup/src/sys/pci/if_fxp.c	Tue Jan 14 03:56:47 1997
--- if_fxp.c	Sat Jan 25 13:57:15 1997
***************
*** 28,34 ****
   */
  
  /*
!  * Intel EtherExpress Pro/100B PCI Fast Ethernet driver
   */
  
  #include "bpfilter.h"
--- 28,34 ----
   */
  
  /*
!  * Intel EtherExpress Pro/100B or Pro/10B PCI Ethernet driver
   */
  
  #include "bpfilter.h"
***************
*** 208,214 ****
  {
  	if (((device_id & 0xffff) == FXP_VENDORID_INTEL) &&
  	    ((device_id >> 16) & 0xffff) == FXP_DEVICEID_i82557)
! 		return ("Intel EtherExpress Pro/100B Fast Ethernet");
  
  	return NULL;
  }
--- 208,214 ----
  {
  	if (((device_id & 0xffff) == FXP_VENDORID_INTEL) &&
  	    ((device_id >> 16) & 0xffff) == FXP_DEVICEID_i82557)
! 		return ("Intel EtherExpress Pro 10B/100B Ethernet");
  
  	return NULL;
  }
***************
*** 802,808 ****
  	struct fxp_cb_ias *cb_ias;
  	struct fxp_cb_tx *txp;
  	struct fxp_csr *csr = sc->csr;
! 	int i, s, mcast, prm;
  
  	s = splimp();
  	/*
--- 802,808 ----
  	struct fxp_cb_ias *cb_ias;
  	struct fxp_cb_tx *txp;
  	struct fxp_csr *csr = sc->csr;
! 	int i, s, mcast, prm, link0, link1;
  
  	s = splimp();
  	/*
***************
*** 820,825 ****
--- 820,836 ----
  	mcast = (ifp->if_flags & (IFF_MULTICAST|IFF_ALLMULTI)) ? 1 : 0;
  
  	/*
+ 	 * link0 is used to indicate if the card is a 100MB card (not
+ 	 * set) or if the card is a 10MB card (set).
+ 	 *
+ 	 * link1 is used to indicate if the card should indicate it
+ 	 * can do full duplex communications (not set) or if the card
+ 	 * should refuse to do full duplex communications (set).
+ 	 */
+ 	link0 = ifp->if_flags & IFF_LINK0;
+ 	link1 = ifp->if_flags & IFF_LINK1;
+ 
+ 	/*
  	 * Initialize base of CBL and RFA memory. Loading with zero
  	 * sets it up for regular linear addressing.
  	 */
***************
*** 866,872 ****
  	cbp->save_bf =		prm;	/* save bad frames */
  	cbp->disc_short_rx =	!prm;	/* discard short packets */
  	cbp->underrun_retry =	1;	/* retry mode (1) on DMA underrun */
! 	cbp->mediatype =	1;	/* (MII) interface mode */
  	cbp->nsai =		1;	/* (don't) disable source addr insert */
  	cbp->preamble_length =	2;	/* (7 byte) preamble */
  	cbp->loopback =		0;	/* (don't) loopback */
--- 877,883 ----
  	cbp->save_bf =		prm;	/* save bad frames */
  	cbp->disc_short_rx =	!prm;	/* discard short packets */
  	cbp->underrun_retry =	1;	/* retry mode (1) on DMA underrun */
! 	cbp->mediatype =	!link0;	/* (MII or PHV) interface mode */
  	cbp->nsai =		1;	/* (don't) disable source addr insert */
  	cbp->preamble_length =	2;	/* (7 byte) preamble */
  	cbp->loopback =		0;	/* (don't) loopback */
***************
*** 880,886 ****
  	cbp->padding =		1;	/* (do) pad short tx packets */
  	cbp->rcv_crc_xfer =	0;	/* (don't) xfer CRC to host */
  	cbp->force_fdx =	0;	/* (don't) force full duplex */
! 	cbp->fdx_pin_en =	1;	/* (enable) FDX# pin */
  	cbp->multi_ia =		0;	/* (don't) accept multiple IAs */
  	cbp->mc_all =		mcast;	/* accept all multicasts */
  
--- 891,897 ----
  	cbp->padding =		1;	/* (do) pad short tx packets */
  	cbp->rcv_crc_xfer =	0;	/* (don't) xfer CRC to host */
  	cbp->force_fdx =	0;	/* (don't) force full duplex */
! 	cbp->fdx_pin_en =	!link1;	/* (enable or disable) FDX# pin */
  	cbp->multi_ia =		0;	/* (don't) accept multiple IAs */
  	cbp->mc_all =		mcast;	/* accept all multicasts */
  



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199701260422.UAA15008>