Lines Matching refs:p_cfg
511 tL2CAP_LE_CFG_INFO* p_cfg) { in l2cu_send_credit_based_reconfig_req() argument
538 p_lcb->pending_ecoc_reconfig_cnt, p_cfg->mtu, p_cfg->mps); in l2cu_send_credit_based_reconfig_req()
540 UINT16_TO_STREAM(p, p_cfg->mtu); in l2cu_send_credit_based_reconfig_req()
541 UINT16_TO_STREAM(p, p_cfg->mps); in l2cu_send_credit_based_reconfig_req()
563 void l2cu_send_peer_config_req(tL2C_CCB* p_ccb, tL2CAP_CFG_INFO* p_cfg) { in l2cu_send_peer_config_req() argument
574 if (p_cfg->mtu_present) in l2cu_send_peer_config_req()
576 if (p_cfg->flush_to_present) in l2cu_send_peer_config_req()
578 if (p_cfg->qos_present) in l2cu_send_peer_config_req()
580 if (p_cfg->fcr_present) in l2cu_send_peer_config_req()
582 if (p_cfg->fcs_present) in l2cu_send_peer_config_req()
584 if (p_cfg->ext_flow_spec_present) in l2cu_send_peer_config_req()
599 UINT16_TO_STREAM(p, p_cfg->flags); /* Flags (continuation) */ in l2cu_send_peer_config_req()
602 if (p_cfg->mtu_present) { in l2cu_send_peer_config_req()
605 UINT16_TO_STREAM(p, p_cfg->mtu); in l2cu_send_peer_config_req()
607 if (p_cfg->flush_to_present) { in l2cu_send_peer_config_req()
610 UINT16_TO_STREAM(p, p_cfg->flush_to); in l2cu_send_peer_config_req()
612 if (p_cfg->qos_present) { in l2cu_send_peer_config_req()
615 UINT8_TO_STREAM(p, p_cfg->qos.qos_flags); in l2cu_send_peer_config_req()
616 UINT8_TO_STREAM(p, p_cfg->qos.service_type); in l2cu_send_peer_config_req()
617 UINT32_TO_STREAM(p, p_cfg->qos.token_rate); in l2cu_send_peer_config_req()
618 UINT32_TO_STREAM(p, p_cfg->qos.token_bucket_size); in l2cu_send_peer_config_req()
619 UINT32_TO_STREAM(p, p_cfg->qos.peak_bandwidth); in l2cu_send_peer_config_req()
620 UINT32_TO_STREAM(p, p_cfg->qos.latency); in l2cu_send_peer_config_req()
621 UINT32_TO_STREAM(p, p_cfg->qos.delay_variation); in l2cu_send_peer_config_req()
623 if (p_cfg->fcr_present) { in l2cu_send_peer_config_req()
626 UINT8_TO_STREAM(p, p_cfg->fcr.mode); in l2cu_send_peer_config_req()
627 UINT8_TO_STREAM(p, p_cfg->fcr.tx_win_sz); in l2cu_send_peer_config_req()
628 UINT8_TO_STREAM(p, p_cfg->fcr.max_transmit); in l2cu_send_peer_config_req()
629 UINT16_TO_STREAM(p, p_cfg->fcr.rtrans_tout); in l2cu_send_peer_config_req()
630 UINT16_TO_STREAM(p, p_cfg->fcr.mon_tout); in l2cu_send_peer_config_req()
631 UINT16_TO_STREAM(p, p_cfg->fcr.mps); in l2cu_send_peer_config_req()
634 if (p_cfg->fcs_present) { in l2cu_send_peer_config_req()
637 UINT8_TO_STREAM(p, p_cfg->fcs); in l2cu_send_peer_config_req()
640 if (p_cfg->ext_flow_spec_present) { in l2cu_send_peer_config_req()
643 UINT8_TO_STREAM(p, p_cfg->ext_flow_spec.id); in l2cu_send_peer_config_req()
644 UINT8_TO_STREAM(p, p_cfg->ext_flow_spec.stype); in l2cu_send_peer_config_req()
645 UINT16_TO_STREAM(p, p_cfg->ext_flow_spec.max_sdu_size); in l2cu_send_peer_config_req()
646 UINT32_TO_STREAM(p, p_cfg->ext_flow_spec.sdu_inter_time); in l2cu_send_peer_config_req()
647 UINT32_TO_STREAM(p, p_cfg->ext_flow_spec.access_latency); in l2cu_send_peer_config_req()
648 UINT32_TO_STREAM(p, p_cfg->ext_flow_spec.flush_timeout); in l2cu_send_peer_config_req()
664 void l2cu_send_peer_config_rsp(tL2C_CCB* p_ccb, tL2CAP_CFG_INFO* p_cfg) { in l2cu_send_peer_config_rsp() argument
670 if (p_cfg->mtu_present) in l2cu_send_peer_config_rsp()
672 if (p_cfg->flush_to_present) in l2cu_send_peer_config_rsp()
674 if (p_cfg->qos_present) in l2cu_send_peer_config_rsp()
676 if (p_cfg->fcr_present) in l2cu_send_peer_config_rsp()
678 if (p_cfg->ext_flow_spec_present) in l2cu_send_peer_config_rsp()
694 p_cfg->flags); /* Flags (continuation) Must match request */ in l2cu_send_peer_config_rsp()
695 UINT16_TO_STREAM(p, p_cfg->result); in l2cu_send_peer_config_rsp()
698 if (p_cfg->mtu_present) { in l2cu_send_peer_config_rsp()
701 UINT16_TO_STREAM(p, p_cfg->mtu); in l2cu_send_peer_config_rsp()
703 if (p_cfg->flush_to_present) { in l2cu_send_peer_config_rsp()
706 UINT16_TO_STREAM(p, p_cfg->flush_to); in l2cu_send_peer_config_rsp()
708 if (p_cfg->qos_present) { in l2cu_send_peer_config_rsp()
711 UINT8_TO_STREAM(p, p_cfg->qos.qos_flags); in l2cu_send_peer_config_rsp()
712 UINT8_TO_STREAM(p, p_cfg->qos.service_type); in l2cu_send_peer_config_rsp()
713 UINT32_TO_STREAM(p, p_cfg->qos.token_rate); in l2cu_send_peer_config_rsp()
714 UINT32_TO_STREAM(p, p_cfg->qos.token_bucket_size); in l2cu_send_peer_config_rsp()
715 UINT32_TO_STREAM(p, p_cfg->qos.peak_bandwidth); in l2cu_send_peer_config_rsp()
716 UINT32_TO_STREAM(p, p_cfg->qos.latency); in l2cu_send_peer_config_rsp()
717 UINT32_TO_STREAM(p, p_cfg->qos.delay_variation); in l2cu_send_peer_config_rsp()
719 if (p_cfg->fcr_present) { in l2cu_send_peer_config_rsp()
722 UINT8_TO_STREAM(p, p_cfg->fcr.mode); in l2cu_send_peer_config_rsp()
723 UINT8_TO_STREAM(p, p_cfg->fcr.tx_win_sz); in l2cu_send_peer_config_rsp()
724 UINT8_TO_STREAM(p, p_cfg->fcr.max_transmit); in l2cu_send_peer_config_rsp()
727 UINT16_TO_STREAM(p, p_cfg->fcr.mps); in l2cu_send_peer_config_rsp()
730 if (p_cfg->ext_flow_spec_present) { in l2cu_send_peer_config_rsp()
733 UINT8_TO_STREAM(p, p_cfg->ext_flow_spec.id); in l2cu_send_peer_config_rsp()
734 UINT8_TO_STREAM(p, p_cfg->ext_flow_spec.stype); in l2cu_send_peer_config_rsp()
735 UINT16_TO_STREAM(p, p_cfg->ext_flow_spec.max_sdu_size); in l2cu_send_peer_config_rsp()
736 UINT32_TO_STREAM(p, p_cfg->ext_flow_spec.sdu_inter_time); in l2cu_send_peer_config_rsp()
737 UINT32_TO_STREAM(p, p_cfg->ext_flow_spec.access_latency); in l2cu_send_peer_config_rsp()
738 UINT32_TO_STREAM(p, p_cfg->ext_flow_spec.flush_timeout); in l2cu_send_peer_config_rsp()
1806 uint8_t l2cu_process_peer_cfg_req(tL2C_CCB* p_ccb, tL2CAP_CFG_INFO* p_cfg) { in l2cu_process_peer_cfg_req() argument
1816 if (!p_cfg->fcr_present) p_cfg->fcr.mode = L2CAP_FCR_BASIC_MODE; in l2cu_process_peer_cfg_req()
1818 if (!p_cfg->mtu_present && required_remote_mtu > L2CAP_DEFAULT_MTU) { in l2cu_process_peer_cfg_req()
1820 p_cfg->mtu = required_remote_mtu; in l2cu_process_peer_cfg_req()
1822 } else if (p_cfg->mtu_present) { in l2cu_process_peer_cfg_req()
1824 if (p_cfg->mtu >= required_remote_mtu) { in l2cu_process_peer_cfg_req()
1826 if ((!p_cfg->fcr_present) && (p_cfg->mtu > L2CAP_MTU_SIZE)) in l2cu_process_peer_cfg_req()
1827 p_cfg->mtu = L2CAP_MTU_SIZE; in l2cu_process_peer_cfg_req()
1830 p_ccb->peer_cfg.mtu = p_cfg->mtu; in l2cu_process_peer_cfg_req()
1834 p_cfg->mtu = required_remote_mtu; in l2cu_process_peer_cfg_req()
1840 p_cfg->mtu_present = true; in l2cu_process_peer_cfg_req()
1841 p_cfg->mtu = p_ccb->peer_cfg.mtu; in l2cu_process_peer_cfg_req()
1845 if (p_cfg->flush_to_present) { in l2cu_process_peer_cfg_req()
1846 if (!p_cfg->flush_to) { in l2cu_process_peer_cfg_req()
1847 p_cfg->flush_to = 0xFFFF; /* Infinite retransmissions (spec default) */ in l2cu_process_peer_cfg_req()
1852 p_ccb->peer_cfg.flush_to = p_cfg->flush_to; in l2cu_process_peer_cfg_req()
1858 p_cfg->flush_to_present = true; in l2cu_process_peer_cfg_req()
1859 p_cfg->flush_to = p_ccb->peer_cfg.flush_to; in l2cu_process_peer_cfg_req()
1863 if (p_cfg->qos_present) { in l2cu_process_peer_cfg_req()
1867 if (p_cfg->qos.service_type <= SVC_TYPE_GUARANTEED) { in l2cu_process_peer_cfg_req()
1868 p_ccb->peer_cfg.qos = p_cfg->qos; in l2cu_process_peer_cfg_req()
1872 p_cfg->qos.service_type = SVC_TYPE_BEST_EFFORT; in l2cu_process_peer_cfg_req()
1878 p_cfg->qos_present = true; in l2cu_process_peer_cfg_req()
1879 p_cfg->qos = p_ccb->peer_cfg.qos; in l2cu_process_peer_cfg_req()
1882 fcr_status = l2c_fcr_process_peer_cfg_req(p_ccb, p_cfg); in l2cu_process_peer_cfg_req()
1885 p_cfg->result = L2CAP_CFG_FAILED_NO_REASON; in l2cu_process_peer_cfg_req()
1886 p_cfg->mtu_present = p_cfg->qos_present = p_cfg->flush_to_present = 0; in l2cu_process_peer_cfg_req()
1898 p_cfg->result = L2CAP_CFG_UNACCEPTABLE_PARAMS; in l2cu_process_peer_cfg_req()
1900 if (mtu_ok) p_cfg->mtu_present = false; in l2cu_process_peer_cfg_req()
1901 if (flush_to_ok) p_cfg->flush_to_present = false; in l2cu_process_peer_cfg_req()
1902 if (qos_type_ok) p_cfg->qos_present = false; in l2cu_process_peer_cfg_req()
1903 if (fcr_ok) p_cfg->fcr_present = false; in l2cu_process_peer_cfg_req()
1920 void l2cu_process_peer_cfg_rsp(tL2C_CCB* p_ccb, tL2CAP_CFG_INFO* p_cfg) { in l2cu_process_peer_cfg_rsp() argument
1923 if ((p_cfg->qos_present) && (p_ccb->our_cfg.qos_present)) in l2cu_process_peer_cfg_rsp()
1924 p_ccb->our_cfg.qos = p_cfg->qos; in l2cu_process_peer_cfg_rsp()
1926 if (p_cfg->fcr_present) { in l2cu_process_peer_cfg_rsp()
1928 if (p_cfg->fcr.mode == L2CAP_FCR_ERTM_MODE) { in l2cu_process_peer_cfg_rsp()
1929 p_ccb->peer_cfg.fcr.rtrans_tout = p_cfg->fcr.rtrans_tout; in l2cu_process_peer_cfg_rsp()
1930 p_ccb->peer_cfg.fcr.mon_tout = p_cfg->fcr.mon_tout; in l2cu_process_peer_cfg_rsp()
1935 if (p_cfg->fcr.tx_win_sz < p_ccb->our_cfg.fcr.tx_win_sz) in l2cu_process_peer_cfg_rsp()
1936 p_ccb->fcrb.max_held_acks = p_cfg->fcr.tx_win_sz / 3; in l2cu_process_peer_cfg_rsp()
1943 p_cfg->fcr.tx_win_sz, p_ccb->our_cfg.fcr.tx_win_sz, in l2cu_process_peer_cfg_rsp()
1959 void l2cu_process_our_cfg_req(tL2C_CCB* p_ccb, tL2CAP_CFG_INFO* p_cfg) { in l2cu_process_our_cfg_req() argument
1961 if (p_cfg->qos_present) { in l2cu_process_our_cfg_req()
1963 p_ccb->our_cfg.qos = p_cfg->qos; in l2cu_process_our_cfg_req()
1966 if (p_cfg->fcr_present) { in l2cu_process_our_cfg_req()
1968 if (p_cfg->fcr.mode == L2CAP_FCR_BASIC_MODE) in l2cu_process_our_cfg_req()
1969 memset(&p_cfg->fcr, 0, sizeof(tL2CAP_FCR_OPTS)); in l2cu_process_our_cfg_req()
1976 p_cfg->fcr.mon_tout = p_cfg->fcr.rtrans_tout = 0; in l2cu_process_our_cfg_req()
1980 p_ccb->fcrb.max_held_acks = p_cfg->fcr.tx_win_sz / 3; in l2cu_process_our_cfg_req()
1984 p_cfg->fcs_present = false; in l2cu_process_our_cfg_req()
1987 p_cfg->fcr.mode = L2CAP_FCR_BASIC_MODE; in l2cu_process_our_cfg_req()
1990 p_ccb->our_cfg.fcr.mode = p_cfg->fcr.mode; in l2cu_process_our_cfg_req()
1991 p_ccb->our_cfg.fcr_present = p_cfg->fcr_present; in l2cu_process_our_cfg_req()
2005 void l2cu_process_our_cfg_rsp(tL2C_CCB* p_ccb, tL2CAP_CFG_INFO* p_cfg) { in l2cu_process_our_cfg_rsp() argument
2008 if ((p_cfg->qos_present) && (p_ccb->peer_cfg.qos_present)) in l2cu_process_our_cfg_rsp()
2009 p_ccb->peer_cfg.qos = p_cfg->qos; in l2cu_process_our_cfg_rsp()
2011 p_cfg->qos_present = false; in l2cu_process_our_cfg_rsp()
2013 l2c_fcr_adj_our_rsp_options(p_ccb, p_cfg); in l2cu_process_our_cfg_rsp()