From patchwork Fri May 13 09:38:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: gerrit-no-reply@lists.osmocom.org X-Patchwork-Id: 621910 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.osmocom.org (lists.osmocom.org [144.76.43.76]) by ozlabs.org (Postfix) with ESMTP id 3r5lD02GKVz9t6n for ; Fri, 13 May 2016 19:38:40 +1000 (AEST) Received: from lists.osmocom.org (lists.osmocom.org [144.76.43.76]) by lists.osmocom.org (Postfix) with ESMTP id C31F11C0D3; Fri, 13 May 2016 09:38:38 +0000 (UTC) X-Original-To: openbsc@lists.osmocom.org Delivered-To: openbsc@lists.osmocom.org Received: from 127.0.1.12 (unknown [127.0.1.12]) by lists.osmocom.org (Postfix) with ESMTPA id 4C3FB1C086 for ; Fri, 13 May 2016 09:38:34 +0000 (UTC) Date: Fri, 13 May 2016 09:38:34 +0000 From: gerrit-no-reply@lists.osmocom.org Message-ID: X-Gerrit-MessageType: newchange Subject: Change in osmo-pcu[master]: Change internal API for consistency X-Gerrit-Change-Id: Ic584611184b0c8b5417ecff0ddae3d526b55a079 X-Gerrit-ChangeURL: X-Gerrit-Commit: f45c05474196424bf70f4659c51a0981f4eb90be MIME-Version: 1.0 Content-Disposition: inline User-Agent: Gerrit/2.12.2 X-BeenThere: openbsc@lists.osmocom.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Development of OpenBSC, OsmoBSC, OsmoNITB, OsmoCSCN" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: msuraev@sysmocom.de Errors-To: openbsc-bounces@lists.osmocom.org Sender: "OpenBSC" From Max : Max has uploaded a new change for review. https://gerrit.osmocom.org/59 Change subject: Change internal API for consistency ...................................................................... Change internal API for consistency Use uint8_t for TRX numbering everywhere (we don't expect hardware with more than 256 transceivers in the near future). This change helps to avoid unnecessary casts and make API much clearer. Change-Id: Ic584611184b0c8b5417ecff0ddae3d526b55a079 Related: SYS#2443 --- M src/osmo-bts-sysmo/sysmo_l1_if.c M src/osmo-bts-sysmo/sysmo_l1_if.h M src/pcu_l1_if.cpp 3 files changed, 9 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/59/59/1 diff --git a/src/osmo-bts-sysmo/sysmo_l1_if.c b/src/osmo-bts-sysmo/sysmo_l1_if.c index c7c54dd..4bfcecd 100644 --- a/src/osmo-bts-sysmo/sysmo_l1_if.c +++ b/src/osmo-bts-sysmo/sysmo_l1_if.c @@ -155,7 +155,7 @@ switch (rts_ind->sapi) { case GsmL1_Sapi_Pdtch: case GsmL1_Sapi_Pacch: - rc = pcu_rx_rts_req_pdtch((long)fl1h->priv, rts_ind->u8Tn, + rc = pcu_rx_rts_req_pdtch(fl1h->trx, rts_ind->u8Tn, rts_ind->u16Arfcn, rts_ind->u32Fn, rts_ind->u8BlockNbr); case GsmL1_Sapi_Ptcch: // FIXME @@ -215,7 +215,7 @@ != GsmL1_PdtchPlType_Full) break; /* PDTCH / PACCH frame handling */ - pcu_rx_data_ind_pdtch((long)fl1h->priv, data_ind->u8Tn, + pcu_rx_data_ind_pdtch(fl1h->trx, data_ind->u8Tn, data_ind->msgUnitParam.u8Buffer + 1, data_ind->msgUnitParam.u8Size - 1, data_ind->u32Fn, @@ -357,7 +357,7 @@ return 0; } -void *l1if_open_pdch(void *priv, uint32_t hlayer1, struct gsmtap_inst *gsmtap) +void *l1if_open_pdch(uint8_t trx, uint32_t hlayer1, struct gsmtap_inst *gsmtap) { struct femtol1_hdl *fl1h; int rc; @@ -367,7 +367,7 @@ return NULL; fl1h->hLayer1 = hlayer1; - fl1h->priv = priv; + fl1h->trx = trx; fl1h->clk_cal = 0; /* default clock source: OCXO */ fl1h->clk_src = SuperFemto_ClkSrcId_Ocxo; diff --git a/src/osmo-bts-sysmo/sysmo_l1_if.h b/src/osmo-bts-sysmo/sysmo_l1_if.h index 6b50d4e..83ca481 100644 --- a/src/osmo-bts-sysmo/sysmo_l1_if.h +++ b/src/osmo-bts-sysmo/sysmo_l1_if.h @@ -38,7 +38,7 @@ struct gsmtap_inst *gsmtap; uint32_t gsmtap_sapi_mask; - void *priv; /* user reference */ + uint8_t trx; struct osmo_timer_list alive_timer; unsigned int alive_prim_cnt; diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp index 67272ab..17e9d75 100644 --- a/src/pcu_l1_if.cpp +++ b/src/pcu_l1_if.cpp @@ -44,7 +44,7 @@ // FIXME: move this, when changed from c++ to c. extern "C" { -void *l1if_open_pdch(void *priv, uint32_t hlayer1, struct gsmtap_inst *gsmtap); +void *l1if_open_pdch(uint8_t trx, uint32_t hlayer1, struct gsmtap_inst *gsmtap); int l1if_connect_pdch(void *obj, uint8_t ts); int l1if_pdch_req(void *obj, uint8_t ts, int is_ptcch, uint32_t fn, uint16_t arfcn, uint8_t block_nr, uint8_t *data, uint8_t len); @@ -330,8 +330,8 @@ struct gprs_bssgp_pcu *pcu; struct gprs_rlcmac_pdch *pdch; struct in_addr ia; - int rc = 0; - int trx, ts; + int rc = 0, ts; + uint8_t trx; int i; if (info_ind->version != PCU_IF_VERSION) { @@ -450,7 +450,7 @@ info_ind->trx[trx].hlayer1); if (!bts->trx[trx].fl1h) bts->trx[trx].fl1h = l1if_open_pdch( - (void *)trx, + trx, info_ind->trx[trx].hlayer1, bts->gsmtap); if (!bts->trx[trx].fl1h) {