diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2011-12-08 21:28:54 -0500 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2011-12-13 06:06:26 -0500 |
commit | 3edeee3893b107364fe4ed8535245773b1e1e72b (patch) | |
tree | c2207d91e769635857b8f9b14e36ed686a6e8a32 /drivers/usb/renesas_usbhs/fifo.c | |
parent | e5679d07a6ca5512070fb5e65dcc66eeb5087d0d (diff) |
usb: renesas_usbhs: care pipe sequence
driver has to re-use the limited pipe for each device/endpoint
when it is USB host hub mode, since number of pipe has limitation.
Then, each pipe should care own pipe sequence for next packet.
This patch adds sequence control.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/renesas_usbhs/fifo.c')
-rw-r--r-- | drivers/usb/renesas_usbhs/fifo.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/usb/renesas_usbhs/fifo.c b/drivers/usb/renesas_usbhs/fifo.c index ffdf5d15085e..b51fcd80d244 100644 --- a/drivers/usb/renesas_usbhs/fifo.c +++ b/drivers/usb/renesas_usbhs/fifo.c | |||
@@ -56,7 +56,7 @@ static struct usbhs_pkt_handle usbhsf_null_handler = { | |||
56 | void usbhs_pkt_push(struct usbhs_pipe *pipe, struct usbhs_pkt *pkt, | 56 | void usbhs_pkt_push(struct usbhs_pipe *pipe, struct usbhs_pkt *pkt, |
57 | void (*done)(struct usbhs_priv *priv, | 57 | void (*done)(struct usbhs_priv *priv, |
58 | struct usbhs_pkt *pkt), | 58 | struct usbhs_pkt *pkt), |
59 | void *buf, int len, int zero) | 59 | void *buf, int len, int zero, int sequence) |
60 | { | 60 | { |
61 | struct usbhs_priv *priv = usbhs_pipe_to_priv(pipe); | 61 | struct usbhs_priv *priv = usbhs_pipe_to_priv(pipe); |
62 | struct device *dev = usbhs_priv_to_dev(priv); | 62 | struct device *dev = usbhs_priv_to_dev(priv); |
@@ -90,6 +90,7 @@ void usbhs_pkt_push(struct usbhs_pipe *pipe, struct usbhs_pkt *pkt, | |||
90 | pkt->zero = zero; | 90 | pkt->zero = zero; |
91 | pkt->actual = 0; | 91 | pkt->actual = 0; |
92 | pkt->done = done; | 92 | pkt->done = done; |
93 | pkt->sequence = sequence; | ||
93 | 94 | ||
94 | usbhs_unlock(priv, flags); | 95 | usbhs_unlock(priv, flags); |
95 | /******************** spin unlock ******************/ | 96 | /******************** spin unlock ******************/ |
@@ -481,6 +482,9 @@ static int usbhsf_pio_try_push(struct usbhs_pkt *pkt, int *is_done) | |||
481 | int i, ret, len; | 482 | int i, ret, len; |
482 | int is_short; | 483 | int is_short; |
483 | 484 | ||
485 | usbhs_pipe_data_sequence(pipe, pkt->sequence); | ||
486 | pkt->sequence = -1; /* -1 sequence will be ignored */ | ||
487 | |||
484 | ret = usbhsf_fifo_select(pipe, fifo, 1); | 488 | ret = usbhsf_fifo_select(pipe, fifo, 1); |
485 | if (ret < 0) | 489 | if (ret < 0) |
486 | return 0; | 490 | return 0; |
@@ -584,6 +588,8 @@ static int usbhsf_prepare_pop(struct usbhs_pkt *pkt, int *is_done) | |||
584 | /* | 588 | /* |
585 | * pipe enable to prepare packet receive | 589 | * pipe enable to prepare packet receive |
586 | */ | 590 | */ |
591 | usbhs_pipe_data_sequence(pipe, pkt->sequence); | ||
592 | pkt->sequence = -1; /* -1 sequence will be ignored */ | ||
587 | 593 | ||
588 | usbhs_pipe_enable(pipe); | 594 | usbhs_pipe_enable(pipe); |
589 | usbhsf_rx_irq_ctrl(pipe, 1); | 595 | usbhsf_rx_irq_ctrl(pipe, 1); |
@@ -641,6 +647,7 @@ static int usbhsf_pio_try_pop(struct usbhs_pkt *pkt, int *is_done) | |||
641 | * "Operation" - "FIFO Buffer Memory" - "FIFO Port Function" | 647 | * "Operation" - "FIFO Buffer Memory" - "FIFO Port Function" |
642 | */ | 648 | */ |
643 | if (0 == rcv_len) { | 649 | if (0 == rcv_len) { |
650 | pkt->zero = 1; | ||
644 | usbhsf_fifo_clear(pipe, fifo); | 651 | usbhsf_fifo_clear(pipe, fifo); |
645 | goto usbhs_fifo_read_end; | 652 | goto usbhs_fifo_read_end; |
646 | } | 653 | } |