summaryrefslogtreecommitdiff
path: root/components/drivers/include
diff options
context:
space:
mode:
authorSherman <[email protected]>2022-01-26 17:48:46 +0800
committerSherman <[email protected]>2022-01-26 17:48:46 +0800
commit544c721d89ee7c6e7d3f88dd5bd555a221d8222e (patch)
treeaafdd34b49eca60159844a6712883cd01fd478b7 /components/drivers/include
parentfc3c29df709798bcbf0c40e4146e628975c40b9e (diff)
parent032ce63ed39c1bbb9f68068c0cf8b876771f27c8 (diff)
Merge branch 'master' of github.com:RT-Thread/rt-thread
Diffstat (limited to 'components/drivers/include')
-rw-r--r--components/drivers/include/drivers/usb_host.h8
-rw-r--r--components/drivers/include/ipc/workqueue.h26
2 files changed, 10 insertions, 24 deletions
diff --git a/components/drivers/include/drivers/usb_host.h b/components/drivers/include/drivers/usb_host.h
index 2031e2cdc0..95dd1ff066 100644
--- a/components/drivers/include/drivers/usb_host.h
+++ b/components/drivers/include/drivers/usb_host.h
@@ -6,6 +6,7 @@
* Change Logs:
* Date Author Notes
* 2011-3-12 Yi Qiu first version
+ * 2021-02-23 Leslie Lee provide possibility for multi usb host
*/
#ifndef __RT_USB_HOST_H__
@@ -137,6 +138,7 @@ struct uhcd
uhcd_ops_t ops;
rt_uint8_t num_ports;
uhub_t roothub;
+ struct rt_messagequeue *usb_mq;
};
typedef struct uhcd* uhcd_t;
@@ -163,7 +165,7 @@ struct uhost_msg
typedef struct uhost_msg* uhost_msg_t;
/* usb host system interface */
-rt_err_t rt_usb_host_init(void);
+rt_err_t rt_usb_host_init(const char *name);
void rt_usbh_hub_init(struct uhcd *hcd);
/* usb host core interface */
@@ -203,7 +205,7 @@ rt_err_t rt_usbh_hub_clear_port_feature(uhub_t uhub, rt_uint16_t port,
rt_err_t rt_usbh_hub_set_port_feature(uhub_t uhub, rt_uint16_t port,
rt_uint16_t feature);
rt_err_t rt_usbh_hub_reset_port(uhub_t uhub, rt_uint16_t port);
-rt_err_t rt_usbh_event_signal(struct uhost_msg* msg);
+rt_err_t rt_usbh_event_signal(uhcd_t uhcd, struct uhost_msg* msg);
void rt_usbh_root_hub_connect_handler(struct uhcd *hcd, rt_uint8_t port, rt_bool_t isHS);
@@ -265,5 +267,3 @@ rt_inline int rt_usb_hcd_setup_xfer(uhcd_t hcd, upipe_t pipe, ureq_t setup, int
#endif
#endif
-
-
diff --git a/components/drivers/include/ipc/workqueue.h b/components/drivers/include/ipc/workqueue.h
index edefb0933e..b2224bdcf4 100644
--- a/components/drivers/include/ipc/workqueue.h
+++ b/components/drivers/include/ipc/workqueue.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006-2021, RT-Thread Development Team
+ * Copyright (c) 2006-2022, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -54,37 +54,23 @@ struct rt_work
/**
* WorkQueue for DeviceDriver
*/
+void rt_work_init(struct rt_work *work, void (*work_func)(struct rt_work *work, void *work_data), void *work_data);
struct rt_workqueue *rt_workqueue_create(const char *name, rt_uint16_t stack_size, rt_uint8_t priority);
rt_err_t rt_workqueue_destroy(struct rt_workqueue *queue);
rt_err_t rt_workqueue_dowork(struct rt_workqueue *queue, struct rt_work *work);
-rt_err_t rt_workqueue_submit_work(struct rt_workqueue *queue, struct rt_work *work, rt_tick_t time);
+rt_err_t rt_workqueue_submit_work(struct rt_workqueue *queue, struct rt_work *work, rt_tick_t ticks);
rt_err_t rt_workqueue_cancel_work(struct rt_workqueue *queue, struct rt_work *work);
rt_err_t rt_workqueue_cancel_work_sync(struct rt_workqueue *queue, struct rt_work *work);
rt_err_t rt_workqueue_cancel_all_work(struct rt_workqueue *queue);
rt_err_t rt_workqueue_urgent_work(struct rt_workqueue *queue, struct rt_work *work);
#ifdef RT_USING_SYSTEM_WORKQUEUE
-rt_err_t rt_work_submit(struct rt_work *work, rt_tick_t time);
+rt_err_t rt_work_submit(struct rt_work *work, rt_tick_t ticks);
+rt_err_t rt_work_urgent(struct rt_work *work);
rt_err_t rt_work_cancel(struct rt_work *work);
#endif /* RT_USING_SYSTEM_WORKQUEUE */
-/**
- * @brief Initialize a work item, binding with a callback function.
- *
- * @param work A pointer to the work item object.
- * @param work_func A callback function that will be called when this work item is executed.
- * @param work_data A user data passed to the callback function as the second parameter.
- */
-rt_inline void rt_work_init(struct rt_work *work, void (*work_func)(struct rt_work *work, void *work_data),
- void *work_data)
-{
- rt_list_init(&(work->list));
- work->work_func = work_func;
- work->work_data = work_data;
- work->workqueue = RT_NULL;
- work->flags = 0;
- work->type = 0;
-}
+
#endif /* RT_USING_HEAP */