This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
Max gerrit-no-reply at lists.osmocom.orgMax has uploaded this change for review. ( https://gerrit.osmocom.org/12948
Change subject: Clarify write_immediate_assignment() signature
......................................................................
Clarify write_immediate_assignment() signature
* remove unused variable
* use bool for boolean types
* add clarification comments
Change-Id: I363445063e2d873d9194b2a5924b9e59b8b7ea53
---
M src/bts.cpp
M src/bts.h
M src/encoding.cpp
M src/encoding.h
M src/tbf.cpp
M src/tbf_dl.cpp
6 files changed, 20 insertions(+), 22 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/48/12948/1
diff --git a/src/bts.cpp b/src/bts.cpp
index b6d0d0c..f421e2c 100644
--- a/src/bts.cpp
+++ b/src/bts.cpp
@@ -774,11 +774,10 @@
" - 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 than 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 @@
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 @@
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 @@
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 1f96458..29a62e7 100644
--- a/src/encoding.cpp
+++ b/src/encoding.cpp
@@ -91,7 +91,7 @@
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) {
@@ -343,10 +343,10 @@
*/
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 @@
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 @@
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 @@
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;
}
}
--
To view, visit https://gerrit.osmocom.org/12948
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I363445063e2d873d9194b2a5924b9e59b8b7ea53
Gerrit-Change-Number: 12948
Gerrit-PatchSet: 1
Gerrit-Owner: Max <msuraev at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190218/fe3a69db/attachment.htm>