1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 #include <linux/types.h>
18 #include <net/llc_if.h>
19 #include <net/llc_s_ev.h>
20 #include <net/llc_s_ac.h>
21 #include <net/llc_s_st.h>
22
23
24
25
26
27 static struct llc_sap_state_trans llc_sap_state_trans_end;
28
29
30
31
32 static const llc_sap_action_t llc_sap_inactive_state_actions_1[] = {
33 [0] = llc_sap_action_report_status,
34 [1] = NULL,
35 };
36
37 static struct llc_sap_state_trans llc_sap_inactive_state_trans_1 = {
38 .ev = llc_sap_ev_activation_req,
39 .next_state = LLC_SAP_STATE_ACTIVE,
40 .ev_actions = llc_sap_inactive_state_actions_1,
41 };
42
43
44 static struct llc_sap_state_trans *llc_sap_inactive_state_transitions[] = {
45 [0] = &llc_sap_inactive_state_trans_1,
46 [1] = &llc_sap_state_trans_end,
47 };
48
49
50 static const llc_sap_action_t llc_sap_active_state_actions_1[] = {
51 [0] = llc_sap_action_unitdata_ind,
52 [1] = NULL,
53 };
54
55 static struct llc_sap_state_trans llc_sap_active_state_trans_1 = {
56 .ev = llc_sap_ev_rx_ui,
57 .next_state = LLC_SAP_STATE_ACTIVE,
58 .ev_actions = llc_sap_active_state_actions_1,
59 };
60
61
62 static const llc_sap_action_t llc_sap_active_state_actions_2[] = {
63 [0] = llc_sap_action_send_ui,
64 [1] = NULL,
65 };
66
67 static struct llc_sap_state_trans llc_sap_active_state_trans_2 = {
68 .ev = llc_sap_ev_unitdata_req,
69 .next_state = LLC_SAP_STATE_ACTIVE,
70 .ev_actions = llc_sap_active_state_actions_2,
71 };
72
73
74 static const llc_sap_action_t llc_sap_active_state_actions_3[] = {
75 [0] = llc_sap_action_send_xid_c,
76 [1] = NULL,
77 };
78
79 static struct llc_sap_state_trans llc_sap_active_state_trans_3 = {
80 .ev = llc_sap_ev_xid_req,
81 .next_state = LLC_SAP_STATE_ACTIVE,
82 .ev_actions = llc_sap_active_state_actions_3,
83 };
84
85
86 static const llc_sap_action_t llc_sap_active_state_actions_4[] = {
87 [0] = llc_sap_action_send_xid_r,
88 [1] = NULL,
89 };
90
91 static struct llc_sap_state_trans llc_sap_active_state_trans_4 = {
92 .ev = llc_sap_ev_rx_xid_c,
93 .next_state = LLC_SAP_STATE_ACTIVE,
94 .ev_actions = llc_sap_active_state_actions_4,
95 };
96
97
98 static const llc_sap_action_t llc_sap_active_state_actions_5[] = {
99 [0] = llc_sap_action_xid_ind,
100 [1] = NULL,
101 };
102
103 static struct llc_sap_state_trans llc_sap_active_state_trans_5 = {
104 .ev = llc_sap_ev_rx_xid_r,
105 .next_state = LLC_SAP_STATE_ACTIVE,
106 .ev_actions = llc_sap_active_state_actions_5,
107 };
108
109
110 static const llc_sap_action_t llc_sap_active_state_actions_6[] = {
111 [0] = llc_sap_action_send_test_c,
112 [1] = NULL,
113 };
114
115 static struct llc_sap_state_trans llc_sap_active_state_trans_6 = {
116 .ev = llc_sap_ev_test_req,
117 .next_state = LLC_SAP_STATE_ACTIVE,
118 .ev_actions = llc_sap_active_state_actions_6,
119 };
120
121
122 static const llc_sap_action_t llc_sap_active_state_actions_7[] = {
123 [0] = llc_sap_action_send_test_r,
124 [1] = NULL,
125 };
126
127 static struct llc_sap_state_trans llc_sap_active_state_trans_7 = {
128 .ev = llc_sap_ev_rx_test_c,
129 .next_state = LLC_SAP_STATE_ACTIVE,
130 .ev_actions = llc_sap_active_state_actions_7
131 };
132
133
134 static const llc_sap_action_t llc_sap_active_state_actions_8[] = {
135 [0] = llc_sap_action_test_ind,
136 [1] = NULL,
137 };
138
139 static struct llc_sap_state_trans llc_sap_active_state_trans_8 = {
140 .ev = llc_sap_ev_rx_test_r,
141 .next_state = LLC_SAP_STATE_ACTIVE,
142 .ev_actions = llc_sap_active_state_actions_8,
143 };
144
145
146
147
148 static const llc_sap_action_t llc_sap_active_state_actions_9[] = {
149 [0] = llc_sap_action_report_status,
150 [1] = NULL,
151 };
152
153 static struct llc_sap_state_trans llc_sap_active_state_trans_9 = {
154 .ev = llc_sap_ev_deactivation_req,
155 .next_state = LLC_SAP_STATE_INACTIVE,
156 .ev_actions = llc_sap_active_state_actions_9
157 };
158
159
160 static struct llc_sap_state_trans *llc_sap_active_state_transitions[] = {
161 [0] = &llc_sap_active_state_trans_2,
162 [1] = &llc_sap_active_state_trans_1,
163 [2] = &llc_sap_active_state_trans_3,
164 [3] = &llc_sap_active_state_trans_4,
165 [4] = &llc_sap_active_state_trans_5,
166 [5] = &llc_sap_active_state_trans_6,
167 [6] = &llc_sap_active_state_trans_7,
168 [7] = &llc_sap_active_state_trans_8,
169 [8] = &llc_sap_active_state_trans_9,
170 [9] = &llc_sap_state_trans_end,
171 };
172
173
174 struct llc_sap_state llc_sap_state_table[LLC_NR_SAP_STATES] = {
175 [LLC_SAP_STATE_INACTIVE - 1] = {
176 .curr_state = LLC_SAP_STATE_INACTIVE,
177 .transitions = llc_sap_inactive_state_transitions,
178 },
179 [LLC_SAP_STATE_ACTIVE - 1] = {
180 .curr_state = LLC_SAP_STATE_ACTIVE,
181 .transitions = llc_sap_active_state_transitions,
182 },
183 };