static char *sessionfile = NULL;
static GSList *dev_insts = NULL;
-static int capabilities[] = {
+static int hwcaps[] = {
SR_HWCAP_CAPTUREFILE,
SR_HWCAP_CAPTURE_UNITSIZE,
0,
return SR_OK;
}
-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 session_vdev *vdev;
void *info;
* @return A pointer to the (hardware) capabilities of this virtual session
* driver. This could be NULL, if no such capabilities exist.
*/
-static int *hw_get_capabilities(void)
+static int *hw_hwcap_get_all(void)
{
- return capabilities;
+ return hwcaps;
}
-static int hw_set_configuration(int dev_index, int capability, void *value)
+static int hw_config_set(int dev_index, int hwcap, void *value)
{
struct session_vdev *vdev;
uint64_t *tmp_u64;
if (!(vdev = get_vdev_by_index(dev_index)))
return SR_ERR;
- switch (capability) {
+ switch (hwcap) {
case SR_HWCAP_SAMPLERATE:
tmp_u64 = value;
vdev->samplerate = *tmp_u64;
break;
default:
sr_err("session driver: %s: unknown capability %d requested",
- __func__, capability);
+ __func__, hwcap);
return SR_ERR;
}
}
SR_PRIV struct sr_dev_plugin session_driver = {
- "session",
- "Session-emulating driver",
- 1,
- hw_init,
- hw_cleanup,
- hw_opendev,
- NULL,
- hw_get_dev_info,
- hw_get_status,
- hw_get_capabilities,
- hw_set_configuration,
- hw_start_acquisition,
- NULL,
+ .name = "session",
+ .longname = "Session-emulating driver",
+ .api_version = 1,
+ .init = hw_init,
+ .cleanup = hw_cleanup,
+ .opendev = hw_opendev,
+ .closedev = NULL,
+ .dev_info_get = hw_dev_info_get,
+ .get_status = hw_get_status,
+ .hwcap_get_all = hw_hwcap_get_all,
+ .config_set = hw_config_set,
+ .start_acquisition = hw_start_acquisition,
+ .stop_acquisition = NULL,
};