Diff between 06c9a191372ff943115465121e821ab9dd48c8f9 and 4ead1cb1ecea705367c1b716bb7bd5538f0b49dd

Changed Files

File Additions Deletions Status
emulator/bthost.c +17 -17 modified
emulator/bthost.h +3 -4 modified
tools/rfcomm-tester.c +2 -2 modified

Full Patch

diff --git a/emulator/bthost.c b/emulator/bthost.c
index 92c63cd..2d94d19 100644
--- a/emulator/bthost.c
+++ b/emulator/bthost.c
@@ -126,11 +126,11 @@ struct cid_hook {
 	struct cid_hook *next;
 };
 
-struct rfcomm_channel_hook {
+struct rfcomm_chan_hook {
 	uint8_t channel;
-	bthost_rfcomm_channel_hook_func_t func;
+	bthost_rfcomm_chan_hook_func_t func;
 	void *user_data;
-	struct rfcomm_channel_hook *next;
+	struct rfcomm_chan_hook *next;
 };
 
 struct btconn {
@@ -142,7 +142,7 @@ struct btconn {
 	struct l2conn *l2conns;
 	struct rcconn *rcconns;
 	struct cid_hook *cid_hooks;
-	struct rfcomm_channel_hook *rfcomm_channel_hooks;
+	struct rfcomm_chan_hook *rfcomm_chan_hooks;
 	struct btconn *next;
 	void *smp_data;
 };
@@ -255,10 +255,10 @@ static void btconn_free(struct btconn *conn)
 		free(rcconn);
 	}
 
-	while (conn->rfcomm_channel_hooks) {
-		struct rfcomm_channel_hook *hook = conn->rfcomm_channel_hooks;
+	while (conn->rfcomm_chan_hooks) {
+		struct rfcomm_chan_hook *hook = conn->rfcomm_chan_hooks;
 
-		conn->rfcomm_channel_hooks = hook->next;
+		conn->rfcomm_chan_hooks = hook->next;
 		free(hook);
 	}
 
@@ -1611,12 +1611,12 @@ static struct cid_hook *find_cid_hook(struct btconn *conn, uint16_t cid)
 	return NULL;
 }
 
-static struct rfcomm_channel_hook *find_rfcomm_channel_hook(struct btconn *conn,
+static struct rfcomm_chan_hook *find_rfcomm_chan_hook(struct btconn *conn,
 							uint16_t channel)
 {
-	struct rfcomm_channel_hook *hook;
+	struct rfcomm_chan_hook *hook;
 
-	for (hook = conn->rfcomm_channel_hooks; hook != NULL; hook = hook->next)
+	for (hook = conn->rfcomm_chan_hooks; hook != NULL; hook = hook->next)
 		if (hook->channel == channel)
 			return hook;
 
@@ -1892,9 +1892,9 @@ static void rfcomm_uih_recv(struct bthost *bthost, struct btconn *conn,
 	p = data + hdr_len;
 
 	if (RFCOMM_GET_DLCI(hdr->address)) {
-		struct rfcomm_channel_hook *hook;
+		struct rfcomm_chan_hook *hook;
 
-		hook = find_rfcomm_channel_hook(conn,
+		hook = find_rfcomm_chan_hook(conn,
 					RFCOMM_GET_CHANNEL(hdr->address));
 		if (!hook)
 			return;
@@ -2201,12 +2201,12 @@ bool bthost_connect_rfcomm(struct bthost *bthost, uint16_t handle,
 					&req, sizeof(req), NULL, NULL);
 }
 
-void bthost_add_rfcomm_channel_hook(struct bthost *bthost, uint16_t handle,
+void bthost_add_rfcomm_chan_hook(struct bthost *bthost, uint16_t handle,
 					uint8_t channel,
-					bthost_rfcomm_channel_hook_func_t func,
+					bthost_rfcomm_chan_hook_func_t func,
 					void *user_data)
 {
-	struct rfcomm_channel_hook *hook;
+	struct rfcomm_chan_hook *hook;
 	struct btconn *conn;
 
 	conn = bthost_find_conn(bthost, handle);
@@ -2223,8 +2223,8 @@ void bthost_add_rfcomm_channel_hook(struct bthost *bthost, uint16_t handle,
 	hook->func = func;
 	hook->user_data = user_data;
 
-	hook->next = conn->rfcomm_channel_hooks;
-	conn->rfcomm_channel_hooks = hook;
+	hook->next = conn->rfcomm_chan_hooks;
+	conn->rfcomm_chan_hooks = hook;
 }
 
 void bthost_send_rfcomm_data(struct bthost *bthost, uint16_t handle,
diff --git a/emulator/bthost.h b/emulator/bthost.h
index 0d4594f..5048094 100644
--- a/emulator/bthost.h
+++ b/emulator/bthost.h
@@ -99,13 +99,12 @@ bool bthost_connect_rfcomm(struct bthost *bthost, uint16_t handle,
 				uint8_t channel, bthost_rfcomm_connect_cb func,
 				void *user_data);
 
-typedef void (*bthost_rfcomm_channel_hook_func_t) (const void *data,
-							uint16_t len,
+typedef void (*bthost_rfcomm_chan_hook_func_t) (const void *data, uint16_t len,
 							void *user_data);
 
-void bthost_add_rfcomm_channel_hook(struct bthost *bthost, uint16_t handle,
+void bthost_add_rfcomm_chan_hook(struct bthost *bthost, uint16_t handle,
 					uint8_t channel,
-					bthost_rfcomm_channel_hook_func_t func,
+					bthost_rfcomm_chan_hook_func_t func,
 					void *user_data);
 
 void bthost_send_rfcomm_data(struct bthost *bthost, uint16_t handle,
diff --git a/tools/rfcomm-tester.c b/tools/rfcomm-tester.c
index e8fbe1d..8be6e72 100644
--- a/tools/rfcomm-tester.c
+++ b/tools/rfcomm-tester.c
@@ -525,7 +525,7 @@ static void rfcomm_connect_cb(uint16_t handle, uint16_t cid,
 	struct bthost *bthost = hciemu_client_get_host(data->hciemu);
 
 	if (client_data->send_data)
-		bthost_add_rfcomm_channel_hook(bthost, handle,
+		bthost_add_rfcomm_chan_hook(bthost, handle,
 						client_data->client_channel,
 						client_hook_func, NULL);
 	else if (client_data->read_data)
@@ -670,7 +670,7 @@ static void client_new_conn(uint16_t handle, void *user_data)
 	struct bthost *bthost;
 
 	bthost = hciemu_client_get_host(data->hciemu);
-	bthost_add_rfcomm_channel_hook(bthost, handle,
+	bthost_add_rfcomm_chan_hook(bthost, handle,
 						server_data->client_channel,
 						server_hook_func, NULL);
 	bthost_connect_rfcomm(bthost, handle, server_data->client_channel,