diff options
author | Grant Likely <grant.likely@secretlab.ca> | 2012-07-25 00:31:09 -0400 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2012-07-25 00:34:40 -0400 |
commit | 6aeea3ecc33b1f36dbc3b80461d15a7052ae424f (patch) | |
tree | bbd273e3e0ca76094aed8e9c77e5adfe2b07f779 /include/linux/phy.h | |
parent | 9844a5524ec532aee826c35e3031637c7fc8287b (diff) | |
parent | bdc0077af574800d24318b6945cf2344e8dbb050 (diff) |
Merge remote-tracking branch 'origin' into irqdomain/next
Diffstat (limited to 'include/linux/phy.h')
-rw-r--r-- | include/linux/phy.h | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/include/linux/phy.h b/include/linux/phy.h index c291cae8ce32..93b3cf77f564 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h | |||
@@ -243,6 +243,15 @@ enum phy_state { | |||
243 | PHY_RESUMING | 243 | PHY_RESUMING |
244 | }; | 244 | }; |
245 | 245 | ||
246 | /** | ||
247 | * struct phy_c45_device_ids - 802.3-c45 Device Identifiers | ||
248 | * @devices_in_package: Bit vector of devices present. | ||
249 | * @device_ids: The device identifer for each present device. | ||
250 | */ | ||
251 | struct phy_c45_device_ids { | ||
252 | u32 devices_in_package; | ||
253 | u32 device_ids[8]; | ||
254 | }; | ||
246 | 255 | ||
247 | /* phy_device: An instance of a PHY | 256 | /* phy_device: An instance of a PHY |
248 | * | 257 | * |
@@ -250,6 +259,8 @@ enum phy_state { | |||
250 | * bus: Pointer to the bus this PHY is on | 259 | * bus: Pointer to the bus this PHY is on |
251 | * dev: driver model device structure for this PHY | 260 | * dev: driver model device structure for this PHY |
252 | * phy_id: UID for this device found during discovery | 261 | * phy_id: UID for this device found during discovery |
262 | * c45_ids: 802.3-c45 Device Identifers if is_c45. | ||
263 | * is_c45: Set to true if this phy uses clause 45 addressing. | ||
253 | * state: state of the PHY for management purposes | 264 | * state: state of the PHY for management purposes |
254 | * dev_flags: Device-specific flags used by the PHY driver. | 265 | * dev_flags: Device-specific flags used by the PHY driver. |
255 | * addr: Bus address of PHY | 266 | * addr: Bus address of PHY |
@@ -285,6 +296,9 @@ struct phy_device { | |||
285 | 296 | ||
286 | u32 phy_id; | 297 | u32 phy_id; |
287 | 298 | ||
299 | struct phy_c45_device_ids c45_ids; | ||
300 | bool is_c45; | ||
301 | |||
288 | enum phy_state state; | 302 | enum phy_state state; |
289 | 303 | ||
290 | u32 dev_flags; | 304 | u32 dev_flags; |
@@ -412,6 +426,12 @@ struct phy_driver { | |||
412 | /* Clears up any memory if needed */ | 426 | /* Clears up any memory if needed */ |
413 | void (*remove)(struct phy_device *phydev); | 427 | void (*remove)(struct phy_device *phydev); |
414 | 428 | ||
429 | /* Returns true if this is a suitable driver for the given | ||
430 | * phydev. If NULL, matching is based on phy_id and | ||
431 | * phy_id_mask. | ||
432 | */ | ||
433 | int (*match_phy_device)(struct phy_device *phydev); | ||
434 | |||
415 | /* Handles ethtool queries for hardware time stamping. */ | 435 | /* Handles ethtool queries for hardware time stamping. */ |
416 | int (*ts_info)(struct phy_device *phydev, struct ethtool_ts_info *ti); | 436 | int (*ts_info)(struct phy_device *phydev, struct ethtool_ts_info *ti); |
417 | 437 | ||
@@ -480,7 +500,9 @@ static inline int phy_write(struct phy_device *phydev, u32 regnum, u16 val) | |||
480 | return mdiobus_write(phydev->bus, phydev->addr, regnum, val); | 500 | return mdiobus_write(phydev->bus, phydev->addr, regnum, val); |
481 | } | 501 | } |
482 | 502 | ||
483 | struct phy_device* get_phy_device(struct mii_bus *bus, int addr); | 503 | struct phy_device *phy_device_create(struct mii_bus *bus, int addr, int phy_id, |
504 | bool is_c45, struct phy_c45_device_ids *c45_ids); | ||
505 | struct phy_device *get_phy_device(struct mii_bus *bus, int addr, bool is_c45); | ||
484 | int phy_device_register(struct phy_device *phy); | 506 | int phy_device_register(struct phy_device *phy); |
485 | int phy_init_hw(struct phy_device *phydev); | 507 | int phy_init_hw(struct phy_device *phydev); |
486 | struct phy_device * phy_attach(struct net_device *dev, | 508 | struct phy_device * phy_attach(struct net_device *dev, |
@@ -511,7 +533,9 @@ int genphy_read_status(struct phy_device *phydev); | |||
511 | int genphy_suspend(struct phy_device *phydev); | 533 | int genphy_suspend(struct phy_device *phydev); |
512 | int genphy_resume(struct phy_device *phydev); | 534 | int genphy_resume(struct phy_device *phydev); |
513 | void phy_driver_unregister(struct phy_driver *drv); | 535 | void phy_driver_unregister(struct phy_driver *drv); |
536 | void phy_drivers_unregister(struct phy_driver *drv, int n); | ||
514 | int phy_driver_register(struct phy_driver *new_driver); | 537 | int phy_driver_register(struct phy_driver *new_driver); |
538 | int phy_drivers_register(struct phy_driver *new_driver, int n); | ||
515 | void phy_state_machine(struct work_struct *work); | 539 | void phy_state_machine(struct work_struct *work); |
516 | void phy_start_machine(struct phy_device *phydev, | 540 | void phy_start_machine(struct phy_device *phydev, |
517 | void (*handler)(struct net_device *)); | 541 | void (*handler)(struct net_device *)); |
@@ -532,6 +556,11 @@ int phy_register_fixup_for_uid(u32 phy_uid, u32 phy_uid_mask, | |||
532 | int (*run)(struct phy_device *)); | 556 | int (*run)(struct phy_device *)); |
533 | int phy_scan_fixups(struct phy_device *phydev); | 557 | int phy_scan_fixups(struct phy_device *phydev); |
534 | 558 | ||
559 | int phy_init_eee(struct phy_device *phydev, bool clk_stop_enable); | ||
560 | int phy_get_eee_err(struct phy_device *phydev); | ||
561 | int phy_ethtool_set_eee(struct phy_device *phydev, struct ethtool_eee *data); | ||
562 | int phy_ethtool_get_eee(struct phy_device *phydev, struct ethtool_eee *data); | ||
563 | |||
535 | int __init mdio_bus_init(void); | 564 | int __init mdio_bus_init(void); |
536 | void mdio_bus_exit(void); | 565 | void mdio_bus_exit(void); |
537 | 566 | ||