[Linuxptp-devel] [PATCH 03/27] Allow sending to a specified (unicast) address

2014-03-20 Thread Jiri Benc
This will be needed for notifications. Only implemented for UDS. Signed-off-by: Jiri Benc --- port.c | 14 ++ port.h | 22 ++ transport.c | 17 + transport.h | 25 + transpor

[Linuxptp-devel] [PATCH 01/27] Move check of TLV length for management COMMAND messages

2014-03-20 Thread Jiri Benc
Currently, it is assumed that the management TLV data of management COMMAND messages is always empty. This is not true for the INITIALIZE command and also for a custom command we'll be introducing. Move the check to msg_post_recv and let it check only the TLVs defined by the standard. Signed-off-

[Linuxptp-devel] [PATCH 09/27] Event notification: port state

2014-03-20 Thread Jiri Benc
Notify subscribers about port state changes. Signed-off-by: Jiri Benc --- notification.h |2 +- port.c |6 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/notification.h b/notification.h index 9fe90cd0bacb..9427d819dac3 100644 --- a/notification.h +++ b/noti

[Linuxptp-devel] [PATCH 19/27] phc2sys: track ports

2014-03-20 Thread Jiri Benc
Add tracking of which ports have been added and to which clock they belong. Signed-off-by: Jiri Benc --- phc2sys.c | 51 +++ 1 files changed, 51 insertions(+), 0 deletions(-) diff --git a/phc2sys.c b/phc2sys.c index 3fdb90cf161b..e5a7c0f49b9e 10

[Linuxptp-devel] [PATCH 10/27] Custom management TLV PORT_ENUMERATION_NP

2014-03-20 Thread Jiri Benc
Used to enumerate all ports. With the future dynamic port adding/removal, there may be holes in the port number sequence. For now, just fill it with the sequence numbers. Signed-off-by: Jiri Benc --- clock.c | 16 tlv.c | 29 + tlv.h |6 ++

[Linuxptp-devel] [PATCH 11/27] Event notification: port addition/removal

2014-03-20 Thread Jiri Benc
Add an event number for port adding/removal. As currently the ports are static, this event is not emitted for now. Signed-off-by: Jiri Benc --- clock.c|4 +++- notification.h |1 + 2 files changed, 4 insertions(+), 1 deletions(-) diff --git a/clock.c b/clock.c index 2e7794cc07cd

[Linuxptp-devel] [PATCH 26/27] Subscription time limit

2014-03-20 Thread Jiri Benc
Require subscriptions to be renewed regularly. This way, the subscription automatically times out when phc2sys is killed. Signed-off-by: Jiri Benc --- clock.c | 24 phc2sys.c | 10 ++ 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/clock.c b

[Linuxptp-devel] [PATCH 23/27] phc2sys: autoconfiguration

2014-03-20 Thread Jiri Benc
Add automatic configuration option (-a). Signed-off-by: Jiri Benc --- phc2sys.c | 247 ++--- 1 files changed, 236 insertions(+), 11 deletions(-) diff --git a/phc2sys.c b/phc2sys.c index 557b00ec6930..b0d8adb6828d 100644 --- a/phc2sys.c ++

[Linuxptp-devel] [PATCH 20/27] pmc_common: easy way to set port and broadcast target

2014-03-20 Thread Jiri Benc
Implement pmc_target_port to set a port number, leaving clock identity unchanged, and pmc_target_all to set clock identity and port number to all 1's. Signed-off-by: Jiri Benc --- pmc_common.c | 12 +++- pmc_common.h |2 ++ 2 files changed, 13 insertions(+), 1 deletions(-) diff --

[Linuxptp-devel] [PATCH 08/27] clock: event notification

2014-03-20 Thread Jiri Benc
Split management message creation to more fine-grained functions to allow notification messages to be created. Signed-off-by: Jiri Benc --- clock.c | 58 -- clock.h |8 port.c |8 +++- port.h | 14 ++

[Linuxptp-devel] [PATCH 22/27] phc2sys: event subscription

2014-03-20 Thread Jiri Benc
Add support for subscribing to events (run_pmc_subscribe) and receiving and handling of received events (run_pmc_events). Add initial support for port status changes. Signed-off-by: Jiri Benc --- phc2sys.c | 113 +++-- 1 files changed, 11

[Linuxptp-devel] [PATCH 27/27] phc2sys: man page update for -a and -r options

2014-03-20 Thread Jiri Benc
Signed-off-by: Jiri Benc --- phc2sys.8 | 115 ++--- 1 files changed, 79 insertions(+), 36 deletions(-) diff --git a/phc2sys.8 b/phc2sys.8 index 8688e4840cf0..d6fdb465c1f3 100644 --- a/phc2sys.8 +++ b/phc2sys.8 @@ -1,12 +1,17 @@ .TH PHC2SY

[Linuxptp-devel] [PATCH 24/27] phc2sys: autoconfigure realtime clock on demand only

2014-03-20 Thread Jiri Benc
By default, do not synchronize CLOCK_REALTIME. To do it, -r option is needed. That will only consider CLOCK_REALTIME as the destination. To consider it also as a possible time source, use -rr. Signed-off-by: Jiri Benc --- phc2sys.c | 33 + 1 files changed, 25 in

[Linuxptp-devel] [PATCH 21/27] pmc_common: implement pmc_send_command_action

2014-03-20 Thread Jiri Benc
Signed-off-by: Jiri Benc --- pmc_common.c | 16 ++-- pmc_common.h |2 +- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/pmc_common.c b/pmc_common.c index 061529e25b83..763b06e8e4c5 100644 --- a/pmc_common.c +++ b/pmc_common.c @@ -260,12 +260,14 @@ int pmc_send_g

[Linuxptp-devel] [PATCH 18/27] phc2sys: open devices in clock_add

2014-03-20 Thread Jiri Benc
Do not call clock_open to open a clock device but let clock_add do that and return the newly created struct. Also, store the device (interface) name in struct clock. Signed-off-by: Jiri Benc --- phc2sys.c | 81 ++-- 1 files changed, 46 in

[Linuxptp-devel] [PATCH 15/27] phc2sys: split clock and node

2014-03-20 Thread Jiri Benc
Split members that apply to all synchronized clocks and members that apply to an individual clock. Keep all clocks in a list, with a pointer to the source clock. This will allow to support multiple clocks synchronization. Signed-off-by: Jiri Benc --- phc2sys.c | 397

[Linuxptp-devel] [PATCH 06/27] Include TLV in replies to management commands

2014-03-20 Thread Jiri Benc
The standard requires management TLV in replies to commands: An acknowledge management message is a response to a command management message. The value of the managementId shall be identical to that in the command message. (Table 38) Just copy the TLV from the requ

[Linuxptp-devel] [PATCH 12/27] Custom management TLV PORT_PROPERTIES_NP

2014-03-20 Thread Jiri Benc
Will be used by phc2sys to find out interfaces corresponding to ports. Signed-off-by: Jiri Benc --- clock.c |9 + port.c | 16 tlv.c | 20 tlv.h |8 4 files changed, 53 insertions(+), 0 deletions(-) diff --git a/clock.c b/c

[Linuxptp-devel] [PATCH 07/27] port: event notification

2014-03-20 Thread Jiri Benc
Split management message creation to more fine-grained functions to allow notification messages to be created. Signed-off-by: Jiri Benc --- port.c | 93 ++-- port.h |9 ++ 2 files changed, 82 insertions(+), 20 deletions(-) di

[Linuxptp-devel] [PATCH 14/27] phc2sys: split update_sync_offset

2014-03-20 Thread Jiri Benc
Split the generic (global) part of update_sync_offset and the part that affects individual clocks. This is in preparation for phc2sys handling synchronization of more clocks. Signed-off-by: Jiri Benc --- phc2sys.c | 71 +++- 1 files chang

[Linuxptp-devel] [PATCH 13/27] phc2sys: generalize run_pmc

2014-03-20 Thread Jiri Benc
Make run_pmc usable for any kind of management message. Create wrappers for waiting for ptp4l and for getting UTC offset. Signed-off-by: Jiri Benc --- phc2sys.c | 131 +++-- 1 files changed, 66 insertions(+), 65 deletions(-) diff --git a/

[Linuxptp-devel] [PATCH 02/27] Move common code into port_prepare_and_send

2014-03-20 Thread Jiri Benc
The task of preparing the message for transmission and sending it appears at many places. Unify them into a new function. Signed-off-by: Jiri Benc --- clock.c | 12 + port.c | 129 -- port.h | 12 ++ 3 files changed, 57 i

[Linuxptp-devel] [PATCH 05/27] Event subscribing

2014-03-20 Thread Jiri Benc
This puts groundwork for event subscription and notification. The individual events are added by subsequent patches. Signed-off-by: Jiri Benc --- clock.c| 137 clock.h| 11 + notification.h | 28 +++ tlv.c

[Linuxptp-devel] [PATCH 00/27] automatic phc2sys configuration

2014-03-20 Thread Jiri Benc
This patchset adds support for phc2sys following ptp4l state changes and automatic (re)configuration. This works by "subscribing" certain kinds of events over the UDS and ptp4l sending the events to their "subscribers". The patchset is prepared to handle the "emulated boundary clock" scenario, i.

[Linuxptp-devel] [PATCH 25/27] phc2sys: check clockIdentity

2014-03-20 Thread Jiri Benc
Make sure that we handle only one PTP clock (node). This is for an extra safety. Signed-off-by: Jiri Benc --- phc2sys.c | 39 +-- 1 files changed, 37 insertions(+), 2 deletions(-) diff --git a/phc2sys.c b/phc2sys.c index f29d8e7eeaab..d130232f70de 100644 --

[Linuxptp-devel] [PATCH 17/27] phc2sys: rearrange declarations

2014-03-20 Thread Jiri Benc
This just moves code around to have related functions together and forward declaration at the beginning of the file. No code changes. Signed-off-by: Jiri Benc --- phc2sys.c | 208 ++--- 1 files changed, 103 insertions(+), 105 deletions(-)

[Linuxptp-devel] [PATCH 04/27] uds: don't output "Connection refused"

2014-03-20 Thread Jiri Benc
When phc2sys is started before ptp4l or it is interrupted before ptp4l has a chance to reply to its query, the "uds: sendto failed: Connection refused" message is output. This is not an interesting message. Also, don't output the "failed to send message" error from pmc_send, as all transports outp

[Linuxptp-devel] [PATCH 16/27] phc2sys: store information about clocks being UTC or TAI

2014-03-20 Thread Jiri Benc
For now, only CLOCK_REALTIME can be UTC. This may stay this way forever but now we have a clean separation between codepaths where CLOCK_REALTIME is required and codepaths any UTC clock should take. The main motiviation behind this change is removal of sync_offset_direction. It has to be computed

Re: [Linuxptp-devel] [PATCH 00/27] automatic phc2sys configuration

2014-03-20 Thread Keller, Jacob E
On Thu, 2014-03-20 at 19:08 +0100, Jiri Benc wrote: > This patchset adds support for phc2sys following ptp4l state changes and > automatic (re)configuration. > > This works by "subscribing" certain kinds of events over the UDS and ptp4l > sending the events to their "subscribers". > > The patchse