aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-octphy/l1_if.h
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2016-01-09 13:13:37 +0100
committerHarald Welte <laforge@gnumonks.org>2016-02-15 14:18:59 +0100
commitd784e50747b8cf0ce505489e1451f75be5ccbd4b (patch)
treeb143bbf2162bea0959ba9b80cc5d1573de7d62ee /src/osmo-bts-octphy/l1_if.h
parentf58542899a91d1db0bbe9966ae98ccdf449f45d0 (diff)
Introduce new phy_link and phy_instance abstraction
This way we can model a flexible mapping between any number of PHYs, each having multiple instances, and then map BTSs with TRXx on top of those PHYs.
Diffstat (limited to 'src/osmo-bts-octphy/l1_if.h')
-rw-r--r--src/osmo-bts-octphy/l1_if.h31
1 files changed, 11 insertions, 20 deletions
diff --git a/src/osmo-bts-octphy/l1_if.h b/src/osmo-bts-octphy/l1_if.h
index 42778659..2dee178d 100644
--- a/src/osmo-bts-octphy/l1_if.h
+++ b/src/osmo-bts-octphy/l1_if.h
@@ -13,16 +13,16 @@
#include <osmocom/gsm/protocol/gsm_04_08.h>
#include <osmo-bts/gsm_data.h>
+#include <osmo-bts/phy_link.h>
#include <octphy/octvc1/gsm/octvc1_gsm_api.h>
struct octphy_hdl {
+ /* MAC address of the PHY */
+ struct sockaddr_ll phy_addr;
+
/* packet socket to talk with PHY */
struct osmo_wqueue phy_wq;
- /* MAC address of th PHY */
- struct sockaddr_ll phy_addr;
- /* Network device name */
- char *netdev_name;
/* address parameters of the PHY */
uint32_t session_id;
@@ -33,12 +33,6 @@ struct octphy_hdl {
uint32_t clkmgr_state;
struct {
- uint32_t rf_port_index;
- uint32_t rx_gain_db;
- uint32_t tx_atten_db;
- } config;
-
- struct {
struct {
char *name;
char *description;
@@ -72,8 +66,8 @@ struct octphy_hdl {
struct llist_head wlc_postponed;
int wlc_postponed_len;
- /* private pointer, points back to TRX */
- void *priv;
+ /* back pointer to the PHY link */
+ struct phy_link *phy_link;
struct osmo_timer_list alive_timer;
uint32_t alive_prim_cnt;
@@ -82,15 +76,10 @@ struct octphy_hdl {
int opened;
};
-static inline struct octphy_hdl *trx_octphy_hdl(struct gsm_bts_trx *trx)
-{
- return trx->role_bts.l1h;
-}
-
void l1if_fill_msg_hdr(tOCTVC1_MSG_HEADER *mh, struct msgb *msg,
struct octphy_hdl *fl1h, uint32_t msg_type, uint32_t api_cmd);
-typedef int l1if_compl_cb(struct gsm_bts_trx *trx, struct msgb *l1_msg, void *data);
+typedef int l1if_compl_cb(struct octphy_hdl *fl1, struct msgb *l1_msg, void *data);
/* send a request primitive to the L1 and schedule completion call-back */
int l1if_req_compl(struct octphy_hdl *fl1h, struct msgb *msg,
@@ -100,19 +89,21 @@ int l1if_req_compl(struct octphy_hdl *fl1h, struct msgb *msg,
struct gsm_lchan *get_lchan_by_lchid(struct gsm_bts_trx *trx,
tOCTVC1_GSM_LOGICAL_CHANNEL_ID *lch_id);
-int l1if_open(struct octphy_hdl *fl1h);
+struct octphy_hdl *l1if_open(struct phy_link *plink);
int l1if_close(struct octphy_hdl *hdl);
int l1if_trx_open(struct gsm_bts_trx *trx);
int l1if_trx_close_all(struct gsm_bts *bts);
int l1if_enable_events(struct gsm_bts_trx *trx);
-int l1if_activate_rf(struct octphy_hdl *fl1h, int on);
+int l1if_activate_rf(struct gsm_bts_trx *trx, int on);
int l1if_tch_rx(struct gsm_bts_trx *trx, uint8_t chan_nr,
tOCTVC1_GSM_MSG_TRX_LOGICAL_CHANNEL_DATA_INDICATION_EVT *
data_ind);
+struct gsm_bts_trx *trx_by_l1h(struct octphy_hdl *fl1h, unsigned int trx_id);
+
struct msgb *l1p_msgb_alloc(void);
/* tch.c */