Commit e1fdb5b3 authored by Ralf Baechle's avatar Ralf Baechle Committed by David S. Miller

[AX.25]: Eleminate HZ from AX.25 kernel interfaces

Convert all AX.25 sysctl time values from jiffies to ms as units.
Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4cc7c273
...@@ -145,14 +145,14 @@ enum { ...@@ -145,14 +145,14 @@ enum {
#define AX25_DEF_CONMODE 2 /* Connected mode allowed */ #define AX25_DEF_CONMODE 2 /* Connected mode allowed */
#define AX25_DEF_WINDOW 2 /* Window=2 */ #define AX25_DEF_WINDOW 2 /* Window=2 */
#define AX25_DEF_EWINDOW 32 /* Module-128 Window=32 */ #define AX25_DEF_EWINDOW 32 /* Module-128 Window=32 */
#define AX25_DEF_T1 (10 * HZ) /* T1=10s */ #define AX25_DEF_T1 10000 /* T1=10s */
#define AX25_DEF_T2 (3 * HZ) /* T2=3s */ #define AX25_DEF_T2 3000 /* T2=3s */
#define AX25_DEF_T3 (300 * HZ) /* T3=300s */ #define AX25_DEF_T3 300000 /* T3=300s */
#define AX25_DEF_N2 10 /* N2=10 */ #define AX25_DEF_N2 10 /* N2=10 */
#define AX25_DEF_IDLE (0 * 60 * HZ) /* Idle=None */ #define AX25_DEF_IDLE 0 /* Idle=None */
#define AX25_DEF_PACLEN 256 /* Paclen=256 */ #define AX25_DEF_PACLEN 256 /* Paclen=256 */
#define AX25_DEF_PROTOCOL AX25_PROTO_STD_SIMPLEX /* Standard AX.25 */ #define AX25_DEF_PROTOCOL AX25_PROTO_STD_SIMPLEX /* Standard AX.25 */
#define AX25_DEF_DS_TIMEOUT (3 * 60 * HZ) /* DAMA timeout 3 minutes */ #define AX25_DEF_DS_TIMEOUT 180000 /* DAMA timeout 3 minutes */
typedef struct ax25_uid_assoc { typedef struct ax25_uid_assoc {
struct hlist_node uid_node; struct hlist_node uid_node;
......
...@@ -426,6 +426,26 @@ static int ax25_ctl_ioctl(const unsigned int cmd, void __user *arg) ...@@ -426,6 +426,26 @@ static int ax25_ctl_ioctl(const unsigned int cmd, void __user *arg)
return 0; return 0;
} }
static void ax25_fillin_cb_from_dev(ax25_cb *ax25, ax25_dev *ax25_dev)
{
ax25->rtt = msecs_to_jiffies(ax25_dev->values[AX25_VALUES_T1]) / 2;
ax25->t1 = msecs_to_jiffies(ax25_dev->values[AX25_VALUES_T1]);
ax25->t2 = msecs_to_jiffies(ax25_dev->values[AX25_VALUES_T2]);
ax25->t3 = msecs_to_jiffies(ax25_dev->values[AX25_VALUES_T3]);
ax25->n2 = ax25_dev->values[AX25_VALUES_N2];
ax25->paclen = ax25_dev->values[AX25_VALUES_PACLEN];
ax25->idle = msecs_to_jiffies(ax25_dev->values[AX25_VALUES_IDLE]);
ax25->backoff = ax25_dev->values[AX25_VALUES_BACKOFF];
if (ax25_dev->values[AX25_VALUES_AXDEFMODE]) {
ax25->modulus = AX25_EMODULUS;
ax25->window = ax25_dev->values[AX25_VALUES_EWINDOW];
} else {
ax25->modulus = AX25_MODULUS;
ax25->window = ax25_dev->values[AX25_VALUES_WINDOW];
}
}
/* /*
* Fill in a created AX.25 created control block with the default * Fill in a created AX.25 created control block with the default
* values for a particular device. * values for a particular device.
...@@ -435,39 +455,28 @@ void ax25_fillin_cb(ax25_cb *ax25, ax25_dev *ax25_dev) ...@@ -435,39 +455,28 @@ void ax25_fillin_cb(ax25_cb *ax25, ax25_dev *ax25_dev)
ax25->ax25_dev = ax25_dev; ax25->ax25_dev = ax25_dev;
if (ax25->ax25_dev != NULL) { if (ax25->ax25_dev != NULL) {
ax25->rtt = ax25_dev->values[AX25_VALUES_T1] / 2; ax25_fillin_cb_from_dev(ax25, ax25_dev);
ax25->t1 = ax25_dev->values[AX25_VALUES_T1]; return;
ax25->t2 = ax25_dev->values[AX25_VALUES_T2]; }
ax25->t3 = ax25_dev->values[AX25_VALUES_T3];
ax25->n2 = ax25_dev->values[AX25_VALUES_N2]; /*
ax25->paclen = ax25_dev->values[AX25_VALUES_PACLEN]; * No device, use kernel / AX.25 spec default values
ax25->idle = ax25_dev->values[AX25_VALUES_IDLE]; */
ax25->backoff = ax25_dev->values[AX25_VALUES_BACKOFF]; ax25->rtt = msecs_to_jiffies(AX25_DEF_T1) / 2;
ax25->t1 = msecs_to_jiffies(AX25_DEF_T1);
if (ax25_dev->values[AX25_VALUES_AXDEFMODE]) { ax25->t2 = msecs_to_jiffies(AX25_DEF_T2);
ax25->modulus = AX25_EMODULUS; ax25->t3 = msecs_to_jiffies(AX25_DEF_T3);
ax25->window = ax25_dev->values[AX25_VALUES_EWINDOW]; ax25->n2 = AX25_DEF_N2;
} else { ax25->paclen = AX25_DEF_PACLEN;
ax25->modulus = AX25_MODULUS; ax25->idle = msecs_to_jiffies(AX25_DEF_IDLE);
ax25->window = ax25_dev->values[AX25_VALUES_WINDOW]; ax25->backoff = AX25_DEF_BACKOFF;
}
if (AX25_DEF_AXDEFMODE) {
ax25->modulus = AX25_EMODULUS;
ax25->window = AX25_DEF_EWINDOW;
} else { } else {
ax25->rtt = AX25_DEF_T1 / 2; ax25->modulus = AX25_MODULUS;
ax25->t1 = AX25_DEF_T1; ax25->window = AX25_DEF_WINDOW;
ax25->t2 = AX25_DEF_T2;
ax25->t3 = AX25_DEF_T3;
ax25->n2 = AX25_DEF_N2;
ax25->paclen = AX25_DEF_PACLEN;
ax25->idle = AX25_DEF_IDLE;
ax25->backoff = AX25_DEF_BACKOFF;
if (AX25_DEF_AXDEFMODE) {
ax25->modulus = AX25_EMODULUS;
ax25->window = AX25_DEF_EWINDOW;
} else {
ax25->modulus = AX25_MODULUS;
ax25->window = AX25_DEF_WINDOW;
}
} }
} }
......
...@@ -61,7 +61,8 @@ void ax25_ds_set_timer(ax25_dev *ax25_dev) ...@@ -61,7 +61,8 @@ void ax25_ds_set_timer(ax25_dev *ax25_dev)
return; return;
del_timer(&ax25_dev->dama.slave_timer); del_timer(&ax25_dev->dama.slave_timer);
ax25_dev->dama.slave_timeout = ax25_dev->values[AX25_VALUES_DS_TIMEOUT] / 10; ax25_dev->dama.slave_timeout =
msecs_to_jiffies(ax25_dev->values[AX25_VALUES_DS_TIMEOUT]) / 10;
ax25_ds_add_timer(ax25_dev); ax25_ds_add_timer(ax25_dev);
} }
......
...@@ -18,14 +18,14 @@ static int min_backoff[1], max_backoff[] = {2}; ...@@ -18,14 +18,14 @@ static int min_backoff[1], max_backoff[] = {2};
static int min_conmode[1], max_conmode[] = {2}; static int min_conmode[1], max_conmode[] = {2};
static int min_window[] = {1}, max_window[] = {7}; static int min_window[] = {1}, max_window[] = {7};
static int min_ewindow[] = {1}, max_ewindow[] = {63}; static int min_ewindow[] = {1}, max_ewindow[] = {63};
static int min_t1[] = {1}, max_t1[] = {30 * HZ}; static int min_t1[] = {1}, max_t1[] = {30000};
static int min_t2[] = {1}, max_t2[] = {20 * HZ}; static int min_t2[] = {1}, max_t2[] = {20000};
static int min_t3[1], max_t3[] = {3600 * HZ}; static int min_t3[1], max_t3[] = {3600000};
static int min_idle[1], max_idle[] = {65535 * HZ}; static int min_idle[1], max_idle[] = {65535000};
static int min_n2[] = {1}, max_n2[] = {31}; static int min_n2[] = {1}, max_n2[] = {31};
static int min_paclen[] = {1}, max_paclen[] = {512}; static int min_paclen[] = {1}, max_paclen[] = {512};
static int min_proto[1], max_proto[] = { AX25_PROTO_MAX }; static int min_proto[1], max_proto[] = { AX25_PROTO_MAX };
static int min_ds_timeout[1], max_ds_timeout[] = {65535 * HZ}; static int min_ds_timeout[1], max_ds_timeout[] = {65535000};
static struct ctl_table_header *ax25_table_header; static struct ctl_table_header *ax25_table_header;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment