Commit Graph

32388 Commits

Author SHA1 Message Date
Darian Leung
29ae4e7a4f
refactor(usb/usbh): Update USBH device creation and enumeration handling
This commit updates how the USBH handles device creation and enumeration so that
upper layers (such as the Hub driver) can use the USBH API for enumeration instead
of calling the HCD.

USBH Updates:

USBH now creates unenumerated devices set to address 0 with no device/config
descriptor. A newly created device can be opened and communicated with immediately
(using control transfers). This allows the Hub driver to call the USBH instead of
the HCD. Summary of USBH changes:

- Added new APIs to add/remove a device. Devices are now created as unenumerated
and can be immediately opened and communicated with.
- Added new APIs to enumerate a device (see 'usbh_dev_set_...()' functions). Device
must be locked (see 'usbh_dev_enum_lock()') before enumeration functions can be called.
- Added UID for each device. This allows the particular USBH without needing to
use the device's handle (which implies opening the device).

Hub Driver Updates:

Hub driver now calls the USBH for enumeration. Summary of USBH changes:

- Replace all 'hcd_pipe_...()' calls with 'usbh_dev_...()' calls
- Refactored port event handling to fit with new USBH API
- Updated to use UID to uniquely identify devices without opening them

USB Host Updates:

- Reroute USBH control transfers to clients and hub driver

Note: Backported ESP_ERR_NOT_ALLOWED macro
2024-06-02 00:29:36 +08:00
Darian Leung
15121a3ef6
refactor(usb/hub): Update Hub driver port request logic 2024-06-02 00:29:35 +08:00
Darian Leung
144463be5c
refactor(usb/hcd): Allow port resets with allocated pipes
This commit updates the HCD API to allow port resets to occur even if pipes
are allocated. The pipes cannot be active and the port reset will simply
restore the pipes (by reinitializing their channel registers) following the
reset.

Changes:

- Allow port resets while channels are allocated
- Remove pipe persistance API 'hcd_pipe_set_persist_reset()'
2024-06-02 00:29:35 +08:00
Darian Leung
8053174dd4
refactor(usb/usbh): Rename device pool functions and ref_count
This commit renames the following APIs and variables in the USBH:

- Rename the prefix of device pool functions from 'usbh_dev_...' to
  'usbh_devs_...'.
- Rename 'ref_count' to 'open_count'. This variable tracks the number of times
  a device has been opened.
2024-06-02 00:29:34 +08:00
Darian Leung
5f0a659e73
refactor(usb/host): Refactor USBH function grouping
This commit rearranges the USBH functions into new groupings to provide a
clearer abstraction. This is in preparation for refactoring/removing the Hub
related functions in the USBH API. This commit DOES NOT MAKE ANY BEHAVIORAL
CHANGES to the code.

Functions are now grouped into...

- USBH Processing: Functions dealing with overall USBH processing
- Device Pool: Functions that add/remove/open/close devices from the internal
               device pool
- Device: Functions that pertain to setting/getting a particular device
- Endpoints: Functions that pertain to a particular endpoint
- Transfer: Functions that pertain to sending transfers
2024-06-02 00:29:34 +08:00
Roman Leonov
8479302503
refactor(hcd_dwc): Added mps request from hcd_dwc 2024-06-02 00:29:34 +08:00
Darian Leung
0b77a7289c
refactor(usb/host): Simplify USBH and Hub interaction
Previously, on a device disconnection, the USBH and Hub would the require the
following 2-way interaction:

- Hub -> usbh_hub_pass_event() -> USBH to indicate a port error
- USBH -> usbh_hub_req_cb_t -> Hub to request port recovery after the device
has been freed.

The 2-way interaction has been simplified:

- USBH now nofities upper layers of devices being freed via the
USBH_EVENT_DEV_FREE event
- Hub now handles port recovery only after a device has been freed
2024-06-02 00:29:33 +08:00
Roman Leonov
cfa48efc6a
refactor(usb_host): Renamed hub_driver_state to root_port_state 2024-06-02 00:29:33 +08:00
Tomas Rezucha
4270a4edce
feat(usb/host): Add missing sync types from USB specification 2024-06-02 00:29:33 +08:00
Roman Leonov
54d984644a
feat(usb_host): Added KConfig parameter for External HUB support enable 2024-06-02 00:29:32 +08:00
Roman Leonov
01761f4c99
refactor(usb_host): Added chapter11 header, refactor chapter9 header 2024-06-02 00:29:32 +08:00
Darian Leung
78515b3fef
refactor(usb): Remove USBH control transfer callback
This commit merges the USBH control transfer callback into the USBH event
callback. This simplifies the code as the USBH now uses a single callback.
2024-06-02 00:29:32 +08:00
Darian Leung
42076af4c4
refactor(usb): Update USBH event callback arguments
This commit does the following:

- Updates the USBH event callback arguments to now pass a usbh_event_data_t
which can contain different data for each event
- Updated event names
2024-06-02 00:29:31 +08:00
Rahul Tank
3f9ab2d6a6 Merge branch 'bugfix/free_reattempt_adv_data_v5.1' into 'release/v5.1'
fix(nimble): Added change to free memory in case of failure (v5.1)

See merge request espressif/esp-idf!31166
2024-06-01 18:59:49 +08:00
morris
8318a2ad44 Merge branch 'feature/usb_new_phy_driver_collective_backport_v5.1' into 'release/v5.1'
refactor(usb/host): PHY driver preqrequisite refacotring collective backport (v5.1)

See merge request espressif/esp-idf!29791
2024-05-31 22:30:32 +08:00
Rahul Tank
3b5c0b7d73 fix(nimble): Added change to free memory in case of failure 2024-05-31 12:09:32 +05:30
Jiang Jiang Jian
08aef5cd64 Merge branch 'bugfix/wps_scan_log_flood_v5.1' into 'release/v5.1'
fix(wpa_supplicant): Suppress RSN IE print to Verbose level (Backport v5.1)

See merge request espressif/esp-idf!31157
2024-05-31 13:47:41 +08:00
Jiang Jiang Jian
6535d0745b Merge branch 'bugfix/ftm_fix_wrong_compensation_v5.1' into 'release/v5.1'
Fix issue in selecting FTM compensation with external AP (Backport v5.1)

See merge request espressif/esp-idf!30740
2024-05-31 13:37:05 +08:00
Island
a7a612c9fc Merge branch 'bugfix/bleqabr24-549_v5.1' into 'release/v5.1'
fix(ble_mesh): fix issues in mesh deinit_v5.1

See merge request espressif/esp-idf!30542
2024-05-31 11:13:53 +08:00
luoxu
cd5f3bf146 fix(ble_mesh): fix issues in mesh deinit 2024-05-30 20:40:55 +08:00
Jiang Jiang Jian
cfe861582c Merge branch 'bugfix/stop_tg_wdt_in_xpd_xtal_lightsleep_v5.1' into 'release/v5.1'
fix(esp_hw_support): stop tg wdt in xpd xtal lightsleep (v5.1)

See merge request espressif/esp-idf!31140
2024-05-30 20:00:24 +08:00
Nachiket Kukade
3e82811fec fix(esp_wifi): Fix issue in selecting FTM compensation with external AP 2024-05-30 19:42:24 +08:00
Rahul Tank
ebe0b3f40c Merge branch 'feature/ble_resolve_adv_data_v5.1' into 'release/v5.1'
feat(nimble): Added API to get resolve ADV data (v5.1)

See merge request espressif/esp-idf!30952
2024-05-29 13:51:39 +08:00
Nachiket Kukade
1614f9e3b5 fix(wpa_supplicant): Suppress RSN IE print to Verbose level 2024-05-29 11:09:57 +05:30
wuzhenghui
725381290e
fix(esp_hw_support/sleep): stop TG0/TG1 watchdog if XTAL not power down in lightsleep 2024-05-28 19:39:19 +08:00
wuzhenghui
bd1017132e
change(esp_hw_support/sleep): improve esp32c3 systimer stall bug workaround 2024-05-28 19:38:04 +08:00
Roland Dobai
59e2674bf6 Merge branch 'fix/pytest_session_dir_v5.1' into 'release/v5.1'
ci: apply new fix in pytest-embedded 1.10 (v5.1)

See merge request espressif/esp-idf!30678
2024-05-28 17:02:23 +08:00
Jiang Jiang Jian
f2b11841fc Merge branch 'bugfix/mldv6_report_memory_leak_v5.1' into 'release/v5.1'
fix(esp_netif): Fix mldv6 report memory leak in esp_netif(v5.1)

See merge request espressif/esp-idf!31062
2024-05-28 15:58:22 +08:00
Wang Meng Yang
7046477541 Merge branch 'bugfix/fix_hid_connection_failed_bug_v5.1' into 'release/v5.1'
fix(bt/bluedroid): Fix HID connection bugs[backport 5.1]

See merge request espressif/esp-idf!30590
2024-05-28 15:19:35 +08:00
David Čermák
89eb191f7f Merge branch 'bugfix/eth_l2_test_conn_wait_tmo_v5.1' into 'release/v5.1'
ci(esp_eth): increased L2 test wait for connection timeout (v5.1)

See merge request espressif/esp-idf!29882
2024-05-27 18:25:37 +08:00
David Čermák
0c9478fb65 Merge branch 'bugfix/dm9051_phy_axs_wait_v5.1' into 'release/v5.1'
fix(esp_eth): made access to PHY registers for DM9051 more robust (v5.1)

See merge request espressif/esp-idf!30280
2024-05-27 18:24:55 +08:00
David Čermák
489e460479 Merge branch 'contrib/github_pr_13560_v5.1' into 'release/v5.1'
esp_eth: DP83848: correct link detection to use BMSR (GitHub PR) (v5.1)

See merge request espressif/esp-idf!30452
2024-05-27 18:24:35 +08:00
morris
d7c75b92d1 Merge branch 'bugfix/check_c3_efuse_error_on_ram_app_condition_v5.1' into 'release/v5.1'
bugfix(cpu_start): check c3 efuse error log on ram app condition (v5.1)

See merge request espressif/esp-idf!31046
2024-05-27 15:43:21 +08:00
Island
2daa497ba0 Merge branch 'feat/add_api_to_set_privacy_mode_v5.1' into 'release/v5.1'
feat(bt/bluedroid): support BLE set privacy mode (v5.1)

See merge request espressif/esp-idf!31027
2024-05-27 14:56:15 +08:00
WanqQixiang
9bcbd2fb51 fix(esp_netif): Fix mldv6 report memory leak in esp_netif 2024-05-24 15:29:53 +08:00
Abhinav Kudnar
8df917bde9 feat(nimble): Added API to get resolve ADV data 2024-05-24 11:56:21 +05:30
Island
e603747a5a Merge branch 'bugfix/BLEQABR23-798_v5.1' into 'release/v5.1'
bugfix(ble_mesh): Close BLEQABR23-798 (v5.1)

See merge request espressif/esp-idf!30646
2024-05-24 14:10:18 +08:00
Island
262264e4e2 Merge branch 'fix/ble_mesh_gatts_bugfix_v5.1' into 'release/v5.1'
BLE Mesh Gatts bugfix (v5.1)

See merge request espressif/esp-idf!30874
2024-05-24 14:09:56 +08:00
Sergei Silnov
8354a8f3bf Merge branch 'fix/gdbgui_version_check_v5.1' into 'release/v5.1'
fix(tools): Use GDGBUI arguments based on its version (v5.1)

See merge request espressif/esp-idf!31039
2024-05-23 22:51:55 +08:00
Roland Dobai
ab18946708 fix(tools): Use GDGBUI arguments based on its version
Closes https://github.com/espressif/esp-idf/issues/13665
2024-05-23 14:45:41 +02:00
Rahul Tank
de42be85db Merge branch 'bugfix/restart_advertising_if_slave_23e_v5.1' into 'release/v5.1'
fix(nimble): start advertising if disconnect due to 0x3E in slave (v5.1)

See merge request espressif/esp-idf!31034
2024-05-23 20:26:21 +08:00
Armando
bb51330aa6 bugfix(cpu_start): check c3 efuse error log on ram app condition
Prior to this commit, esp_efuse_check_errors() is only called when it's
2nd stage btld app.

This commit moves this error check so under all conditions (including
ram app, pure ram app) will check this efuse error
2024-05-23 15:56:08 +08:00
Mahavir Jain
68c894bba6 Merge branch 'feature/update_cjson_version_to_1.7.18_v5.1' into 'release/v5.1'
feat(cjson): update submodule to v1.7.18 (v5.1)

See merge request espressif/esp-idf!31016
2024-05-23 15:10:14 +08:00
luoxu
f401e2960a fix(ble_mesh): Create service after service register success 2024-05-23 14:30:03 +08:00
Jiang Jiang Jian
836dba4fa7 Merge branch 'bugfix/loadprohibited_after_bt_deinit_v5.1' into 'release/v5.1'
Fixed some coexist issues

See merge request espressif/esp-idf!31005
2024-05-23 11:36:24 +08:00
chenjianhua
6678996170 feat(bt/bluedroid): support BLE set privacy mode 2024-05-22 19:25:50 +08:00
zhanghaipeng
b1bbc8e486 fix(ble/bluedroid): Optimized BLE SPP example for improved compatibility 2024-05-22 19:25:11 +08:00
zhanghaipeng
af59333eb5 feat(ble/bluedroid): Support BLE add device to resolving list 2024-05-22 19:23:24 +08:00
zhanghaipeng
c075708e0b feat(ble/bluedroid): Support set resolvable provate address timeout by api 2024-05-22 19:21:31 +08:00
zhanghaipeng
c488cc4b6a fix(ble/bluedroid): Fixed BLE GATT max length of an attribute value 2024-05-22 18:03:47 +08:00