thunderbolt: Move nfc_credits field to struct tb_path_hop
With the USB4 buffer allocation the number of credits (and non-flow credits) may be different depending on the router buffer allocation preferences. To allow this move the nfc_credits field to struct tb_path_hop. Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
This commit is contained in:
@@ -367,7 +367,7 @@ static void __tb_path_deallocate_nfc(struct tb_path *path, int first_hop)
|
||||
int i, res;
|
||||
for (i = first_hop; i < path->path_length; i++) {
|
||||
res = tb_port_add_nfc_credits(path->hops[i].in_port,
|
||||
-path->nfc_credits);
|
||||
-path->hops[i].nfc_credits);
|
||||
if (res)
|
||||
tb_port_warn(path->hops[i].in_port,
|
||||
"nfc credits deallocation failed for hop %d\n",
|
||||
@@ -502,7 +502,7 @@ int tb_path_activate(struct tb_path *path)
|
||||
/* Add non flow controlled credits. */
|
||||
for (i = path->path_length - 1; i >= 0; i--) {
|
||||
res = tb_port_add_nfc_credits(path->hops[i].in_port,
|
||||
path->nfc_credits);
|
||||
path->hops[i].nfc_credits);
|
||||
if (res) {
|
||||
__tb_path_deallocate_nfc(path, i);
|
||||
goto err;
|
||||
|
||||
Reference in New Issue
Block a user