Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 35132
b: refs/heads/master
c: f148965
h: refs/heads/master
v: v3
  • Loading branch information
Ayaz Abdulla authored and Jeff Garzik committed Aug 9, 2006
1 parent c191090 commit a406d28
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fcf194d19b7857c2467bebdb271bd079a0c0da81
refs/heads/master: f1489653e9c891f343d2034aad0ef6984d3ef5cb
29 changes: 14 additions & 15 deletions trunk/drivers/net/forcedeth.c
Original file line number Diff line number Diff line change
Expand Up @@ -3895,10 +3895,9 @@ static int nv_open(struct net_device *dev)

dprintk(KERN_DEBUG "nv_open: begin\n");

/* 1) erase previous misconfiguration */
/* erase previous misconfiguration */
if (np->driver_data & DEV_HAS_POWER_CNTRL)
nv_mac_reset(dev);
/* 4.1-1: stop adapter: ignored, 4.3 seems to be overkill */
writel(NVREG_MCASTADDRA_FORCE, base + NvRegMulticastAddrA);
writel(0, base + NvRegMulticastAddrB);
writel(0, base + NvRegMulticastMaskA);
Expand All @@ -3913,7 +3912,7 @@ static int nv_open(struct net_device *dev)
if (np->pause_flags & NV_PAUSEFRAME_TX_CAPABLE)
writel(NVREG_TX_PAUSEFRAME_DISABLE, base + NvRegTxPauseFrame);

/* 2) initialize descriptor rings */
/* initialize descriptor rings */
set_bufsize(dev);
oom = nv_init_ring(dev);

Expand All @@ -3924,15 +3923,11 @@ static int nv_open(struct net_device *dev)

np->in_shutdown = 0;

/* 3) set mac address */
nv_copy_mac_to_hw(dev);

/* 4) give hw rings */
/* give hw rings */
setup_hw_rings(dev, NV_SETUP_RX_RING | NV_SETUP_TX_RING);
writel( ((np->rx_ring_size-1) << NVREG_RINGSZ_RXSHIFT) + ((np->tx_ring_size-1) << NVREG_RINGSZ_TXSHIFT),
base + NvRegRingSizes);

/* 5) continue setup */
writel(np->linkspeed, base + NvRegLinkSpeed);
if (np->desc_ver == DESC_VER_1)
writel(NVREG_TX_WM_DESC1_DEFAULT, base + NvRegTxWatermark);
Expand All @@ -3950,7 +3945,6 @@ static int nv_open(struct net_device *dev)
writel(NVREG_IRQSTAT_MASK, base + NvRegIrqStatus);
writel(NVREG_MIISTAT_MASK2, base + NvRegMIIStatus);

/* 6) continue setup */
writel(NVREG_MISC1_FORCE | NVREG_MISC1_HD, base + NvRegMisc1);
writel(readl(base + NvRegTransmitterStatus), base + NvRegTransmitterStatus);
writel(NVREG_PFF_ALWAYS, base + NvRegPacketFilterFlags);
Expand Down Expand Up @@ -4076,12 +4070,6 @@ static int nv_close(struct net_device *dev)
if (np->wolenabled)
nv_start_rx(dev);

/* special op: write back the misordered MAC address - otherwise
* the next nv_probe would see a wrong address.
*/
writel(np->orig_mac[0], base + NvRegMacAddrA);
writel(np->orig_mac[1], base + NvRegMacAddrB);

/* FIXME: power down nic */

return 0;
Expand Down Expand Up @@ -4309,6 +4297,9 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2],
dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5]);

/* set mac address */
nv_copy_mac_to_hw(dev);

/* disable WOL */
writel(0, base + NvRegWakeUpFlags);
np->wolenabled = 0;
Expand Down Expand Up @@ -4421,9 +4412,17 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
static void __devexit nv_remove(struct pci_dev *pci_dev)
{
struct net_device *dev = pci_get_drvdata(pci_dev);
struct fe_priv *np = netdev_priv(dev);
u8 __iomem *base = get_hwbase(dev);

unregister_netdev(dev);

/* special op: write back the misordered MAC address - otherwise
* the next nv_probe would see a wrong address.
*/
writel(np->orig_mac[0], base + NvRegMacAddrA);
writel(np->orig_mac[1], base + NvRegMacAddrB);

/* free all structures */
free_rings(dev);
iounmap(get_hwbase(dev));
Expand Down

0 comments on commit a406d28

Please sign in to comment.