X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=hardware%2Fasix-sigma%2Fasix-sigma.c;h=71cb2fddcdd7b9d41eeb4e2325a0e0e2a6b9e914;hb=a562c3a2e5e54dbb7e0553422ac0e0c845b180ad;hp=ce67cc00fe36ad8ea784f908b7c723ad869e52fc;hpb=6f1be0a2d40b3998abd8d10b5479e4538bc4ff1e;p=libsigrok.git diff --git a/hardware/asix-sigma/asix-sigma.c b/hardware/asix-sigma/asix-sigma.c index ce67cc00..71cb2fdd 100644 --- a/hardware/asix-sigma/asix-sigma.c +++ b/hardware/asix-sigma/asix-sigma.c @@ -20,7 +20,7 @@ */ /* - * ASIX Sigma Logic Analyzer Driver + * ASIX SIGMA Logic Analyzer Driver */ #include "config.h" @@ -30,6 +30,7 @@ #include #include #include +#include #include "asix-sigma.h" #define USB_VENDOR 0xa600 @@ -43,23 +44,23 @@ static GSList *device_instances = NULL; static uint64_t supported_samplerates[] = { - KHZ(200), - KHZ(250), - KHZ(500), - MHZ(1), - MHZ(5), - MHZ(10), - MHZ(25), - MHZ(50), - MHZ(100), - MHZ(200), + SR_KHZ(200), + SR_KHZ(250), + SR_KHZ(500), + SR_MHZ(1), + SR_MHZ(5), + SR_MHZ(10), + SR_MHZ(25), + SR_MHZ(50), + SR_MHZ(100), + SR_MHZ(200), 0, }; static struct sr_samplerates samplerates = { - KHZ(200), - MHZ(200), - 0, + SR_KHZ(200), + SR_MHZ(200), + SR_HZ(0), supported_samplerates, }; @@ -97,7 +98,7 @@ static const char *firmware_files[] = { "asix-sigma-phasor.fw", /* Frequency counter */ }; -static void hw_stop_acquisition(int device_index, gpointer session_device_id); +static void hw_stop_acquisition(int device_index, gpointer session_data); static int sigma_read(void *buf, size_t size, struct sigma *sigma) { @@ -105,8 +106,8 @@ static int sigma_read(void *buf, size_t size, struct sigma *sigma) ret = ftdi_read_data(&sigma->ftdic, (unsigned char *)buf, size); if (ret < 0) { - g_warning("ftdi_read_data failed: %s", - ftdi_get_error_string(&sigma->ftdic)); + sr_warn("ftdi_read_data failed: %s", + ftdi_get_error_string(&sigma->ftdic)); } return ret; @@ -118,10 +119,10 @@ static int sigma_write(void *buf, size_t size, struct sigma *sigma) ret = ftdi_write_data(&sigma->ftdic, (unsigned char *)buf, size); if (ret < 0) { - g_warning("ftdi_write_data failed: %s", - ftdi_get_error_string(&sigma->ftdic)); + sr_warn("ftdi_write_data failed: %s", + ftdi_get_error_string(&sigma->ftdic)); } else if ((size_t) ret != size) { - g_warning("ftdi_write_data did not complete write\n"); + sr_warn("ftdi_write_data did not complete write\n"); } return ret; @@ -169,7 +170,7 @@ static uint8_t sigma_get_register(uint8_t reg, struct sigma *sigma) uint8_t value; if (1 != sigma_read_register(reg, &value, 1, sigma)) { - g_warning("Sigma_get_register: 1 byte expected"); + sr_warn("sigma_get_register: 1 byte expected"); return 0; } @@ -316,26 +317,31 @@ static int bin2bitbang(const char *filename, f = g_fopen(filename, "rb"); if (!f) { - g_warning("g_fopen(\"%s\", \"rb\")", filename); - return -1; + sr_warn("g_fopen(\"%s\", \"rb\")", filename); + return SR_ERR; } if (-1 == fseek(f, 0, SEEK_END)) { - g_warning("fseek on %s failed", filename); + sr_warn("fseek on %s failed", filename); fclose(f); - return -1; + return SR_ERR; } file_size = ftell(f); fseek(f, 0, SEEK_SET); - compressed_buf = g_malloc(file_size); - firmware = g_malloc(buffer_size); + if (!(compressed_buf = g_try_malloc(file_size))) { + sr_err("sigma: %s: compressed_buf malloc failed", __func__); + fclose(f); + return SR_ERR_MALLOC; + } - if (!compressed_buf || !firmware) { - g_warning("Error allocating buffers"); - return -1; + if (!(firmware = g_try_malloc(buffer_size))) { + sr_err("sigma: %s: firmware malloc failed", __func__); + fclose(f); + g_free(compressed_buf); + return SR_ERR_MALLOC; } csize = 0; @@ -350,19 +356,20 @@ static int bin2bitbang(const char *filename, if (ret < 0) { g_free(compressed_buf); g_free(firmware); - g_warning("Could not unpack Sigma firmware. (Error %d)\n", ret); - return -1; + sr_warn("Could not unpack Sigma firmware. (Error %d)\n", ret); + return SR_ERR; } g_free(compressed_buf); *buf_size = fwsize * 2 * 8; - *buf = p = (unsigned char *)g_malloc(*buf_size); - + *buf = p = (unsigned char *)g_try_malloc(*buf_size); if (!p) { - g_warning("Error allocating buffers"); - return -1; + sr_err("sigma: %s: buf/p malloc failed", __func__); + g_free(compressed_buf); + g_free(firmware); + return SR_ERR_MALLOC; } for (i = 0; i < fwsize; ++i) { @@ -377,25 +384,28 @@ static int bin2bitbang(const char *filename, if (offset != *buf_size) { g_free(*buf); - g_warning("Error reading firmware %s " - "offset=%ld, file_size=%ld, buf_size=%zd\n", - filename, offset, file_size, *buf_size); + sr_warn("Error reading firmware %s " + "offset=%ld, file_size=%ld, buf_size=%zd\n", + filename, offset, file_size, *buf_size); - return -1; + return SR_ERR; } - return 0; + return SR_OK; } -static int hw_init(char *deviceinfo) +static int hw_init(const char *deviceinfo) { struct sr_device_instance *sdi; - struct sigma *sigma = g_malloc(sizeof(struct sigma)); + struct sigma *sigma; + /* Avoid compiler warnings. */ deviceinfo = deviceinfo; - if (!sigma) - return 0; + if (!(sigma = g_try_malloc(sizeof(struct sigma)))) { + sr_err("sigma: %s: sigma malloc failed", __func__); + return 0; /* FIXME: Should be SR_ERR_MALLOC. */ + } ftdi_init(&sigma->ftdic); @@ -405,6 +415,7 @@ static int hw_init(char *deviceinfo) goto free; sigma->cur_samplerate = 0; + sigma->period_ps = 0; sigma->limit_msec = 0; sigma->cur_firmware = -1; sigma->num_probes = 0; @@ -427,7 +438,7 @@ static int hw_init(char *deviceinfo) return 1; free: - free(sigma); + g_free(sigma); return 0; } @@ -443,21 +454,21 @@ static int upload_firmware(int firmware_idx, struct sigma *sigma) /* Make sure it's an ASIX SIGMA. */ if ((ret = ftdi_usb_open_desc(&sigma->ftdic, USB_VENDOR, USB_PRODUCT, USB_DESCRIPTION, NULL)) < 0) { - g_warning("ftdi_usb_open failed: %s", - ftdi_get_error_string(&sigma->ftdic)); + sr_warn("ftdi_usb_open failed: %s", + ftdi_get_error_string(&sigma->ftdic)); return 0; } if ((ret = ftdi_set_bitmode(&sigma->ftdic, 0xdf, BITMODE_BITBANG)) < 0) { - g_warning("ftdi_set_bitmode failed: %s", - ftdi_get_error_string(&sigma->ftdic)); + sr_warn("ftdi_set_bitmode failed: %s", + ftdi_get_error_string(&sigma->ftdic)); return 0; } /* Four times the speed of sigmalogan - Works well. */ if ((ret = ftdi_set_baudrate(&sigma->ftdic, 750000)) < 0) { - g_warning("ftdi_set_baudrate failed: %s", - ftdi_get_error_string(&sigma->ftdic)); + sr_warn("ftdi_set_baudrate failed: %s", + ftdi_get_error_string(&sigma->ftdic)); return 0; } @@ -483,10 +494,10 @@ static int upload_firmware(int firmware_idx, struct sigma *sigma) snprintf(firmware_path, sizeof(firmware_path), "%s/%s", FIRMWARE_DIR, firmware_files[firmware_idx]); - if (-1 == bin2bitbang(firmware_path, &buf, &buf_size)) { - g_warning("An error occured while reading the firmware: %s", - firmware_path); - return SR_ERR; + if ((ret = bin2bitbang(firmware_path, &buf, &buf_size)) != SR_OK) { + sr_warn("An error occured while reading the firmware: %s", + firmware_path); + return ret; } /* Upload firmare. */ @@ -495,8 +506,8 @@ static int upload_firmware(int firmware_idx, struct sigma *sigma) g_free(buf); if ((ret = ftdi_set_bitmode(&sigma->ftdic, 0x00, BITMODE_RESET)) < 0) { - g_warning("ftdi_set_bitmode failed: %s", - ftdi_get_error_string(&sigma->ftdic)); + sr_warn("ftdi_set_bitmode failed: %s", + ftdi_get_error_string(&sigma->ftdic)); return SR_ERR; } @@ -513,7 +524,7 @@ static int upload_firmware(int firmware_idx, struct sigma *sigma) ret = sigma_read(result, 3, sigma); if (ret != 3 || result[0] != 0xa6 || result[1] != 0x55 || result[2] != 0xaa) { - g_warning("Configuration failed. Invalid reply received."); + sr_warn("Configuration failed. Invalid reply received."); return SR_ERR; } @@ -537,7 +548,7 @@ static int hw_opendev(int device_index) if ((ret = ftdi_usb_open_desc(&sigma->ftdic, USB_VENDOR, USB_PRODUCT, USB_DESCRIPTION, NULL)) < 0) { - g_warning("ftdi_usb_open failed: %s", + sr_warn("ftdi_usb_open failed: %s", ftdi_get_error_string(&sigma->ftdic)); return 0; @@ -561,24 +572,25 @@ static int set_samplerate(struct sr_device_instance *sdi, if (supported_samplerates[i] == 0) return SR_ERR_SAMPLERATE; - if (samplerate <= MHZ(50)) { + if (samplerate <= SR_MHZ(50)) { ret = upload_firmware(0, sigma); sigma->num_probes = 16; } - if (samplerate == MHZ(100)) { + if (samplerate == SR_MHZ(100)) { ret = upload_firmware(1, sigma); sigma->num_probes = 8; } - else if (samplerate == MHZ(200)) { + else if (samplerate == SR_MHZ(200)) { ret = upload_firmware(2, sigma); sigma->num_probes = 4; } sigma->cur_samplerate = samplerate; + sigma->period_ps = 1000000000000 / samplerate; sigma->samples_per_event = 16 / sigma->num_probes; sigma->state.state = SIGMA_IDLE; - g_message("Firmware uploaded"); + sr_info("Firmware uploaded"); return ret; } @@ -608,12 +620,11 @@ static int configure_probes(struct sr_device_instance *sdi, GSList *probes) if (!probe->enabled || !probe->trigger) continue; - if (sigma->cur_samplerate >= MHZ(100)) { + if (sigma->cur_samplerate >= SR_MHZ(100)) { /* Fast trigger support. */ if (trigger_set) { - g_warning("Asix Sigma only supports a single " - "pin trigger in 100 and 200 " - "MHz mode."); + sr_warn("ASIX SIGMA only supports a single " + "pin trigger in 100 and 200MHz mode."); return SR_ERR; } if (probe->trigger[0] == 'f') @@ -621,9 +632,9 @@ static int configure_probes(struct sr_device_instance *sdi, GSList *probes) else if (probe->trigger[0] == 'r') sigma->trigger.risingmask |= probebit; else { - g_warning("Asix Sigma only supports " - "rising/falling trigger in 100 " - "and 200 MHz mode."); + sr_warn("ASIX SIGMA only supports " + "rising/falling trigger in 100 " + "and 200MHz mode."); return SR_ERR; } @@ -653,8 +664,8 @@ static int configure_probes(struct sr_device_instance *sdi, GSList *probes) * does not permit ORed triggers. */ if (trigger_set > 1) { - g_warning("Asix Sigma only supports 1 rising/" - "falling triggers."); + sr_warn("ASIX SIGMA only supports 1 rising/" + "falling triggers."); return SR_ERR; } } @@ -666,19 +677,28 @@ static int configure_probes(struct sr_device_instance *sdi, GSList *probes) return SR_OK; } -static void hw_closedev(int device_index) +static int hw_closedev(int device_index) { struct sr_device_instance *sdi; struct sigma *sigma; - if ((sdi = sr_get_device_instance(device_instances, device_index))) - { - sigma = sdi->priv; - if (sdi->status == SR_ST_ACTIVE) - ftdi_usb_close(&sigma->ftdic); + if (!(sdi = sr_get_device_instance(device_instances, device_index))) { + sr_err("sigma: %s: sdi was NULL", __func__); + return SR_ERR; /* TODO: SR_ERR_ARG? */ + } - sdi->status = SR_ST_INACTIVE; + if (!(sigma = sdi->priv)) { + sr_err("sigma: %s: sdi->priv was NULL", __func__); + return SR_ERR; /* TODO: SR_ERR_ARG? */ } + + /* TODO */ + if (sdi->status == SR_ST_ACTIVE) + ftdi_usb_close(&sigma->ftdic); + + sdi->status = SR_ST_INACTIVE; + + return SR_OK; } static void hw_cleanup(void) @@ -704,7 +724,7 @@ static void *hw_get_device_info(int device_index, int device_info_id) void *info = NULL; if (!(sdi = sr_get_device_instance(device_instances, device_index))) { - fprintf(stderr, "It's NULL.\n"); + sr_err("It's NULL.\n"); return NULL; } @@ -823,13 +843,14 @@ static int get_trigger_offset(uint16_t *samples, uint16_t last_sample, */ static int decode_chunk_ts(uint8_t *buf, uint16_t *lastts, uint16_t *lastsample, int triggerpos, - uint16_t limit_chunk, void *user_data) + uint16_t limit_chunk, void *session_data) { - struct sr_device_instance *sdi = user_data; + struct sr_device_instance *sdi = session_data; struct sigma *sigma = sdi->priv; uint16_t tsdiff, ts; uint16_t samples[65536 * sigma->samples_per_event]; struct sr_datafeed_packet packet; + struct sr_datafeed_logic logic; int i, j, k, l, numpad, tosend; size_t n = 0, sent = 0; int clustersize = EVENTS_PER_CLUSTER * sigma->samples_per_event; @@ -839,7 +860,7 @@ static int decode_chunk_ts(uint8_t *buf, uint16_t *lastts, /* Check if trigger is in this chunk. */ if (triggerpos != -1) { - if (sigma->cur_samplerate <= MHZ(50)) + if (sigma->cur_samplerate <= SR_MHZ(50)) triggerpos -= EVENTS_PER_CLUSTER - 1; if (triggerpos < 0) @@ -874,9 +895,13 @@ static int decode_chunk_ts(uint8_t *buf, uint16_t *lastts, tosend = MIN(2048, n - sent); packet.type = SR_DF_LOGIC; - packet.length = tosend * sizeof(uint16_t); - packet.unitsize = 2; - packet.payload = samples + sent; + /* TODO: fill in timeoffset and duration */ + packet.timeoffset = 0; + packet.duration = 0; + packet.payload = &logic; + logic.length = tosend * sizeof(uint16_t); + logic.unitsize = 2; + logic.data = samples + sent; sr_session_bus(sigma->session_id, &packet); sent += tosend; @@ -918,9 +943,13 @@ static int decode_chunk_ts(uint8_t *buf, uint16_t *lastts, if (tosend > 0) { packet.type = SR_DF_LOGIC; - packet.length = tosend * sizeof(uint16_t); - packet.unitsize = 2; - packet.payload = samples; + /* TODO: fill in timeoffset and duration */ + packet.timeoffset = 0; + packet.duration = 0; + packet.payload = &logic; + logic.length = tosend * sizeof(uint16_t); + logic.unitsize = 2; + logic.data = samples; sr_session_bus(sigma->session_id, &packet); sent += tosend; @@ -929,8 +958,9 @@ static int decode_chunk_ts(uint8_t *buf, uint16_t *lastts, /* Only send trigger if explicitly enabled. */ if (sigma->use_triggers) { packet.type = SR_DF_TRIGGER; - packet.length = 0; - packet.payload = 0; + /* TODO: fill in timeoffset only */ + packet.timeoffset = 0; + packet.duration = 0; sr_session_bus(sigma->session_id, &packet); } } @@ -940,9 +970,13 @@ static int decode_chunk_ts(uint8_t *buf, uint16_t *lastts, if (tosend > 0) { packet.type = SR_DF_LOGIC; - packet.length = tosend * sizeof(uint16_t); - packet.unitsize = 2; - packet.payload = samples + sent; + /* TODO: fill in timeoffset and duration */ + packet.timeoffset = 0; + packet.duration = 0; + packet.payload = &logic; + logic.length = tosend * sizeof(uint16_t); + logic.unitsize = 2; + logic.data = samples + sent; sr_session_bus(sigma->session_id, &packet); } @@ -952,9 +986,9 @@ static int decode_chunk_ts(uint8_t *buf, uint16_t *lastts, return SR_OK; } -static int receive_data(int fd, int revents, void *user_data) +static int receive_data(int fd, int revents, void *session_data) { - struct sr_device_instance *sdi = user_data; + struct sr_device_instance *sdi = session_data; struct sigma *sigma = sdi->priv; struct sr_datafeed_packet packet; const int chunks_per_read = 32; @@ -981,7 +1015,7 @@ static int receive_data(int fd, int revents, void *user_data) if (running_msec < sigma->limit_msec && numchunks < 32767) return FALSE; - hw_stop_acquisition(sdi->index, user_data); + hw_stop_acquisition(sdi->index, session_data); return FALSE; @@ -989,7 +1023,6 @@ static int receive_data(int fd, int revents, void *user_data) if (sigma->state.chunks_downloaded >= numchunks) { /* End of samples. */ packet.type = SR_DF_END; - packet.length = 0; sr_session_bus(sigma->session_id, &packet); sigma->state.state = SIGMA_IDLE; @@ -1000,11 +1033,13 @@ static int receive_data(int fd, int revents, void *user_data) newchunks = MIN(chunks_per_read, numchunks - sigma->state.chunks_downloaded); - g_message("Downloading sample data: %.0f %%", - 100.0 * sigma->state.chunks_downloaded / numchunks); + sr_info("Downloading sample data: %.0f %%", + 100.0 * sigma->state.chunks_downloaded / numchunks); bufsz = sigma_read_dram(sigma->state.chunks_downloaded, newchunks, buf, sigma); + /* TODO: Check bufsz. For now, just avoid compiler warnings. */ + (void)bufsz; /* Find first ts. */ if (sigma->state.chunks_downloaded == 0) { @@ -1028,12 +1063,12 @@ static int receive_data(int fd, int revents, void *user_data) &sigma->state.lastts, &sigma->state.lastsample, sigma->state.triggerpos & 0x1ff, - limit_chunk, user_data); + limit_chunk, session_data); else decode_chunk_ts(buf + (i * CHUNK_SIZE), &sigma->state.lastts, &sigma->state.lastsample, - -1, limit_chunk, user_data); + -1, limit_chunk, session_data); ++sigma->state.chunks_downloaded; } @@ -1198,20 +1233,19 @@ static int build_basic_trigger(struct triggerlut *lut, struct sigma *sigma) return SR_OK; } -static int hw_start_acquisition(int device_index, gpointer session_device_id) +static int hw_start_acquisition(int device_index, gpointer session_data) { struct sr_device_instance *sdi; struct sigma *sigma; struct sr_datafeed_packet packet; struct sr_datafeed_header header; struct clockselect_50 clockselect; - int frac; + int frac, triggerpin, ret; uint8_t triggerselect; struct triggerinout triggerinout_conf; struct triggerlut lut; - int triggerpin; - session_device_id = session_device_id; + session_data = session_data; if (!(sdi = sr_get_device_instance(device_instances, device_index))) return SR_ERR; @@ -1219,14 +1253,16 @@ static int hw_start_acquisition(int device_index, gpointer session_device_id) sigma = sdi->priv; /* If the samplerate has not been set, default to 200 KHz. */ - if (sigma->cur_firmware == -1) - set_samplerate(sdi, KHZ(200)); + if (sigma->cur_firmware == -1) { + if ((ret = set_samplerate(sdi, SR_KHZ(200))) != SR_OK) + return ret; + } /* Enter trigger programming mode. */ sigma_set_register(WRITE_TRIGGER_SELECT1, 0x20, sigma); /* 100 and 200 MHz mode. */ - if (sigma->cur_samplerate >= MHZ(100)) { + if (sigma->cur_samplerate >= SR_MHZ(100)) { sigma_set_register(WRITE_TRIGGER_SELECT1, 0x81, sigma); /* Find which pin to trigger on from mask. */ @@ -1243,7 +1279,7 @@ static int hw_start_acquisition(int device_index, gpointer session_device_id) triggerselect |= 1 << 3; /* All other modes. */ - } else if (sigma->cur_samplerate <= MHZ(50)) { + } else if (sigma->cur_samplerate <= SR_MHZ(50)) { build_basic_trigger(&lut, sigma); sigma_write_trigger_lut(&lut, sigma); @@ -1264,10 +1300,10 @@ static int hw_start_acquisition(int device_index, gpointer session_device_id) sigma_set_register(WRITE_TRIGGER_SELECT1, triggerselect, sigma); /* Set clock select register. */ - if (sigma->cur_samplerate == MHZ(200)) + if (sigma->cur_samplerate == SR_MHZ(200)) /* Enable 4 probes. */ sigma_set_register(WRITE_CLOCK_SELECT, 0xf0, sigma); - else if (sigma->cur_samplerate == MHZ(100)) + else if (sigma->cur_samplerate == SR_MHZ(100)) /* Enable 8 probes. */ sigma_set_register(WRITE_CLOCK_SELECT, 0x00, sigma); else { @@ -1275,7 +1311,7 @@ static int hw_start_acquisition(int device_index, gpointer session_device_id) * 50 MHz mode (or fraction thereof). Any fraction down to * 50 MHz / 256 can be used, but is not supported by sigrok API. */ - frac = MHZ(50) / sigma->cur_samplerate - 1; + frac = SR_MHZ(50) / sigma->cur_samplerate - 1; clockselect.async = 0; clockselect.fraction = frac; @@ -1294,19 +1330,17 @@ static int hw_start_acquisition(int device_index, gpointer session_device_id) gettimeofday(&sigma->start_tv, 0); sigma_set_register(WRITE_MODE, 0x0d, sigma); - sigma->session_id = session_device_id; + sigma->session_id = session_data; /* Send header packet to the session bus. */ packet.type = SR_DF_HEADER; - packet.length = sizeof(struct sr_datafeed_header); packet.payload = &header; header.feed_version = 1; gettimeofday(&header.starttime, NULL); header.samplerate = sigma->cur_samplerate; - header.protocol_id = SR_PROTO_RAW; header.num_logic_probes = sigma->num_probes; header.num_analog_probes = 0; - sr_session_bus(session_device_id, &packet); + sr_session_bus(session_data, &packet); /* Add capture source. */ sr_source_add(0, G_IO_IN, 10, receive_data, sdi); @@ -1316,7 +1350,7 @@ static int hw_start_acquisition(int device_index, gpointer session_device_id) return SR_OK; } -static void hw_stop_acquisition(int device_index, gpointer session_device_id) +static void hw_stop_acquisition(int device_index, gpointer session_data) { struct sr_device_instance *sdi; struct sigma *sigma; @@ -1327,7 +1361,7 @@ static void hw_stop_acquisition(int device_index, gpointer session_device_id) sigma = sdi->priv; - session_device_id = session_device_id; + session_data = session_data; /* Stop acquisition. */ sigma_set_register(WRITE_MODE, 0x11, sigma); @@ -1352,17 +1386,17 @@ static void hw_stop_acquisition(int device_index, gpointer session_device_id) } struct sr_device_plugin asix_sigma_plugin_info = { - "asix-sigma", - "ASIX SIGMA", - 1, - hw_init, - hw_cleanup, - hw_opendev, - hw_closedev, - hw_get_device_info, - hw_get_status, - hw_get_capabilities, - hw_set_configuration, - hw_start_acquisition, - hw_stop_acquisition, + .name = "asix-sigma", + .longname = "ASIX SIGMA", + .api_version = 1, + .init = hw_init, + .cleanup = hw_cleanup, + .opendev = hw_opendev, + .closedev = hw_closedev, + .get_device_info = hw_get_device_info, + .get_status = hw_get_status, + .get_capabilities = hw_get_capabilities, + .set_configuration = hw_set_configuration, + .start_acquisition = hw_start_acquisition, + .stop_acquisition = hw_stop_acquisition, };