mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: Jules Maselbas <jmaselbas@kalray.eu>, barebox@lists.infradead.org
Subject: Re: [RFC PATCH] usb: gadget: dfu: Rework dfu command to use usbgadget
Date: Fri, 10 Sep 2021 10:46:23 +0200	[thread overview]
Message-ID: <2a28243f-72fc-2cb3-3399-23ab175d385a@pengutronix.de> (raw)
In-Reply-To: <20210830144835.27458-1-jmaselbas@kalray.eu>

Hi Jules,

On 30.08.21 16:48, Jules Maselbas wrote:
> The dfu command now uses the composite multi gadget to register the usb
> functionality. This allows the removal of the usb composite driver from
> dfu.c
> 
> As the dfu command is blocking the command slice must be released while
> the dfu gadget is running in order to do operations on the file system.
> 
> The usb_dfu_register() function is replaced with usb_dfu_detached() for
> the dfu command to return a different value depending on if it has been
> interrupted with CTRL-C or if the gadget has been detached.
> 
> Signed-off-by: Jules Maselbas <jmaselbas@kalray.eu>
> ---
>  commands/dfu.c           |  24 +++---
>  drivers/usb/gadget/dfu.c | 163 +--------------------------------------
>  include/usb/dfu.h        |   2 +-
>  3 files changed, 15 insertions(+), 174 deletions(-)
> 
> diff --git a/commands/dfu.c b/commands/dfu.c
> index 3132a7479d..0d8a703300 100644
> --- a/commands/dfu.c
> +++ b/commands/dfu.c
> @@ -11,6 +11,7 @@
>  #include <fs.h>
>  #include <xfuncs.h>
>  #include <usb/dfu.h>
> +#include <usb/gadget-multi.h>
>  #include <linux/err.h>
>  
>  /* dfu /dev/self0(bootloader)sr,/dev/nand0.root.bb(root)
> @@ -20,28 +21,27 @@
>   */
>  static int do_dfu(int argc, char *argv[])
>  {
> -	struct f_dfu_opts opts;
>  	char *argstr;
> -	struct usb_dfu_dev *dfu_alts = NULL;
>  	int ret;
>  
>  	if (argc != optind + 1)
>  		return COMMAND_ERROR_USAGE;
>  
>  	argstr = argv[optind];
> +	ret = usbgadget_register(true, argstr, false, NULL, false, false);
> +	if (ret)
> +		return ret;

next branch has a different prototype for usbgadget_register now.
Could you adapt it for v2?


Cheers,
Ahmad


-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


      parent reply	other threads:[~2021-09-10  8:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-30 14:48 Jules Maselbas
2021-09-08 12:45 ` Anže Lešnik
2021-09-10  8:44   ` Ahmad Fatoum
2021-09-10 18:27     ` Anže Lešnik
2021-09-10  8:46 ` Ahmad Fatoum [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2a28243f-72fc-2cb3-3399-23ab175d385a@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=jmaselbas@kalray.eu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox