From 0aed654ac735749be31e4119336808596136aac3 Mon Sep 17 00:00:00 2001 From: Andreas Eversberg Date: Sat, 23 Jun 2012 10:33:16 +0200 Subject: 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. --- src/pcu_l1_if.h | 57 ++++++++++++++++++++------------------------------------- 1 file changed, 20 insertions(+), 37 deletions(-) (limited to 'src/pcu_l1_if.h') 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 -#include -#include +#include extern "C" { #include #include #include +#include #include } -#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 -- cgit v1.2.3