laforge has submitted this change. (
https://gerrit.osmocom.org/c/osmo-e1d/+/26794 )
Change subject: e1d/usb: Use wMaxPacketSize to know maximum number of frames to send
......................................................................
e1d/usb: Use wMaxPacketSize to know maximum number of frames to send
Signed-off-by: Sylvain Munaut <tnt(a)246tNt.com>
Change-Id: I9595cba39377e45303d41a06753861bf72d5a93a
---
M src/usb.c
1 file changed, 3 insertions(+), 2 deletions(-)
Approvals:
Jenkins Builder: Verified
laforge: Looks good to me, approved
diff --git a/src/usb.c b/src/usb.c
index 348c104..d5107bc 100644
--- a/src/usb.c
+++ b/src/usb.c
@@ -126,7 +126,7 @@
{
struct e1_line *line = flow->line;
struct e1_usb_line_data *ld = (struct e1_usb_line_data *) line->drv_data;
- int fts;
+ int fm, fts;
if (size <= 0) {
LOGPLI(line, DXFR, LOGL_ERROR, "OUT ERROR: %d\n", size);
@@ -136,9 +136,10 @@
/* Flow regulation */
ld->r_acc += ld->r_sw;
+ fm = (ld->pkt_size - 4) / 32;
fts = ld->r_acc >> 10;
if (fts < 4) fts = 4;
- else if (fts > 12) fts = 12;
+ else if (fts > fm) fts = fm;
ld->r_acc -= fts << 10;
if (ld->r_acc & 0x80000000)
--
To view, visit
https://gerrit.osmocom.org/c/osmo-e1d/+/26794
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-e1d
Gerrit-Branch: master
Gerrit-Change-Id: I9595cba39377e45303d41a06753861bf72d5a93a
Gerrit-Change-Number: 26794
Gerrit-PatchSet: 1
Gerrit-Owner: tnt <tnt(a)246tNt.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: merged