[U-Boot] [PATCH 6/8] usb: add usb_submit_int_msg_nonblock

Marek Vasut marex at denx.de
Tue Jul 2 11:59:49 UTC 2019


On 7/1/19 5:56 PM, Michal Suchanek wrote:
> Signed-off-by: Michal Suchanek <msuchanek at suse.de>
> ---
>  common/usb.c  | 9 +++++++++
>  include/usb.h | 2 ++
>  2 files changed, 11 insertions(+)
> 
> diff --git a/common/usb.c b/common/usb.c
> index 3ae71c98aaf4..d8302d39a91a 100644
> --- a/common/usb.c
> +++ b/common/usb.c
> @@ -200,6 +200,15 @@ int usb_submit_int_msg(struct usb_device *dev, unsigned long pipe,
>  	return submit_int_msg(dev, pipe, buffer, transfer_len, interval, false);
>  }
>  
> +/*
> + * submits an Interrupt Message without retry
> + */
> +int usb_submit_int_msg_nonblock(struct usb_device *dev, unsigned long pipe,
> +			void *buffer, int transfer_len, int interval)
> +{
> +	return submit_int_msg(dev, pipe, buffer, transfer_len, interval, true);
> +}

Is this wrapper really necessary ?

>  /*
>   * submits a control message and waits for comletion (at least timeout * 1ms)
>   * If timeout is 0, we don't wait for completion (used as example to set and
> diff --git a/include/usb.h b/include/usb.h
> index dde3e601da45..d1e7112f4c4e 100644
> --- a/include/usb.h
> +++ b/include/usb.h
> @@ -263,6 +263,8 @@ int usb_bulk_msg(struct usb_device *dev, unsigned int pipe,
>  			void *data, int len, int *actual_length, int timeout);
>  int usb_submit_int_msg(struct usb_device *dev, unsigned long pipe,
>  			void *buffer, int transfer_len, int interval);
> +int usb_submit_int_msg_nonblock(struct usb_device *dev, unsigned long pipe,
> +			void *buffer, int transfer_len, int interval);
>  int usb_disable_asynch(int disable);
>  int usb_maxpacket(struct usb_device *dev, unsigned long pipe);
>  int usb_get_configuration_no(struct usb_device *dev, int cfgno,
> 


-- 
Best regards,
Marek Vasut


More information about the U-Boot mailing list