aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2019-02-18 18:52:38 +0100
committerMax <msuraev@sysmocom.de>2019-02-19 18:58:04 +0100
commitfc8afc2f332c2e595e0429c048bbb55196fe3563 (patch)
treedb2cd33ba4082992f5179d70bf6a105be5ca98e8
parent81b58ccd9468c4a3dfe6485826be45b4a1f2e040 (diff)
Clarify write_immediate_assignment() signature
* remove unused variable * use bool for boolean types * add clarification comments Change-Id: I363445063e2d873d9194b2a5924b9e59b8b7ea53
-rw-r--r--src/bts.cpp20
-rw-r--r--src/bts.h2
-rw-r--r--src/encoding.cpp8
-rw-r--r--src/encoding.h8
-rw-r--r--src/tbf.cpp2
-rw-r--r--src/tbf_dl.cpp2
6 files changed, 20 insertions, 22 deletions
diff --git a/src/bts.cpp b/src/bts.cpp
index b6d0d0c..1804c52 100644
--- a/src/bts.cpp
+++ b/src/bts.cpp
@@ -774,11 +774,10 @@ int BTS::rcv_rach(uint16_t ra, uint32_t Fn, int16_t qta, bool is_11bit,
" - TRX=%d (%d) TS=%d TA=%d TSC=%d TFI=%d USF=%d\n",
trx_no, m_bts.trx[trx_no].arfcn, ts_no, ta, tsc,
tbf ? tbf->tfi() : -1, usf);
-
- plen = Encoding::write_immediate_assignment(
- tbf, immediate_assignment, 0, ra, Fn, ta,
- m_bts.trx[trx_no].arfcn, ts_no, tsc, usf, 0, sb_fn,
- m_bts.alpha, m_bts.gamma, -1, burst_type, sb);
+ // N. B: if tbf == NULL then SBA is used for Imm. Ass. below
+ plen = Encoding::write_immediate_assignment(tbf, immediate_assignment, false, ra, Fn, ta,
+ m_bts.trx[trx_no].arfcn, ts_no, tsc, usf, false, sb_fn,
+ m_bts.alpha, m_bts.gamma, -1, burst_type);
}
if (plen >= 0) {
@@ -791,7 +790,7 @@ int BTS::rcv_rach(uint16_t ra, uint32_t Fn, int16_t qta, bool is_11bit,
return rc;
}
-void BTS::snd_dl_ass(gprs_rlcmac_tbf *tbf, uint8_t poll, const char *imsi)
+void BTS::snd_dl_ass(gprs_rlcmac_tbf *tbf, bool poll, const char *imsi)
{
int plen;
unsigned int ts = tbf->first_ts;
@@ -804,10 +803,11 @@ void BTS::snd_dl_ass(gprs_rlcmac_tbf *tbf, uint8_t poll, const char *imsi)
LOGP(DRLCMAC, LOGL_DEBUG, " - TRX=%d (%d) TS=%d TA=%d pollFN=%d\n",
tbf->trx->trx_no, tbf->trx->arfcn,
ts, tbf->ta(), poll ? tbf->poll_fn : -1);
- plen = Encoding::write_immediate_assignment(tbf, immediate_assignment, 1, 125,
- (tbf->pdch[ts]->last_rts_fn + 21216) % GSM_MAX_FN, tbf->ta(),
- tbf->trx->arfcn, ts, tbf->tsc(), 7, poll,
- tbf->poll_fn, m_bts.alpha, m_bts.gamma, -1);
+ plen = Encoding::write_immediate_assignment(tbf, immediate_assignment, true, 125,
+ (tbf->pdch[ts]->last_rts_fn + 21216) % GSM_MAX_FN, tbf->ta(),
+ tbf->trx->arfcn, ts, tbf->tsc(), 7, poll,
+ tbf->poll_fn, m_bts.alpha, m_bts.gamma, -1,
+ GSM_L1_BURST_TYPE_ACCESS_0);
if (plen >= 0) {
immediate_assignment_dl_tbf();
pcu_l1if_tx_pch(immediate_assignment, plen, imsi);
diff --git a/src/bts.h b/src/bts.h
index df81440..51760e2 100644
--- a/src/bts.h
+++ b/src/bts.h
@@ -294,7 +294,7 @@ public:
int rcv_rach(uint16_t ra, uint32_t Fn, int16_t qta, bool is_11bit,
enum ph_burst_type burst_type);
- void snd_dl_ass(gprs_rlcmac_tbf *tbf, uint8_t poll, const char *imsi);
+ void snd_dl_ass(gprs_rlcmac_tbf *tbf, bool poll, const char *imsi);
GprsMsStorage &ms_store();
GprsMs *ms_by_tlli(uint32_t tlli, uint32_t old_tlli = 0);
diff --git a/src/encoding.cpp b/src/encoding.cpp
index 0241b39..2c89819 100644
--- a/src/encoding.cpp
+++ b/src/encoding.cpp
@@ -90,7 +90,7 @@ static inline void write_ta_ie(bitvec *dest, unsigned& wp,
static int write_ia_rest_downlink(
gprs_rlcmac_dl_tbf *tbf,
bitvec * dest, unsigned& wp,
- uint8_t polling, bool ta_valid, uint32_t fn,
+ bool polling, bool ta_valid, uint32_t fn,
uint8_t alpha, uint8_t gamma, int8_t ta_idx)
{
if (!tbf) {
@@ -342,10 +342,10 @@ static inline void log_alert_exit(const char * error)
*/
int Encoding::write_immediate_assignment(
struct gprs_rlcmac_tbf *tbf,
- bitvec * dest, uint8_t downlink, uint16_t ra,
+ bitvec * dest, bool downlink, uint16_t ra,
uint32_t ref_fn, uint8_t ta, uint16_t arfcn, uint8_t ts, uint8_t tsc,
- uint8_t usf, uint8_t polling, uint32_t fn, uint8_t alpha,
- uint8_t gamma, int8_t ta_idx, enum ph_burst_type burst_type, uint8_t sb)
+ uint8_t usf, bool polling, uint32_t fn, uint8_t alpha,
+ uint8_t gamma, int8_t ta_idx, enum ph_burst_type burst_type)
{
unsigned wp = 0;
int plen;
diff --git a/src/encoding.h b/src/encoding.h
index 54cb057..2309dc3 100644
--- a/src/encoding.h
+++ b/src/encoding.h
@@ -43,14 +43,12 @@ class Encoding {
public:
static int write_immediate_assignment(
struct gprs_rlcmac_tbf *tbf,
- bitvec * dest, uint8_t downlink, uint16_t ra,
+ bitvec * dest, bool downlink, uint16_t ra,
uint32_t ref_fn, uint8_t ta, uint16_t arfcn, uint8_t ts,
- uint8_t tsc, uint8_t usf, uint8_t polling,
+ uint8_t tsc, uint8_t usf, bool polling,
uint32_t fn, uint8_t alpha, uint8_t gamma,
int8_t ta_idx,
- enum ph_burst_type burst_type =
- GSM_L1_BURST_TYPE_ACCESS_0,
- uint8_t sb = 1);
+ enum ph_burst_type burst_type);
static int write_immediate_assignment_reject(
bitvec *dest, uint16_t ra,
diff --git a/src/tbf.cpp b/src/tbf.cpp
index 233ae91..ffe8b82 100644
--- a/src/tbf.cpp
+++ b/src/tbf.cpp
@@ -880,7 +880,7 @@ void gprs_rlcmac_tbf::poll_timeout()
LOGPTBF(dl_tbf, LOGL_DEBUG, "Re-send dowlink assignment on PCH (IMSI=%s)\n",
imsi());
/* send immediate assignment */
- dl_tbf->bts->snd_dl_ass(dl_tbf, 0, imsi());
+ dl_tbf->bts->snd_dl_ass(dl_tbf, false, imsi());
dl_tbf->m_wait_confirm = 1;
}
} else
diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp
index dd24963..0ef3032 100644
--- a/src/tbf_dl.cpp
+++ b/src/tbf_dl.cpp
@@ -510,7 +510,7 @@ void gprs_rlcmac_dl_tbf::trigger_ass(struct gprs_rlcmac_tbf *old_tbf)
TBF_SET_ASS_ON(this, GPRS_RLCMAC_FLAG_CCCH, false);
/* send immediate assignment */
- bts->snd_dl_ass(this, 0, imsi());
+ bts->snd_dl_ass(this, false, imsi());
m_wait_confirm = 1;
}
}