Cleanup in preparation for merge
authorJohnathan Corgan <jcorgan@corganenterprises.com>
Thu, 1 Oct 2009 20:51:03 +0000 (13:51 -0700)
committerJohnathan Corgan <jcorgan@corganenterprises.com>
Thu, 1 Oct 2009 20:51:03 +0000 (13:51 -0700)
Fix trailing whitespace
Use standard include guards
Add more missing config.h includes
Fixup emacs mode strings
Update copyright notices

28 files changed:
config/usrp_fusb_tech.m4
config/usrp_libusb.m4
usrp/host/include/usrp/usrp_basic.h
usrp/host/include/usrp/usrp_prims.h
usrp/host/lib/db_dbs_rx.cc
usrp/host/lib/db_dtt754.cc
usrp/host/lib/db_dtt768.cc
usrp/host/lib/db_flexrf.cc
usrp/host/lib/db_flexrf_mimo.cc
usrp/host/lib/db_tv_rx.cc
usrp/host/lib/db_tv_rx_mimo.cc
usrp/host/lib/fusb.cc
usrp/host/lib/fusb.h
usrp/host/lib/fusb_libusb1.cc
usrp/host/lib/fusb_libusb1.h
usrp/host/lib/fusb_sysconfig_darwin.cc
usrp/host/lib/fusb_sysconfig_generic.cc
usrp/host/lib/fusb_sysconfig_libusb1.cc
usrp/host/lib/fusb_sysconfig_linux.cc
usrp/host/lib/fusb_sysconfig_ra_wb.cc
usrp/host/lib/fusb_sysconfig_win32.cc
usrp/host/lib/usrp_basic_common.cc
usrp/host/lib/usrp_basic_libusb0.cc
usrp/host/lib/usrp_basic_libusb1.cc
usrp/host/lib/usrp_prims_common.cc
usrp/host/lib/usrp_prims_libusb0.cc
usrp/host/lib/usrp_prims_libusb1.cc
usrp/host/lib/usrp_primsi.h

index cd08e18e598c663d8dd09fd8a17e46ae57c2861e..b99cf243207c43ba9210732e7346172d0c994a93 100644 (file)
@@ -1,5 +1,5 @@
 dnl
-dnl Copyright 2003,2008 Free Software Foundation, Inc.
+dnl Copyright 2003,2008,2009 Free Software Foundation, Inc.
 dnl 
 dnl This file is part of GNU Radio
 dnl 
index bbf94b82d4760c97b591f5aaa61a9de96f8c2ed0..673fa994d0e54600117cba975767e3479d423825 100644 (file)
@@ -18,9 +18,9 @@ dnl the Free Software Foundation, Inc., 51 Franklin Street,
 dnl Boston, MA 02110-1301, USA.
 
 # $1 is $req_libusb1:
-#   yes : check libusb-1.0 
-#   no  : check libusb-0.12 
-#   ""  : check libusb-0.12 
+#   yes : check libusb-1.0
+#   no  : check libusb-0.12
+#   ""  : check libusb-0.12
 
 
 AC_DEFUN([USRP_LIBUSB], [
index 063cb3c23e9fc804cdb0aa3a90d69b2779ce8090..c24630eb6f20ab79a147187c56784f8a75e534cd 100644 (file)
@@ -1,4 +1,4 @@
-/*  -*- Mode: C++ -*- */
+/*  -*- c++ -*- */
 /*
  * Copyright 2005,2009 Free Software Foundation, Inc.
  *
@@ -20,8 +20,8 @@
  * Boston, MA 02110-1301, USA.
  */
 
-#ifndef _USRP_BASIC_H_
-#define _USRP_BASIC_H_
+#ifndef INCLUDED_USRP_BASIC_H
+#define INCLUDED_USRP_BASIC_H
 
 #include <usrp/db_base.h>
 #include <usrp/usrp_slots.h>
@@ -990,4 +990,4 @@ public:
   bool stop ();
 };
 
-#endif
+#endif /* INCLUDED_USRP_BASIC_H */
index 042958653b1f4f6a906b939bb8500fcf4688e6ba..323287d02afdfa3d1725bd2ae6d7a51cc8fece0d 100644 (file)
@@ -1,4 +1,4 @@
-/*  -*- Mode: C++ -*- */
+/*  -*- c++ -*- */
 /*
  * Copyright 2005,2009 Free Software Foundation, Inc.
  *
@@ -20,8 +20,8 @@
  * Boston, MA 02110-1301, USA.
  */
 
-#ifndef _USRP_PRIMS_H_
-#define _USRP_PRIMS_H_
+#ifndef INCLUDED_USRP_PRIMS_H
+#define INCLUDED_USRP_PRIMS_H
 
 #include <usrp/usrp_slots.h>
 #include <usrp/libusb_types.h>
@@ -40,15 +40,15 @@ enum usrp_load_status_t { ULS_ERROR = 0, ULS_OK, ULS_ALREADY_LOADED };
  *
  * Probe busses and devices. The argument is ignored and defaults to NULL.
  * Safe to call more than once.
- * 
+ *
  * libusb-1.0
  *
  * If an location to a libusb_context is passed in, create and write in the new
  * context. If no argument is provided, initialize libusb with the default
- * (NULL) context. 
+ * (NULL) context.
  *
  * Generally _not_ safe to call more than once with non-NULL argument since a
- * new context will be created each time. 
+ * new context will be created each time.
  */
 
 void usrp_one_time_init (libusb_context **ctx = NULL);
@@ -295,4 +295,4 @@ bool usrp_write_dboard_offsets (libusb_device_handle *udh, int slot_id,
  */
 std::string usrp_serial_number(libusb_device_handle *udh);
 
-#endif /* _USRP_PRIMS_H_ */
+#endif /* INCLUDED_USRP_PRIMS_H */
index 98b05d0bf89972a0bf237c4dd7e5e958335b8f1b..7fe8c4951f46e8b30c2ad4ff2534b7c51692b316 100644 (file)
@@ -1,5 +1,5 @@
 //
-// Copyright 2008 Free Software Foundation, Inc.
+// Copyright 2008,2009 Free Software Foundation, Inc.
 // 
 // This file is part of GNU Radio
 // 
index 9634c610d7e2fa929fa897f03e54582d26f8ec6c..9ced705e4afeeb048d8c038800f70eb3a3c6a832 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 //
-// Copyright 2008 Free Software Foundation, Inc.
+// Copyright 2008,2009 Free Software Foundation, Inc.
 // 
 // This file is part of GNU Radio
 // 
index 68e3077231ba22eeb6bbc20431793fefe49202d2..0dfe1a8f346e00a64ea8ea516f40daf925f983d7 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 //
-// Copyright 2008 Free Software Foundation, Inc.
+// Copyright 2008,2009 Free Software Foundation, Inc.
 // 
 // This file is part of GNU Radio
 // 
index f6b44834b01a67d60fa5573f7773f1325b220074..85ef79bd38652d8dee07cd76553629cf1b9210e2 100644 (file)
@@ -1,5 +1,5 @@
 //
-// Copyright 2008 Free Software Foundation, Inc.
+// Copyright 2008,2009 Free Software Foundation, Inc.
 // 
 // This file is part of GNU Radio
 // 
index e2db5cd10d04c34999d9f904960778f8b62249da..29bbbd58f321511162c888183148e69a9bee20f7 100644 (file)
  * Boston, MA 02110-1301, USA.
  */ 
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include <usrp/db_flexrf_mimo.h>
 #include <fpga_regs_standard.h>
 #include <fpga_regs_common.h>
index 4b28e9bc11d2fce202edd30866d6e86f9fc3dfb5..1822479e1b0361b7ec626392c51c4eebfe2ca3ae 100644 (file)
@@ -1,5 +1,5 @@
 //
-// Copyright 2008 Free Software Foundation, Inc.
+// Copyright 2008,2009 Free Software Foundation, Inc.
 // 
 // This file is part of GNU Radio
 // 
index d0dcb52a9f4162ac01a81da1599694df4ab25a01..0964c5d8b18024761759cdde5a9aefa0dd9711ac 100644 (file)
@@ -1,5 +1,5 @@
 //
-// Copyright 2008 Free Software Foundation, Inc.
+// Copyright 2008,2009 Free Software Foundation, Inc.
 // 
 // This file is part of GNU Radio
 // 
 // the Free Software Foundation, Inc., 51 Franklin Street,
 // Boston, MA 02110-1301, USA.
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include <usrp/db_tv_rx_mimo.h>
 
 db_tv_rx_mimo::db_tv_rx_mimo(usrp_basic_sptr usrp, int which,
index c14d7c1fbb5ed80f74a62a795bc6dcc94472ea6a..2a597b67ce17f6ae73446fb05840a66e1ab8dd90 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2003 Free Software Foundation, Inc.
+ * Copyright 2003,2009 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
index 5e3f3aacb225791dd2b893657240fb41e7831f93..538ae1ae0d64c0461529fd57ede6f64d124945a9 100644 (file)
@@ -1,4 +1,4 @@
-/*  -*- Mode: C++ -*- */
+/*  -*- c++ -*- */
 /*
  * Copyright 2005,2009 Free Software Foundation, Inc.
  *
index 0171235de8ea084c94eb1b461a9d3950ee6c17fc..4846f51a5618dacc54b7f4ef15ecc6df69ce759b 100644 (file)
@@ -1,19 +1,19 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2003 Free Software Foundation, Inc.
- * 
+ * Copyright 2003,2009 Free Software Foundation, Inc.
+ *
  * This file is part of GNU Radio
- * 
+ *
  * GNU Radio is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 3, or (at your option)
  * any later version.
- * 
+ *
  * GNU Radio is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with GNU Radio; see the file COPYING.  If not, write to
  * the Free Software Foundation, Inc., 51 Franklin Street,
@@ -35,9 +35,9 @@
 #include <errno.h>
 #include <string.h>
 
-#define MINIMIZE_TX_BUFFERING true 
+#define MINIMIZE_TX_BUFFERING true
 
-static const int MAX_BLOCK_SIZE = fusb_sysconfig::max_block_size(); 
+static const int MAX_BLOCK_SIZE = fusb_sysconfig::max_block_size();
 static const int DEFAULT_BLOCK_SIZE = MAX_BLOCK_SIZE;
 static const int DEFAULT_BUFFER_SIZE = 4 * (1L << 20);  // 4 MB endpoint
 static const int LIBUSB_TIMEOUT = 0;                   // no timeout
@@ -49,7 +49,7 @@ lut_get_ephandle (libusb_transfer *lut)
 }
 
 // ------------------------------------------------------------------------
-//     libusb_transfer allocation, deallocation, and callback 
+//     libusb_transfer allocation, deallocation, and callback
 // ------------------------------------------------------------------------
 
 static void
@@ -60,14 +60,14 @@ free_lut (libusb_transfer *lut)
   if (lut->endpoint & 0x80)
     delete [] ((unsigned char *) lut->buffer);
 
-  libusb_free_transfer(lut); 
+  libusb_free_transfer(lut);
 
 }
 
 /*
  * The callback means the libusb_transfer is completed whether sent, cancelled,
  * or failed. Move the libusb_transfer from the pending list to the
- * completed list. If the cancel is from the destructor then free the 
+ * completed list. If the cancel is from the destructor then free the
  * transfer instead; normally this won't happen since all endpoints should be
  * destroyed first leaving the pending list empty.
  */
@@ -77,7 +77,7 @@ generic_callback(struct libusb_transfer *lut)
 {
 
   // Fish out devhandle from endpoint
-  fusb_devhandle_libusb1* dev_handle = 
+  fusb_devhandle_libusb1* dev_handle =
     lut_get_ephandle(lut)->get_fusb_devhandle_libusb1();
 
   dev_handle->pending_remove(lut);
@@ -87,10 +87,10 @@ generic_callback(struct libusb_transfer *lut)
     free_lut (lut);
     return;
   }
-  
+
   lut_get_ephandle(lut)->completed_list_add(lut);
 
-} 
+}
 
 static libusb_transfer*
 alloc_lut (fusb_ephandle_libusb1 *self, int buffer_length, int endpoint,
@@ -110,11 +110,11 @@ alloc_lut (fusb_ephandle_libusb1 *self, int buffer_length, int endpoint,
 
   // Load the libusb_transfer for bulk transfer
   libusb_fill_bulk_transfer (lut,              // transfer
-                             dev_handle,        // dev_handle 
+                             dev_handle,        // dev_handle
                              endpoint,         // endpoint
                              write_buffer,     // buffer
                              buffer_length,    // length
-                             generic_callback, // callback 
+                             generic_callback, // callback
                              self,             // user_data
                              LIBUSB_TIMEOUT);  // timeout
 
@@ -129,7 +129,7 @@ fusb_devhandle_libusb1::fusb_devhandle_libusb1 (libusb_device_handle *udh,
                                                 libusb_context *ctx)
   : fusb_devhandle (udh), d_ctx (ctx), d_teardown (false)
 {
-  // that's it 
+  // that's it
 }
 
 fusb_devhandle_libusb1::~fusb_devhandle_libusb1 ()
@@ -160,10 +160,10 @@ fusb_devhandle_libusb1::make_ephandle (int endpoint, bool input_p,
 }
 
 /*
- * devhandle list manipulators 
+ * devhandle list manipulators
  */
 
-void 
+void
 fusb_devhandle_libusb1::pending_add (libusb_transfer *lut)
 {
   d_pending_rqsts.push_back (lut);
@@ -201,7 +201,7 @@ fusb_devhandle_libusb1::pending_get ()
 }
 
 /*
- * Match libusb_tranfer with the pending list and erase 
+ * Match libusb_tranfer with the pending list and erase
  * Return true if found, false otherwise
  */
 
@@ -241,11 +241,11 @@ fusb_devhandle_libusb1::_submit_lut (libusb_transfer *lut)
 }
 
 /*
- * Attempt to cancel any pending libusb_transfer transactions. 
+ * Attempt to cancel any pending libusb_transfer transactions.
  * Return true in the absence of errors, which does not mean that the transfer
  * is cancelled. Cancellation can be checked after the callback is fired off
- * by libusb. 
- */ 
+ * by libusb.
+ */
 
 bool
 fusb_devhandle_libusb1::_cancel_lut (libusb_transfer *lut)
@@ -287,12 +287,12 @@ fusb_devhandle_libusb1::_reap (bool ok_to_block_p)
     tv.tv_sec = 0;
     tv.tv_usec =  0;
   }
+
   if ((ret = libusb_handle_events_timeout(d_ctx, &tv)) < 0) {
     fprintf (stderr, "fusb::_reap libusb_handle_events() %i\n", ret);
     return false;
   }
-  
+
   return true;
 }
 
@@ -300,9 +300,9 @@ void
 fusb_devhandle_libusb1::_wait_for_completion ()
 {
 
-  while (!d_pending_rqsts.empty ()) 
-    if (!_reap(true)) 
-      break; 
+  while (!d_pending_rqsts.empty ())
+    if (!_reap(true))
+      break;
 
 }
 
@@ -339,7 +339,7 @@ fusb_ephandle_libusb1::fusb_ephandle_libusb1 (fusb_devhandle_libusb1 *dh,
     fprintf(stderr, "fusb_ephandle_libusb1::ctor: d_block_size = %d  d_nblocks = %d\n",
       d_block_size, d_nblocks);
 
-  // allocate libusb_transfers 
+  // allocate libusb_transfers
   for (int i = 0; i < d_nblocks; i++)
     d_free_list.push_back (alloc_lut (this, d_block_size, d_endpoint,
                                       d_input_p, d_write_buffer, d_devhandle));
@@ -391,7 +391,7 @@ fusb_ephandle_libusb1::start ()
 }
 
 /*
- * Cancel all transfers in progress or pending and return to initial state 
+ * Cancel all transfers in progress or pending and return to initial state
  */
 
 bool
@@ -434,7 +434,7 @@ fusb_ephandle_libusb1::stop ()
 }
 
 // ------------------------------------------------------------------------
-//                     routines for writing    
+//                     routines for writing
 // ------------------------------------------------------------------------
 
 #if (MINIMIZE_TX_BUFFERING)
@@ -444,7 +444,7 @@ fusb_ephandle_libusb1::write (const void *buffer, int nbytes)
 {
   if (!d_started)      // doesn't matter here, but keeps semantics constant
     return -1;
-  
+
   if (d_input_p)
     return -1;
 
@@ -465,7 +465,7 @@ fusb_ephandle_libusb1::write (const void *buffer, int nbytes)
 
     n += m;
     src += m;
-   
+
     if (!submit_lut(lut))
       return -1;
 
@@ -547,11 +547,11 @@ fusb_ephandle_libusb1::reap_complete_writes ()
   while ((lut = completed_list_get ()) != 0) {
 
     // Check for any errors or short writes that were reporetd in the transfer.
-    // libusb1 sets status, actual_length. 
+    // libusb1 sets status, actual_length.
 
-    if (lut->status != LIBUSB_TRANSFER_COMPLETED) { 
+    if (lut->status != LIBUSB_TRANSFER_COMPLETED) {
       fprintf (stderr, "fusb: (status %d) \n", lut->status );
-    } 
+    }
     else if (lut->actual_length != lut->length){
       fprintf (stderr, "fusb: short write xfer: %d != %d\n",
                lut->actual_length, lut->length);
@@ -568,7 +568,7 @@ fusb_ephandle_libusb1::wait_for_completion ()
 }
 
 // ------------------------------------------------------------------------
-//                     routines for reading    
+//                     routines for reading
 // ------------------------------------------------------------------------
 
 int
@@ -619,12 +619,12 @@ fusb_ephandle_libusb1::reload_read_buffer ()
 
   while (1) {
 
-    while ((lut = completed_list_get ()) == 0 ) 
+    while ((lut = completed_list_get ()) == 0 )
       if (!d_devhandle->_reap(true))
-        return false; 
+        return false;
 
     if (lut->status != LIBUSB_TRANSFER_COMPLETED) {
-      fprintf (stderr, "fust: (rd status %d) %s\n", lut->status, 
+      fprintf (stderr, "fust: (rd status %d) %s\n", lut->status,
                strerror (-lut->status));
       lut->actual_length = 0;
       free_list_add (lut);
@@ -641,7 +641,7 @@ fusb_ephandle_libusb1::reload_read_buffer ()
 
 
 /*
- * ephandle list manipulation  
+ * ephandle list manipulation
  */
 
 
index 4bc49aafbda8db3ef416f5768628044b71c93330..c0e3736bd52cad11abf3947057b17898ac135153 100644 (file)
@@ -1,19 +1,19 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2003 Free Software Foundation, Inc.
- * 
+ * Copyright 2003,2009 Free Software Foundation, Inc.
+ *
  * This file is part of GNU Radio
- * 
+ *
  * GNU Radio is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 3, or (at your option)
  * any later version.
- * 
+ *
  * GNU Radio is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with GNU Radio; see the file COPYING.  If not, write to
  * the Free Software Foundation, Inc., 51 Franklin Street,
@@ -85,8 +85,8 @@ private:
   libusb_transfer *get_write_work_in_progress ();
   void reap_complete_writes ();
   bool reload_read_buffer ();
-  bool submit_lut (libusb_transfer *lut); 
+  bool submit_lut (libusb_transfer *lut);
+
 public:
   // CREATORS
   fusb_ephandle_libusb1 (fusb_devhandle_libusb1 *dh, int endpoint, bool input_p,
@@ -121,7 +121,7 @@ public:
   struct libusb_transfer *free_list_get ();
   struct libusb_transfer *completed_list_get ();
 
-  // accessor to work from callback context 
+  // accessor to work from callback context
   fusb_devhandle_libusb1* get_fusb_devhandle_libusb1 () const {
     return d_devhandle;
   }
index 3d1f656cd3878b2670adf35becf1bf8b2657737f..68dd6481532aa19fe16cb093694238006bdd2d33 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2003 Free Software Foundation, Inc.
+ * Copyright 2003,2009 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
index 271ba6e3abc9a11098b1de9c9928d990dea99319..e0986510c3ec4ffeb9e81989346fc34c59e1c426 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2003 Free Software Foundation, Inc.
+ * Copyright 2003,2009 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
index a005f540d242dfa4bb97f9e6dc5e6a2b94595f75..46daf561a7bd581a09a0bdd29284eac419379dde 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2003 Free Software Foundation, Inc.
+ * Copyright 2003,2009 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
index c2e453881eebd5a68204d38ac01643f7965996e9..e33b90ba42b05fc78cfef94123277bf3d7f37d21 100644 (file)
@@ -1,19 +1,19 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2003 Free Software Foundation, Inc.
- * 
+ * Copyright 2003,2009 Free Software Foundation, Inc.
+ *
  * This file is part of GNU Radio
- * 
+ *
  * GNU Radio is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 3, or (at your option)
  * any later version.
- * 
+ *
  * GNU Radio is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with GNU Radio; see the file COPYING.  If not, write to
  * the Free Software Foundation, Inc., 51 Franklin Street,
@@ -30,7 +30,7 @@ static const int FUSB_BUFFER_SIZE   =   1 * (1L << 20); // 1MB
 fusb_devhandle *
 fusb_sysconfig::make_devhandle (usb_dev_handle *udh, libusb_context *ctx)
 {
-  return new fusb_devhandle_linux (udh); 
+  return new fusb_devhandle_linux (udh);
 }
 
 int fusb_sysconfig::max_block_size ()
index 561ab22234501b741470b24bd5e74737f06460dc..c527e3099ec7f71d2f5d89c3508f7bead2dadf49 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2003,2006 Free Software Foundation, Inc.
+ * Copyright 2003,2006,2009 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
index a0d1405431ffdb9fe337807ea5871bad5074eecb..fb4be88292e4a3120a9e926d68dcad8c7df97518 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2003,2005 Free Software Foundation, Inc.
+ * Copyright 2003,2005,2009 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
index 91417dbe7a9a5e43615b93da3f97f4f648f209bc..721301dec4f2dd4874b8ecfec87404e9b79cd0de 100644 (file)
@@ -1,19 +1,19 @@
 /* -*- c++ -*- */
 /*
  * Copyright 2003,2004,2008,2009 Free Software Foundation, Inc.
- * 
+ *
  * This file is part of GNU Radio
- * 
+ *
  * GNU Radio is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 3, or (at your option)
  * any later version.
- * 
+ *
  * GNU Radio is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with GNU Radio; see the file COPYING.  If not, write to
  * the Free Software Foundation, Inc., 51 Franklin Street,
@@ -84,7 +84,7 @@ open_tx_interface (libusb_device *dev)
 
 // Given:
 //   CLKIN = 64 MHz
-//   CLKSEL pin = high 
+//   CLKSEL pin = high
 //
 // These settings give us:
 //   CLKOUT1 = CLKIN = 64 MHz
@@ -107,8 +107,8 @@ usrp_basic::shutdown_daughterboards()
   // nuke d'boards before we close down USB in ~usrp_basic
   // shutdown() will do any board shutdown while the USRP can still
   // be talked to
-  for(size_t i = 0; i < d_db.size(); i++) 
-    for(size_t j = 0; j < d_db[i].size(); j++) 
+  for(size_t i = 0; i < d_db.size(); i++)
+    for(size_t j = 0; j < d_db[i].size(); j++)
       d_db[i][j]->shutdown();
 }
 
@@ -122,7 +122,7 @@ usrp_basic::init_db(usrp_basic_sptr u)
   d_db[1] = instantiate_dbs(d_dbid[1], u, 1);
 }
 
-std::vector<db_base_sptr> 
+std::vector<db_base_sptr>
 usrp_basic::db(int which_side)
 {
   which_side &= 0x1;   // clamp it to avoid any reporting any errors
@@ -307,7 +307,7 @@ usrp_basic::set_adc_buffer_bypass (int which_adc, bool bypass)
 bool
 usrp_basic::set_dc_offset_cl_enable(int bits, int mask)
 {
-  return _write_fpga_reg(FR_DC_OFFSET_CL_EN, 
+  return _write_fpga_reg(FR_DC_OFFSET_CL_EN,
                         (d_fpga_shadows[FR_DC_OFFSET_CL_EN] & ~mask) | (bits & mask));
 }
 
@@ -399,7 +399,7 @@ usrp_basic::_read_spi (int optional_header, int enables, int format, int len)
 {
   if (len <= 0)
     return "";
-  
+
   char buf[len];
 
   if (!usrp_spi_read (d_udh, optional_header, enables, format, buf, len))
@@ -741,7 +741,7 @@ usrp_basic_rx::usrp_basic_rx (int which_board, int fusb_block_size, int fusb_nbl
 
   if (fusb_nblocks < 0)
     throw std::out_of_range ("usrp_basic_rx: invalid fusb_nblocks");
-  
+
   if (fusb_block_size == 0)
     fusb_block_size = fusb_sysconfig::default_block_size();
 
@@ -799,7 +799,7 @@ usrp_basic_rx::start ()
     fprintf (stderr, "usrp_basic_rx: set_rx_enable failed\n");
     return false;
   }
+
   return true;
 }
 
@@ -827,7 +827,7 @@ usrp_basic_rx::make (int which_board, int fusb_block_size, int fusb_nblocks,
                     const std::string firmware_filename)
 {
   usrp_basic_rx *u = 0;
-  
+
   try {
     u = new usrp_basic_rx (which_board, fusb_block_size, fusb_nblocks,
                           fpga_filename, firmware_filename);
@@ -860,10 +860,10 @@ int
 usrp_basic_rx::read (void *buf, int len, bool *overrun)
 {
   int  r;
-  
+
   if (overrun)
     *overrun = false;
-  
+
   if (len < 0 || (len % 512) != 0){
     fprintf (stderr, "usrp_basic_rx::read: invalid length = %d\n", len);
     return -1;
@@ -890,7 +890,7 @@ usrp_basic_rx::read (void *buf, int len, bool *overrun)
       fprintf (stderr, "usrp_basic_rx: usrp_check_rx_overrun failed\n");
     }
   }
-    
+
   return r;
 }
 
@@ -940,21 +940,21 @@ usrp_basic_rx::probe_rx_slots (bool verbose)
       _write_fpga_reg (slot_id_to_oe_reg(slot_id), (0xffff << 16) | eeprom.oe);
       _write_fpga_reg (slot_id_to_io_reg(slot_id), (0xffff << 16) | 0x0000);
       break;
-      
+
     case UDBE_NO_EEPROM:
       d_dbid[i] = -1;
       msg = "<none>";
       _write_fpga_reg (slot_id_to_oe_reg(slot_id), (0xffff << 16) | 0x0000);
       _write_fpga_reg (slot_id_to_io_reg(slot_id), (0xffff << 16) | 0x0000);
       break;
-      
+
     case UDBE_INVALID_EEPROM:
       d_dbid[i] = -2;
       msg = "Invalid EEPROM contents";
       _write_fpga_reg (slot_id_to_oe_reg(slot_id), (0xffff << 16) | 0x0000);
       _write_fpga_reg (slot_id_to_io_reg(slot_id), (0xffff << 16) | 0x0000);
       break;
-      
+
     case UDBE_BAD_SLOT:
     default:
       assert (0);
@@ -1144,7 +1144,7 @@ usrp_basic_tx::usrp_basic_tx (int which_board, int fusb_block_size, int fusb_nbl
 
   if (fusb_nblocks < 0)
     throw std::out_of_range ("usrp_basic_rx: invalid fusb_nblocks");
-  
+
   if (fusb_block_size == 0)
     fusb_block_size = FUSB_BLOCK_SIZE;
 
@@ -1194,7 +1194,7 @@ usrp_basic_tx::start ()
     fprintf (stderr, "usrp_basic_tx: set_tx_enable failed\n");
     return false;
   }
-  
+
   if (!d_ephandle->start ()){
     fprintf (stderr, "usrp_basic_tx: failed to start end point streaming");
     return false;
@@ -1227,7 +1227,7 @@ usrp_basic_tx::make (int which_board, int fusb_block_size, int fusb_nblocks,
                     const std::string firmware_filename)
 {
   usrp_basic_tx *u = 0;
-  
+
   try {
     u = new usrp_basic_tx (which_board, fusb_block_size, fusb_nblocks,
                           fpga_filename, firmware_filename);
@@ -1260,10 +1260,10 @@ int
 usrp_basic_tx::write (const void *buf, int len, bool *underrun)
 {
   int  r;
-  
+
   if (underrun)
     *underrun = false;
-  
+
   if (len < 0 || (len % 512) != 0){
     fprintf (stderr, "usrp_basic_tx::write: invalid length = %d\n", len);
     return -1;
@@ -1272,7 +1272,7 @@ usrp_basic_tx::write (const void *buf, int len, bool *underrun)
   r = d_ephandle->write (buf, len);
   if (r > 0)
     d_bytes_seen += r;
-    
+
   /*
    * In many cases, the FPGA reports an tx underrun right after we
    * enable the Tx path.  If this is our first write, check for the
@@ -1347,21 +1347,21 @@ usrp_basic_tx::probe_tx_slots (bool verbose)
       _write_fpga_reg (slot_id_to_oe_reg(slot_id), (0xffff << 16) | eeprom.oe);
       _write_fpga_reg (slot_id_to_io_reg(slot_id), (0xffff << 16) | 0x0000);
       break;
-      
+
     case UDBE_NO_EEPROM:
       d_dbid[i] = -1;
       msg = "<none>";
       _write_fpga_reg (slot_id_to_oe_reg(slot_id), (0xffff << 16) | 0x0000);
       _write_fpga_reg (slot_id_to_io_reg(slot_id), (0xffff << 16) | 0x0000);
       break;
-      
+
     case UDBE_INVALID_EEPROM:
       d_dbid[i] = -2;
       msg = "Invalid EEPROM contents";
       _write_fpga_reg (slot_id_to_oe_reg(slot_id), (0xffff << 16) | 0x0000);
       _write_fpga_reg (slot_id_to_io_reg(slot_id), (0xffff << 16) | 0x0000);
       break;
-      
+
     case UDBE_BAD_SLOT:
     default:
       assert (0);
index 6e41585bb3b492e0c404eddadf26aba20a340305..21748058084811a8f613c5aa18163bacae857ac8 100644 (file)
@@ -1,19 +1,19 @@
 /* -*- c++ -*- */
 /*
  * Copyright 2003,2004,2008,2009 Free Software Foundation, Inc.
- * 
+ *
  * This file is part of GNU Radio
- * 
+ *
  * GNU Radio is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 3, or (at your option)
  * any later version.
- * 
+ *
  * GNU Radio is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with GNU Radio; see the file COPYING.  If not, write to
  * the Free Software Foundation, Inc., 51 Franklin Street,
@@ -56,7 +56,7 @@ static const double POLLING_INTERVAL = 0.1;   // seconds
 
 // Given:
 //   CLKIN = 64 MHz
-//   CLKSEL pin = high 
+//   CLKSEL pin = high
 //
 //   CLKOUT1 = CLKIN = 64 MHz
 //   CLKOUT2 = CLKIN = 64 MHz
@@ -73,7 +73,7 @@ static unsigned char common_regs[] = {
 };
 
 
-usrp_basic::usrp_basic (int which_board, 
+usrp_basic::usrp_basic (int which_board,
                        struct usb_dev_handle *
                        open_interface (struct usb_device *dev),
                        const std::string fpga_filename,
@@ -87,7 +87,7 @@ usrp_basic::usrp_basic (int which_board,
    * SWAG: Scientific Wild Ass Guess.
    *
    * d_usb_data_rate is used only to determine how often to poll for over- and under-runs.
-   * We defualt it to 1/2  of our best case.  Classes derived from usrp_basic (e.g., 
+   * We defualt it to 1/2  of our best case.  Classes derived from usrp_basic (e.g.,
    * usrp_standard_tx and usrp_standard_rx) call set_usb_data_rate() to tell us the
    * actual rate.  This doesn't change our throughput, that's determined by the signal
    * processing code in the FPGA (which we know nothing about), and the system limits
index 64cff6078649765cd9ec93ada4fbf60b1d263ce5..35009dc662407979adcdc44fe025bf50f098f263 100644 (file)
@@ -1,19 +1,19 @@
 /* -*- c++ -*- */
 /*
  * Copyright 2003,2004,2008,2009 Free Software Foundation, Inc.
- * 
+ *
  * This file is part of GNU Radio
- * 
+ *
  * GNU Radio is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 3, or (at your option)
  * any later version.
- * 
+ *
  * GNU Radio is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with GNU Radio; see the file COPYING.  If not, write to
  * the Free Software Foundation, Inc., 51 Franklin Street,
@@ -57,7 +57,7 @@ static const double POLLING_INTERVAL = 0.1;   // seconds
 
 // Given:
 //   CLKIN = 64 MHz
-//   CLKSEL pin = high 
+//   CLKSEL pin = high
 //
 // These settings give us:
 //   CLKOUT1 = CLKIN = 64 MHz
@@ -74,7 +74,7 @@ static unsigned char common_regs[] = {
   REG_AUX_ADC_CLK,     AUX_ADC_CLK_CLK_OVER_4
 };
 
-usrp_basic::usrp_basic (int which_board, 
+usrp_basic::usrp_basic (int which_board,
                        struct libusb_device_handle *
                        open_interface (struct libusb_device *dev),
                        const std::string fpga_filename,
@@ -88,7 +88,7 @@ usrp_basic::usrp_basic (int which_board,
    * SWAG: Scientific Wild Ass Guess.
    *
    * d_usb_data_rate is used only to determine how often to poll for over- and under-runs.
-   * We defualt it to 1/2  of our best case.  Classes derived from usrp_basic (e.g., 
+   * We defualt it to 1/2  of our best case.  Classes derived from usrp_basic (e.g.,
    * usrp_standard_tx and usrp_standard_rx) call set_usb_data_rate() to tell us the
    * actual rate.  This doesn't change our throughput, that's determined by the signal
    * processing code in the FPGA (which we know nothing about), and the system limits
index b687a18e731ea96273318d193799291a207b9ffa..70e90d7fed44cb93e97c47a83beb5f0a3219de1d 100644 (file)
@@ -1,19 +1,19 @@
 /* -*- c++ -*- */
 /*
  * Copyright 2003,2004,2006,2009 Free Software Foundation, Inc.
- * 
+ *
  * This file is part of GNU Radio
- * 
+ *
  * GNU Radio is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 3, or (at your option)
  * any later version.
- * 
+ *
  * GNU Radio is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with GNU Radio; see the file COPYING.  If not, write to
  * the Free Software Foundation, Inc., 51 Franklin Street,
@@ -255,7 +255,7 @@ _usrp_load_firmware (libusb_device_handle *udh, const char *filename,
   if (!reset_cpu (udh, true))  // hold CPU in reset while loading firmware
     goto fail;
 
-  
+
   char s[1024];
   int length;
   int addr;
@@ -347,7 +347,7 @@ _usrp_load_fpga (libusb_device_handle *udh, const char *filename,
 
   if (write_cmd (udh, VRQ_FPGA_LOAD, 0, FL_BEGIN, 0, 0) != 0)
     goto fail;
-  
+
   while ((n = fread (buf, 1, sizeof (buf), fp)) > 0){
     if (write_cmd (udh, VRQ_FPGA_LOAD, 0, FL_XFER, buf, n) != n)
       goto fail;
@@ -355,7 +355,7 @@ _usrp_load_fpga (libusb_device_handle *udh, const char *filename,
 
   if (write_cmd (udh, VRQ_FPGA_LOAD, 0, FL_END, 0, 0) != 0)
     goto fail;
-  
+
   fclose (fp);
 
   if (!usrp_set_hash (udh, FPGA_HASH_SLOT, hash))
@@ -368,7 +368,7 @@ _usrp_load_fpga (libusb_device_handle *udh, const char *filename,
   usrp_set_fpga_reset (udh, 0);                // fpga out of master reset
 
   // now these commands will work
-  
+
   ok &= usrp_set_fpga_tx_enable (udh, 0);
   ok &= usrp_set_fpga_rx_enable (udh, 0);
 
@@ -402,7 +402,7 @@ _usrp_load_fpga (libusb_device_handle *udh, const char *filename,
 
 // ----------------------------------------------------------------
 
-bool 
+bool
 usrp_set_led (libusb_device_handle *udh, int which, bool on)
 {
   int r = write_cmd (udh, VRQ_SET_LED, on, which, 0, 0);
@@ -421,7 +421,7 @@ usrp_set_hash (libusb_device_handle *udh, int which,
                                 (unsigned char *) hash, USRP_HASH_SIZE, 1000);
   return r == USRP_HASH_SIZE;
 }
-  
+
 bool
 usrp_get_hash (libusb_device_handle *udh, int which,
                unsigned char hash[USRP_HASH_SIZE])
@@ -454,7 +454,7 @@ usrp1_fpga_write (libusb_device_handle *udh,
   buf[1] = (value >> 16) & 0xff;
   buf[2] = (value >>  8) & 0xff;
   buf[3] = (value >>  0) & 0xff;
-  
+
   return usrp_spi_write (udh, 0x00 | (regno & 0x7f),
                         SPI_ENABLE_FPGA,
                         SPI_FMT_MSB | SPI_FMT_HDR_1,
@@ -503,31 +503,31 @@ usrp_read_fpga_reg (libusb_device_handle *udh, int reg, int *value)
   }
 }
 
-bool 
+bool
 usrp_set_fpga_reset (libusb_device_handle *udh, bool on)
 {
   return usrp_set_switch (udh, VRQ_FPGA_SET_RESET, on);
 }
 
-bool 
+bool
 usrp_set_fpga_tx_enable (libusb_device_handle *udh, bool on)
 {
   return usrp_set_switch (udh, VRQ_FPGA_SET_TX_ENABLE, on);
 }
 
-bool 
+bool
 usrp_set_fpga_rx_enable (libusb_device_handle *udh, bool on)
 {
   return usrp_set_switch (udh, VRQ_FPGA_SET_RX_ENABLE, on);
 }
 
-bool 
+bool
 usrp_set_fpga_tx_reset (libusb_device_handle *udh, bool on)
 {
   return usrp_set_switch (udh, VRQ_FPGA_SET_TX_RESET, on);
 }
 
-bool 
+bool
 usrp_set_fpga_rx_reset (libusb_device_handle *udh, bool on)
 {
   return usrp_set_switch (udh, VRQ_FPGA_SET_RX_RESET, on);
@@ -550,7 +550,7 @@ compute_hash (const char *filename, unsigned char hash[USRP_HASH_SIZE])
   }
   int r = md5_stream (fp, hash);
   fclose (fp);
-  
+
   return r == 0;
 }
 
@@ -565,7 +565,7 @@ usrp_conditionally_load_something (libusb_device_handle *udh,
 {
   unsigned char file_hash[USRP_HASH_SIZE];
   unsigned char usrp_hash[USRP_HASH_SIZE];
-  
+
   if (access (filename, R_OK) != 0){
     perror (filename);
     return ULS_ERROR;
@@ -677,13 +677,13 @@ usrp_load_firmware_nth (int nth, const char *filename, bool force, libusb_contex
 
   case ULS_OK:
     // we loaded firmware successfully.
+
     // It's highly likely that the board will renumerate (simulate a
     // disconnect/reconnect sequence), invalidating our current
     // handle.
 
     // FIXME.  Turn this into a loop that rescans until we refind ourselves
-   
+
     struct timespec     t;      // delay for 1 second
     t.tv_sec = 2;
     t.tv_nsec = 0;
@@ -702,12 +702,12 @@ load_status_msg (usrp_load_status_t s, const char *type, const char *filename)
 {
   char *e = getenv("USRP_VERBOSE");
   bool verbose = e != 0;
-  
+
   switch (s){
   case ULS_ERROR:
     fprintf (stderr, "usrp: failed to load %s %s.\n", type, filename);
     break;
-    
+
   case ULS_ALREADY_LOADED:
     if (verbose)
       fprintf (stderr, "usrp: %s %s already loaded.\n", type, filename);
@@ -772,7 +772,7 @@ usrp_load_standard_bits (int nth, bool force,
   libusb_device_handle *udh = open_nth_cmd_interface (nth, ctx);
   if (udh == 0)
     return false;
-  
+
   s = usrp_load_fpga (udh, filename, force);
   usrp_close_interface (udh);
   load_status_msg (s, "fpga bitstream", filename);
@@ -789,7 +789,7 @@ _usrp_get_status (libusb_device_handle *udh, int which, bool *trouble)
 {
   unsigned char        status;
   *trouble = true;
-  
+
   if (write_cmd (udh, VRQ_GET_STATUS, 0, which,
                 &status, sizeof (status)) != sizeof (status))
     return false;
@@ -874,7 +874,7 @@ usrp_9862_write (libusb_device_handle *udh, int which_codec,
   unsigned char buf[1];
 
   buf[0] = value;
-  
+
   return usrp_spi_write (udh, 0x00 | (regno & 0x3f),
                         which_codec == 0 ? SPI_ENABLE_CODEC_A : SPI_ENABLE_CODEC_B,
                         SPI_FMT_MSB | SPI_FMT_HDR_1,
@@ -952,7 +952,7 @@ usrp_eeprom_write (libusb_device_handle *udh, int i2c_addr,
 {
   unsigned char cmd[2];
   const unsigned char *p = (unsigned char *) buf;
-  
+
   // The simplest thing that could possibly work:
   //   all writes are single byte writes.
   //
@@ -967,7 +967,7 @@ usrp_eeprom_write (libusb_device_handle *udh, int i2c_addr,
     if (!r)
       return false;
   }
-  
+
   return true;
 }
 
@@ -994,14 +994,14 @@ usrp_eeprom_read (libusb_device_handle *udh, int i2c_addr,
   }
   return true;
 }
+
 // ----------------------------------------------------------------
 
 static bool
 slot_to_codec (int slot, int *which_codec)
 {
   *which_codec = 0;
-  
+
   switch (slot){
   case SLOT_TX_A:
   case SLOT_RX_A:
@@ -1038,7 +1038,7 @@ usrp_write_aux_dac (libusb_device_handle *udh, int slot,
                    int which_dac, int value)
 {
   int which_codec;
-  
+
   if (!slot_to_codec (slot, &which_codec))
     return false;
 
@@ -1048,7 +1048,7 @@ usrp_write_aux_dac (libusb_device_handle *udh, int slot,
   }
 
   value &= 0x0fff;     // mask to 12-bits
-  
+
   if (which_dac == 3){
     // dac 3 is really 12-bits.  Use value as is.
     bool r = true;
@@ -1057,7 +1057,7 @@ usrp_write_aux_dac (libusb_device_handle *udh, int slot,
     return r;
   }
   else {
-    // dac 0, 1, and 2 are really 8 bits.  
+    // dac 0, 1, and 2 are really 8 bits.
     value = value >> 4;                // shift value appropriately
     return usrp_9862_write (udh, which_codec, 36 + which_dac, value);
   }
@@ -1084,7 +1084,7 @@ usrp_read_aux_adc (libusb_device_handle *udh, int slot,
     | AUX_ADC_CTRL_REFSEL_B;           // on chip reference
 
   int  rd_reg = 26;    // base address of two regs to read for result
-  
+
   // program the ADC mux bits
   if (tx_slot_p (slot))
     aux_adc_control |= AUX_ADC_CTRL_SELECT_A2 | AUX_ADC_CTRL_SELECT_B2;
@@ -1092,7 +1092,7 @@ usrp_read_aux_adc (libusb_device_handle *udh, int slot,
     rd_reg += 2;
     aux_adc_control |= AUX_ADC_CTRL_SELECT_A1 | AUX_ADC_CTRL_SELECT_B1;
   }
-  
+
   // I'm not sure if we can set the mux and issue a start conversion
   // in the same cycle, so let's do them one at a time.
 
@@ -1116,7 +1116,7 @@ usrp_read_aux_adc (libusb_device_handle *udh, int slot,
 
   if (r)
     *value = ((v_hi << 2) | ((v_lo >> 6) & 0x3)) << 2; // format as 12-bit
-  
+
   return r;
 }
 
index 23d278fe8673aec6218467523c07dd3afd887b93..7a82eabfaf634180397215cee664d7d07509bfb1 100644 (file)
@@ -1,19 +1,19 @@
 /* -*- c++ -*- */
 /*
  * Copyright 2003,2004,2006,2009 Free Software Foundation, Inc.
- * 
+ *
  * This file is part of GNU Radio
- * 
+ *
  * GNU Radio is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 3, or (at your option)
  * any later version.
- * 
+ *
  * GNU Radio is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with GNU Radio; see the file COPYING.  If not, write to
  * the Free Software Foundation, Inc., 51 Franklin Street,
@@ -109,7 +109,7 @@ usrp_find_device (int nth, bool fx2_ok_p, libusb_context *ctx)
   int   n_found = 0;
 
   usrp_one_time_init ();
-  
+
   p = usb_get_busses();
   while (p != NULL){
     q = p->devices;
@@ -147,7 +147,7 @@ usrp_open_interface (struct usb_device *dev, int interface, int altinterface)
   // Appears to be required for libusb-win32 and Cygwin -- dew 09/20/06
   if (usb_set_configuration (udh, 1) < 0){
     /*
-     * Ignore this error.  
+     * Ignore this error.
      *
      * Seems that something changed in drivers/usb/core/devio.c:proc_setconfig such that
      * it returns -EBUSY if _any_ of the interfaces of a device are open.
index 0b514e97f2de795d113d49b80deb47914d986ae8..cf1f8fe0771bf8ed7ca3137c8f4038df52cbced4 100644 (file)
@@ -1,19 +1,19 @@
 /* -*- c++ -*- */
 /*
  * Copyright 2003,2004,2006,2009 Free Software Foundation, Inc.
- * 
+ *
  * This file is part of GNU Radio
- * 
+ *
  * GNU Radio is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 3, or (at your option)
  * any later version.
- * 
+ *
  * GNU Radio is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with GNU Radio; see the file COPYING.  If not, write to
  * the Free Software Foundation, Inc., 51 Franklin Street,
index 83cc31aee3df21a42d73b469ada2ee6d69be78df..b1cf7263a80f627a31ba7f5556e0b1a6944523a0 100644 (file)
@@ -1,19 +1,19 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2003 Free Software Foundation, Inc.
- * 
+ * Copyright 2003,2009 Free Software Foundation, Inc.
+ *
  * This file is part of GNU Radio
- * 
+ *
  * GNU Radio is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 3, or (at your option)
  * any later version.
- * 
+ *
  * GNU Radio is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with GNU Radio; see the file COPYING.  If not, write to
  * the Free Software Foundation, Inc., 51 Franklin Street,
@@ -30,7 +30,7 @@
 #include "usrp/usrp_prims.h"
 
 /*
- * Internal functions 
+ * Internal functions
  */
 
 libusb_device_handle *
@@ -40,7 +40,7 @@ int write_cmd (libusb_device_handle *udh, int request, int value, int index,
                unsigned char *bytes, int len);
 
 /*
- * Compatibility functions 
+ * Compatibility functions
  */
 
 libusb_device *_get_usb_device (libusb_device_handle *udh);