Change in osmo-trx[master]: device: Drop unused numberRead/numberWritten APIs

Pau Espin Pedrol gerrit-no-reply at lists.osmocom.org
Fri May 3 18:26:15 UTC 2019


Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/13832 )

Change subject: device: Drop unused numberRead/numberWritten APIs
......................................................................

device: Drop unused numberRead/numberWritten APIs

It's really not used, so let's drop unused code and simplify work for
new to come device drivers implementation.

Change-Id: I0d18f9c2584771e2f7b3d5c6b016e764e02855ff
---
M Transceiver52M/device/lms/LMSDevice.cpp
M Transceiver52M/device/lms/LMSDevice.h
M Transceiver52M/device/radioDevice.h
M Transceiver52M/device/uhd/UHDDevice.cpp
M Transceiver52M/device/uhd/UHDDevice.h
M Transceiver52M/device/usrp1/USRPDevice.cpp
M Transceiver52M/device/usrp1/USRPDevice.h
7 files changed, 1 insertion(+), 33 deletions(-)

Approvals:
  Jenkins Builder: Verified
  Harald Welte: Looks good to me, approved
  tnt: Looks good to me, but someone else must approve



diff --git a/Transceiver52M/device/lms/LMSDevice.cpp b/Transceiver52M/device/lms/LMSDevice.cpp
index 7071589..be51a12 100644
--- a/Transceiver52M/device/lms/LMSDevice.cpp
+++ b/Transceiver52M/device/lms/LMSDevice.cpp
@@ -238,8 +238,6 @@
 		goto out_close;
 	}
 
-	samplesRead = 0;
-	samplesWritten = 0;
 	started = false;
 
 	return NORMAL;
@@ -630,8 +628,6 @@
 		thread_enable_cancel(true);
 	}
 
-	samplesRead += rc;
-
 	if (((TIMESTAMP) rx_metadata.timestamp) < timestamp)
 		rc = 0;
 
@@ -678,8 +674,6 @@
 		thread_enable_cancel(true);
 	}
 
-	samplesWritten += rc;
-
 	return rc;
 }
 
diff --git a/Transceiver52M/device/lms/LMSDevice.h b/Transceiver52M/device/lms/LMSDevice.h
index 225839d..b0ff03b 100644
--- a/Transceiver52M/device/lms/LMSDevice.h
+++ b/Transceiver52M/device/lms/LMSDevice.h
@@ -55,9 +55,6 @@
 
 	double actualSampleRate;	///< the actual USRP sampling rate
 
-	unsigned long long samplesRead;	///< number of samples read from LMS
-	unsigned long long samplesWritten;	///< number of samples sent to LMS
-
 	bool started;		///< flag indicates LMS has started
 	bool skipRx;		///< set if LMS is transmit-only.
 
@@ -203,12 +200,6 @@
 	inline double getSampleRate() {
 		return actualSampleRate;
 	}
-	inline double numberRead() {
-		return samplesRead;
-	}
-	inline double numberWritten() {
-		return samplesWritten;
-	}
 };
 
 #endif // _LMS_DEVICE_H_
diff --git a/Transceiver52M/device/radioDevice.h b/Transceiver52M/device/radioDevice.h
index 5d001fb..30e0f43 100644
--- a/Transceiver52M/device/radioDevice.h
+++ b/Transceiver52M/device/radioDevice.h
@@ -161,8 +161,6 @@
   virtual double getTxFreq(size_t chan = 0) = 0;
   virtual double getRxFreq(size_t chan = 0) = 0;
   virtual double getSampleRate()=0;
-  virtual double numberRead()=0;
-  virtual double numberWritten()=0;
 
   protected:
   size_t tx_sps, rx_sps;
diff --git a/Transceiver52M/device/uhd/UHDDevice.cpp b/Transceiver52M/device/uhd/UHDDevice.cpp
index 6214666..79e5855 100644
--- a/Transceiver52M/device/uhd/UHDDevice.cpp
+++ b/Transceiver52M/device/uhd/UHDDevice.cpp
@@ -165,7 +165,7 @@
 	  tx_gain_min(0.0), tx_gain_max(0.0),
 	  rx_gain_min(0.0), rx_gain_max(0.0),
 	  tx_spp(0), rx_spp(0),
-	  started(false), aligned(false), rx_pkt_cnt(0), drop_cnt(0),
+	  started(false), aligned(false), drop_cnt(0),
 	  prev_ts(0,0), ts_initial(0), ts_offset(0), async_event_thrd(NULL)
 {
 }
@@ -725,8 +725,6 @@
 						   metadata, 0.1, true);
 		thread_enable_cancel(true);
 
-		rx_pkt_cnt++;
-
 		// Check for errors
 		rc = check_rx_md_err(metadata, num_smpls);
 		switch (rc) {
diff --git a/Transceiver52M/device/uhd/UHDDevice.h b/Transceiver52M/device/uhd/UHDDevice.h
index 05a5914..0b57ba4 100644
--- a/Transceiver52M/device/uhd/UHDDevice.h
+++ b/Transceiver52M/device/uhd/UHDDevice.h
@@ -112,8 +112,6 @@
 	GSM::Time minLatency();
 
 	inline double getSampleRate() { return tx_rate; }
-	inline double numberRead() { return rx_pkt_cnt; }
-	inline double numberWritten() { return 0; }
 
 	/** Receive and process asynchronous message
 	    @return true if message received or false on timeout or error
@@ -146,7 +144,6 @@
 	bool started;
 	bool aligned;
 
-	size_t rx_pkt_cnt;
 	size_t drop_cnt;
 	uhd::time_spec_t prev_ts;
 
diff --git a/Transceiver52M/device/usrp1/USRPDevice.cpp b/Transceiver52M/device/usrp1/USRPDevice.cpp
index 2343fb6..b1d6c56 100644
--- a/Transceiver52M/device/usrp1/USRPDevice.cpp
+++ b/Transceiver52M/device/usrp1/USRPDevice.cpp
@@ -173,8 +173,6 @@
   m_dbTx = m_uTx->selected_subdev(txSubdevSpec);
   m_dbRx = m_uRx->selected_subdev(rxSubdevSpec);
 
-  samplesRead = 0;
-  samplesWritten = 0;
   started = false;
 
   return NORMAL;
@@ -505,7 +503,6 @@
     gettimeofday(&lastReadTime,NULL);
     firstRead = true;
   }
-  samplesRead += numSamples;
 
   return numSamples;
 #endif
@@ -555,14 +552,12 @@
   }
   m_uTx->write((const void*) outPkt,sizeof(uint32_t)*128*numPkts,NULL);
 
-  samplesWritten += len/2/sizeof(short);
   writeLock.unlock();
 
   return len/2/sizeof(short);
 #else
   int retVal = len;
   memcpy(loopbackBuffer+loopbackBufferSize,buf,sizeof(short)*2*len);
-  samplesWritten += retVal;
   loopbackBufferSize += retVal*2;
 
   return retVal;
diff --git a/Transceiver52M/device/usrp1/USRPDevice.h b/Transceiver52M/device/usrp1/USRPDevice.h
index 521d81d..c02e58c 100644
--- a/Transceiver52M/device/usrp1/USRPDevice.h
+++ b/Transceiver52M/device/usrp1/USRPDevice.h
@@ -51,9 +51,6 @@
   double actualSampleRate;	///< the actual USRP sampling rate
   unsigned int decimRate;	///< the USRP decimation rate
 
-  unsigned long long samplesRead;	///< number of samples read from USRP
-  unsigned long long samplesWritten;	///< number of samples sent to USRP
-
   bool started;			///< flag indicates USRP has started
 
   static const unsigned int currDataSize_log2 = 21;
@@ -201,8 +198,6 @@
   inline double getTxFreq(size_t chan = 0) { return 0; }
   inline double getRxFreq(size_t chan = 0) { return 0; }
   inline double getSampleRate() { return actualSampleRate; }
-  inline double numberRead() { return samplesRead; }
-  inline double numberWritten() { return samplesWritten; }
 };
 
 #endif // _USRP_DEVICE_H_

-- 
To view, visit https://gerrit.osmocom.org/13832
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I0d18f9c2584771e2f7b3d5c6b016e764e02855ff
Gerrit-Change-Number: 13832
Gerrit-PatchSet: 2
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: tnt <tnt at 246tNt.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190503/264cd9f8/attachment.html>


More information about the gerrit-log mailing list