HI Lukasz
2017-04-20 17:14 GMT+08:00 Lukasz Majewski <lu...@denx.de>: > Hi, > >> Hi Eddie, >> >> > Hi Lukasz >> > >> > 2017-04-20 6:14 GMT+08:00 Lukasz Majewski <lu...@denx.de>: >> > > Hi Eddie, >> > > >> > >> add do_extra_command to let people deal with customized command >> > >> >> > >> Signed-off-by: Eddie Cai <eddie.cai.li...@gmail.com> >> > >> --- >> > >> drivers/usb/gadget/f_mass_storage.c | 8 +++++++- >> > >> 1 file changed, 7 insertions(+), 1 deletion(-) >> > >> >> > >> diff --git a/drivers/usb/gadget/f_mass_storage.c >> > >> b/drivers/usb/gadget/f_mass_storage.c index 333f069..d431e53 >> > >> 100644 --- a/drivers/usb/gadget/f_mass_storage.c >> > >> +++ b/drivers/usb/gadget/f_mass_storage.c >> > >> @@ -2168,6 +2168,10 @@ unknown_cmnd: >> > >> return 0; >> > >> } >> > >> >> > >> +int __weak do_extra_command(struct fsg_common *common) >> > >> +{ >> > >> + return -EINVAL; >> > >> +} >> > >> >> > >> /*-------------------------------------------------------------------------*/ >> > >> >> > >> static int received_cbw(struct fsg_dev *fsg, struct fsg_buffhd >> > >> *bh) @@ -2540,8 +2544,10 @@ int fsg_main_thread(void *common_) >> > >> if (!exception_in_progress(common)) >> > >> common->state = FSG_STATE_DATA_PHASE; >> > >> >> > >> - if (do_scsi_command(common) || >> > >> finish_reply(common)) >> > >> + if ((do_extra_command(common) && >> > >> do_scsi_command(common)) || >> > > >> > > I must admit that I'm against mixing things. Let's leave >> > > f_mass_storage for mass storage and add f_rockchip_* for separate >> > > function. >> > Do you mean add f_rockusb.c for rockusb function? >> > > >> > > If possible we can reuse as much as possible from f_*.c and >> > > g_dnl.* files. >> > Yes, Totally agree. Can you review my V1 patches? I think that is >> > what you expect. >> > https://lists.denx.de/pipermail/u-boot/2017-March/283730.html >> >> No problem, I will look on them. > > One more remark/nit: > > It is very useful to add info regarding changes between versions: > > --- > Changes for v3: > - > - > > Changes for v2: > - Moved from f_rockchip_* to f_mass_storage > - Combine storage_common.c file with f_mass_storage.c Got it. Thanks for reminding. I will add it in next version. > > > >> >> > > >> > >> + finish_reply(common)) { >> > >> continue; >> > >> + } >> > >> >> > >> if (!exception_in_progress(common)) >> > >> common->state = FSG_STATE_STATUS_PHASE; >> > > >> > > >> > > >> > > >> > > Best regards, >> > > >> > > Lukasz Majewski >> > > >> > > -- >> > > >> > > DENX Software Engineering GmbH, Managing Director: Wolfgang >> > > Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, >> > > Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: >> > > w...@denx.de >> >> >> >> >> Best regards, >> >> Lukasz Majewski >> >> -- >> >> DENX Software Engineering GmbH, Managing Director: Wolfgang Denk >> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany >> Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de > > > > Best regards, > > Lukasz Majewski > > -- > > DENX Software Engineering GmbH, Managing Director: Wolfgang Denk > HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany > Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot