diff options
-rw-r--r-- | Documentation/networking/phy.txt | 18 | ||||
-rw-r--r-- | drivers/net/phy/phy.c | 13 | ||||
-rw-r--r-- | drivers/net/phy/phy_device.c | 19 | ||||
-rw-r--r-- | include/linux/phy.h | 12 |
4 files changed, 15 insertions, 47 deletions
diff --git a/Documentation/networking/phy.txt b/Documentation/networking/phy.txt index 88bb71b46da4..9eb1ba52013d 100644 --- a/Documentation/networking/phy.txt +++ b/Documentation/networking/phy.txt | |||
@@ -177,18 +177,6 @@ Doing it all yourself | |||
177 | 177 | ||
178 | A convenience function to print out the PHY status neatly. | 178 | A convenience function to print out the PHY status neatly. |
179 | 179 | ||
180 | int phy_clear_interrupt(struct phy_device *phydev); | ||
181 | int phy_config_interrupt(struct phy_device *phydev, u32 interrupts); | ||
182 | |||
183 | Clear the PHY's interrupt, and configure which ones are allowed, | ||
184 | respectively. Currently only supports all on, or all off. | ||
185 | |||
186 | int phy_enable_interrupts(struct phy_device *phydev); | ||
187 | int phy_disable_interrupts(struct phy_device *phydev); | ||
188 | |||
189 | Functions which enable/disable PHY interrupts, clearing them | ||
190 | before and after, respectively. | ||
191 | |||
192 | int phy_start_interrupts(struct phy_device *phydev); | 180 | int phy_start_interrupts(struct phy_device *phydev); |
193 | int phy_stop_interrupts(struct phy_device *phydev); | 181 | int phy_stop_interrupts(struct phy_device *phydev); |
194 | 182 | ||
@@ -213,12 +201,6 @@ Doing it all yourself | |||
213 | Fills the phydev structure with up-to-date information about the current | 201 | Fills the phydev structure with up-to-date information about the current |
214 | settings in the PHY. | 202 | settings in the PHY. |
215 | 203 | ||
216 | void phy_sanitize_settings(struct phy_device *phydev) | ||
217 | |||
218 | Resolves differences between currently desired settings, and | ||
219 | supported settings for the given PHY device. Does not make | ||
220 | the changes in the hardware, though. | ||
221 | |||
222 | int phy_ethtool_sset(struct phy_device *phydev, struct ethtool_cmd *cmd); | 204 | int phy_ethtool_sset(struct phy_device *phydev, struct ethtool_cmd *cmd); |
223 | int phy_ethtool_gset(struct phy_device *phydev, struct ethtool_cmd *cmd); | 205 | int phy_ethtool_gset(struct phy_device *phydev, struct ethtool_cmd *cmd); |
224 | 206 | ||
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index 1bb16cb79433..7670aac0e93f 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c | |||
@@ -65,7 +65,7 @@ EXPORT_SYMBOL(phy_print_status); | |||
65 | * | 65 | * |
66 | * Returns 0 on success on < 0 on error. | 66 | * Returns 0 on success on < 0 on error. |
67 | */ | 67 | */ |
68 | int phy_clear_interrupt(struct phy_device *phydev) | 68 | static int phy_clear_interrupt(struct phy_device *phydev) |
69 | { | 69 | { |
70 | int err = 0; | 70 | int err = 0; |
71 | 71 | ||
@@ -82,7 +82,7 @@ int phy_clear_interrupt(struct phy_device *phydev) | |||
82 | * | 82 | * |
83 | * Returns 0 on success on < 0 on error. | 83 | * Returns 0 on success on < 0 on error. |
84 | */ | 84 | */ |
85 | int phy_config_interrupt(struct phy_device *phydev, u32 interrupts) | 85 | static int phy_config_interrupt(struct phy_device *phydev, u32 interrupts) |
86 | { | 86 | { |
87 | int err = 0; | 87 | int err = 0; |
88 | 88 | ||
@@ -208,7 +208,7 @@ static inline int phy_find_valid(int idx, u32 features) | |||
208 | * duplexes. Drop down by one in this order: 1000/FULL, | 208 | * duplexes. Drop down by one in this order: 1000/FULL, |
209 | * 1000/HALF, 100/FULL, 100/HALF, 10/FULL, 10/HALF. | 209 | * 1000/HALF, 100/FULL, 100/HALF, 10/FULL, 10/HALF. |
210 | */ | 210 | */ |
211 | void phy_sanitize_settings(struct phy_device *phydev) | 211 | static void phy_sanitize_settings(struct phy_device *phydev) |
212 | { | 212 | { |
213 | u32 features = phydev->supported; | 213 | u32 features = phydev->supported; |
214 | int idx; | 214 | int idx; |
@@ -223,7 +223,6 @@ void phy_sanitize_settings(struct phy_device *phydev) | |||
223 | phydev->speed = settings[idx].speed; | 223 | phydev->speed = settings[idx].speed; |
224 | phydev->duplex = settings[idx].duplex; | 224 | phydev->duplex = settings[idx].duplex; |
225 | } | 225 | } |
226 | EXPORT_SYMBOL(phy_sanitize_settings); | ||
227 | 226 | ||
228 | /** | 227 | /** |
229 | * phy_ethtool_sset - generic ethtool sset function, handles all the details | 228 | * phy_ethtool_sset - generic ethtool sset function, handles all the details |
@@ -532,7 +531,7 @@ static irqreturn_t phy_interrupt(int irq, void *phy_dat) | |||
532 | * phy_enable_interrupts - Enable the interrupts from the PHY side | 531 | * phy_enable_interrupts - Enable the interrupts from the PHY side |
533 | * @phydev: target phy_device struct | 532 | * @phydev: target phy_device struct |
534 | */ | 533 | */ |
535 | int phy_enable_interrupts(struct phy_device *phydev) | 534 | static int phy_enable_interrupts(struct phy_device *phydev) |
536 | { | 535 | { |
537 | int err; | 536 | int err; |
538 | 537 | ||
@@ -545,13 +544,12 @@ int phy_enable_interrupts(struct phy_device *phydev) | |||
545 | 544 | ||
546 | return err; | 545 | return err; |
547 | } | 546 | } |
548 | EXPORT_SYMBOL(phy_enable_interrupts); | ||
549 | 547 | ||
550 | /** | 548 | /** |
551 | * phy_disable_interrupts - Disable the PHY interrupts from the PHY side | 549 | * phy_disable_interrupts - Disable the PHY interrupts from the PHY side |
552 | * @phydev: target phy_device struct | 550 | * @phydev: target phy_device struct |
553 | */ | 551 | */ |
554 | int phy_disable_interrupts(struct phy_device *phydev) | 552 | static int phy_disable_interrupts(struct phy_device *phydev) |
555 | { | 553 | { |
556 | int err; | 554 | int err; |
557 | 555 | ||
@@ -574,7 +572,6 @@ phy_err: | |||
574 | 572 | ||
575 | return err; | 573 | return err; |
576 | } | 574 | } |
577 | EXPORT_SYMBOL(phy_disable_interrupts); | ||
578 | 575 | ||
579 | /** | 576 | /** |
580 | * phy_start_interrupts - request and enable interrupts for a PHY device | 577 | * phy_start_interrupts - request and enable interrupts for a PHY device |
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index 16ddc77313cb..993c52c82aeb 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c | |||
@@ -57,6 +57,9 @@ extern void mdio_bus_exit(void); | |||
57 | static LIST_HEAD(phy_fixup_list); | 57 | static LIST_HEAD(phy_fixup_list); |
58 | static DEFINE_MUTEX(phy_fixup_lock); | 58 | static DEFINE_MUTEX(phy_fixup_lock); |
59 | 59 | ||
60 | static int phy_attach_direct(struct net_device *dev, struct phy_device *phydev, | ||
61 | u32 flags, phy_interface_t interface); | ||
62 | |||
60 | /* | 63 | /* |
61 | * Creates a new phy_fixup and adds it to the list | 64 | * Creates a new phy_fixup and adds it to the list |
62 | * @bus_id: A string which matches phydev->dev.bus_id (or PHY_ANY_ID) | 65 | * @bus_id: A string which matches phydev->dev.bus_id (or PHY_ANY_ID) |
@@ -146,7 +149,8 @@ int phy_scan_fixups(struct phy_device *phydev) | |||
146 | } | 149 | } |
147 | EXPORT_SYMBOL(phy_scan_fixups); | 150 | EXPORT_SYMBOL(phy_scan_fixups); |
148 | 151 | ||
149 | struct phy_device* phy_device_create(struct mii_bus *bus, int addr, int phy_id) | 152 | static struct phy_device* phy_device_create(struct mii_bus *bus, |
153 | int addr, int phy_id) | ||
150 | { | 154 | { |
151 | struct phy_device *dev; | 155 | struct phy_device *dev; |
152 | 156 | ||
@@ -193,7 +197,6 @@ struct phy_device* phy_device_create(struct mii_bus *bus, int addr, int phy_id) | |||
193 | 197 | ||
194 | return dev; | 198 | return dev; |
195 | } | 199 | } |
196 | EXPORT_SYMBOL(phy_device_create); | ||
197 | 200 | ||
198 | /** | 201 | /** |
199 | * get_phy_id - reads the specified addr for its ID. | 202 | * get_phy_id - reads the specified addr for its ID. |
@@ -316,7 +319,7 @@ EXPORT_SYMBOL(phy_find_first); | |||
316 | * If you want to monitor your own link state, don't call | 319 | * If you want to monitor your own link state, don't call |
317 | * this function. | 320 | * this function. |
318 | */ | 321 | */ |
319 | void phy_prepare_link(struct phy_device *phydev, | 322 | static void phy_prepare_link(struct phy_device *phydev, |
320 | void (*handler)(struct net_device *)) | 323 | void (*handler)(struct net_device *)) |
321 | { | 324 | { |
322 | phydev->adjust_link = handler; | 325 | phydev->adjust_link = handler; |
@@ -435,8 +438,8 @@ int phy_init_hw(struct phy_device *phydev) | |||
435 | * the attaching device, and given a callback for link status | 438 | * the attaching device, and given a callback for link status |
436 | * change. The phy_device is returned to the attaching driver. | 439 | * change. The phy_device is returned to the attaching driver. |
437 | */ | 440 | */ |
438 | int phy_attach_direct(struct net_device *dev, struct phy_device *phydev, | 441 | static int phy_attach_direct(struct net_device *dev, struct phy_device *phydev, |
439 | u32 flags, phy_interface_t interface) | 442 | u32 flags, phy_interface_t interface) |
440 | { | 443 | { |
441 | struct device *d = &phydev->dev; | 444 | struct device *d = &phydev->dev; |
442 | 445 | ||
@@ -473,7 +476,6 @@ int phy_attach_direct(struct net_device *dev, struct phy_device *phydev, | |||
473 | * (dev_flags and interface) */ | 476 | * (dev_flags and interface) */ |
474 | return phy_init_hw(phydev); | 477 | return phy_init_hw(phydev); |
475 | } | 478 | } |
476 | EXPORT_SYMBOL(phy_attach_direct); | ||
477 | 479 | ||
478 | /** | 480 | /** |
479 | * phy_attach - attach a network device to a particular PHY device | 481 | * phy_attach - attach a network device to a particular PHY device |
@@ -540,7 +542,7 @@ EXPORT_SYMBOL(phy_detach); | |||
540 | * what is supported. Returns < 0 on error, 0 if the PHY's advertisement | 542 | * what is supported. Returns < 0 on error, 0 if the PHY's advertisement |
541 | * hasn't changed, and > 0 if it has changed. | 543 | * hasn't changed, and > 0 if it has changed. |
542 | */ | 544 | */ |
543 | int genphy_config_advert(struct phy_device *phydev) | 545 | static int genphy_config_advert(struct phy_device *phydev) |
544 | { | 546 | { |
545 | u32 advertise; | 547 | u32 advertise; |
546 | int oldadv, adv; | 548 | int oldadv, adv; |
@@ -605,7 +607,6 @@ int genphy_config_advert(struct phy_device *phydev) | |||
605 | 607 | ||
606 | return changed; | 608 | return changed; |
607 | } | 609 | } |
608 | EXPORT_SYMBOL(genphy_config_advert); | ||
609 | 610 | ||
610 | /** | 611 | /** |
611 | * genphy_setup_forced - configures/forces speed/duplex from @phydev | 612 | * genphy_setup_forced - configures/forces speed/duplex from @phydev |
@@ -615,7 +616,7 @@ EXPORT_SYMBOL(genphy_config_advert); | |||
615 | * to the values in phydev. Assumes that the values are valid. | 616 | * to the values in phydev. Assumes that the values are valid. |
616 | * Please see phy_sanitize_settings(). | 617 | * Please see phy_sanitize_settings(). |
617 | */ | 618 | */ |
618 | int genphy_setup_forced(struct phy_device *phydev) | 619 | static int genphy_setup_forced(struct phy_device *phydev) |
619 | { | 620 | { |
620 | int err; | 621 | int err; |
621 | int ctl = 0; | 622 | int ctl = 0; |
diff --git a/include/linux/phy.h b/include/linux/phy.h index a6e047a04f79..7da5fa845959 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h | |||
@@ -472,11 +472,7 @@ static inline int phy_write(struct phy_device *phydev, u32 regnum, u16 val) | |||
472 | int get_phy_id(struct mii_bus *bus, int addr, u32 *phy_id); | 472 | int get_phy_id(struct mii_bus *bus, int addr, u32 *phy_id); |
473 | struct phy_device* get_phy_device(struct mii_bus *bus, int addr); | 473 | struct phy_device* get_phy_device(struct mii_bus *bus, int addr); |
474 | int phy_device_register(struct phy_device *phy); | 474 | int phy_device_register(struct phy_device *phy); |
475 | int phy_clear_interrupt(struct phy_device *phydev); | ||
476 | int phy_config_interrupt(struct phy_device *phydev, u32 interrupts); | ||
477 | int phy_init_hw(struct phy_device *phydev); | 475 | int phy_init_hw(struct phy_device *phydev); |
478 | int phy_attach_direct(struct net_device *dev, struct phy_device *phydev, | ||
479 | u32 flags, phy_interface_t interface); | ||
480 | struct phy_device * phy_attach(struct net_device *dev, | 476 | struct phy_device * phy_attach(struct net_device *dev, |
481 | const char *bus_id, u32 flags, phy_interface_t interface); | 477 | const char *bus_id, u32 flags, phy_interface_t interface); |
482 | struct phy_device *phy_find_first(struct mii_bus *bus); | 478 | struct phy_device *phy_find_first(struct mii_bus *bus); |
@@ -492,17 +488,12 @@ void phy_start(struct phy_device *phydev); | |||
492 | void phy_stop(struct phy_device *phydev); | 488 | void phy_stop(struct phy_device *phydev); |
493 | int phy_start_aneg(struct phy_device *phydev); | 489 | int phy_start_aneg(struct phy_device *phydev); |
494 | 490 | ||
495 | void phy_sanitize_settings(struct phy_device *phydev); | ||
496 | int phy_stop_interrupts(struct phy_device *phydev); | 491 | int phy_stop_interrupts(struct phy_device *phydev); |
497 | int phy_enable_interrupts(struct phy_device *phydev); | ||
498 | int phy_disable_interrupts(struct phy_device *phydev); | ||
499 | 492 | ||
500 | static inline int phy_read_status(struct phy_device *phydev) { | 493 | static inline int phy_read_status(struct phy_device *phydev) { |
501 | return phydev->drv->read_status(phydev); | 494 | return phydev->drv->read_status(phydev); |
502 | } | 495 | } |
503 | 496 | ||
504 | int genphy_config_advert(struct phy_device *phydev); | ||
505 | int genphy_setup_forced(struct phy_device *phydev); | ||
506 | int genphy_restart_aneg(struct phy_device *phydev); | 497 | int genphy_restart_aneg(struct phy_device *phydev); |
507 | int genphy_config_aneg(struct phy_device *phydev); | 498 | int genphy_config_aneg(struct phy_device *phydev); |
508 | int genphy_update_link(struct phy_device *phydev); | 499 | int genphy_update_link(struct phy_device *phydev); |
@@ -511,8 +502,6 @@ int genphy_suspend(struct phy_device *phydev); | |||
511 | int genphy_resume(struct phy_device *phydev); | 502 | int genphy_resume(struct phy_device *phydev); |
512 | void phy_driver_unregister(struct phy_driver *drv); | 503 | void phy_driver_unregister(struct phy_driver *drv); |
513 | int phy_driver_register(struct phy_driver *new_driver); | 504 | int phy_driver_register(struct phy_driver *new_driver); |
514 | void phy_prepare_link(struct phy_device *phydev, | ||
515 | void (*adjust_link)(struct net_device *)); | ||
516 | void phy_state_machine(struct work_struct *work); | 505 | void phy_state_machine(struct work_struct *work); |
517 | void phy_start_machine(struct phy_device *phydev, | 506 | void phy_start_machine(struct phy_device *phydev, |
518 | void (*handler)(struct net_device *)); | 507 | void (*handler)(struct net_device *)); |
@@ -523,7 +512,6 @@ int phy_mii_ioctl(struct phy_device *phydev, | |||
523 | struct ifreq *ifr, int cmd); | 512 | struct ifreq *ifr, int cmd); |
524 | int phy_start_interrupts(struct phy_device *phydev); | 513 | int phy_start_interrupts(struct phy_device *phydev); |
525 | void phy_print_status(struct phy_device *phydev); | 514 | void phy_print_status(struct phy_device *phydev); |
526 | struct phy_device* phy_device_create(struct mii_bus *bus, int addr, int phy_id); | ||
527 | void phy_device_free(struct phy_device *phydev); | 515 | void phy_device_free(struct phy_device *phydev); |
528 | 516 | ||
529 | int phy_register_fixup(const char *bus_id, u32 phy_uid, u32 phy_uid_mask, | 517 | int phy_register_fixup(const char *bus_id, u32 phy_uid, u32 phy_uid_mask, |