#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/errno.h>
#include <linux/unistd.h>
#include <linux/interrupt.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
#include <linux/mm.h>
#include <linux/module.h>
#include <linux/mii.h>
#include <linux/ethtool.h>
#include <linux/phy.h>
#include <linux/timer.h>
#include <linux/workqueue.h>
#include <linux/mdio.h>
#include <linux/atomic.h>
#include <asm/io.h>
#include <asm/irq.h>
#include <asm/uaccess.h>
Go to the source code of this file.
#define pr_fmt |
( |
|
fmt | ) |
KBUILD_MODNAME ": " fmt |
Definition at line 19 of file phy.c.
phy_ethtool_get_eee - get EEE supported and status : target phy_device struct : ethtool_eee data
Description: it reportes the Supported/Advertisement/LP Advertisement capabilities.
Definition at line 1144 of file phy.c.
phy_ethtool_set_eee - set EEE supported and status : target phy_device struct : ethtool_eee data
Description: it is to program the Advertisement EEE register.
Definition at line 1180 of file phy.c.
phy_ethtool_sset - generic ethtool sset function, handles all the details : target phy_device struct : ethtool_cmd
A few notes about parameter checking:
- We don't set port or transceiver, so we don't care what they were set to.
- phy_start_aneg() will make sure forced settings are sane, and choose the next best ones from the ones selected, so we don't care if ethtool tries to give us bad values.
Definition at line 241 of file phy.c.
phy_get_eee_err - report the EEE wake error count : target phy_device struct
Description: it is to report the number of time where the PHY failed to complete its normal wake sequence.
Definition at line 1128 of file phy.c.
phy_init_eee - init and check the EEE feature : target phy_device struct : PHY may stop the clock during LPI
Description: it checks if the Energy-Efficient Ethernet (EEE) is supported by looking at the MMD registers 3.20 and 7.60/61 and it programs the MMD register 3.0 setting the "Clock stop enable" bit if required.
Definition at line 1048 of file phy.c.
phy_mii_ioctl - generic PHY MII ioctl interface : the phy_device struct : &struct ifreq for socket ioctl's : ioctl cmd to execute
Note that this function is currently incompatible with the PHYCONTROL layer. It changes registers without regard to current state. Use at own risk.
Definition at line 314 of file phy.c.
phy_print_status - Convenience function to print out the current phy status : the phy_device struct
Definition at line 49 of file phy.c.
phy_start - start or restart a PHY device : target phy_device struct
Description: Indicates the attached device's readiness to handle PHY-related work. Used during startup to start the PHY, and after a call to phy_stop() to resume operation. Also used to indicate the MDIO bus has cleared an error condition.
Definition at line 743 of file phy.c.
phy_start_aneg - start auto-negotiation for this PHY device : the phy_device struct
Description: Sanitizes the settings (if we're not autonegotiating them), and then calls the driver's config_aneg function. If the PHYCONTROL Layer is operating, we change the state to reflect the beginning of Auto-negotiation or forcing.
Definition at line 391 of file phy.c.
phy_start_interrupts - request and enable interrupts for a PHY device : target phy_device struct
Description: Request the interrupt for the given PHY. If this fails, then we set irq to PHY_POLL. Otherwise, we enable the interrupts in the PHY. This should only be called with a valid IRQ number. Returns 0 on success or < 0 on error.
Definition at line 591 of file phy.c.
phy_start_machine - start PHY state machine tracking : the phy_device struct : callback function for state change notifications
Description: The PHY infrastructure can run a state machine which tracks whether the PHY is starting up, negotiating, etc. This function starts the timer which tracks the state of the PHY. If you want to be notified when the state changes, pass in the callback , otherwise, pass NULL. If you want to maintain your own state machine, do not call this function.
Definition at line 437 of file phy.c.
phy_state_machine - Handle the state machine : work_struct that describes the work to be done
Definition at line 768 of file phy.c.
phy_stop_interrupts - disable interrupts from a PHY device : target phy_device struct
Definition at line 618 of file phy.c.
phy_stop_machine - stop the PHY state machine tracking : target phy_device struct
Description: Stops the state machine timer, sets the state to UP (unless it wasn't up yet). This function must be called BEFORE phy_detach.
Definition at line 453 of file phy.c.