laforge has submitted this change. (
https://gerrit.osmocom.org/c/osmo-e1d/+/29962 )
Change subject: Differentiate between icE1usb and e1-tracer in log/vty output
......................................................................
Differentiate between icE1usb and e1-tracer in log/vty output
Now that we support the e1-tracer in addition to icE1usb, let's
differentiate in the log output.
Change-Id: Iea647b12d86c97cfacbc3df43010b9b94f0a97c7
---
M src/usb.c
M src/vty.c
2 files changed, 9 insertions(+), 5 deletions(-)
Approvals:
Jenkins Builder: Verified
tnt: Looks good to me, but someone else must approve
laforge: Looks good to me, approved
diff --git a/src/usb.c b/src/usb.c
index 35e1894..fc461c4 100644
--- a/src/usb.c
+++ b/src/usb.c
@@ -825,6 +825,10 @@
libusb_device_handle *devh;
int line_nr = 0;
int i, j, ret;
+ const char *hwname = "icE1usb";
+
+ if (is_tracer)
+ hwname = "e1-tracer";
ret = libusb_open(dev, &devh);
if (ret) {
@@ -853,7 +857,7 @@
/* try to find the matching interface config created by the vty */
intf = e1d_find_intf_by_usb_serial(e1d, serial_str);
if (intf) {
- LOGP(DE1D, LOGL_INFO, "Configuration for icE1usb serial '%s'
found\n", serial_str);
+ LOGP(DE1D, LOGL_INFO, "Configuration for %s serial '%s' found\n",
hwname, serial_str);
auto_create_lines = false;
if (intf->drv_data) {
LOGP(DE1D, LOGL_ERROR, "New device with serial '%s', but E1 interface %u
busy\n",
@@ -865,8 +869,8 @@
intf_data->devh = devh;
intf->drv_data = intf_data;
} else {
- LOGP(DE1D, LOGL_NOTICE, "No configuration for icE1usb serial '%s' found,
"
- "auto-generating it\n", serial_str);
+ LOGP(DE1D, LOGL_NOTICE, "No configuration for %s serial '%s' found,
"
+ "auto-generating it\n", hwname, serial_str);
auto_create_lines = true;
intf_data = talloc_zero(e1d->ctx, struct e1_usb_intf_data);
intf_data->devh = devh;
@@ -888,7 +892,7 @@
ret = libusb_get_active_config_descriptor(dev, &cd);
if (ret) {
- LOGP(DE1D, LOGL_ERROR, "Failed to talk to usb device: %s\n",
libusb_strerror(ret));
+ LOGP(DE1D, LOGL_ERROR, "Failed to talk to %s usb device: %s\n", hwname,
libusb_strerror(ret));
intf_data->devh = NULL;
talloc_free(intf_data);
if (auto_create_lines)
diff --git a/src/vty.c b/src/vty.c
index d3433da..6507937 100644
--- a/src/vty.c
+++ b/src/vty.c
@@ -242,7 +242,7 @@
}
DEFUN(cfg_e1d_if_icE1usb, cfg_e1d_if_icE1usb_cmd, "interface <0-255>
icE1usb",
- "Configure an icE1usb E1 interface\n"
+ "Configure an icE1usb/e1-tracer E1 interface\n"
"E1 Interface Number\n")
{
struct e1_intf *intf;
--
To view, visit
https://gerrit.osmocom.org/c/osmo-e1d/+/29962
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-e1d
Gerrit-Branch: master
Gerrit-Change-Id: Iea647b12d86c97cfacbc3df43010b9b94f0a97c7
Gerrit-Change-Number: 29962
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: tnt <tnt(a)246tNt.com>
Gerrit-MessageType: merged