* dpseci_open() - Open a control session for the specified object * @mc_io: Pointer to MC portal's I/O object * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @dpseci_id: DPSECI unique ID * @token: Returned token; use in subsequent API calls * * This function can be used to open a control session for an * already created object; an object may have been declared in * the DPL or
| 28 | * Return: '0' on Success; Error code otherwise. |
| 29 | */ |
| 30 | int dpseci_open(struct fsl_mc_io *mc_io, |
| 31 | uint32_t cmd_flags, |
| 32 | int dpseci_id, |
| 33 | uint16_t *token) |
| 34 | { |
| 35 | struct dpseci_cmd_open *cmd_params; |
| 36 | struct mc_command cmd = { 0 }; |
| 37 | int err; |
| 38 | |
| 39 | /* prepare command */ |
| 40 | cmd.header = mc_encode_cmd_header(DPSECI_CMDID_OPEN, |
| 41 | cmd_flags, |
| 42 | 0); |
| 43 | cmd_params = (struct dpseci_cmd_open *)cmd.params; |
| 44 | cmd_params->dpseci_id = cpu_to_le32(dpseci_id); |
| 45 | |
| 46 | /* send command to mc*/ |
| 47 | err = mc_send_command(mc_io, &cmd); |
| 48 | if (err) |
| 49 | return err; |
| 50 | |
| 51 | /* retrieve response parameters */ |
| 52 | *token = mc_cmd_hdr_read_token(&cmd); |
| 53 | |
| 54 | return 0; |
| 55 | } |
| 56 | |
| 57 | /** |
| 58 | * dpseci_close() - Close the control session of the object |
no test coverage detected