Commit dfe05dd0 authored by Pavel Vasilyev's avatar Pavel Vasilyev Committed by Benjamin Cabé
Browse files

bluetooth: host: prefix API functions with bt_

Prefix API functions of a module with bt_ to avoid confusion when
reading code.

Signed-off-by: default avatarPavel Vasilyev <pavel.vasilyev@nordicsemi.no>
parent c21e613f
Loading
Loading
Loading
Loading
+18 −18
Changes for subsys/bluetooth/host/conn.c: 18 added lines, 18 removed lines.
Original line number Diff line number Diff line
@@ -1932,7 +1932,7 @@ static void notify_disconnected(struct bt_conn *conn)
}

#if defined(CONFIG_BT_REMOTE_INFO)
void notify_remote_info(struct bt_conn *conn)
void bt_conn_notify_remote_info(struct bt_conn *conn)
{
	struct bt_conn_remote_info remote_info;
	int err;
@@ -1957,7 +1957,7 @@ void notify_remote_info(struct bt_conn *conn)
}
#endif /* defined(CONFIG_BT_REMOTE_INFO) */

void notify_le_param_updated(struct bt_conn *conn)
void bt_conn_notify_le_param_updated(struct bt_conn *conn)
{
	/* If new connection parameters meet requirement of pending
	 * parameters don't send peripheral conn param request anymore on timeout
@@ -1988,7 +1988,7 @@ void notify_le_param_updated(struct bt_conn *conn)
}

#if defined(CONFIG_BT_USER_DATA_LEN_UPDATE)
void notify_le_data_len_updated(struct bt_conn *conn)
void bt_conn_notify_le_data_len_updated(struct bt_conn *conn)
{
	BT_CONN_CB_DYNAMIC_FOREACH(callback) {
		if (callback->le_data_len_updated) {
@@ -2005,7 +2005,7 @@ void notify_le_data_len_updated(struct bt_conn *conn)
#endif

#if defined(CONFIG_BT_USER_PHY_UPDATE)
void notify_le_phy_updated(struct bt_conn *conn)
void bt_conn_notify_le_phy_updated(struct bt_conn *conn)
{
	BT_CONN_CB_DYNAMIC_FOREACH(callback) {
		if (callback->le_phy_updated) {
@@ -2021,7 +2021,7 @@ void notify_le_phy_updated(struct bt_conn *conn)
}
#endif

bool le_param_req(struct bt_conn *conn, struct bt_le_conn_param *param)
bool bt_conn_le_param_req(struct bt_conn *conn, struct bt_le_conn_param *param)
{
	if (!bt_le_conn_params_valid(param)) {
		return false;
@@ -2979,8 +2979,7 @@ static int bt_conn_get_tx_power_level(struct bt_conn *conn, uint8_t type,
}

#if defined(CONFIG_BT_TRANSMIT_POWER_CONTROL)
void notify_tx_power_report(struct bt_conn *conn,
			    struct bt_conn_le_tx_power_report report)
void bt_conn_notify_tx_power_report(struct bt_conn *conn, struct bt_conn_le_tx_power_report report)
{
	BT_CONN_CB_DYNAMIC_FOREACH(callback) {
		if (callback->tx_power_report) {
@@ -3122,7 +3121,7 @@ int bt_conn_le_get_tx_power_level(struct bt_conn *conn,
}

#if defined(CONFIG_BT_PATH_LOSS_MONITORING)
void notify_path_loss_threshold_report(struct bt_conn *conn,
void bt_conn_notify_path_loss_threshold_report(struct bt_conn *conn,
					       struct bt_conn_le_path_loss_threshold_report report)
{
	BT_CONN_CB_DYNAMIC_FOREACH(callback) {
@@ -3191,7 +3190,7 @@ int bt_conn_le_set_path_loss_mon_enable(struct bt_conn *conn, bool reporting_ena
#endif /* CONFIG_BT_PATH_LOSS_MONITORING */

#if defined(CONFIG_BT_SUBRATING)
void notify_subrate_change(struct bt_conn *conn,
void bt_conn_notify_subrate_change(struct bt_conn *conn,
				   const struct bt_conn_le_subrate_changed params)
{
	BT_CONN_CB_DYNAMIC_FOREACH(callback) {
@@ -3297,7 +3296,7 @@ int bt_conn_le_subrate_request(struct bt_conn *conn,
#endif /* CONFIG_BT_SUBRATING */

#if defined(CONFIG_BT_LE_EXTENDED_FEAT_SET)
void notify_read_all_remote_feat_complete(struct bt_conn *conn,
void bt_conn_notify_read_all_remote_feat_complete(struct bt_conn *conn,
					struct bt_conn_le_read_all_remote_feat_complete *params)
{
	BT_CONN_CB_DYNAMIC_FOREACH(callback) {
@@ -3342,7 +3341,7 @@ int bt_conn_le_read_all_remote_features(struct bt_conn *conn, uint8_t pages_requ
#endif /* CONFIG_BT_LE_EXTENDED_FEAT_SET */

#if defined(CONFIG_BT_FRAME_SPACE_UPDATE)
void notify_frame_space_update_complete(struct bt_conn *conn,
void bt_conn_notify_frame_space_update_complete(struct bt_conn *conn,
						struct bt_conn_le_frame_space_updated *params)
{
	if (IS_ENABLED(CONFIG_BT_CONN_DYNAMIC_CALLBACKS)) {
@@ -3414,7 +3413,7 @@ int bt_conn_le_frame_space_update(struct bt_conn *conn,
#endif /* CONFIG_BT_FRAME_SPACE_UPDATE */

#if defined(CONFIG_BT_CHANNEL_SOUNDING)
void notify_remote_cs_capabilities(struct bt_conn *conn, uint8_t status,
void bt_conn_notify_remote_cs_capabilities(struct bt_conn *conn, uint8_t status,
					   struct bt_conn_le_cs_capabilities *params)
{
	BT_CONN_CB_DYNAMIC_FOREACH(callback) {
@@ -3431,7 +3430,7 @@ void notify_remote_cs_capabilities(struct bt_conn *conn, uint8_t status,
	}
}

void notify_remote_cs_fae_table(struct bt_conn *conn, uint8_t status,
void bt_conn_notify_remote_cs_fae_table(struct bt_conn *conn, uint8_t status,
					struct bt_conn_le_cs_fae_table *params)
{
	BT_CONN_CB_DYNAMIC_FOREACH(callback) {
@@ -3448,7 +3447,7 @@ void notify_remote_cs_fae_table(struct bt_conn *conn, uint8_t status,
	}
}

void notify_cs_config_created(struct bt_conn *conn, uint8_t status,
void bt_conn_notify_cs_config_created(struct bt_conn *conn, uint8_t status,
				      struct bt_conn_le_cs_config *params)
{
	BT_CONN_CB_DYNAMIC_FOREACH(callback) {
@@ -3464,7 +3463,7 @@ void notify_cs_config_created(struct bt_conn *conn, uint8_t status,
	}
}

void notify_cs_config_removed(struct bt_conn *conn, uint8_t config_id)
void bt_conn_notify_cs_config_removed(struct bt_conn *conn, uint8_t config_id)
{
	BT_CONN_CB_DYNAMIC_FOREACH(callback) {
		if (callback->le_cs_config_removed) {
@@ -3479,7 +3478,7 @@ void notify_cs_config_removed(struct bt_conn *conn, uint8_t config_id)
	}
}

void notify_cs_security_enable_available(struct bt_conn *conn, uint8_t status)
void bt_conn_notify_cs_security_enable_available(struct bt_conn *conn, uint8_t status)
{
	BT_CONN_CB_DYNAMIC_FOREACH(callback) {
		if (callback->le_cs_security_enable_complete) {
@@ -3494,7 +3493,7 @@ void notify_cs_security_enable_available(struct bt_conn *conn, uint8_t status)
	}
}

void notify_cs_procedure_enable_available(struct bt_conn *conn, uint8_t status,
void bt_conn_notify_cs_procedure_enable_available(struct bt_conn *conn, uint8_t status,
					struct bt_conn_le_cs_procedure_enable_complete *params)
{
	BT_CONN_CB_DYNAMIC_FOREACH(callback) {
@@ -3510,7 +3509,8 @@ void notify_cs_procedure_enable_available(struct bt_conn *conn, uint8_t status,
	}
}

void notify_cs_subevent_result(struct bt_conn *conn, struct bt_conn_le_cs_subevent_result *result)
void bt_conn_notify_cs_subevent_result(struct bt_conn *conn,
				       struct bt_conn_le_cs_subevent_result *result)
{
	BT_CONN_CB_DYNAMIC_FOREACH(callback) {
		if (callback->le_cs_subevent_data_available) {
+18 −23
Changes for subsys/bluetooth/host/conn_internal.h: 18 added lines, 23 removed lines.
Original line number Diff line number Diff line
@@ -477,51 +477,46 @@ void bt_conn_role_changed(struct bt_conn *conn, uint8_t status);
int bt_conn_le_conn_update(struct bt_conn *conn,
			   const struct bt_le_conn_param *param);

void notify_remote_info(struct bt_conn *conn);
void bt_conn_notify_remote_info(struct bt_conn *conn);

void notify_le_param_updated(struct bt_conn *conn);
void bt_conn_notify_le_param_updated(struct bt_conn *conn);

void notify_le_data_len_updated(struct bt_conn *conn);
void bt_conn_notify_le_data_len_updated(struct bt_conn *conn);

void notify_le_phy_updated(struct bt_conn *conn);
void bt_conn_notify_le_phy_updated(struct bt_conn *conn);

bool le_param_req(struct bt_conn *conn, struct bt_le_conn_param *param);
bool bt_conn_le_param_req(struct bt_conn *conn, struct bt_le_conn_param *param);

void notify_tx_power_report(struct bt_conn *conn,
			    struct bt_conn_le_tx_power_report report);
void bt_conn_notify_tx_power_report(struct bt_conn *conn, struct bt_conn_le_tx_power_report report);

void notify_path_loss_threshold_report(struct bt_conn *conn,
void bt_conn_notify_path_loss_threshold_report(struct bt_conn *conn,
					       struct bt_conn_le_path_loss_threshold_report report);

void notify_subrate_change(struct bt_conn *conn,
			   struct bt_conn_le_subrate_changed params);
void bt_conn_notify_subrate_change(struct bt_conn *conn, struct bt_conn_le_subrate_changed params);

void notify_read_all_remote_feat_complete(struct bt_conn *conn,
void bt_conn_notify_read_all_remote_feat_complete(struct bt_conn *conn,
					struct bt_conn_le_read_all_remote_feat_complete *params);

void notify_frame_space_update_complete(struct bt_conn *conn,
void bt_conn_notify_frame_space_update_complete(struct bt_conn *conn,
						struct bt_conn_le_frame_space_updated *params);

void notify_remote_cs_capabilities(struct bt_conn *conn,
				   uint8_t status,
void bt_conn_notify_remote_cs_capabilities(struct bt_conn *conn, uint8_t status,
					  struct bt_conn_le_cs_capabilities *params);

void notify_remote_cs_fae_table(struct bt_conn *conn,
				uint8_t status,
void bt_conn_notify_remote_cs_fae_table(struct bt_conn *conn, uint8_t status,
					struct bt_conn_le_cs_fae_table *params);

void notify_cs_config_created(struct bt_conn *conn,
			      uint8_t status,
void bt_conn_notify_cs_config_created(struct bt_conn *conn, uint8_t status,
				      struct bt_conn_le_cs_config *params);

void notify_cs_config_removed(struct bt_conn *conn, uint8_t config_id);
void bt_conn_notify_cs_config_removed(struct bt_conn *conn, uint8_t config_id);

void notify_cs_subevent_result(struct bt_conn *conn, struct bt_conn_le_cs_subevent_result *result);
void bt_conn_notify_cs_subevent_result(struct bt_conn *conn,
				       struct bt_conn_le_cs_subevent_result *result);

void notify_cs_security_enable_available(struct bt_conn *conn, uint8_t status);
void bt_conn_notify_cs_security_enable_available(struct bt_conn *conn, uint8_t status);

void notify_cs_procedure_enable_available(struct bt_conn *conn,
					  uint8_t status,
void bt_conn_notify_cs_procedure_enable_available(struct bt_conn *conn, uint8_t status,
					struct bt_conn_le_cs_procedure_enable_complete *params);

/* If role specific LTK is present */
+12 −11
Changes for subsys/bluetooth/host/cs.c: 12 added lines, 11 removed lines.
Original line number Diff line number Diff line
@@ -244,7 +244,7 @@ static void invoke_subevent_result_callback(struct bt_conn *conn,
	} else
#endif /* CONFIG_BT_CHANNEL_SOUNDING_TEST */
	{
		notify_cs_subevent_result(conn, p_result);
		bt_conn_notify_cs_subevent_result(conn, p_result);
	}
}

@@ -425,9 +425,10 @@ void bt_hci_le_cs_read_remote_supported_capabilities_complete(struct net_buf *bu
		remote_cs_capabilities.t_sw_time = evt->t_sw_time_supported;
		remote_cs_capabilities.tx_snr_capability = evt->tx_snr_capability;

		notify_remote_cs_capabilities(conn, BT_HCI_ERR_SUCCESS, &remote_cs_capabilities);
		bt_conn_notify_remote_cs_capabilities(conn, BT_HCI_ERR_SUCCESS,
						      &remote_cs_capabilities);
	} else {
		notify_remote_cs_capabilities(conn, evt->status, NULL);
		bt_conn_notify_remote_cs_capabilities(conn, evt->status, NULL);
	}

	bt_conn_unref(conn);
@@ -502,9 +503,9 @@ void bt_hci_le_cs_read_remote_fae_table_complete(struct net_buf *buf)
	if (evt->status == BT_HCI_ERR_SUCCESS) {
		fae_table.remote_fae_table = evt->remote_fae_table;

		notify_remote_cs_fae_table(conn, BT_HCI_ERR_SUCCESS, &fae_table);
		bt_conn_notify_remote_cs_fae_table(conn, BT_HCI_ERR_SUCCESS, &fae_table);
	} else {
		notify_remote_cs_fae_table(conn, evt->status, NULL);
		bt_conn_notify_remote_cs_fae_table(conn, evt->status, NULL);
	}

	bt_conn_unref(conn);
@@ -853,7 +854,7 @@ void bt_hci_le_cs_config_complete_event(struct net_buf *buf)

	if (evt->status == BT_HCI_ERR_SUCCESS) {
		if (evt->action == BT_HCI_LE_CS_CONFIG_ACTION_REMOVED) {
			notify_cs_config_removed(conn, evt->config_id);
			bt_conn_notify_cs_config_removed(conn, evt->config_id);
			bt_conn_unref(conn);
			return;
		}
@@ -882,9 +883,9 @@ void bt_hci_le_cs_config_complete_event(struct net_buf *buf)
		config.t_pm_time_us = evt->t_pm_time;
		memcpy(config.channel_map, evt->channel_map, ARRAY_SIZE(config.channel_map));

		notify_cs_config_created(conn, BT_HCI_ERR_SUCCESS, &config);
		bt_conn_notify_cs_config_created(conn, BT_HCI_ERR_SUCCESS, &config);
	} else {
		notify_cs_config_created(conn, evt->status, NULL);
		bt_conn_notify_cs_config_created(conn, evt->status, NULL);
	}

	bt_conn_unref(conn);
@@ -1263,7 +1264,7 @@ void bt_hci_le_cs_security_enable_complete(struct net_buf *buf)
		return;
	}

	notify_cs_security_enable_available(conn, evt->status);
	bt_conn_notify_cs_security_enable_available(conn, evt->status);

	bt_conn_unref(conn);
}
@@ -1313,9 +1314,9 @@ void bt_hci_le_cs_procedure_enable_complete(struct net_buf *buf)
		params.procedure_count = sys_le16_to_cpu(evt->procedure_count);
		params.max_procedure_len = sys_le16_to_cpu(evt->max_procedure_len);

		notify_cs_procedure_enable_available(conn, BT_HCI_ERR_SUCCESS, &params);
		bt_conn_notify_cs_procedure_enable_available(conn, BT_HCI_ERR_SUCCESS, &params);
	} else {
		notify_cs_procedure_enable_available(conn, evt->status, NULL);
		bt_conn_notify_cs_procedure_enable_available(conn, evt->status, NULL);
	}

	bt_conn_unref(conn);
+11 −11
Changes for subsys/bluetooth/host/hci_core.c: 11 added lines, 11 removed lines.
Original line number Diff line number Diff line
@@ -1800,7 +1800,7 @@ static void le_remote_feat_complete(struct net_buf *buf)
	if (IS_ENABLED(CONFIG_BT_REMOTE_INFO) &&
	    (!IS_ENABLED(CONFIG_BT_REMOTE_VERSION) ||
	     atomic_test_bit(conn->flags, BT_CONN_AUTO_VERSION_INFO))) {
		notify_remote_info(conn);
		bt_conn_notify_remote_info(conn);
	}

	bt_conn_unref(conn);
@@ -1831,7 +1831,7 @@ static void le_read_all_remote_feat_complete(struct net_buf *buf)
		params.features = evt->features;
	}

	notify_read_all_remote_feat_complete(conn, &params);
	bt_conn_notify_read_all_remote_feat_complete(conn, &params);

	bt_conn_unref(conn);
}
@@ -1860,7 +1860,7 @@ static void le_frame_space_update_complete(struct net_buf *buf)
		params.initiator = evt->initiator;
	}

	notify_frame_space_update_complete(conn, &params);
	bt_conn_notify_frame_space_update_complete(conn, &params);
}
#endif /* CONFIG_BT_FRAME_SPACE_UPDATE */

@@ -1903,7 +1903,7 @@ static void le_data_len_change(struct net_buf *buf)
	conn->le.data_len.tx_max_time = max_tx_time;
	conn->le.data_len.rx_max_len = max_rx_octets;
	conn->le.data_len.rx_max_time = max_rx_time;
	notify_le_data_len_updated(conn);
	bt_conn_notify_le_data_len_updated(conn);
#endif

	bt_conn_unref(conn);
@@ -1930,7 +1930,7 @@ static void le_phy_update_complete(struct net_buf *buf)
#if defined(CONFIG_BT_USER_PHY_UPDATE)
	conn->le.phy.tx_phy = bt_get_phy(evt->tx_phy);
	conn->le.phy.rx_phy = bt_get_phy(evt->rx_phy);
	notify_le_phy_updated(conn);
	bt_conn_notify_le_phy_updated(conn);
#endif

	bt_conn_unref(conn);
@@ -2024,7 +2024,7 @@ static void le_conn_param_req(struct net_buf *buf)
		return;
	}

	if (!le_param_req(conn, &param)) {
	if (!bt_conn_le_param_req(conn, &param)) {
		le_conn_param_neg_reply(handle, BT_HCI_ERR_INVALID_LL_PARAM);
	} else {
		le_conn_param_req_reply(handle, &param);
@@ -2103,7 +2103,7 @@ static void le_conn_update_complete(struct net_buf *buf)

		}

		notify_le_param_updated(conn);
		bt_conn_notify_le_param_updated(conn);
	}

	bt_conn_unref(conn);
@@ -2440,7 +2440,7 @@ static void bt_hci_evt_read_remote_version_complete(struct net_buf *buf)
	if (IS_ENABLED(CONFIG_BT_REMOTE_INFO) &&
	    atomic_test_bit(conn->flags, BT_CONN_LE_FEATURES_EXCHANGED)) {
		/* Remote features is already present */
		notify_remote_info(conn);
		bt_conn_notify_remote_info(conn);
	}

	bt_conn_unref(conn);
@@ -2714,7 +2714,7 @@ void bt_hci_le_transmit_power_report(struct net_buf *buf)
	report.tx_power_level_flag = evt->tx_power_level_flag;
	report.delta = evt->delta;

	notify_tx_power_report(conn, report);
	bt_conn_notify_tx_power_report(conn, report);

	bt_conn_unref(conn);
}
@@ -2750,7 +2750,7 @@ void bt_hci_le_path_loss_threshold_event(struct net_buf *buf)
		report.path_loss = evt->current_path_loss;
	}

	notify_path_loss_threshold_report(conn, report);
	bt_conn_notify_path_loss_threshold_report(conn, report);

	bt_conn_unref(conn);
}
@@ -2806,7 +2806,7 @@ void bt_hci_le_subrate_change_event(struct net_buf *buf)
	params.peripheral_latency = conn->le.latency;
	params.supervision_timeout = conn->le.timeout;

	notify_subrate_change(conn, params);
	bt_conn_notify_subrate_change(conn, params);

	bt_conn_unref(conn);
}
+1 −1
Changes for subsys/bluetooth/host/l2cap.c: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -1132,7 +1132,7 @@ static void le_conn_param_update_req(struct bt_l2cap *l2cap, uint8_t ident,
		return;
	}

	accepted = le_param_req(conn, &param);
	accepted = bt_conn_le_param_req(conn, &param);

	rsp = net_buf_add(buf, sizeof(*rsp));
	if (accepted) {
Loading