Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 83663
b: refs/heads/master
c: b2976d2
h: refs/heads/master
i:
  83661: d50a90b
  83659: 8e01faf
  83655: 0214c16
  83647: 4f6502c
v: v3
  • Loading branch information
Ayaz Abdulla authored and Jeff Garzik committed Feb 6, 2008
1 parent 57855f4 commit 15233b0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 47eaa267a5db1729d238f977364e297b8963e115
refs/heads/master: b2976d23a15aac11e8e77a496108b9f4040fac4d
19 changes: 19 additions & 0 deletions trunk/drivers/net/forcedeth.c
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,9 @@ union ring_type {
#define NV_MSI_X_VECTOR_TX 0x1
#define NV_MSI_X_VECTOR_OTHER 0x2

#define NV_RESTART_TX 0x1
#define NV_RESTART_RX 0x2

/* statistics */
struct nv_ethtool_str {
char name[ETH_GSTRING_LEN];
Expand Down Expand Up @@ -2767,6 +2770,7 @@ static int nv_update_linkspeed(struct net_device *dev)
int mii_status;
int retval = 0;
u32 control_1000, status_1000, phyreg, pause_flags, txreg;
u32 txrxFlags = 0;

/* BMSR_LSTATUS is latched, read it twice:
* we want the current value.
Expand Down Expand Up @@ -2862,6 +2866,16 @@ static int nv_update_linkspeed(struct net_device *dev)
np->duplex = newdup;
np->linkspeed = newls;

/* The transmitter and receiver must be restarted for safe update */
if (readl(base + NvRegTransmitterControl) & NVREG_XMITCTL_START) {
txrxFlags |= NV_RESTART_TX;
nv_stop_tx(dev);
}
if (readl(base + NvRegReceiverControl) & NVREG_RCVCTL_START) {
txrxFlags |= NV_RESTART_RX;
nv_stop_rx(dev);
}

if (np->gigabit == PHY_GIGABIT) {
phyreg = readl(base + NvRegRandomSeed);
phyreg &= ~(0x3FF00);
Expand Down Expand Up @@ -2950,6 +2964,11 @@ static int nv_update_linkspeed(struct net_device *dev)
}
nv_update_pause(dev, pause_flags);

if (txrxFlags & NV_RESTART_TX)
nv_start_tx(dev);
if (txrxFlags & NV_RESTART_RX)
nv_start_rx(dev);

return retval;
}

Expand Down

0 comments on commit 15233b0

Please sign in to comment.