Change in osmo-bsc[master]: hodec2: [2/2] implement automatic choice between FULL and SUBSET meas...

fixeria gerrit-no-reply at lists.osmocom.org
Tue Jul 6 00:18:35 UTC 2021


fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/24851 )

Change subject: hodec2: [2/2] implement automatic choice between FULL and SUBSET measurements
......................................................................


Patch Set 2:

(1 comment)

https://gerrit.osmocom.org/c/osmo-bsc/+/24851/2/src/osmo-bsc/meas_rep.c 
File src/osmo-bsc/meas_rep.c:

https://gerrit.osmocom.org/c/osmo-bsc/+/24851/2/src/osmo-bsc/meas_rep.c@120 
PS2, Line 120: 	return map[field][dir][set];
I would implement this function in a different way:

  bool full = (set == TDMA_MEAS_SET_FULL);
  if (set == TDMA_MEAS_SET_AUTO) {
    const uint8_t mask = (dir == TDMA_MEAS_DIR_UL) ?
      MEAS_REP_F_UL_DTX : MEAS_REP_F_DL_DTX;
    full = (meas_rep->flags & mask) != mask;
  }

  #define MUX(dir, field) \
    ((dir << 8) | field)

  switch(MUX(dir, field)) {
  case MUX(TDMA_MEAS_DIR_UL, TDMA_MEAS_FIELD_RXLEV):
    return full ? MEAS_REP_UL_RXLEV_FULL : MEAS_REP_UL_RXLEV_SUB;
  case MUX(TDMA_MEAS_DIR_DL, TDMA_MEAS_FIELD_RXLEV):
    return full ? MEAS_REP_DL_RXLEV_FULL : MEAS_REP_DL_RXLEV_SUB;
  case MUX(TDMA_MEAS_DIR_UL, TDMA_MEAS_FIELD_RXQUAL):
    return full ? MEAS_REP_UL_RXQUAL_FULL : MEAS_REP_UL_RXQUAL_SUB;
  case MUX(TDMA_MEAS_DIR_DL, TDMA_MEAS_FIELD_RXQUAL):
    return full ? MEAS_REP_DL_RXQUAL_FULL : MEAS_REP_DL_RXQUAL_SUB;
  default:
    ASSERT(0);
  }

  #undef MUX

P.S. Does not mean that you have to refactor it, just suggesting a possible approach.



-- 
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/24851
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I67dce55ccf892c8679272ee5dfedc25620f0f725
Gerrit-Change-Number: 24851
Gerrit-PatchSet: 2
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr at sysmocom.de>
Gerrit-Comment-Date: Tue, 06 Jul 2021 00:18:35 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210706/434cf6e1/attachment.htm>


More information about the gerrit-log mailing list