diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2012-07-26 20:10:39 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2012-07-26 20:18:53 +0200 |
commit | b86bf060d334b33628e192218915526a526ebe46 (patch) | |
tree | 12f1a8e0514399fce89e89932d51b7a9ad97221b /src/osmo-bts-sysmo/l1_transp_hw.c | |
parent | fde8e6dc0c1b493f70c2ffdb5182afe8d426bd9e (diff) |
sysmobts: Support older firmware on the RevB hardware
For the firmware used on RevB the GsmL1_Prim_t was bigger than
the femtobts control structure. Solve it by introducing a macro
that will select the biggest size and use this macro. This is a
follow up fix for 08fce19cfce84432fbf8293318486a96437a3427.
Diffstat (limited to 'src/osmo-bts-sysmo/l1_transp_hw.c')
-rw-r--r-- | src/osmo-bts-sysmo/l1_transp_hw.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/osmo-bts-sysmo/l1_transp_hw.c b/src/osmo-bts-sysmo/l1_transp_hw.c index d4b99780..0bfc5089 100644 --- a/src/osmo-bts-sysmo/l1_transp_hw.c +++ b/src/osmo-bts-sysmo/l1_transp_hw.c @@ -82,11 +82,17 @@ static const char *wr_devnames[] = { #endif }; +/* + * Make sure that all structs we read fit into the SYSMOBTS_PRIM_SIZE + */ +osmo_static_assert(sizeof(GsmL1_Prim_t) + 128 <= SYSMOBTS_PRIM_SIZE, prim) +osmo_static_assert(sizeof(SuperFemto_Prim_t) + 128 <= SYSMOBTS_PRIM_SIZE, prim) + /* callback when there's something to read from the l1 msg_queue */ static int l1if_fd_cb(struct osmo_fd *ofd, unsigned int what) { //struct msgb *msg = l1p_msgb_alloc(); - struct msgb *msg = msgb_alloc_headroom(sizeof(SuperFemto_Prim_t) + 128, 128, "1l_fd"); + struct msgb *msg = msgb_alloc_headroom(SYSMOBTS_PRIM_SIZE, 128, "1l_fd"); struct femtol1_hdl *fl1h = ofd->data; int rc; |