Lines Matching refs:p_cfg
596 void l2cu_send_peer_config_req (tL2C_CCB *p_ccb, tL2CAP_CFG_INFO *p_cfg) in l2cu_send_peer_config_req() argument
608 if (p_cfg->mtu_present) in l2cu_send_peer_config_req()
610 if (p_cfg->flush_to_present) in l2cu_send_peer_config_req()
612 if (p_cfg->qos_present) in l2cu_send_peer_config_req()
614 if (p_cfg->fcr_present) in l2cu_send_peer_config_req()
616 if (p_cfg->fcs_present) in l2cu_send_peer_config_req()
618 if (p_cfg->ext_flow_spec_present) in l2cu_send_peer_config_req()
632 UINT16_TO_STREAM (p, p_cfg->flags); /* Flags (continuation) */ in l2cu_send_peer_config_req()
635 if (p_cfg->mtu_present) in l2cu_send_peer_config_req()
639 UINT16_TO_STREAM (p, p_cfg->mtu); in l2cu_send_peer_config_req()
641 if (p_cfg->flush_to_present) in l2cu_send_peer_config_req()
645 UINT16_TO_STREAM (p, p_cfg->flush_to); in l2cu_send_peer_config_req()
647 if (p_cfg->qos_present) in l2cu_send_peer_config_req()
651 UINT8_TO_STREAM (p, p_cfg->qos.qos_flags); in l2cu_send_peer_config_req()
652 UINT8_TO_STREAM (p, p_cfg->qos.service_type); in l2cu_send_peer_config_req()
653 UINT32_TO_STREAM (p, p_cfg->qos.token_rate); in l2cu_send_peer_config_req()
654 UINT32_TO_STREAM (p, p_cfg->qos.token_bucket_size); in l2cu_send_peer_config_req()
655 UINT32_TO_STREAM (p, p_cfg->qos.peak_bandwidth); in l2cu_send_peer_config_req()
656 UINT32_TO_STREAM (p, p_cfg->qos.latency); in l2cu_send_peer_config_req()
657 UINT32_TO_STREAM (p, p_cfg->qos.delay_variation); in l2cu_send_peer_config_req()
659 if (p_cfg->fcr_present) in l2cu_send_peer_config_req()
663 UINT8_TO_STREAM (p, p_cfg->fcr.mode); in l2cu_send_peer_config_req()
664 UINT8_TO_STREAM (p, p_cfg->fcr.tx_win_sz); in l2cu_send_peer_config_req()
665 UINT8_TO_STREAM (p, p_cfg->fcr.max_transmit); in l2cu_send_peer_config_req()
666 UINT16_TO_STREAM (p, p_cfg->fcr.rtrans_tout); in l2cu_send_peer_config_req()
667 UINT16_TO_STREAM (p, p_cfg->fcr.mon_tout); in l2cu_send_peer_config_req()
668 UINT16_TO_STREAM (p, p_cfg->fcr.mps); in l2cu_send_peer_config_req()
671 if (p_cfg->fcs_present) in l2cu_send_peer_config_req()
675 UINT8_TO_STREAM (p, p_cfg->fcs); in l2cu_send_peer_config_req()
678 if (p_cfg->ext_flow_spec_present) in l2cu_send_peer_config_req()
682 UINT8_TO_STREAM (p, p_cfg->ext_flow_spec.id); in l2cu_send_peer_config_req()
683 UINT8_TO_STREAM (p, p_cfg->ext_flow_spec.stype); in l2cu_send_peer_config_req()
684 UINT16_TO_STREAM (p, p_cfg->ext_flow_spec.max_sdu_size); in l2cu_send_peer_config_req()
685 UINT32_TO_STREAM (p, p_cfg->ext_flow_spec.sdu_inter_time); in l2cu_send_peer_config_req()
686 UINT32_TO_STREAM (p, p_cfg->ext_flow_spec.access_latency); in l2cu_send_peer_config_req()
687 UINT32_TO_STREAM (p, p_cfg->ext_flow_spec.flush_timeout); in l2cu_send_peer_config_req()
703 void l2cu_send_peer_config_rsp (tL2C_CCB *p_ccb, tL2CAP_CFG_INFO *p_cfg) in l2cu_send_peer_config_rsp() argument
710 if (p_cfg->mtu_present) in l2cu_send_peer_config_rsp()
712 if (p_cfg->flush_to_present) in l2cu_send_peer_config_rsp()
714 if (p_cfg->qos_present) in l2cu_send_peer_config_rsp()
716 if (p_cfg->fcr_present) in l2cu_send_peer_config_rsp()
718 if (p_cfg->ext_flow_spec_present) in l2cu_send_peer_config_rsp()
731 UINT16_TO_STREAM (p, p_cfg->flags); /* Flags (continuation) Must match request */ in l2cu_send_peer_config_rsp()
732 UINT16_TO_STREAM (p, p_cfg->result); in l2cu_send_peer_config_rsp()
735 if (p_cfg->mtu_present) in l2cu_send_peer_config_rsp()
739 UINT16_TO_STREAM (p, p_cfg->mtu); in l2cu_send_peer_config_rsp()
741 if (p_cfg->flush_to_present) in l2cu_send_peer_config_rsp()
745 UINT16_TO_STREAM (p, p_cfg->flush_to); in l2cu_send_peer_config_rsp()
747 if (p_cfg->qos_present) in l2cu_send_peer_config_rsp()
751 UINT8_TO_STREAM (p, p_cfg->qos.qos_flags); in l2cu_send_peer_config_rsp()
752 UINT8_TO_STREAM (p, p_cfg->qos.service_type); in l2cu_send_peer_config_rsp()
753 UINT32_TO_STREAM (p, p_cfg->qos.token_rate); in l2cu_send_peer_config_rsp()
754 UINT32_TO_STREAM (p, p_cfg->qos.token_bucket_size); in l2cu_send_peer_config_rsp()
755 UINT32_TO_STREAM (p, p_cfg->qos.peak_bandwidth); in l2cu_send_peer_config_rsp()
756 UINT32_TO_STREAM (p, p_cfg->qos.latency); in l2cu_send_peer_config_rsp()
757 UINT32_TO_STREAM (p, p_cfg->qos.delay_variation); in l2cu_send_peer_config_rsp()
759 if (p_cfg->fcr_present) in l2cu_send_peer_config_rsp()
763 UINT8_TO_STREAM (p, p_cfg->fcr.mode); in l2cu_send_peer_config_rsp()
764 UINT8_TO_STREAM (p, p_cfg->fcr.tx_win_sz); in l2cu_send_peer_config_rsp()
765 UINT8_TO_STREAM (p, p_cfg->fcr.max_transmit); in l2cu_send_peer_config_rsp()
768 UINT16_TO_STREAM (p, p_cfg->fcr.mps); in l2cu_send_peer_config_rsp()
771 if (p_cfg->ext_flow_spec_present) in l2cu_send_peer_config_rsp()
775 UINT8_TO_STREAM (p, p_cfg->ext_flow_spec.id); in l2cu_send_peer_config_rsp()
776 UINT8_TO_STREAM (p, p_cfg->ext_flow_spec.stype); in l2cu_send_peer_config_rsp()
777 UINT16_TO_STREAM (p, p_cfg->ext_flow_spec.max_sdu_size); in l2cu_send_peer_config_rsp()
778 UINT32_TO_STREAM (p, p_cfg->ext_flow_spec.sdu_inter_time); in l2cu_send_peer_config_rsp()
779 UINT32_TO_STREAM (p, p_cfg->ext_flow_spec.access_latency); in l2cu_send_peer_config_rsp()
780 UINT32_TO_STREAM (p, p_cfg->ext_flow_spec.flush_timeout); in l2cu_send_peer_config_rsp()
1969 UINT8 l2cu_process_peer_cfg_req (tL2C_CCB *p_ccb, tL2CAP_CFG_INFO *p_cfg) in l2cu_process_peer_cfg_req() argument
1978 if (!p_cfg->fcr_present) in l2cu_process_peer_cfg_req()
1979 p_cfg->fcr.mode = L2CAP_FCR_BASIC_MODE; in l2cu_process_peer_cfg_req()
1982 if (p_cfg->mtu_present) in l2cu_process_peer_cfg_req()
1985 if (p_cfg->mtu >= L2CAP_MIN_MTU) in l2cu_process_peer_cfg_req()
1988 if ( (p_cfg->fcr_present == FALSE) && (p_cfg->mtu > L2CAP_MTU_SIZE) ) in l2cu_process_peer_cfg_req()
1989 p_cfg->mtu = L2CAP_MTU_SIZE; in l2cu_process_peer_cfg_req()
1992 p_ccb->peer_cfg.mtu = p_cfg->mtu; in l2cu_process_peer_cfg_req()
1998 p_cfg->mtu = L2CAP_MIN_MTU; in l2cu_process_peer_cfg_req()
2005 p_cfg->mtu_present = TRUE; in l2cu_process_peer_cfg_req()
2006 p_cfg->mtu = p_ccb->peer_cfg.mtu; in l2cu_process_peer_cfg_req()
2010 if (p_cfg->flush_to_present) in l2cu_process_peer_cfg_req()
2012 if (!p_cfg->flush_to) in l2cu_process_peer_cfg_req()
2014 p_cfg->flush_to = 0xFFFF; /* Infinite retransmissions (spec default) */ in l2cu_process_peer_cfg_req()
2020 p_ccb->peer_cfg.flush_to = p_cfg->flush_to; in l2cu_process_peer_cfg_req()
2027 p_cfg->flush_to_present = TRUE; in l2cu_process_peer_cfg_req()
2028 p_cfg->flush_to = p_ccb->peer_cfg.flush_to; in l2cu_process_peer_cfg_req()
2032 if (p_cfg->qos_present) in l2cu_process_peer_cfg_req()
2037 if (p_cfg->qos.service_type <= GUARANTEED) in l2cu_process_peer_cfg_req()
2039 p_ccb->peer_cfg.qos = p_cfg->qos; in l2cu_process_peer_cfg_req()
2045 p_cfg->qos.service_type = BEST_EFFORT; in l2cu_process_peer_cfg_req()
2052 p_cfg->qos_present = TRUE; in l2cu_process_peer_cfg_req()
2053 p_cfg->qos = p_ccb->peer_cfg.qos; in l2cu_process_peer_cfg_req()
2056 if ((fcr_status = l2c_fcr_process_peer_cfg_req (p_ccb, p_cfg)) == L2CAP_PEER_CFG_DISCONNECT) in l2cu_process_peer_cfg_req()
2059 p_cfg->result = L2CAP_CFG_FAILED_NO_REASON; in l2cu_process_peer_cfg_req()
2060 p_cfg->mtu_present = p_cfg->qos_present = p_cfg->flush_to_present = 0; in l2cu_process_peer_cfg_req()
2075 p_cfg->result = L2CAP_CFG_UNACCEPTABLE_PARAMS; in l2cu_process_peer_cfg_req()
2078 p_cfg->mtu_present = FALSE; in l2cu_process_peer_cfg_req()
2080 p_cfg->flush_to_present = FALSE; in l2cu_process_peer_cfg_req()
2082 p_cfg->qos_present = FALSE; in l2cu_process_peer_cfg_req()
2084 p_cfg->fcr_present = FALSE; in l2cu_process_peer_cfg_req()
2102 void l2cu_process_peer_cfg_rsp (tL2C_CCB *p_ccb, tL2CAP_CFG_INFO *p_cfg) in l2cu_process_peer_cfg_rsp() argument
2105 if ( (p_cfg->qos_present) && (p_ccb->our_cfg.qos_present) ) in l2cu_process_peer_cfg_rsp()
2106 p_ccb->our_cfg.qos = p_cfg->qos; in l2cu_process_peer_cfg_rsp()
2108 if (p_cfg->fcr_present) in l2cu_process_peer_cfg_rsp()
2111 if (p_cfg->fcr.mode == L2CAP_FCR_ERTM_MODE) in l2cu_process_peer_cfg_rsp()
2113 p_ccb->peer_cfg.fcr.rtrans_tout = p_cfg->fcr.rtrans_tout; in l2cu_process_peer_cfg_rsp()
2114 p_ccb->peer_cfg.fcr.mon_tout = p_cfg->fcr.mon_tout; in l2cu_process_peer_cfg_rsp()
2118 if (p_cfg->fcr.tx_win_sz < p_ccb->our_cfg.fcr.tx_win_sz) in l2cu_process_peer_cfg_rsp()
2119 p_ccb->fcrb.max_held_acks = p_cfg->fcr.tx_win_sz / 3; in l2cu_process_peer_cfg_rsp()
2124 … p_cfg->fcr.tx_win_sz, p_ccb->our_cfg.fcr.tx_win_sz, p_ccb->fcrb.max_held_acks); in l2cu_process_peer_cfg_rsp()
2139 void l2cu_process_our_cfg_req (tL2C_CCB *p_ccb, tL2CAP_CFG_INFO *p_cfg) in l2cu_process_our_cfg_req() argument
2145 if (p_cfg->qos_present) in l2cu_process_our_cfg_req()
2148 p_ccb->our_cfg.qos = p_cfg->qos; in l2cu_process_our_cfg_req()
2151 if (p_cfg->fcr_present) in l2cu_process_our_cfg_req()
2154 if (p_cfg->fcr.mode == L2CAP_FCR_BASIC_MODE) in l2cu_process_our_cfg_req()
2155 memset(&p_cfg->fcr, 0, sizeof(tL2CAP_FCR_OPTS)); in l2cu_process_our_cfg_req()
2161 p_cfg->fcr.mon_tout = p_cfg->fcr.rtrans_tout = 0; in l2cu_process_our_cfg_req()
2163 if (p_cfg->fcr.mode == L2CAP_FCR_STREAM_MODE) in l2cu_process_our_cfg_req()
2164 p_cfg->fcr.max_transmit = p_cfg->fcr.tx_win_sz = 0; in l2cu_process_our_cfg_req()
2168 p_ccb->fcrb.max_held_acks = p_cfg->fcr.tx_win_sz / 3; in l2cu_process_our_cfg_req()
2174 if (p_cfg->fcs_present && p_cfg->fcs == L2CAP_CFG_FCS_BYPASS) in l2cu_process_our_cfg_req()
2178 p_cfg->fcs_present = FALSE; in l2cu_process_our_cfg_req()
2182 p_cfg->fcr.mode = L2CAP_FCR_BASIC_MODE; in l2cu_process_our_cfg_req()
2185 p_ccb->our_cfg.fcr.mode = p_cfg->fcr.mode; in l2cu_process_our_cfg_req()
2186 p_ccb->our_cfg.fcr_present = p_cfg->fcr_present; in l2cu_process_our_cfg_req()
2190 if (p_cfg->flush_to_present) in l2cu_process_our_cfg_req()
2192 if ((p_cfg->flush_to == 0)||(p_cfg->flush_to == L2CAP_NO_AUTOMATIC_FLUSH)) in l2cu_process_our_cfg_req()
2197 p_cfg->flush_to_present = FALSE; in l2cu_process_our_cfg_req()
2201 p_ccb->our_cfg.flush_to = p_cfg->flush_to; in l2cu_process_our_cfg_req()
2204 if (p_cfg->flush_to < p_lcb->link_flush_tout) in l2cu_process_our_cfg_req()
2206 p_lcb->link_flush_tout = p_cfg->flush_to; in l2cu_process_our_cfg_req()
2209 if (p_cfg->flush_to <= ((HCI_MAX_AUTO_FLUSH_TOUT * 5) / 8)) in l2cu_process_our_cfg_req()
2212 hci_flush_to = ((p_cfg->flush_to * 8) + 3) / 5; in l2cu_process_our_cfg_req()
2232 void l2cu_process_our_cfg_rsp (tL2C_CCB *p_ccb, tL2CAP_CFG_INFO *p_cfg) in l2cu_process_our_cfg_rsp() argument
2235 if ( (p_cfg->qos_present) && (p_ccb->peer_cfg.qos_present) ) in l2cu_process_our_cfg_rsp()
2236 p_ccb->peer_cfg.qos = p_cfg->qos; in l2cu_process_our_cfg_rsp()
2238 p_cfg->qos_present = FALSE; in l2cu_process_our_cfg_rsp()
2240 l2c_fcr_adj_our_rsp_options (p_ccb, p_cfg); in l2cu_process_our_cfg_rsp()