1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright 2008-2012 Freescale Semiconductor, Inc
3 * Copyright 2019-2020 NXP
9 * @Description FM Virtual Storage-Profile
11 #ifndef __FM_VSP_EXT_H
12 #define __FM_VSP_EXT_H
17 typedef struct t_fm_vsp_params {
19 /**< A handle to the FM object this VSP related to */
20 t_fm_ext_pools ext_buf_pools;
21 /**< Which external buffer pools are used (up to
22 * FM_PORT_MAX_NUM_OF_EXT_POOLS), and their sizes.
23 * Parameter associated with Rx / OP port
25 uint16_t liodn_offset; /**< VSP's LIODN offset */
27 e_fm_port_type port_type; /**< Port type */
28 uint8_t port_id; /**< Port Id - relative to type */
30 uint8_t relative_profile_id;
31 /**< VSP Id - relative to VSP's range defined in
36 typedef struct ioc_fm_vsp_params_t {
37 struct t_fm_vsp_params vsp_params;
38 void *id; /**< return value */
39 } ioc_fm_vsp_params_t;
41 typedef struct t_fm_port_vspalloc_params {
42 uint8_t num_of_profiles;
43 /**< Number of Virtual Storage Profiles; must be a power of 2 */
44 uint8_t dflt_relative_id;
45 /**< The default Virtual-Storage-Profile-id dedicated to Rx/OP port. The
46 * same default Virtual-Storage-Profile-id will be for coupled Tx port
47 * if relevant function called for Rx port
49 } t_fm_port_vspalloc_params;
51 typedef struct ioc_fm_port_vsp_alloc_params_t {
52 struct t_fm_port_vspalloc_params params;
54 /**< Handle to coupled Tx Port; not relevant for OP port. */
55 } ioc_fm_port_vsp_alloc_params_t;
57 typedef struct ioc_fm_buffer_prefix_content_t {
58 uint16_t priv_data_size;
59 /**< Number of bytes to be left at the beginning of the external
60 * buffer; Note that the private-area will start from the base
61 * of the buffer address.
64 /**< TRUE to pass the parse result to/from the FM; User
65 * may use fm_port_get_buffer_prs_result() in order to
66 * get the parser-result from a buffer.
69 /**< TRUE to pass the timeStamp to/from the FM User may
70 * use fm_port_get_buffer_time_stamp() in order to get
71 * the parser-result from a buffer.
73 bool pass_hash_result;
74 /**< TRUE to pass the KG hash result to/from the FM User
75 * may use fm_port_get_buffer_hash_result() in order to
76 * get the parser-result from a buffer.
78 bool pass_all_other_pcd_info;
79 /**< Add all other Internal-Context information: AD,
80 * hash-result, key, etc.
83 /**< 0 to use driver's default alignment [64],
84 * other value for selecting a data alignment (must be a
85 * power of 2); if write optimization is used, must be
88 uint8_t manip_extra_space;
89 /**< Maximum extra size needed
90 * (insertion-size minus removal-size);
91 * Note that this field impacts the size of the
92 * buffer-prefix (i.e. it pushes the data offset);
93 * This field is irrelevant if DPAA_VERSION==10
95 } ioc_fm_buffer_prefix_content_t;
97 typedef struct ioc_fm_buffer_prefix_content_params_t {
99 ioc_fm_buffer_prefix_content_t fm_buffer_prefix_content;
100 } ioc_fm_buffer_prefix_content_params_t;
102 uint32_t fm_port_vsp_alloc(t_handle h_fm_port,
103 t_fm_port_vspalloc_params *p_params);
105 t_handle fm_vsp_config(t_fm_vsp_params *p_fm_vsp_params);
107 uint32_t fm_vsp_init(t_handle h_fm_vsp);
109 uint32_t fm_vsp_free(t_handle h_fm_vsp);
111 uint32_t fm_vsp_config_buffer_prefix_content(t_handle h_fm_vsp,
112 t_fm_buffer_prefix_content *p_fm_buffer_prefix_content);
114 #define FM_PORT_IOC_VSP_ALLOC \
115 _IOW(FM_IOC_TYPE_BASE, FM_PORT_IOC_NUM(38), \
116 ioc_fm_port_vsp_alloc_params_t)
118 #define FM_IOC_VSP_CONFIG \
119 _IOWR(FM_IOC_TYPE_BASE, FM_IOC_NUM(8), ioc_fm_vsp_params_t)
121 #define FM_IOC_VSP_INIT \
122 _IOW(FM_IOC_TYPE_BASE, FM_IOC_NUM(9), ioc_fm_obj_t)
124 #define FM_IOC_VSP_FREE \
125 _IOW(FM_IOC_TYPE_BASE, FM_IOC_NUM(10), ioc_fm_obj_t)
127 #define FM_IOC_VSP_CONFIG_BUFFER_PREFIX_CONTENT \
128 _IOW(FM_IOC_TYPE_BASE, FM_IOC_NUM(12), \
129 ioc_fm_buffer_prefix_content_params_t)
131 #endif /* __FM_VSP_EXT_H */