diff options
| author | hathach <[email protected]> | 2018-12-10 05:40:02 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2018-12-10 05:44:08 +0700 |
| commit | a31f83dbb0d123d15dcc393dd9d926a4cc7352b6 (patch) | |
| tree | 6319734b0e9096b41be6776bc1a240ab645d1431 /src/host | |
| parent | 75baedf27d09e57deb9d88cc7c82d95b0d530bca (diff) | |
removing pipe handle
Diffstat (limited to 'src/host')
| -rw-r--r-- | src/host/ehci/ehci.c | 4 | ||||
| -rw-r--r-- | src/host/hub.c | 8 | ||||
| -rw-r--r-- | src/host/hub.h | 2 | ||||
| -rw-r--r-- | src/host/usbh.c | 7 | ||||
| -rw-r--r-- | src/host/usbh.h | 2 | ||||
| -rw-r--r-- | src/host/usbh_hcd.h | 2 |
6 files changed, 12 insertions, 13 deletions
diff --git a/src/host/ehci/ehci.c b/src/host/ehci/ehci.c index 2186bfcdf..445210c8b 100644 --- a/src/host/ehci/ehci.c +++ b/src/host/ehci/ehci.c @@ -647,7 +647,7 @@ static void qhd_xfer_complete_isr(ehci_qhd_t * p_qhd) {
// end of request
// call USBH callback
- usbh_xfer_isr( qhd_create_pipe_handle(p_qhd), XFER_RESULT_SUCCESS, p_qhd->total_xferred_bytes);
+ usbh_xfer_isr(p_qhd->device_address, edpt_addr(p_qhd->endpoint_number, p_qhd->pid_non_control == EHCI_PID_IN ? 1 : 0), XFER_RESULT_SUCCESS, p_qhd->total_xferred_bytes);
p_qhd->total_xferred_bytes = 0;
}
@@ -741,7 +741,7 @@ static void qhd_xfer_error_isr(ehci_qhd_t * p_qhd) }
// call USBH callback
- usbh_xfer_isr( qhd_create_pipe_handle(p_qhd), error_event, p_qhd->total_xferred_bytes);
+ usbh_xfer_isr(p_qhd->device_address, edpt_addr(p_qhd->endpoint_number, p_qhd->pid_non_control == EHCI_PID_IN ? 1 : 0), error_event, p_qhd->total_xferred_bytes);
p_qhd->total_xferred_bytes = 0;
}
diff --git a/src/host/hub.c b/src/host/hub.c index 0b909bef0..5612f6cda 100644 --- a/src/host/hub.c +++ b/src/host/hub.c @@ -211,11 +211,11 @@ bool hub_open_subtask(uint8_t rhport, uint8_t dev_addr, tusb_desc_interface_t co // is the response of interrupt endpoint polling
#include "usbh_hcd.h" // FIXME remove
-void hub_isr(pipe_handle_t pipe_hdl, xfer_result_t event, uint32_t xferred_bytes)
+void hub_isr(uint8_t dev_addr, xfer_result_t event, uint32_t xferred_bytes)
{
(void) xferred_bytes; // TODO can be more than 1 for hub with lots of ports
- usbh_hub_t * p_hub = &hub_data[pipe_hdl.dev_addr-1];
+ usbh_hub_t * p_hub = &hub_data[dev_addr-1];
if ( event == XFER_RESULT_SUCCESS )
{
@@ -226,11 +226,11 @@ void hub_isr(pipe_handle_t pipe_hdl, xfer_result_t event, uint32_t xferred_bytes {
hcd_event_t event =
{
- .rhport = _usbh_devices[pipe_hdl.dev_addr].rhport,
+ .rhport = _usbh_devices[dev_addr].rhport,
.event_id = HCD_EVENT_DEVICE_ATTACH
};
- event.attach.hub_addr = pipe_hdl.dev_addr;
+ event.attach.hub_addr = dev_addr;
event.attach.hub_port = port;
hcd_event_handler(&event, true);
diff --git a/src/host/hub.h b/src/host/hub.h index 8d1fece4b..8e8416d8f 100644 --- a/src/host/hub.h +++ b/src/host/hub.h @@ -196,7 +196,7 @@ tusb_error_t hub_status_pipe_queue(uint8_t dev_addr); void hub_init(void);
bool hub_open_subtask(uint8_t rhport, uint8_t dev_addr, tusb_desc_interface_t const *p_interface_desc, uint16_t *p_length) ATTR_WARN_UNUSED_RESULT;
-void hub_isr(pipe_handle_t pipe_hdl, xfer_result_t event, uint32_t xferred_bytes);
+void hub_isr(uint8_t dev_addr, xfer_result_t event, uint32_t xferred_bytes);
void hub_close(uint8_t dev_addr);
#endif
diff --git a/src/host/usbh.c b/src/host/usbh.c index 0df7c1dc8..a9e825f70 100644 --- a/src/host/usbh.c +++ b/src/host/usbh.c @@ -256,10 +256,9 @@ static inline tusb_error_t usbh_pipe_control_close(uint8_t dev_addr) // USBH-HCD ISR/Callback API
//--------------------------------------------------------------------+
// interrupt caused by a TD (with IOC=1) in pipe of class class_code
-void usbh_xfer_isr(pipe_handle_t pipe_hdl, xfer_result_t event, uint32_t xferred_bytes)
+void usbh_xfer_isr(uint8_t dev_addr, uint8_t ep_addr, xfer_result_t event, uint32_t xferred_bytes)
{
- usbh_device_t* dev = &_usbh_devices[ pipe_hdl.dev_addr ];
- uint8_t ep_addr = pipe_hdl.ep_addr;
+ usbh_device_t* dev = &_usbh_devices[ dev_addr ];
if (0 == edpt_number(ep_addr))
{
@@ -274,7 +273,7 @@ void usbh_xfer_isr(pipe_handle_t pipe_hdl, xfer_result_t event, uint32_t xferred if (usbh_class_drivers[drv_id].isr)
{
- usbh_class_drivers[drv_id].isr(pipe_hdl, event, xferred_bytes);
+ usbh_class_drivers[drv_id].isr(dev_addr , event, xferred_bytes);
}
else
{
diff --git a/src/host/usbh.h b/src/host/usbh.h index b04328e40..de43c8a4f 100644 --- a/src/host/usbh.h +++ b/src/host/usbh.h @@ -68,7 +68,7 @@ typedef struct { void (* const init) (void); bool (* const open_subtask)(uint8_t rhport, uint8_t dev_addr, tusb_desc_interface_t const *, uint16_t* outlen); - void (* const isr) (pipe_handle_t, xfer_result_t, uint32_t); + void (* const isr) (uint8_t dev_addr, xfer_result_t, uint32_t); void (* const close) (uint8_t); } host_class_driver_t; //--------------------------------------------------------------------+ diff --git a/src/host/usbh_hcd.h b/src/host/usbh_hcd.h index ce4469233..3c1c1511d 100644 --- a/src/host/usbh_hcd.h +++ b/src/host/usbh_hcd.h @@ -96,7 +96,7 @@ extern usbh_device_t _usbh_devices[CFG_TUSB_HOST_DEVICE_MAX+1]; // including zer //--------------------------------------------------------------------+ // callback from HCD ISR //--------------------------------------------------------------------+ -void usbh_xfer_isr(pipe_handle_t pipe_hdl, xfer_result_t event, uint32_t xferred_bytes); +void usbh_xfer_isr(uint8_t dev_addr, uint8_t ep_addr, xfer_result_t event, uint32_t xferred_bytes); #ifdef __cplusplus |
