thunderbolt: Add functions for allocating and releasing HopIDs

Each port has a separate path configuration space that is used for
finding the next hop (switch) in the path. HopID is an index to this
configuration space. HopIDs 0 - 7 are reserved by the protocol.

In order to get next available HopID for each direction we provide two
pairs of helper functions that can be used to allocate and release
HopIDs for a given port.

While there remove obsolete TODO comment.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
This commit is contained in:
Mika Westerberg
2017-02-19 16:57:27 +02:00
parent 93f36ade5b
commit 0b2863ac3c
3 changed files with 98 additions and 3 deletions

View File

@@ -27,8 +27,7 @@
* use this ring for anything else.
*/
#define RING_E2E_UNUSED_HOPID 2
/* HopIDs 0-7 are reserved by the Thunderbolt protocol */
#define RING_FIRST_USABLE_HOPID 8
#define RING_FIRST_USABLE_HOPID TB_PATH_MIN_HOPID
/*
* Minimal number of vectors when we use MSI-X. Two for control channel