Lines Matching refs:p_cfg
537 void l2cu_send_peer_config_req(tL2C_CCB* p_ccb, tL2CAP_CFG_INFO* p_cfg) { in l2cu_send_peer_config_req() argument
548 if (p_cfg->mtu_present) in l2cu_send_peer_config_req()
550 if (p_cfg->flush_to_present) in l2cu_send_peer_config_req()
552 if (p_cfg->qos_present) in l2cu_send_peer_config_req()
554 if (p_cfg->fcr_present) in l2cu_send_peer_config_req()
556 if (p_cfg->fcs_present) in l2cu_send_peer_config_req()
558 if (p_cfg->ext_flow_spec_present) in l2cu_send_peer_config_req()
573 UINT16_TO_STREAM(p, p_cfg->flags); /* Flags (continuation) */ in l2cu_send_peer_config_req()
576 if (p_cfg->mtu_present) { in l2cu_send_peer_config_req()
579 UINT16_TO_STREAM(p, p_cfg->mtu); in l2cu_send_peer_config_req()
581 if (p_cfg->flush_to_present) { in l2cu_send_peer_config_req()
584 UINT16_TO_STREAM(p, p_cfg->flush_to); in l2cu_send_peer_config_req()
586 if (p_cfg->qos_present) { in l2cu_send_peer_config_req()
589 UINT8_TO_STREAM(p, p_cfg->qos.qos_flags); in l2cu_send_peer_config_req()
590 UINT8_TO_STREAM(p, p_cfg->qos.service_type); in l2cu_send_peer_config_req()
591 UINT32_TO_STREAM(p, p_cfg->qos.token_rate); in l2cu_send_peer_config_req()
592 UINT32_TO_STREAM(p, p_cfg->qos.token_bucket_size); in l2cu_send_peer_config_req()
593 UINT32_TO_STREAM(p, p_cfg->qos.peak_bandwidth); in l2cu_send_peer_config_req()
594 UINT32_TO_STREAM(p, p_cfg->qos.latency); in l2cu_send_peer_config_req()
595 UINT32_TO_STREAM(p, p_cfg->qos.delay_variation); in l2cu_send_peer_config_req()
597 if (p_cfg->fcr_present) { in l2cu_send_peer_config_req()
600 UINT8_TO_STREAM(p, p_cfg->fcr.mode); in l2cu_send_peer_config_req()
601 UINT8_TO_STREAM(p, p_cfg->fcr.tx_win_sz); in l2cu_send_peer_config_req()
602 UINT8_TO_STREAM(p, p_cfg->fcr.max_transmit); in l2cu_send_peer_config_req()
603 UINT16_TO_STREAM(p, p_cfg->fcr.rtrans_tout); in l2cu_send_peer_config_req()
604 UINT16_TO_STREAM(p, p_cfg->fcr.mon_tout); in l2cu_send_peer_config_req()
605 UINT16_TO_STREAM(p, p_cfg->fcr.mps); in l2cu_send_peer_config_req()
608 if (p_cfg->fcs_present) { in l2cu_send_peer_config_req()
611 UINT8_TO_STREAM(p, p_cfg->fcs); in l2cu_send_peer_config_req()
614 if (p_cfg->ext_flow_spec_present) { in l2cu_send_peer_config_req()
617 UINT8_TO_STREAM(p, p_cfg->ext_flow_spec.id); in l2cu_send_peer_config_req()
618 UINT8_TO_STREAM(p, p_cfg->ext_flow_spec.stype); in l2cu_send_peer_config_req()
619 UINT16_TO_STREAM(p, p_cfg->ext_flow_spec.max_sdu_size); in l2cu_send_peer_config_req()
620 UINT32_TO_STREAM(p, p_cfg->ext_flow_spec.sdu_inter_time); in l2cu_send_peer_config_req()
621 UINT32_TO_STREAM(p, p_cfg->ext_flow_spec.access_latency); in l2cu_send_peer_config_req()
622 UINT32_TO_STREAM(p, p_cfg->ext_flow_spec.flush_timeout); in l2cu_send_peer_config_req()
638 void l2cu_send_peer_config_rsp(tL2C_CCB* p_ccb, tL2CAP_CFG_INFO* p_cfg) { in l2cu_send_peer_config_rsp() argument
644 if (p_cfg->mtu_present) in l2cu_send_peer_config_rsp()
646 if (p_cfg->flush_to_present) in l2cu_send_peer_config_rsp()
648 if (p_cfg->qos_present) in l2cu_send_peer_config_rsp()
650 if (p_cfg->fcr_present) in l2cu_send_peer_config_rsp()
652 if (p_cfg->ext_flow_spec_present) in l2cu_send_peer_config_rsp()
668 p_cfg->flags); /* Flags (continuation) Must match request */ in l2cu_send_peer_config_rsp()
669 UINT16_TO_STREAM(p, p_cfg->result); in l2cu_send_peer_config_rsp()
672 if (p_cfg->mtu_present) { in l2cu_send_peer_config_rsp()
675 UINT16_TO_STREAM(p, p_cfg->mtu); in l2cu_send_peer_config_rsp()
677 if (p_cfg->flush_to_present) { in l2cu_send_peer_config_rsp()
680 UINT16_TO_STREAM(p, p_cfg->flush_to); in l2cu_send_peer_config_rsp()
682 if (p_cfg->qos_present) { in l2cu_send_peer_config_rsp()
685 UINT8_TO_STREAM(p, p_cfg->qos.qos_flags); in l2cu_send_peer_config_rsp()
686 UINT8_TO_STREAM(p, p_cfg->qos.service_type); in l2cu_send_peer_config_rsp()
687 UINT32_TO_STREAM(p, p_cfg->qos.token_rate); in l2cu_send_peer_config_rsp()
688 UINT32_TO_STREAM(p, p_cfg->qos.token_bucket_size); in l2cu_send_peer_config_rsp()
689 UINT32_TO_STREAM(p, p_cfg->qos.peak_bandwidth); in l2cu_send_peer_config_rsp()
690 UINT32_TO_STREAM(p, p_cfg->qos.latency); in l2cu_send_peer_config_rsp()
691 UINT32_TO_STREAM(p, p_cfg->qos.delay_variation); in l2cu_send_peer_config_rsp()
693 if (p_cfg->fcr_present) { in l2cu_send_peer_config_rsp()
696 UINT8_TO_STREAM(p, p_cfg->fcr.mode); in l2cu_send_peer_config_rsp()
697 UINT8_TO_STREAM(p, p_cfg->fcr.tx_win_sz); in l2cu_send_peer_config_rsp()
698 UINT8_TO_STREAM(p, p_cfg->fcr.max_transmit); in l2cu_send_peer_config_rsp()
701 UINT16_TO_STREAM(p, p_cfg->fcr.mps); in l2cu_send_peer_config_rsp()
704 if (p_cfg->ext_flow_spec_present) { in l2cu_send_peer_config_rsp()
707 UINT8_TO_STREAM(p, p_cfg->ext_flow_spec.id); in l2cu_send_peer_config_rsp()
708 UINT8_TO_STREAM(p, p_cfg->ext_flow_spec.stype); in l2cu_send_peer_config_rsp()
709 UINT16_TO_STREAM(p, p_cfg->ext_flow_spec.max_sdu_size); in l2cu_send_peer_config_rsp()
710 UINT32_TO_STREAM(p, p_cfg->ext_flow_spec.sdu_inter_time); in l2cu_send_peer_config_rsp()
711 UINT32_TO_STREAM(p, p_cfg->ext_flow_spec.access_latency); in l2cu_send_peer_config_rsp()
712 UINT32_TO_STREAM(p, p_cfg->ext_flow_spec.flush_timeout); in l2cu_send_peer_config_rsp()
1850 uint8_t l2cu_process_peer_cfg_req(tL2C_CCB* p_ccb, tL2CAP_CFG_INFO* p_cfg) { in l2cu_process_peer_cfg_req() argument
1858 if (!p_cfg->fcr_present) p_cfg->fcr.mode = L2CAP_FCR_BASIC_MODE; in l2cu_process_peer_cfg_req()
1861 if (p_cfg->mtu_present) { in l2cu_process_peer_cfg_req()
1863 if (p_cfg->mtu >= L2CAP_MIN_MTU) { in l2cu_process_peer_cfg_req()
1865 if ((!p_cfg->fcr_present) && (p_cfg->mtu > L2CAP_MTU_SIZE)) in l2cu_process_peer_cfg_req()
1866 p_cfg->mtu = L2CAP_MTU_SIZE; in l2cu_process_peer_cfg_req()
1869 p_ccb->peer_cfg.mtu = p_cfg->mtu; in l2cu_process_peer_cfg_req()
1874 p_cfg->mtu = L2CAP_MIN_MTU; in l2cu_process_peer_cfg_req()
1880 p_cfg->mtu_present = true; in l2cu_process_peer_cfg_req()
1881 p_cfg->mtu = p_ccb->peer_cfg.mtu; in l2cu_process_peer_cfg_req()
1885 if (p_cfg->flush_to_present) { in l2cu_process_peer_cfg_req()
1886 if (!p_cfg->flush_to) { in l2cu_process_peer_cfg_req()
1887 p_cfg->flush_to = 0xFFFF; /* Infinite retransmissions (spec default) */ in l2cu_process_peer_cfg_req()
1892 p_ccb->peer_cfg.flush_to = p_cfg->flush_to; in l2cu_process_peer_cfg_req()
1898 p_cfg->flush_to_present = true; in l2cu_process_peer_cfg_req()
1899 p_cfg->flush_to = p_ccb->peer_cfg.flush_to; in l2cu_process_peer_cfg_req()
1903 if (p_cfg->qos_present) { in l2cu_process_peer_cfg_req()
1907 if (p_cfg->qos.service_type <= SVC_TYPE_GUARANTEED) { in l2cu_process_peer_cfg_req()
1908 p_ccb->peer_cfg.qos = p_cfg->qos; in l2cu_process_peer_cfg_req()
1913 p_cfg->qos.service_type = SVC_TYPE_BEST_EFFORT; in l2cu_process_peer_cfg_req()
1919 p_cfg->qos_present = true; in l2cu_process_peer_cfg_req()
1920 p_cfg->qos = p_ccb->peer_cfg.qos; in l2cu_process_peer_cfg_req()
1923 fcr_status = l2c_fcr_process_peer_cfg_req(p_ccb, p_cfg); in l2cu_process_peer_cfg_req()
1926 p_cfg->result = L2CAP_CFG_FAILED_NO_REASON; in l2cu_process_peer_cfg_req()
1927 p_cfg->mtu_present = p_cfg->qos_present = p_cfg->flush_to_present = 0; in l2cu_process_peer_cfg_req()
1939 p_cfg->result = L2CAP_CFG_UNACCEPTABLE_PARAMS; in l2cu_process_peer_cfg_req()
1941 if (mtu_ok) p_cfg->mtu_present = false; in l2cu_process_peer_cfg_req()
1942 if (flush_to_ok) p_cfg->flush_to_present = false; in l2cu_process_peer_cfg_req()
1943 if (qos_type_ok) p_cfg->qos_present = false; in l2cu_process_peer_cfg_req()
1944 if (fcr_ok) p_cfg->fcr_present = false; in l2cu_process_peer_cfg_req()
1961 void l2cu_process_peer_cfg_rsp(tL2C_CCB* p_ccb, tL2CAP_CFG_INFO* p_cfg) { in l2cu_process_peer_cfg_rsp() argument
1964 if ((p_cfg->qos_present) && (p_ccb->our_cfg.qos_present)) in l2cu_process_peer_cfg_rsp()
1965 p_ccb->our_cfg.qos = p_cfg->qos; in l2cu_process_peer_cfg_rsp()
1967 if (p_cfg->fcr_present) { in l2cu_process_peer_cfg_rsp()
1969 if (p_cfg->fcr.mode == L2CAP_FCR_ERTM_MODE) { in l2cu_process_peer_cfg_rsp()
1970 p_ccb->peer_cfg.fcr.rtrans_tout = p_cfg->fcr.rtrans_tout; in l2cu_process_peer_cfg_rsp()
1971 p_ccb->peer_cfg.fcr.mon_tout = p_cfg->fcr.mon_tout; in l2cu_process_peer_cfg_rsp()
1976 if (p_cfg->fcr.tx_win_sz < p_ccb->our_cfg.fcr.tx_win_sz) in l2cu_process_peer_cfg_rsp()
1977 p_ccb->fcrb.max_held_acks = p_cfg->fcr.tx_win_sz / 3; in l2cu_process_peer_cfg_rsp()
1984 p_cfg->fcr.tx_win_sz, p_ccb->our_cfg.fcr.tx_win_sz, in l2cu_process_peer_cfg_rsp()
2000 void l2cu_process_our_cfg_req(tL2C_CCB* p_ccb, tL2CAP_CFG_INFO* p_cfg) { in l2cu_process_our_cfg_req() argument
2005 if (p_cfg->qos_present) { in l2cu_process_our_cfg_req()
2007 p_ccb->our_cfg.qos = p_cfg->qos; in l2cu_process_our_cfg_req()
2010 if (p_cfg->fcr_present) { in l2cu_process_our_cfg_req()
2012 if (p_cfg->fcr.mode == L2CAP_FCR_BASIC_MODE) in l2cu_process_our_cfg_req()
2013 memset(&p_cfg->fcr, 0, sizeof(tL2CAP_FCR_OPTS)); in l2cu_process_our_cfg_req()
2020 p_cfg->fcr.mon_tout = p_cfg->fcr.rtrans_tout = 0; in l2cu_process_our_cfg_req()
2024 p_ccb->fcrb.max_held_acks = p_cfg->fcr.tx_win_sz / 3; in l2cu_process_our_cfg_req()
2029 if (p_cfg->fcs_present && p_cfg->fcs == L2CAP_CFG_FCS_BYPASS) in l2cu_process_our_cfg_req()
2032 p_cfg->fcs_present = false; in l2cu_process_our_cfg_req()
2034 p_cfg->fcr.mode = L2CAP_FCR_BASIC_MODE; in l2cu_process_our_cfg_req()
2037 p_ccb->our_cfg.fcr.mode = p_cfg->fcr.mode; in l2cu_process_our_cfg_req()
2038 p_ccb->our_cfg.fcr_present = p_cfg->fcr_present; in l2cu_process_our_cfg_req()
2042 if (p_cfg->flush_to_present) { in l2cu_process_our_cfg_req()
2043 if ((p_cfg->flush_to == 0) || in l2cu_process_our_cfg_req()
2044 (p_cfg->flush_to == L2CAP_NO_AUTOMATIC_FLUSH)) { in l2cu_process_our_cfg_req()
2049 p_cfg->flush_to_present = false; in l2cu_process_our_cfg_req()
2051 p_ccb->our_cfg.flush_to = p_cfg->flush_to; in l2cu_process_our_cfg_req()
2054 if (p_cfg->flush_to < p_lcb->link_flush_tout) { in l2cu_process_our_cfg_req()
2055 p_lcb->link_flush_tout = p_cfg->flush_to; in l2cu_process_our_cfg_req()
2058 if (p_cfg->flush_to <= ((HCI_MAX_AUTOMATIC_FLUSH_TIMEOUT * 5) / 8)) { in l2cu_process_our_cfg_req()
2060 hci_flush_to = ((p_cfg->flush_to * 8) + 3) / 5; in l2cu_process_our_cfg_req()
2079 void l2cu_process_our_cfg_rsp(tL2C_CCB* p_ccb, tL2CAP_CFG_INFO* p_cfg) { in l2cu_process_our_cfg_rsp() argument
2082 if ((p_cfg->qos_present) && (p_ccb->peer_cfg.qos_present)) in l2cu_process_our_cfg_rsp()
2083 p_ccb->peer_cfg.qos = p_cfg->qos; in l2cu_process_our_cfg_rsp()
2085 p_cfg->qos_present = false; in l2cu_process_our_cfg_rsp()
2087 l2c_fcr_adj_our_rsp_options(p_ccb, p_cfg); in l2cu_process_our_cfg_rsp()