On Wed, Feb 22, 2017 at 6:55 AM, Christophe Milard <
christophe.mil...@linaro.org> wrote:

> The driver removal function expects a device, of course...
> Also unbind seems a better name to disconnect from a device
> since remove has been used for removing the object itself for
> enumerators.
> Some extra parameters to allow for graceful unbinding are also added.
>
> Signed-off-by: Christophe Milard <christophe.mil...@linaro.org>
> ---
>  include/odp/drv/spec/driver.h | 21 ++++++++++++++++++---
>  1 file changed, 18 insertions(+), 3 deletions(-)
>
> diff --git a/include/odp/drv/spec/driver.h b/include/odp/drv/spec/driver.h
> index b08d7fb..a978d12 100644
> --- a/include/odp/drv/spec/driver.h
> +++ b/include/odp/drv/spec/driver.h
> @@ -300,14 +300,29 @@ struct odpdrv_driver_param_t {
>          */
>         int (*probe)(odpdrv_device_t *dev);
>
> -       /** Remove function:
> +       /** unbind function:
>          * Only called with devices whose probe() returned true
>          *
> +        * dev: the device to unbind
> +        * callback: if flag ODPDRV_DRV_UNBIND_IMMEDIATE is not specified,
> +        *  unbind should be attempted gracefuly, meaning that some IO may
> need
> +        *  to terminate before the driver is really unbound from the
> device:
> +        *  In this case (when the flag is not set), the driver is due to
> call
> +        *  the callback function when the driver is unbound from the
> device.
> +        *  This callback may occurs within the unbind() call if the driver
> +        *  does unbind immediately.
> +        *  If the ODPDRV_DRV_UNBIND_IMMEDIATE is specified, the driver is
> due
> +        *  to release the device immediately (poosibly less gracefuly).
>

Typo: possibly less gracefully


> +        *  The callback must be called immediately in this case.
>          */
> -       int (*remove)(odpdrv_device_param_t *dev);
> -
> +       int (*unbind)(odpdrv_device_t dev,
> +                     void (*callback)(odpdrv_device_t dev),
> +                     uint32_t flags);
>  };
>
> +/** The callback function must be called mmediately by the current ODP
> thread */
> +#define ODPDRV_DRV_UNBIND_IMMEDIATE    0x00000001
> +
>  /**
>  * Register an enumerator class.
>  * Each enumerator class calls this function at init time.
> --
> 2.7.4
>
>

Reply via email to