Fix Timing Advance handling

* initialize with invalid TA instead of making assumption that phone is
  located within 550 meters (TA=0)
* only set valid TA

Change-Id: Idfc40ff0c11bdac13d9e28fbfa4e95dfc6b735b0
Related: OS#1526
diff --git a/src/sba.cpp b/src/sba.cpp
index 6aeeb7c..46c1431 100644
--- a/src/sba.cpp
+++ b/src/sba.cpp
@@ -26,6 +26,7 @@
 
 extern "C" {
 #include <osmocom/core/talloc.h>
+#include <osmocom/gsm/protocol/gsm_04_08.h>
 }
 
 #include <errno.h>
@@ -55,6 +56,9 @@
 	if (!sba)
 		return -ENOMEM;
 
+	if (!gsm48_ta_is_valid(ta))
+		return -EINVAL;
+
 	for (trx = 0; trx < 8; trx++) {
 		for (ts = 7; ts >= 0; ts--) {
 			pdch = &m_bts.bts_data()->trx[trx].pdch[ts];