aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2012-04-19 19:22:53 +0200
committerHarald Welte <laforge@gnumonks.org>2012-04-19 19:22:53 +0200
commitf19ee660963ba34a2ecad5f6fb5c44e89c9fb820 (patch)
treea4470d6cdf58caa907a38040d663abd23941ea47 /src
parent4301b09137925dc4f903c98608697491a7a0a600 (diff)
add a VTY command for activating PDCH channels (in EGPRS mode)
This allows us to do RF measurements (EDGE EVM and the like) even without having any PCU/RLC/MAC code as of now. To use it, configure PDCH type timeslots (e.g. TS 7) in the BSC and then use "trx 0 7 activate 0" to manually activate the PDTCH lchan on top of that timeslot. The BTS will now happily transmit EDGE/8PSK data.
Diffstat (limited to 'src')
-rw-r--r--src/common/oml.c4
-rw-r--r--src/osmo-bts-sysmo/femtobts.c27
-rw-r--r--src/osmo-bts-sysmo/femtobts.h19
-rw-r--r--src/osmo-bts-sysmo/l1_if.c10
-rw-r--r--src/osmo-bts-sysmo/oml.c17
-rw-r--r--src/osmo-bts-sysmo/sysmobts_vty.c25
6 files changed, 101 insertions, 1 deletions
diff --git a/src/common/oml.c b/src/common/oml.c
index 56d00c5c..d82c3d4f 100644
--- a/src/common/oml.c
+++ b/src/common/oml.c
@@ -595,6 +595,10 @@ static int conf_lchans_for_pchan(struct gsm_bts_trx_ts *ts)
lchan->type = GSM_LCHAN_SDCCH;
}
break;
+ case GSM_PCHAN_PDCH:
+ lchan = &ts->lchan[0];
+ lchan->type = GSM_LCHAN_PDTCH;
+ break;
default:
/* FIXME */
break;
diff --git a/src/osmo-bts-sysmo/femtobts.c b/src/osmo-bts-sysmo/femtobts.c
index 848981a3..a367c32a 100644
--- a/src/osmo-bts-sysmo/femtobts.c
+++ b/src/osmo-bts-sysmo/femtobts.c
@@ -257,3 +257,30 @@ const struct value_string femtobts_dir_names[] = {
{ GsmL1_Dir_TxDownlink|GsmL1_Dir_RxUplink, "BOTH" },
{ 0, NULL }
};
+
+const struct value_string femtobts_chcomb_names[] = {
+ { GsmL1_LogChComb_0, "dummy" },
+ { GsmL1_LogChComb_I, "tch_f" },
+ { GsmL1_LogChComb_II, "tch_h" },
+ { GsmL1_LogChComb_IV, "ccch" },
+ { GsmL1_LogChComb_V, "ccch_sdcch4" },
+ { GsmL1_LogChComb_VII, "sdcch8" },
+ { GsmL1_LogChComb_XIII, "pdtch" },
+ { 0, NULL }
+};
+
+const uint8_t pdch_msu_size[_NUM_PDCH_CS] = {
+ [PDCH_CS_1] = 23,
+ [PDCH_CS_2] = 34,
+ [PDCH_CS_3] = 40,
+ [PDCH_CS_4] = 54,
+ [PDCH_MCS_1] = 27,
+ [PDCH_MCS_2] = 33,
+ [PDCH_MCS_3] = 42,
+ [PDCH_MCS_4] = 49,
+ [PDCH_MCS_5] = 60,
+ [PDCH_MCS_6] = 78,
+ [PDCH_MCS_7] = 118,
+ [PDCH_MCS_8] = 142,
+ [PDCH_MCS_9] = 154
+};
diff --git a/src/osmo-bts-sysmo/femtobts.h b/src/osmo-bts-sysmo/femtobts.h
index bb5c6aaf..5dfcba24 100644
--- a/src/osmo-bts-sysmo/femtobts.h
+++ b/src/osmo-bts-sysmo/femtobts.h
@@ -48,4 +48,23 @@ const struct value_string femtobts_clksrc_names[8];
const struct value_string femtobts_dir_names[6];
+enum pdch_cs {
+ PDCH_CS_1,
+ PDCH_CS_2,
+ PDCH_CS_3,
+ PDCH_CS_4,
+ PDCH_MCS_1,
+ PDCH_MCS_2,
+ PDCH_MCS_3,
+ PDCH_MCS_4,
+ PDCH_MCS_5,
+ PDCH_MCS_6,
+ PDCH_MCS_7,
+ PDCH_MCS_8,
+ PDCH_MCS_9,
+ _NUM_PDCH_CS
+};
+
+const uint8_t pdch_msu_size[_NUM_PDCH_CS];
+
#endif /* FEMTOBTS_H */
diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c
index 88245329..d344a1b3 100644
--- a/src/osmo-bts-sysmo/l1_if.c
+++ b/src/osmo-bts-sysmo/l1_if.c
@@ -505,6 +505,16 @@ static int handle_ph_readytosend_ind(struct femtol1_hdl *fl1,
}
break;
/* we should never receive a request here */
+ case GsmL1_Sapi_Pdtch:
+ msu_param->u8Size = pdch_msu_size[PDCH_MCS_9];
+ memset(msu_param->u8Buffer, 0, msu_param->u8Size);
+ /* FIXME: copy actual data */
+ break;
+ case GsmL1_Sapi_Pacch:
+ case GsmL1_Sapi_Ptcch:
+ case GsmL1_Sapi_Prach:
+ goto empty_frame;
+ break;
default:
memcpy(msu_param->u8Buffer, fill_frame, GSM_MACBLOCK_LEN);
break;
diff --git a/src/osmo-bts-sysmo/oml.c b/src/osmo-bts-sysmo/oml.c
index e4dcf338..8552887b 100644
--- a/src/osmo-bts-sysmo/oml.c
+++ b/src/osmo-bts-sysmo/oml.c
@@ -399,6 +399,17 @@ static const struct sapi_dir sdcch_sapis[] = {
{ GsmL1_Sapi_Sacch, GsmL1_Dir_RxUplink },
};
+static const struct sapi_dir pdtch_sapis[] = {
+ { GsmL1_Sapi_Pdtch, GsmL1_Dir_TxDownlink },
+ { GsmL1_Sapi_Pdtch, GsmL1_Dir_RxUplink },
+#if 0
+ { GsmL1_Sapi_Ptcch, GsmL1_Dir_TxDownlink },
+ { GsmL1_Sapi_Ptcch, GsmL1_Dir_RxUplink },
+ { GsmL1_Sapi_Pacch, GsmL1_Dir_TxDownlink },
+ { GsmL1_Sapi_Prach, GsmL1_Dir_RxUplink },
+#endif
+};
+
struct lchan_sapis {
const struct sapi_dir *sapis;
unsigned int num_sapis;
@@ -421,6 +432,10 @@ static const struct lchan_sapis sapis_for_lchan[_GSM_LCHAN_MAX] = {
.sapis = ccch_sapis,
.num_sapis = ARRAY_SIZE(ccch_sapis),
},
+ [GSM_LCHAN_PDTCH] = {
+ .sapis = pdtch_sapis,
+ .num_sapis = ARRAY_SIZE(pdtch_sapis),
+ },
};
static int lchan_act_compl_cb(struct msgb *l1_msg, void *data)
@@ -906,7 +921,7 @@ static int lchan_deact_compl_cb(struct msgb *l1_msg, void *data)
return 0;
}
-static int lchan_deactivate(struct gsm_lchan *lchan)
+int lchan_deactivate(struct gsm_lchan *lchan)
{
struct femtol1_hdl *fl1h = trx_femtol1_hdl(lchan->ts->trx);
const struct lchan_sapis *s4l = &sapis_for_lchan[lchan->type];
diff --git a/src/osmo-bts-sysmo/sysmobts_vty.c b/src/osmo-bts-sysmo/sysmobts_vty.c
index d80cd16e..85381939 100644
--- a/src/osmo-bts-sysmo/sysmobts_vty.c
+++ b/src/osmo-bts-sysmo/sysmobts_vty.c
@@ -304,6 +304,29 @@ DEFUN(show_sys_info, show_sys_info_cmd,
return CMD_SUCCESS;
}
+DEFUN(activate_lchan, activate_lchan_cmd,
+ "trx <0-0> <0-7> (activate|deactivate) <0-7>",
+ "Transceiver related commands\n"
+ "TRX number\n"
+ "Timeslot number\n"
+ "Activate or Deactivate\n"
+ "Logical Channel Number\n" )
+{
+ int trx_nr = atoi(argv[0]);
+ int ts_nr = atoi(argv[1]);
+ int lchan_nr = atoi(argv[3]);
+ struct gsm_bts_trx *trx = gsm_bts_trx_num(vty_bts, trx_nr);
+ struct gsm_bts_trx_ts *ts = &trx->ts[ts_nr];
+ struct gsm_lchan *lchan = &ts->lchan[lchan_nr];
+
+ if (!strcmp(argv[2], "activate"))
+ lchan_activate(lchan);
+ else
+ lchan_deactivate(lchan);
+
+ return CMD_SUCCESS;
+}
+
void bts_model_config_write_bts(struct vty *vty, struct gsm_bts *bts)
{
}
@@ -338,6 +361,8 @@ int bts_model_vty_init(struct gsm_bts *bts)
install_element_ve(&dsp_trace_f_cmd);
install_element_ve(&no_dsp_trace_f_cmd);
+ install_element(ENABLE_NODE, &activate_lchan_cmd);
+
install_element(TRX_NODE, &cfg_trx_clkcal_cmd);
install_element(TRX_NODE, &cfg_trx_clkcal_def_cmd);
install_element(TRX_NODE, &cfg_trx_clksrc_cmd);