sr: s/acquisition_*/dev_acquisition_*/.

These functions are per-device-instance, so use dev_ as prefix as with
the other ones.
This commit is contained in:
Uwe Hermann 2012-02-18 12:03:49 +01:00
parent e7eb703fff
commit 69040b7c8f
11 changed files with 50 additions and 50 deletions

View File

@ -290,7 +290,7 @@ static int receive_data(int fd, int revents, void *user_data)
return TRUE; return TRUE;
} }
static int hw_acquisition_start(int dev_index, gpointer session_dev_id) static int hw_dev_acquisition_start(int dev_index, gpointer session_dev_id)
{ {
struct sr_dev_inst *sdi; struct sr_dev_inst *sdi;
struct alsa *alsa; struct alsa *alsa;
@ -383,7 +383,7 @@ static int hw_acquisition_start(int dev_index, gpointer session_dev_id)
return SR_OK; return SR_OK;
} }
static int hw_acquisition_stop(int dev_index, gpointer session_dev_id) static int hw_dev_acquisition_stop(int dev_index, gpointer session_dev_id)
{ {
/* Avoid compiler warnings. */ /* Avoid compiler warnings. */
dev_index = dev_index; dev_index = dev_index;
@ -404,6 +404,6 @@ SR_PRIV struct sr_dev_plugin alsa_plugin_info = {
.dev_status_get = hw_dev_status_get, .dev_status_get = hw_dev_status_get,
.hwcap_get_all = hw_hwcap_get_all, .hwcap_get_all = hw_hwcap_get_all,
.config_set = hw_config_set, .config_set = hw_config_set,
.acquisition_start = hw_acquisition_start, .dev_acquisition_start = hw_dev_acquisition_start,
.acquisition_stop = hw_acquisition_stop, .dev_acquisition_stop = hw_dev_acquisition_stop,
}; };

View File

@ -118,7 +118,7 @@ static const char *firmware_files[] = {
"asix-sigma-phasor.fw", /* Frequency counter */ "asix-sigma-phasor.fw", /* Frequency counter */
}; };
static int hw_acquisition_stop(int dev_index, gpointer session_data); static int hw_dev_dev_acquisition_stop(int dev_index, gpointer session_data);
static int sigma_read(void *buf, size_t size, struct sigma *sigma) static int sigma_read(void *buf, size_t size, struct sigma *sigma)
{ {
@ -1034,7 +1034,7 @@ static int receive_data(int fd, int revents, void *session_data)
if (running_msec < sigma->limit_msec && numchunks < 32767) if (running_msec < sigma->limit_msec && numchunks < 32767)
return FALSE; return FALSE;
hw_acquisition_stop(sdi->index, session_data); hw_dev_dev_acquisition_stop(sdi->index, session_data);
return FALSE; return FALSE;
@ -1252,7 +1252,7 @@ static int build_basic_trigger(struct triggerlut *lut, struct sigma *sigma)
return SR_OK; return SR_OK;
} }
static int hw_acquisition_start(int dev_index, gpointer session_data) static int hw_dev_dev_acquisition_start(int dev_index, gpointer session_data)
{ {
struct sr_dev_inst *sdi; struct sr_dev_inst *sdi;
struct sigma *sigma; struct sigma *sigma;
@ -1369,7 +1369,7 @@ static int hw_acquisition_start(int dev_index, gpointer session_data)
return SR_OK; return SR_OK;
} }
static int hw_acquisition_stop(int dev_index, gpointer session_data) static int hw_dev_dev_acquisition_stop(int dev_index, gpointer session_data)
{ {
struct sr_dev_inst *sdi; struct sr_dev_inst *sdi;
struct sigma *sigma; struct sigma *sigma;
@ -1423,6 +1423,6 @@ SR_PRIV struct sr_dev_plugin asix_sigma_plugin_info = {
.dev_status_get = hw_dev_status_get, .dev_status_get = hw_dev_status_get,
.hwcap_get_all = hw_hwcap_get_all, .hwcap_get_all = hw_hwcap_get_all,
.config_set = hw_config_set, .config_set = hw_config_set,
.acquisition_start = hw_acquisition_start, .dev_dev_acquisition_start = hw_dev_dev_acquisition_start,
.acquisition_stop = hw_acquisition_stop, .dev_dev_acquisition_stop = hw_dev_dev_acquisition_stop,
}; };

View File

@ -136,7 +136,7 @@ static int hwcaps[] = {
/* Function prototypes. */ /* Function prototypes. */
static int la8_close_usb_reset_sequencer(struct la8 *la8); static int la8_close_usb_reset_sequencer(struct la8 *la8);
static int hw_acquisition_stop(int dev_index, gpointer session_data); static int hw_dev_acquisition_stop(int dev_index, gpointer session_data);
static int la8_reset(struct la8 *la8); static int la8_reset(struct la8 *la8);
static void fill_supported_samplerates_if_needed(void) static void fill_supported_samplerates_if_needed(void)
@ -990,7 +990,7 @@ static int receive_data(int fd, int revents, void *session_data)
/* Get one block of data. */ /* Get one block of data. */
if ((ret = la8_read_block(la8)) < 0) { if ((ret = la8_read_block(la8)) < 0) {
sr_err("la8: %s: la8_read_block error: %d", __func__, ret); sr_err("la8: %s: la8_read_block error: %d", __func__, ret);
hw_acquisition_stop(sdi->index, session_data); hw_dev_acquisition_stop(sdi->index, session_data);
return FALSE; return FALSE;
} }
@ -1006,13 +1006,13 @@ static int receive_data(int fd, int revents, void *session_data)
for (i = 0; i < NUM_BLOCKS; i++) for (i = 0; i < NUM_BLOCKS; i++)
send_block_to_session_bus(la8, i); send_block_to_session_bus(la8, i);
hw_acquisition_stop(sdi->index, session_data); hw_dev_acquisition_stop(sdi->index, session_data);
// return FALSE; /* FIXME? */ // return FALSE; /* FIXME? */
return TRUE; return TRUE;
} }
static int hw_acquisition_start(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_dev_inst *sdi;
struct la8 *la8; struct la8 *la8;
@ -1087,7 +1087,7 @@ static int hw_acquisition_start(int dev_index, gpointer session_data)
return SR_OK; return SR_OK;
} }
static int hw_acquisition_stop(int dev_index, gpointer session_data) static int hw_dev_acquisition_stop(int dev_index, gpointer session_data)
{ {
struct sr_dev_inst *sdi; struct sr_dev_inst *sdi;
struct la8 *la8; struct la8 *la8;
@ -1125,6 +1125,6 @@ SR_PRIV struct sr_dev_plugin chronovu_la8_plugin_info = {
.dev_status_get = hw_dev_status_get, .dev_status_get = hw_dev_status_get,
.hwcap_get_all = hw_hwcap_get_all, .hwcap_get_all = hw_hwcap_get_all,
.config_set = hw_config_set, .config_set = hw_config_set,
.acquisition_start = hw_acquisition_start, .dev_acquisition_start = hw_dev_acquisition_start,
.acquisition_stop = hw_acquisition_stop, .dev_acquisition_stop = hw_dev_acquisition_stop,
}; };

View File

@ -134,7 +134,7 @@ static int default_pattern = PATTERN_SIGROK;
static GThread *my_thread; static GThread *my_thread;
static int thread_running; static int thread_running;
static int hw_acquisition_stop(int dev_index, gpointer session_data); static int hw_dev_acquisition_stop(int dev_index, gpointer session_data);
static int hw_init(const char *devinfo) static int hw_init(const char *devinfo)
{ {
@ -405,7 +405,7 @@ static int receive_data(int fd, int revents, void *session_data)
return TRUE; return TRUE;
} }
static int hw_acquisition_start(int dev_index, gpointer session_data) static int hw_dev_acquisition_start(int dev_index, gpointer session_data)
{ {
struct sr_datafeed_packet *packet; struct sr_datafeed_packet *packet;
struct sr_datafeed_header *header; struct sr_datafeed_header *header;
@ -477,7 +477,7 @@ static int hw_acquisition_start(int dev_index, gpointer session_data)
return SR_OK; return SR_OK;
} }
static int hw_acquisition_stop(int dev_index, gpointer session_data) static int hw_dev_acquisition_stop(int dev_index, gpointer session_data)
{ {
/* Avoid compiler warnings. */ /* Avoid compiler warnings. */
(void)dev_index; (void)dev_index;
@ -501,6 +501,6 @@ SR_PRIV struct sr_dev_plugin demo_plugin_info = {
.dev_status_get = hw_dev_status_get, .dev_status_get = hw_dev_status_get,
.hwcap_get_all = hw_hwcap_get_all, .hwcap_get_all = hw_hwcap_get_all,
.config_set = hw_config_set, .config_set = hw_config_set,
.acquisition_start = hw_acquisition_start, .dev_acquisition_start = hw_dev_acquisition_start,
.acquisition_stop = hw_acquisition_stop, .dev_acquisition_stop = hw_dev_acquisition_stop,
}; };

View File

@ -743,7 +743,7 @@ static int receive_data(int fd, int revents, void *user_data)
return TRUE; return TRUE;
} }
static int hw_acquisition_start(int dev_index, gpointer session_dev_id) static int hw_dev_acquisition_start(int dev_index, gpointer session_dev_id)
{ {
struct sr_dev_inst *sdi; struct sr_dev_inst *sdi;
struct mso *mso; struct mso *mso;
@ -817,7 +817,7 @@ static int hw_acquisition_start(int dev_index, gpointer session_dev_id)
} }
/* FIXME */ /* FIXME */
static int hw_acquisition_stop(int dev_index, gpointer session_dev_id) static int hw_dev_acquisition_stop(int dev_index, gpointer session_dev_id)
{ {
struct sr_datafeed_packet packet; struct sr_datafeed_packet packet;
@ -841,6 +841,6 @@ SR_PRIV struct sr_dev_plugin link_mso19_plugin_info = {
.dev_status_get = hw_dev_status_get, .dev_status_get = hw_dev_status_get,
.hwcap_get_all = hw_hwcap_get_all, .hwcap_get_all = hw_hwcap_get_all,
.config_set = hw_config_set, .config_set = hw_config_set,
.acquisition_start = hw_acquisition_start, .dev_acquisition_start = hw_dev_acquisition_start,
.acquisition_stop = hw_acquisition_stop, .dev_acquisition_stop = hw_dev_acquisition_stop,
}; };

View File

@ -871,7 +871,7 @@ static int receive_data(int fd, int revents, void *session_data)
return TRUE; return TRUE;
} }
static int hw_acquisition_start(int dev_index, gpointer session_data) static int hw_dev_acquisition_start(int dev_index, gpointer session_data)
{ {
struct sr_datafeed_packet *packet; struct sr_datafeed_packet *packet;
struct sr_datafeed_header *header; struct sr_datafeed_header *header;
@ -1024,7 +1024,7 @@ static int hw_acquisition_start(int dev_index, gpointer session_data)
return SR_OK; return SR_OK;
} }
static int hw_acquisition_stop(int dev_index, gpointer session_dev_id) static int hw_dev_acquisition_stop(int dev_index, gpointer session_dev_id)
{ {
struct sr_datafeed_packet packet; struct sr_datafeed_packet packet;
@ -1049,6 +1049,6 @@ SR_PRIV struct sr_dev_plugin ols_plugin_info = {
.dev_status_get = hw_dev_status_get, .dev_status_get = hw_dev_status_get,
.hwcap_get_all = hw_hwcap_get_all, .hwcap_get_all = hw_hwcap_get_all,
.config_set = hw_config_set, .config_set = hw_config_set,
.acquisition_start = hw_acquisition_start, .dev_acquisition_start = hw_dev_acquisition_start,
.acquisition_stop = hw_acquisition_stop, .dev_acquisition_stop = hw_dev_acquisition_stop,
}; };

View File

@ -94,7 +94,7 @@ static libusb_context *usb_context = NULL;
static int new_saleae_logic_firmware = 0; static int new_saleae_logic_firmware = 0;
static int hw_config_set(int dev_index, int hwcap, void *value); static int hw_config_set(int dev_index, int hwcap, void *value);
static int hw_acquisition_stop(int dev_index, gpointer session_dev_id); 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. * Check the USB configuration to determine if this is a Saleae Logic.
@ -680,7 +680,7 @@ static void receive_transfer(struct libusb_transfer *transfer)
int cur_buflen, trigger_offset, i; int cur_buflen, trigger_offset, i;
unsigned char *cur_buf, *new_buf; unsigned char *cur_buf, *new_buf;
/* hw_acquisition_stop() is telling us to stop. */ /* hw_dev_acquisition_stop() is telling us to stop. */
if (transfer == NULL) if (transfer == NULL)
num_samples = -1; num_samples = -1;
@ -723,7 +723,7 @@ static void receive_transfer(struct libusb_transfer *transfer)
* The FX2 gave up. End the acquisition, the frontend * The FX2 gave up. End the acquisition, the frontend
* will work out that the samplecount is short. * will work out that the samplecount is short.
*/ */
hw_acquisition_stop(-1, fx2->session_data); hw_dev_acquisition_stop(-1, fx2->session_data);
} }
return; return;
} else { } else {
@ -797,7 +797,7 @@ static void receive_transfer(struct libusb_transfer *transfer)
num_samples += cur_buflen; num_samples += cur_buflen;
if (fx2->limit_samples && (unsigned int) num_samples > fx2->limit_samples) { if (fx2->limit_samples && (unsigned int) num_samples > fx2->limit_samples) {
hw_acquisition_stop(-1, fx2->session_data); hw_dev_acquisition_stop(-1, fx2->session_data);
} }
} else { } else {
/* /*
@ -807,7 +807,7 @@ static void receive_transfer(struct libusb_transfer *transfer)
} }
} }
static int hw_acquisition_start(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_dev_inst *sdi;
struct sr_datafeed_packet *packet; struct sr_datafeed_packet *packet;
@ -873,7 +873,7 @@ static int hw_acquisition_start(int dev_index, gpointer session_data)
} }
/* This stops acquisition on ALL devices, ignoring dev_index. */ /* This stops acquisition on ALL devices, ignoring dev_index. */
static int hw_acquisition_stop(int dev_index, gpointer session_data) static int hw_dev_acquisition_stop(int dev_index, gpointer session_data)
{ {
struct sr_datafeed_packet packet; struct sr_datafeed_packet packet;
@ -902,6 +902,6 @@ SR_PRIV struct sr_dev_plugin saleae_logic_plugin_info = {
.dev_status_get = hw_dev_status_get, .dev_status_get = hw_dev_status_get,
.hwcap_get_all = hw_hwcap_get_all, .hwcap_get_all = hw_hwcap_get_all,
.config_set = hw_config_set, .config_set = hw_config_set,
.acquisition_start = hw_acquisition_start, .dev_acquisition_start = hw_dev_acquisition_start,
.acquisition_stop = hw_acquisition_stop, .dev_acquisition_stop = hw_dev_acquisition_stop,
}; };

View File

@ -627,7 +627,7 @@ static int hw_config_set(int dev_index, int hwcap, void *value)
} }
} }
static int hw_acquisition_start(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_dev_inst *sdi;
struct sr_datafeed_packet packet; struct sr_datafeed_packet packet;
@ -703,7 +703,7 @@ static int hw_acquisition_start(int dev_index, gpointer session_data)
} }
/* This stops acquisition on ALL devices, ignoring dev_index. */ /* This stops acquisition on ALL devices, ignoring dev_index. */
static int hw_acquisition_stop(int dev_index, gpointer session_dev_id) static int hw_dev_acquisition_stop(int dev_index, gpointer session_dev_id)
{ {
struct sr_datafeed_packet packet; struct sr_datafeed_packet packet;
struct sr_dev_inst *sdi; struct sr_dev_inst *sdi;
@ -740,6 +740,6 @@ SR_PRIV struct sr_dev_plugin zeroplus_logic_cube_plugin_info = {
.dev_status_get = hw_dev_status_get, .dev_status_get = hw_dev_status_get,
.hwcap_get_all = hw_hwcap_get_all, .hwcap_get_all = hw_hwcap_get_all,
.config_set = hw_config_set, .config_set = hw_config_set,
.acquisition_start = hw_acquisition_start, .dev_acquisition_start = hw_dev_acquisition_start,
.acquisition_stop = hw_acquisition_stop, .dev_acquisition_stop = hw_dev_acquisition_stop,
}; };

View File

@ -276,7 +276,7 @@ SR_API int sr_session_start(void)
for (l = session->devs; l; l = l->next) { for (l = session->devs; l; l = l->next) {
dev = l->data; dev = l->data;
/* TODO: Check for dev != NULL. */ /* TODO: Check for dev != NULL. */
if ((ret = dev->plugin->acquisition_start( if ((ret = dev->plugin->dev_acquisition_start(
dev->plugin_index, dev)) != SR_OK) { dev->plugin_index, dev)) != SR_OK) {
sr_err("session: %s: could not start an acquisition " sr_err("session: %s: could not start an acquisition "
"(%d)", __func__, ret); "(%d)", __func__, ret);
@ -373,8 +373,8 @@ SR_API int sr_session_stop(void)
dev = l->data; dev = l->data;
/* Check for dev != NULL. */ /* Check for dev != NULL. */
if (dev->plugin) { if (dev->plugin) {
if (dev->plugin->acquisition_stop) if (dev->plugin->dev_acquisition_stop)
dev->plugin->acquisition_stop(dev->plugin_index, dev); dev->plugin->dev_acquisition_stop(dev->plugin_index, dev);
if (dev->plugin->cleanup) if (dev->plugin->cleanup)
dev->plugin->cleanup(); dev->plugin->cleanup();
} }

View File

@ -269,7 +269,7 @@ static int hw_config_set(int dev_index, int hwcap, void *value)
return SR_OK; return SR_OK;
} }
static int hw_acquisition_start(int dev_index, gpointer session_dev_id) static int hw_dev_acquisition_start(int dev_index, gpointer session_dev_id)
{ {
struct zip_stat zs; struct zip_stat zs;
struct session_vdev *vdev; struct session_vdev *vdev;
@ -343,6 +343,6 @@ SR_PRIV struct sr_dev_plugin session_driver = {
.dev_status_get = hw_dev_status_get, .dev_status_get = hw_dev_status_get,
.hwcap_get_all = hw_hwcap_get_all, .hwcap_get_all = hw_hwcap_get_all,
.config_set = hw_config_set, .config_set = hw_config_set,
.acquisition_start = hw_acquisition_start, .dev_acquisition_start = hw_dev_acquisition_start,
.acquisition_stop = NULL, .dev_acquisition_stop = NULL,
}; };

View File

@ -353,8 +353,8 @@ struct sr_dev_plugin {
int (*dev_status_get) (int dev_index); int (*dev_status_get) (int dev_index);
int *(*hwcap_get_all) (void); int *(*hwcap_get_all) (void);
int (*config_set) (int dev_index, int hwcap, void *value); int (*config_set) (int dev_index, int hwcap, void *value);
int (*acquisition_start) (int dev_index, gpointer session_dev_id); int (*dev_acquisition_start) (int dev_index, gpointer session_dev_id);
int (*acquisition_stop) (int dev_index, gpointer session_dev_id); int (*dev_acquisition_stop) (int dev_index, gpointer session_dev_id);
}; };
struct sr_session { struct sr_session {