summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Tsou <ttsou@vt.edu>2010-08-26 19:00:05 -0700
committerThomas Tsou <ttsou@vt.edu>2010-08-27 11:59:08 -0700
commit5e047eb5cb6f51b0c86ace7e5b4ea6c8089f0de9 (patch)
tree55ee42104fbdb0f90f33607f8062748dac501d8a
parentab068598b62b5c05dc56df0e2a2a54cc0b37cdf2 (diff)
downloaduhd-5e047eb5cb6f51b0c86ace7e5b4ea6c8089f0de9.tar.gz
uhd-5e047eb5cb6f51b0c86ace7e5b4ea6c8089f0de9.tar.bz2
uhd-5e047eb5cb6f51b0c86ace7e5b4ea6c8089f0de9.zip
usrp1: Only return a list of FSF devices
-rw-r--r--host/lib/transport/libusb1_device_handle.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/host/lib/transport/libusb1_device_handle.cpp b/host/lib/transport/libusb1_device_handle.cpp
index f80090f15..5289f668f 100644
--- a/host/lib/transport/libusb1_device_handle.cpp
+++ b/host/lib/transport/libusb1_device_handle.cpp
@@ -88,6 +88,16 @@ usb_device_handle::sptr make_usb_device_handle(libusb_device *dev)
device_addr));
}
+bool check_fsf_device(libusb_device *dev)
+{
+ libusb_device_descriptor desc;
+
+ if (libusb_get_device_descriptor(dev, &desc) < 0) {
+ UHD_ASSERT_THROW("USB: failed to get device descriptor");
+ }
+
+ return desc.idVendor == 0xfffe;
+}
std::vector<usb_device_handle::sptr> usb_device_handle::get_device_list()
{
@@ -105,7 +115,8 @@ std::vector<usb_device_handle::sptr> usb_device_handle::get_device_list()
ssize_t i = 0;
for (i = 0; i < cnt; i++) {
libusb_device *dev = list[i];
- device_list.push_back(make_usb_device_handle(dev));
+ if (check_fsf_device(dev))
+ device_list.push_back(make_usb_device_handle(dev));
}
libusb_free_device_list(list, 0);