ntp: check PHC index before opening device
Apparently, it is possible for an interface to report all necessary flags for HW timestamping without having a PHC. Check the PHC index to avoid an error message in the system log saying that /dev/ptp-1 cannot be opened.
This commit is contained in:
parent
76bed76289
commit
2962fc6286
1 changed files with 6 additions and 0 deletions
|
@ -171,6 +171,12 @@ add_interface(CNF_HwTsInterface *conf_iface)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ts_info.phc_index < 0) {
|
||||||
|
DEBUG_LOG("PHC missing on %s", req.ifr_name);
|
||||||
|
close(sock_fd);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
ts_config.flags = 0;
|
ts_config.flags = 0;
|
||||||
ts_config.tx_type = HWTSTAMP_TX_ON;
|
ts_config.tx_type = HWTSTAMP_TX_ON;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue