]> sigrok.org Git - libsigrok.git/commitdiff
Fix #442 by renaming sr_dev_driver.priv to .context
authorSoeren Apel <redacted>
Mon, 6 Jul 2015 19:55:36 +0000 (21:55 +0200)
committerUwe Hermann <redacted>
Thu, 9 Jul 2015 23:22:15 +0000 (01:22 +0200)
57 files changed:
include/libsigrok/libsigrok.h
src/device.c
src/hardware/agilent-dmm/api.c
src/hardware/appa-55ii/api.c
src/hardware/asix-sigma/asix-sigma.c
src/hardware/atten-pps3xxx/api.c
src/hardware/baylibre-acme/api.c
src/hardware/beaglelogic/api.c
src/hardware/brymen-bm86x/api.c
src/hardware/brymen-dmm/api.c
src/hardware/cem-dt-885x/api.c
src/hardware/center-3xx/api.c
src/hardware/chronovu-la/api.c
src/hardware/colead-slm/api.c
src/hardware/conrad-digi-35-cpu/api.c
src/hardware/demo/demo.c
src/hardware/deree-de5000/api.c
src/hardware/fluke-dmm/api.c
src/hardware/fx2lafw/api.c
src/hardware/fx2lafw/protocol.c
src/hardware/gmc-mh-1x-2x/api.c
src/hardware/hameg-hmo/api.c
src/hardware/hantek-dso/api.c
src/hardware/hantek-dso/dso.c
src/hardware/ikalogic-scanalogic2/api.c
src/hardware/ikalogic-scanalogic2/protocol.c
src/hardware/ikalogic-scanaplus/api.c
src/hardware/kecheng-kc-330b/api.c
src/hardware/kecheng-kc-330b/protocol.c
src/hardware/lascar-el-usb/api.c
src/hardware/lascar-el-usb/protocol.c
src/hardware/link-mso19/api.c
src/hardware/link-mso19/protocol.c
src/hardware/manson-hcs-3xxx/api.c
src/hardware/maynuo-m97/api.c
src/hardware/mic-985xx/api.c
src/hardware/motech-lps-30x/api.c
src/hardware/norma-dmm/api.c
src/hardware/openbench-logic-sniffer/api.c
src/hardware/pipistrello-ols/api.c
src/hardware/rigol-ds/api.c
src/hardware/saleae-logic16/api.c
src/hardware/scpi-pps/api.c
src/hardware/serial-dmm/api.c
src/hardware/sysclk-lwla/api.c
src/hardware/teleinfo/api.c
src/hardware/testo/api.c
src/hardware/tondaj-sl-814/api.c
src/hardware/uni-t-dmm/api.c
src/hardware/uni-t-ut32x/api.c
src/hardware/uni-t-ut32x/protocol.c
src/hardware/victor-dmm/api.c
src/hardware/yokogawa-dlm/api.c
src/hardware/zeroplus-logic-cube/api.c
src/hwdriver.c
src/session_driver.c
src/std.c

index 3ac46f6b30f0c8bba680b486b648cb44d2558863..233e04a6ce969dd881c02f3c6d5092536e9a356e 100644 (file)
@@ -1073,8 +1073,8 @@ struct sr_dev_driver {
                        void *cb_data);
 
        /* Dynamic */
-       /** Device driver private data. Initialized by init(). */
-       void *priv;
+       /** Device driver context, considered private. Initialized by init(). */
+       void *context;
 };
 
 /**
index d7c32567fb7971f62925d118151a8a8b0bab7064..01f413486357d546817c05c7bffc27974c031d13 100644 (file)
@@ -547,7 +547,7 @@ SR_API const char *sr_dev_inst_connid_get(const struct sr_dev_inst *sdi)
        if ((!sdi->connection_id) && (sdi->inst_type == SR_INST_USB)) {
                /* connection_id isn't populated, let's do that here. */
 
-               drvc = sdi->driver->priv;
+               drvc = sdi->driver->context;
                usb = sdi->conn;
 
                if ((cnt = libusb_get_device_list(drvc->sr_ctx->libusb_ctx, &devlist)) < 0) {
index e8ef427b7cc1951ca03797d542c1937697ebaf58..823740764a1d1d12c547298a5025b9e1df0d9386 100644 (file)
@@ -89,7 +89,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
        const char *conn, *serialcomm;
        char *buf, **tokens;
 
-       drvc = di->priv;
+       drvc = di->context;
        drvc->instances = NULL;
 
        devices = NULL;
@@ -163,7 +163,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
 
 static GSList *dev_list(const struct sr_dev_driver *di)
 {
-       return ((struct drv_context *)(di->priv))->instances;
+       return ((struct drv_context *)(di->context))->instances;
 }
 
 static int cleanup(const struct sr_dev_driver *di)
@@ -275,5 +275,5 @@ SR_PRIV struct sr_dev_driver agdmm_driver_info = {
        .dev_close = std_serial_dev_close,
        .dev_acquisition_start = dev_acquisition_start,
        .dev_acquisition_stop = dev_acquisition_stop,
-       .priv = NULL,
+       .context = NULL,
 };
index 18fc2142171bb5ee6518b01222cc443daf7b52c0..580dbc2ae58cb094a0650037588246e1b9e3f358 100644 (file)
@@ -86,7 +86,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
 
        sr_info("Probing serial port %s.", conn);
 
-       drvc = di->priv;
+       drvc = di->context;
        drvc->instances = NULL;
        serial_flush(serial);
 
@@ -122,7 +122,7 @@ scan_cleanup:
 
 static GSList *dev_list(const struct sr_dev_driver *di)
 {
-       return ((struct drv_context *)(di->priv))->instances;
+       return ((struct drv_context *)(di->context))->instances;
 }
 
 static int cleanup(const struct sr_dev_driver *di)
@@ -281,5 +281,5 @@ SR_PRIV struct sr_dev_driver appa_55ii_driver_info = {
        .dev_close = std_serial_dev_close,
        .dev_acquisition_start = dev_acquisition_start,
        .dev_acquisition_stop = dev_acquisition_stop,
-       .priv = NULL,
+       .context = NULL,
 };
index 6e7f1fd716d52c04fd8c816348cb3088d2629e97..0a2ec990ac38d47467715d015b9cab1d3c09366d 100644 (file)
@@ -345,7 +345,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
 
        (void)options;
 
-       drvc = di->priv;
+       drvc = di->context;
 
        devices = NULL;
 
@@ -411,7 +411,7 @@ free:
 
 static GSList *dev_list(const struct sr_dev_driver *di)
 {
-       return ((struct drv_context *)(di->priv))->instances;
+       return ((struct drv_context *)(di->context))->instances;
 }
 
 /*
@@ -1554,5 +1554,5 @@ SR_PRIV struct sr_dev_driver asix_sigma_driver_info = {
        .dev_close = dev_close,
        .dev_acquisition_start = dev_acquisition_start,
        .dev_acquisition_stop = dev_acquisition_stop,
-       .priv = NULL,
+       .context = NULL,
 };
index 6b178ae9e6f8010ac0bff050a4895607267f2d92..10dfa2adea6fcf059d0e3f34e8e15e5104b948d6 100644 (file)
@@ -100,7 +100,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options, int modelid)
        char channel[10];
 
        devices = NULL;
-       drvc = di->priv;
+       drvc = di->context;
        drvc->instances = NULL;
 
        conn = serialcomm = NULL;
@@ -201,7 +201,7 @@ static GSList *scan_3203(struct sr_dev_driver *di, GSList *options)
 
 static GSList *dev_list(const struct sr_dev_driver *di)
 {
-       return ((struct drv_context *)(di->priv))->instances;
+       return ((struct drv_context *)(di->context))->instances;
 }
 
 static int cleanup(const struct sr_dev_driver *di)
@@ -523,5 +523,5 @@ SR_PRIV struct sr_dev_driver atten_pps3203_driver_info = {
        .dev_close = dev_close,
        .dev_acquisition_start = dev_acquisition_start,
        .dev_acquisition_stop = dev_acquisition_stop,
-       .priv = NULL,
+       .context = NULL,
 };
index 6cbae3880bd10e2152ba81944e0f41b30e2b20f8..b1884b62b15aa0bbef0d2ab6697abb4286291292 100644 (file)
@@ -68,7 +68,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
 
        (void)options;
 
-       drvc = di->priv;
+       drvc = di->context;
        devices = NULL;
 
        devc = g_malloc0(sizeof(struct dev_context));
@@ -143,7 +143,7 @@ err_out:
 
 static GSList *dev_list(const struct sr_dev_driver *di)
 {
-       return ((struct drv_context *)(di->priv))->instances;
+       return ((struct drv_context *)(di->context))->instances;
 }
 
 static int dev_clear(const struct sr_dev_driver *di)
@@ -442,5 +442,5 @@ SR_PRIV struct sr_dev_driver baylibre_acme_driver_info = {
        .dev_close = dev_close,
        .dev_acquisition_start = dev_acquisition_start,
        .dev_acquisition_stop = dev_acquisition_stop,
-       .priv = NULL,
+       .context = NULL,
 };
index 5f1d35fc1716f88172024d0795d1d464461c232b..12af5c1db6660891406128b93879f8409ced74fd 100644 (file)
@@ -87,7 +87,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
        int i, maxch;
 
        devices = NULL;
-       drvc = di->priv;
+       drvc = di->context;
        drvc->instances = NULL;
 
        /* Probe for /dev/beaglelogic */
@@ -146,7 +146,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
 
 static GSList *dev_list(const struct sr_dev_driver *di)
 {
-       return ((struct drv_context *)(di->priv))->instances;
+       return ((struct drv_context *)(di->context))->instances;
 }
 
 static int dev_clear(const struct sr_dev_driver *di)
@@ -205,7 +205,7 @@ static int cleanup(const struct sr_dev_driver *di)
        GSList *l;
 
        /* unused driver */
-       if (!(drvc = di->priv))
+       if (!(drvc = di->context))
                return SR_OK;
 
        /* Clean up the instances */
@@ -422,5 +422,5 @@ SR_PRIV struct sr_dev_driver beaglelogic_driver_info = {
        .dev_close = dev_close,
        .dev_acquisition_start = dev_acquisition_start,
        .dev_acquisition_stop = dev_acquisition_stop,
-       .priv = NULL,
+       .context = NULL,
 };
index d7dccc0502470826cfa685a861814de6060d2a0d..834f11bb80cc140f4802771e7d8f156352875c23 100644 (file)
@@ -49,7 +49,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
        struct sr_config *src;
        const char *conn;
 
-       drvc = di->priv;
+       drvc = di->context;
        drvc->instances = NULL;
 
        conn = BRYMEN_BC86X;
@@ -93,13 +93,13 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
 
 static GSList *dev_list(const struct sr_dev_driver *di)
 {
-       return ((struct drv_context *)(di->priv))->instances;
+       return ((struct drv_context *)(di->context))->instances;
 }
 
 static int dev_open(struct sr_dev_inst *sdi)
 {
        struct sr_dev_driver *di = sdi->driver;
-       struct drv_context *drvc = di->priv;
+       struct drv_context *drvc = di->context;
        struct sr_usb_dev_inst *usb;
        struct dev_context *devc;
        int ret;
@@ -299,5 +299,5 @@ SR_PRIV struct sr_dev_driver brymen_bm86x_driver_info = {
        .dev_close = dev_close,
        .dev_acquisition_start = dev_acquisition_start,
        .dev_acquisition_stop = dev_acquisition_stop,
-       .priv = NULL,
+       .context = NULL,
 };
index 38a5ab8fb25b17b74e4abbba457eccca838f533b..b1c5339c5a18b8b8accb47f9c504061e5bc023eb 100644 (file)
@@ -80,7 +80,7 @@ static GSList *brymen_scan(const char *conn, const char *serialcomm)
        devc = g_malloc0(sizeof(struct dev_context));
        sdi->inst_type = SR_INST_SERIAL;
        sdi->conn = serial;
-       drvc = di->priv;
+       drvc = di->context;
        sdi->priv = devc;
        sdi->driver = di;
        sr_channel_new(sdi, 0, SR_CHANNEL_ANALOG, TRUE, "P1");
@@ -101,7 +101,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
        const char *conn, *serialcomm;
 
        devices = NULL;
-       drvc = di->priv;
+       drvc = di->context;
        drvc->instances = NULL;
 
        conn = serialcomm = NULL;
@@ -132,7 +132,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
 
 static GSList *dev_list(const struct sr_dev_driver *di)
 {
-       return ((struct drv_context *)(di->priv))->instances;
+       return ((struct drv_context *)(di->context))->instances;
 }
 
 static int cleanup(const struct sr_dev_driver *di)
@@ -249,5 +249,5 @@ SR_PRIV struct sr_dev_driver brymen_bm857_driver_info = {
        .dev_close = std_serial_dev_close,
        .dev_acquisition_start = dev_acquisition_start,
        .dev_acquisition_stop = dev_acquisition_stop,
-       .priv = NULL,
+       .context = NULL,
 };
index a30b5b778d9e9be015fe17d1b7955cb30041063b..ebeebcf2b3aebab1462a564299624b0e6d1a3461 100644 (file)
@@ -102,7 +102,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
                return NULL;
 
        devices = NULL;
-       drvc = di->priv;
+       drvc = di->context;
        start = g_get_monotonic_time();
        while (g_get_monotonic_time() - start < MAX_SCAN_TIME_US) {
                if (serial_read_nonblocking(serial, &c, 1) == 1 && c == 0xa5) {
@@ -137,7 +137,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
 
 static GSList *dev_list(const struct sr_dev_driver *di)
 {
-       return ((struct drv_context *)(di->priv))->instances;
+       return ((struct drv_context *)(di->context))->instances;
 }
 
 static int dev_open(struct sr_dev_inst *sdi)
@@ -431,5 +431,5 @@ SR_PRIV struct sr_dev_driver cem_dt_885x_driver_info = {
        .dev_close = std_serial_dev_close,
        .dev_acquisition_start = dev_acquisition_start,
        .dev_acquisition_stop = dev_acquisition_stop,
-       .priv = NULL,
+       .context = NULL,
 };
index 1d2a5669831a28c2fac8a1ddf356744c46ef155d..b041db82641ee977feeee8e305c7419d0095d38b 100644 (file)
@@ -79,7 +79,7 @@ static GSList *center_scan(const char *conn, const char *serialcomm, int idx)
        if (serial_open(serial, SERIAL_RDWR) != SR_OK)
                return NULL;
 
-       drvc = center_devs[idx].di->priv;
+       drvc = center_devs[idx].di->context;
        devices = NULL;
        serial_flush(serial);
 
@@ -140,7 +140,7 @@ static GSList *scan(GSList *options, int idx)
 
 static GSList *dev_list(int idx)
 {
-       return ((struct drv_context *)(center_devs[idx].di->priv))->instances;
+       return ((struct drv_context *)(center_devs[idx].di->context))->instances;
 }
 
 static int cleanup(int idx)
@@ -278,7 +278,7 @@ SR_PRIV struct sr_dev_driver ID##_driver_info = { \
        .dev_close = std_serial_dev_close, \
        .dev_acquisition_start = dev_acquisition_start_##ID_UPPER, \
        .dev_acquisition_stop = dev_acquisition_stop, \
-       .priv = NULL, \
+       .context = NULL, \
 };
 
 DRV(center_309, CENTER_309, "center-309", "Center 309")
index fc5212f4409522fc0605e78b2ce4dd652d295eb8..c4cc2ab097e4a33b6d5ac110c7f0e3694911dc7c 100644 (file)
@@ -83,7 +83,7 @@ static int add_device(int idx, int model, GSList **devices)
 
        ret = SR_OK;
 
-       drvc = di->priv;
+       drvc = di->context;
 
        /* Allocate memory for our private device context. */
        devc = g_malloc0(sizeof(struct dev_context));
@@ -191,7 +191,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
 
 static GSList *dev_list(const struct sr_dev_driver *di)
 {
-       return ((struct drv_context *)(di->priv))->instances;
+       return ((struct drv_context *)(di->context))->instances;
 }
 
 static int dev_open(struct sr_dev_inst *sdi)
@@ -542,5 +542,5 @@ SR_PRIV struct sr_dev_driver chronovu_la_driver_info = {
        .dev_close = dev_close,
        .dev_acquisition_start = dev_acquisition_start,
        .dev_acquisition_stop = dev_acquisition_stop,
-       .priv = NULL,
+       .context = NULL,
 };
index a60444010f23b257820e994971b8e60a0e01da15..38c54580d8d4c8573c8f7da9eb36ac22d8aeb841 100644 (file)
@@ -58,7 +58,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
        GSList *devices, *l;
        const char *conn, *serialcomm;
 
-       drvc = di->priv;
+       drvc = di->context;
        drvc->instances = NULL;
 
        devices = NULL;
@@ -98,7 +98,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
 
 static GSList *dev_list(const struct sr_dev_driver *di)
 {
-       return ((struct drv_context *)(di->priv))->instances;
+       return ((struct drv_context *)(di->context))->instances;
 }
 
 static int dev_open(struct sr_dev_inst *sdi)
@@ -219,5 +219,5 @@ SR_PRIV struct sr_dev_driver colead_slm_driver_info = {
        .dev_close = std_serial_dev_close,
        .dev_acquisition_start = dev_acquisition_start,
        .dev_acquisition_stop = dev_acquisition_stop,
-       .priv = NULL,
+       .context = NULL,
 };
index ee42960ad88935a6e39bdc8c8364269f6b37f7d2..5af4b051a26fd3ed04f45964e534462d7541df19 100644 (file)
@@ -55,7 +55,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
        const char *conn, *serialcomm;
 
        devices = NULL;
-       drvc = di->priv;
+       drvc = di->context;
        drvc->instances = NULL;
        conn = serialcomm = NULL;
 
@@ -107,7 +107,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
 
 static GSList *dev_list(const struct sr_dev_driver *di)
 {
-       return ((struct drv_context *)(di->priv))->instances;
+       return ((struct drv_context *)(di->context))->instances;
 }
 
 static int cleanup(const struct sr_dev_driver *di)
@@ -218,5 +218,5 @@ SR_PRIV struct sr_dev_driver conrad_digi_35_cpu_driver_info = {
        .dev_close = std_serial_dev_close,
        .dev_acquisition_start = dev_acquisition_start,
        .dev_acquisition_stop = dev_acquisition_stop,
-       .priv = NULL,
+       .context = NULL,
 };
index 5128b9dc652094b75790d626fae7b2936bdc7f10..4ad4ea3423f0890a1a39c04ae911fbfa2c388b60 100644 (file)
@@ -278,7 +278,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
        int num_logic_channels, num_analog_channels, pattern, i;
        char channel_name[16];
 
-       drvc = di->priv;
+       drvc = di->context;
 
        num_logic_channels = DEFAULT_NUM_LOGIC_CHANNELS;
        num_analog_channels = DEFAULT_NUM_ANALOG_CHANNELS;
@@ -370,7 +370,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
 
 static GSList *dev_list(const struct sr_dev_driver *di)
 {
-       return ((struct drv_context *)(di->priv))->instances;
+       return ((struct drv_context *)(di->context))->instances;
 }
 
 static int dev_open(struct sr_dev_inst *sdi)
@@ -925,5 +925,5 @@ SR_PRIV struct sr_dev_driver demo_driver_info = {
        .dev_close = dev_close,
        .dev_acquisition_start = dev_acquisition_start,
        .dev_acquisition_stop = dev_acquisition_stop,
-       .priv = NULL,
+       .context = NULL,
 };
index 88aa88281a4cf78a5c4764e978e93e1caf12973c..33e38881232b0be03c60039009492ecf6ed204eb 100644 (file)
@@ -28,7 +28,7 @@ static void std_dev_attach(struct sr_dev_driver *di, struct sr_dev_inst *sdi)
 {
        struct drv_context *drvc;
 
-       drvc = di->priv;
+       drvc = di->context;
 
        sdi->driver = di;
        drvc->instances = g_slist_append(drvc->instances, sdi);
@@ -36,7 +36,7 @@ static void std_dev_attach(struct sr_dev_driver *di, struct sr_dev_inst *sdi)
 
 static GSList *dev_list(const struct sr_dev_driver *di)
 {
-       return ((struct drv_context *)di->priv)->instances;
+       return ((struct drv_context *)di->context)->instances;
 }
 
 #define LOG_PREFIX "deree-de5000"
@@ -81,5 +81,5 @@ SR_PRIV struct sr_dev_driver deree_de5000_driver_info = {
        .dev_close = std_serial_dev_close,
        .dev_acquisition_start = es51919_serial_acquisition_start,
        .dev_acquisition_stop = es51919_serial_acquisition_stop,
-       .priv = NULL,
+       .context = NULL,
 };
index 4c6e2c18aeff25bb7c2572c4ea811904ccd6b6f4..1b4ce404bdf8df3a94e515bce888f038f26b4328 100644 (file)
@@ -79,7 +79,7 @@ static GSList *fluke_scan(struct sr_dev_driver *di, const char *conn,
        if (serial_open(serial, SERIAL_RDWR) != SR_OK)
                return NULL;
 
-       drvc = di->priv;
+       drvc = di->context;
        b = buf;
        retry = 0;
        devices = NULL;
@@ -190,7 +190,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
 
 static GSList *dev_list(const struct sr_dev_driver *di)
 {
-       return ((struct drv_context *)(di->priv))->instances;
+       return ((struct drv_context *)(di->context))->instances;
 }
 
 static int cleanup(const struct sr_dev_driver *di)
@@ -305,5 +305,5 @@ SR_PRIV struct sr_dev_driver flukedmm_driver_info = {
        .dev_close = std_serial_dev_close,
        .dev_acquisition_start = dev_acquisition_start,
        .dev_acquisition_stop = dev_acquisition_stop,
-       .priv = NULL,
+       .context = NULL,
 };
index ada4fcc9b002989572ce5005366fad7636cc35f5..4348e680825af8c1f9be71ad8f344bd0a3607d2a 100644 (file)
@@ -193,7 +193,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
        const char *conn;
        char manufacturer[64], product[64], serial_num[64], connection_id[64];
 
-       drvc = di->priv;
+       drvc = di->context;
 
        conn = NULL;
        for (l = options; l; l = l->next) {
@@ -355,7 +355,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
 
 static GSList *dev_list(const struct sr_dev_driver *di)
 {
-       return ((struct drv_context *)(di->priv))->instances;
+       return ((struct drv_context *)(di->context))->instances;
 }
 
 static int dev_open(struct sr_dev_inst *sdi)
@@ -468,7 +468,7 @@ static int cleanup(const struct sr_dev_driver *di)
        int ret;
        struct drv_context *drvc;
 
-       if (!(drvc = di->priv))
+       if (!(drvc = di->context))
                return SR_OK;
 
        ret = std_dev_clear(di, NULL);
@@ -764,7 +764,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data)
                return SR_ERR_DEV_CLOSED;
 
        di = sdi->driver;
-       drvc = di->priv;
+       drvc = di->context;
        devc = sdi->priv;
 
        devc->ctx = drvc->sr_ctx;
@@ -815,5 +815,5 @@ SR_PRIV struct sr_dev_driver fx2lafw_driver_info = {
        .dev_close = dev_close,
        .dev_acquisition_start = dev_acquisition_start,
        .dev_acquisition_stop = dev_acquisition_stop,
-       .priv = NULL,
+       .context = NULL,
 };
index 6098f24ee30e11e8ee050ea7c659c490b2641e68..c87f659d07e249a28bfc5a771bf324eeb592934c 100644 (file)
@@ -194,7 +194,7 @@ SR_PRIV int fx2lafw_dev_open(struct sr_dev_inst *sdi, struct sr_dev_driver *di)
        uint8_t revid;
        char connection_id[64];
 
-       drvc = di->priv;
+       drvc = di->context;
        devc = sdi->priv;
        usb = sdi->conn;
 
index efb9e009c71b4d25f0b3a2fa66a12ca38f443e8e..890fec47d1bd5ef6da1f1930f5baf46493097d0e 100644 (file)
@@ -161,7 +161,7 @@ static GSList *scan_1x_2x_rs232(struct sr_dev_driver *di, GSList *options)
        gboolean serialcomm_given;
 
        devices = NULL;
-       drvc = di->priv;
+       drvc = di->context;
        drvc->instances = NULL;
        conn = serialcomm = NULL;
        model = METRAHIT_NONE;
@@ -256,7 +256,7 @@ static GSList *scan_2x_bd232(struct sr_dev_driver *di, GSList *options)
        conn = serialcomm = NULL;
        devices = NULL;
 
-       drvc = di->priv;
+       drvc = di->context;
        drvc->instances = NULL;
 
        sr_spew("scan_2x_bd232() called!");
@@ -354,7 +354,7 @@ exit_err:
 
 static GSList *dev_list(const struct sr_dev_driver *di)
 {
-       return ((struct drv_context *)(di->priv))->instances;
+       return ((struct drv_context *)(di->context))->instances;
 }
 
 static int dev_close(struct sr_dev_inst *sdi)
@@ -551,7 +551,7 @@ SR_PRIV struct sr_dev_driver gmc_mh_1x_2x_rs232_driver_info = {
        .dev_close = dev_close,
        .dev_acquisition_start = dev_acquisition_start_1x_2x_rs232,
        .dev_acquisition_stop = dev_acquisition_stop,
-       .priv = NULL,
+       .context = NULL,
 };
 
 SR_PRIV struct sr_dev_driver gmc_mh_2x_bd232_driver_info = {
@@ -570,5 +570,5 @@ SR_PRIV struct sr_dev_driver gmc_mh_2x_bd232_driver_info = {
        .dev_close = dev_close,
        .dev_acquisition_start = dev_acquisition_start_2x_bd232,
        .dev_acquisition_stop = dev_acquisition_stop,
-       .priv = NULL,
+       .context = NULL,
 };
index cad91c75adfacc4f0059920aee54cb9ad5c45bb7..fb03d04cdd86ecc615d71235dd28f1471a3abe16 100644 (file)
@@ -116,12 +116,12 @@ fail:
 
 static GSList *scan(struct sr_dev_driver *di, GSList *options)
 {
-       return sr_scpi_scan(di->priv, options, hmo_probe_serial_device);
+       return sr_scpi_scan(di->context, options, hmo_probe_serial_device);
 }
 
 static GSList *dev_list(const struct sr_dev_driver *di)
 {
-       return ((struct drv_context *)(di->priv))->instances;
+       return ((struct drv_context *)(di->context))->instances;
 }
 
 static void clear_helper(void *priv)
@@ -809,5 +809,5 @@ SR_PRIV struct sr_dev_driver hameg_hmo_driver_info = {
        .dev_close = dev_close,
        .dev_acquisition_start = dev_acquisition_start,
        .dev_acquisition_stop = dev_acquisition_stop,
-       .priv = NULL,
+       .context = NULL,
 };
index 47907d8e1754f36a84eceda01365a9469c1e78fb..b309ea665ced0d970029306c78e0841ac573482d 100644 (file)
@@ -208,7 +208,7 @@ static struct sr_dev_inst *dso_dev_new(const struct dso_profile *prof)
        devc->triggersource = g_strdup(DEFAULT_TRIGGER_SOURCE);
        devc->triggerposition = DEFAULT_HORIZ_TRIGGERPOS;
        sdi->priv = devc;
-       drvc = hantek_dso_driver_info.priv;
+       drvc = hantek_dso_driver_info.context;
        drvc->instances = g_slist_append(drvc->instances, sdi);
 
        return sdi;
@@ -273,7 +273,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
        const char *conn;
        char connection_id[64];
 
-       drvc = di->priv;
+       drvc = di->context;
 
        devices = 0;
 
@@ -363,7 +363,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
 
 static GSList *dev_list(const struct sr_dev_driver *di)
 {
-       return ((struct drv_context *)(di->priv))->instances;
+       return ((struct drv_context *)(di->context))->instances;
 }
 
 static int dev_open(struct sr_dev_inst *sdi)
@@ -876,7 +876,7 @@ static int handle_event(int fd, int revents, void *cb_data)
 
        sdi = cb_data;
        di = sdi->driver;
-       drvc = di->priv;
+       drvc = di->context;
        devc = sdi->priv;
        if (devc->dev_state == STOPPING) {
                /* We've been told to wind up the acquisition. */
@@ -976,7 +976,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data)
 {
        struct dev_context *devc;
        struct sr_dev_driver *di = sdi->driver;
-       struct drv_context *drvc = di->priv;
+       struct drv_context *drvc = di->context;
 
        if (sdi->status != SR_ST_ACTIVE)
                return SR_ERR_DEV_CLOSED;
@@ -1035,5 +1035,5 @@ SR_PRIV struct sr_dev_driver hantek_dso_driver_info = {
        .dev_close = dev_close,
        .dev_acquisition_start = dev_acquisition_start,
        .dev_acquisition_stop = dev_acquisition_stop,
-       .priv = NULL,
+       .context = NULL,
 };
index 156efd9333f32e4c37e3320744258f589be6d5ec..195201fe7302f3e05185cb42d5b583b8d1f25aca 100644 (file)
@@ -111,7 +111,7 @@ err:
 SR_PRIV int dso_open(struct sr_dev_inst *sdi)
 {
        struct dev_context *devc;
-       struct drv_context *drvc = hantek_dso_driver_info.priv;
+       struct drv_context *drvc = hantek_dso_driver_info.context;
        struct sr_usb_dev_inst *usb;
        struct libusb_device_descriptor des;
        libusb_device **devlist;
index a18557cf5f0cd94986a4843b1e0f50a256d69077..92b9946a8645d98faa145cedc6dcdaa3a1082491 100644 (file)
@@ -72,7 +72,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
        (void)options;
 
        devices = NULL;
-       drvc = di->priv;
+       drvc = di->context;
        drvc->instances = NULL;
 
        usb_devices = sr_usb_find(drvc->sr_ctx->libusb_ctx, USB_VID_PID);
@@ -163,7 +163,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
 
 static GSList *dev_list(const struct sr_dev_driver *di)
 {
-       return ((struct drv_context *)(di->priv))->instances;
+       return ((struct drv_context *)(di->context))->instances;
 }
 
 static void clear_dev_context(void *priv)
@@ -193,7 +193,7 @@ static int dev_open(struct sr_dev_inst *sdi)
        uint8_t buffer[PACKET_LENGTH];
        int ret;
 
-       if (!(drvc = di->priv)) {
+       if (!(drvc = di->context)) {
                sr_err("Driver was not initialized.");
                return SR_ERR;
        }
@@ -261,7 +261,7 @@ static int dev_close(struct sr_dev_inst *sdi)
        struct sr_dev_driver *di = sdi->driver;
        struct sr_usb_dev_inst *usb;
 
-       if (!di->priv) {
+       if (!di->context) {
                sr_err("Driver was not initialized.");
                return SR_ERR;
        }
@@ -397,7 +397,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data)
                return SR_ERR_DEV_CLOSED;
 
        devc = sdi->priv;
-       drvc = di->priv;
+       drvc = di->context;
 
        devc->cb_data = cb_data;
        devc->wait_data_ready_locked = TRUE;
@@ -505,5 +505,5 @@ SR_PRIV struct sr_dev_driver ikalogic_scanalogic2_driver_info = {
        .dev_close = dev_close,
        .dev_acquisition_start = dev_acquisition_start,
        .dev_acquisition_stop = dev_acquisition_stop,
-       .priv = NULL,
+       .context = NULL,
 };
index 7a7a2cb171b5ba210c26f660f875fcf03887ac0b..70ef28094ea42a4165d438411e425b6d96eac309 100644 (file)
@@ -215,7 +215,7 @@ SR_PRIV int ikalogic_scanalogic2_receive_data(int fd, int revents, void *cb_data
                return TRUE;
 
        di = sdi->driver;
-       drvc = di->priv;
+       drvc = di->context;
        current_time = g_get_monotonic_time();
 
        if (devc->state == STATE_WAIT_DATA_READY &&
@@ -643,7 +643,7 @@ SR_PRIV int sl2_get_device_info(struct sr_usb_dev_inst usb,
        uint8_t buffer[PACKET_LENGTH];
        int ret;
 
-       drvc = ikalogic_scanalogic2_driver_info.priv;
+       drvc = ikalogic_scanalogic2_driver_info.context;
 
        if (!dev_info)
                return SR_ERR_ARG;
index 487fc2178c7817f21a788999071942b0a3ceec55..456eb58cd6279520928ef858761a222f13bb2ae6 100644 (file)
@@ -80,7 +80,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
 
        (void)options;
 
-       drvc = di->priv;
+       drvc = di->context;
 
        devices = NULL;
 
@@ -150,7 +150,7 @@ err_free_devc:
 
 static GSList *dev_list(const struct sr_dev_driver *di)
 {
-       return ((struct drv_context *)(di->priv))->instances;
+       return ((struct drv_context *)(di->context))->instances;
 }
 
 static int dev_open(struct sr_dev_inst *sdi)
@@ -420,5 +420,5 @@ SR_PRIV struct sr_dev_driver ikalogic_scanaplus_driver_info = {
        .dev_close = dev_close,
        .dev_acquisition_start = dev_acquisition_start,
        .dev_acquisition_stop = dev_acquisition_stop,
-       .priv = NULL,
+       .context = NULL,
 };
index 8033e960cd2ea1562f094c44772d53d97cf77e1e..e7bb5a21080c21a66103ee810e59dc2acbeea330 100644 (file)
@@ -74,7 +74,7 @@ static int scan_kecheng(struct sr_dev_driver *di,
        int len, ret;
        unsigned char cmd, buf[32];
 
-       drvc = di->priv;
+       drvc = di->context;
        if (sr_usb_open(drvc->sr_ctx->libusb_ctx, usb) != SR_OK)
                return SR_ERR;
 
@@ -117,7 +117,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
 
        (void)options;
 
-       drvc = di->priv;
+       drvc = di->context;
        drvc->instances = NULL;
 
        devices = NULL;
@@ -161,7 +161,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
 
 static GSList *dev_list(const struct sr_dev_driver *di)
 {
-       return ((struct drv_context *)(di->priv))->instances;
+       return ((struct drv_context *)(di->context))->instances;
 }
 
 static int dev_open(struct sr_dev_inst *sdi)
@@ -171,7 +171,7 @@ static int dev_open(struct sr_dev_inst *sdi)
        struct sr_usb_dev_inst *usb;
        int ret;
 
-       if (!(drvc = di->priv)) {
+       if (!(drvc = di->context)) {
                sr_err("Driver was not initialized.");
                return SR_ERR;
        }
@@ -201,7 +201,7 @@ static int dev_close(struct sr_dev_inst *sdi)
        struct dev_context *devc;
        struct sr_usb_dev_inst *usb;
 
-       if (!di->priv) {
+       if (!di->context) {
                sr_err("Driver was not initialized.");
                return SR_ERR;
        }
@@ -231,7 +231,7 @@ static int cleanup(const struct sr_dev_driver *di)
        int ret;
        struct drv_context *drvc;
 
-       if (!(drvc = di->priv))
+       if (!(drvc = di->context))
                /* Can get called on an unused driver, doesn't matter. */
                return SR_OK;
 
@@ -305,7 +305,7 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd
        if (sdi->status != SR_ST_ACTIVE)
                return SR_ERR_DEV_CLOSED;
 
-       if (!di->priv) {
+       if (!di->context) {
                sr_err("Driver was not initialized.");
                return SR_ERR;
        }
@@ -430,7 +430,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi,
        if (sdi->status != SR_ST_ACTIVE)
                return SR_ERR_DEV_CLOSED;
 
-       drvc = di->priv;
+       drvc = di->context;
        devc = sdi->priv;
        usb = sdi->conn;
 
@@ -566,5 +566,5 @@ SR_PRIV struct sr_dev_driver kecheng_kc_330b_driver_info = {
        .dev_close = dev_close,
        .dev_acquisition_start = dev_acquisition_start,
        .dev_acquisition_stop = dev_acquisition_stop,
-       .priv = NULL,
+       .context = NULL,
 };
index 005b87cba05a50dd28f219dcd14ac07607635650..d79a92a56b449a1d4385bb8e576492d5489e6d21 100644 (file)
@@ -44,7 +44,7 @@ SR_PRIV int kecheng_kc_330b_handle_events(int fd, int revents, void *cb_data)
        devc = sdi->priv;
        usb = sdi->conn;
        di = sdi->driver;
-       drvc = di->priv;
+       drvc = di->context;
 
        memset(&tv, 0, sizeof(struct timeval));
        libusb_handle_events_timeout_completed(drvc->sr_ctx->libusb_ctx, &tv,
index 4d9ae81dfb4aa4fddab39c83eb16aa9386c22544..40a4164943282cd90e076a0b3cf8865b1169a798 100644 (file)
@@ -51,7 +51,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
        GSList *usb_devices, *devices, *l;
        const char *conn;
 
-       drvc = di->priv;
+       drvc = di->context;
 
        conn = NULL;
        for (l = options; l; l = l->next) {
@@ -90,7 +90,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
 
 static GSList *dev_list(const struct sr_dev_driver *di)
 {
-       return ((struct drv_context *)(di->priv))->instances;
+       return ((struct drv_context *)(di->context))->instances;
 }
 
 static int dev_open(struct sr_dev_inst *sdi)
@@ -100,7 +100,7 @@ static int dev_open(struct sr_dev_inst *sdi)
        struct sr_usb_dev_inst *usb;
        int ret;
 
-       if (!(drvc = di->priv)) {
+       if (!(drvc = di->context)) {
                sr_err("Driver was not initialized.");
                return SR_ERR;
        }
@@ -124,7 +124,7 @@ static int dev_close(struct sr_dev_inst *sdi)
        struct sr_dev_driver *di = sdi->driver;
        struct sr_usb_dev_inst *usb;
 
-       if (!di->priv) {
+       if (!di->context) {
                sr_err("Driver was not initialized.");
                return SR_ERR;
        }
@@ -148,7 +148,7 @@ static int cleanup(const struct sr_dev_driver *di)
        int ret;
        struct drv_context *drvc;
 
-       if (!(drvc = di->priv))
+       if (!(drvc = di->context))
                /* Can get called on an unused driver, doesn't matter. */
                return SR_OK;
 
@@ -206,7 +206,7 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd
        if (sdi->status != SR_ST_ACTIVE)
                return SR_ERR_DEV_CLOSED;
 
-       if (!di->priv) {
+       if (!di->context) {
                sr_err("Driver was not initialized.");
                return SR_ERR;
        }
@@ -340,12 +340,12 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data)
        if (sdi->status != SR_ST_ACTIVE)
                return SR_ERR_DEV_CLOSED;
 
-       if (!di->priv) {
+       if (!di->context) {
                sr_err("Driver was not initialized.");
                return SR_ERR;
        }
 
-       drvc = di->priv;
+       drvc = di->context;
        devc = sdi->priv;
        usb = sdi->conn;
        devc->cb_data = cb_data;
@@ -451,7 +451,7 @@ SR_PRIV int dev_acquisition_stop(struct sr_dev_inst *sdi, void *cb_data)
        struct sr_dev_driver *di = sdi->driver;
        (void)cb_data;
 
-       if (!di->priv) {
+       if (!di->context) {
                sr_err("Driver was not initialized.");
                return SR_ERR;
        }
@@ -483,5 +483,5 @@ SR_PRIV struct sr_dev_driver lascar_el_usb_driver_info = {
        .dev_close = dev_close,
        .dev_acquisition_start = dev_acquisition_start,
        .dev_acquisition_stop = dev_acquisition_stop,
-       .priv = NULL,
+       .context = NULL,
 };
index cc40bbfab7e98dd9aad4b2b59c2c444b15249e94..3dad7943ef78e816e865fee81291fff325885ebf 100644 (file)
@@ -96,7 +96,7 @@ SR_PRIV int lascar_get_config(libusb_device_handle *dev_hdl,
 
        sr_spew("Reading config block.");
 
-       drvc = di->priv;
+       drvc = di->context;
        *configlen = 0;
 
        if (!(xfer_in = libusb_alloc_transfer(0)) ||
@@ -213,7 +213,7 @@ static int lascar_save_config(libusb_device_handle *dev_hdl,
 
        sr_spew("Writing config block.");
 
-       drvc = di->priv;
+       drvc = di->context;
 
        if (!(xfer_in = libusb_alloc_transfer(0)) ||
                        !(xfer_out = libusb_alloc_transfer(0)))
@@ -356,7 +356,7 @@ SR_PRIV struct sr_dev_inst *lascar_scan(int bus, int address)
        int dummy, ret, i;
        unsigned char config[MAX_CONFIGBLOCK_SIZE];
 
-       drvc = di->priv;
+       drvc = di->context;
        sdi = NULL;
 
        libusb_get_device_list(drvc->sr_ctx->libusb_ctx, &devlist);
@@ -479,7 +479,7 @@ static void lascar_el_usb_dispatch(struct sr_dev_inst *sdi, unsigned char *buf,
 
 SR_PRIV int lascar_el_usb_handle_events(int fd, int revents, void *cb_data)
 {
-       struct drv_context *drvc = di->priv;
+       struct drv_context *drvc = di->context;
        struct sr_datafeed_packet packet;
        struct sr_dev_inst *sdi;
        struct timeval tv;
index 7d0fbf8b21030e080f699c6090b0fa8251b7e8f6..8b4ccc7fd43c6bea97a2a079b01388642c5f7209 100644 (file)
@@ -60,7 +60,7 @@ static int dev_clear(const struct sr_dev_driver *di)
        struct dev_context *devc;
        int ret = SR_OK;
 
-       if (!(drvc = di->priv))
+       if (!(drvc = di->context))
                return SR_OK;
 
        /* Properly close and free all devices. */
@@ -219,7 +219,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
                }
 
                //Add the driver
-               struct drv_context *drvc = di->priv;
+               struct drv_context *drvc = di->context;
                drvc->instances = g_slist_append(drvc->instances, sdi);
                devices = g_slist_append(devices, sdi);
        }
@@ -229,7 +229,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
 
 static GSList *dev_list(const struct sr_dev_driver *di)
 {
-       return ((struct drv_context *)(di->priv))->instances;
+       return ((struct drv_context *)(di->context))->instances;
 }
 
 static int dev_open(struct sr_dev_inst *sdi)
@@ -483,5 +483,5 @@ SR_PRIV struct sr_dev_driver link_mso19_driver_info = {
        .dev_close = std_serial_dev_close,
        .dev_acquisition_start = dev_acquisition_start,
        .dev_acquisition_stop = dev_acquisition_stop,
-       .priv = NULL,
+       .context = NULL,
 };
index 148f0ba18933fd80ec26bd2ee171be379e582097..ca85ffaf60dfd920599446b9fe42871430bfedbc 100644 (file)
@@ -357,7 +357,7 @@ SR_PRIV int mso_receive_data(int fd, int revents, void *cb_data)
        GSList *l;
        int i;
 
-       struct drv_context *drvc = di->priv;
+       struct drv_context *drvc = di->context;
 
        /* Find this device's devc struct by its fd. */
        struct dev_context *devc = NULL;
index ccf1bf96f1d5fa034872c91931e37cdd36c892f4..81370e9f9007382fbb79409c1f6d5c04a0d40f80 100644 (file)
@@ -96,7 +96,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
        struct sr_serial_dev_inst *serial;
        char reply[50], **tokens, *dummy;
 
-       drvc = di->priv;
+       drvc = di->context;
        drvc->instances = NULL;
        devices = NULL;
        conn = NULL;
@@ -204,7 +204,7 @@ exit_err:
 
 static GSList *dev_list(const struct sr_dev_driver *di)
 {
-       return ((struct drv_context *)(di->priv))->instances;
+       return ((struct drv_context *)(di->context))->instances;
 }
 
 static int cleanup(const struct sr_dev_driver *di)
@@ -433,5 +433,5 @@ SR_PRIV struct sr_dev_driver manson_hcs_3xxx_driver_info = {
        .dev_close = std_serial_dev_close,
        .dev_acquisition_start = dev_acquisition_start,
        .dev_acquisition_stop = dev_acquisition_stop,
-       .priv = NULL,
+       .context = NULL,
 };
index f1afdfe6cb886158bb92a8d0b7b58f52c0ff185f..3910100a97899543e3e1cae0370fa2fd86ae63e9 100644 (file)
@@ -188,7 +188,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
        if (!g_slist_find_custom(options, &default_modbusaddr, config_compare))
                opts = g_slist_prepend(opts, &default_modbusaddr);
 
-       devices = sr_modbus_scan(di->priv, opts, probe_device);
+       devices = sr_modbus_scan(di->context, opts, probe_device);
 
        while (opts != options)
                opts = g_slist_delete_link(opts, opts);
@@ -200,7 +200,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
 
 static GSList *dev_list(const struct sr_dev_driver *di)
 {
-       return ((struct drv_context *)(di->priv))->instances;
+       return ((struct drv_context *)(di->context))->instances;
 }
 
 static int dev_clear(const struct sr_dev_driver *di)
@@ -516,5 +516,5 @@ SR_PRIV struct sr_dev_driver maynuo_m97_driver_info = {
        .dev_close = dev_close,
        .dev_acquisition_start = dev_acquisition_start,
        .dev_acquisition_stop = dev_acquisition_stop,
-       .priv = NULL,
+       .context = NULL,
 };
index 6abc09ce073b778613c9f1348e8232f2b8cd33e6..94e8e89ce05286e7a89d92062708afbd7c1ec7e1 100644 (file)
@@ -79,7 +79,7 @@ static GSList *mic_scan(const char *conn, const char *serialcomm, int idx)
        if (serial_open(serial, SERIAL_RDWR) != SR_OK)
                return NULL;
 
-       drvc = mic_devs[idx].di->priv;
+       drvc = mic_devs[idx].di->context;
        devices = NULL;
        serial_flush(serial);
 
@@ -146,7 +146,7 @@ static GSList *scan(GSList *options, int idx)
 
 static GSList *dev_list(int idx)
 {
-       return ((struct drv_context *)(mic_devs[idx].di->priv))->instances;
+       return ((struct drv_context *)(mic_devs[idx].di->context))->instances;
 }
 
 static int cleanup(int idx)
@@ -291,7 +291,7 @@ SR_PRIV struct sr_dev_driver ID##_driver_info = { \
        .dev_close = std_serial_dev_close, \
        .dev_acquisition_start = dev_acquisition_start_##ID_UPPER, \
        .dev_acquisition_stop = dev_acquisition_stop, \
-       .priv = NULL, \
+       .context = NULL, \
 };
 
 DRV(mic_98581, MIC_98581, "mic-98581", "MIC 98581")
index 30fc62f21e0732799be6878ef61adece1d801159..19f530de1c9a31d7b26e32ef7b1f6dd7d7ef15e6 100644 (file)
@@ -516,7 +516,7 @@ static GSList *scan_lps301(struct sr_dev_driver *di, GSList *options)
 
 static GSList *dev_list_lps301(const struct sr_dev_driver *di)
 {
-       return ((struct drv_context *)(di->priv))->instances;
+       return ((struct drv_context *)(di->context))->instances;
 }
 
 static void dev_clear_private(struct dev_context* devc)
@@ -849,5 +849,5 @@ SR_PRIV struct sr_dev_driver motech_lps_301_driver_info = {
        .dev_close = std_serial_dev_close,
        .dev_acquisition_start = dev_acquisition_start,
        .dev_acquisition_stop = dev_acquisition_stop,
-       .priv = NULL,
+       .context = NULL,
 };
index 2743c23431547e367dd946cc758570a3c5164c36..c86f9c7d40a48ec4259a8a45bef17585615e3f8a 100644 (file)
@@ -175,7 +175,7 @@ static GSList *scan(struct sr_dev_driver* drv, GSList *options)
 
 static GSList *dev_list(const struct sr_dev_driver *di)
 {
-       return ((struct drv_context *)(di->priv))->instances;
+       return ((struct drv_context *)(di->context))->instances;
 }
 
 static int dev_close(struct sr_dev_inst *sdi)
@@ -307,7 +307,7 @@ SR_PRIV struct sr_dev_driver norma_dmm_driver_info = {
        .dev_close = dev_close,
        .dev_acquisition_start = dev_acquisition_start,
        .dev_acquisition_stop = dev_acquisition_stop,
-       .priv = NULL,
+       .context = NULL,
 };
 
 SR_PRIV struct sr_dev_driver siemens_b102x_driver_info = {
@@ -326,5 +326,5 @@ SR_PRIV struct sr_dev_driver siemens_b102x_driver_info = {
        .dev_close = dev_close,
        .dev_acquisition_start = dev_acquisition_start,
        .dev_acquisition_stop = dev_acquisition_stop,
-       .priv = NULL,
+       .context = NULL,
 };
index 246b900a6c13e86512f25e3db2211139b25e1095..4abc929a24b0824673303971afe92cc45b3b2e4f 100644 (file)
@@ -105,7 +105,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
        const char *conn, *serialcomm;
        char buf[8];
 
-       drvc = di->priv;
+       drvc = di->context;
 
        devices = NULL;
 
@@ -215,7 +215,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
 
 static GSList *dev_list(const struct sr_dev_driver *di)
 {
-       return ((struct drv_context *)(di->priv))->instances;
+       return ((struct drv_context *)(di->context))->instances;
 }
 
 static int cleanup(const struct sr_dev_driver *di)
@@ -608,5 +608,5 @@ SR_PRIV struct sr_dev_driver ols_driver_info = {
        .dev_close = std_serial_dev_close,
        .dev_acquisition_start = dev_acquisition_start,
        .dev_acquisition_stop = dev_acquisition_stop,
-       .priv = NULL,
+       .context = NULL,
 };
index b84ff193ea8404bbb47ae47ca9eb6aa19bbae140..3c7fc7b1790c0af6e1c37f33d929bb85523631f7 100644 (file)
@@ -93,7 +93,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
 
        (void)options;
 
-       drvc = di->priv;
+       drvc = di->context;
 
        devices = NULL;
 
@@ -201,7 +201,7 @@ err_free_ftdi_buf:
 
 static GSList *dev_list(const struct sr_dev_driver *di)
 {
-       return ((struct drv_context *)(di->priv))->instances;
+       return ((struct drv_context *)(di->context))->instances;
 }
 
 static void clear_helper(void *priv)
@@ -739,5 +739,5 @@ SR_PRIV struct sr_dev_driver p_ols_driver_info = {
        .dev_close = dev_close,
        .dev_acquisition_start = dev_acquisition_start,
        .dev_acquisition_stop = dev_acquisition_stop,
-       .priv = NULL,
+       .context = NULL,
 };
index 7a195bb70c6c9e24eb8868aa57975919697c732d..3febe605f8230d1e60d951ab23038a1015ecc397 100644 (file)
@@ -407,12 +407,12 @@ static struct sr_dev_inst *probe_device(struct sr_scpi_dev_inst *scpi)
 
 static GSList *scan(struct sr_dev_driver *di, GSList *options)
 {
-       return sr_scpi_scan(di->priv, options, probe_device);
+       return sr_scpi_scan(di->context, options, probe_device);
 }
 
 static GSList *dev_list(const struct sr_dev_driver *di)
 {
-       return ((struct drv_context *)(di->priv))->instances;
+       return ((struct drv_context *)(di->context))->instances;
 }
 
 static int dev_open(struct sr_dev_inst *sdi)
@@ -1091,5 +1091,5 @@ SR_PRIV struct sr_dev_driver rigol_ds_driver_info = {
        .dev_close = dev_close,
        .dev_acquisition_start = dev_acquisition_start,
        .dev_acquisition_stop = dev_acquisition_stop,
-       .priv = NULL,
+       .context = NULL,
 };
index 868348c5e169278ea9ae74dd74c261031e429374..7206c5825125ec2a79883920251d916e9ac27731 100644 (file)
@@ -152,7 +152,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
        const char *conn;
        char connection_id[64];
 
-       drvc = di->priv;
+       drvc = di->context;
 
        conn = NULL;
        for (l = options; l; l = l->next) {
@@ -242,7 +242,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
 
 static GSList *dev_list(const struct sr_dev_driver *di)
 {
-       return ((struct drv_context *)(di->priv))->instances;
+       return ((struct drv_context *)(di->context))->instances;
 }
 
 static int logic16_dev_open(struct sr_dev_inst *sdi)
@@ -256,7 +256,7 @@ static int logic16_dev_open(struct sr_dev_inst *sdi)
        char connection_id[64];
 
        di = sdi->driver;
-       drvc = di->priv;
+       drvc = di->context;
        usb = sdi->conn;
 
        if (sdi->status == SR_ST_ACTIVE)
@@ -416,7 +416,7 @@ static int cleanup(const struct sr_dev_driver *di)
        int ret;
        struct drv_context *drvc;
 
-       if (!(drvc = di->priv))
+       if (!(drvc = di->context))
                /* Can get called on an unused driver, doesn't matter. */
                return SR_OK;
 
@@ -687,7 +687,7 @@ static int receive_data(int fd, int revents, void *cb_data)
 
        sdi = cb_data;
        di = sdi->driver;
-       drvc = di->priv;
+       drvc = di->context;
        devc = sdi->priv;
 
        tv.tv_sec = tv.tv_usec = 0;
@@ -717,7 +717,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data)
        if (sdi->status != SR_ST_ACTIVE)
                return SR_ERR_DEV_CLOSED;
 
-       drvc = di->priv;
+       drvc = di->context;
        devc = sdi->priv;
        usb = sdi->conn;
 
@@ -845,5 +845,5 @@ SR_PRIV struct sr_dev_driver saleae_logic16_driver_info = {
        .dev_close = dev_close,
        .dev_acquisition_start = dev_acquisition_start,
        .dev_acquisition_stop = dev_acquisition_stop,
-       .priv = NULL,
+       .context = NULL,
 };
index c728f2b0fde2b494f855f2d6c516f5a0d9fb5ce0..e2c15ac88cc43a86b7d37d2219d03b49decf76dd 100644 (file)
@@ -173,12 +173,12 @@ static struct sr_dev_inst *probe_device(struct sr_scpi_dev_inst *scpi)
 
 static GSList *scan(struct sr_dev_driver *di, GSList *options)
 {
-       return sr_scpi_scan(di->priv, options, probe_device);
+       return sr_scpi_scan(di->context, options, probe_device);
 }
 
 static GSList *dev_list(const struct sr_dev_driver *di)
 {
-       return ((struct drv_context *)(di->priv))->instances;
+       return ((struct drv_context *)(di->context))->instances;
 }
 
 static int dev_clear(const struct sr_dev_driver *di)
@@ -620,5 +620,5 @@ SR_PRIV struct sr_dev_driver scpi_pps_driver_info = {
        .dev_close = dev_close,
        .dev_acquisition_start = dev_acquisition_start,
        .dev_acquisition_stop = dev_acquisition_stop,
-       .priv = NULL,
+       .context = NULL,
 };
index d76d8842da48d72af8d3eec7129aabc7bc5f3753..5a89b3d158ad7d5660ce9812899faf9f5d1b55f0 100644 (file)
@@ -92,7 +92,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
 
        sr_info("Probing serial port %s.", conn);
 
-       drvc = di->priv;
+       drvc = di->context;
        devices = NULL;
        serial_flush(serial);
 
@@ -152,7 +152,7 @@ scan_cleanup:
 
 static GSList *dev_list(const struct sr_dev_driver *di)
 {
-       return ((struct drv_context *)(di->priv))->instances;
+       return ((struct drv_context *)(di->context))->instances;
 }
 
 static int cleanup(const struct sr_dev_driver *di)
@@ -270,7 +270,7 @@ static int dev_acquisition_stop(struct sr_dev_inst *sdi, void *cb_data)
                        .dev_close = std_serial_dev_close, \
                        .dev_acquisition_start = dev_acquisition_start, \
                        .dev_acquisition_stop = dev_acquisition_stop, \
-                       .priv = NULL, \
+                       .context = NULL, \
                }, \
                VENDOR, MODEL, CONN, BAUDRATE, PACKETSIZE, TIMEOUT, DELAY, \
                REQUEST, VALID, PARSE, DETAILS, sizeof(struct CHIPSET##_info) \
index 1d68ba4ab68a88720c8fea832f61c7062285acc7..f5a6d2f1dd1534523f7a57b0a92987e94d1130bc 100644 (file)
@@ -118,7 +118,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
        struct sr_config *src;
        const char *conn;
 
-       drvc = di->priv;
+       drvc = di->context;
        conn = USB_VID_PID;
 
        for (node = options; node != NULL; node = node->next) {
@@ -158,7 +158,7 @@ static GSList *dev_list(const struct sr_dev_driver *di)
 {
        struct drv_context *drvc;
 
-       drvc = di->priv;
+       drvc = di->context;
 
        return drvc->instances;
 }
@@ -186,7 +186,7 @@ static int dev_open(struct sr_dev_inst *sdi)
        struct sr_usb_dev_inst *usb;
        int ret;
 
-       drvc = di->priv;
+       drvc = di->context;
 
        if (!drvc) {
                sr_err("Driver was not initialized.");
@@ -220,7 +220,7 @@ static int dev_close(struct sr_dev_inst *sdi)
 {
        struct sr_usb_dev_inst *usb;
 
-       if (!di->priv) {
+       if (!di->context) {
                sr_err("Driver was not initialized.");
                return SR_ERR;
        }
@@ -482,7 +482,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data)
                return SR_ERR_DEV_CLOSED;
 
        devc = sdi->priv;
-       drvc = di->priv;
+       drvc = di->context;
 
        if (devc->acquisition) {
                sr_err("Acquisition still in progress?");
@@ -557,5 +557,5 @@ SR_PRIV struct sr_dev_driver sysclk_lwla_driver_info = {
        .dev_close = dev_close,
        .dev_acquisition_start = dev_acquisition_start,
        .dev_acquisition_stop = dev_acquisition_stop,
-       .priv = NULL,
+       .context = NULL,
 };
index 13465f5612f85e72add8093a8e04d5f1f9cca053..26f3a41a2e101bdf26fb8a10a8ab4071b1843d1b 100644 (file)
@@ -79,7 +79,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
 
        sr_info("Probing serial port %s.", conn);
 
-       drvc = di->priv;
+       drvc = di->context;
        drvc->instances = NULL;
        serial_flush(serial);
 
@@ -134,7 +134,7 @@ scan_cleanup:
 
 static GSList *dev_list(const struct sr_dev_driver *di)
 {
-       return ((struct drv_context *)(di->priv))->instances;
+       return ((struct drv_context *)(di->context))->instances;
 }
 
 static int cleanup(const struct sr_dev_driver *di)
@@ -248,5 +248,5 @@ SR_PRIV struct sr_dev_driver teleinfo_driver_info = {
        .dev_close = std_serial_dev_close,
        .dev_acquisition_start = dev_acquisition_start,
        .dev_acquisition_stop = dev_acquisition_stop,
-       .priv = NULL,
+       .context = NULL,
 };
index de3faf04334198e4d882d3a46ba25b3e41659bde..0ac6a32ceae4ccfb84cb98762eedd8da29d5c8fa 100644 (file)
@@ -63,7 +63,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
        char manufacturer[64], product[64], connection_id[64];
 
        devices = NULL;
-       drvc = di->priv;
+       drvc = di->context;
        drvc->instances = NULL;
 
        conn_devices = NULL;
@@ -151,7 +151,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
 
 static GSList *dev_list(const struct sr_dev_driver *di)
 {
-       return ((struct drv_context *)(di->priv))->instances;
+       return ((struct drv_context *)(di->context))->instances;
 }
 
 static int dev_clear(const struct sr_dev_driver *di)
@@ -162,13 +162,13 @@ static int dev_clear(const struct sr_dev_driver *di)
 static int dev_open(struct sr_dev_inst *sdi)
 {
        struct sr_dev_driver *di = sdi->driver;
-       struct drv_context *drvc = di->priv;
+       struct drv_context *drvc = di->context;
        struct sr_usb_dev_inst *usb;
        libusb_device **devlist;
        int ret, i;
        char connection_id[64];
 
-       if (!di->priv) {
+       if (!di->context) {
                sr_err("Driver was not initialized.");
                return SR_ERR;
        }
@@ -215,7 +215,7 @@ static int dev_close(struct sr_dev_inst *sdi)
        struct sr_dev_driver *di = sdi->driver;
        struct sr_usb_dev_inst *usb;
 
-       if (!di->priv) {
+       if (!di->context) {
                sr_err("Driver was not initialized.");
                return SR_ERR;
        }
@@ -238,7 +238,7 @@ static int cleanup(const struct sr_dev_driver *di)
        int ret;
        struct drv_context *drvc;
 
-       if (!(drvc = di->priv))
+       if (!(drvc = di->context))
                return SR_OK;
 
        ret = dev_clear(di);
@@ -283,7 +283,7 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd
        if (sdi->status != SR_ST_ACTIVE)
                return SR_ERR_DEV_CLOSED;
 
-       if (!di->priv) {
+       if (!di->context) {
                sr_err("Driver was not initialized.");
                return SR_ERR;
        }
@@ -427,7 +427,7 @@ static int handle_events(int fd, int revents, void *cb_data)
        sdi = cb_data;
        devc = sdi->priv;
        di = sdi->driver;
-       drvc = di->priv;
+       drvc = di->context;
 
        if (devc->limit_msec) {
                now = g_get_monotonic_time() / 1000;
@@ -461,11 +461,11 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data)
        int ret;
        unsigned char *buf;
 
-       drvc = di->priv;
+       drvc = di->context;
        if (sdi->status != SR_ST_ACTIVE)
                return SR_ERR_DEV_CLOSED;
 
-       if (!di->priv) {
+       if (!di->context) {
                sr_err("Driver was not initialized.");
                return SR_ERR;
        }
@@ -510,7 +510,7 @@ static int dev_acquisition_stop(struct sr_dev_inst *sdi, void *cb_data)
        struct sr_dev_driver *di = sdi->driver;
        (void)cb_data;
 
-       if (!di->priv) {
+       if (!di->context) {
                sr_err("Driver was not initialized.");
                return SR_ERR;
        }
@@ -539,5 +539,5 @@ SR_PRIV struct sr_dev_driver testo_driver_info = {
        .dev_close = dev_close,
        .dev_acquisition_start = dev_acquisition_start,
        .dev_acquisition_stop = dev_acquisition_stop,
-       .priv = NULL,
+       .context = NULL,
 };
index 01c336408c06179b39532062b05de2edb0a17bc0..83312249cfcdf56755c304d64b5fd1a8d8af73da 100644 (file)
@@ -54,7 +54,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
        const char *conn, *serialcomm;
        struct sr_serial_dev_inst *serial;
 
-       drvc = di->priv;
+       drvc = di->context;
        drvc->instances = NULL;
 
        devices = NULL;
@@ -107,7 +107,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
 
 static GSList *dev_list(const struct sr_dev_driver *di)
 {
-       return ((struct drv_context *)(di->priv))->instances;
+       return ((struct drv_context *)(di->context))->instances;
 }
 
 static int cleanup(const struct sr_dev_driver *di)
@@ -205,5 +205,5 @@ SR_PRIV struct sr_dev_driver tondaj_sl_814_driver_info = {
        .dev_close = std_serial_dev_close,
        .dev_acquisition_start = dev_acquisition_start,
        .dev_acquisition_stop = dev_acquisition_stop,
-       .priv = NULL,
+       .context = NULL,
 };
index 40ef808aee43a7c34caa5b441fef687945e0ef4b..6f3ad6a2b86db5e7a3999ce19e1ce75c8a8baddd 100644 (file)
@@ -66,7 +66,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
        struct sr_config *src;
        const char *conn;
 
-       drvc = di->priv;
+       drvc = di->context;
        dmm = (struct dmm_info *)di;
 
        conn = NULL;
@@ -109,7 +109,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
 
 static GSList *dev_list(const struct sr_dev_driver *di)
 {
-       return ((struct drv_context *)(di->priv))->instances;
+       return ((struct drv_context *)(di->context))->instances;
 }
 
 static int dev_open(struct sr_dev_inst *sdi)
@@ -120,7 +120,7 @@ static int dev_open(struct sr_dev_inst *sdi)
        int ret;
 
        di = sdi->driver;
-       drvc = di->priv;
+       drvc = di->context;
        usb = sdi->conn;
 
        if ((ret = sr_usb_open(drvc->sr_ctx->libusb_ctx, usb)) == SR_OK)
@@ -244,7 +244,7 @@ static int dev_acquisition_stop(struct sr_dev_inst *sdi, void *cb_data)
                        .dev_close = dev_close, \
                        .dev_acquisition_start = dev_acquisition_start, \
                        .dev_acquisition_stop = dev_acquisition_stop, \
-                       .priv = NULL, \
+                       .context = NULL, \
                }, \
                VENDOR, MODEL, BAUDRATE, PACKETSIZE, \
                VALID, PARSE, DETAILS, sizeof(struct CHIPSET##_info) \
index 136182e2aea9eb00cd9562b61a13785f50166998..c28726669e7a7b8db0f8beede80813b2758ffdb1 100644 (file)
@@ -53,7 +53,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
        unsigned int i;
        const char *conn;
 
-       drvc = di->priv;
+       drvc = di->context;
        drvc->instances = NULL;
 
        conn = NULL;
@@ -99,7 +99,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
 
 static GSList *dev_list(const struct sr_dev_driver *di)
 {
-       return ((struct drv_context *)(di->priv))->instances;
+       return ((struct drv_context *)(di->context))->instances;
 }
 
 static int dev_open(struct sr_dev_inst *sdi)
@@ -109,7 +109,7 @@ static int dev_open(struct sr_dev_inst *sdi)
        struct sr_usb_dev_inst *usb;
        int ret;
 
-       if (!(drvc = di->priv)) {
+       if (!(drvc = di->context)) {
                sr_err("Driver was not initialized.");
                return SR_ERR;
        }
@@ -152,7 +152,7 @@ static int dev_close(struct sr_dev_inst *sdi)
        struct sr_dev_driver *di = sdi->driver;
        struct sr_usb_dev_inst *usb;
 
-       if (!di->priv) {
+       if (!di->context) {
                sr_err("Driver was not initialized.");
                return SR_ERR;
        }
@@ -175,7 +175,7 @@ static int cleanup(const struct sr_dev_driver *di)
        int ret;
        struct drv_context *drvc;
 
-       if (!(drvc = di->priv))
+       if (!(drvc = di->context))
                /* Can get called on an unused driver, doesn't matter. */
                return SR_OK;
 
@@ -222,7 +222,7 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd
        if (sdi->status != SR_ST_ACTIVE)
                return SR_ERR_DEV_CLOSED;
 
-       if (!di->priv) {
+       if (!di->context) {
                sr_err("Driver was not initialized.");
                return SR_ERR;
        }
@@ -283,7 +283,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi,
        if (sdi->status != SR_ST_ACTIVE)
                return SR_ERR_DEV_CLOSED;
 
-       drvc = di->priv;
+       drvc = di->context;
        devc = sdi->priv;
        usb = sdi->conn;
 
@@ -365,5 +365,5 @@ SR_PRIV struct sr_dev_driver uni_t_ut32x_driver_info = {
        .dev_close = dev_close,
        .dev_acquisition_start = dev_acquisition_start,
        .dev_acquisition_stop = dev_acquisition_stop,
-       .priv = NULL,
+       .context = NULL,
 };
index a79d07ae2f28ade7d467e4eaea508770aaf2165c..0c7829f85c8d2069d04b999c6d2d34fa2f449fa3 100644 (file)
@@ -207,7 +207,7 @@ SR_PRIV int uni_t_ut32x_handle_events(int fd, int revents, void *cb_data)
                return TRUE;
 
        di = sdi->driver;
-       drvc = di->priv;
+       drvc = di->context;
 
        if (!(devc = sdi->priv))
                return TRUE;
index 7ed2bf435fb0081032023debec8cf999470d5bb9..e82302618693c76f09de61eb89e847c9063785c8 100644 (file)
@@ -67,7 +67,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
 
        (void)options;
 
-       drvc = di->priv;
+       drvc = di->context;
 
        devices = NULL;
        libusb_get_device_list(drvc->sr_ctx->libusb_ctx, &devlist);
@@ -107,19 +107,19 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
 
 static GSList *dev_list(const struct sr_dev_driver *di)
 {
-       return ((struct drv_context *)(di->priv))->instances;
+       return ((struct drv_context *)(di->context))->instances;
 }
 
 static int dev_open(struct sr_dev_inst *sdi)
 {
        struct sr_dev_driver *di = sdi->driver;
-       struct drv_context *drvc = di->priv;
+       struct drv_context *drvc = di->context;
        struct sr_usb_dev_inst *usb;
        libusb_device **devlist;
        int ret, i;
        char connection_id[64];
 
-       if (!di->priv) {
+       if (!di->context) {
                sr_err("Driver was not initialized.");
                return SR_ERR;
        }
@@ -168,7 +168,7 @@ static int dev_close(struct sr_dev_inst *sdi)
        struct sr_dev_driver *di = sdi->driver;
        struct sr_usb_dev_inst *usb;
 
-       if (!di->priv) {
+       if (!di->context) {
                sr_err("Driver was not initialized.");
                return SR_ERR;
        }
@@ -192,7 +192,7 @@ static int cleanup(const struct sr_dev_driver *di)
        int ret;
        struct drv_context *drvc;
 
-       if (!(drvc = di->priv))
+       if (!(drvc = di->context))
                /* Can get called on an unused driver, doesn't matter. */
                return SR_OK;
 
@@ -237,7 +237,7 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd
        if (sdi->status != SR_ST_ACTIVE)
                return SR_ERR_DEV_CLOSED;
 
-       if (!di->priv) {
+       if (!di->context) {
                sr_err("Driver was not initialized.");
                return SR_ERR;
        }
@@ -343,7 +343,7 @@ static int handle_events(int fd, int revents, void *cb_data)
        sdi = cb_data;
        devc = sdi->priv;
        di = sdi->driver;
-       drvc = di->priv;
+       drvc = di->context;
 
        if (devc->limit_msec) {
                now = g_get_monotonic_time() / 1000;
@@ -371,7 +371,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data)
 {
        struct sr_dev_driver *di = sdi->driver;
        struct dev_context *devc;
-       struct drv_context *drvc = di->priv;
+       struct drv_context *drvc = di->context;
        struct sr_usb_dev_inst *usb;
        struct libusb_transfer *transfer;
        int ret;
@@ -380,7 +380,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data)
        if (sdi->status != SR_ST_ACTIVE)
                return SR_ERR_DEV_CLOSED;
 
-       if (!di->priv) {
+       if (!di->context) {
                sr_err("Driver was not initialized.");
                return SR_ERR;
        }
@@ -419,7 +419,7 @@ static int dev_acquisition_stop(struct sr_dev_inst *sdi, void *cb_data)
        struct sr_dev_driver *di = sdi->driver;
        (void)cb_data;
 
-       if (!di->priv) {
+       if (!di->context) {
                sr_err("Driver was not initialized.");
                return SR_ERR;
        }
@@ -450,5 +450,5 @@ SR_PRIV struct sr_dev_driver victor_dmm_driver_info = {
        .dev_close = dev_close,
        .dev_acquisition_start = dev_acquisition_start,
        .dev_acquisition_stop = dev_acquisition_stop,
-       .priv = NULL,
+       .context = NULL,
 };
index 618c3a4e119dbc840e4c1db4727c07d58d9ec718..382762b6a5c2dbe868d463bc7a79d51af69892d0 100644 (file)
@@ -127,12 +127,12 @@ fail:
 
 static GSList *scan(struct sr_dev_driver *di, GSList *options)
 {
-       return sr_scpi_scan(di->priv, options, probe_usbtmc_device);
+       return sr_scpi_scan(di->context, options, probe_usbtmc_device);
 }
 
 static GSList *dev_list(const struct sr_dev_driver *di)
 {
-       return ((struct drv_context *)(di->priv))->instances;
+       return ((struct drv_context *)(di->context))->instances;
 }
 
 static void clear_helper(void *priv)
@@ -718,5 +718,5 @@ SR_PRIV struct sr_dev_driver yokogawa_dlm_driver_info = {
        .dev_close = dev_close,
        .dev_acquisition_start = dev_acquisition_start,
        .dev_acquisition_stop = dev_acquisition_stop,
-       .priv = NULL,
+       .context = NULL,
 };
index 5de6f317099d1a63d6346d35d6f4dd65b5d657e3..62577a1451ae27001cf9c6fa73a70e760a2c475f 100644 (file)
@@ -174,7 +174,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
 
        (void)options;
 
-       drvc = di->priv;
+       drvc = di->context;
 
        devices = NULL;
 
@@ -262,7 +262,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
 
 static GSList *dev_list(const struct sr_dev_driver *di)
 {
-       return ((struct drv_context *)(di->priv))->instances;
+       return ((struct drv_context *)(di->context))->instances;
 }
 
 static int dev_open(struct sr_dev_inst *sdi)
@@ -275,7 +275,7 @@ static int dev_open(struct sr_dev_inst *sdi)
        int device_count, ret, i;
        char connection_id[64];
 
-       drvc = di->priv;
+       drvc = di->context;
        usb = sdi->conn;
 
        if (!(devc = sdi->priv)) {
@@ -740,5 +740,5 @@ SR_PRIV struct sr_dev_driver zeroplus_logic_cube_driver_info = {
        .dev_close = dev_close,
        .dev_acquisition_start = dev_acquisition_start,
        .dev_acquisition_stop = dev_acquisition_stop,
-       .priv = NULL,
+       .context = NULL,
 };
index 26ecbe1a538e92343e84885e4c926c8a26594995..74d75e6a1e5bdad58909aabb93e207b8f68d7f1e 100644 (file)
@@ -397,7 +397,7 @@ SR_API GSList *sr_driver_scan(struct sr_dev_driver *driver, GSList *options)
                return NULL;
        }
 
-       if (!driver->priv) {
+       if (!driver->context) {
                sr_err("Driver not initialized, can't scan for devices.");
                return NULL;
        }
@@ -434,7 +434,7 @@ SR_PRIV void sr_hw_cleanup_all(const struct sr_context *ctx)
        for (i = 0; drivers[i]; i++) {
                if (drivers[i]->cleanup)
                        drivers[i]->cleanup(drivers[i]);
-               drivers[i]->priv = NULL;
+               drivers[i]->context = NULL;
        }
 }
 
index ae1b211892c792779a2df33691e1e064f4f42609..91c05404316620fbeae853ba983893922b2d160c 100644 (file)
@@ -171,7 +171,7 @@ static int dev_clear(const struct sr_dev_driver *di)
        struct drv_context *drvc;
        GSList *l;
 
-       drvc = di->priv;
+       drvc = di->context;
        for (l = drvc->instances; l; l = l->next)
                sr_dev_inst_free(l->data);
        g_slist_free(drvc->instances);
@@ -187,7 +187,7 @@ static int dev_open(struct sr_dev_inst *sdi)
        struct session_vdev *vdev;
 
        di = sdi->driver;
-       drvc = di->priv;
+       drvc = di->context;
        vdev = g_malloc0(sizeof(struct session_vdev));
        sdi->priv = vdev;
        drvc->instances = g_slist_append(drvc->instances, sdi);
@@ -335,5 +335,5 @@ SR_PRIV struct sr_dev_driver session_driver = {
        .dev_close = dev_close,
        .dev_acquisition_start = dev_acquisition_start,
        .dev_acquisition_stop = NULL,
-       .priv = NULL,
+       .context = NULL,
 };
index 008e645ca04c8fe43b538c834b31194e1e1db054..5b97f66a857696f09998b30732ec6956f3649c5f 100644 (file)
--- a/src/std.c
+++ b/src/std.c
@@ -56,7 +56,7 @@ SR_PRIV int std_init(struct sr_context *sr_ctx, struct sr_dev_driver *di,
        drvc = g_malloc0(sizeof(struct drv_context));
        drvc->sr_ctx = sr_ctx;
        drvc->instances = NULL;
-       di->priv = drvc;
+       di->context = drvc;
 
        return SR_OK;
 }
@@ -247,7 +247,7 @@ SR_PRIV int std_dev_clear(const struct sr_dev_driver *driver,
        GSList *l;
        int ret;
 
-       if (!(drvc = driver->priv))
+       if (!(drvc = driver->context))
                /* Driver was never initialized, nothing to do. */
                return SR_OK;