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 <andrei.simion@xilinx.com>
This commit is contained in:
Andrei-Liviu Simion 2015-04-10 14:30:40 -07:00 committed by Nava kishore Manne
parent 7cdb022588
commit f8a61f7c7b

View file

@ -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;