static int submit_transfer(struct dev_context *devc,
struct libusb_transfer *xfer)
{
static int submit_transfer(struct dev_context *devc,
struct libusb_transfer *xfer)
{
static int submit_request(const struct sr_dev_inst *sdi,
enum protocol_state state)
{
static int submit_request(const struct sr_dev_inst *sdi,
enum protocol_state state)
{
static void handle_length_response(const struct sr_dev_inst *sdi)
{
struct dev_context *devc;
struct acquisition_state *acq;
devc = sdi->priv;
static void handle_length_response(const struct sr_dev_inst *sdi)
{
struct dev_context *devc;
struct acquisition_state *acq;
devc = sdi->priv;
static void clear_acquisition_state(const struct sr_dev_inst *sdi)
{
struct dev_context *devc;
struct acquisition_state *acq;
devc = sdi->priv;
static void clear_acquisition_state(const struct sr_dev_inst *sdi)
{
struct dev_context *devc;
struct acquisition_state *acq;
devc = sdi->priv;
static int transfer_event(int fd, int revents, void *cb_data)
{
const struct sr_dev_inst *sdi;
static int transfer_event(int fd, int revents, void *cb_data)
{
const struct sr_dev_inst *sdi;
/* We are done, clean up and send end packet to session bus. */
clear_acquisition_state(sdi);
/* We are done, clean up and send end packet to session bus. */
clear_acquisition_state(sdi);
static void LIBUSB_CALL transfer_out_completed(struct libusb_transfer *transfer)
{
const struct sr_dev_inst *sdi;
struct dev_context *devc;
struct acquisition_state *acq;
static void LIBUSB_CALL transfer_out_completed(struct libusb_transfer *transfer)
{
const struct sr_dev_inst *sdi;
struct dev_context *devc;
struct acquisition_state *acq;
if (transfer->status != LIBUSB_TRANSFER_COMPLETED) {
sr_err("Transfer to device failed (state %d): %s.",
if (transfer->status != LIBUSB_TRANSFER_COMPLETED) {
sr_err("Transfer to device failed (state %d): %s.",
static void LIBUSB_CALL transfer_in_completed(struct libusb_transfer *transfer)
{
const struct sr_dev_inst *sdi;
struct dev_context *devc;
struct acquisition_state *acq;
static void LIBUSB_CALL transfer_in_completed(struct libusb_transfer *transfer)
{
const struct sr_dev_inst *sdi;
struct dev_context *devc;
struct acquisition_state *acq;
if (transfer->status != LIBUSB_TRANSFER_COMPLETED) {
sr_err("Transfer from device failed (state %d): %s.",
if (transfer->status != LIBUSB_TRANSFER_COMPLETED) {
sr_err("Transfer from device failed (state %d): %s.",
if (ret != SR_OK) {
usb_source_remove(sdi->session, drvc->sr_ctx);
clear_acquisition_state(sdi);
if (ret != SR_OK) {
usb_source_remove(sdi->session, drvc->sr_ctx);
clear_acquisition_state(sdi);