tokenization turbo decoder/encoder flags values separated by a comma */
| 319 | |
| 320 | /* tokenization turbo decoder/encoder flags values separated by a comma */ |
| 321 | static int |
| 322 | parse_turbo_flags(char *tokens, uint32_t *op_flags, |
| 323 | enum rte_bbdev_op_type op_type) |
| 324 | { |
| 325 | char *tok = NULL; |
| 326 | uint32_t op_flag_value = 0; |
| 327 | |
| 328 | tok = strtok(tokens, VALUE_DELIMITER); |
| 329 | if (tok == NULL) |
| 330 | return -1; |
| 331 | |
| 332 | while (tok != NULL) { |
| 333 | trim_space(tok); |
| 334 | if (op_type == RTE_BBDEV_OP_TURBO_DEC) { |
| 335 | if (op_decoder_flag_strtoul(tok, &op_flag_value) == -1) |
| 336 | return -1; |
| 337 | } else if (op_type == RTE_BBDEV_OP_TURBO_ENC) { |
| 338 | if (op_encoder_flag_strtoul(tok, &op_flag_value) == -1) |
| 339 | return -1; |
| 340 | } else if (op_type == RTE_BBDEV_OP_LDPC_ENC) { |
| 341 | if (op_ldpc_encoder_flag_strtoul(tok, &op_flag_value) |
| 342 | == -1) |
| 343 | return -1; |
| 344 | } else if (op_type == RTE_BBDEV_OP_LDPC_DEC) { |
| 345 | if (op_ldpc_decoder_flag_strtoul(tok, &op_flag_value) |
| 346 | == -1) |
| 347 | return -1; |
| 348 | } else if (op_type == RTE_BBDEV_OP_FFT) { |
| 349 | if (op_fft_flag_strtoul(tok, &op_flag_value) |
| 350 | == -1) |
| 351 | return -1; |
| 352 | } else if (op_type == RTE_BBDEV_OP_MLDTS) { |
| 353 | if (op_mld_flag_strtoul(tok, &op_flag_value) |
| 354 | == -1) |
| 355 | return -1; |
| 356 | } else { |
| 357 | return -1; |
| 358 | } |
| 359 | |
| 360 | *op_flags = *op_flags | op_flag_value; |
| 361 | |
| 362 | tok = strtok(NULL, VALUE_DELIMITER); |
| 363 | if (tok == NULL) |
| 364 | break; |
| 365 | } |
| 366 | |
| 367 | return 0; |
| 368 | } |
| 369 | |
| 370 | /* convert turbo encoder/decoder op_type from string to enum*/ |
| 371 | static int |
no test coverage detected