Added support for the Intel 82555 PHY chip which is being used on newer
Pro/100B cards. Full duplex should work now, although it hasn't been tested.
This commit is contained in:
parent
c2043f40bb
commit
854d14213e
@ -24,7 +24,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: if_fxp.c,v 1.33 1997/03/25 14:54:38 davidg Exp $
|
||||
* $Id: if_fxp.c,v 1.34 1997/04/23 01:44:30 davidg Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -963,15 +963,18 @@ fxp_init(xsc)
|
||||
csr->scb_command = FXP_SCB_COMMAND_RU_START;
|
||||
|
||||
/*
|
||||
* Toggle a few bits in the DP83840 PHY.
|
||||
* Toggle a few bits in the PHY.
|
||||
*/
|
||||
if (sc->phy_primary_device == FXP_PHY_DP83840 ||
|
||||
sc->phy_primary_device == FXP_PHY_DP83840A) {
|
||||
switch (sc->phy_primary_device) {
|
||||
case FXP_PHY_DP83840:
|
||||
case FXP_PHY_DP83840A:
|
||||
fxp_mdi_write(sc->csr, sc->phy_primary_addr, FXP_DP83840_PCR,
|
||||
fxp_mdi_read(sc->csr, sc->phy_primary_addr, FXP_DP83840_PCR) |
|
||||
FXP_DP83840_PCR_LED4_MODE | /* LED4 always indicates duplex */
|
||||
FXP_DP83840_PCR_F_CONNECT | /* force link disconnect bypass */
|
||||
FXP_DP83840_PCR_BIT10); /* XXX I have no idea */
|
||||
/* fall through */
|
||||
case FXP_PHY_82555:
|
||||
/*
|
||||
* If link0 is set, disable auto-negotiation and then:
|
||||
* If link1 is unset = 10Mbps
|
||||
@ -983,19 +986,20 @@ fxp_init(xsc)
|
||||
int flags;
|
||||
|
||||
flags = (ifp->if_flags & IFF_LINK1) ?
|
||||
FXP_DP83840_BMCR_SPEED_100M : 0;
|
||||
FXP_PHY_BMCR_SPEED_100M : 0;
|
||||
flags |= (ifp->if_flags & IFF_LINK2) ?
|
||||
FXP_DP83840_BMCR_FULLDUPLEX : 0;
|
||||
fxp_mdi_write(sc->csr, sc->phy_primary_addr, FXP_DP83840_BMCR,
|
||||
(fxp_mdi_read(sc->csr, sc->phy_primary_addr, FXP_DP83840_BMCR) &
|
||||
~(FXP_DP83840_BMCR_AUTOEN | FXP_DP83840_BMCR_SPEED_100M |
|
||||
FXP_DP83840_BMCR_FULLDUPLEX)) | flags);
|
||||
FXP_PHY_BMCR_FULLDUPLEX : 0;
|
||||
fxp_mdi_write(sc->csr, sc->phy_primary_addr, FXP_PHY_BMCR,
|
||||
(fxp_mdi_read(sc->csr, sc->phy_primary_addr, FXP_PHY_BMCR) &
|
||||
~(FXP_PHY_BMCR_AUTOEN | FXP_PHY_BMCR_SPEED_100M |
|
||||
FXP_PHY_BMCR_FULLDUPLEX)) | flags);
|
||||
} else {
|
||||
fxp_mdi_write(sc->csr, sc->phy_primary_addr, FXP_DP83840_BMCR,
|
||||
(fxp_mdi_read(sc->csr, sc->phy_primary_addr, FXP_DP83840_BMCR) |
|
||||
FXP_DP83840_BMCR_AUTOEN));
|
||||
fxp_mdi_write(sc->csr, sc->phy_primary_addr, FXP_PHY_BMCR,
|
||||
(fxp_mdi_read(sc->csr, sc->phy_primary_addr, FXP_PHY_BMCR) |
|
||||
FXP_PHY_BMCR_AUTOEN));
|
||||
}
|
||||
} else {
|
||||
break;
|
||||
default:
|
||||
printf("fxp%d: warning: unsupported PHY, type = %d, addr = %d\n",
|
||||
ifp->if_unit, sc->phy_primary_device, sc->phy_primary_addr);
|
||||
}
|
||||
|
@ -24,7 +24,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: if_fxpreg.h,v 1.7 1997/03/17 11:08:16 davidg Exp $
|
||||
* $Id: if_fxpreg.h,v 1.8 1997/03/21 08:00:13 davidg Exp $
|
||||
*/
|
||||
|
||||
#define FXP_VENDORID_INTEL 0x8086
|
||||
@ -292,15 +292,16 @@ struct fxp_stats {
|
||||
#define FXP_PHY_DP83840 4
|
||||
#define FXP_PHY_80C240 5
|
||||
#define FXP_PHY_80C24 6
|
||||
#define FXP_PHY_82555 7
|
||||
#define FXP_PHY_DP83840A 10
|
||||
|
||||
/*
|
||||
* DP84830 PHY, BMCR Basic Mode Control Register
|
||||
* PHY BMCR Basic Mode Control Register
|
||||
*/
|
||||
#define FXP_DP83840_BMCR 0x0
|
||||
#define FXP_DP83840_BMCR_FULLDUPLEX 0x0100
|
||||
#define FXP_DP83840_BMCR_AUTOEN 0x1000
|
||||
#define FXP_DP83840_BMCR_SPEED_100M 0x2000
|
||||
#define FXP_PHY_BMCR 0x0
|
||||
#define FXP_PHY_BMCR_FULLDUPLEX 0x0100
|
||||
#define FXP_PHY_BMCR_AUTOEN 0x1000
|
||||
#define FXP_PHY_BMCR_SPEED_100M 0x2000
|
||||
|
||||
/*
|
||||
* DP84830 PHY, PCS Configuration Register
|
||||
|
@ -24,7 +24,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: if_fxp.c,v 1.33 1997/03/25 14:54:38 davidg Exp $
|
||||
* $Id: if_fxp.c,v 1.34 1997/04/23 01:44:30 davidg Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -963,15 +963,18 @@ fxp_init(xsc)
|
||||
csr->scb_command = FXP_SCB_COMMAND_RU_START;
|
||||
|
||||
/*
|
||||
* Toggle a few bits in the DP83840 PHY.
|
||||
* Toggle a few bits in the PHY.
|
||||
*/
|
||||
if (sc->phy_primary_device == FXP_PHY_DP83840 ||
|
||||
sc->phy_primary_device == FXP_PHY_DP83840A) {
|
||||
switch (sc->phy_primary_device) {
|
||||
case FXP_PHY_DP83840:
|
||||
case FXP_PHY_DP83840A:
|
||||
fxp_mdi_write(sc->csr, sc->phy_primary_addr, FXP_DP83840_PCR,
|
||||
fxp_mdi_read(sc->csr, sc->phy_primary_addr, FXP_DP83840_PCR) |
|
||||
FXP_DP83840_PCR_LED4_MODE | /* LED4 always indicates duplex */
|
||||
FXP_DP83840_PCR_F_CONNECT | /* force link disconnect bypass */
|
||||
FXP_DP83840_PCR_BIT10); /* XXX I have no idea */
|
||||
/* fall through */
|
||||
case FXP_PHY_82555:
|
||||
/*
|
||||
* If link0 is set, disable auto-negotiation and then:
|
||||
* If link1 is unset = 10Mbps
|
||||
@ -983,19 +986,20 @@ fxp_init(xsc)
|
||||
int flags;
|
||||
|
||||
flags = (ifp->if_flags & IFF_LINK1) ?
|
||||
FXP_DP83840_BMCR_SPEED_100M : 0;
|
||||
FXP_PHY_BMCR_SPEED_100M : 0;
|
||||
flags |= (ifp->if_flags & IFF_LINK2) ?
|
||||
FXP_DP83840_BMCR_FULLDUPLEX : 0;
|
||||
fxp_mdi_write(sc->csr, sc->phy_primary_addr, FXP_DP83840_BMCR,
|
||||
(fxp_mdi_read(sc->csr, sc->phy_primary_addr, FXP_DP83840_BMCR) &
|
||||
~(FXP_DP83840_BMCR_AUTOEN | FXP_DP83840_BMCR_SPEED_100M |
|
||||
FXP_DP83840_BMCR_FULLDUPLEX)) | flags);
|
||||
FXP_PHY_BMCR_FULLDUPLEX : 0;
|
||||
fxp_mdi_write(sc->csr, sc->phy_primary_addr, FXP_PHY_BMCR,
|
||||
(fxp_mdi_read(sc->csr, sc->phy_primary_addr, FXP_PHY_BMCR) &
|
||||
~(FXP_PHY_BMCR_AUTOEN | FXP_PHY_BMCR_SPEED_100M |
|
||||
FXP_PHY_BMCR_FULLDUPLEX)) | flags);
|
||||
} else {
|
||||
fxp_mdi_write(sc->csr, sc->phy_primary_addr, FXP_DP83840_BMCR,
|
||||
(fxp_mdi_read(sc->csr, sc->phy_primary_addr, FXP_DP83840_BMCR) |
|
||||
FXP_DP83840_BMCR_AUTOEN));
|
||||
fxp_mdi_write(sc->csr, sc->phy_primary_addr, FXP_PHY_BMCR,
|
||||
(fxp_mdi_read(sc->csr, sc->phy_primary_addr, FXP_PHY_BMCR) |
|
||||
FXP_PHY_BMCR_AUTOEN));
|
||||
}
|
||||
} else {
|
||||
break;
|
||||
default:
|
||||
printf("fxp%d: warning: unsupported PHY, type = %d, addr = %d\n",
|
||||
ifp->if_unit, sc->phy_primary_device, sc->phy_primary_addr);
|
||||
}
|
||||
|
@ -24,7 +24,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: if_fxpreg.h,v 1.7 1997/03/17 11:08:16 davidg Exp $
|
||||
* $Id: if_fxpreg.h,v 1.8 1997/03/21 08:00:13 davidg Exp $
|
||||
*/
|
||||
|
||||
#define FXP_VENDORID_INTEL 0x8086
|
||||
@ -292,15 +292,16 @@ struct fxp_stats {
|
||||
#define FXP_PHY_DP83840 4
|
||||
#define FXP_PHY_80C240 5
|
||||
#define FXP_PHY_80C24 6
|
||||
#define FXP_PHY_82555 7
|
||||
#define FXP_PHY_DP83840A 10
|
||||
|
||||
/*
|
||||
* DP84830 PHY, BMCR Basic Mode Control Register
|
||||
* PHY BMCR Basic Mode Control Register
|
||||
*/
|
||||
#define FXP_DP83840_BMCR 0x0
|
||||
#define FXP_DP83840_BMCR_FULLDUPLEX 0x0100
|
||||
#define FXP_DP83840_BMCR_AUTOEN 0x1000
|
||||
#define FXP_DP83840_BMCR_SPEED_100M 0x2000
|
||||
#define FXP_PHY_BMCR 0x0
|
||||
#define FXP_PHY_BMCR_FULLDUPLEX 0x0100
|
||||
#define FXP_PHY_BMCR_AUTOEN 0x1000
|
||||
#define FXP_PHY_BMCR_SPEED_100M 0x2000
|
||||
|
||||
/*
|
||||
* DP84830 PHY, PCS Configuration Register
|
||||
|
Loading…
Reference in New Issue
Block a user