]> git.baikalelectronics.ru Git - kernel.git/commit
thunderbolt: Allocate ring HopID automatically if requested
authorMika Westerberg <mika.westerberg@linux.intel.com>
Mon, 2 Oct 2017 10:38:43 +0000 (13:38 +0300)
committerDavid S. Miller <davem@davemloft.net>
Mon, 2 Oct 2017 18:24:41 +0000 (11:24 -0700)
commitb280d808123fe360057696668e96e55bb578b906
tree625bedcec2f68c641e98b36afa510e5467a88f3f
parent9678eb4fa92cb7a0feddc3298d43d928255c7716
thunderbolt: Allocate ring HopID automatically if requested

Thunderbolt services should not care which HopID (ring) they use for
sending and receiving packets over the high-speed DMA path, so make
tb_ring_alloc_rx() and tb_ring_alloc_tx() accept negative HopID. This
means that the NHI will allocate next available HopID for the caller
automatically.

These HopIDs will be allocated from the range which is not reserved for
the Thunderbolt protocol (8 .. hop_count - 1).

The allocated HopID can be retrieved from ring->hop field after the ring
has been allocated successfully if needed.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: Michael Jamet <michael.jamet@intel.com>
Reviewed-by: Yehezkel Bernat <yehezkel.bernat@intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/thunderbolt/nhi.c