aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2016-10-10 13:17:01 +0200
committerHarald Welte <laforge@gnumonks.org>2016-10-12 09:30:06 +0000
commit4ca5be766cb139eccb9798a0237cc32ae59617d9 (patch)
tree5b4743ba9484c1f106628c39c4a9348d73f31bba
parent9f9b96a67bd1a4c3aa4180822e65de0a98572227 (diff)
Move copy-pasted array into shared header
-rw-r--r--include/osmo-bts/l1sap.h8
-rw-r--r--src/common/l1sap.c6
-rw-r--r--src/osmo-bts-litecell15/l1_if.c6
-rw-r--r--src/osmo-bts-sysmo/l1_if.c6
4 files changed, 8 insertions, 18 deletions
diff --git a/include/osmo-bts/l1sap.h b/include/osmo-bts/l1sap.h
index 981cd756..77bfbaa0 100644
--- a/include/osmo-bts/l1sap.h
+++ b/include/osmo-bts/l1sap.h
@@ -1,6 +1,8 @@
#ifndef L1SAP_H
#define L1SAP_H
+#include <osmocom/gsm/protocol/gsm_04_08.h>
+
/* timeslot and subslot from chan_nr */
#define L1SAP_CHAN2TS(chan_nr) (chan_nr & 7)
#define L1SAP_CHAN2SS_TCHH(chan_nr) ((chan_nr >> 3) & 1)
@@ -28,6 +30,12 @@
#define L1SAP_FN2PTCCHBLOCK(fn) ((fn / 104) & 3)
#define L1SAP_IS_PTCCH(fn) ((fn % 52) == 12)
+static const uint8_t fill_frame[GSM_MACBLOCK_LEN] = {
+ 0x03, 0x03, 0x01, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B,
+ 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B,
+ 0x2B, 0x2B, 0x2B
+};
+
/* subslot from any chan_nr */
static inline uint8_t l1sap_chan2ss(uint8_t chan_nr)
{
diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index dd34d804..dd234eec 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -86,12 +86,6 @@ static uint32_t fn_ms_adj(uint32_t fn, uint32_t last_fn)
return GSM_RTP_DURATION;
}
-static const uint8_t fill_frame[GSM_MACBLOCK_LEN] = {
- 0x03, 0x03, 0x01, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B,
- 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B,
- 0x2B, 0x2B, 0x2B
-};
-
/* allocate a msgb containing a osmo_phsap_prim + optional l2 data
* in order to wrap femtobts header arround l2 data, there must be enough space
* in front and behind data pointer */
diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c
index a4378c15..1c989518 100644
--- a/src/osmo-bts-litecell15/l1_if.c
+++ b/src/osmo-bts-litecell15/l1_if.c
@@ -286,12 +286,6 @@ empty_req_from_rts_ind(GsmL1_Prim_t *l1p,
return empty_req;
}
-static const uint8_t fill_frame[GSM_MACBLOCK_LEN] = {
- 0x03, 0x03, 0x01, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B,
- 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B,
- 0x2B, 0x2B, 0x2B
-};
-
/* fill PH-DATA.req from l1sap primitive */
static GsmL1_PhDataReq_t *
data_req_from_l1sap(GsmL1_Prim_t *l1p, struct lc15l1_hdl *fl1,
diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c
index 09627af6..11a57291 100644
--- a/src/osmo-bts-sysmo/l1_if.c
+++ b/src/osmo-bts-sysmo/l1_if.c
@@ -281,12 +281,6 @@ empty_req_from_rts_ind(GsmL1_Prim_t *l1p,
return empty_req;
}
-static const uint8_t fill_frame[GSM_MACBLOCK_LEN] = {
- 0x03, 0x03, 0x01, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B,
- 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B,
- 0x2B, 0x2B, 0x2B
-};
-
/* fill PH-DATA.req from l1sap primitive */
static GsmL1_PhDataReq_t *
data_req_from_l1sap(GsmL1_Prim_t *l1p, struct femtol1_hdl *fl1,