path: root/src/pcu_l1_if.h
diff options
authorAndreas Eversberg <jolly@eversberg.eu>2012-06-23 10:33:16 +0200
committerAndreas Eversberg <jolly@eversberg.eu>2012-06-23 10:33:16 +0200
commit0aed654ac735749be31e4119336808596136aac3 (patch)
tree3c43968af08245576fa42198814347700dd978b8 /src/pcu_l1_if.h
parentf6b7ca5dd4ba93c13307313c61f06509645b6bca (diff)
Split of L1 interface to be used with OpenBTS or sysmo-BTS
The OpenBTS socket functions are moved from main to pcu_l1_if.cpp. New sysmo_l1_if.cpp is introduced. It used special unix socket interface to connect to sysmo-BTS. This is required to access CCCH/RACH and info about cell layout. Traffic is also forwarded via this interface, but it direct access of L1 baseband DSP will be added soon. In order to handle ready-to-send requests above l1_if, the transmit queue (for downlink blocks) is moved to gprs_rlcmac.cpp. The TBF instance additionally holds TRX and TS info, but this is only a hack currently. TBF instance requires more details about allocated ressources in the future.
Diffstat (limited to 'src/pcu_l1_if.h')
1 files changed, 20 insertions, 37 deletions
diff --git a/src/pcu_l1_if.h b/src/pcu_l1_if.h
index efe533e7..241f4943 100644
--- a/src/pcu_l1_if.h
+++ b/src/pcu_l1_if.h
@@ -20,58 +20,41 @@
#ifndef PCU_L1_IF_H
#define PCU_L1_IF_H
-#include <bitvector.h>
-#include <gsmL1prim.h>
-#include <sys/socket.h>
+#include <stdint.h>
extern "C" {
#include <osmocom/core/write_queue.h>
#include <osmocom/core/socket.h>
#include <osmocom/core/timer.h>
+#include <osmocom/core/bitvec.h>
#include <osmocom/gsm/gsm_utils.h>
-#define msgb_l1prim(msg) ((GsmL1_Prim_t *)(msg)->l1h)
-struct femtol1_hdl {
- struct gsm_time gsm_time;
- uint32_t hLayer1; /* handle to the L1 instance in the DSP */
- uint32_t dsp_trace_f;
- uint16_t clk_cal;
- struct llist_head wlc_list;
- void *priv; /* user reference */
- struct osmo_timer_list alive_timer;
- unsigned int alive_prim_cnt;
- struct osmo_fd read_ofd; /* osmo file descriptors */
- struct osmo_wqueue write_q;
- struct {
- uint16_t arfcn;
- uint8_t tn;
- uint8_t tsc;
- uint16_t ta;
- } channel_info;
+struct pcu_l1if_ts {
+ uint8_t enable;
+ uint8_t tsc;
-struct l1fwd_hdl {
- struct sockaddr_storage remote_sa;
- socklen_t remote_sa_len;
- struct osmo_wqueue udp_wq;
+struct pcu_l1if_trx {
+ uint16_t arfcn;
+ struct pcu_l1if_ts ts[8];
- struct femtol1_hdl *fl1h;
+struct pcu_l1if_bts {
+ struct pcu_l1if_trx trx[8];
-extern struct l1fwd_hdl *l1fh;
+extern struct pcu_l1if_bts pcu_l1if_bts;
int get_current_fn();
+void set_current_fn(int fn);
-void pcu_l1if_tx(bitvec * block, GsmL1_Sapi_t sapi, int len = 23);
+void pcu_l1if_tx_pdtch(msgb *msg, uint8_t trx, uint8_t ts, uint16_t arfcn,
+ uint32_t fn, uint8_t block_nr);
+void pcu_l1if_tx_ptcch(msgb *msg, uint8_t trx, uint8_t ts, uint16_t arfcn,
+ uint32_t fn, uint8_t block_nr);
+void pcu_l1if_tx_agch(bitvec * block, int len);
-int pcu_l1if_handle_l1prim(struct femtol1_hdl *fl1h, struct msgb *msg);
+int pcu_l1if_open(void);
+void pcu_l1if_close(void);
#endif // PCU_L1_IF_H