public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [RFC PATCH 1/2] USB: SS: Add support for Super Speed USB interface
Date: Fri, 26 Oct 2012 12:18:06 +0200	[thread overview]
Message-ID: <201210261218.07227.marex@denx.de> (raw)
In-Reply-To: <CAFp+6iEqgBm=coMuzxPfuM402bu6GGnmnKZDBJtN_YzqgC7G3g@mail.gmail.com>

Dear Vivek Gautam,

[...]
> 
> This comes as an affect of introduction of "struct usb_ep_desc"
> which eventually contains "struct usb_endpoint_descriptor" and
> "struct usb_ss_ep_comp_descriptor".

I see, can we split this? I really enjoy small incremental patches, it's much 
easier to bisect issues then.

> >>                       put_unaligned(le16_to_cpu(ep_wMaxPacketSize),
> >>                       
> >>                                       &dev->config.\
> >>                                       if_desc[ifno].\
> >>                                       ep_desc[epno].\
> >> 
> >> -                                     wMaxPacketSize);
> >> +                                     ep_desc.wMaxPacketSize);
> >> 
> >>                       USB_PRINTF("if %d, ep %d\n", ifno, epno);
> >>                       break;
> >> 
> >> +             case USB_DT_SS_ENDPOINT_COMP:
> >> +                     if_desc = &dev->config.if_desc[ifno];
> >> +                     memcpy(&(if_desc->ep_desc[epno].ss_ep_comp),
> > 
> > Do you need these braces in &(...) ?
> 
> True, we can remove these braces.
> 
> >> +                             &buffer[index], buffer[index]);
> >> +                     break;
> >> 
> >>               default:
> >>                       if (head->bLength == 0)
> >>                       
> >>                               return 1;
> >> 
> >> @@ -659,6 +666,18 @@ static int usb_get_string(struct usb_device *dev,
> >> unsigned short langid, return result;
> >> 
> >>  }
> >> 
> >> +/* Allocate usb device */
> >> +int usb_alloc_dev(struct usb_device *dev)
> >> +{
> >> +     int res;
> >> +
> >> +     USB_PRINTF("alloc device\n");
> > 
> > this is a debug print.
> 
> Isn't USB_PRINTF itself a conditional debug print ?

Yes, but I'd prefer to kill USB_PRINTF altogether in favor of debug().

> >> +     res = usb_control_msg(dev, usb_sndctrlpipe(dev->parent, 0),
> >> +                             USB_REQ_ALLOC_DEV, 0, 0, 0,
> >> +                             NULL, 0, USB_CNTL_TIMEOUT);
> > 
> > How does this "allocate" a device? Please, do a proper documentation.
> > Actually, take a look at include/linker_lists.h
> > 
> > Or see here:
> > http://git.denx.de/?p=u-
> > boot.git;a=blob;f=include/linker_lists.h;h=0b405d78ea34df1c528fbc4e24ed2a
> > ad756ac4a2;hb=HEAD
> > 
> > And here (U-Boot Code Documentation):
> > http://www.denx.de/wiki/U-Boot/CodingStyle
> > 
> > It'd be really nice if you could follow such pattern of documentation!
> 
> Yes, thanks for pointing out. Will document it properly to make things
> more understandable.

_AWESOME_ !

> >> +     return res;
> >> +}
> >> 

[...]

> >> diff --git a/include/common.h b/include/common.h
> >> index b23e90b..ef5f687 100644
> >> --- a/include/common.h
> >> +++ b/include/common.h
> >> @@ -211,6 +211,8 @@ typedef void (interrupt_handler_t)(void *);
> >> 
> >>  #define MIN(x, y)  min(x, y)
> >>  #define MAX(x, y)  max(x, y)
> >> 
> >> +#define min3(a, b, c)        min(min(a, b), c)
> >> +
> > 
> > Isn't this defined somewhere already?
> 
> Can you please guide me here, i can see a similar inline function in
> ehci-hcd only :(

ICK, so we have ad-hoc implementation of this :-( I'd say, put it into common.h 
and remove the ehci's ad-hoc implementation.

> > [...]
> > 
> > Rest is just great.
> 
> Thanks for reviewing this Marek. I shall update the patchset soon.

Welcome, it's pleasure to work with you ;-)

  reply	other threads:[~2012-10-26 10:18 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-23 10:54 [U-Boot] [RFC PATCH 0/2] USB: XHCI: Add xHCI host controller stack driver Vivek Gautam
2012-10-23 10:54 ` [U-Boot] [RFC PATCH 1/2] USB: SS: Add support for Super Speed USB interface Vivek Gautam
2012-10-23 11:40   ` Marek Vasut
2012-10-26 10:07     ` Vivek Gautam
2012-10-26 10:18       ` Marek Vasut [this message]
2012-10-26 10:34         ` Vivek Gautam
2012-10-26 11:06           ` Marek Vasut
2012-10-23 10:54 ` [U-Boot] [RFC PATCH 2/2] USB: xHCI: Add stack support for xHCI Vivek Gautam
2012-10-23 11:43   ` Marek Vasut
2012-10-23 22:35     ` Tom Rini
2012-10-26  9:51       ` Vivek Gautam
2012-10-26 10:17         ` Vivek Gautam
2012-10-26 10:18         ` Marek Vasut
2012-10-26 10:21           ` Vivek Gautam
2012-10-23 13:00   ` Wolfgang Denk
2012-10-25  6:12     ` Vivek Gautam
2013-01-11  5:32       ` Satendra Pratap
2013-01-11 10:05         ` Vivek Gautam
2012-10-23 11:20 ` [U-Boot] [RFC PATCH 0/2] USB: XHCI: Add xHCI host controller stack driver Marek Vasut
2012-10-23 12:53   ` Vivek Gautam

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=201210261218.07227.marex@denx.de \
    --to=marex@denx.de \
    --cc=u-boot@lists.denx.de \
    /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