Skip to content

Commit

Permalink
clkmgr: Remove ptp4l_id.
Browse files Browse the repository at this point in the history
Remove ptp4l_id as this parameter is no longer required.

Signed-off-by: Song Yoong Siang <yoong.siang.song@intel.com>
  • Loading branch information
yoongsiang2 committed Feb 24, 2025
1 parent dfa54d7 commit bb5821d
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 48 deletions.
10 changes: 0 additions & 10 deletions clkmgr/client/client_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,16 +138,6 @@ void ClientState::set_sessionId(sessionId_t sessionId)
m_sessionId = sessionId;
}

void ClientState::set_ptp4l_id(uint8_t ptp4l_id)
{
m_ptp4l_id = ptp4l_id;
}

uint8_t ClientState::get_ptp4l_id() const
{
return m_ptp4l_id;
}

void ClientState::set_last_notification_time(const timespec &newTime)
{
last_notification_time = newTime;
Expand Down
13 changes: 0 additions & 13 deletions clkmgr/client/client_state.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ class ClientState
std::atomic_bool subscribed{false}; /**< Subscription status */
sessionId_t m_sessionId = InvalidSessionId; /**< Session ID */
TransportClientId clientID = {}; /**< Client ID */
uint8_t m_ptp4l_id = 0; /**< PTP4L ID */
Event_state eventState = {}; /**< Event state */
Event_count eventStateCount = {}; /**< Event count */
ClkMgrSubscription eventSub = {}; /**< Event subscription */
Expand Down Expand Up @@ -154,18 +153,6 @@ class ClientState
* @param[in] sessionId The new session ID to set.
*/
void set_sessionId(sessionId_t sessionId);

/**
* Set the ptp4l ID.
* @param[in] ptp4l_id The new ptp4l ID to set.
*/
void set_ptp4l_id(uint8_t ptp4l_id);

/**
* Get the value of the ptp4l ID.
* @return the ptp4l ID.
*/
uint8_t get_ptp4l_id() const;
};

__CLKMGR_NAMESPACE_END
Expand Down
4 changes: 0 additions & 4 deletions clkmgr/client/connect_msg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,9 @@ bool ClientConnectMessage::initMessage()

PARSE_RXBUFFER_TYPE(ClientConnectMessage::parseBuffer)
{
ptp_event data = {};
PrintDebug("[ClientConnectMessage]::parseBuffer ");
if(!CommonConnectMessage::parseBuffer(LxContext))
return false;
if(!PARSE_RX(FIELD, data.ptp4l_id, LxContext))
return false;
currentClientState->set_ptp4l_id(data.ptp4l_id);
return true;
}

Expand Down
2 changes: 0 additions & 2 deletions clkmgr/common/ptp_event.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ struct ptp_event {
uint8_t gm_identity[8]; /* Grandmaster clock ID */
bool as_capable; /* 802@.1AS Capable */
bool synced_to_primary_clock;
uint8_t ptp4l_id;
int64_t chrony_offset;
uint32_t chrony_reference_id;
int64_t polling_interval;
Expand All @@ -35,7 +34,6 @@ struct client_ptp_event {
int64_t master_offset_low;
int64_t master_offset_high;
uint8_t gm_identity[8]; /* Grandmaster clock ID */
uint8_t ptp4l_id;
bool as_capable; /* 802@.1AS Capable */
bool synced_to_primary_clock;
bool master_offset_in_range;
Expand Down
8 changes: 0 additions & 8 deletions clkmgr/proxy/connect_msg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,6 @@ PROCESS_MESSAGE_TYPE(ProxyConnectMessage::processMessage)
{
sessionId_t newSessionId = this->getc_sessionId();
PrintDebug("Processing proxy connect message");
/* Check whether there is ptp4l available */
if(!clockEvent.ptp4l_id) {
PrintError("ptp4l_id is not available.");
return false;
}
if(newSessionId != InvalidSessionId) {
auto clientSession = Client::GetClientSession(newSessionId);
if(clientSession)
Expand All @@ -99,8 +94,5 @@ BUILD_TXBUFFER_TYPE(ProxyConnectMessage::makeBuffer) const
PrintDebug("[ProxyConnectMessage]::makeBuffer");
if(!CommonConnectMessage::makeBuffer(TxContext))
return false;
/* Add ptp4l_id here */
if(!WRITE_TX(FIELD, clockEvent.ptp4l_id, TxContext))
return false;
return true;
}
1 change: 0 additions & 1 deletion clkmgr/proxy/connect_ptp4l.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,6 @@ void *ptp4l_event_loop(void *arg)
*/
int Connect::connect(uint8_t transport_specific)
{
clockEvent.ptp4l_id = 1;
const char *uds_address = "/var/run/ptp4l";
if(!sku.setDefSelfAddress() || !sku.init() ||
!sku.setPeerAddress(uds_address))
Expand Down
10 changes: 0 additions & 10 deletions clkmgr/utest/client_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,13 +147,3 @@ TEST(ClientStateTest, sessionId)
cstate.set_sessionId(0x3f);
EXPECT_EQ(cstate.get_sessionId(), 0x3f);
}

// Tests PTP ID
// void set_ptp4l_id(uint8_t ptp4l_id)
// uint8_t get_ptp4l_id() const
TEST(ClientStateTest, ptp4l_id)
{
ClientState cstate;
cstate.set_ptp4l_id(0x55);
EXPECT_EQ(cstate.get_ptp4l_id(), 0x55);
}

0 comments on commit bb5821d

Please sign in to comment.