diff options
-rw-r--r-- | include/osmo-bts/pcuif_proto.h | 11 | ||||
-rw-r--r-- | src/common/pcu_sock.c | 7 | ||||
-rw-r--r-- | src/osmo-bts-sysmo/l1_if.c | 6 | ||||
-rw-r--r-- | src/osmo-bts-sysmo/main.c | 10 | ||||
-rw-r--r-- | src/osmo-bts-sysmo/oml.c | 7 |
5 files changed, 35 insertions, 6 deletions
diff --git a/include/osmo-bts/pcuif_proto.h b/include/osmo-bts/pcuif_proto.h index 99947f74..493f058c 100644 --- a/include/osmo-bts/pcuif_proto.h +++ b/include/osmo-bts/pcuif_proto.h @@ -1,7 +1,7 @@ #ifndef _PCUIF_PROTO_H #define _PCUIF_PROTO_H -#define PCU_IF_VERSION 0x01 +#define PCU_IF_VERSION 0x03 /* msg_type */ #define PCU_IF_MSG_DATA_REQ 0x00 /* send data to given channel */ @@ -73,12 +73,14 @@ struct gsm_pcu_if_info_trx { uint8_t pdch_mask; /* PDCH channels per TS */ uint8_t spare; uint8_t tsc[8]; /* TSC per channel */ + uint32_t hlayer1; } __attribute__ ((packed)); struct gsm_pcu_if_info_ind { uint32_t version; uint32_t flags; struct gsm_pcu_if_info_trx trx[8]; /* TRX infos per BTS */ + uint8_t bsic; /* RAI */ uint16_t mcc, mnc, lac, rac; /* NSE */ @@ -121,6 +123,12 @@ struct gsm_pcu_if_time_ind { uint32_t fn; } __attribute__ ((packed)); +struct gsm_pcu_if_pag_req { + uint8_t sapi; + uint8_t chan_needed; + uint8_t identity_lv[9]; +} __attribute__ ((packed)); + struct gsm_pcu_if { /* context based information */ uint8_t msg_type; /* message type */ @@ -135,6 +143,7 @@ struct gsm_pcu_if { struct gsm_pcu_if_info_ind info_ind; struct gsm_pcu_if_act_req act_req; struct gsm_pcu_if_time_ind time_ind; + struct gsm_pcu_if_pag_req pag_req; } u; } __attribute__ ((packed)); diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c index 28cc527d..1bf8cd60 100644 --- a/src/common/pcu_sock.c +++ b/src/common/pcu_sock.c @@ -41,7 +41,10 @@ #include <osmo-bts/signal.h> #include <osmo-bts/bts_model.h> +uint32_t trx_get_hlayer1(struct gsm_bts_trx *trx); + extern struct gsm_network bts_gsmnet; +extern int pcu_direct; static int avail_lai = 0, avail_nse = 0, avail_cell = 0, avail_nsvc[2] = {0, 0}; static const char *sapi_string[] = { @@ -128,6 +131,9 @@ int pcu_tx_info_ind(void) } else LOGP(DPCU, LOGL_INFO, "BTS is down\n"); + if (pcu_direct) + info_ind->flags |= PCU_IF_FLAG_SYSMO; + /* RAI */ info_ind->mcc = net->mcc; info_ind->mnc = net->mnc; @@ -201,6 +207,7 @@ int pcu_tx_info_ind(void) break; info_ind->trx[i].pdch_mask = 0; info_ind->trx[i].arfcn = trx->arfcn; + info_ind->trx[i].hlayer1 = trx_get_hlayer1(trx); for (j = 0; j < 8; j++) { ts = &trx->ts[j]; if (ts->mo.nm_state.operational == NM_OPSTATE_ENABLED diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index b219c41d..3cf2955a 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -57,6 +57,8 @@ #include "l1_transp.h" #include "hw_misc.h" +extern int pcu_direct; + /* FIXME: make threshold configurable */ #define MIN_QUAL_RACH 5.0f /* at least 5 dB C/I */ #define MIN_QUAL_NORM -0.5f /* at least -1 dB C/I */ @@ -959,12 +961,10 @@ int l1if_activate_rf(struct femtol1_hdl *hdl, int on) #else sysp->u.activateRfReq.timing.u8TimSrc = 1; /* Master */ sysp->u.activateRfReq.msgq.u8UseTchMsgq = 0; - sysp->u.activateRfReq.msgq.u8UsePdtchMsgq = 0; + sysp->u.activateRfReq.msgq.u8UsePdtchMsgq = pcu_direct; /* Use clock from OCXO or whatever source is configured */ sysp->u.activateRfReq.rfTrx.clkSrc = hdl->clk_src; - sysp->u.activateRfReq.rfRx.clkSrc = hdl->clk_src; sysp->u.activateRfReq.rfTrx.iClkCor = hdl->clk_cal; - sysp->u.activateRfReq.rfRx.iClkCor = hdl->clk_cal; #endif } else { sysp->id = SuperFemto_PrimId_DeactivateRfReq; diff --git a/src/osmo-bts-sysmo/main.c b/src/osmo-bts-sysmo/main.c index 2203309d..84a02745 100644 --- a/src/osmo-bts-sysmo/main.c +++ b/src/osmo-bts-sysmo/main.c @@ -51,7 +51,7 @@ /* FIXME: read from real hardware */ const uint8_t abis_mac[6] = { 0,1,2,3,4,5 }; -int gprs_enabled = 0; +int gprs_enabled = 0, pcu_direct = 0; static const char *config_file = "osmo-bts.cfg"; static int daemonize = 0; @@ -110,6 +110,8 @@ static void print_help() " -p --dsp-trace Set DSP trace flags\n" " -w --hw-version Print the targeted HW Version\n" " -P --pcu Enable PCU L1 socket interface\n" + " -M --pcu-direct Force PCU to access message queue for " + "PDCH dchannel directly\n" ); } @@ -140,10 +142,11 @@ static void handle_options(int argc, char **argv) { "dsp-trace", 1, 0, 'p' }, { "hw-version", 0, 0, 'w' }, { "pcu", 0, 0, 'P' }, + { "pcu-direct", 0, 0, 'M' }, { 0, 0, 0, 0 } }; - c = getopt_long(argc, argv, "hc:d:Dc:sTVe:p:w:P", + c = getopt_long(argc, argv, "hc:d:Dc:sTVe:p:w:PM", long_options, &option_idx); if (c == -1) break; @@ -175,6 +178,9 @@ static void handle_options(int argc, char **argv) } gprs_enabled = 1; break; + case 'M': + pcu_direct = 1; + break; case 'V': print_version(1); exit(0); diff --git a/src/osmo-bts-sysmo/oml.c b/src/osmo-bts-sysmo/oml.c index 257f30a1..705fd83c 100644 --- a/src/osmo-bts-sysmo/oml.c +++ b/src/osmo-bts-sysmo/oml.c @@ -291,6 +291,13 @@ static int trx_init(struct gsm_bts_trx *trx) return l1if_req_compl(fl1h, msg, 0, trx_init_compl_cb, fl1h); } +uint32_t trx_get_hlayer1(struct gsm_bts_trx *trx) +{ + struct femtol1_hdl *fl1h = trx_femtol1_hdl(trx); + + return fl1h->hLayer1; +} + static int trx_close_compl_cb(struct msgb *l1_msg, void *data) { return 0; |