Fixed bug usb_control_transfer bug
authorttsou <ttsou@vt.edu>
Mon, 14 Sep 2009 05:16:52 +0000 (01:16 -0400)
committerttsou <ttsou@vt.edu>
Wed, 16 Sep 2009 21:08:52 +0000 (17:08 -0400)
usrp/host/include/usrp/usrp_prims.h.in
usrp/host/lib/usrp_prims_common.cc
usrp/host/lib/usrp_prims_libusb.cc

index ae12bbe65288742b37d3a4b4b147494288f7d7c9..49a9d3d62a31c0b8a2a6fb8ed0ac330b40c2f660 100644 (file)
@@ -275,7 +275,5 @@ int usb_control_transfer (struct usb_dev_handle *udh, int request_type,
                           int request, int value, int index,
                           unsigned char *data, int length,
                           unsigned int timeout);
-}
-
 
 #endif /* _USRP_PRIMS_H_ */
index 1517d51ac2a914aa9a1cea3d9b6e1f8e23a885c0..c71ba90b0f7856edfcedd68aa683b1ec5bc52d54 100644 (file)
@@ -218,8 +218,8 @@ write_internal_ram (libusb_device_handle *udh, unsigned char *buf,
     if (n > quanta)
       n = quanta;
 
-    a = usb_control_transfer (udh, 0x40, 0xA0,
-                         addr, 0, (unsigned char *)(buf + (addr - start_addr)), n, 1000);
+    a = usb_control_transfer (udh, 0x40, 0xA0, addr, 0,
+                       (unsigned char*)(buf + (addr - start_addr)), n, 1000);
 
     if (a < 0){
       fprintf(stderr,"write_internal_ram failed: %u\n", a);
@@ -425,7 +425,7 @@ usrp_set_hash (libusb_device_handle *udh, int which,
 
   // we use the Cypress firmware down load command to jam it in.
   int r = usb_control_transfer (udh, 0x40, 0xa0, hash_slot_addr[which], 0,
-                           (unsigned char *) hash, USRP_HASH_SIZE, 1000);
+                                (unsigned char *) hash, USRP_HASH_SIZE, 1000);
   return r == USRP_HASH_SIZE;
 }
   
@@ -437,7 +437,7 @@ usrp_get_hash (libusb_device_handle *udh, int which,
 
   // we use the Cypress firmware upload command to fetch it.
   int r = usb_control_transfer (udh, 0xc0, 0xa0, hash_slot_addr[which], 0,
-                           (unsigned char *) hash, USRP_HASH_SIZE, 1000);
+                                (unsigned char *) hash, USRP_HASH_SIZE, 1000);
   return r == USRP_HASH_SIZE;
 }
 
index d07caaa9d963fef725687936dcfd4063481679c9..999dc5897973cf892950fdf0a0994e67646c5c39 100644 (file)
@@ -26,7 +26,6 @@
 
 #include "usrp/usrp_prims.h"
 #include "usrp_commands.h"
-//#include "usrp_ids.h"
 #include <usb.h>
 #include <errno.h>
 #include <stdio.h>
@@ -60,8 +59,9 @@ usb_control_transfer (struct usb_dev_handle *udh, int request_type,
                       int request, int value, int index,
                       unsigned char *data, int length, unsigned int timeout)
 {
-  return usb_control_msg (udh, request_type, request, value, index,
-                          (char*) *data, length, (int) timeout);
+  return usb_control_msg (udh, request_type, 
+                          request, value, index,
+                          (char*) data, length, (int) timeout);
 
 }