]> sigrok.org Git - libsigrok.git/blobdiff - hardware/demo/demo.c
Add protocol parser for FS9721_LP3/FS9721B.
[libsigrok.git] / hardware / demo / demo.c
index 3e3150afc6663156f0aaac25aeeb0f7505bbb269..e435482e32ac1c91e67aba58c1cfd452255765c9 100644 (file)
@@ -63,13 +63,6 @@ enum {
        PATTERN_ALL_HIGH,
 };
 
-/* FIXME: Should not be global. */
-
-/* Private driver context. */
-struct drv_context {
-       GSList *instances;
-};
-
 /* Private, per-device-instance driver context. */
 struct dev_context {
        int pipe_fds[2];
@@ -192,6 +185,15 @@ static GSList *hw_scan(GSList *options)
        return devices;
 }
 
+static GSList *hw_dev_list(void)
+{
+       struct drv_context *drvc;
+
+       drvc = ddi->priv;
+
+       return drvc->instances;
+}
+
 static int hw_dev_open(struct sr_dev_inst *sdi)
 {
        /* Avoid compiler warnings. */
@@ -537,6 +539,7 @@ SR_PRIV struct sr_dev_driver demo_driver_info = {
        .init = hw_init,
        .cleanup = hw_cleanup,
        .scan = hw_scan,
+       .dev_list = hw_dev_list,
        .dev_open = hw_dev_open,
        .dev_close = hw_dev_close,
        .info_get = hw_info_get,