diff options
Diffstat (limited to 'drivers/net/dm9000.c')
-rw-r--r-- | drivers/net/dm9000.c | 40 |
1 files changed, 19 insertions, 21 deletions
diff --git a/drivers/net/dm9000.c b/drivers/net/dm9000.c index 5a9083e3f443..bcf92917bbf3 100644 --- a/drivers/net/dm9000.c +++ b/drivers/net/dm9000.c | |||
@@ -137,7 +137,7 @@ typedef struct board_info { | |||
137 | 137 | ||
138 | static inline board_info_t *to_dm9000_board(struct net_device *dev) | 138 | static inline board_info_t *to_dm9000_board(struct net_device *dev) |
139 | { | 139 | { |
140 | return dev->priv; | 140 | return netdev_priv(dev); |
141 | } | 141 | } |
142 | 142 | ||
143 | /* DM9000 network board routine ---------------------------- */ | 143 | /* DM9000 network board routine ---------------------------- */ |
@@ -626,7 +626,7 @@ static unsigned char dm9000_type_to_char(enum dm9000_type type) | |||
626 | static void | 626 | static void |
627 | dm9000_hash_table(struct net_device *dev) | 627 | dm9000_hash_table(struct net_device *dev) |
628 | { | 628 | { |
629 | board_info_t *db = (board_info_t *) dev->priv; | 629 | board_info_t *db = netdev_priv(dev); |
630 | struct dev_mc_list *mcptr = dev->mc_list; | 630 | struct dev_mc_list *mcptr = dev->mc_list; |
631 | int mc_cnt = dev->mc_count; | 631 | int mc_cnt = dev->mc_count; |
632 | int i, oft; | 632 | int i, oft; |
@@ -677,7 +677,7 @@ dm9000_hash_table(struct net_device *dev) | |||
677 | static void | 677 | static void |
678 | dm9000_init_dm9000(struct net_device *dev) | 678 | dm9000_init_dm9000(struct net_device *dev) |
679 | { | 679 | { |
680 | board_info_t *db = dev->priv; | 680 | board_info_t *db = netdev_priv(dev); |
681 | unsigned int imr; | 681 | unsigned int imr; |
682 | 682 | ||
683 | dm9000_dbg(db, 1, "entering %s\n", __func__); | 683 | dm9000_dbg(db, 1, "entering %s\n", __func__); |
@@ -723,7 +723,7 @@ dm9000_init_dm9000(struct net_device *dev) | |||
723 | /* Our watchdog timed out. Called by the networking layer */ | 723 | /* Our watchdog timed out. Called by the networking layer */ |
724 | static void dm9000_timeout(struct net_device *dev) | 724 | static void dm9000_timeout(struct net_device *dev) |
725 | { | 725 | { |
726 | board_info_t *db = (board_info_t *) dev->priv; | 726 | board_info_t *db = netdev_priv(dev); |
727 | u8 reg_save; | 727 | u8 reg_save; |
728 | unsigned long flags; | 728 | unsigned long flags; |
729 | 729 | ||
@@ -751,7 +751,7 @@ static int | |||
751 | dm9000_start_xmit(struct sk_buff *skb, struct net_device *dev) | 751 | dm9000_start_xmit(struct sk_buff *skb, struct net_device *dev) |
752 | { | 752 | { |
753 | unsigned long flags; | 753 | unsigned long flags; |
754 | board_info_t *db = dev->priv; | 754 | board_info_t *db = netdev_priv(dev); |
755 | 755 | ||
756 | dm9000_dbg(db, 3, "%s:\n", __func__); | 756 | dm9000_dbg(db, 3, "%s:\n", __func__); |
757 | 757 | ||
@@ -831,7 +831,7 @@ struct dm9000_rxhdr { | |||
831 | static void | 831 | static void |
832 | dm9000_rx(struct net_device *dev) | 832 | dm9000_rx(struct net_device *dev) |
833 | { | 833 | { |
834 | board_info_t *db = (board_info_t *) dev->priv; | 834 | board_info_t *db = netdev_priv(dev); |
835 | struct dm9000_rxhdr rxhdr; | 835 | struct dm9000_rxhdr rxhdr; |
836 | struct sk_buff *skb; | 836 | struct sk_buff *skb; |
837 | u8 rxbyte, *rdptr; | 837 | u8 rxbyte, *rdptr; |
@@ -928,7 +928,7 @@ dm9000_rx(struct net_device *dev) | |||
928 | static irqreturn_t dm9000_interrupt(int irq, void *dev_id) | 928 | static irqreturn_t dm9000_interrupt(int irq, void *dev_id) |
929 | { | 929 | { |
930 | struct net_device *dev = dev_id; | 930 | struct net_device *dev = dev_id; |
931 | board_info_t *db = dev->priv; | 931 | board_info_t *db = netdev_priv(dev); |
932 | int int_status; | 932 | int int_status; |
933 | u8 reg_save; | 933 | u8 reg_save; |
934 | 934 | ||
@@ -996,7 +996,7 @@ static void dm9000_poll_controller(struct net_device *dev) | |||
996 | static int | 996 | static int |
997 | dm9000_open(struct net_device *dev) | 997 | dm9000_open(struct net_device *dev) |
998 | { | 998 | { |
999 | board_info_t *db = dev->priv; | 999 | board_info_t *db = netdev_priv(dev); |
1000 | unsigned long irqflags = db->irq_res->flags & IRQF_TRIGGER_MASK; | 1000 | unsigned long irqflags = db->irq_res->flags & IRQF_TRIGGER_MASK; |
1001 | 1001 | ||
1002 | if (netif_msg_ifup(db)) | 1002 | if (netif_msg_ifup(db)) |
@@ -1046,7 +1046,7 @@ static void dm9000_msleep(board_info_t *db, unsigned int ms) | |||
1046 | static int | 1046 | static int |
1047 | dm9000_phy_read(struct net_device *dev, int phy_reg_unused, int reg) | 1047 | dm9000_phy_read(struct net_device *dev, int phy_reg_unused, int reg) |
1048 | { | 1048 | { |
1049 | board_info_t *db = (board_info_t *) dev->priv; | 1049 | board_info_t *db = netdev_priv(dev); |
1050 | unsigned long flags; | 1050 | unsigned long flags; |
1051 | unsigned int reg_save; | 1051 | unsigned int reg_save; |
1052 | int ret; | 1052 | int ret; |
@@ -1093,7 +1093,7 @@ static void | |||
1093 | dm9000_phy_write(struct net_device *dev, | 1093 | dm9000_phy_write(struct net_device *dev, |
1094 | int phyaddr_unused, int reg, int value) | 1094 | int phyaddr_unused, int reg, int value) |
1095 | { | 1095 | { |
1096 | board_info_t *db = (board_info_t *) dev->priv; | 1096 | board_info_t *db = netdev_priv(dev); |
1097 | unsigned long flags; | 1097 | unsigned long flags; |
1098 | unsigned long reg_save; | 1098 | unsigned long reg_save; |
1099 | 1099 | ||
@@ -1134,7 +1134,7 @@ dm9000_phy_write(struct net_device *dev, | |||
1134 | static void | 1134 | static void |
1135 | dm9000_shutdown(struct net_device *dev) | 1135 | dm9000_shutdown(struct net_device *dev) |
1136 | { | 1136 | { |
1137 | board_info_t *db = dev->priv; | 1137 | board_info_t *db = netdev_priv(dev); |
1138 | 1138 | ||
1139 | /* RESET device */ | 1139 | /* RESET device */ |
1140 | dm9000_phy_write(dev, 0, MII_BMCR, BMCR_RESET); /* PHY RESET */ | 1140 | dm9000_phy_write(dev, 0, MII_BMCR, BMCR_RESET); /* PHY RESET */ |
@@ -1150,7 +1150,7 @@ dm9000_shutdown(struct net_device *dev) | |||
1150 | static int | 1150 | static int |
1151 | dm9000_stop(struct net_device *ndev) | 1151 | dm9000_stop(struct net_device *ndev) |
1152 | { | 1152 | { |
1153 | board_info_t *db = ndev->priv; | 1153 | board_info_t *db = netdev_priv(ndev); |
1154 | 1154 | ||
1155 | if (netif_msg_ifdown(db)) | 1155 | if (netif_msg_ifdown(db)) |
1156 | dev_dbg(db->dev, "shutting down %s\n", ndev->name); | 1156 | dev_dbg(db->dev, "shutting down %s\n", ndev->name); |
@@ -1197,7 +1197,7 @@ dm9000_probe(struct platform_device *pdev) | |||
1197 | dev_dbg(&pdev->dev, "dm9000_probe()\n"); | 1197 | dev_dbg(&pdev->dev, "dm9000_probe()\n"); |
1198 | 1198 | ||
1199 | /* setup board info structure */ | 1199 | /* setup board info structure */ |
1200 | db = ndev->priv; | 1200 | db = netdev_priv(ndev); |
1201 | memset(db, 0, sizeof(*db)); | 1201 | memset(db, 0, sizeof(*db)); |
1202 | 1202 | ||
1203 | db->dev = &pdev->dev; | 1203 | db->dev = &pdev->dev; |
@@ -1385,13 +1385,11 @@ dm9000_probe(struct platform_device *pdev) | |||
1385 | platform_set_drvdata(pdev, ndev); | 1385 | platform_set_drvdata(pdev, ndev); |
1386 | ret = register_netdev(ndev); | 1386 | ret = register_netdev(ndev); |
1387 | 1387 | ||
1388 | if (ret == 0) { | 1388 | if (ret == 0) |
1389 | DECLARE_MAC_BUF(mac); | 1389 | printk(KERN_INFO "%s: dm9000%c at %p,%p IRQ %d MAC: %pM (%s)\n", |
1390 | printk(KERN_INFO "%s: dm9000%c at %p,%p IRQ %d MAC: %s (%s)\n", | ||
1391 | ndev->name, dm9000_type_to_char(db->type), | 1390 | ndev->name, dm9000_type_to_char(db->type), |
1392 | db->io_addr, db->io_data, ndev->irq, | 1391 | db->io_addr, db->io_data, ndev->irq, |
1393 | print_mac(mac, ndev->dev_addr), mac_src); | 1392 | ndev->dev_addr, mac_src); |
1394 | } | ||
1395 | return 0; | 1393 | return 0; |
1396 | 1394 | ||
1397 | out: | 1395 | out: |
@@ -1410,7 +1408,7 @@ dm9000_drv_suspend(struct platform_device *dev, pm_message_t state) | |||
1410 | board_info_t *db; | 1408 | board_info_t *db; |
1411 | 1409 | ||
1412 | if (ndev) { | 1410 | if (ndev) { |
1413 | db = (board_info_t *) ndev->priv; | 1411 | db = netdev_priv(ndev); |
1414 | db->in_suspend = 1; | 1412 | db->in_suspend = 1; |
1415 | 1413 | ||
1416 | if (netif_running(ndev)) { | 1414 | if (netif_running(ndev)) { |
@@ -1425,7 +1423,7 @@ static int | |||
1425 | dm9000_drv_resume(struct platform_device *dev) | 1423 | dm9000_drv_resume(struct platform_device *dev) |
1426 | { | 1424 | { |
1427 | struct net_device *ndev = platform_get_drvdata(dev); | 1425 | struct net_device *ndev = platform_get_drvdata(dev); |
1428 | board_info_t *db = (board_info_t *) ndev->priv; | 1426 | board_info_t *db = netdev_priv(ndev); |
1429 | 1427 | ||
1430 | if (ndev) { | 1428 | if (ndev) { |
1431 | 1429 | ||
@@ -1449,7 +1447,7 @@ dm9000_drv_remove(struct platform_device *pdev) | |||
1449 | platform_set_drvdata(pdev, NULL); | 1447 | platform_set_drvdata(pdev, NULL); |
1450 | 1448 | ||
1451 | unregister_netdev(ndev); | 1449 | unregister_netdev(ndev); |
1452 | dm9000_release_board(pdev, (board_info_t *) ndev->priv); | 1450 | dm9000_release_board(pdev, (board_info_t *) netdev_priv(ndev)); |
1453 | free_netdev(ndev); /* free device structure */ | 1451 | free_netdev(ndev); /* free device structure */ |
1454 | 1452 | ||
1455 | dev_dbg(&pdev->dev, "released and freed device\n"); | 1453 | dev_dbg(&pdev->dev, "released and freed device\n"); |