summaryrefslogtreecommitdiff
path: root/cesar/test_general/integration/station-cp-dp
diff options
context:
space:
mode:
Diffstat (limited to 'cesar/test_general/integration/station-cp-dp')
-rw-r--r--cesar/test_general/integration/station-cp-dp/Makefile15
-rw-r--r--cesar/test_general/integration/station-cp-dp/ecos.ecc.sh5
-rw-r--r--cesar/test_general/integration/station-cp-dp/src/Maximus.py417
-rw-r--r--cesar/test_general/integration/station-cp-dp/src/Maximus_3_stations.py441
-rw-r--r--cesar/test_general/integration/station-cp-dp/src/station-cp-dp.c401
5 files changed, 1279 insertions, 0 deletions
diff --git a/cesar/test_general/integration/station-cp-dp/Makefile b/cesar/test_general/integration/station-cp-dp/Makefile
new file mode 100644
index 0000000000..850fad0ce5
--- /dev/null
+++ b/cesar/test_general/integration/station-cp-dp/Makefile
@@ -0,0 +1,15 @@
+BASE = ../../..
+
+ECOS = y
+
+#INCLUDES = lib/visual_state_api/src
+
+TARGET_PROGRAMS = station_cp_dp
+
+station_cp_dp_SOURCES = station-cp-dp.c
+
+station_cp_dp_MODULES = lib host hal/hle/maximus hal/phy/maximus/dur/maximus interface cp/station/maximus cp/conn
+
+cp_beacon_MODULE_SOURCES = beacons.c bentry.c ntb_clock_sync.c
+
+include $(BASE)/common/make/top.mk
diff --git a/cesar/test_general/integration/station-cp-dp/ecos.ecc.sh b/cesar/test_general/integration/station-cp-dp/ecos.ecc.sh
new file mode 100644
index 0000000000..7984aef8ed
--- /dev/null
+++ b/cesar/test_general/integration/station-cp-dp/ecos.ecc.sh
@@ -0,0 +1,5 @@
+config=${1:-ecos-gen.ecc}
+ecosconfig --config=$config new maximus default
+cat >> $config <<EOF
+EOF
+ecosconfig --config=$config check
diff --git a/cesar/test_general/integration/station-cp-dp/src/Maximus.py b/cesar/test_general/integration/station-cp-dp/src/Maximus.py
new file mode 100644
index 0000000000..2fd99ea064
--- /dev/null
+++ b/cesar/test_general/integration/station-cp-dp/src/Maximus.py
@@ -0,0 +1,417 @@
+#!/usr/bin/env python
+
+import sys
+
+######################################################
+#
+# (chemins d'import a adapter en fonction de l'emplacement du script...)
+#
+######################################################
+sys.path.append('../../../../maximus/python/obj');
+sys.path.append('../../../../maximus/python/');
+sys.path.append('../../../../maximus/python/lib/cesar');
+
+from maximus import *
+from interface import *
+from sta_cesar import STACesar
+
+#def my_eth_filter(eth):
+# try:
+# eth.get_type()
+# return True
+# except:
+# return False
+def my_eth_filter(eth):
+ if eth.get_type() is 'ETHERNET_TYPE_SNIFFER':
+ # Consider received object that are packets sniffed
+ # by the INTERFACE/SNIFFER module (note that, depending on
+ # the SNIFFER setup, sniffed packets can be beacons and/or MMEs
+ # in Tx and/or Rx)
+ return True
+ else:
+ return False
+
+######################################################
+#
+# "Debut" script Python (impose, c'est l'init Maximus...)
+#
+# On considere que le script sera execute a partir du dossier
+# cesar/test_general/integration/station-cp-dp/src
+# de la maniere suivante:
+#
+# python Maximus.py -l1
+#
+# avec l'executable a tester se trouvant dans ../obj
+# (c-a-d, cesar/test_general/integration/station-cp-dp/obj)
+#
+######################################################
+
+maximus = Maximus()
+#maximus.init (sys.argv)
+maximus.init (sys.argv+['-e','../obj/station_cp_dp.elf'])
+
+######################################################
+#
+# Declaration et parametrage de station(s)...
+#
+######################################################
+#
+# Parametres principaux :
+#
+# mac_address (adresse MAC station, chaine de caracteres specifiant 6 octets en hexa, "XX:XX:XX:XX:XX:XX",
+# ou liste classique Python de 6 octets hexa, (0xXX,0xXX,0xXX,0xXX,0xXX,0xXX),
+# ou entier long Python, 0xXXXXXXXXXXXX)
+#
+# cco_preference (choix preference CCo, booleen true ou false)
+#
+# was_cco (indicateur role CCo actif lors du dernier Power-off, booleen true ou false)
+#
+# npw (Network PassWord, 8 a 64 caracteres ASCII dans l'intervalle standard 0x20 - 0x7F.
+# NMK, NID offset et NID sont calcules automatiquement par le CP de la station
+# a partir du NPW ou peuvent etre "forces", cf parametres optionnels suivants)
+#
+# dpw (Device PassWord, 0 a 64 caracteres ASCII dans l'intervalle standard 0x20 - 0x7F)
+#
+# m_sta_hfid (Manufacturer STA HFID, 0 a 64 caracteres ASCII dans l'intervalle standard 0x20 - 0x7F)
+#
+# u_sta_hfid (User STA HFID, 0 a 64 caracteres ASCII dans l'intervalle standard 0x20 - 0x7F)
+#
+# avln_hfid (AVLN HFID, 0 a 64 caracteres ASCII dans l'intervalle standard 0x20 - 0x7F)
+#
+# sl (Security Level, entier, 2 bits utiles, 0, 1 ou 2)
+#
+# tonemask (Tone mask, liste d'entiers specifiant les bornes d'activation/desactivation
+# de porteuses ou plages de porteuses a utiliser parmi les 1536 porteuses possibles,
+# sachant que les 74 premieres porteuses doivent etre "OFF" et que 1155 porteuses
+# sont utilisables a partir de la porteuse 75. La premiere valeur indique la 1ere porteuse
+# ou debut de plage de porteuses "ON").
+# La definition de la plage de porteuses standard HP AV pour les USA pourrait etre definie ainsi (TBC) :
+# (85,139,167,214,225,282,302,409,419,569,591,736,748,856,882,1015,1027,1143,1535)
+# cette liste definit les porteuses 0 a 84 "OFF", 85 a 138 "ON", 139 a 166 "OFF", ... et 1143 a 1535 "OFF" (TBC)
+#
+# Parametres additionnels (optionnels) :
+#
+# nid (Network IDentifier, entier, 54 bits utiles)
+#
+# snid (Short Network IDentifier, entier nul par defaut, 4 bits utiles => valeurs possibles = 0 a 15
+#
+#####################################################
+
+#####################################################
+# Declaration et parametrage d'une station "STA1_CCO" dans un AVLN "AVLN1"
+# que l'on verrait de preference comme CCo (et etait CCo lors du dernier Power-off),
+# et d'une station "STA2_STA" dans le meme AVLN...
+# On force le SNID a 1 pour STA1_CCO et 2 pour STA2_STA... (mais quand tout sera operationnel,
+# on ne devrait plus avoir a forcer de SNID, puisque le SNID est attribue a une STA par "sa" CCo...)
+#####################################################
+
+conf_sta1 = Config ()
+conf_sta1.mac_address = "11:21:31:41:51:61"
+#ou conf_sta1.mac_address = (0x11,0x21,0x31,0x41,0x51,0x61)
+#ou conf_sta1.mac_address = 0x112131415161
+conf_sta1.cco_preference = True
+conf_sta1.was_cco = True
+#conf_sta1.npw = "AVLN1_NPW"
+conf_sta1.npw = "HomePlugAV0123"
+conf_sta1.dpw = "STA1_DPW"
+conf_sta1.m_sta_hfid = "HPAV_STATION"
+conf_sta1.u_sta_hfid = "STA1_CCO"
+conf_sta1.avln_hfid = "AVLN1"
+conf_sta1.tonemask = (85,139,167,214,225,282,302,409,419,569,591,736,748,856,882,1015,1027,1143,1535)
+conf_sta1.sl = 1
+conf_sta1.snid = 1
+
+conf_sta2 = Config ()
+conf_sta2.mac_address = "12:22:32:42:52:62"
+#ou conf_sta2.mac_address = (0x12,0x22,0x32,0x42,0x52,0x62)
+#ou conf_sta2.mac_address = 0x122232425262
+conf_sta2.cco_preference = False
+conf_sta2.was_cco = False
+#conf_sta2.npw = "AVLN1_NPW"
+conf_sta2.npw = "HomePlugAV0123"
+conf_sta2.dpw = "STA2_DPW"
+conf_sta2.m_sta_hfid = "HPAV_STATION"
+conf_sta2.u_sta_hfid = "STA2_STA"
+conf_sta2.avln_hfid = "AVLN1"
+conf_sta2.tonemask = (85,139,167,214,225,282,302,409,419,569,591,736,748,856,882,1015,1027,1143,1535)
+conf_sta2.sl = 1
+conf_sta2.snid = 2
+
+#####################################################
+#
+# Instanciation de station(s) CESAR : staN = STACesar ( ... )
+#
+# Dans le cas d'une station CESAR, le nombre de buffers specifie
+# au moyen de l'argument mme_buffer_nb est le nombre de buffers
+# reserves pour la couche logicielle "Control-Plane". D'autres
+# buffers sont alloues pour d'autres couches ou modules suivant
+# leurs propres besoins.
+#
+# Remarque : pour instancier une station non specifiquement CESAR,
+# utiliser : staN = STA ( ... ) en specifiant
+# le nombre de buffers adequat (argument mme_buffer_nb)
+# suivant l'utilisation de modules CESAR ou non ayant
+# besoin de buffers particuliers...
+#
+#####################################################
+#
+# Les arguments d'instanciation STA ( ... ) ou STACesar ( ... ) sont :
+#
+# - la variable resultat d'init Maximus (ex: la variable "maximus" utilisee
+# dans la ligne d'init "maximus = Maximus()")
+#
+# - l'argument "config" specifiant la variable declarant les parametres
+# de la station a instancier (simulation des parametres station en memoire Flash),
+# c'est-a-dire, indication de la variable "conf_staN" utilisee dans la la ligne de
+# declaration "conf_staN = Config()"
+#
+# - "mme_buffer_nb", nombre de buffers MME "d'avance" pour emission vers CL/HLE
+# (1 buffer d'avance par defaut si l'argument mme_buffer_nb n'est pas
+# specifie explicitement)
+# Remarque:
+# -Dans le cas d'une station CESAR, le nombre de buffers specifie
+# au moyen de l'argument mme_buffer_nb est le nombre de buffers
+# reserves pour la couche logicielle "Control-Plane". D'autres
+# buffers sont alloues pour d'autres couches ou modules suivant
+# leurs propres besoins.
+# -Pour instancier une station non specifiquement CESAR,
+# utiliser : staN = STA ( ... ) en specifiant
+# le nombre de buffers adequat (argument mme_buffer_nb)
+# suivant l'utilisation de modules CESAR ou non ayant
+# besoin de buffers particuliers...
+#
+# - "config_mode", chaine specifiant le mode de passage des parametres station
+# a la couche Control-Plane (appel direct de fonctions callback du Control-Plane
+# ou envoi de messages "Driver-MMEs" au Control-Plane via la couche Convergence-Layer).
+# Valeurs "config_mode" possibles :
+#
+# . "MME" (valeur par defaut)
+# . "fcall_process_drv"
+# . "fcall_cp_station"
+#
+# Exemple :
+#
+# sta1 = STA (maximus, config=conf_sta1, mme_buffer_nb=2, config_mode="MME")
+#
+# instancie une station dont les parametres sont definis par l'ensemble de
+# parametres "conf_sta1", 2 buffers MME d'avance (1 est la valeur par defaut
+# si "mme_buffer_nb" n'est pas specifie), et transmission des parametres au
+# Control-plane via des MMEs (plus exactement des DRV-MMEs, c'est-a-dire par
+# simulation du driver Power-Line Linux qui lit les parametres station en Flash
+# et les transmet a la couche Control-Plane via la couche Convergence-Layer
+# sous forme de messages "Driver-MMEs")
+#
+#####################################################
+
+#sta1 = STA (maximus, config=conf_sta1, mme_buffer_nb=3, debug=False, config_mode="MME")
+sta1 = STACesar (maximus, config=conf_sta1, mme_buffer_nb=1, debug=True, config_mode="MME")
+#sta1 = STA (maximus, config=conf_sta1, mme_buffer_nb=5, config_mode="fcall_process_drv")
+#sta1 = STA (maximus, config=conf_sta1, mme_buffer_nb=5, config_mode="fcall_cp_station")
+#sta1.debug()
+
+#maximus.wait (500)
+#sta1.deactivate()
+
+#sta2 = STA (maximus, config=conf_sta2, mme_buffer_nb=3, debug=True, config_mode="MME")
+sta2 = STACesar (maximus, config=conf_sta2, mme_buffer_nb=1, debug=True, config_mode="MME")
+#sta2 = STA (maximus, config=conf_sta2, mme_buffer_nb=5, config_mode="fcall_process_drv")
+#sta2 = STA (maximus, config=conf_sta2, mme_buffer_nb=5, config_mode="fcall_cp_station")
+#sta2.debug()
+
+
+#####################################################
+
+
+
+#maximus.wait (5000000)
+
+
+#fc1 = maximus.create_fcall ("fc_station_init_config")
+#fc1.set_sta (station1)
+#fc1.add_param_ushort ("snid", 1)
+#fc1.add_param_ushort ("tei", 1)
+#fc1.add_param_ushort ("auto", 1)
+#fc1.send()
+
+#fc2 = maximus.create_fcall ("fc_station_init_config")
+#fc2.set_sta (station2)
+#fc2.add_param_ushort ("snid", 1)
+#fc2.add_param_ushort ("tei", 2)
+#fc2.add_param_ushort ("auto", 1)
+#fc2.send()
+
+##neighbour discovery
+#fc1 = maximus.create_fcall ("fc_station_discover")
+#fc1.set_sta (station1)
+#fc1.add_param_ushort ("qte", 1)
+#fc1.add_param_ushort ("tei0", 2)
+#param = pack ('Q', 0x123456789abc)[0:6]
+#fc1.add_param ("mac0", param)
+#fc1.send()
+
+#fc2 = maximus.create_fcall ("fc_station_discover")
+#fc2.set_sta (station2)
+#fc2.add_param_ushort ("qte", 1)
+#fc2.add_param_ushort ("tei0", 1)
+#param = pack ('Q', 0x23456789abcd)[0:6]
+#fc2.add_param ("mac0", param)
+#fc2.send()
+
+#fc1 = maximus.create_fcall ("fc_station_link_add")
+#fc1.set_sta (station1)
+#fc1.add_param_ushort ("type", 1)
+#fc1.add_param_ushort ("bcast", 0)
+#fc1.add_param_ushort ("mme", 0)
+#fc1.add_param_ushort ("lid", 1)
+#fc1.add_param_ushort ("tei", 2)
+#fc1.send()
+
+#fc1 = maximus.create_fcall ("fc_station_link_add")
+#fc1.set_sta (station1)
+#fc1.add_param_ushort ("type", 1)
+#fc1.add_param_ushort ("bcast", 0)
+#fc1.add_param_ushort ("mme", 1)
+#fc1.add_param_ushort ("lid", 248)
+#fc1.add_param_ushort ("tei", 2)
+#fc1.send()
+
+#fc2 = maximus.create_fcall ("fc_station_link_add")
+#fc2.set_sta (station2)
+#fc2.add_param_ushort ("type", 0)
+#fc2.add_param_ushort ("bcast", 0)
+#fc2.add_param_ushort ("mme", 0)
+#fc2.add_param_ushort ("lid", 1)
+#fc2.add_param_ushort ("tei", 1)
+#fc2.send()
+
+#fc2 = maximus.create_fcall ("fc_station_link_add") pld_maxlen = 0; /* TO DO : what length ? */
+
+#fc2.set_sta (station2)
+#fc2.add_param_ushort ("type", 0)
+#fc2.add_param_ushort ("bcast", 0)
+#fc2.add_param_ushort ("mme", 1)
+#fc2.add_param_ushort ("lid", 248)
+#fc2.add_param_ushort ("tei", 1)
+#fc2.send()
+
+## Add a buffer to the SAR
+#alloc_data_buffer (maximus, station2)
+
+##sends three buffers to the station 2
+#alloc_data_buffer (maximus, station2)
+#alloc_data_buffer (maximus, station2)
+#alloc_data_buffer (maximus, station2)
+
+##create three Ethernet Packets
+
+
+## read the ethernet full packet
+#packet_file = open ('../packet_max','r')
+#packet = packet_file.read()
+
+##first ethernet pack of 1500 bytes.
+#pack1 = packet
+
+##second one 424 bytes of length
+#pack2 = packet[0:423]
+
+##third one 1240 bytes
+#pack3 = packet[0:1239]
+
+##First one
+#frame0 = Eth()
+#frame0.src = '23:45:67:89:ab:cd'
+#frame0.dst = '12:34:56:78:9a:bc'
+#frame0.vlantag = 0x4D4E4F50
+#frame0.type = 0x5152
+#frame0.payload = pack1
+#frame0.send (maximus, station1)
+
+##Second frame
+#frame1 = Eth()
+#frame1.src = '23:45:67:89:ab:cd'
+#frame1.dst = '12:34:56:78:9a:bc'
+#frame1.vlantag = 0x4D4E4F50
+#frame1.type = 0x5152
+#frame1.payload = pack2;
+#frame1.send (maximus, station1)
+
+##third frame
+#frame2 = Eth()
+#frame2.src = '23:45:67:89:ab:cd'
+#frame2.dst = '12:34:56:78:9a:bc'
+#frame2.vlantag = 0x4D4E4F50
+#frame2.type = 0x5152
+#frame2.payload = pack3;
+#frame2.send (maximus, station1)
+
+##Catch the ethernet packets
+#rsp = recv(maximus, count=3, filter=my_eth_filter)
+
+#if (rsp[0].dst != frame0.dst) and (rsp[0].src != frame0.src) and (rsp[0].vlantag != frame0.vlantag) and (rsp[0].type != frame0.type):
+ #print "Frame0 dst dont correspond with the dst mac address of the frame"
+#else:
+ #if frame0.payload != rsp[0].payload:
+ #print "Error the frame 0 payload is deferent from the received one"
+
+#Catch packets sniffed by the INTERFACE/SNIFFER module
+#(note that, depending on # the SNIFFER setup, sniffed packets
+#can be beacons and/or MMEs in Tx and/or Rx)
+rsp = recv(maximus, count=1, filter=my_eth_filter)
+#Display (dump) sniffed packet...
+rsp[0].display()
+
+maximus.wait (1000000000)
+##while not sta1.is_idle() and not sta2.is_idle():
+ ##maximus.wait (10000)
+#while True:
+# maximus.process()
+
+
+##print the traces of the HLE
+#print "\n\n ************** Station 1 Traces *******************\n"
+#fc1 = maximus.create_fcall ("fc_hle_print_trace")
+#fc1.set_sta (sta1)
+#fc1.send()
+#
+#print ""
+#fc1 = maximus.create_fcall ("fc_cl_print_trace")
+#fc1.set_sta (sta1)
+#fc1.send()
+#
+#print ""
+#fc1 = maximus.create_fcall ("fc_sar_print_trace")
+#fc1.set_sta (sta1)
+#fc1.send()
+#
+#print "\n\n ************ Station 1 Traces END ******************\n"
+#
+sta1.remove()
+
+##print the traces of the HLE
+#print "\n\n ************** Station 2 Traces *******************\n"
+#fc1 = maximus.create_fcall ("fc_hle_print_trace")
+#fc1.set_sta (sta2)
+#fc1.send()
+#
+#print ""
+#fc1 = maximus.create_fcall ("fc_cl_print_trace")
+#fc1.set_sta (sta2)
+#fc1.send()
+#
+#print ""
+#fc1 = maximus.create_fcall ("fc_sar_print_trace")
+#fc1.set_sta (sta2)
+#fc1.send()
+#
+#print "\n\n ************ Station 2 Traces END ******************\n"
+#
+sta2.remove()
+
+
+#####################################################
+#
+# Fin du script de test
+#
+#####################################################
+
diff --git a/cesar/test_general/integration/station-cp-dp/src/Maximus_3_stations.py b/cesar/test_general/integration/station-cp-dp/src/Maximus_3_stations.py
new file mode 100644
index 0000000000..1247914f35
--- /dev/null
+++ b/cesar/test_general/integration/station-cp-dp/src/Maximus_3_stations.py
@@ -0,0 +1,441 @@
+#!/usr/bin/env python
+
+import sys
+
+######################################################
+#
+# (chemins d'import a adapter en fonction de l'emplacement du script...)
+#
+######################################################
+sys.path.append('../../../../maximus/python/obj');
+sys.path.append('../../../../maximus/python/');
+sys.path.append('../../../../maximus/python/lib/cesar');
+
+from maximus import *
+from interface import *
+from sta_cesar import STACesar
+
+#def my_eth_filter(eth):
+# try:
+# eth.get_type()
+# return True
+# except:
+# return False
+def my_eth_filter(eth):
+ if eth.get_type() is 'ETHERNET_TYPE_SNIFFER':
+ # Consider received object that are packets sniffed
+ # by the INTERFACE/SNIFFER module (note that, depending on
+ # the SNIFFER setup, sniffed packets can be beacons and/or MMEs
+ # in Tx and/or Rx)
+ return True
+ else:
+ return False
+
+######################################################
+#
+# "Debut" script Python (impose, c'est l'init Maximus...)
+#
+# On considere que le script sera execute a partir du dossier
+# cesar/test_general/integration/station-cp-dp/src
+# de la maniere suivante:
+#
+# python Maximus.py -l1
+#
+# avec l'executable a tester se trouvant dans ../obj
+# (c-a-d, cesar/test_general/integration/station-cp-dp/obj)
+#
+######################################################
+
+maximus = Maximus()
+#maximus.init (sys.argv)
+maximus.init (sys.argv+['-e','../obj/station_cp_dp.elf'])
+
+######################################################
+#
+# Declaration et parametrage de station(s)...
+#
+######################################################
+#
+# Parametres principaux :
+#
+# mac_address (adresse MAC station, chaine de caracteres specifiant 6 octets en hexa, "XX:XX:XX:XX:XX:XX",
+# ou liste classique Python de 6 octets hexa, (0xXX,0xXX,0xXX,0xXX,0xXX,0xXX),
+# ou entier long Python, 0xXXXXXXXXXXXX)
+#
+# cco_preference (choix preference CCo, booleen true ou false)
+#
+# was_cco (indicateur role CCo actif lors du dernier Power-off, booleen true ou false)
+#
+# npw (Network PassWord, 8 a 64 caracteres ASCII dans l'intervalle standard 0x20 - 0x7F.
+# NMK, NID offset et NID sont calcules automatiquement par le CP de la station
+# a partir du NPW ou peuvent etre "forces", cf parametres optionnels suivants)
+#
+# dpw (Device PassWord, 0 a 64 caracteres ASCII dans l'intervalle standard 0x20 - 0x7F)
+#
+# m_sta_hfid (Manufacturer STA HFID, 0 a 64 caracteres ASCII dans l'intervalle standard 0x20 - 0x7F)
+#
+# u_sta_hfid (User STA HFID, 0 a 64 caracteres ASCII dans l'intervalle standard 0x20 - 0x7F)
+#
+# avln_hfid (AVLN HFID, 0 a 64 caracteres ASCII dans l'intervalle standard 0x20 - 0x7F)
+#
+# sl (Security Level, entier, 2 bits utiles, 0, 1 ou 2)
+#
+# tonemask (Tone mask, liste d'entiers specifiant les bornes d'activation/desactivation
+# de porteuses ou plages de porteuses a utiliser parmi les 1536 porteuses possibles,
+# sachant que les 74 premieres porteuses doivent etre "OFF" et que 1155 porteuses
+# sont utilisables a partir de la porteuse 75. La premiere valeur indique la 1ere porteuse
+# ou debut de plage de porteuses "ON").
+# La definition de la plage de porteuses standard HP AV pour les USA pourrait etre definie ainsi (TBC) :
+# (85,139,167,214,225,282,302,409,419,569,591,736,748,856,882,1015,1027,1143,1535)
+# cette liste definit les porteuses 0 a 84 "OFF", 85 a 138 "ON", 139 a 166 "OFF", ... et 1143 a 1535 "OFF" (TBC)
+#
+# Parametres additionnels (optionnels) :
+#
+# nid (Network IDentifier, entier, 54 bits utiles)
+#
+# snid (Short Network IDentifier, entier nul par defaut, 4 bits utiles => valeurs possibles = 0 a 15
+#
+#####################################################
+
+#####################################################
+# Declaration et parametrage d'une station "STA1_CCO" dans un AVLN "AVLN1"
+# que l'on verrait de preference comme CCo (et etait CCo lors du dernier Power-off),
+# et de 2 stations "STA2_STA" et "STA3_STA" dans le meme AVLN...
+# On force le SNID a 1 pour STA1_CCO, 2 pour STA2_STA et 3 pour STA3_STA...
+# (mais quand tout sera operationnel, on ne devrait plus avoir a forcer de SNID,
+# puisque le SNID est attribue a une STA par "sa" CCo...)
+#####################################################
+
+conf_sta1 = Config ()
+conf_sta1.mac_address = "11:21:31:41:51:61"
+#ou conf_sta1.mac_address = (0x11,0x21,0x31,0x41,0x51,0x61)
+#ou conf_sta1.mac_address = 0x112131415161
+conf_sta1.cco_preference = True
+conf_sta1.was_cco = True
+#conf_sta1.npw = "AVLN1_NPW"
+conf_sta1.npw = "HomePlugAV0123"
+conf_sta1.dpw = "STA1_DPW"
+conf_sta1.m_sta_hfid = "HPAV_STATION"
+conf_sta1.u_sta_hfid = "STA1_CCO"
+conf_sta1.avln_hfid = "AVLN1"
+conf_sta1.tonemask = (85,139,167,214,225,282,302,409,419,569,591,736,748,856,882,1015,1027,1143,1535)
+conf_sta1.sl = 1
+conf_sta1.snid = 1
+
+conf_sta2 = Config ()
+conf_sta2.mac_address = "12:22:32:42:52:62"
+#ou conf_sta2.mac_address = (0x12,0x22,0x32,0x42,0x52,0x62)
+#ou conf_sta2.mac_address = 0x122232425262
+conf_sta2.cco_preference = False
+conf_sta2.was_cco = False
+#conf_sta2.npw = "AVLN1_NPW"
+conf_sta2.npw = "HomePlugAV0123"
+conf_sta2.dpw = "STA2_DPW"
+conf_sta2.m_sta_hfid = "HPAV_STATION"
+conf_sta2.u_sta_hfid = "STA2_STA"
+conf_sta2.avln_hfid = "AVLN1"
+conf_sta2.tonemask = (85,139,167,214,225,282,302,409,419,569,591,736,748,856,882,1015,1027,1143,1535)
+conf_sta2.sl = 1
+conf_sta2.snid = 2
+
+conf_sta3 = Config ()
+conf_sta3.mac_address = "13:23:33:43:53:63"
+#ou conf_sta3.mac_address = (0x13,0x23,0x33,0x43,0x53,0x63)
+#ou conf_sta3.mac_address = 0x132333435363
+conf_sta3.cco_preference = False
+conf_sta3.was_cco = False
+#conf_sta3.npw = "AVLN1_NPW"
+conf_sta3.npw = "HomePlugAV0123"
+conf_sta3.dpw = "STA3_DPW"
+conf_sta3.m_sta_hfid = "HPAV_STATION"
+conf_sta3.u_sta_hfid = "STA3_STA"
+conf_sta3.avln_hfid = "AVLN1"
+conf_sta3.tonemask = (85,139,167,214,225,282,302,409,419,569,591,736,748,856,882,1015,1027,1143,1535)
+conf_sta3.sl = 1
+conf_sta3.snid = 3
+
+#####################################################
+#
+# Instanciation de station(s) CESAR : staN = STACesar ( ... )
+#
+# Dans le cas d'une station CESAR, le nombre de buffers specifie
+# au moyen de l'argument mme_buffer_nb est le nombre de buffers
+# reserves pour la couche logicielle "Control-Plane". D'autres
+# buffers sont alloues pour d'autres couches ou modules suivant
+# leurs propres besoins.
+#
+# Remarque : pour instancier une station non specifiquement CESAR,
+# utiliser : staN = STA ( ... ) en specifiant
+# le nombre de buffers adequat (argument mme_buffer_nb)
+# suivant l'utilisation de modules CESAR ou non ayant
+# besoin de buffers particuliers...
+#
+#####################################################
+#
+# Les arguments d'instanciation STA ( ... ) ou STACesar ( ... ) sont :
+#
+# - la variable resultat d'init Maximus (ex: la variable "maximus" utilisee
+# dans la ligne d'init "maximus = Maximus()")
+#
+# - l'argument "config" specifiant la variable declarant les parametres
+# de la station a instancier (simulation des parametres station en memoire Flash),
+# c'est-a-dire, indication de la variable "conf_staN" utilisee dans la la ligne de
+# declaration "conf_staN = Config()"
+#
+# - "mme_buffer_nb", nombre de buffers MME "d'avance" pour emission vers CL/HLE
+# (1 buffer d'avance par defaut si l'argument mme_buffer_nb n'est pas
+# specifie explicitement)
+# Remarque:
+# -Dans le cas d'une station CESAR, le nombre de buffers specifie
+# au moyen de l'argument mme_buffer_nb est le nombre de buffers
+# reserves pour la couche logicielle "Control-Plane". D'autres
+# buffers sont alloues pour d'autres couches ou modules suivant
+# leurs propres besoins.
+# -Pour instancier une station non specifiquement CESAR,
+# utiliser : staN = STA ( ... ) en specifiant
+# le nombre de buffers adequat (argument mme_buffer_nb)
+# suivant l'utilisation de modules CESAR ou non ayant
+# besoin de buffers particuliers...
+#
+# - "config_mode", chaine specifiant le mode de passage des parametres station
+# a la couche Control-Plane (appel direct de fonctions callback du Control-Plane
+# ou envoi de messages "Driver-MMEs" au Control-Plane via la couche Convergence-Layer).
+# Valeurs "config_mode" possibles :
+#
+# . "MME" (valeur par defaut)
+# . "fcall_process_drv"
+# . "fcall_cp_station"
+#
+# Exemple :
+#
+# sta1 = STA (maximus, config=conf_sta1, mme_buffer_nb=2, config_mode="MME")
+#
+# instancie une station dont les parametres sont definis par l'ensemble de
+# parametres "conf_sta1", 2 buffers MME d'avance (1 est la valeur par defaut
+# si "mme_buffer_nb" n'est pas specifie), et transmission des parametres au
+# Control-plane via des MMEs (plus exactement des DRV-MMEs, c'est-a-dire par
+# simulation du driver Power-Line Linux qui lit les parametres station en Flash
+# et les transmet a la couche Control-Plane via la couche Convergence-Layer
+# sous forme de messages "Driver-MMEs")
+#
+#####################################################
+
+#sta1 = STA (maximus, config=conf_sta1, mme_buffer_nb=3, debug=False, config_mode="MME")
+sta1 = STACesar (maximus, config=conf_sta1, mme_buffer_nb=1, debug=True, config_mode="MME")
+#sta1 = STA (maximus, config=conf_sta1, mme_buffer_nb=5, config_mode="fcall_process_drv")
+#sta1 = STA (maximus, config=conf_sta1, mme_buffer_nb=5, config_mode="fcall_cp_station")
+#sta1.debug()
+
+#maximus.wait (500)
+#sta1.deactivate()
+
+#sta2 = STA (maximus, config=conf_sta2, mme_buffer_nb=3, debug=True, config_mode="MME")
+sta2 = STACesar (maximus, config=conf_sta2, mme_buffer_nb=1, debug=True, config_mode="MME")
+#sta2 = STA (maximus, config=conf_sta2, mme_buffer_nb=5, config_mode="fcall_process_drv")
+#sta2 = STA (maximus, config=conf_sta2, mme_buffer_nb=5, config_mode="fcall_cp_station")
+#sta2.debug()
+
+#sta3 = STA (maximus, config=conf_sta3, mme_buffer_nb=3, debug=True, config_mode="MME")
+sta3 = STACesar (maximus, config=conf_sta3, mme_buffer_nb=1, debug=True, config_mode="MME")
+#sta3 = STA (maximus, config=conf_sta3, mme_buffer_nb=5, config_mode="fcall_process_drv")
+#sta3 = STA (maximus, config=conf_sta3, mme_buffer_nb=5, config_mode="fcall_cp_station")
+#sta3.debug()
+
+
+#####################################################
+
+
+
+#maximus.wait (5000000)
+
+
+#fc1 = maximus.create_fcall ("fc_station_init_config")
+#fc1.set_sta (station1)
+#fc1.add_param_ushort ("snid", 1)
+#fc1.add_param_ushort ("tei", 1)
+#fc1.add_param_ushort ("auto", 1)
+#fc1.send()
+
+#fc2 = maximus.create_fcall ("fc_station_init_config")
+#fc2.set_sta (station2)
+#fc2.add_param_ushort ("snid", 1)
+#fc2.add_param_ushort ("tei", 2)
+#fc2.add_param_ushort ("auto", 1)
+#fc2.send()
+
+##neighbour discovery
+#fc1 = maximus.create_fcall ("fc_station_discover")
+#fc1.set_sta (station1)
+#fc1.add_param_ushort ("qte", 1)
+#fc1.add_param_ushort ("tei0", 2)
+#param = pack ('Q', 0x123456789abc)[0:6]
+#fc1.add_param ("mac0", param)
+#fc1.send()
+
+#fc2 = maximus.create_fcall ("fc_station_discover")
+#fc2.set_sta (station2)
+#fc2.add_param_ushort ("qte", 1)
+#fc2.add_param_ushort ("tei0", 1)
+#param = pack ('Q', 0x23456789abcd)[0:6]
+#fc2.add_param ("mac0", param)
+#fc2.send()
+
+#fc1 = maximus.create_fcall ("fc_station_link_add")
+#fc1.set_sta (station1)
+#fc1.add_param_ushort ("type", 1)
+#fc1.add_param_ushort ("bcast", 0)
+#fc1.add_param_ushort ("mme", 0)
+#fc1.add_param_ushort ("lid", 1)
+#fc1.add_param_ushort ("tei", 2)
+#fc1.send()
+
+#fc1 = maximus.create_fcall ("fc_station_link_add")
+#fc1.set_sta (station1)
+#fc1.add_param_ushort ("type", 1)
+#fc1.add_param_ushort ("bcast", 0)
+#fc1.add_param_ushort ("mme", 1)
+#fc1.add_param_ushort ("lid", 248)
+#fc1.add_param_ushort ("tei", 2)
+#fc1.send()
+
+#fc2 = maximus.create_fcall ("fc_station_link_add")
+#fc2.set_sta (station2)
+#fc2.add_param_ushort ("type", 0)
+#fc2.add_param_ushort ("bcast", 0)
+#fc2.add_param_ushort ("mme", 0)
+#fc2.add_param_ushort ("lid", 1)
+#fc2.add_param_ushort ("tei", 1)
+#fc2.send()
+
+#fc2 = maximus.create_fcall ("fc_station_link_add") pld_maxlen = 0; /* TO DO : what length ? */
+
+#fc2.set_sta (station2)
+#fc2.add_param_ushort ("type", 0)
+#fc2.add_param_ushort ("bcast", 0)
+#fc2.add_param_ushort ("mme", 1)
+#fc2.add_param_ushort ("lid", 248)
+#fc2.add_param_ushort ("tei", 1)
+#fc2.send()
+
+## Add a buffer to the SAR
+#alloc_data_buffer (maximus, station2)
+
+##sends three buffers to the station 2
+#alloc_data_buffer (maximus, station2)
+#alloc_data_buffer (maximus, station2)
+#alloc_data_buffer (maximus, station2)
+
+##create three Ethernet Packets
+
+
+## read the ethernet full packet
+#packet_file = open ('../packet_max','r')
+#packet = packet_file.read()
+
+##first ethernet pack of 1500 bytes.
+#pack1 = packet
+
+##second one 424 bytes of length
+#pack2 = packet[0:423]
+
+##third one 1240 bytes
+#pack3 = packet[0:1239]
+
+##First one
+#frame0 = Eth()
+#frame0.src = '23:45:67:89:ab:cd'
+#frame0.dst = '12:34:56:78:9a:bc'
+#frame0.vlantag = 0x4D4E4F50
+#frame0.type = 0x5152
+#frame0.payload = pack1
+#frame0.send (maximus, station1)
+
+##Second frame
+#frame1 = Eth()
+#frame1.src = '23:45:67:89:ab:cd'
+#frame1.dst = '12:34:56:78:9a:bc'
+#frame1.vlantag = 0x4D4E4F50
+#frame1.type = 0x5152
+#frame1.payload = pack2;
+#frame1.send (maximus, station1)
+
+##third frame
+#frame2 = Eth()
+#frame2.src = '23:45:67:89:ab:cd'
+#frame2.dst = '12:34:56:78:9a:bc'
+#frame2.vlantag = 0x4D4E4F50
+#frame2.type = 0x5152
+#frame2.payload = pack3;
+#frame2.send (maximus, station1)
+
+##Catch the ethernet packets
+#rsp = recv(maximus, count=3, filter=my_eth_filter)
+
+#if (rsp[0].dst != frame0.dst) and (rsp[0].src != frame0.src) and (rsp[0].vlantag != frame0.vlantag) and (rsp[0].type != frame0.type):
+ #print "Frame0 dst dont correspond with the dst mac address of the frame"
+#else:
+ #if frame0.payload != rsp[0].payload:
+ #print "Error the frame 0 payload is deferent from the received one"
+
+#Catch packets sniffed by the INTERFACE/SNIFFER module
+#(note that, depending on # the SNIFFER setup, sniffed packets
+#can be beacons and/or MMEs in Tx and/or Rx)
+rsp = recv(maximus, count=1, filter=my_eth_filter)
+#Display (dump) sniffed packet...
+rsp[0].display()
+
+maximus.wait (1000000000)
+##while not sta1.is_idle() and not sta2.is_idle():
+ ##maximus.wait (10000)
+#while True:
+# maximus.process()
+
+
+##print the traces of the HLE
+#print "\n\n ************** Station 1 Traces *******************\n"
+#fc1 = maximus.create_fcall ("fc_hle_print_trace")
+#fc1.set_sta (sta1)
+#fc1.send()
+#
+#print ""
+#fc1 = maximus.create_fcall ("fc_cl_print_trace")
+#fc1.set_sta (sta1)
+#fc1.send()
+#
+#print ""
+#fc1 = maximus.create_fcall ("fc_sar_print_trace")
+#fc1.set_sta (sta1)
+#fc1.send()
+#
+#print "\n\n ************ Station 1 Traces END ******************\n"
+#
+sta1.remove()
+
+##print the traces of the HLE
+#print "\n\n ************** Station 2 Traces *******************\n"
+#fc1 = maximus.create_fcall ("fc_hle_print_trace")
+#fc1.set_sta (sta2)
+#fc1.send()
+#
+#print ""
+#fc1 = maximus.create_fcall ("fc_cl_print_trace")
+#fc1.set_sta (sta2)
+#fc1.send()
+#
+#print ""
+#fc1 = maximus.create_fcall ("fc_sar_print_trace")
+#fc1.set_sta (sta2)
+#fc1.send()
+#
+#print "\n\n ************ Station 2 Traces END ******************\n"
+#
+sta2.remove()
+
+sta3.remove()
+
+#####################################################
+#
+# Fin du script de test
+#
+#####################################################
+
diff --git a/cesar/test_general/integration/station-cp-dp/src/station-cp-dp.c b/cesar/test_general/integration/station-cp-dp/src/station-cp-dp.c
new file mode 100644
index 0000000000..2bc708a0ec
--- /dev/null
+++ b/cesar/test_general/integration/station-cp-dp/src/station-cp-dp.c
@@ -0,0 +1,401 @@
+/* Cesar project {{{
+ *
+ * Copyright (C) 2007 Spidcom
+ *
+ * <<<Licence>>>
+ *
+ * }}} */
+/**
+ * \file station-cp-dp.c
+ * \brief « brief description »
+ * \ingroup « module »
+ *
+ * « long description »
+ */
+
+#include "common/std.h"
+#include "host/station.h"
+
+#include "lib/test.h"
+#include "lib/trace.h"
+#include "lib/read_word.h"
+#include "lib/restrack.h"
+
+#include "mac/ca/ca.h"
+#include "mac/sar/sar.h"
+#include "cl/cl.h"
+#include "hle/hle.h"
+
+#include "mac/common/ntb.h"
+#include "cp/beacon/beacons.h"
+#include "cp/beacon/inc/beacons_ctx.h"
+#include "cp/beacon/forward.h"
+
+#include "cp/secu/secu.h"
+#include "cp/interf/interf.h"
+#include "cp/msg/inc/msg_drv.h"
+#include "cp/station/station.h"
+
+#include "hal/hle/ipmbox.h"
+
+/*#include "test_general/station/int_station.h"*/
+#include "test_general/station/int_station_fc.h"
+
+#include "cp/station/maximus/inc/maximus_cp_station.h"
+
+/*#include "cp/test/inc/test_secu.h"
+#include "cp/test/inc/test_msg.h"
+#include "cp/test/inc/test_interf.h"
+#include "cp/test/inc/test_station.h"
+#include "cp/beacon/inc/beacon_types.h"*/
+
+/*int_station_t int_sta_global;*/
+cp_sta_t cp_sta_global;
+
+cp_secu_t sec_m;
+mac_config_t mac_config;
+
+#define CP_THREAD_PRIORITY 30
+static unsigned char cp_thread_stack[CYGNUM_HAL_STACK_SIZE_TYPICAL];
+static cyg_handle_t cp_thread_handle;
+static cyg_thread cp_thread;
+
+#define CE_THREAD_PRIORITY 29
+static unsigned char ce_thread_stack[CYGNUM_HAL_STACK_SIZE_TYPICAL];
+static cyg_handle_t ce_thread_handle;
+static cyg_thread ce_thread;
+
+extern station_ctx_t my_station;
+
+/* Use to keep a list of rx params in the CE */
+list_t ce_rx_params_list;
+
+struct ce_rx_params_node_t
+{
+ list_node_t node;
+ pbproc_rx_params_t *rx_params;
+};
+typedef struct ce_rx_params_node_t ce_rx_params_node_t;
+
+/****************** VARIABLES DEFINITION *****************/
+
+
+/******************* CALLBACK FUNCTIONS ******************/
+
+
+/**
+ * Cp beacon call back when the leon timer expires.
+ * It shall call the add event function of the Visual state FSM.
+ *
+ * \param user_data the user_data provided on the cp_beacon_init function.
+ */
+void
+cp_beacon_timer_expires (void *user_data)
+{
+#if DEBUG
+ printf("%u %s()...\n",cyg_hal_sys_getpid(),__FUNCTION__);
+#endif
+}
+
+/*********************** FUNCTIONS ***********************/
+
+/**
+ * \brief Rx-CE thread body.
+ *
+ */
+void
+ce_thread_main (cyg_addrword_t data)
+{
+#if DEBUG
+ printf("%u %s() : Rx-CE thread ready...\n",cyg_hal_sys_getpid(),__FUNCTION__);
+#endif
+ while(1)
+ {
+ printf("%u %s() : Rx-CE thread loop...\n",cyg_hal_sys_getpid(),__FUNCTION__);
+ cyg_thread_delay (300);
+ }
+}
+
+/**
+ * \brief CE init and Rx-CE thread launch.
+ *
+ * \return 0
+ *
+ */
+int
+ce_init (void)
+{
+ // TODO : CE init
+
+ // ...
+
+ // creation of the Rx-CE thread
+ cyg_thread_create (
+ CE_THREAD_PRIORITY,
+ &ce_thread_main,
+ 0,
+ "CE-Rx",
+ ce_thread_stack,
+ sizeof(ce_thread_stack),
+ &ce_thread_handle,
+ &ce_thread);
+ cyg_thread_resume (ce_thread_handle);
+
+ return 0;
+}
+
+/**
+ * \brief CP init and thread launch.
+ *
+ * \param mac_store_ctx the pointer to MAC store context
+ * \param mac_config the pointer to MAC configuration
+ * \param interf_cl_ctx the pointer to CL context
+ * \param pbproc the pointer to PBProc context
+ * \param ca_ctx the pointer to CA context
+ * \param hal_timer the pointer to HAL timer context
+ *
+ * \return 0
+ *
+ */
+int
+cp_init (mac_store_t *mac_store_ctx, mac_config_t *mac_config, cl_t *interf_cl_ctx, pbproc_t *pbproc, ca_t *ca_ctx,hal_timer_t *hal_timer)
+{
+ ntb_t *my_ntb_ctx;
+ phy_t *my_phy_ctx;
+
+ dbg_assert(mac_store_ctx);
+ dbg_assert(mac_config);
+ dbg_assert(interf_cl_ctx);
+ dbg_assert(pbproc);
+ dbg_assert(ca_ctx);
+
+ /*
+ * reset structures containing CP params :
+ *
+ * - struct to store CP-STATION params (obtained by receiving them as DRV-MME messages)
+ * - struct to store CP-STATION security params computed from NPW (NPW is a param stored in flash)
+ */
+ memset(&cp_sta_global.cp_sta_flash_params,0x00,sizeof(cp_sta_global.cp_sta_flash_params));
+ memset(&cp_sta_global.cp_sta_secu_params,0x00,sizeof(cp_sta_global.cp_sta_secu_params));
+
+ /*
+ * get phy context before calling ntb_init() because ca_ctx pointer
+ * is an opaque context pointer which does not permit to dereference
+ * the phy context pointer...
+ */
+ my_phy_ctx = pbproc_get_phy (pbproc);
+
+ /* init the NTB clock synchronization management */
+ my_ntb_ctx = ntb_init(my_phy_ctx, mac_config);
+
+ /*
+ * init MME message interface with CL
+ * (interfacing CP with CL is done through CP-DP dedicated interface & sniffer module)
+ */
+ interf_init (interf_cl_ctx);
+
+ /* init message management module */
+ msg_init ();
+
+ /* init the security management module */
+ cp_sta_global.sec = NULL;
+ secu_init (&sec_m);
+ cp_sta_global.sec = &sec_m;
+
+ /* init the station management */
+ cp_station_init (mac_store_ctx, interf_cl_ctx, pbproc, ca_ctx);
+
+ /* init CCo context */
+ cp_sta_global.cco = cp_cco_init();
+
+ /* init the beacon management */
+ cp_sta_global.hal_timer = hal_timer_init (my_phy_ctx);
+#if 1
+ cp_sta_global.cp_beacon = cp_beacon_init(cp_sta_global.interface,
+ pbproc_get_phy(cp_sta_global.pbproc),
+ &cp_sta_global,
+ cp_sta_global.sec,
+ pbproc_get_ca(cp_sta_global.pbproc),
+ cp_sta_global.pbproc,
+ cp_sta_global.mac_store,
+ cp_sta_global.cco,
+ cp_sta_global.hal_timer,
+ NULL, // ??? (void *user_data)
+ cp_beacon_timer_expires);
+ cp_sta_global.cp_beacon->sta = &cp_sta_global;
+#endif
+ // creation of the CP thread
+ printf("%u %s() : AVANT cyg_thread_create()...",cyg_hal_sys_getpid(),__FUNCTION__);
+ cyg_thread_create (
+ CP_THREAD_PRIORITY,
+ &cp_station_wait_event,
+ 0,
+ "CP",
+ cp_thread_stack,
+ sizeof(cp_thread_stack),
+ &cp_thread_handle,
+ &cp_thread);
+ cyg_thread_resume (cp_thread_handle);
+ printf("%u %s() : APRES cyg_thread_resume()...",cyg_hal_sys_getpid(),__FUNCTION__);
+
+ // CE init and Rx-CE thread launch...
+ ce_init ();
+
+ return 0;
+}
+
+#if 0
+/**
+ * \brief mac config initialisation.
+ *
+ * \return mac_config (pointer to mac config)
+ *
+ */
+mac_config_t * my_mac_config_init(void)
+{
+ mac_config_t *mac_config;
+
+ mac_config = blk_alloc ();
+ mac_config->rts_broadcast = false;
+ mac_config->fc_symbols_nb = 1;
+ mac_config->ntb_offset_tck = 0;
+ tonemask_default ((u8*) &mac_config->tonemask_info);
+ tonemask_update (&mac_config->tonemask_info);
+
+ return mac_config;
+}
+#endif
+
+/**
+ * \brief CESAR application software entry-point function.
+ *
+ * \return true
+ *
+ */
+int
+cesar_init (void)
+{
+ trace_init ();
+
+ cp_sta_global.mac_store = mac_store_init ();
+ //cp_sta_global.mac_config = my_mac_config_init ();
+ mac_config_init (&mac_config);
+ cp_sta_global.mac_config = &mac_config;
+ cp_sta_global.pbproc = pbproc_init (cp_sta_global.mac_config,
+ cp_sta_global.mac_store);
+
+ mac_ntb_init (pbproc_get_phy(cp_sta_global.pbproc),
+ cp_sta_global.mac_config);
+
+ cp_sta_global.sar = sar_init (cp_sta_global.mac_store,
+ cp_sta_global.pbproc, pbproc_get_ca (cp_sta_global.pbproc));
+
+ cp_sta_global.cl = cl_init (cp_sta_global.mac_store, cp_sta_global.sar,
+ cp_sta_global.mac_config);
+
+ cp_sta_global.hle = hle_init (cp_sta_global.cl);
+
+ cp_sta_global.interface = interface_init(cp_sta_global.hle, cp_sta_global.cl, cp_sta_global.sar, cp_sta_global.mac_config);
+
+ /*---------------------------------------------------------------------*/
+#if 0
+ my_sta = int_station_init ();
+
+ cp_init (my_sta->mac_store, my_sta->cl, my_sta->pbproc, NULL);
+#else
+ // CP init and thread launch...
+ cp_init (cp_sta_global.mac_store,
+ cp_sta_global.mac_config,
+ cp_sta_global.cl,
+ cp_sta_global.pbproc,
+ pbproc_get_ca(cp_sta_global.pbproc),
+ cp_sta_global.hal_timer
+ );
+
+ // start HLE...
+ hle_activate(cp_sta_global.hle, true);
+
+#endif
+
+#if 0
+ list_init (&ce_rx_params_list);
+
+ sar_init_measure_context (my_sta->sar, my_sta->sar);
+ sar_init_measurement_cb (my_sta->sar, ce_measurements);
+
+ sar_init_measure_context (my_sta->sar, my_sta->sar);
+ sar_init_measurement_cb (my_sta->sar, ce_measurements);
+/*
+ fcall_register (my_station.fcall, "fc_station_link_add",
+ &fc_station_link_add, NULL);
+
+ fcall_register (my_station.fcall, "fc_station_link_remove",
+ &fc_station_link_remove, NULL);
+
+ fcall_register (my_station.fcall, "fc_station_init_config",
+ &fc_station_init_config, NULL);
+
+ fcall_register (my_station.fcall, "fc_station_discover",
+ &fc_station_discover, NULL); memset(&cp_sta_flash_params,0x00,sizeof(cp_sta_flash_params));
+
+
+ fcall_register (my_station.fcall, "fc_station_uninit",
+ &fc_station_uninit, NULL);
+
+ fcall_register (my_station.fcall, "fc_cp_mme_send_as_data",
+ &fc_cp_mme_send_as_data, NULL);
+
+ fcall_register (my_station.fcall, "fc_cp_mme_send_as_mme",
+ &fc_cp_mme_send_as_mme, NULL);
+*/
+ fcall_register (my_station.fcall, "fc_hle_print_trace",
+ &fc_hle_print_trace, NULL);
+
+ fcall_register (my_station.fcall, "fc_cl_print_trace",
+ &fc_cl_print_trace, NULL);
+
+ fcall_register (my_station.fcall, "fc_sar_print_trace",
+ &fc_sar_print_trace, NULL);
+
+
+ list_init (&ce_rx_params_list);
+#endif
+ return true;
+}
+
+#if 0
+/**
+ * simulates the Leon timer to awake the beacon module.
+ *
+ */
+void
+phy_leon_timer (cyg_addrword_t int_sta)
+{
+ cyg_thread_yield();
+
+ cyg_thread_delay(cp_sta_global.cp_beacon->awake_time);
+}
+#endif
+
+/**
+ * \brief Entry-point function, main() or cyg_user_start().
+ * - main() or cyg_user_start() called directly by maximus core in case of maximus simulation environment,
+ * - cyg_user_start() called by eCos on true target...
+ *
+ * \return cesar initialisation return code
+ *
+ */
+int
+main (void)
+{
+ /* inits specifiques pour environnement de simulation Maximus */
+#define SIMU_WITH_MAXIMUS
+#ifdef SIMU_WITH_MAXIMUS
+ maximus_cp_station_init(&my_station);
+ station_log_set_level(&my_station, STATION_LOG_WARNING);
+ station_log_set_mask(&my_station, STATION_LOGTYPE_ALL);
+ my_station.pipe_log_fd = 1;
+#endif
+
+ return cesar_init();
+}