return 0;
}
-/**
- * dpci_get_peer_attributes() - Retrieve peer DPCI 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 DPCI object
- * @attr: Returned peer attributes
- *
- * Return: '0' on Success; Error code otherwise.
- */
-int dpci_get_peer_attributes(struct fsl_mc_io *mc_io,
- uint32_t cmd_flags,
- uint16_t token,
- struct dpci_peer_attr *attr)
-{
- struct dpci_rsp_get_peer_attr *rsp_params;
- struct mc_command cmd = { 0 };
- int err;
-
- /* prepare command */
- cmd.header = mc_encode_cmd_header(DPCI_CMDID_GET_PEER_ATTR,
- cmd_flags,
- token);
-
- /* send command to mc*/
- err = mc_send_command(mc_io, &cmd);
- if (err)
- return err;
-
- /* retrieve response parameters */
- rsp_params = (struct dpci_rsp_get_peer_attr *)cmd.params;
- attr->peer_id = le32_to_cpu(rsp_params->id);
- attr->num_of_priorities = rsp_params->num_of_priorities;
-
- return 0;
-}
-
-/**
- * dpci_get_link_state() - Retrieve the DPCI link state.
- * @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
- * @up: Returned link state; returns '1' if link is up, '0' otherwise
- *
- * DPCI can be connected to another DPCI, together they
- * create a 'link'. In order to use the DPCI Tx and Rx queues,
- * both objects must be enabled.
- *
- * Return: '0' on Success; Error code otherwise.
- */
-int dpci_get_link_state(struct fsl_mc_io *mc_io,
- uint32_t cmd_flags,
- uint16_t token,
- int *up)
-{
- struct dpci_rsp_get_link_state *rsp_params;
- struct mc_command cmd = { 0 };
- int err;
-
- /* prepare command */
- cmd.header = mc_encode_cmd_header(DPCI_CMDID_GET_LINK_STATE,
- cmd_flags,
- token);
-
- /* send command to mc*/
- err = mc_send_command(mc_io, &cmd);
- if (err)
- return err;
-
- /* retrieve response parameters */
- rsp_params = (struct dpci_rsp_get_link_state *)cmd.params;
- *up = dpci_get_field(rsp_params->up, UP);
-
- return 0;
-}
-
/**
* dpci_set_rx_queue() - Set Rx queue configuration
* @mc_io: Pointer to MC portal's I/O object