dpaa: move fmlib ioctl headers into kernel tree
Move the 5 fmlib ioctl ABI headers (fm_pcd_ioctls.h, fm_ioctls.h, net_ioctls.h, ioctls.h, integration_ioctls.h) from the external opnsense-deps repo into sys/contrib/ncsw/inc/ioctls/. This makes the kernel buildable without depending on a sibling repository. Merge FMCD_COMPILE_CMD into DPAA_COMPILE_CMD since it only added a single -I path; fman_chardev.c now compiles with the same flags as all other DPAA source files.
This commit is contained in:
parent
ef0aedc40b
commit
5065099c0d
8 changed files with 4213 additions and 8 deletions
|
|
@ -21,9 +21,5 @@ makeoptions DPAA_COMPILE_CMD="${LINUXKPI_C} ${DPAAWARNFLAGS} \
|
|||
-I$S/contrib/ncsw/Peripherals/FM/Rtc \
|
||||
-I$S/contrib/ncsw/Peripherals/QM \
|
||||
-I$S/contrib/ncsw/inc/flib \
|
||||
-I$S/contrib/ncsw/inc/integrations"
|
||||
|
||||
makeoptions FMCD_COMPILE_CMD="${DPAA_COMPILE_CMD} \
|
||||
-I$S/../../opnsense-deps/fastpath/fmlib/include/fmd \
|
||||
-I$S/../../opnsense-deps/fastpath/fmlib/include/fmd/Peripherals \
|
||||
-I$S/../../opnsense-deps/fastpath/fmlib/include/fmd/integrations"
|
||||
-I$S/contrib/ncsw/inc/integrations \
|
||||
-I$S/contrib/ncsw/inc/ioctls"
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ dev/dpaa/qman_fdt.c optional dpaa fdt \
|
|||
dev/dpaa/fman.c optional dpaa fdt \
|
||||
no-depend compile-with "${DPAA_COMPILE_CMD}"
|
||||
dev/dpaa/fman_chardev.c optional dpaa fdt \
|
||||
no-depend compile-with "${FMCD_COMPILE_CMD}"
|
||||
no-depend compile-with "${DPAA_COMPILE_CMD}"
|
||||
dev/dpaa/fman_fdt.c optional dpaa fdt \
|
||||
no-depend compile-with "${DPAA_COMPILE_CMD}"
|
||||
# mEMAC external MDIO controller (fsl,fman-memac-mdio)
|
||||
|
|
|
|||
645
sys/contrib/ncsw/inc/ioctls/fm_ioctls.h
Normal file
645
sys/contrib/ncsw/inc/ioctls/fm_ioctls.h
Normal file
|
|
@ -0,0 +1,645 @@
|
|||
/* Copyright (c) 2008-2012 Freescale Semiconductor, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of Freescale Semiconductor nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
*
|
||||
* ALTERNATIVELY, this software may be distributed under the terms of the
|
||||
* GNU General Public License ("GPL") as published by the Free Software
|
||||
* Foundation, either version 2 of that License or (at your option) any
|
||||
* later version.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/**************************************************************************//**
|
||||
@File fm_ioctls.h
|
||||
|
||||
@Description FM Char device ioctls
|
||||
*//***************************************************************************/
|
||||
#ifndef __FM_IOCTLS_H
|
||||
#define __FM_IOCTLS_H
|
||||
|
||||
|
||||
/**************************************************************************//**
|
||||
@Group lnx_ioctl_FM_grp Frame Manager Linux IOCTL API
|
||||
|
||||
@Description FM Linux ioctls definitions and enums
|
||||
|
||||
@{
|
||||
*//***************************************************************************/
|
||||
|
||||
/**************************************************************************//**
|
||||
@Collection FM IOCTL device ('/dev') definitions
|
||||
*//***************************************************************************/
|
||||
#define DEV_FM_NAME "fm" /**< Name of the FM chardev */
|
||||
|
||||
#define DEV_FM_MINOR_BASE 0
|
||||
#define DEV_FM_PCD_MINOR_BASE (DEV_FM_MINOR_BASE + 1) /*/dev/fmx-pcd */
|
||||
#define DEV_FM_OH_PORTS_MINOR_BASE (DEV_FM_PCD_MINOR_BASE + 1) /*/dev/fmx-port-ohy */
|
||||
#define DEV_FM_RX_PORTS_MINOR_BASE (DEV_FM_OH_PORTS_MINOR_BASE + FM_MAX_NUM_OF_OH_PORTS) /*/dev/fmx-port-rxy */
|
||||
#define DEV_FM_TX_PORTS_MINOR_BASE (DEV_FM_RX_PORTS_MINOR_BASE + FM_MAX_NUM_OF_RX_PORTS) /*/dev/fmx-port-txy */
|
||||
#define DEV_FM_MAX_MINORS (DEV_FM_TX_PORTS_MINOR_BASE + FM_MAX_NUM_OF_TX_PORTS)
|
||||
|
||||
#define FM_IOC_NUM(n) (n)
|
||||
#define FM_PCD_IOC_NUM(n) (n+20)
|
||||
#define FM_PORT_IOC_NUM(n) (n+70)
|
||||
/* @} */
|
||||
|
||||
#define IOC_FM_MAX_NUM_OF_PORTS 64
|
||||
|
||||
|
||||
/**************************************************************************//**
|
||||
@Description Enum for defining port types
|
||||
(must match enum e_FmPortType defined in fm_ext.h)
|
||||
*//***************************************************************************/
|
||||
typedef enum ioc_fm_port_type {
|
||||
e_IOC_FM_PORT_TYPE_OH_OFFLINE_PARSING = 0, /**< Offline parsing port */
|
||||
e_IOC_FM_PORT_TYPE_RX, /**< 1G Rx port */
|
||||
e_IOC_FM_PORT_TYPE_RX_10G, /**< 10G Rx port */
|
||||
e_IOC_FM_PORT_TYPE_TX, /**< 1G Tx port */
|
||||
e_IOC_FM_PORT_TYPE_TX_10G, /**< 10G Tx port */
|
||||
e_IOC_FM_PORT_TYPE_DUMMY
|
||||
} ioc_fm_port_type;
|
||||
|
||||
|
||||
/**************************************************************************//**
|
||||
@Group lnx_ioctl_FM_lib_grp FM library
|
||||
|
||||
@Description FM API functions, definitions and enums
|
||||
The FM module is the main driver module and is a mandatory module
|
||||
for FM driver users. Before any further module initialization,
|
||||
this module must be initialized.
|
||||
The FM is a "single-tone" module. It is responsible of the common
|
||||
HW modules: FPM, DMA, common QMI, common BMI initializations and
|
||||
run-time control routines. This module must be initialized always
|
||||
when working with any of the FM modules.
|
||||
NOTE - We assumes that the FML will be initialize only by core No. 0!
|
||||
|
||||
@{
|
||||
*//***************************************************************************/
|
||||
|
||||
/**************************************************************************//**
|
||||
@Description FM Exceptions
|
||||
*//***************************************************************************/
|
||||
typedef enum ioc_fm_exceptions {
|
||||
e_IOC_FM_EX_DMA_BUS_ERROR, /**< DMA bus error. */
|
||||
e_IOC_EX_DMA_READ_ECC, /**< Read Buffer ECC error (Valid for FM rev < 6)*/
|
||||
e_IOC_EX_DMA_SYSTEM_WRITE_ECC, /**< Write Buffer ECC error on system side (Valid for FM rev < 6)*/
|
||||
e_IOC_EX_DMA_FM_WRITE_ECC, /**< Write Buffer ECC error on FM side (Valid for FM rev < 6)*/
|
||||
e_IOC_EX_DMA_SINGLE_PORT_ECC, /**< Single Port ECC error on FM side (Valid for FM rev > 6)*/
|
||||
e_IOC_EX_FPM_STALL_ON_TASKS, /**< Stall of tasks on FPM */
|
||||
e_IOC_EX_FPM_SINGLE_ECC, /**< Single ECC on FPM. */
|
||||
e_IOC_EX_FPM_DOUBLE_ECC, /**< Double ECC error on FPM ram access */
|
||||
e_IOC_EX_QMI_SINGLE_ECC, /**< Single ECC on QMI. */
|
||||
e_IOC_EX_QMI_DOUBLE_ECC, /**< Double bit ECC occurred on QMI */
|
||||
e_IOC_EX_QMI_DEQ_FROM_UNKNOWN_PORTID,/**< Dequeue from unknown port id */
|
||||
e_IOC_EX_BMI_LIST_RAM_ECC, /**< Linked List RAM ECC error */
|
||||
e_IOC_EX_BMI_STORAGE_PROFILE_ECC, /**< Storage Profile ECC Error */
|
||||
e_IOC_EX_BMI_STATISTICS_RAM_ECC, /**< Statistics Count RAM ECC Error Enable */
|
||||
e_IOC_EX_BMI_DISPATCH_RAM_ECC, /**< Dispatch RAM ECC Error Enable */
|
||||
e_IOC_EX_IRAM_ECC, /**< Double bit ECC occurred on IRAM*/
|
||||
e_IOC_EX_MURAM_ECC /**< Double bit ECC occurred on MURAM*/
|
||||
} ioc_fm_exceptions;
|
||||
|
||||
/**************************************************************************//**
|
||||
@Group lnx_ioctl_FM_runtime_control_grp FM Runtime Control Unit
|
||||
|
||||
@Description FM Runtime control unit API functions, definitions and enums.
|
||||
The FM driver provides a set of control routines for each module.
|
||||
These routines may only be called after the module was fully
|
||||
initialized (both configuration and initialization routines were
|
||||
called). They are typically used to get information from hardware
|
||||
(status, counters/statistics, revision etc.), to modify a current
|
||||
state or to force/enable a required action. Run-time control may
|
||||
be called whenever necessary and as many times as needed.
|
||||
@{
|
||||
*//***************************************************************************/
|
||||
|
||||
/**************************************************************************//**
|
||||
@Collection General FM defines.
|
||||
*//***************************************************************************/
|
||||
#define IOC_FM_MAX_NUM_OF_VALID_PORTS (FM_MAX_NUM_OF_OH_PORTS + \
|
||||
FM_MAX_NUM_OF_1G_RX_PORTS + \
|
||||
FM_MAX_NUM_OF_10G_RX_PORTS + \
|
||||
FM_MAX_NUM_OF_1G_TX_PORTS + \
|
||||
FM_MAX_NUM_OF_10G_TX_PORTS)
|
||||
/* @} */
|
||||
|
||||
/**************************************************************************//**
|
||||
@Description Structure for Port bandwidth requirement. Port is identified
|
||||
by type and relative id.
|
||||
(must be identical to t_FmPortBandwidth defined in fm_ext.h)
|
||||
*//***************************************************************************/
|
||||
typedef struct ioc_fm_port_bandwidth_t {
|
||||
ioc_fm_port_type type; /**< FM port type */
|
||||
uint8_t relative_port_id; /**< Type relative port id */
|
||||
uint8_t bandwidth; /**< bandwidth - (in term of percents) */
|
||||
} ioc_fm_port_bandwidth_t;
|
||||
|
||||
/**************************************************************************//**
|
||||
@Description A Structure containing an array of Port bandwidth requirements.
|
||||
The user should state the ports requiring bandwidth in terms of
|
||||
percentage - i.e. all port's bandwidths in the array must add
|
||||
up to 100.
|
||||
(must be identical to t_FmPortsBandwidthParams defined in fm_ext.h)
|
||||
*//***************************************************************************/
|
||||
typedef struct ioc_fm_port_bandwidth_params {
|
||||
uint8_t num_of_ports;
|
||||
/**< num of ports listed in the array below */
|
||||
ioc_fm_port_bandwidth_t ports_bandwidths[IOC_FM_MAX_NUM_OF_VALID_PORTS];
|
||||
/**< for each port, it's bandwidth (all port's
|
||||
bandwidths must add up to 100.*/
|
||||
} ioc_fm_port_bandwidth_params;
|
||||
|
||||
/**************************************************************************//**
|
||||
@Description enum for defining FM counters
|
||||
*//***************************************************************************/
|
||||
typedef enum ioc_fm_counters {
|
||||
e_IOC_FM_COUNTERS_ENQ_TOTAL_FRAME, /**< QMI total enqueued frames counter */
|
||||
e_IOC_FM_COUNTERS_DEQ_TOTAL_FRAME, /**< QMI total dequeued frames counter */
|
||||
e_IOC_FM_COUNTERS_DEQ_0, /**< QMI 0 frames from QMan counter */
|
||||
e_IOC_FM_COUNTERS_DEQ_1, /**< QMI 1 frames from QMan counter */
|
||||
e_IOC_FM_COUNTERS_DEQ_2, /**< QMI 2 frames from QMan counter */
|
||||
e_IOC_FM_COUNTERS_DEQ_3, /**< QMI 3 frames from QMan counter */
|
||||
e_IOC_FM_COUNTERS_DEQ_FROM_DEFAULT, /**< QMI dequeue from default queue counter */
|
||||
e_IOC_FM_COUNTERS_DEQ_FROM_CONTEXT, /**< QMI dequeue from FQ context counter */
|
||||
e_IOC_FM_COUNTERS_DEQ_FROM_FD, /**< QMI dequeue from FD command field counter */
|
||||
e_IOC_FM_COUNTERS_DEQ_CONFIRM, /**< QMI dequeue confirm counter */
|
||||
} ioc_fm_counters;
|
||||
|
||||
typedef struct ioc_fm_obj_t {
|
||||
void *obj;
|
||||
} ioc_fm_obj_t;
|
||||
|
||||
/**************************************************************************//**
|
||||
@Description A structure for returning revision information
|
||||
(must match struct t_FmRevisionInfo declared in fm_ext.h)
|
||||
*//***************************************************************************/
|
||||
typedef struct ioc_fm_revision_info_t {
|
||||
uint8_t major; /**< Major revision */
|
||||
uint8_t minor; /**< Minor revision */
|
||||
} ioc_fm_revision_info_t;
|
||||
|
||||
/**************************************************************************//**
|
||||
@Description A structure for FM counters
|
||||
*//***************************************************************************/
|
||||
typedef struct ioc_fm_counters_params_t {
|
||||
ioc_fm_counters cnt; /**< The requested counter */
|
||||
uint32_t val; /**< The requested value to get/set from/into the counter */
|
||||
} ioc_fm_counters_params_t;
|
||||
|
||||
typedef union ioc_fm_api_version_t {
|
||||
struct {
|
||||
uint8_t major;
|
||||
uint8_t minor;
|
||||
uint8_t respin;
|
||||
uint8_t reserved;
|
||||
} version;
|
||||
uint32_t ver;
|
||||
} ioc_fm_api_version_t;
|
||||
|
||||
/**************************************************************************//**
|
||||
@Description A structure of information about each of the external
|
||||
buffer pools used by a port or storage-profile.
|
||||
(must be identical to t_FmExtPoolParams defined in fm_ext.h)
|
||||
*//***************************************************************************/
|
||||
typedef struct ioc_fm_ext_pool_params {
|
||||
uint8_t id; /**< External buffer pool id */
|
||||
uint16_t size; /**< External buffer pool buffer size */
|
||||
} ioc_fm_ext_pool_params;
|
||||
|
||||
/**************************************************************************//**
|
||||
@Description A structure for informing the driver about the external
|
||||
buffer pools allocated in the BM and used by a port or a
|
||||
storage-profile.
|
||||
(must be identical to t_FmExtPools defined in fm_ext.h)
|
||||
*//***************************************************************************/
|
||||
typedef struct ioc_fm_ext_pools {
|
||||
uint8_t num_of_pools_used; /**< Number of pools use by this port */
|
||||
ioc_fm_ext_pool_params ext_buf_pool[FM_PORT_MAX_NUM_OF_EXT_POOLS];
|
||||
/**< Parameters for each port */
|
||||
} ioc_fm_ext_pools;
|
||||
|
||||
typedef struct ioc_fm_vsp_params_t {
|
||||
void *p_fm; /**< A handle to the FM object this VSP related to */
|
||||
ioc_fm_ext_pools ext_buf_pools; /**< Which external buffer pools are used
|
||||
(up to FM_PORT_MAX_NUM_OF_EXT_POOLS), and their sizes.
|
||||
parameter associated with Rx / OP port */
|
||||
uint16_t liodn_offset; /**< VSP's LIODN offset */
|
||||
struct {
|
||||
ioc_fm_port_type port_type; /**< Port type */
|
||||
uint8_t port_id; /**< Port Id - relative to type */
|
||||
} port_params;
|
||||
uint8_t relative_profile_id; /**< VSP Id - relative to VSP's range
|
||||
defined in relevant FM object */
|
||||
void *id; /**< return value */
|
||||
} ioc_fm_vsp_params_t;
|
||||
|
||||
/**************************************************************************//**
|
||||
@Description A structure for defining BM pool depletion criteria
|
||||
*//***************************************************************************/
|
||||
typedef struct ioc_fm_buf_pool_depletion_t {
|
||||
bool pools_grp_mode_enable; /**< select mode in which pause frames will be sent after
|
||||
a number of pools (all together!) are depleted */
|
||||
uint8_t num_of_pools; /**< the number of depleted pools that will invoke
|
||||
pause frames transmission. */
|
||||
bool pools_to_consider[BM_MAX_NUM_OF_POOLS];
|
||||
/**< For each pool, TRUE if it should be considered for
|
||||
depletion (Note - this pool must be used by this port!). */
|
||||
bool single_pool_mode_enable; /**< select mode in which pause frames will be sent after
|
||||
a single-pool is depleted; */
|
||||
bool pools_to_consider_for_single_mode[BM_MAX_NUM_OF_POOLS];
|
||||
/**< For each pool, TRUE if it should be considered for
|
||||
depletion (Note - this pool must be used by this port!) */
|
||||
bool pfc_priorities_en[FM_MAX_NUM_OF_PFC_PRIORITIES];
|
||||
/**< This field is used by the MAC as the Priority Enable Vector in the PFC frame
|
||||
which is transmitted */
|
||||
} ioc_fm_buf_pool_depletion_t;
|
||||
|
||||
typedef struct ioc_fm_buf_pool_depletion_params_t {
|
||||
void *p_fm_vsp;
|
||||
ioc_fm_buf_pool_depletion_t fm_buf_pool_depletion;
|
||||
} ioc_fm_buf_pool_depletion_params_t;
|
||||
|
||||
typedef struct ioc_fm_buffer_prefix_content_t {
|
||||
uint16_t priv_data_size; /**< Number of bytes to be left at the beginning
|
||||
of the external buffer; Note that the private-area will
|
||||
start from the base of the buffer address. */
|
||||
bool pass_prs_result; /**< TRUE to pass the parse result to/from the FM;
|
||||
User may use FM_PORT_GetBufferPrsResult() in order to
|
||||
get the parser-result from a buffer. */
|
||||
bool pass_time_stamp; /**< TRUE to pass the timeStamp to/from the FM
|
||||
User may use FM_PORT_GetBufferTimeStamp() in order to
|
||||
get the parser-result from a buffer. */
|
||||
bool pass_hash_result; /**< TRUE to pass the KG hash result to/from the FM
|
||||
User may use FM_PORT_GetBufferHashResult() in order to
|
||||
get the parser-result from a buffer. */
|
||||
bool pass_all_other_pcd_info; /**< Add all other Internal-Context information:
|
||||
AD, hash-result, key, etc. */
|
||||
uint16_t data_align; /**< 0 to use driver's default alignment [64],
|
||||
other value for selecting a data alignment (must be a power of 2);
|
||||
if write optimization is used, must be >= 16. */
|
||||
uint8_t manip_extra_space; /**< Maximum extra size needed (insertion-size minus removal-size);
|
||||
Note that this field impacts the size of the buffer-prefix
|
||||
(i.e. it pushes the data offset); */
|
||||
} ioc_fm_buffer_prefix_content_t;
|
||||
|
||||
typedef struct ioc_fm_buffer_prefix_content_params_t {
|
||||
void *p_fm_vsp;
|
||||
ioc_fm_buffer_prefix_content_t fm_buffer_prefix_content;
|
||||
} ioc_fm_buffer_prefix_content_params_t;
|
||||
|
||||
typedef struct ioc_fm_vsp_config_no_sg_params_t {
|
||||
void *p_fm_vsp;
|
||||
bool no_sg;
|
||||
} ioc_fm_vsp_config_no_sg_params_t;
|
||||
|
||||
typedef struct ioc_fm_vsp_prs_result_params_t {
|
||||
void *p_fm_vsp;
|
||||
void *p_data;
|
||||
} ioc_fm_vsp_prs_result_params_t;
|
||||
|
||||
typedef struct fm_ctrl_mon_t {
|
||||
uint8_t percent_cnt[2];
|
||||
} fm_ctrl_mon_t;
|
||||
|
||||
typedef struct ioc_fm_ctrl_mon_counters_params_t {
|
||||
uint8_t fm_ctrl_index;
|
||||
fm_ctrl_mon_t *p_mon;
|
||||
} ioc_fm_ctrl_mon_counters_params_t;
|
||||
|
||||
/**************************************************************************//**
|
||||
@Function FM_IOC_SET_PORTS_BANDWIDTH
|
||||
|
||||
@Description Sets relative weights between ports when accessing common resources.
|
||||
|
||||
@Param[in] ioc_fm_port_bandwidth_params Port bandwidth percentages,
|
||||
their sum must equal 100.
|
||||
|
||||
@Return E_OK on success; Error code otherwise.
|
||||
|
||||
@Cautions Allowed only following FM_Init().
|
||||
*//***************************************************************************/
|
||||
#define FM_IOC_SET_PORTS_BANDWIDTH _IOW(FM_IOC_TYPE_BASE, FM_IOC_NUM(2), ioc_fm_port_bandwidth_params)
|
||||
|
||||
/**************************************************************************//**
|
||||
@Function FM_IOC_GET_REVISION
|
||||
|
||||
@Description Returns the FM revision
|
||||
|
||||
@Param[out] ioc_fm_revision_info_t A structure of revision information parameters.
|
||||
|
||||
@Return None.
|
||||
|
||||
@Cautions Allowed only following FM_Init().
|
||||
*//***************************************************************************/
|
||||
#define FM_IOC_GET_REVISION _IOR(FM_IOC_TYPE_BASE, FM_IOC_NUM(3), ioc_fm_revision_info_t)
|
||||
|
||||
/**************************************************************************//**
|
||||
@Function FM_IOC_GET_COUNTER
|
||||
|
||||
@Description Reads one of the FM counters.
|
||||
|
||||
@Param[in,out] ioc_fm_counters_params_t The requested counter parameters.
|
||||
|
||||
@Return Counter's current value.
|
||||
|
||||
@Cautions Allowed only following FM_Init().
|
||||
Note that it is user's responsibilty to call this routine only
|
||||
for enabled counters, and there will be no indication if a
|
||||
disabled counter is accessed.
|
||||
*//***************************************************************************/
|
||||
#define FM_IOC_GET_COUNTER _IOWR(FM_IOC_TYPE_BASE, FM_IOC_NUM(4), ioc_fm_counters_params_t)
|
||||
|
||||
/**************************************************************************//**
|
||||
@Function FM_IOC_SET_COUNTER
|
||||
|
||||
@Description Sets a value to an enabled counter. Use "0" to reset the counter.
|
||||
|
||||
@Param[in] ioc_fm_counters_params_t The requested counter parameters.
|
||||
|
||||
@Return E_OK on success; Error code otherwise.
|
||||
|
||||
@Cautions Allowed only following FM_Init().
|
||||
*//***************************************************************************/
|
||||
#define FM_IOC_SET_COUNTER _IOW(FM_IOC_TYPE_BASE, FM_IOC_NUM(5), ioc_fm_counters_params_t)
|
||||
|
||||
/**************************************************************************//**
|
||||
@Function FM_IOC_FORCE_INTR
|
||||
|
||||
@Description Causes an interrupt event on the requested source.
|
||||
|
||||
@Param[in] ioc_fm_exceptions An exception to be forced.
|
||||
|
||||
@Return E_OK on success; Error code if the exception is not enabled,
|
||||
or is not able to create interrupt.
|
||||
|
||||
@Cautions Allowed only following FM_Init().
|
||||
*//***************************************************************************/
|
||||
#define FM_IOC_FORCE_INTR _IOW(FM_IOC_TYPE_BASE, FM_IOC_NUM(6), ioc_fm_exceptions)
|
||||
|
||||
/**************************************************************************//**
|
||||
@Function FM_IOC_GET_API_VERSION
|
||||
|
||||
@Description Reads the FMD IOCTL API version.
|
||||
|
||||
@Param[in,out] ioc_fm_api_version_t The requested counter parameters.
|
||||
|
||||
@Return Version's value.
|
||||
*//***************************************************************************/
|
||||
#define FM_IOC_GET_API_VERSION _IOR(FM_IOC_TYPE_BASE, FM_IOC_NUM(7), ioc_fm_api_version_t)
|
||||
|
||||
/**************************************************************************//**
|
||||
@Function FM_VSP_Config
|
||||
|
||||
@Description Creates descriptor for the FM VSP module.
|
||||
|
||||
The routine returns a handle (descriptor) to the FM VSP object.
|
||||
This descriptor must be passed as first parameter to all other
|
||||
FM VSP function calls.
|
||||
|
||||
No actual initialization or configuration of FM hardware is
|
||||
done by this routine.
|
||||
|
||||
@Param[in] p_FmVspParams Pointer to data structure of parameters
|
||||
|
||||
@Retval Handle to FM VSP object, or NULL for Failure.
|
||||
*//***************************************************************************/
|
||||
#if defined(FM_COMPAT)
|
||||
#define FM_IOC_VSP_CONFIG_COMPAT _IOWR(FM_IOC_TYPE_BASE, FM_IOC_NUM(8), ioc_compat_fm_vsp_params_t)
|
||||
#endif
|
||||
#define FM_IOC_VSP_CONFIG _IOWR(FM_IOC_TYPE_BASE, FM_IOC_NUM(8), ioc_fm_vsp_params_t)
|
||||
|
||||
/**************************************************************************//**
|
||||
@Function FM_VSP_Init
|
||||
|
||||
@Description Initializes the FM VSP module
|
||||
|
||||
@Param[in] h_FmVsp - FM VSP module descriptor
|
||||
|
||||
@Return E_OK on success; Error code otherwise.
|
||||
*//***************************************************************************/
|
||||
#if defined(FM_COMPAT)
|
||||
#define FM_IOC_VSP_INIT_COMPAT _IOW(FM_IOC_TYPE_BASE, FM_IOC_NUM(9), ioc_compat_fm_obj_t)
|
||||
#endif
|
||||
#define FM_IOC_VSP_INIT _IOW(FM_IOC_TYPE_BASE, FM_IOC_NUM(9), ioc_fm_obj_t)
|
||||
|
||||
/**************************************************************************//**
|
||||
@Function FM_VSP_Free
|
||||
|
||||
@Description Frees all resources that were assigned to FM VSP module.
|
||||
|
||||
Calling this routine invalidates the descriptor.
|
||||
|
||||
@Param[in] h_FmVsp - FM VSP module descriptor
|
||||
|
||||
@Return E_OK on success; Error code otherwise.
|
||||
*//***************************************************************************/
|
||||
#if defined(FM_COMPAT)
|
||||
#define FM_IOC_VSP_FREE_COMPAT _IOW(FM_IOC_TYPE_BASE, FM_IOC_NUM(10), ioc_compat_fm_obj_t)
|
||||
#endif
|
||||
#define FM_IOC_VSP_FREE _IOW(FM_IOC_TYPE_BASE, FM_IOC_NUM(10), ioc_fm_obj_t)
|
||||
|
||||
/**************************************************************************//**
|
||||
@Function FM_VSP_ConfigPoolDepletion
|
||||
|
||||
@Description Calling this routine enables pause frame generation depending on the
|
||||
depletion status of BM pools. It also defines the conditions to activate
|
||||
this functionality. By default, this functionality is disabled.
|
||||
|
||||
@Param[in] ioc_fm_buf_pool_depletion_params_t A structure holding the required parameters.
|
||||
|
||||
@Return E_OK on success; Error code otherwise.
|
||||
|
||||
@Cautions Allowed only following FM_VSP_Config() and before FM_VSP_Init().
|
||||
*//***************************************************************************/
|
||||
#if defined(FM_COMPAT)
|
||||
#define FM_IOC_VSP_CONFIG_POOL_DEPLETION_COMPAT _IOW(FM_IOC_TYPE_BASE, FM_IOC_NUM(11), ioc_compat_fm_buf_pool_depletion_params_t)
|
||||
#endif
|
||||
#define FM_IOC_VSP_CONFIG_POOL_DEPLETION _IOW(FM_IOC_TYPE_BASE, FM_IOC_NUM(11), ioc_fm_buf_pool_depletion_params_t)
|
||||
|
||||
/**************************************************************************//**
|
||||
@Function FM_VSP_ConfigBufferPrefixContent
|
||||
|
||||
@Description Defines the structure, size and content of the application buffer.
|
||||
|
||||
The prefix will
|
||||
In VSPs defined for Tx ports, if 'passPrsResult', the application
|
||||
should set a value to their offsets in the prefix of
|
||||
the FM will save the first 'privDataSize', than,
|
||||
depending on 'passPrsResult' and 'passTimeStamp', copy parse result
|
||||
and timeStamp, and the packet itself (in this order), to the
|
||||
application buffer, and to offset.
|
||||
|
||||
Calling this routine changes the buffer margins definitions
|
||||
in the internal driver data base from its default
|
||||
configuration: Data size: [DEFAULT_FM_SP_bufferPrefixContent_privDataSize]
|
||||
Pass Parser result: [DEFAULT_FM_SP_bufferPrefixContent_passPrsResult].
|
||||
Pass timestamp: [DEFAULT_FM_SP_bufferPrefixContent_passTimeStamp].
|
||||
|
||||
@Param[in] ioc_fm_buffer_prefix_content_params_t A structure holding the required parameters.
|
||||
|
||||
@Return E_OK on success; Error code otherwise.
|
||||
|
||||
@Cautions Allowed only following FM_VSP_Config() and before FM_VSP_Init().
|
||||
*//***************************************************************************/
|
||||
#if defined(FM_COMPAT)
|
||||
#define FM_IOC_VSP_CONFIG_BUFFER_PREFIX_CONTENT_COMPAT _IOW(FM_IOC_TYPE_BASE, FM_IOC_NUM(12), ioc_compat_fm_buffer_prefix_content_params_t)
|
||||
#endif
|
||||
#define FM_IOC_VSP_CONFIG_BUFFER_PREFIX_CONTENT _IOW(FM_IOC_TYPE_BASE, FM_IOC_NUM(12), ioc_fm_buffer_prefix_content_params_t)
|
||||
|
||||
/**************************************************************************//**
|
||||
@Function FM_VSP_ConfigNoScatherGather
|
||||
|
||||
@Description Calling this routine changes the possibility to receive S/G frame
|
||||
in the internal driver data base
|
||||
from its default configuration: optimize = [DEFAULT_FM_SP_noScatherGather]
|
||||
|
||||
@Param[in] ioc_fm_vsp_config_no_sg_params_t A structure holding the required parameters.
|
||||
|
||||
@Return E_OK on success; Error code otherwise.
|
||||
|
||||
@Cautions Allowed only following FM_VSP_Config() and before FM_VSP_Init().
|
||||
*//***************************************************************************/
|
||||
#if defined(FM_COMPAT)
|
||||
#define FM_IOC_VSP_CONFIG_NO_SG_COMPAT _IOW(FM_IOC_TYPE_BASE, FM_IOC_NUM(13), ioc_compat_fm_vsp_config_no_sg_params_t)
|
||||
#endif
|
||||
#define FM_IOC_VSP_CONFIG_NO_SG _IOW(FM_IOC_TYPE_BASE, FM_IOC_NUM(13), ioc_fm_vsp_config_no_sg_params_t)
|
||||
|
||||
/**************************************************************************//**
|
||||
@Function FM_VSP_GetBufferPrsResult
|
||||
|
||||
@Description Returns the pointer to the parse result in the data buffer.
|
||||
In Rx ports this is relevant after reception, if parse
|
||||
result is configured to be part of the data passed to the
|
||||
application. For non Rx ports it may be used to get the pointer
|
||||
of the area in the buffer where parse result should be
|
||||
initialized - if so configured.
|
||||
See FM_VSP_ConfigBufferPrefixContent for data buffer prefix
|
||||
configuration.
|
||||
|
||||
@Param[in] ioc_fm_vsp_prs_result_params_t A structure holding the required parameters.
|
||||
|
||||
@Return Parse result pointer on success, NULL if parse result was not
|
||||
configured for this port.
|
||||
|
||||
@Cautions Allowed only following FM_VSP_Init().
|
||||
*//***************************************************************************/
|
||||
#if defined(FM_COMPAT)
|
||||
#define FM_IOC_VSP_GET_BUFFER_PRS_RESULT_COMPAT _IOWR(FM_IOC_TYPE_BASE, FM_IOC_NUM(14), ioc_compat_fm_vsp_prs_result_params_t)
|
||||
#endif
|
||||
#define FM_IOC_VSP_GET_BUFFER_PRS_RESULT _IOWR(FM_IOC_TYPE_BASE, FM_IOC_NUM(14), ioc_fm_vsp_prs_result_params_t)
|
||||
|
||||
/**************************************************************************//**
|
||||
@Function FM_CtrlMonStart
|
||||
|
||||
@Description Start monitoring utilization of all available FM controllers.
|
||||
|
||||
In order to obtain FM controllers utilization the following sequence
|
||||
should be used:
|
||||
-# FM_CtrlMonStart()
|
||||
-# FM_CtrlMonStop()
|
||||
-# FM_CtrlMonGetCounters() - issued for each FM controller
|
||||
|
||||
@Return E_OK on success; Error code otherwise.
|
||||
|
||||
@Cautions Allowed only following FM_Init().
|
||||
*//***************************************************************************/
|
||||
#define FM_IOC_CTRL_MON_START _IO(FM_IOC_TYPE_BASE, FM_IOC_NUM(15))
|
||||
|
||||
|
||||
/**************************************************************************//**
|
||||
@Function FM_CtrlMonStop
|
||||
|
||||
@Description Stop monitoring utilization of all available FM controllers.
|
||||
|
||||
In order to obtain FM controllers utilization the following sequence
|
||||
should be used:
|
||||
-# FM_CtrlMonStart()
|
||||
-# FM_CtrlMonStop()
|
||||
-# FM_CtrlMonGetCounters() - issued for each FM controller
|
||||
|
||||
@Return E_OK on success; Error code otherwise.
|
||||
|
||||
@Cautions Allowed only following FM_Init().
|
||||
*//***************************************************************************/
|
||||
#define FM_IOC_CTRL_MON_STOP _IO(FM_IOC_TYPE_BASE, FM_IOC_NUM(16))
|
||||
|
||||
/**************************************************************************//**
|
||||
@Function FM_CtrlMonGetCounters
|
||||
|
||||
@Description Obtain FM controller utilization parameters.
|
||||
|
||||
In order to obtain FM controllers utilization the following sequence
|
||||
should be used:
|
||||
-# FM_CtrlMonStart()
|
||||
-# FM_CtrlMonStop()
|
||||
-# FM_CtrlMonGetCounters() - issued for each FM controller
|
||||
|
||||
@Param[in] ioc_fm_ctrl_mon_counters_params_t A structure holding the required parameters.
|
||||
|
||||
@Return E_OK on success; Error code otherwise.
|
||||
|
||||
@Cautions Allowed only following FM_Init().
|
||||
*//***************************************************************************/
|
||||
#if defined(FM_COMPAT)
|
||||
#define FM_IOC_CTRL_MON_GET_COUNTERS_COMPAT _IOW(FM_IOC_TYPE_BASE, FM_IOC_NUM(17), ioc_compat_fm_ctrl_mon_counters_params_t)
|
||||
#endif
|
||||
#define FM_IOC_CTRL_MON_GET_COUNTERS _IOW(FM_IOC_TYPE_BASE, FM_IOC_NUM(17), ioc_fm_ctrl_mon_counters_params_t)
|
||||
|
||||
/**************************************************************************//**
|
||||
@Function FM_ReadTimeStamp
|
||||
|
||||
@Description Reads the FMan engine's timestamp.
|
||||
|
||||
@Param[out] uint32_t The indicated engine's timestamp
|
||||
|
||||
@Return E_OK on success; Error code otherwise.
|
||||
|
||||
@Cautions Allowed only following FM_Init().
|
||||
*//***************************************************************************/
|
||||
#define FM_IOC_READ_TIMESTAMP _IOWR(FM_IOC_TYPE_BASE, FM_IOC_NUM(18), uint32_t)
|
||||
|
||||
/**************************************************************************//**
|
||||
@Function FM_GetTimeStampIncrementPerUsec
|
||||
|
||||
@Description Provides the value of the FMan engine's timestamp increment
|
||||
per microsecond.
|
||||
|
||||
@Param[out] uint32_t The value the timestamp is
|
||||
incremented with each microsecond
|
||||
|
||||
@Return E_OK on success; Error code otherwise.
|
||||
|
||||
@Cautions Allowed only following FM_Init().
|
||||
*//***************************************************************************/
|
||||
#define FM_IOC_GET_TIMESTAMP_INCREMENT _IOWR(FM_IOC_TYPE_BASE, FM_IOC_NUM(19), uint32_t)
|
||||
|
||||
/** @} */ /* end of lnx_ioctl_FM_runtime_control_grp group */
|
||||
/** @} */ /* end of lnx_ioctl_FM_lib_grp group */
|
||||
/** @} */ /* end of lnx_ioctl_FM_grp */
|
||||
|
||||
#define FMD_API_VERSION_MAJOR 21
|
||||
#define FMD_API_VERSION_MINOR 1
|
||||
#define FMD_API_VERSION_RESPIN 0
|
||||
|
||||
#endif /* __FM_IOCTLS_H */
|
||||
2982
sys/contrib/ncsw/inc/ioctls/fm_pcd_ioctls.h
Normal file
2982
sys/contrib/ncsw/inc/ioctls/fm_pcd_ioctls.h
Normal file
File diff suppressed because it is too large
Load diff
56
sys/contrib/ncsw/inc/ioctls/integration_ioctls.h
Normal file
56
sys/contrib/ncsw/inc/ioctls/integration_ioctls.h
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
/* Copyright (c) 2008-2012 Freescale Semiconductor, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of Freescale Semiconductor nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
*
|
||||
* ALTERNATIVELY, this software may be distributed under the terms of the
|
||||
* GNU General Public License ("GPL") as published by the Free Software
|
||||
* Foundation, either version 2 of that License or (at your option) any
|
||||
* later version.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/**************************************************************************//**
|
||||
@File integration_ioctls.h
|
||||
|
||||
@Description External header file for Integration unit routines.
|
||||
*//***************************************************************************/
|
||||
|
||||
#ifndef __INTG_IOCTLS_H
|
||||
#define __INTG_IOCTLS_H
|
||||
|
||||
|
||||
#define FM_IOC_TYPE_BASE (NCSW_IOC_TYPE_BASE+1)
|
||||
#define FMT_IOC_TYPE_BASE (NCSW_IOC_TYPE_BASE+3)
|
||||
|
||||
/*#define FM_IOCTL_DBG*/
|
||||
|
||||
#if defined(FM_IOCTL_DBG)
|
||||
#define _fm_ioctl_dbg(format, arg...) \
|
||||
printk("fm ioctl [%s:%u](cpu:%u) - " format, \
|
||||
__func__, __LINE__, smp_processor_id(), ##arg)
|
||||
#else
|
||||
# define _fm_ioctl_dbg(arg...)
|
||||
#endif
|
||||
|
||||
#endif /* __INTG_IOCTLS_H */
|
||||
96
sys/contrib/ncsw/inc/ioctls/ioctls.h
Normal file
96
sys/contrib/ncsw/inc/ioctls/ioctls.h
Normal file
|
|
@ -0,0 +1,96 @@
|
|||
/* Copyright (c) 2008-2012 Freescale Semiconductor, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of Freescale Semiconductor nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
*
|
||||
* ALTERNATIVELY, this software may be distributed under the terms of the
|
||||
* GNU General Public License ("GPL") as published by the Free Software
|
||||
* Foundation, either version 2 of that License or (at your option) any
|
||||
* later version.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/**************************************************************************//**
|
||||
@File ioctls.h
|
||||
|
||||
@Description Structures and definitions for Command Relay Ioctls
|
||||
*//***************************************************************************/
|
||||
|
||||
#ifndef __IOCTLS_H__
|
||||
#define __IOCTLS_H__
|
||||
|
||||
#include <sys/ioccom.h>
|
||||
|
||||
#include "integration_ioctls.h"
|
||||
|
||||
|
||||
/**************************************************************************//**
|
||||
@Group lnx_ioctl_ncsw_grp NetCommSw Linux User-Space (IOCTL) API
|
||||
@{
|
||||
*//***************************************************************************/
|
||||
|
||||
#define NCSW_IOC_TYPE_BASE 0xe0 /**< defines the IOCTL type for all
|
||||
the NCSW Linux module commands */
|
||||
|
||||
|
||||
/**************************************************************************//**
|
||||
@Description IOCTL Memory allocation types.
|
||||
*//***************************************************************************/
|
||||
typedef enum ioc_mem_type {
|
||||
e_IOC_MEM_INVALID = 0x00000000, /**< Invalid memory type (error) */
|
||||
e_IOC_MEM_CACHABLE_SYS = 0x00000001, /**< Primary DDR, cacheable segment */
|
||||
e_IOC_MEM_NOCACHE_SYS = 0x00000004, /**< Primary DDR, non-cacheable segment */
|
||||
e_IOC_MEM_SECONDARY = 0x00000002, /**< Either secondary DDR or SDRAM */
|
||||
e_IOC_MEM_PRAM = 0x00000008 /**< Multi-user RAM identifier */
|
||||
} ioc_mem_type;
|
||||
|
||||
/**************************************************************************//**
|
||||
@Description Enumeration (bit flags) of communication modes (Transmit,
|
||||
receive or both).
|
||||
*//***************************************************************************/
|
||||
typedef enum ioc_comm_mode {
|
||||
e_IOC_COMM_MODE_NONE = 0 /**< No transmit/receive communication */
|
||||
, e_IOC_COMM_MODE_RX = 1 /**< Only receive communication */
|
||||
, e_IOC_COMM_MODE_TX = 2 /**< Only transmit communication */
|
||||
, e_IOC_COMM_MODE_RX_AND_TX = 3 /**< Both transmit and receive communication */
|
||||
} ioc_comm_mode;
|
||||
|
||||
/**************************************************************************//**
|
||||
@Description General Diagnostic Mode
|
||||
*//***************************************************************************/
|
||||
typedef enum ioc_diag_mode
|
||||
{
|
||||
e_IOC_DIAG_MODE_NONE = 0,
|
||||
e_IOC_DIAG_MODE_CTRL_LOOPBACK, /**< loopback in the controller; E.g. MAC, TDM, etc. */
|
||||
e_IOC_DIAG_MODE_CHIP_LOOPBACK, /**< loopback in the chip but not in controller;
|
||||
E.g. IO-pins, SerDes, etc. */
|
||||
e_IOC_DIAG_MODE_PHY_LOOPBACK, /**< loopback in the external PHY */
|
||||
e_IOC_DIAG_MODE_LINE_LOOPBACK, /**< loopback in the external line */
|
||||
e_IOC_DIAG_MODE_CTRL_ECHO, /**< */
|
||||
e_IOC_DIAG_MODE_PHY_ECHO /**< */
|
||||
} ioc_diag_mode;
|
||||
|
||||
/** @} */ /* end of lnx_ioctl_ncsw_grp */
|
||||
|
||||
|
||||
#endif /* __IOCTLS_H__ */
|
||||
430
sys/contrib/ncsw/inc/ioctls/net_ioctls.h
Normal file
430
sys/contrib/ncsw/inc/ioctls/net_ioctls.h
Normal file
|
|
@ -0,0 +1,430 @@
|
|||
/* Copyright (c) 2008-2012 Freescale Semiconductor, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of Freescale Semiconductor nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
*
|
||||
* ALTERNATIVELY, this software may be distributed under the terms of the
|
||||
* GNU General Public License ("GPL") as published by the Free Software
|
||||
* Foundation, either version 2 of that License or (at your option) any
|
||||
* later version.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************//**
|
||||
@File net_ioctls.h
|
||||
|
||||
@Description This file contains common and general netcomm headers definitions.
|
||||
*//***************************************************************************/
|
||||
#ifndef __NET_IOCTLS_H
|
||||
#define __NET_IOCTLS_H
|
||||
|
||||
#include "ioctls.h"
|
||||
|
||||
|
||||
typedef uint8_t ioc_header_field_ppp_t;
|
||||
|
||||
#define IOC_NET_HEADER_FIELD_PPP_PID (1)
|
||||
#define IOC_NET_HEADER_FIELD_PPP_COMPRESSED (IOC_NET_HEADER_FIELD_PPP_PID << 1)
|
||||
#define IOC_NET_HEADER_FIELD_PPP_ALL_FIELDS ((IOC_NET_HEADER_FIELD_PPP_PID << 2) - 1)
|
||||
|
||||
|
||||
typedef uint8_t ioc_header_field_pppoe_t;
|
||||
|
||||
#define IOC_NET_HEADER_FIELD_PPPoE_VER (1)
|
||||
#define IOC_NET_HEADER_FIELD_PPPoE_TYPE (IOC_NET_HEADER_FIELD_PPPoE_VER << 1)
|
||||
#define IOC_NET_HEADER_FIELD_PPPoE_CODE (IOC_NET_HEADER_FIELD_PPPoE_VER << 2)
|
||||
#define IOC_NET_HEADER_FIELD_PPPoE_SID (IOC_NET_HEADER_FIELD_PPPoE_VER << 3)
|
||||
#define IOC_NET_HEADER_FIELD_PPPoE_LEN (IOC_NET_HEADER_FIELD_PPPoE_VER << 4)
|
||||
#define IOC_NET_HEADER_FIELD_PPPoE_SESSION (IOC_NET_HEADER_FIELD_PPPoE_VER << 5)
|
||||
#define IOC_NET_HEADER_FIELD_PPPoE_PID (IOC_NET_HEADER_FIELD_PPPoE_VER << 6)
|
||||
#define IOC_NET_HEADER_FIELD_PPPoE_ALL_FIELDS ((IOC_NET_HEADER_FIELD_PPPoE_VER << 7) - 1)
|
||||
|
||||
#define IOC_NET_HEADER_FIELD_PPPMUX_PID (1)
|
||||
#define IOC_NET_HEADER_FIELD_PPPMUX_CKSUM (IOC_NET_HEADER_FIELD_PPPMUX_PID << 1)
|
||||
#define IOC_NET_HEADER_FIELD_PPPMUX_COMPRESSED (IOC_NET_HEADER_FIELD_PPPMUX_PID << 2)
|
||||
#define IOC_NET_HEADER_FIELD_PPPMUX_ALL_FIELDS ((IOC_NET_HEADER_FIELD_PPPMUX_PID << 3) - 1)
|
||||
|
||||
#define IOC_NET_HEADER_FIELD_PPPMUX_SUBFRAME_PFF (1)
|
||||
#define IOC_NET_HEADER_FIELD_PPPMUX_SUBFRAME_LXT (IOC_NET_HEADER_FIELD_PPPMUX_SUBFRAME_PFF << 1)
|
||||
#define IOC_NET_HEADER_FIELD_PPPMUX_SUBFRAME_LEN (IOC_NET_HEADER_FIELD_PPPMUX_SUBFRAME_PFF << 2)
|
||||
#define IOC_NET_HEADER_FIELD_PPPMUX_SUBFRAME_PID (IOC_NET_HEADER_FIELD_PPPMUX_SUBFRAME_PFF << 3)
|
||||
#define IOC_NET_HEADER_FIELD_PPPMUX_SUBFRAME_USE_PID (IOC_NET_HEADER_FIELD_PPPMUX_SUBFRAME_PFF << 4)
|
||||
#define IOC_NET_HEADER_FIELD_PPPMUX_SUBFRAME_ALL_FIELDS ((IOC_NET_HEADER_FIELD_PPPMUX_SUBFRAME_PFF << 5) - 1)
|
||||
|
||||
|
||||
typedef uint8_t ioc_header_field_eth_t;
|
||||
|
||||
#define IOC_NET_HEADER_FIELD_ETH_DA (1)
|
||||
#define IOC_NET_HEADER_FIELD_ETH_SA (IOC_NET_HEADER_FIELD_ETH_DA << 1)
|
||||
#define IOC_NET_HEADER_FIELD_ETH_LENGTH (IOC_NET_HEADER_FIELD_ETH_DA << 2)
|
||||
#define IOC_NET_HEADER_FIELD_ETH_TYPE (IOC_NET_HEADER_FIELD_ETH_DA << 3)
|
||||
#define IOC_NET_HEADER_FIELD_ETH_FINAL_CKSUM (IOC_NET_HEADER_FIELD_ETH_DA << 4)
|
||||
#define IOC_NET_HEADER_FIELD_ETH_PADDING (IOC_NET_HEADER_FIELD_ETH_DA << 5)
|
||||
#define IOC_NET_HEADER_FIELD_ETH_ALL_FIELDS ((IOC_NET_HEADER_FIELD_ETH_DA << 6) - 1)
|
||||
|
||||
#define IOC_NET_HEADER_FIELD_ETH_ADDR_SIZE 6
|
||||
|
||||
typedef uint16_t ioc_header_field_ip_t;
|
||||
|
||||
#define IOC_NET_HEADER_FIELD_IP_VER (1)
|
||||
#define IOC_NET_HEADER_FIELD_IP_DSCP (IOC_NET_HEADER_FIELD_IP_VER << 2)
|
||||
#define IOC_NET_HEADER_FIELD_IP_ECN (IOC_NET_HEADER_FIELD_IP_VER << 3)
|
||||
#define IOC_NET_HEADER_FIELD_IP_PROTO (IOC_NET_HEADER_FIELD_IP_VER << 4)
|
||||
|
||||
#define IOC_NET_HEADER_FIELD_IP_PROTO_SIZE 1
|
||||
|
||||
typedef uint16_t ioc_header_field_ipv4_t;
|
||||
|
||||
#define IOC_NET_HEADER_FIELD_IPv4_VER (1)
|
||||
#define IOC_NET_HEADER_FIELD_IPv4_HDR_LEN (IOC_NET_HEADER_FIELD_IPv4_VER << 1)
|
||||
#define IOC_NET_HEADER_FIELD_IPv4_TOS (IOC_NET_HEADER_FIELD_IPv4_VER << 2)
|
||||
#define IOC_NET_HEADER_FIELD_IPv4_TOTAL_LEN (IOC_NET_HEADER_FIELD_IPv4_VER << 3)
|
||||
#define IOC_NET_HEADER_FIELD_IPv4_ID (IOC_NET_HEADER_FIELD_IPv4_VER << 4)
|
||||
#define IOC_NET_HEADER_FIELD_IPv4_FLAG_D (IOC_NET_HEADER_FIELD_IPv4_VER << 5)
|
||||
#define IOC_NET_HEADER_FIELD_IPv4_FLAG_M (IOC_NET_HEADER_FIELD_IPv4_VER << 6)
|
||||
#define IOC_NET_HEADER_FIELD_IPv4_OFFSET (IOC_NET_HEADER_FIELD_IPv4_VER << 7)
|
||||
#define IOC_NET_HEADER_FIELD_IPv4_TTL (IOC_NET_HEADER_FIELD_IPv4_VER << 8)
|
||||
#define IOC_NET_HEADER_FIELD_IPv4_PROTO (IOC_NET_HEADER_FIELD_IPv4_VER << 9)
|
||||
#define IOC_NET_HEADER_FIELD_IPv4_CKSUM (IOC_NET_HEADER_FIELD_IPv4_VER << 10)
|
||||
#define IOC_NET_HEADER_FIELD_IPv4_SRC_IP (IOC_NET_HEADER_FIELD_IPv4_VER << 11)
|
||||
#define IOC_NET_HEADER_FIELD_IPv4_DST_IP (IOC_NET_HEADER_FIELD_IPv4_VER << 12)
|
||||
#define IOC_NET_HEADER_FIELD_IPv4_OPTS (IOC_NET_HEADER_FIELD_IPv4_VER << 13)
|
||||
#define IOC_NET_HEADER_FIELD_IPv4_OPTS_COUNT (IOC_NET_HEADER_FIELD_IPv4_VER << 14)
|
||||
#define IOC_NET_HEADER_FIELD_IPv4_ALL_FIELDS ((IOC_NET_HEADER_FIELD_IPv4_VER << 15) - 1)
|
||||
|
||||
#define IOC_NET_HEADER_FIELD_IPv4_ADDR_SIZE 4
|
||||
#define IOC_NET_HEADER_FIELD_IPv4_PROTO_SIZE 1
|
||||
|
||||
|
||||
typedef uint8_t ioc_header_field_ipv6_t;
|
||||
|
||||
#define IOC_NET_HEADER_FIELD_IPv6_VER (1)
|
||||
#define IOC_NET_HEADER_FIELD_IPv6_TC (IOC_NET_HEADER_FIELD_IPv6_VER << 1)
|
||||
#define IOC_NET_HEADER_FIELD_IPv6_SRC_IP (IOC_NET_HEADER_FIELD_IPv6_VER << 2)
|
||||
#define IOC_NET_HEADER_FIELD_IPv6_DST_IP (IOC_NET_HEADER_FIELD_IPv6_VER << 3)
|
||||
#define IOC_NET_HEADER_FIELD_IPv6_NEXT_HDR (IOC_NET_HEADER_FIELD_IPv6_VER << 4)
|
||||
#define IOC_NET_HEADER_FIELD_IPv6_FL (IOC_NET_HEADER_FIELD_IPv6_VER << 5)
|
||||
#define IOC_NET_HEADER_FIELD_IPv6_HOP_LIMIT (IOC_NET_HEADER_FIELD_IPv6_VER << 6)
|
||||
#define IOC_NET_HEADER_FIELD_IPv6_ALL_FIELDS ((IOC_NET_HEADER_FIELD_IPv6_VER << 7) - 1)
|
||||
|
||||
#define IOC_NET_HEADER_FIELD_IPv6_ADDR_SIZE 16
|
||||
#define IOC_NET_HEADER_FIELD_IPv6_NEXT_HDR_SIZE 1
|
||||
|
||||
#define IOC_NET_HEADER_FIELD_ICMP_TYPE (1)
|
||||
#define IOC_NET_HEADER_FIELD_ICMP_CODE (IOC_NET_HEADER_FIELD_ICMP_TYPE << 1)
|
||||
#define IOC_NET_HEADER_FIELD_ICMP_CKSUM (IOC_NET_HEADER_FIELD_ICMP_TYPE << 2)
|
||||
#define IOC_NET_HEADER_FIELD_ICMP_ID (IOC_NET_HEADER_FIELD_ICMP_TYPE << 3)
|
||||
#define IOC_NET_HEADER_FIELD_ICMP_SQ_NUM (IOC_NET_HEADER_FIELD_ICMP_TYPE << 4)
|
||||
#define IOC_NET_HEADER_FIELD_ICMP_ALL_FIELDS ((IOC_NET_HEADER_FIELD_ICMP_TYPE << 5) - 1)
|
||||
|
||||
#define IOC_NET_HEADER_FIELD_ICMP_CODE_SIZE 1
|
||||
#define IOC_NET_HEADER_FIELD_ICMP_TYPE_SIZE 1
|
||||
|
||||
#define IOC_NET_HEADER_FIELD_IGMP_VERSION (1)
|
||||
#define IOC_NET_HEADER_FIELD_IGMP_TYPE (IOC_NET_HEADER_FIELD_IGMP_VERSION << 1)
|
||||
#define IOC_NET_HEADER_FIELD_IGMP_CKSUM (IOC_NET_HEADER_FIELD_IGMP_VERSION << 2)
|
||||
#define IOC_NET_HEADER_FIELD_IGMP_DATA (IOC_NET_HEADER_FIELD_IGMP_VERSION << 3)
|
||||
#define IOC_NET_HEADER_FIELD_IGMP_ALL_FIELDS ((IOC_NET_HEADER_FIELD_IGMP_VERSION << 4) - 1)
|
||||
|
||||
|
||||
typedef uint16_t ioc_header_field_tcp_t;
|
||||
|
||||
#define IOC_NET_HEADER_FIELD_TCP_PORT_SRC (1)
|
||||
#define IOC_NET_HEADER_FIELD_TCP_PORT_DST (IOC_NET_HEADER_FIELD_TCP_PORT_SRC << 1)
|
||||
#define IOC_NET_HEADER_FIELD_TCP_SEQ (IOC_NET_HEADER_FIELD_TCP_PORT_SRC << 2)
|
||||
#define IOC_NET_HEADER_FIELD_TCP_ACK (IOC_NET_HEADER_FIELD_TCP_PORT_SRC << 3)
|
||||
#define IOC_NET_HEADER_FIELD_TCP_OFFSET (IOC_NET_HEADER_FIELD_TCP_PORT_SRC << 4)
|
||||
#define IOC_NET_HEADER_FIELD_TCP_FLAGS (IOC_NET_HEADER_FIELD_TCP_PORT_SRC << 5)
|
||||
#define IOC_NET_HEADER_FIELD_TCP_WINDOW (IOC_NET_HEADER_FIELD_TCP_PORT_SRC << 6)
|
||||
#define IOC_NET_HEADER_FIELD_TCP_CKSUM (IOC_NET_HEADER_FIELD_TCP_PORT_SRC << 7)
|
||||
#define IOC_NET_HEADER_FIELD_TCP_URGPTR (IOC_NET_HEADER_FIELD_TCP_PORT_SRC << 8)
|
||||
#define IOC_NET_HEADER_FIELD_TCP_OPTS (IOC_NET_HEADER_FIELD_TCP_PORT_SRC << 9)
|
||||
#define IOC_NET_HEADER_FIELD_TCP_OPTS_COUNT (IOC_NET_HEADER_FIELD_TCP_PORT_SRC << 10)
|
||||
#define IOC_NET_HEADER_FIELD_TCP_ALL_FIELDS ((IOC_NET_HEADER_FIELD_TCP_PORT_SRC << 11) - 1)
|
||||
|
||||
#define IOC_NET_HEADER_FIELD_TCP_PORT_SIZE 2
|
||||
|
||||
|
||||
typedef uint8_t ioc_header_field_sctp_t;
|
||||
|
||||
#define IOC_NET_HEADER_FIELD_SCTP_PORT_SRC (1)
|
||||
#define IOC_NET_HEADER_FIELD_SCTP_PORT_DST (IOC_NET_HEADER_FIELD_SCTP_PORT_SRC << 1)
|
||||
#define IOC_NET_HEADER_FIELD_SCTP_VER_TAG (IOC_NET_HEADER_FIELD_SCTP_PORT_SRC << 2)
|
||||
#define IOC_NET_HEADER_FIELD_SCTP_CKSUM (IOC_NET_HEADER_FIELD_SCTP_PORT_SRC << 3)
|
||||
#define IOC_NET_HEADER_FIELD_SCTP_ALL_FIELDS ((IOC_NET_HEADER_FIELD_SCTP_PORT_SRC << 4) - 1)
|
||||
|
||||
#define IOC_NET_HEADER_FIELD_SCTP_PORT_SIZE 2
|
||||
|
||||
typedef uint8_t ioc_header_field_dccp_t;
|
||||
|
||||
#define IOC_NET_HEADER_FIELD_DCCP_PORT_SRC (1)
|
||||
#define IOC_NET_HEADER_FIELD_DCCP_PORT_DST (IOC_NET_HEADER_FIELD_DCCP_PORT_SRC << 1)
|
||||
#define IOC_NET_HEADER_FIELD_DCCP_ALL_FIELDS ((IOC_NET_HEADER_FIELD_DCCP_PORT_SRC << 2) - 1)
|
||||
|
||||
#define IOC_NET_HEADER_FIELD_DCCP_PORT_SIZE 2
|
||||
|
||||
|
||||
typedef uint8_t ioc_header_field_udp_t;
|
||||
|
||||
#define IOC_NET_HEADER_FIELD_UDP_PORT_SRC (1)
|
||||
#define IOC_NET_HEADER_FIELD_UDP_PORT_DST (IOC_NET_HEADER_FIELD_UDP_PORT_SRC << 1)
|
||||
#define IOC_NET_HEADER_FIELD_UDP_LEN (IOC_NET_HEADER_FIELD_UDP_PORT_SRC << 2)
|
||||
#define IOC_NET_HEADER_FIELD_UDP_CKSUM (IOC_NET_HEADER_FIELD_UDP_PORT_SRC << 3)
|
||||
#define IOC_NET_HEADER_FIELD_UDP_ALL_FIELDS ((IOC_NET_HEADER_FIELD_UDP_PORT_SRC << 4) - 1)
|
||||
|
||||
#define IOC_NET_HEADER_FIELD_UDP_PORT_SIZE 2
|
||||
|
||||
typedef uint8_t ioc_header_field_udp_lite_t;
|
||||
|
||||
#define IOC_NET_HEADER_FIELD_UDP_LITE_PORT_SRC (1)
|
||||
#define IOC_NET_HEADER_FIELD_UDP_LITE_PORT_DST (IOC_NET_HEADER_FIELD_UDP_LITE_PORT_SRC << 1)
|
||||
#define IOC_NET_HEADER_FIELD_UDP_LITE_ALL_FIELDS ((IOC_NET_HEADER_FIELD_UDP_LITE_PORT_SRC << 2) - 1)
|
||||
|
||||
#define IOC_NET_HEADER_FIELD_UDP_LITE_PORT_SIZE 2
|
||||
|
||||
typedef uint8_t ioc_header_field_udp_encap_esp_t;
|
||||
|
||||
#define IOC_NET_HEADER_FIELD_UDP_ENCAP_ESP_PORT_SRC (1)
|
||||
#define IOC_NET_HEADER_FIELD_UDP_ENCAP_ESP_PORT_DST (IOC_NET_HEADER_FIELD_UDP_ENCAP_ESP_PORT_SRC << 1)
|
||||
#define IOC_NET_HEADER_FIELD_UDP_ENCAP_ESP_LEN (IOC_NET_HEADER_FIELD_UDP_ENCAP_ESP_PORT_SRC << 2)
|
||||
#define IOC_NET_HEADER_FIELD_UDP_ENCAP_ESP_CKSUM (IOC_NET_HEADER_FIELD_UDP_ENCAP_ESP_PORT_SRC << 3)
|
||||
#define IOC_NET_HEADER_FIELD_UDP_ENCAP_ESP_SPI (IOC_NET_HEADER_FIELD_UDP_ENCAP_ESP_PORT_SRC << 4)
|
||||
#define IOC_NET_HEADER_FIELD_UDP_ENCAP_ESP_SEQUENCE_NUM (IOC_NET_HEADER_FIELD_UDP_ENCAP_ESP_PORT_SRC << 5)
|
||||
#define IOC_NET_HEADER_FIELD_UDP_ENCAP_ESP_ALL_FIELDS ((IOC_NET_HEADER_FIELD_UDP_ENCAP_ESP_PORT_SRC << 6) - 1)
|
||||
|
||||
#define IOC_NET_HEADER_FIELD_UDP_ENCAP_ESP_PORT_SIZE 2
|
||||
#define IOC_NET_HEADER_FIELD_UDP_ENCAP_ESP_SPI_SIZE 4
|
||||
|
||||
#define IOC_NET_HEADER_FIELD_IPHC_CID (1)
|
||||
#define IOC_NET_HEADER_FIELD_IPHC_CID_TYPE (IOC_NET_HEADER_FIELD_IPHC_CID << 1)
|
||||
#define IOC_NET_HEADER_FIELD_IPHC_HCINDEX (IOC_NET_HEADER_FIELD_IPHC_CID << 2)
|
||||
#define IOC_NET_HEADER_FIELD_IPHC_GEN (IOC_NET_HEADER_FIELD_IPHC_CID << 3)
|
||||
#define IOC_NET_HEADER_FIELD_IPHC_D_BIT (IOC_NET_HEADER_FIELD_IPHC_CID << 4)
|
||||
#define IOC_NET_HEADER_FIELD_IPHC_ALL_FIELDS ((IOC_NET_HEADER_FIELD_IPHC_CID << 5) - 1)
|
||||
|
||||
#define IOC_NET_HEADER_FIELD_SCTP_CHUNK_DATA_TYPE (1)
|
||||
#define IOC_NET_HEADER_FIELD_SCTP_CHUNK_DATA_FLAGS (IOC_NET_HEADER_FIELD_SCTP_CHUNK_DATA_TYPE << 1)
|
||||
#define IOC_NET_HEADER_FIELD_SCTP_CHUNK_DATA_LENGTH (IOC_NET_HEADER_FIELD_SCTP_CHUNK_DATA_TYPE << 2)
|
||||
#define IOC_NET_HEADER_FIELD_SCTP_CHUNK_DATA_TSN (IOC_NET_HEADER_FIELD_SCTP_CHUNK_DATA_TYPE << 3)
|
||||
#define IOC_NET_HEADER_FIELD_SCTP_CHUNK_DATA_STREAM_ID (IOC_NET_HEADER_FIELD_SCTP_CHUNK_DATA_TYPE << 4)
|
||||
#define IOC_NET_HEADER_FIELD_SCTP_CHUNK_DATA_STREAM_SQN (IOC_NET_HEADER_FIELD_SCTP_CHUNK_DATA_TYPE << 5)
|
||||
#define IOC_NET_HEADER_FIELD_SCTP_CHUNK_DATA_PAYLOAD_PID (IOC_NET_HEADER_FIELD_SCTP_CHUNK_DATA_TYPE << 6)
|
||||
#define IOC_NET_HEADER_FIELD_SCTP_CHUNK_DATA_UNORDERED (IOC_NET_HEADER_FIELD_SCTP_CHUNK_DATA_TYPE << 7)
|
||||
#define IOC_NET_HEADER_FIELD_SCTP_CHUNK_DATA_BEGGINING (IOC_NET_HEADER_FIELD_SCTP_CHUNK_DATA_TYPE << 8)
|
||||
#define IOC_NET_HEADER_FIELD_SCTP_CHUNK_DATA_END (IOC_NET_HEADER_FIELD_SCTP_CHUNK_DATA_TYPE << 9)
|
||||
#define IOC_NET_HEADER_FIELD_SCTP_CHUNK_DATA_ALL_FIELDS ((IOC_NET_HEADER_FIELD_SCTP_CHUNK_DATA_TYPE << 10) - 1)
|
||||
|
||||
#define IOC_NET_HEADER_FIELD_L2TPv2_TYPE_BIT (1)
|
||||
#define IOC_NET_HEADER_FIELD_L2TPv2_LENGTH_BIT (IOC_NET_HEADER_FIELD_L2TPv2_TYPE_BIT << 1)
|
||||
#define IOC_NET_HEADER_FIELD_L2TPv2_SEQUENCE_BIT (IOC_NET_HEADER_FIELD_L2TPv2_TYPE_BIT << 2)
|
||||
#define IOC_NET_HEADER_FIELD_L2TPv2_OFFSET_BIT (IOC_NET_HEADER_FIELD_L2TPv2_TYPE_BIT << 3)
|
||||
#define IOC_NET_HEADER_FIELD_L2TPv2_PRIORITY_BIT (IOC_NET_HEADER_FIELD_L2TPv2_TYPE_BIT << 4)
|
||||
#define IOC_NET_HEADER_FIELD_L2TPv2_VERSION (IOC_NET_HEADER_FIELD_L2TPv2_TYPE_BIT << 5)
|
||||
#define IOC_NET_HEADER_FIELD_L2TPv2_LEN (IOC_NET_HEADER_FIELD_L2TPv2_TYPE_BIT << 6)
|
||||
#define IOC_NET_HEADER_FIELD_L2TPv2_TUNNEL_ID (IOC_NET_HEADER_FIELD_L2TPv2_TYPE_BIT << 7)
|
||||
#define IOC_NET_HEADER_FIELD_L2TPv2_SESSION_ID (IOC_NET_HEADER_FIELD_L2TPv2_TYPE_BIT << 8)
|
||||
#define IOC_NET_HEADER_FIELD_L2TPv2_NS (IOC_NET_HEADER_FIELD_L2TPv2_TYPE_BIT << 9)
|
||||
#define IOC_NET_HEADER_FIELD_L2TPv2_NR (IOC_NET_HEADER_FIELD_L2TPv2_TYPE_BIT << 10)
|
||||
#define IOC_NET_HEADER_FIELD_L2TPv2_OFFSET_SIZE (IOC_NET_HEADER_FIELD_L2TPv2_TYPE_BIT << 11)
|
||||
#define IOC_NET_HEADER_FIELD_L2TPv2_FIRST_BYTE (IOC_NET_HEADER_FIELD_L2TPv2_TYPE_BIT << 12)
|
||||
#define IOC_NET_HEADER_FIELD_L2TPv2_ALL_FIELDS ((IOC_NET_HEADER_FIELD_L2TPv2_TYPE_BIT << 13) - 1)
|
||||
|
||||
#define IOC_NET_HEADER_FIELD_L2TPv3_CTRL_TYPE_BIT (1)
|
||||
#define IOC_NET_HEADER_FIELD_L2TPv3_CTRL_LENGTH_BIT (IOC_NET_HEADER_FIELD_L2TPv3_CTRL_TYPE_BIT << 1)
|
||||
#define IOC_NET_HEADER_FIELD_L2TPv3_CTRL_SEQUENCE_BIT (IOC_NET_HEADER_FIELD_L2TPv3_CTRL_TYPE_BIT << 2)
|
||||
#define IOC_NET_HEADER_FIELD_L2TPv3_CTRL_VERSION (IOC_NET_HEADER_FIELD_L2TPv3_CTRL_TYPE_BIT << 3)
|
||||
#define IOC_NET_HEADER_FIELD_L2TPv3_CTRL_LENGTH (IOC_NET_HEADER_FIELD_L2TPv3_CTRL_TYPE_BIT << 4)
|
||||
#define IOC_NET_HEADER_FIELD_L2TPv3_CTRL_CONTROL (IOC_NET_HEADER_FIELD_L2TPv3_CTRL_TYPE_BIT << 5)
|
||||
#define IOC_NET_HEADER_FIELD_L2TPv3_CTRL_SENT (IOC_NET_HEADER_FIELD_L2TPv3_CTRL_TYPE_BIT << 6)
|
||||
#define IOC_NET_HEADER_FIELD_L2TPv3_CTRL_RECV (IOC_NET_HEADER_FIELD_L2TPv3_CTRL_TYPE_BIT << 7)
|
||||
#define IOC_NET_HEADER_FIELD_L2TPv3_CTRL_FIRST_BYTE (IOC_NET_HEADER_FIELD_L2TPv3_CTRL_TYPE_BIT << 8)
|
||||
#define IOC_NET_HEADER_FIELD_L2TPv3_CTRL_ALL_FIELDS ((IOC_NET_HEADER_FIELD_L2TPv3_CTRL_TYPE_BIT << 9) - 1)
|
||||
|
||||
#define IOC_NET_HEADER_FIELD_L2TPv3_SESS_TYPE_BIT (1)
|
||||
#define IOC_NET_HEADER_FIELD_L2TPv3_SESS_VERSION (IOC_NET_HEADER_FIELD_L2TPv3_SESS_TYPE_BIT << 1)
|
||||
#define IOC_NET_HEADER_FIELD_L2TPv3_SESS_ID (IOC_NET_HEADER_FIELD_L2TPv3_SESS_TYPE_BIT << 2)
|
||||
#define IOC_NET_HEADER_FIELD_L2TPv3_SESS_COOKIE (IOC_NET_HEADER_FIELD_L2TPv3_SESS_TYPE_BIT << 3)
|
||||
#define IOC_NET_HEADER_FIELD_L2TPv3_SESS_ALL_FIELDS ((IOC_NET_HEADER_FIELD_L2TPv3_SESS_TYPE_BIT << 4) - 1)
|
||||
|
||||
|
||||
typedef uint8_t ioc_header_field_vlan_t;
|
||||
|
||||
#define IOC_NET_HEADER_FIELD_VLAN_VPRI (1)
|
||||
#define IOC_NET_HEADER_FIELD_VLAN_CFI (IOC_NET_HEADER_FIELD_VLAN_VPRI << 1)
|
||||
#define IOC_NET_HEADER_FIELD_VLAN_VID (IOC_NET_HEADER_FIELD_VLAN_VPRI << 2)
|
||||
#define IOC_NET_HEADER_FIELD_VLAN_LENGTH (IOC_NET_HEADER_FIELD_VLAN_VPRI << 3)
|
||||
#define IOC_NET_HEADER_FIELD_VLAN_TYPE (IOC_NET_HEADER_FIELD_VLAN_VPRI << 4)
|
||||
#define IOC_NET_HEADER_FIELD_VLAN_ALL_FIELDS ((IOC_NET_HEADER_FIELD_VLAN_VPRI << 5) - 1)
|
||||
|
||||
#define IOC_NET_HEADER_FIELD_VLAN_TCI (IOC_NET_HEADER_FIELD_VLAN_VPRI | \
|
||||
IOC_NET_HEADER_FIELD_VLAN_CFI | \
|
||||
IOC_NET_HEADER_FIELD_VLAN_VID)
|
||||
|
||||
|
||||
typedef uint8_t ioc_header_field_llc_t;
|
||||
|
||||
#define IOC_NET_HEADER_FIELD_LLC_DSAP (1)
|
||||
#define IOC_NET_HEADER_FIELD_LLC_SSAP (IOC_NET_HEADER_FIELD_LLC_DSAP << 1)
|
||||
#define IOC_NET_HEADER_FIELD_LLC_CTRL (IOC_NET_HEADER_FIELD_LLC_DSAP << 2)
|
||||
#define IOC_NET_HEADER_FIELD_LLC_ALL_FIELDS ((IOC_NET_HEADER_FIELD_LLC_DSAP << 3) - 1)
|
||||
|
||||
#define IOC_NET_HEADER_FIELD_NLPID_NLPID (1)
|
||||
#define IOC_NET_HEADER_FIELD_NLPID_ALL_FIELDS ((IOC_NET_HEADER_FIELD_NLPID_NLPID << 1) - 1)
|
||||
|
||||
|
||||
typedef uint8_t ioc_header_field_snap_t;
|
||||
|
||||
#define IOC_NET_HEADER_FIELD_SNAP_OUI (1)
|
||||
#define IOC_NET_HEADER_FIELD_SNAP_PID (IOC_NET_HEADER_FIELD_SNAP_OUI << 1)
|
||||
#define IOC_NET_HEADER_FIELD_SNAP_ALL_FIELDS ((IOC_NET_HEADER_FIELD_SNAP_OUI << 2) - 1)
|
||||
|
||||
|
||||
typedef uint8_t ioc_header_field_llc_snap_t;
|
||||
|
||||
#define IOC_NET_HEADER_FIELD_LLC_SNAP_TYPE (1)
|
||||
#define IOC_NET_HEADER_FIELD_LLC_SNAP_ALL_FIELDS ((IOC_NET_HEADER_FIELD_LLC_SNAP_TYPE << 1) - 1)
|
||||
|
||||
#define IOC_NET_HEADER_FIELD_ARP_HTYPE (1)
|
||||
#define IOC_NET_HEADER_FIELD_ARP_PTYPE (IOC_NET_HEADER_FIELD_ARP_HTYPE << 1)
|
||||
#define IOC_NET_HEADER_FIELD_ARP_HLEN (IOC_NET_HEADER_FIELD_ARP_HTYPE << 2)
|
||||
#define IOC_NET_HEADER_FIELD_ARP_PLEN (IOC_NET_HEADER_FIELD_ARP_HTYPE << 3)
|
||||
#define IOC_NET_HEADER_FIELD_ARP_OPER (IOC_NET_HEADER_FIELD_ARP_HTYPE << 4)
|
||||
#define IOC_NET_HEADER_FIELD_ARP_SHA (IOC_NET_HEADER_FIELD_ARP_HTYPE << 5)
|
||||
#define IOC_NET_HEADER_FIELD_ARP_SPA (IOC_NET_HEADER_FIELD_ARP_HTYPE << 6)
|
||||
#define IOC_NET_HEADER_FIELD_ARP_THA (IOC_NET_HEADER_FIELD_ARP_HTYPE << 7)
|
||||
#define IOC_NET_HEADER_FIELD_ARP_TPA (IOC_NET_HEADER_FIELD_ARP_HTYPE << 8)
|
||||
#define IOC_NET_HEADER_FIELD_ARP_ALL_FIELDS ((IOC_NET_HEADER_FIELD_ARP_HTYPE << 9) - 1)
|
||||
|
||||
#define IOC_NET_HEADER_FIELD_RFC2684_LLC (1)
|
||||
#define IOC_NET_HEADER_FIELD_RFC2684_NLPID (IOC_NET_HEADER_FIELD_RFC2684_LLC << 1)
|
||||
#define IOC_NET_HEADER_FIELD_RFC2684_OUI (IOC_NET_HEADER_FIELD_RFC2684_LLC << 2)
|
||||
#define IOC_NET_HEADER_FIELD_RFC2684_PID (IOC_NET_HEADER_FIELD_RFC2684_LLC << 3)
|
||||
#define IOC_NET_HEADER_FIELD_RFC2684_VPN_OUI (IOC_NET_HEADER_FIELD_RFC2684_LLC << 4)
|
||||
#define IOC_NET_HEADER_FIELD_RFC2684_VPN_IDX (IOC_NET_HEADER_FIELD_RFC2684_LLC << 5)
|
||||
#define IOC_NET_HEADER_FIELD_RFC2684_ALL_FIELDS ((IOC_NET_HEADER_FIELD_RFC2684_LLC << 6) - 1)
|
||||
|
||||
#define IOC_NET_HEADER_FIELD_USER_DEFINED_SRCPORT (1)
|
||||
#define IOC_NET_HEADER_FIELD_USER_DEFINED_PCDID (IOC_NET_HEADER_FIELD_USER_DEFINED_SRCPORT << 1)
|
||||
#define IOC_NET_HEADER_FIELD_USER_DEFINED_ALL_FIELDS ((IOC_NET_HEADER_FIELD_USER_DEFINED_SRCPORT << 2) - 1)
|
||||
|
||||
#define IOC_NET_HEADER_FIELD_PAYLOAD_BUFFER (1)
|
||||
#define IOC_NET_HEADER_FIELD_PAYLOAD_SIZE (IOC_NET_HEADER_FIELD_PAYLOAD_BUFFER << 1)
|
||||
#define IOC_NET_HEADER_FIELD_MAX_FRM_SIZE (IOC_NET_HEADER_FIELD_PAYLOAD_BUFFER << 2)
|
||||
#define IOC_NET_HEADER_FIELD_MIN_FRM_SIZE (IOC_NET_HEADER_FIELD_PAYLOAD_BUFFER << 3)
|
||||
#define IOC_NET_HEADER_FIELD_PAYLOAD_TYPE (IOC_NET_HEADER_FIELD_PAYLOAD_BUFFER << 4)
|
||||
#define IOC_NET_HEADER_FIELD_FRAME_SIZE (IOC_NET_HEADER_FIELD_PAYLOAD_BUFFER << 5)
|
||||
#define IOC_NET_HEADER_FIELD_PAYLOAD_ALL_FIELDS ((IOC_NET_HEADER_FIELD_PAYLOAD_BUFFER << 6) - 1)
|
||||
|
||||
|
||||
typedef uint8_t ioc_header_field_gre_t;
|
||||
|
||||
#define IOC_NET_HEADER_FIELD_GRE_TYPE (1)
|
||||
#define IOC_NET_HEADER_FIELD_GRE_ALL_FIELDS ((IOC_NET_HEADER_FIELD_GRE_TYPE << 1) - 1)
|
||||
|
||||
|
||||
typedef uint8_t ioc_header_field_minencap_t;
|
||||
|
||||
#define IOC_NET_HEADER_FIELD_MINENCAP_SRC_IP (1)
|
||||
#define IOC_NET_HEADER_FIELD_MINENCAP_DST_IP (IOC_NET_HEADER_FIELD_MINENCAP_SRC_IP << 1)
|
||||
#define IOC_NET_HEADER_FIELD_MINENCAP_TYPE (IOC_NET_HEADER_FIELD_MINENCAP_SRC_IP << 2)
|
||||
#define IOC_NET_HEADER_FIELD_MINENCAP_ALL_FIELDS ((IOC_NET_HEADER_FIELD_MINENCAP_SRC_IP << 3) - 1)
|
||||
|
||||
|
||||
typedef uint8_t ioc_header_field_ipsec_ah_t;
|
||||
|
||||
#define IOC_NET_HEADER_FIELD_IPSEC_AH_SPI (1)
|
||||
#define IOC_NET_HEADER_FIELD_IPSEC_AH_NH (IOC_NET_HEADER_FIELD_IPSEC_AH_SPI << 1)
|
||||
#define IOC_NET_HEADER_FIELD_IPSEC_AH_ALL_FIELDS ((IOC_NET_HEADER_FIELD_IPSEC_AH_SPI << 2) - 1)
|
||||
|
||||
|
||||
typedef uint8_t ioc_header_field_ipsec_esp_t;
|
||||
|
||||
#define IOC_NET_HEADER_FIELD_IPSEC_ESP_SPI (1)
|
||||
#define IOC_NET_HEADER_FIELD_IPSEC_ESP_SEQUENCE_NUM (IOC_NET_HEADER_FIELD_IPSEC_ESP_SPI << 1)
|
||||
#define IOC_NET_HEADER_FIELD_IPSEC_ESP_ALL_FIELDS ((IOC_NET_HEADER_FIELD_IPSEC_ESP_SPI << 2) - 1)
|
||||
|
||||
#define IOC_NET_HEADER_FIELD_IPSEC_ESP_SPI_SIZE 4
|
||||
|
||||
|
||||
typedef uint8_t ioc_header_field_mpls_t;
|
||||
|
||||
#define IOC_NET_HEADER_FIELD_MPLS_LABEL_STACK (1)
|
||||
#define IOC_NET_HEADER_FIELD_MPLS_LABEL_STACK_ALL_FIELDS ((IOC_NET_HEADER_FIELD_MPLS_LABEL_STACK << 1) - 1)
|
||||
|
||||
|
||||
typedef uint8_t ioc_header_field_macsec_t;
|
||||
|
||||
#define IOC_NET_HEADER_FIELD_MACSEC_SECTAG (1)
|
||||
#define IOC_NET_HEADER_FIELD_MACSEC_ALL_FIELDS ((IOC_NET_HEADER_FIELD_MACSEC_SECTAG << 1) - 1)
|
||||
|
||||
|
||||
typedef enum {
|
||||
e_IOC_NET_HEADER_TYPE_NONE = 0,
|
||||
e_IOC_NET_HEADER_TYPE_PAYLOAD,
|
||||
e_IOC_NET_HEADER_TYPE_ETH,
|
||||
e_IOC_NET_HEADER_TYPE_VLAN,
|
||||
e_IOC_NET_HEADER_TYPE_IPv4,
|
||||
e_IOC_NET_HEADER_TYPE_IPv6,
|
||||
e_IOC_NET_HEADER_TYPE_IP,
|
||||
e_IOC_NET_HEADER_TYPE_TCP,
|
||||
e_IOC_NET_HEADER_TYPE_UDP,
|
||||
e_IOC_NET_HEADER_TYPE_UDP_LITE,
|
||||
e_IOC_NET_HEADER_TYPE_IPHC,
|
||||
e_IOC_NET_HEADER_TYPE_SCTP,
|
||||
e_IOC_NET_HEADER_TYPE_SCTP_CHUNK_DATA,
|
||||
e_IOC_NET_HEADER_TYPE_PPPoE,
|
||||
e_IOC_NET_HEADER_TYPE_PPP,
|
||||
e_IOC_NET_HEADER_TYPE_PPPMUX,
|
||||
e_IOC_NET_HEADER_TYPE_PPPMUX_SUBFRAME,
|
||||
e_IOC_NET_HEADER_TYPE_L2TPv2,
|
||||
e_IOC_NET_HEADER_TYPE_L2TPv3_CTRL,
|
||||
e_IOC_NET_HEADER_TYPE_L2TPv3_SESS,
|
||||
e_IOC_NET_HEADER_TYPE_LLC,
|
||||
e_IOC_NET_HEADER_TYPE_LLC_SNAP,
|
||||
e_IOC_NET_HEADER_TYPE_NLPID,
|
||||
e_IOC_NET_HEADER_TYPE_SNAP,
|
||||
e_IOC_NET_HEADER_TYPE_MPLS,
|
||||
e_IOC_NET_HEADER_TYPE_IPSEC_AH,
|
||||
e_IOC_NET_HEADER_TYPE_IPSEC_ESP,
|
||||
e_IOC_NET_HEADER_TYPE_UDP_ENCAP_ESP, /* RFC 3948 */
|
||||
e_IOC_NET_HEADER_TYPE_MACSEC,
|
||||
e_IOC_NET_HEADER_TYPE_GRE,
|
||||
e_IOC_NET_HEADER_TYPE_MINENCAP,
|
||||
e_IOC_NET_HEADER_TYPE_DCCP,
|
||||
e_IOC_NET_HEADER_TYPE_ICMP,
|
||||
e_IOC_NET_HEADER_TYPE_IGMP,
|
||||
e_IOC_NET_HEADER_TYPE_ARP,
|
||||
e_IOC_NET_HEADER_TYPE_CAPWAP,
|
||||
e_IOC_NET_HEADER_TYPE_CAPWAP_DTLS,
|
||||
e_IOC_NET_HEADER_TYPE_RFC2684,
|
||||
e_IOC_NET_HEADER_TYPE_USER_DEFINED_L2,
|
||||
e_IOC_NET_HEADER_TYPE_USER_DEFINED_L3,
|
||||
e_IOC_NET_HEADER_TYPE_USER_DEFINED_L4,
|
||||
e_IOC_NET_HEADER_TYPE_USER_DEFINED_SHIM1,
|
||||
e_IOC_NET_HEADER_TYPE_USER_DEFINED_SHIM2,
|
||||
e_IOC_NET_MAX_HEADER_TYPE_COUNT
|
||||
} ioc_net_header_type;
|
||||
|
||||
|
||||
#endif /* __NET_IOCTLS_H */
|
||||
|
|
@ -46,7 +46,7 @@
|
|||
|
||||
/*
|
||||
* fmlib ioctl ABI headers — authoritative struct/ioctl definitions.
|
||||
* These are included via FMCD_COMPILE_CMD -I paths (see config.dpaa_arm64).
|
||||
* Located in contrib/ncsw/inc/ioctls/ (included via DPAA_COMPILE_CMD).
|
||||
*/
|
||||
#include "fm_pcd_ioctls.h"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue