conf: add option to set maximum slew rate

With the generic driver, the maxslewrate directive sets the maximum
frequency offset that the driver is allowed to use to slew the time. By
default, it's set to 83333.333 (1/12). This is identical to what Linux
fast slewing used to use.
This commit is contained in:
Miroslav Lichvar
2014-05-21 16:23:30 +02:00
parent 3e1dc801b0
commit 9cf78b974a
4 changed files with 44 additions and 9 deletions

11
conf.c
View File

@@ -88,6 +88,7 @@ static unsigned long command_key_id;
static double max_update_skew = 1000.0;
static double correction_time_ratio = 3.0;
static double max_clock_error = 1.0; /* in ppm */
static double max_slew_rate = 1e6 / 12.0; /* in ppm */
static double reselect_distance = 1e-4;
static double stratum_weight = 1.0;
@@ -422,6 +423,8 @@ CNF_ParseLine(const char *filename, int number, char *line)
parse_double(p, &max_clock_error);
} else if (!strcasecmp(command, "maxsamples")) {
parse_int(p, &max_samples);
} else if (!strcasecmp(command, "maxslewrate")) {
parse_double(p, &max_slew_rate);
} else if (!strcasecmp(command, "maxupdateskew")) {
parse_double(p, &max_update_skew);
} else if (!strcasecmp(command, "minsamples")) {
@@ -1390,6 +1393,14 @@ CNF_GetCorrectionTimeRatio(void)
/* ================================================== */
double
CNF_GetMaxSlewRate(void)
{
return max_slew_rate;
}
/* ================================================== */
double
CNF_GetReselectDistance(void)
{