hwclock: add parameters for minimum/maximum number of samples

Allocate the arrays which hold the samples dynamically and limit the
number of dropped samples to not fall below the minimum.
This commit is contained in:
Miroslav Lichvar
2018-08-08 13:22:30 +02:00
parent 159bd73f76
commit c0717a27f6
5 changed files with 33 additions and 17 deletions

View File

@@ -236,7 +236,8 @@ add_interface(CNF_HwTsInterface *conf_iface)
iface->tx_comp = conf_iface->tx_comp;
iface->rx_comp = conf_iface->rx_comp;
iface->clock = HCL_CreateInstance(UTI_Log2ToDouble(MAX(conf_iface->minpoll, MIN_PHC_POLL)));
iface->clock = HCL_CreateInstance(0, 16, UTI_Log2ToDouble(MAX(conf_iface->minpoll,
MIN_PHC_POLL)));
LOG(LOGS_INFO, "Enabled HW timestamping %son %s",
ts_config.rx_filter == HWTSTAMP_FILTER_NONE ? "(TX only) " : "", iface->name);