Commit 439f01a0 authored by Jeff Garzik's avatar Jeff Garzik

[net drivers] Rename MII lib API member, s/duplex_lock/force_media/,

and update all drivers that reference this struct member.
parent 058fd7fa
......@@ -1049,7 +1049,7 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev,
printk(KERN_INFO "%s: Media type forced to Full Duplex.\n", dev->name);
/* Changing the MII-advertised media because might prevent
re-connection. */
tp->mii.duplex_lock = 1;
tp->mii.force_media = 1;
}
if (tp->default_port) {
printk(KERN_INFO " Forcing %dMbps %s-duplex operation.\n",
......@@ -1306,7 +1306,7 @@ static int rtl8139_open (struct net_device *dev)
}
tp->mii.full_duplex = tp->mii.duplex_lock;
tp->mii.full_duplex = tp->mii.force_media;
tp->tx_flag = (TX_FIFO_THRESH << 11) & 0x003f0000;
tp->twistie = (tp->chipset == CH_8139_K) ? 1 : 0;
tp->time_to_die = 0;
......@@ -1537,7 +1537,7 @@ static inline void rtl8139_thread_iter (struct net_device *dev,
mii_lpa = mdio_read (dev, tp->phys[0], MII_LPA);
if (!tp->mii.duplex_lock && mii_lpa != 0xffff) {
if (!tp->mii.force_media && mii_lpa != 0xffff) {
int duplex = (mii_lpa & LPA_100FULL)
|| (mii_lpa & 0x01C0) == 0x0040;
if (tp->mii.full_duplex != duplex) {
......@@ -1995,7 +1995,7 @@ static void rtl8139_weird_interrupt (struct net_device *dev,
/* Really link-change on new chips. */
int lpar = RTL_R16 (NWayLPAR);
int duplex = (lpar & LPA_100FULL) || (lpar & 0x01C0) == 0x0040
|| tp->mii.duplex_lock;
|| tp->mii.force_media;
if (tp->mii.full_duplex != duplex) {
tp->mii.full_duplex = duplex;
#if 0
......
......@@ -523,7 +523,7 @@ static int __devinit epic_init_one (struct pci_dev *pdev,
/* The lower four bits are the media type. */
if (duplex) {
ep->mii.duplex_lock = ep->mii.full_duplex = 1;
ep->mii.force_media = ep->mii.full_duplex = 1;
printk(KERN_INFO DRV_NAME "(%s): Forced full duplex operation requested.\n",
pdev->slot_name);
}
......@@ -854,7 +854,7 @@ static void check_media(struct net_device *dev)
int negotiated = mii_lpa & ep->mii.advertising;
int duplex = (negotiated & 0x0100) || (negotiated & 0x01C0) == 0x0040;
if (ep->mii.duplex_lock)
if (ep->mii.force_media)
return;
if (mii_lpa == 0xffff) /* Bogus read */
return;
......@@ -1464,8 +1464,8 @@ static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
switch (data->reg_num) {
case 0:
/* Check for autonegotiation on or reset. */
ep->mii.duplex_lock = (value & 0x9000) ? 0 : 1;
if (ep->mii.duplex_lock)
ep->mii.force_media = (value & 0x9000) ? 0 : 1;
if (ep->mii.force_media)
ep->mii.full_duplex = (value & 0x0100) ? 1 : 0;
break;
case 4: ep->mii.advertising = value; break;
......
......@@ -654,7 +654,7 @@ static int __devinit fealnx_init_one(struct pci_dev *pdev,
mdio_write(dev, np->phys[0], MII_ADVERTISE, ADVERTISE_FULL);
else
writel(ADVERTISE_FULL, dev->base_addr + ANARANLPAR);
np->mii.duplex_lock = 1;
np->mii.force_media = 1;
}
/* The chip-specific entries in the device structure. */
......@@ -956,7 +956,7 @@ static int netdev_open(struct net_device *dev)
// 89/9/1 modify,
// np->crvalue = 0x00e40001; /* tx store and forward, tx/rx enable */
np->crvalue |= 0x00e40001; /* tx store and forward, tx/rx enable */
np->mii.full_duplex = np->mii.duplex_lock;
np->mii.full_duplex = np->mii.force_media;
getlinkstatus(dev);
if (np->linkok)
getlinktype(dev);
......
......@@ -122,7 +122,7 @@ int mii_ethtool_sset(struct mii_if_info *mii, struct ethtool_cmd *ecmd)
bmcr |= (BMCR_ANENABLE | BMCR_ANRESTART);
mii->mdio_write(dev, mii->phy_id, MII_BMCR, bmcr);
mii->duplex_lock = 0;
mii->force_media = 0;
} else {
u32 bmcr, tmp;
......@@ -139,7 +139,7 @@ int mii_ethtool_sset(struct mii_if_info *mii, struct ethtool_cmd *ecmd)
if (bmcr != tmp)
mii->mdio_write(dev, mii->phy_id, MII_BMCR, tmp);
mii->duplex_lock = 1;
mii->force_media = 1;
}
return 0;
}
......@@ -186,7 +186,7 @@ unsigned int mii_check_media (struct mii_if_info *mii,
int advertise, lpa, media, duplex;
/* if forced media, go no further */
if (mii->duplex_lock)
if (mii->force_media)
return 0; /* duplex did not change */
/* check current and old link status */
......
......@@ -473,7 +473,7 @@ static int __devinit w840_probe1 (struct pci_dev *pdev,
np->mii_if.full_duplex = 1;
if (np->mii_if.full_duplex)
np->mii_if.duplex_lock = 1;
np->mii_if.force_media = 1;
/* The chip-specific entries in the device structure. */
dev->open = &netdev_open;
......@@ -773,7 +773,7 @@ static int update_link(struct net_device *dev)
duplex = (negotiated & LPA_100FULL) || ((negotiated & 0x02C0) == LPA_10FULL);
fasteth = negotiated & 0x380;
}
duplex |= np->mii_if.duplex_lock;
duplex |= np->mii_if.force_media;
/* remove fastether and fullduplex */
result = np->csr6 & ~0x20000200;
if (duplex)
......
......@@ -731,7 +731,7 @@ static int __devinit via_rhine_init_one (struct pci_dev *pdev,
if (np->mii_if.full_duplex) {
printk(KERN_INFO "%s: Set to forced full duplex, autonegotiation"
" disabled.\n", dev->name);
np->mii_if.duplex_lock = 1;
np->mii_if.force_media = 1;
}
/* The chip-specific entries in the device structure. */
......@@ -1001,7 +1001,7 @@ static void init_registers(struct net_device *dev)
ioaddr + IntrEnable);
np->chip_cmd = CmdStart|CmdTxOn|CmdRxOn|CmdNoTxPoll;
if (np->mii_if.duplex_lock)
if (np->mii_if.force_media)
np->chip_cmd |= CmdFDuplex;
writew(np->chip_cmd, ioaddr + ChipCmd);
......@@ -1043,7 +1043,7 @@ static void mdio_write(struct net_device *dev, int phy_id, int regnum, int value
switch (regnum) {
case MII_BMCR: /* Is user forcing speed/duplex? */
if (value & 0x9000) /* Autonegotiation. */
np->mii_if.duplex_lock = 0;
np->mii_if.force_media = 0;
else
np->mii_if.full_duplex = (value & 0x0100) ? 1 : 0;
break;
......@@ -1114,7 +1114,7 @@ static void via_rhine_check_duplex(struct net_device *dev)
int negotiated = mii_lpa & np->mii_if.advertising;
int duplex;
if (np->mii_if.duplex_lock || mii_lpa == 0xffff)
if (np->mii_if.force_media || mii_lpa == 0xffff)
return;
duplex = (negotiated & 0x0100) || (negotiated & 0x01C0) == 0x0040;
if (np->mii_if.full_duplex != duplex) {
......
......@@ -108,8 +108,8 @@ struct mii_if_info {
int phy_id;
int advertising;
unsigned int full_duplex : 1;
unsigned int duplex_lock : 1;
unsigned int full_duplex : 1; /* is full duplex? */
unsigned int force_media : 1; /* is autoneg. disabled? */
struct net_device *dev;
int (*mdio_read) (struct net_device *dev, int phy_id, int location);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment