aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2020-06-28 23:09:18 +0200
committerHarald Welte <laforge@osmocom.org>2020-06-29 22:12:42 +0200
commit9bedf75f2b154a4c2dd27ce4ce3c9a2d96068558 (patch)
tree4de407fb1ce3a9d8d47671fdafc614a47777d768
parent760097bfb0a49a492719c0ee6c1633097c6980ed (diff)
introduce notion of 'driver'
-rw-r--r--src/e1d.h7
-rw-r--r--src/intf_line.c4
-rw-r--r--src/usb.c1
3 files changed, 12 insertions, 0 deletions
diff --git a/src/e1d.h b/src/e1d.h
index 303757f..c1a28ce 100644
--- a/src/e1d.h
+++ b/src/e1d.h
@@ -65,12 +65,19 @@ struct e1_line {
struct e1_ts ts[32];
};
+enum e1_driver {
+ E1_DRIVER_USB,
+};
+
+extern const struct value_string e1_driver_names[];
+
struct e1_intf {
struct llist_head list;
struct e1_daemon *e1d;
uint8_t id;
+ enum e1_driver drv;
void *drv_data;
struct llist_head lines;
diff --git a/src/intf_line.c b/src/intf_line.c
index c3466e0..f572190 100644
--- a/src/intf_line.c
+++ b/src/intf_line.c
@@ -34,6 +34,10 @@
#include "e1d.h"
#include "log.h"
+const struct value_string e1_driver_names[] = {
+ { E1_DRIVER_USB, "usb" },
+ { 0, NULL }
+};
// ---------------------------------------------------------------------------
// e1d structures
diff --git a/src/usb.c b/src/usb.c
index 8cf96b4..5d38d32 100644
--- a/src/usb.c
+++ b/src/usb.c
@@ -300,6 +300,7 @@ _e1_usb_open_device(struct e1_daemon *e1d, struct libusb_device *dev)
intf_data->devh = devh;
intf = e1_intf_new(e1d, intf_data);
+ intf->drv = E1_DRIVER_USB;
ret = libusb_get_active_config_descriptor(dev, &cd);
if (ret) {