This patch is first of series of patches to support 11 bit RACH. This includes interface structure changes between osmo-pcu and osmo-bts to support 11 bit RACH.Processing of 11 bit RACH for GPRS is added in bts.cpp. Unit test for the same shall be sent as separate patch. EGPRS PACKET CHANNEL REQUEST is not part of this patch.Note also that this feature requires changes in osmo-bts and versioning needs to be addressed further. --- src/bts.cpp | 36 +++++++++++++++++++++++++++--------- src/bts.h | 9 ++++++++- src/pcu_l1_if.cpp | 2 +- src/pcuif_proto.h | 3 ++- 4 files changed, 38 insertions(+), 12 deletions(-)
diff --git a/src/bts.cpp b/src/bts.cpp index 715fb51..a999c48 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -459,7 +459,7 @@ int BTS::rcv_imm_ass_cnf(const uint8_t *data, uint32_t fn) return 0; }
-int BTS::rcv_rach(uint8_t ra, uint32_t Fn, int16_t qta) +int BTS::rcv_rach(uint16_t ra, uint32_t Fn, int16_t qta, uint8_t rach_type) { struct gprs_rlcmac_ul_tbf *tbf = NULL; uint8_t trx_no, ts_no = 0; @@ -475,14 +475,32 @@ int BTS::rcv_rach(uint8_t ra, uint32_t Fn, int16_t qta)
LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF on RACH, so we provide " "one:\n"); - if ((ra & 0xf8) == 0x70) { - LOGP(DRLCMAC, LOGL_DEBUG, "MS requests single block " - "allocation\n"); - sb = 1; - } else if (m_bts.force_two_phase) { - LOGP(DRLCMAC, LOGL_DEBUG, "MS requests single phase access, " - "but we force two phase access\n"); - sb = 1; + + if (rach_type == GPRS_8_BIT_RACH ) { + if ((ra & 0xf8) == 0x70) { + LOGP(DRLCMAC, LOGL_DEBUG, "MS requests single block " + "allocation\n"); + sb = 1; + } else if (m_bts.force_two_phase) { + LOGP(DRLCMAC, LOGL_DEBUG, "MS requests single phase access, " + "but we force two phase access\n"); + sb = 1; + } + + } else if(rach_type == GPRS_11_BIT_RACH ) { + if((ra & RACH_CAUSE_SINGLE_BLOCK) == 0x0600) { + LOGP(DRLCMAC, LOGL_DEBUG, "11 bit RACH received.MS requests single block " + "allocation\n"); + sb = 1; + + } else if (m_bts.force_two_phase) { + LOGP(DRLCMAC, LOGL_DEBUG, "11 bit RACHreceived.MS requests single phase access, " + "but we force two phase access\n"); + sb = 1; + } + } else if (rach_type == EGPRS_11_BIT_RACH) { + /*TODO*/ + } if (qta < 0) qta = 0; diff --git a/src/bts.h b/src/bts.h index c975304..870e6f3 100644 --- a/src/bts.h +++ b/src/bts.h @@ -41,6 +41,7 @@ extern "C" {
#define LLC_CODEL_DISABLE 0 #define LLC_CODEL_USE_DEFAULT (-1) +#define RACH_CAUSE_SINGLE_BLOCK ((~((~0) << 6)) << 5) /* Establish cause */
struct BTS; struct GprsMs; @@ -251,6 +252,12 @@ public: TIMER_T3190_MSEC = 5000, };
+ enum { + GPRS_8_BIT_RACH = 0, + GPRS_11_BIT_RACH = 1, + EGPRS_11_BIT_RACH = 2, + }; + BTS(); ~BTS();
@@ -275,7 +282,7 @@ public: int tfi_find_free(enum gprs_rlcmac_tbf_direction dir, uint8_t *_trx, int8_t use_trx);
int rcv_imm_ass_cnf(const uint8_t *data, uint32_t fn); - int rcv_rach(uint8_t ra, uint32_t Fn, int16_t qta); + int rcv_rach(uint16_t ra, uint32_t Fn, int16_t qta, uint8_t rach_type = 0);
void trigger_dl_ass(gprs_rlcmac_dl_tbf *tbf, gprs_rlcmac_tbf *old_tbf); void snd_dl_ass(gprs_rlcmac_tbf *tbf, uint8_t poll, const char *imsi); diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp index 19dda5c..d937d20 100644 --- a/src/pcu_l1_if.cpp +++ b/src/pcu_l1_if.cpp @@ -313,7 +313,7 @@ static int pcu_rx_rach_ind(struct gsm_pcu_if_rach_ind *rach_ind) case PCU_IF_SAPI_RACH: rc = BTS::main_bts()->rcv_rach( rach_ind->ra, rach_ind->fn, - rach_ind->qta); + rach_ind->qta,rach_ind->rach_type); break; default: LOGP(DL1IF, LOGL_ERROR, "Received PCU rach request with " diff --git a/src/pcuif_proto.h b/src/pcuif_proto.h index 9d740ac..0844183 100644 --- a/src/pcuif_proto.h +++ b/src/pcuif_proto.h @@ -64,10 +64,11 @@ struct gsm_pcu_if_rts_req {
struct gsm_pcu_if_rach_ind { uint8_t sapi; - uint8_t ra; + uint16_t ra; int16_t qta; uint32_t fn; uint16_t arfcn; + uint8_t rach_type; } __attribute__ ((packed));
struct gsm_pcu_if_info_trx {
On 08 Mar 2016, at 14:15, Bhargava Abhyankar Bhargava.Abhyankar@radisys.com wrote:
Dear Bhargava,
This patch is first of series of patches to support 11 bit RACH. This includes interface structure changes between osmo-pcu and osmo-bts to support 11 bit RACH.Processing of 11 bit RACH for GPRS is added in bts.cpp. Unit test for the same shall be sent as separate patch. EGPRS PACKET CHANNEL REQUEST is not part of this patch.Note also that this feature requires changes in osmo-bts and versioning needs to be addressed further.
could you start by sending a patch for both osmo-bts and osmo-pcu to modify the pcuif_proto.h with the new protocol and the version number increase and osmo-bts to set it as GPRS_8_BIT_RACH (to match current behavior if that makes sense)?
src/bts.cpp | 36 +++++++++++++++++++++++++++--------- src/bts.h | 9 ++++++++- src/pcu_l1_if.cpp | 2 +- src/pcuif_proto.h | 3 ++- 4 files changed, 38 insertions(+), 12 deletions(-)
diff --git a/src/bts.cpp b/src/bts.cpp index 715fb51..a999c48 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -459,7 +459,7 @@ int BTS::rcv_imm_ass_cnf(const uint8_t *data, uint32_t fn) return 0; }
-int BTS::rcv_rach(uint8_t ra, uint32_t Fn, int16_t qta) +int BTS::rcv_rach(uint16_t ra, uint32_t Fn, int16_t qta, uint8_t rach_type) {
- } else if(rach_type == GPRS_11_BIT_RACH ) {
if((ra & RACH_CAUSE_SINGLE_BLOCK) == 0x0600) {
please have a look at the Linux Kernel CodingStyle guidelines about necessary spaces between the if keyword and the opening parenthesis.
In terms of style, could you move the code that select the 'sb' into a separate (static inline) helper function. Not that we do it right now but in general this allows us to unit test such things more easily.
- } else if (rach_type == EGPRS_11_BIT_RACH) {
/*TODO*/
Do you think a log message is necessary here? Also in terms of TODO, maybe describe what someone in the future should put there?
kind regards holger
Hello holger, Thanks for your comments. We see that in latest osmo-bts, PCU_IF_VERSION is defined as 0x06 whereas in latest osmo-pcu, it is defined as 0x05. Let us know the value to be taken for 11 bit RACH support.
Regards Bhargava Abhyankar
-----Original Message----- From: Holger Freyther [mailto:holger@freyther.de] Sent: Tuesday, March 08, 2016 11:12 PM To: Bhargava Abhyankar Bhargava.Abhyankar@radisys.com Cc: osmocom-net-gprs@lists.osmocom.org; Prasad Kaup Prasad.Kaup@radisys.com Subject: Re: [PATCH] Support of 11 bit RACH
On 08 Mar 2016, at 14:15, Bhargava Abhyankar Bhargava.Abhyankar@radisys.com wrote:
Dear Bhargava,
This patch is first of series of patches to support 11 bit RACH. This includes interface structure changes between osmo-pcu and osmo-bts to support 11 bit RACH.Processing of 11 bit RACH for GPRS is added in bts.cpp. Unit test for the same shall be sent as separate patch. EGPRS PACKET CHANNEL REQUEST is not part of this patch.Note also that this feature requires changes in osmo-bts and versioning needs to be addressed further.
could you start by sending a patch for both osmo-bts and osmo-pcu to modify the pcuif_proto.h with the new protocol and the version number increase and osmo-bts to set it as GPRS_8_BIT_RACH (to match current behavior if that makes sense)?
src/bts.cpp | 36 +++++++++++++++++++++++++++--------- src/bts.h | 9 ++++++++- src/pcu_l1_if.cpp | 2 +- src/pcuif_proto.h | 3 ++- 4 files changed, 38 insertions(+), 12 deletions(-)
diff --git a/src/bts.cpp b/src/bts.cpp index 715fb51..a999c48 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -459,7 +459,7 @@ int BTS::rcv_imm_ass_cnf(const uint8_t *data, uint32_t fn) return 0; }
-int BTS::rcv_rach(uint8_t ra, uint32_t Fn, int16_t qta) +int BTS::rcv_rach(uint16_t ra, uint32_t Fn, int16_t qta, uint8_t +rach_type) {
- } else if(rach_type == GPRS_11_BIT_RACH ) {
if((ra & RACH_CAUSE_SINGLE_BLOCK) == 0x0600) {
please have a look at the Linux Kernel CodingStyle guidelines about necessary spaces between the if keyword and the opening parenthesis.
In terms of style, could you move the code that select the 'sb' into a separate (static inline) helper function. Not that we do it right now but in general this allows us to unit test such things more easily.
- } else if (rach_type == EGPRS_11_BIT_RACH) {
/*TODO*/
Do you think a log message is necessary here? Also in terms of TODO, maybe describe what someone in the future should put there?
kind regards holger
Hi Bhargava,
On Thu, Mar 10, 2016 at 02:12:06PM +0000, Bhargava Abhyankar wrote:
We see that in latest osmo-bts, PCU_IF_VERSION is defined as 0x06 whereas in latest osmo-pcu, it is defined as 0x05.
I canno find 0x06 used in osmo-bts. On master, both bts and PCU are using 0x05. Can you please indicate which version/branch you ar using?
Let us know the value to be taken for 11 bit RACH support.
I would argue that you should bump to 0x07 on both sides if 0x06 was ever used anywhere. If 0x06 was not used (I couldn't find it), bump to 0x06.
Also if you really have seen different versions, it seems we need to cheeck if we really make sure that the version information is actually checked. Any different version should make the OsmoPCU start-up fail with a corresponding error message.
Regards, Harald
On 11 Mar 2016, at 11:54, Harald Welte laforge@gnumonks.org wrote:
We see that in latest osmo-bts, PCU_IF_VERSION is defined as 0x06 whereas in latest osmo-pcu, it is defined as 0x05.
I canno find 0x06 used in osmo-bts. On master, both bts and PCU are using 0x05. Can you please indicate which version/branch you ar using
look at the last commit i made. I bumped the version during review of Max's changes and then noticed it doesn't need to be bumped. When making the push I forgot to ammend the revert for the version number increase. As no packages has been built and the PCU was never upgraded, I moved back to 0x05 and think that 0x06 can be used for the 11bit RACH changes.
holger
Hello Holger,
The comments on 11 bit RACH support will be incorporated in next patches. We have identified below mentioned patches for the initial support of 11 bit RACH, and plan to release in series. Please give your feedback.
* Interface changes and versioning increment in osmo-pcu. * Interface changes and versioning increment in osmo-bts. * 11 bit RACH handling in osmo-pcu. * 11 bit RACH in osmo-bts. * EGPRS 11 bit RACH handling in osmo-pcu. * EGPRS 11 bit RACH handling in osmo-bts.
Thanks Bhargava Abhyankar
-----Original Message----- From: Holger Freyther [mailto:holger@freyther.de] Sent: Friday, March 11, 2016 4:43 PM To: Harald Welte laforge@gnumonks.org Cc: Bhargava Abhyankar Bhargava.Abhyankar@radisys.com; Prasad Kaup Prasad.Kaup@radisys.com; osmocom-net-gprs@lists.osmocom.org Subject: Re: [PATCH] Support of 11 bit RACH
On 11 Mar 2016, at 11:54, Harald Welte laforge@gnumonks.org wrote:
We see that in latest osmo-bts, PCU_IF_VERSION is defined as 0x06 whereas in latest osmo-pcu, it is defined as 0x05.
I canno find 0x06 used in osmo-bts. On master, both bts and PCU are using 0x05. Can you please indicate which version/branch you ar using
look at the last commit i made. I bumped the version during review of Max's changes and then noticed it doesn't need to be bumped. When making the push I forgot to ammend the revert for the version number increase. As no packages has been built and the PCU was never upgraded, I moved back to 0x05 and think that 0x06 can be used for the 11bit RACH changes.
holger
osmocom-net-gprs@lists.osmocom.org