forked from sdr/rtl-sdr
Apply SatNOGS patches
From https://gitea.osmocom.org/kerel-fs/rtl-sdr/src/branch/satnogs/debian/patches
This commit is contained in:
parent
af33886796
commit
bed700bb96
|
@ -361,7 +361,7 @@ static rtlsdr_dongle_t known_devices[] = {
|
|||
#define CTRL_IN (LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_ENDPOINT_IN)
|
||||
#define CTRL_OUT (LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_ENDPOINT_OUT)
|
||||
#define CTRL_TIMEOUT 300
|
||||
#define BULK_TIMEOUT 0
|
||||
#define BULK_TIMEOUT 10000
|
||||
|
||||
#define EEPROM_ADDR 0xa0
|
||||
|
||||
|
@ -1531,11 +1531,9 @@ int rtlsdr_open(rtlsdr_dev_t **out_dev, uint32_t index)
|
|||
|
||||
dev->rtl_xtal = DEF_RTL_XTAL_FREQ;
|
||||
|
||||
/* perform a dummy write, if it fails, reset the device */
|
||||
if (rtlsdr_write_reg(dev, USBB, USB_SYSCTL, 0x09, 1) < 0) {
|
||||
fprintf(stderr, "Resetting device...\n");
|
||||
libusb_reset_device(dev->devh);
|
||||
}
|
||||
/* Reset the device before initialization */
|
||||
fprintf(stderr, "Resetting device...\n");
|
||||
libusb_reset_device(dev->devh);
|
||||
|
||||
rtlsdr_init_baseband(dev);
|
||||
dev->dev_lost = 0;
|
||||
|
@ -1673,6 +1671,10 @@ int rtlsdr_close(rtlsdr_dev_t *dev)
|
|||
|
||||
rtlsdr_deinit_baseband(dev);
|
||||
}
|
||||
else {
|
||||
fprintf(stderr, "Resetting device...\n");
|
||||
libusb_reset_device(dev->devh);
|
||||
}
|
||||
|
||||
libusb_release_interface(dev->devh, 0);
|
||||
|
||||
|
@ -1725,7 +1727,8 @@ static void LIBUSB_CALL _libusb_callback(struct libusb_transfer *xfer)
|
|||
dev->xfer_errors = 0;
|
||||
} else if (LIBUSB_TRANSFER_CANCELLED != xfer->status) {
|
||||
#ifndef _WIN32
|
||||
if (LIBUSB_TRANSFER_ERROR == xfer->status)
|
||||
if (LIBUSB_TRANSFER_ERROR == xfer->status ||
|
||||
LIBUSB_TRANSFER_TIMED_OUT == xfer->status)
|
||||
dev->xfer_errors++;
|
||||
|
||||
if (dev->xfer_errors >= dev->xfer_buf_num ||
|
||||
|
|
Loading…
Reference in New Issue