aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2022-11-02 09:42:04 +0100
committerHarald Welte <laforge@osmocom.org>2022-11-02 09:42:04 +0100
commit81546e67730af9bf80b1410e80c250dd6a9ce9f7 (patch)
tree3368557e3ac00971605f627300cf0bfcf8984406 /src
parent75331976392a65b71e4c59facda5fe30d904dc4c (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/usb.c12
-rw-r--r--src/vty.c2
2 files changed, 9 insertions, 5 deletions
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 @@ _e1_usb_open_device(struct e1_daemon *e1d, struct libusb_device *dev, bool is_tr
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 @@ _e1_usb_open_device(struct e1_daemon *e1d, struct libusb_device *dev, bool is_tr
/* 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 @@ _e1_usb_open_device(struct e1_daemon *e1d, struct libusb_device *dev, bool is_tr
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 @@ _e1_usb_open_device(struct e1_daemon *e1d, struct libusb_device *dev, bool is_tr
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_vpair, cfg_vpair_cmd, "virtual-e1-pair <1-255>",
}
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;