usb: gadget: renesas_usbhs: add struct usbhs_priv to packet done function
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tue, 11 Oct 2011 05:03:39 +0000 (22:03 -0700)
committerFelipe Balbi <balbi@ti.com>
Thu, 13 Oct 2011 17:41:41 +0000 (20:41 +0300)
There was no method to get struct usbhs_priv when
packet transfer done function was called.
This patch allow that callback function receive it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/renesas_usbhs/fifo.c
drivers/usb/renesas_usbhs/mod_gadget.c
drivers/usb/renesas_usbhs/pipe.c
drivers/usb/renesas_usbhs/pipe.h

index b9ab8aefcae02f6c5c5428cc276c5c5b89fcec18..9bf3a437ea0b36970a65c5548fd0b993c9e164ad 100644 (file)
@@ -171,7 +171,7 @@ __usbhs_pkt_handler_end:
        /********************  spin unlock ******************/
 
        if (is_done) {
-               info->done(pkt);
+               info->done(priv, pkt);
                usbhs_pkt_start(pipe);
        }
 
index ae7d816c23d9d9ce571588b788514458ccef4656..dd4ca37fbab386ccbb814325fad179d661406037 100644 (file)
@@ -159,7 +159,7 @@ static void usbhsg_queue_pop(struct usbhsg_uep *uep,
        ureq->req.complete(&uep->ep, &ureq->req);
 }
 
-static void usbhsg_queue_done(struct usbhs_pkt *pkt)
+static void usbhsg_queue_done(struct usbhs_priv *priv, struct usbhs_pkt *pkt)
 {
        struct usbhs_pipe *pipe = pkt->pipe;
        struct usbhsg_uep *uep = usbhsg_pipe_to_uep(pipe);
index 5238287dc2cbec8cc1f6834d9aa46e0f6cfb1a37..08d11b0cab4304e2e901e57119c332e21d2df808 100644 (file)
@@ -497,7 +497,8 @@ static struct usbhs_pipe *usbhsp_get_pipe(struct usbhs_priv *priv, u32 type)
 }
 
 void usbhs_pipe_init(struct usbhs_priv *priv,
-                    void (*done)(struct usbhs_pkt *pkt),
+                    void (*done)(struct usbhs_priv *priv,
+                                 struct usbhs_pkt *pkt),
                     int (*dma_map_ctrl)(struct usbhs_pkt *pkt, int map))
 {
        struct usbhs_pipe_info *info = usbhs_priv_to_pipeinfo(priv);
index 6073a5c77740e0d5ba2f988f6aac8b010a91744d..05b706a09e56a72d326135e1e95e940a973b03c9 100644 (file)
@@ -47,7 +47,7 @@ struct usbhs_pipe_info {
        int size;       /* array size of "pipe" */
        int bufnmb_last;        /* FIXME : driver needs good allocator */
 
-       void (*done)(struct usbhs_pkt *pkt);
+       void (*done)(struct usbhs_priv *priv, struct usbhs_pkt *pkt);
        int (*dma_map_ctrl)(struct usbhs_pkt *pkt, int map);
 };
 
@@ -80,7 +80,8 @@ void usbhs_pipe_remove(struct usbhs_priv *priv);
 int usbhs_pipe_is_dir_in(struct usbhs_pipe *pipe);
 int usbhs_pipe_is_dir_host(struct usbhs_pipe *pipe);
 void usbhs_pipe_init(struct usbhs_priv *priv,
-                    void (*done)(struct usbhs_pkt *pkt),
+                    void (*done)(struct usbhs_priv *priv,
+                                 struct usbhs_pkt *pkt),
                     int (*dma_map_ctrl)(struct usbhs_pkt *pkt, int map));
 int usbhs_pipe_get_maxpacket(struct usbhs_pipe *pipe);
 void usbhs_pipe_clear_sequence(struct usbhs_pipe *pipe);