From: Uwe Hermann Date: Wed, 29 Aug 2018 22:12:12 +0000 (+0200) Subject: ipdbg-la: Drop various unneeded name prefixes. X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=1f15efc1f7aaf7a947bab7142894131b96aa12e5;p=libsigrok.git ipdbg-la: Drop various unneeded name prefixes. --- diff --git a/src/hardware/ipdbg-la/api.c b/src/hardware/ipdbg-la/api.c index f39a70ba..984778ed 100644 --- a/src/hardware/ipdbg-la/api.c +++ b/src/hardware/ipdbg-la/api.c @@ -20,21 +20,21 @@ #include #include "protocol.h" -static const uint32_t ipdbg_la_drvopts[] = { +static const uint32_t drvopts[] = { SR_CONF_LOGIC_ANALYZER, }; -static const uint32_t ipdbg_la_scanopts[] = { +static const uint32_t scanopts[] = { SR_CONF_CONN, }; -static const uint32_t ipdbg_la_devopts[] = { +static const uint32_t devopts[] = { SR_CONF_TRIGGER_MATCH | SR_CONF_LIST | SR_CONF_SET, SR_CONF_CAPTURE_RATIO | SR_CONF_GET | SR_CONF_SET, SR_CONF_LIMIT_SAMPLES | SR_CONF_GET, }; -static const int32_t ipdbg_la_trigger_matches[] = { +static const int32_t trigger_matches[] = { SR_TRIGGER_ZERO, SR_TRIGGER_ONE, SR_TRIGGER_RISING, @@ -108,7 +108,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) sdi->version = g_strdup("v1.0"); sdi->driver = di; - struct ipdbg_la_dev_context *devc = ipdbg_la_dev_new(); + struct dev_context *devc = ipdbg_la_dev_new(); sdi->priv = devc; ipdbg_la_get_addrwidth_and_datawidth(tcp, devc); @@ -194,7 +194,7 @@ static int config_get(uint32_t key, GVariant **data, (void)cg; - struct ipdbg_la_dev_context *devc = sdi->priv; + struct dev_context *devc = sdi->priv; switch (key) { case SR_CONF_CAPTURE_RATIO: @@ -221,7 +221,7 @@ static int config_set(uint32_t key, GVariant *data, if (sdi->status != SR_ST_ACTIVE) return SR_ERR_DEV_CLOSED; - struct ipdbg_la_dev_context *devc = sdi->priv; + struct dev_context *devc = sdi->priv; switch (key) { case SR_CONF_CAPTURE_RATIO: @@ -253,31 +253,19 @@ static int config_list(uint32_t key, GVariant **data, switch (key) { case SR_CONF_SCAN_OPTIONS: *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32, - ipdbg_la_scanopts, - ARRAY_SIZE - (ipdbg_la_scanopts), - sizeof(uint32_t)); + scanopts, ARRAY_SIZE(scanopts), sizeof(uint32_t)); break; case SR_CONF_DEVICE_OPTIONS: if (!sdi) *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32, - ipdbg_la_drvopts, - ARRAY_SIZE - (ipdbg_la_drvopts), - sizeof(uint32_t)); + drvopts, ARRAY_SIZE(drvopts), sizeof(uint32_t)); else *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32, - ipdbg_la_devopts, - ARRAY_SIZE - (ipdbg_la_devopts), - sizeof(uint32_t)); + devopts, ARRAY_SIZE(devopts), sizeof(uint32_t)); break; case SR_CONF_TRIGGER_MATCH: *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32, - ipdbg_la_trigger_matches, - ARRAY_SIZE - (ipdbg_la_trigger_matches), - sizeof(int32_t)); + trigger_matches, ARRAY_SIZE(trigger_matches), sizeof(int32_t)); break; default: return SR_ERR_NA; @@ -302,7 +290,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi) return SR_ERR_DEV_CLOSED; struct ipdbg_la_tcp *tcp = sdi->conn; - struct ipdbg_la_dev_context *devc = sdi->priv; + struct dev_context *devc = sdi->priv; ipdbg_la_convert_trigger(sdi); ipdbg_la_send_trigger(devc, tcp); @@ -322,7 +310,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi) static int dev_acquisition_stop(struct sr_dev_inst *sdi) { struct ipdbg_la_tcp *tcp = sdi->conn; - struct ipdbg_la_dev_context *devc = sdi->priv; + struct dev_context *devc = sdi->priv; uint8_t byte; diff --git a/src/hardware/ipdbg-la/protocol.c b/src/hardware/ipdbg-la/protocol.c index 1f7d349f..c9fc45a4 100644 --- a/src/hardware/ipdbg-la/protocol.c +++ b/src/hardware/ipdbg-la/protocol.c @@ -217,7 +217,7 @@ SR_PRIV int ipdbg_la_tcp_receive(struct ipdbg_la_tcp *tcp, SR_PRIV int ipdbg_la_convert_trigger(const struct sr_dev_inst *sdi) { - struct ipdbg_la_dev_context *devc; + struct dev_context *devc; struct sr_trigger *trigger; struct sr_trigger_stage *stage; struct sr_trigger_match *match; @@ -288,7 +288,7 @@ SR_PRIV int ipdbg_la_convert_trigger(const struct sr_dev_inst *sdi) SR_PRIV int ipdbg_la_receive_data(int fd, int revents, void *cb_data) { const struct sr_dev_inst *sdi; - struct ipdbg_la_dev_context *devc; + struct dev_context *devc; (void)fd; (void)revents; @@ -358,7 +358,7 @@ SR_PRIV int ipdbg_la_receive_data(int fd, int revents, void *cb_data) return TRUE; } -SR_PRIV int ipdbg_la_send_delay(struct ipdbg_la_dev_context *devc, +SR_PRIV int ipdbg_la_send_delay(struct dev_context *devc, struct ipdbg_la_tcp *tcp) { devc->delay_value = (devc->limit_samples / 100.0) * devc->capture_ratio; @@ -381,7 +381,7 @@ SR_PRIV int ipdbg_la_send_delay(struct ipdbg_la_dev_context *devc, return SR_OK; } -SR_PRIV int ipdbg_la_send_trigger(struct ipdbg_la_dev_context *devc, +SR_PRIV int ipdbg_la_send_trigger(struct dev_context *devc, struct ipdbg_la_tcp *tcp) { uint8_t buf; @@ -473,7 +473,7 @@ SR_PRIV int send_escaping(struct ipdbg_la_tcp *tcp, uint8_t *dataToSend, } SR_PRIV void ipdbg_la_get_addrwidth_and_datawidth( - struct ipdbg_la_tcp *tcp, struct ipdbg_la_dev_context *devc) + struct ipdbg_la_tcp *tcp, struct dev_context *devc) { uint8_t buf[8]; uint8_t read_cmd = CMD_GET_BUS_WIDTHS; @@ -511,11 +511,11 @@ SR_PRIV void ipdbg_la_get_addrwidth_and_datawidth( devc->trigger_edge_mask = g_malloc0(devc->DATA_WIDTH_BYTES); } -SR_PRIV struct ipdbg_la_dev_context *ipdbg_la_dev_new(void) +SR_PRIV struct dev_context *ipdbg_la_dev_new(void) { - struct ipdbg_la_dev_context *devc; + struct dev_context *devc; - devc = g_malloc0(sizeof(struct ipdbg_la_dev_context)); + devc = g_malloc0(sizeof(struct dev_context)); devc->capture_ratio = 50; return devc; diff --git a/src/hardware/ipdbg-la/protocol.h b/src/hardware/ipdbg-la/protocol.h index bcc33315..85f41a16 100644 --- a/src/hardware/ipdbg-la/protocol.h +++ b/src/hardware/ipdbg-la/protocol.h @@ -34,7 +34,7 @@ struct ipdbg_la_tcp { }; /** Private, per-device-instance driver context. */ -struct ipdbg_la_dev_context { +struct dev_context { uint32_t DATA_WIDTH; uint32_t DATA_WIDTH_BYTES; uint32_t ADDR_WIDTH; @@ -69,17 +69,17 @@ SR_PRIV int ipdbg_la_tcp_receive(struct ipdbg_la_tcp *tcp, SR_PRIV int ipdbg_la_convert_trigger(const struct sr_dev_inst *sdi); -SR_PRIV struct ipdbg_la_dev_context *ipdbg_la_dev_new(void); +SR_PRIV struct dev_context *ipdbg_la_dev_new(void); SR_PRIV void ipdbg_la_get_addrwidth_and_datawidth( - struct ipdbg_la_tcp *tcp, struct ipdbg_la_dev_context *devc); + struct ipdbg_la_tcp *tcp, struct dev_context *devc); SR_PRIV int send_escaping(struct ipdbg_la_tcp *tcp, uint8_t *dataToSend, uint32_t length); SR_PRIV int ipdbg_la_send_reset(struct ipdbg_la_tcp *tcp); SR_PRIV int ipdbg_la_request_id(struct ipdbg_la_tcp *tcp); SR_PRIV int ipdbg_la_send_start(struct ipdbg_la_tcp *tcp); -SR_PRIV int ipdbg_la_send_trigger(struct ipdbg_la_dev_context *devc, +SR_PRIV int ipdbg_la_send_trigger(struct dev_context *devc, struct ipdbg_la_tcp *tcp); -SR_PRIV int ipdbg_la_send_delay(struct ipdbg_la_dev_context *devc, +SR_PRIV int ipdbg_la_send_delay(struct dev_context *devc, struct ipdbg_la_tcp *tcp); SR_PRIV int ipdbg_la_receive_data(int fd, int revents, void *cb_data); SR_PRIV void ipdbg_la_abort_acquisition(const struct sr_dev_inst *sdi);