[MERGED] osmo-bts[master]: trx/scheduler: Use integer math for TOA (Timing of Arrival)

2018-02-27 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: trx/scheduler: Use integer math for TOA (Timing of Arrival)
..


trx/scheduler: Use integer math for TOA (Timing of Arrival)

There's no need to express TOA as a float:
* We receive it as signed 16bit integer in units 1/256 symbol periods
* We pass it to L1SAP as signed integer in 1/4 symbol periods

So turn it into an int16_t with 1/256 symbol period accuracy throughout
the code to avoid both float arithmetic as well as loosing any precision.

Change-Id: Idce4178e0b1f7e940ebc22b3e2f340fcd544d4ec
---
M include/osmo-bts/scheduler.h
M include/osmo-bts/scheduler_backend.h
M src/common/scheduler.c
M src/osmo-bts-trx/l1_if.c
M src/osmo-bts-trx/l1_if.h
M src/osmo-bts-trx/loops.c
M src/osmo-bts-trx/loops.h
M src/osmo-bts-trx/scheduler_trx.c
M src/osmo-bts-trx/trx_if.c
M src/osmo-bts-virtual/scheduler_virtbts.c
10 files changed, 74 insertions(+), 71 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/include/osmo-bts/scheduler.h b/include/osmo-bts/scheduler.h
index 4d34315..98f38d3 100644
--- a/include/osmo-bts/scheduler.h
+++ b/include/osmo-bts/scheduler.h
@@ -75,7 +75,7 @@
uint8_t rssi_num;   /* number of RSSI values */
float   rssi_sum;   /* sum of RSSI values */
uint8_t toa_num;/* number of TOA values */
-   float   toa_sum;/* sum of TOA values */
+   int32_t toa256_sum; /* sum of TOA values (1/256 
symbol) */
 
/* loss detection */
uint8_t lost;   /* (SACCH) loss detection */
@@ -113,7 +113,7 @@
int rssi_count; /* received RSSI values */
int rssi_valid_count; /* number of stored value */
int rssi_got_burst; /* any burst received so far */
-   float   toa_sum;/* sum of TOA values */
+   int32_t toa256_sum; /* sum of TOA values (1/256 
symbol) */
int toa_num;/* number of TOA value */
} meas;
 
@@ -165,7 +165,7 @@
 
 /*! \brief handle an UL burst received by PHY */
 int trx_sched_ul_burst(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn,
-sbit_t *bits, uint16_t nbits, int8_t rssi, float toa);
+sbit_t *bits, uint16_t nbits, int8_t rssi, int16_t toa);
 
 /*! \brief set multiframe scheduler to given physical channel config */
 int trx_sched_set_pchan(struct l1sched_trx *l1t, uint8_t tn,
diff --git a/include/osmo-bts/scheduler_backend.h 
b/include/osmo-bts/scheduler_backend.h
index 5e077ef..5f11f9b 100644
--- a/include/osmo-bts/scheduler_backend.h
+++ b/include/osmo-bts/scheduler_backend.h
@@ -16,7 +16,7 @@
 typedef int trx_sched_ul_func(struct l1sched_trx *l1t, uint8_t tn,
  uint32_t fn, enum trx_chan_type chan,
  uint8_t bid, sbit_t *bits, uint16_t nbits,
- int8_t rssi, float toa);
+ int8_t rssi, int16_t toa256);
 
 struct trx_chan_desc {
/*! \brief Is this on a PDCH (PS) ? */
@@ -74,19 +74,19 @@
enum trx_chan_type chan, uint8_t bid, uint16_t *nbits);
 int rx_rach_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn,
enum trx_chan_type chan, uint8_t bid, sbit_t *bits, uint16_t nbits,
-   int8_t rssi, float toa);
+   int8_t rssi, int16_t toa256);
 int rx_data_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn,
enum trx_chan_type chan, uint8_t bid, sbit_t *bits, uint16_t nbits,
-   int8_t rssi, float toa);
+   int8_t rssi, int16_t toa256);
 int rx_pdtch_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn,
enum trx_chan_type chan, uint8_t bid, sbit_t *bits, uint16_t nbits,
-   int8_t rssi, float toa);
+   int8_t rssi, int16_t toa256);
 int rx_tchf_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn,
enum trx_chan_type chan, uint8_t bid, sbit_t *bits, uint16_t nbits,
-   int8_t rssi, float toa);
+   int8_t rssi, int16_t toa256);
 int rx_tchh_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn,
enum trx_chan_type chan, uint8_t bid, sbit_t *bits, uint16_t nbits,
-   int8_t rssi, float toa);
+   int8_t rssi, int16_t toa256);
 
 const ubit_t *_sched_dl_burst(struct l1sched_trx *l1t, uint8_t tn,
  uint32_t fn, uint16_t *nbits);
diff --git a/src/common/scheduler.c b/src/common/scheduler.c
index e6cf541..edd99d2 100644
--- a/src/common/scheduler.c
+++ b/src/common/scheduler.c
@@ -846,7 +846,7 @@
 
 /* process uplink burst */
 int trx_sched_ul_burst(struct l1sched_trx *l1t, uint8_t tn, uint32_t 
current_fn,
-   sbit_t *bits, uint16_t nbits, int8_t rssi, float toa)
+   sbit_t *bits, uint16_t nbits, int8_t rssi, 

osmo-bts[master]: trx/scheduler: Use integer math for TOA (Timing of Arrival)

2018-02-27 Thread Harald Welte

Patch Set 3: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/6955
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Idce4178e0b1f7e940ebc22b3e2f340fcd544d4ec
Gerrit-PatchSet: 3
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-HasComments: No


[PATCH] osmo-bts[master]: trx/scheduler: Use integer math for TOA (Timing of Arrival)

2018-02-27 Thread Harald Welte
Hello Vadim Yanitskiy, Jenkins Builder,

I'd like you to reexamine a change.  Please visit

https://gerrit.osmocom.org/6955

to look at the new patch set (#3).

trx/scheduler: Use integer math for TOA (Timing of Arrival)

There's no need to express TOA as a float:
* We receive it as signed 16bit integer in units 1/256 symbol periods
* We pass it to L1SAP as signed integer in 1/4 symbol periods

So turn it into an int16_t with 1/256 symbol period accuracy throughout
the code to avoid both float arithmetic as well as loosing any precision.

Change-Id: Idce4178e0b1f7e940ebc22b3e2f340fcd544d4ec
---
M include/osmo-bts/scheduler.h
M include/osmo-bts/scheduler_backend.h
M src/common/scheduler.c
M src/osmo-bts-trx/l1_if.c
M src/osmo-bts-trx/l1_if.h
M src/osmo-bts-trx/loops.c
M src/osmo-bts-trx/loops.h
M src/osmo-bts-trx/scheduler_trx.c
M src/osmo-bts-trx/trx_if.c
M src/osmo-bts-virtual/scheduler_virtbts.c
10 files changed, 74 insertions(+), 71 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/55/6955/3

diff --git a/include/osmo-bts/scheduler.h b/include/osmo-bts/scheduler.h
index 4d34315..98f38d3 100644
--- a/include/osmo-bts/scheduler.h
+++ b/include/osmo-bts/scheduler.h
@@ -75,7 +75,7 @@
uint8_t rssi_num;   /* number of RSSI values */
float   rssi_sum;   /* sum of RSSI values */
uint8_t toa_num;/* number of TOA values */
-   float   toa_sum;/* sum of TOA values */
+   int32_t toa256_sum; /* sum of TOA values (1/256 
symbol) */
 
/* loss detection */
uint8_t lost;   /* (SACCH) loss detection */
@@ -113,7 +113,7 @@
int rssi_count; /* received RSSI values */
int rssi_valid_count; /* number of stored value */
int rssi_got_burst; /* any burst received so far */
-   float   toa_sum;/* sum of TOA values */
+   int32_t toa256_sum; /* sum of TOA values (1/256 
symbol) */
int toa_num;/* number of TOA value */
} meas;
 
@@ -165,7 +165,7 @@
 
 /*! \brief handle an UL burst received by PHY */
 int trx_sched_ul_burst(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn,
-sbit_t *bits, uint16_t nbits, int8_t rssi, float toa);
+sbit_t *bits, uint16_t nbits, int8_t rssi, int16_t toa);
 
 /*! \brief set multiframe scheduler to given physical channel config */
 int trx_sched_set_pchan(struct l1sched_trx *l1t, uint8_t tn,
diff --git a/include/osmo-bts/scheduler_backend.h 
b/include/osmo-bts/scheduler_backend.h
index 5e077ef..5f11f9b 100644
--- a/include/osmo-bts/scheduler_backend.h
+++ b/include/osmo-bts/scheduler_backend.h
@@ -16,7 +16,7 @@
 typedef int trx_sched_ul_func(struct l1sched_trx *l1t, uint8_t tn,
  uint32_t fn, enum trx_chan_type chan,
  uint8_t bid, sbit_t *bits, uint16_t nbits,
- int8_t rssi, float toa);
+ int8_t rssi, int16_t toa256);
 
 struct trx_chan_desc {
/*! \brief Is this on a PDCH (PS) ? */
@@ -74,19 +74,19 @@
enum trx_chan_type chan, uint8_t bid, uint16_t *nbits);
 int rx_rach_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn,
enum trx_chan_type chan, uint8_t bid, sbit_t *bits, uint16_t nbits,
-   int8_t rssi, float toa);
+   int8_t rssi, int16_t toa256);
 int rx_data_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn,
enum trx_chan_type chan, uint8_t bid, sbit_t *bits, uint16_t nbits,
-   int8_t rssi, float toa);
+   int8_t rssi, int16_t toa256);
 int rx_pdtch_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn,
enum trx_chan_type chan, uint8_t bid, sbit_t *bits, uint16_t nbits,
-   int8_t rssi, float toa);
+   int8_t rssi, int16_t toa256);
 int rx_tchf_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn,
enum trx_chan_type chan, uint8_t bid, sbit_t *bits, uint16_t nbits,
-   int8_t rssi, float toa);
+   int8_t rssi, int16_t toa256);
 int rx_tchh_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn,
enum trx_chan_type chan, uint8_t bid, sbit_t *bits, uint16_t nbits,
-   int8_t rssi, float toa);
+   int8_t rssi, int16_t toa256);
 
 const ubit_t *_sched_dl_burst(struct l1sched_trx *l1t, uint8_t tn,
  uint32_t fn, uint16_t *nbits);
diff --git a/src/common/scheduler.c b/src/common/scheduler.c
index e6cf541..edd99d2 100644
--- a/src/common/scheduler.c
+++ b/src/common/scheduler.c
@@ -846,7 +846,7 @@
 
 /* process uplink burst */
 int trx_sched_ul_burst(struct l1sched_trx *l1t, uint8_t tn, uint32_t 
current_fn,
-   sbit_t *bits, uint16_t nbits, int8_t rssi, float toa)
+   sbit_t *bits, uint16_t nbits, int8_t rssi, int16_t toa256)
 {
struct l1sched_ts *l1ts = 

osmo-bts[master]: trx/scheduler: Use integer math for TOA (Timing of Arrival)

2018-02-27 Thread Vadim Yanitskiy

Patch Set 2: Code-Review+1

-- 
To view, visit https://gerrit.osmocom.org/6955
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Idce4178e0b1f7e940ebc22b3e2f340fcd544d4ec
Gerrit-PatchSet: 2
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-HasComments: No


osmo-bts[master]: trx/scheduler: Use integer math for TOA (Timing of Arrival)

2018-02-27 Thread Harald Welte

Patch Set 2:

(3 comments)

https://gerrit.osmocom.org/#/c/6955/2/src/osmo-bts-trx/scheduler_trx.c
File src/osmo-bts-trx/scheduler_trx.c:

Line 745:   toa *= 10;
> Should this part also be updated?
I thikn it can be removed.  For my patch, I will change it to toa256 *= 10 to 
not mix the two unrelated issues of changing float->int and the removal of this 
debugging (which can now be done much better with fake-trx.


Line 1060:  n_errors, n_bits_total, rssi, toa256);
> Just wondering, why don't we compute the AVG here?
you mean the average over all 4 bursts?  I have no idea why not. My patch 
simply changes float->int, and doesn't intend to change any logic. FEel free to 
create a patch or ticket for averaging.


https://gerrit.osmocom.org/#/c/6955/2/src/osmo-bts-trx/trx_if.c
File src/osmo-bts-trx/trx_if.c:

Line 523:   int16_t toa256 = 0;
> No need to init, it will be overwritten.
once again, I'm just changing the data type here and try to not make any other 
modifications.


-- 
To view, visit https://gerrit.osmocom.org/6955
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Idce4178e0b1f7e940ebc22b3e2f340fcd544d4ec
Gerrit-PatchSet: 2
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-HasComments: Yes


osmo-bts[master]: trx/scheduler: Use integer math for TOA (Timing of Arrival)

2018-02-27 Thread Vadim Yanitskiy

Patch Set 2: -Code-Review

-- 
To view, visit https://gerrit.osmocom.org/6955
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Idce4178e0b1f7e940ebc22b3e2f340fcd544d4ec
Gerrit-PatchSet: 2
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-HasComments: No


osmo-bts[master]: trx/scheduler: Use integer math for TOA (Timing of Arrival)

2018-02-27 Thread Vadim Yanitskiy

Patch Set 2: Code-Review+1

(3 comments)

The ToA computation logic looks a bit complicated in scheduler_trx.c.
Somewhere we calculate AVG, but for FACCH we don't. Somewhere we
multiply by 4, somewhere we divide by 256. Are you sure that
everything is correct?

I think it would be great to clarify and/or define macros
for such computations?

https://gerrit.osmocom.org/#/c/6955/2/src/osmo-bts-trx/scheduler_trx.c
File src/osmo-bts-trx/scheduler_trx.c:

Line 745:   toa *= 10;
Should this part also be updated?
And does anyone still use it?


Line 1060:  n_errors, n_bits_total, rssi, toa256);
Just wondering, why don't we compute the AVG here?


https://gerrit.osmocom.org/#/c/6955/2/src/osmo-bts-trx/trx_if.c
File src/osmo-bts-trx/trx_if.c:

Line 523:   int16_t toa256 = 0;
No need to init, it will be overwritten.


-- 
To view, visit https://gerrit.osmocom.org/6955
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Idce4178e0b1f7e940ebc22b3e2f340fcd544d4ec
Gerrit-PatchSet: 2
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-HasComments: Yes


[PATCH] osmo-bts[master]: trx/scheduler: Use integer math for TOA (Timing of Arrival)

2018-02-27 Thread Harald Welte
Hello Jenkins Builder,

I'd like you to reexamine a change.  Please visit

https://gerrit.osmocom.org/6955

to look at the new patch set (#2).

trx/scheduler: Use integer math for TOA (Timing of Arrival)

There's no need to express TOA as a float:
* We receive it as signed 16bit integer in units 1/256 symbol periods
* We pass it to L1SAP as signed integer in 1/4 symbol periods

So turn it into an int16_t with 1/256 symbol period accuracy throughout
the code to avoid both float arithmetic as well as loosing any precision.

Change-Id: Idce4178e0b1f7e940ebc22b3e2f340fcd544d4ec
---
M include/osmo-bts/scheduler.h
M include/osmo-bts/scheduler_backend.h
M src/common/scheduler.c
M src/osmo-bts-trx/l1_if.c
M src/osmo-bts-trx/l1_if.h
M src/osmo-bts-trx/loops.c
M src/osmo-bts-trx/loops.h
M src/osmo-bts-trx/scheduler_trx.c
M src/osmo-bts-trx/trx_if.c
M src/osmo-bts-virtual/scheduler_virtbts.c
10 files changed, 73 insertions(+), 70 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/55/6955/2

diff --git a/include/osmo-bts/scheduler.h b/include/osmo-bts/scheduler.h
index 4d34315..98f38d3 100644
--- a/include/osmo-bts/scheduler.h
+++ b/include/osmo-bts/scheduler.h
@@ -75,7 +75,7 @@
uint8_t rssi_num;   /* number of RSSI values */
float   rssi_sum;   /* sum of RSSI values */
uint8_t toa_num;/* number of TOA values */
-   float   toa_sum;/* sum of TOA values */
+   int32_t toa256_sum; /* sum of TOA values (1/256 
symbol) */
 
/* loss detection */
uint8_t lost;   /* (SACCH) loss detection */
@@ -113,7 +113,7 @@
int rssi_count; /* received RSSI values */
int rssi_valid_count; /* number of stored value */
int rssi_got_burst; /* any burst received so far */
-   float   toa_sum;/* sum of TOA values */
+   int32_t toa256_sum; /* sum of TOA values (1/256 
symbol) */
int toa_num;/* number of TOA value */
} meas;
 
@@ -165,7 +165,7 @@
 
 /*! \brief handle an UL burst received by PHY */
 int trx_sched_ul_burst(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn,
-sbit_t *bits, uint16_t nbits, int8_t rssi, float toa);
+sbit_t *bits, uint16_t nbits, int8_t rssi, int16_t toa);
 
 /*! \brief set multiframe scheduler to given physical channel config */
 int trx_sched_set_pchan(struct l1sched_trx *l1t, uint8_t tn,
diff --git a/include/osmo-bts/scheduler_backend.h 
b/include/osmo-bts/scheduler_backend.h
index 5e077ef..5f11f9b 100644
--- a/include/osmo-bts/scheduler_backend.h
+++ b/include/osmo-bts/scheduler_backend.h
@@ -16,7 +16,7 @@
 typedef int trx_sched_ul_func(struct l1sched_trx *l1t, uint8_t tn,
  uint32_t fn, enum trx_chan_type chan,
  uint8_t bid, sbit_t *bits, uint16_t nbits,
- int8_t rssi, float toa);
+ int8_t rssi, int16_t toa256);
 
 struct trx_chan_desc {
/*! \brief Is this on a PDCH (PS) ? */
@@ -74,19 +74,19 @@
enum trx_chan_type chan, uint8_t bid, uint16_t *nbits);
 int rx_rach_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn,
enum trx_chan_type chan, uint8_t bid, sbit_t *bits, uint16_t nbits,
-   int8_t rssi, float toa);
+   int8_t rssi, int16_t toa256);
 int rx_data_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn,
enum trx_chan_type chan, uint8_t bid, sbit_t *bits, uint16_t nbits,
-   int8_t rssi, float toa);
+   int8_t rssi, int16_t toa256);
 int rx_pdtch_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn,
enum trx_chan_type chan, uint8_t bid, sbit_t *bits, uint16_t nbits,
-   int8_t rssi, float toa);
+   int8_t rssi, int16_t toa256);
 int rx_tchf_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn,
enum trx_chan_type chan, uint8_t bid, sbit_t *bits, uint16_t nbits,
-   int8_t rssi, float toa);
+   int8_t rssi, int16_t toa256);
 int rx_tchh_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn,
enum trx_chan_type chan, uint8_t bid, sbit_t *bits, uint16_t nbits,
-   int8_t rssi, float toa);
+   int8_t rssi, int16_t toa256);
 
 const ubit_t *_sched_dl_burst(struct l1sched_trx *l1t, uint8_t tn,
  uint32_t fn, uint16_t *nbits);
diff --git a/src/common/scheduler.c b/src/common/scheduler.c
index e6cf541..edd99d2 100644
--- a/src/common/scheduler.c
+++ b/src/common/scheduler.c
@@ -846,7 +846,7 @@
 
 /* process uplink burst */
 int trx_sched_ul_burst(struct l1sched_trx *l1t, uint8_t tn, uint32_t 
current_fn,
-   sbit_t *bits, uint16_t nbits, int8_t rssi, float toa)
+   sbit_t *bits, uint16_t nbits, int8_t rssi, int16_t toa256)
 {
struct l1sched_ts *l1ts = 

[PATCH] osmo-bts[master]: trx/scheduler: Use integer math for TOA (Timing of Arrival)

2018-02-26 Thread Harald Welte

Review at  https://gerrit.osmocom.org/6955

trx/scheduler: Use integer math for TOA (Timing of Arrival)

There's no need to express TOA as a float:
* We receive it as signed 16bit integer in units 1/256 symbol periods
* We pass it to L1SAP as signed integer in 1/4 symbol periods

So turn it into an int16_t with 1/256 symbol period accuracy throughout
the code to avoid both float arithmetic as well as loosing any precision.

Change-Id: Idce4178e0b1f7e940ebc22b3e2f340fcd544d4ec
---
M include/osmo-bts/scheduler.h
M include/osmo-bts/scheduler_backend.h
M src/common/scheduler.c
M src/osmo-bts-trx/l1_if.c
M src/osmo-bts-trx/l1_if.h
M src/osmo-bts-trx/loops.c
M src/osmo-bts-trx/loops.h
M src/osmo-bts-trx/scheduler_trx.c
M src/osmo-bts-trx/trx_if.c
M src/osmo-bts-virtual/scheduler_virtbts.c
10 files changed, 73 insertions(+), 70 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/55/6955/1

diff --git a/include/osmo-bts/scheduler.h b/include/osmo-bts/scheduler.h
index 4d34315..98f38d3 100644
--- a/include/osmo-bts/scheduler.h
+++ b/include/osmo-bts/scheduler.h
@@ -75,7 +75,7 @@
uint8_t rssi_num;   /* number of RSSI values */
float   rssi_sum;   /* sum of RSSI values */
uint8_t toa_num;/* number of TOA values */
-   float   toa_sum;/* sum of TOA values */
+   int32_t toa256_sum; /* sum of TOA values (1/256 
symbol) */
 
/* loss detection */
uint8_t lost;   /* (SACCH) loss detection */
@@ -113,7 +113,7 @@
int rssi_count; /* received RSSI values */
int rssi_valid_count; /* number of stored value */
int rssi_got_burst; /* any burst received so far */
-   float   toa_sum;/* sum of TOA values */
+   int32_t toa256_sum; /* sum of TOA values (1/256 
symbol) */
int toa_num;/* number of TOA value */
} meas;
 
@@ -165,7 +165,7 @@
 
 /*! \brief handle an UL burst received by PHY */
 int trx_sched_ul_burst(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn,
-sbit_t *bits, uint16_t nbits, int8_t rssi, float toa);
+sbit_t *bits, uint16_t nbits, int8_t rssi, int16_t toa);
 
 /*! \brief set multiframe scheduler to given physical channel config */
 int trx_sched_set_pchan(struct l1sched_trx *l1t, uint8_t tn,
diff --git a/include/osmo-bts/scheduler_backend.h 
b/include/osmo-bts/scheduler_backend.h
index 5e077ef..5f11f9b 100644
--- a/include/osmo-bts/scheduler_backend.h
+++ b/include/osmo-bts/scheduler_backend.h
@@ -16,7 +16,7 @@
 typedef int trx_sched_ul_func(struct l1sched_trx *l1t, uint8_t tn,
  uint32_t fn, enum trx_chan_type chan,
  uint8_t bid, sbit_t *bits, uint16_t nbits,
- int8_t rssi, float toa);
+ int8_t rssi, int16_t toa256);
 
 struct trx_chan_desc {
/*! \brief Is this on a PDCH (PS) ? */
@@ -74,19 +74,19 @@
enum trx_chan_type chan, uint8_t bid, uint16_t *nbits);
 int rx_rach_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn,
enum trx_chan_type chan, uint8_t bid, sbit_t *bits, uint16_t nbits,
-   int8_t rssi, float toa);
+   int8_t rssi, int16_t toa256);
 int rx_data_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn,
enum trx_chan_type chan, uint8_t bid, sbit_t *bits, uint16_t nbits,
-   int8_t rssi, float toa);
+   int8_t rssi, int16_t toa256);
 int rx_pdtch_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn,
enum trx_chan_type chan, uint8_t bid, sbit_t *bits, uint16_t nbits,
-   int8_t rssi, float toa);
+   int8_t rssi, int16_t toa256);
 int rx_tchf_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn,
enum trx_chan_type chan, uint8_t bid, sbit_t *bits, uint16_t nbits,
-   int8_t rssi, float toa);
+   int8_t rssi, int16_t toa256);
 int rx_tchh_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn,
enum trx_chan_type chan, uint8_t bid, sbit_t *bits, uint16_t nbits,
-   int8_t rssi, float toa);
+   int8_t rssi, int16_t toa256);
 
 const ubit_t *_sched_dl_burst(struct l1sched_trx *l1t, uint8_t tn,
  uint32_t fn, uint16_t *nbits);
diff --git a/src/common/scheduler.c b/src/common/scheduler.c
index e6cf541..edd99d2 100644
--- a/src/common/scheduler.c
+++ b/src/common/scheduler.c
@@ -846,7 +846,7 @@
 
 /* process uplink burst */
 int trx_sched_ul_burst(struct l1sched_trx *l1t, uint8_t tn, uint32_t 
current_fn,
-   sbit_t *bits, uint16_t nbits, int8_t rssi, float toa)
+   sbit_t *bits, uint16_t nbits, int8_t rssi, int16_t toa256)
 {
struct l1sched_ts *l1ts = l1sched_trx_get_ts(l1t, tn);
struct l1sched_chan_state *l1cs;
@@ -907,7 +907,7 @@