summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2009-12-28 07:27:43 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2009-12-28 09:05:16 +0100
commitab2c8b109d06df8ad1e7c237c00f8267f5ae3e08 (patch)
treea6df6d6da5fb1a23357ae6439b87530bd79dd6fb
parentf413a0811a608d4f7eaabdf343683422940ccc44 (diff)
[ipaccess] Start flashing once the BTS has started enough...
Strictly speaking we would only need to start the Site Manager and could probably start flashing afterwards but it is more easy to have one config path...
-rw-r--r--openbsc/src/ipaccess/ipaccess-config.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/openbsc/src/ipaccess/ipaccess-config.c b/openbsc/src/ipaccess/ipaccess-config.c
index c0fc2c469..c7d223438 100644
--- a/openbsc/src/ipaccess/ipaccess-config.c
+++ b/openbsc/src/ipaccess/ipaccess-config.c
@@ -282,15 +282,6 @@ static void bootstrap_om(struct gsm_bts *bts)
abis_nm_ipaccess_restart(bts);
}
- if (software) {
- int rc;
- printf("Attempting software upload with '%s'\n", software);
- rc = abis_nm_software_load(bts, software, 19, 0, swload_cbfn, bts);
- if (rc < 0) {
- fprintf(stderr, "Failed to start software load\n");
- exit(-3);
- }
- }
}
void input_event(int event, enum e1inp_sign_type type, struct gsm_bts_trx *trx)
@@ -322,13 +313,23 @@ int nm_state_event(enum nm_evt evt, u_int8_t obj_class, void *obj,
{
if (evt == EVT_STATECHG_OPER &&
obj_class == NM_OC_RADIO_CARRIER &&
- new_state->availability == 3 &&
- net_listen_testnr) {
+ new_state->availability == 3) {
struct gsm_bts_trx *trx = obj;
- u_int8_t phys_config[] = { 0x02, 0x0a, 0x00, 0x01, 0x02 };
- abis_nm_perform_test(trx->bts, 2, 0, 0, 0xff,
- net_listen_testnr, 1,
- phys_config, sizeof(phys_config));
+
+ if (net_listen_testnr) {
+ u_int8_t phys_config[] = { 0x02, 0x0a, 0x00, 0x01, 0x02 };
+ abis_nm_perform_test(trx->bts, 2, 0, 0, 0xff,
+ net_listen_testnr, 1,
+ phys_config, sizeof(phys_config));
+ } else if (software) {
+ int rc;
+ printf("Attempting software upload with '%s'\n", software);
+ rc = abis_nm_software_load(trx->bts, software, 19, 0, swload_cbfn, trx->bts);
+ if (rc < 0) {
+ fprintf(stderr, "Failed to start software load\n");
+ exit(-3);
+ }
+ }
}
return 0;
}