[U-Boot] [PATCH 5/6] usb: dwc2: add support for SPLIT transactions

Stefan Bruens
2015-12-20T00:17:05Z

On Tuesday 15 December 2015 20:36:02 Stephen Warren wrote:
> On 12/12/2015 09:17 PM, Stefan Br?ns wrote:
> > In contrast to non-SPLIT transfers each transaction has to be submitted
> > as an individual chunk. Handling of ACK/NAk/NYET handshakes depends on
> > transaction (non-SPLIT/SSPLIT/CSPLIT), thus inline the HCINT flag
> > handling.
> >
> > diff --git a/drivers/usb/host/dwc2.c b/drivers/usb/host/dwc2.c
> >
> > int chunk_msg(struct dwc2_priv *priv, struct usb_device *dev,
> >
> > - unsigned long pipe, int *pid, int in, void *buffer, int len,
> > - bool ignore_ack)
> > + unsigned long pipe, int *pid, int in, void *buffer, int len)
>
> ...
>
> > + uint32_t hctsiz;
> > + uint32_t hcint;
> > + uint32_t hcint_rem;
> > + uint8_t do_split = 0;
> > + uint8_t complete_split = 0;
> > + uint8_t start_again = 0;
> > + uint8_t hub_addr = 0;
> > + uint8_t hub_port = 0;
>
> Rather than inlining all this stuff into chunk_msg, I had always
> intended to move the body of chunk_msg() into a new function e.g.
> split_msg() that chunk_msg() called repeatedly for each chunk, with
> split_msg() either performing just a single transaction, or performing
> both a start/complete-split. That would keep the functions a bit simpler
> and more focused.

I will try to restructure the code a little bit to move the body of the loop
to a seperate function ...

Kind regards,

Stefan

--
Stefan Br?ns / Bergstra?e 21 / 52062 Aachen
home: +49 241 53809034 mobile: +49 151 50412019
work: +49 2405 49936-424