* dpseci_get_rx_queue() - Retrieve Rx queue attributes. * @mc_io: Pointer to MC portal's I/O object * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @token: Token of DPSECI object * @queue: Select the queue relative to number of * priorities configured at DPSECI creation * @attr: Returned Rx queue attributes * * Return: '0' on Success; Error code otherwise. */
| 366 | * Return: '0' on Success; Error code otherwise. |
| 367 | */ |
| 368 | int dpseci_get_rx_queue(struct fsl_mc_io *mc_io, |
| 369 | uint32_t cmd_flags, |
| 370 | uint16_t token, |
| 371 | uint8_t queue, |
| 372 | struct dpseci_rx_queue_attr *attr) |
| 373 | { |
| 374 | struct dpseci_rsp_get_rx_queue *rsp_params; |
| 375 | struct dpseci_cmd_get_queue *cmd_params; |
| 376 | struct mc_command cmd = { 0 }; |
| 377 | int err; |
| 378 | |
| 379 | /* prepare command */ |
| 380 | cmd.header = mc_encode_cmd_header(DPSECI_CMDID_GET_RX_QUEUE, |
| 381 | cmd_flags, |
| 382 | token); |
| 383 | cmd_params = (struct dpseci_cmd_get_queue *)cmd.params; |
| 384 | cmd_params->queue = queue; |
| 385 | |
| 386 | /* send command to mc*/ |
| 387 | err = mc_send_command(mc_io, &cmd); |
| 388 | if (err) |
| 389 | return err; |
| 390 | |
| 391 | /* retrieve response parameters */ |
| 392 | rsp_params = (struct dpseci_rsp_get_rx_queue *)cmd.params; |
| 393 | attr->user_ctx = le64_to_cpu(rsp_params->user_ctx); |
| 394 | attr->fqid = le32_to_cpu(rsp_params->fqid); |
| 395 | attr->dest_cfg.dest_id = le32_to_cpu(rsp_params->dest_id); |
| 396 | attr->dest_cfg.priority = rsp_params->dest_priority; |
| 397 | attr->dest_cfg.dest_type = |
| 398 | dpseci_get_field(rsp_params->dest_type, |
| 399 | DEST_TYPE); |
| 400 | attr->order_preservation_en = |
| 401 | dpseci_get_field(rsp_params->order_preservation_en, |
| 402 | ORDER_PRESERVATION); |
| 403 | |
| 404 | return 0; |
| 405 | } |
| 406 | |
| 407 | /** |
| 408 | * dpseci_get_tx_queue() - Retrieve Tx queue attributes. |
no test coverage detected