]> sigrok.org Git - libsigrok.git/commitdiff
sr: s/config_set/dev_config_set/.
authorUwe Hermann <redacted>
Sat, 18 Feb 2012 11:11:15 +0000 (12:11 +0100)
committerUwe Hermann <redacted>
Sat, 18 Feb 2012 11:11:15 +0000 (12:11 +0100)
This functions is per-device-instance, so use dev_ as prefix as with
the other ones.

hardware/alsa/alsa.c
hardware/asix-sigma/asix-sigma.c
hardware/chronovu-la8/chronovu-la8.c
hardware/demo/demo.c
hardware/link-mso19/link-mso19.c
hardware/openbench-logic-sniffer/ols.c
hardware/saleae-logic/saleae-logic.c
hardware/zeroplus-logic-cube/zeroplus.c
session_driver.c
session_file.c
sigrok.h

index 7335bdb5d61a6e6d7a146695ebfa49fa62ddfc4e..9e33d4309be1302aee90e7b0e630e33c01348dbb 100644 (file)
@@ -209,7 +209,7 @@ static int *hw_hwcap_get_all(void)
        return hwcaps;
 }
 
-static int hw_config_set(int dev_index, int hwcap, void *value)
+static int hw_dev_config_set(int dev_index, int hwcap, void *value)
 {
        struct sr_dev_inst *sdi;
        struct alsa *alsa;
@@ -403,7 +403,7 @@ SR_PRIV struct sr_dev_plugin alsa_plugin_info = {
        .dev_info_get = hw_dev_info_get,
        .dev_status_get = hw_dev_status_get,
        .hwcap_get_all = hw_hwcap_get_all,
-       .config_set = hw_config_set,
+       .dev_config_set = hw_dev_config_set,
        .dev_acquisition_start = hw_dev_acquisition_start,
        .dev_acquisition_stop = hw_dev_acquisition_stop,
 };
index 355a35877b2aa525601bd05a9efba15b2210d6fe..8a947c10f15af683a640c22b65e62283a04e75f9 100644 (file)
@@ -797,7 +797,7 @@ static int *hw_hwcap_get_all(void)
        return hwcaps;
 }
 
-static int hw_config_set(int dev_index, int hwcap, void *value)
+static int hw_dev_config_set(int dev_index, int hwcap, void *value)
 {
        struct sr_dev_inst *sdi;
        struct sigma *sigma;
@@ -1422,7 +1422,7 @@ SR_PRIV struct sr_dev_plugin asix_sigma_plugin_info = {
        .dev_info_get = hw_dev_info_get,
        .dev_status_get = hw_dev_status_get,
        .hwcap_get_all = hw_hwcap_get_all,
-       .config_set = hw_config_set,
+       .dev_config_set = hw_dev_config_set,
        .dev_dev_acquisition_start = hw_dev_dev_acquisition_start,
        .dev_dev_acquisition_stop = hw_dev_dev_acquisition_stop,
 };
index 8855002ca234a88dda35b1bf975bc927d9975922..6de27a49f6b207a8cb9bc49673a6873d451a997e 100644 (file)
@@ -762,7 +762,7 @@ static int *hw_hwcap_get_all(void)
        return hwcaps;
 }
 
-static int hw_config_set(int dev_index, int hwcap, void *value)
+static int hw_dev_config_set(int dev_index, int hwcap, void *value)
 {
        struct sr_dev_inst *sdi;
        struct la8 *la8;
@@ -1124,7 +1124,7 @@ SR_PRIV struct sr_dev_plugin chronovu_la8_plugin_info = {
        .dev_info_get = hw_dev_info_get,
        .dev_status_get = hw_dev_status_get,
        .hwcap_get_all = hw_hwcap_get_all,
-       .config_set = hw_config_set,
+       .dev_config_set = hw_dev_config_set,
        .dev_acquisition_start = hw_dev_acquisition_start,
        .dev_acquisition_stop = hw_dev_acquisition_stop,
 };
index 448c148bef15744f94ef643d9ae0a35e6907def5..6ae0d80da960e8f57ea2f358ca6d32a41e835333 100644 (file)
@@ -227,7 +227,7 @@ static int *hw_hwcap_get_all(void)
        return hwcaps;
 }
 
-static int hw_config_set(int dev_index, int hwcap, void *value)
+static int hw_dev_config_set(int dev_index, int hwcap, void *value)
 {
        int ret;
        char *stropt;
@@ -500,7 +500,7 @@ SR_PRIV struct sr_dev_plugin demo_plugin_info = {
        .dev_info_get = hw_dev_info_get,
        .dev_status_get = hw_dev_status_get,
        .hwcap_get_all = hw_hwcap_get_all,
-       .config_set = hw_config_set,
+       .dev_config_set = hw_dev_config_set,
        .dev_acquisition_start = hw_dev_acquisition_start,
        .dev_acquisition_stop = hw_dev_acquisition_stop,
 };
index 0869df6233cc36745bd37c6e7193b4e10522d71e..37f0a96bf9aa9d9609fe3c8e0492677655f6302a 100644 (file)
@@ -650,7 +650,7 @@ static int *hw_hwcap_get_all(void)
        return hwcaps;
 }
 
-static int hw_config_set(int dev_index, int hwcap, void *value)
+static int hw_dev_config_set(int dev_index, int hwcap, void *value)
 {
        struct sr_dev_inst *sdi;
 
@@ -840,7 +840,7 @@ SR_PRIV struct sr_dev_plugin link_mso19_plugin_info = {
        .dev_info_get = hw_dev_info_get,
        .dev_status_get = hw_dev_status_get,
        .hwcap_get_all = hw_hwcap_get_all,
-       .config_set = hw_config_set,
+       .dev_config_set = hw_dev_config_set,
        .dev_acquisition_start = hw_dev_acquisition_start,
        .dev_acquisition_stop = hw_dev_acquisition_stop,
 };
index f7fcd5877a76d9522c3bc3f06760b06382674bac..88891c089bdbe33cf3956d2393a5fea0845d9ace 100644 (file)
@@ -605,7 +605,7 @@ static int *hw_hwcap_get_all(void)
        return hwcaps;
 }
 
-static int config_set_samplerate(struct sr_dev_inst *sdi, uint64_t samplerate)
+static int set_samplerate(struct sr_dev_inst *sdi, uint64_t samplerate)
 {
        struct ols_dev *ols;
 
@@ -637,7 +637,7 @@ static int config_set_samplerate(struct sr_dev_inst *sdi, uint64_t samplerate)
        return SR_OK;
 }
 
-static int hw_config_set(int dev_index, int hwcap, void *value)
+static int hw_dev_config_set(int dev_index, int hwcap, void *value)
 {
        struct sr_dev_inst *sdi;
        struct ols_dev *ols;
@@ -654,7 +654,7 @@ static int hw_config_set(int dev_index, int hwcap, void *value)
        switch (hwcap) {
        case SR_HWCAP_SAMPLERATE:
                tmp_u64 = value;
-               ret = config_set_samplerate(sdi, *tmp_u64);
+               ret = set_samplerate(sdi, *tmp_u64);
                break;
        case SR_HWCAP_PROBECONFIG:
                ret = configure_probes(ols, (GSList *) value);
@@ -1048,7 +1048,7 @@ SR_PRIV struct sr_dev_plugin ols_plugin_info = {
        .dev_info_get = hw_dev_info_get,
        .dev_status_get = hw_dev_status_get,
        .hwcap_get_all = hw_hwcap_get_all,
-       .config_set = hw_config_set,
+       .dev_config_set = hw_dev_config_set,
        .dev_acquisition_start = hw_dev_acquisition_start,
        .dev_acquisition_stop = hw_dev_acquisition_stop,
 };
index 8307220578ba0084b0b5c7e6de9b9fc541e3cc3d..33707639ac37f73506091f9605332d1e89a5b971 100644 (file)
@@ -93,7 +93,7 @@ static libusb_context *usb_context = NULL;
 
 static int new_saleae_logic_firmware = 0;
 
-static int hw_config_set(int dev_index, int hwcap, void *value);
+static int hw_dev_config_set(int dev_index, int hwcap, void *value);
 static int hw_dev_acquisition_stop(int dev_index, gpointer session_dev_id);
 
 /**
@@ -440,7 +440,7 @@ static int hw_dev_open(int dev_index)
 
        if (fx2->cur_samplerate == 0) {
                /* Samplerate hasn't been set; default to the slowest one. */
-               if (hw_config_set(dev_index, SR_HWCAP_SAMPLERATE,
+               if (hw_dev_config_set(dev_index, SR_HWCAP_SAMPLERATE,
                    &supported_samplerates[0]) == SR_ERR)
                        return SR_ERR;
        }
@@ -591,7 +591,7 @@ static uint8_t new_firmware_divider_value(uint64_t samplerate)
        return 0;
 }
 
-static int config_set_samplerate(struct sr_dev_inst *sdi, uint64_t samplerate)
+static int set_samplerate(struct sr_dev_inst *sdi, uint64_t samplerate)
 {
        struct fx2_dev *fx2;
        uint8_t divider;
@@ -627,7 +627,7 @@ static int config_set_samplerate(struct sr_dev_inst *sdi, uint64_t samplerate)
        return SR_OK;
 }
 
-static int hw_config_set(int dev_index, int hwcap, void *value)
+static int hw_dev_config_set(int dev_index, int hwcap, void *value)
 {
        struct sr_dev_inst *sdi;
        struct fx2_dev *fx2;
@@ -640,7 +640,7 @@ static int hw_config_set(int dev_index, int hwcap, void *value)
 
        if (hwcap == SR_HWCAP_SAMPLERATE) {
                tmp_u64 = value;
-               ret = config_set_samplerate(sdi, *tmp_u64);
+               ret = set_samplerate(sdi, *tmp_u64);
        } else if (hwcap == SR_HWCAP_PROBECONFIG) {
                ret = configure_probes(fx2, (GSList *) value);
        } else if (hwcap == SR_HWCAP_LIMIT_SAMPLES) {
@@ -901,7 +901,7 @@ SR_PRIV struct sr_dev_plugin saleae_logic_plugin_info = {
        .dev_info_get = hw_dev_info_get,
        .dev_status_get = hw_dev_status_get,
        .hwcap_get_all = hw_hwcap_get_all,
-       .config_set = hw_config_set,
+       .dev_config_set = hw_dev_config_set,
        .dev_acquisition_start = hw_dev_acquisition_start,
        .dev_acquisition_stop = hw_dev_acquisition_stop,
 };
index 7390ec7cf25fded02cf6fb532d2fb8791f250fae..79edc6deb67654306809801eb92e4061f3b905c2 100644 (file)
@@ -166,7 +166,7 @@ struct zp {
        struct sr_usb_dev_inst *usb;
 };
 
-static int hw_config_set(int dev_index, int hwcap, void *value);
+static int hw_dev_config_set(int dev_index, int hwcap, void *value);
 
 static unsigned int get_memory_size(int type)
 {
@@ -462,7 +462,7 @@ static int hw_dev_open(int dev_index)
 
        if (zp->cur_samplerate == 0) {
                /* Samplerate hasn't been set. Default to the slowest one. */
-               if (hw_config_set(dev_index, SR_HWCAP_SAMPLERATE,
+               if (hw_dev_config_set(dev_index, SR_HWCAP_SAMPLERATE,
                     &samplerates.list[0]) == SR_ERR)
                        return SR_ERR;
        }
@@ -568,7 +568,7 @@ static int *hw_hwcap_get_all(void)
        return hwcaps;
 }
 
-static int config_set_samplerate(struct sr_dev_inst *sdi, uint64_t samplerate)
+static int set_samplerate(struct sr_dev_inst *sdi, uint64_t samplerate)
 {
        struct zp *zp;
 
@@ -596,7 +596,7 @@ static int config_set_samplerate(struct sr_dev_inst *sdi, uint64_t samplerate)
        return SR_OK;
 }
 
-static int hw_config_set(int dev_index, int hwcap, void *value)
+static int hw_dev_config_set(int dev_index, int hwcap, void *value)
 {
        struct sr_dev_inst *sdi;
        uint64_t *tmp_u64;
@@ -615,7 +615,7 @@ static int hw_config_set(int dev_index, int hwcap, void *value)
        switch (hwcap) {
        case SR_HWCAP_SAMPLERATE:
                tmp_u64 = value;
-               return config_set_samplerate(sdi, *tmp_u64);
+               return set_samplerate(sdi, *tmp_u64);
        case SR_HWCAP_PROBECONFIG:
                return configure_probes(sdi, (GSList *)value);
        case SR_HWCAP_LIMIT_SAMPLES:
@@ -739,7 +739,7 @@ SR_PRIV struct sr_dev_plugin zeroplus_logic_cube_plugin_info = {
        .dev_info_get = hw_dev_info_get,
        .dev_status_get = hw_dev_status_get,
        .hwcap_get_all = hw_hwcap_get_all,
-       .config_set = hw_config_set,
+       .dev_config_set = hw_dev_config_set,
        .dev_acquisition_start = hw_dev_acquisition_start,
        .dev_acquisition_stop = hw_dev_acquisition_stop,
 };
index 17a8473c0973259c37ae36ced750fff85926cfaf..efe68a4d5f48e652b0c7a76b9fb77e26a497255b 100644 (file)
@@ -232,7 +232,7 @@ static int *hw_hwcap_get_all(void)
        return hwcaps;
 }
 
-static int hw_config_set(int dev_index, int hwcap, void *value)
+static int hw_dev_config_set(int dev_index, int hwcap, void *value)
 {
        struct session_vdev *vdev;
        uint64_t *tmp_u64;
@@ -342,7 +342,7 @@ SR_PRIV struct sr_dev_plugin session_driver = {
        .dev_info_get = hw_dev_info_get,
        .dev_status_get = hw_dev_status_get,
        .hwcap_get_all = hw_hwcap_get_all,
-       .config_set = hw_config_set,
+       .dev_config_set = hw_dev_config_set,
        .dev_acquisition_start = hw_dev_acquisition_start,
        .dev_acquisition_stop = NULL,
 };
index e4f41a5e9c7c18b747c43a4dc5f0874434fb9c39..259472e55ceef57fba4482f26515adf321ca24cb 100644 (file)
@@ -120,17 +120,17 @@ SR_API int sr_session_load(const char *filename)
                                                /* first device, init the plugin */
                                                dev->plugin->init((char *)filename);
                                        sr_session_dev_add(dev);
-                                       dev->plugin->config_set(devcnt, SR_HWCAP_CAPTUREFILE, val);
+                                       dev->plugin->dev_config_set(devcnt, SR_HWCAP_CAPTUREFILE, val);
                                        g_ptr_array_add(capturefiles, val);
                                } else if (!strcmp(keys[j], "samplerate")) {
                                        sr_parse_sizestring(val, &tmp_u64);
-                                       dev->plugin->config_set(devcnt, SR_HWCAP_SAMPLERATE, &tmp_u64);
+                                       dev->plugin->dev_config_set(devcnt, SR_HWCAP_SAMPLERATE, &tmp_u64);
                                } else if (!strcmp(keys[j], "unitsize")) {
                                        tmp_u64 = strtoull(val, NULL, 10);
-                                       dev->plugin->config_set(devcnt, SR_HWCAP_CAPTURE_UNITSIZE, &tmp_u64);
+                                       dev->plugin->dev_config_set(devcnt, SR_HWCAP_CAPTURE_UNITSIZE, &tmp_u64);
                                } else if (!strcmp(keys[j], "total probes")) {
                                        total_probes = strtoull(val, NULL, 10);
-                                       dev->plugin->config_set(devcnt, SR_HWCAP_CAPTURE_NUM_PROBES, &total_probes);
+                                       dev->plugin->dev_config_set(devcnt, SR_HWCAP_CAPTURE_NUM_PROBES, &total_probes);
                                        for (p = 0; p < total_probes; p++) {
                                                snprintf(probename, SR_MAX_PROBENAME_LEN, "%" PRIu64, p);
                                                sr_dev_probe_add(dev, probename);
index d1ace96d5bf74efa6dc59d692eb728b6121d99ee..10a483f377fb6ee47d3b245856c831f725f515c3 100644 (file)
--- a/sigrok.h
+++ b/sigrok.h
@@ -94,7 +94,7 @@ extern "C" {
 
 typedef int (*sr_receive_data_callback) (int fd, int revents, void *user_data);
 
-/* Data types used by hardware plugins for config_set() */
+/* Data types used by hardware plugins for dev_config_set() */
 enum {
        SR_T_UINT64,
        SR_T_CHAR,
@@ -352,7 +352,7 @@ struct sr_dev_plugin {
        void *(*dev_info_get) (int dev_index, int dev_info_id);
        int (*dev_status_get) (int dev_index);
        int *(*hwcap_get_all) (void);
-       int (*config_set) (int dev_index, int hwcap, void *value);
+       int (*dev_config_set) (int dev_index, int hwcap, void *value);
        int (*dev_acquisition_start) (int dev_index, gpointer session_dev_id);
        int (*dev_acquisition_stop) (int dev_index, gpointer session_dev_id);
 };