Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 44887
b: refs/heads/master
c: ef8142a
h: refs/heads/master
i:
  44885: cffd0d0
  44883: da6fac2
  44879: 127c43e
v: v3
  • Loading branch information
Andrew Morton authored and Linus Torvalds committed Dec 22, 2006
1 parent d27a9cb commit 1eaedf6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 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: 9b6d2efed2f4cfa07827d3e497655ce91dd97866
refs/heads/master: ef8142a525c58dec325e8dd9a7bf92fb240d05c7
21 changes: 14 additions & 7 deletions trunk/drivers/net/smc911x.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ struct smc911x_local {
int tx_throttle;
spinlock_t lock;

struct net_device *netdev;

#ifdef SMC_USE_DMA
/* DMA needs the physical address of the chip */
u_long physaddr;
Expand Down Expand Up @@ -948,10 +950,11 @@ static void smc911x_phy_check_media(struct net_device *dev, int init)
* of autonegotiation.) If the RPC ANEG bit is cleared, the selection
* is controlled by the RPC SPEED and RPC DPLX bits.
*/
static void smc911x_phy_configure(void *data)
static void smc911x_phy_configure(struct work_struct *work)
{
struct net_device *dev = data;
struct smc911x_local *lp = netdev_priv(dev);
struct smc911x_local *lp = container_of(work, struct smc911x_local,
phy_configure);
struct net_device *dev = lp->netdev;
unsigned long ioaddr = dev->base_addr;
int phyaddr = lp->mii.phy_id;
int my_phy_caps; /* My PHY capabilities */
Expand Down Expand Up @@ -1495,6 +1498,8 @@ static void smc911x_set_multicast_list(struct net_device *dev)
static int
smc911x_open(struct net_device *dev)
{
struct smc911x_local *lp = netdev_priv(dev);

DBG(SMC_DEBUG_FUNC, "%s: --> %s\n", dev->name, __FUNCTION__);

/*
Expand All @@ -1511,7 +1516,7 @@ smc911x_open(struct net_device *dev)
smc911x_reset(dev);

/* Configure the PHY, initialize the link state */
smc911x_phy_configure(dev);
smc911x_phy_configure(&lp->phy_configure);

/* Turn on Tx + Rx */
smc911x_enable(dev);
Expand Down Expand Up @@ -2060,7 +2065,7 @@ static int __init smc911x_probe(struct net_device *dev, unsigned long ioaddr)
dev->poll_controller = smc911x_poll_controller;
#endif

INIT_WORK(&lp->phy_configure, smc911x_phy_configure, dev);
INIT_WORK(&lp->phy_configure, smc911x_phy_configure);
lp->mii.phy_id_mask = 0x1f;
lp->mii.reg_num_mask = 0x1f;
lp->mii.force_media = 0;
Expand Down Expand Up @@ -2154,6 +2159,7 @@ static int smc911x_drv_probe(struct platform_device *pdev)
{
struct net_device *ndev;
struct resource *res;
struct smc911x_local *lp;
unsigned int *addr;
int ret;

Expand Down Expand Up @@ -2183,6 +2189,8 @@ static int smc911x_drv_probe(struct platform_device *pdev)

ndev->dma = (unsigned char)-1;
ndev->irq = platform_get_irq(pdev, 0);
lp = netdev_priv(ndev);
lp->netdev = ndev;

addr = ioremap(res->start, SMC911X_IO_EXTENT);
if (!addr) {
Expand All @@ -2204,7 +2212,6 @@ static int smc911x_drv_probe(struct platform_device *pdev)
}
#ifdef SMC_USE_DMA
else {
struct smc911x_local *lp = netdev_priv(ndev);
lp->physaddr = res->start;
lp->dev = &pdev->dev;
}
Expand Down Expand Up @@ -2275,7 +2282,7 @@ static int smc911x_drv_resume(struct platform_device *dev)
smc911x_reset(ndev);
smc911x_enable(ndev);
if (lp->phy_type != 0)
smc911x_phy_configure(ndev);
smc911x_phy_configure(&lp->phy_configure);
netif_device_attach(ndev);
}
}
Expand Down

0 comments on commit 1eaedf6

Please sign in to comment.