Disable support for tvrx rev 2 on usrp2. There are only a few of these in existence.
[debian/gnuradio] / usrp2 / host / lib / control.h
index 2c042f0cf78e9946d9243255598992bfd5a07b75..46ce791ea3019915432ca498b639db143b4c2343 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2008 Free Software Foundation, Inc.
+ * Copyright 2008,2009 Free Software Foundation, Inc.
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -19,7 +19,7 @@
 #ifndef INCLUDED_CONTROL_H
 #define INCLUDED_CONTROL_H
 
-#include <omnithread.h>
+#include <gnuradio/omnithread.h>
 #include <usrp2_eth_packet.h>
 
 namespace usrp2 {
@@ -33,27 +33,35 @@ namespace usrp2 {
   /*!
    * OP_CONFIG_RX_V2 command packet
    */
-  struct op_config_rx_v2_cmd 
+  struct op_config_rx_v2_cmd
   {
     u2_eth_packet_t   h;
     op_config_rx_v2_t op;
     op_generic_t      eop;
   };
 
-  struct op_start_rx_streaming_cmd 
+  struct op_start_rx_streaming_cmd
   {
     u2_eth_packet_t        h;
     op_start_rx_streaming_t op;
     op_generic_t           eop;
   };
-    
+
+  struct op_sync_and_start_rx_streaming_cmd
+  {
+    u2_eth_packet_t        h;
+    op_generic_t            sync_op;
+    op_start_rx_streaming_t rx_op;
+    op_generic_t           eop;
+  };
+
   struct op_stop_rx_cmd {
     u2_eth_packet_t h;
     op_generic_t    op;
     op_generic_t    eop;
   };
 
-  struct op_config_tx_v2_cmd 
+  struct op_config_tx_v2_cmd
   {
     u2_eth_packet_t   h;
     op_config_tx_v2_t op;
@@ -67,7 +75,7 @@ namespace usrp2 {
     op_generic_t      eop;
   };
 
-  struct op_burn_mac_addr_cmd 
+  struct op_burn_mac_addr_cmd
   {
     u2_eth_packet_t    h;
     op_burn_mac_addr_t op;
@@ -93,19 +101,40 @@ namespace usrp2 {
     // eop must be dynamically written here
   };
 
+  struct op_freq_cmd {
+    u2_eth_packet_t h;
+    op_freq_t       op;
+    op_generic_t    eop;
+  };
+
+  struct op_gpio_cmd {
+    u2_eth_packet_t h;
+    op_gpio_t       op;
+    op_generic_t    eop;
+  };
+
+  struct op_gpio_set_sels_cmd {
+    u2_eth_packet_t h;
+    op_gpio_set_sels_t op;
+    op_generic_t    eop;
+  };
+
   /*!
    * Control mechanism to allow API calls to block waiting for reply packets
-   */    
+   */
   class pending_reply
   {
   private:
     unsigned int    d_rid;
-    omni_mutex      d_mutex;
-    omni_condition  d_cond;
     void           *d_buffer;
     size_t         d_len;
 
-  public:  
+    // d_mutex is used with d_cond and also protects d_complete
+    omni_mutex      d_mutex;
+    omni_condition  d_cond;
+    bool           d_complete;
+
+  public:
     /*!
      * Construct a pending reply from the reply ID, response packet
      * buffer, and buffer length.
@@ -122,12 +151,12 @@ namespace usrp2 {
      * Returns: 1 = ok, reply packet in buffer
      *          0 = timeout
      */
-    int wait(double secs);
+    int wait_for_completion(double secs);
 
     /*!
      * Allows creating thread to resume after copying reply into buffer
      */
-    void signal();
+    void notify_completion();
 
     /*!
      * Retrieve pending reply ID
@@ -144,7 +173,7 @@ namespace usrp2 {
      */
     size_t len() const { return d_len; }
   };
-  
+
 } // namespace usrp2
 
 #endif /* INCLUDED_CONTROL_H */