]> git.baikalelectronics.ru Git - kernel.git/commit
tg3: PTP - Implement the ptp api and ethtool functions
authorMatt Carlson <mcarlson@broadcom.com>
Mon, 3 Dec 2012 19:36:58 +0000 (19:36 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 4 Dec 2012 17:58:49 +0000 (12:58 -0500)
commit1815d44a21d795f1a14ae0bc2d2fc30375550a65
tree238b05bdb8f7cff710083be379e0d5ff75c0fa97
parent2f4953ab5724cf037bb72a608a05ca05e970489c
tg3: PTP - Implement the ptp api and ethtool functions

This patch adds the ptp_caps structure, ptp api implementation,
reference clock read and register/unregister functions.  All the basic
clock operations as described in Documentation/ptp/ptp.txt are
supported.

Frequency adjustment is performed using hardware with a 24 bit
accumulator and a programmable correction value. On each clk, the
correction value gets added to the accumulator and when it overflows,
the time counter is incremented/decremented and the accumulator reset.

So conversion from ppb to correction value is
ppb * (1 << 24) / 1000000000

[Re-organized to put the ptp_clock_info struct declaration in one patch,
 added ptp_clock_info.name, and added locking to tg3_ptp_adjtime() based
 on input from Richard Cochran.]

Signed-off-by: Nithin Nayak Sujir <nsujir@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Cc: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/tg3.c