usbh name change
This commit is contained in:
@@ -443,7 +443,7 @@ pipe_handle_t hcd_pipe_open(uint8_t rhport, uint8_t dev_addr, tusb_desc_endpoint
|
||||
return (pipe_handle_t) { .index = qhd_get_index(p_qhd) };
|
||||
}
|
||||
|
||||
tusb_error_t hcd_pipe_queue_xfer(uint8_t dev_addr, pipe_handle_t pipe_hdl, uint8_t buffer[], uint16_t total_bytes)
|
||||
bool hcd_pipe_queue_xfer(uint8_t dev_addr, pipe_handle_t pipe_hdl, uint8_t buffer[], uint16_t total_bytes)
|
||||
{
|
||||
//------------- TODO pipe handle validate -------------//
|
||||
|
||||
@@ -451,7 +451,7 @@ tusb_error_t hcd_pipe_queue_xfer(uint8_t dev_addr, pipe_handle_t pipe_hdl, uint
|
||||
ehci_qhd_t *p_qhd = qhd_get_from_pipe_handle(dev_addr, pipe_hdl);
|
||||
ehci_qtd_t *p_qtd = qtd_find_free(dev_addr);
|
||||
|
||||
TU_ASSERT(p_qtd, TUSB_ERROR_EHCI_NOT_ENOUGH_QTD);
|
||||
TU_ASSERT(p_qtd);
|
||||
|
||||
qtd_init(p_qtd, (uint32_t) buffer, total_bytes);
|
||||
p_qtd->pid = p_qhd->pid_non_control;
|
||||
@@ -459,12 +459,12 @@ tusb_error_t hcd_pipe_queue_xfer(uint8_t dev_addr, pipe_handle_t pipe_hdl, uint
|
||||
//------------- insert TD to TD list -------------//
|
||||
qtd_insert_to_qhd(p_qhd, p_qtd);
|
||||
|
||||
return TUSB_ERROR_NONE;
|
||||
return true;
|
||||
}
|
||||
|
||||
tusb_error_t hcd_pipe_xfer(uint8_t dev_addr, pipe_handle_t pipe_hdl, uint8_t buffer[], uint16_t total_bytes, bool int_on_complete)
|
||||
bool hcd_pipe_xfer(uint8_t dev_addr, pipe_handle_t pipe_hdl, uint8_t buffer[], uint16_t total_bytes, bool int_on_complete)
|
||||
{
|
||||
TU_ASSERT_ERR ( hcd_pipe_queue_xfer(dev_addr, pipe_hdl, buffer, total_bytes) );
|
||||
TU_ASSERT ( hcd_pipe_queue_xfer(dev_addr, pipe_hdl, buffer, total_bytes) );
|
||||
|
||||
ehci_qhd_t *p_qhd = qhd_get_from_pipe_handle(dev_addr, pipe_hdl);
|
||||
|
||||
@@ -474,7 +474,7 @@ tusb_error_t hcd_pipe_xfer(uint8_t dev_addr, pipe_handle_t pipe_hdl, uint8_t bu
|
||||
}
|
||||
p_qhd->qtd_overlay.next.address = (uint32_t) p_qhd->p_qtd_list_head; // attach head QTD to QHD start transferring
|
||||
|
||||
return TUSB_ERROR_NONE;
|
||||
return true;
|
||||
}
|
||||
|
||||
/// pipe_close should only be called as a part of unmount/safe-remove process
|
||||
|
||||
@@ -145,8 +145,8 @@ bool hcd_edpt_xfer(uint8_t rhport, uint8_t dev_addr, uint8_t ep_addr, uint8_t *
|
||||
// TODO control xfer should be used via usbh layer
|
||||
|
||||
pipe_handle_t hcd_pipe_open(uint8_t rhport, uint8_t dev_addr, tusb_desc_endpoint_t const * ep_desc);
|
||||
tusb_error_t hcd_pipe_queue_xfer(uint8_t dev_addr, pipe_handle_t pipe_hdl, uint8_t buffer[], uint16_t total_bytes) ATTR_WARN_UNUSED_RESULT; // only queue, not transferring yet
|
||||
tusb_error_t hcd_pipe_xfer(uint8_t dev_addr, pipe_handle_t pipe_hdl, uint8_t buffer[], uint16_t total_bytes, bool int_on_complete) ATTR_WARN_UNUSED_RESULT;
|
||||
bool hcd_pipe_queue_xfer(uint8_t dev_addr, pipe_handle_t pipe_hdl, uint8_t buffer[], uint16_t total_bytes) ATTR_WARN_UNUSED_RESULT; // only queue, not transferring yet
|
||||
bool hcd_pipe_xfer(uint8_t dev_addr, pipe_handle_t pipe_hdl, uint8_t buffer[], uint16_t total_bytes, bool int_on_complete) ATTR_WARN_UNUSED_RESULT;
|
||||
bool hcd_pipe_close(uint8_t rhport, uint8_t dev_addr, pipe_handle_t pipe_hdl);
|
||||
|
||||
bool hcd_pipe_is_busy(uint8_t dev_addr, pipe_handle_t pipe_hdl);
|
||||
|
||||
@@ -155,7 +155,7 @@ void hub_init(void)
|
||||
// hub_enum_sem_hdl = osal_semaphore_create( OSAL_SEM_REF(hub_enum_semaphore) );
|
||||
}
|
||||
|
||||
bool hub_open_subtask(uint8_t rhport, uint8_t dev_addr, tusb_desc_interface_t const *p_interface_desc, uint16_t *p_length)
|
||||
bool hub_open(uint8_t rhport, uint8_t dev_addr, tusb_desc_interface_t const *p_interface_desc, uint16_t *p_length)
|
||||
{
|
||||
// not support multiple TT yet
|
||||
if ( p_interface_desc->bInterfaceProtocol > 1 ) return false;
|
||||
@@ -204,7 +204,7 @@ bool hub_open_subtask(uint8_t rhport, uint8_t dev_addr, tusb_desc_interface_t co
|
||||
}
|
||||
|
||||
//------------- Queue the initial Status endpoint transfer -------------//
|
||||
TU_ASSERT( TUSB_ERROR_NONE == hcd_pipe_xfer(dev_addr, hub_data[dev_addr-1].pipe_status, &hub_data[dev_addr-1].status_change, 1, true) );
|
||||
TU_ASSERT( hcd_pipe_xfer(dev_addr, hub_data[dev_addr-1].pipe_status, &hub_data[dev_addr-1].status_change, 1, true) );
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -254,7 +254,7 @@ void hub_close(uint8_t dev_addr)
|
||||
// osal_semaphore_reset(hub_enum_sem_hdl);
|
||||
}
|
||||
|
||||
tusb_error_t hub_status_pipe_queue(uint8_t dev_addr)
|
||||
bool hub_status_pipe_queue(uint8_t dev_addr)
|
||||
{
|
||||
return hcd_pipe_xfer(dev_addr, hub_data[dev_addr-1].pipe_status, &hub_data[dev_addr-1].status_change, 1, true);
|
||||
}
|
||||
|
||||
@@ -187,7 +187,7 @@ TU_VERIFY_STATIC( sizeof(hub_port_status_response_t) == 4, "size is not correct"
|
||||
bool hub_port_reset_subtask(uint8_t hub_addr, uint8_t hub_port);
|
||||
bool hub_port_clear_feature_subtask(uint8_t hub_addr, uint8_t hub_port, uint8_t feature);
|
||||
tusb_speed_t hub_port_get_speed(void);
|
||||
tusb_error_t hub_status_pipe_queue(uint8_t dev_addr);
|
||||
bool hub_status_pipe_queue(uint8_t dev_addr);
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// USBH-CLASS DRIVER API
|
||||
@@ -195,7 +195,7 @@ tusb_error_t hub_status_pipe_queue(uint8_t dev_addr);
|
||||
#ifdef _TINY_USB_SOURCE_FILE_
|
||||
|
||||
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;
|
||||
bool hub_open(uint8_t rhport, uint8_t dev_addr, tusb_desc_interface_t const *itf_desc, uint16_t *p_length) ATTR_WARN_UNUSED_RESULT;
|
||||
void hub_isr(uint8_t dev_addr, xfer_result_t event, uint32_t xferred_bytes);
|
||||
void hub_close(uint8_t dev_addr);
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ static host_class_driver_t const usbh_class_drivers[] =
|
||||
{
|
||||
.class_code = TUSB_CLASS_CDC,
|
||||
.init = cdch_init,
|
||||
.open_subtask = cdch_open,
|
||||
.open = cdch_open,
|
||||
.isr = cdch_isr,
|
||||
.close = cdch_close
|
||||
},
|
||||
@@ -81,7 +81,7 @@ static host_class_driver_t const usbh_class_drivers[] =
|
||||
{
|
||||
.class_code = TUSB_CLASS_MSC,
|
||||
.init = msch_init,
|
||||
.open_subtask = msch_open,
|
||||
.open = msch_open,
|
||||
.isr = msch_isr,
|
||||
.close = msch_close
|
||||
},
|
||||
@@ -91,7 +91,7 @@ static host_class_driver_t const usbh_class_drivers[] =
|
||||
{
|
||||
.class_code = TUSB_CLASS_HID,
|
||||
.init = hidh_init,
|
||||
.open_subtask = hidh_open_subtask,
|
||||
.open = hidh_open_subtask,
|
||||
.isr = hidh_isr,
|
||||
.close = hidh_close
|
||||
},
|
||||
@@ -101,7 +101,7 @@ static host_class_driver_t const usbh_class_drivers[] =
|
||||
{
|
||||
.class_code = TUSB_CLASS_HUB,
|
||||
.init = hub_init,
|
||||
.open_subtask = hub_open_subtask,
|
||||
.open = hub_open,
|
||||
.isr = hub_isr,
|
||||
.close = hub_close
|
||||
},
|
||||
@@ -111,7 +111,7 @@ static host_class_driver_t const usbh_class_drivers[] =
|
||||
{
|
||||
.class_code = TUSB_CLASS_VENDOR_SPECIFIC,
|
||||
.init = cush_init,
|
||||
.open_subtask = cush_open_subtask,
|
||||
.open = cush_open_subtask,
|
||||
.isr = cush_isr,
|
||||
.close = cush_close
|
||||
}
|
||||
@@ -611,7 +611,7 @@ bool enum_task(hcd_event_t* event)
|
||||
{
|
||||
uint16_t itf_len = 0;
|
||||
|
||||
if ( usbh_class_drivers[drv_id].open_subtask(new_dev->rhport, new_addr, desc_itf, &itf_len) )
|
||||
if ( usbh_class_drivers[drv_id].open(new_dev->rhport, new_addr, desc_itf, &itf_len) )
|
||||
{
|
||||
mark_interface_endpoint(new_dev->ep2drv, p_desc, itf_len, drv_id);
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ typedef struct {
|
||||
uint8_t class_code;
|
||||
|
||||
void (* const init) (void);
|
||||
bool (* const open_subtask)(uint8_t rhport, uint8_t dev_addr, tusb_desc_interface_t const * itf_desc, uint16_t* outlen);
|
||||
bool (* const open)(uint8_t rhport, uint8_t dev_addr, tusb_desc_interface_t const * itf_desc, uint16_t* outlen);
|
||||
void (* const isr) (uint8_t dev_addr, uint8_t ep_addr, xfer_result_t result, uint32_t len);
|
||||
void (* const close) (uint8_t);
|
||||
} host_class_driver_t;
|
||||
|
||||
Reference in New Issue
Block a user