* dpci_set_rx_queue() - Set Rx queue configuration * @mc_io: Pointer to MC portal's I/O object * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @token: Token of DPCI object * @priority: Select the queue relative to number of * priorities configured at DPCI creation; use * DPCI_ALL_QUEUES to configure all Rx queues * identically. * @cfg: Rx queue configuration * * Return
| 316 | * Return: '0' on Success; Error code otherwise. |
| 317 | */ |
| 318 | int dpci_set_rx_queue(struct fsl_mc_io *mc_io, |
| 319 | uint32_t cmd_flags, |
| 320 | uint16_t token, |
| 321 | uint8_t priority, |
| 322 | const struct dpci_rx_queue_cfg *cfg) |
| 323 | { |
| 324 | struct dpci_cmd_set_rx_queue *cmd_params; |
| 325 | struct mc_command cmd = { 0 }; |
| 326 | |
| 327 | /* prepare command */ |
| 328 | cmd.header = mc_encode_cmd_header(DPCI_CMDID_SET_RX_QUEUE, |
| 329 | cmd_flags, |
| 330 | token); |
| 331 | cmd_params = (struct dpci_cmd_set_rx_queue *)cmd.params; |
| 332 | cmd_params->dest_id = cpu_to_le32(cfg->dest_cfg.dest_id); |
| 333 | cmd_params->dest_priority = cfg->dest_cfg.priority; |
| 334 | cmd_params->priority = priority; |
| 335 | cmd_params->user_ctx = cpu_to_le64(cfg->user_ctx); |
| 336 | cmd_params->options = cpu_to_le32(cfg->options); |
| 337 | dpci_set_field(cmd_params->dest_type, |
| 338 | DEST_TYPE, |
| 339 | cfg->dest_cfg.dest_type); |
| 340 | dpci_set_field(cmd_params->dest_type, |
| 341 | ORDER_PRESERVATION, |
| 342 | cfg->order_preservation_en); |
| 343 | |
| 344 | /* send command to mc*/ |
| 345 | return mc_send_command(mc_io, &cmd); |
| 346 | } |
| 347 | |
| 348 | /** |
| 349 | * dpci_get_rx_queue() - Retrieve Rx queue attributes. |
no test coverage detected