From 44b46d703612aa7dfc406043cf1b82bdae19179b Mon Sep 17 00:00:00 2001 From: Uwe Hermann Date: Tue, 20 Jun 2017 23:07:27 +0200 Subject: [PATCH] dreamsourcelab-dslogic: Naming and other consistency fixes. --- Makefile.am | 8 +++--- configure.ac | 2 +- .../{dslogic => dreamsourcelab-dslogic}/api.c | 26 +++++++++---------- .../protocol.c | 20 +++++++------- .../protocol.h | 6 ++--- 5 files changed, 30 insertions(+), 32 deletions(-) rename src/hardware/{dslogic => dreamsourcelab-dslogic}/api.c (96%) rename src/hardware/{dslogic => dreamsourcelab-dslogic}/protocol.c (98%) rename src/hardware/{dslogic => dreamsourcelab-dslogic}/protocol.h (95%) diff --git a/Makefile.am b/Makefile.am index 58e954d6..c9b89938 100644 --- a/Makefile.am +++ b/Makefile.am @@ -272,11 +272,11 @@ src_libdrivers_la_SOURCES += \ src/hardware/demo/protocol.c \ src/hardware/demo/api.c endif -if HW_DSLOGIC +if HW_DREAMSOURCELAB_DSLOGIC src_libdrivers_la_SOURCES += \ - src/hardware/dslogic/protocol.h \ - src/hardware/dslogic/protocol.c \ - src/hardware/dslogic/api.c + src/hardware/dreamsourcelab-dslogic/protocol.h \ + src/hardware/dreamsourcelab-dslogic/protocol.c \ + src/hardware/dreamsourcelab-dslogic/api.c endif if HW_FLUKE_DMM src_libdrivers_la_SOURCES += \ diff --git a/configure.ac b/configure.ac index 2a24d414..ce81eac0 100644 --- a/configure.ac +++ b/configure.ac @@ -234,7 +234,7 @@ SR_DRIVER([ChronoVu LA], [chronovu-la], [libusb libftdi]) SR_DRIVER([Colead SLM], [colead-slm], [libserialport]) SR_DRIVER([Conrad DIGI 35 CPU], [conrad-digi-35-cpu], [libserialport]) SR_DRIVER([demo], [demo]) -SR_DRIVER([DreamSourceLabs], [DSLogic], [libusb]) +SR_DRIVER([DreamSourceLab DSLogic], [dreamsourcelab-dslogic], [libusb]) SR_DRIVER([Fluke DMM], [fluke-dmm], [libserialport]) SR_DRIVER([FTDI LA], [ftdi-la], [libusb libftdi]) SR_DRIVER([fx2lafw], [fx2lafw], [libusb]) diff --git a/src/hardware/dslogic/api.c b/src/hardware/dreamsourcelab-dslogic/api.c similarity index 96% rename from src/hardware/dslogic/api.c rename to src/hardware/dreamsourcelab-dslogic/api.c index 8e49c92a..bc6979fe 100644 --- a/src/hardware/dslogic/api.c +++ b/src/hardware/dreamsourcelab-dslogic/api.c @@ -26,23 +26,23 @@ static const struct dslogic_profile supported_device[] = { /* DreamSourceLab DSLogic */ { 0x2a0e, 0x0001, "DreamSourceLab", "DSLogic", NULL, "dreamsourcelab-dslogic-fx2.fw", - 0, "DreamSourceLab", "DSLogic", 256 * 1048576ULL}, + 0, "DreamSourceLab", "DSLogic", 256 * 1024 * 1024}, /* DreamSourceLab DSCope */ { 0x2a0e, 0x0002, "DreamSourceLab", "DSCope", NULL, "dreamsourcelab-dscope-fx2.fw", - 0, "DreamSourceLab", "DSCope", 256 * 1048576ULL}, + 0, "DreamSourceLab", "DSCope", 256 * 1024 * 1024}, /* DreamSourceLab DSLogic Pro */ { 0x2a0e, 0x0003, "DreamSourceLab", "DSLogic Pro", NULL, "dreamsourcelab-dslogic-pro-fx2.fw", - 0, "DreamSourceLab", "DSLogic", 256 * 1048576ULL}, + 0, "DreamSourceLab", "DSLogic", 256 * 1024 * 1024}, /* DreamSourceLab DSLogic Plus */ { 0x2a0e, 0x0020, "DreamSourceLab", "DSLogic Plus", NULL, "dreamsourcelab-dslogic-plus-fx2.fw", - 0, "DreamSourceLab", "DSLogic", 256 * 1048576ULL}, + 0, "DreamSourceLab", "DSLogic", 256 * 1024 * 1024}, /* DreamSourceLab DSLogic Basic */ { 0x2a0e, 0x0021, "DreamSourceLab", "DSLogic Basic", NULL, "dreamsourcelab-dslogic-basic-fx2.fw", - 0, "DreamSourceLab", "DSLogic", 256 * 1024ULL}, + 0, "DreamSourceLab", "DSLogic", 256 * 1024}, ALL_ZERO }; @@ -150,7 +150,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) else conn_devices = NULL; - /* Find all dslogic compatible devices and upload firmware to them. */ + /* Find all DSLogic compatible devices and upload firmware to them. */ devices = NULL; libusb_get_device_list(drvc->sr_ctx->libusb_ctx, &devlist); for (i = 0; devlist[i]; i++) { @@ -168,7 +168,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) continue; } - libusb_get_device_descriptor( devlist[i], &des); + libusb_get_device_descriptor(devlist[i], &des); if (!is_plausible(&des)) continue; @@ -260,7 +260,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) if (has_firmware) { /* Already has the firmware, so fix the new address. */ - sr_dbg("Found an dslogic device."); + sr_dbg("Found a DSLogic device."); sdi->status = SR_ST_INACTIVE; sdi->inst_type = SR_INST_USB; sdi->conn = sr_usb_dev_inst_new(libusb_get_bus_number(devlist[i]), @@ -387,7 +387,7 @@ static int dev_close(struct sr_dev_inst *sdi) if (!usb->devhdl) return SR_ERR; - sr_info("dslogic: Closing device on %d.%d (logical) / %s (physical) interface %d.", + sr_info("Closing device on %d.%d (logical) / %s (physical) interface %d.", usb->bus, usb->address, sdi->connection_id, USB_INTERFACE); libusb_release_interface(usb->devhdl, USB_INTERFACE); libusb_close(usb->devhdl); @@ -638,9 +638,9 @@ static int config_list(uint32_t key, GVariant **data, return SR_OK; } -static struct sr_dev_driver dslogic_driver_info = { - .name = "dslogic", - .longname = "DreamSourceLabs DSLogic", +static struct sr_dev_driver dreamsourcelab_dslogic_driver_info = { + .name = "dreamsourcelab-dslogic", + .longname = "DreamSourceLab DSLogic", .api_version = 1, .init = std_init, .cleanup = std_cleanup, @@ -656,4 +656,4 @@ static struct sr_dev_driver dslogic_driver_info = { .dev_acquisition_stop = dslogic_acquisition_stop, .context = NULL, }; -SR_REGISTER_DEV_DRIVER(dslogic_driver_info); +SR_REGISTER_DEV_DRIVER(dreamsourcelab_dslogic_driver_info); diff --git a/src/hardware/dslogic/protocol.c b/src/hardware/dreamsourcelab-dslogic/protocol.c similarity index 98% rename from src/hardware/dslogic/protocol.c rename to src/hardware/dreamsourcelab-dslogic/protocol.c index 49c46f06..cf6272b6 100644 --- a/src/hardware/dslogic/protocol.c +++ b/src/hardware/dreamsourcelab-dslogic/protocol.c @@ -76,15 +76,15 @@ * number of 16-bit words. */ #define _DS_CFG(variable, wordcnt) ((variable << 8) | wordcnt) -#define DS_CFG_START 0xf5a5f5a5 -#define DS_CFG_MODE _DS_CFG(0, 1) -#define DS_CFG_DIVIDER _DS_CFG(1, 2) -#define DS_CFG_COUNT _DS_CFG(3, 2) -#define DS_CFG_TRIG_POS _DS_CFG(5, 2) -#define DS_CFG_TRIG_GLB _DS_CFG(7, 1) -#define DS_CFG_CH_EN _DS_CFG(8, 1) -#define DS_CFG_TRIG _DS_CFG(64, 160) -#define DS_CFG_END 0xfa5afa5a +#define DS_CFG_START 0xf5a5f5a5 +#define DS_CFG_MODE _DS_CFG(0, 1) +#define DS_CFG_DIVIDER _DS_CFG(1, 2) +#define DS_CFG_COUNT _DS_CFG(3, 2) +#define DS_CFG_TRIG_POS _DS_CFG(5, 2) +#define DS_CFG_TRIG_GLB _DS_CFG(7, 1) +#define DS_CFG_CH_EN _DS_CFG(8, 1) +#define DS_CFG_TRIG _DS_CFG(64, 160) +#define DS_CFG_END 0xfa5afa5a #pragma pack(push, 1) @@ -437,8 +437,6 @@ static void set_trigger(const struct sr_dev_inst *sdi, } cfg->trig_glb |= num_trigger_stages; - - return; } static int fpga_configure(const struct sr_dev_inst *sdi) diff --git a/src/hardware/dslogic/protocol.h b/src/hardware/dreamsourcelab-dslogic/protocol.h similarity index 95% rename from src/hardware/dslogic/protocol.h rename to src/hardware/dreamsourcelab-dslogic/protocol.h index 933ac256..467389bd 100644 --- a/src/hardware/dslogic/protocol.h +++ b/src/hardware/dreamsourcelab-dslogic/protocol.h @@ -18,8 +18,8 @@ * along with this program. If not, see . */ -#ifndef LIBSIGROK_HARDWARE_DSLOGIC_PROTOCOL_H -#define LIBSIGROK_HARDWARE_DSLOGIC_PROTOCOL_H +#ifndef LIBSIGROK_HARDWARE_DREAMSOURCELAB_DSLOGIC_PROTOCOL_H +#define LIBSIGROK_HARDWARE_DREAMSOURCELAB_DSLOGIC_PROTOCOL_H #include #include @@ -105,7 +105,7 @@ struct dslogic_profile { struct dev_context { const struct dslogic_profile *profile; /* - * Since we can't keep track of an dslogic device after upgrading + * Since we can't keep track of a DSLogic device after upgrading * the firmware (it renumerates into a different device address * after the upgrade) this is like a global lock. No device will open * until a proper delay after the last device was upgraded.