supported_samplerates,
};
-/* List of struct sr_dev_inst, maintained by opendev()/closedev(). */
+/* List of struct sr_dev_inst, maintained by dev_open()/dev_close(). */
static GSList *dev_insts = NULL;
static libusb_context *usb_context = NULL;
static int new_saleae_logic_firmware = 0;
-static int hw_set_configuration(int dev_index, int hwcap, void *value);
-static int hw_stop_acquisition(int dev_index, gpointer session_dev_id);
+static int hw_config_set(int dev_index, int hwcap, void *value);
+static int hw_dev_acquisition_stop(int dev_index, gpointer session_dev_id);
/**
* Check the USB configuration to determine if this is a Saleae Logic.
return devcnt;
}
-static int hw_opendev(int dev_index)
+static int hw_dev_open(int dev_index)
{
GTimeVal cur_time;
struct sr_dev_inst *sdi;
if (fx2->cur_samplerate == 0) {
/* Samplerate hasn't been set; default to the slowest one. */
- if (hw_set_configuration(dev_index, SR_HWCAP_SAMPLERATE,
+ if (hw_config_set(dev_index, SR_HWCAP_SAMPLERATE,
&supported_samplerates[0]) == SR_ERR)
return SR_ERR;
}
return SR_OK;
}
-static int hw_closedev(int dev_index)
+static int hw_dev_close(int dev_index)
{
struct sr_dev_inst *sdi;
return ret;
}
-static void *hw_get_dev_info(int dev_index, int dev_info_id)
+static void *hw_dev_info_get(int dev_index, int dev_info_id)
{
struct sr_dev_inst *sdi;
struct fx2_dev *fx2;
return info;
}
-static int hw_get_status(int dev_index)
+static int hw_dev_status_get(int dev_index)
{
struct sr_dev_inst *sdi;
return 0;
}
-static int set_configuration_samplerate(struct sr_dev_inst *sdi,
- uint64_t samplerate)
+static int config_set_samplerate(struct sr_dev_inst *sdi, uint64_t samplerate)
{
struct fx2_dev *fx2;
uint8_t divider;
return SR_OK;
}
-static int hw_set_configuration(int dev_index, int hwcap, void *value)
+static int hw_config_set(int dev_index, int hwcap, void *value)
{
struct sr_dev_inst *sdi;
struct fx2_dev *fx2;
if (hwcap == SR_HWCAP_SAMPLERATE) {
tmp_u64 = value;
- ret = set_configuration_samplerate(sdi, *tmp_u64);
+ ret = config_set_samplerate(sdi, *tmp_u64);
} else if (hwcap == SR_HWCAP_PROBECONFIG) {
ret = configure_probes(fx2, (GSList *) value);
} else if (hwcap == SR_HWCAP_LIMIT_SAMPLES) {
int cur_buflen, trigger_offset, i;
unsigned char *cur_buf, *new_buf;
- /* hw_stop_acquisition() is telling us to stop. */
+ /* hw_dev_acquisition_stop() is telling us to stop. */
if (transfer == NULL)
num_samples = -1;
* The FX2 gave up. End the acquisition, the frontend
* will work out that the samplecount is short.
*/
- hw_stop_acquisition(-1, fx2->session_data);
+ hw_dev_acquisition_stop(-1, fx2->session_data);
}
return;
} else {
num_samples += cur_buflen;
if (fx2->limit_samples && (unsigned int) num_samples > fx2->limit_samples) {
- hw_stop_acquisition(-1, fx2->session_data);
+ hw_dev_acquisition_stop(-1, fx2->session_data);
}
} else {
/*
}
}
-static int hw_start_acquisition(int dev_index, gpointer session_data)
+static int hw_dev_acquisition_start(int dev_index, gpointer session_data)
{
struct sr_dev_inst *sdi;
struct sr_datafeed_packet *packet;
}
/* This stops acquisition on ALL devices, ignoring dev_index. */
-static int hw_stop_acquisition(int dev_index, gpointer session_data)
+static int hw_dev_acquisition_stop(int dev_index, gpointer session_data)
{
struct sr_datafeed_packet packet;
.api_version = 1,
.init = hw_init,
.cleanup = hw_cleanup,
- .opendev = hw_opendev,
- .closedev = hw_closedev,
- .get_dev_info = hw_get_dev_info,
- .get_status = hw_get_status,
+ .dev_open = hw_dev_open,
+ .dev_close = hw_dev_close,
+ .dev_info_get = hw_dev_info_get,
+ .dev_status_get = hw_dev_status_get,
.hwcap_get_all = hw_hwcap_get_all,
- .set_configuration = hw_set_configuration,
- .start_acquisition = hw_start_acquisition,
- .stop_acquisition = hw_stop_acquisition,
+ .config_set = hw_config_set,
+ .dev_acquisition_start = hw_dev_acquisition_start,
+ .dev_acquisition_stop = hw_dev_acquisition_stop,
};