tnt has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26837 )
Change subject: icE1usb fw: Use 'int' as the default type for port index
......................................................................
icE1usb fw: Use 'int' as the default type for port index
No benefit to use uint8_t and for consistency with later patches,
use 'int' here too.
Signed-off-by: Sylvain Munaut <tnt(a)246tNt.com>
Change-Id: I50a76476af844acf20436b9d410cb917b723590d
---
M firmware/ice40-riscv/icE1usb/e1.h
M firmware/ice40-riscv/icE1usb/misc.c
2 files changed, 2 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-e1-hardware refs/changes/37/26837/1
diff --git a/firmware/ice40-riscv/icE1usb/e1.h b/firmware/ice40-riscv/icE1usb/e1.h
index 9ceffdd..862d568 100644
--- a/firmware/ice40-riscv/icE1usb/e1.h
+++ b/firmware/ice40-riscv/icE1usb/e1.h
@@ -57,5 +57,5 @@
E1P_LED_ST_BLINK_FAST = 3
};
-extern void e1_platform_led_set(uint8_t port, enum e1_platform_led led,
+extern void e1_platform_led_set(int port, enum e1_platform_led led,
enum e1_platform_led_state state);
diff --git a/firmware/ice40-riscv/icE1usb/misc.c b/firmware/ice40-riscv/icE1usb/misc.c
index 3117be9..a25bcc5 100644
--- a/firmware/ice40-riscv/icE1usb/misc.c
+++ b/firmware/ice40-riscv/icE1usb/misc.c
@@ -53,7 +53,7 @@
}
void
-e1_platform_led_set(uint8_t port, enum e1_platform_led led,
+e1_platform_led_set(int port, enum e1_platform_led led,
enum e1_platform_led_state state)
{
uint32_t tmp;
--
To view, visit https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26837
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-e1-hardware
Gerrit-Branch: master
Gerrit-Change-Id: I50a76476af844acf20436b9d410cb917b723590d
Gerrit-Change-Number: 26837
Gerrit-PatchSet: 1
Gerrit-Owner: tnt <tnt(a)246tNt.com>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newchange
tnt has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26836 )
Change subject: icE1usb fw: Fix computation of received E1 frames from USB
......................................................................
icE1usb fw: Fix computation of received E1 frames from USB
Several issues :
- The reported length includes the CRC so it's minus 6 and
not minus 4. (2 for CRC, 4 for header)
- Cast length to int to make it signed so the minus works
- If the packet is empty, this would be negative (no header),
underflow, and then try to submit a giant number of frames
to the E1 hardware
Signed-off-by: Sylvain Munaut <tnt(a)246tNt.com>
Change-Id: Ib754e460290fe2e1551a0090e30a51846131d07d
---
M firmware/ice40-riscv/icE1usb/usb_e1.c
1 file changed, 3 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-e1-hardware refs/changes/36/26836/1
diff --git a/firmware/ice40-riscv/icE1usb/usb_e1.c b/firmware/ice40-riscv/icE1usb/usb_e1.c
index 3de6071..ed4826f 100644
--- a/firmware/ice40-riscv/icE1usb/usb_e1.c
+++ b/firmware/ice40-riscv/icE1usb/usb_e1.c
@@ -171,8 +171,9 @@
usb_data_read(&hdr, ptr, 4);
/* Empty data into the FIFO */
- int n = ((csr & USB_BD_LEN_MSK) - 4) / 32;
- n = e1_tx_feed_data((ptr >> 2) + 1, n);
+ int n = ((int)(csr & USB_BD_LEN_MSK) - 6) / 32;
+ if (n > 0)
+ e1_tx_feed_data((ptr >> 2) + 1, n);
refill:
/* Refill it */
--
To view, visit https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26836
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-e1-hardware
Gerrit-Branch: master
Gerrit-Change-Id: Ib754e460290fe2e1551a0090e30a51846131d07d
Gerrit-Change-Number: 26836
Gerrit-PatchSet: 1
Gerrit-Owner: tnt <tnt(a)246tNt.com>
Gerrit-MessageType: newchange
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-upf/+/26691 )
Change subject: initial osmocom boilerplate source tree
......................................................................
Patch Set 5: Code-Review+1
(1 comment)
https://gerrit.osmocom.org/c/osmo-upf/+/26691/5/README.md
File README.md:
https://gerrit.osmocom.org/c/osmo-upf/+/26691/5/README.md@37
PS5, Line 37: h
URL works (via redirect) but one could use the correct/new URL of mailman3
--
To view, visit https://gerrit.osmocom.org/c/osmo-upf/+/26691
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-upf
Gerrit-Branch: master
Gerrit-Change-Id: I4352dd8738a1a9de6ba2fc250ee8eef69c65ff1e
Gerrit-Change-Number: 26691
Gerrit-PatchSet: 5
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 12 Jan 2022 15:35:51 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment