]> sigrok.org Git - libsigrok.git/commitdiff
Rename session_dev_id to cb_data everywhere.
authorUwe Hermann <redacted>
Thu, 7 Feb 2013 08:11:26 +0000 (09:11 +0100)
committerUwe Hermann <redacted>
Thu, 7 Feb 2013 10:26:02 +0000 (11:26 +0100)
We use 'cb_data' in all drivers these days, make the few remaining ones
that use 'session_dev_id' consistent.

hardware/asix-sigma/asix-sigma.c
hardware/asix-sigma/asix-sigma.h
hardware/chronovu-la8/api.c
hardware/chronovu-la8/protocol.c
hardware/chronovu-la8/protocol.h
hardware/demo/demo.c
hardware/fx2lafw/fx2lafw.c
hardware/fx2lafw/fx2lafw.h
hardware/link-mso19/protocol.h

index fc7b68e680b2e558e50cc2a7ff0006f840fb24c5..6561c00abb58154101e09004e0a631e60239ecff 100644 (file)
@@ -940,7 +940,7 @@ static int decode_chunk_ts(uint8_t *buf, uint16_t *lastts,
                        logic.length = tosend * sizeof(uint16_t);
                        logic.unitsize = 2;
                        logic.data = samples + sent;
-                       sr_session_send(devc->session_dev_id, &packet);
+                       sr_session_send(devc->cb_data, &packet);
 
                        sent += tosend;
                }
@@ -983,7 +983,7 @@ static int decode_chunk_ts(uint8_t *buf, uint16_t *lastts,
                                logic.length = tosend * sizeof(uint16_t);
                                logic.unitsize = 2;
                                logic.data = samples;
-                               sr_session_send(devc->session_dev_id, &packet);
+                               sr_session_send(devc->cb_data, &packet);
 
                                sent += tosend;
                        }
@@ -991,7 +991,7 @@ static int decode_chunk_ts(uint8_t *buf, uint16_t *lastts,
                        /* Only send trigger if explicitly enabled. */
                        if (devc->use_triggers) {
                                packet.type = SR_DF_TRIGGER;
-                               sr_session_send(devc->session_dev_id, &packet);
+                               sr_session_send(devc->cb_data, &packet);
                        }
                }
 
@@ -1004,7 +1004,7 @@ static int decode_chunk_ts(uint8_t *buf, uint16_t *lastts,
                        logic.length = tosend * sizeof(uint16_t);
                        logic.unitsize = 2;
                        logic.data = samples + sent;
-                       sr_session_send(devc->session_dev_id, &packet);
+                       sr_session_send(devc->cb_data, &packet);
                }
 
                *lastsample = samples[n - 1];
@@ -1052,7 +1052,7 @@ static int receive_data(int fd, int revents, void *cb_data)
                if (devc->state.chunks_downloaded >= numchunks) {
                        /* End of samples. */
                        packet.type = SR_DF_END;
-                       sr_session_send(devc->session_dev_id, &packet);
+                       sr_session_send(devc->cb_data, &packet);
 
                        devc->state.state = SIGMA_IDLE;
 
@@ -1357,7 +1357,7 @@ static int hw_dev_acquisition_start(const struct sr_dev_inst *sdi,
        gettimeofday(&devc->start_tv, 0);
        sigma_set_register(WRITE_MODE, 0x0d, devc);
 
-       devc->session_dev_id = cb_data;
+       devc->cb_data = cb_data;
 
        /* Send header packet to the session bus. */
        std_session_send_df_header(cb_data, DRIVER_LOG_DOMAIN);
index 1a8ad43b48d6481fe6a9bbcc58c8bf1b71ce1ce2..15169d36c9271ae43075e64cd682e2b49b57e246 100644 (file)
@@ -196,7 +196,7 @@ struct dev_context {
        struct sigma_trigger trigger;
        int use_triggers;
        struct sigma_state state;
-       void *session_dev_id;
+       void *cb_data;
 };
 
 #endif
index 66cbdb6ecdfa83393d409b55dc222f945ccdd5e3..2dd12e3bf05411900c121ca760e7d25ccca35417 100644 (file)
@@ -100,7 +100,7 @@ static GSList *hw_scan(GSList *options)
        devc->cur_samplerate = SR_MHZ(100); /* 100MHz == max. samplerate */
        devc->limit_msec = 0;
        devc->limit_samples = 0;
-       devc->session_dev_id = NULL;
+       devc->cb_data = NULL;
        memset(devc->mangled_buf, 0, BS);
        devc->final_buf = NULL;
        devc->trigger_pattern = 0x00; /* Value irrelevant, see trigger_mask. */
@@ -449,7 +449,7 @@ static int hw_dev_acquisition_start(const struct sr_dev_inst *sdi,
 
        sr_dbg("Hardware acquisition started successfully.");
 
-       devc->session_dev_id = cb_data;
+       devc->cb_data = cb_data;
 
        /* Send header packet to the session bus. */
        std_session_send_df_header(cb_data, DRIVER_LOG_DOMAIN);
index 35a0342c30eb34b9ca6a36da6a0b35a06e2b9f3b..5de7cf1761c5a1b7a1df0d58ff7e580c557bad38 100644 (file)
@@ -488,7 +488,7 @@ SR_PRIV void send_block_to_session_bus(struct dev_context *devc, int block)
                logic.length = BS;
                logic.unitsize = 1;
                logic.data = devc->final_buf + (block * BS);
-               sr_session_send(devc->session_dev_id, &packet);
+               sr_session_send(devc->cb_data, &packet);
                return;
        }
 
@@ -511,7 +511,7 @@ SR_PRIV void send_block_to_session_bus(struct dev_context *devc, int block)
                logic.length = trigger_point;
                logic.unitsize = 1;
                logic.data = devc->final_buf + (block * BS);
-               sr_session_send(devc->session_dev_id, &packet);
+               sr_session_send(devc->cb_data, &packet);
        }
 
        /* Send the SR_DF_TRIGGER packet to the session bus. */
@@ -519,7 +519,7 @@ SR_PRIV void send_block_to_session_bus(struct dev_context *devc, int block)
                (block * BS) + trigger_point);
        packet.type = SR_DF_TRIGGER;
        packet.payload = NULL;
-       sr_session_send(devc->session_dev_id, &packet);
+       sr_session_send(devc->cb_data, &packet);
 
        /* If at least one sample is located after the trigger... */
        if (trigger_point < (BS - 1)) {
@@ -532,6 +532,6 @@ SR_PRIV void send_block_to_session_bus(struct dev_context *devc, int block)
                logic.length = BS - trigger_point;
                logic.unitsize = 1;
                logic.data = devc->final_buf + (block * BS) + trigger_point;
-               sr_session_send(devc->session_dev_id, &packet);
+               sr_session_send(devc->cb_data, &packet);
        }
 }
index 07e04c2fb98d78733890e2d8890d2dd86f71c8ab..8c78ef077bd94705b537b1b45bad22b6ac7643f7 100644 (file)
@@ -64,8 +64,7 @@ struct dev_context {
        /** The current sampling limit (in number of samples). */
        uint64_t limit_samples;
 
-       /** TODO */
-       void *session_dev_id;
+       void *cb_data;
 
        /**
         * A buffer containing some (mangled) samples from the device.
index 8a4bc9a0593c7b15ae5cfdfb44e3c2306716104b..560d1be3c5d99da52c5d950f810716a475e58fce 100644 (file)
@@ -79,7 +79,7 @@ struct dev_context {
        GIOChannel *channels[2];
        uint8_t sample_generator;
        uint64_t samples_counter;
-       void *session_dev_id;
+       void *cb_data;
        int64_t starttime;
 };
 
@@ -371,7 +371,7 @@ static int receive_data(int fd, int revents, void *cb_data)
                logic.length = sending_now;
                logic.unitsize = 1;
                logic.data = buf;
-               sr_session_send(devc->session_dev_id, &packet);
+               sr_session_send(devc->cb_data, &packet);
                devc->samples_counter += sending_now;
        }
 
@@ -398,7 +398,7 @@ static int hw_dev_acquisition_start(const struct sr_dev_inst *sdi,
        }
 
        devc->sample_generator = default_pattern;
-       devc->session_dev_id = cb_data;
+       devc->cb_data = cb_data;
        devc->samples_counter = 0;
 
        /*
@@ -455,7 +455,7 @@ static int hw_dev_acquisition_stop(struct sr_dev_inst *sdi, void *cb_data)
 
        /* Send last packet. */
        packet.type = SR_DF_END;
-       sr_session_send(devc->session_dev_id, &packet);
+       sr_session_send(devc->cb_data, &packet);
 
        return SR_OK;
 }
index 1bbb45470bbbd5fb567cd38eab971752ff2f6079..0cebebab22d92cb05484951ed7f26fc90ae62487 100644 (file)
@@ -688,7 +688,7 @@ static void finish_acquisition(struct dev_context *devc)
 
        /* Terminate session. */
        packet.type = SR_DF_END;
-       sr_session_send(devc->session_dev_id, &packet);
+       sr_session_send(devc->cb_data, &packet);
 
        /* Remove fds from polling. */
        lupfd = libusb_get_pollfds(drvc->sr_ctx->libusb_ctx);
@@ -820,7 +820,7 @@ static void receive_transfer(struct libusb_transfer *transfer)
                                         */
                                        packet.type = SR_DF_TRIGGER;
                                        packet.payload = NULL;
-                                       sr_session_send(devc->session_dev_id, &packet);
+                                       sr_session_send(devc->cb_data, &packet);
 
                                        /*
                                         * Send the samples that triggered it,
@@ -831,7 +831,7 @@ static void receive_transfer(struct libusb_transfer *transfer)
                                        logic.unitsize = sizeof(*devc->trigger_buffer);
                                        logic.length = devc->trigger_stage * logic.unitsize;
                                        logic.data = devc->trigger_buffer;
-                                       sr_session_send(devc->session_dev_id, &packet);
+                                       sr_session_send(devc->cb_data, &packet);
 
                                        devc->trigger_stage = TRIGGER_FIRED;
                                        break;
@@ -861,7 +861,7 @@ static void receive_transfer(struct libusb_transfer *transfer)
                logic.length = transfer->actual_length - trigger_offset_bytes;
                logic.unitsize = sample_width;
                logic.data = cur_buf + trigger_offset_bytes;
-               sr_session_send(devc->session_dev_id, &packet);
+               sr_session_send(devc->cb_data, &packet);
 
                devc->num_samples += cur_sample_count;
                if (devc->limit_samples &&
@@ -943,7 +943,7 @@ static int hw_dev_acquisition_start(const struct sr_dev_inst *sdi,
                return SR_ERR;
        }
 
-       devc->session_dev_id = cb_data;
+       devc->cb_data = cb_data;
        devc->num_samples = 0;
        devc->empty_transfer_count = 0;
 
index 1e3c09906eca2ec69ab3f0e4b6f00b9dca410c06..2958a9695ce76c8e583a04a9f5b70a07b3336c6d 100644 (file)
@@ -95,7 +95,7 @@ struct dev_context {
        int submitted_transfers;
        int empty_transfer_count;
 
-       void *session_dev_id;
+       void *cb_data;
 
        struct sr_usb_dev_inst *usb;
 
index 77a87bfee216cd5c016e1dc75f7cba0631e1f5c1..687e5a09d69b0c35325b0bc6d9fc5293db6bd499 100644 (file)
@@ -123,7 +123,7 @@ struct dev_context {
        double dso_trigger_voltage;
        uint16_t dso_trigger_width;
        struct mso_prototrig protocol_trigger;
-       void *session_dev_id;
+       void *cb_data;
        uint16_t buffer_n;
        char buffer[4096];
 };