2 * This file is part of the sigrok project.
4 * Copyright (C) 2010 Bert Vermeulen <bert@biot.com>
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
23 #include <sys/types.h>
38 #include <arpa/inet.h>
42 #include <sigrok-internal.h>
46 #define O_NONBLOCK FIONBIO
49 static int capabilities[] = {
50 SR_HWCAP_LOGIC_ANALYZER,
52 SR_HWCAP_CAPTURE_RATIO,
53 SR_HWCAP_LIMIT_SAMPLES,
57 /* default supported samplerates, can be overridden by device metadata */
58 static struct sr_samplerates samplerates = {
65 /* List of struct sr_serial_device_instance */
66 static GSList *device_instances = NULL;
68 static int send_shortcommand(int fd, uint8_t command)
72 sr_dbg("ols: sending cmd 0x%.2x", command);
74 if (serial_write(fd, buf, 1) != 1)
80 static int send_longcommand(int fd, uint8_t command, uint32_t data)
84 sr_dbg("ols: sending cmd 0x%.2x data 0x%.8x", command, data);
86 buf[1] = (data & 0xff000000) >> 24;
87 buf[2] = (data & 0xff0000) >> 16;
88 buf[3] = (data & 0xff00) >> 8;
90 if (serial_write(fd, buf, 5) != 5)
96 static int configure_probes(struct ols_device *ols, GSList *probes)
98 struct sr_probe *probe;
100 int probe_bit, stage, i;
104 for (i = 0; i < NUM_TRIGGER_STAGES; i++) {
105 ols->trigger_mask[i] = 0;
106 ols->trigger_value[i] = 0;
110 for (l = probes; l; l = l->next) {
111 probe = (struct sr_probe *)l->data;
116 * Set up the probe mask for later configuration into the
119 probe_bit = 1 << (probe->index - 1);
120 ols->probe_mask |= probe_bit;
125 /* Configure trigger mask and value. */
127 for (tc = probe->trigger; tc && *tc; tc++) {
128 ols->trigger_mask[stage] |= probe_bit;
130 ols->trigger_value[stage] |= probe_bit;
134 * TODO: Only supporting parallel mode, with
139 if (stage > ols->num_stages)
140 ols->num_stages = stage;
146 static uint32_t reverse16(uint32_t in)
150 out = (in & 0xff) << 8;
151 out |= (in & 0xff00) >> 8;
152 out |= (in & 0xff0000) << 8;
153 out |= (in & 0xff000000) >> 8;
158 static uint32_t reverse32(uint32_t in)
162 out = (in & 0xff) << 24;
163 out |= (in & 0xff00) << 8;
164 out |= (in & 0xff0000) >> 8;
165 out |= (in & 0xff000000) >> 24;
170 static struct ols_device *ols_device_new(void)
172 struct ols_device *ols;
174 /* TODO: Is 'ols' ever g_free()'d? */
175 if (!(ols = g_try_malloc0(sizeof(struct ols_device)))) {
176 sr_err("ols: %s: ols malloc failed", __func__);
180 ols->trigger_at = -1;
181 ols->probe_mask = 0xffffffff;
182 ols->cur_samplerate = SR_KHZ(200);
187 static struct sr_device_instance *get_metadata(int fd)
189 struct sr_device_instance *sdi;
190 struct ols_device *ols;
192 uint8_t key, type, token;
193 GString *tmp_str, *devicename, *version;
196 sdi = sr_device_instance_new(0, SR_ST_INACTIVE, NULL, NULL, NULL);
197 ols = ols_device_new();
200 devicename = g_string_new("");
201 version = g_string_new("");
205 if (serial_read(fd, &key, 1) != 1 || key == 0x00)
211 /* NULL-terminated string */
212 tmp_str = g_string_new("");
213 while (serial_read(fd, &tmp_c, 1) == 1 && tmp_c != '\0')
214 g_string_append_c(tmp_str, tmp_c);
215 sr_dbg("ols: got metadata key 0x%.2x value '%s'",
220 devicename = g_string_append(devicename, tmp_str->str);
223 /* FPGA firmware version */
225 g_string_append(version, ", ");
226 g_string_append(version, "FPGA version ");
227 g_string_append(version, tmp_str->str);
230 /* Ancillary version */
232 g_string_append(version, ", ");
233 g_string_append(version, "Ancillary version ");
234 g_string_append(version, tmp_str->str);
237 sr_info("ols: unknown token 0x%.2x: '%s'",
238 token, tmp_str->str);
241 g_string_free(tmp_str, TRUE);
244 /* 32-bit unsigned integer */
245 if (serial_read(fd, &tmp_int, 4) != 4)
247 tmp_int = reverse32(tmp_int);
248 sr_dbg("ols: got metadata key 0x%.2x value 0x%.8x",
252 /* Number of usable probes */
253 ols->num_probes = tmp_int;
256 /* Amount of sample memory available (bytes) */
257 ols->max_samples = tmp_int;
260 /* Amount of dynamic memory available (bytes) */
261 /* what is this for? */
264 /* Maximum sample rate (hz) */
265 ols->max_samplerate = tmp_int;
268 /* protocol version */
269 ols->protocol_version = tmp_int;
272 sr_info("ols: unknown token 0x%.2x: 0x%.8x",
278 /* 8-bit unsigned integer */
279 if (serial_read(fd, &tmp_c, 1) != 1)
281 sr_dbg("ols: got metadata key 0x%.2x value 0x%.2x",
285 /* Number of usable probes */
286 ols->num_probes = tmp_c;
289 /* protocol version */
290 ols->protocol_version = tmp_c;
293 sr_info("ols: unknown token 0x%.2x: 0x%.2x",
304 sdi->model = devicename->str;
305 sdi->version = version->str;
306 g_string_free(devicename, FALSE);
307 g_string_free(version, FALSE);
312 static int hw_init(const char *deviceinfo)
314 struct sr_device_instance *sdi;
315 struct ols_device *ols;
317 GPollFD *fds, probefd;
318 int devcnt, final_devcnt, num_ports, fd, ret, i;
319 char buf[8], **device_names, **serial_params;
324 ports = g_slist_append(NULL, strdup(deviceinfo));
326 /* No specific device given, so scan all serial ports. */
327 ports = list_serial_ports();
329 num_ports = g_slist_length(ports);
331 if (!(fds = g_try_malloc0(num_ports * sizeof(GPollFD)))) {
332 sr_err("ols: %s: fds malloc failed", __func__);
333 goto hw_init_free_ports; /* TODO: SR_ERR_MALLOC. */
336 if (!(device_names = g_try_malloc(num_ports * sizeof(char *)))) {
337 sr_err("ols: %s: device_names malloc failed", __func__);
338 goto hw_init_free_fds; /* TODO: SR_ERR_MALLOC. */
341 if (!(serial_params = g_try_malloc(num_ports * sizeof(char *)))) {
342 sr_err("ols: %s: serial_params malloc failed", __func__);
343 goto hw_init_free_device_names; /* TODO: SR_ERR_MALLOC. */
347 for (l = ports; l; l = l->next) {
348 /* The discovery procedure is like this: first send the Reset
349 * command (0x00) 5 times, since the device could be anywhere
350 * in a 5-byte command. Then send the ID command (0x02).
351 * If the device responds with 4 bytes ("OLS1" or "SLA1"), we
354 * Since it may take the device a while to respond at 115Kb/s,
355 * we do all the sending first, then wait for all of them to
356 * respond with g_poll().
358 sr_info("ols: probing %s...", (char *)l->data);
359 fd = serial_open(l->data, O_RDWR | O_NONBLOCK);
361 serial_params[devcnt] = serial_backup_params(fd);
362 serial_set_params(fd, 115200, 8, 0, 1, 2);
364 for (i = 0; i < 5; i++) {
365 if ((ret = send_shortcommand(fd,
366 CMD_RESET)) != SR_OK) {
367 /* Serial port is not writable. */
372 serial_restore_params(fd,
373 serial_params[devcnt]);
377 send_shortcommand(fd, CMD_ID);
379 fds[devcnt].events = G_IO_IN;
380 device_names[devcnt] = strdup(l->data);
386 /* 2ms isn't enough for reliable transfer with pl2303, let's try 10 */
389 g_poll(fds, devcnt, 1);
391 for (i = 0; i < devcnt; i++) {
392 if (fds[i].revents != G_IO_IN)
394 if (serial_read(fds[i].fd, buf, 4) != 4)
396 if (strncmp(buf, "1SLO", 4) && strncmp(buf, "1ALS", 4))
399 /* definitely using the OLS protocol, check if it supports
400 * the metadata command
402 send_shortcommand(fds[i].fd, CMD_METADATA);
403 probefd.fd = fds[i].fd;
404 probefd.events = G_IO_IN;
405 if (g_poll(&probefd, 1, 10) > 0) {
407 sdi = get_metadata(fds[i].fd);
408 sdi->index = final_devcnt;
410 /* not an OLS -- some other board that uses the sump protocol */
411 sdi = sr_device_instance_new(final_devcnt, SR_ST_INACTIVE,
412 "Sump", "Logic Analyzer", "v1.0");
413 ols = ols_device_new();
414 ols->num_probes = 32;
417 sdi->serial = sr_serial_device_instance_new(device_names[i], -1);
418 device_instances = g_slist_append(device_instances, sdi);
420 serial_close(fds[i].fd);
424 /* clean up after all the probing */
425 for (i = 0; i < devcnt; i++) {
426 if (fds[i].fd != 0) {
427 serial_restore_params(fds[i].fd, serial_params[i]);
428 serial_close(fds[i].fd);
430 free(serial_params[i]);
431 free(device_names[i]);
434 g_free(serial_params);
435 hw_init_free_device_names:
436 g_free(device_names);
445 static int hw_opendev(int device_index)
447 struct sr_device_instance *sdi;
449 if (!(sdi = sr_get_device_instance(device_instances, device_index)))
452 sdi->serial->fd = serial_open(sdi->serial->port, O_RDWR);
453 if (sdi->serial->fd == -1)
456 sdi->status = SR_ST_ACTIVE;
461 static void hw_closedev(int device_index)
463 struct sr_device_instance *sdi;
465 if (!(sdi = sr_get_device_instance(device_instances, device_index)))
468 if (sdi->serial->fd != -1) {
469 serial_close(sdi->serial->fd);
470 sdi->serial->fd = -1;
471 sdi->status = SR_ST_INACTIVE;
475 static void hw_cleanup(void)
478 struct sr_device_instance *sdi;
480 /* Properly close all devices. */
481 for (l = device_instances; l; l = l->next) {
483 if (sdi->serial->fd != -1)
484 serial_close(sdi->serial->fd);
485 sr_device_instance_free(sdi);
487 g_slist_free(device_instances);
488 device_instances = NULL;
491 static void *hw_get_device_info(int device_index, int device_info_id)
493 struct sr_device_instance *sdi;
494 struct ols_device *ols;
497 if (!(sdi = sr_get_device_instance(device_instances, device_index)))
502 switch (device_info_id) {
506 case SR_DI_NUM_PROBES:
507 info = GINT_TO_POINTER(NUM_PROBES);
509 case SR_DI_SAMPLERATES:
512 case SR_DI_TRIGGER_TYPES:
513 info = (char *)TRIGGER_TYPES;
515 case SR_DI_CUR_SAMPLERATE:
516 info = &ols->cur_samplerate;
523 static int hw_get_status(int device_index)
525 struct sr_device_instance *sdi;
527 if (!(sdi = sr_get_device_instance(device_instances, device_index)))
528 return SR_ST_NOT_FOUND;
533 static int *hw_get_capabilities(void)
538 static int set_configuration_samplerate(struct sr_device_instance *sdi,
541 struct ols_device *ols;
544 if (ols->max_samplerate) {
545 if (samplerate > ols->max_samplerate)
546 return SR_ERR_SAMPLERATE;
547 } else if (samplerate < samplerates.low || samplerate > samplerates.high)
548 return SR_ERR_SAMPLERATE;
550 ols->cur_samplerate = samplerate;
551 if (samplerate > CLOCK_RATE) {
552 ols->flag_reg |= FLAG_DEMUX;
553 ols->cur_samplerate_divider = (CLOCK_RATE * 2 / samplerate) - 1;
555 ols->flag_reg &= ~FLAG_DEMUX;
556 ols->cur_samplerate_divider = (CLOCK_RATE / samplerate) - 1;
562 static int hw_set_configuration(int device_index, int capability, void *value)
564 struct sr_device_instance *sdi;
565 struct ols_device *ols;
569 if (!(sdi = sr_get_device_instance(device_instances, device_index)))
573 if (sdi->status != SR_ST_ACTIVE)
576 switch (capability) {
577 case SR_HWCAP_SAMPLERATE:
579 ret = set_configuration_samplerate(sdi, *tmp_u64);
581 case SR_HWCAP_PROBECONFIG:
582 ret = configure_probes(ols, (GSList *) value);
584 case SR_HWCAP_LIMIT_SAMPLES:
586 if (*tmp_u64 < MIN_NUM_SAMPLES)
588 ols->limit_samples = *tmp_u64;
589 sr_info("ols: sample limit %" PRIu64, ols->limit_samples);
592 case SR_HWCAP_CAPTURE_RATIO:
594 ols->capture_ratio = *tmp_u64;
595 if (ols->capture_ratio < 0 || ols->capture_ratio > 100) {
596 ols->capture_ratio = 0;
608 static int receive_data(int fd, int revents, void *user_data)
610 struct sr_datafeed_packet packet;
611 struct sr_device_instance *sdi;
612 struct ols_device *ols;
614 int count, buflen, num_channels, offset, i, j;
615 unsigned char byte, *buffer;
617 /* find this device's ols_device struct by its fd */
619 for (l = device_instances; l; l = l->next) {
621 if (sdi->serial->fd == fd) {
627 /* shouldn't happen */
630 if (ols->num_transfers++ == 0) {
632 * First time round, means the device started sending data,
633 * and will not stop until done. If it stops sending for
634 * longer than it takes to send a byte, that means it's
635 * finished. We'll double that to 30ms to be sure...
637 sr_source_remove(fd);
638 sr_source_add(fd, G_IO_IN, 30, receive_data, user_data);
639 ols->raw_sample_buf = g_try_malloc(ols->limit_samples * 4);
640 if (!ols->raw_sample_buf) {
641 sr_err("ols: %s: ols->raw_sample_buf malloc failed",
645 /* fill with 1010... for debugging */
646 memset(ols->raw_sample_buf, 0x82, ols->limit_samples * 4);
650 for (i = 0x20; i > 0x02; i /= 2) {
651 if ((ols->flag_reg & i) == 0)
655 if (revents == G_IO_IN
656 && ols->num_transfers / num_channels <= ols->limit_samples) {
657 if (serial_read(fd, &byte, 1) != 1)
660 ols->sample[ols->num_bytes++] = byte;
661 sr_dbg("ols: received byte 0x%.2x", byte);
662 if (ols->num_bytes == num_channels) {
663 /* Got a full sample. */
664 sr_dbg("ols: received sample 0x%.*x",
665 ols->num_bytes * 2, (int) *ols->sample);
666 if (ols->flag_reg & FLAG_RLE) {
668 * In RLE mode -1 should never come in as a
669 * sample, because bit 31 is the "count" flag.
670 * TODO: Endianness may be wrong here, could be
673 if (ols->sample[0] & 0x80
674 && !(ols->last_sample[0] & 0x80)) {
675 count = (int)(*ols->sample) & 0x7fffffff;
676 if (!(buffer = g_try_malloc(count))) {
677 sr_err("ols: %s: buffer malloc "
683 for (i = 0; i < count; i++) {
684 memcpy(buffer + buflen, ols->last_sample, 4);
689 * Just a single sample, next sample
690 * will probably be a count referring
691 * to this -- but this one is still a
692 * part of the stream.
694 buffer = ols->sample;
698 /* No compression. */
699 buffer = ols->sample;
703 if (num_channels < 4) {
705 * Some channel groups may have been turned
706 * off, to speed up transfer between the
707 * hardware and the PC. Expand that here before
708 * submitting it over the session bus --
709 * whatever is listening on the bus will be
710 * expecting a full 32-bit sample, based on
711 * the number of probes.
714 memset(ols->tmp_sample, 0, 4);
715 for (i = 0; i < 4; i++) {
716 if (((ols->flag_reg >> 2) & (1 << i)) == 0) {
718 * This channel group was
719 * enabled, copy from received
722 ols->tmp_sample[i] = ols->sample[j++];
725 memcpy(ols->sample, ols->tmp_sample, 4);
726 sr_dbg("ols: full sample 0x%.8x", (int) *ols->sample);
729 /* the OLS sends its sample buffer backwards.
730 * store it in reverse order here, so we can dump
731 * this on the session bus later.
733 offset = (ols->limit_samples - ols->num_transfers / num_channels) * 4;
734 memcpy(ols->raw_sample_buf + offset, ols->sample, 4);
736 if (buffer == ols->sample)
737 memcpy(ols->last_sample, buffer, num_channels);
741 memset(ols->sample, 0, 4);
746 * This is the main loop telling us a timeout was reached, or
747 * we've acquired all the samples we asked for -- we're done.
748 * Send the (properly-ordered) buffer to the frontend.
750 if (ols->trigger_at != -1) {
751 /* a trigger was set up, so we need to tell the frontend
754 if (ols->trigger_at > 0) {
755 /* there are pre-trigger samples, send those first */
756 packet.type = SR_DF_LOGIC;
757 packet.length = ols->trigger_at * 4;
759 packet.payload = ols->raw_sample_buf;
760 sr_session_bus(user_data, &packet);
763 packet.type = SR_DF_TRIGGER;
765 sr_session_bus(user_data, &packet);
767 packet.type = SR_DF_LOGIC;
768 packet.length = (ols->limit_samples * 4) - (ols->trigger_at * 4);
770 packet.payload = ols->raw_sample_buf + ols->trigger_at * 4;
771 sr_session_bus(user_data, &packet);
773 packet.type = SR_DF_LOGIC;
774 packet.length = ols->limit_samples * 4;
776 packet.payload = ols->raw_sample_buf;
777 sr_session_bus(user_data, &packet);
779 g_free(ols->raw_sample_buf);
783 packet.type = SR_DF_END;
785 sr_session_bus(user_data, &packet);
791 static int hw_start_acquisition(int device_index, gpointer session_device_id)
793 struct sr_datafeed_packet *packet;
794 struct sr_datafeed_header *header;
795 struct sr_device_instance *sdi;
796 struct ols_device *ols;
797 uint32_t trigger_config[4];
799 uint16_t readcount, delaycount;
800 uint8_t changrp_mask;
803 if (!(sdi = sr_get_device_instance(device_instances, device_index)))
808 if (sdi->status != SR_ST_ACTIVE)
811 readcount = ols->limit_samples / 4;
813 memset(trigger_config, 0, 16);
814 trigger_config[ols->num_stages - 1] |= 0x08;
815 if (ols->trigger_mask[0]) {
816 delaycount = readcount * (1 - ols->capture_ratio / 100.0);
817 ols->trigger_at = (readcount - delaycount) * 4 - ols->num_stages;
819 if (send_longcommand(sdi->serial->fd, CMD_SET_TRIGGER_MASK_0,
820 reverse32(ols->trigger_mask[0])) != SR_OK)
822 if (send_longcommand(sdi->serial->fd, CMD_SET_TRIGGER_VALUE_0,
823 reverse32(ols->trigger_value[0])) != SR_OK)
825 if (send_longcommand(sdi->serial->fd, CMD_SET_TRIGGER_CONFIG_0,
826 trigger_config[0]) != SR_OK)
829 if (send_longcommand(sdi->serial->fd, CMD_SET_TRIGGER_MASK_1,
830 reverse32(ols->trigger_mask[1])) != SR_OK)
832 if (send_longcommand(sdi->serial->fd, CMD_SET_TRIGGER_VALUE_1,
833 reverse32(ols->trigger_value[1])) != SR_OK)
835 if (send_longcommand(sdi->serial->fd, CMD_SET_TRIGGER_CONFIG_1,
836 trigger_config[1]) != SR_OK)
839 if (send_longcommand(sdi->serial->fd, CMD_SET_TRIGGER_MASK_2,
840 reverse32(ols->trigger_mask[2])) != SR_OK)
842 if (send_longcommand(sdi->serial->fd, CMD_SET_TRIGGER_VALUE_2,
843 reverse32(ols->trigger_value[2])) != SR_OK)
845 if (send_longcommand(sdi->serial->fd, CMD_SET_TRIGGER_CONFIG_2,
846 trigger_config[2]) != SR_OK)
849 if (send_longcommand(sdi->serial->fd, CMD_SET_TRIGGER_MASK_3,
850 reverse32(ols->trigger_mask[3])) != SR_OK)
852 if (send_longcommand(sdi->serial->fd, CMD_SET_TRIGGER_VALUE_3,
853 reverse32(ols->trigger_value[3])) != SR_OK)
855 if (send_longcommand(sdi->serial->fd, CMD_SET_TRIGGER_CONFIG_3,
856 trigger_config[3]) != SR_OK)
859 if (send_longcommand(sdi->serial->fd, CMD_SET_TRIGGER_MASK_0,
860 ols->trigger_mask[0]) != SR_OK)
862 if (send_longcommand(sdi->serial->fd, CMD_SET_TRIGGER_VALUE_0,
863 ols->trigger_value[0]) != SR_OK)
865 if (send_longcommand(sdi->serial->fd, CMD_SET_TRIGGER_CONFIG_0,
866 0x00000008) != SR_OK)
868 delaycount = readcount;
871 sr_info("ols: setting samplerate to %" PRIu64 " Hz (divider %u, "
872 "demux %s)", ols->cur_samplerate, ols->cur_samplerate_divider,
873 ols->flag_reg & FLAG_DEMUX ? "on" : "off");
874 if (send_longcommand(sdi->serial->fd, CMD_SET_DIVIDER,
875 reverse32(ols->cur_samplerate_divider)) != SR_OK)
878 /* Send sample limit and pre/post-trigger capture ratio. */
879 data = ((readcount - 1) & 0xffff) << 16;
880 data |= (delaycount - 1) & 0xffff;
881 if (send_longcommand(sdi->serial->fd, CMD_CAPTURE_SIZE, reverse16(data)) != SR_OK)
885 * Enable/disable channel groups in the flag register according to the
889 for (i = 0; i < 4; i++) {
890 if (ols->probe_mask & (0xff << (i * 8)))
891 changrp_mask |= (1 << i);
894 /* The flag register wants them here, and 1 means "disable channel". */
895 ols->flag_reg |= ~(changrp_mask << 2) & 0x3c;
896 ols->flag_reg |= FLAG_FILTER;
897 data = ols->flag_reg << 24;
898 if (send_longcommand(sdi->serial->fd, CMD_SET_FLAGS, data) != SR_OK)
901 /* Start acquisition on the device. */
902 if (send_shortcommand(sdi->serial->fd, CMD_RUN) != SR_OK)
905 sr_source_add(sdi->serial->fd, G_IO_IN, -1, receive_data,
908 if (!(packet = g_try_malloc(sizeof(struct sr_datafeed_packet)))) {
909 sr_err("ols: %s: packet malloc failed", __func__);
910 return SR_ERR_MALLOC;
913 if (!(header = g_try_malloc(sizeof(struct sr_datafeed_header)))) {
914 sr_err("ols: %s: header malloc failed", __func__);
916 return SR_ERR_MALLOC;
919 /* Send header packet to the session bus. */
920 packet->type = SR_DF_HEADER;
921 packet->length = sizeof(struct sr_datafeed_header);
922 packet->payload = (unsigned char *)header;
923 header->feed_version = 1;
924 gettimeofday(&header->starttime, NULL);
925 header->samplerate = ols->cur_samplerate;
926 header->protocol_id = SR_PROTO_RAW;
927 header->num_logic_probes = NUM_PROBES;
928 header->num_analog_probes = 0;
929 sr_session_bus(session_device_id, packet);
937 static void hw_stop_acquisition(int device_index, gpointer session_device_id)
939 struct sr_datafeed_packet packet;
941 /* Avoid compiler warnings. */
942 device_index = device_index;
944 packet.type = SR_DF_END;
946 sr_session_bus(session_device_id, &packet);
949 struct sr_device_plugin ols_plugin_info = {
951 .longname = "Openbench Logic Sniffer",
954 .cleanup = hw_cleanup,
956 .close = hw_closedev,
957 .get_device_info = hw_get_device_info,
958 .get_status = hw_get_status,
959 .get_capabilities = hw_get_capabilities,
960 .set_configuration = hw_set_configuration,
961 .start_acquisition = hw_start_acquisition,
962 .stop_acquisition = hw_stop_acquisition,