Lines Matching refs:params

56 static bool valid_cl_cte_rx_params(const struct bt_df_per_adv_sync_cte_rx_param *params);
59 const struct bt_df_per_adv_sync_cte_rx_param *params,
62 const struct bt_df_per_adv_sync_cte_rx_param *params);
67 const struct bt_df_conn_cte_rx_param *params,
70 const struct bt_df_conn_cte_rx_param *params);
89 const struct bt_df_adv_cte_tx_param *params) in hci_df_set_cl_cte_tx_params() argument
97 if (params->cte_type == BT_DF_CTE_TYPE_AOD_1US || in hci_df_set_cl_cte_tx_params()
98 params->cte_type == BT_DF_CTE_TYPE_AOD_2US) { in hci_df_set_cl_cte_tx_params()
103 if (params->cte_type == BT_DF_CTE_TYPE_AOD_1US && in hci_df_set_cl_cte_tx_params()
108 if (params->num_ant_ids < BT_HCI_LE_SWITCH_PATTERN_LEN_MIN || in hci_df_set_cl_cte_tx_params()
109 params->num_ant_ids > BT_HCI_LE_SWITCH_PATTERN_LEN_MAX || in hci_df_set_cl_cte_tx_params()
110 !params->ant_ids) { in hci_df_set_cl_cte_tx_params()
113 } else if (params->cte_type != BT_DF_CTE_TYPE_AOA) { in hci_df_set_cl_cte_tx_params()
117 if (params->cte_len < BT_HCI_LE_CTE_LEN_MIN || in hci_df_set_cl_cte_tx_params()
118 params->cte_len > BT_HCI_LE_CTE_LEN_MAX) { in hci_df_set_cl_cte_tx_params()
122 if (params->cte_count < BT_HCI_LE_CTE_COUNT_MIN || in hci_df_set_cl_cte_tx_params()
123 params->cte_count > BT_HCI_LE_CTE_COUNT_MAX) { in hci_df_set_cl_cte_tx_params()
128 sizeof(*cp) + params->num_ant_ids); in hci_df_set_cl_cte_tx_params()
135 cp->cte_len = params->cte_len; in hci_df_set_cl_cte_tx_params()
136 cp->cte_type = get_hci_cte_type(params->cte_type); in hci_df_set_cl_cte_tx_params()
137 cp->cte_count = params->cte_count; in hci_df_set_cl_cte_tx_params()
139 if (params->num_ant_ids) { in hci_df_set_cl_cte_tx_params()
140 uint8_t *dest_ant_ids = net_buf_add(buf, params->num_ant_ids); in hci_df_set_cl_cte_tx_params()
142 memcpy(dest_ant_ids, params->ant_ids, params->num_ant_ids); in hci_df_set_cl_cte_tx_params()
143 cp->switch_pattern_len = params->num_ant_ids; in hci_df_set_cl_cte_tx_params()
263 static bool valid_cl_cte_rx_params(const struct bt_df_per_adv_sync_cte_rx_param *params) in valid_cl_cte_rx_params() argument
265 if (params->max_cte_count > BT_HCI_LE_SAMPLE_CTE_COUNT_MAX) { in valid_cl_cte_rx_params()
269 if (params->cte_types & BT_DF_CTE_TYPE_AOA) { in valid_cl_cte_rx_params()
270 return valid_cte_rx_common_params(params->cte_types, params->slot_durations, in valid_cl_cte_rx_params()
271 params->num_ant_ids, params->ant_ids); in valid_cl_cte_rx_params()
279 const struct bt_df_per_adv_sync_cte_rx_param *params, in prepare_cl_cte_rx_enable_cmd_params() argument
285 if (params->cte_types & BT_DF_CTE_TYPE_AOA) { in prepare_cl_cte_rx_enable_cmd_params()
286 switch_pattern_len = params->num_ant_ids; in prepare_cl_cte_rx_enable_cmd_params()
311 cp->max_sampled_cte = params->max_cte_count; in prepare_cl_cte_rx_enable_cmd_params()
313 if (params->cte_types & BT_DF_CTE_TYPE_AOA) { in prepare_cl_cte_rx_enable_cmd_params()
314 cp->slot_durations = params->slot_durations; in prepare_cl_cte_rx_enable_cmd_params()
315 ant_ids = params->ant_ids; in prepare_cl_cte_rx_enable_cmd_params()
335 const struct bt_df_per_adv_sync_cte_rx_param *params) in hci_df_set_cl_cte_rx_enable() argument
343 if (!valid_cl_cte_rx_params(params)) { in hci_df_set_cl_cte_rx_enable()
348 err = prepare_cl_cte_rx_enable_cmd_params(&buf, sync, params, enable); in hci_df_set_cl_cte_rx_enable()
364 sync->cte_types = (enable ? params->cte_types : 0); in hci_df_set_cl_cte_rx_enable()
470 static bool valid_conn_cte_tx_params(const struct bt_df_conn_cte_tx_param *params) in valid_conn_cte_tx_params() argument
472 if (!(params->cte_types & BT_DF_CTE_TYPE_ALL)) { in valid_conn_cte_tx_params()
479 if ((params->cte_types & BT_DF_CTE_TYPE_AOD_1US || in valid_conn_cte_tx_params()
480 params->cte_types & BT_DF_CTE_TYPE_AOD_1US) && in valid_conn_cte_tx_params()
481 (params->num_ant_ids < BT_HCI_LE_SWITCH_PATTERN_LEN_MIN || in valid_conn_cte_tx_params()
482 params->num_ant_ids > BT_HCI_LE_SWITCH_PATTERN_LEN_MAX || !params->ant_ids || in valid_conn_cte_tx_params()
491 const struct bt_df_conn_cte_tx_param *params) in prepare_conn_cte_tx_params_cmd() argument
500 cp->cte_types = params->cte_types; in prepare_conn_cte_tx_params_cmd()
502 if (params->cte_types & (BT_DF_CTE_TYPE_AOD_1US | BT_DF_CTE_TYPE_AOD_2US)) { in prepare_conn_cte_tx_params_cmd()
503 cp->switch_pattern_len = params->num_ant_ids; in prepare_conn_cte_tx_params_cmd()
506 (void)memcpy(ant_ids, params->ant_ids, cp->switch_pattern_len); in prepare_conn_cte_tx_params_cmd()
521 const struct bt_df_conn_cte_tx_param *params) in hci_df_set_conn_cte_tx_param() argument
532 if (!valid_conn_cte_tx_params(params)) { in hci_df_set_conn_cte_tx_param()
536 num_ant_ids = ((params->cte_types & (BT_DF_CTE_TYPE_AOD_1US | BT_DF_CTE_TYPE_AOD_2US)) ? in hci_df_set_conn_cte_tx_param()
537 params->num_ant_ids : 0); in hci_df_set_conn_cte_tx_param()
545 prepare_conn_cte_tx_params_cmd(buf, conn, params); in hci_df_set_conn_cte_tx_param()
570 const struct bt_df_conn_cte_rx_param *params, in prepare_conn_cte_rx_enable_cmd_params() argument
576 if (params->cte_types & BT_DF_CTE_TYPE_AOA) { in prepare_conn_cte_rx_enable_cmd_params()
577 switch_pattern_len = params->num_ant_ids; in prepare_conn_cte_rx_enable_cmd_params()
602 if (params->cte_types & BT_DF_CTE_TYPE_AOA) { in prepare_conn_cte_rx_enable_cmd_params()
603 cp->slot_durations = params->slot_durations; in prepare_conn_cte_rx_enable_cmd_params()
604 ant_ids = params->ant_ids; in prepare_conn_cte_rx_enable_cmd_params()
626 const struct bt_df_conn_cte_rx_param *params) in hci_df_set_conn_cte_rx_enable() argument
634 if (!valid_cte_rx_common_params(params->cte_types, params->slot_durations, in hci_df_set_conn_cte_rx_enable()
635 params->num_ant_ids, params->ant_ids)) { in hci_df_set_conn_cte_rx_enable()
640 err = prepare_conn_cte_rx_enable_cmd_params(&buf, conn, params, enable); in hci_df_set_conn_cte_rx_enable()
656 conn->cte_types = (enable ? params->cte_types : 0); in hci_df_set_conn_cte_rx_enable()
791 const struct bt_df_conn_cte_req_params *params, in prepare_conn_cte_req_enable_cmd_params() argument
803 cp->cte_request_interval = params->interval; in prepare_conn_cte_req_enable_cmd_params()
804 cp->requested_cte_length = sys_cpu_to_le16(params->cte_length); in prepare_conn_cte_req_enable_cmd_params()
805 cp->requested_cte_type = get_hci_cte_type(params->cte_type); in prepare_conn_cte_req_enable_cmd_params()
810 const struct bt_df_conn_cte_req_params *params) in hci_df_set_conn_cte_req_enable() argument
817 if (enable && !valid_cte_req_params(conn, params->cte_type, params->cte_length)) { in hci_df_set_conn_cte_req_enable()
827 prepare_conn_cte_req_enable_cmd_params(buf, conn, params, enable); in hci_df_set_conn_cte_req_enable()
961 const struct bt_df_adv_cte_tx_param *params) in bt_df_set_adv_cte_tx_param() argument
964 __ASSERT_NO_MSG(params); in bt_df_set_adv_cte_tx_param()
983 err = hci_df_set_cl_cte_tx_params(adv, params); in bt_df_set_adv_cte_tx_param()
1025 const struct bt_df_per_adv_sync_cte_rx_param *params) in bt_df_set_per_adv_sync_cte_rx_enable() argument
1040 return hci_df_set_cl_cte_rx_enable(sync, enable, params); in bt_df_set_per_adv_sync_cte_rx_enable()
1044 const struct bt_df_per_adv_sync_cte_rx_param *params) in bt_df_per_adv_sync_cte_rx_enable() argument
1049 CHECKIF(!params) { in bt_df_per_adv_sync_cte_rx_enable()
1053 return bt_df_set_per_adv_sync_cte_rx_enable(sync, true, params); in bt_df_per_adv_sync_cte_rx_enable()
1068 const struct bt_df_conn_cte_rx_param *params) in bt_df_set_conn_cte_rx_enable() argument
1080 return hci_df_set_conn_cte_rx_enable(conn, enable, params); in bt_df_set_conn_cte_rx_enable()
1083 int bt_df_conn_cte_rx_enable(struct bt_conn *conn, const struct bt_df_conn_cte_rx_param *params) in bt_df_conn_cte_rx_enable() argument
1089 CHECKIF(!params) { in bt_df_conn_cte_rx_enable()
1093 return bt_df_set_conn_cte_rx_enable(conn, true, params); in bt_df_conn_cte_rx_enable()
1107 int bt_df_set_conn_cte_tx_param(struct bt_conn *conn, const struct bt_df_conn_cte_tx_param *params) in bt_df_set_conn_cte_tx_param() argument
1113 CHECKIF(!params) { in bt_df_set_conn_cte_tx_param()
1127 return hci_df_set_conn_cte_tx_param(conn, params); in bt_df_set_conn_cte_tx_param()
1134 const struct bt_df_conn_cte_req_params *params) in bt_df_set_conn_cte_req_enable() argument
1151 return hci_df_set_conn_cte_req_enable(conn, enable, params); in bt_df_set_conn_cte_req_enable()
1154 int bt_df_conn_cte_req_enable(struct bt_conn *conn, const struct bt_df_conn_cte_req_params *params) in bt_df_conn_cte_req_enable() argument
1160 CHECKIF(!params) { in bt_df_conn_cte_req_enable()
1164 return bt_df_set_conn_cte_req_enable(conn, true, params); in bt_df_conn_cte_req_enable()