summaryrefslogtreecommitdiff
path: root/cesar/cp/fsm/src/fsm/cp.fsm
blob: 268d84290578f05f149758f9a1fc731b45c064a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
Control Plane FSM
  FSM for control plane.

States:
 UNASSOCIATED [enter=cp_sta_action_assoc__unassociated__enter]
 WAIT_ASSOC_CONF [enter=cp_sta_action_assoc__start_retry_timer leave=cp_sta_action_assoc__stop_retry_timer]
 ASSOCIATED [enter=cp_sta_action_assoc__start_retry_timer leave=cp_sta_action_assoc__stop_retry_timer]
 AUTHENTICATED [leave=cp_sta_action_assoc__authenticated__leave]
 LEAVING
 LEAVE_WAIT [enter=cp_sta_action_assoc__leave_wait__enter]

 SC_WAIT_ASSOC_CONF [enter=cp_sta_action_assoc__start_retry_timer leave=cp_sta_action_assoc__stop_retry_timer]
 SC_ASSOCIATED [enter=cp_sta_action_assoc__start_retry_timer leave=cp_sta_action_assoc__stop_retry_timer]
 SC_TEK_EXCHANGED
 SC_NMK_EXCHANGED
 ASSOC_CCO

 *SC_IDLE [enter=cp_sta_action_sc__sc_idle__enter leave=cp_sta_action_sc__sc_idle__leave]
  Idle state of the SC (simple connect) sub FSM.
 SC_ADD
  Wait for a CM_SC_JOIN_REQ MME.
 SC_JOIN [enter=cp_sta_action_sc__sc_join__enter leave=cp_sta_action_sc__sc_join__leave]
  Send periodically CM_SC_JOIN_REQ MME.
 SC_WAIT_BEACON
  Wait for beacon to start association.
 SC_WAIT_PEER_ASSOCIATED
  Wait for peer to confirm association.
 SC_BUILDING_TEK
  Get the second hash key with the sc peer to build the TEK.
 SC_NMK_EXCHANGE
  Exchange the NMK to authenticate to the CCo.

 *STOPPED
 STARTED
 STOPPING

 *IDLE
 POWERON [enter=cp_sta_action_poweron__poweron__enter leave=cp_sta_action_poweron__poweron__leave]
 POWERON_JOINING
 USTA [enter=cp_sta_action_poweron__usta__enter leave=cp_sta_action_poweron__usta__leave]
 USTA_JOINING
 UCCO [enter=cp_sta_action_poweron__ucco__enter]
 STA
 CCO [enter=cp_sta_action_poweron__cco__enter leave=cp_sta_action_poweron__cco__leave]
 CCO_LEAVING
 CCO_LEAVING_HOIP
 UNASSOCIATING

 SC_USTA
  Same as USTA, but the STA is doing SC procedure at the same time.
 SC_USTA_JOINING
  Same as USTA_JOINING, but the STA is doing SC procedure at the same time.
 SC_UCCO
  Same as UCCO, but the STA is doing SC procedure at the same time.
 SC_STA
  Same as STA, but the STA is doing SC procedure at the same time.
 SC_CCO
  Same as CCO, but the STA is doing SC procedure at the same time.

 HANDOVER_CCO
  The handover CCo state.
 HANDOVER_STA
  The handover STA state.

 *CCO_HANDOVER_IDLE
  The idle state of the CCo handover.
 CCO_HANDOVER_WAIT_CC_HANDOVER_CNF
  The CCo is waiting the confirmation from the peer station for the handover request.
 CCO_HANDOVER_WAIT_CC_HANDOVER_INFO_RSP
  The CCo waits for the cc_handover_info.rsp from the peer station i.e. the new CCo.
 CCO_HANDOVER_WAIT_HANDOVER_COUNTDOWN
  Wait the handover countdown expires in the central beacon to leave the CCo status.

 *STA_HANDOVER_IDLE
  The idle state of the STA handover.
 STA_HANDOVER_WAIT_CC_HANDOVER_INFO
  The station waits the CC_HANDOVER_INFO message.
 STA_HANDOVER_WAIT_COUNTDOWN_EXPIRES
  The station is ready to become the new CCo and only waits the end of the HANDOVER countdown.
 STA_HANDOVER_FAILURE
  Failure state.

 *CCO_NEK_CHANGE_IDLE  [enter=cp_cco_action_nek_change_prevent]
  NEK change FSM in IDLE state.
 CCO_NEK_CHANGE_WAIT_STA_CNF
  Wait for the station requested to answer the request of the first CM_SET_KEY.
 CCO_NEK_CHANGE_PROCESS_CM_SET_KEY_CNF
  Verify the CM_SET_KEY.CNF MME received from the peer and choose between the possibility to branch.
 CCO_NEK_CHANGE_NEK_EXCHANGE_ENDED
  The procedure is ended with the peer station, it will try with the next one or go to the IDLE state.

Events:
 to_assoc
 to_sc_assoc
 to_leave
 assoc_timeout
 renew
 joined
 left
 avln_failure
 become_cco
 become_sta
 sta_status_changed

 DRV_STA_SET_MAC_ADDR_REQ
 DRV_STA_SET_CCO_PREF_REQ
 DRV_STA_SET_WAS_CCO_REQ
 DRV_STA_SET_NPW_REQ
 DRV_STA_SET_DPW_REQ
 DRV_STA_SET_SL_REQ
 DRV_STA_SET_NID_REQ
 DRV_STA_SET_M_STA_HFID_REQ
 DRV_STA_SET_U_STA_HFID_REQ
 DRV_STA_SET_AVLN_HFID_REQ
 DRV_STA_SET_TONEMASK_REQ
 DRV_STA_MAC_START_REQ
 DRV_STA_MAC_STOP_REQ
 DRV_STA_SC_REQ
 DRV_STA_SET_KEY_REQ
 DRV_STA_SET_DAK_REQ
 DRV_STA_GET_KEY_REQ
 DRV_STA_STATUS_REQ
 DRV_STA_SET_CONFIG_REQ

 VS_GET_TONEMAP_REQ
 VS_GET_SNR_REQ
 VS_GET_LINK_STATS_REQ
 VS_GET_SPECTRUM_REQ
 VS_GET_AMP_MAP_REQ
 VS_GET_STATS_REQ
 IMAC_GET_DISCOVER_LIST_REQ

 to_poweron
 to_stop
 stopped
 btt_timeout
 ustt_timeout
 BEACON
 all_sta_leaved
 join_timeout
 association_request
 net_list_empty
 usta_ind
 BEACON_NOT_RECEIVED
 BEACON_TIMER_EXPIRES
 snid_conflict
 first_com_with_assoc_sta
  First communication with an associated STA has been done.
 new_sta_associated

 change_nek
 nek_provide
 nek_timeout

 sc_start_add
  To start the SC FSM in SC ADD.
 sc_start_join
  To start the SC FSM in SC JOIN.
 sc_timeout
  When the main timer of the SC FSM occurs.
 sc_join_req_timeout
  When the timer for periodic broadcast of SC_JON.REQ MME expires.
 sc_failed
  When the SC FSM has finished with a failure.
 sc_succeed
  When the SC FSM has finished with a success.
 sc_get_cco_functionality
  When the SC FSM need the main FSM to move to a state to get CCo
  functionalities.

 HANDOVER_DISCOVER_PROCESS_DONE
  Post by the beacon module to indicate the discover process is done.
 HOIP_EXPIRED
  The handover in progress countdown expired in the central beacon.
 HANDOVER_TIMEOUT
  The handover process timeout.
 CCO_LEAVING_HANDOVER
  The CCo is doing a handover to be stopped after.

 CCO_HANDOVER_START
  Handover FSM start event
 STA_HANDOVER_START
 HANDOVER_SUCCESS
  Handover FSM end event.
 HANDOVER_FAILURE
  Handover FSM end event.

 CC_DISCOVER_LIST_REQ
 CC_DISCOVER_LIST_CNF
 CC_WHO_RU_REQ
 CC_WHO_RU_CNF
 CC_ASSOC_REQ
 CC_ASSOC_CNF
 CC_LEAVE_REQ
 CC_LEAVE_CNF
 CC_LEAVE_IND
 CC_LEAVE_RSP
 CC_SET_TEI_MAP_REQ
 CC_SET_TEI_MAP_IND
 CC_RELAY_REQ
 CC_RELAY_IND
 CC_HANDOVER_CNF
 CC_HANDOVER_REQ
 CC_HANDOVER_INFO_IND
 CC_HANDOVER_INFO_RSP
 CM_UNASSOCIATED_STA_IND
 CM_SET_KEY_REQ
 CM_SET_KEY_CNF
 CM_SET_KEY_REQ_PID1
 CM_SET_KEY_CNF_PID1
 CM_SET_KEY_REQ_PID3
 CM_SET_KEY_CNF_PID3
 CM_GET_KEY_REQ
 CM_GET_KEY_CNF
 CM_GET_KEY_REQ_PID0
 CM_GET_KEY_CNF_PID0
 CM_GET_KEY_REQ_PID3
 CM_GET_KEY_CNF_PID3
 CM_SC_JOIN_REQ
 CM_SC_JOIN_CNF
 CM_CHAN_EST_IND
 CM_TM_UPDATE_IND
 CM_AMP_MAP_REQ
 CM_AMP_MAP_CNF
 CM_BRG_INFO_REQ
 CM_BRG_INFO_CNF
 CM_STA_CAP_REQ
 CM_STA_CAP_CNF
 CM_NW_INFO_REQ
 CM_NW_INFO_CNF
 CM_NW_STATS_REQ
 CM_NW_STATS_CNF
 CM_LINK_STATS_REQ
 CM_HFID_REQ
 CM_HFID_CNF
 CM_MME_ERROR_IND

UNASSOCIATED:
 to_assoc -> WAIT_ASSOC_CONF [cp_sta_action_assoc__unassociated__to_assoc]
  send CC_ASSOC.REQ
 to_sc_assoc -> SC_WAIT_ASSOC_CONF [cp_sta_action_assoc__unassociated__to_assoc]
  send CC_ASSOC.REQ
 become_cco -> ASSOC_CCO [NULL]

WAIT_ASSOC_CONF:
 CC_ASSOC_CNF: ok -> ASSOCIATED [cp_sta_action_assoc__wait_assoc_cnf__cc_assoc_cnf]
  send CM_GET_KEY.REQ
 CC_ASSOC_CNF: nok -> UNASSOCIATED
 CC_ASSOC_CNF: unrelated -> .
 assoc_timeout: retry -> . [cp_sta_action_assoc__wait_assoc_cnf__timeout]
  send CC_ASSOC.REQ
 assoc_timeout: no retry -> UNASSOCIATED
 to_leave -> UNASSOCIATED [NULL]

SC_WAIT_ASSOC_CONF:
 CC_ASSOC_CNF: ok -> SC_ASSOCIATED [cp_sta_action_assoc__sc_wait_assoc_cnf__cc_assoc_cnf]
  send CM_GET_KEY.REQ
 CC_ASSOC_CNF: nok -> UNASSOCIATED
 CC_ASSOC_CNF: unrelated -> .
 assoc_timeout: retry -> . [cp_sta_action_assoc__sc_wait_assoc_cnf__timeout]
  send CC_ASSOC.REQ
 assoc_timeout: no retry -> UNASSOCIATED
 to_leave -> UNASSOCIATED [NULL]

ASSOCIATED:
 CM_GET_KEY_CNF_PID0: ok -> AUTHENTICATED [cp_sta_action_assoc__associated__cm_get_key_cnf_pid_0]
 CM_GET_KEY_CNF_PID0: nok -> UNASSOCIATED
 CM_GET_KEY_CNF_PID0: unrelated -> .
 assoc_timeout -> UNASSOCIATED [cp_sta_action_assoc__associated__timeout]
 to_leave -> UNASSOCIATED [cp_sta_action_assoc__associated__to_leave]

SC_ASSOCIATED:
 CM_GET_KEY_REQ_PID3: ok -> SC_TEK_EXCHANGED [cp_sta_action_assoc__sc_associated__cm_get_key_req_pid_3]
  send CM_GET_KEY_CNF_PID3
 CM_GET_KEY_REQ_PID3: unrelated -> .
 assoc_timeout -> UNASSOCIATED [NULL]
 to_leave -> UNASSOCIATED [cp_sta_action_assoc__associated__to_leave]

SC_TEK_EXCHANGED:
 CM_SET_KEY_REQ_PID3: ok -> SC_NMK_EXCHANGED [cp_sta_action_assoc__sc_tek_exchanged__cm_set_key_req_pid_3]
  send CM_SET_KEY_CNF_PID3 and CM_GET_KEY_CNF_PID0
 CM_SET_KEY_REQ_PID3: unrelated -> .
 assoc_timeout -> UNASSOCIATED [NULL]
 to_leave -> UNASSOCIATED [cp_sta_action_assoc__associated__to_leave]

SC_NMK_EXCHANGED:
 CM_GET_KEY_CNF_PID0: ok -> AUTHENTICATED [cp_sta_action_assoc__sc_nmk_exchanged__cm_get_key_cnf_pid_0]
 CM_GET_KEY_CNF_PID0: unrelated -> .
 CM_GET_KEY_CNF_PID0: nok -> UNASSOCIATED
 assoc_timeout -> UNASSOCIATED [NULL]
 to_leave -> UNASSOCIATED [cp_sta_action_assoc__associated__to_leave]

AUTHENTICATED:
 renew -> . [cp_sta_action_assoc__authenticated__renew]
  send CC_ASSOC.REQ for renewal
 CC_ASSOC_CNF -> . [cp_sta_action_assoc__authenticated__cc_assoc_cnf]
 CM_SET_KEY_REQ_PID1 -> . [cp_sta_action_assoc__authenticated__cm_set_key_req_pid_1]
  send CM_SET_KEY.CNF
 to_leave -> LEAVING [cp_sta_action_assoc__authenticated__to_leave]
  send CC_LEAVE.REQ
 CC_LEAVE_IND: ok -> LEAVE_WAIT [cp_sta_action_assoc__authenticated__cc_leave_ind]
  send CC_LEAVE.RSP
 CC_LEAVE_IND: nok -> .
 BEACON -> . [cp_sta_action_assoc__authenticated__beacon]
  clear missed beacon counter
 BEACON_NOT_RECEIVED: avln failure -> UNASSOCIATED [cp_sta_action_assoc__authenticated__beacon_not_received]
  cleanup data plane
 BEACON_NOT_RECEIVED: else -> .
 become_cco -> ASSOC_CCO [NULL]
  Handover done, the STA is now CCo.

ASSOCIATED, AUTHENTICATED:
 CC_SET_TEI_MAP_IND -> . [cp_sta_action_process_cc_set_tei_map_ind]

ASSOC_CCO:
 become_sta -> AUTHENTICATED [NULL]
 to_leave -> UNASSOCIATED [NULL]

LEAVING:
 CC_LEAVE_CNF: ok -> UNASSOCIATED [cp_sta_action_assoc__leaving__cc_leave_cnf]
  cleanup data plane
 CC_LEAVE_CNF: unrelated -> .
 assoc_timeout -> LEAVE_WAIT [cp_sta_action_assoc__leaving__timeout]
  send CC_LEAVE.REQ

LEAVE_WAIT:
 assoc_timeout -> UNASSOCIATED [cp_sta_action_assoc__leave_wait__timeout]
  cleanup data plane


STOPPED:
 DRV_STA_SET_MAC_ADDR_REQ -> . [cp_sta_action_drv__stopped__drv_sta_set_mac_addr_req]
 DRV_STA_SET_CCO_PREF_REQ -> . [cp_sta_action_drv__stopped__drv_sta_set_cco_pref_req]
 DRV_STA_SET_WAS_CCO_REQ -> . [cp_sta_action_drv__stopped__drv_sta_set_was_cco_req]
 DRV_STA_SET_NPW_REQ -> . [cp_sta_action_drv__stopped__drv_sta_set_npw_req]
 DRV_STA_SET_DPW_REQ -> . [cp_sta_action_drv__stopped__drv_sta_set_dpw_req]
 DRV_STA_SET_SL_REQ -> . [cp_sta_action_drv__stopped__drv_sta_set_sl_req]
 DRV_STA_SET_NID_REQ -> . [cp_sta_action_drv__stopped__drv_sta_set_nid_req]
 DRV_STA_SET_M_STA_HFID_REQ -> . [cp_sta_action_drv__stopped__drv_sta_set_m_sta_hfid_req]
 DRV_STA_SET_U_STA_HFID_REQ -> . [cp_sta_action_drv__stopped__drv_sta_set_u_sta_hfid_req]
 DRV_STA_SET_AVLN_HFID_REQ -> . [cp_sta_action_drv__stopped__drv_sta_set_avln_hfid_req]
 DRV_STA_SET_TONEMASK_REQ -> . [cp_sta_action_drv__stopped__drv_sta_set_tonemask_req]
 DRV_STA_SET_KEY_REQ -> . [cp_sta_action_drv__stopped__drv_sta_set_key_req]
 DRV_STA_SET_DAK_REQ -> . [cp_sta_action_drv__stopped__drv_sta_set_dak_req]
 DRV_STA_MAC_START_REQ -> STARTED [cp_sta_action_drv__stopped__drv_sta_mac_start_req]
  send DRV_STA_MAC_START.CNF
 DRV_STA_GET_KEY_REQ -> . [cp_sta_action_drv__drv_sta_get_key_req]
 DRV_STA_STATUS_REQ -> . [cp_sta_action_drv__drv_sta_status_req]
 DRV_STA_SET_CONFIG_REQ -> . [cp_sta_action_drv__drv_sta_set_config_req]
 sta_status_changed -> . [cp_sta_action_drv__drv_sta_status_ind_send]

STARTED:
 DRV_STA_MAC_STOP_REQ -> STOPPING [cp_sta_action_drv__started__drv_sta_mac_stop_req]
  trigger to_stop
 DRV_STA_GET_KEY_REQ -> . [cp_sta_action_drv__drv_sta_get_key_req]
 DRV_STA_STATUS_REQ -> . [cp_sta_action_drv__drv_sta_status_req]
 DRV_STA_SET_CONFIG_REQ -> . [cp_sta_action_drv__drv_sta_set_config_req]

 CM_UNASSOCIATED_STA_IND -> . [cp_sta_action_process_cm_unassociated_sta_ind]
 CM_SET_KEY_REQ -> . [cp_sta_action_process_cm_set_key_req]
 CM_SET_KEY_CNF -> . [cp_sta_action_process_cm_set_key_cnf]
 CM_GET_KEY_REQ -> . [cp_sta_action_process_cm_get_key_req]
 CM_GET_KEY_CNF -> . [cp_sta_action_process_cm_get_key_cnf]
 CM_HFID_REQ -> . [cp_sta_action_process_cm_hfid_req]
 CM_STA_CAP_REQ -> . [cp_sta_action_process_cm_sta_cap_req]

 VS_GET_TONEMAP_REQ -> . [cp_sta_action_vs__started__vs_get_tonemap_req]
 VS_GET_SNR_REQ -> . [cp_sta_action_vs__started__vs_get_snr_req]
 VS_GET_SPECTRUM_REQ -> . [cp_sta_action_vs__started__vs_get_spectrum_req]
 VS_GET_LINK_STATS_REQ -> . [cp_sta_action_vs__started__vs_get_link_stats_req]
 VS_GET_AMP_MAP_REQ -> . [cp_sta_action_vs__started__vs_get_amp_map_req]
 VS_GET_STATS_REQ -> . [cp_sta_action_vs__started__vs_get_stats_req]
 CM_NW_INFO_REQ -> . [cp_sta_action_process_cm_nw_info_req]
 sta_status_changed -> . [cp_sta_action_drv__drv_sta_status_ind_send]
 CM_NW_STATS_REQ -> . [cp_sta_action_process_cm_nw_stats_req]
 CM_LINK_STATS_REQ -> . [cp_sta_action_process_cm_link_stats_req]
 IMAC_GET_DISCOVER_LIST_REQ -> . [cp_sta_action_vs__started__imac_get_discover_list_req]
 CC_DISCOVER_LIST_REQ -> . [cp_sta_action_process_cc_discover_list_req]

STOPPING:
 stopped -> STOPPED [cp_sta_action_drv__stopping__stopped]
  send DRV_STA_MAC_STOP.CNF
 DRV_STA_GET_KEY_REQ -> . [cp_sta_action_drv__drv_sta_get_key_req]
 DRV_STA_STATUS_REQ -> . [cp_sta_action_drv__drv_sta_status_req]
 DRV_STA_SET_CONFIG_REQ -> . [cp_sta_action_drv__drv_sta_set_config_req]
 sta_status_changed -> . [cp_sta_action_drv__drv_sta_status_ind_send]

IDLE:
 to_poweron -> POWERON [cp_sta_action_poweron__idle__to_poweron]

POWERON:
 BEACON_TIMER_EXPIRES -> . [cp_beacon_beacon_not_received]
 ustt_timeout -> . [cp_sta_action_poweron__poweron__ustt_timeout]
  send CM_UNASSOCIATED_STA.IND if an AVLN is present
 btt_timeout: nid match cco -> CCO [cp_sta_action_poweron__poweron__btt_timeout]
 btt_timeout: avln -> USTA
 btt_timeout: no avln -> UCCO
 BEACON: nid match -> POWERON_JOINING [cp_sta_action_poweron__poweron__beacon]
 BEACON: no nid match -> .
 to_stop -> IDLE [cp_sta_action_poweron__many__to_idle]

USTA:
 BEACON_TIMER_EXPIRES -> . [cp_beacon_beacon_not_received]
 ustt_timeout -> . [cp_sta_action_poweron__usta__ustt_timeout]
  send CM_UNASSOCIATED_STA.IND if an AVLN is present
 BEACON: nid match -> USTA_JOINING [cp_sta_action_poweron__usta__beacon]
 BEACON: no nid match -> .
 net_list_empty -> UCCO [NULL]
 usta_ind: nid match cco -> CCO [cp_sta_action_poweron__usta__usta_ind]
 usta_ind: else -> .
 to_stop -> IDLE [cp_sta_action_poweron__many__to_idle]
 DRV_STA_SC_REQ -> SC_USTA [cp_sta_action_drv__usta__drv_sta_sc]
  Start the SC FSM.

SC_USTA:
 BEACON_TIMER_EXPIRES -> . [cp_beacon_beacon_not_received]
 BEACON -> . [cp_sta_action_sc__sc_usta_track_beacon]
  track AVLN.
 net_list_empty -> SC_UCCO [NULL]
  no more AVLN to track, go to SC_UCCO.
 sc_get_cco_functionality -> SC_CCO [cp_sta_action_sc__sc_usta_sc_get_cco_functionality]
  Get CCo functionality.
 sc_succeed -> SC_USTA_JOINING [NULL]
  SC procedure finished, start association.
 sc_failed -> USTA [NULL]
 to_stop -> IDLE [cp_sta_action_poweron__many__to_idle]

POWERON_JOINING:
 BEACON_TIMER_EXPIRES -> . [cp_beacon_sta_update_beacon_data]
 left -> POWERON [cp_sta_action_poweron__poweron_joining__left]

USTA_JOINING:
 BEACON_TIMER_EXPIRES -> . [cp_beacon_beacon_not_received]
 left -> USTA [cp_sta_action_poweron__usta_joining__left]

SC_USTA_JOINING:
 BEACON_TIMER_EXPIRES -> . [cp_beacon_beacon_not_received]
 joined -> STA [NULL]
  SC procedure (association part), finished, we are now a STA in the AVLN.
 left -> USTA [NULL]
  SC procedure (association part) failed.
 to_stop -> UNASSOCIATING [cp_sta_action_poweron__joining__to_stop]

POWERON_JOINING, USTA_JOINING:
 joined -> STA [NULL]
 to_stop -> UNASSOCIATING [cp_sta_action_poweron__joining__to_stop]

UCCO:
 BEACON_TIMER_EXPIRES -> . [cp_beacon_ucco_update_beacon_data]
 BEACON: nid match -> USTA_JOINING [cp_sta_action_poweron__ucco__beacon]
 BEACON: no nid match -> USTA
 association_request -> CCO [NULL]
 to_stop -> IDLE [cp_sta_action_poweron__many__to_idle]

 CC_WHO_RU_REQ -> . [cp_sta_action_process_cc_who_ru_req]
 CC_ASSOC_REQ -> . [cp_cco_action__ucco__cc_assoc_req]
 DRV_STA_SC_REQ -> SC_UCCO [cp_sta_action_drv__ucco__drv_sta_sc]
  Start the SC FSM.

SC_UCCO:
 BEACON_TIMER_EXPIRES -> . [cp_beacon_ucco_update_beacon_data]
 BEACON -> SC_USTA [cp_sta_action_sc__sc_ucco_track_beacon]
  Still doing SC procedure, but in SC_USTA.
 CC_WHO_RU_REQ -> . [cp_sta_action_process_cc_who_ru_req]
 to_stop -> IDLE [cp_sta_action_poweron__many__to_idle]
 sc_get_cco_functionality -> SC_CCO [cp_sta_action_sc__sc_ucco_sc_get_cco_functionality]
  Get CCo functionality.
 sc_failed -> UCCO [NULL]
  SC failed, go back to normal.
 sc_succeed -> SC_USTA_JOINING [NULL]
  SC procedure finished, start association.

STA:
 BEACON_TIMER_EXPIRES -> . [cp_beacon_beacon_not_received]
 avln_failure -> POWERON [NULL]
 left -> USTA [NULL]
 to_stop -> UNASSOCIATING [cp_sta_action_poweron__sta__to_stop]
 CC_HANDOVER_REQ -> HANDOVER_STA [cp_sta_action_handover__handover]
 HOIP_EXPIRED -> . [cp_sta_action_handover__sta_handover]

 DRV_STA_SC_REQ: sc_add -> SC_STA [cp_sta_action_drv__sta__drv_sta_sc]
 DRV_STA_SC_REQ: sc_join -> .
  Start the SC FSM only for SC ADD.

SC_STA:
 BEACON_TIMER_EXPIRES -> . [cp_beacon_beacon_not_received]
 avln_failure -> POWERON [cp_sta_action_sc__sc_sta__avln_failure]
  Stop SC procedure.
 left -> SC_USTA [NULL]
 to_stop -> UNASSOCIATING [cp_sta_action_poweron__sta__to_stop]
 sc_failed -> STA [NULL]
 sc_succeed -> STA [NULL]

CCO:
 BEACON_TIMER_EXPIRES -> . [cp_beacon_cco_update_beacon_data]
 join_timeout: sta -> . [cp_sta_action_poweron__cco__join_timeout]
 join_timeout: no sta avln -> USTA
 join_timeout: no sta no avln -> UCCO
 all_sta_leaved -> . [cp_sta_action_poweron__cco__all_sta_leaved]
 to_stop -> CCO_LEAVING [cp_cco_action_drv_mac_stop]

 change_nek -> . [cp_cco_action_gen_nek]
 snid_conflict -> . [cp_cco_action_snid_change]

 CC_WHO_RU_REQ -> . [cp_sta_action_process_cc_who_ru_req]
 CC_ASSOC_REQ -> . [cp_cco_action__cco__cc_assoc_req]
 CM_GET_KEY_REQ_PID0 -> . [cp_cco_action__cco__cm_get_key_req_pid0]
 CC_LEAVE_REQ -> . [cp_cco_action__cco__cc_leave]

 HANDOVER_DISCOVER_PROCESS_DONE -> HANDOVER_CCO [cp_cco_action_handover__discover_done]

 DRV_STA_SC_REQ: sc_add -> SC_CCO [cp_sta_action_drv__cco__drv_sta_sc]
 DRV_STA_SC_REQ: sc_join -> .
  Start the SC FSM only for SC ADD.

CCO_LEAVING:
 CCO_LEAVING_HANDOVER -> CCO_LEAVING_HOIP [NULL]
 BEACON_TIMER_EXPIRES -> . [cp_cco_action_drv_mac_stop_suspend]
 all_sta_leaved -> UNASSOCIATING [cp_cco_action__cco__unassoc_stop]

 CC_WHO_RU_REQ -> . [cp_sta_action_process_cc_who_ru_req]
 CC_ASSOC_REQ -> . [cp_cco_action__cco__cc_assoc_req]
 CM_GET_KEY_REQ_PID0 -> . [cp_cco_action__cco__cm_get_key_req_pid0]
 CC_LEAVE_REQ -> . [cp_cco_action__cco__cc_leave]

CCO_LEAVING_HOIP:
 BEACON_TIMER_EXPIRES -> . [cp_beacon_cco_update_beacon_data]

 HANDOVER_SUCCESS -> UNASSOCIATING [cp_cco_action_drv_mac_stop_ended]
 HANDOVER_FAILURE -> UNASSOCIATING [cp_cco_action_drv_mac_stop_ended]

SC_CCO:
 BEACON_TIMER_EXPIRES -> . [cp_beacon_cco_update_beacon_data]
 to_stop -> CCO_LEAVING [cp_cco_action_drv_mac_stop]
 change_nek -> . [cp_cco_action_gen_nek]
 snid_conflict -> . [cp_cco_action_snid_change]
 CC_WHO_RU_REQ -> . [cp_sta_action_process_cc_who_ru_req]
 CC_ASSOC_REQ -> . [cp_cco_action_sc__sc_cco__cc_assoc_req]
  Refuse request for new association (except with the SC sta), reply to renew.
 CC_LEAVE_REQ -> . [cp_cco_action__cco__cc_leave]
 sc_succeed -> CCO [NULL]
 sc_failed -> CCO [NULL]

UNASSOCIATING:
 BEACON_TIMER_EXPIRES -> . [cp_beacon_beacon_not_received]
 left -> IDLE [cp_sta_action_poweron__many__to_idle]
 avln_failure -> IDLE [cp_sta_action_poweron__many__to_idle]

CCO, AUTHENTICATED, SC_CCO:
 CM_BRG_INFO_CNF -> . [cp_sta_action_process_cm_brg_info_cnf]
 CM_BRG_INFO_REQ -> . [cp_sta_action_process_cm_brg_info_req]
 first_com_with_assoc_sta -> . [cp_sta_action_bridge_first_com]

CCO, SC_CCO, ASSOCIATED, SC_ASSOCIATED, AUTHENTICATED:
 CM_CHAN_EST_IND -> . [ce_tx_process__cm_chan_est_ind]
 CM_TM_UPDATE_IND -> . [ce_tx_process__cm_update_tm_ind]

SC_IDLE:
 sc_start_add -> SC_ADD [NULL]
  Nothing to do, we wait for a CM_SC_JOIN.REQ.
 sc_start_join -> SC_JOIN [NULL]
  Transition is handled by enter function of SC_IDLE.

SC_ADD:
 CM_SC_JOIN_REQ: ok -> SC_WAIT_PEER_ASSOCIATED [cp_sta_action_sc__sc_add__cm_sc_join_req]
 CM_SC_JOIN_REQ: nok -> .
  Check CM_SC_JOIN.REQ. If ok, become CCo if we are not on AVLN, send CM_SC_JOIN.CNF.

SC_WAIT_PEER_ASSOCIATED:
 new_sta_associated: sta_is_sc_peer -> SC_BUILDING_TEK [cp_sta_action_sc__sc_wait_peer_associated__new_sta_associated]
 new_sta_associated: sta_not_sc_peer -> .
  If it is the SC STA, start UKE protocol.

SC_JOIN:
 CM_SC_JOIN_REQ: ok_my_cco_cap_greater -> SC_WAIT_PEER_ASSOCIATED [cp_sta_action_sc__sc_join__cm_sc_join_req]
 CM_SC_JOIN_REQ: ok_my_cco_cap_lower -> .
 CM_SC_JOIN_REQ: nok -> .
  Check MME. If ok, check CCo cap, and become CCo if needed. Otherwise, do
  nothing.
 CM_SC_JOIN_CNF: ok -> SC_WAIT_BEACON [cp_sta_action_sc__sc_join__cm_sc_join_cnf]
 CM_SC_JOIN_CNF: nok -> .
  Check MME. If ok, set NID and check avln_status of peer.
 sc_join_req_timeout -> . [cp_sta_action_sc__sc_join__sc_join_req_timeout]
  Send a SC_JOIN.REQ MME.

SC_WAIT_BEACON:
 BEACON: nid_match -> SC_IDLE [cp_sta_action_sc__sc_wait_beacon__beacon]
 BEACON: nid_differs -> .
  If the beacon has the right nid, make the top FSM move for association.

SC_BUILDING_TEK:
 CM_GET_KEY_CNF_PID3: ok -> SC_NMK_EXCHANGE [cp_sta_action_sc__sc_building_tek__cm_get_key_cnf_pid3]
 CM_GET_KEY_CNF_PID3: unrelated -> .
 CM_GET_KEY_CNF_PID3: nok -> SC_IDLE
  Check MME, compute TEK, send NMK encrypted with TEK.

SC_NMK_EXCHANGE:
 CM_SET_KEY_CNF_PID3: ok -> SC_IDLE [cp_sta_action_sc__sc_nmk_exchange__cm_set_key_cnf_pid3]
 CM_SET_KEY_CNF_PID3: unrelated -> .
 CM_SET_KEY_CNF_PID3: nok -> SC_IDLE
  Check MME. If ok, authentication can start.

SC_ADD, SC_WAIT_PEER_ASSOCIATED, SC_JOIN, SC_BUILDING_TEK, SC_NMK_EXCHANGE, SC_WAIT_BEACON:
 sc_timeout -> SC_IDLE [cp_sta_action_sc__sc_timeout]
  SC Procedure is abort, tell it to the CP FSM.
 to_stop -> SC_IDLE [cp_sta_action_sc__to_stop]
  Timer stop is handled when going to SC_IDLE, just need to tell the top FSP
  the SC procedure is abort.

POWERON, POWERON_JOINING, USTA_JOINING, SC_USTA_JOINING, SC_USTA, SC_UCCO, SC_STA, SC_CCO:
 DRV_STA_SC_REQ -> . [cp_sta_action_drv__many__drv_sta_sc__failure]
  DRV_STA_SC_REQ is disable during poweron procedure.

HANDOVER_CCO:
 CC_ASSOC_REQ -> . [cp_cco_action__cco__cc_assoc_req]
 CM_GET_KEY_REQ_PID0 -> . [cp_cco_action__cco__cm_get_key_req_pid0]
 CC_LEAVE_REQ -> . [cp_cco_action__cco__cc_leave]
 BEACON_TIMER_EXPIRES -> . [cp_beacon_cco_update_beacon_data]
 CC_WHO_RU_REQ -> . [cp_sta_action_process_cc_who_ru_req]

 HANDOVER_SUCCESS -> STA [cp_cco_action_handover_ended]
 HANDOVER_FAILURE -> CCO [cp_cco_action_cco_selection__clear]

CCO_HANDOVER_IDLE:
 CCO_HANDOVER_START: sta -> CCO_HANDOVER_WAIT_CC_HANDOVER_CNF [cp_cco_action_handover__start]
 CCO_HANDOVER_START: no_sta -> .
  Should call the handover_failure function.

CCO_HANDOVER_WAIT_CC_HANDOVER_CNF:
 HANDOVER_TIMEOUT: another_sta -> . [cp_cco_action_handover__timeout_cc_handover_cnf]
 HANDOVER_TIMEOUT: no_more_sta -> CCO_HANDOVER_IDLE
  Should call cp_cco_action_handover__failure
 CC_HANDOVER_CNF: hard_accept -> CCO_HANDOVER_WAIT_CC_HANDOVER_INFO_RSP [cp_cco_action_handover__cc_handover_cnf_receive]
 CC_HANDOVER_CNF: another_sta -> CCO_HANDOVER_WAIT_CC_HANDOVER_CNF
 CC_HANDOVER_CNF: no_more_sta -> CCO_HANDOVER_IDLE
  Should call cp_cco_action_handover__failure

CCO_HANDOVER_WAIT_CC_HANDOVER_INFO_RSP:
 CC_HANDOVER_INFO_RSP -> CCO_HANDOVER_WAIT_HANDOVER_COUNTDOWN [cp_cco_action_handover__cc_handover_info_rsp_receive]
 HANDOVER_TIMEOUT: another_sta -> CCO_HANDOVER_WAIT_CC_HANDOVER_CNF [cp_cco_action_handover__timeout_cc_handover_info_rsp]
 HANDOVER_TIMEOUT: no_more_sta -> CCO_HANDOVER_IDLE
  Should call the handover_failure function.

CCO_HANDOVER_WAIT_HANDOVER_COUNTDOWN:
 HOIP_EXPIRED -> CCO_HANDOVER_IDLE [cp_cco_action_handover__hoip_countdown_expired]

HANDOVER_STA:
 BEACON_TIMER_EXPIRES -> . [cp_beacon_beacon_not_received]

 HANDOVER_SUCCESS -> CCO [NULL]
 HANDOVER_FAILURE -> STA [NULL]

STA_HANDOVER_IDLE:
 STA_HANDOVER_START:hard -> STA_HANDOVER_WAIT_CC_HANDOVER_INFO [cp_sta_action_handover__start]
 STA_HANDOVER_START:soft -> STA_HANDOVER_IDLE

STA_HANDOVER_WAIT_CC_HANDOVER_INFO:
 CC_HANDOVER_INFO_IND -> STA_HANDOVER_WAIT_COUNTDOWN_EXPIRES [cp_sta_action_handover__handover_info_ind_receive]
 HANDOVER_TIMEOUT -> STA_HANDOVER_IDLE [cp_sta_action_handover__failure]

STA_HANDOVER_WAIT_COUNTDOWN_EXPIRES:
 HOIP_EXPIRED -> STA_HANDOVER_IDLE [cp_sta_action_handover__handover_ended]

CCO_NEK_CHANGE_IDLE:
 nek_provide:sta -> CCO_NEK_CHANGE_WAIT_STA_CNF [cp_cco_action_nek_provide]
 nek_provide:nosta -> .

CCO_NEK_CHANGE_WAIT_STA_CNF:
 CM_SET_KEY_CNF_PID1 -> CCO_NEK_CHANGE_PROCESS_CM_SET_KEY_CNF [cp_cco_action_cm_set_key_cnf_receive]
 nek_timeout:no -> CCO_NEK_CHANGE_IDLE [cp_cco_action_nek_change_timeout_wait]
 nek_timeout:yes -> CCO_NEK_CHANGE_WAIT_STA_CNF

CCO_NEK_CHANGE_PROCESS_CM_SET_KEY_CNF:
 nek_timeout:no -> CCO_NEK_CHANGE_IDLE [cp_cco_action_nek_change_timeout_process]
 nek_timeout:yes -> CCO_NEK_CHANGE_WAIT_STA_CNF
 CM_SET_KEY_CNF_PID1:ok_continue -> CCO_NEK_CHANGE_WAIT_STA_CNF [cp_cco_action_cm_set_key_cnf_receive]
 CM_SET_KEY_CNF_PID1:end -> CCO_NEK_CHANGE_IDLE