Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Alan Borzeszkowski and committed by
Mika Westerberg
6f3ed985 371c2374

+53 -32
+53 -32
drivers/thunderbolt/tunnel.c
··· 121 121 * @port: Lane adapter to check 122 122 * @max_dp_streams: If non-%NULL stores maximum number of simultaneous DP 123 123 * streams possible through this lane adapter 124 + * 125 + * Return: Number of available credits. 124 126 */ 125 127 static unsigned int tb_available_credits(const struct tb_port *port, 126 128 size_t *max_dp_streams) ··· 417 415 * @alloc_hopid: Allocate HopIDs from visited ports 418 416 * 419 417 * If @down adapter is active, follows the tunnel to the PCIe upstream 420 - * adapter and back. Returns the discovered tunnel or %NULL if there was 421 - * no tunnel. 418 + * adapter and back. 419 + * 420 + * Return: Pointer to &struct tb_tunnel or %NULL if there was no tunnel. 422 421 */ 423 422 struct tb_tunnel *tb_tunnel_discover_pci(struct tb *tb, struct tb_port *down, 424 423 bool alloc_hopid) ··· 499 496 * Allocate a PCI tunnel. The ports must be of type TB_TYPE_PCIE_UP and 500 497 * TB_TYPE_PCIE_DOWN. 501 498 * 502 - * Return: Returns a tb_tunnel on success or NULL on failure. 499 + * Return: Pointer to @struct tb_tunnel or %NULL on failure. 503 500 */ 504 501 struct tb_tunnel *tb_tunnel_alloc_pci(struct tb *tb, struct tb_port *up, 505 502 struct tb_port *down) ··· 546 543 * 547 544 * Can be called to any connected lane 0 adapter to find out how much 548 545 * bandwidth needs to be left in reserve for possible PCIe bulk traffic. 549 - * Returns true if there is something to be reserved and writes the 550 - * amount to @reserved_down/@reserved_up. Otherwise returns false and 551 - * does not touch the parameters. 546 + * 547 + * Return: 548 + * * %true - If there is something to be reserved. Writes the amount to 549 + * @reserved_down/@reserved_up. 550 + * * %false - Nothing to be reserved. Leaves @reserved_down/@reserved_up 551 + * unmodified. 552 552 */ 553 553 bool tb_tunnel_reserved_pci(struct tb_port *port, int *reserved_up, 554 554 int *reserved_down) ··· 1157 1151 * @tunnel: DP tunnel to check 1158 1152 * @max_bw_rounded: Maximum bandwidth in Mb/s rounded up to the next granularity 1159 1153 * 1160 - * Returns maximum possible bandwidth for this tunnel in Mb/s. 1154 + * Return: Maximum possible bandwidth for this tunnel in Mb/s, negative errno 1155 + * in case of failure. 1161 1156 */ 1162 1157 static int tb_dp_bandwidth_mode_maximum_bandwidth(struct tb_tunnel *tunnel, 1163 1158 int *max_bw_rounded) ··· 1554 1547 * and back. Returns the discovered tunnel or %NULL if there was no 1555 1548 * tunnel. 1556 1549 * 1557 - * Return: DP tunnel or %NULL if no tunnel found. 1550 + * Return: Pointer to &struct tb_tunnel or %NULL if no tunnel found. 1558 1551 */ 1559 1552 struct tb_tunnel *tb_tunnel_discover_dp(struct tb *tb, struct tb_port *in, 1560 1553 bool alloc_hopid) ··· 1655 1648 * successful (or if it returns %false there was some sort of issue). 1656 1649 * The @callback is called without @tb->lock held. 1657 1650 * 1658 - * Return: Returns a tb_tunnel on success or &NULL on failure. 1651 + * Return: Pointer to @struct tb_tunnel or %NULL in case of failure. 1659 1652 */ 1660 1653 struct tb_tunnel *tb_tunnel_alloc_dp(struct tb *tb, struct tb_port *in, 1661 1654 struct tb_port *out, int link_nr, ··· 1868 1861 * @receive_ring: NHI ring number used to receive packets from the 1869 1862 * other domain. Set to %-1 if RX path is not needed. 1870 1863 * 1871 - * Return: Returns a tb_tunnel on success or NULL on failure. 1864 + * Return: Pointer to @struct tb_tunnel or %NULL in case of failure. 1872 1865 */ 1873 1866 struct tb_tunnel *tb_tunnel_alloc_dma(struct tb *tb, struct tb_port *nhi, 1874 1867 struct tb_port *dst, int transmit_path, ··· 1945 1938 * 1946 1939 * This function can be used to match specific DMA tunnel, if there are 1947 1940 * multiple DMA tunnels going through the same XDomain connection. 1948 - * Returns true if there is match and false otherwise. 1941 + * 1942 + * Return: %true if there is a match, %false otherwise. 1949 1943 */ 1950 1944 bool tb_tunnel_match_dma(const struct tb_tunnel *tunnel, int transmit_path, 1951 1945 int transmit_ring, int receive_path, int receive_ring) ··· 2168 2160 * @alloc_hopid: Allocate HopIDs from visited ports 2169 2161 * 2170 2162 * If @down adapter is active, follows the tunnel to the USB3 upstream 2171 - * adapter and back. Returns the discovered tunnel or %NULL if there was 2172 - * no tunnel. 2163 + * adapter and back. 2164 + * 2165 + * Return: Pointer to &struct tb_tunnel or %NULL if there was no tunnel. 2173 2166 */ 2174 2167 struct tb_tunnel *tb_tunnel_discover_usb3(struct tb *tb, struct tb_port *down, 2175 2168 bool alloc_hopid) ··· 2275 2266 * Allocate an USB3 tunnel. The ports must be of type @TB_TYPE_USB3_UP and 2276 2267 * @TB_TYPE_USB3_DOWN. 2277 2268 * 2278 - * Return: Returns a tb_tunnel on success or %NULL on failure. 2269 + * Return: Pointer to @struct tb_tunnel or %NULL in case of failure. 2279 2270 */ 2280 2271 struct tb_tunnel *tb_tunnel_alloc_usb3(struct tb *tb, struct tb_port *up, 2281 2272 struct tb_port *down, int max_up, ··· 2346 2337 /** 2347 2338 * tb_tunnel_is_invalid - check whether an activated path is still valid 2348 2339 * @tunnel: Tunnel to check 2340 + * 2341 + * Return: %true if path is valid, %false otherwise. 2349 2342 */ 2350 2343 bool tb_tunnel_is_invalid(struct tb_tunnel *tunnel) 2351 2344 { ··· 2366 2355 * tb_tunnel_activate() - activate a tunnel 2367 2356 * @tunnel: Tunnel to activate 2368 2357 * 2369 - * Return: 0 on success and negative errno in case if failure. 2370 - * Specifically returns %-EINPROGRESS if the tunnel activation is still 2371 - * in progress (that's for DP tunnels to complete DPRX capabilities 2372 - * read). 2358 + * Return: 2359 + * * %0 - On success. 2360 + * * %-EINPROGRESS - If the tunnel activation is still in progress (that's 2361 + * for DP tunnels to complete DPRX capabilities read). 2362 + * * Negative errno - Another error occurred. 2373 2363 */ 2374 2364 int tb_tunnel_activate(struct tb_tunnel *tunnel) 2375 2365 { ··· 2450 2438 * @tunnel: Tunnel to check 2451 2439 * @port: Port to check 2452 2440 * 2453 - * Returns true if @tunnel goes through @port (direction does not matter), 2454 - * false otherwise. 2441 + * Return: %true if @tunnel goes through @port (direction does not matter), 2442 + * %false otherwise. 2455 2443 */ 2456 2444 bool tb_tunnel_port_on_path(const struct tb_tunnel *tunnel, 2457 2445 const struct tb_port *port) ··· 2481 2469 * @max_up: Maximum upstream bandwidth in Mb/s 2482 2470 * @max_down: Maximum downstream bandwidth in Mb/s 2483 2471 * 2484 - * Returns maximum possible bandwidth this tunnel can go if not limited 2485 - * by other bandwidth clients. If the tunnel does not support this 2486 - * returns %-EOPNOTSUPP. 2472 + * Return: 2473 + * * Maximum possible bandwidth this tunnel can support if not 2474 + * limited by other bandwidth clients. 2475 + * * %-EOPNOTSUPP - If the tunnel does not support this function. 2476 + * * %-ENOTCONN - If the tunnel is not active. 2487 2477 */ 2488 2478 int tb_tunnel_maximum_bandwidth(struct tb_tunnel *tunnel, int *max_up, 2489 2479 int *max_down) ··· 2505 2491 * @allocated_down: Currently allocated downstream bandwidth in Mb/s is 2506 2492 * stored here 2507 2493 * 2508 - * Returns the bandwidth allocated for the tunnel. This may be higher 2509 - * than what the tunnel actually consumes. 2494 + * Return: 2495 + * * Bandwidth allocated for the tunnel. This may be higher than what the 2496 + * tunnel actually consumes. 2497 + * * %-EOPNOTSUPP - If the tunnel does not support this function. 2498 + * * %-ENOTCONN - If the tunnel is not active. 2499 + * * Negative errno - Another error occurred. 2510 2500 */ 2511 2501 int tb_tunnel_allocated_bandwidth(struct tb_tunnel *tunnel, int *allocated_up, 2512 2502 int *allocated_down) ··· 2530 2512 * @alloc_up: New upstream bandwidth in Mb/s 2531 2513 * @alloc_down: New downstream bandwidth in Mb/s 2532 2514 * 2533 - * Tries to change tunnel bandwidth allocation. If succeeds returns %0 2534 - * and updates @alloc_up and @alloc_down to that was actually allocated 2535 - * (it may not be the same as passed originally). Returns negative errno 2536 - * in case of failure. 2515 + * Tries to change tunnel bandwidth allocation. 2516 + * 2517 + * Return: 2518 + * * %0 - On success. Updates @alloc_up and @alloc_down to values that were 2519 + * actually allocated (it may not be the same as passed originally). 2520 + * * Negative errno - In case of failure. 2537 2521 */ 2538 2522 int tb_tunnel_alloc_bandwidth(struct tb_tunnel *tunnel, int *alloc_up, 2539 2523 int *alloc_down) ··· 2566 2546 * Can be %NULL. 2567 2547 * 2568 2548 * Stores the amount of isochronous bandwidth @tunnel consumes in 2569 - * @consumed_up and @consumed_down. In case of success returns %0, 2570 - * negative errno otherwise. 2549 + * @consumed_up and @consumed_down. 2550 + * 2551 + * Return: %0 on success, negative errno otherwise. 2571 2552 */ 2572 2553 int tb_tunnel_consumed_bandwidth(struct tb_tunnel *tunnel, int *consumed_up, 2573 2554 int *consumed_down) ··· 2606 2585 * If tunnel supports dynamic bandwidth management (USB3 tunnels at the 2607 2586 * moment) this function makes it to release all the unused bandwidth. 2608 2587 * 2609 - * Returns %0 in case of success and negative errno otherwise. 2588 + * Return: %0 on success, negative errno otherwise. 2610 2589 */ 2611 2590 int tb_tunnel_release_unused_bandwidth(struct tb_tunnel *tunnel) 2612 2591 {