phy_device.c (00db8189d984d6c51226dafbbe4a667ce9b7d5da) phy_device.c (67c4f3fa25502ce7ed82fb0307e09cf36f1f81da)
1/*
2 * drivers/net/phy/phy_device.c
3 *
4 * Framework for finding and configuring PHYs.
5 * Also contains generic PHY driver
6 *
7 * Author: Andy Fleming
8 *

--- 25 unchanged lines hidden (view full) ---

34#include <linux/mii.h>
35#include <linux/ethtool.h>
36#include <linux/phy.h>
37
38#include <asm/io.h>
39#include <asm/irq.h>
40#include <asm/uaccess.h>
41
1/*
2 * drivers/net/phy/phy_device.c
3 *
4 * Framework for finding and configuring PHYs.
5 * Also contains generic PHY driver
6 *
7 * Author: Andy Fleming
8 *

--- 25 unchanged lines hidden (view full) ---

34#include <linux/mii.h>
35#include <linux/ethtool.h>
36#include <linux/phy.h>
37
38#include <asm/io.h>
39#include <asm/irq.h>
40#include <asm/uaccess.h>
41
42static int genphy_config_init(struct phy_device *phydev);
43
44static struct phy_driver genphy_driver = {
45 .phy_id = 0xffffffff,
46 .phy_id_mask = 0xffffffff,
47 .name = "Generic PHY",
48 .config_init = genphy_config_init,
49 .features = 0,
50 .config_aneg = genphy_config_aneg,
51 .read_status = genphy_read_status,
52 .driver = {.owner = THIS_MODULE, },
53};
54
42/* get_phy_device
43 *
44 * description: Reads the ID registers of the PHY at addr on the
45 * bus, then allocates and returns the phy_device to
46 * represent it.
47 */
48struct phy_device * get_phy_device(struct mii_bus *bus, int addr)
49{

--- 601 unchanged lines hidden (view full) ---

651EXPORT_SYMBOL(phy_driver_register);
652
653void phy_driver_unregister(struct phy_driver *drv)
654{
655 driver_unregister(&drv->driver);
656}
657EXPORT_SYMBOL(phy_driver_unregister);
658
55/* get_phy_device
56 *
57 * description: Reads the ID registers of the PHY at addr on the
58 * bus, then allocates and returns the phy_device to
59 * represent it.
60 */
61struct phy_device * get_phy_device(struct mii_bus *bus, int addr)
62{

--- 601 unchanged lines hidden (view full) ---

664EXPORT_SYMBOL(phy_driver_register);
665
666void phy_driver_unregister(struct phy_driver *drv)
667{
668 driver_unregister(&drv->driver);
669}
670EXPORT_SYMBOL(phy_driver_unregister);
671
659static struct phy_driver genphy_driver = {
660 .phy_id = 0xffffffff,
661 .phy_id_mask = 0xffffffff,
662 .name = "Generic PHY",
663 .config_init = genphy_config_init,
664 .features = 0,
665 .config_aneg = genphy_config_aneg,
666 .read_status = genphy_read_status,
667 .driver = {.owner = THIS_MODULE, },
668};
669
672
670static int __init genphy_init(void)
673static int __init phy_init(void)
671{
674{
672 return phy_driver_register(&genphy_driver);
675 int rc;
676 extern int mdio_bus_init(void);
673
677
678 rc = phy_driver_register(&genphy_driver);
679 if (rc)
680 goto out;
681
682 rc = mdio_bus_init();
683 if (rc)
684 goto out_unreg;
685
686 return 0;
687
688out_unreg:
689 phy_driver_unregister(&genphy_driver);
690out:
691 return rc;
674}
675
692}
693
676static void __exit genphy_exit(void)
694static void __exit phy_exit(void)
677{
678 phy_driver_unregister(&genphy_driver);
679}
680
695{
696 phy_driver_unregister(&genphy_driver);
697}
698
681module_init(genphy_init);
682module_exit(genphy_exit);
699module_init(phy_init);
700module_exit(phy_exit);