Review at https://gerrit.osmocom.org/2792
l1_if: Add inline functions to check dsp/fgpa version at runtime Change-Id: Iddae9c8de33aca6663dca77908fa4852ad704ce9 --- M src/osmo-bts-sysmo/l1_if.h 1 file changed, 15 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/92/2792/1 diff --git a/src/osmo-bts-sysmo/l1_if.h b/src/osmo-bts-sysmo/l1_if.h index 0dc919b..961e585 100644 --- a/src/osmo-bts-sysmo/l1_if.h +++ b/src/osmo-bts-sysmo/l1_if.h @@ -83,6 +83,21 @@ void *priv; }; + +#define L1_VER_SHIFT(x,y,z) ((x << 16) | (y << 8) | (z)) + +static inline uint32_t l1if_dsp_ver(struct femtol1_hdl *fl1h) +{ + const uint8_t *v = fl1h->hw_info.dsp_version; + return L1_VER_SHIFT(v[0], v[1], v[2]); +} + +static inline uint32_t l1if_fpga_ver(struct femtol1_hdl *fl1h) +{ + const uint8_t *v = fl1h->hw_info.fpga_version; + return L1_VER_SHIFT(v[0], v[1], v[2]); +} + #define msgb_l1prim(msg) ((GsmL1_Prim_t *)(msg)->l1h) #define msgb_sysprim(msg) ((SuperFemto_Prim_t *)(msg)->l1h) -- To view, visit https://gerrit.osmocom.org/2792 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iddae9c8de33aca6663dca77908fa4852ad704ce9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte <lafo...@gnumonks.org>