X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=hardware%2Flink-mso19%2Flink-mso19.c;h=c264b3cc396986ba844848f5149dfc324ca3e2f5;hb=fb9d3bf9cc0cafbd3caedcd54831219a533ef7fb;hp=b9df6c55e08661148e19f247a55cecddef875935;hpb=21b50ee1831602bd6c1f223fb200e2c298885aa3;p=libsigrok.git diff --git a/hardware/link-mso19/link-mso19.c b/hardware/link-mso19/link-mso19.c index b9df6c55..c264b3cc 100644 --- a/hardware/link-mso19/link-mso19.c +++ b/hardware/link-mso19/link-mso19.c @@ -28,8 +28,8 @@ #include #include #include -#include "sigrok.h" -#include "sigrok-internal.h" +#include "libsigrok.h" +#include "libsigrok-internal.h" #include "link-mso19.h" #define USB_VENDOR "3195" @@ -37,7 +37,7 @@ #define NUM_PROBES 8 -static int hwcaps[] = { +static const int hwcaps[] = { SR_HWCAP_LOGIC_ANALYZER, // SR_HWCAP_OSCILLOSCOPE, // SR_HWCAP_PAT_GENERATOR, @@ -65,7 +65,7 @@ static const char *probe_names[NUM_PROBES + 1] = { NULL, }; -static uint64_t supported_samplerates[] = { +static const uint64_t supported_samplerates[] = { SR_HZ(100), SR_HZ(200), SR_HZ(500), @@ -89,10 +89,10 @@ static uint64_t supported_samplerates[] = { 0, }; -static struct sr_samplerates samplerates = { - SR_HZ(100), - SR_MHZ(200), - SR_HZ(0), +static const struct sr_samplerates samplerates = { + 0, + 0, + 0, supported_samplerates, }; @@ -401,7 +401,15 @@ static int mso_parse_serial(const char *iSerial, const char *iProduct, return SR_OK; } -static int hw_init(const char *devinfo) +static int hw_init(void) +{ + + /* Nothing to do. */ + + return SR_OK; +} + +static int hw_scan(void) { struct sr_dev_inst *sdi; int devcnt = 0; @@ -410,8 +418,6 @@ static int hw_init(const char *devinfo) struct udev_list_entry *devs, *dev_list_entry; struct context *ctx; - devinfo = devinfo; - /* It's easier to map usb<->serial using udev */ /* * FIXME: On windows we can get the same information from the @@ -607,11 +613,11 @@ static int hw_dev_close(int dev_index) return SR_OK; } -static void *hw_dev_info_get(int dev_index, int dev_info_id) +static const void *hw_dev_info_get(int dev_index, int dev_info_id) { struct sr_dev_inst *sdi; struct context *ctx; - void *info = NULL; + const void *info = NULL; if (!(sdi = sr_dev_inst_get(dev_insts, dev_index))) return NULL; @@ -650,12 +656,12 @@ static int hw_dev_status_get(int dev_index) return sdi->status; } -static int *hw_hwcap_get_all(void) +static const int *hw_hwcap_get_all(void) { return hwcaps; } -static int hw_dev_config_set(int dev_index, int hwcap, void *value) +static int hw_dev_config_set(int dev_index, int hwcap, const void *value) { struct sr_dev_inst *sdi; @@ -664,7 +670,7 @@ static int hw_dev_config_set(int dev_index, int hwcap, void *value) switch (hwcap) { case SR_HWCAP_SAMPLERATE: - return mso_configure_rate(sdi, *(uint64_t *) value); + return mso_configure_rate(sdi, *(const uint64_t *) value); case SR_HWCAP_PROBECONFIG: case SR_HWCAP_LIMIT_SAMPLES: default: @@ -842,6 +848,7 @@ SR_PRIV struct sr_dev_driver link_mso19_driver_info = { .api_version = 1, .init = hw_init, .cleanup = hw_cleanup, + .scan = hw_scan, .dev_open = hw_dev_open, .dev_close = hw_dev_close, .dev_info_get = hw_dev_info_get,