Skip to content

Commit

Permalink
Remove unused code
Browse files Browse the repository at this point in the history
Signed-off-by: Sabeel Ansari <sabeel.ansari@intel.com>
  • Loading branch information
5abeel committed Jan 31, 2025
1 parent c548c79 commit 7f03c57
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 49 deletions.
42 changes: 0 additions & 42 deletions stratum/hal/lib/tdi/es2k/es2k_virtual_port_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,32 +44,6 @@ namespace tdi {

Es2kVirtualPortManager* Es2kVirtualPortManager::singleton_ = nullptr;

#if 0
namespace {

// A callback function executed in SDE port state change thread context.
ipu_status_t sde_port_status_callback(ipu_dev_id_t device,
ipu_dev_port_t dev_port, bool up,
void* cookie) {
absl::Time timestamp = absl::Now();
Es2kVirtualPortManager* es2k_port_manager =
Es2kVirtualPortManager::GetSingleton();
if (!es2k_port_manager) {
LOG(ERROR)
<< "Es2kVirtualPortManager singleton instance is not initialized.";
return IPU_INTERNAL_ERROR;
}
// Forward the event.
auto status =
es2k_port_manager->OnPortStatusEvent(device, dev_port, up, timestamp);

return status.ok() ? IPU_SUCCESS : IPU_INTERNAL_ERROR;
}

} // namespace

#endif

Es2kVirtualPortManager* Es2kVirtualPortManager::CreateSingleton() {
absl::WriterMutexLock l(&init_lock_);
if (!singleton_) {
Expand Down Expand Up @@ -139,22 +113,6 @@ ::util::StatusOr<uint64> Es2kVirtualPortManager::GetMacAddress(
return swapped_mac;
}

::util::Status Es2kVirtualPortManager::OnPortStatusEvent(int device, int port,
bool up,
absl::Time timestamp) {
// Create PortStatusEvent message.
PortState state = up ? PORT_STATE_UP : PORT_STATE_DOWN;
PortStatusEvent event = {device, port, state, timestamp};

{
absl::ReaderMutexLock l(&port_status_event_writer_lock_);
if (!port_status_event_writer_) {
return ::util::OkStatus();
}
return port_status_event_writer_->Write(event, kWriteTimeout);
}
}

} // namespace tdi
} // namespace hal
} // namespace stratum
7 changes: 0 additions & 7 deletions stratum/hal/lib/tdi/es2k/es2k_virtual_port_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,6 @@ class Es2kVirtualPortManager : public TdiVirtualPortManager {
// Return the singleton instance to be used in the SDE callbacks.
static Es2kVirtualPortManager* GetSingleton() LOCKS_EXCLUDED(init_lock_);

// Called whenever a port status event is received from SDK. It forwards the
// port status event to the module who registered a callback by calling
// RegisterPortStatusEventWriter().
::util::Status OnPortStatusEvent(int device, int dev_port, bool up,
absl::Time timestamp)
LOCKS_EXCLUDED(port_status_event_writer_lock_);

protected:
// The singleton instance.
static Es2kVirtualPortManager* singleton_ GUARDED_BY(init_lock_);
Expand Down

0 comments on commit 7f03c57

Please sign in to comment.