* dpseci_is_enabled() - Check if the DPSECI is enabled. * @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 * @en: Returns '1' if object is enabled; '0' otherwise * * Return: '0' on Success; Error code otherwise. */
| 226 | * Return: '0' on Success; Error code otherwise. |
| 227 | */ |
| 228 | int dpseci_is_enabled(struct fsl_mc_io *mc_io, |
| 229 | uint32_t cmd_flags, |
| 230 | uint16_t token, |
| 231 | int *en) |
| 232 | { |
| 233 | struct dpseci_rsp_is_enabled *rsp_params; |
| 234 | struct mc_command cmd = { 0 }; |
| 235 | int err; |
| 236 | |
| 237 | /* prepare command */ |
| 238 | cmd.header = mc_encode_cmd_header(DPSECI_CMDID_IS_ENABLED, |
| 239 | cmd_flags, |
| 240 | token); |
| 241 | |
| 242 | /* send command to mc*/ |
| 243 | err = mc_send_command(mc_io, &cmd); |
| 244 | if (err) |
| 245 | return err; |
| 246 | |
| 247 | /* retrieve response parameters */ |
| 248 | rsp_params = (struct dpseci_rsp_is_enabled *)cmd.params; |
| 249 | *en = dpseci_get_field(rsp_params->en, ENABLE); |
| 250 | |
| 251 | return 0; |
| 252 | } |
| 253 | |
| 254 | /** |
| 255 | * dpseci_reset() - Reset the DPSECI, returns the object to initial state. |
nothing calls this directly
no test coverage detected