20 #include <linux/netdevice.h>
21 #include <linux/slab.h>
34 static int llc_conn_ac_data_confirm(
struct sock *
sk,
struct sk_buff *ev);
38 static int llc_conn_ac_send_rr_rsp_f_set_ackpf(
struct sock *
sk,
214 llc_conn_ac_set_p_flag_1(sk, skb);
376 llc_conn_ac_inc_vs_by_1(sk, skb);
381 static int llc_conn_ac_send_i_cmd_p_set_0(
struct sock *
sk,
struct sk_buff *
skb)
393 llc_conn_ac_inc_vs_by_1(sk, skb);
410 llc_conn_ac_inc_vs_by_1(sk, skb);
765 int state_changed = llc_sk(sk)->p_flag && !
value;
767 llc_sk(sk)->p_flag =
value;
784 dmac = llc->
dev->dev_addr;
830 llc_sk(sk)->s_flag = 0;
836 llc_sk(sk)->s_flag = 1;
866 llc->
ack_pf |= pf_bit & 1;
874 llc_conn_ac_send_rr_rsp_f_set_ackpf(sk, skb);
877 llc_conn_ac_inc_npta_value(sk, skb);
893 llc_sk(sk)->ack_must_be_send = llc_sk(sk)->ack_pf = 0;
907 static int llc_conn_ac_send_i_rsp_f_set_ackpf(
struct sock *sk,
920 llc_conn_ac_inc_vs_by_1(sk, skb);
940 llc_conn_ac_send_i_rsp_f_set_ackpf(sk, skb);
944 llc_conn_ac_send_i_cmd_p_set_0(sk, skb);
958 static int llc_conn_ac_send_rr_rsp_f_set_ackpf(
struct sock *sk,
993 static int llc_conn_ac_inc_npta_value(
struct sock *sk,
struct sk_buff *skb)
1072 if (llc->
k - unacked_pdu < 1)
1075 llc->
k -= unacked_pdu;
1144 if (!timer_pending(&llc->
ack_timer.timer))
1190 llc_conn_ac_data_confirm(sk, skb);
1201 llc_conn_ac_data_confirm(sk, skb);
1225 llc_sk(sk)->data_flag = 2;
1231 llc_sk(sk)->data_flag = 0;
1237 llc_sk(sk)->data_flag = 1;
1244 if (!llc_sk(sk)->data_flag)
1245 llc_sk(sk)->data_flag = 1;
1255 static int llc_conn_ac_set_p_flag_1(
struct sock *sk,
struct sk_buff *skb)
1263 llc_sk(sk)->remote_busy_flag = 0;
1269 llc_sk(sk)->cause_flag = 0;
1275 llc_sk(sk)->cause_flag = 1;
1281 llc_sk(sk)->retry_count = 0;
1287 llc_sk(sk)->retry_count++;
1311 llc_sk(sk)->vS = llc_sk(sk)->last_nr;
1315 static int llc_conn_ac_inc_vs_by_1(
struct sock *sk,
struct sk_buff *skb)
1321 static void llc_conn_tmr_common_cb(
unsigned long timeout_data,
u8 type)
1323 struct sock *sk = (
struct sock *)timeout_data;
1330 skb_set_owner_r(skb, sk);
1332 llc_process_tmr_ev(sk, skb);
1359 llc_sk(sk)->X = llc_sk(sk)->vS;
1430 static void llc_process_tmr_ev(
struct sock *sk,
struct sk_buff *skb)
1441 __sk_add_backlog(sk, skb);