From f8a61f7c7b95be7bf908316d0dbf4b413cdd8944 Mon Sep 17 00:00:00 2001 From: Andrei-Liviu Simion Date: Fri, 10 Apr 2015 14:30:40 -0700 Subject: [PATCH] dp: rx: mst: Keep the internal port number the same as the index. When setting the configuration of a port, always keep the port number of the port structure to the same value as the index of the structure's index in the port structure array. This simplifies functions that operate on the port structure since they don't need to search each port structure in the array for the port number, the port number is known from the index. Note: The existence of the port number member in the port structure is required since the TX populates this structure when receiving LINK_ADDRESS sideband messages. Signed-off-by: Andrei-Liviu Simion --- XilinxProcessorIPLib/drivers/dp/src/xdp_mst.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/XilinxProcessorIPLib/drivers/dp/src/xdp_mst.c b/XilinxProcessorIPLib/drivers/dp/src/xdp_mst.c index 3c77c282..ad1957c3 100644 --- a/XilinxProcessorIPLib/drivers/dp/src/xdp_mst.c +++ b/XilinxProcessorIPLib/drivers/dp/src/xdp_mst.c @@ -2436,9 +2436,12 @@ void XDp_RxMstSetPort(XDp *InstancePtr, u8 PortNum, Port = &InstancePtr->RxInstance.Topology.LinkAddressInfo. PortDetails[PortNum]; + /* Keep internal port number the same as the index. */ + Port->PortNum = PortNum; + + /* Copy port details into the structure. */ Port->InputPort = PortDetails->InputPort; Port->PeerDeviceType = PortDetails->PeerDeviceType; - Port->PortNum = PortDetails->PortNum; Port->MsgCapStatus = PortDetails->MsgCapStatus; Port->DpDevPlugStatus = PortDetails->DpDevPlugStatus; Port->LegacyDevPlugStatus = PortDetails->LegacyDevPlugStatus;