Refactor bluetooth hardware PowerUp/PowerDown functions
component/bt: fix use of a deprecated MACRO "CONFIG_ESP32_WIFI_SW_COEXIST_ENABLE"
component/bt: fix sleep wakeup in controller disable procedure
remove use of s_pm_lock_sem
1. Modified the waking up approach from async to sync: post a message to controller task upon vhci downstream packets or controller disable, and in response, controller task goes through the wake-up procedure
2. Added Controller status check for the esp_vhci APIs
3. Adjust the procedure during controller_init, check the validity of arguments first
Some minor modifications for bluetooth sleep control and configuration
1. use variable flag s_btdm_allow_light_sleep to control the use of s_light_sleep_pm_lock
2. use variable btdm_lpclk_sel to choose bluetooth sleep clock, support only for external 32kHz crystal temporarily
component/bt: improve async_wakeup function
1. check power state first and then decide if wakeup needs to be performed
2. change the meaning of the return value, if wakeup request is posted to controller task, then return true, otherwise return false
put sleep control logics in controller init/deinit/enable/disable together
Use s_lp_cntl struct: replace bool-typed variable sleep_backup_en with s_lp_cntl.mac_bb_pd
Use s_lp_cntl struct: replace bool-typed variable s_btdm_allow_light_sleep with s_lp_cntl.no_light_sleep
Use s_lp_cntl struct: replace global variable btdm_lpclk_sel with s_lp_cntl.lpclk_sel
create semaphore s_wakeup_req_sem only when low power mode is required
Use s_lp_cntl struct: use s_lp_cntl.wakeup_timer_required to control the wakeup timer
use s_lp_stat to replace original state variable sleep_backup_done and s_pm_lock_acquired
one minor change for mac_bb_pd settings init: return error status if memeory allocation failed
1.Fix supervision timeout in LLC DISC busy statue can not disconnect issue.
2.Solve the problem that the ble terminate ack packet may lose with a high probability in coex mode.
Rewrite ble dynamic prio to fix ble disconn in conn_param_update/channel_map_update
Rewrite ble dynamic prio in connection establishment
Fix ble dynamic prio with latency
Fix status bit set error when conn fail
- Simplify PHY access API
- Move coexist initializing and deinitializing out from PHY API
to Wi-Fi and Bluetooth
- Remove coexist pause and resume for they are no longer needed.
Prevent a remote device from doing a Bluetooth Impersonation Attack
(BIAS) by:
- Preventing remote device to downgrade secure connection
feature mask. Secure connection feature mask should remain same or
increase to enabled in link key generation and authentication.
- Doing a mutual authentication during Legacy Authentication.
Signed-off-by: Chinmay Chhajed <chinmay.chhajed@espressif.com>
After this commit, global interrupts will be disabled before taking
current time for scheduling further bluetooth events. Earlier disabling
interrupts was taking some time because of which WiFi events were
interrupting in current bluetooth scheduling.
Signed-off-by: Chinmay Chhajed <chinmay.chhajed@espressif.com>
1. Improve WiFi throughput in some Classic BT scienarios(idle, inquire scan,
connected, sniff, a2dp pause, etc).
2. Support WiFi + Classic BT + BLE mesh coexistence scienario.
3. Improve WiFi scan and connect succeed ratio in coexistence scienario.
4. Do not support to choose software coexistence preference anymore for it is
determined according to coexistence scienario automatically.
components/lwip: increase TCP send buffer and receive window limitation when TCP window scale is enabled
components/ble_mesh: Fix some bugs about ble mesh
1. fix send acl pkt after ble have sent terminate ind modify min adv interval to 10ms.
1. Since BLE full-scan feature for BLE mesh change the controller code cause this problem,
it cause coex semaphore take in "interrupt disable", then it may cause task schedule
and cause crash in freertos
2. Fix newlib lock ISR context and critical section check
3. Fix bt controller ISR context and critical section check
1. Fix high beacon and broadcast packets loss ratio of WiFi to make
MDNS test pass.
2. Improve stability of WiFi performance with a little
sacrifice of throughput.
3. Improve BLE advertising and connection performance with dynamic
priority. It sacrifices a little WiFi throughput, but achieves balance
between WiFi and Bluetooth.
This problem may cause HCI send command timeout.
When host call VHCI api to do btdm_wakeup_request, then controller
wakeup process will be handled in ISR and controller task context.
As host task priority is lower than controller task and ISR,
it will cause an incorrect behavior that before VHCI take the
rx_flow_on_semaphore, controller sleep again, then VHCI cannot take
the semaphore and has to wait the automatic wakeup.