#include "protocol.h"
SR_PRIV struct sr_dev_driver ${lib}_driver_info;
-static struct sr_dev_driver *di = &${lib}_driver_info;
-static int init(struct sr_context *sr_ctx)
+static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx)
{
return std_init(sr_ctx, di, LOG_PREFIX);
}
-static GSList *scan(GSList *options)
+static GSList *scan(struct sr_dev_driver *di, GSList *options)
{
struct drv_context *drvc;
GSList *devices;
return devices;
}
-static GSList *dev_list(void)
+static GSList *dev_list(const struct sr_dev_driver *di)
{
return ((struct drv_context *)(di->priv))->instances;
}
-static int dev_clear(void)
+static int dev_clear(const struct sr_dev_driver *di)
{
return std_dev_clear(di, NULL);
}
return SR_OK;
}
-static int cleanup(void)
+static int cleanup(const struct sr_dev_driver *di)
{
- dev_clear();
+ dev_clear(di);
/* TODO: free other driver resources, if any. */
"""
TMPL_DRIVERS_POINTER = """\
#ifdef HAVE_HW_${upper}
- &${lib}_driver_info,
+ (DRVS) {&${lib}_driver_info, NULL},
#endif
"""
FILE_DRV_API = 'drv-api.c'