Skip to content

Conversation

peter-marcisovsky
Copy link
Collaborator

Description

Adding remote wakeup feature for usb host lib

Related

Testing


Checklist

Before submitting a Pull Request, please ensure the following:

  • 🚨 This PR does not introduce breaking changes.
  • All CI checks (GH Actions) pass.
  • Documentation is updated as needed.
  • Tests are updated or added as necessary.
  • Code is well-commented, especially in complex areas.
  • Git history is clean — commits are squashed to the minimum necessary.

@peter-marcisovsky peter-marcisovsky self-assigned this Oct 16, 2025
@peter-marcisovsky peter-marcisovsky added Status: In Progress Issue is being worked on Component: usb_host Issue affects usb_host component labels Oct 16, 2025
@peter-marcisovsky peter-marcisovsky changed the title Feat/usb host remote wkp USB Host remote wakeup Oct 16, 2025
port->flags.conn_dev_ena = 0;
break;
}
case USB_DWC_HAL_PORT_EVENT_REMOTE_WAKEUP: {

Check failure

Code scanning / clang-tidy

duplicate case value: 'USB_DWC_HAL_PORT_EVENT_DISABLED' and 'HCD_PORT_EVENT_REMOTE_WAKEUP' both equal '5' [clang-diagnostic-error] Error

duplicate case value: 'USB_DWC_HAL_PORT_EVENT_DISABLED' and 'HCD_PORT_EVENT_REMOTE_WAKEUP' both equal '5' [clang-diagnostic-error]
port->flags.conn_dev_ena = 0;
break;
}
case USB_DWC_HAL_PORT_EVENT_REMOTE_WAKEUP: {

Check failure

Code scanning / clang-tidy

use of undeclared identifier 'USB_DWC_HAL_PORT_EVENT_REMOTE_WAKEUP'; did you mean 'HCD_PORT_EVENT_REMOTE_WAKEUP'? [clang-diagnostic-error] Error

use of undeclared identifier 'USB_DWC_HAL_PORT_EVENT_REMOTE_WAKEUP'; did you mean 'HCD_PORT_EVENT_REMOTE_WAKEUP'? [clang-diagnostic-error]
ret = ESP_ERR_INVALID_STATE;
goto exit;
}
hprt = usb_dwc_hal_port_get_hprt_val(port->hal);

Check failure

Code scanning / clang-tidy

use of undeclared identifier 'usb_dwc_hal_port_get_hprt_val' [clang-diagnostic-error] Error

use of undeclared identifier 'usb_dwc_hal_port_get_hprt_val' [clang-diagnostic-error]
goto exit;
}
hprt = usb_dwc_hal_port_get_hprt_val(port->hal);
gintsts = usb_dwc_hal_port_get_gintsts_val(port->hal);

Check failure

Code scanning / clang-tidy

use of undeclared identifier 'usb_dwc_hal_port_get_gintsts_val'; did you mean 'usb_dwc_hal_port_get_conn_speed'? [clang-diagnostic-error] Error

use of undeclared identifier 'usb_dwc_hal_port_get_gintsts_val'; did you mean 'usb_dwc_hal_port_get_conn_speed'? [clang-diagnostic-error]
}
hprt = usb_dwc_hal_port_get_hprt_val(port->hal);
gintsts = usb_dwc_hal_port_get_gintsts_val(port->hal);
state = usb_dwc_hal_hprt_get_pwr_line_status(port->hal);

Check failure

Code scanning / clang-tidy

use of undeclared identifier 'usb_dwc_hal_hprt_get_pwr_line_status'; did you mean 'usb_dwc_ll_hprt_get_pwr_line_status'? [clang-diagnostic-error] Error

use of undeclared identifier 'usb_dwc_hal_hprt_get_pwr_line_status'; did you mean 'usb_dwc_ll_hprt_get_pwr_line_status'? [clang-diagnostic-error]
vTaskDelay(pdMS_TO_TICKS(100));

// Res3 (Wkp3)
hprt = usb_dwc_hal_port_get_hprt_val(port->hal);

Check failure

Code scanning / clang-tidy

use of undeclared identifier 'usb_dwc_hal_port_get_hprt_val' [clang-diagnostic-error] Error

use of undeclared identifier 'usb_dwc_hal_port_get_hprt_val' [clang-diagnostic-error]

// Res3 (Wkp3)
hprt = usb_dwc_hal_port_get_hprt_val(port->hal);
gintsts = usb_dwc_hal_port_get_gintsts_val(port->hal);

Check failure

Code scanning / clang-tidy

use of undeclared identifier 'usb_dwc_hal_port_get_gintsts_val'; did you mean 'usb_dwc_hal_port_get_conn_speed'? [clang-diagnostic-error] Error

use of undeclared identifier 'usb_dwc_hal_port_get_gintsts_val'; did you mean 'usb_dwc_hal_port_get_conn_speed'? [clang-diagnostic-error]
// Res3 (Wkp3)
hprt = usb_dwc_hal_port_get_hprt_val(port->hal);
gintsts = usb_dwc_hal_port_get_gintsts_val(port->hal);
state = usb_dwc_hal_hprt_get_pwr_line_status(port->hal);

Check failure

Code scanning / clang-tidy

use of undeclared identifier 'usb_dwc_hal_hprt_get_pwr_line_status'; did you mean 'usb_dwc_ll_hprt_get_pwr_line_status'? [clang-diagnostic-error] Error

use of undeclared identifier 'usb_dwc_hal_hprt_get_pwr_line_status'; did you mean 'usb_dwc_ll_hprt_get_pwr_line_status'? [clang-diagnostic-error]
ctrl_transfer->context = (void *)transfer_done;

// Copy setup packet
memcpy(ctrl_transfer->data_buffer, setup_packet, sizeof(usb_setup_packet_t));

Check warning

Code scanning / clang-tidy

Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memcpy_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] Warning

Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memcpy_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]

// For IN transfers, copy data back to caller buffer
if (data_buf && (data_len > 0)) {
memcpy(data_buf, ctrl_transfer->data_buffer + sizeof(usb_setup_packet_t), data_len);

Check warning

Code scanning / clang-tidy

Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memcpy_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] Warning

Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memcpy_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component: usb_host Issue affects usb_host component Status: In Progress Issue is being worked on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant