follow libosmocore/gprs_ns2 API changes of GPRS enums

All gprs_ns2 enums have now GPRS_NS2 as prefix.

API change which must be synchronized with libosmocore

Depends-on: I548ff12f7277cbb7e1a630a3dc02b738ce89be72 (libosmocore)
Change-Id: I1af704cdd62ddaff4304479b837dc185b80d7dd6
This commit is contained in:
Alexander Couzens 2021-01-27 20:56:55 +01:00
parent c09cb29d78
commit 21afdf9a32
2 changed files with 20 additions and 20 deletions

View File

@ -168,7 +168,7 @@ static int gbprox_relay2nse(struct msgb *old_msg, struct gbproxy_nse *nse,
if (gprs_gb_parse_tlli(msgb_data(msg), msgb_length(msg), &tlli) == 1) if (gprs_gb_parse_tlli(msgb_data(msg), msgb_length(msg), &tlli) == 1)
nsp.u.unitdata.link_selector = tlli; nsp.u.unitdata.link_selector = tlli;
osmo_prim_init(&nsp.oph, SAP_NS, PRIM_NS_UNIT_DATA, osmo_prim_init(&nsp.oph, SAP_NS, GPRS_NS2_PRIM_UNIT_DATA,
PRIM_OP_REQUEST, msg); PRIM_OP_REQUEST, msg);
rc = gprs_ns2_recv_prim(nsi, &nsp.oph); rc = gprs_ns2_recv_prim(nsi, &nsp.oph);
/* FIXME: We need a counter group for gbproxy_nse */ /* FIXME: We need a counter group for gbproxy_nse */
@ -1279,7 +1279,7 @@ int gbprox_bssgp_send_cb(void *ctx, struct msgb *msg)
nsp.bvci = msgb_bvci(msg); nsp.bvci = msgb_bvci(msg);
nsp.nsei = msgb_nsei(msg); nsp.nsei = msgb_nsei(msg);
osmo_prim_init(&nsp.oph, SAP_NS, PRIM_NS_UNIT_DATA, PRIM_OP_REQUEST, msg); osmo_prim_init(&nsp.oph, SAP_NS, GPRS_NS2_PRIM_UNIT_DATA, PRIM_OP_REQUEST, msg);
rc = gprs_ns2_recv_prim(nsi, &nsp.oph); rc = gprs_ns2_recv_prim(nsi, &nsp.oph);
return rc; return rc;
@ -1321,13 +1321,13 @@ int gbprox_rcvmsg(void *ctx, struct msgb *msg)
} }
/* TODO: What about handling: /* TODO: What about handling:
* NS_AFF_CAUSE_VC_FAILURE, * GPRS_NS2_AFF_CAUSE_VC_FAILURE,
NS_AFF_CAUSE_VC_RECOVERY, GPRS_NS2_AFF_CAUSE_VC_RECOVERY,
NS_AFF_CAUSE_FAILURE, GPRS_NS2_AFF_CAUSE_FAILURE,
NS_AFF_CAUSE_RECOVERY, GPRS_NS2_AFF_CAUSE_RECOVERY,
osmocom own causes osmocom own causes
NS_AFF_CAUSE_SNS_CONFIGURED, GPRS_NS2_AFF_CAUSE_SNS_CONFIGURED,
NS_AFF_CAUSE_SNS_FAILURE, GPRS_NS2_AFF_CAUSE_SNS_FAILURE,
*/ */
void gprs_ns_prim_status_cb(struct gbproxy_config *cfg, struct osmo_gprs_ns2_prim *nsp) void gprs_ns_prim_status_cb(struct gbproxy_config *cfg, struct osmo_gprs_ns2_prim *nsp)
@ -1340,11 +1340,11 @@ void gprs_ns_prim_status_cb(struct gbproxy_config *cfg, struct osmo_gprs_ns2_pri
struct gbproxy_nse *sgsn_nse; struct gbproxy_nse *sgsn_nse;
switch (nsp->u.status.cause) { switch (nsp->u.status.cause) {
case NS_AFF_CAUSE_SNS_FAILURE: case GPRS_NS2_AFF_CAUSE_SNS_FAILURE:
case NS_AFF_CAUSE_SNS_CONFIGURED: case GPRS_NS2_AFF_CAUSE_SNS_CONFIGURED:
break; break;
case NS_AFF_CAUSE_RECOVERY: case GPRS_NS2_AFF_CAUSE_RECOVERY:
LOGP(DGPRS, LOGL_NOTICE, "NS-NSE %d became available\n", nsp->nsei); LOGP(DGPRS, LOGL_NOTICE, "NS-NSE %d became available\n", nsp->nsei);
sgsn_nse = gbproxy_nse_by_nsei(cfg, nsp->nsei, NSE_F_SGSN); sgsn_nse = gbproxy_nse_by_nsei(cfg, nsp->nsei, NSE_F_SGSN);
if (sgsn_nse) { if (sgsn_nse) {
@ -1354,7 +1354,7 @@ void gprs_ns_prim_status_cb(struct gbproxy_config *cfg, struct osmo_gprs_ns2_pri
osmo_fsm_inst_dispatch(bvc->fi, BSSGP_BVCFSM_E_REQ_RESET, &cause); osmo_fsm_inst_dispatch(bvc->fi, BSSGP_BVCFSM_E_REQ_RESET, &cause);
} }
break; break;
case NS_AFF_CAUSE_FAILURE: case GPRS_NS2_AFF_CAUSE_FAILURE:
#if 0 #if 0
if (gbproxy_is_sgsn_nsei(cfg, nsp->nsei)) { if (gbproxy_is_sgsn_nsei(cfg, nsp->nsei)) {
/* sgsn */ /* sgsn */
@ -1408,7 +1408,7 @@ int gprs_ns2_prim_cb(struct osmo_prim_hdr *oph, void *ctx)
} }
switch (oph->primitive) { switch (oph->primitive) {
case PRIM_NS_UNIT_DATA: case GPRS_NS2_PRIM_UNIT_DATA:
/* hand the message into the BSSGP implementation */ /* hand the message into the BSSGP implementation */
msgb_bssgph(oph->msg) = oph->msg->l3h; msgb_bssgph(oph->msg) = oph->msg->l3h;
@ -1420,7 +1420,7 @@ int gprs_ns2_prim_cb(struct osmo_prim_hdr *oph, void *ctx)
rc = gbprox_rcvmsg(cfg, oph->msg); rc = gbprox_rcvmsg(cfg, oph->msg);
msgb_free(oph->msg); msgb_free(oph->msg);
break; break;
case PRIM_NS_STATUS: case GPRS_NS2_PRIM_STATUS:
gprs_ns_prim_status_cb(cfg, nsp); gprs_ns_prim_status_cb(cfg, nsp);
break; break;
default: default:

View File

@ -114,17 +114,17 @@ int gprs_gb_send_cb(void *ctx, struct msgb *msg)
struct osmo_gprs_ns2_prim nsp = {}; struct osmo_gprs_ns2_prim nsp = {};
nsp.nsei = msgb_nsei(msg); nsp.nsei = msgb_nsei(msg);
nsp.bvci = msgb_bvci(msg); nsp.bvci = msgb_bvci(msg);
osmo_prim_init(&nsp.oph, SAP_NS, PRIM_NS_UNIT_DATA, PRIM_OP_REQUEST, msg); osmo_prim_init(&nsp.oph, SAP_NS, GPRS_NS2_PRIM_UNIT_DATA, PRIM_OP_REQUEST, msg);
return gprs_ns2_recv_prim(nsi, &nsp.oph); return gprs_ns2_recv_prim(nsi, &nsp.oph);
} }
void gprs_ns_prim_status_cb(struct osmo_gprs_ns2_prim *nsp) void gprs_ns_prim_status_cb(struct osmo_gprs_ns2_prim *nsp)
{ {
switch (nsp->u.status.cause) { switch (nsp->u.status.cause) {
case NS_AFF_CAUSE_SNS_CONFIGURED: case GPRS_NS2_AFF_CAUSE_SNS_CONFIGURED:
LOGP(DGPRS, LOGL_NOTICE, "NS-E %d SNS configured.\n", nsp->nsei); LOGP(DGPRS, LOGL_NOTICE, "NS-E %d SNS configured.\n", nsp->nsei);
break; break;
case NS_AFF_CAUSE_RECOVERY: case GPRS_NS2_AFF_CAUSE_RECOVERY:
LOGP(DGPRS, LOGL_NOTICE, "NS-E %d became available\n", nsp->nsei); LOGP(DGPRS, LOGL_NOTICE, "NS-E %d became available\n", nsp->nsei);
/* workaround for broken BSS which doesn't respond correct to BSSGP status message. /* workaround for broken BSS which doesn't respond correct to BSSGP status message.
* Sent a BSSGP Reset when a persistent NSVC comes up for the first time. */ * Sent a BSSGP Reset when a persistent NSVC comes up for the first time. */
@ -135,7 +135,7 @@ void gprs_ns_prim_status_cb(struct osmo_gprs_ns2_prim *nsp)
bssgp_tx_bvc_reset2(&bctx, BVCI_SIGNALLING, BSSGP_CAUSE_EQUIP_FAIL, false); bssgp_tx_bvc_reset2(&bctx, BVCI_SIGNALLING, BSSGP_CAUSE_EQUIP_FAIL, false);
} }
break; break;
case NS_AFF_CAUSE_FAILURE: case GPRS_NS2_AFF_CAUSE_FAILURE:
LOGP(DGPRS, LOGL_NOTICE, "NS-E %d became unavailable\n", nsp->nsei); LOGP(DGPRS, LOGL_NOTICE, "NS-E %d became unavailable\n", nsp->nsei);
break; break;
default: default:
@ -164,7 +164,7 @@ int gprs_ns_prim_cb(struct osmo_prim_hdr *oph, void *ctx)
} }
switch (oph->primitive) { switch (oph->primitive) {
case PRIM_NS_UNIT_DATA: case GPRS_NS2_PRIM_UNIT_DATA:
/* hand the message into the BSSGP implementation */ /* hand the message into the BSSGP implementation */
/* add required msg fields for Gb layer */ /* add required msg fields for Gb layer */
msgb_bssgph(oph->msg) = oph->msg->l3h; msgb_bssgph(oph->msg) = oph->msg->l3h;
@ -172,7 +172,7 @@ int gprs_ns_prim_cb(struct osmo_prim_hdr *oph, void *ctx)
msgb_nsei(oph->msg) = nsp->nsei; msgb_nsei(oph->msg) = nsp->nsei;
rc = bssgp_rcvmsg(oph->msg); rc = bssgp_rcvmsg(oph->msg);
break; break;
case PRIM_NS_STATUS: case GPRS_NS2_PRIM_STATUS:
gprs_ns_prim_status_cb(nsp); gprs_ns_prim_status_cb(nsp);
break; break;
default: default: