]> sigrok.org Git - libsigrok.git/commitdiff
Deprecate SR_DI_HWCAPS.
authorBert Vermeulen <redacted>
Fri, 25 Jan 2013 14:01:49 +0000 (15:01 +0100)
committerBert Vermeulen <redacted>
Fri, 25 Jan 2013 14:01:49 +0000 (15:01 +0100)
This is replaced by SR_CONF_DEVICE_OPTIONS.

22 files changed:
device.c
hardware/agilent-dmm/api.c
hardware/alsa/api.c
hardware/asix-sigma/asix-sigma.c
hardware/chronovu-la8/api.c
hardware/colead-slm/api.c
hardware/demo/demo.c
hardware/fluke-dmm/api.c
hardware/fx2lafw/fx2lafw.c
hardware/hantek-dso/api.c
hardware/lascar-el-usb/api.c
hardware/link-mso19/api.c
hardware/openbench-logic-sniffer/api.c
hardware/rigol-ds1xx2/api.c
hardware/serial-dmm/api.c
hardware/tondaj-sl-814/api.c
hardware/uni-t-dmm/api.c
hardware/victor-dmm/api.c
hardware/zeroplus-logic-cube/zeroplus.c
hwdriver.c
libsigrok.h
session_driver.c

index a5c8c509bae914b5909ba37c323cfc17202449e6..0c38c119ddde0b8a1ca3525cb15a49566914c940 100644 (file)
--- a/device.c
+++ b/device.c
@@ -198,7 +198,7 @@ SR_API gboolean sr_dev_has_hwcap(const struct sr_dev_inst *sdi, int hwcap)
        if (!sdi || !sdi->driver)
                return FALSE;
 
-       if (sdi->driver->config_get(SR_DI_HWCAPS,
+       if (sdi->driver->config_list(SR_CONF_DEVICE_OPTIONS,
                        (const void **)&hwcaps, NULL) != SR_OK)
                return FALSE;
 
index aa56b58d42c10d87c12e7e9017afc07d2a2fb22c..5f961018f70a5615b38b28a80d36ffff86c7fc2e 100644 (file)
@@ -255,9 +255,6 @@ static int config_get(int id, const void **data, const struct sr_dev_inst *sdi)
        case SR_DI_HWOPTS:
                *data = hwopts;
                break;
-       case SR_DI_HWCAPS:
-               *data = hwcaps;
-               break;
        default:
                return SR_ERR_ARG;
        }
@@ -308,6 +305,9 @@ static int config_list(int key, const void **data, const struct sr_dev_inst *sdi
        (void)sdi;
 
        switch (key) {
+       case SR_CONF_DEVICE_OPTIONS:
+               *data = hwcaps;
+               break;
        default:
                return SR_ERR_ARG;
        }
index 86ab6a7c9bee0aa35c8f1b7d62016372e7f8c72b..67773f60582e5977f0daa2a3faf528d400bf7df0 100644 (file)
@@ -144,14 +144,9 @@ static int config_get(int id, const void **data, const struct sr_dev_inst *sdi)
 {
        struct dev_context *devc;
 
-       if (id != SR_DI_HWCAPS) /* For SR_DI_HWCAPS sdi will be NULL. */
-               devc = sdi->priv;
-
        switch (id) {
-       case SR_DI_HWCAPS:
-               *data = hwcaps;
-               break;
        case SR_CONF_SAMPLERATE:
+               devc = sdi->priv;
                *data = &devc->cur_samplerate;
                break;
        default:
@@ -189,6 +184,9 @@ static int config_list(int key, const void **data, const struct sr_dev_inst *sdi
        (void)sdi;
 
        switch (key) {
+       case SR_CONF_DEVICE_OPTIONS:
+               *data = hwcaps;
+               break;
        case SR_CONF_SAMPLERATE:
                if (!sdi || !sdi->priv)
                        return SR_ERR_ARG;
index 13cb334203738ad63dc1efcdd820154055f55167..667df3a32f183ab1e60e33e03ce087b7ec35252e 100644 (file)
@@ -792,9 +792,6 @@ static int config_get(int id, const void **data, const struct sr_dev_inst *sdi)
        struct dev_context *devc;
 
        switch (id) {
-       case SR_DI_HWCAPS:
-               *data = hwcaps;
-               break;
        case SR_CONF_SAMPLERATE:
                if (sdi) {
                        devc = sdi->priv;
@@ -843,6 +840,9 @@ static int config_list(int key, const void **data, const struct sr_dev_inst *sdi
        (void)sdi;
 
        switch (key) {
+       case SR_CONF_DEVICE_OPTIONS:
+               *data = hwcaps;
+               break;
        case SR_CONF_SAMPLERATE:
                *data = &samplerates;
                break;
index bfeddaa1d0124e808db024cafbd8088b2535e40d..478f0a1c95b1763de0893a25b1adb6b4065b3f62 100644 (file)
@@ -293,9 +293,6 @@ static int config_get(int id, const void **data, const struct sr_dev_inst *sdi)
        struct dev_context *devc;
 
        switch (id) {
-       case SR_DI_HWCAPS:
-               *data = hwcaps;
-               break;
        case SR_CONF_SAMPLERATE:
                if (sdi) {
                        devc = sdi->priv;
@@ -361,6 +358,9 @@ static int config_list(int key, const void **data, const struct sr_dev_inst *sdi
        (void)sdi;
 
        switch (key) {
+       case SR_CONF_DEVICE_OPTIONS:
+               *data = hwcaps;
+               break;
        case SR_CONF_SAMPLERATE:
                fill_supported_samplerates_if_needed();
                *data = &samplerates;
index 4047a319995128450bdc0999ffd00ed6f68755ce..8fed762a7d2e2badb49a515651f3f5252980e338 100644 (file)
@@ -199,9 +199,6 @@ static int config_get(int id, const void **data, const struct sr_dev_inst *sdi)
        case SR_DI_HWOPTS:
                *data = hwopts;
                break;
-       case SR_DI_HWCAPS:
-               *data = hwcaps;
-               break;
        default:
                return SR_ERR_ARG;
        }
@@ -252,6 +249,9 @@ static int config_list(int key, const void **data, const struct sr_dev_inst *sdi
        (void)sdi;
 
        switch (key) {
+       case SR_CONF_DEVICE_OPTIONS:
+               *data = hwcaps;
+               break;
        default:
                return SR_ERR_ARG;
        }
index 345468c41be550174350ecd2ea4b7984edf37499..df6a2543bad4d2190ba05d1a5f892c3f50cab8db 100644 (file)
@@ -231,9 +231,6 @@ static int config_get(int id, const void **data, const struct sr_dev_inst *sdi)
        (void)sdi;
 
        switch (id) {
-       case SR_DI_HWCAPS:
-               *data = hwcaps;
-               break;
        case SR_CONF_SAMPLERATE:
                *data = &cur_samplerate;
                break;
@@ -298,6 +295,9 @@ static int config_list(int key, const void **data, const struct sr_dev_inst *sdi
        (void)sdi;
 
        switch (key) {
+       case SR_CONF_DEVICE_OPTIONS:
+               *data = hwcaps;
+               break;
        case SR_CONF_SAMPLERATE:
                *data = &samplerates;
                break;
index bf00b7352326c6ae281f9cfb9ea5d0f834069b76..dd9e7178ff738133f2cf44e43e066ff3025706ab 100644 (file)
@@ -289,9 +289,6 @@ static int config_get(int id, const void **data, const struct sr_dev_inst *sdi)
        case SR_DI_HWOPTS:
                *data = hwopts;
                break;
-       case SR_DI_HWCAPS:
-               *data = hwcaps;
-               break;
        default:
                return SR_ERR_ARG;
        }
@@ -342,6 +339,9 @@ static int config_list(int key, const void **data, const struct sr_dev_inst *sdi
        (void)sdi;
 
        switch (key) {
+       case SR_CONF_DEVICE_OPTIONS:
+               *data = hwcaps;
+               break;
        default:
                return SR_ERR_ARG;
        }
index 3b949940351798aed01b98c9fadd7709d654a829..b0f94c590db4e1649b444e9ce17433911780e5fc 100644 (file)
@@ -607,9 +607,6 @@ static int config_get(int id, const void **data, const struct sr_dev_inst *sdi)
        struct dev_context *devc;
 
        switch (id) {
-       case SR_DI_HWCAPS:
-               *data = hwcaps;
-               break;
        case SR_CONF_SAMPLERATE:
                if (sdi) {
                        devc = sdi->priv;
@@ -650,6 +647,9 @@ static int config_list(int key, const void **data, const struct sr_dev_inst *sdi
        (void)sdi;
 
        switch (key) {
+       case SR_CONF_DEVICE_OPTIONS:
+               *data = hwcaps;
+               break;
        case SR_CONF_SAMPLERATE:
                *data = &samplerates;
                break;
index 1e0a4a17a12d44cf18f97fb658d41d3b478c205c..65e7000c0245225b8b3938537bba0a112457f837 100644 (file)
@@ -429,9 +429,6 @@ static int config_get(int id, const void **data, const struct sr_dev_inst *sdi)
        (void)sdi;
 
        switch (id) {
-       case SR_DI_HWCAPS:
-               *data = hwcaps;
-               break;
        /* TODO remove this */
        case SR_CONF_SAMPLERATE:
                *data = &tmp;
@@ -568,6 +565,9 @@ static int config_list(int key, const void **data, const struct sr_dev_inst *sdi
        (void)sdi;
 
        switch (key) {
+       case SR_CONF_DEVICE_OPTIONS:
+               *data = hwcaps;
+               break;
        case SR_CONF_BUFFERSIZE:
                *data = buffersizes;
                break;
index 25932ac74106df886bc9aa7ad791aa62dbd72fd8..c9ccbfda1a967d9054b1bc05d8b659629000d809 100644 (file)
@@ -221,9 +221,6 @@ static int config_get(int id, const void **data, const struct sr_dev_inst *sdi)
        case SR_DI_HWOPTS:
                *data = hwopts;
                break;
-       case SR_DI_HWCAPS:
-               *data = hwcaps;
-               break;
        default:
                return SR_ERR_ARG;
        }
@@ -267,6 +264,9 @@ static int config_list(int key, const void **data, const struct sr_dev_inst *sdi
        (void)sdi;
 
        switch (key) {
+       case SR_CONF_DEVICE_OPTIONS:
+               *data = hwcaps;
+               break;
        default:
                return SR_ERR_ARG;
        }
index 77faf08b79fd4ed2d4918f27b28a9a905e0619bd..11ae88880df8008386c855146b4b9bcfd48af81a 100644 (file)
@@ -303,9 +303,6 @@ static int config_get(int id, const void **data, const struct sr_dev_inst *sdi)
        struct dev_context *devc;
 
        switch (id) {
-       case SR_DI_HWCAPS:
-               *data = hwcaps;
-               break;
        case SR_CONF_SAMPLERATE:
                if (sdi) {
                        devc = sdi->priv;
@@ -392,6 +389,9 @@ static int config_list(int key, const void **data, const struct sr_dev_inst *sdi
        (void)sdi;
 
        switch (key) {
+       case SR_CONF_DEVICE_OPTIONS:
+               *data = hwcaps;
+               break;
        case SR_CONF_SAMPLERATE:
                *data = &samplerates;
                break;
index 02945b8c533e25b37a4605f2ebd7f4355722087a..634a2a570344f84f307f5a8c467a1522b9fc86fa 100644 (file)
@@ -258,9 +258,6 @@ static int config_get(int id, const void **data, const struct sr_dev_inst *sdi)
        case SR_DI_HWOPTS:
                *data = hwopts;
                break;
-       case SR_DI_HWCAPS:
-               *data = hwcaps;
-               break;
        case SR_CONF_SAMPLERATE:
                if (sdi) {
                        devc = sdi->priv;
@@ -329,6 +326,9 @@ static int config_list(int key, const void **data, const struct sr_dev_inst *sdi
        (void)sdi;
 
        switch (key) {
+       case SR_CONF_DEVICE_OPTIONS:
+               *data = hwcaps;
+               break;
        case SR_CONF_SAMPLERATE:
                *data = &samplerates;
                break;
index 83323114fe412a467cdb45a6eafeceb1c979ef81..3e3aa54207e754656921878c57363392d0289f3e 100644 (file)
@@ -329,9 +329,6 @@ static int config_get(int id, const void **data, const struct sr_dev_inst *sdi)
        (void)sdi;
 
        switch (id) {
-       case SR_DI_HWCAPS:
-               *data = hwcaps;
-               break;
        default:
                return SR_ERR_ARG;
        }
@@ -433,6 +430,9 @@ static int config_list(int key, const void **data, const struct sr_dev_inst *sdi
        (void)sdi;
 
        switch (key) {
+       case SR_CONF_DEVICE_OPTIONS:
+               *data = hwcaps;
+               break;
        case SR_CONF_COUPLING:
                *data = coupling;
                break;
index ce37c9dc6f04039de47309269580a0c9e3bd0eda..7ca807c4238f97aef1e504a9056da4b651dec496 100644 (file)
@@ -381,9 +381,6 @@ static int config_get(int id, const void **data, const struct sr_dev_inst *sdi)
        case SR_DI_HWOPTS:
                *data = hwopts;
                break;
-       case SR_DI_HWCAPS:
-               *data = hwcaps;
-               break;
        default:
                return SR_ERR_ARG;
        }
@@ -429,6 +426,9 @@ static int config_list(int key, const void **data, const struct sr_dev_inst *sdi
        (void)sdi;
 
        switch (key) {
+       case SR_CONF_DEVICE_OPTIONS:
+               *data = hwcaps;
+               break;
        default:
                return SR_ERR_ARG;
        }
index aa3fe6ff32eb534499f2eef1c2e47d1ee5f75279..7f6066310147d04eea938ff69533422202dac9f0 100644 (file)
@@ -203,9 +203,6 @@ static int config_get(int id, const void **data, const struct sr_dev_inst *sdi)
        case SR_DI_HWOPTS:
                *data = hwopts;
                break;
-       case SR_DI_HWCAPS:
-               *data = hwcaps;
-               break;
        default:
                return SR_ERR_ARG;
        }
@@ -244,6 +241,9 @@ static int config_list(int key, const void **data, const struct sr_dev_inst *sdi
        (void)sdi;
 
        switch (key) {
+       case SR_CONF_DEVICE_OPTIONS:
+               *data = hwcaps;
+               break;
        default:
                return SR_ERR_ARG;
        }
index 7c4c6b89cd3cf5a8d109621971706b85c8911067..7511283823b145c95f3af1aca47ca5e520dc96a5 100644 (file)
@@ -196,10 +196,6 @@ static int config_get(int id, const void **data, const struct sr_dev_inst *sdi)
        case SR_DI_HWOPTS:
                *data = hwopts;
                break;
-       case SR_DI_HWCAPS:
-               *data = hwcaps;
-               sr_spew("%s: Returning hwcaps.", __func__);
-               break;
        case SR_CONF_SAMPLERATE:
                /* TODO: Get rid of this. */
                *data = NULL;
@@ -255,6 +251,9 @@ static int config_list(int key, const void **data, const struct sr_dev_inst *sdi
        (void)sdi;
 
        switch (key) {
+       case SR_CONF_DEVICE_OPTIONS:
+               *data = hwcaps;
+               break;
        default:
                return SR_ERR_ARG;
        }
index d930dbf09fe6ec3ec10237527393454d2b6bd1f3..1e8cd4ae1c0659748ca0769fed26403ce58004a3 100644 (file)
@@ -249,9 +249,6 @@ static int config_get(int id, const void **data, const struct sr_dev_inst *sdi)
        (void)sdi;
 
        switch (id) {
-       case SR_DI_HWCAPS:
-               *data = hwcaps;
-               break;
        default:
                return SR_ERR_ARG;
        }
@@ -304,6 +301,9 @@ static int config_list(int key, const void **data, const struct sr_dev_inst *sdi
        (void)sdi;
 
        switch (key) {
+       case SR_CONF_DEVICE_OPTIONS:
+               *data = hwcaps;
+               break;
        default:
                return SR_ERR_ARG;
        }
index 91e7c4a8da66271f4be91962748b3c47488e0094..7a72e7c42e994f9ee895a70bb0877bf379eda6c6 100644 (file)
@@ -534,9 +534,6 @@ static int config_get(int id, const void **data, const struct sr_dev_inst *sdi)
        struct dev_context *devc;
 
        switch (id) {
-       case SR_DI_HWCAPS:
-               *data = hwcaps;
-               break;
        case SR_CONF_SAMPLERATE:
                if (sdi) {
                        devc = sdi->priv;
@@ -647,6 +644,9 @@ static int config_list(int key, const void **data, const struct sr_dev_inst *sdi
        (void)sdi;
 
        switch (key) {
+       case SR_CONF_DEVICE_OPTIONS:
+               *data = hwcaps;
+               break;
        case SR_CONF_SAMPLERATE:
                *data = &samplerates;
                break;
index 439d4c78e9ac6ecdf2a4ef1ead932f288febf798..b413610339ed6b38f5e8e01a28c9643eda781509 100644 (file)
@@ -365,7 +365,7 @@ SR_API gboolean sr_driver_hwcap_exists(struct sr_dev_driver *driver, int hwcap)
                return FALSE;
        }
 
-       if (driver->config_get(SR_DI_HWCAPS, (const void **)&hwcaps, NULL) != SR_OK)
+       if (driver->config_list(SR_CONF_DEVICE_OPTIONS, (const void **)&hwcaps, NULL) != SR_OK)
                return FALSE;
 
        for (i = 0; hwcaps[i]; i++) {
index 7ee2fa384729ab90be146a6fa1ea25c525b3a23d..2b17a5f61ecf70710590eaef210525a6d96c510b 100644 (file)
@@ -388,7 +388,7 @@ enum {
        /** The device can measure humidity. */
        SR_CONF_HYGROMETER,
 
-       /*--- Driver options ------------------------------------------------*/
+       /*--- Driver scan options -------------------------------------------*/
 
        /**
         * Specification on how to connect to a device.
@@ -466,6 +466,12 @@ enum {
 
        /*--- Special stuff -------------------------------------------------*/
 
+       /** Scan options supported by the driver. */
+       SR_CONF_SCAN_OPTIONS,
+
+       /** Device options for a particular device. */
+       SR_CONF_DEVICE_OPTIONS,
+
        /** Session filename. */
        SR_CONF_SESSIONFILE = 40000,
 
@@ -552,8 +558,6 @@ enum {
 enum {
        /** A list of options supported by the driver. */
        SR_DI_HWOPTS = 10000,
-       /** A list of capabilities supported by the device. */
-       SR_DI_HWCAPS,
 };
 
 /*
index e4f6a9f424dfcdfdbe82d8a6642e44d9f55f92e8..f3cd4b6c8b57e3bff710fdb9e7b90ff590ee372e 100644 (file)
@@ -153,9 +153,6 @@ static int config_get(int id, const void **data, const struct sr_dev_inst *sdi)
        struct session_vdev *vdev;
 
        switch (id) {
-       case SR_DI_HWCAPS:
-               *data = hwcaps;
-               break;
        case SR_CONF_SAMPLERATE:
                if (sdi) {
                        vdev = sdi->priv;
@@ -207,6 +204,22 @@ static int config_set(int id, const void *value, const struct sr_dev_inst *sdi)
        return SR_OK;
 }
 
+static int config_list(int key, const void **data, const struct sr_dev_inst *sdi)
+{
+
+       (void)sdi;
+
+       switch (key) {
+       case SR_CONF_DEVICE_OPTIONS:
+               *data = hwcaps;
+               break;
+       default:
+               return SR_ERR_ARG;
+       }
+
+       return SR_OK;
+}
+
 static int hw_dev_acquisition_start(const struct sr_dev_inst *sdi,
                void *cb_data)
 {
@@ -274,6 +287,7 @@ SR_PRIV struct sr_dev_driver session_driver = {
        .cleanup = hw_cleanup,
        .config_get = config_get,
        .config_set = config_set,
+       .config_list = config_list,
        .dev_open = hw_dev_open,
        .dev_close = NULL,
        .dev_acquisition_start = hw_dev_acquisition_start,