port: Introduce unicast sync messages.
The port will need to send unicast Sync messages in order to support the NSM protocol. Besides that, we will need this ability anyhow if we ever want to implement unicast operation. Signed-off-by: Richard Cochran <richardcochran@gmail.com>master
parent
3a264e6eec
commit
b0d9c9600a
12
port.c
12
port.c
|
@ -1333,7 +1333,7 @@ static int port_tx_announce(struct port *p)
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int port_tx_sync(struct port *p)
|
static int port_tx_sync(struct port *p, struct address *dst)
|
||||||
{
|
{
|
||||||
struct ptp_message *msg, *fup;
|
struct ptp_message *msg, *fup;
|
||||||
int err, event;
|
int err, event;
|
||||||
|
@ -1369,6 +1369,10 @@ static int port_tx_sync(struct port *p)
|
||||||
if (p->timestamping != TS_ONESTEP)
|
if (p->timestamping != TS_ONESTEP)
|
||||||
msg->header.flagField[0] |= TWO_STEP;
|
msg->header.flagField[0] |= TWO_STEP;
|
||||||
|
|
||||||
|
if (dst) {
|
||||||
|
msg->address = *dst;
|
||||||
|
msg->header.flagField[0] |= UNICAST;
|
||||||
|
}
|
||||||
err = port_prepare_and_send(p, msg, event);
|
err = port_prepare_and_send(p, msg, event);
|
||||||
if (err) {
|
if (err) {
|
||||||
pr_err("port %hu: send sync failed", portnum(p));
|
pr_err("port %hu: send sync failed", portnum(p));
|
||||||
|
@ -1398,6 +1402,10 @@ static int port_tx_sync(struct port *p)
|
||||||
|
|
||||||
ts_to_timestamp(&msg->hwts.ts, &fup->follow_up.preciseOriginTimestamp);
|
ts_to_timestamp(&msg->hwts.ts, &fup->follow_up.preciseOriginTimestamp);
|
||||||
|
|
||||||
|
if (dst) {
|
||||||
|
fup->address = *dst;
|
||||||
|
fup->header.flagField[0] |= UNICAST;
|
||||||
|
}
|
||||||
if (p->follow_up_info && follow_up_info_append(p, fup)) {
|
if (p->follow_up_info && follow_up_info_append(p, fup)) {
|
||||||
pr_err("port %hu: append fup info failed", portnum(p));
|
pr_err("port %hu: append fup info failed", portnum(p));
|
||||||
err = -1;
|
err = -1;
|
||||||
|
@ -2345,7 +2353,7 @@ enum fsm_event port_event(struct port *p, int fd_index)
|
||||||
case FD_SYNC_TX_TIMER:
|
case FD_SYNC_TX_TIMER:
|
||||||
pr_debug("port %hu: master sync timeout", portnum(p));
|
pr_debug("port %hu: master sync timeout", portnum(p));
|
||||||
port_set_sync_tx_tmo(p);
|
port_set_sync_tx_tmo(p);
|
||||||
return port_tx_sync(p) ? EV_FAULT_DETECTED : EV_NONE;
|
return port_tx_sync(p, NULL) ? EV_FAULT_DETECTED : EV_NONE;
|
||||||
|
|
||||||
case FD_RTNL:
|
case FD_RTNL:
|
||||||
pr_debug("port %hu: received link status notification", portnum(p));
|
pr_debug("port %hu: received link status notification", portnum(p));
|
||||||
|
|
Loading…
Reference in New Issue