aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/phy.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/phy.h')
-rw-r--r--include/linux/phy.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/include/linux/phy.h b/include/linux/phy.h
index d090cfcaa167..22af8f8f5802 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -433,6 +433,7 @@ struct phy_device {
433 * by this PHY 433 * by this PHY
434 * flags: A bitfield defining certain other features this PHY 434 * flags: A bitfield defining certain other features this PHY
435 * supports (like interrupts) 435 * supports (like interrupts)
436 * driver_data: static driver data
436 * 437 *
437 * The drivers must implement config_aneg and read_status. All 438 * The drivers must implement config_aneg and read_status. All
438 * other functions are optional. Note that none of these 439 * other functions are optional. Note that none of these
@@ -448,6 +449,7 @@ struct phy_driver {
448 unsigned int phy_id_mask; 449 unsigned int phy_id_mask;
449 u32 features; 450 u32 features;
450 u32 flags; 451 u32 flags;
452 const void *driver_data;
451 453
452 /* 454 /*
453 * Called to issue a PHY software reset 455 * Called to issue a PHY software reset
@@ -772,4 +774,28 @@ int __init mdio_bus_init(void);
772void mdio_bus_exit(void); 774void mdio_bus_exit(void);
773 775
774extern struct bus_type mdio_bus_type; 776extern struct bus_type mdio_bus_type;
777
778/**
779 * module_phy_driver() - Helper macro for registering PHY drivers
780 * @__phy_drivers: array of PHY drivers to register
781 *
782 * Helper macro for PHY drivers which do not do anything special in module
783 * init/exit. Each module may only use this macro once, and calling it
784 * replaces module_init() and module_exit().
785 */
786#define phy_module_driver(__phy_drivers, __count) \
787static int __init phy_module_init(void) \
788{ \
789 return phy_drivers_register(__phy_drivers, __count); \
790} \
791module_init(phy_module_init); \
792static void __exit phy_module_exit(void) \
793{ \
794 phy_drivers_unregister(__phy_drivers, __count); \
795} \
796module_exit(phy_module_exit)
797
798#define module_phy_driver(__phy_drivers) \
799 phy_module_driver(__phy_drivers, ARRAY_SIZE(__phy_drivers))
800
775#endif /* __PHY_H */ 801#endif /* __PHY_H */