Attention is currently required from: msuraev. fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/30262 )
Change subject: trxcon: implement Ready-to-Receive PHYIF API ......................................................................
Patch Set 2:
(3 comments)
File src/host/trxcon/include/osmocom/bb/l1sched/l1sched.h:
https://gerrit.osmocom.org/c/osmocom-bb/+/30262/comment/d6baeffc_2e355422 PS2, Line 166: #define L1SCHED_PROBE_F_ACTIVE (1 << 0)
That looks odd. […]
I see nothing odd here. This is the usual way of defining bit-flags. If we ever need more flags, it would be more convenient to write (1 << N) rather than 1, 2, 4, 8, etc.
File src/host/trxcon/include/osmocom/bb/trxcon/phyif.h:
https://gerrit.osmocom.org/c/osmocom-bb/+/30262/comment/dae2a8d5_3e29bd94 PS2, Line 85: #define TRXCON_PHYIF_RTR_F_ACTIVE (1 << 0)
Same here.
See my answer near the L1SCHED_PROBE_F_ACTIVE.
File src/host/trxcon/src/sched_trx.c:
https://gerrit.osmocom.org/c/osmocom-bb/+/30262/comment/dbc50b46_4ed388ca PS2, Line 829: return -ENODEV;
Would be better to use different error code to distinguish between different errors.
This is not really necessary though. Most of the times we check if the value is 0 and don't care why exactly some function failed. If I ever needed distinct self-explanatory error causes, I would rather go for my own enumerated type rather than using constants from errno.h.