diff options
Diffstat (limited to 'drivers/net/ibm_newemac')
-rw-r--r-- | drivers/net/ibm_newemac/core.c | 39 | ||||
-rw-r--r-- | drivers/net/ibm_newemac/core.h | 6 | ||||
-rw-r--r-- | drivers/net/ibm_newemac/mal.c | 9 | ||||
-rw-r--r-- | drivers/net/ibm_newemac/rgmii.c | 9 | ||||
-rw-r--r-- | drivers/net/ibm_newemac/tah.c | 11 | ||||
-rw-r--r-- | drivers/net/ibm_newemac/zmii.c | 9 |
6 files changed, 34 insertions, 49 deletions
diff --git a/drivers/net/ibm_newemac/core.c b/drivers/net/ibm_newemac/core.c index 519e19e23955..079450fe5e96 100644 --- a/drivers/net/ibm_newemac/core.c +++ b/drivers/net/ibm_newemac/core.c | |||
@@ -1279,7 +1279,7 @@ static void emac_force_link_update(struct emac_instance *dev) | |||
1279 | netif_carrier_off(dev->ndev); | 1279 | netif_carrier_off(dev->ndev); |
1280 | smp_rmb(); | 1280 | smp_rmb(); |
1281 | if (dev->link_polling) { | 1281 | if (dev->link_polling) { |
1282 | cancel_rearming_delayed_work(&dev->link_work); | 1282 | cancel_delayed_work_sync(&dev->link_work); |
1283 | if (dev->link_polling) | 1283 | if (dev->link_polling) |
1284 | schedule_delayed_work(&dev->link_work, PHY_POLL_LINK_OFF); | 1284 | schedule_delayed_work(&dev->link_work, PHY_POLL_LINK_OFF); |
1285 | } | 1285 | } |
@@ -1294,7 +1294,7 @@ static int emac_close(struct net_device *ndev) | |||
1294 | 1294 | ||
1295 | if (dev->phy.address >= 0) { | 1295 | if (dev->phy.address >= 0) { |
1296 | dev->link_polling = 0; | 1296 | dev->link_polling = 0; |
1297 | cancel_rearming_delayed_work(&dev->link_work); | 1297 | cancel_delayed_work_sync(&dev->link_work); |
1298 | } | 1298 | } |
1299 | mutex_lock(&dev->link_lock); | 1299 | mutex_lock(&dev->link_lock); |
1300 | emac_netif_stop(dev); | 1300 | emac_netif_stop(dev); |
@@ -2053,13 +2053,6 @@ static void emac_ethtool_get_pauseparam(struct net_device *ndev, | |||
2053 | mutex_unlock(&dev->link_lock); | 2053 | mutex_unlock(&dev->link_lock); |
2054 | } | 2054 | } |
2055 | 2055 | ||
2056 | static u32 emac_ethtool_get_rx_csum(struct net_device *ndev) | ||
2057 | { | ||
2058 | struct emac_instance *dev = netdev_priv(ndev); | ||
2059 | |||
2060 | return dev->tah_dev != NULL; | ||
2061 | } | ||
2062 | |||
2063 | static int emac_get_regs_len(struct emac_instance *dev) | 2056 | static int emac_get_regs_len(struct emac_instance *dev) |
2064 | { | 2057 | { |
2065 | if (emac_has_feature(dev, EMAC_FTR_EMAC4)) | 2058 | if (emac_has_feature(dev, EMAC_FTR_EMAC4)) |
@@ -2095,11 +2088,11 @@ static void *emac_dump_regs(struct emac_instance *dev, void *buf) | |||
2095 | if (emac_has_feature(dev, EMAC_FTR_EMAC4)) { | 2088 | if (emac_has_feature(dev, EMAC_FTR_EMAC4)) { |
2096 | hdr->version = EMAC4_ETHTOOL_REGS_VER; | 2089 | hdr->version = EMAC4_ETHTOOL_REGS_VER; |
2097 | memcpy_fromio(hdr + 1, dev->emacp, EMAC4_ETHTOOL_REGS_SIZE(dev)); | 2090 | memcpy_fromio(hdr + 1, dev->emacp, EMAC4_ETHTOOL_REGS_SIZE(dev)); |
2098 | return ((void *)(hdr + 1) + EMAC4_ETHTOOL_REGS_SIZE(dev)); | 2091 | return (void *)(hdr + 1) + EMAC4_ETHTOOL_REGS_SIZE(dev); |
2099 | } else { | 2092 | } else { |
2100 | hdr->version = EMAC_ETHTOOL_REGS_VER; | 2093 | hdr->version = EMAC_ETHTOOL_REGS_VER; |
2101 | memcpy_fromio(hdr + 1, dev->emacp, EMAC_ETHTOOL_REGS_SIZE(dev)); | 2094 | memcpy_fromio(hdr + 1, dev->emacp, EMAC_ETHTOOL_REGS_SIZE(dev)); |
2102 | return ((void *)(hdr + 1) + EMAC_ETHTOOL_REGS_SIZE(dev)); | 2095 | return (void *)(hdr + 1) + EMAC_ETHTOOL_REGS_SIZE(dev); |
2103 | } | 2096 | } |
2104 | } | 2097 | } |
2105 | 2098 | ||
@@ -2203,15 +2196,11 @@ static const struct ethtool_ops emac_ethtool_ops = { | |||
2203 | .get_ringparam = emac_ethtool_get_ringparam, | 2196 | .get_ringparam = emac_ethtool_get_ringparam, |
2204 | .get_pauseparam = emac_ethtool_get_pauseparam, | 2197 | .get_pauseparam = emac_ethtool_get_pauseparam, |
2205 | 2198 | ||
2206 | .get_rx_csum = emac_ethtool_get_rx_csum, | ||
2207 | |||
2208 | .get_strings = emac_ethtool_get_strings, | 2199 | .get_strings = emac_ethtool_get_strings, |
2209 | .get_sset_count = emac_ethtool_get_sset_count, | 2200 | .get_sset_count = emac_ethtool_get_sset_count, |
2210 | .get_ethtool_stats = emac_ethtool_get_ethtool_stats, | 2201 | .get_ethtool_stats = emac_ethtool_get_ethtool_stats, |
2211 | 2202 | ||
2212 | .get_link = ethtool_op_get_link, | 2203 | .get_link = ethtool_op_get_link, |
2213 | .get_tx_csum = ethtool_op_get_tx_csum, | ||
2214 | .get_sg = ethtool_op_get_sg, | ||
2215 | }; | 2204 | }; |
2216 | 2205 | ||
2217 | static int emac_ioctl(struct net_device *ndev, struct ifreq *rq, int cmd) | 2206 | static int emac_ioctl(struct net_device *ndev, struct ifreq *rq, int cmd) |
@@ -2293,7 +2282,7 @@ static int __devinit emac_check_deps(struct emac_instance *dev, | |||
2293 | if (deps[i].drvdata != NULL) | 2282 | if (deps[i].drvdata != NULL) |
2294 | there++; | 2283 | there++; |
2295 | } | 2284 | } |
2296 | return (there == EMAC_DEP_COUNT); | 2285 | return there == EMAC_DEP_COUNT; |
2297 | } | 2286 | } |
2298 | 2287 | ||
2299 | static void emac_put_deps(struct emac_instance *dev) | 2288 | static void emac_put_deps(struct emac_instance *dev) |
@@ -2719,8 +2708,7 @@ static const struct net_device_ops emac_gige_netdev_ops = { | |||
2719 | .ndo_change_mtu = emac_change_mtu, | 2708 | .ndo_change_mtu = emac_change_mtu, |
2720 | }; | 2709 | }; |
2721 | 2710 | ||
2722 | static int __devinit emac_probe(struct platform_device *ofdev, | 2711 | static int __devinit emac_probe(struct platform_device *ofdev) |
2723 | const struct of_device_id *match) | ||
2724 | { | 2712 | { |
2725 | struct net_device *ndev; | 2713 | struct net_device *ndev; |
2726 | struct emac_instance *dev; | 2714 | struct emac_instance *dev; |
@@ -2860,8 +2848,10 @@ static int __devinit emac_probe(struct platform_device *ofdev, | |||
2860 | if (err != 0) | 2848 | if (err != 0) |
2861 | goto err_detach_tah; | 2849 | goto err_detach_tah; |
2862 | 2850 | ||
2863 | if (dev->tah_dev) | 2851 | if (dev->tah_dev) { |
2864 | ndev->features |= NETIF_F_IP_CSUM | NETIF_F_SG; | 2852 | ndev->hw_features = NETIF_F_IP_CSUM | NETIF_F_SG; |
2853 | ndev->features |= ndev->hw_features | NETIF_F_RXCSUM; | ||
2854 | } | ||
2865 | ndev->watchdog_timeo = 5 * HZ; | 2855 | ndev->watchdog_timeo = 5 * HZ; |
2866 | if (emac_phy_supports_gige(dev->phy_mode)) { | 2856 | if (emac_phy_supports_gige(dev->phy_mode)) { |
2867 | ndev->netdev_ops = &emac_gige_netdev_ops; | 2857 | ndev->netdev_ops = &emac_gige_netdev_ops; |
@@ -2871,7 +2861,6 @@ static int __devinit emac_probe(struct platform_device *ofdev, | |||
2871 | SET_ETHTOOL_OPS(ndev, &emac_ethtool_ops); | 2861 | SET_ETHTOOL_OPS(ndev, &emac_ethtool_ops); |
2872 | 2862 | ||
2873 | netif_carrier_off(ndev); | 2863 | netif_carrier_off(ndev); |
2874 | netif_stop_queue(ndev); | ||
2875 | 2864 | ||
2876 | err = register_netdev(ndev); | 2865 | err = register_netdev(ndev); |
2877 | if (err) { | 2866 | if (err) { |
@@ -2951,7 +2940,7 @@ static int __devexit emac_remove(struct platform_device *ofdev) | |||
2951 | 2940 | ||
2952 | unregister_netdev(dev->ndev); | 2941 | unregister_netdev(dev->ndev); |
2953 | 2942 | ||
2954 | flush_scheduled_work(); | 2943 | cancel_work_sync(&dev->reset_work); |
2955 | 2944 | ||
2956 | if (emac_has_feature(dev, EMAC_FTR_HAS_TAH)) | 2945 | if (emac_has_feature(dev, EMAC_FTR_HAS_TAH)) |
2957 | tah_detach(dev->tah_dev, dev->tah_port); | 2946 | tah_detach(dev->tah_dev, dev->tah_port); |
@@ -2995,7 +2984,7 @@ static struct of_device_id emac_match[] = | |||
2995 | }; | 2984 | }; |
2996 | MODULE_DEVICE_TABLE(of, emac_match); | 2985 | MODULE_DEVICE_TABLE(of, emac_match); |
2997 | 2986 | ||
2998 | static struct of_platform_driver emac_driver = { | 2987 | static struct platform_driver emac_driver = { |
2999 | .driver = { | 2988 | .driver = { |
3000 | .name = "emac", | 2989 | .name = "emac", |
3001 | .owner = THIS_MODULE, | 2990 | .owner = THIS_MODULE, |
@@ -3070,7 +3059,7 @@ static int __init emac_init(void) | |||
3070 | rc = tah_init(); | 3059 | rc = tah_init(); |
3071 | if (rc) | 3060 | if (rc) |
3072 | goto err_rgmii; | 3061 | goto err_rgmii; |
3073 | rc = of_register_platform_driver(&emac_driver); | 3062 | rc = platform_driver_register(&emac_driver); |
3074 | if (rc) | 3063 | if (rc) |
3075 | goto err_tah; | 3064 | goto err_tah; |
3076 | 3065 | ||
@@ -3092,7 +3081,7 @@ static void __exit emac_exit(void) | |||
3092 | { | 3081 | { |
3093 | int i; | 3082 | int i; |
3094 | 3083 | ||
3095 | of_unregister_platform_driver(&emac_driver); | 3084 | platform_driver_unregister(&emac_driver); |
3096 | 3085 | ||
3097 | tah_exit(); | 3086 | tah_exit(); |
3098 | rgmii_exit(); | 3087 | rgmii_exit(); |
diff --git a/drivers/net/ibm_newemac/core.h b/drivers/net/ibm_newemac/core.h index 9e37e3d9c51d..4fec0844d59d 100644 --- a/drivers/net/ibm_newemac/core.h +++ b/drivers/net/ibm_newemac/core.h | |||
@@ -410,7 +410,7 @@ static inline u32 *emac_xaht_base(struct emac_instance *dev) | |||
410 | else | 410 | else |
411 | offset = offsetof(struct emac_regs, u0.emac4.iaht1); | 411 | offset = offsetof(struct emac_regs, u0.emac4.iaht1); |
412 | 412 | ||
413 | return ((u32 *)((ptrdiff_t)p + offset)); | 413 | return (u32 *)((ptrdiff_t)p + offset); |
414 | } | 414 | } |
415 | 415 | ||
416 | static inline u32 *emac_gaht_base(struct emac_instance *dev) | 416 | static inline u32 *emac_gaht_base(struct emac_instance *dev) |
@@ -418,7 +418,7 @@ static inline u32 *emac_gaht_base(struct emac_instance *dev) | |||
418 | /* GAHT registers always come after an identical number of | 418 | /* GAHT registers always come after an identical number of |
419 | * IAHT registers. | 419 | * IAHT registers. |
420 | */ | 420 | */ |
421 | return (emac_xaht_base(dev) + EMAC_XAHT_REGS(dev)); | 421 | return emac_xaht_base(dev) + EMAC_XAHT_REGS(dev); |
422 | } | 422 | } |
423 | 423 | ||
424 | static inline u32 *emac_iaht_base(struct emac_instance *dev) | 424 | static inline u32 *emac_iaht_base(struct emac_instance *dev) |
@@ -426,7 +426,7 @@ static inline u32 *emac_iaht_base(struct emac_instance *dev) | |||
426 | /* IAHT registers always come before an identical number of | 426 | /* IAHT registers always come before an identical number of |
427 | * GAHT registers. | 427 | * GAHT registers. |
428 | */ | 428 | */ |
429 | return (emac_xaht_base(dev)); | 429 | return emac_xaht_base(dev); |
430 | } | 430 | } |
431 | 431 | ||
432 | /* Ethtool get_regs complex data. | 432 | /* Ethtool get_regs complex data. |
diff --git a/drivers/net/ibm_newemac/mal.c b/drivers/net/ibm_newemac/mal.c index d5717e2123e1..d268f404b7b0 100644 --- a/drivers/net/ibm_newemac/mal.c +++ b/drivers/net/ibm_newemac/mal.c | |||
@@ -517,8 +517,7 @@ void *mal_dump_regs(struct mal_instance *mal, void *buf) | |||
517 | return regs + 1; | 517 | return regs + 1; |
518 | } | 518 | } |
519 | 519 | ||
520 | static int __devinit mal_probe(struct platform_device *ofdev, | 520 | static int __devinit mal_probe(struct platform_device *ofdev) |
521 | const struct of_device_id *match) | ||
522 | { | 521 | { |
523 | struct mal_instance *mal; | 522 | struct mal_instance *mal; |
524 | int err = 0, i, bd_size; | 523 | int err = 0, i, bd_size; |
@@ -789,7 +788,7 @@ static struct of_device_id mal_platform_match[] = | |||
789 | {}, | 788 | {}, |
790 | }; | 789 | }; |
791 | 790 | ||
792 | static struct of_platform_driver mal_of_driver = { | 791 | static struct platform_driver mal_of_driver = { |
793 | .driver = { | 792 | .driver = { |
794 | .name = "mcmal", | 793 | .name = "mcmal", |
795 | .owner = THIS_MODULE, | 794 | .owner = THIS_MODULE, |
@@ -801,10 +800,10 @@ static struct of_platform_driver mal_of_driver = { | |||
801 | 800 | ||
802 | int __init mal_init(void) | 801 | int __init mal_init(void) |
803 | { | 802 | { |
804 | return of_register_platform_driver(&mal_of_driver); | 803 | return platform_driver_register(&mal_of_driver); |
805 | } | 804 | } |
806 | 805 | ||
807 | void mal_exit(void) | 806 | void mal_exit(void) |
808 | { | 807 | { |
809 | of_unregister_platform_driver(&mal_of_driver); | 808 | platform_driver_unregister(&mal_of_driver); |
810 | } | 809 | } |
diff --git a/drivers/net/ibm_newemac/rgmii.c b/drivers/net/ibm_newemac/rgmii.c index dd61798897ac..4fa53f3def64 100644 --- a/drivers/net/ibm_newemac/rgmii.c +++ b/drivers/net/ibm_newemac/rgmii.c | |||
@@ -228,8 +228,7 @@ void *rgmii_dump_regs(struct platform_device *ofdev, void *buf) | |||
228 | } | 228 | } |
229 | 229 | ||
230 | 230 | ||
231 | static int __devinit rgmii_probe(struct platform_device *ofdev, | 231 | static int __devinit rgmii_probe(struct platform_device *ofdev) |
232 | const struct of_device_id *match) | ||
233 | { | 232 | { |
234 | struct device_node *np = ofdev->dev.of_node; | 233 | struct device_node *np = ofdev->dev.of_node; |
235 | struct rgmii_instance *dev; | 234 | struct rgmii_instance *dev; |
@@ -318,7 +317,7 @@ static struct of_device_id rgmii_match[] = | |||
318 | {}, | 317 | {}, |
319 | }; | 318 | }; |
320 | 319 | ||
321 | static struct of_platform_driver rgmii_driver = { | 320 | static struct platform_driver rgmii_driver = { |
322 | .driver = { | 321 | .driver = { |
323 | .name = "emac-rgmii", | 322 | .name = "emac-rgmii", |
324 | .owner = THIS_MODULE, | 323 | .owner = THIS_MODULE, |
@@ -330,10 +329,10 @@ static struct of_platform_driver rgmii_driver = { | |||
330 | 329 | ||
331 | int __init rgmii_init(void) | 330 | int __init rgmii_init(void) |
332 | { | 331 | { |
333 | return of_register_platform_driver(&rgmii_driver); | 332 | return platform_driver_register(&rgmii_driver); |
334 | } | 333 | } |
335 | 334 | ||
336 | void rgmii_exit(void) | 335 | void rgmii_exit(void) |
337 | { | 336 | { |
338 | of_unregister_platform_driver(&rgmii_driver); | 337 | platform_driver_unregister(&rgmii_driver); |
339 | } | 338 | } |
diff --git a/drivers/net/ibm_newemac/tah.c b/drivers/net/ibm_newemac/tah.c index 299aa49490c0..5f51bf7c9dc5 100644 --- a/drivers/net/ibm_newemac/tah.c +++ b/drivers/net/ibm_newemac/tah.c | |||
@@ -60,7 +60,7 @@ void tah_reset(struct platform_device *ofdev) | |||
60 | printk(KERN_ERR "%s: reset timeout\n", | 60 | printk(KERN_ERR "%s: reset timeout\n", |
61 | ofdev->dev.of_node->full_name); | 61 | ofdev->dev.of_node->full_name); |
62 | 62 | ||
63 | /* 10KB TAH TX FIFO accomodates the max MTU of 9000 */ | 63 | /* 10KB TAH TX FIFO accommodates the max MTU of 9000 */ |
64 | out_be32(&p->mr, | 64 | out_be32(&p->mr, |
65 | TAH_MR_CVR | TAH_MR_ST_768 | TAH_MR_TFS_10KB | TAH_MR_DTFP | | 65 | TAH_MR_CVR | TAH_MR_ST_768 | TAH_MR_TFS_10KB | TAH_MR_DTFP | |
66 | TAH_MR_DIG); | 66 | TAH_MR_DIG); |
@@ -87,8 +87,7 @@ void *tah_dump_regs(struct platform_device *ofdev, void *buf) | |||
87 | return regs + 1; | 87 | return regs + 1; |
88 | } | 88 | } |
89 | 89 | ||
90 | static int __devinit tah_probe(struct platform_device *ofdev, | 90 | static int __devinit tah_probe(struct platform_device *ofdev) |
91 | const struct of_device_id *match) | ||
92 | { | 91 | { |
93 | struct device_node *np = ofdev->dev.of_node; | 92 | struct device_node *np = ofdev->dev.of_node; |
94 | struct tah_instance *dev; | 93 | struct tah_instance *dev; |
@@ -165,7 +164,7 @@ static struct of_device_id tah_match[] = | |||
165 | {}, | 164 | {}, |
166 | }; | 165 | }; |
167 | 166 | ||
168 | static struct of_platform_driver tah_driver = { | 167 | static struct platform_driver tah_driver = { |
169 | .driver = { | 168 | .driver = { |
170 | .name = "emac-tah", | 169 | .name = "emac-tah", |
171 | .owner = THIS_MODULE, | 170 | .owner = THIS_MODULE, |
@@ -177,10 +176,10 @@ static struct of_platform_driver tah_driver = { | |||
177 | 176 | ||
178 | int __init tah_init(void) | 177 | int __init tah_init(void) |
179 | { | 178 | { |
180 | return of_register_platform_driver(&tah_driver); | 179 | return platform_driver_register(&tah_driver); |
181 | } | 180 | } |
182 | 181 | ||
183 | void tah_exit(void) | 182 | void tah_exit(void) |
184 | { | 183 | { |
185 | of_unregister_platform_driver(&tah_driver); | 184 | platform_driver_unregister(&tah_driver); |
186 | } | 185 | } |
diff --git a/drivers/net/ibm_newemac/zmii.c b/drivers/net/ibm_newemac/zmii.c index 34ed6ee8ca8a..97449e786d61 100644 --- a/drivers/net/ibm_newemac/zmii.c +++ b/drivers/net/ibm_newemac/zmii.c | |||
@@ -231,8 +231,7 @@ void *zmii_dump_regs(struct platform_device *ofdev, void *buf) | |||
231 | return regs + 1; | 231 | return regs + 1; |
232 | } | 232 | } |
233 | 233 | ||
234 | static int __devinit zmii_probe(struct platform_device *ofdev, | 234 | static int __devinit zmii_probe(struct platform_device *ofdev) |
235 | const struct of_device_id *match) | ||
236 | { | 235 | { |
237 | struct device_node *np = ofdev->dev.of_node; | 236 | struct device_node *np = ofdev->dev.of_node; |
238 | struct zmii_instance *dev; | 237 | struct zmii_instance *dev; |
@@ -312,7 +311,7 @@ static struct of_device_id zmii_match[] = | |||
312 | {}, | 311 | {}, |
313 | }; | 312 | }; |
314 | 313 | ||
315 | static struct of_platform_driver zmii_driver = { | 314 | static struct platform_driver zmii_driver = { |
316 | .driver = { | 315 | .driver = { |
317 | .name = "emac-zmii", | 316 | .name = "emac-zmii", |
318 | .owner = THIS_MODULE, | 317 | .owner = THIS_MODULE, |
@@ -324,10 +323,10 @@ static struct of_platform_driver zmii_driver = { | |||
324 | 323 | ||
325 | int __init zmii_init(void) | 324 | int __init zmii_init(void) |
326 | { | 325 | { |
327 | return of_register_platform_driver(&zmii_driver); | 326 | return platform_driver_register(&zmii_driver); |
328 | } | 327 | } |
329 | 328 | ||
330 | void zmii_exit(void) | 329 | void zmii_exit(void) |
331 | { | 330 | { |
332 | of_unregister_platform_driver(&zmii_driver); | 331 | platform_driver_unregister(&zmii_driver); |
333 | } | 332 | } |