Re: [Linuxptp-users] Error accessing /dev/ptp0
PTP IEEE 1588 stack for Linux
Brought to you by:
rcochran
From: Richard C. <ric...@gm...> - 2014-08-06 16:24:03
|
On Wed, Aug 06, 2014 at 05:45:04PM +0800, Ronex Dicapriyo wrote: > Hello, > > I have few queries related to linuxptp, as mentioned below: > > > 1) I tried to run ptp4l application using command: > /home/ptp4l -i eth0 -p eth0 -m -P (ptp master) You don't need '-p' unless your kernel is older than v3.5. > If this device is supposed to be created by user then what is the MAJOR/MINOR number for /dev/ptp0 ? > And which driver manages/handles access to this node ? Look for 'ptp' in /proc/devices to get the major number. The minor number is then zero. Normally udev creates the node automatically. If you are using busybox, then mdev should also make the node for you. Otherwise, just create the node by hand using the 'mknod' command. > 2) I am also not able to understand the basic higher level abstract flow of how this application works ? > I think linux kernel has its own ptp driver implementation, So From the application does it use the linux user space API/system calls which further calls linux ptp driver functions (<linux_x.x>/drivers/ptp/), from which hardware ptp supported driver's functions are invoked ? > ptp4l(linuxptp app) ---> drivers/ptp ---> ethernet_driver_with_ptp_support Yes, more or less. There are actually three different kernel interfaces that ptp4l uses: 1. so_timestamping socket option (user -> network core -> driver) 2. ptp clock character device (user -> chardev -> ptp subsystem -> driver) 3. dynamic posix clock (user -> time core -> ptp subsystem -> driver) The second interface is only used to get a handle to a dynamic posix clock. In addition, the phc2sys program uses the ioctls from the ptp clock character device. See include/uapi/linux/ptp_clock.h in the Linux kernel source. HTH, Richard |