Logo Search packages:      
Sourcecode: linux-fsl-imx51 version File versions  Download package

fsl_shw_return_t fsl_shw_register_user ( fsl_shw_uco_t user_ctx  ) 

Create an association between the the user and the provider of the API.

Parameters:
user_ctx The user context which will be used for this association.
Returns:
A return code of type fsl_shw_return_t.

Definition at line 1562 of file shw_driver.c.

References fsl_shw_uco_t::flags, FSL_RETURN_BAD_FLAG_S, FSL_RETURN_INTERNAL_ERROR_S, FSL_RETURN_NO_RESOURCE_S, FSL_RETURN_OK_S, FSL_UCO_BLOCKING_MODE, FSL_UCO_CALLBACK_MODE, fsl_shw_uco_t::pool_size, sah_register(), and SHW_ADD_USER().

{
      fsl_shw_return_t code = FSL_RETURN_INTERNAL_ERROR_S;

      if ((user_ctx->flags & FSL_UCO_BLOCKING_MODE) &&
          (user_ctx->flags & FSL_UCO_CALLBACK_MODE)) {
            code = FSL_RETURN_BAD_FLAG_S;
            goto error_exit;
      } else if (user_ctx->pool_size == 0) {
            code = FSL_RETURN_NO_RESOURCE_S;
            goto error_exit;
      } else {
            user_ctx->result_pool.head = NULL;
            user_ctx->result_pool.tail = NULL;
            SHW_ADD_USER(user_ctx);
            code = FSL_RETURN_OK_S;
      }

      error_exit:
      return code;
}


Generated by  Doxygen 1.6.0   Back to index