diff options
| author | David S. Miller <davem@davemloft.net> | 2008-04-25 03:31:07 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2008-04-25 03:31:07 -0400 |
| commit | cc93d7d77d28d65d4f947dabc95a01c42d713ea3 (patch) | |
| tree | bdaa01a54c7d881b7087551daf85fa52c61b3d1c /Documentation/networking/phy.txt | |
| parent | 461e6c856faf9cdd8862fa4d0785974a64e39dba (diff) | |
| parent | f946dffed6334f08da065a89ed65026ebf8b33b4 (diff) | |
Merge branch 'upstream-davem' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6
Diffstat (limited to 'Documentation/networking/phy.txt')
| -rw-r--r-- | Documentation/networking/phy.txt | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/Documentation/networking/phy.txt b/Documentation/networking/phy.txt index 0bc95eab1512..8df6a7b0e66c 100644 --- a/Documentation/networking/phy.txt +++ b/Documentation/networking/phy.txt | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | 1 | ||
| 2 | ------- | 2 | ------- |
| 3 | PHY Abstraction Layer | 3 | PHY Abstraction Layer |
| 4 | (Updated 2006-11-30) | 4 | (Updated 2008-04-08) |
| 5 | 5 | ||
| 6 | Purpose | 6 | Purpose |
| 7 | 7 | ||
| @@ -291,3 +291,39 @@ Writing a PHY driver | |||
| 291 | Feel free to look at the Marvell, Cicada, and Davicom drivers in | 291 | Feel free to look at the Marvell, Cicada, and Davicom drivers in |
| 292 | drivers/net/phy/ for examples (the lxt and qsemi drivers have | 292 | drivers/net/phy/ for examples (the lxt and qsemi drivers have |
| 293 | not been tested as of this writing) | 293 | not been tested as of this writing) |
| 294 | |||
| 295 | Board Fixups | ||
| 296 | |||
| 297 | Sometimes the specific interaction between the platform and the PHY requires | ||
| 298 | special handling. For instance, to change where the PHY's clock input is, | ||
| 299 | or to add a delay to account for latency issues in the data path. In order | ||
| 300 | to support such contingencies, the PHY Layer allows platform code to register | ||
| 301 | fixups to be run when the PHY is brought up (or subsequently reset). | ||
| 302 | |||
| 303 | When the PHY Layer brings up a PHY it checks to see if there are any fixups | ||
| 304 | registered for it, matching based on UID (contained in the PHY device's phy_id | ||
| 305 | field) and the bus identifier (contained in phydev->dev.bus_id). Both must | ||
| 306 | match, however two constants, PHY_ANY_ID and PHY_ANY_UID, are provided as | ||
| 307 | wildcards for the bus ID and UID, respectively. | ||
| 308 | |||
| 309 | When a match is found, the PHY layer will invoke the run function associated | ||
| 310 | with the fixup. This function is passed a pointer to the phy_device of | ||
| 311 | interest. It should therefore only operate on that PHY. | ||
| 312 | |||
| 313 | The platform code can either register the fixup using phy_register_fixup(): | ||
| 314 | |||
| 315 | int phy_register_fixup(const char *phy_id, | ||
| 316 | u32 phy_uid, u32 phy_uid_mask, | ||
| 317 | int (*run)(struct phy_device *)); | ||
| 318 | |||
| 319 | Or using one of the two stubs, phy_register_fixup_for_uid() and | ||
| 320 | phy_register_fixup_for_id(): | ||
| 321 | |||
| 322 | int phy_register_fixup_for_uid(u32 phy_uid, u32 phy_uid_mask, | ||
| 323 | int (*run)(struct phy_device *)); | ||
| 324 | int phy_register_fixup_for_id(const char *phy_id, | ||
| 325 | int (*run)(struct phy_device *)); | ||
| 326 | |||
| 327 | The stubs set one of the two matching criteria, and set the other one to | ||
| 328 | match anything. | ||
| 329 | |||
