arch/mips/include/asm/octeon/cvmx-helper-util.h

Source file repositories/reference/linux-study-clean/arch/mips/include/asm/octeon/cvmx-helper-util.h

File Facts

System
Linux kernel
Corpus path
arch/mips/include/asm/octeon/cvmx-helper-util.h
Extension
.h
Size
5358 bytes
Lines
193
Domain
Architecture Layer
Bucket
arch/mips
Inferred role
Architecture Layer: implementation source
Status
source implementation candidate

Why This File Exists

CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.

Dependency Surface

Detected Declarations

Annotated Snippet

#ifndef __CVMX_HELPER_UTIL_H__
#define __CVMX_HELPER_UTIL_H__

/**
 * Convert a interface mode into a human readable string
 *
 * @mode:   Mode to convert
 *
 * Returns String
 */
extern const char
    *cvmx_helper_interface_mode_to_string(cvmx_helper_interface_mode_t mode);

/**
 * Setup Random Early Drop to automatically begin dropping packets.
 *
 * @pass_thresh:
 *		 Packets will begin slowly dropping when there are less than
 *		 this many packet buffers free in FPA 0.
 * @drop_thresh:
 *		 All incoming packets will be dropped when there are less
 *		 than this many free packet buffers in FPA 0.
 * Returns Zero on success. Negative on failure
 */
extern int cvmx_helper_setup_red(int pass_thresh, int drop_thresh);

/**
 * Get the version of the CVMX libraries.
 *
 * Returns Version string. Note this buffer is allocated statically
 *	   and will be shared by all callers.
 */
extern const char *cvmx_helper_get_version(void);

/**
 * Setup the common GMX settings that determine the number of
 * ports. These setting apply to almost all configurations of all
 * chips.
 *
 * @interface: Interface to configure
 * @num_ports: Number of ports on the interface
 *
 * Returns Zero on success, negative on failure
 */
extern int __cvmx_helper_setup_gmx(int interface, int num_ports);

/**
 * Returns the IPD/PKO port number for a port on the given
 * interface.
 *
 * @interface: Interface to use
 * @port:      Port on the interface
 *
 * Returns IPD/PKO port number
 */
extern int cvmx_helper_get_ipd_port(int interface, int port);

/**
 * Returns the IPD/PKO port number for the first port on the given
 * interface.
 *
 * @interface: Interface to use
 *
 * Returns IPD/PKO port number
 */
static inline int cvmx_helper_get_first_ipd_port(int interface)
{
	return cvmx_helper_get_ipd_port(interface, 0);
}

/**
 * Returns the IPD/PKO port number for the last port on the given
 * interface.
 *
 * @interface: Interface to use
 *
 * Returns IPD/PKO port number
 */
static inline int cvmx_helper_get_last_ipd_port(int interface)
{
	extern int cvmx_helper_ports_on_interface(int interface);

	return cvmx_helper_get_first_ipd_port(interface) +
	       cvmx_helper_ports_on_interface(interface) - 1;
}

/**
 * Free the packet buffers contained in a work queue entry.
 * The work queue entry is not freed.
 *

Annotation

Implementation Notes