aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSylvain Munaut <tnt@246tNt.com>2024-04-29 23:32:06 +0200
committerSylvain Munaut <tnt@246tNt.com>2024-04-30 00:31:37 +0200
commit2c0f3fd1e362b1e8f01c4ed15c7173fb1642d7de (patch)
tree432e883709f583963f8b5760c20a0cf3bd3408d0 /src
parent21e5cac177896df14d697e35a6e9ca13638f0057 (diff)
ctl: When setting Sa bits, other bits must remain set to '1'tnt/work
Some of the other bits will be used 'as-is'. For instance the bit 0 (MSB) will be copied from this if operating in nocrc4 mode. Signed-off-by: Sylvain Munaut <tnt@246tNt.com> Change-Id: Id482c6a114e7bf051d157e81038f015e9d26fa99
Diffstat (limited to 'src')
-rw-r--r--src/ctl.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/ctl.c b/src/ctl.c
index 331f2ad..e63589b 100644
--- a/src/ctl.c
+++ b/src/ctl.c
@@ -452,11 +452,14 @@ _e1d_ctl_sabits(void *data, struct msgb *msgb, struct msgb *rmsgb, int *rfd)
return 0;
}
- line->ts0.tx_frame = ((sa_bits & 0x80) >> 7) | /* Bit 7 -> Sa8 */
- ((sa_bits & 0x40) >> 5) | /* Bit 6 -> Sa7 */
- ((sa_bits & 0x01) << 2) | /* Bit 0 -> Sa6 */
- ((sa_bits & 0x20) >> 2) | /* Bit 5 -> Sa5 */
- (sa_bits & 0x10); /* Bit 4 -> Sa4 */
+ line->ts0.tx_frame = (
+ ((sa_bits & 0x80) >> 7) | /* Bit 7 -> Sa8 */
+ ((sa_bits & 0x40) >> 5) | /* Bit 6 -> Sa7 */
+ ((sa_bits & 0x01) << 2) | /* Bit 0 -> Sa6 */
+ ((sa_bits & 0x20) >> 2) | /* Bit 5 -> Sa5 */
+ (sa_bits & 0x10) | /* Bit 4 -> Sa4 */
+ 0xe0
+ );
return 0;
}