]> sigrok.org Git - libsigrok.git/blame - hardware/fx2lafw/fx2lafw.c
fx2lafw: Devices now retain the same PID/VID after fw load
[libsigrok.git] / hardware / fx2lafw / fx2lafw.c
CommitLineData
f302a082
JH
1/*
2 * This file is part of the sigrok project.
3 *
4 * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
5 *
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.
10 *
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.
15 *
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/>.
18 */
19
20#include <stdio.h>
21#include <stdlib.h>
8b35f474 22#include <inttypes.h>
187b3582
JH
23#include <glib.h>
24#include <libusb.h>
f302a082
JH
25#include "config.h"
26#include "sigrok.h"
27#include "sigrok-internal.h"
28#include "fx2lafw.h"
29
187b3582
JH
30static struct fx2lafw_profile supported_fx2[] = {
31 /* USBee AX */
32 { 0x08a9, 0x0014, "CWAV", "USBee AX", NULL, 8 },
33 { 0, 0, 0, 0, 0, 0 }
34};
35
8b35f474
JH
36static int fx2lafw_capabilities[] = {
37 SR_HWCAP_LOGIC_ANALYZER,
38 SR_HWCAP_SAMPLERATE,
39
40 /* These are really implemented in the driver, not the hardware. */
41 SR_HWCAP_LIMIT_SAMPLES,
42 SR_HWCAP_CONTINUOUS,
772a0e61 43 0,
8b35f474
JH
44};
45
46static const char *fx2lafw_probe_names[] = {
47 "D0",
48 "D1",
49 "D2",
50 "D3",
51 "D4",
52 "D5",
53 "D6",
54 "D7",
772a0e61 55 NULL,
8b35f474
JH
56};
57
58static uint64_t fx2lafw_supported_samplerates[] = {
59 SR_MHZ(1),
60 SR_MHZ(2),
61 SR_MHZ(3),
62 SR_MHZ(4),
63 SR_MHZ(6),
64 SR_MHZ(8),
65 SR_MHZ(12),
66 SR_MHZ(16),
772a0e61 67 SR_MHZ(24),
8b35f474
JH
68};
69
70static struct sr_samplerates fx2lafw_samplerates = {
71 SR_MHZ(1),
72 SR_MHZ(24),
73 SR_HZ(0),
772a0e61 74 fx2lafw_supported_samplerates,
8b35f474
JH
75};
76
cac0bbaa 77static GSList *dev_insts = NULL;
187b3582
JH
78static libusb_context *usb_context = NULL;
79
1f9813eb 80static int hw_dev_acquisition_stop(int dev_index, void *session_dev_id);
610dbb70 81
b1eeb67e
JH
82/**
83 * Check the USB configuration to determine if this is an fx2lafw device.
84 *
f9a69557
UH
85 * @return TRUE if the device's configuration profile match fx2lafw
86 * configuration, FALSE otherwise.
b1eeb67e 87 */
f9a69557 88static gboolean check_conf_profile(libusb_device *dev)
b1eeb67e
JH
89{
90 struct libusb_device_descriptor des;
91 struct libusb_config_descriptor *conf_dsc = NULL;
92 const struct libusb_interface_descriptor *intf_dsc;
f9a69557 93 gboolean ret = FALSE;
b1eeb67e
JH
94
95 while (!ret) {
96 /* Assume it's not a Saleae Logic unless proven wrong. */
97 ret = 0;
98
99 if (libusb_get_device_descriptor(dev, &des) != 0)
100 break;
101
102 if (des.bNumConfigurations != 1)
103 /* Need exactly 1 configuration. */
104 break;
105
106 if (libusb_get_config_descriptor(dev, 0, &conf_dsc) != 0)
107 break;
108
109 if (conf_dsc->bNumInterfaces != 1)
110 /* Need exactly 1 interface. */
111 break;
112
113 if (conf_dsc->interface[0].num_altsetting != 1)
114 /* Need just one alternate setting. */
115 break;
116
117 intf_dsc = &(conf_dsc->interface[0].altsetting[0]);
118 if (intf_dsc->bNumEndpoints != 3)
119 /* Need exactly 3 end points. */
120 break;
121
122 if ((intf_dsc->endpoint[0].bEndpointAddress & 0x8f) !=
123 (1 | LIBUSB_ENDPOINT_OUT))
124 /* The first endpoint should be 1 (outbound). */
125 break;
126
127 if ((intf_dsc->endpoint[1].bEndpointAddress & 0x8f) !=
128 (2 | LIBUSB_ENDPOINT_IN))
129 /* The second endpoint should be 2 (inbound). */
130 break;
131
132 /* TODO: Check the debug channel... */
133
134 /* If we made it here, it must be an fx2lafw. */
f9a69557 135 ret = TRUE;
b1eeb67e
JH
136 }
137
138 if (conf_dsc)
139 libusb_free_config_descriptor(conf_dsc);
140
141 return ret;
142}
143
43125c69
JH
144static int fx2lafw_open_dev(int dev_index)
145{
146 libusb_device **devlist;
147 struct libusb_device_descriptor des;
148 struct sr_dev_inst *sdi;
772a0e61 149 struct context *ctx;
43125c69
JH
150 int err, skip, i;
151
152 if (!(sdi = sr_dev_inst_get(dev_insts, dev_index)))
153 return SR_ERR;
154 ctx = sdi->priv;
155
156 if (sdi->status == SR_ST_ACTIVE)
157 /* already in use */
158 return SR_ERR;
159
160 skip = 0;
161 libusb_get_device_list(usb_context, &devlist);
162 for (i = 0; devlist[i]; i++) {
163 if ((err = libusb_get_device_descriptor(devlist[i], &des))) {
164 sr_err("fx2lafw: failed to get device descriptor: %d", err);
165 continue;
166 }
167
74fcfb80
JH
168 if (des.idVendor != ctx->profile->vid
169 || des.idProduct != ctx->profile->pid)
43125c69
JH
170 continue;
171
172 if (sdi->status == SR_ST_INITIALIZING) {
173 if (skip != dev_index) {
174 /* Skip devices of this type that aren't the one we want. */
175 skip += 1;
176 continue;
177 }
178 } else if (sdi->status == SR_ST_INACTIVE) {
179 /*
180 * This device is fully enumerated, so we need to find
181 * this device by vendor, product, bus and address.
182 */
183 if (libusb_get_bus_number(devlist[i]) != ctx->usb->bus
184 || libusb_get_device_address(devlist[i]) != ctx->usb->address)
185 /* this is not the one */
186 continue;
187 }
188
189 if (!(err = libusb_open(devlist[i], &ctx->usb->devhdl))) {
190 if (ctx->usb->address == 0xff)
191 /*
192 * first time we touch this device after firmware upload,
193 * so we don't know the address yet.
194 */
195 ctx->usb->address = libusb_get_device_address(devlist[i]);
196
197 sdi->status = SR_ST_ACTIVE;
198 sr_info("fx2lafw: opened device %d on %d.%d interface %d",
199 sdi->index, ctx->usb->bus,
200 ctx->usb->address, USB_INTERFACE);
201 } else {
202 sr_err("fx2lafw: failed to open device: %d", err);
203 }
204
205 /* if we made it here, we handled the device one way or another */
206 break;
207 }
208 libusb_free_device_list(devlist, 1);
209
210 if (sdi->status != SR_ST_ACTIVE)
211 return SR_ERR;
212
213 return SR_OK;
214}
215
f1898235
JH
216static void close_dev(struct sr_dev_inst *sdi)
217{
772a0e61 218 struct context *ctx;
f1898235
JH
219
220 ctx = sdi->priv;
221
222 if (ctx->usb->devhdl == NULL)
223 return;
224
225 sr_info("fx2lafw: closing device %d on %d.%d interface %d", sdi->index,
226 ctx->usb->bus, ctx->usb->address, USB_INTERFACE);
227 libusb_release_interface(ctx->usb->devhdl, USB_INTERFACE);
228 libusb_close(ctx->usb->devhdl);
229 ctx->usb->devhdl = NULL;
230 sdi->status = SR_ST_INACTIVE;
231}
232
772a0e61 233static struct context *fx2lafw_device_new(void)
187b3582 234{
772a0e61 235 struct context *ctx;
187b3582 236
772a0e61
UH
237 if (!(ctx = g_try_malloc0(sizeof(struct context)))) {
238 sr_err("fx2lafw: %s: ctx malloc failed", __func__);
187b3582
JH
239 return NULL;
240 }
241
772a0e61 242 return ctx;
187b3582 243}
f302a082
JH
244
245/*
246 * API callbacks
247 */
248
249static int hw_init(const char *deviceinfo)
250{
187b3582
JH
251 struct sr_dev_inst *sdi;
252 struct libusb_device_descriptor des;
253 struct fx2lafw_profile *fx2lafw_prof;
772a0e61 254 struct context *ctx;
187b3582
JH
255 libusb_device **devlist;
256 int err;
257 int devcnt = 0;
258 int i, j;
259
260 /* Avoid compiler warnings. */
f302a082 261 (void)deviceinfo;
187b3582
JH
262
263 if (libusb_init(&usb_context) != 0) {
264 sr_warn("Failed to initialize USB.");
265 return 0;
266 }
267
268 /* Find all fx2lafw compatible devices and upload firware to all of them. */
269 libusb_get_device_list(usb_context, &devlist);
270 for (i = 0; devlist[i]; i++) {
271
272 if ((err = libusb_get_device_descriptor(
273 devlist[i], &des)) != 0) {
274 sr_warn("failed to get device descriptor: %d", err);
275 continue;
276 }
277
278 fx2lafw_prof = NULL;
279 for (j = 0; supported_fx2[j].vid; j++) {
280 if (des.idVendor == supported_fx2[j].vid &&
281 des.idProduct == supported_fx2[j].pid) {
282 fx2lafw_prof = &supported_fx2[j];
283 }
284 }
285
286 /* Skip if the device was not found */
287 if(!fx2lafw_prof)
288 continue;
289
290 sdi = sr_dev_inst_new(devcnt, SR_ST_INITIALIZING,
291 fx2lafw_prof->vendor, fx2lafw_prof->model,
292 fx2lafw_prof->model_version);
293 if(!sdi)
294 return 0;
295
90282c82
JH
296 ctx = fx2lafw_device_new();
297 ctx->profile = fx2lafw_prof;
298 sdi->priv = ctx;
be4b99e8 299 dev_insts = g_slist_append(dev_insts, sdi);
187b3582 300
b1eeb67e
JH
301 if (check_conf_profile(devlist[i])) {
302 /* Already has the firmware, so fix the new address. */
303 sr_dbg("fx2lafw: Found a fx2lafw device.");
304 sdi->status = SR_ST_INACTIVE;
305 ctx->usb = sr_usb_dev_inst_new
306 (libusb_get_bus_number(devlist[i]),
307 libusb_get_device_address(devlist[i]), NULL);
308 } else {
309 if (ezusb_upload_firmware(devlist[i], USB_CONFIGURATION, FIRMWARE) == SR_OK)
310 /* Remember when the firmware on this device was updated */
311 g_get_current_time(&ctx->fw_updated);
312 else
313 sr_err("fx2lafw: firmware upload failed for "
314 "device %d", devcnt);
315 ctx->usb = sr_usb_dev_inst_new
316 (libusb_get_bus_number(devlist[i]), 0xff, NULL);
317 }
318
187b3582
JH
319 devcnt++;
320 }
321 libusb_free_device_list(devlist, 1);
322
323 return devcnt;
f302a082
JH
324}
325
772a0e61 326static int hw_dev_open(int dev_index)
f302a082 327{
43125c69
JH
328 GTimeVal cur_time;
329 struct sr_dev_inst *sdi;
772a0e61 330 struct context *ctx;
43125c69
JH
331 int timediff, err;
332
772a0e61 333 if (!(sdi = sr_dev_inst_get(dev_insts, dev_index)))
43125c69
JH
334 return SR_ERR;
335 ctx = sdi->priv;
336
337 /*
338 * if the firmware was recently uploaded, wait up to MAX_RENUM_DELAY ms
339 * for the FX2 to renumerate
340 */
341 err = 0;
342 if (GTV_TO_MSEC(ctx->fw_updated) > 0) {
343 sr_info("fx2lafw: waiting for device to reset");
344 /* takes at least 300ms for the FX2 to be gone from the USB bus */
345 g_usleep(300 * 1000);
346 timediff = 0;
347 while (timediff < MAX_RENUM_DELAY) {
772a0e61 348 if ((err = fx2lafw_open_dev(dev_index)) == SR_OK)
43125c69
JH
349 break;
350 g_usleep(100 * 1000);
351 g_get_current_time(&cur_time);
352 timediff = GTV_TO_MSEC(cur_time) - GTV_TO_MSEC(ctx->fw_updated);
353 }
354 sr_info("fx2lafw: device came back after %d ms", timediff);
355 } else {
772a0e61 356 err = fx2lafw_open_dev(dev_index);
43125c69
JH
357 }
358
359 if (err != SR_OK) {
360 sr_err("fx2lafw: unable to open device");
361 return SR_ERR;
362 }
363 ctx = sdi->priv;
364
365 err = libusb_claim_interface(ctx->usb->devhdl, USB_INTERFACE);
366 if (err != 0) {
367 sr_err("fx2lafw: Unable to claim interface: %d", err);
368 return SR_ERR;
369 }
370
f302a082
JH
371 return SR_OK;
372}
373
f1898235 374static int hw_dev_close(int dev_index)
f302a082 375{
f1898235
JH
376 struct sr_dev_inst *sdi;
377
378 if (!(sdi = sr_dev_inst_get(dev_insts, dev_index))) {
379 sr_err("fx2lafw: %s: sdi was NULL", __func__);
0abee507 380 return SR_ERR_BUG;
f1898235
JH
381 }
382
383 /* TODO */
384 close_dev(sdi);
385
f302a082
JH
386 return SR_OK;
387}
388
389static int hw_cleanup(void)
390{
187b3582
JH
391 GSList *l;
392 struct sr_dev_inst *sdi;
772a0e61 393 struct context *ctx;
62bc70e4 394 int ret = SR_OK;
187b3582 395
62bc70e4
JH
396 for(l = dev_insts; l; l = l->next) {
397 if (!(sdi = l->data)) {
398 /* Log error, but continue cleaning up the rest. */
399 sr_err("fx2lafw: %s: sdi was NULL, continuing", __func__);
400 ret = SR_ERR_BUG;
401 continue;
402 }
403 if (!(ctx = sdi->priv)) {
404 /* Log error, but continue cleaning up the rest. */
405 sr_err("fx2lafw: %s: sdi->priv was NULL, continuing",
406 __func__);
407 ret = SR_ERR_BUG;
408 continue;
409 }
410 close_dev(sdi);
187b3582
JH
411 sdi = l->data;
412 sr_dev_inst_free(sdi);
413 }
414
62bc70e4
JH
415 g_slist_free(dev_insts);
416 dev_insts = NULL;
187b3582
JH
417
418 if(usb_context)
419 libusb_exit(usb_context);
420 usb_context = NULL;
421
62bc70e4 422 return ret;
f302a082
JH
423}
424
772a0e61 425static void *hw_dev_info_get(int dev_index, int dev_info_id)
f302a082 426{
8b35f474 427 struct sr_dev_inst *sdi;
772a0e61 428 struct context *ctx;
8b35f474 429
772a0e61 430 if (!(sdi = sr_dev_inst_get(dev_insts, dev_index)))
8b35f474 431 return NULL;
cdfdd711 432 ctx = sdi->priv;
8b35f474 433
772a0e61 434 switch (dev_info_id) {
8b35f474
JH
435 case SR_DI_INST:
436 return sdi;
437 case SR_DI_NUM_PROBES:
cdfdd711 438 return GINT_TO_POINTER(ctx->profile->num_probes);
8b35f474
JH
439 case SR_DI_PROBE_NAMES:
440 return fx2lafw_probe_names;
441 case SR_DI_SAMPLERATES:
442 return &fx2lafw_samplerates;
443 case SR_DI_TRIGGER_TYPES:
444 return TRIGGER_TYPES;
e3186647
JH
445 case SR_DI_CUR_SAMPLERATE:
446 return &ctx->cur_samplerate;
8b35f474
JH
447 }
448
f302a082
JH
449 return NULL;
450}
451
772a0e61 452static int hw_dev_status_get(int dev_index)
f302a082 453{
aae2fed6 454 const struct sr_dev_inst *const sdi =
772a0e61 455 sr_dev_inst_get(dev_insts, dev_index);
aae2fed6
JH
456
457 if (!sdi)
458 return SR_ST_NOT_FOUND;
459
460 return sdi->status;
f302a082
JH
461}
462
463static int *hw_hwcap_get_all(void)
464{
8b35f474 465 return fx2lafw_capabilities;
f302a082
JH
466}
467
7cb621d4 468static int hw_dev_config_set(int dev_index, int hwcap, void *value)
f302a082 469{
7cb621d4 470 struct sr_dev_inst *sdi;
772a0e61 471 struct context *ctx;
7cb621d4
JH
472 int ret;
473
474 if (!(sdi = sr_dev_inst_get(dev_insts, dev_index)))
475 return SR_ERR;
476 ctx = sdi->priv;
477
e3186647
JH
478 if (hwcap == SR_HWCAP_SAMPLERATE) {
479 ctx->cur_samplerate = *(uint64_t *)value;
480 ret = SR_OK;
481 } else if (hwcap == SR_HWCAP_PROBECONFIG) {
482 ret = SR_OK;
483 } else if (hwcap == SR_HWCAP_LIMIT_SAMPLES) {
7cb621d4
JH
484 ctx->limit_samples = *(uint64_t *)value;
485 ret = SR_OK;
486 } else {
487 ret = SR_ERR;
488 }
489
490 return ret;
f302a082
JH
491}
492
1f9813eb 493static int receive_data(int fd, int revents, void *cb_data)
610dbb70
JH
494{
495 struct timeval tv;
496
497 /* Avoid compiler warnings. */
498 (void)fd;
499 (void)revents;
1f9813eb 500 (void)cb_data;
610dbb70
JH
501
502 tv.tv_sec = tv.tv_usec = 0;
503 libusb_handle_events_timeout(usb_context, &tv);
504
505 return TRUE;
506}
507
508static void receive_transfer(struct libusb_transfer *transfer)
509{
510 /* TODO: These statics have to move to the ctx struct. */
511 static int num_samples = 0;
512 static int empty_transfer_count = 0;
513 struct sr_datafeed_packet packet;
514 struct sr_datafeed_logic logic;
772a0e61 515 struct context *ctx;
610dbb70
JH
516 int cur_buflen;
517 unsigned char *cur_buf, *new_buf;
518
519 /* hw_dev_acquisition_stop() is telling us to stop. */
520 if (transfer == NULL)
521 num_samples = -1;
522
523 /*
524 * If acquisition has already ended, just free any queued up
525 * transfer that come in.
526 */
527 if (num_samples == -1) {
528 if (transfer)
529 libusb_free_transfer(transfer);
530 return;
531 }
532
533 sr_info("fx2lafw: receive_transfer(): status %d received %d bytes",
534 transfer->status, transfer->actual_length);
535
536 /* Save incoming transfer before reusing the transfer struct. */
537 cur_buf = transfer->buffer;
538 cur_buflen = transfer->actual_length;
539 ctx = transfer->user_data;
540
541 /* Fire off a new request. */
542 if (!(new_buf = g_try_malloc(4096))) {
543 sr_err("fx2lafw: %s: new_buf malloc failed", __func__);
544 return; /* TODO: SR_ERR_MALLOC */
545 }
546
547 transfer->buffer = new_buf;
548 transfer->length = 4096;
549 if (libusb_submit_transfer(transfer) != 0) {
550 /* TODO: Stop session? */
551 /* TODO: Better error message. */
552 sr_err("fx2lafw: %s: libusb_submit_transfer error", __func__);
553 }
554
555 if (cur_buflen == 0) {
556 empty_transfer_count++;
557 if (empty_transfer_count > MAX_EMPTY_TRANSFERS) {
558 /*
559 * The FX2 gave up. End the acquisition, the frontend
560 * will work out that the samplecount is short.
561 */
3cd3a20b 562 hw_dev_acquisition_stop(-1, ctx->session_dev_id);
610dbb70
JH
563 }
564 return;
565 } else {
566 empty_transfer_count = 0;
567 }
568
569 /* Send the incoming transfer to the session bus. */
570 packet.type = SR_DF_LOGIC;
571 packet.payload = &logic;
572 logic.length = cur_buflen;
573 logic.unitsize = 1;
574 logic.data = cur_buf;
3cd3a20b 575 sr_session_send(ctx->session_dev_id, &packet);
610dbb70
JH
576 g_free(cur_buf);
577
578 num_samples += cur_buflen;
579 if (ctx->limit_samples &&
580 (unsigned int) num_samples > ctx->limit_samples) {
3cd3a20b 581 hw_dev_acquisition_stop(-1, ctx->session_dev_id);
610dbb70
JH
582 }
583}
584
3cd3a20b 585static int hw_dev_acquisition_start(int dev_index, void *cb_data)
f302a082 586{
610dbb70
JH
587 struct sr_dev_inst *sdi;
588 struct sr_datafeed_packet *packet;
589 struct sr_datafeed_header *header;
772a0e61 590 struct context *ctx;
610dbb70
JH
591 struct libusb_transfer *transfer;
592 const struct libusb_pollfd **lupfd;
593 int size, i;
594 unsigned char *buf;
595
596 if (!(sdi = sr_dev_inst_get(dev_insts, dev_index)))
597 return SR_ERR;
598 ctx = sdi->priv;
3cd3a20b 599 ctx->session_dev_id = cb_data;
610dbb70
JH
600
601 if (!(packet = g_try_malloc(sizeof(struct sr_datafeed_packet)))) {
602 sr_err("fx2lafw: %s: packet malloc failed", __func__);
603 return SR_ERR_MALLOC;
604 }
605
606 if (!(header = g_try_malloc(sizeof(struct sr_datafeed_header)))) {
607 sr_err("fx2lafw: %s: header malloc failed", __func__);
608 return SR_ERR_MALLOC;
609 }
610
611 /* Start with 2K transfer, subsequently increased to 4K. */
612 size = 2048;
613 for (i = 0; i < NUM_SIMUL_TRANSFERS; i++) {
614 if (!(buf = g_try_malloc(size))) {
615 sr_err("fx2lafw: %s: buf malloc failed", __func__);
616 return SR_ERR_MALLOC;
617 }
618 transfer = libusb_alloc_transfer(0);
619 libusb_fill_bulk_transfer(transfer, ctx->usb->devhdl,
620 2 | LIBUSB_ENDPOINT_IN, buf, size,
621 receive_transfer, ctx, 40);
622 if (libusb_submit_transfer(transfer) != 0) {
623 /* TODO: Free them all. */
624 libusb_free_transfer(transfer);
625 g_free(buf);
626 return SR_ERR;
627 }
628 size = 4096;
629 }
630
631 lupfd = libusb_get_pollfds(usb_context);
632 for (i = 0; lupfd[i]; i++)
633 sr_source_add(lupfd[i]->fd, lupfd[i]->events,
634 40, receive_data, NULL);
635 free(lupfd); /* NOT g_free()! */
636
637 packet->type = SR_DF_HEADER;
638 packet->payload = header;
639 header->feed_version = 1;
640 gettimeofday(&header->starttime, NULL);
e3186647 641 header->samplerate = ctx->cur_samplerate;
610dbb70 642 header->num_logic_probes = ctx->profile->num_probes;
c8f2c9dd 643 sr_session_send(cb_data, packet);
610dbb70
JH
644 g_free(header);
645 g_free(packet);
646
f302a082
JH
647 return SR_OK;
648}
649
3cd3a20b 650/* TODO: This stops acquisition on ALL devices, ignoring dev_index. */
c8f2c9dd 651static int hw_dev_acquisition_stop(int dev_index, void *cb_data)
f302a082 652{
5da93902
JH
653 struct sr_datafeed_packet packet;
654
655 /* Avoid compiler warnings. */
f302a082 656 (void)dev_index;
5da93902
JH
657
658 packet.type = SR_DF_END;
c8f2c9dd 659 sr_session_send(cb_data, &packet);
5da93902
JH
660
661 receive_transfer(NULL);
662
663 /* TODO: Need to cancel and free any queued up transfers. */
664
f302a082
JH
665 return SR_OK;
666}
667
c09f0b57 668SR_PRIV struct sr_dev_driver fx2lafw_driver_info = {
f302a082
JH
669 .name = "fx2lafw",
670 .longname = "fx2lafw",
671 .api_version = 1,
672 .init = hw_init,
673 .cleanup = hw_cleanup,
674 .dev_open = hw_dev_open,
675 .dev_close = hw_dev_close,
676 .dev_info_get = hw_dev_info_get,
677 .dev_status_get = hw_dev_status_get,
678 .hwcap_get_all = hw_hwcap_get_all,
679 .dev_config_set = hw_dev_config_set,
680 .dev_acquisition_start = hw_dev_acquisition_start,
681 .dev_acquisition_stop = hw_dev_acquisition_stop,
682};