fx2lafw: pass sdi to command functions.
This commit is contained in:
parent
23b886bc40
commit
a54edb1dfb
|
@ -527,8 +527,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data)
|
||||||
/* Send header packet to the session bus. */
|
/* Send header packet to the session bus. */
|
||||||
std_session_send_df_header(cb_data, LOG_PREFIX);
|
std_session_send_df_header(cb_data, LOG_PREFIX);
|
||||||
|
|
||||||
if ((ret = fx2lafw_command_start_acquisition(usb->devhdl,
|
if ((ret = fx2lafw_command_start_acquisition(sdi)) != SR_OK) {
|
||||||
devc->cur_samplerate, devc->sample_wide)) != SR_OK) {
|
|
||||||
fx2lafw_abort_acquisition(devc);
|
fx2lafw_abort_acquisition(devc);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,9 +67,10 @@ static int command_get_fw_version(libusb_device_handle *devhdl,
|
||||||
return SR_OK;
|
return SR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int command_get_revid_version(libusb_device_handle *devhdl,
|
static int command_get_revid_version(struct sr_dev_inst *sdi, uint8_t *revid)
|
||||||
uint8_t *revid)
|
|
||||||
{
|
{
|
||||||
|
struct sr_usb_dev_inst *usb = sdi->conn;
|
||||||
|
libusb_device_handle *devhdl = usb->devhdl;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = libusb_control_transfer(devhdl, LIBUSB_REQUEST_TYPE_VENDOR |
|
ret = libusb_control_transfer(devhdl, LIBUSB_REQUEST_TYPE_VENDOR |
|
||||||
|
@ -84,9 +85,13 @@ static int command_get_revid_version(libusb_device_handle *devhdl,
|
||||||
return SR_OK;
|
return SR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
SR_PRIV int fx2lafw_command_start_acquisition(libusb_device_handle *devhdl,
|
SR_PRIV int fx2lafw_command_start_acquisition(const struct sr_dev_inst *sdi)
|
||||||
uint64_t samplerate, gboolean samplewide)
|
|
||||||
{
|
{
|
||||||
|
struct dev_context *devc = sdi->priv;
|
||||||
|
struct sr_usb_dev_inst *usb = sdi->conn;
|
||||||
|
libusb_device_handle *devhdl = usb->devhdl;
|
||||||
|
uint64_t samplerate = devc->cur_samplerate;
|
||||||
|
gboolean samplewide = devc->sample_wide;
|
||||||
struct cmd_start_acquisition cmd = { 0 };
|
struct cmd_start_acquisition cmd = { 0 };
|
||||||
int delay = 0, ret;
|
int delay = 0, ret;
|
||||||
|
|
||||||
|
@ -255,7 +260,7 @@ SR_PRIV int fx2lafw_dev_open(struct sr_dev_inst *sdi, struct sr_dev_driver *di)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = command_get_revid_version(usb->devhdl, &revid);
|
ret = command_get_revid_version(sdi, &revid);
|
||||||
if (ret != SR_OK) {
|
if (ret != SR_OK) {
|
||||||
sr_err("Failed to get REVID.");
|
sr_err("Failed to get REVID.");
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -98,8 +98,7 @@ struct dev_context {
|
||||||
struct sr_context *ctx;
|
struct sr_context *ctx;
|
||||||
};
|
};
|
||||||
|
|
||||||
SR_PRIV int fx2lafw_command_start_acquisition(libusb_device_handle *devhdl,
|
SR_PRIV int fx2lafw_command_start_acquisition(const struct sr_dev_inst *sdi);
|
||||||
uint64_t samplerate, gboolean samplewide);
|
|
||||||
SR_PRIV gboolean fx2lafw_check_conf_profile(libusb_device *dev);
|
SR_PRIV gboolean fx2lafw_check_conf_profile(libusb_device *dev);
|
||||||
SR_PRIV int fx2lafw_dev_open(struct sr_dev_inst *sdi, struct sr_dev_driver *di);
|
SR_PRIV int fx2lafw_dev_open(struct sr_dev_inst *sdi, struct sr_dev_driver *di);
|
||||||
SR_PRIV int fx2lafw_configure_channels(const struct sr_dev_inst *sdi);
|
SR_PRIV int fx2lafw_configure_channels(const struct sr_dev_inst *sdi);
|
||||||
|
|
Loading…
Reference in New Issue