laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/27398 )
Change subject: usb: Match device by VID/PID without path/addr if it is unique
......................................................................
usb: Match device by VID/PID without path/addr if it is unique
If there's only a single device with matching VID/PID attached,
we don't need to insist that either the path or the address of the
device matches. Those are only needed to disambiguate multiple
devices with identical VID/PID.
Change-Id: I2ef245a56dfcf22758a0216b86d2a5c602ee5588
---
M src/usb/osmo_libusb.c
1 file changed, 2 insertions(+), 1 deletion(-)
Approvals:
Jenkins Builder: Verified
pespin: Looks good to me, but someone else must approve
laforge: Looks good to me, approved
diff --git a/src/usb/osmo_libusb.c b/src/usb/osmo_libusb.c
index c5ea507..a249d10 100644
--- a/src/usb/osmo_libusb.c
+++ b/src/usb/osmo_libusb.c
@@ -537,7 +537,8 @@
addr = libusb_get_device_address(*dev);
path = osmo_libusb_dev_get_path_buf(pathbuf, sizeof(pathbuf), *dev);
if ((ifm->addr && addr == ifm->addr) ||
- (strlen(ifm->path) && !strcmp(path, ifm->path))) {
+ (strlen(ifm->path) && !strcmp(path, ifm->path)) ||
+ (!ifm->addr && !strlen(ifm->path) && !list[1] /* only one device */)) {
rc = libusb_open(*dev, &usb_devh);
if (rc < 0) {
fprintf(stderr, "Cannot open device: %s\n", libusb_error_name(rc));
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/27398
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I2ef245a56dfcf22758a0216b86d2a5c602ee5588
Gerrit-Change-Number: 27398
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/27398 )
Change subject: usb: Match device by VID/PID without path/addr if it is unique
......................................................................
Patch Set 2: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/27398
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I2ef245a56dfcf22758a0216b86d2a5c602ee5588
Gerrit-Change-Number: 27398
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 03 Mar 2022 18:07:28 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: iedemam.
neels has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/27081 )
Change subject: stats: new trackers for lchan life duration
......................................................................
Patch Set 13:
(1 comment)
File src/osmo-bsc/lchan_fsm.c:
https://gerrit.osmocom.org/c/osmo-bsc/+/27081/comment/73baf37b_329c50ef
PS13, Line 226: lchan->activate.timekeeper = (struct osmo_time_cc){
also you probably want to do this only once during lchan allocation, i.e. in lchan_fsm_alloc(), or in ts_setup_lchans() in timeslot_fsm.c. Either one is fine.
That's because you want to accumulate the active time across multiple lchan activations. The only thing remaining here in this function should be setting the flag to true.
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/27081
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I1b0670c47cb5e0b7776eda89d1e71545ba0e3347
Gerrit-Change-Number: 27081
Gerrit-PatchSet: 13
Gerrit-Owner: iedemam <michael(a)kapsulate.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: iedemam <michael(a)kapsulate.com>
Gerrit-Comment-Date: Thu, 03 Mar 2022 18:06:17 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Attention is currently required from: fixeria.
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/simtrace2/+/26985 )
Change subject: contrib/simtrace.lua: Add Flag bits + Data to COL_INFO
......................................................................
Patch Set 5: Code-Review+2
(1 comment)
File contrib/simtrace.lua:
https://gerrit.osmocom.org/c/simtrace2/+/26985/comment/6d630fda_a6751bb6
PS1, Line 93: if is_pbrx().value == 1 then
> Interesting, I don't even remember where I found that syntax. Now I found: […]
"Attempt to perform arithmetic on locla 'flagstr' (a string value).
and with .. instead of + it is a different value.
I'm now going to merge this as-is, as your suggestions don't appear to work.
--
To view, visit https://gerrit.osmocom.org/c/simtrace2/+/26985
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I0aa3d68172022907fbe8371aaca6538df0649dfe
Gerrit-Change-Number: 26985
Gerrit-PatchSet: 5
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 03 Mar 2022 18:04:41 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: laforge <laforge(a)osmocom.org>
Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: comment
Attention is currently required from: iedemam.
neels has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/27081 )
Change subject: stats: new trackers for lchan life duration
......................................................................
Patch Set 13:
(5 comments)
File include/osmocom/bsc/gsm_data.h:
https://gerrit.osmocom.org/c/osmo-bsc/+/27081/comment/82510adb_73ed7fcf
PS13, Line 771: struct osmo_time_cc timekeeper;
here is your problem: the lchan is completely cleared out every time an lchan is activated / unused. See lchan_reset(), there it loses its pointer to the ctr. In lchan_reset(), you need to make sure the timekeeper stays unchanged by adding
.timekeeper = lchan->timekeeper,
lchan->activate is intended as a volatile place describing the state of a single activation. Rather put your timekeeper in the "lchan root" please.
Nitpick on the name: let's call it 'active_ms' or 'active_time' or something more concise.
File src/osmo-bsc/gsm_data.c:
https://gerrit.osmocom.org/c/osmo-bsc/+/27081/comment/88951373_c33c89fe
PS13, Line 354: !&lchan->activate.timekeeper
a) the address of a struct member is *always* non-NULL. (ok if a struct pointer is NULL and the member is the first in the struct, it could be NULL, but that's beside the point)
b) even if you drop the '&', timekeeper is not a pointer.
This condition will always evaluate false. the compiler should have told you that, too, wondering why jenkins passes the build.
Completely drop this 'if'
File src/osmo-bsc/lchan_fsm.c:
https://gerrit.osmocom.org/c/osmo-bsc/+/27081/comment/538b2512_a7f5c4b8
PS13, Line 228: .gran_usec = 1*1000000,
if you want milliseconds, 1000 is your factor. This says after how much active time the rate counter increments; using one second for that does make sense, just saying. The total_sum is always in microseconds regardless, so probably this is correct after all.
https://gerrit.osmocom.org/c/osmo-bsc/+/27081/comment/d75ec044_d7534a91
PS13, Line 237: /* TMP HACK: this fixes "make check" handover tests... */
yeah because you re-init the lost state after lchan_reset().
https://gerrit.osmocom.org/c/osmo-bsc/+/27081/comment/587ae6f2_260775a4
PS13, Line 558: if (&lchan->activate.timekeeper) {
this condition is never false, as above. simply set the the flag without condition.
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/27081
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I1b0670c47cb5e0b7776eda89d1e71545ba0e3347
Gerrit-Change-Number: 27081
Gerrit-PatchSet: 13
Gerrit-Owner: iedemam <michael(a)kapsulate.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: iedemam <michael(a)kapsulate.com>
Gerrit-Comment-Date: Thu, 03 Mar 2022 18:01:40 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Attention is currently required from: laforge.
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/simtrace2/+/26985 )
Change subject: contrib/simtrace.lua: Add Flag bits + Data to COL_INFO
......................................................................
Patch Set 5:
(1 comment)
File contrib/simtrace.lua:
https://gerrit.osmocom.org/c/simtrace2/+/26985/comment/32f50145_d42e05bc
PS1, Line 93: if is_pbrx().value == 1 then
> the syntax you provided simply doesn't work here: "unexpected symbol near if"
Interesting, I don't even remember where I found that syntax. Now I found:
flagstr = flagstr + (is_pbrx().value == 1) and "R" or "."
https://riptutorial.com/lua/example/26503/emulating-ternary-operator-with--…
--
To view, visit https://gerrit.osmocom.org/c/simtrace2/+/26985
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I0aa3d68172022907fbe8371aaca6538df0649dfe
Gerrit-Change-Number: 26985
Gerrit-PatchSet: 5
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Comment-Date: Thu, 03 Mar 2022 17:45:42 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: laforge <laforge(a)osmocom.org>
Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: comment
Attention is currently required from: laforge.
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/27398 )
Change subject: usb: Match device by VID/PID without path/addr if it is unique
......................................................................
Patch Set 2: Code-Review+1
(1 comment)
Patchset:
PS1:
> the current problem is that you always have to specify either the address or the path for all the si […]
ACK, makes sense, I think I checked patch version 1 and you changed the logic in version 2.
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/27398
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I2ef245a56dfcf22758a0216b86d2a5c602ee5588
Gerrit-Change-Number: 27398
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Comment-Date: Thu, 03 Mar 2022 17:05:11 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: laforge <laforge(a)osmocom.org>
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: comment