From: Uwe Hermann Date: Sat, 18 Feb 2012 11:11:15 +0000 (+0100) Subject: sr: s/config_set/dev_config_set/. X-Git-Tag: libsigrok-0.1.0~107 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=a9a245b428cb9645d73044f6741818d2499efefc;p=libsigrok.git sr: s/config_set/dev_config_set/. This functions is per-device-instance, so use dev_ as prefix as with the other ones. --- diff --git a/hardware/alsa/alsa.c b/hardware/alsa/alsa.c index 7335bdb5..9e33d430 100644 --- a/hardware/alsa/alsa.c +++ b/hardware/alsa/alsa.c @@ -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, }; diff --git a/hardware/asix-sigma/asix-sigma.c b/hardware/asix-sigma/asix-sigma.c index 355a3587..8a947c10 100644 --- a/hardware/asix-sigma/asix-sigma.c +++ b/hardware/asix-sigma/asix-sigma.c @@ -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, }; diff --git a/hardware/chronovu-la8/chronovu-la8.c b/hardware/chronovu-la8/chronovu-la8.c index 8855002c..6de27a49 100644 --- a/hardware/chronovu-la8/chronovu-la8.c +++ b/hardware/chronovu-la8/chronovu-la8.c @@ -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, }; diff --git a/hardware/demo/demo.c b/hardware/demo/demo.c index 448c148b..6ae0d80d 100644 --- a/hardware/demo/demo.c +++ b/hardware/demo/demo.c @@ -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, }; diff --git a/hardware/link-mso19/link-mso19.c b/hardware/link-mso19/link-mso19.c index 0869df62..37f0a96b 100644 --- a/hardware/link-mso19/link-mso19.c +++ b/hardware/link-mso19/link-mso19.c @@ -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, }; diff --git a/hardware/openbench-logic-sniffer/ols.c b/hardware/openbench-logic-sniffer/ols.c index f7fcd587..88891c08 100644 --- a/hardware/openbench-logic-sniffer/ols.c +++ b/hardware/openbench-logic-sniffer/ols.c @@ -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, }; diff --git a/hardware/saleae-logic/saleae-logic.c b/hardware/saleae-logic/saleae-logic.c index 83072205..33707639 100644 --- a/hardware/saleae-logic/saleae-logic.c +++ b/hardware/saleae-logic/saleae-logic.c @@ -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, }; diff --git a/hardware/zeroplus-logic-cube/zeroplus.c b/hardware/zeroplus-logic-cube/zeroplus.c index 7390ec7c..79edc6de 100644 --- a/hardware/zeroplus-logic-cube/zeroplus.c +++ b/hardware/zeroplus-logic-cube/zeroplus.c @@ -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, }; diff --git a/session_driver.c b/session_driver.c index 17a8473c..efe68a4d 100644 --- a/session_driver.c +++ b/session_driver.c @@ -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, }; diff --git a/session_file.c b/session_file.c index e4f41a5e..259472e5 100644 --- a/session_file.c +++ b/session_file.c @@ -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); diff --git a/sigrok.h b/sigrok.h index d1ace96d..10a483f3 100644 --- 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); };