diff options
author | Arnaldo Carvalho de Melo <acme@mandriva.com> | 2005-09-22 03:30:44 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@mandriva.com> | 2005-09-22 03:30:44 -0400 |
commit | 590232a7150674b2036291eaefce085f3f9659c8 (patch) | |
tree | f14ca696cc9eead769933d24d04105928260f028 /net/llc/af_llc.c | |
parent | 54fb7f25f19a4539d3ec012e410439913650dc06 (diff) |
[LLC]: Add sysctl support for the LLC timeouts
Signed-off-by: Jochen Friedrich <jochen@scram.de>
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
Diffstat (limited to 'net/llc/af_llc.c')
-rw-r--r-- | net/llc/af_llc.c | 47 |
1 files changed, 35 insertions, 12 deletions
diff --git a/net/llc/af_llc.c b/net/llc/af_llc.c index 95444f227510..ef125345a2db 100644 --- a/net/llc/af_llc.c +++ b/net/llc/af_llc.c | |||
@@ -877,22 +877,22 @@ static int llc_ui_setsockopt(struct socket *sock, int level, int optname, | |||
877 | case LLC_OPT_ACK_TMR_EXP: | 877 | case LLC_OPT_ACK_TMR_EXP: |
878 | if (opt > LLC_OPT_MAX_ACK_TMR_EXP) | 878 | if (opt > LLC_OPT_MAX_ACK_TMR_EXP) |
879 | goto out; | 879 | goto out; |
880 | llc->ack_timer.expire = opt; | 880 | llc->ack_timer.expire = opt * HZ; |
881 | break; | 881 | break; |
882 | case LLC_OPT_P_TMR_EXP: | 882 | case LLC_OPT_P_TMR_EXP: |
883 | if (opt > LLC_OPT_MAX_P_TMR_EXP) | 883 | if (opt > LLC_OPT_MAX_P_TMR_EXP) |
884 | goto out; | 884 | goto out; |
885 | llc->pf_cycle_timer.expire = opt; | 885 | llc->pf_cycle_timer.expire = opt * HZ; |
886 | break; | 886 | break; |
887 | case LLC_OPT_REJ_TMR_EXP: | 887 | case LLC_OPT_REJ_TMR_EXP: |
888 | if (opt > LLC_OPT_MAX_REJ_TMR_EXP) | 888 | if (opt > LLC_OPT_MAX_REJ_TMR_EXP) |
889 | goto out; | 889 | goto out; |
890 | llc->rej_sent_timer.expire = opt; | 890 | llc->rej_sent_timer.expire = opt * HZ; |
891 | break; | 891 | break; |
892 | case LLC_OPT_BUSY_TMR_EXP: | 892 | case LLC_OPT_BUSY_TMR_EXP: |
893 | if (opt > LLC_OPT_MAX_BUSY_TMR_EXP) | 893 | if (opt > LLC_OPT_MAX_BUSY_TMR_EXP) |
894 | goto out; | 894 | goto out; |
895 | llc->busy_state_timer.expire = opt; | 895 | llc->busy_state_timer.expire = opt * HZ; |
896 | break; | 896 | break; |
897 | case LLC_OPT_TX_WIN: | 897 | case LLC_OPT_TX_WIN: |
898 | if (opt > LLC_OPT_MAX_WIN) | 898 | if (opt > LLC_OPT_MAX_WIN) |
@@ -942,17 +942,17 @@ static int llc_ui_getsockopt(struct socket *sock, int level, int optname, | |||
942 | goto out; | 942 | goto out; |
943 | switch (optname) { | 943 | switch (optname) { |
944 | case LLC_OPT_RETRY: | 944 | case LLC_OPT_RETRY: |
945 | val = llc->n2; break; | 945 | val = llc->n2; break; |
946 | case LLC_OPT_SIZE: | 946 | case LLC_OPT_SIZE: |
947 | val = llc->n1; break; | 947 | val = llc->n1; break; |
948 | case LLC_OPT_ACK_TMR_EXP: | 948 | case LLC_OPT_ACK_TMR_EXP: |
949 | val = llc->ack_timer.expire; break; | 949 | val = llc->ack_timer.expire / HZ; break; |
950 | case LLC_OPT_P_TMR_EXP: | 950 | case LLC_OPT_P_TMR_EXP: |
951 | val = llc->pf_cycle_timer.expire; break; | 951 | val = llc->pf_cycle_timer.expire / HZ; break; |
952 | case LLC_OPT_REJ_TMR_EXP: | 952 | case LLC_OPT_REJ_TMR_EXP: |
953 | val = llc->rej_sent_timer.expire; break; | 953 | val = llc->rej_sent_timer.expire / HZ; break; |
954 | case LLC_OPT_BUSY_TMR_EXP: | 954 | case LLC_OPT_BUSY_TMR_EXP: |
955 | val = llc->busy_state_timer.expire; break; | 955 | val = llc->busy_state_timer.expire / HZ; break; |
956 | case LLC_OPT_TX_WIN: | 956 | case LLC_OPT_TX_WIN: |
957 | val = llc->k; break; | 957 | val = llc->k; break; |
958 | case LLC_OPT_RX_WIN: | 958 | case LLC_OPT_RX_WIN: |
@@ -999,6 +999,13 @@ static struct proto_ops llc_ui_ops = { | |||
999 | extern void llc_sap_handler(struct llc_sap *sap, struct sk_buff *skb); | 999 | extern void llc_sap_handler(struct llc_sap *sap, struct sk_buff *skb); |
1000 | extern void llc_conn_handler(struct llc_sap *sap, struct sk_buff *skb); | 1000 | extern void llc_conn_handler(struct llc_sap *sap, struct sk_buff *skb); |
1001 | 1001 | ||
1002 | static char llc_proc_err_msg[] __initdata = | ||
1003 | KERN_CRIT "LLC: Unable to register the proc_fs entries\n"; | ||
1004 | static char llc_sysctl_err_msg[] __initdata = | ||
1005 | KERN_CRIT "LLC: Unable to register the sysctl entries\n"; | ||
1006 | static char llc_sock_err_msg[] __initdata = | ||
1007 | KERN_CRIT "LLC: Unable to register the network family\n"; | ||
1008 | |||
1002 | static int __init llc2_init(void) | 1009 | static int __init llc2_init(void) |
1003 | { | 1010 | { |
1004 | int rc = proto_register(&llc_proto, 0); | 1011 | int rc = proto_register(&llc_proto, 0); |
@@ -1010,13 +1017,28 @@ static int __init llc2_init(void) | |||
1010 | llc_station_init(); | 1017 | llc_station_init(); |
1011 | llc_ui_sap_last_autoport = LLC_SAP_DYN_START; | 1018 | llc_ui_sap_last_autoport = LLC_SAP_DYN_START; |
1012 | rc = llc_proc_init(); | 1019 | rc = llc_proc_init(); |
1013 | if (rc != 0) | 1020 | if (rc != 0) { |
1021 | printk(llc_proc_err_msg); | ||
1014 | goto out_unregister_llc_proto; | 1022 | goto out_unregister_llc_proto; |
1015 | sock_register(&llc_ui_family_ops); | 1023 | } |
1024 | rc = llc_sysctl_init(); | ||
1025 | if (rc) { | ||
1026 | printk(llc_sysctl_err_msg); | ||
1027 | goto out_proc; | ||
1028 | } | ||
1029 | rc = sock_register(&llc_ui_family_ops); | ||
1030 | if (rc) { | ||
1031 | printk(llc_sock_err_msg); | ||
1032 | goto out_sysctl; | ||
1033 | } | ||
1016 | llc_add_pack(LLC_DEST_SAP, llc_sap_handler); | 1034 | llc_add_pack(LLC_DEST_SAP, llc_sap_handler); |
1017 | llc_add_pack(LLC_DEST_CONN, llc_conn_handler); | 1035 | llc_add_pack(LLC_DEST_CONN, llc_conn_handler); |
1018 | out: | 1036 | out: |
1019 | return rc; | 1037 | return rc; |
1038 | out_sysctl: | ||
1039 | llc_sysctl_exit(); | ||
1040 | out_proc: | ||
1041 | llc_proc_exit(); | ||
1020 | out_unregister_llc_proto: | 1042 | out_unregister_llc_proto: |
1021 | proto_unregister(&llc_proto); | 1043 | proto_unregister(&llc_proto); |
1022 | goto out; | 1044 | goto out; |
@@ -1029,6 +1051,7 @@ static void __exit llc2_exit(void) | |||
1029 | llc_remove_pack(LLC_DEST_CONN); | 1051 | llc_remove_pack(LLC_DEST_CONN); |
1030 | sock_unregister(PF_LLC); | 1052 | sock_unregister(PF_LLC); |
1031 | llc_proc_exit(); | 1053 | llc_proc_exit(); |
1054 | llc_sysctl_exit(); | ||
1032 | proto_unregister(&llc_proto); | 1055 | proto_unregister(&llc_proto); |
1033 | } | 1056 | } |
1034 | 1057 | ||