Lines Matching defs:p_lcb
35 static void l2cble_start_conn_update (tL2C_LCB *p_lcb);
51 tL2C_LCB *p_lcb;
73 if ((p_lcb = l2cu_find_lcb_by_bd_addr (rem_bda, BT_TRANSPORT_LE)) != NULL)
75 p_lcb->disc_reason = L2CAP_CONN_CANCEL;
76 l2cu_release_lcb (p_lcb);
101 tL2C_LCB *p_lcb;
105 p_lcb = l2cu_find_lcb_by_bd_addr (rem_bda, BT_TRANSPORT_LE);
108 if (!p_lcb || !p_acl_cb)
116 if (p_lcb->transport != BT_TRANSPORT_LE)
124 p_lcb->min_interval = min_int;
125 p_lcb->max_interval = max_int;
126 p_lcb->latency = latency;
127 p_lcb->timeout = timeout;
128 p_lcb->conn_update_mask |= L2C_BLE_NEW_CONN_PARAM;
130 l2cble_start_conn_update(p_lcb);
149 tL2C_LCB *p_lcb;
152 p_lcb = l2cu_find_lcb_by_bd_addr (rem_bda, BT_TRANSPORT_LE);
154 if (!p_lcb)
164 (rem_bda[4]<<8)+rem_bda[5], enable, p_lcb->conn_update_mask);
166 if (p_lcb->transport != BT_TRANSPORT_LE)
170 (rem_bda[4]<<8)+rem_bda[5], p_lcb->link_role);
175 p_lcb->conn_update_mask &= ~L2C_BLE_CONN_UPDATE_DISABLE;
177 p_lcb->conn_update_mask |= L2C_BLE_CONN_UPDATE_DISABLE;
179 l2cble_start_conn_update(p_lcb);
198 tL2C_LCB *p_lcb;
200 if ((p_lcb = l2cu_find_lcb_by_bd_addr (bd_addr, BT_TRANSPORT_LE)) != NULL)
201 role = p_lcb->link_role;
216 tL2C_LCB *p_lcb;
219 if ((p_lcb = l2cu_find_lcb_by_bd_addr (remote_bda, transport)) != NULL)
220 reason = p_lcb->disc_reason;
238 tL2C_LCB *p_lcb = l2cu_find_lcb_by_bd_addr (bda, BT_TRANSPORT_LE);
241 if (p_lcb != NULL && p_acl != NULL && p_lcb->link_state != LST_CONNECTED)
246 p_lcb->link_state = LST_CONNECTED;
247 l2cu_process_fixed_chnl_resp (p_lcb);
264 tL2C_LCB *p_lcb;
273 p_lcb = l2cu_find_lcb_by_bd_addr (bda, BT_TRANSPORT_LE);
276 if (!p_lcb)
278 p_lcb = l2cu_allocate_lcb (bda, FALSE, BT_TRANSPORT_LE);
279 if (!p_lcb)
287 if (!l2cu_initialize_fixed_ccb (p_lcb, L2CAP_ATT_CID, &l2cb.fixed_reg[L2CAP_ATT_CID - L2CAP_FIRST_FIXED_CHNL].fixed_chnl_opts))
295 else if (p_lcb->link_state != LST_CONNECTING)
297 L2CAP_TRACE_ERROR ("L2CAP got BLE scanner conn_comp in bad state: %d", p_lcb->link_state);
300 btu_stop_timer(&p_lcb->timer_entry);
303 p_lcb->handle = handle;
306 p_lcb->link_role = HCI_ROLE_MASTER;
307 p_lcb->transport = BT_TRANSPORT_LE;
310 p_lcb->min_interval = p_lcb->max_interval = conn_interval;
311 p_lcb->timeout = conn_timeout;
312 p_lcb->latency = conn_latency;
313 p_lcb->conn_update_mask = L2C_BLE_NOT_DEFAULT_PARAM;
333 p_lcb->min_interval = p_dev_rec->conn_params.min_conn_int;
334 p_lcb->max_interval = p_dev_rec->conn_params.max_conn_int;
335 p_lcb->timeout = p_dev_rec->conn_params.supervision_tout;
336 p_lcb->latency = p_dev_rec->conn_params.slave_latency;
347 btm_acl_created (bda, NULL, p_dev_rec->sec_bd_name, handle, p_lcb->link_role, BT_TRANSPORT_LE);
349 p_lcb->peer_chnl_mask[0] = L2CAP_FIXED_CHNL_ATT_BIT | L2CAP_FIXED_CHNL_BLE_SIG_BIT | L2CAP_FIXED_CHNL_SMP_BIT;
368 tL2C_LCB *p_lcb;
376 p_lcb = l2cu_find_lcb_by_bd_addr (bda, BT_TRANSPORT_LE);
379 if (!p_lcb)
381 p_lcb = l2cu_allocate_lcb (bda, FALSE, BT_TRANSPORT_LE);
382 if (!p_lcb)
390 if (!l2cu_initialize_fixed_ccb (p_lcb, L2CAP_ATT_CID, &l2cb.fixed_reg[L2CAP_ATT_CID - L2CAP_FIRST_FIXED_CHNL].fixed_chnl_opts))
400 p_lcb->handle = handle;
403 p_lcb->link_role = HCI_ROLE_SLAVE;
404 p_lcb->transport = BT_TRANSPORT_LE;
407 p_lcb->min_interval = p_lcb->max_interval = conn_interval;
408 p_lcb->timeout = conn_timeout;
409 p_lcb->latency = conn_latency;
410 p_lcb->conn_update_mask = L2C_BLE_NOT_DEFAULT_PARAM;
415 btm_acl_created (bda, NULL, p_dev_rec->sec_bd_name, handle, p_lcb->link_role, BT_TRANSPORT_LE);
417 p_lcb->peer_chnl_mask[0] = L2CAP_FIXED_CHNL_ATT_BIT | L2CAP_FIXED_CHNL_BLE_SIG_BIT | L2CAP_FIXED_CHNL_SMP_BIT;
421 p_lcb->link_state = LST_CONNECTED;
422 l2cu_process_fixed_chnl_resp (p_lcb);
466 static void l2cble_start_conn_update (tL2C_LCB *p_lcb)
469 tBTM_SEC_DEV_REC *p_dev_rec = btm_find_or_alloc_dev(p_lcb->remote_bd_addr);
470 tACL_CONN *p_acl_cb = btm_bda_to_acl(p_lcb->remote_bd_addr, BT_TRANSPORT_LE);
472 if (p_lcb->conn_update_mask & L2C_BLE_UPDATE_PENDING) return;
474 if (p_lcb->conn_update_mask & L2C_BLE_CONN_UPDATE_DISABLE)
479 if (p_lcb->conn_update_mask & L2C_BLE_NOT_DEFAULT_PARAM &&
481 p_lcb->min_interval > BTM_BLE_CONN_INT_MIN)
489 if (p_lcb->link_role == HCI_ROLE_MASTER
496 btsnd_hcic_ble_upd_ll_conn_params(p_lcb->handle, min_conn_int, max_conn_int,
498 p_lcb->conn_update_mask |= L2C_BLE_UPDATE_PENDING;
502 l2cu_send_peer_ble_par_req (p_lcb, min_conn_int, max_conn_int, slave_latency, supervision_tout);
504 p_lcb->conn_update_mask &= ~L2C_BLE_NOT_DEFAULT_PARAM;
505 p_lcb->conn_update_mask |= L2C_BLE_NEW_CONN_PARAM;
511 if (p_lcb->conn_update_mask & L2C_BLE_NEW_CONN_PARAM)
514 if (p_lcb->link_role == HCI_ROLE_MASTER
521 btsnd_hcic_ble_upd_ll_conn_params(p_lcb->handle, p_lcb->min_interval,
522 p_lcb->max_interval, p_lcb->latency, p_lcb->timeout, 0, 0);
523 p_lcb->conn_update_mask |= L2C_BLE_UPDATE_PENDING;
527 l2cu_send_peer_ble_par_req (p_lcb, p_lcb->min_interval, p_lcb->max_interval,
528 p_lcb->latency, p_lcb->timeout);
530 p_lcb->conn_update_mask &= ~L2C_BLE_NEW_CONN_PARAM;
531 p_lcb->conn_update_mask |= L2C_BLE_NOT_DEFAULT_PARAM;
548 tL2C_LCB *p_lcb;
553 p_lcb = l2cu_find_lcb_by_handle(handle);
554 if (!p_lcb)
560 p_lcb->conn_update_mask &= ~L2C_BLE_UPDATE_PENDING;
567 l2cble_start_conn_update(p_lcb);
569 L2CAP_TRACE_DEBUG("l2cble_process_conn_update_evt: conn_update_mask=%d", p_lcb->conn_update_mask);
581 void l2cble_process_sig_cmd (tL2C_LCB *p_lcb, UINT8 *p, UINT16 pkt_len)
611 l2cu_send_peer_cmd_reject (p_lcb, L2CAP_CMD_REJ_NOT_UNDERSTOOD, id, 0, 0);
620 if (p_lcb->link_role == HCI_ROLE_MASTER)
629 l2cu_send_peer_ble_par_rsp (p_lcb, L2CAP_CFG_UNACCEPTABLE_PARAMS, id);
634 l2cu_send_peer_ble_par_rsp (p_lcb, L2CAP_CFG_OK, id);
636 p_lcb->min_interval = min_interval;
637 p_lcb->max_interval = max_interval;
638 p_lcb->latency = latency;
639 p_lcb->timeout = timeout;
640 p_lcb->conn_update_mask |= L2C_BLE_NEW_CONN_PARAM;
642 l2cble_start_conn_update(p_lcb);
646 l2cu_send_peer_cmd_reject (p_lcb, L2CAP_CMD_REJ_NOT_UNDERSTOOD, id, 0, 0);
655 l2cu_send_peer_cmd_reject (p_lcb, L2CAP_CMD_REJ_NOT_UNDERSTOOD, id, 0, 0);
669 BOOLEAN l2cble_init_direct_conn (tL2C_LCB *p_lcb)
671 tBTM_SEC_DEV_REC *p_dev_rec = btm_find_or_alloc_dev (p_lcb->remote_bd_addr);
688 init_addr_type = p_lcb->ble_addr_type;
689 memcpy(init_addr, p_lcb->remote_bd_addr, BD_ADDR_LEN);
708 l2cu_release_lcb (p_lcb);
730 l2cu_release_lcb (p_lcb);
736 p_lcb->link_state = LST_CONNECTING;
738 memcpy (l2cb.ble_connecting_bda, p_lcb->remote_bd_addr, BD_ADDR_LEN);
739 btu_start_timer (&p_lcb->timer_entry, BTU_TTYPE_L2CAP_LINK, L2CAP_BLE_LINK_CONNECT_TOUT);
755 BOOLEAN l2cble_create_conn (tL2C_LCB *p_lcb)
763 rt = l2cble_init_direct_conn(p_lcb);
769 btm_ble_enqueue_direct_conn_req(p_lcb);
819 tL2C_LCB *p_lcb;
835 for (yy = 0, p_lcb = &l2cb.lcb_pool[0]; yy < MAX_L2CAP_LINKS; yy++, p_lcb++)
837 if (p_lcb->in_use && p_lcb->transport == BT_TRANSPORT_LE)
839 if (p_lcb->acl_priority == L2CAP_PRIORITY_HIGH)
884 for (yy = 0, p_lcb = &l2cb.lcb_pool[0]; yy < MAX_L2CAP_LINKS; yy++, p_lcb++)
886 if (p_lcb->in_use && p_lcb->transport == BT_TRANSPORT_LE)
888 if (p_lcb->acl_priority == L2CAP_PRIORITY_HIGH)
890 p_lcb->link_xmit_quota = high_pri_link_quota;
897 if (( p_lcb->link_xmit_quota > 0 )&&( qq == 0 ))
898 l2cb.ble_round_robin_unacked += p_lcb->sent_not_acked;
900 p_lcb->link_xmit_quota = qq;
903 p_lcb->link_xmit_quota++;
909 yy, p_lcb->acl_priority, p_lcb->link_xmit_quota);
912 p_lcb->sent_not_acked, l2cb.round_robin_unacked);
917 if ( (p_lcb->link_state == LST_CONNECTED)
918 && (p_lcb->link_xmit_data_q.count)
919 && (p_lcb->sent_not_acked < p_lcb->link_xmit_quota) )
920 btu_start_timer (&p_lcb->timer_entry, BTU_TTYPE_L2CAP_LINK, L2CAP_LINK_FLOW_CONTROL_TOUT);
938 tL2C_LCB *p_lcb = l2cu_find_lcb_by_handle (handle);
940 if (p_lcb != NULL)
942 p_lcb->min_interval = int_min;
943 p_lcb->max_interval = int_max;
944 p_lcb->latency = latency;
945 p_lcb->timeout = timeout;
948 if ((p_lcb->conn_update_mask & L2C_BLE_CONN_UPDATE_DISABLE) == 0)
955 p_lcb->conn_update_mask |= L2C_BLE_NEW_CONN_PARAM;