diff options
Diffstat (limited to 'drivers/net/ethernet/freescale/fec_ptp.c')
| -rw-r--r-- | drivers/net/ethernet/freescale/fec_ptp.c | 18 | 
1 files changed, 16 insertions, 2 deletions
diff --git a/drivers/net/ethernet/freescale/fec_ptp.c b/drivers/net/ethernet/freescale/fec_ptp.c index 5007e4f9fff..82386b29914 100644 --- a/drivers/net/ethernet/freescale/fec_ptp.c +++ b/drivers/net/ethernet/freescale/fec_ptp.c @@ -28,7 +28,6 @@  #include <linux/slab.h>  #include <linux/interrupt.h>  #include <linux/pci.h> -#include <linux/init.h>  #include <linux/delay.h>  #include <linux/netdevice.h>  #include <linux/etherdevice.h> @@ -274,7 +273,7 @@ static int fec_ptp_enable(struct ptp_clock_info *ptp,   * @ifreq: ioctl data   * @cmd: particular ioctl requested   */ -int fec_ptp_ioctl(struct net_device *ndev, struct ifreq *ifr, int cmd) +int fec_ptp_set(struct net_device *ndev, struct ifreq *ifr)  {  	struct fec_enet_private *fep = netdev_priv(ndev); @@ -321,6 +320,20 @@ int fec_ptp_ioctl(struct net_device *ndev, struct ifreq *ifr, int cmd)  	    -EFAULT : 0;  } +int fec_ptp_get(struct net_device *ndev, struct ifreq *ifr) +{ +	struct fec_enet_private *fep = netdev_priv(ndev); +	struct hwtstamp_config config; + +	config.flags = 0; +	config.tx_type = fep->hwts_tx_en ? HWTSTAMP_TX_ON : HWTSTAMP_TX_OFF; +	config.rx_filter = (fep->hwts_rx_en ? +			    HWTSTAMP_FILTER_ALL : HWTSTAMP_FILTER_NONE); + +	return copy_to_user(ifr->ifr_data, &config, sizeof(config)) ? +		-EFAULT : 0; +} +  /**   * fec_time_keep - call timecounter_read every second to avoid timer overrun   *                 because ENET just support 32bit counter, will timeout in 4s @@ -359,6 +372,7 @@ void fec_ptp_init(struct platform_device *pdev)  	fep->ptp_caps.n_alarm = 0;  	fep->ptp_caps.n_ext_ts = 0;  	fep->ptp_caps.n_per_out = 0; +	fep->ptp_caps.n_pins = 0;  	fep->ptp_caps.pps = 0;  	fep->ptp_caps.adjfreq = fec_ptp_adjfreq;  	fep->ptp_caps.adjtime = fec_ptp_adjtime;  | 
