case bluetooth::hci::EventCode::MAX_SLOTS_CHANGE:
case bluetooth::hci::EventCode::VENDOR_SPECIFIC:
return bluetooth::shim::is_gd_hci_enabled();
- case bluetooth::hci::EventCode::LE_META_EVENT:
case bluetooth::hci::EventCode::DISCONNECTION_COMPLETE:
case bluetooth::hci::EventCode::READ_REMOTE_VERSION_INFORMATION_COMPLETE:
- return bluetooth::shim::is_gd_acl_enabled();
+ case bluetooth::hci::EventCode::LE_META_EVENT:
+ return bluetooth::shim::is_gd_acl_enabled() ||
+ bluetooth::shim::is_gd_l2cap_enabled();
default:
return false;
}
bluetooth::hci::EventCode event_code) {
switch (event_code) {
case bluetooth::hci::EventCode::NUMBER_OF_COMPLETED_PACKETS:
- return bluetooth::shim::is_gd_acl_enabled();
+ return bluetooth::shim::is_gd_acl_enabled() ||
+ bluetooth::shim::is_gd_l2cap_enabled();
default:
return false;
}
bluetooth::hci::EventCode event_code) {
for (auto event : bluetooth::hci::AclConnectionEvents) {
if (event == event_code) {
- return bluetooth::shim::is_gd_acl_enabled();
+ return bluetooth::shim::is_gd_acl_enabled() ||
+ bluetooth::shim::is_gd_l2cap_enabled();
}
}
return false;
case bluetooth::hci::SubeventCode::PHY_UPDATE_COMPLETE:
case bluetooth::hci::SubeventCode::REMOTE_CONNECTION_PARAMETER_REQUEST:
return bluetooth::shim::is_gd_acl_enabled() ||
- bluetooth::shim::is_gd_advertising_enabled();
+ bluetooth::shim::is_gd_l2cap_enabled();
case bluetooth::hci::SubeventCode::ADVERTISING_SET_TERMINATED:
case bluetooth::hci::SubeventCode::SCAN_REQUEST_RECEIVED:
- return bluetooth::shim::is_gd_advertising_enabled();
- case bluetooth::hci::SubeventCode::SCAN_TIMEOUT:
+ return bluetooth::shim::is_gd_acl_enabled() ||
+ bluetooth::shim::is_gd_l2cap_enabled();
case bluetooth::hci::SubeventCode::ADVERTISING_REPORT:
case bluetooth::hci::SubeventCode::DIRECTED_ADVERTISING_REPORT:
case bluetooth::hci::SubeventCode::EXTENDED_ADVERTISING_REPORT:
case bluetooth::hci::SubeventCode::READ_REMOTE_FEATURES_COMPLETE:
case bluetooth::hci::SubeventCode::READ_LOCAL_P256_PUBLIC_KEY_COMPLETE:
case bluetooth::hci::SubeventCode::GENERATE_DHKEY_COMPLETE:
+ case bluetooth::hci::SubeventCode::SCAN_TIMEOUT:
case bluetooth::hci::SubeventCode::CHANNEL_SELECTION_ALGORITHM:
case bluetooth::hci::SubeventCode::CONNECTIONLESS_IQ_REPORT:
case bluetooth::hci::SubeventCode::CONNECTION_IQ_REPORT:
// if gd advertising enabled, hci_queue_end will be register in
// AclManager::impl::Start
- if (!bluetooth::shim::is_gd_advertising_enabled()) {
+ if (!bluetooth::shim::is_gd_advertising_enabled() &&
+ !bluetooth::shim::is_gd_l2cap_enabled()) {
hci_queue_end->RegisterDequeue(bluetooth::shim::GetGdShimHandler(),
bluetooth::common::Bind(acl_data_callback));
}
pending_data = nullptr;
}
if (hci_queue_end != nullptr) {
- if (!bluetooth::shim::is_gd_advertising_enabled()) {
+ if (!bluetooth::shim::is_gd_advertising_enabled() &&
+ !bluetooth::shim::is_gd_l2cap_enabled()) {
hci_queue_end->UnregisterDequeue();
}
for (uint8_t event_code_raw = 0; event_code_raw < 0xFF; event_code_raw++) {
p_dev_rec->security_required, p_dev_rec, p_callback);
if (transport == BT_TRANSPORT_LE) {
- if (BTM_IsAclConnectionUp(bd_addr, transport)) {
+ if (BTM_IsAclConnectionUp(bd_addr, BT_TRANSPORT_LE)) {
rc = btm_ble_set_encryption(bd_addr, sec_act,
acl_link_role(bd_addr, transport));
} else {
/** Add a device from the background connection list. Returns true if device
* added to the list, or already in list, false otherwise */
bool background_connect_add(uint8_t app_id, const RawAddress& address) {
- if (bluetooth::shim::is_gd_shim_enabled()) {
+ if (bluetooth::shim::is_gd_l2cap_enabled()) {
return L2CA_ConnectFixedChnl(L2CAP_ATT_CID, address);
}
/** Add a device to the direcgt connection list. Returns true if device
* added to the list, false otherwise */
bool direct_connect_add(uint8_t app_id, const RawAddress& address) {
- if (bluetooth::shim::is_gd_shim_enabled()) {
+ if (bluetooth::shim::is_gd_l2cap_enabled()) {
return L2CA_ConnectFixedChnl(L2CAP_ATT_CID, address);
}
using base::StringPrintf;
-tL2CAP_LE_RESULT_CODE btm_ble_start_sec_check(const RawAddress& bd_addr,
- uint16_t psm, bool is_originator,
- tBTM_SEC_CALLBACK* p_callback,
- void* p_ref_data);
-
static void l2cble_start_conn_update(tL2C_LCB* p_lcb);
/*******************************************************************************
*
******************************************************************************/
void l2c_link_processs_ble_num_bufs(uint16_t num_lm_ble_bufs) {
+ if (bluetooth::shim::is_gd_l2cap_enabled()) {
+ return;
+ }
+
if (num_lm_ble_bufs == 0) {
num_lm_ble_bufs = L2C_DEF_NUM_BLE_BUF_SHARED;
l2cb.num_lm_acl_bufs -= L2C_DEF_NUM_BLE_BUF_SHARED;
******************************************************************************/
bool l2c_link_hci_disc_comp(uint16_t handle, uint8_t reason) {
if (bluetooth::shim::is_gd_l2cap_enabled()) {
- btm_acl_removed(handle);
return false;
}
}
void l2c_link_init() {
+ if (bluetooth::shim::is_gd_l2cap_enabled()) {
+ // GD L2cap gets this info through GD ACL
+ return;
+ }
+
const controller_t* controller = controller_get_interface();
l2cb.num_lm_acl_bufs = controller->get_acl_buffer_count_classic();
}
tBTM_STATUS l2cu_ConnectAclForSecurity(const RawAddress& bd_addr) {
+ if (bluetooth::shim::is_gd_l2cap_enabled()) {
+ bluetooth::shim::L2CA_ConnectForSecurity(bd_addr);
+ return BTM_SUCCESS;
+ }
+
tL2C_LCB* p_lcb = l2cu_find_lcb_by_bd_addr(bd_addr, BT_TRANSPORT_BR_EDR);
if (p_lcb && (p_lcb->link_state == LST_CONNECTED ||
p_lcb->link_state == LST_CONNECTING)) {
*
******************************************************************************/
void l2cu_update_lcb_4_bonding(const RawAddress& p_bd_addr, bool is_bonding) {
+ if (bluetooth::shim::is_gd_l2cap_enabled()) {
+ bluetooth::shim::L2CA_SetBondingState(p_bd_addr, is_bonding);
+ return;
+ }
+
tL2C_LCB* p_lcb = l2cu_find_lcb_by_bd_addr(p_bd_addr, BT_TRANSPORT_BR_EDR);
if (p_lcb) {
*
******************************************************************************/
void l2cu_device_reset(void) {
+ if (bluetooth::shim::is_gd_l2cap_enabled()) {
+ return;
+ }
+
int xx;
tL2C_LCB* p_lcb = &l2cb.lcb_pool[0];
*
******************************************************************************/
void l2cu_set_non_flushable_pbf(bool is_supported) {
+ if (bluetooth::shim::is_gd_l2cap_enabled()) {
+ return;
+ }
+
if (is_supported)
l2cb.non_flushable_pbf =
(L2CAP_PKT_START_NON_FLUSHABLE << L2CAP_PKT_TYPE_SHIFT);
namespace bluetooth {
namespace shim {
-bool is_gd_shim_enabled() { return false; }
+bool is_gd_l2cap_enabled() { return false; }
} // namespace shim
} // namespace bluetooth