diff --git a/src/host/layer23/include/osmocom/gsm48_rr.h b/src/host/layer23/include/osmocom/gsm48_rr.h index c2907030a..74ccb27ab 100644 --- a/src/host/layer23/include/osmocom/gsm48_rr.h +++ b/src/host/layer23/include/osmocom/gsm48_rr.h @@ -161,6 +161,7 @@ int gsm48_decode_lai(struct gsm48_loc_area_id *lai, uint16_t *mcc, int gsm48_rr_enc_cm2(struct osmocom_ms *ms, struct gsm48_classmark2 *cm); int gsm48_rr_tx_rand_acc(struct osmocom_ms *ms, struct msgb *msg); int gsm48_rr_los(struct osmocom_ms *ms); +int gsm48_rr_rach_conf(struct osmocom_ms *ms, uint32_t fn); extern const char *gsm48_rr_state_names[]; #endif /* _GSM48_RR_H */ diff --git a/src/host/layer23/include/osmocom/l1ctl.h b/src/host/layer23/include/osmocom/l1ctl.h index 427f27e83..ad59b2d43 100644 --- a/src/host/layer23/include/osmocom/l1ctl.h +++ b/src/host/layer23/include/osmocom/l1ctl.h @@ -17,8 +17,12 @@ int tx_ph_data_req(struct osmocom_ms *ms, struct msgb *msg, int tx_ph_rach_req(struct osmocom_ms *ms); /* Transmit L1CTL_DM_EST_REQ */ -int tx_ph_dm_est_req(struct osmocom_ms *ms, uint16_t band_arfcn, uint8_t chan_nr, - uint8_t tsc); +int tx_ph_dm_est_req(struct osmocom_ms *ms, uint16_t band_arfcn, + uint8_t chan_nr, uint8_t tsc); + +/* Transmit L1CTL_DM_REL_REQ */ +int tx_ph_dm_rel_req(struct osmocom_ms *ms); + /* Transmit FBSB_REQ */ int l1ctl_tx_fbsb_req(struct osmocom_ms *ms, uint16_t arfcn, uint8_t flags, uint16_t timeout, uint8_t sync_info_idx, diff --git a/src/host/layer23/src/gsm322.c b/src/host/layer23/src/gsm322.c index 11ff50642..8c51d0136 100644 --- a/src/host/layer23/src/gsm322.c +++ b/src/host/layer23/src/gsm322.c @@ -2309,8 +2309,8 @@ static int gsm322_cs_powerscan(struct osmocom_ms *ms) /* start scan on radio interface */ cs->powerscan = 1; -#warning TESTING!!!! -usleep(300000); +//#warning TESTING!!!! +//usleep(300000); return l1ctl_tx_pm_req_range(ms, s, e); } @@ -2833,8 +2833,8 @@ static int gsm322_c_conn_mode_1(struct osmocom_ms *ms, struct msgb *msg) hack = 5; gsm322_sync_to_cell(ms, cs); cs->si = cs->list[cs->arfcn].sysinfo; -#warning TESTING: laforge must fix the sync error when sending fbsb request too close to each other. also we must get a response with arfcn or a confirm, so we know where the response belongs to. -usleep(300000); +//#warning TESTING!!!! +//usleep(300000); return 0; } diff --git a/src/host/layer23/src/gsm48_rr.c b/src/host/layer23/src/gsm48_rr.c index de087ced7..415adc425 100644 --- a/src/host/layer23/src/gsm48_rr.c +++ b/src/host/layer23/src/gsm48_rr.c @@ -58,6 +58,7 @@ #include #include #include +#include static int gsm48_rcv_rsl(struct osmocom_ms *ms, struct msgb *msg); static int gsm48_rr_dl_est(struct osmocom_ms *ms); @@ -213,6 +214,8 @@ static void new_rr_state(struct gsm48_rrlayer *rr, int state) if (state == GSM48_RR_ST_IDLE) { struct msgb *msg, *nmsg; + /* release dedicated mode, if any */ + tx_ph_dm_rel_req(rr->ms); /* free establish message, if any */ rr->rr_est_req = 0; if (rr->rr_est_msg) { @@ -3003,9 +3006,15 @@ static int gsm48_rr_dl_est(struct osmocom_ms *ms) #ifdef TODO RSL_MT_ to activate channel with all the cd_now informations #else + if (rr->cd_now.h) { + printf("FIXME: Channel hopping not supported, exitting.\n"); + exit(-ENOTSUP); + } rsl_dec_chan_nr(rr->cd_now.chan_nr, &ch_type, &ch_subch, &ch_ts); - if (ch_type != RSL_CHAN_SDCCH4_ACCH || ch_ts != 0) { - printf("Channel type not supported, exitting.\n"); + if ((ch_type != RSL_CHAN_SDCCH8_ACCH + && ch_type != RSL_CHAN_SDCCH4_ACCH) || ch_ts > 4) { + printf("Channel type %d, subch %d, ts %d not supported, " + "exitting.\n", ch_type, ch_subch, ch_ts); exit(-ENOTSUP); } tx_ph_dm_est_req(ms, rr->cd_now.arfcn, rr->cd_now.chan_nr, diff --git a/src/host/layer23/src/l1ctl.c b/src/host/layer23/src/l1ctl.c index 5b86dfedd..6e5920440 100644 --- a/src/host/layer23/src/l1ctl.c +++ b/src/host/layer23/src/l1ctl.c @@ -343,6 +343,23 @@ int tx_ph_dm_est_req(struct osmocom_ms *ms, uint16_t band_arfcn, uint8_t chan_nr return osmo_send_l1(ms, msg); } +/* Transmit L1CTL_DM_REL_REQ */ +int tx_ph_dm_rel_req(struct osmocom_ms *ms) +{ + struct msgb *msg; + struct l1ctl_info_ul *ul; + + msg = osmo_l1_alloc(L1CTL_DM_REL_REQ); + if (!msg) + return -1; + + DEBUGP(DL1C, "Tx Dedic.Mode Rel Req\n"); + + ul = (struct l1ctl_info_ul *) msgb_put(msg, sizeof(*ul)); + + return osmo_send_l1(ms, msg); +} + int l1ctl_tx_echo_req(struct osmocom_ms *ms, unsigned int len) { struct msgb *msg; diff --git a/src/target/firmware/layer1/l23_api.c b/src/target/firmware/layer1/l23_api.c index 16f896947..70776fcc7 100644 --- a/src/target/firmware/layer1/l23_api.c +++ b/src/target/firmware/layer1/l23_api.c @@ -171,9 +171,9 @@ static void l1ctl_rx_dm_est_req(struct msgb *msg) puts("We don't support ARFCN switches yet\n"); return; } - if (ul->chan_nr & 0x7) { + if ((ul->chan_nr & 0x7) > 4) { /* FIXME: Timeslot */ - puts("We don't support non-0 TS yet\n"); + puts("We don't support TS > 4 yet\n"); return; } if (est_req->h) {