I need to make my homework first.
After looking into the function adjtimes things made more sense to me.
The missing piece in my understand for now that the timex.freq unit is in
ppm and its long, so no fractions for the ppb.
After I looked into the kernel module igb_ptp.c it has a function to adjust
the frequency and it expecting an input "s32 ppb".
So from the clockadj::clockadj_set_freq(.. double freq) all the way down to
the kernel ptp ptp_adjfreq, how the value 'doubel freq" became to ppb?

Thank you
Bassam



On Wed, Nov 11, 2015 at 1:58 PM, Bassam Alsanie <[email protected]> wrote:

> There is something I need to understand in the ptp4l implementation in
> order to implement my custom clock driver correctly.
>
> Regards clockajd::clockadj_set_freq(... double freq);
>
> What does the 'freq' parameter above represent?
>
> Does the freq parameter above represent the requested ppb, or the request
> frequency shift in Hz?
> Basically I have custom interface in my driver called:
>
> shiftCurrentFrequency (freqShiftInHz);
>
> That I need to convert the freq (above) to actual frequency shift In Hz.
> What I am doing now is:
>
> __s64 freqShiftInHz = (long long int) (currentFreq * freq) / kPpb;
>
> for example, if the requested ppb is 250123, then:
> freqShiftInHz = (long long int) (100MHz * 2500) / 1000000000;
> freqShiftInHz  = 250 Hz
>
>
> Thank you
> Bassam
>
>
------------------------------------------------------------------------------
_______________________________________________
Linuxptp-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to