Branch data Line data Source code
1 : : /* SPDX-License-Identifier: BSD-3-Clause 2 : : * Copyright(c) 2023 Napatech A/S 3 : : */ 4 : : 5 : : #include "ntnic_mod_reg.h" 6 : : 7 : : static struct sg_ops_s *sg_ops; 8 : : 9 : 0 : void nthw_reg_sg_ops(struct sg_ops_s *ops) 10 : : { 11 : 0 : sg_ops = ops; 12 : 0 : } 13 : : 14 : 0 : const struct sg_ops_s *nthw_get_sg_ops(void) 15 : : { 16 [ # # ]: 0 : if (sg_ops == NULL) 17 : 0 : nthw_sg_init(); 18 : 0 : return sg_ops; 19 : : } 20 : : 21 : : /* 22 : : * 23 : : */ 24 : : static struct meter_ops_s *meter_ops; 25 : : 26 : 0 : void nthw_reg_meter_ops(struct meter_ops_s *ops) 27 : : { 28 : 0 : meter_ops = ops; 29 : 0 : } 30 : : 31 : 0 : const struct meter_ops_s *nthw_get_meter_ops(void) 32 : : { 33 [ # # ]: 0 : if (meter_ops == NULL) 34 : 0 : nthw_meter_init(); 35 : : 36 : 0 : return meter_ops; 37 : : } 38 : : 39 : : /* 40 : : * 41 : : */ 42 : : static const struct ntnic_filter_ops *ntnic_filter_ops; 43 : : 44 : 0 : void nthw_reg_filter_ops(const struct ntnic_filter_ops *ops) 45 : : { 46 : 0 : ntnic_filter_ops = ops; 47 : 0 : } 48 : : 49 : 0 : const struct ntnic_filter_ops *nthw_get_filter_ops(void) 50 : : { 51 [ # # ]: 0 : if (ntnic_filter_ops == NULL) 52 : 0 : nthw_filter_ops_init(); 53 : : 54 : 0 : return ntnic_filter_ops; 55 : : } 56 : : 57 : : static struct link_ops_s *link_100g_ops; 58 : : 59 : 0 : void nthw_reg_100g_link_ops(struct link_ops_s *ops) 60 : : { 61 : 0 : link_100g_ops = ops; 62 : 0 : } 63 : : 64 : 0 : const struct link_ops_s *nthw_get_100g_link_ops(void) 65 : : { 66 [ # # ]: 0 : if (link_100g_ops == NULL) 67 : 0 : nthw_link_100g_init(); 68 : 0 : return link_100g_ops; 69 : : } 70 : : 71 : : /* 72 : : * 73 : : */ 74 : : static struct link_ops_s *link_agx_100g_ops; 75 : : 76 : 0 : void nthw_reg_agx_100g_link_ops(struct link_ops_s *ops) 77 : : { 78 : 0 : link_agx_100g_ops = ops; 79 : 0 : } 80 : : 81 : 0 : const struct link_ops_s *nthw_get_agx_100g_link_ops(void) 82 : : { 83 [ # # ]: 0 : if (link_agx_100g_ops == NULL) 84 : 0 : nthw_link_agx_100g_ops_init(); 85 : 0 : return link_agx_100g_ops; 86 : : } 87 : : 88 : : static const struct port_ops *port_ops; 89 : : 90 : 0 : void nthw_reg_port_ops(const struct port_ops *ops) 91 : : { 92 : 0 : port_ops = ops; 93 : 0 : } 94 : : 95 : 0 : const struct port_ops *nthw_get_port_ops(void) 96 : : { 97 [ # # ]: 0 : if (port_ops == NULL) 98 : 0 : nthw_port_init(); 99 : 0 : return port_ops; 100 : : } 101 : : 102 : : static const struct nt4ga_stat_ops *nt4ga_stat_ops; 103 : : 104 : 0 : void nthw_reg_nt4ga_stat_ops(const struct nt4ga_stat_ops *ops) 105 : : { 106 : 0 : nt4ga_stat_ops = ops; 107 : 0 : } 108 : : 109 : 0 : const struct nt4ga_stat_ops *nthw_get_nt4ga_stat_ops(void) 110 : : { 111 [ # # ]: 0 : if (nt4ga_stat_ops == NULL) 112 : 0 : nthw_stat_ops_init(); 113 : : 114 : 0 : return nt4ga_stat_ops; 115 : : } 116 : : 117 : : static const struct adapter_ops *adapter_ops; 118 : : 119 : 0 : void nthw_reg_adapter_ops(const struct adapter_ops *ops) 120 : : { 121 : 0 : adapter_ops = ops; 122 : 0 : } 123 : : 124 : 0 : const struct adapter_ops *nthw_get_adapter_ops(void) 125 : : { 126 [ # # ]: 0 : if (adapter_ops == NULL) 127 : 0 : nthw_adapter_init(); 128 : 0 : return adapter_ops; 129 : : } 130 : : 131 : : static struct clk9563_ops *clk9563_ops; 132 : : 133 : 0 : void nthw_reg_clk9563_ops(struct clk9563_ops *ops) 134 : : { 135 : 0 : clk9563_ops = ops; 136 : 0 : } 137 : : 138 : 0 : struct clk9563_ops *nthw_get_clk9563_ops(void) 139 : : { 140 [ # # ]: 0 : if (clk9563_ops == NULL) 141 : 0 : nthw_clk9563_ops_init(); 142 : 0 : return clk9563_ops; 143 : : } 144 : : 145 : : static struct rst_nt200a0x_ops *rst_nt200a0x_ops; 146 : : 147 : 0 : void nthw_reg_rst_nt200a0x_ops(struct rst_nt200a0x_ops *ops) 148 : : { 149 : 0 : rst_nt200a0x_ops = ops; 150 : 0 : } 151 : : 152 : 0 : struct rst_nt200a0x_ops *nthw_get_rst_nt200a0x_ops(void) 153 : : { 154 [ # # ]: 0 : if (rst_nt200a0x_ops == NULL) 155 : 0 : nthw_rst_nt200a0x_ops_init(); 156 : 0 : return rst_nt200a0x_ops; 157 : : } 158 : : 159 : : static struct rst9563_ops *rst9563_ops; 160 : : 161 : 0 : void nthw_reg_rst9563_ops(struct rst9563_ops *ops) 162 : : { 163 : 0 : rst9563_ops = ops; 164 : 0 : } 165 : : 166 : 0 : struct rst9563_ops *nthw_get_rst9563_ops(void) 167 : : { 168 [ # # ]: 0 : if (rst9563_ops == NULL) 169 : 0 : nthw_rst9563_ops_init(); 170 : 0 : return rst9563_ops; 171 : : } 172 : : 173 : : static const struct flow_backend_ops *flow_backend_ops; 174 : : 175 : 0 : void nthw_reg_flow_backend_ops(const struct flow_backend_ops *ops) 176 : : { 177 : 0 : flow_backend_ops = ops; 178 : 0 : } 179 : : 180 : : static struct rst9574_ops *rst9574_ops; 181 : : 182 : 0 : void nthw_reg_rst9574_ops(struct rst9574_ops *ops) 183 : : { 184 : 0 : rst9574_ops = ops; 185 : 0 : } 186 : : 187 : 0 : struct rst9574_ops *nthw_get_rst9574_ops(void) 188 : : { 189 [ # # ]: 0 : if (rst9574_ops == NULL) 190 : 0 : nthw_rst9574_ops_init(); 191 : : 192 : 0 : return rst9574_ops; 193 : : } 194 : : 195 : : static struct rst9569_ops *rst9569_ops; 196 : : 197 : 0 : void nthw_reg_rst9569_ops(struct rst9569_ops *ops) 198 : : { 199 : 0 : rst9569_ops = ops; 200 : 0 : } 201 : : 202 : 0 : struct rst9569_ops *nthw_get_rst9569_ops(void) 203 : : { 204 [ # # ]: 0 : if (rst9569_ops == NULL) 205 : 0 : nthw_rst9569_ops_init(); 206 : : 207 : 0 : return rst9569_ops; 208 : : } 209 : : 210 : : static struct rst_nt400dxx_ops *rst_nt400dxx_ops; 211 : : 212 : 0 : void nthw_reg_rst_nt400dxx_ops(struct rst_nt400dxx_ops *ops) 213 : : { 214 : 0 : rst_nt400dxx_ops = ops; 215 : 0 : } 216 : : 217 : 0 : struct rst_nt400dxx_ops *nthw_get_rst_nt400dxx_ops(void) 218 : : { 219 [ # # ]: 0 : if (rst_nt400dxx_ops == NULL) 220 : 0 : nthw_rst_nt400dxx_ops_init(); 221 : : 222 : 0 : return rst_nt400dxx_ops; 223 : : } 224 : : 225 : 0 : const struct flow_backend_ops *nthw_get_flow_backend_ops(void) 226 : : { 227 [ # # ]: 0 : if (flow_backend_ops == NULL) 228 : 0 : nthw_flow_backend_init(); 229 : : 230 : 0 : return flow_backend_ops; 231 : : } 232 : : 233 : : static const struct profile_inline_ops *profile_inline_ops; 234 : : 235 : 0 : void nthw_reg_profile_inline_ops(const struct profile_inline_ops *ops) 236 : : { 237 : 0 : profile_inline_ops = ops; 238 : 0 : } 239 : : 240 : 0 : const struct profile_inline_ops *nthw_get_profile_inline_ops(void) 241 : : { 242 [ # # ]: 0 : if (profile_inline_ops == NULL) 243 : 0 : nthw_profile_inline_init(); 244 : : 245 : 0 : return profile_inline_ops; 246 : : } 247 : : 248 : : static const struct flow_filter_ops *flow_filter_ops; 249 : : 250 : 0 : void nthw_reg_flow_filter_ops(const struct flow_filter_ops *ops) 251 : : { 252 : 0 : flow_filter_ops = ops; 253 : 0 : } 254 : : 255 : 0 : const struct flow_filter_ops *nthw_get_flow_filter_ops(void) 256 : : { 257 [ # # ]: 0 : if (flow_filter_ops == NULL) 258 : 0 : nthw_init_flow_filter(); 259 : : 260 : 0 : return flow_filter_ops; 261 : : } 262 : : 263 : : static const struct rte_flow_fp_ops *dev_fp_flow_ops; 264 : : 265 : 0 : void nthw_reg_dev_fp_flow_ops(const struct rte_flow_fp_ops *ops) 266 : : { 267 : 0 : dev_fp_flow_ops = ops; 268 : 0 : } 269 : : 270 : 0 : const struct rte_flow_fp_ops *nthw_get_dev_fp_flow_ops(void) 271 : : { 272 [ # # ]: 0 : if (dev_fp_flow_ops == NULL) 273 : 0 : nthw_dev_fp_flow_init(); 274 : : 275 : 0 : return dev_fp_flow_ops; 276 : : } 277 : : 278 : : static const struct rte_flow_ops *dev_flow_ops; 279 : : 280 : 0 : void nthw_reg_dev_flow_ops(const struct rte_flow_ops *ops) 281 : : { 282 : 0 : dev_flow_ops = ops; 283 : 0 : } 284 : : 285 : 0 : const struct rte_flow_ops *nthw_get_dev_flow_ops(void) 286 : : { 287 [ # # ]: 0 : if (dev_flow_ops == NULL) 288 : 0 : nthw_dev_flow_init(); 289 : : 290 : 0 : return dev_flow_ops; 291 : : } 292 : : 293 : : static struct ntnic_xstats_ops *ntnic_xstats_ops; 294 : : 295 : 0 : void nthw_reg_xstats_ops(struct ntnic_xstats_ops *ops) 296 : : { 297 : 0 : ntnic_xstats_ops = ops; 298 : 0 : } 299 : : 300 : 0 : struct ntnic_xstats_ops *nthw_get_xstats_ops(void) 301 : : { 302 [ # # ]: 0 : if (ntnic_xstats_ops == NULL) 303 : 0 : nthw_xstats_ops_init(); 304 : : 305 : 0 : return ntnic_xstats_ops; 306 : : }