tnt has uploaded this change for review. ( 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@246tNt.com Change-Id: I9595cba39377e45303d41a06753861bf72d5a93a --- M src/usb.c 1 file changed, 3 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-e1d refs/changes/94/26794/1
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)
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-e1d/+/26794 )
Change subject: e1d/usb: Use wMaxPacketSize to know maximum number of frames to send ......................................................................
Patch Set 1: Code-Review+2
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@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)
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-e1d/+/26794 )
Change subject: e1d/usb: Use wMaxPacketSize to know maximum number of frames to send ......................................................................
Patch Set 1:
interestingly the icE1usb driver already seems to do exactly this, so no need to port this change. @tnt, do you agree?