aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-05-12 23:51:46 +0800
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-05-13 00:17:17 +0800
commit6eae31e39f496a2ca7e20c8c10917867dfb79ffd (patch)
tree0f09cbd397a329ef1b9c331e5b76054b6cc03f31 /openbsc
parent4647015f6960183b881b8f43c52ad818a6c20b27 (diff)
sw_load: Specify the trx_nr for the software load
For the multi TRX setup we will need to specify the right trx->nr to be able to flash the BTS. For the BS11 case we are ignoring the additional argument.
Diffstat (limited to 'openbsc')
-rw-r--r--openbsc/include/openbsc/abis_nm.h2
-rw-r--r--openbsc/src/abis_nm.c12
-rw-r--r--openbsc/src/bs11_config.c2
-rw-r--r--openbsc/src/ipaccess/ipaccess-config.c2
4 files changed, 10 insertions, 8 deletions
diff --git a/openbsc/include/openbsc/abis_nm.h b/openbsc/include/openbsc/abis_nm.h
index 1e9197e29..c20e4e172 100644
--- a/openbsc/include/openbsc/abis_nm.h
+++ b/openbsc/include/openbsc/abis_nm.h
@@ -92,7 +92,7 @@ int abis_nm_sw_act_req_ack(struct gsm_bts *bts, u_int8_t obj_class, u_int8_t i1,
int abis_nm_raw_msg(struct gsm_bts *bts, int len, u_int8_t *msg);
int abis_nm_event_reports(struct gsm_bts *bts, int on);
int abis_nm_reset_resource(struct gsm_bts *bts);
-int abis_nm_software_load(struct gsm_bts *bts, const char *fname,
+int abis_nm_software_load(struct gsm_bts *bts, int trx_nr, const char *fname,
u_int8_t win_size, int forced,
gsm_cbfn *cbfn, void *cb_data);
int abis_nm_software_load_status(struct gsm_bts *bts);
diff --git a/openbsc/src/abis_nm.c b/openbsc/src/abis_nm.c
index ee0604d3c..09285bd43 100644
--- a/openbsc/src/abis_nm.c
+++ b/openbsc/src/abis_nm.c
@@ -1139,6 +1139,7 @@ enum sw_state {
struct abis_nm_sw {
struct gsm_bts *bts;
+ int trx_nr;
gsm_cbfn *cbfn;
void *cb_data;
int forced;
@@ -1592,7 +1593,7 @@ static int abis_nm_rcvmsg_sw(struct msgb *mb)
}
/* Load the specified software into the BTS */
-int abis_nm_software_load(struct gsm_bts *bts, const char *fname,
+int abis_nm_software_load(struct gsm_bts *bts, int trx_nr, const char *fname,
u_int8_t win_size, int forced,
gsm_cbfn *cbfn, void *cb_data)
{
@@ -1606,6 +1607,7 @@ int abis_nm_software_load(struct gsm_bts *bts, const char *fname,
return -EBUSY;
sw->bts = bts;
+ sw->trx_nr = trx_nr;
switch (bts->type) {
case GSM_BTS_TYPE_BS11:
@@ -1616,8 +1618,8 @@ int abis_nm_software_load(struct gsm_bts *bts, const char *fname,
break;
case GSM_BTS_TYPE_NANOBTS:
sw->obj_class = NM_OC_BASEB_TRANSC;
- sw->obj_instance[0] = 0x00;
- sw->obj_instance[1] = 0x00;
+ sw->obj_instance[0] = sw->bts->nr;
+ sw->obj_instance[1] = sw->trx_nr;
sw->obj_instance[2] = 0xff;
break;
case GSM_BTS_TYPE_UNKNOWN:
@@ -2551,7 +2553,7 @@ static int bs11_swload_cbfn(unsigned int hook, unsigned int event,
fle = fl_dequeue(&bs11_sw->file_list);
if (fle) {
/* start download the next file of our file list */
- rc = abis_nm_software_load(bs11_sw->bts, fle->fname,
+ rc = abis_nm_software_load(bs11_sw->bts, 0xff, fle->fname,
bs11_sw->win_size,
bs11_sw->forced,
&bs11_swload_cbfn, bs11_sw);
@@ -2607,7 +2609,7 @@ int abis_nm_bs11_load_swl(struct gsm_bts *bts, const char *fname,
return -EINVAL;
/* start download the next file of our file list */
- rc = abis_nm_software_load(bts, fle->fname, win_size, forced,
+ rc = abis_nm_software_load(bts, 0xff, fle->fname, win_size, forced,
bs11_swload_cbfn, bs11_sw);
talloc_free(fle);
return rc;
diff --git a/openbsc/src/bs11_config.c b/openbsc/src/bs11_config.c
index c00b93985..af87f08f8 100644
--- a/openbsc/src/bs11_config.c
+++ b/openbsc/src/bs11_config.c
@@ -481,7 +481,7 @@ static int handle_state_resp(enum abis_bs11_phase state)
* argument, so our swload_cbfn can distinguish
* a safety load from a regular software */
if (file_is_readable(fname_safety))
- rc = abis_nm_software_load(g_bts, fname_safety,
+ rc = abis_nm_software_load(g_bts, 0xff, fname_safety,
win_size, param_forced,
swload_cbfn, g_bts);
else
diff --git a/openbsc/src/ipaccess/ipaccess-config.c b/openbsc/src/ipaccess/ipaccess-config.c
index b84b6a870..d2ce41396 100644
--- a/openbsc/src/ipaccess/ipaccess-config.c
+++ b/openbsc/src/ipaccess/ipaccess-config.c
@@ -411,7 +411,7 @@ int nm_state_event(enum nm_evt evt, u_int8_t obj_class, void *obj,
} 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);
+ rc = abis_nm_software_load(trx->bts, trx->nr, software, 19, 0, swload_cbfn, trx->bts);
if (rc < 0) {
fprintf(stderr, "Failed to start software load\n");
exit(-3);