diff options
author | Yogesh Gaur | 2017-11-15 11:59:31 +0530 |
---|---|---|
committer | York Sun | 2017-12-06 14:55:17 -0800 |
commit | 2557c5a942213acc2a0e3353a9c00140ea11b5d4 (patch) | |
tree | 19eab2844a182b9bddcdb761460c8d624a7e7ba8 /include/fsl-mc/fsl_dpbp.h | |
parent | ba348904207a2e9061a2405ebd84268f63a1809f (diff) |
driver: net: fsl-mc: flib changes for MC 10.3.0
Existing MC driver framework is based on MC-9.x.x flib. This patch
migrates MC obj (DPBP, DPNI, DPRC, DPMAC etc) to use latest MC flib
which is MC-10.3.0.
Changes introduced due to migration:
1. To get OBJ token, pair of create and open API replaces create APIs
2. Pair of close and destroy APIs replaces destroy APIs
3. For version read, get_version APIs replaces get_attributes APIs
4. dpni_get/reset_statistics APIs replaces dpni_get/set_counter APIs
5. Simplifies struct dpni_cfg and removes dpni_extended_cfg struct
6. Single API dpni_get_buffer_layout/set_buffer_layout replaces
dpni_get_rx/set_rx, tx related, tx_conf_buffer_layout related APIs.
New API takes a queue type as an argument.
7. Similarly dpni_get_queue/set_queue replaces
dpni_get_rx_flow/set_rx_flow , tx_flow related, tx_conf related
APIs
Signed-off-by: Yogesh Gaur <yogeshnarayan.gaur@nxp.com>
Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>
Reviewed-by: York Sun <york.sun@nxp.com>
Diffstat (limited to 'include/fsl-mc/fsl_dpbp.h')
-rw-r--r-- | include/fsl-mc/fsl_dpbp.h | 62 |
1 files changed, 35 insertions, 27 deletions
diff --git a/include/fsl-mc/fsl_dpbp.h b/include/fsl-mc/fsl_dpbp.h index b1ad46ee45e..5401e861f0f 100644 --- a/include/fsl-mc/fsl_dpbp.h +++ b/include/fsl-mc/fsl_dpbp.h @@ -1,8 +1,8 @@ /* * Freescale Layerscape MC I/O wrapper * - * Copyright (C) 2013-2015 Freescale Semiconductor, Inc. - * Author: German Rivera <German.Rivera@freescale.com> + * Copyright (C) 2013-2016 Freescale Semiconductor, Inc. + * Copyright 2017 NXP * * SPDX-License-Identifier: GPL-2.0+ */ @@ -14,19 +14,21 @@ #define __FSL_DPBP_H /* DPBP Version */ -#define DPBP_VER_MAJOR 2 -#define DPBP_VER_MINOR 2 +#define DPBP_VER_MAJOR 3 +#define DPBP_VER_MINOR 3 /* Command IDs */ -#define DPBP_CMDID_CLOSE 0x800 -#define DPBP_CMDID_OPEN 0x804 -#define DPBP_CMDID_CREATE 0x904 -#define DPBP_CMDID_DESTROY 0x900 - -#define DPBP_CMDID_ENABLE 0x002 -#define DPBP_CMDID_DISABLE 0x003 -#define DPBP_CMDID_GET_ATTR 0x004 -#define DPBP_CMDID_RESET 0x005 +#define DPBP_CMDID_CLOSE 0x8001 +#define DPBP_CMDID_OPEN 0x8041 +#define DPBP_CMDID_CREATE 0x9041 +#define DPBP_CMDID_DESTROY 0x9841 +#define DPBP_CMDID_GET_API_VERSION 0xa041 + +#define DPBP_CMDID_ENABLE 0x0021 +#define DPBP_CMDID_DISABLE 0x0031 +#define DPBP_CMDID_GET_ATTR 0x0041 +#define DPBP_CMDID_RESET 0x0051 +#define DPBP_CMDID_IS_ENABLED 0x0061 /* cmd, param, offset, width, type, arg_name */ #define DPBP_CMD_OPEN(cmd, dpbp_id) \ @@ -37,8 +39,6 @@ do { \ MC_RSP_OP(cmd, 0, 16, 16, uint16_t, attr->bpid); \ MC_RSP_OP(cmd, 0, 32, 32, int, attr->id);\ - MC_RSP_OP(cmd, 1, 0, 16, uint16_t, attr->version.major);\ - MC_RSP_OP(cmd, 1, 16, 16, uint16_t, attr->version.minor);\ } while (0) /* Data Path Buffer Pool API @@ -114,9 +114,10 @@ struct dpbp_cfg { * Return: '0' on Success; Error code otherwise. */ int dpbp_create(struct fsl_mc_io *mc_io, + uint16_t dprc_token, uint32_t cmd_flags, const struct dpbp_cfg *cfg, - uint16_t *token); + uint32_t *obj_id); /** * dpbp_destroy() - Destroy the DPBP object and release all its resources. @@ -127,8 +128,9 @@ int dpbp_create(struct fsl_mc_io *mc_io, * Return: '0' on Success; error code otherwise. */ int dpbp_destroy(struct fsl_mc_io *mc_io, + uint16_t dprc_token, uint32_t cmd_flags, - uint16_t token); + uint32_t obj_id); /** * dpbp_enable() - Enable the DPBP. @@ -189,16 +191,7 @@ int dpbp_reset(struct fsl_mc_io *mc_io, * acquire/release operations on buffers */ struct dpbp_attr { - int id; - /** - * struct version - Structure representing DPBP version - * @major: DPBP major version - * @minor: DPBP minor version - */ - struct { - uint16_t major; - uint16_t minor; - } version; + uint32_t id; uint16_t bpid; }; @@ -217,6 +210,21 @@ int dpbp_get_attributes(struct fsl_mc_io *mc_io, uint16_t token, struct dpbp_attr *attr); +/** + * dpbp_get_api_version - Retrieve DPBP Major and Minor version info. + * + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @major_ver: DPBP major version + * @minor_ver: DPBP minor version + * + * Return: '0' on Success; Error code otherwise. + */ +int dpbp_get_api_version(struct fsl_mc_io *mc_io, + u32 cmd_flags, + u16 *major_ver, + u16 *minor_ver); + /** @} */ #endif /* __FSL_DPBP_H */ |