Skip to content

Commit 6f3ed98

Browse files
aborzeszwesteri
authored andcommitted
thunderbolt: Update tunnel.c function documentation
Make tunnel.c function documentation compliant with current kernel-doc standards. No functional changes. Signed-off-by: Alan Borzeszkowski <alan.borzeszkowski@linux.intel.com> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
1 parent 371c237 commit 6f3ed98

1 file changed

Lines changed: 53 additions & 32 deletions

File tree

drivers/thunderbolt/tunnel.c

Lines changed: 53 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ static inline unsigned int tb_usable_credits(const struct tb_port *port)
121121
* @port: Lane adapter to check
122122
* @max_dp_streams: If non-%NULL stores maximum number of simultaneous DP
123123
* streams possible through this lane adapter
124+
*
125+
* Return: Number of available credits.
124126
*/
125127
static unsigned int tb_available_credits(const struct tb_port *port,
126128
size_t *max_dp_streams)
@@ -415,8 +417,9 @@ static int tb_pci_init_path(struct tb_path *path)
415417
* @alloc_hopid: Allocate HopIDs from visited ports
416418
*
417419
* If @down adapter is active, follows the tunnel to the PCIe upstream
418-
* adapter and back. Returns the discovered tunnel or %NULL if there was
419-
* no tunnel.
420+
* adapter and back.
421+
*
422+
* Return: Pointer to &struct tb_tunnel or %NULL if there was no tunnel.
420423
*/
421424
struct tb_tunnel *tb_tunnel_discover_pci(struct tb *tb, struct tb_port *down,
422425
bool alloc_hopid)
@@ -496,7 +499,7 @@ struct tb_tunnel *tb_tunnel_discover_pci(struct tb *tb, struct tb_port *down,
496499
* Allocate a PCI tunnel. The ports must be of type TB_TYPE_PCIE_UP and
497500
* TB_TYPE_PCIE_DOWN.
498501
*
499-
* Return: Returns a tb_tunnel on success or NULL on failure.
502+
* Return: Pointer to @struct tb_tunnel or %NULL on failure.
500503
*/
501504
struct tb_tunnel *tb_tunnel_alloc_pci(struct tb *tb, struct tb_port *up,
502505
struct tb_port *down)
@@ -543,9 +546,12 @@ struct tb_tunnel *tb_tunnel_alloc_pci(struct tb *tb, struct tb_port *up,
543546
*
544547
* Can be called to any connected lane 0 adapter to find out how much
545548
* bandwidth needs to be left in reserve for possible PCIe bulk traffic.
546-
* Returns true if there is something to be reserved and writes the
547-
* amount to @reserved_down/@reserved_up. Otherwise returns false and
548-
* does not touch the parameters.
549+
*
550+
* Return:
551+
* * %true - If there is something to be reserved. Writes the amount to
552+
* @reserved_down/@reserved_up.
553+
* * %false - Nothing to be reserved. Leaves @reserved_down/@reserved_up
554+
* unmodified.
549555
*/
550556
bool tb_tunnel_reserved_pci(struct tb_port *port, int *reserved_up,
551557
int *reserved_down)
@@ -1151,7 +1157,8 @@ static int tb_dp_activate(struct tb_tunnel *tunnel, bool active)
11511157
* @tunnel: DP tunnel to check
11521158
* @max_bw_rounded: Maximum bandwidth in Mb/s rounded up to the next granularity
11531159
*
1154-
* Returns maximum possible bandwidth for this tunnel in Mb/s.
1160+
* Return: Maximum possible bandwidth for this tunnel in Mb/s, negative errno
1161+
* in case of failure.
11551162
*/
11561163
static int tb_dp_bandwidth_mode_maximum_bandwidth(struct tb_tunnel *tunnel,
11571164
int *max_bw_rounded)
@@ -1547,7 +1554,7 @@ static void tb_dp_dump(struct tb_tunnel *tunnel)
15471554
* and back. Returns the discovered tunnel or %NULL if there was no
15481555
* tunnel.
15491556
*
1550-
* Return: DP tunnel or %NULL if no tunnel found.
1557+
* Return: Pointer to &struct tb_tunnel or %NULL if no tunnel found.
15511558
*/
15521559
struct tb_tunnel *tb_tunnel_discover_dp(struct tb *tb, struct tb_port *in,
15531560
bool alloc_hopid)
@@ -1648,7 +1655,7 @@ struct tb_tunnel *tb_tunnel_discover_dp(struct tb *tb, struct tb_port *in,
16481655
* successful (or if it returns %false there was some sort of issue).
16491656
* The @callback is called without @tb->lock held.
16501657
*
1651-
* Return: Returns a tb_tunnel on success or &NULL on failure.
1658+
* Return: Pointer to @struct tb_tunnel or %NULL in case of failure.
16521659
*/
16531660
struct tb_tunnel *tb_tunnel_alloc_dp(struct tb *tb, struct tb_port *in,
16541661
struct tb_port *out, int link_nr,
@@ -1861,7 +1868,7 @@ static void tb_dma_destroy(struct tb_tunnel *tunnel)
18611868
* @receive_ring: NHI ring number used to receive packets from the
18621869
* other domain. Set to %-1 if RX path is not needed.
18631870
*
1864-
* Return: Returns a tb_tunnel on success or NULL on failure.
1871+
* Return: Pointer to @struct tb_tunnel or %NULL in case of failure.
18651872
*/
18661873
struct tb_tunnel *tb_tunnel_alloc_dma(struct tb *tb, struct tb_port *nhi,
18671874
struct tb_port *dst, int transmit_path,
@@ -1938,7 +1945,8 @@ struct tb_tunnel *tb_tunnel_alloc_dma(struct tb *tb, struct tb_port *nhi,
19381945
*
19391946
* This function can be used to match specific DMA tunnel, if there are
19401947
* multiple DMA tunnels going through the same XDomain connection.
1941-
* Returns true if there is match and false otherwise.
1948+
*
1949+
* Return: %true if there is a match, %false otherwise.
19421950
*/
19431951
bool tb_tunnel_match_dma(const struct tb_tunnel *tunnel, int transmit_path,
19441952
int transmit_ring, int receive_path, int receive_ring)
@@ -2160,8 +2168,9 @@ static void tb_usb3_init_path(struct tb_path *path)
21602168
* @alloc_hopid: Allocate HopIDs from visited ports
21612169
*
21622170
* If @down adapter is active, follows the tunnel to the USB3 upstream
2163-
* adapter and back. Returns the discovered tunnel or %NULL if there was
2164-
* no tunnel.
2171+
* adapter and back.
2172+
*
2173+
* Return: Pointer to &struct tb_tunnel or %NULL if there was no tunnel.
21652174
*/
21662175
struct tb_tunnel *tb_tunnel_discover_usb3(struct tb *tb, struct tb_port *down,
21672176
bool alloc_hopid)
@@ -2266,7 +2275,7 @@ struct tb_tunnel *tb_tunnel_discover_usb3(struct tb *tb, struct tb_port *down,
22662275
* Allocate an USB3 tunnel. The ports must be of type @TB_TYPE_USB3_UP and
22672276
* @TB_TYPE_USB3_DOWN.
22682277
*
2269-
* Return: Returns a tb_tunnel on success or %NULL on failure.
2278+
* Return: Pointer to @struct tb_tunnel or %NULL in case of failure.
22702279
*/
22712280
struct tb_tunnel *tb_tunnel_alloc_usb3(struct tb *tb, struct tb_port *up,
22722281
struct tb_port *down, int max_up,
@@ -2337,6 +2346,8 @@ struct tb_tunnel *tb_tunnel_alloc_usb3(struct tb *tb, struct tb_port *up,
23372346
/**
23382347
* tb_tunnel_is_invalid - check whether an activated path is still valid
23392348
* @tunnel: Tunnel to check
2349+
*
2350+
* Return: %true if path is valid, %false otherwise.
23402351
*/
23412352
bool tb_tunnel_is_invalid(struct tb_tunnel *tunnel)
23422353
{
@@ -2355,10 +2366,11 @@ bool tb_tunnel_is_invalid(struct tb_tunnel *tunnel)
23552366
* tb_tunnel_activate() - activate a tunnel
23562367
* @tunnel: Tunnel to activate
23572368
*
2358-
* Return: 0 on success and negative errno in case if failure.
2359-
* Specifically returns %-EINPROGRESS if the tunnel activation is still
2360-
* in progress (that's for DP tunnels to complete DPRX capabilities
2361-
* read).
2369+
* Return:
2370+
* * %0 - On success.
2371+
* * %-EINPROGRESS - If the tunnel activation is still in progress (that's
2372+
* for DP tunnels to complete DPRX capabilities read).
2373+
* * Negative errno - Another error occurred.
23622374
*/
23632375
int tb_tunnel_activate(struct tb_tunnel *tunnel)
23642376
{
@@ -2438,8 +2450,8 @@ void tb_tunnel_deactivate(struct tb_tunnel *tunnel)
24382450
* @tunnel: Tunnel to check
24392451
* @port: Port to check
24402452
*
2441-
* Returns true if @tunnel goes through @port (direction does not matter),
2442-
* false otherwise.
2453+
* Return: %true if @tunnel goes through @port (direction does not matter),
2454+
* %false otherwise.
24432455
*/
24442456
bool tb_tunnel_port_on_path(const struct tb_tunnel *tunnel,
24452457
const struct tb_port *port)
@@ -2469,9 +2481,11 @@ static bool tb_tunnel_is_activated(const struct tb_tunnel *tunnel)
24692481
* @max_up: Maximum upstream bandwidth in Mb/s
24702482
* @max_down: Maximum downstream bandwidth in Mb/s
24712483
*
2472-
* Returns maximum possible bandwidth this tunnel can go if not limited
2473-
* by other bandwidth clients. If the tunnel does not support this
2474-
* returns %-EOPNOTSUPP.
2484+
* Return:
2485+
* * Maximum possible bandwidth this tunnel can support if not
2486+
* limited by other bandwidth clients.
2487+
* * %-EOPNOTSUPP - If the tunnel does not support this function.
2488+
* * %-ENOTCONN - If the tunnel is not active.
24752489
*/
24762490
int tb_tunnel_maximum_bandwidth(struct tb_tunnel *tunnel, int *max_up,
24772491
int *max_down)
@@ -2491,8 +2505,12 @@ int tb_tunnel_maximum_bandwidth(struct tb_tunnel *tunnel, int *max_up,
24912505
* @allocated_down: Currently allocated downstream bandwidth in Mb/s is
24922506
* stored here
24932507
*
2494-
* Returns the bandwidth allocated for the tunnel. This may be higher
2495-
* than what the tunnel actually consumes.
2508+
* Return:
2509+
* * Bandwidth allocated for the tunnel. This may be higher than what the
2510+
* tunnel actually consumes.
2511+
* * %-EOPNOTSUPP - If the tunnel does not support this function.
2512+
* * %-ENOTCONN - If the tunnel is not active.
2513+
* * Negative errno - Another error occurred.
24962514
*/
24972515
int tb_tunnel_allocated_bandwidth(struct tb_tunnel *tunnel, int *allocated_up,
24982516
int *allocated_down)
@@ -2512,10 +2530,12 @@ int tb_tunnel_allocated_bandwidth(struct tb_tunnel *tunnel, int *allocated_up,
25122530
* @alloc_up: New upstream bandwidth in Mb/s
25132531
* @alloc_down: New downstream bandwidth in Mb/s
25142532
*
2515-
* Tries to change tunnel bandwidth allocation. If succeeds returns %0
2516-
* and updates @alloc_up and @alloc_down to that was actually allocated
2517-
* (it may not be the same as passed originally). Returns negative errno
2518-
* in case of failure.
2533+
* Tries to change tunnel bandwidth allocation.
2534+
*
2535+
* Return:
2536+
* * %0 - On success. Updates @alloc_up and @alloc_down to values that were
2537+
* actually allocated (it may not be the same as passed originally).
2538+
* * Negative errno - In case of failure.
25192539
*/
25202540
int tb_tunnel_alloc_bandwidth(struct tb_tunnel *tunnel, int *alloc_up,
25212541
int *alloc_down)
@@ -2546,8 +2566,9 @@ int tb_tunnel_alloc_bandwidth(struct tb_tunnel *tunnel, int *alloc_up,
25462566
* Can be %NULL.
25472567
*
25482568
* Stores the amount of isochronous bandwidth @tunnel consumes in
2549-
* @consumed_up and @consumed_down. In case of success returns %0,
2550-
* negative errno otherwise.
2569+
* @consumed_up and @consumed_down.
2570+
*
2571+
* Return: %0 on success, negative errno otherwise.
25512572
*/
25522573
int tb_tunnel_consumed_bandwidth(struct tb_tunnel *tunnel, int *consumed_up,
25532574
int *consumed_down)
@@ -2585,7 +2606,7 @@ int tb_tunnel_consumed_bandwidth(struct tb_tunnel *tunnel, int *consumed_up,
25852606
* If tunnel supports dynamic bandwidth management (USB3 tunnels at the
25862607
* moment) this function makes it to release all the unused bandwidth.
25872608
*
2588-
* Returns %0 in case of success and negative errno otherwise.
2609+
* Return: %0 on success, negative errno otherwise.
25892610
*/
25902611
int tb_tunnel_release_unused_bandwidth(struct tb_tunnel *tunnel)
25912612
{

0 commit comments

Comments
 (0)