* dpseci_get_attributes() - Retrieve DPSECI 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 * @attr: Returned object's attributes * * Return: '0' on Success; Error code otherwise. */
| 284 | * Return: '0' on Success; Error code otherwise. |
| 285 | */ |
| 286 | int dpseci_get_attributes(struct fsl_mc_io *mc_io, |
| 287 | uint32_t cmd_flags, |
| 288 | uint16_t token, |
| 289 | struct dpseci_attr *attr) |
| 290 | { |
| 291 | struct dpseci_rsp_get_attr *rsp_params; |
| 292 | struct mc_command cmd = { 0 }; |
| 293 | int err; |
| 294 | |
| 295 | /* prepare command */ |
| 296 | cmd.header = mc_encode_cmd_header(DPSECI_CMDID_GET_ATTR, |
| 297 | cmd_flags, |
| 298 | token); |
| 299 | |
| 300 | /* send command to mc*/ |
| 301 | err = mc_send_command(mc_io, &cmd); |
| 302 | if (err) |
| 303 | return err; |
| 304 | |
| 305 | /* retrieve response parameters */ |
| 306 | rsp_params = (struct dpseci_rsp_get_attr *)cmd.params; |
| 307 | attr->id = le32_to_cpu(rsp_params->id); |
| 308 | attr->options = le32_to_cpu(rsp_params->options); |
| 309 | attr->num_tx_queues = rsp_params->num_tx_queues; |
| 310 | attr->num_rx_queues = rsp_params->num_rx_queues; |
| 311 | |
| 312 | return 0; |
| 313 | } |
| 314 | |
| 315 | /** |
| 316 | * dpseci_set_rx_queue() - Set Rx queue configuration |
no test coverage detected