From: Uwe Hermann Date: Thu, 7 Feb 2013 08:11:26 +0000 (+0100) Subject: Rename session_dev_id to cb_data everywhere. X-Git-Tag: dsupstream~275 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=3e9b7f9c776221c2c6b0d9f51b48db31383a4b03;p=libsigrok.git Rename session_dev_id to cb_data everywhere. We use 'cb_data' in all drivers these days, make the few remaining ones that use 'session_dev_id' consistent. --- diff --git a/hardware/asix-sigma/asix-sigma.c b/hardware/asix-sigma/asix-sigma.c index fc7b68e6..6561c00a 100644 --- a/hardware/asix-sigma/asix-sigma.c +++ b/hardware/asix-sigma/asix-sigma.c @@ -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); diff --git a/hardware/asix-sigma/asix-sigma.h b/hardware/asix-sigma/asix-sigma.h index 1a8ad43b..15169d36 100644 --- a/hardware/asix-sigma/asix-sigma.h +++ b/hardware/asix-sigma/asix-sigma.h @@ -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 diff --git a/hardware/chronovu-la8/api.c b/hardware/chronovu-la8/api.c index 66cbdb6e..2dd12e3b 100644 --- a/hardware/chronovu-la8/api.c +++ b/hardware/chronovu-la8/api.c @@ -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); diff --git a/hardware/chronovu-la8/protocol.c b/hardware/chronovu-la8/protocol.c index 35a0342c..5de7cf17 100644 --- a/hardware/chronovu-la8/protocol.c +++ b/hardware/chronovu-la8/protocol.c @@ -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); } } diff --git a/hardware/chronovu-la8/protocol.h b/hardware/chronovu-la8/protocol.h index 07e04c2f..8c78ef07 100644 --- a/hardware/chronovu-la8/protocol.h +++ b/hardware/chronovu-la8/protocol.h @@ -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. diff --git a/hardware/demo/demo.c b/hardware/demo/demo.c index 8a4bc9a0..560d1be3 100644 --- a/hardware/demo/demo.c +++ b/hardware/demo/demo.c @@ -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; } diff --git a/hardware/fx2lafw/fx2lafw.c b/hardware/fx2lafw/fx2lafw.c index 1bbb4547..0cebebab 100644 --- a/hardware/fx2lafw/fx2lafw.c +++ b/hardware/fx2lafw/fx2lafw.c @@ -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; diff --git a/hardware/fx2lafw/fx2lafw.h b/hardware/fx2lafw/fx2lafw.h index 1e3c0990..2958a969 100644 --- a/hardware/fx2lafw/fx2lafw.h +++ b/hardware/fx2lafw/fx2lafw.h @@ -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; diff --git a/hardware/link-mso19/protocol.h b/hardware/link-mso19/protocol.h index 77a87bfe..687e5a09 100644 --- a/hardware/link-mso19/protocol.h +++ b/hardware/link-mso19/protocol.h @@ -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]; };