Changeset 9513
- Timestamp:
- 08/16/09 14:41:48 (4 years ago)
- Location:
- ossiedev/branches/ttsou/gnuradio/usrp/host/lib
- Files:
-
- 4 modified
-
fusb_linux.cc (modified) (5 diffs)
-
fusb_linux.h (modified) (2 diffs)
-
fusb_ra_wb.cc (modified) (3 diffs)
-
fusb_sysconfig_linux.cc (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
ossiedev/branches/ttsou/gnuradio/usrp/host/lib/fusb_linux.cc
r9509 r9513 26 26 27 27 #include <fusb_linux.h> 28 #include < libusb-1.0/libusb.h> // libusb header28 #include <usb.h> // libusb header 29 29 #include <stdexcept> 30 30 #ifdef HAVE_LINUX_COMPILER_H … … 39 39 #include <string.h> 40 40 #include <cstdio> 41 #include <pthread.h>42 41 43 42 #define MINIMIZE_TX_BUFFERING 1 // must be defined to 0 or 1 … … 54 53 // 55 54 // FIXME if everything breaks someday in the future, look here... 56 //57 // With libusb-1.0 the libusb_device_handle is still opaque and the file58 // descriptor is buried even further. Lock the doors and hide the women and59 // children; this may code may kill you. Obviously it's rigged for 64-bit60 // machines.61 55 62 56 static int 63 fd_from_usb_dev_handle (libusb_device_handle *udh) 64 { 65 return *(int*)((u_int64_t)udh + sizeof(pthread_mutex_t) 66 + sizeof(long) 67 + 3*sizeof(void*)); 68 69 #if 0 70 71 return *(int*)((u_int32_t)udh + sizeof(pthread_mutex_t) 72 + sizeof(long) 73 + 3*sizeof(void*)); 74 #endif 75 57 fd_from_usb_dev_handle (usb_dev_handle *udh) 58 { 59 return *((int *) udh); 76 60 } 77 61 … … 143 127 // ------------------------------------------------------------------------ 144 128 145 fusb_devhandle_linux::fusb_devhandle_linux ( libusb_device_handle *udh)129 fusb_devhandle_linux::fusb_devhandle_linux (usb_dev_handle *udh) 146 130 : fusb_devhandle (udh) 147 131 { … … 311 295 break; 312 296 } 313 // ------------------------------------------------------------------------297 // ------------------------------------------------------------------------ 314 298 // end point handle 315 299 // ------------------------------------------------------------------------ -
ossiedev/branches/ttsou/gnuradio/usrp/host/lib/fusb_linux.h
r9509 r9513 46 46 public: 47 47 // CREATORS 48 fusb_devhandle_linux ( libusb_device_handle *udh);48 fusb_devhandle_linux (usb_dev_handle *udh); 49 49 virtual ~fusb_devhandle_linux (); 50 50 … … 61 61 }; 62 62 63 /*!63 /*! 64 64 * \brief linux specific implementation of fusb_ephandle using usbdevice_fs 65 65 */ -
ossiedev/branches/ttsou/gnuradio/usrp/host/lib/fusb_ra_wb.cc
r9501 r9513 26 26 27 27 #include <fusb_ra_wb.h> 28 #include < libusb-1.0/libusb.h>28 #include <usb.h> 29 29 30 30 #include <stdio.h> … … 55 55 // new "fragile extraction" 56 56 static int 57 ep_fd_from_usb_dev_handle ( libusb_dev_handle *udh, int endpoint)58 { 59 struct libusb_device_handle_kludge2 { // see also usrp_prims.cc57 ep_fd_from_usb_dev_handle (usb_dev_handle *udh, int endpoint) 58 { 59 struct usb_dev_handle_kludge2 { // see also usrp_prims.cc 60 60 int fd; 61 61 struct usb_bus *bus; … … 71 71 struct bsd_usb_dev_handle_info_kludge *info 72 72 = (struct bsd_usb_dev_handle_info_kludge *) 73 ((struct libusb_device_handle_kludge2 *)udh)->impl_info;73 ((struct usb_dev_handle_kludge2 *)udh)->impl_info; 74 74 return info->ep_fd[UE_GET_ADDR(endpoint)]; 75 75 } -
ossiedev/branches/ttsou/gnuradio/usrp/host/lib/fusb_sysconfig_linux.cc
r9501 r9513 29 29 30 30 fusb_devhandle * 31 fusb_sysconfig::make_devhandle ( libusb_device_handle *udh)31 fusb_sysconfig::make_devhandle (usb_dev_handle *udh) 32 32 { 33 33 return new fusb_devhandle_linux (udh);