more or less the same shape.
ok uebayasi@
-/* $OpenBSD: dwc2.c,v 1.27 2015/06/08 00:58:23 jmatthew Exp $ */
+/* $OpenBSD: dwc2.c,v 1.28 2015/06/08 08:47:38 jmatthew Exp $ */
/* $NetBSD: dwc2.c,v 1.32 2014/09/02 23:26:20 macallan Exp $ */
/*-
{
struct delayed_work *dw = arg;
- task_set(&dw->work, dw->dw_fn, arg);
+ task_set(&dw->work, dw->dw_fn, dw->dw_arg);
task_add(dw->dw_wq, &dw->work);
}
-/* $OpenBSD: dwc2.h,v 1.11 2015/02/12 07:51:51 uebayasi Exp $ */
+/* $OpenBSD: dwc2.h,v 1.12 2015/06/08 08:47:38 jmatthew Exp $ */
/* $NetBSD: dwc2.h,v 1.4 2014/12/23 16:20:06 macallan Exp $ */
/*-
struct taskq *dw_wq;
void (*dw_fn)(void *);
+ void *dw_arg;
};
STATIC_INLINE void
-INIT_DELAYED_WORK(struct delayed_work *dw, void (*fn)(struct task *))
+INIT_DELAYED_WORK(struct delayed_work *dw, void (*fn)(void *), void *arg)
{
- dw->dw_fn = (void (*)(void *))fn;
+ dw->dw_fn = fn;
+ dw->dw_arg = arg;
timeout_set(&dw->dw_timer, dw_timeout, dw);
}
STATIC_INLINE void
queue_delayed_work(struct taskq *wq, struct delayed_work *dw, int j)
{
+ dw->dw_wq = wq;
timeout_add(&dw->dw_timer, j);
}
-/* $OpenBSD: dwc2_coreintr.c,v 1.6 2015/02/12 06:46:23 uebayasi Exp $ */
+/* $OpenBSD: dwc2_coreintr.c,v 1.7 2015/06/08 08:47:38 jmatthew Exp $ */
/* $NetBSD: dwc2_coreintr.c,v 1.8 2014/04/04 05:40:57 skrll Exp $ */
/*
* scheduling.
*/
spin_unlock(&hsotg->lock);
+ task_set(&hsotg->wf_otg, dwc2_conn_id_status_change, hsotg);
task_add(hsotg->wq_otg, &hsotg->wf_otg);
spin_lock(&hsotg->lock);
-/* $OpenBSD: dwc2_hcd.c,v 1.14 2015/02/12 11:42:58 uebayasi Exp $ */
+/* $OpenBSD: dwc2_hcd.c,v 1.15 2015/06/08 08:47:38 jmatthew Exp $ */
/* $NetBSD: dwc2_hcd.c,v 1.15 2014/11/24 10:14:14 skrll Exp $ */
/*
}
void
-dwc2_conn_id_status_change(struct task *work)
+dwc2_conn_id_status_change(void *data)
{
- struct dwc2_hsotg *hsotg = container_of(work, struct dwc2_hsotg,
- wf_otg);
+ struct dwc2_hsotg *hsotg = data;
u32 count = 0;
u32 gotgctl;
* Work queue function for starting the HCD when A-Cable is connected
*/
void
-dwc2_hcd_start_func(struct task *work)
+dwc2_hcd_start_func(void *data)
{
- struct dwc2_hsotg *hsotg = container_of(work, struct dwc2_hsotg,
- start_work.work);
+ struct dwc2_hsotg *hsotg = data;
dev_dbg(hsotg->dev, "%s() %p\n", __func__, hsotg);
dwc2_host_start(hsotg);
* Reset work queue function
*/
void
-dwc2_hcd_reset_func(struct task *work)
+dwc2_hcd_reset_func(void *data)
{
- struct dwc2_hsotg *hsotg = container_of(work, struct dwc2_hsotg,
- reset_work.work);
+ struct dwc2_hsotg *hsotg = data;
u32 hprt0;
dev_dbg(hsotg->dev, "USB RESET function called\n");
dwc2_hcd_init_usecs(hsotg);
/* Initialize hsotg start work */
- INIT_DELAYED_WORK(&hsotg->start_work, dwc2_hcd_start_func);
+ INIT_DELAYED_WORK(&hsotg->start_work, dwc2_hcd_start_func, hsotg);
/* Initialize port reset work */
- INIT_DELAYED_WORK(&hsotg->reset_work, dwc2_hcd_reset_func);
+ INIT_DELAYED_WORK(&hsotg->reset_work, dwc2_hcd_reset_func, hsotg);
/*
* Allocate space for storing data on status transactions. Normally no
-/* $OpenBSD: dwc2_hcd.h,v 1.11 2015/02/12 11:42:58 uebayasi Exp $ */
+/* $OpenBSD: dwc2_hcd.h,v 1.12 2015/06/08 08:47:38 jmatthew Exp $ */
/* $NetBSD: dwc2_hcd.h,v 1.9 2014/09/03 10:00:08 skrll Exp $ */
/*
void dwc2_hcd_urb_set_pipeinfo(struct dwc2_hsotg *, struct dwc2_hcd_urb *,
u8 ,u8, u8, u8, u16);
-void dwc2_conn_id_status_change(struct task *);
-void dwc2_hcd_start_func(struct task *);
-void dwc2_hcd_reset_func(struct task *);
+void dwc2_conn_id_status_change(void *);
+void dwc2_hcd_start_func(void *);
+void dwc2_hcd_reset_func(void *);
struct dwc2_hcd_urb * dwc2_hcd_urb_alloc(struct dwc2_hsotg *, int, gfp_t);
void dwc2_hcd_urb_free(struct dwc2_hsotg *, struct dwc2_hcd_urb *, int);