diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-05-12 23:34:51 +0800 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-05-13 00:16:15 +0800 |
commit | 4647015f6960183b881b8f43c52ad818a6c20b27 (patch) | |
tree | 70d158527cdfc6bada70755e829681437fa2023b /openbsc | |
parent | 239f95467c00d065382f0cedbf32fe9614dc7ea3 (diff) |
ipaccess: Send the reset to the BASEBAND_TRANSC and supply TRX
Send the IPA Restart to a given BTS/TRX, change the signal callbacks
to carry the trx instead of the BTS so we have an easy access to the
right TRX and change the ipaccess-config to use that TRX. This is
fixing the restart with a multi TRX setup.
Even if we have the msg->trx, use the gsm_bts_trx_by_nr and get
the TRX from the fom header. This is because the OpenBSC and the
BTS numbering might not match for the multi TRX case.
Diffstat (limited to 'openbsc')
-rw-r--r-- | openbsc/include/openbsc/abis_nm.h | 2 | ||||
-rw-r--r-- | openbsc/include/openbsc/signal.h | 2 | ||||
-rw-r--r-- | openbsc/src/abis_nm.c | 15 | ||||
-rw-r--r-- | openbsc/src/ipaccess/ipaccess-config.c | 15 |
4 files changed, 20 insertions, 14 deletions
diff --git a/openbsc/include/openbsc/abis_nm.h b/openbsc/include/openbsc/abis_nm.h index 1b6a8fe5d..1e9197e29 100644 --- a/openbsc/include/openbsc/abis_nm.h +++ b/openbsc/include/openbsc/abis_nm.h @@ -148,7 +148,7 @@ int abis_nm_ipaccess_msg(struct gsm_bts *bts, u_int8_t msg_type, u_int8_t *attr, int attr_len); int abis_nm_ipaccess_set_nvattr(struct gsm_bts_trx *trx, u_int8_t *attr, int attr_len); -int abis_nm_ipaccess_restart(struct gsm_bts *bts); +int abis_nm_ipaccess_restart(struct gsm_bts_trx *trx); int abis_nm_ipaccess_set_attr(struct gsm_bts *bts, u_int8_t obj_class, u_int8_t bts_nr, u_int8_t trx_nr, u_int8_t ts_nr, u_int8_t *attr, u_int8_t attr_len); diff --git a/openbsc/include/openbsc/signal.h b/openbsc/include/openbsc/signal.h index 1b974e288..fcc69186d 100644 --- a/openbsc/include/openbsc/signal.h +++ b/openbsc/include/openbsc/signal.h @@ -133,7 +133,7 @@ struct scall_signal_data { }; struct ipacc_ack_signal_data { - struct gsm_bts *bts; + struct gsm_bts_trx *trx; u_int8_t msg_type; }; diff --git a/openbsc/src/abis_nm.c b/openbsc/src/abis_nm.c index 42f610d82..ee0604d3c 100644 --- a/openbsc/src/abis_nm.c +++ b/openbsc/src/abis_nm.c @@ -2775,12 +2775,12 @@ static int abis_nm_rx_ipacc(struct msgb *msg) case NM_MT_IPACC_RSL_CONNECT_NACK: case NM_MT_IPACC_SET_NVATTR_NACK: case NM_MT_IPACC_GET_NVATTR_NACK: - signal.bts = msg->trx->bts; + signal.trx = gsm_bts_trx_by_nr(msg->trx->bts, foh->obj_inst.trx_nr); signal.msg_type = foh->msg_type; dispatch_signal(SS_NM, S_NM_IPACC_NACK, &signal); break; case NM_MT_IPACC_SET_NVATTR_ACK: - signal.bts = msg->trx->bts; + signal.trx = gsm_bts_trx_by_nr(msg->trx->bts, foh->obj_inst.trx_nr); signal.msg_type = foh->msg_type; dispatch_signal(SS_NM, S_NM_IPACC_ACK, &signal); break; @@ -2866,9 +2866,16 @@ int abis_nm_ipaccess_rsl_connect(struct gsm_bts_trx *trx, } /* restart / reboot an ip.access nanoBTS */ -int abis_nm_ipaccess_restart(struct gsm_bts *bts) +int abis_nm_ipaccess_restart(struct gsm_bts_trx *trx) { - return __simple_cmd(bts, NM_MT_IPACC_RESTART); + struct abis_om_hdr *oh; + struct msgb *msg = nm_msgb_alloc(); + + oh = (struct abis_om_hdr *) msgb_put(msg, ABIS_OM_FOM_HDR_SIZE); + fill_om_fom_hdr(oh, 0, NM_MT_IPACC_RESTART, NM_OC_BASEB_TRANSC, + trx->bts->nr, trx->nr, 0xff); + + return abis_nm_sendmsg(trx->bts, msg); } int abis_nm_ipaccess_set_attr(struct gsm_bts *bts, u_int8_t obj_class, diff --git a/openbsc/src/ipaccess/ipaccess-config.c b/openbsc/src/ipaccess/ipaccess-config.c index 331e6bb41..b84b6a870 100644 --- a/openbsc/src/ipaccess/ipaccess-config.c +++ b/openbsc/src/ipaccess/ipaccess-config.c @@ -92,23 +92,23 @@ static int ipacc_msg_nack(u_int8_t mt) return 0; } -static void check_restart_or_exit(struct gsm_bts *bts) +static void check_restart_or_exit(struct gsm_bts_trx *trx) { if (restart) { - abis_nm_ipaccess_restart(bts); + abis_nm_ipaccess_restart(trx); } else { exit(0); } } -static int ipacc_msg_ack(u_int8_t mt, struct gsm_bts *bts) +static int ipacc_msg_ack(u_int8_t mt, struct gsm_bts_trx *trx) { if (sw_load_state == 1) { fprintf(stderr, "The new software is activaed.\n"); - check_restart_or_exit(bts); + check_restart_or_exit(trx); } else if (oml_state == 1) { fprintf(stderr, "Set the primary OML IP.\n"); - check_restart_or_exit(bts); + check_restart_or_exit(trx); } return 0; @@ -203,7 +203,7 @@ static int nm_sig_cb(unsigned int subsys, unsigned int signal, return ipacc_msg_nack(ipacc_data->msg_type); case S_NM_IPACC_ACK: ipacc_data = signal_data; - return ipacc_msg_ack(ipacc_data->msg_type, ipacc_data->bts); + return ipacc_msg_ack(ipacc_data->msg_type, ipacc_data->trx); case S_NM_TEST_REP: return test_rep(signal_data); case S_NM_IPACC_RESTART_ACK: @@ -304,7 +304,6 @@ static void bootstrap_om(struct gsm_bts_trx *trx) int len; static u_int8_t buf[1024]; u_int8_t *cur = buf; - struct gsm_bts *bts = trx->bts; printf("OML link established using TRX %d\n", trx->nr); @@ -361,7 +360,7 @@ static void bootstrap_om(struct gsm_bts_trx *trx) if (restart && !prim_oml_ip && !software) { printf("restarting BTS\n"); - abis_nm_ipaccess_restart(bts); + abis_nm_ipaccess_restart(trx); } } |