summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndreas.Eversberg2010-05-02 19:40:52 +0200
committerAndreas.Eversberg2010-05-02 19:40:52 +0200
commitfe1dc19c6eb1bd295db558197b474eb0557f21cb (patch)
tree80c0656513969cbeda949a65536b8e5ac65114e9 /src
parentMany fixes in layer 3: (diff)
downloadosmocom-fe1dc19c6eb1bd295db558197b474eb0557f21cb.tar.gz
osmocom-fe1dc19c6eb1bd295db558197b474eb0557f21cb.tar.xz
osmocom-fe1dc19c6eb1bd295db558197b474eb0557f21cb.zip
More fixes on layer3.
The current code will scan frequencies, select a cell and camps on it. No SIM is inserted. Paging requests and Immediate assginments can be seen. When inserting a SIM card (uncomment it in app_mobile.c), location update is triggered after selecting a cell. The RACH request is sent, an Immediate assignment is received, the dedicated mode is requested. Nothing happens then, because no confirm / abort of layer 2 is received.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/host/layer23/include/osmocom/gsm322.h2
-rwxr-xr-xsrc/host/layer23/src/gsm322.c23
-rw-r--r--src/host/layer23/src/gsm48_mm.c2
-rw-r--r--src/host/layer23/src/support.c2
4 files changed, 18 insertions, 11 deletions
diff --git a/src/host/layer23/include/osmocom/gsm322.h b/src/host/layer23/include/osmocom/gsm322.h
index bc807e5..0159972 100755
--- a/src/host/layer23/include/osmocom/gsm322.h
+++ b/src/host/layer23/include/osmocom/gsm322.h
@@ -183,7 +183,7 @@ int gsm322_is_forbidden_plmn(struct osmocom_ms *ms, uint16_t mcc, uint16_t mnc);
int gsm322_is_forbidden_la(struct osmocom_ms *ms, uint16_t mcc, uint16_t mnc,
uint16_t lac);
int gsm322_dump_sorted_plmn(struct osmocom_ms *ms);
-int gsm322_dump_cs_list(struct osmocom_ms *ms);
+int gsm322_dump_cs_list(struct osmocom_ms *ms, uint8_t flag);
int gsm322_dump_sim_plmn(struct osmocom_ms *ms);
int gsm322_dump_forbidden_plmn(struct osmocom_ms *ms);
int gsm322_dump_forbidden_la(struct osmocom_ms *ms);
diff --git a/src/host/layer23/src/gsm322.c b/src/host/layer23/src/gsm322.c
index 0d74e6b..b96f011 100755
--- a/src/host/layer23/src/gsm322.c
+++ b/src/host/layer23/src/gsm322.c
@@ -45,9 +45,9 @@ static int gsm322_m_switch_on(struct osmocom_ms *ms, struct msgb *msg);
#warning HACK to stay on one channel
+static int already = 0;
int l1ctl_tx_ccch_req_(struct osmocom_ms *ms, uint16_t arfcn)
{
- static int already = 0;
if (!already) {
already = 1;
@@ -1482,7 +1482,7 @@ static int gsm322_cs_scan(struct osmocom_ms *ms)
cs->scan_state = weight;
if (!weight)
- gsm322_dump_cs_list(ms);
+ gsm322_dump_cs_list(ms, GSM322_CS_FLAG_SYSINFO);
/* special negative case for HPLMN search */
if (cs->state == GSM322_HPLMN_SEARCH && !weight) {
@@ -1787,8 +1787,10 @@ static int gsm322_c_camp_sysinfo_bcch(struct osmocom_ms *ms, struct msgb *msg)
|| (s->si2bis && s->si2ter && s->nb_ext_ind_si2
&& s->nb_ext_ind_si2bis))) {
if (cs->selected) {
- LOGP(DCS, LOGL_INFO, "Selected sysinfo is updated.\n");
+ LOGP(DCS, LOGL_INFO, "Sysinfo of selected cell is "
+ "updated.\n");
memcpy(&cs->sel_si, s, sizeof(cs->sel_si));
+ gsm48_sysinfo_dump(ms, s);
}
}
@@ -1856,6 +1858,7 @@ static int gsm322_c_scan_sysinfo_bcch(struct osmocom_ms *ms, struct msgb *msg)
|| (s->si2bis && s->nb_ext_ind_si2 && !s->nb_ext_ind_si2bis)
|| (s->si2bis && s->si2ter && s->nb_ext_ind_si2
&& s->nb_ext_ind_si2bis))) {
+ LOGP(DCS, LOGL_INFO, "Received relevant sysinfo.\n");
/* stop timer */
stop_cs_timer(cs);
@@ -1922,10 +1925,14 @@ static int gsm322_cs_powerscan(struct osmocom_ms *ms)
}
#warning testing
-cs->list[10].rxlev_db = -50;
-cs->list[10].flags |= GSM322_CS_FLAG_POWER;
-cs->list[10].flags |= GSM322_CS_FLAG_SIGNAL;
+if (already) s = -1;
+#if 0
+cs->list[ms->test_arfcn].rxlev_db = -50;
+cs->list[ms->test_arfcn].flags |= GSM322_CS_FLAG_POWER;
+cs->list[ms->test_arfcn].flags |= GSM322_CS_FLAG_SIGNAL;
s = -1;
+#endif
+
/* if there is no more frequency, we can tune to that cell */
if (s < 0) {
int found = 0;
@@ -2720,7 +2727,7 @@ int gsm322_dump_sorted_plmn(struct osmocom_ms *ms)
return 0;
}
-int gsm322_dump_cs_list(struct osmocom_ms *ms)
+int gsm322_dump_cs_list(struct osmocom_ms *ms, uint8_t flags)
{
struct gsm322_cellsel *cs = &ms->cellsel;
int i, j;
@@ -2730,7 +2737,7 @@ int gsm322_dump_cs_list(struct osmocom_ms *ms)
"-------+-------+-------+-------+-----------------------+"
"-------+-------\n");
for (i = 0; i <= 1023; i++) {
- if (!(cs->list[i].flags & GSM322_CS_FLAG_SIGNAL))
+ if (!(cs->list[i].flags & flags))
continue;
printf("%4d |", cs->list[i].rxlev_db);
if ((cs->list[i].flags & GSM322_CS_FLAG_SYSINFO)) {
diff --git a/src/host/layer23/src/gsm48_mm.c b/src/host/layer23/src/gsm48_mm.c
index e82b7a2..2d05622 100644
--- a/src/host/layer23/src/gsm48_mm.c
+++ b/src/host/layer23/src/gsm48_mm.c
@@ -2398,7 +2398,7 @@ static int gsm48_mm_loc_upd_failed(struct osmocom_ms *ms)
/* start update retry timer (RR connection is released) */
if (mm->lupd_attempt < 4)
- mm->start_t3211;
+ mm->start_t3211 = 1;
/* CS process will trigger: return to MM IDLE */
return 0;
diff --git a/src/host/layer23/src/support.c b/src/host/layer23/src/support.c
index b9ff803..29317d7 100644
--- a/src/host/layer23/src/support.c
+++ b/src/host/layer23/src/support.c
@@ -118,7 +118,7 @@ struct gsm_support_scan_max gsm_sup_smax[] = {
{ 955, 124, 30, 0 },
{ 512, 885, 40, 0 },
#else
- { 955, 125, 3, 0 }, /* testing */
+ { 955, 125, 1, 0 }, /* we support only one ARFCN */
#endif
{ 0, 0, 0, 0 }
};