diff options
Diffstat (limited to 'arch/ppc')
-rw-r--r-- | arch/ppc/8260_io/fcc_enet.c | 21 | ||||
-rw-r--r-- | arch/ppc/8xx_io/fec.c | 21 |
2 files changed, 26 insertions, 16 deletions
diff --git a/arch/ppc/8260_io/fcc_enet.c b/arch/ppc/8260_io/fcc_enet.c index 2e1943e27819..709952c25f29 100644 --- a/arch/ppc/8260_io/fcc_enet.c +++ b/arch/ppc/8260_io/fcc_enet.c | |||
@@ -385,6 +385,7 @@ struct fcc_enet_private { | |||
385 | phy_info_t *phy; | 385 | phy_info_t *phy; |
386 | struct work_struct phy_relink; | 386 | struct work_struct phy_relink; |
387 | struct work_struct phy_display_config; | 387 | struct work_struct phy_display_config; |
388 | struct net_device *dev; | ||
388 | 389 | ||
389 | uint sequence_done; | 390 | uint sequence_done; |
390 | 391 | ||
@@ -1391,10 +1392,11 @@ static phy_info_t *phy_info[] = { | |||
1391 | NULL | 1392 | NULL |
1392 | }; | 1393 | }; |
1393 | 1394 | ||
1394 | static void mii_display_status(void *data) | 1395 | static void mii_display_status(struct work_struct *work) |
1395 | { | 1396 | { |
1396 | struct net_device *dev = data; | 1397 | volatile struct fcc_enet_private *fep = |
1397 | volatile struct fcc_enet_private *fep = dev->priv; | 1398 | container_of(work, struct fcc_enet_private, phy_relink); |
1399 | struct net_device *dev = fep->dev; | ||
1398 | uint s = fep->phy_status; | 1400 | uint s = fep->phy_status; |
1399 | 1401 | ||
1400 | if (!fep->link && !fep->old_link) { | 1402 | if (!fep->link && !fep->old_link) { |
@@ -1428,10 +1430,12 @@ static void mii_display_status(void *data) | |||
1428 | printk(".\n"); | 1430 | printk(".\n"); |
1429 | } | 1431 | } |
1430 | 1432 | ||
1431 | static void mii_display_config(void *data) | 1433 | static void mii_display_config(struct work_struct *work) |
1432 | { | 1434 | { |
1433 | struct net_device *dev = data; | 1435 | volatile struct fcc_enet_private *fep = |
1434 | volatile struct fcc_enet_private *fep = dev->priv; | 1436 | container_of(work, struct fcc_enet_private, |
1437 | phy_display_config); | ||
1438 | struct net_device *dev = fep->dev; | ||
1435 | uint s = fep->phy_status; | 1439 | uint s = fep->phy_status; |
1436 | 1440 | ||
1437 | printk("%s: config: auto-negotiation ", dev->name); | 1441 | printk("%s: config: auto-negotiation ", dev->name); |
@@ -1758,8 +1762,9 @@ static int __init fec_enet_init(void) | |||
1758 | cep->phy_id_done = 0; | 1762 | cep->phy_id_done = 0; |
1759 | cep->phy_addr = fip->fc_phyaddr; | 1763 | cep->phy_addr = fip->fc_phyaddr; |
1760 | mii_queue(dev, mk_mii_read(MII_PHYSID1), mii_discover_phy); | 1764 | mii_queue(dev, mk_mii_read(MII_PHYSID1), mii_discover_phy); |
1761 | INIT_WORK(&cep->phy_relink, mii_display_status, dev); | 1765 | INIT_WORK(&cep->phy_relink, mii_display_status); |
1762 | INIT_WORK(&cep->phy_display_config, mii_display_config, dev); | 1766 | INIT_WORK(&cep->phy_display_config, mii_display_config); |
1767 | cep->dev = dev; | ||
1763 | #endif /* CONFIG_USE_MDIO */ | 1768 | #endif /* CONFIG_USE_MDIO */ |
1764 | 1769 | ||
1765 | fip++; | 1770 | fip++; |
diff --git a/arch/ppc/8xx_io/fec.c b/arch/ppc/8xx_io/fec.c index 2f9fa9e3d331..e6c28fb423b2 100644 --- a/arch/ppc/8xx_io/fec.c +++ b/arch/ppc/8xx_io/fec.c | |||
@@ -173,6 +173,7 @@ struct fec_enet_private { | |||
173 | uint phy_speed; | 173 | uint phy_speed; |
174 | phy_info_t *phy; | 174 | phy_info_t *phy; |
175 | struct work_struct phy_task; | 175 | struct work_struct phy_task; |
176 | struct net_device *dev; | ||
176 | 177 | ||
177 | uint sequence_done; | 178 | uint sequence_done; |
178 | 179 | ||
@@ -1263,10 +1264,11 @@ static void mii_display_status(struct net_device *dev) | |||
1263 | printk(".\n"); | 1264 | printk(".\n"); |
1264 | } | 1265 | } |
1265 | 1266 | ||
1266 | static void mii_display_config(void *priv) | 1267 | static void mii_display_config(struct work_struct *work) |
1267 | { | 1268 | { |
1268 | struct net_device *dev = (struct net_device *)priv; | 1269 | struct fec_enet_private *fep = |
1269 | struct fec_enet_private *fep = dev->priv; | 1270 | container_of(work, struct fec_enet_private, phy_task); |
1271 | struct net_device *dev = fep->dev; | ||
1270 | volatile uint *s = &(fep->phy_status); | 1272 | volatile uint *s = &(fep->phy_status); |
1271 | 1273 | ||
1272 | printk("%s: config: auto-negotiation ", dev->name); | 1274 | printk("%s: config: auto-negotiation ", dev->name); |
@@ -1295,10 +1297,11 @@ static void mii_display_config(void *priv) | |||
1295 | fep->sequence_done = 1; | 1297 | fep->sequence_done = 1; |
1296 | } | 1298 | } |
1297 | 1299 | ||
1298 | static void mii_relink(void *priv) | 1300 | static void mii_relink(struct work_struct *work) |
1299 | { | 1301 | { |
1300 | struct net_device *dev = (struct net_device *)priv; | 1302 | struct fec_enet_private *fep = |
1301 | struct fec_enet_private *fep = dev->priv; | 1303 | container_of(work, struct fec_enet_private, phy_task); |
1304 | struct net_device *dev = fep->dev; | ||
1302 | int duplex; | 1305 | int duplex; |
1303 | 1306 | ||
1304 | fep->link = (fep->phy_status & PHY_STAT_LINK) ? 1 : 0; | 1307 | fep->link = (fep->phy_status & PHY_STAT_LINK) ? 1 : 0; |
@@ -1325,7 +1328,8 @@ static void mii_queue_relink(uint mii_reg, struct net_device *dev) | |||
1325 | { | 1328 | { |
1326 | struct fec_enet_private *fep = dev->priv; | 1329 | struct fec_enet_private *fep = dev->priv; |
1327 | 1330 | ||
1328 | INIT_WORK(&fep->phy_task, mii_relink, (void *)dev); | 1331 | fep->dev = dev; |
1332 | INIT_WORK(&fep->phy_task, mii_relink); | ||
1329 | schedule_work(&fep->phy_task); | 1333 | schedule_work(&fep->phy_task); |
1330 | } | 1334 | } |
1331 | 1335 | ||
@@ -1333,7 +1337,8 @@ static void mii_queue_config(uint mii_reg, struct net_device *dev) | |||
1333 | { | 1337 | { |
1334 | struct fec_enet_private *fep = dev->priv; | 1338 | struct fec_enet_private *fep = dev->priv; |
1335 | 1339 | ||
1336 | INIT_WORK(&fep->phy_task, mii_display_config, (void *)dev); | 1340 | fep->dev = dev; |
1341 | INIT_WORK(&fep->phy_task, mii_display_config); | ||
1337 | schedule_work(&fep->phy_task); | 1342 | schedule_work(&fep->phy_task); |
1338 | } | 1343 | } |
1339 | 1344 | ||